diff options
Diffstat (limited to 'contrib/bind9/lib/dns/rdata')
106 files changed, 0 insertions, 18712 deletions
diff --git a/contrib/bind9/lib/dns/rdata/any_255/tsig_250.c b/contrib/bind9/lib/dns/rdata/any_255/tsig_250.c deleted file mode 100644 index 4fdadd3..0000000 --- a/contrib/bind9/lib/dns/rdata/any_255/tsig_250.c +++ /dev/null @@ -1,597 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: tsig_250.c,v 1.59.18.2 2005/03/20 22:34:32 marka Exp $ */ - -/* Reviewed: Thu Mar 16 13:39:43 PST 2000 by gson */ - -#ifndef RDATA_ANY_255_TSIG_250_C -#define RDATA_ANY_255_TSIG_250_C - -#define RRTYPE_TSIG_ATTRIBUTES \ - (DNS_RDATATYPEATTR_META | DNS_RDATATYPEATTR_NOTQUESTION) - -static inline isc_result_t -fromtext_any_tsig(ARGS_FROMTEXT) { - isc_token_t token; - dns_name_t name; - isc_uint64_t sigtime; - isc_buffer_t buffer; - dns_rcode_t rcode; - long i; - char *e; - - REQUIRE(type == 250); - REQUIRE(rdclass == 255); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(callbacks); - - /* - * Algorithm Name. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - dns_name_init(&name, NULL); - buffer_fromregion(&buffer, &token.value.as_region); - origin = (origin != NULL) ? origin : dns_rootname; - RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target)); - - /* - * Time Signed: 48 bits. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - sigtime = isc_string_touint64(DNS_AS_STR(token), &e, 10); - if (*e != 0) - RETTOK(DNS_R_SYNTAX); - if ((sigtime >> 48) != 0) - RETTOK(ISC_R_RANGE); - RETERR(uint16_tobuffer((isc_uint16_t)(sigtime >> 32), target)); - RETERR(uint32_tobuffer((isc_uint32_t)(sigtime & 0xffffffffU), target)); - - /* - * Fudge. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - if (token.value.as_ulong > 0xffffU) - RETTOK(ISC_R_RANGE); - RETERR(uint16_tobuffer(token.value.as_ulong, target)); - - /* - * Signature Size. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - if (token.value.as_ulong > 0xffffU) - RETTOK(ISC_R_RANGE); - RETERR(uint16_tobuffer(token.value.as_ulong, target)); - - /* - * Signature. - */ - RETERR(isc_base64_tobuffer(lexer, target, (int)token.value.as_ulong)); - - /* - * Original ID. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - if (token.value.as_ulong > 0xffffU) - RETTOK(ISC_R_RANGE); - RETERR(uint16_tobuffer(token.value.as_ulong, target)); - - /* - * Error. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - if (dns_tsigrcode_fromtext(&rcode, &token.value.as_textregion) - != ISC_R_SUCCESS) - { - i = strtol(DNS_AS_STR(token), &e, 10); - if (*e != 0) - RETTOK(DNS_R_UNKNOWN); - if (i < 0 || i > 0xffff) - RETTOK(ISC_R_RANGE); - rcode = (dns_rcode_t)i; - } - RETERR(uint16_tobuffer(rcode, target)); - - /* - * Other Len. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - if (token.value.as_ulong > 0xffffU) - RETTOK(ISC_R_RANGE); - RETERR(uint16_tobuffer(token.value.as_ulong, target)); - - /* - * Other Data. - */ - return (isc_base64_tobuffer(lexer, target, (int)token.value.as_ulong)); -} - -static inline isc_result_t -totext_any_tsig(ARGS_TOTEXT) { - isc_region_t sr; - isc_region_t sigr; - char buf[sizeof("281474976710655 ")]; - char *bufp; - dns_name_t name; - dns_name_t prefix; - isc_boolean_t sub; - isc_uint64_t sigtime; - unsigned short n; - - REQUIRE(rdata->type == 250); - REQUIRE(rdata->rdclass == 255); - REQUIRE(rdata->length != 0); - - dns_rdata_toregion(rdata, &sr); - /* - * Algorithm Name. - */ - dns_name_init(&name, NULL); - dns_name_init(&prefix, NULL); - dns_name_fromregion(&name, &sr); - sub = name_prefix(&name, tctx->origin, &prefix); - RETERR(dns_name_totext(&prefix, sub, target)); - RETERR(str_totext(" ", target)); - isc_region_consume(&sr, name_length(&name)); - - /* - * Time Signed. - */ - sigtime = ((isc_uint64_t)sr.base[0] << 40) | - ((isc_uint64_t)sr.base[1] << 32) | - ((isc_uint64_t)sr.base[2] << 24) | - ((isc_uint64_t)sr.base[3] << 16) | - ((isc_uint64_t)sr.base[4] << 8) | - (isc_uint64_t)sr.base[5]; - isc_region_consume(&sr, 6); - bufp = &buf[sizeof(buf) - 1]; - *bufp-- = 0; - *bufp-- = ' '; - do { - *bufp-- = decdigits[sigtime % 10]; - sigtime /= 10; - } while (sigtime != 0); - bufp++; - RETERR(str_totext(bufp, target)); - - /* - * Fudge. - */ - n = uint16_fromregion(&sr); - isc_region_consume(&sr, 2); - sprintf(buf, "%u ", n); - RETERR(str_totext(buf, target)); - - /* - * Signature Size. - */ - n = uint16_fromregion(&sr); - isc_region_consume(&sr, 2); - sprintf(buf, "%u", n); - RETERR(str_totext(buf, target)); - - /* - * Signature. - */ - REQUIRE(n <= sr.length); - sigr = sr; - sigr.length = n; - if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) - RETERR(str_totext(" (", target)); - RETERR(str_totext(tctx->linebreak, target)); - RETERR(isc_base64_totext(&sigr, tctx->width - 2, - tctx->linebreak, target)); - if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) - RETERR(str_totext(" ) ", target)); - else - RETERR(str_totext(" ", target)); - isc_region_consume(&sr, n); - - /* - * Original ID. - */ - n = uint16_fromregion(&sr); - isc_region_consume(&sr, 2); - sprintf(buf, "%u ", n); - RETERR(str_totext(buf, target)); - - /* - * Error. - */ - n = uint16_fromregion(&sr); - isc_region_consume(&sr, 2); - if (dns_tsigrcode_totext((dns_rcode_t)n, target) == ISC_R_SUCCESS) - RETERR(str_totext(" ", target)); - else { - sprintf(buf, "%u ", n); - RETERR(str_totext(buf, target)); - } - - /* - * Other Size. - */ - n = uint16_fromregion(&sr); - isc_region_consume(&sr, 2); - sprintf(buf, "%u ", n); - RETERR(str_totext(buf, target)); - - /* - * Other. - */ - return (isc_base64_totext(&sr, 60, " ", target)); -} - -static inline isc_result_t -fromwire_any_tsig(ARGS_FROMWIRE) { - isc_region_t sr; - dns_name_t name; - unsigned long n; - - REQUIRE(type == 250); - REQUIRE(rdclass == 255); - - UNUSED(type); - UNUSED(rdclass); - - dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE); - - /* - * Algorithm Name. - */ - dns_name_init(&name, NULL); - RETERR(dns_name_fromwire(&name, source, dctx, options, target)); - - isc_buffer_activeregion(source, &sr); - /* - * Time Signed + Fudge. - */ - if (sr.length < 8) - return (ISC_R_UNEXPECTEDEND); - RETERR(mem_tobuffer(target, sr.base, 8)); - isc_region_consume(&sr, 8); - isc_buffer_forward(source, 8); - - /* - * Signature Length + Signature. - */ - if (sr.length < 2) - return (ISC_R_UNEXPECTEDEND); - n = uint16_fromregion(&sr); - if (sr.length < n + 2) - return (ISC_R_UNEXPECTEDEND); - RETERR(mem_tobuffer(target, sr.base, n + 2)); - isc_region_consume(&sr, n + 2); - isc_buffer_forward(source, n + 2); - - /* - * Original ID + Error. - */ - if (sr.length < 4) - return (ISC_R_UNEXPECTEDEND); - RETERR(mem_tobuffer(target, sr.base, 4)); - isc_region_consume(&sr, 4); - isc_buffer_forward(source, 4); - - /* - * Other Length + Other. - */ - if (sr.length < 2) - return (ISC_R_UNEXPECTEDEND); - n = uint16_fromregion(&sr); - if (sr.length < n + 2) - return (ISC_R_UNEXPECTEDEND); - isc_buffer_forward(source, n + 2); - return (mem_tobuffer(target, sr.base, n + 2)); -} - -static inline isc_result_t -towire_any_tsig(ARGS_TOWIRE) { - isc_region_t sr; - dns_name_t name; - dns_offsets_t offsets; - - REQUIRE(rdata->type == 250); - REQUIRE(rdata->rdclass == 255); - REQUIRE(rdata->length != 0); - - dns_compress_setmethods(cctx, DNS_COMPRESS_NONE); - dns_rdata_toregion(rdata, &sr); - dns_name_init(&name, offsets); - dns_name_fromregion(&name, &sr); - RETERR(dns_name_towire(&name, cctx, target)); - isc_region_consume(&sr, name_length(&name)); - return (mem_tobuffer(target, sr.base, sr.length)); -} - -static inline int -compare_any_tsig(ARGS_COMPARE) { - isc_region_t r1; - isc_region_t r2; - dns_name_t name1; - dns_name_t name2; - int order; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 250); - REQUIRE(rdata1->rdclass == 255); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - dns_rdata_toregion(rdata1, &r1); - dns_rdata_toregion(rdata2, &r2); - dns_name_init(&name1, NULL); - dns_name_init(&name2, NULL); - dns_name_fromregion(&name1, &r1); - dns_name_fromregion(&name2, &r2); - order = dns_name_rdatacompare(&name1, &name2); - if (order != 0) - return (order); - isc_region_consume(&r1, name_length(&name1)); - isc_region_consume(&r2, name_length(&name2)); - return (isc_region_compare(&r1, &r2)); -} - -static inline isc_result_t -fromstruct_any_tsig(ARGS_FROMSTRUCT) { - dns_rdata_any_tsig_t *tsig = source; - isc_region_t tr; - - REQUIRE(type == 250); - REQUIRE(rdclass == 255); - REQUIRE(source != NULL); - REQUIRE(tsig->common.rdclass == rdclass); - REQUIRE(tsig->common.rdtype == type); - - UNUSED(type); - UNUSED(rdclass); - - /* - * Algorithm Name. - */ - RETERR(name_tobuffer(&tsig->algorithm, target)); - - isc_buffer_availableregion(target, &tr); - if (tr.length < 6 + 2 + 2) - return (ISC_R_NOSPACE); - - /* - * Time Signed: 48 bits. - */ - RETERR(uint16_tobuffer((isc_uint16_t)(tsig->timesigned >> 32), - target)); - RETERR(uint32_tobuffer((isc_uint32_t)(tsig->timesigned & 0xffffffffU), - target)); - - /* - * Fudge. - */ - RETERR(uint16_tobuffer(tsig->fudge, target)); - - /* - * Signature Size. - */ - RETERR(uint16_tobuffer(tsig->siglen, target)); - - /* - * Signature. - */ - RETERR(mem_tobuffer(target, tsig->signature, tsig->siglen)); - - isc_buffer_availableregion(target, &tr); - if (tr.length < 2 + 2 + 2) - return (ISC_R_NOSPACE); - - /* - * Original ID. - */ - RETERR(uint16_tobuffer(tsig->originalid, target)); - - /* - * Error. - */ - RETERR(uint16_tobuffer(tsig->error, target)); - - /* - * Other Len. - */ - RETERR(uint16_tobuffer(tsig->otherlen, target)); - - /* - * Other Data. - */ - return (mem_tobuffer(target, tsig->other, tsig->otherlen)); -} - -static inline isc_result_t -tostruct_any_tsig(ARGS_TOSTRUCT) { - dns_rdata_any_tsig_t *tsig; - dns_name_t alg; - isc_region_t sr; - - REQUIRE(rdata->type == 250); - REQUIRE(rdata->rdclass == 255); - REQUIRE(rdata->length != 0); - - tsig = (dns_rdata_any_tsig_t *) target; - tsig->common.rdclass = rdata->rdclass; - tsig->common.rdtype = rdata->type; - ISC_LINK_INIT(&tsig->common, link); - - dns_rdata_toregion(rdata, &sr); - - /* - * Algorithm Name. - */ - dns_name_init(&alg, NULL); - dns_name_fromregion(&alg, &sr); - dns_name_init(&tsig->algorithm, NULL); - RETERR(name_duporclone(&alg, mctx, &tsig->algorithm)); - - isc_region_consume(&sr, name_length(&tsig->algorithm)); - - /* - * Time Signed. - */ - INSIST(sr.length >= 6); - tsig->timesigned = ((isc_uint64_t)sr.base[0] << 40) | - ((isc_uint64_t)sr.base[1] << 32) | - ((isc_uint64_t)sr.base[2] << 24) | - ((isc_uint64_t)sr.base[3] << 16) | - ((isc_uint64_t)sr.base[4] << 8) | - (isc_uint64_t)sr.base[5]; - isc_region_consume(&sr, 6); - - /* - * Fudge. - */ - tsig->fudge = uint16_fromregion(&sr); - isc_region_consume(&sr, 2); - - /* - * Signature Size. - */ - tsig->siglen = uint16_fromregion(&sr); - isc_region_consume(&sr, 2); - - /* - * Signature. - */ - INSIST(sr.length >= tsig->siglen); - tsig->signature = mem_maybedup(mctx, sr.base, tsig->siglen); - if (tsig->signature == NULL) - goto cleanup; - isc_region_consume(&sr, tsig->siglen); - - /* - * Original ID. - */ - tsig->originalid = uint16_fromregion(&sr); - isc_region_consume(&sr, 2); - - /* - * Error. - */ - tsig->error = uint16_fromregion(&sr); - isc_region_consume(&sr, 2); - - /* - * Other Size. - */ - tsig->otherlen = uint16_fromregion(&sr); - isc_region_consume(&sr, 2); - - /* - * Other. - */ - INSIST(sr.length == tsig->otherlen); - tsig->other = mem_maybedup(mctx, sr.base, tsig->otherlen); - if (tsig->other == NULL) - goto cleanup; - - tsig->mctx = mctx; - return (ISC_R_SUCCESS); - - cleanup: - if (mctx != NULL) - dns_name_free(&tsig->algorithm, tsig->mctx); - if (mctx != NULL && tsig->signature != NULL) - isc_mem_free(mctx, tsig->signature); - return (ISC_R_NOMEMORY); -} - -static inline void -freestruct_any_tsig(ARGS_FREESTRUCT) { - dns_rdata_any_tsig_t *tsig = (dns_rdata_any_tsig_t *) source; - - REQUIRE(source != NULL); - REQUIRE(tsig->common.rdclass == 255); - REQUIRE(tsig->common.rdtype == 250); - - if (tsig->mctx == NULL) - return; - - dns_name_free(&tsig->algorithm, tsig->mctx); - if (tsig->signature != NULL) - isc_mem_free(tsig->mctx, tsig->signature); - if (tsig->other != NULL) - isc_mem_free(tsig->mctx, tsig->other); - tsig->mctx = NULL; -} - -static inline isc_result_t -additionaldata_any_tsig(ARGS_ADDLDATA) { - REQUIRE(rdata->type == 250); - REQUIRE(rdata->rdclass == 255); - - UNUSED(rdata); - UNUSED(add); - UNUSED(arg); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_any_tsig(ARGS_DIGEST) { - - REQUIRE(rdata->type == 250); - REQUIRE(rdata->rdclass == 255); - - UNUSED(rdata); - UNUSED(digest); - UNUSED(arg); - - return (ISC_R_NOTIMPLEMENTED); -} - -static inline isc_boolean_t -checkowner_any_tsig(ARGS_CHECKOWNER) { - - REQUIRE(type == 250); - REQUIRE(rdclass == 255); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_any_tsig(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 250); - REQUIRE(rdata->rdclass == 250); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_ANY_255_TSIG_250_C */ diff --git a/contrib/bind9/lib/dns/rdata/any_255/tsig_250.h b/contrib/bind9/lib/dns/rdata/any_255/tsig_250.h deleted file mode 100644 index b84a715..0000000 --- a/contrib/bind9/lib/dns/rdata/any_255/tsig_250.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: tsig_250.h,v 1.21.18.2 2005/04/29 00:16:29 marka Exp $ */ - -#ifndef ANY_255_TSIG_250_H -#define ANY_255_TSIG_250_H 1 - -/*% RFC2845 */ -typedef struct dns_rdata_any_tsig { - dns_rdatacommon_t common; - isc_mem_t * mctx; - dns_name_t algorithm; - isc_uint64_t timesigned; - isc_uint16_t fudge; - isc_uint16_t siglen; - unsigned char * signature; - isc_uint16_t originalid; - isc_uint16_t error; - isc_uint16_t otherlen; - unsigned char * other; -} dns_rdata_any_tsig_t; - -#endif /* ANY_255_TSIG_250_H */ diff --git a/contrib/bind9/lib/dns/rdata/ch_3/a_1.c b/contrib/bind9/lib/dns/rdata/ch_3/a_1.c deleted file mode 100644 index 6a9b70c..0000000 --- a/contrib/bind9/lib/dns/rdata/ch_3/a_1.c +++ /dev/null @@ -1,316 +0,0 @@ -/* - * Copyright (C) 2005 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: a_1.c,v 1.2.2.3 2005/08/23 04:10:09 marka Exp $ */ - -/* by Bjorn.Victor@it.uu.se, 2005-05-07 */ -/* Based on generic/soa_6.c and generic/mx_15.c */ - -#ifndef RDATA_CH_3_A_1_C -#define RDATA_CH_3_A_1_C - -#include <isc/net.h> - -#define RRTYPE_A_ATTRIBUTES (0) - -static inline isc_result_t -fromtext_ch_a(ARGS_FROMTEXT) { - isc_token_t token; - dns_name_t name; - isc_buffer_t buffer; - - REQUIRE(type == 1); - REQUIRE(rdclass == dns_rdataclass_ch); /* 3 */ - - UNUSED(type); - UNUSED(callbacks); - - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - - /* get domain name */ - dns_name_init(&name, NULL); - buffer_fromregion(&buffer, &token.value.as_region); - origin = (origin != NULL) ? origin : dns_rootname; - RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target)); - if ((options & DNS_RDATA_CHECKNAMES) != 0 && - (options & DNS_RDATA_CHECKREVERSE) != 0) { - isc_boolean_t ok; - ok = dns_name_ishostname(&name, ISC_FALSE); - if (!ok && (options & DNS_RDATA_CHECKNAMESFAIL) != 0) - RETTOK(DNS_R_BADNAME); - if (!ok && callbacks != NULL) - warn_badname(&name, lexer, callbacks); - } - - /* 16-bit octal address */ - RETERR(isc_lex_getoctaltoken(lexer, &token, ISC_FALSE)); - if (token.value.as_ulong > 0xffffU) - RETTOK(ISC_R_RANGE); - return (uint16_tobuffer(token.value.as_ulong, target)); -} - -static inline isc_result_t -totext_ch_a(ARGS_TOTEXT) { - isc_region_t region; - dns_name_t name; - dns_name_t prefix; - isc_boolean_t sub; - char buf[sizeof("0177777")]; - isc_uint16_t addr; - - REQUIRE(rdata->type == 1); - REQUIRE(rdata->rdclass == dns_rdataclass_ch); /* 3 */ - REQUIRE(rdata->length != 0); - - dns_name_init(&name, NULL); - dns_name_init(&prefix, NULL); - - dns_rdata_toregion(rdata, ®ion); - dns_name_fromregion(&name, ®ion); - isc_region_consume(®ion, name_length(&name)); - addr = uint16_fromregion(®ion); - - sub = name_prefix(&name, tctx->origin, &prefix); - RETERR(dns_name_totext(&prefix, sub, target)); - - sprintf(buf, "%o", addr); /* note octal */ - RETERR(str_totext(" ", target)); - return (str_totext(buf, target)); -} - -static inline isc_result_t -fromwire_ch_a(ARGS_FROMWIRE) { - isc_region_t sregion; - isc_region_t tregion; - dns_name_t name; - - REQUIRE(type == 1); - REQUIRE(rdclass == dns_rdataclass_ch); - - UNUSED(type); - UNUSED(rdclass); - - dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14); - - dns_name_init(&name, NULL); - - RETERR(dns_name_fromwire(&name, source, dctx, options, target)); - - isc_buffer_activeregion(source, &sregion); - isc_buffer_availableregion(target, &tregion); - if (sregion.length < 2) - return (ISC_R_UNEXPECTEDEND); - if (tregion.length < 2) - return (ISC_R_NOSPACE); - - memcpy(tregion.base, sregion.base, 2); - isc_buffer_forward(source, 2); - isc_buffer_add(target, 2); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -towire_ch_a(ARGS_TOWIRE) { - dns_name_t name; - dns_offsets_t offsets; - isc_region_t sregion; - isc_region_t tregion; - - REQUIRE(rdata->type == 1); - REQUIRE(rdata->rdclass == dns_rdataclass_ch); - REQUIRE(rdata->length != 0); - - dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14); - - dns_name_init(&name, offsets); - - dns_rdata_toregion(rdata, &sregion); - - dns_name_fromregion(&name, &sregion); - isc_region_consume(&sregion, name_length(&name)); - RETERR(dns_name_towire(&name, cctx, target)); - - isc_buffer_availableregion(target, &tregion); - if (tregion.length < 2) - return (ISC_R_NOSPACE); - - memcpy(tregion.base, sregion.base, 2); - isc_buffer_add(target, 2); - return (ISC_R_SUCCESS); -} - -static inline int -compare_ch_a(ARGS_COMPARE) { - dns_name_t name1; - dns_name_t name2; - isc_region_t region1; - isc_region_t region2; - int order; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 1); - REQUIRE(rdata1->rdclass == dns_rdataclass_ch); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - dns_name_init(&name1, NULL); - dns_name_init(&name2, NULL); - - dns_rdata_toregion(rdata1, ®ion1); - dns_rdata_toregion(rdata2, ®ion2); - - dns_name_fromregion(&name1, ®ion1); - dns_name_fromregion(&name2, ®ion2); - isc_region_consume(®ion1, name_length(&name1)); - isc_region_consume(®ion2, name_length(&name2)); - - order = dns_name_rdatacompare(&name1, &name2); - if (order != 0) - return (order); - - order = memcmp(rdata1->data, rdata2->data, 2); - if (order != 0) - order = (order < 0) ? -1 : 1; - return (order); -} - -static inline isc_result_t -fromstruct_ch_a(ARGS_FROMSTRUCT) { - dns_rdata_ch_a_t *a = source; - isc_region_t region; - - REQUIRE(type == 1); - REQUIRE(source != NULL); - REQUIRE(a->common.rdtype == type); - REQUIRE(a->common.rdclass == rdclass); - - UNUSED(type); - UNUSED(rdclass); - - dns_name_toregion(&a->ch_addr_dom, ®ion); - RETERR(isc_buffer_copyregion(target, ®ion)); - - return (uint16_tobuffer(ntohs(a->ch_addr), target)); -} - -static inline isc_result_t -tostruct_ch_a(ARGS_TOSTRUCT) { - dns_rdata_ch_a_t *a = target; - isc_region_t region; - dns_name_t name; - - REQUIRE(rdata->type == 1); - REQUIRE(rdata->rdclass == dns_rdataclass_ch); - REQUIRE(rdata->length != 0); - - a->common.rdclass = rdata->rdclass; - a->common.rdtype = rdata->type; - ISC_LINK_INIT(&a->common, link); - - dns_rdata_toregion(rdata, ®ion); - - dns_name_init(&name, NULL); - dns_name_fromregion(&name, ®ion); - isc_region_consume(®ion, name_length(&name)); - - dns_name_init(&a->ch_addr_dom, NULL); - RETERR(name_duporclone(&name, mctx, &a->ch_addr_dom)); - a->ch_addr = htons(uint16_fromregion(®ion)); - a->mctx = mctx; - return (ISC_R_SUCCESS); -} - -static inline void -freestruct_ch_a(ARGS_FREESTRUCT) { - dns_rdata_ch_a_t *a = source; - - REQUIRE(source != NULL); - REQUIRE(a->common.rdtype == 1); - - if (a->mctx == NULL) - return; - - dns_name_free(&a->ch_addr_dom, a->mctx); - a->mctx = NULL; -} - -static inline isc_result_t -additionaldata_ch_a(ARGS_ADDLDATA) { - - REQUIRE(rdata->type == 1); - REQUIRE(rdata->rdclass == dns_rdataclass_ch); - - UNUSED(rdata); - UNUSED(add); - UNUSED(arg); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_ch_a(ARGS_DIGEST) { - isc_region_t r; - - dns_name_t name; - - REQUIRE(rdata->type == 1); - REQUIRE(rdata->rdclass == dns_rdataclass_ch); - - dns_rdata_toregion(rdata, &r); - dns_name_init(&name, NULL); - dns_name_fromregion(&name, &r); - isc_region_consume(&r, name_length(&name)); - RETERR(dns_name_digest(&name, digest, arg)); - return ((digest)(arg, &r)); -} - -static inline isc_boolean_t -checkowner_ch_a(ARGS_CHECKOWNER) { - - REQUIRE(type == 1); - REQUIRE(rdclass == dns_rdataclass_ch); - - UNUSED(type); - - return (dns_name_ishostname(name, wildcard)); -} - -static inline isc_boolean_t -checknames_ch_a(ARGS_CHECKNAMES) { - isc_region_t region; - dns_name_t name; - - REQUIRE(rdata->type == 1); - REQUIRE(rdata->rdclass == dns_rdataclass_ch); - - UNUSED(owner); - - dns_rdata_toregion(rdata, ®ion); - dns_name_init(&name, NULL); - dns_name_fromregion(&name, ®ion); - if (!dns_name_ishostname(&name, ISC_FALSE)) { - if (bad != NULL) - dns_name_clone(&name, bad); - return (ISC_FALSE); - } - - return (ISC_TRUE); -} - -#endif /* RDATA_CH_3_A_1_C */ diff --git a/contrib/bind9/lib/dns/rdata/ch_3/a_1.h b/contrib/bind9/lib/dns/rdata/ch_3/a_1.h deleted file mode 100644 index 9f67977..0000000 --- a/contrib/bind9/lib/dns/rdata/ch_3/a_1.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2005 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: a_1.h,v 1.2.2.2 2005/06/05 00:02:22 marka Exp $ */ - -/* by Bjorn.Victor@it.uu.se, 2005-05-07 */ -/* Based on generic/mx_15.h */ - -#ifndef CH_3_A_1_H -#define CH_3_A_1_H 1 - -typedef isc_uint16_t ch_addr_t; - -typedef struct dns_rdata_ch_a { - dns_rdatacommon_t common; - isc_mem_t *mctx; - dns_name_t ch_addr_dom; /* ch-addr domain for back mapping */ - ch_addr_t ch_addr; /* chaos address (16 bit) network order */ -} dns_rdata_ch_a_t; - -#endif /* CH_3_A_1_H */ diff --git a/contrib/bind9/lib/dns/rdata/generic/afsdb_18.c b/contrib/bind9/lib/dns/rdata/generic/afsdb_18.c deleted file mode 100644 index 24a63e6..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/afsdb_18.c +++ /dev/null @@ -1,309 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001, 2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: afsdb_18.c,v 1.43.18.2 2005/04/29 00:16:30 marka Exp $ */ - -/* Reviewed: Wed Mar 15 14:59:00 PST 2000 by explorer */ - -/* RFC1183 */ - -#ifndef RDATA_GENERIC_AFSDB_18_C -#define RDATA_GENERIC_AFSDB_18_C - -#define RRTYPE_AFSDB_ATTRIBUTES (0) - -static inline isc_result_t -fromtext_afsdb(ARGS_FROMTEXT) { - isc_token_t token; - isc_buffer_t buffer; - dns_name_t name; - isc_boolean_t ok; - - REQUIRE(type == 18); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(callbacks); - - /* - * Subtype. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - if (token.value.as_ulong > 0xffffU) - RETTOK(ISC_R_RANGE); - RETERR(uint16_tobuffer(token.value.as_ulong, target)); - - /* - * Hostname. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - dns_name_init(&name, NULL); - buffer_fromregion(&buffer, &token.value.as_region); - origin = (origin != NULL) ? origin : dns_rootname; - RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target)); - ok = ISC_TRUE; - if ((options & DNS_RDATA_CHECKNAMES) != 0) - ok = dns_name_ishostname(&name, ISC_FALSE); - if (!ok && (options & DNS_RDATA_CHECKNAMESFAIL) != 0) - RETTOK(DNS_R_BADNAME); - if (!ok && callbacks != NULL) - warn_badname(&name, lexer, callbacks); - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -totext_afsdb(ARGS_TOTEXT) { - dns_name_t name; - dns_name_t prefix; - isc_region_t region; - char buf[sizeof("64000 ")]; - isc_boolean_t sub; - unsigned int num; - - REQUIRE(rdata->type == 18); - REQUIRE(rdata->length != 0); - - dns_name_init(&name, NULL); - dns_name_init(&prefix, NULL); - - dns_rdata_toregion(rdata, ®ion); - num = uint16_fromregion(®ion); - isc_region_consume(®ion, 2); - sprintf(buf, "%u ", num); - RETERR(str_totext(buf, target)); - dns_name_fromregion(&name, ®ion); - sub = name_prefix(&name, tctx->origin, &prefix); - return (dns_name_totext(&prefix, sub, target)); -} - -static inline isc_result_t -fromwire_afsdb(ARGS_FROMWIRE) { - dns_name_t name; - isc_region_t sr; - isc_region_t tr; - - REQUIRE(type == 18); - - UNUSED(type); - UNUSED(rdclass); - - dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE); - - dns_name_init(&name, NULL); - - isc_buffer_activeregion(source, &sr); - isc_buffer_availableregion(target, &tr); - if (tr.length < 2) - return (ISC_R_NOSPACE); - if (sr.length < 2) - return (ISC_R_UNEXPECTEDEND); - memcpy(tr.base, sr.base, 2); - isc_buffer_forward(source, 2); - isc_buffer_add(target, 2); - return (dns_name_fromwire(&name, source, dctx, options, target)); -} - -static inline isc_result_t -towire_afsdb(ARGS_TOWIRE) { - isc_region_t tr; - isc_region_t sr; - dns_name_t name; - dns_offsets_t offsets; - - REQUIRE(rdata->type == 18); - REQUIRE(rdata->length != 0); - - dns_compress_setmethods(cctx, DNS_COMPRESS_NONE); - isc_buffer_availableregion(target, &tr); - dns_rdata_toregion(rdata, &sr); - if (tr.length < 2) - return (ISC_R_NOSPACE); - memcpy(tr.base, sr.base, 2); - isc_region_consume(&sr, 2); - isc_buffer_add(target, 2); - - dns_name_init(&name, offsets); - dns_name_fromregion(&name, &sr); - - return (dns_name_towire(&name, cctx, target)); -} - -static inline int -compare_afsdb(ARGS_COMPARE) { - int result; - dns_name_t name1; - dns_name_t name2; - isc_region_t region1; - isc_region_t region2; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 18); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - result = memcmp(rdata1->data, rdata2->data, 2); - if (result != 0) - return (result < 0 ? -1 : 1); - - dns_name_init(&name1, NULL); - dns_name_init(&name2, NULL); - - dns_rdata_toregion(rdata1, ®ion1); - dns_rdata_toregion(rdata2, ®ion2); - - isc_region_consume(®ion1, 2); - isc_region_consume(®ion2, 2); - - dns_name_fromregion(&name1, ®ion1); - dns_name_fromregion(&name2, ®ion2); - - return (dns_name_rdatacompare(&name1, &name2)); -} - -static inline isc_result_t -fromstruct_afsdb(ARGS_FROMSTRUCT) { - dns_rdata_afsdb_t *afsdb = source; - isc_region_t region; - - REQUIRE(type == 18); - REQUIRE(source != NULL); - REQUIRE(afsdb->common.rdclass == rdclass); - REQUIRE(afsdb->common.rdtype == type); - - UNUSED(type); - UNUSED(rdclass); - - RETERR(uint16_tobuffer(afsdb->subtype, target)); - dns_name_toregion(&afsdb->server, ®ion); - return (isc_buffer_copyregion(target, ®ion)); -} - -static inline isc_result_t -tostruct_afsdb(ARGS_TOSTRUCT) { - isc_region_t region; - dns_rdata_afsdb_t *afsdb = target; - dns_name_t name; - - REQUIRE(rdata->type == 18); - REQUIRE(target != NULL); - REQUIRE(rdata->length != 0); - - afsdb->common.rdclass = rdata->rdclass; - afsdb->common.rdtype = rdata->type; - ISC_LINK_INIT(&afsdb->common, link); - - dns_name_init(&afsdb->server, NULL); - - dns_rdata_toregion(rdata, ®ion); - - afsdb->subtype = uint16_fromregion(®ion); - isc_region_consume(®ion, 2); - - dns_name_init(&name, NULL); - dns_name_fromregion(&name, ®ion); - - RETERR(name_duporclone(&name, mctx, &afsdb->server)); - afsdb->mctx = mctx; - return (ISC_R_SUCCESS); -} - -static inline void -freestruct_afsdb(ARGS_FREESTRUCT) { - dns_rdata_afsdb_t *afsdb = source; - - REQUIRE(source != NULL); - REQUIRE(afsdb->common.rdtype == 18); - - if (afsdb->mctx == NULL) - return; - - dns_name_free(&afsdb->server, afsdb->mctx); - afsdb->mctx = NULL; -} - -static inline isc_result_t -additionaldata_afsdb(ARGS_ADDLDATA) { - dns_name_t name; - dns_offsets_t offsets; - isc_region_t region; - - REQUIRE(rdata->type == 18); - - dns_name_init(&name, offsets); - dns_rdata_toregion(rdata, ®ion); - isc_region_consume(®ion, 2); - dns_name_fromregion(&name, ®ion); - - return ((add)(arg, &name, dns_rdatatype_a)); -} - -static inline isc_result_t -digest_afsdb(ARGS_DIGEST) { - isc_region_t r1, r2; - dns_name_t name; - - REQUIRE(rdata->type == 18); - - dns_rdata_toregion(rdata, &r1); - r2 = r1; - isc_region_consume(&r2, 2); - r1.length = 2; - RETERR((digest)(arg, &r1)); - dns_name_init(&name, NULL); - dns_name_fromregion(&name, &r2); - - return (dns_name_digest(&name, digest, arg)); -} - -static inline isc_boolean_t -checkowner_afsdb(ARGS_CHECKOWNER) { - - REQUIRE(type == 18); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_afsdb(ARGS_CHECKNAMES) { - isc_region_t region; - dns_name_t name; - - REQUIRE(rdata->type == 18); - - UNUSED(owner); - - dns_rdata_toregion(rdata, ®ion); - isc_region_consume(®ion, 2); - dns_name_init(&name, NULL); - dns_name_fromregion(&name, ®ion); - if (!dns_name_ishostname(&name, ISC_FALSE)) { - if (bad != NULL) - dns_name_clone(&name, bad); - return (ISC_FALSE); - } - return (ISC_TRUE); -} - -#endif /* RDATA_GENERIC_AFSDB_18_C */ diff --git a/contrib/bind9/lib/dns/rdata/generic/afsdb_18.h b/contrib/bind9/lib/dns/rdata/generic/afsdb_18.h deleted file mode 100644 index 1532da1..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/afsdb_18.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef GENERIC_AFSDB_18_H -#define GENERIC_AFSDB_18_H 1 - -/* $Id: afsdb_18.h,v 1.16.18.2 2005/04/29 00:16:30 marka Exp $ */ - -/*! - * \brief Per RFC1183 */ - -typedef struct dns_rdata_afsdb { - dns_rdatacommon_t common; - isc_mem_t *mctx; - isc_uint16_t subtype; - dns_name_t server; -} dns_rdata_afsdb_t; - -#endif /* GENERIC_AFSDB_18_H */ - diff --git a/contrib/bind9/lib/dns/rdata/generic/cert_37.c b/contrib/bind9/lib/dns/rdata/generic/cert_37.c deleted file mode 100644 index c6ba3a8..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/cert_37.c +++ /dev/null @@ -1,280 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: cert_37.c,v 1.46.18.2 2005/04/29 00:16:30 marka Exp $ */ - -/* Reviewed: Wed Mar 15 21:14:32 EST 2000 by tale */ - -/* RFC2538 */ - -#ifndef RDATA_GENERIC_CERT_37_C -#define RDATA_GENERIC_CERT_37_C - -#define RRTYPE_CERT_ATTRIBUTES (0) - -static inline isc_result_t -fromtext_cert(ARGS_FROMTEXT) { - isc_token_t token; - dns_secalg_t secalg; - dns_cert_t cert; - - REQUIRE(type == 37); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(origin); - UNUSED(options); - UNUSED(callbacks); - - /* - * Cert type. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - RETTOK(dns_cert_fromtext(&cert, &token.value.as_textregion)); - RETERR(uint16_tobuffer(cert, target)); - - /* - * Key tag. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - if (token.value.as_ulong > 0xffffU) - RETTOK(ISC_R_RANGE); - RETERR(uint16_tobuffer(token.value.as_ulong, target)); - - /* - * Algorithm. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - RETTOK(dns_secalg_fromtext(&secalg, &token.value.as_textregion)); - RETERR(mem_tobuffer(target, &secalg, 1)); - - return (isc_base64_tobuffer(lexer, target, -1)); -} - -static inline isc_result_t -totext_cert(ARGS_TOTEXT) { - isc_region_t sr; - char buf[sizeof("64000 ")]; - unsigned int n; - - REQUIRE(rdata->type == 37); - REQUIRE(rdata->length != 0); - - UNUSED(tctx); - - dns_rdata_toregion(rdata, &sr); - - /* - * Type. - */ - n = uint16_fromregion(&sr); - isc_region_consume(&sr, 2); - RETERR(dns_cert_totext((dns_cert_t)n, target)); - RETERR(str_totext(" ", target)); - - /* - * Key tag. - */ - n = uint16_fromregion(&sr); - isc_region_consume(&sr, 2); - sprintf(buf, "%u ", n); - RETERR(str_totext(buf, target)); - - /* - * Algorithm. - */ - RETERR(dns_secalg_totext(sr.base[0], target)); - isc_region_consume(&sr, 1); - - /* - * Cert. - */ - if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) - RETERR(str_totext(" (", target)); - RETERR(str_totext(tctx->linebreak, target)); - RETERR(isc_base64_totext(&sr, tctx->width - 2, - tctx->linebreak, target)); - if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) - RETERR(str_totext(" )", target)); - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -fromwire_cert(ARGS_FROMWIRE) { - isc_region_t sr; - - REQUIRE(type == 37); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(dctx); - UNUSED(options); - - isc_buffer_activeregion(source, &sr); - if (sr.length < 5) - return (ISC_R_UNEXPECTEDEND); - - isc_buffer_forward(source, sr.length); - return (mem_tobuffer(target, sr.base, sr.length)); -} - -static inline isc_result_t -towire_cert(ARGS_TOWIRE) { - isc_region_t sr; - - REQUIRE(rdata->type == 37); - REQUIRE(rdata->length != 0); - - UNUSED(cctx); - - dns_rdata_toregion(rdata, &sr); - return (mem_tobuffer(target, sr.base, sr.length)); -} - -static inline int -compare_cert(ARGS_COMPARE) { - isc_region_t r1; - isc_region_t r2; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 37); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - dns_rdata_toregion(rdata1, &r1); - dns_rdata_toregion(rdata2, &r2); - return (isc_region_compare(&r1, &r2)); -} - -static inline isc_result_t -fromstruct_cert(ARGS_FROMSTRUCT) { - dns_rdata_cert_t *cert = source; - - REQUIRE(type == 37); - REQUIRE(source != NULL); - REQUIRE(cert->common.rdtype == type); - REQUIRE(cert->common.rdclass == rdclass); - - UNUSED(type); - UNUSED(rdclass); - - RETERR(uint16_tobuffer(cert->type, target)); - RETERR(uint16_tobuffer(cert->key_tag, target)); - RETERR(uint8_tobuffer(cert->algorithm, target)); - - return (mem_tobuffer(target, cert->certificate, cert->length)); -} - -static inline isc_result_t -tostruct_cert(ARGS_TOSTRUCT) { - dns_rdata_cert_t *cert = target; - isc_region_t region; - - REQUIRE(rdata->type == 37); - REQUIRE(target != NULL); - REQUIRE(rdata->length != 0); - - cert->common.rdclass = rdata->rdclass; - cert->common.rdtype = rdata->type; - ISC_LINK_INIT(&cert->common, link); - - dns_rdata_toregion(rdata, ®ion); - - cert->type = uint16_fromregion(®ion); - isc_region_consume(®ion, 2); - cert->key_tag = uint16_fromregion(®ion); - isc_region_consume(®ion, 2); - cert->algorithm = uint8_fromregion(®ion); - isc_region_consume(®ion, 1); - cert->length = region.length; - - cert->certificate = mem_maybedup(mctx, region.base, region.length); - if (cert->certificate == NULL) - return (ISC_R_NOMEMORY); - - cert->mctx = mctx; - return (ISC_R_SUCCESS); -} - -static inline void -freestruct_cert(ARGS_FREESTRUCT) { - dns_rdata_cert_t *cert = source; - - REQUIRE(cert != NULL); - REQUIRE(cert->common.rdtype == 37); - - if (cert->mctx == NULL) - return; - - if (cert->certificate != NULL) - isc_mem_free(cert->mctx, cert->certificate); - cert->mctx = NULL; -} - -static inline isc_result_t -additionaldata_cert(ARGS_ADDLDATA) { - REQUIRE(rdata->type == 37); - - UNUSED(rdata); - UNUSED(add); - UNUSED(arg); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_cert(ARGS_DIGEST) { - isc_region_t r; - - REQUIRE(rdata->type == 37); - - dns_rdata_toregion(rdata, &r); - - return ((digest)(arg, &r)); -} - -static inline isc_boolean_t -checkowner_cert(ARGS_CHECKOWNER) { - - REQUIRE(type == 37); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_cert(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 37); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_GENERIC_CERT_37_C */ - diff --git a/contrib/bind9/lib/dns/rdata/generic/cert_37.h b/contrib/bind9/lib/dns/rdata/generic/cert_37.h deleted file mode 100644 index 2af25b7..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/cert_37.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: cert_37.h,v 1.16.18.2 2005/04/29 00:16:31 marka Exp $ */ - -#ifndef GENERIC_CERT_37_H -#define GENERIC_CERT_37_H 1 - -/*% RFC2538 */ -typedef struct dns_rdata_cert { - dns_rdatacommon_t common; - isc_mem_t *mctx; - isc_uint16_t type; - isc_uint16_t key_tag; - isc_uint8_t algorithm; - isc_uint16_t length; - unsigned char *certificate; -} dns_rdata_cert_t; - -#endif /* GENERIC_CERT_37_H */ diff --git a/contrib/bind9/lib/dns/rdata/generic/cname_5.c b/contrib/bind9/lib/dns/rdata/generic/cname_5.c deleted file mode 100644 index 6ea1db1..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/cname_5.c +++ /dev/null @@ -1,232 +0,0 @@ -/* - * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: cname_5.c,v 1.45 2004/03/05 05:10:10 marka Exp $ */ - -/* reviewed: Wed Mar 15 16:48:45 PST 2000 by brister */ - -#ifndef RDATA_GENERIC_CNAME_5_C -#define RDATA_GENERIC_CNAME_5_C - -#define RRTYPE_CNAME_ATTRIBUTES \ - (DNS_RDATATYPEATTR_EXCLUSIVE | DNS_RDATATYPEATTR_SINGLETON) - -static inline isc_result_t -fromtext_cname(ARGS_FROMTEXT) { - isc_token_t token; - dns_name_t name; - isc_buffer_t buffer; - - REQUIRE(type == 5); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(callbacks); - - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - - dns_name_init(&name, NULL); - buffer_fromregion(&buffer, &token.value.as_region); - origin = (origin != NULL) ? origin : dns_rootname; - RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target)); - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -totext_cname(ARGS_TOTEXT) { - isc_region_t region; - dns_name_t name; - dns_name_t prefix; - isc_boolean_t sub; - - REQUIRE(rdata->type == 5); - REQUIRE(rdata->length != 0); - - dns_name_init(&name, NULL); - dns_name_init(&prefix, NULL); - - dns_rdata_toregion(rdata, ®ion); - dns_name_fromregion(&name, ®ion); - - sub = name_prefix(&name, tctx->origin, &prefix); - - return (dns_name_totext(&prefix, sub, target)); -} - -static inline isc_result_t -fromwire_cname(ARGS_FROMWIRE) { - dns_name_t name; - - REQUIRE(type == 5); - - UNUSED(type); - UNUSED(rdclass); - - dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14); - - dns_name_init(&name, NULL); - return (dns_name_fromwire(&name, source, dctx, options, target)); -} - -static inline isc_result_t -towire_cname(ARGS_TOWIRE) { - dns_name_t name; - dns_offsets_t offsets; - isc_region_t region; - - REQUIRE(rdata->type == 5); - REQUIRE(rdata->length != 0); - - dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14); - - dns_name_init(&name, offsets); - dns_rdata_toregion(rdata, ®ion); - dns_name_fromregion(&name, ®ion); - - return (dns_name_towire(&name, cctx, target)); -} - -static inline int -compare_cname(ARGS_COMPARE) { - dns_name_t name1; - dns_name_t name2; - isc_region_t region1; - isc_region_t region2; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 5); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - dns_name_init(&name1, NULL); - dns_name_init(&name2, NULL); - - dns_rdata_toregion(rdata1, ®ion1); - dns_rdata_toregion(rdata2, ®ion2); - - dns_name_fromregion(&name1, ®ion1); - dns_name_fromregion(&name2, ®ion2); - - return (dns_name_rdatacompare(&name1, &name2)); -} - -static inline isc_result_t -fromstruct_cname(ARGS_FROMSTRUCT) { - dns_rdata_cname_t *cname = source; - isc_region_t region; - - REQUIRE(type == 5); - REQUIRE(source != NULL); - REQUIRE(cname->common.rdtype == type); - REQUIRE(cname->common.rdclass == rdclass); - - UNUSED(type); - UNUSED(rdclass); - - dns_name_toregion(&cname->cname, ®ion); - return (isc_buffer_copyregion(target, ®ion)); -} - -static inline isc_result_t -tostruct_cname(ARGS_TOSTRUCT) { - isc_region_t region; - dns_rdata_cname_t *cname = target; - dns_name_t name; - - REQUIRE(rdata->type == 5); - REQUIRE(target != NULL); - REQUIRE(rdata->length != 0); - - cname->common.rdclass = rdata->rdclass; - cname->common.rdtype = rdata->type; - ISC_LINK_INIT(&cname->common, link); - - dns_name_init(&name, NULL); - dns_rdata_toregion(rdata, ®ion); - dns_name_fromregion(&name, ®ion); - dns_name_init(&cname->cname, NULL); - RETERR(name_duporclone(&name, mctx, &cname->cname)); - cname->mctx = mctx; - return (ISC_R_SUCCESS); -} - -static inline void -freestruct_cname(ARGS_FREESTRUCT) { - dns_rdata_cname_t *cname = source; - - REQUIRE(source != NULL); - - if (cname->mctx == NULL) - return; - - dns_name_free(&cname->cname, cname->mctx); - cname->mctx = NULL; -} - -static inline isc_result_t -additionaldata_cname(ARGS_ADDLDATA) { - UNUSED(rdata); - UNUSED(add); - UNUSED(arg); - - REQUIRE(rdata->type == 5); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_cname(ARGS_DIGEST) { - isc_region_t r; - dns_name_t name; - - REQUIRE(rdata->type == 5); - - dns_rdata_toregion(rdata, &r); - dns_name_init(&name, NULL); - dns_name_fromregion(&name, &r); - - return (dns_name_digest(&name, digest, arg)); -} - -static inline isc_boolean_t -checkowner_cname(ARGS_CHECKOWNER) { - - REQUIRE(type == 5); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_cname(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 5); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_GENERIC_CNAME_5_C */ diff --git a/contrib/bind9/lib/dns/rdata/generic/cname_5.h b/contrib/bind9/lib/dns/rdata/generic/cname_5.h deleted file mode 100644 index dc24383..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/cname_5.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: cname_5.h,v 1.24 2004/03/05 05:10:10 marka Exp $ */ - -#ifndef GENERIC_CNAME_5_H -#define GENERIC_CNAME_5_H 1 - -typedef struct dns_rdata_cname { - dns_rdatacommon_t common; - isc_mem_t *mctx; - dns_name_t cname; -} dns_rdata_cname_t; - -#endif /* GENERIC_CNAME_5_H */ diff --git a/contrib/bind9/lib/dns/rdata/generic/dlv_32769.c b/contrib/bind9/lib/dns/rdata/generic/dlv_32769.c deleted file mode 100644 index c0bb348..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/dlv_32769.c +++ /dev/null @@ -1,321 +0,0 @@ -/* - * Copyright (C) 2004, 2006, 2007 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: dlv_32769.c,v 1.2.2.5 2007/08/28 07:20:06 tbox Exp $ */ - -/* draft-ietf-dnsext-delegation-signer-05.txt */ - -#ifndef RDATA_GENERIC_DLV_32769_C -#define RDATA_GENERIC_DLV_32769_C - -#define RRTYPE_DLV_ATTRIBUTES 0 - -#include <isc/sha1.h> -#include <isc/sha2.h> - -#include <dns/ds.h> - - -static inline isc_result_t -fromtext_dlv(ARGS_FROMTEXT) { - isc_token_t token; - unsigned char c; - int length; - - REQUIRE(type == 32769); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(origin); - UNUSED(options); - UNUSED(callbacks); - - /* - * Key tag. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - if (token.value.as_ulong > 0xffffU) - RETTOK(ISC_R_RANGE); - RETERR(uint16_tobuffer(token.value.as_ulong, target)); - - /* - * Algorithm. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - if (token.value.as_ulong > 0xffU) - RETTOK(ISC_R_RANGE); - RETERR(uint8_tobuffer(token.value.as_ulong, target)); - - /* - * Digest type. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - if (token.value.as_ulong > 0xffU) - RETTOK(ISC_R_RANGE); - RETERR(uint8_tobuffer(token.value.as_ulong, target)); - c = (unsigned char) token.value.as_ulong; - - /* - * Digest. - */ - if (c == DNS_DSDIGEST_SHA1) - length = ISC_SHA1_DIGESTLENGTH; - else if (c == DNS_DSDIGEST_SHA256) - length = ISC_SHA256_DIGESTLENGTH; - else - length = -1; - return (isc_hex_tobuffer(lexer, target, -1)); -} - -static inline isc_result_t -totext_dlv(ARGS_TOTEXT) { - isc_region_t sr; - char buf[sizeof("64000 ")]; - unsigned int n; - - REQUIRE(rdata->type == 32769); - REQUIRE(rdata->length != 0); - - UNUSED(tctx); - - dns_rdata_toregion(rdata, &sr); - - /* - * Key tag. - */ - n = uint16_fromregion(&sr); - isc_region_consume(&sr, 2); - sprintf(buf, "%u ", n); - RETERR(str_totext(buf, target)); - - /* - * Algorithm. - */ - n = uint8_fromregion(&sr); - isc_region_consume(&sr, 1); - sprintf(buf, "%u ", n); - RETERR(str_totext(buf, target)); - - /* - * Digest type. - */ - n = uint8_fromregion(&sr); - isc_region_consume(&sr, 1); - sprintf(buf, "%u", n); - RETERR(str_totext(buf, target)); - - /* - * Digest. - */ - if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) - RETERR(str_totext(" (", target)); - RETERR(str_totext(tctx->linebreak, target)); - RETERR(isc_hex_totext(&sr, tctx->width - 2, tctx->linebreak, target)); - if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) - RETERR(str_totext(" )", target)); - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -fromwire_dlv(ARGS_FROMWIRE) { - isc_region_t sr; - - REQUIRE(type == 32769); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(dctx); - UNUSED(options); - - isc_buffer_activeregion(source, &sr); - - /* - * Check digest lengths if we know them. - */ - if (sr.length < 4 || - (sr.base[3] == DNS_DSDIGEST_SHA1 && - sr.length < 4 + ISC_SHA1_DIGESTLENGTH) || - (sr.base[3] == DNS_DSDIGEST_SHA256 && - sr.length < 4 + ISC_SHA256_DIGESTLENGTH)) - return (ISC_R_UNEXPECTEDEND); - - /* - * Only copy digest lengths if we know them. - * If there is extra data dns_rdata_fromwire() will - * detect that. - */ - if (sr.base[3] == DNS_DSDIGEST_SHA1) - sr.length = 4 + ISC_SHA1_DIGESTLENGTH; - else if (sr.base[3] == DNS_DSDIGEST_SHA256) - sr.length = 4 + ISC_SHA256_DIGESTLENGTH; - - isc_buffer_forward(source, sr.length); - return (mem_tobuffer(target, sr.base, sr.length)); -} - -static inline isc_result_t -towire_dlv(ARGS_TOWIRE) { - isc_region_t sr; - - REQUIRE(rdata->type == 32769); - REQUIRE(rdata->length != 0); - - UNUSED(cctx); - - dns_rdata_toregion(rdata, &sr); - return (mem_tobuffer(target, sr.base, sr.length)); -} - -static inline int -compare_dlv(ARGS_COMPARE) { - isc_region_t r1; - isc_region_t r2; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 32769); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - dns_rdata_toregion(rdata1, &r1); - dns_rdata_toregion(rdata2, &r2); - return (isc_region_compare(&r1, &r2)); -} - -static inline isc_result_t -fromstruct_dlv(ARGS_FROMSTRUCT) { - dns_rdata_dlv_t *dlv = source; - - REQUIRE(type == 32769); - REQUIRE(source != NULL); - REQUIRE(dlv->common.rdtype == type); - REQUIRE(dlv->common.rdclass == rdclass); - switch (dlv->digest_type) { - case DNS_DSDIGEST_SHA1: - REQUIRE(dlv->length == ISC_SHA1_DIGESTLENGTH); - break; - case DNS_DSDIGEST_SHA256: - REQUIRE(dlv->length == ISC_SHA256_DIGESTLENGTH); - break; - } - - UNUSED(type); - UNUSED(rdclass); - - RETERR(uint16_tobuffer(dlv->key_tag, target)); - RETERR(uint8_tobuffer(dlv->algorithm, target)); - RETERR(uint8_tobuffer(dlv->digest_type, target)); - - return (mem_tobuffer(target, dlv->digest, dlv->length)); -} - -static inline isc_result_t -tostruct_dlv(ARGS_TOSTRUCT) { - dns_rdata_dlv_t *dlv = target; - isc_region_t region; - - REQUIRE(rdata->type == 32769); - REQUIRE(target != NULL); - REQUIRE(rdata->length != 0); - - dlv->common.rdclass = rdata->rdclass; - dlv->common.rdtype = rdata->type; - ISC_LINK_INIT(&dlv->common, link); - - dns_rdata_toregion(rdata, ®ion); - - dlv->key_tag = uint16_fromregion(®ion); - isc_region_consume(®ion, 2); - dlv->algorithm = uint8_fromregion(®ion); - isc_region_consume(®ion, 1); - dlv->digest_type = uint8_fromregion(®ion); - isc_region_consume(®ion, 1); - dlv->length = region.length; - - dlv->digest = mem_maybedup(mctx, region.base, region.length); - if (dlv->digest == NULL) - return (ISC_R_NOMEMORY); - - dlv->mctx = mctx; - return (ISC_R_SUCCESS); -} - -static inline void -freestruct_dlv(ARGS_FREESTRUCT) { - dns_rdata_dlv_t *dlv = source; - - REQUIRE(dlv != NULL); - REQUIRE(dlv->common.rdtype == 32769); - - if (dlv->mctx == NULL) - return; - - if (dlv->digest != NULL) - isc_mem_free(dlv->mctx, dlv->digest); - dlv->mctx = NULL; -} - -static inline isc_result_t -additionaldata_dlv(ARGS_ADDLDATA) { - REQUIRE(rdata->type == 32769); - - UNUSED(rdata); - UNUSED(add); - UNUSED(arg); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_dlv(ARGS_DIGEST) { - isc_region_t r; - - REQUIRE(rdata->type == 32769); - - dns_rdata_toregion(rdata, &r); - - return ((digest)(arg, &r)); -} - -static inline isc_boolean_t -checkowner_dlv(ARGS_CHECKOWNER) { - - REQUIRE(type == 32769); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_dlv(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 32769); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_GENERIC_DLV_32769_C */ diff --git a/contrib/bind9/lib/dns/rdata/generic/dlv_32769.h b/contrib/bind9/lib/dns/rdata/generic/dlv_32769.h deleted file mode 100644 index bd03c73..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/dlv_32769.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2004, 2006 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: dlv_32769.h,v 1.2.2.2 2006/02/19 06:50:47 marka Exp $ */ - -/* draft-ietf-dnsext-delegation-signer-05.txt */ -#ifndef GENERIC_DLV_32769_H -#define GENERIC_DLV_32769_H 1 - -typedef struct dns_rdata_dlv { - dns_rdatacommon_t common; - isc_mem_t *mctx; - isc_uint16_t key_tag; - isc_uint8_t algorithm; - isc_uint8_t digest_type; - isc_uint16_t length; - unsigned char *digest; -} dns_rdata_dlv_t; - -#endif /* GENERIC_DLV_32769_H */ diff --git a/contrib/bind9/lib/dns/rdata/generic/dname_39.c b/contrib/bind9/lib/dns/rdata/generic/dname_39.c deleted file mode 100644 index ed3133c..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/dname_39.c +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: dname_39.c,v 1.36 2004/03/05 05:10:10 marka Exp $ */ - -/* Reviewed: Wed Mar 15 16:52:38 PST 2000 by explorer */ - -/* RFC2672 */ - -#ifndef RDATA_GENERIC_DNAME_39_C -#define RDATA_GENERIC_DNAME_39_C - -#define RRTYPE_DNAME_ATTRIBUTES (DNS_RDATATYPEATTR_SINGLETON) - -static inline isc_result_t -fromtext_dname(ARGS_FROMTEXT) { - isc_token_t token; - dns_name_t name; - isc_buffer_t buffer; - - REQUIRE(type == 39); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(callbacks); - - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - - dns_name_init(&name, NULL); - buffer_fromregion(&buffer, &token.value.as_region); - origin = (origin != NULL) ? origin : dns_rootname; - RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target)); - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -totext_dname(ARGS_TOTEXT) { - isc_region_t region; - dns_name_t name; - dns_name_t prefix; - isc_boolean_t sub; - - REQUIRE(rdata->type == 39); - REQUIRE(rdata->length != 0); - - dns_name_init(&name, NULL); - dns_name_init(&prefix, NULL); - - dns_rdata_toregion(rdata, ®ion); - dns_name_fromregion(&name, ®ion); - - sub = name_prefix(&name, tctx->origin, &prefix); - - return (dns_name_totext(&prefix, sub, target)); -} - -static inline isc_result_t -fromwire_dname(ARGS_FROMWIRE) { - dns_name_t name; - - REQUIRE(type == 39); - - UNUSED(type); - UNUSED(rdclass); - - dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE); - - dns_name_init(&name, NULL); - return(dns_name_fromwire(&name, source, dctx, options, target)); -} - -static inline isc_result_t -towire_dname(ARGS_TOWIRE) { - dns_name_t name; - dns_offsets_t offsets; - isc_region_t region; - - REQUIRE(rdata->type == 39); - REQUIRE(rdata->length != 0); - - dns_compress_setmethods(cctx, DNS_COMPRESS_NONE); - dns_name_init(&name, offsets); - dns_rdata_toregion(rdata, ®ion); - dns_name_fromregion(&name, ®ion); - - return (dns_name_towire(&name, cctx, target)); -} - -static inline int -compare_dname(ARGS_COMPARE) { - dns_name_t name1; - dns_name_t name2; - isc_region_t region1; - isc_region_t region2; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 39); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - dns_name_init(&name1, NULL); - dns_name_init(&name2, NULL); - - dns_rdata_toregion(rdata1, ®ion1); - dns_rdata_toregion(rdata2, ®ion2); - - dns_name_fromregion(&name1, ®ion1); - dns_name_fromregion(&name2, ®ion2); - - return (dns_name_rdatacompare(&name1, &name2)); -} - -static inline isc_result_t -fromstruct_dname(ARGS_FROMSTRUCT) { - dns_rdata_dname_t *dname = source; - isc_region_t region; - - REQUIRE(type == 39); - REQUIRE(source != NULL); - REQUIRE(dname->common.rdtype == type); - REQUIRE(dname->common.rdclass == rdclass); - - UNUSED(type); - UNUSED(rdclass); - - dns_name_toregion(&dname->dname, ®ion); - return (isc_buffer_copyregion(target, ®ion)); -} - -static inline isc_result_t -tostruct_dname(ARGS_TOSTRUCT) { - isc_region_t region; - dns_rdata_dname_t *dname = target; - dns_name_t name; - - REQUIRE(rdata->type == 39); - REQUIRE(target != NULL); - REQUIRE(rdata->length != 0); - - dname->common.rdclass = rdata->rdclass; - dname->common.rdtype = rdata->type; - ISC_LINK_INIT(&dname->common, link); - - dns_name_init(&name, NULL); - dns_rdata_toregion(rdata, ®ion); - dns_name_fromregion(&name, ®ion); - dns_name_init(&dname->dname, NULL); - RETERR(name_duporclone(&name, mctx, &dname->dname)); - dname->mctx = mctx; - return (ISC_R_SUCCESS); -} - -static inline void -freestruct_dname(ARGS_FREESTRUCT) { - dns_rdata_dname_t *dname = source; - - REQUIRE(source != NULL); - REQUIRE(dname->common.rdtype == 39); - - if (dname->mctx == NULL) - return; - - dns_name_free(&dname->dname, dname->mctx); - dname->mctx = NULL; -} - -static inline isc_result_t -additionaldata_dname(ARGS_ADDLDATA) { - UNUSED(rdata); - UNUSED(add); - UNUSED(arg); - - REQUIRE(rdata->type == 39); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_dname(ARGS_DIGEST) { - isc_region_t r; - dns_name_t name; - - REQUIRE(rdata->type == 39); - - dns_rdata_toregion(rdata, &r); - dns_name_init(&name, NULL); - dns_name_fromregion(&name, &r); - - return (dns_name_digest(&name, digest, arg)); -} - -static inline isc_boolean_t -checkowner_dname(ARGS_CHECKOWNER) { - - REQUIRE(type == 39); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_dname(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 39); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_GENERIC_DNAME_39_C */ diff --git a/contrib/bind9/lib/dns/rdata/generic/dname_39.h b/contrib/bind9/lib/dns/rdata/generic/dname_39.h deleted file mode 100644 index 93ec709..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/dname_39.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef GENERIC_DNAME_39_H -#define GENERIC_DNAME_39_H 1 - -/* $Id: dname_39.h,v 1.17.18.2 2005/04/29 00:16:31 marka Exp $ */ - -/*! - * \brief per RFC2672 */ - -typedef struct dns_rdata_dname { - dns_rdatacommon_t common; - isc_mem_t *mctx; - dns_name_t dname; -} dns_rdata_dname_t; - -#endif /* GENERIC_DNAME_39_H */ diff --git a/contrib/bind9/lib/dns/rdata/generic/dnskey_48.c b/contrib/bind9/lib/dns/rdata/generic/dnskey_48.c deleted file mode 100644 index 5a4e453..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/dnskey_48.c +++ /dev/null @@ -1,312 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: dnskey_48.c,v 1.4.20.2 2005/04/29 00:16:31 marka Exp $ */ - -/* - * Reviewed: Wed Mar 15 16:47:10 PST 2000 by halley. - */ - -/* RFC2535 */ - -#ifndef RDATA_GENERIC_DNSKEY_48_C -#define RDATA_GENERIC_DNSKEY_48_C - -#include <dst/dst.h> - -#define RRTYPE_DNSKEY_ATTRIBUTES (DNS_RDATATYPEATTR_DNSSEC) - -static inline isc_result_t -fromtext_dnskey(ARGS_FROMTEXT) { - isc_token_t token; - dns_secalg_t alg; - dns_secproto_t proto; - dns_keyflags_t flags; - - REQUIRE(type == 48); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(origin); - UNUSED(options); - UNUSED(callbacks); - - /* flags */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - RETTOK(dns_keyflags_fromtext(&flags, &token.value.as_textregion)); - RETERR(uint16_tobuffer(flags, target)); - - /* protocol */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - RETTOK(dns_secproto_fromtext(&proto, &token.value.as_textregion)); - RETERR(mem_tobuffer(target, &proto, 1)); - - /* algorithm */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - RETTOK(dns_secalg_fromtext(&alg, &token.value.as_textregion)); - RETERR(mem_tobuffer(target, &alg, 1)); - - /* No Key? */ - if ((flags & 0xc000) == 0xc000) - return (ISC_R_SUCCESS); - - return (isc_base64_tobuffer(lexer, target, -1)); -} - -static inline isc_result_t -totext_dnskey(ARGS_TOTEXT) { - isc_region_t sr; - char buf[sizeof("64000")]; - unsigned int flags; - unsigned char algorithm; - - REQUIRE(rdata->type == 48); - REQUIRE(rdata->length != 0); - - dns_rdata_toregion(rdata, &sr); - - /* flags */ - flags = uint16_fromregion(&sr); - isc_region_consume(&sr, 2); - sprintf(buf, "%u", flags); - RETERR(str_totext(buf, target)); - RETERR(str_totext(" ", target)); - - /* protocol */ - sprintf(buf, "%u", sr.base[0]); - isc_region_consume(&sr, 1); - RETERR(str_totext(buf, target)); - RETERR(str_totext(" ", target)); - - /* algorithm */ - algorithm = sr.base[0]; - sprintf(buf, "%u", algorithm); - isc_region_consume(&sr, 1); - RETERR(str_totext(buf, target)); - - /* No Key? */ - if ((flags & 0xc000) == 0xc000) - return (ISC_R_SUCCESS); - - /* key */ - if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) - RETERR(str_totext(" (", target)); - RETERR(str_totext(tctx->linebreak, target)); - RETERR(isc_base64_totext(&sr, tctx->width - 2, - tctx->linebreak, target)); - - if ((tctx->flags & DNS_STYLEFLAG_COMMENT) != 0) - RETERR(str_totext(tctx->linebreak, target)); - else if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) - RETERR(str_totext(" ", target)); - - if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) - RETERR(str_totext(")", target)); - - if ((tctx->flags & DNS_STYLEFLAG_COMMENT) != 0) { - isc_region_t tmpr; - - RETERR(str_totext(" ; key id = ", target)); - dns_rdata_toregion(rdata, &tmpr); - sprintf(buf, "%u", dst_region_computeid(&tmpr, algorithm)); - RETERR(str_totext(buf, target)); - } - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -fromwire_dnskey(ARGS_FROMWIRE) { - isc_region_t sr; - - REQUIRE(type == 48); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(dctx); - UNUSED(options); - - isc_buffer_activeregion(source, &sr); - if (sr.length < 4) - return (ISC_R_UNEXPECTEDEND); - - isc_buffer_forward(source, sr.length); - return (mem_tobuffer(target, sr.base, sr.length)); -} - -static inline isc_result_t -towire_dnskey(ARGS_TOWIRE) { - isc_region_t sr; - - REQUIRE(rdata->type == 48); - REQUIRE(rdata->length != 0); - - UNUSED(cctx); - - dns_rdata_toregion(rdata, &sr); - return (mem_tobuffer(target, sr.base, sr.length)); -} - -static inline int -compare_dnskey(ARGS_COMPARE) { - isc_region_t r1; - isc_region_t r2; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 48); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - dns_rdata_toregion(rdata1, &r1); - dns_rdata_toregion(rdata2, &r2); - return (isc_region_compare(&r1, &r2)); -} - -static inline isc_result_t -fromstruct_dnskey(ARGS_FROMSTRUCT) { - dns_rdata_dnskey_t *dnskey = source; - - REQUIRE(type == 48); - REQUIRE(source != NULL); - REQUIRE(dnskey->common.rdtype == type); - REQUIRE(dnskey->common.rdclass == rdclass); - - UNUSED(type); - UNUSED(rdclass); - - /* Flags */ - RETERR(uint16_tobuffer(dnskey->flags, target)); - - /* Protocol */ - RETERR(uint8_tobuffer(dnskey->protocol, target)); - - /* Algorithm */ - RETERR(uint8_tobuffer(dnskey->algorithm, target)); - - /* Data */ - return (mem_tobuffer(target, dnskey->data, dnskey->datalen)); -} - -static inline isc_result_t -tostruct_dnskey(ARGS_TOSTRUCT) { - dns_rdata_dnskey_t *dnskey = target; - isc_region_t sr; - - REQUIRE(rdata->type == 48); - REQUIRE(target != NULL); - REQUIRE(rdata->length != 0); - - dnskey->common.rdclass = rdata->rdclass; - dnskey->common.rdtype = rdata->type; - ISC_LINK_INIT(&dnskey->common, link); - - dns_rdata_toregion(rdata, &sr); - - /* Flags */ - if (sr.length < 2) - return (ISC_R_UNEXPECTEDEND); - dnskey->flags = uint16_fromregion(&sr); - isc_region_consume(&sr, 2); - - /* Protocol */ - if (sr.length < 1) - return (ISC_R_UNEXPECTEDEND); - dnskey->protocol = uint8_fromregion(&sr); - isc_region_consume(&sr, 1); - - /* Algorithm */ - if (sr.length < 1) - return (ISC_R_UNEXPECTEDEND); - dnskey->algorithm = uint8_fromregion(&sr); - isc_region_consume(&sr, 1); - - /* Data */ - dnskey->datalen = sr.length; - dnskey->data = mem_maybedup(mctx, sr.base, dnskey->datalen); - if (dnskey->data == NULL) - return (ISC_R_NOMEMORY); - - dnskey->mctx = mctx; - return (ISC_R_SUCCESS); -} - -static inline void -freestruct_dnskey(ARGS_FREESTRUCT) { - dns_rdata_dnskey_t *dnskey = (dns_rdata_dnskey_t *) source; - - REQUIRE(source != NULL); - REQUIRE(dnskey->common.rdtype == 48); - - if (dnskey->mctx == NULL) - return; - - if (dnskey->data != NULL) - isc_mem_free(dnskey->mctx, dnskey->data); - dnskey->mctx = NULL; -} - -static inline isc_result_t -additionaldata_dnskey(ARGS_ADDLDATA) { - REQUIRE(rdata->type == 48); - - UNUSED(rdata); - UNUSED(add); - UNUSED(arg); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_dnskey(ARGS_DIGEST) { - isc_region_t r; - - REQUIRE(rdata->type == 48); - - dns_rdata_toregion(rdata, &r); - - return ((digest)(arg, &r)); -} - -static inline isc_boolean_t -checkowner_dnskey(ARGS_CHECKOWNER) { - - REQUIRE(type == 48); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_dnskey(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 48); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_GENERIC_DNSKEY_48_C */ diff --git a/contrib/bind9/lib/dns/rdata/generic/dnskey_48.h b/contrib/bind9/lib/dns/rdata/generic/dnskey_48.h deleted file mode 100644 index 9b3d262..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/dnskey_48.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef GENERIC_DNSKEY_48_H -#define GENERIC_DNSKEY_48_H 1 - -/* $Id: dnskey_48.h,v 1.3.20.2 2005/04/29 00:16:32 marka Exp $ */ - -/*! - * \brief per RFC2535 */ - -typedef struct dns_rdata_dnskey { - dns_rdatacommon_t common; - isc_mem_t * mctx; - isc_uint16_t flags; - isc_uint8_t protocol; - isc_uint8_t algorithm; - isc_uint16_t datalen; - unsigned char * data; -} dns_rdata_dnskey_t; - - -#endif /* GENERIC_DNSKEY_48_H */ diff --git a/contrib/bind9/lib/dns/rdata/generic/ds_43.c b/contrib/bind9/lib/dns/rdata/generic/ds_43.c deleted file mode 100644 index 212a56f..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/ds_43.c +++ /dev/null @@ -1,321 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2002 Internet Software Consortium. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: ds_43.c,v 1.7.18.5 2007/08/28 07:20:06 tbox Exp $ */ - -/* draft-ietf-dnsext-delegation-signer-05.txt */ - -#ifndef RDATA_GENERIC_DS_43_C -#define RDATA_GENERIC_DS_43_C - -#define RRTYPE_DS_ATTRIBUTES \ - (DNS_RDATATYPEATTR_DNSSEC|DNS_RDATATYPEATTR_ATPARENT) - -#include <isc/sha1.h> -#include <isc/sha2.h> - -#include <dns/ds.h> - -static inline isc_result_t -fromtext_ds(ARGS_FROMTEXT) { - isc_token_t token; - unsigned char c; - int length; - - REQUIRE(type == 43); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(origin); - UNUSED(options); - UNUSED(callbacks); - - /* - * Key tag. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - if (token.value.as_ulong > 0xffffU) - RETTOK(ISC_R_RANGE); - RETERR(uint16_tobuffer(token.value.as_ulong, target)); - - /* - * Algorithm. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - RETTOK(dns_secalg_fromtext(&c, &token.value.as_textregion)); - RETERR(mem_tobuffer(target, &c, 1)); - - /* - * Digest type. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - if (token.value.as_ulong > 0xffU) - RETTOK(ISC_R_RANGE); - RETERR(uint8_tobuffer(token.value.as_ulong, target)); - c = (unsigned char) token.value.as_ulong; - - /* - * Digest. - */ - if (c == DNS_DSDIGEST_SHA1) - length = ISC_SHA1_DIGESTLENGTH; - else if (c == DNS_DSDIGEST_SHA256) - length = ISC_SHA256_DIGESTLENGTH; - else - length = -1; - return (isc_hex_tobuffer(lexer, target, length)); -} - -static inline isc_result_t -totext_ds(ARGS_TOTEXT) { - isc_region_t sr; - char buf[sizeof("64000 ")]; - unsigned int n; - - REQUIRE(rdata->type == 43); - REQUIRE(rdata->length != 0); - - UNUSED(tctx); - - dns_rdata_toregion(rdata, &sr); - - /* - * Key tag. - */ - n = uint16_fromregion(&sr); - isc_region_consume(&sr, 2); - sprintf(buf, "%u ", n); - RETERR(str_totext(buf, target)); - - /* - * Algorithm. - */ - n = uint8_fromregion(&sr); - isc_region_consume(&sr, 1); - sprintf(buf, "%u ", n); - RETERR(str_totext(buf, target)); - - /* - * Digest type. - */ - n = uint8_fromregion(&sr); - isc_region_consume(&sr, 1); - sprintf(buf, "%u", n); - RETERR(str_totext(buf, target)); - - /* - * Digest. - */ - if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) - RETERR(str_totext(" (", target)); - RETERR(str_totext(tctx->linebreak, target)); - RETERR(isc_hex_totext(&sr, tctx->width - 2, tctx->linebreak, target)); - if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) - RETERR(str_totext(" )", target)); - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -fromwire_ds(ARGS_FROMWIRE) { - isc_region_t sr; - - REQUIRE(type == 43); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(dctx); - UNUSED(options); - - isc_buffer_activeregion(source, &sr); - - /* - * Check digest lengths if we know them. - */ - if (sr.length < 4 || - (sr.base[3] == DNS_DSDIGEST_SHA1 && - sr.length < 4 + ISC_SHA1_DIGESTLENGTH) || - (sr.base[3] == DNS_DSDIGEST_SHA256 && - sr.length < 4 + ISC_SHA256_DIGESTLENGTH)) - return (ISC_R_UNEXPECTEDEND); - - /* - * Only copy digest lengths if we know them. - * If there is extra data dns_rdata_fromwire() will - * detect that. - */ - if (sr.base[3] == DNS_DSDIGEST_SHA1) - sr.length = 4 + ISC_SHA1_DIGESTLENGTH; - else if (sr.base[3] == DNS_DSDIGEST_SHA256) - sr.length = 4 + ISC_SHA256_DIGESTLENGTH; - - isc_buffer_forward(source, sr.length); - return (mem_tobuffer(target, sr.base, sr.length)); -} - -static inline isc_result_t -towire_ds(ARGS_TOWIRE) { - isc_region_t sr; - - REQUIRE(rdata->type == 43); - REQUIRE(rdata->length != 0); - - UNUSED(cctx); - - dns_rdata_toregion(rdata, &sr); - return (mem_tobuffer(target, sr.base, sr.length)); -} - -static inline int -compare_ds(ARGS_COMPARE) { - isc_region_t r1; - isc_region_t r2; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 43); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - dns_rdata_toregion(rdata1, &r1); - dns_rdata_toregion(rdata2, &r2); - return (isc_region_compare(&r1, &r2)); -} - -static inline isc_result_t -fromstruct_ds(ARGS_FROMSTRUCT) { - dns_rdata_ds_t *ds = source; - - REQUIRE(type == 43); - REQUIRE(source != NULL); - REQUIRE(ds->common.rdtype == type); - REQUIRE(ds->common.rdclass == rdclass); - switch (ds->digest_type) { - case DNS_DSDIGEST_SHA1: - REQUIRE(ds->length == ISC_SHA1_DIGESTLENGTH); - break; - case DNS_DSDIGEST_SHA256: - REQUIRE(ds->length == ISC_SHA256_DIGESTLENGTH); - break; - } - - UNUSED(type); - UNUSED(rdclass); - - RETERR(uint16_tobuffer(ds->key_tag, target)); - RETERR(uint8_tobuffer(ds->algorithm, target)); - RETERR(uint8_tobuffer(ds->digest_type, target)); - - return (mem_tobuffer(target, ds->digest, ds->length)); -} - -static inline isc_result_t -tostruct_ds(ARGS_TOSTRUCT) { - dns_rdata_ds_t *ds = target; - isc_region_t region; - - REQUIRE(rdata->type == 43); - REQUIRE(target != NULL); - REQUIRE(rdata->length != 0); - - ds->common.rdclass = rdata->rdclass; - ds->common.rdtype = rdata->type; - ISC_LINK_INIT(&ds->common, link); - - dns_rdata_toregion(rdata, ®ion); - - ds->key_tag = uint16_fromregion(®ion); - isc_region_consume(®ion, 2); - ds->algorithm = uint8_fromregion(®ion); - isc_region_consume(®ion, 1); - ds->digest_type = uint8_fromregion(®ion); - isc_region_consume(®ion, 1); - ds->length = region.length; - - ds->digest = mem_maybedup(mctx, region.base, region.length); - if (ds->digest == NULL) - return (ISC_R_NOMEMORY); - - ds->mctx = mctx; - return (ISC_R_SUCCESS); -} - -static inline void -freestruct_ds(ARGS_FREESTRUCT) { - dns_rdata_ds_t *ds = source; - - REQUIRE(ds != NULL); - REQUIRE(ds->common.rdtype == 43); - - if (ds->mctx == NULL) - return; - - if (ds->digest != NULL) - isc_mem_free(ds->mctx, ds->digest); - ds->mctx = NULL; -} - -static inline isc_result_t -additionaldata_ds(ARGS_ADDLDATA) { - REQUIRE(rdata->type == 43); - - UNUSED(rdata); - UNUSED(add); - UNUSED(arg); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_ds(ARGS_DIGEST) { - isc_region_t r; - - REQUIRE(rdata->type == 43); - - dns_rdata_toregion(rdata, &r); - - return ((digest)(arg, &r)); -} - -static inline isc_boolean_t -checkowner_ds(ARGS_CHECKOWNER) { - - REQUIRE(type == 43); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_ds(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 43); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_GENERIC_DS_43_C */ diff --git a/contrib/bind9/lib/dns/rdata/generic/ds_43.h b/contrib/bind9/lib/dns/rdata/generic/ds_43.h deleted file mode 100644 index dae7bef..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/ds_43.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2002 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: ds_43.h,v 1.3.20.2 2005/04/29 00:16:32 marka Exp $ */ - -#ifndef GENERIC_DS_43_H -#define GENERIC_DS_43_H 1 - -/*! - * \brief per draft-ietf-dnsext-delegation-signer-05.txt */ -typedef struct dns_rdata_ds { - dns_rdatacommon_t common; - isc_mem_t *mctx; - isc_uint16_t key_tag; - isc_uint8_t algorithm; - isc_uint8_t digest_type; - isc_uint16_t length; - unsigned char *digest; -} dns_rdata_ds_t; - -#endif /* GENERIC_DS_43_H */ diff --git a/contrib/bind9/lib/dns/rdata/generic/gpos_27.c b/contrib/bind9/lib/dns/rdata/generic/gpos_27.c deleted file mode 100644 index 9b37905..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/gpos_27.c +++ /dev/null @@ -1,252 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2002 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: gpos_27.c,v 1.37.18.2 2005/04/29 00:16:32 marka Exp $ */ - -/* reviewed: Wed Mar 15 16:48:45 PST 2000 by brister */ - -/* RFC1712 */ - -#ifndef RDATA_GENERIC_GPOS_27_C -#define RDATA_GENERIC_GPOS_27_C - -#define RRTYPE_GPOS_ATTRIBUTES (0) - -static inline isc_result_t -fromtext_gpos(ARGS_FROMTEXT) { - isc_token_t token; - int i; - - REQUIRE(type == 27); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(origin); - UNUSED(options); - UNUSED(callbacks); - - for (i = 0; i < 3; i++) { - RETERR(isc_lex_getmastertoken(lexer, &token, - isc_tokentype_qstring, - ISC_FALSE)); - RETTOK(txt_fromtext(&token.value.as_textregion, target)); - } - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -totext_gpos(ARGS_TOTEXT) { - isc_region_t region; - int i; - - REQUIRE(rdata->type == 27); - REQUIRE(rdata->length != 0); - - UNUSED(tctx); - - dns_rdata_toregion(rdata, ®ion); - - for (i = 0; i < 3; i++) { - RETERR(txt_totext(®ion, target)); - if (i != 2) - RETERR(str_totext(" ", target)); - } - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -fromwire_gpos(ARGS_FROMWIRE) { - int i; - - REQUIRE(type == 27); - - UNUSED(type); - UNUSED(dctx); - UNUSED(rdclass); - UNUSED(options); - - for (i = 0; i < 3; i++) - RETERR(txt_fromwire(source, target)); - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -towire_gpos(ARGS_TOWIRE) { - - REQUIRE(rdata->type == 27); - REQUIRE(rdata->length != 0); - - UNUSED(cctx); - - return (mem_tobuffer(target, rdata->data, rdata->length)); -} - -static inline int -compare_gpos(ARGS_COMPARE) { - isc_region_t r1; - isc_region_t r2; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 27); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - dns_rdata_toregion(rdata1, &r1); - dns_rdata_toregion(rdata2, &r2); - return (isc_region_compare(&r1, &r2)); -} - -static inline isc_result_t -fromstruct_gpos(ARGS_FROMSTRUCT) { - dns_rdata_gpos_t *gpos = source; - - REQUIRE(type == 27); - REQUIRE(source != NULL); - REQUIRE(gpos->common.rdtype == type); - REQUIRE(gpos->common.rdclass == rdclass); - - UNUSED(type); - UNUSED(rdclass); - - RETERR(uint8_tobuffer(gpos->long_len, target)); - RETERR(mem_tobuffer(target, gpos->longitude, gpos->long_len)); - RETERR(uint8_tobuffer(gpos->lat_len, target)); - RETERR(mem_tobuffer(target, gpos->latitude, gpos->lat_len)); - RETERR(uint8_tobuffer(gpos->alt_len, target)); - return (mem_tobuffer(target, gpos->altitude, gpos->alt_len)); -} - -static inline isc_result_t -tostruct_gpos(ARGS_TOSTRUCT) { - dns_rdata_gpos_t *gpos = target; - isc_region_t region; - - REQUIRE(rdata->type == 27); - REQUIRE(target != NULL); - REQUIRE(rdata->length != 0); - - gpos->common.rdclass = rdata->rdclass; - gpos->common.rdtype = rdata->type; - ISC_LINK_INIT(&gpos->common, link); - - dns_rdata_toregion(rdata, ®ion); - gpos->long_len = uint8_fromregion(®ion); - isc_region_consume(®ion, 1); - gpos->longitude = mem_maybedup(mctx, region.base, gpos->long_len); - if (gpos->longitude == NULL) - return (ISC_R_NOMEMORY); - isc_region_consume(®ion, gpos->long_len); - - gpos->lat_len = uint8_fromregion(®ion); - isc_region_consume(®ion, 1); - gpos->latitude = mem_maybedup(mctx, region.base, gpos->lat_len); - if (gpos->latitude == NULL) - goto cleanup_longitude; - isc_region_consume(®ion, gpos->lat_len); - - gpos->alt_len = uint8_fromregion(®ion); - isc_region_consume(®ion, 1); - if (gpos->lat_len > 0) { - gpos->altitude = - mem_maybedup(mctx, region.base, gpos->alt_len); - if (gpos->altitude == NULL) - goto cleanup_latitude; - } else - gpos->altitude = NULL; - - gpos->mctx = mctx; - return (ISC_R_SUCCESS); - - cleanup_latitude: - if (mctx != NULL && gpos->longitude != NULL) - isc_mem_free(mctx, gpos->longitude); - - cleanup_longitude: - if (mctx != NULL && gpos->latitude != NULL) - isc_mem_free(mctx, gpos->latitude); - return (ISC_R_NOMEMORY); -} - -static inline void -freestruct_gpos(ARGS_FREESTRUCT) { - dns_rdata_gpos_t *gpos = source; - - REQUIRE(source != NULL); - REQUIRE(gpos->common.rdtype == 27); - - if (gpos->mctx == NULL) - return; - - if (gpos->longitude != NULL) - isc_mem_free(gpos->mctx, gpos->longitude); - if (gpos->latitude != NULL) - isc_mem_free(gpos->mctx, gpos->latitude); - if (gpos->altitude != NULL) - isc_mem_free(gpos->mctx, gpos->altitude); - gpos->mctx = NULL; -} - -static inline isc_result_t -additionaldata_gpos(ARGS_ADDLDATA) { - REQUIRE(rdata->type == 27); - - UNUSED(rdata); - UNUSED(add); - UNUSED(arg); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_gpos(ARGS_DIGEST) { - isc_region_t r; - - REQUIRE(rdata->type == 27); - - dns_rdata_toregion(rdata, &r); - - return ((digest)(arg, &r)); -} - -static inline isc_boolean_t -checkowner_gpos(ARGS_CHECKOWNER) { - - REQUIRE(type == 27); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_gpos(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 27); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_GENERIC_GPOS_27_C */ diff --git a/contrib/bind9/lib/dns/rdata/generic/gpos_27.h b/contrib/bind9/lib/dns/rdata/generic/gpos_27.h deleted file mode 100644 index 4949bde..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/gpos_27.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef GENERIC_GPOS_27_H -#define GENERIC_GPOS_27_H 1 - -/* $Id: gpos_27.h,v 1.13.18.2 2005/04/29 00:16:32 marka Exp $ */ - -/*! - * \brief per RFC1712 */ - -typedef struct dns_rdata_gpos { - dns_rdatacommon_t common; - isc_mem_t *mctx; - char *longitude; - char *latitude; - char *altitude; - isc_uint8_t long_len; - isc_uint8_t lat_len; - isc_uint8_t alt_len; -} dns_rdata_gpos_t; - -#endif /* GENERIC_GPOS_27_H */ diff --git a/contrib/bind9/lib/dns/rdata/generic/hinfo_13.c b/contrib/bind9/lib/dns/rdata/generic/hinfo_13.c deleted file mode 100644 index 70c433c..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/hinfo_13.c +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2002 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: hinfo_13.c,v 1.42 2004/03/05 05:10:11 marka Exp $ */ - -/* - * Reviewed: Wed Mar 15 16:47:10 PST 2000 by halley. - */ - -#ifndef RDATA_GENERIC_HINFO_13_C -#define RDATA_GENERIC_HINFO_13_C - -#define RRTYPE_HINFO_ATTRIBUTES (0) - -static inline isc_result_t -fromtext_hinfo(ARGS_FROMTEXT) { - isc_token_t token; - int i; - - UNUSED(type); - UNUSED(rdclass); - UNUSED(origin); - UNUSED(options); - UNUSED(callbacks); - - REQUIRE(type == 13); - - for (i = 0; i < 2; i++) { - RETERR(isc_lex_getmastertoken(lexer, &token, - isc_tokentype_qstring, - ISC_FALSE)); - RETTOK(txt_fromtext(&token.value.as_textregion, target)); - } - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -totext_hinfo(ARGS_TOTEXT) { - isc_region_t region; - - UNUSED(tctx); - - REQUIRE(rdata->type == 13); - REQUIRE(rdata->length != 0); - - dns_rdata_toregion(rdata, ®ion); - RETERR(txt_totext(®ion, target)); - RETERR(str_totext(" ", target)); - return (txt_totext(®ion, target)); -} - -static inline isc_result_t -fromwire_hinfo(ARGS_FROMWIRE) { - - REQUIRE(type == 13); - - UNUSED(type); - UNUSED(dctx); - UNUSED(rdclass); - UNUSED(options); - - RETERR(txt_fromwire(source, target)); - return (txt_fromwire(source, target)); -} - -static inline isc_result_t -towire_hinfo(ARGS_TOWIRE) { - - UNUSED(cctx); - - REQUIRE(rdata->type == 13); - REQUIRE(rdata->length != 0); - - return (mem_tobuffer(target, rdata->data, rdata->length)); -} - -static inline int -compare_hinfo(ARGS_COMPARE) { - isc_region_t r1; - isc_region_t r2; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 13); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - dns_rdata_toregion(rdata1, &r1); - dns_rdata_toregion(rdata2, &r2); - return (isc_region_compare(&r1, &r2)); -} - -static inline isc_result_t -fromstruct_hinfo(ARGS_FROMSTRUCT) { - dns_rdata_hinfo_t *hinfo = source; - - REQUIRE(type == 13); - REQUIRE(source != NULL); - REQUIRE(hinfo->common.rdtype == type); - REQUIRE(hinfo->common.rdclass == rdclass); - - UNUSED(type); - UNUSED(rdclass); - - RETERR(uint8_tobuffer(hinfo->cpu_len, target)); - RETERR(mem_tobuffer(target, hinfo->cpu, hinfo->cpu_len)); - RETERR(uint8_tobuffer(hinfo->os_len, target)); - return (mem_tobuffer(target, hinfo->os, hinfo->os_len)); -} - -static inline isc_result_t -tostruct_hinfo(ARGS_TOSTRUCT) { - dns_rdata_hinfo_t *hinfo = target; - isc_region_t region; - - REQUIRE(rdata->type == 13); - REQUIRE(target != NULL); - REQUIRE(rdata->length != 0); - - hinfo->common.rdclass = rdata->rdclass; - hinfo->common.rdtype = rdata->type; - ISC_LINK_INIT(&hinfo->common, link); - - dns_rdata_toregion(rdata, ®ion); - hinfo->cpu_len = uint8_fromregion(®ion); - isc_region_consume(®ion, 1); - hinfo->cpu = mem_maybedup(mctx, region.base, hinfo->cpu_len); - if (hinfo->cpu == NULL) - return (ISC_R_NOMEMORY); - isc_region_consume(®ion, hinfo->cpu_len); - - hinfo->os_len = uint8_fromregion(®ion); - isc_region_consume(®ion, 1); - hinfo->os = mem_maybedup(mctx, region.base, hinfo->os_len); - if (hinfo->os == NULL) - goto cleanup; - - hinfo->mctx = mctx; - return (ISC_R_SUCCESS); - - cleanup: - if (mctx != NULL && hinfo->cpu != NULL) - isc_mem_free(mctx, hinfo->cpu); - return (ISC_R_NOMEMORY); -} - -static inline void -freestruct_hinfo(ARGS_FREESTRUCT) { - dns_rdata_hinfo_t *hinfo = source; - - REQUIRE(source != NULL); - - if (hinfo->mctx == NULL) - return; - - if (hinfo->cpu != NULL) - isc_mem_free(hinfo->mctx, hinfo->cpu); - if (hinfo->os != NULL) - isc_mem_free(hinfo->mctx, hinfo->os); - hinfo->mctx = NULL; -} - -static inline isc_result_t -additionaldata_hinfo(ARGS_ADDLDATA) { - REQUIRE(rdata->type == 13); - - UNUSED(add); - UNUSED(arg); - UNUSED(rdata); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_hinfo(ARGS_DIGEST) { - isc_region_t r; - - REQUIRE(rdata->type == 13); - - dns_rdata_toregion(rdata, &r); - - return ((digest)(arg, &r)); -} - -static inline isc_boolean_t -checkowner_hinfo(ARGS_CHECKOWNER) { - - REQUIRE(type == 13); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_hinfo(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 13); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_GENERIC_HINFO_13_C */ diff --git a/contrib/bind9/lib/dns/rdata/generic/hinfo_13.h b/contrib/bind9/lib/dns/rdata/generic/hinfo_13.h deleted file mode 100644 index e542c48..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/hinfo_13.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef GENERIC_HINFO_13_H -#define GENERIC_HINFO_13_H 1 - -/* $Id: hinfo_13.h,v 1.23 2004/03/05 05:10:12 marka Exp $ */ - -typedef struct dns_rdata_hinfo { - dns_rdatacommon_t common; - isc_mem_t *mctx; - char *cpu; - char *os; - isc_uint8_t cpu_len; - isc_uint8_t os_len; -} dns_rdata_hinfo_t; - -#endif /* GENERIC_HINFO_13_H */ diff --git a/contrib/bind9/lib/dns/rdata/generic/ipseckey_45.c b/contrib/bind9/lib/dns/rdata/generic/ipseckey_45.c deleted file mode 100644 index 3c3736e..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/ipseckey_45.c +++ /dev/null @@ -1,462 +0,0 @@ -/* - * Copyright (C) 2005 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: ipseckey_45.c,v 1.2.2.1 2005/07/07 03:17:36 marka Exp $ */ - -#ifndef RDATA_GENERIC_IPSECKEY_45_C -#define RDATA_GENERIC_IPSECKEY_45_C - -#include <string.h> - -#include <isc/net.h> - -#define RRTYPE_IPSECKEY_ATTRIBUTES (0) - -static inline isc_result_t -fromtext_ipseckey(ARGS_FROMTEXT) { - isc_token_t token; - dns_name_t name; - isc_buffer_t buffer; - unsigned int gateway; - struct in_addr addr; - unsigned char addr6[16]; - isc_region_t region; - - REQUIRE(type == 45); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(callbacks); - - /* - * Precedence. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - if (token.value.as_ulong > 0xffU) - RETTOK(ISC_R_RANGE); - RETERR(uint8_tobuffer(token.value.as_ulong, target)); - - /* - * Gateway type. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - if (token.value.as_ulong > 0x3U) - RETTOK(ISC_R_RANGE); - RETERR(uint8_tobuffer(token.value.as_ulong, target)); - gateway = token.value.as_ulong; - - /* - * Algorithm. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - if (token.value.as_ulong > 0xffU) - RETTOK(ISC_R_RANGE); - RETERR(uint8_tobuffer(token.value.as_ulong, target)); - - /* - * Gateway. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - - switch (gateway) { - case 0: - if (strcmp(DNS_AS_STR(token), ".") != 0) - RETTOK(DNS_R_SYNTAX); - break; - - case 1: - if (getquad(DNS_AS_STR(token), &addr, lexer, callbacks) != 1) - RETTOK(DNS_R_BADDOTTEDQUAD); - isc_buffer_availableregion(target, ®ion); - if (region.length < 4) - return (ISC_R_NOSPACE); - memcpy(region.base, &addr, 4); - isc_buffer_add(target, 4); - break; - - case 2: - if (inet_pton(AF_INET6, DNS_AS_STR(token), addr6) != 1) - RETTOK(DNS_R_BADAAAA); - isc_buffer_availableregion(target, ®ion); - if (region.length < 16) - return (ISC_R_NOSPACE); - memcpy(region.base, addr6, 16); - isc_buffer_add(target, 16); - break; - - case 3: - dns_name_init(&name, NULL); - buffer_fromregion(&buffer, &token.value.as_region); - origin = (origin != NULL) ? origin : dns_rootname; - RETTOK(dns_name_fromtext(&name, &buffer, origin, - options, target)); - break; - } - - /* - * Public key. - */ - return (isc_base64_tobuffer(lexer, target, -1)); -} - -static inline isc_result_t -totext_ipseckey(ARGS_TOTEXT) { - isc_region_t region; - dns_name_t name; - dns_name_t prefix; - isc_boolean_t sub; - char buf[sizeof("255 ")]; - unsigned short num; - unsigned short gateway; - - REQUIRE(rdata->type == 45); - REQUIRE(rdata->length >= 3); - - dns_name_init(&name, NULL); - dns_name_init(&prefix, NULL); - - if (rdata->data[1] > 3U) - return (ISC_R_NOTIMPLEMENTED); - - if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) - RETERR(str_totext("( ", target)); - - /* - * Precendence. - */ - dns_rdata_toregion(rdata, ®ion); - num = uint8_fromregion(®ion); - isc_region_consume(®ion, 1); - sprintf(buf, "%u ", num); - RETERR(str_totext(buf, target)); - - /* - * Gateway type. - */ - gateway = uint8_fromregion(®ion); - isc_region_consume(®ion, 1); - sprintf(buf, "%u ", gateway); - RETERR(str_totext(buf, target)); - - /* - * Algorithm. - */ - num = uint8_fromregion(®ion); - isc_region_consume(®ion, 1); - sprintf(buf, "%u ", num); - RETERR(str_totext(buf, target)); - - /* - * Gateway. - */ - switch (gateway) { - case 0: - RETERR(str_totext(".", target)); - break; - - case 1: - RETERR(inet_totext(AF_INET, ®ion, target)); - isc_region_consume(®ion, 4); - break; - - case 2: - RETERR(inet_totext(AF_INET6, ®ion, target)); - isc_region_consume(®ion, 16); - break; - - case 3: - dns_name_fromregion(&name, ®ion); - sub = name_prefix(&name, tctx->origin, &prefix); - RETERR(dns_name_totext(&prefix, sub, target)); - isc_region_consume(®ion, name_length(&name)); - break; - } - - /* - * Key. - */ - if (region.length > 0U) { - RETERR(str_totext(tctx->linebreak, target)); - RETERR(isc_base64_totext(®ion, tctx->width - 2, - tctx->linebreak, target)); - } - - if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) - RETERR(str_totext(" )", target)); - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -fromwire_ipseckey(ARGS_FROMWIRE) { - dns_name_t name; - isc_region_t region; - - REQUIRE(type == 45); - - UNUSED(type); - UNUSED(rdclass); - - dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE); - - dns_name_init(&name, NULL); - - isc_buffer_activeregion(source, ®ion); - if (region.length < 3) - return (ISC_R_UNEXPECTEDEND); - - switch (region.base[1]) { - case 0: - isc_buffer_forward(source, region.length); - return (mem_tobuffer(target, region.base, region.length)); - - case 1: - if (region.length < 7) - return (ISC_R_UNEXPECTEDEND); - isc_buffer_forward(source, region.length); - return (mem_tobuffer(target, region.base, region.length)); - - case 2: - if (region.length < 19) - return (ISC_R_UNEXPECTEDEND); - isc_buffer_forward(source, region.length); - return (mem_tobuffer(target, region.base, region.length)); - - case 3: - RETERR(mem_tobuffer(target, region.base, 3)); - isc_buffer_forward(source, 3); - RETERR(dns_name_fromwire(&name, source, dctx, options, target)); - isc_buffer_activeregion(source, ®ion); - return(mem_tobuffer(target, region.base, region.length)); - - default: - return (ISC_R_NOTIMPLEMENTED); - } -} - -static inline isc_result_t -towire_ipseckey(ARGS_TOWIRE) { - isc_region_t region; - - REQUIRE(rdata->type == 45); - REQUIRE(rdata->length != 0); - - UNUSED(cctx); - - dns_rdata_toregion(rdata, ®ion); - return (mem_tobuffer(target, region.base, region.length)); -} - -static inline int -compare_ipseckey(ARGS_COMPARE) { - isc_region_t region1; - isc_region_t region2; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 45); - REQUIRE(rdata1->length >= 3); - REQUIRE(rdata2->length >= 3); - - dns_rdata_toregion(rdata1, ®ion1); - dns_rdata_toregion(rdata2, ®ion2); - - return (isc_region_compare(®ion1, ®ion2)); -} - -static inline isc_result_t -fromstruct_ipseckey(ARGS_FROMSTRUCT) { - dns_rdata_ipseckey_t *ipseckey = source; - isc_region_t region; - isc_uint32_t n; - - REQUIRE(type == 45); - REQUIRE(source != NULL); - REQUIRE(ipseckey->common.rdtype == type); - REQUIRE(ipseckey->common.rdclass == rdclass); - - UNUSED(type); - UNUSED(rdclass); - - if (ipseckey->gateway_type > 3U) - return (ISC_R_NOTIMPLEMENTED); - - RETERR(uint8_tobuffer(ipseckey->precedence, target)); - RETERR(uint8_tobuffer(ipseckey->gateway_type, target)); - RETERR(uint8_tobuffer(ipseckey->algorithm, target)); - - switch (ipseckey->gateway_type) { - case 0: - break; - - case 1: - n = ntohl(ipseckey->in_addr.s_addr); - RETERR(uint32_tobuffer(n, target)); - break; - - case 2: - RETERR(mem_tobuffer(target, ipseckey->in6_addr.s6_addr, 16)); - break; - - case 3: - dns_name_toregion(&ipseckey->gateway, ®ion); - RETERR(isc_buffer_copyregion(target, ®ion)); - break; - } - - return (mem_tobuffer(target, ipseckey->key, ipseckey->keylength)); -} - -static inline isc_result_t -tostruct_ipseckey(ARGS_TOSTRUCT) { - isc_region_t region; - dns_rdata_ipseckey_t *ipseckey = target; - dns_name_t name; - isc_uint32_t n; - - REQUIRE(rdata->type == 45); - REQUIRE(target != NULL); - REQUIRE(rdata->length >= 3); - - if (rdata->data[1] > 3U) - return (ISC_R_NOTIMPLEMENTED); - - ipseckey->common.rdclass = rdata->rdclass; - ipseckey->common.rdtype = rdata->type; - ISC_LINK_INIT(&ipseckey->common, link); - - dns_name_init(&name, NULL); - dns_rdata_toregion(rdata, ®ion); - - ipseckey->precedence = uint8_fromregion(®ion); - isc_region_consume(®ion, 1); - - ipseckey->gateway_type = uint8_fromregion(®ion); - isc_region_consume(®ion, 1); - - ipseckey->algorithm = uint8_fromregion(®ion); - isc_region_consume(®ion, 1); - - switch (ipseckey->gateway_type) { - case 0: - break; - - case 1: - n = uint32_fromregion(®ion); - ipseckey->in_addr.s_addr = htonl(n); - isc_region_consume(®ion, 4); - break; - - case 2: - memcpy(ipseckey->in6_addr.s6_addr, region.base, 16); - isc_region_consume(®ion, 16); - break; - - case 3: - dns_name_init(&ipseckey->gateway, NULL); - dns_name_fromregion(&name, ®ion); - RETERR(name_duporclone(&name, mctx, &ipseckey->gateway)); - isc_region_consume(®ion, name_length(&name)); - break; - } - - ipseckey->keylength = region.length; - if (ipseckey->keylength != 0U) { - ipseckey->key = mem_maybedup(mctx, region.base, - ipseckey->keylength); - if (ipseckey->key == NULL) { - if (ipseckey->gateway_type == 3) - dns_name_free(&ipseckey->gateway, - ipseckey->mctx); - return (ISC_R_NOMEMORY); - } - } else - ipseckey->key = NULL; - - ipseckey->mctx = mctx; - return (ISC_R_SUCCESS); -} - -static inline void -freestruct_ipseckey(ARGS_FREESTRUCT) { - dns_rdata_ipseckey_t *ipseckey = source; - - REQUIRE(source != NULL); - REQUIRE(ipseckey->common.rdtype == 45); - - if (ipseckey->mctx == NULL) - return; - - if (ipseckey->gateway_type == 3) - dns_name_free(&ipseckey->gateway, ipseckey->mctx); - - if (ipseckey->key != NULL) - isc_mem_free(ipseckey->mctx, ipseckey->key); - - ipseckey->mctx = NULL; -} - -static inline isc_result_t -additionaldata_ipseckey(ARGS_ADDLDATA) { - - REQUIRE(rdata->type == 45); - - UNUSED(rdata); - UNUSED(add); - UNUSED(arg); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_ipseckey(ARGS_DIGEST) { - isc_region_t region; - - REQUIRE(rdata->type == 45); - - dns_rdata_toregion(rdata, ®ion); - return ((digest)(arg, ®ion)); -} - -static inline isc_boolean_t -checkowner_ipseckey(ARGS_CHECKOWNER) { - - REQUIRE(type == 45); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_ipseckey(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 45); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_GENERIC_IPSECKEY_45_C */ diff --git a/contrib/bind9/lib/dns/rdata/generic/ipseckey_45.h b/contrib/bind9/lib/dns/rdata/generic/ipseckey_45.h deleted file mode 100644 index b766fa0..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/ipseckey_45.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2005 Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: ipseckey_45.h,v 1.2.2.1 2005/07/07 03:17:36 marka Exp $ */ - -#ifndef GENERIC_IPSECKEY_45_H -#define GENERIC_IPSECKEY_45_H 1 - -typedef struct dns_rdata_ipseckey { - dns_rdatacommon_t common; - isc_mem_t *mctx; - isc_uint8_t precedence; - isc_uint8_t gateway_type; - isc_uint8_t algorithm; - struct in_addr in_addr; /* gateway type 1 */ - struct in6_addr in6_addr; /* gateway type 2 */ - dns_name_t gateway; /* gateway type 3 */ - unsigned char *key; - isc_uint16_t keylength; -} dns_rdata_ipseckey_t; - -#endif /* GENERIC_IPSECKEY_45_H */ diff --git a/contrib/bind9/lib/dns/rdata/generic/isdn_20.c b/contrib/bind9/lib/dns/rdata/generic/isdn_20.c deleted file mode 100644 index 1813759..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/isdn_20.c +++ /dev/null @@ -1,234 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2002 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: isdn_20.c,v 1.34.18.2 2005/04/29 00:16:33 marka Exp $ */ - -/* Reviewed: Wed Mar 15 16:53:11 PST 2000 by bwelling */ - -/* RFC1183 */ - -#ifndef RDATA_GENERIC_ISDN_20_C -#define RDATA_GENERIC_ISDN_20_C - -#define RRTYPE_ISDN_ATTRIBUTES (0) - -static inline isc_result_t -fromtext_isdn(ARGS_FROMTEXT) { - isc_token_t token; - - REQUIRE(type == 20); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(origin); - UNUSED(options); - UNUSED(callbacks); - - /* ISDN-address */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_qstring, - ISC_FALSE)); - RETTOK(txt_fromtext(&token.value.as_textregion, target)); - - /* sa: optional */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_qstring, - ISC_TRUE)); - if (token.type != isc_tokentype_string && - token.type != isc_tokentype_qstring) { - isc_lex_ungettoken(lexer, &token); - return (ISC_R_SUCCESS); - } - RETTOK(txt_fromtext(&token.value.as_textregion, target)); - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -totext_isdn(ARGS_TOTEXT) { - isc_region_t region; - - REQUIRE(rdata->type == 20); - REQUIRE(rdata->length != 0); - - UNUSED(tctx); - - dns_rdata_toregion(rdata, ®ion); - RETERR(txt_totext(®ion, target)); - if (region.length == 0) - return (ISC_R_SUCCESS); - RETERR(str_totext(" ", target)); - return (txt_totext(®ion, target)); -} - -static inline isc_result_t -fromwire_isdn(ARGS_FROMWIRE) { - REQUIRE(type == 20); - - UNUSED(type); - UNUSED(dctx); - UNUSED(rdclass); - UNUSED(options); - - RETERR(txt_fromwire(source, target)); - if (buffer_empty(source)) - return (ISC_R_SUCCESS); - return (txt_fromwire(source, target)); -} - -static inline isc_result_t -towire_isdn(ARGS_TOWIRE) { - UNUSED(cctx); - - REQUIRE(rdata->type == 20); - REQUIRE(rdata->length != 0); - - return (mem_tobuffer(target, rdata->data, rdata->length)); -} - -static inline int -compare_isdn(ARGS_COMPARE) { - isc_region_t r1; - isc_region_t r2; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 20); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - dns_rdata_toregion(rdata1, &r1); - dns_rdata_toregion(rdata2, &r2); - return (isc_region_compare(&r1, &r2)); -} - -static inline isc_result_t -fromstruct_isdn(ARGS_FROMSTRUCT) { - dns_rdata_isdn_t *isdn = source; - - REQUIRE(type == 20); - REQUIRE(source != NULL); - REQUIRE(isdn->common.rdtype == type); - REQUIRE(isdn->common.rdclass == rdclass); - - UNUSED(type); - UNUSED(rdclass); - - RETERR(uint8_tobuffer(isdn->isdn_len, target)); - RETERR(mem_tobuffer(target, isdn->isdn, isdn->isdn_len)); - RETERR(uint8_tobuffer(isdn->subaddress_len, target)); - return (mem_tobuffer(target, isdn->subaddress, isdn->subaddress_len)); -} - -static inline isc_result_t -tostruct_isdn(ARGS_TOSTRUCT) { - dns_rdata_isdn_t *isdn = target; - isc_region_t r; - - REQUIRE(rdata->type == 20); - REQUIRE(target != NULL); - REQUIRE(rdata->length != 0); - - isdn->common.rdclass = rdata->rdclass; - isdn->common.rdtype = rdata->type; - ISC_LINK_INIT(&isdn->common, link); - - dns_rdata_toregion(rdata, &r); - - isdn->isdn_len = uint8_fromregion(&r); - isc_region_consume(&r, 1); - isdn->isdn = mem_maybedup(mctx, r.base, isdn->isdn_len); - if (isdn->isdn == NULL) - return (ISC_R_NOMEMORY); - isc_region_consume(&r, isdn->isdn_len); - - isdn->subaddress_len = uint8_fromregion(&r); - isc_region_consume(&r, 1); - isdn->subaddress = mem_maybedup(mctx, r.base, isdn->subaddress_len); - if (isdn->subaddress == NULL) - goto cleanup; - - isdn->mctx = mctx; - return (ISC_R_SUCCESS); - - cleanup: - if (mctx != NULL && isdn->isdn != NULL) - isc_mem_free(mctx, isdn->isdn); - return (ISC_R_NOMEMORY); -} - -static inline void -freestruct_isdn(ARGS_FREESTRUCT) { - dns_rdata_isdn_t *isdn = source; - - REQUIRE(source != NULL); - - if (isdn->mctx == NULL) - return; - - if (isdn->isdn != NULL) - isc_mem_free(isdn->mctx, isdn->isdn); - if (isdn->subaddress != NULL) - isc_mem_free(isdn->mctx, isdn->subaddress); - isdn->mctx = NULL; -} - -static inline isc_result_t -additionaldata_isdn(ARGS_ADDLDATA) { - REQUIRE(rdata->type == 20); - - UNUSED(rdata); - UNUSED(add); - UNUSED(arg); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_isdn(ARGS_DIGEST) { - isc_region_t r; - - REQUIRE(rdata->type == 20); - - dns_rdata_toregion(rdata, &r); - - return ((digest)(arg, &r)); -} - -static inline isc_boolean_t -checkowner_isdn(ARGS_CHECKOWNER) { - - REQUIRE(type == 20); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_isdn(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 20); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_GENERIC_ISDN_20_C */ diff --git a/contrib/bind9/lib/dns/rdata/generic/isdn_20.h b/contrib/bind9/lib/dns/rdata/generic/isdn_20.h deleted file mode 100644 index 6a51317..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/isdn_20.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef GENERIC_ISDN_20_H -#define GENERIC_ISDN_20_H 1 - -/* $Id: isdn_20.h,v 1.14.18.2 2005/04/29 00:16:33 marka Exp $ */ - -/*! - * \brief Per RFC1183 */ - -typedef struct dns_rdata_isdn { - dns_rdatacommon_t common; - isc_mem_t *mctx; - char *isdn; - char *subaddress; - isc_uint8_t isdn_len; - isc_uint8_t subaddress_len; -} dns_rdata_isdn_t; - -#endif /* GENERIC_ISDN_20_H */ diff --git a/contrib/bind9/lib/dns/rdata/generic/key_25.c b/contrib/bind9/lib/dns/rdata/generic/key_25.c deleted file mode 100644 index 24dc10f..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/key_25.c +++ /dev/null @@ -1,312 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: key_25.c,v 1.47.18.2 2005/04/29 00:16:33 marka Exp $ */ - -/* - * Reviewed: Wed Mar 15 16:47:10 PST 2000 by halley. - */ - -/* RFC2535 */ - -#ifndef RDATA_GENERIC_KEY_25_C -#define RDATA_GENERIC_KEY_25_C - -#include <dst/dst.h> - -#define RRTYPE_KEY_ATTRIBUTES (0) - -static inline isc_result_t -fromtext_key(ARGS_FROMTEXT) { - isc_token_t token; - dns_secalg_t alg; - dns_secproto_t proto; - dns_keyflags_t flags; - - REQUIRE(type == 25); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(origin); - UNUSED(options); - UNUSED(callbacks); - - /* flags */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - RETTOK(dns_keyflags_fromtext(&flags, &token.value.as_textregion)); - RETERR(uint16_tobuffer(flags, target)); - - /* protocol */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - RETTOK(dns_secproto_fromtext(&proto, &token.value.as_textregion)); - RETERR(mem_tobuffer(target, &proto, 1)); - - /* algorithm */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - RETTOK(dns_secalg_fromtext(&alg, &token.value.as_textregion)); - RETERR(mem_tobuffer(target, &alg, 1)); - - /* No Key? */ - if ((flags & 0xc000) == 0xc000) - return (ISC_R_SUCCESS); - - return (isc_base64_tobuffer(lexer, target, -1)); -} - -static inline isc_result_t -totext_key(ARGS_TOTEXT) { - isc_region_t sr; - char buf[sizeof("64000")]; - unsigned int flags; - unsigned char algorithm; - - REQUIRE(rdata->type == 25); - REQUIRE(rdata->length != 0); - - dns_rdata_toregion(rdata, &sr); - - /* flags */ - flags = uint16_fromregion(&sr); - isc_region_consume(&sr, 2); - sprintf(buf, "%u", flags); - RETERR(str_totext(buf, target)); - RETERR(str_totext(" ", target)); - - /* protocol */ - sprintf(buf, "%u", sr.base[0]); - isc_region_consume(&sr, 1); - RETERR(str_totext(buf, target)); - RETERR(str_totext(" ", target)); - - /* algorithm */ - algorithm = sr.base[0]; - sprintf(buf, "%u", algorithm); - isc_region_consume(&sr, 1); - RETERR(str_totext(buf, target)); - - /* No Key? */ - if ((flags & 0xc000) == 0xc000) - return (ISC_R_SUCCESS); - - /* key */ - if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) - RETERR(str_totext(" (", target)); - RETERR(str_totext(tctx->linebreak, target)); - RETERR(isc_base64_totext(&sr, tctx->width - 2, - tctx->linebreak, target)); - - if ((tctx->flags & DNS_STYLEFLAG_COMMENT) != 0) - RETERR(str_totext(tctx->linebreak, target)); - else if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) - RETERR(str_totext(" ", target)); - - if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) - RETERR(str_totext(")", target)); - - if ((tctx->flags & DNS_STYLEFLAG_COMMENT) != 0) { - isc_region_t tmpr; - - RETERR(str_totext(" ; key id = ", target)); - dns_rdata_toregion(rdata, &tmpr); - sprintf(buf, "%u", dst_region_computeid(&tmpr, algorithm)); - RETERR(str_totext(buf, target)); - } - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -fromwire_key(ARGS_FROMWIRE) { - isc_region_t sr; - - REQUIRE(type == 25); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(dctx); - UNUSED(options); - - isc_buffer_activeregion(source, &sr); - if (sr.length < 4) - return (ISC_R_UNEXPECTEDEND); - - isc_buffer_forward(source, sr.length); - return (mem_tobuffer(target, sr.base, sr.length)); -} - -static inline isc_result_t -towire_key(ARGS_TOWIRE) { - isc_region_t sr; - - REQUIRE(rdata->type == 25); - REQUIRE(rdata->length != 0); - - UNUSED(cctx); - - dns_rdata_toregion(rdata, &sr); - return (mem_tobuffer(target, sr.base, sr.length)); -} - -static inline int -compare_key(ARGS_COMPARE) { - isc_region_t r1; - isc_region_t r2; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 25); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - dns_rdata_toregion(rdata1, &r1); - dns_rdata_toregion(rdata2, &r2); - return (isc_region_compare(&r1, &r2)); -} - -static inline isc_result_t -fromstruct_key(ARGS_FROMSTRUCT) { - dns_rdata_key_t *key = source; - - REQUIRE(type == 25); - REQUIRE(source != NULL); - REQUIRE(key->common.rdtype == type); - REQUIRE(key->common.rdclass == rdclass); - - UNUSED(type); - UNUSED(rdclass); - - /* Flags */ - RETERR(uint16_tobuffer(key->flags, target)); - - /* Protocol */ - RETERR(uint8_tobuffer(key->protocol, target)); - - /* Algorithm */ - RETERR(uint8_tobuffer(key->algorithm, target)); - - /* Data */ - return (mem_tobuffer(target, key->data, key->datalen)); -} - -static inline isc_result_t -tostruct_key(ARGS_TOSTRUCT) { - dns_rdata_key_t *key = target; - isc_region_t sr; - - REQUIRE(rdata->type == 25); - REQUIRE(target != NULL); - REQUIRE(rdata->length != 0); - - key->common.rdclass = rdata->rdclass; - key->common.rdtype = rdata->type; - ISC_LINK_INIT(&key->common, link); - - dns_rdata_toregion(rdata, &sr); - - /* Flags */ - if (sr.length < 2) - return (ISC_R_UNEXPECTEDEND); - key->flags = uint16_fromregion(&sr); - isc_region_consume(&sr, 2); - - /* Protocol */ - if (sr.length < 1) - return (ISC_R_UNEXPECTEDEND); - key->protocol = uint8_fromregion(&sr); - isc_region_consume(&sr, 1); - - /* Algorithm */ - if (sr.length < 1) - return (ISC_R_UNEXPECTEDEND); - key->algorithm = uint8_fromregion(&sr); - isc_region_consume(&sr, 1); - - /* Data */ - key->datalen = sr.length; - key->data = mem_maybedup(mctx, sr.base, key->datalen); - if (key->data == NULL) - return (ISC_R_NOMEMORY); - - key->mctx = mctx; - return (ISC_R_SUCCESS); -} - -static inline void -freestruct_key(ARGS_FREESTRUCT) { - dns_rdata_key_t *key = (dns_rdata_key_t *) source; - - REQUIRE(source != NULL); - REQUIRE(key->common.rdtype == 25); - - if (key->mctx == NULL) - return; - - if (key->data != NULL) - isc_mem_free(key->mctx, key->data); - key->mctx = NULL; -} - -static inline isc_result_t -additionaldata_key(ARGS_ADDLDATA) { - REQUIRE(rdata->type == 25); - - UNUSED(rdata); - UNUSED(add); - UNUSED(arg); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_key(ARGS_DIGEST) { - isc_region_t r; - - REQUIRE(rdata->type == 25); - - dns_rdata_toregion(rdata, &r); - - return ((digest)(arg, &r)); -} - -static inline isc_boolean_t -checkowner_key(ARGS_CHECKOWNER) { - - REQUIRE(type == 25); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_key(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 25); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_GENERIC_KEY_25_C */ diff --git a/contrib/bind9/lib/dns/rdata/generic/key_25.h b/contrib/bind9/lib/dns/rdata/generic/key_25.h deleted file mode 100644 index 03400db..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/key_25.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef GENERIC_KEY_25_H -#define GENERIC_KEY_25_H 1 - -/* $Id: key_25.h,v 1.15.18.2 2005/04/29 00:16:33 marka Exp $ */ - -/*! - * \brief Per RFC2535 */ - -typedef struct dns_rdata_key_t { - dns_rdatacommon_t common; - isc_mem_t * mctx; - isc_uint16_t flags; - isc_uint8_t protocol; - isc_uint8_t algorithm; - isc_uint16_t datalen; - unsigned char * data; -} dns_rdata_key_t; - - -#endif /* GENERIC_KEY_25_H */ diff --git a/contrib/bind9/lib/dns/rdata/generic/loc_29.c b/contrib/bind9/lib/dns/rdata/generic/loc_29.c deleted file mode 100644 index c93ac90..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/loc_29.c +++ /dev/null @@ -1,794 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: loc_29.c,v 1.41.18.2 2005/04/29 00:16:34 marka Exp $ */ - -/* Reviewed: Wed Mar 15 18:13:09 PST 2000 by explorer */ - -/* RFC1876 */ - -#ifndef RDATA_GENERIC_LOC_29_C -#define RDATA_GENERIC_LOC_29_C - -#define RRTYPE_LOC_ATTRIBUTES (0) - -static inline isc_result_t -fromtext_loc(ARGS_FROMTEXT) { - isc_token_t token; - int d1, m1, s1; - int d2, m2, s2; - unsigned char size; - unsigned char hp; - unsigned char vp; - unsigned char version; - isc_boolean_t east = ISC_FALSE; - isc_boolean_t north = ISC_FALSE; - long tmp; - long m; - long cm; - long poweroften[8] = { 1, 10, 100, 1000, - 10000, 100000, 1000000, 10000000 }; - int man; - int exp; - char *e; - int i; - unsigned long latitude; - unsigned long longitude; - unsigned long altitude; - - REQUIRE(type == 29); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(origin); - UNUSED(options); - - /* - * Defaults. - */ - m1 = s1 = 0; - m2 = s2 = 0; - size = 0x12; /* 1.00m */ - hp = 0x16; /* 10000.00 m */ - vp = 0x13; /* 10.00 m */ - version = 0; - - /* - * Degrees. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - if (token.value.as_ulong > 90U) - RETTOK(ISC_R_RANGE); - d1 = (int)token.value.as_ulong; - /* - * Minutes. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - if (strcasecmp(DNS_AS_STR(token), "N") == 0) - north = ISC_TRUE; - if (north || strcasecmp(DNS_AS_STR(token), "S") == 0) - goto getlong; - m1 = strtol(DNS_AS_STR(token), &e, 10); - if (*e != 0) - RETTOK(DNS_R_SYNTAX); - if (m1 < 0 || m1 > 59) - RETTOK(ISC_R_RANGE); - if (d1 == 90 && m1 != 0) - RETTOK(ISC_R_RANGE); - - /* - * Seconds. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - if (strcasecmp(DNS_AS_STR(token), "N") == 0) - north = ISC_TRUE; - if (north || strcasecmp(DNS_AS_STR(token), "S") == 0) - goto getlong; - s1 = strtol(DNS_AS_STR(token), &e, 10); - if (*e != 0 && *e != '.') - RETTOK(DNS_R_SYNTAX); - if (s1 < 0 || s1 > 59) - RETTOK(ISC_R_RANGE); - if (*e == '.') { - const char *l; - e++; - for (i = 0; i < 3; i++) { - if (*e == 0) - break; - if ((tmp = decvalue(*e++)) < 0) - RETTOK(DNS_R_SYNTAX); - s1 *= 10; - s1 += tmp; - } - for (; i < 3; i++) - s1 *= 10; - l = e; - while (*e != 0) { - if (decvalue(*e++) < 0) - RETTOK(DNS_R_SYNTAX); - } - if (*l != '\0' && callbacks != NULL) { - const char *file = isc_lex_getsourcename(lexer); - unsigned long line = isc_lex_getsourceline(lexer); - - if (file == NULL) - file = "UNKNOWN"; - (*callbacks->warn)(callbacks, "%s: %s:%u: '%s' extra " - "precision digits ignored", - "dns_rdata_fromtext", file, line, - DNS_AS_STR(token)); - } - } else - s1 *= 1000; - if (d1 == 90 && s1 != 0) - RETTOK(ISC_R_RANGE); - - /* - * Direction. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - if (strcasecmp(DNS_AS_STR(token), "N") == 0) - north = ISC_TRUE; - if (!north && strcasecmp(DNS_AS_STR(token), "S") != 0) - RETTOK(DNS_R_SYNTAX); - - getlong: - /* - * Degrees. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - if (token.value.as_ulong > 180U) - RETTOK(ISC_R_RANGE); - d2 = (int)token.value.as_ulong; - - /* - * Minutes. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - if (strcasecmp(DNS_AS_STR(token), "E") == 0) - east = ISC_TRUE; - if (east || strcasecmp(DNS_AS_STR(token), "W") == 0) - goto getalt; - m2 = strtol(DNS_AS_STR(token), &e, 10); - if (*e != 0) - RETTOK(DNS_R_SYNTAX); - if (m2 < 0 || m2 > 59) - RETTOK(ISC_R_RANGE); - if (d2 == 180 && m2 != 0) - RETTOK(ISC_R_RANGE); - - /* - * Seconds. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - if (strcasecmp(DNS_AS_STR(token), "E") == 0) - east = ISC_TRUE; - if (east || strcasecmp(DNS_AS_STR(token), "W") == 0) - goto getalt; - s2 = strtol(DNS_AS_STR(token), &e, 10); - if (*e != 0 && *e != '.') - RETTOK(DNS_R_SYNTAX); - if (s2 < 0 || s2 > 59) - RETTOK(ISC_R_RANGE); - if (*e == '.') { - const char *l; - e++; - for (i = 0; i < 3; i++) { - if (*e == 0) - break; - if ((tmp = decvalue(*e++)) < 0) - RETTOK(DNS_R_SYNTAX); - s2 *= 10; - s2 += tmp; - } - for (; i < 3; i++) - s2 *= 10; - l = e; - while (*e != 0) { - if (decvalue(*e++) < 0) - RETTOK(DNS_R_SYNTAX); - } - if (*l != '\0' && callbacks != NULL) { - const char *file = isc_lex_getsourcename(lexer); - unsigned long line = isc_lex_getsourceline(lexer); - - if (file == NULL) - file = "UNKNOWN"; - (*callbacks->warn)(callbacks, "%s: %s:%u: '%s' extra " - "precision digits ignored", - "dns_rdata_fromtext", - file, line, DNS_AS_STR(token)); - } - } else - s2 *= 1000; - if (d2 == 180 && s2 != 0) - RETTOK(ISC_R_RANGE); - - /* - * Direction. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - if (strcasecmp(DNS_AS_STR(token), "E") == 0) - east = ISC_TRUE; - if (!east && strcasecmp(DNS_AS_STR(token), "W") != 0) - RETTOK(DNS_R_SYNTAX); - - getalt: - /* - * Altitude. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - m = strtol(DNS_AS_STR(token), &e, 10); - if (*e != 0 && *e != '.' && *e != 'm') - RETTOK(DNS_R_SYNTAX); - if (m < -100000 || m > 42849672) - RETTOK(ISC_R_RANGE); - cm = 0; - if (*e == '.') { - e++; - for (i = 0; i < 2; i++) { - if (*e == 0 || *e == 'm') - break; - if ((tmp = decvalue(*e++)) < 0) - return (DNS_R_SYNTAX); - cm *= 10; - if (m < 0) - cm -= tmp; - else - cm += tmp; - } - for (; i < 2; i++) - cm *= 10; - } - if (*e == 'm') - e++; - if (*e != 0) - RETTOK(DNS_R_SYNTAX); - if (m == -100000 && cm != 0) - RETTOK(ISC_R_RANGE); - if (m == 42849672 && cm > 95) - RETTOK(ISC_R_RANGE); - /* - * Adjust base. - */ - altitude = m + 100000; - altitude *= 100; - altitude += cm; - - /* - * Size: optional. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_TRUE)); - if (token.type == isc_tokentype_eol || - token.type == isc_tokentype_eof) { - isc_lex_ungettoken(lexer, &token); - goto encode; - } - m = strtol(DNS_AS_STR(token), &e, 10); - if (*e != 0 && *e != '.' && *e != 'm') - RETTOK(DNS_R_SYNTAX); - if (m < 0 || m > 90000000) - RETTOK(ISC_R_RANGE); - cm = 0; - if (*e == '.') { - e++; - for (i = 0; i < 2; i++) { - if (*e == 0 || *e == 'm') - break; - if ((tmp = decvalue(*e++)) < 0) - RETTOK(DNS_R_SYNTAX); - cm *= 10; - cm += tmp; - } - for (; i < 2; i++) - cm *= 10; - } - if (*e == 'm') - e++; - if (*e != 0) - RETTOK(DNS_R_SYNTAX); - /* - * We don't just multiply out as we will overflow. - */ - if (m > 0) { - for (exp = 0; exp < 7; exp++) - if (m < poweroften[exp+1]) - break; - man = m / poweroften[exp]; - exp += 2; - } else { - if (cm >= 10) { - man = cm / 10; - exp = 1; - } else { - man = cm; - exp = 0; - } - } - size = (man << 4) + exp; - - /* - * Horizontal precision: optional. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_TRUE)); - if (token.type == isc_tokentype_eol || - token.type == isc_tokentype_eof) { - isc_lex_ungettoken(lexer, &token); - goto encode; - } - m = strtol(DNS_AS_STR(token), &e, 10); - if (*e != 0 && *e != '.' && *e != 'm') - RETTOK(DNS_R_SYNTAX); - if (m < 0 || m > 90000000) - RETTOK(ISC_R_RANGE); - cm = 0; - if (*e == '.') { - e++; - for (i = 0; i < 2; i++) { - if (*e == 0 || *e == 'm') - break; - if ((tmp = decvalue(*e++)) < 0) - RETTOK(DNS_R_SYNTAX); - cm *= 10; - cm += tmp; - } - for (; i < 2; i++) - cm *= 10; - } - if (*e == 'm') - e++; - if (*e != 0) - RETTOK(DNS_R_SYNTAX); - /* - * We don't just multiply out as we will overflow. - */ - if (m > 0) { - for (exp = 0; exp < 7; exp++) - if (m < poweroften[exp+1]) - break; - man = m / poweroften[exp]; - exp += 2; - } else if (cm >= 10) { - man = cm / 10; - exp = 1; - } else { - man = cm; - exp = 0; - } - hp = (man << 4) + exp; - - /* - * Vertical precision: optional. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_TRUE)); - if (token.type == isc_tokentype_eol || - token.type == isc_tokentype_eof) { - isc_lex_ungettoken(lexer, &token); - goto encode; - } - m = strtol(DNS_AS_STR(token), &e, 10); - if (*e != 0 && *e != '.' && *e != 'm') - RETTOK(DNS_R_SYNTAX); - if (m < 0 || m > 90000000) - RETTOK(ISC_R_RANGE); - cm = 0; - if (*e == '.') { - e++; - for (i = 0; i < 2; i++) { - if (*e == 0 || *e == 'm') - break; - if ((tmp = decvalue(*e++)) < 0) - RETTOK(DNS_R_SYNTAX); - cm *= 10; - cm += tmp; - } - for (; i < 2; i++) - cm *= 10; - } - if (*e == 'm') - e++; - if (*e != 0) - RETTOK(DNS_R_SYNTAX); - /* - * We don't just multiply out as we will overflow. - */ - if (m > 0) { - for (exp = 0; exp < 7; exp++) - if (m < poweroften[exp+1]) - break; - man = m / poweroften[exp]; - exp += 2; - } else if (cm >= 10) { - man = cm / 10; - exp = 1; - } else { - man = cm; - exp = 0; - } - vp = (man << 4) + exp; - - encode: - RETERR(mem_tobuffer(target, &version, 1)); - RETERR(mem_tobuffer(target, &size, 1)); - RETERR(mem_tobuffer(target, &hp, 1)); - RETERR(mem_tobuffer(target, &vp, 1)); - if (north) - latitude = 0x80000000 + ( d1 * 3600 + m1 * 60 ) * 1000 + s1; - else - latitude = 0x80000000 - ( d1 * 3600 + m1 * 60 ) * 1000 - s1; - RETERR(uint32_tobuffer(latitude, target)); - - if (east) - longitude = 0x80000000 + ( d2 * 3600 + m2 * 60 ) * 1000 + s2; - else - longitude = 0x80000000 - ( d2 * 3600 + m2 * 60 ) * 1000 - s2; - RETERR(uint32_tobuffer(longitude, target)); - - return (uint32_tobuffer(altitude, target)); -} - -static inline isc_result_t -totext_loc(ARGS_TOTEXT) { - int d1, m1, s1, fs1; - int d2, m2, s2, fs2; - unsigned long latitude; - unsigned long longitude; - unsigned long altitude; - isc_boolean_t north; - isc_boolean_t east; - isc_boolean_t below; - isc_region_t sr; - char buf[sizeof("89 59 59.999 N 179 59 59.999 E " - "42849672.95m 90000000m 90000000m 90000000m")]; - char sbuf[sizeof("90000000m")]; - char hbuf[sizeof("90000000m")]; - char vbuf[sizeof("90000000m")]; - unsigned char size, hp, vp; - unsigned long poweroften[8] = { 1, 10, 100, 1000, - 10000, 100000, 1000000, 10000000 }; - - UNUSED(tctx); - - REQUIRE(rdata->type == 29); - REQUIRE(rdata->length != 0); - - dns_rdata_toregion(rdata, &sr); - - /* version = sr.base[0]; */ - size = sr.base[1]; - if ((size&0x0f)> 1) - sprintf(sbuf, "%lum", (size>>4) * poweroften[(size&0x0f)-2]); - else - sprintf(sbuf, "0.%02lum", (size>>4) * poweroften[(size&0x0f)]); - hp = sr.base[2]; - if ((hp&0x0f)> 1) - sprintf(hbuf, "%lum", (hp>>4) * poweroften[(hp&0x0f)-2]); - else - sprintf(hbuf, "0.%02lum", (hp>>4) * poweroften[(hp&0x0f)]); - vp = sr.base[3]; - if ((vp&0x0f)> 1) - sprintf(vbuf, "%lum", (vp>>4) * poweroften[(vp&0x0f)-2]); - else - sprintf(vbuf, "0.%02lum", (vp>>4) * poweroften[(vp&0x0f)]); - isc_region_consume(&sr, 4); - - latitude = uint32_fromregion(&sr); - isc_region_consume(&sr, 4); - if (latitude >= 0x80000000) { - north = ISC_TRUE; - latitude -= 0x80000000; - } else { - north = ISC_FALSE; - latitude = 0x80000000 - latitude; - } - fs1 = (int)(latitude % 1000); - latitude /= 1000; - s1 = (int)(latitude % 60); - latitude /= 60; - m1 = (int)(latitude % 60); - latitude /= 60; - d1 = (int)latitude; - - longitude = uint32_fromregion(&sr); - isc_region_consume(&sr, 4); - if (longitude >= 0x80000000) { - east = ISC_TRUE; - longitude -= 0x80000000; - } else { - east = ISC_FALSE; - longitude = 0x80000000 - longitude; - } - fs2 = (int)(longitude % 1000); - longitude /= 1000; - s2 = (int)(longitude % 60); - longitude /= 60; - m2 = (int)(longitude % 60); - longitude /= 60; - d2 = (int)longitude; - - altitude = uint32_fromregion(&sr); - isc_region_consume(&sr, 4); - if (altitude < 10000000U) { - below = ISC_TRUE; - altitude = 10000000 - altitude; - } else { - below =ISC_FALSE; - altitude -= 10000000; - } - - sprintf(buf, "%d %d %d.%03d %s %d %d %d.%03d %s %s%ld.%02ldm %s %s %s", - d1, m1, s1, fs1, north ? "N" : "S", - d2, m2, s2, fs2, east ? "E" : "W", - below ? "-" : "", altitude/100, altitude % 100, - sbuf, hbuf, vbuf); - - return (str_totext(buf, target)); -} - -static inline isc_result_t -fromwire_loc(ARGS_FROMWIRE) { - isc_region_t sr; - unsigned char c; - unsigned long latitude; - unsigned long longitude; - - REQUIRE(type == 29); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(dctx); - UNUSED(options); - - isc_buffer_activeregion(source, &sr); - if (sr.length < 1) - return (ISC_R_UNEXPECTEDEND); - if (sr.base[0] != 0) - return (ISC_R_NOTIMPLEMENTED); - if (sr.length < 16) - return (ISC_R_UNEXPECTEDEND); - - /* - * Size. - */ - c = sr.base[1]; - if (c != 0) - if ((c&0xf) > 9 || ((c>>4)&0xf) > 9 || ((c>>4)&0xf) == 0) - return (ISC_R_RANGE); - - /* - * Horizontal precision. - */ - c = sr.base[2]; - if (c != 0) - if ((c&0xf) > 9 || ((c>>4)&0xf) > 9 || ((c>>4)&0xf) == 0) - return (ISC_R_RANGE); - - /* - * Vertical precision. - */ - c = sr.base[3]; - if (c != 0) - if ((c&0xf) > 9 || ((c>>4)&0xf) > 9 || ((c>>4)&0xf) == 0) - return (ISC_R_RANGE); - isc_region_consume(&sr, 4); - - /* - * Latitude. - */ - latitude = uint32_fromregion(&sr); - if (latitude < (0x80000000UL - 90 * 3600000) || - latitude > (0x80000000UL + 90 * 3600000)) - return (ISC_R_RANGE); - isc_region_consume(&sr, 4); - - /* - * Longitude. - */ - longitude = uint32_fromregion(&sr); - if (longitude < (0x80000000UL - 180 * 3600000) || - longitude > (0x80000000UL + 180 * 3600000)) - return (ISC_R_RANGE); - - /* - * Altitiude. - * All values possible. - */ - - isc_buffer_activeregion(source, &sr); - isc_buffer_forward(source, 16); - return (mem_tobuffer(target, sr.base, 16)); -} - -static inline isc_result_t -towire_loc(ARGS_TOWIRE) { - UNUSED(cctx); - - REQUIRE(rdata->type == 29); - REQUIRE(rdata->length != 0); - - return (mem_tobuffer(target, rdata->data, rdata->length)); -} - -static inline int -compare_loc(ARGS_COMPARE) { - isc_region_t r1; - isc_region_t r2; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 29); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - dns_rdata_toregion(rdata1, &r1); - dns_rdata_toregion(rdata2, &r2); - return (isc_region_compare(&r1, &r2)); -} - -static inline isc_result_t -fromstruct_loc(ARGS_FROMSTRUCT) { - dns_rdata_loc_t *loc = source; - isc_uint8_t c; - - REQUIRE(type == 29); - REQUIRE(source != NULL); - REQUIRE(loc->common.rdtype == type); - REQUIRE(loc->common.rdclass == rdclass); - - UNUSED(type); - UNUSED(rdclass); - - if (loc->v.v0.version != 0) - return (ISC_R_NOTIMPLEMENTED); - RETERR(uint8_tobuffer(loc->v.v0.version, target)); - - c = loc->v.v0.size; - if ((c&0xf) > 9 || ((c>>4)&0xf) > 9 || ((c>>4)&0xf) == 0) - return (ISC_R_RANGE); - RETERR(uint8_tobuffer(loc->v.v0.size, target)); - - c = loc->v.v0.horizontal; - if ((c&0xf) > 9 || ((c>>4)&0xf) > 9 || ((c>>4)&0xf) == 0) - return (ISC_R_RANGE); - RETERR(uint8_tobuffer(loc->v.v0.horizontal, target)); - - c = loc->v.v0.vertical; - if ((c&0xf) > 9 || ((c>>4)&0xf) > 9 || ((c>>4)&0xf) == 0) - return (ISC_R_RANGE); - RETERR(uint8_tobuffer(loc->v.v0.vertical, target)); - - if (loc->v.v0.latitude < (0x80000000UL - 90 * 3600000) || - loc->v.v0.latitude > (0x80000000UL + 90 * 3600000)) - return (ISC_R_RANGE); - RETERR(uint32_tobuffer(loc->v.v0.latitude, target)); - - if (loc->v.v0.longitude < (0x80000000UL - 180 * 3600000) || - loc->v.v0.longitude > (0x80000000UL + 180 * 3600000)) - return (ISC_R_RANGE); - RETERR(uint32_tobuffer(loc->v.v0.longitude, target)); - return (uint32_tobuffer(loc->v.v0.altitude, target)); -} - -static inline isc_result_t -tostruct_loc(ARGS_TOSTRUCT) { - dns_rdata_loc_t *loc = target; - isc_region_t r; - isc_uint8_t version; - - REQUIRE(rdata->type == 29); - REQUIRE(target != NULL); - REQUIRE(rdata->length != 0); - - UNUSED(mctx); - - dns_rdata_toregion(rdata, &r); - version = uint8_fromregion(&r); - if (version != 0) - return (ISC_R_NOTIMPLEMENTED); - - loc->common.rdclass = rdata->rdclass; - loc->common.rdtype = rdata->type; - ISC_LINK_INIT(&loc->common, link); - - loc->v.v0.version = version; - isc_region_consume(&r, 1); - loc->v.v0.size = uint8_fromregion(&r); - isc_region_consume(&r, 1); - loc->v.v0.horizontal = uint8_fromregion(&r); - isc_region_consume(&r, 1); - loc->v.v0.vertical = uint8_fromregion(&r); - isc_region_consume(&r, 1); - loc->v.v0.latitude = uint32_fromregion(&r); - isc_region_consume(&r, 4); - loc->v.v0.longitude = uint32_fromregion(&r); - isc_region_consume(&r, 4); - loc->v.v0.altitude = uint32_fromregion(&r); - isc_region_consume(&r, 4); - return (ISC_R_SUCCESS); -} - -static inline void -freestruct_loc(ARGS_FREESTRUCT) { - dns_rdata_loc_t *loc = source; - - REQUIRE(source != NULL); - REQUIRE(loc->common.rdtype == 29); - - UNUSED(source); - UNUSED(loc); -} - -static inline isc_result_t -additionaldata_loc(ARGS_ADDLDATA) { - REQUIRE(rdata->type == 29); - - UNUSED(rdata); - UNUSED(add); - UNUSED(arg); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_loc(ARGS_DIGEST) { - isc_region_t r; - - REQUIRE(rdata->type == 29); - - dns_rdata_toregion(rdata, &r); - - return ((digest)(arg, &r)); -} - -static inline isc_boolean_t -checkowner_loc(ARGS_CHECKOWNER) { - - REQUIRE(type == 29); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_loc(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 29); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_GENERIC_LOC_29_C */ diff --git a/contrib/bind9/lib/dns/rdata/generic/loc_29.h b/contrib/bind9/lib/dns/rdata/generic/loc_29.h deleted file mode 100644 index d8eae16..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/loc_29.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef GENERIC_LOC_29_H -#define GENERIC_LOC_29_H 1 - -/* $Id: loc_29.h,v 1.15.18.2 2005/04/29 00:16:34 marka Exp $ */ - -/*! - * \brief Per RFC1876 */ - -typedef struct dns_rdata_loc_0 { - isc_uint8_t version; /* must be first and zero */ - isc_uint8_t size; - isc_uint8_t horizontal; - isc_uint8_t vertical; - isc_uint32_t latitude; - isc_uint32_t longitude; - isc_uint32_t altitude; -} dns_rdata_loc_0_t; - -typedef struct dns_rdata_loc { - dns_rdatacommon_t common; - union { - dns_rdata_loc_0_t v0; - } v; -} dns_rdata_loc_t; - -#endif /* GENERIC_LOC_29_H */ diff --git a/contrib/bind9/lib/dns/rdata/generic/mb_7.c b/contrib/bind9/lib/dns/rdata/generic/mb_7.c deleted file mode 100644 index 94c622d..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/mb_7.c +++ /dev/null @@ -1,234 +0,0 @@ -/* - * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: mb_7.c,v 1.43 2004/03/05 05:10:13 marka Exp $ */ - -/* Reviewed: Wed Mar 15 17:31:26 PST 2000 by bwelling */ - -#ifndef RDATA_GENERIC_MB_7_C -#define RDATA_GENERIC_MB_7_C - -#define RRTYPE_MB_ATTRIBUTES (0) - -static inline isc_result_t -fromtext_mb(ARGS_FROMTEXT) { - isc_token_t token; - dns_name_t name; - isc_buffer_t buffer; - - REQUIRE(type == 7); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(callbacks); - - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - - dns_name_init(&name, NULL); - buffer_fromregion(&buffer, &token.value.as_region); - origin = (origin != NULL) ? origin : dns_rootname; - RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target)); - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -totext_mb(ARGS_TOTEXT) { - isc_region_t region; - dns_name_t name; - dns_name_t prefix; - isc_boolean_t sub; - - REQUIRE(rdata->type == 7); - REQUIRE(rdata->length != 0); - - dns_name_init(&name, NULL); - dns_name_init(&prefix, NULL); - - dns_rdata_toregion(rdata, ®ion); - dns_name_fromregion(&name, ®ion); - - sub = name_prefix(&name, tctx->origin, &prefix); - - return (dns_name_totext(&prefix, sub, target)); -} - -static inline isc_result_t -fromwire_mb(ARGS_FROMWIRE) { - dns_name_t name; - - REQUIRE(type == 7); - - UNUSED(type); - UNUSED(rdclass); - - dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14); - - dns_name_init(&name, NULL); - return (dns_name_fromwire(&name, source, dctx, options, target)); -} - -static inline isc_result_t -towire_mb(ARGS_TOWIRE) { - dns_name_t name; - dns_offsets_t offsets; - isc_region_t region; - - REQUIRE(rdata->type == 7); - REQUIRE(rdata->length != 0); - - dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14); - - dns_name_init(&name, offsets); - dns_rdata_toregion(rdata, ®ion); - dns_name_fromregion(&name, ®ion); - - return (dns_name_towire(&name, cctx, target)); -} - -static inline int -compare_mb(ARGS_COMPARE) { - dns_name_t name1; - dns_name_t name2; - isc_region_t region1; - isc_region_t region2; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 7); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - dns_name_init(&name1, NULL); - dns_name_init(&name2, NULL); - - dns_rdata_toregion(rdata1, ®ion1); - dns_rdata_toregion(rdata2, ®ion2); - - dns_name_fromregion(&name1, ®ion1); - dns_name_fromregion(&name2, ®ion2); - - return (dns_name_rdatacompare(&name1, &name2)); -} - -static inline isc_result_t -fromstruct_mb(ARGS_FROMSTRUCT) { - dns_rdata_mb_t *mb = source; - isc_region_t region; - - REQUIRE(type == 7); - REQUIRE(source != NULL); - REQUIRE(mb->common.rdtype == type); - REQUIRE(mb->common.rdclass == rdclass); - - UNUSED(type); - UNUSED(rdclass); - - dns_name_toregion(&mb->mb, ®ion); - return (isc_buffer_copyregion(target, ®ion)); -} - -static inline isc_result_t -tostruct_mb(ARGS_TOSTRUCT) { - isc_region_t region; - dns_rdata_mb_t *mb = target; - dns_name_t name; - - REQUIRE(rdata->type == 7); - REQUIRE(target != NULL); - REQUIRE(rdata->length != 0); - - mb->common.rdclass = rdata->rdclass; - mb->common.rdtype = rdata->type; - ISC_LINK_INIT(&mb->common, link); - - dns_name_init(&name, NULL); - dns_rdata_toregion(rdata, ®ion); - dns_name_fromregion(&name, ®ion); - dns_name_init(&mb->mb, NULL); - RETERR(name_duporclone(&name, mctx, &mb->mb)); - mb->mctx = mctx; - return (ISC_R_SUCCESS); -} - -static inline void -freestruct_mb(ARGS_FREESTRUCT) { - dns_rdata_mb_t *mb = source; - - REQUIRE(source != NULL); - - if (mb->mctx == NULL) - return; - - dns_name_free(&mb->mb, mb->mctx); - mb->mctx = NULL; -} - -static inline isc_result_t -additionaldata_mb(ARGS_ADDLDATA) { - dns_name_t name; - dns_offsets_t offsets; - isc_region_t region; - - REQUIRE(rdata->type == 7); - - dns_name_init(&name, offsets); - dns_rdata_toregion(rdata, ®ion); - dns_name_fromregion(&name, ®ion); - - return ((add)(arg, &name, dns_rdatatype_a)); -} - -static inline isc_result_t -digest_mb(ARGS_DIGEST) { - isc_region_t r; - dns_name_t name; - - REQUIRE(rdata->type == 7); - - dns_rdata_toregion(rdata, &r); - dns_name_init(&name, NULL); - dns_name_fromregion(&name, &r); - - return (dns_name_digest(&name, digest, arg)); -} - -static inline isc_boolean_t -checkowner_mb(ARGS_CHECKOWNER) { - - REQUIRE(type == 7); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (dns_name_ismailbox(name)); -} - -static inline isc_boolean_t -checknames_mb(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 7); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_GENERIC_MB_7_C */ diff --git a/contrib/bind9/lib/dns/rdata/generic/mb_7.h b/contrib/bind9/lib/dns/rdata/generic/mb_7.h deleted file mode 100644 index f6a8b35..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/mb_7.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* */ -#ifndef GENERIC_MB_7_H -#define GENERIC_MB_7_H 1 - -/* $Id: mb_7.h,v 1.23.18.2 2005/04/29 00:16:34 marka Exp $ */ - -typedef struct dns_rdata_mb { - dns_rdatacommon_t common; - isc_mem_t *mctx; - dns_name_t mb; -} dns_rdata_mb_t; - -#endif /* GENERIC_MB_7_H */ diff --git a/contrib/bind9/lib/dns/rdata/generic/md_3.c b/contrib/bind9/lib/dns/rdata/generic/md_3.c deleted file mode 100644 index 75e4970..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/md_3.c +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: md_3.c,v 1.45 2004/03/05 05:10:13 marka Exp $ */ - -/* Reviewed: Wed Mar 15 17:48:20 PST 2000 by bwelling */ - -#ifndef RDATA_GENERIC_MD_3_C -#define RDATA_GENERIC_MD_3_C - -#define RRTYPE_MD_ATTRIBUTES (0) - -static inline isc_result_t -fromtext_md(ARGS_FROMTEXT) { - isc_token_t token; - dns_name_t name; - isc_buffer_t buffer; - - REQUIRE(type == 3); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(callbacks); - - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - - dns_name_init(&name, NULL); - buffer_fromregion(&buffer, &token.value.as_region); - origin = (origin != NULL) ? origin : dns_rootname; - RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target)); - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -totext_md(ARGS_TOTEXT) { - isc_region_t region; - dns_name_t name; - dns_name_t prefix; - isc_boolean_t sub; - - REQUIRE(rdata->type == 3); - REQUIRE(rdata->length != 0); - - dns_name_init(&name, NULL); - dns_name_init(&prefix, NULL); - - dns_rdata_toregion(rdata, ®ion); - dns_name_fromregion(&name, ®ion); - - sub = name_prefix(&name, tctx->origin, &prefix); - - return (dns_name_totext(&prefix, sub, target)); -} - -static inline isc_result_t -fromwire_md(ARGS_FROMWIRE) { - dns_name_t name; - - REQUIRE(type == 3); - - UNUSED(type); - UNUSED(rdclass); - - dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14); - - dns_name_init(&name, NULL); - return (dns_name_fromwire(&name, source, dctx, options, target)); -} - -static inline isc_result_t -towire_md(ARGS_TOWIRE) { - dns_name_t name; - dns_offsets_t offsets; - isc_region_t region; - - REQUIRE(rdata->type == 3); - REQUIRE(rdata->length != 0); - - dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14); - - dns_name_init(&name, offsets); - dns_rdata_toregion(rdata, ®ion); - dns_name_fromregion(&name, ®ion); - - return (dns_name_towire(&name, cctx, target)); -} - -static inline int -compare_md(ARGS_COMPARE) { - dns_name_t name1; - dns_name_t name2; - isc_region_t region1; - isc_region_t region2; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 3); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - dns_name_init(&name1, NULL); - dns_name_init(&name2, NULL); - - dns_rdata_toregion(rdata1, ®ion1); - dns_rdata_toregion(rdata2, ®ion2); - - dns_name_fromregion(&name1, ®ion1); - dns_name_fromregion(&name2, ®ion2); - - return (dns_name_rdatacompare(&name1, &name2)); -} - -static inline isc_result_t -fromstruct_md(ARGS_FROMSTRUCT) { - dns_rdata_md_t *md = source; - isc_region_t region; - - REQUIRE(type == 3); - REQUIRE(source != NULL); - REQUIRE(md->common.rdtype == type); - REQUIRE(md->common.rdclass == rdclass); - - UNUSED(type); - UNUSED(rdclass); - - dns_name_toregion(&md->md, ®ion); - return (isc_buffer_copyregion(target, ®ion)); -} - -static inline isc_result_t -tostruct_md(ARGS_TOSTRUCT) { - dns_rdata_md_t *md = target; - isc_region_t r; - dns_name_t name; - - REQUIRE(rdata->type == 3); - REQUIRE(target != NULL); - REQUIRE(rdata->length != 0); - - md->common.rdclass = rdata->rdclass; - md->common.rdtype = rdata->type; - ISC_LINK_INIT(&md->common, link); - - dns_name_init(&name, NULL); - dns_rdata_toregion(rdata, &r); - dns_name_fromregion(&name, &r); - dns_name_init(&md->md, NULL); - RETERR(name_duporclone(&name, mctx, &md->md)); - md->mctx = mctx; - return (ISC_R_SUCCESS); -} - -static inline void -freestruct_md(ARGS_FREESTRUCT) { - dns_rdata_md_t *md = source; - - REQUIRE(source != NULL); - REQUIRE(md->common.rdtype == 3); - - if (md->mctx == NULL) - return; - - dns_name_free(&md->md, md->mctx); - md->mctx = NULL; -} - -static inline isc_result_t -additionaldata_md(ARGS_ADDLDATA) { - dns_name_t name; - dns_offsets_t offsets; - isc_region_t region; - - REQUIRE(rdata->type == 3); - - dns_name_init(&name, offsets); - dns_rdata_toregion(rdata, ®ion); - dns_name_fromregion(&name, ®ion); - - return ((add)(arg, &name, dns_rdatatype_a)); -} - -static inline isc_result_t -digest_md(ARGS_DIGEST) { - isc_region_t r; - dns_name_t name; - - REQUIRE(rdata->type == 3); - - dns_rdata_toregion(rdata, &r); - dns_name_init(&name, NULL); - dns_name_fromregion(&name, &r); - - return (dns_name_digest(&name, digest, arg)); -} - -static inline isc_boolean_t -checkowner_md(ARGS_CHECKOWNER) { - - REQUIRE(type == 3); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_md(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 3); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_GENERIC_MD_3_C */ diff --git a/contrib/bind9/lib/dns/rdata/generic/md_3.h b/contrib/bind9/lib/dns/rdata/generic/md_3.h deleted file mode 100644 index 578ce66..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/md_3.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* */ -#ifndef GENERIC_MD_3_H -#define GENERIC_MD_3_H 1 - -/* $Id: md_3.h,v 1.24.18.2 2005/04/29 00:16:35 marka Exp $ */ - -typedef struct dns_rdata_md { - dns_rdatacommon_t common; - isc_mem_t *mctx; - dns_name_t md; -} dns_rdata_md_t; - - -#endif /* GENERIC_MD_3_H */ diff --git a/contrib/bind9/lib/dns/rdata/generic/mf_4.c b/contrib/bind9/lib/dns/rdata/generic/mf_4.c deleted file mode 100644 index 362d300..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/mf_4.c +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: mf_4.c,v 1.43 2004/03/05 05:10:14 marka Exp $ */ - -/* reviewed: Wed Mar 15 17:47:33 PST 2000 by brister */ - -#ifndef RDATA_GENERIC_MF_4_C -#define RDATA_GENERIC_MF_4_C - -#define RRTYPE_MF_ATTRIBUTES (0) - -static inline isc_result_t -fromtext_mf(ARGS_FROMTEXT) { - isc_token_t token; - dns_name_t name; - isc_buffer_t buffer; - - REQUIRE(type == 4); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(callbacks); - - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - - dns_name_init(&name, NULL); - buffer_fromregion(&buffer, &token.value.as_region); - origin = (origin != NULL) ? origin : dns_rootname; - RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target)); - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -totext_mf(ARGS_TOTEXT) { - isc_region_t region; - dns_name_t name; - dns_name_t prefix; - isc_boolean_t sub; - - REQUIRE(rdata->type == 4); - REQUIRE(rdata->length != 0); - - dns_name_init(&name, NULL); - dns_name_init(&prefix, NULL); - - dns_rdata_toregion(rdata, ®ion); - dns_name_fromregion(&name, ®ion); - - sub = name_prefix(&name, tctx->origin, &prefix); - - return (dns_name_totext(&prefix, sub, target)); -} - -static inline isc_result_t -fromwire_mf(ARGS_FROMWIRE) { - dns_name_t name; - - REQUIRE(type == 4); - - UNUSED(type); - UNUSED(rdclass); - - dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14); - - dns_name_init(&name, NULL); - return (dns_name_fromwire(&name, source, dctx, options, target)); -} - -static inline isc_result_t -towire_mf(ARGS_TOWIRE) { - dns_name_t name; - dns_offsets_t offsets; - isc_region_t region; - - REQUIRE(rdata->type == 4); - REQUIRE(rdata->length != 0); - - dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14); - - dns_name_init(&name, offsets); - dns_rdata_toregion(rdata, ®ion); - dns_name_fromregion(&name, ®ion); - - return (dns_name_towire(&name, cctx, target)); -} - -static inline int -compare_mf(ARGS_COMPARE) { - dns_name_t name1; - dns_name_t name2; - isc_region_t region1; - isc_region_t region2; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 4); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - dns_name_init(&name1, NULL); - dns_name_init(&name2, NULL); - - dns_rdata_toregion(rdata1, ®ion1); - dns_rdata_toregion(rdata2, ®ion2); - - dns_name_fromregion(&name1, ®ion1); - dns_name_fromregion(&name2, ®ion2); - - return (dns_name_rdatacompare(&name1, &name2)); -} - -static inline isc_result_t -fromstruct_mf(ARGS_FROMSTRUCT) { - dns_rdata_mf_t *mf = source; - isc_region_t region; - - REQUIRE(type == 4); - REQUIRE(source != NULL); - REQUIRE(mf->common.rdtype == type); - REQUIRE(mf->common.rdclass == rdclass); - - UNUSED(type); - UNUSED(rdclass); - - dns_name_toregion(&mf->mf, ®ion); - return (isc_buffer_copyregion(target, ®ion)); -} - -static inline isc_result_t -tostruct_mf(ARGS_TOSTRUCT) { - dns_rdata_mf_t *mf = target; - isc_region_t r; - dns_name_t name; - - REQUIRE(rdata->type == 4); - REQUIRE(target != NULL); - REQUIRE(rdata->length != 0); - - mf->common.rdclass = rdata->rdclass; - mf->common.rdtype = rdata->type; - ISC_LINK_INIT(&mf->common, link); - - dns_name_init(&name, NULL); - dns_rdata_toregion(rdata, &r); - dns_name_fromregion(&name, &r); - dns_name_init(&mf->mf, NULL); - RETERR(name_duporclone(&name, mctx, &mf->mf)); - mf->mctx = mctx; - return (ISC_R_SUCCESS); -} - -static inline void -freestruct_mf(ARGS_FREESTRUCT) { - dns_rdata_mf_t *mf = source; - - REQUIRE(source != NULL); - REQUIRE(mf->common.rdtype == 4); - - if (mf->mctx == NULL) - return; - dns_name_free(&mf->mf, mf->mctx); - mf->mctx = NULL; -} - -static inline isc_result_t -additionaldata_mf(ARGS_ADDLDATA) { - dns_name_t name; - dns_offsets_t offsets; - isc_region_t region; - - REQUIRE(rdata->type == 4); - - dns_name_init(&name, offsets); - dns_rdata_toregion(rdata, ®ion); - dns_name_fromregion(&name, ®ion); - - return ((add)(arg, &name, dns_rdatatype_a)); -} - -static inline isc_result_t -digest_mf(ARGS_DIGEST) { - isc_region_t r; - dns_name_t name; - - REQUIRE(rdata->type == 4); - - dns_rdata_toregion(rdata, &r); - dns_name_init(&name, NULL); - dns_name_fromregion(&name, &r); - - return (dns_name_digest(&name, digest, arg)); -} - -static inline isc_boolean_t -checkowner_mf(ARGS_CHECKOWNER) { - - REQUIRE(type == 4); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_mf(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 4); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_GENERIC_MF_4_C */ diff --git a/contrib/bind9/lib/dns/rdata/generic/mf_4.h b/contrib/bind9/lib/dns/rdata/generic/mf_4.h deleted file mode 100644 index 2be0eec..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/mf_4.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* */ -#ifndef GENERIC_MF_4_H -#define GENERIC_MF_4_H 1 - -/* $Id: mf_4.h,v 1.22.18.2 2005/04/29 00:16:35 marka Exp $ */ - -typedef struct dns_rdata_mf { - dns_rdatacommon_t common; - isc_mem_t *mctx; - dns_name_t mf; -} dns_rdata_mf_t; - -#endif /* GENERIC_MF_4_H */ diff --git a/contrib/bind9/lib/dns/rdata/generic/mg_8.c b/contrib/bind9/lib/dns/rdata/generic/mg_8.c deleted file mode 100644 index 602d820..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/mg_8.c +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: mg_8.c,v 1.41 2004/03/05 05:10:14 marka Exp $ */ - -/* reviewed: Wed Mar 15 17:49:21 PST 2000 by brister */ - -#ifndef RDATA_GENERIC_MG_8_C -#define RDATA_GENERIC_MG_8_C - -#define RRTYPE_MG_ATTRIBUTES (0) - -static inline isc_result_t -fromtext_mg(ARGS_FROMTEXT) { - isc_token_t token; - dns_name_t name; - isc_buffer_t buffer; - - REQUIRE(type == 8); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(callbacks); - - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - - dns_name_init(&name, NULL); - buffer_fromregion(&buffer, &token.value.as_region); - origin = (origin != NULL) ? origin : dns_rootname; - RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target)); - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -totext_mg(ARGS_TOTEXT) { - isc_region_t region; - dns_name_t name; - dns_name_t prefix; - isc_boolean_t sub; - - REQUIRE(rdata->type == 8); - REQUIRE(rdata->length != 0); - - dns_name_init(&name, NULL); - dns_name_init(&prefix, NULL); - - dns_rdata_toregion(rdata, ®ion); - dns_name_fromregion(&name, ®ion); - - sub = name_prefix(&name, tctx->origin, &prefix); - - return (dns_name_totext(&prefix, sub, target)); -} - -static inline isc_result_t -fromwire_mg(ARGS_FROMWIRE) { - dns_name_t name; - - REQUIRE(type == 8); - - UNUSED(type); - UNUSED(rdclass); - - dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14); - - dns_name_init(&name, NULL); - return (dns_name_fromwire(&name, source, dctx, options, target)); -} - -static inline isc_result_t -towire_mg(ARGS_TOWIRE) { - dns_name_t name; - dns_offsets_t offsets; - isc_region_t region; - - REQUIRE(rdata->type == 8); - REQUIRE(rdata->length != 0); - - dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14); - - dns_name_init(&name, offsets); - dns_rdata_toregion(rdata, ®ion); - dns_name_fromregion(&name, ®ion); - - return (dns_name_towire(&name, cctx, target)); -} - -static inline int -compare_mg(ARGS_COMPARE) { - dns_name_t name1; - dns_name_t name2; - isc_region_t region1; - isc_region_t region2; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 8); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - dns_name_init(&name1, NULL); - dns_name_init(&name2, NULL); - - dns_rdata_toregion(rdata1, ®ion1); - dns_rdata_toregion(rdata2, ®ion2); - - dns_name_fromregion(&name1, ®ion1); - dns_name_fromregion(&name2, ®ion2); - - return (dns_name_rdatacompare(&name1, &name2)); -} - -static inline isc_result_t -fromstruct_mg(ARGS_FROMSTRUCT) { - dns_rdata_mg_t *mg = source; - isc_region_t region; - - REQUIRE(type == 8); - REQUIRE(source != NULL); - REQUIRE(mg->common.rdtype == type); - REQUIRE(mg->common.rdclass == rdclass); - - UNUSED(type); - UNUSED(rdclass); - - dns_name_toregion(&mg->mg, ®ion); - return (isc_buffer_copyregion(target, ®ion)); -} - -static inline isc_result_t -tostruct_mg(ARGS_TOSTRUCT) { - isc_region_t region; - dns_rdata_mg_t *mg = target; - dns_name_t name; - - REQUIRE(rdata->type == 8); - REQUIRE(target != NULL); - REQUIRE(rdata->length != 0); - - mg->common.rdclass = rdata->rdclass; - mg->common.rdtype = rdata->type; - ISC_LINK_INIT(&mg->common, link); - - dns_name_init(&name, NULL); - dns_rdata_toregion(rdata, ®ion); - dns_name_fromregion(&name, ®ion); - dns_name_init(&mg->mg, NULL); - RETERR(name_duporclone(&name, mctx, &mg->mg)); - mg->mctx = mctx; - return (ISC_R_SUCCESS); -} - -static inline void -freestruct_mg(ARGS_FREESTRUCT) { - dns_rdata_mg_t *mg = source; - - REQUIRE(source != NULL); - REQUIRE(mg->common.rdtype == 8); - - if (mg->mctx == NULL) - return; - dns_name_free(&mg->mg, mg->mctx); - mg->mctx = NULL; -} - -static inline isc_result_t -additionaldata_mg(ARGS_ADDLDATA) { - REQUIRE(rdata->type == 8); - - UNUSED(add); - UNUSED(arg); - UNUSED(rdata); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_mg(ARGS_DIGEST) { - isc_region_t r; - dns_name_t name; - - REQUIRE(rdata->type == 8); - - dns_rdata_toregion(rdata, &r); - dns_name_init(&name, NULL); - dns_name_fromregion(&name, &r); - - return (dns_name_digest(&name, digest, arg)); -} - -static inline isc_boolean_t -checkowner_mg(ARGS_CHECKOWNER) { - - REQUIRE(type == 8); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (dns_name_ismailbox(name)); -} - -static inline isc_boolean_t -checknames_mg(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 8); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_GENERIC_MG_8_C */ diff --git a/contrib/bind9/lib/dns/rdata/generic/mg_8.h b/contrib/bind9/lib/dns/rdata/generic/mg_8.h deleted file mode 100644 index 5679c17..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/mg_8.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* */ -#ifndef GENERIC_MG_8_H -#define GENERIC_MG_8_H 1 - -/* $Id: mg_8.h,v 1.22.18.2 2005/04/29 00:16:35 marka Exp $ */ - -typedef struct dns_rdata_mg { - dns_rdatacommon_t common; - isc_mem_t *mctx; - dns_name_t mg; -} dns_rdata_mg_t; - -#endif /* GENERIC_MG_8_H */ diff --git a/contrib/bind9/lib/dns/rdata/generic/minfo_14.c b/contrib/bind9/lib/dns/rdata/generic/minfo_14.c deleted file mode 100644 index b757480..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/minfo_14.c +++ /dev/null @@ -1,324 +0,0 @@ -/* - * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: minfo_14.c,v 1.43 2004/03/05 05:10:14 marka Exp $ */ - -/* reviewed: Wed Mar 15 17:45:32 PST 2000 by brister */ - -#ifndef RDATA_GENERIC_MINFO_14_C -#define RDATA_GENERIC_MINFO_14_C - -#define RRTYPE_MINFO_ATTRIBUTES (0) - -static inline isc_result_t -fromtext_minfo(ARGS_FROMTEXT) { - isc_token_t token; - dns_name_t name; - isc_buffer_t buffer; - int i; - isc_boolean_t ok; - - REQUIRE(type == 14); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(callbacks); - - for (i = 0; i < 2; i++) { - RETERR(isc_lex_getmastertoken(lexer, &token, - isc_tokentype_string, - ISC_FALSE)); - dns_name_init(&name, NULL); - buffer_fromregion(&buffer, &token.value.as_region); - origin = (origin != NULL) ? origin : dns_rootname; - RETTOK(dns_name_fromtext(&name, &buffer, origin, - options, target)); - ok = ISC_TRUE; - if ((options & DNS_RDATA_CHECKNAMES) != 0) - ok = dns_name_ismailbox(&name); - if (!ok && (options & DNS_RDATA_CHECKNAMESFAIL) != 0) - RETTOK(DNS_R_BADNAME); - if (!ok && callbacks != NULL) - warn_badname(&name, lexer, callbacks); - } - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -totext_minfo(ARGS_TOTEXT) { - isc_region_t region; - dns_name_t rmail; - dns_name_t email; - dns_name_t prefix; - isc_boolean_t sub; - - REQUIRE(rdata->type == 14); - REQUIRE(rdata->length != 0); - - dns_name_init(&rmail, NULL); - dns_name_init(&email, NULL); - dns_name_init(&prefix, NULL); - - dns_rdata_toregion(rdata, ®ion); - - dns_name_fromregion(&rmail, ®ion); - isc_region_consume(®ion, rmail.length); - - dns_name_fromregion(&email, ®ion); - isc_region_consume(®ion, email.length); - - sub = name_prefix(&rmail, tctx->origin, &prefix); - - RETERR(dns_name_totext(&prefix, sub, target)); - - RETERR(str_totext(" ", target)); - - sub = name_prefix(&email, tctx->origin, &prefix); - return (dns_name_totext(&prefix, sub, target)); -} - -static inline isc_result_t -fromwire_minfo(ARGS_FROMWIRE) { - dns_name_t rmail; - dns_name_t email; - - REQUIRE(type == 14); - - UNUSED(type); - UNUSED(rdclass); - - dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14); - - dns_name_init(&rmail, NULL); - dns_name_init(&email, NULL); - - RETERR(dns_name_fromwire(&rmail, source, dctx, options, target)); - return (dns_name_fromwire(&email, source, dctx, options, target)); -} - -static inline isc_result_t -towire_minfo(ARGS_TOWIRE) { - isc_region_t region; - dns_name_t rmail; - dns_name_t email; - dns_offsets_t roffsets; - dns_offsets_t eoffsets; - - REQUIRE(rdata->type == 14); - REQUIRE(rdata->length != 0); - - dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14); - - dns_name_init(&rmail, roffsets); - dns_name_init(&email, eoffsets); - - dns_rdata_toregion(rdata, ®ion); - - dns_name_fromregion(&rmail, ®ion); - isc_region_consume(®ion, name_length(&rmail)); - - RETERR(dns_name_towire(&rmail, cctx, target)); - - dns_name_fromregion(&rmail, ®ion); - isc_region_consume(®ion, rmail.length); - - return (dns_name_towire(&rmail, cctx, target)); -} - -static inline int -compare_minfo(ARGS_COMPARE) { - isc_region_t region1; - isc_region_t region2; - dns_name_t name1; - dns_name_t name2; - int order; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 14); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - dns_name_init(&name1, NULL); - dns_name_init(&name2, NULL); - - dns_rdata_toregion(rdata1, ®ion1); - dns_rdata_toregion(rdata2, ®ion2); - - dns_name_fromregion(&name1, ®ion1); - dns_name_fromregion(&name2, ®ion2); - - order = dns_name_rdatacompare(&name1, &name2); - if (order != 0) - return (order); - - isc_region_consume(®ion1, name_length(&name1)); - isc_region_consume(®ion2, name_length(&name2)); - - dns_name_init(&name1, NULL); - dns_name_init(&name2, NULL); - - dns_name_fromregion(&name1, ®ion1); - dns_name_fromregion(&name2, ®ion2); - - order = dns_name_rdatacompare(&name1, &name2); - return (order); -} - -static inline isc_result_t -fromstruct_minfo(ARGS_FROMSTRUCT) { - dns_rdata_minfo_t *minfo = source; - isc_region_t region; - - REQUIRE(type == 14); - REQUIRE(source != NULL); - REQUIRE(minfo->common.rdtype == type); - REQUIRE(minfo->common.rdclass == rdclass); - - UNUSED(type); - UNUSED(rdclass); - - dns_name_toregion(&minfo->rmailbox, ®ion); - RETERR(isc_buffer_copyregion(target, ®ion)); - dns_name_toregion(&minfo->emailbox, ®ion); - return (isc_buffer_copyregion(target, ®ion)); -} - -static inline isc_result_t -tostruct_minfo(ARGS_TOSTRUCT) { - dns_rdata_minfo_t *minfo = target; - isc_region_t region; - dns_name_t name; - isc_result_t result; - - REQUIRE(rdata->type == 14); - REQUIRE(target != NULL); - REQUIRE(rdata->length != 0); - - minfo->common.rdclass = rdata->rdclass; - minfo->common.rdtype = rdata->type; - ISC_LINK_INIT(&minfo->common, link); - - dns_name_init(&name, NULL); - dns_rdata_toregion(rdata, ®ion); - dns_name_fromregion(&name, ®ion); - dns_name_init(&minfo->rmailbox, NULL); - RETERR(name_duporclone(&name, mctx, &minfo->rmailbox)); - isc_region_consume(®ion, name_length(&name)); - - dns_name_fromregion(&name, ®ion); - dns_name_init(&minfo->emailbox, NULL); - result = name_duporclone(&name, mctx, &minfo->emailbox); - if (result != ISC_R_SUCCESS) - goto cleanup; - minfo->mctx = mctx; - return (ISC_R_SUCCESS); - - cleanup: - if (mctx != NULL) - dns_name_free(&minfo->rmailbox, mctx); - return (ISC_R_NOMEMORY); -} - -static inline void -freestruct_minfo(ARGS_FREESTRUCT) { - dns_rdata_minfo_t *minfo = source; - - REQUIRE(source != NULL); - REQUIRE(minfo->common.rdtype == 14); - - if (minfo->mctx == NULL) - return; - - dns_name_free(&minfo->rmailbox, minfo->mctx); - dns_name_free(&minfo->emailbox, minfo->mctx); - minfo->mctx = NULL; -} - -static inline isc_result_t -additionaldata_minfo(ARGS_ADDLDATA) { - REQUIRE(rdata->type == 14); - - UNUSED(rdata); - UNUSED(add); - UNUSED(arg); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_minfo(ARGS_DIGEST) { - isc_region_t r; - dns_name_t name; - isc_result_t result; - - REQUIRE(rdata->type == 14); - - dns_rdata_toregion(rdata, &r); - dns_name_init(&name, NULL); - dns_name_fromregion(&name, &r); - result = dns_name_digest(&name, digest, arg); - if (result != ISC_R_SUCCESS) - return (result); - isc_region_consume(&r, name_length(&name)); - dns_name_init(&name, NULL); - dns_name_fromregion(&name, &r); - - return (dns_name_digest(&name, digest, arg)); -} - -static inline isc_boolean_t -checkowner_minfo(ARGS_CHECKOWNER) { - - REQUIRE(type == 14); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_minfo(ARGS_CHECKNAMES) { - isc_region_t region; - dns_name_t name; - - REQUIRE(rdata->type == 14); - - UNUSED(owner); - - dns_rdata_toregion(rdata, ®ion); - dns_name_init(&name, NULL); - dns_name_fromregion(&name, ®ion); - if (!dns_name_ismailbox(&name)) { - if (bad != NULL) - dns_name_clone(&name, bad); - return (ISC_FALSE); - } - isc_region_consume(®ion, name_length(&name)); - dns_name_fromregion(&name, ®ion); - if (!dns_name_ismailbox(&name)) { - if (bad != NULL) - dns_name_clone(&name, bad); - return (ISC_FALSE); - } - return (ISC_TRUE); -} - -#endif /* RDATA_GENERIC_MINFO_14_C */ diff --git a/contrib/bind9/lib/dns/rdata/generic/minfo_14.h b/contrib/bind9/lib/dns/rdata/generic/minfo_14.h deleted file mode 100644 index 754fe20..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/minfo_14.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* */ -#ifndef GENERIC_MINFO_14_H -#define GENERIC_MINFO_14_H 1 - -/* $Id: minfo_14.h,v 1.23.18.2 2005/04/29 00:16:35 marka Exp $ */ - -typedef struct dns_rdata_minfo { - dns_rdatacommon_t common; - isc_mem_t *mctx; - dns_name_t rmailbox; - dns_name_t emailbox; -} dns_rdata_minfo_t; - -#endif /* GENERIC_MINFO_14_H */ diff --git a/contrib/bind9/lib/dns/rdata/generic/mr_9.c b/contrib/bind9/lib/dns/rdata/generic/mr_9.c deleted file mode 100644 index ab4c6e0..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/mr_9.c +++ /dev/null @@ -1,231 +0,0 @@ -/* - * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: mr_9.c,v 1.40 2004/03/05 05:10:15 marka Exp $ */ - -/* Reviewed: Wed Mar 15 21:30:35 EST 2000 by tale */ - -#ifndef RDATA_GENERIC_MR_9_C -#define RDATA_GENERIC_MR_9_C - -#define RRTYPE_MR_ATTRIBUTES (0) - -static inline isc_result_t -fromtext_mr(ARGS_FROMTEXT) { - isc_token_t token; - dns_name_t name; - isc_buffer_t buffer; - - REQUIRE(type == 9); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(callbacks); - - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - - dns_name_init(&name, NULL); - buffer_fromregion(&buffer, &token.value.as_region); - origin = (origin != NULL) ? origin : dns_rootname; - RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target)); - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -totext_mr(ARGS_TOTEXT) { - isc_region_t region; - dns_name_t name; - dns_name_t prefix; - isc_boolean_t sub; - - REQUIRE(rdata->type == 9); - REQUIRE(rdata->length != 0); - - dns_name_init(&name, NULL); - dns_name_init(&prefix, NULL); - - dns_rdata_toregion(rdata, ®ion); - dns_name_fromregion(&name, ®ion); - - sub = name_prefix(&name, tctx->origin, &prefix); - - return (dns_name_totext(&prefix, sub, target)); -} - -static inline isc_result_t -fromwire_mr(ARGS_FROMWIRE) { - dns_name_t name; - - REQUIRE(type == 9); - - UNUSED(type); - UNUSED(rdclass); - - dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14); - - dns_name_init(&name, NULL); - return (dns_name_fromwire(&name, source, dctx, options, target)); -} - -static inline isc_result_t -towire_mr(ARGS_TOWIRE) { - dns_name_t name; - dns_offsets_t offsets; - isc_region_t region; - - REQUIRE(rdata->type == 9); - REQUIRE(rdata->length != 0); - - dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14); - - dns_name_init(&name, offsets); - dns_rdata_toregion(rdata, ®ion); - dns_name_fromregion(&name, ®ion); - - return (dns_name_towire(&name, cctx, target)); -} - -static inline int -compare_mr(ARGS_COMPARE) { - dns_name_t name1; - dns_name_t name2; - isc_region_t region1; - isc_region_t region2; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 9); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - dns_name_init(&name1, NULL); - dns_name_init(&name2, NULL); - - dns_rdata_toregion(rdata1, ®ion1); - dns_rdata_toregion(rdata2, ®ion2); - - dns_name_fromregion(&name1, ®ion1); - dns_name_fromregion(&name2, ®ion2); - - return (dns_name_rdatacompare(&name1, &name2)); -} - -static inline isc_result_t -fromstruct_mr(ARGS_FROMSTRUCT) { - dns_rdata_mr_t *mr = source; - isc_region_t region; - - REQUIRE(type == 9); - REQUIRE(source != NULL); - REQUIRE(mr->common.rdtype == type); - REQUIRE(mr->common.rdclass == rdclass); - - UNUSED(type); - UNUSED(rdclass); - - dns_name_toregion(&mr->mr, ®ion); - return (isc_buffer_copyregion(target, ®ion)); -} - -static inline isc_result_t -tostruct_mr(ARGS_TOSTRUCT) { - isc_region_t region; - dns_rdata_mr_t *mr = target; - dns_name_t name; - - REQUIRE(rdata->type == 9); - REQUIRE(target != NULL); - REQUIRE(rdata->length != 0); - - mr->common.rdclass = rdata->rdclass; - mr->common.rdtype = rdata->type; - ISC_LINK_INIT(&mr->common, link); - - dns_name_init(&name, NULL); - dns_rdata_toregion(rdata, ®ion); - dns_name_fromregion(&name, ®ion); - dns_name_init(&mr->mr, NULL); - RETERR(name_duporclone(&name, mctx, &mr->mr)); - mr->mctx = mctx; - return (ISC_R_SUCCESS); -} - -static inline void -freestruct_mr(ARGS_FREESTRUCT) { - dns_rdata_mr_t *mr = source; - - REQUIRE(source != NULL); - REQUIRE(mr->common.rdtype == 9); - - if (mr->mctx == NULL) - return; - dns_name_free(&mr->mr, mr->mctx); - mr->mctx = NULL; -} - -static inline isc_result_t -additionaldata_mr(ARGS_ADDLDATA) { - REQUIRE(rdata->type == 9); - - UNUSED(rdata); - UNUSED(add); - UNUSED(arg); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_mr(ARGS_DIGEST) { - isc_region_t r; - dns_name_t name; - - REQUIRE(rdata->type == 9); - - dns_rdata_toregion(rdata, &r); - dns_name_init(&name, NULL); - dns_name_fromregion(&name, &r); - - return (dns_name_digest(&name, digest, arg)); -} - -static inline isc_boolean_t -checkowner_mr(ARGS_CHECKOWNER) { - - REQUIRE(type == 9); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_mr(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 9); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_GENERIC_MR_9_C */ diff --git a/contrib/bind9/lib/dns/rdata/generic/mr_9.h b/contrib/bind9/lib/dns/rdata/generic/mr_9.h deleted file mode 100644 index e255d70..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/mr_9.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* */ -#ifndef GENERIC_MR_9_H -#define GENERIC_MR_9_H 1 - -/* $Id: mr_9.h,v 1.22.18.2 2005/04/29 00:16:36 marka Exp $ */ - -typedef struct dns_rdata_mr { - dns_rdatacommon_t common; - isc_mem_t *mctx; - dns_name_t mr; -} dns_rdata_mr_t; - -#endif /* GENERIC_MR_9_H */ diff --git a/contrib/bind9/lib/dns/rdata/generic/mx_15.c b/contrib/bind9/lib/dns/rdata/generic/mx_15.c deleted file mode 100644 index fd77ec8..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/mx_15.c +++ /dev/null @@ -1,319 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2001, 2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: mx_15.c,v 1.52.18.2 2005/05/20 01:10:11 marka Exp $ */ - -/* reviewed: Wed Mar 15 18:05:46 PST 2000 by brister */ - -#ifndef RDATA_GENERIC_MX_15_C -#define RDATA_GENERIC_MX_15_C - -#include <string.h> - -#include <isc/net.h> - -#define RRTYPE_MX_ATTRIBUTES (0) - -static isc_boolean_t -check_mx(isc_token_t *token) { - char tmp[sizeof("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:123.123.123.123.")]; - struct in_addr addr; - struct in6_addr addr6; - - if (strlcpy(tmp, DNS_AS_STR(*token), sizeof(tmp)) >= sizeof(tmp)) - return (ISC_TRUE); - - if (tmp[strlen(tmp) - 1] == '.') - tmp[strlen(tmp) - 1] = '\0'; - if (inet_aton(tmp, &addr) == 1 || - inet_pton(AF_INET6, tmp, &addr6) == 1) - return (ISC_FALSE); - - return (ISC_TRUE); -} - -static inline isc_result_t -fromtext_mx(ARGS_FROMTEXT) { - isc_token_t token; - dns_name_t name; - isc_buffer_t buffer; - isc_boolean_t ok; - - REQUIRE(type == 15); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(callbacks); - - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - if (token.value.as_ulong > 0xffffU) - RETTOK(ISC_R_RANGE); - RETERR(uint16_tobuffer(token.value.as_ulong, target)); - - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - - ok = ISC_TRUE; - if ((options & DNS_RDATA_CHECKMX) != 0) - ok = check_mx(&token); - if (!ok && (options & DNS_RDATA_CHECKMXFAIL) != 0) - RETTOK(DNS_R_MXISADDRESS); - if (!ok && callbacks != NULL) - warn_badmx(&token, lexer, callbacks); - - dns_name_init(&name, NULL); - buffer_fromregion(&buffer, &token.value.as_region); - origin = (origin != NULL) ? origin : dns_rootname; - RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target)); - ok = ISC_TRUE; - if ((options & DNS_RDATA_CHECKNAMES) != 0) - ok = dns_name_ishostname(&name, ISC_FALSE); - if (!ok && (options & DNS_RDATA_CHECKNAMESFAIL) != 0) - RETTOK(DNS_R_BADNAME); - if (!ok && callbacks != NULL) - warn_badname(&name, lexer, callbacks); - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -totext_mx(ARGS_TOTEXT) { - isc_region_t region; - dns_name_t name; - dns_name_t prefix; - isc_boolean_t sub; - char buf[sizeof("64000")]; - unsigned short num; - - REQUIRE(rdata->type == 15); - REQUIRE(rdata->length != 0); - - dns_name_init(&name, NULL); - dns_name_init(&prefix, NULL); - - dns_rdata_toregion(rdata, ®ion); - num = uint16_fromregion(®ion); - isc_region_consume(®ion, 2); - sprintf(buf, "%u", num); - RETERR(str_totext(buf, target)); - - RETERR(str_totext(" ", target)); - - dns_name_fromregion(&name, ®ion); - sub = name_prefix(&name, tctx->origin, &prefix); - return (dns_name_totext(&prefix, sub, target)); -} - -static inline isc_result_t -fromwire_mx(ARGS_FROMWIRE) { - dns_name_t name; - isc_region_t sregion; - - REQUIRE(type == 15); - - UNUSED(type); - UNUSED(rdclass); - - dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14); - - dns_name_init(&name, NULL); - - isc_buffer_activeregion(source, &sregion); - if (sregion.length < 2) - return (ISC_R_UNEXPECTEDEND); - RETERR(mem_tobuffer(target, sregion.base, 2)); - isc_buffer_forward(source, 2); - return (dns_name_fromwire(&name, source, dctx, options, target)); -} - -static inline isc_result_t -towire_mx(ARGS_TOWIRE) { - dns_name_t name; - dns_offsets_t offsets; - isc_region_t region; - - REQUIRE(rdata->type == 15); - REQUIRE(rdata->length != 0); - - dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14); - - dns_rdata_toregion(rdata, ®ion); - RETERR(mem_tobuffer(target, region.base, 2)); - isc_region_consume(®ion, 2); - - dns_name_init(&name, offsets); - dns_name_fromregion(&name, ®ion); - - return (dns_name_towire(&name, cctx, target)); -} - -static inline int -compare_mx(ARGS_COMPARE) { - dns_name_t name1; - dns_name_t name2; - isc_region_t region1; - isc_region_t region2; - int order; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 15); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - order = memcmp(rdata1->data, rdata2->data, 2); - if (order != 0) - return (order < 0 ? -1 : 1); - - dns_name_init(&name1, NULL); - dns_name_init(&name2, NULL); - - dns_rdata_toregion(rdata1, ®ion1); - dns_rdata_toregion(rdata2, ®ion2); - - isc_region_consume(®ion1, 2); - isc_region_consume(®ion2, 2); - - dns_name_fromregion(&name1, ®ion1); - dns_name_fromregion(&name2, ®ion2); - - return (dns_name_rdatacompare(&name1, &name2)); -} - -static inline isc_result_t -fromstruct_mx(ARGS_FROMSTRUCT) { - dns_rdata_mx_t *mx = source; - isc_region_t region; - - REQUIRE(type == 15); - REQUIRE(source != NULL); - REQUIRE(mx->common.rdtype == type); - REQUIRE(mx->common.rdclass == rdclass); - - UNUSED(type); - UNUSED(rdclass); - - RETERR(uint16_tobuffer(mx->pref, target)); - dns_name_toregion(&mx->mx, ®ion); - return (isc_buffer_copyregion(target, ®ion)); -} - -static inline isc_result_t -tostruct_mx(ARGS_TOSTRUCT) { - isc_region_t region; - dns_rdata_mx_t *mx = target; - dns_name_t name; - - REQUIRE(rdata->type == 15); - REQUIRE(target != NULL); - REQUIRE(rdata->length != 0); - - mx->common.rdclass = rdata->rdclass; - mx->common.rdtype = rdata->type; - ISC_LINK_INIT(&mx->common, link); - - dns_name_init(&name, NULL); - dns_rdata_toregion(rdata, ®ion); - mx->pref = uint16_fromregion(®ion); - isc_region_consume(®ion, 2); - dns_name_fromregion(&name, ®ion); - dns_name_init(&mx->mx, NULL); - RETERR(name_duporclone(&name, mctx, &mx->mx)); - mx->mctx = mctx; - return (ISC_R_SUCCESS); -} - -static inline void -freestruct_mx(ARGS_FREESTRUCT) { - dns_rdata_mx_t *mx = source; - - REQUIRE(source != NULL); - REQUIRE(mx->common.rdtype == 15); - - if (mx->mctx == NULL) - return; - - dns_name_free(&mx->mx, mx->mctx); - mx->mctx = NULL; -} - -static inline isc_result_t -additionaldata_mx(ARGS_ADDLDATA) { - dns_name_t name; - dns_offsets_t offsets; - isc_region_t region; - - REQUIRE(rdata->type == 15); - - dns_name_init(&name, offsets); - dns_rdata_toregion(rdata, ®ion); - isc_region_consume(®ion, 2); - dns_name_fromregion(&name, ®ion); - - return ((add)(arg, &name, dns_rdatatype_a)); -} - -static inline isc_result_t -digest_mx(ARGS_DIGEST) { - isc_region_t r1, r2; - dns_name_t name; - - REQUIRE(rdata->type == 15); - - dns_rdata_toregion(rdata, &r1); - r2 = r1; - isc_region_consume(&r2, 2); - r1.length = 2; - RETERR((digest)(arg, &r1)); - dns_name_init(&name, NULL); - dns_name_fromregion(&name, &r2); - return (dns_name_digest(&name, digest, arg)); -} - -static inline isc_boolean_t -checkowner_mx(ARGS_CHECKOWNER) { - - REQUIRE(type == 15); - - UNUSED(type); - UNUSED(rdclass); - - return (dns_name_ishostname(name, wildcard)); -} - -static inline isc_boolean_t -checknames_mx(ARGS_CHECKNAMES) { - isc_region_t region; - dns_name_t name; - - REQUIRE(rdata->type == 15); - - UNUSED(owner); - - dns_rdata_toregion(rdata, ®ion); - isc_region_consume(®ion, 2); - dns_name_init(&name, NULL); - dns_name_fromregion(&name, ®ion); - if (!dns_name_ishostname(&name, ISC_FALSE)) { - if (bad != NULL) - dns_name_clone(&name, bad); - return (ISC_FALSE); - } - return (ISC_TRUE); -} - -#endif /* RDATA_GENERIC_MX_15_C */ diff --git a/contrib/bind9/lib/dns/rdata/generic/mx_15.h b/contrib/bind9/lib/dns/rdata/generic/mx_15.h deleted file mode 100644 index 4d81b90..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/mx_15.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* */ -#ifndef GENERIC_MX_15_H -#define GENERIC_MX_15_H 1 - -/* $Id: mx_15.h,v 1.25.18.2 2005/04/29 00:16:36 marka Exp $ */ - -typedef struct dns_rdata_mx { - dns_rdatacommon_t common; - isc_mem_t *mctx; - isc_uint16_t pref; - dns_name_t mx; -} dns_rdata_mx_t; - -#endif /* GENERIC_MX_15_H */ diff --git a/contrib/bind9/lib/dns/rdata/generic/ns_2.c b/contrib/bind9/lib/dns/rdata/generic/ns_2.c deleted file mode 100644 index 2379433..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/ns_2.c +++ /dev/null @@ -1,251 +0,0 @@ -/* - * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: ns_2.c,v 1.44 2004/03/05 05:10:15 marka Exp $ */ - -/* Reviewed: Wed Mar 15 18:15:00 PST 2000 by bwelling */ - -#ifndef RDATA_GENERIC_NS_2_C -#define RDATA_GENERIC_NS_2_C - -#define RRTYPE_NS_ATTRIBUTES (DNS_RDATATYPEATTR_ZONECUTAUTH) - -static inline isc_result_t -fromtext_ns(ARGS_FROMTEXT) { - isc_token_t token; - dns_name_t name; - isc_buffer_t buffer; - isc_boolean_t ok; - - REQUIRE(type == 2); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(callbacks); - - RETERR(isc_lex_getmastertoken(lexer, &token,isc_tokentype_string, - ISC_FALSE)); - - dns_name_init(&name, NULL); - buffer_fromregion(&buffer, &token.value.as_region); - origin = (origin != NULL) ? origin : dns_rootname; - RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target)); - ok = ISC_TRUE; - if ((options & DNS_RDATA_CHECKNAMES) != 0) - ok = dns_name_ishostname(&name, ISC_FALSE); - if (!ok && (options & DNS_RDATA_CHECKNAMESFAIL) != 0) - RETTOK(DNS_R_BADNAME); - if (!ok && callbacks != NULL) - warn_badname(&name, lexer, callbacks); - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -totext_ns(ARGS_TOTEXT) { - isc_region_t region; - dns_name_t name; - dns_name_t prefix; - isc_boolean_t sub; - - REQUIRE(rdata->type == 2); - REQUIRE(rdata->length != 0); - - dns_name_init(&name, NULL); - dns_name_init(&prefix, NULL); - - dns_rdata_toregion(rdata, ®ion); - dns_name_fromregion(&name, ®ion); - - sub = name_prefix(&name, tctx->origin, &prefix); - - return (dns_name_totext(&prefix, sub, target)); -} - -static inline isc_result_t -fromwire_ns(ARGS_FROMWIRE) { - dns_name_t name; - - REQUIRE(type == 2); - - UNUSED(type); - UNUSED(rdclass); - - dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14); - - dns_name_init(&name, NULL); - return (dns_name_fromwire(&name, source, dctx, options, target)); -} - -static inline isc_result_t -towire_ns(ARGS_TOWIRE) { - dns_name_t name; - dns_offsets_t offsets; - isc_region_t region; - - REQUIRE(rdata->type == 2); - REQUIRE(rdata->length != 0); - - dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14); - - dns_name_init(&name, offsets); - dns_rdata_toregion(rdata, ®ion); - dns_name_fromregion(&name, ®ion); - - return (dns_name_towire(&name, cctx, target)); -} - -static inline int -compare_ns(ARGS_COMPARE) { - dns_name_t name1; - dns_name_t name2; - isc_region_t region1; - isc_region_t region2; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 2); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - dns_name_init(&name1, NULL); - dns_name_init(&name2, NULL); - - dns_rdata_toregion(rdata1, ®ion1); - dns_rdata_toregion(rdata2, ®ion2); - - dns_name_fromregion(&name1, ®ion1); - dns_name_fromregion(&name2, ®ion2); - - return (dns_name_rdatacompare(&name1, &name2)); -} - -static inline isc_result_t -fromstruct_ns(ARGS_FROMSTRUCT) { - dns_rdata_ns_t *ns = source; - isc_region_t region; - - REQUIRE(type == 2); - REQUIRE(source != NULL); - REQUIRE(ns->common.rdtype == type); - REQUIRE(ns->common.rdclass == rdclass); - - UNUSED(type); - UNUSED(rdclass); - - dns_name_toregion(&ns->name, ®ion); - return (isc_buffer_copyregion(target, ®ion)); -} - -static inline isc_result_t -tostruct_ns(ARGS_TOSTRUCT) { - isc_region_t region; - dns_rdata_ns_t *ns = target; - dns_name_t name; - - REQUIRE(rdata->type == 2); - REQUIRE(target != NULL); - REQUIRE(rdata->length != 0); - - ns->common.rdclass = rdata->rdclass; - ns->common.rdtype = rdata->type; - ISC_LINK_INIT(&ns->common, link); - - dns_name_init(&name, NULL); - dns_rdata_toregion(rdata, ®ion); - dns_name_fromregion(&name, ®ion); - dns_name_init(&ns->name, NULL); - RETERR(name_duporclone(&name, mctx, &ns->name)); - ns->mctx = mctx; - return (ISC_R_SUCCESS); -} - -static inline void -freestruct_ns(ARGS_FREESTRUCT) { - dns_rdata_ns_t *ns = source; - - REQUIRE(source != NULL); - - if (ns->mctx == NULL) - return; - - dns_name_free(&ns->name, ns->mctx); - ns->mctx = NULL; -} - -static inline isc_result_t -additionaldata_ns(ARGS_ADDLDATA) { - dns_name_t name; - dns_offsets_t offsets; - isc_region_t region; - - REQUIRE(rdata->type == 2); - - dns_name_init(&name, offsets); - dns_rdata_toregion(rdata, ®ion); - dns_name_fromregion(&name, ®ion); - - return ((add)(arg, &name, dns_rdatatype_a)); -} - -static inline isc_result_t -digest_ns(ARGS_DIGEST) { - isc_region_t r; - dns_name_t name; - - REQUIRE(rdata->type == 2); - - dns_rdata_toregion(rdata, &r); - dns_name_init(&name, NULL); - dns_name_fromregion(&name, &r); - - return (dns_name_digest(&name, digest, arg)); -} - -static inline isc_boolean_t -checkowner_ns(ARGS_CHECKOWNER) { - - REQUIRE(type == 2); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_ns(ARGS_CHECKNAMES) { - isc_region_t region; - dns_name_t name; - - REQUIRE(rdata->type == 2); - - UNUSED(owner); - - dns_rdata_toregion(rdata, ®ion); - dns_name_init(&name, NULL); - dns_name_fromregion(&name, ®ion); - if (!dns_name_ishostname(&name, ISC_FALSE)) { - if (bad != NULL) - dns_name_clone(&name, bad); - return (ISC_FALSE); - } - return (ISC_TRUE); -} - -#endif /* RDATA_GENERIC_NS_2_C */ diff --git a/contrib/bind9/lib/dns/rdata/generic/ns_2.h b/contrib/bind9/lib/dns/rdata/generic/ns_2.h deleted file mode 100644 index ec8e771..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/ns_2.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* */ -#ifndef GENERIC_NS_2_H -#define GENERIC_NS_2_H 1 - -/* $Id: ns_2.h,v 1.23.18.2 2005/04/29 00:16:37 marka Exp $ */ - -typedef struct dns_rdata_ns { - dns_rdatacommon_t common; - isc_mem_t *mctx; - dns_name_t name; -} dns_rdata_ns_t; - - -#endif /* GENERIC_NS_2_H */ diff --git a/contrib/bind9/lib/dns/rdata/generic/nsec_47.c b/contrib/bind9/lib/dns/rdata/generic/nsec_47.c deleted file mode 100644 index f3e56ca..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/nsec_47.c +++ /dev/null @@ -1,366 +0,0 @@ -/* - * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: nsec_47.c,v 1.7 2004/03/05 05:10:15 marka Exp $ */ - -/* reviewed: Wed Mar 15 18:21:15 PST 2000 by brister */ - -/* draft-ietf-dnsext-nsec-rdata-01.txt */ - -#ifndef RDATA_GENERIC_NSEC_47_C -#define RDATA_GENERIC_NSEC_47_C - -/* - * The attributes do not include DNS_RDATATYPEATTR_SINGLETON - * because we must be able to handle a parent/child NSEC pair. - */ -#define RRTYPE_NSEC_ATTRIBUTES (DNS_RDATATYPEATTR_DNSSEC) - -static inline isc_result_t -fromtext_nsec(ARGS_FROMTEXT) { - isc_token_t token; - dns_name_t name; - isc_buffer_t buffer; - unsigned char bm[8*1024]; /* 64k bits */ - dns_rdatatype_t covered; - int octet; - int window; - - REQUIRE(type == 47); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(callbacks); - - /* - * Next domain. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - dns_name_init(&name, NULL); - buffer_fromregion(&buffer, &token.value.as_region); - origin = (origin != NULL) ? origin : dns_rootname; - RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target)); - - memset(bm, 0, sizeof(bm)); - do { - RETERR(isc_lex_getmastertoken(lexer, &token, - isc_tokentype_string, ISC_TRUE)); - if (token.type != isc_tokentype_string) - break; - RETTOK(dns_rdatatype_fromtext(&covered, - &token.value.as_textregion)); - bm[covered/8] |= (0x80>>(covered%8)); - } while (1); - isc_lex_ungettoken(lexer, &token); - for (window = 0; window < 256 ; window++) { - /* - * Find if we have a type in this window. - */ - for (octet = 31; octet >= 0; octet--) - if (bm[window * 32 + octet] != 0) - break; - if (octet < 0) - continue; - RETERR(uint8_tobuffer(window, target)); - RETERR(uint8_tobuffer(octet + 1, target)); - RETERR(mem_tobuffer(target, &bm[window * 32], octet + 1)); - } - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -totext_nsec(ARGS_TOTEXT) { - isc_region_t sr; - unsigned int i, j, k; - dns_name_t name; - dns_name_t prefix; - isc_boolean_t sub; - unsigned int window, len; - - REQUIRE(rdata->type == 47); - REQUIRE(rdata->length != 0); - - dns_name_init(&name, NULL); - dns_name_init(&prefix, NULL); - dns_rdata_toregion(rdata, &sr); - dns_name_fromregion(&name, &sr); - isc_region_consume(&sr, name_length(&name)); - sub = name_prefix(&name, tctx->origin, &prefix); - RETERR(dns_name_totext(&prefix, sub, target)); - - - for (i = 0; i < sr.length; i += len) { - INSIST(i + 2 <= sr.length); - window = sr.base[i]; - len = sr.base[i + 1]; - INSIST(len > 0 && len <= 32); - i += 2; - INSIST(i + len <= sr.length); - for (j = 0; j < len; j++) { - dns_rdatatype_t t; - if (sr.base[i + j] == 0) - continue; - for (k = 0; k < 8; k++) { - if ((sr.base[i + j] & (0x80 >> k)) == 0) - continue; - t = window * 256 + j * 8 + k; - RETERR(str_totext(" ", target)); - if (dns_rdatatype_isknown(t)) { - RETERR(dns_rdatatype_totext(t, target)); - } else { - char buf[sizeof("TYPE65535")]; - sprintf(buf, "TYPE%u", t); - RETERR(str_totext(buf, target)); - } - } - } - } - return (ISC_R_SUCCESS); -} - -static /* inline */ isc_result_t -fromwire_nsec(ARGS_FROMWIRE) { - isc_region_t sr; - dns_name_t name; - unsigned int window, lastwindow = 0; - unsigned int len; - isc_boolean_t first = ISC_TRUE; - unsigned int i; - - REQUIRE(type == 47); - - UNUSED(type); - UNUSED(rdclass); - - dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE); - - dns_name_init(&name, NULL); - RETERR(dns_name_fromwire(&name, source, dctx, options, target)); - - isc_buffer_activeregion(source, &sr); - for (i = 0; i < sr.length; i += len) { - /* - * Check for overflow. - */ - if (i + 2 > sr.length) - RETERR(DNS_R_FORMERR); - window = sr.base[i]; - len = sr.base[i + 1]; - i += 2; - /* - * Check that bitmap windows are in the correct order. - */ - if (!first && window <= lastwindow) - RETERR(DNS_R_FORMERR); - /* - * Check for legal lengths. - */ - if (len < 1 || len > 32) - RETERR(DNS_R_FORMERR); - /* - * Check for overflow. - */ - if (i + len > sr.length) - RETERR(DNS_R_FORMERR); - /* - * The last octet of the bitmap must be non zero. - */ - if (sr.base[i + len - 1] == 0) - RETERR(DNS_R_FORMERR); - lastwindow = window; - first = ISC_FALSE; - } - if (i != sr.length) - return (DNS_R_EXTRADATA); - if (first) - RETERR(DNS_R_FORMERR); - RETERR(mem_tobuffer(target, sr.base, sr.length)); - isc_buffer_forward(source, sr.length); - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -towire_nsec(ARGS_TOWIRE) { - isc_region_t sr; - dns_name_t name; - dns_offsets_t offsets; - - REQUIRE(rdata->type == 47); - REQUIRE(rdata->length != 0); - - dns_compress_setmethods(cctx, DNS_COMPRESS_NONE); - dns_name_init(&name, offsets); - dns_rdata_toregion(rdata, &sr); - dns_name_fromregion(&name, &sr); - isc_region_consume(&sr, name_length(&name)); - RETERR(dns_name_towire(&name, cctx, target)); - - return (mem_tobuffer(target, sr.base, sr.length)); -} - -static inline int -compare_nsec(ARGS_COMPARE) { - isc_region_t r1; - isc_region_t r2; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 47); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - dns_rdata_toregion(rdata1, &r1); - dns_rdata_toregion(rdata2, &r2); - return (isc_region_compare(&r1, &r2)); -} - -static inline isc_result_t -fromstruct_nsec(ARGS_FROMSTRUCT) { - dns_rdata_nsec_t *nsec = source; - isc_region_t region; - unsigned int i, len, window, lastwindow = 0; - isc_boolean_t first = ISC_TRUE; - - REQUIRE(type == 47); - REQUIRE(source != NULL); - REQUIRE(nsec->common.rdtype == type); - REQUIRE(nsec->common.rdclass == rdclass); - REQUIRE(nsec->typebits != NULL || nsec->len == 0); - - UNUSED(type); - UNUSED(rdclass); - - dns_name_toregion(&nsec->next, ®ion); - RETERR(isc_buffer_copyregion(target, ®ion)); - /* - * Perform sanity check. - */ - for (i = 0; i < nsec->len ; i += len) { - INSIST(i + 2 <= nsec->len); - window = nsec->typebits[i]; - len = nsec->typebits[i+1]; - i += 2; - INSIST(first || window > lastwindow); - INSIST(len > 0 && len <= 32); - INSIST(i + len <= nsec->len); - INSIST(nsec->typebits[i + len - 1] != 0); - lastwindow = window; - first = ISC_FALSE; - } - INSIST(!first); - return (mem_tobuffer(target, nsec->typebits, nsec->len)); -} - -static inline isc_result_t -tostruct_nsec(ARGS_TOSTRUCT) { - isc_region_t region; - dns_rdata_nsec_t *nsec = target; - dns_name_t name; - - REQUIRE(rdata->type == 47); - REQUIRE(target != NULL); - REQUIRE(rdata->length != 0); - - nsec->common.rdclass = rdata->rdclass; - nsec->common.rdtype = rdata->type; - ISC_LINK_INIT(&nsec->common, link); - - dns_name_init(&name, NULL); - dns_rdata_toregion(rdata, ®ion); - dns_name_fromregion(&name, ®ion); - isc_region_consume(®ion, name_length(&name)); - dns_name_init(&nsec->next, NULL); - RETERR(name_duporclone(&name, mctx, &nsec->next)); - - nsec->len = region.length; - nsec->typebits = mem_maybedup(mctx, region.base, region.length); - if (nsec->typebits == NULL) - goto cleanup; - - nsec->mctx = mctx; - return (ISC_R_SUCCESS); - - cleanup: - if (mctx != NULL) - dns_name_free(&nsec->next, mctx); - return (ISC_R_NOMEMORY); -} - -static inline void -freestruct_nsec(ARGS_FREESTRUCT) { - dns_rdata_nsec_t *nsec = source; - - REQUIRE(source != NULL); - REQUIRE(nsec->common.rdtype == 47); - - if (nsec->mctx == NULL) - return; - - dns_name_free(&nsec->next, nsec->mctx); - if (nsec->typebits != NULL) - isc_mem_free(nsec->mctx, nsec->typebits); - nsec->mctx = NULL; -} - -static inline isc_result_t -additionaldata_nsec(ARGS_ADDLDATA) { - REQUIRE(rdata->type == 47); - - UNUSED(rdata); - UNUSED(add); - UNUSED(arg); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_nsec(ARGS_DIGEST) { - isc_region_t r; - - REQUIRE(rdata->type == 47); - - dns_rdata_toregion(rdata, &r); - return ((digest)(arg, &r)); -} - -static inline isc_boolean_t -checkowner_nsec(ARGS_CHECKOWNER) { - - REQUIRE(type == 47); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_nsec(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 47); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_GENERIC_NSEC_47_C */ diff --git a/contrib/bind9/lib/dns/rdata/generic/nsec_47.h b/contrib/bind9/lib/dns/rdata/generic/nsec_47.h deleted file mode 100644 index ff03483..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/nsec_47.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef GENERIC_NSEC_47_H -#define GENERIC_NSEC_47_H 1 - -/* $Id: nsec_47.h,v 1.4.20.2 2005/04/29 00:16:37 marka Exp $ */ - -/*! - * \brief Per draft-ietf-dnsext-nsec-rdata-01.txt */ - -typedef struct dns_rdata_nsec { - dns_rdatacommon_t common; - isc_mem_t *mctx; - dns_name_t next; - unsigned char *typebits; - isc_uint16_t len; -} dns_rdata_nsec_t; - -#endif /* GENERIC_NSEC_47_H */ diff --git a/contrib/bind9/lib/dns/rdata/generic/null_10.c b/contrib/bind9/lib/dns/rdata/generic/null_10.c deleted file mode 100644 index a6f8f9f4..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/null_10.c +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2002 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: null_10.c,v 1.40 2004/03/05 05:10:16 marka Exp $ */ - -/* Reviewed: Thu Mar 16 13:57:50 PST 2000 by explorer */ - -#ifndef RDATA_GENERIC_NULL_10_C -#define RDATA_GENERIC_NULL_10_C - -#define RRTYPE_NULL_ATTRIBUTES (0) - -static inline isc_result_t -fromtext_null(ARGS_FROMTEXT) { - REQUIRE(type == 10); - - UNUSED(rdclass); - UNUSED(type); - UNUSED(lexer); - UNUSED(origin); - UNUSED(options); - UNUSED(target); - UNUSED(callbacks); - - return (DNS_R_SYNTAX); -} - -static inline isc_result_t -totext_null(ARGS_TOTEXT) { - REQUIRE(rdata->type == 10); - - UNUSED(rdata); - UNUSED(tctx); - UNUSED(target); - - return (DNS_R_SYNTAX); -} - -static inline isc_result_t -fromwire_null(ARGS_FROMWIRE) { - isc_region_t sr; - - REQUIRE(type == 10); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(dctx); - UNUSED(options); - - isc_buffer_activeregion(source, &sr); - isc_buffer_forward(source, sr.length); - return (mem_tobuffer(target, sr.base, sr.length)); -} - -static inline isc_result_t -towire_null(ARGS_TOWIRE) { - REQUIRE(rdata->type == 10); - - UNUSED(cctx); - - return (mem_tobuffer(target, rdata->data, rdata->length)); -} - -static inline int -compare_null(ARGS_COMPARE) { - isc_region_t r1; - isc_region_t r2; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 10); - - dns_rdata_toregion(rdata1, &r1); - dns_rdata_toregion(rdata2, &r2); - return (isc_region_compare(&r1, &r2)); -} - -static inline isc_result_t -fromstruct_null(ARGS_FROMSTRUCT) { - dns_rdata_null_t *null = source; - - REQUIRE(type == 10); - REQUIRE(source != NULL); - REQUIRE(null->common.rdtype == type); - REQUIRE(null->common.rdclass == rdclass); - REQUIRE(null->data != NULL || null->length == 0); - - UNUSED(type); - UNUSED(rdclass); - - return (mem_tobuffer(target, null->data, null->length)); -} - -static inline isc_result_t -tostruct_null(ARGS_TOSTRUCT) { - dns_rdata_null_t *null = target; - isc_region_t r; - - REQUIRE(rdata->type == 10); - REQUIRE(target != NULL); - - null->common.rdclass = rdata->rdclass; - null->common.rdtype = rdata->type; - ISC_LINK_INIT(&null->common, link); - - dns_rdata_toregion(rdata, &r); - null->length = r.length; - null->data = mem_maybedup(mctx, r.base, r.length); - if (null->data == NULL) - return (ISC_R_NOMEMORY); - - null->mctx = mctx; - return (ISC_R_SUCCESS); -} - -static inline void -freestruct_null(ARGS_FREESTRUCT) { - dns_rdata_null_t *null = source; - - REQUIRE(source != NULL); - REQUIRE(null->common.rdtype == 10); - - if (null->mctx == NULL) - return; - - if (null->data != NULL) - isc_mem_free(null->mctx, null->data); - null->mctx = NULL; -} - -static inline isc_result_t -additionaldata_null(ARGS_ADDLDATA) { - UNUSED(rdata); - UNUSED(add); - UNUSED(arg); - - REQUIRE(rdata->type == 10); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_null(ARGS_DIGEST) { - isc_region_t r; - - REQUIRE(rdata->type == 10); - - dns_rdata_toregion(rdata, &r); - - return ((digest)(arg, &r)); -} - -static inline isc_boolean_t -checkowner_null(ARGS_CHECKOWNER) { - - REQUIRE(type == 10); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_null(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 10); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_GENERIC_NULL_10_C */ diff --git a/contrib/bind9/lib/dns/rdata/generic/null_10.h b/contrib/bind9/lib/dns/rdata/generic/null_10.h deleted file mode 100644 index 5afb1ae..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/null_10.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* */ -#ifndef GENERIC_NULL_10_H -#define GENERIC_NULL_10_H 1 - -/* $Id: null_10.h,v 1.21.18.2 2005/04/29 00:16:37 marka Exp $ */ - -typedef struct dns_rdata_null { - dns_rdatacommon_t common; - isc_mem_t *mctx; - isc_uint16_t length; - unsigned char *data; -} dns_rdata_null_t; - - -#endif /* GENERIC_NULL_10_H */ diff --git a/contrib/bind9/lib/dns/rdata/generic/nxt_30.c b/contrib/bind9/lib/dns/rdata/generic/nxt_30.c deleted file mode 100644 index b7358e0..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/nxt_30.c +++ /dev/null @@ -1,329 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: nxt_30.c,v 1.59.18.2 2005/04/29 00:16:38 marka Exp $ */ - -/* reviewed: Wed Mar 15 18:21:15 PST 2000 by brister */ - -/* RFC2535 */ - -#ifndef RDATA_GENERIC_NXT_30_C -#define RDATA_GENERIC_NXT_30_C - -/* - * The attributes do not include DNS_RDATATYPEATTR_SINGLETON - * because we must be able to handle a parent/child NXT pair. - */ -#define RRTYPE_NXT_ATTRIBUTES (0) - -static inline isc_result_t -fromtext_nxt(ARGS_FROMTEXT) { - isc_token_t token; - dns_name_t name; - isc_buffer_t buffer; - char *e; - unsigned char bm[8*1024]; /* 64k bits */ - dns_rdatatype_t covered; - dns_rdatatype_t maxcovered = 0; - isc_boolean_t first = ISC_TRUE; - long n; - - REQUIRE(type == 30); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(callbacks); - - /* - * Next domain. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - dns_name_init(&name, NULL); - buffer_fromregion(&buffer, &token.value.as_region); - origin = (origin != NULL) ? origin : dns_rootname; - RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target)); - - memset(bm, 0, sizeof(bm)); - do { - RETERR(isc_lex_getmastertoken(lexer, &token, - isc_tokentype_string, ISC_TRUE)); - if (token.type != isc_tokentype_string) - break; - n = strtol(DNS_AS_STR(token), &e, 10); - if (e != DNS_AS_STR(token) && *e == '\0') { - covered = (dns_rdatatype_t)n; - } else if (dns_rdatatype_fromtext(&covered, - &token.value.as_textregion) == DNS_R_UNKNOWN) - RETTOK(DNS_R_UNKNOWN); - /* - * NXT is only specified for types 1..127. - */ - if (covered < 1 || covered > 127) - return (ISC_R_RANGE); - if (first || covered > maxcovered) - maxcovered = covered; - first = ISC_FALSE; - bm[covered/8] |= (0x80>>(covered%8)); - } while (1); - isc_lex_ungettoken(lexer, &token); - if (first) - return (ISC_R_SUCCESS); - n = (maxcovered + 8) / 8; - return (mem_tobuffer(target, bm, n)); -} - -static inline isc_result_t -totext_nxt(ARGS_TOTEXT) { - isc_region_t sr; - unsigned int i, j; - dns_name_t name; - dns_name_t prefix; - isc_boolean_t sub; - - REQUIRE(rdata->type == 30); - REQUIRE(rdata->length != 0); - - dns_name_init(&name, NULL); - dns_name_init(&prefix, NULL); - dns_rdata_toregion(rdata, &sr); - dns_name_fromregion(&name, &sr); - isc_region_consume(&sr, name_length(&name)); - sub = name_prefix(&name, tctx->origin, &prefix); - RETERR(dns_name_totext(&prefix, sub, target)); - - for (i = 0; i < sr.length; i++) { - if (sr.base[i] != 0) - for (j = 0; j < 8; j++) - if ((sr.base[i] & (0x80 >> j)) != 0) { - dns_rdatatype_t t = i * 8 + j; - RETERR(str_totext(" ", target)); - if (dns_rdatatype_isknown(t)) { - RETERR(dns_rdatatype_totext(t, - target)); - } else { - char buf[sizeof("65535")]; - sprintf(buf, "%u", t); - RETERR(str_totext(buf, - target)); - } - } - } - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -fromwire_nxt(ARGS_FROMWIRE) { - isc_region_t sr; - dns_name_t name; - - REQUIRE(type == 30); - - UNUSED(type); - UNUSED(rdclass); - - dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE); - - dns_name_init(&name, NULL); - RETERR(dns_name_fromwire(&name, source, dctx, options, target)); - - isc_buffer_activeregion(source, &sr); - if (sr.length > 0 && (sr.base[0] & 0x80) == 0 && - ((sr.length > 16) || sr.base[sr.length - 1] == 0)) - return (DNS_R_BADBITMAP); - RETERR(mem_tobuffer(target, sr.base, sr.length)); - isc_buffer_forward(source, sr.length); - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -towire_nxt(ARGS_TOWIRE) { - isc_region_t sr; - dns_name_t name; - dns_offsets_t offsets; - - REQUIRE(rdata->type == 30); - REQUIRE(rdata->length != 0); - - dns_compress_setmethods(cctx, DNS_COMPRESS_NONE); - dns_name_init(&name, offsets); - dns_rdata_toregion(rdata, &sr); - dns_name_fromregion(&name, &sr); - isc_region_consume(&sr, name_length(&name)); - RETERR(dns_name_towire(&name, cctx, target)); - - return (mem_tobuffer(target, sr.base, sr.length)); -} - -static inline int -compare_nxt(ARGS_COMPARE) { - isc_region_t r1; - isc_region_t r2; - dns_name_t name1; - dns_name_t name2; - int order; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 30); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - dns_name_init(&name1, NULL); - dns_name_init(&name2, NULL); - dns_rdata_toregion(rdata1, &r1); - dns_rdata_toregion(rdata2, &r2); - dns_name_fromregion(&name1, &r1); - dns_name_fromregion(&name2, &r2); - order = dns_name_rdatacompare(&name1, &name2); - if (order != 0) - return (order); - - return (isc_region_compare(&r1, &r2)); -} - -static inline isc_result_t -fromstruct_nxt(ARGS_FROMSTRUCT) { - dns_rdata_nxt_t *nxt = source; - isc_region_t region; - - REQUIRE(type == 30); - REQUIRE(source != NULL); - REQUIRE(nxt->common.rdtype == type); - REQUIRE(nxt->common.rdclass == rdclass); - REQUIRE(nxt->typebits != NULL || nxt->len == 0); - if (nxt->typebits != NULL && (nxt->typebits[0] & 0x80) == 0) { - REQUIRE(nxt->len <= 16); - REQUIRE(nxt->typebits[nxt->len - 1] != 0); - } - - UNUSED(type); - UNUSED(rdclass); - - dns_name_toregion(&nxt->next, ®ion); - RETERR(isc_buffer_copyregion(target, ®ion)); - - return (mem_tobuffer(target, nxt->typebits, nxt->len)); -} - -static inline isc_result_t -tostruct_nxt(ARGS_TOSTRUCT) { - isc_region_t region; - dns_rdata_nxt_t *nxt = target; - dns_name_t name; - - REQUIRE(rdata->type == 30); - REQUIRE(target != NULL); - REQUIRE(rdata->length != 0); - - nxt->common.rdclass = rdata->rdclass; - nxt->common.rdtype = rdata->type; - ISC_LINK_INIT(&nxt->common, link); - - dns_name_init(&name, NULL); - dns_rdata_toregion(rdata, ®ion); - dns_name_fromregion(&name, ®ion); - isc_region_consume(®ion, name_length(&name)); - dns_name_init(&nxt->next, NULL); - RETERR(name_duporclone(&name, mctx, &nxt->next)); - - nxt->len = region.length; - nxt->typebits = mem_maybedup(mctx, region.base, region.length); - if (nxt->typebits == NULL) - goto cleanup; - - nxt->mctx = mctx; - return (ISC_R_SUCCESS); - - cleanup: - if (mctx != NULL) - dns_name_free(&nxt->next, mctx); - return (ISC_R_NOMEMORY); -} - -static inline void -freestruct_nxt(ARGS_FREESTRUCT) { - dns_rdata_nxt_t *nxt = source; - - REQUIRE(source != NULL); - REQUIRE(nxt->common.rdtype == 30); - - if (nxt->mctx == NULL) - return; - - dns_name_free(&nxt->next, nxt->mctx); - if (nxt->typebits != NULL) - isc_mem_free(nxt->mctx, nxt->typebits); - nxt->mctx = NULL; -} - -static inline isc_result_t -additionaldata_nxt(ARGS_ADDLDATA) { - REQUIRE(rdata->type == 30); - - UNUSED(rdata); - UNUSED(add); - UNUSED(arg); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_nxt(ARGS_DIGEST) { - isc_region_t r; - dns_name_t name; - isc_result_t result; - - REQUIRE(rdata->type == 30); - - dns_rdata_toregion(rdata, &r); - dns_name_init(&name, NULL); - dns_name_fromregion(&name, &r); - result = dns_name_digest(&name, digest, arg); - if (result != ISC_R_SUCCESS) - return (result); - isc_region_consume(&r, name_length(&name)); - - return ((digest)(arg, &r)); -} - -static inline isc_boolean_t -checkowner_nxt(ARGS_CHECKOWNER) { - - REQUIRE(type == 30); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_nxt(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 30); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_GENERIC_NXT_30_C */ diff --git a/contrib/bind9/lib/dns/rdata/generic/nxt_30.h b/contrib/bind9/lib/dns/rdata/generic/nxt_30.h deleted file mode 100644 index 3700fb1..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/nxt_30.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2002 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef GENERIC_NXT_30_H -#define GENERIC_NXT_30_H 1 - -/* $Id: nxt_30.h,v 1.21.18.2 2005/04/29 00:16:38 marka Exp $ */ - -/*! - * \brief RFC2535 */ - -typedef struct dns_rdata_nxt { - dns_rdatacommon_t common; - isc_mem_t *mctx; - dns_name_t next; - unsigned char *typebits; - isc_uint16_t len; -} dns_rdata_nxt_t; - -#endif /* GENERIC_NXT_30_H */ diff --git a/contrib/bind9/lib/dns/rdata/generic/opt_41.c b/contrib/bind9/lib/dns/rdata/generic/opt_41.c deleted file mode 100644 index e8f4816..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/opt_41.c +++ /dev/null @@ -1,280 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2002 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: opt_41.c,v 1.29.18.2 2005/04/29 00:16:38 marka Exp $ */ - -/* Reviewed: Thu Mar 16 14:06:44 PST 2000 by gson */ - -/* RFC2671 */ - -#ifndef RDATA_GENERIC_OPT_41_C -#define RDATA_GENERIC_OPT_41_C - -#define RRTYPE_OPT_ATTRIBUTES (DNS_RDATATYPEATTR_SINGLETON | \ - DNS_RDATATYPEATTR_META | \ - DNS_RDATATYPEATTR_NOTQUESTION) - -static inline isc_result_t -fromtext_opt(ARGS_FROMTEXT) { - /* - * OPT records do not have a text format. - */ - - REQUIRE(type == 41); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(lexer); - UNUSED(origin); - UNUSED(options); - UNUSED(target); - UNUSED(callbacks); - - return (ISC_R_NOTIMPLEMENTED); -} - -static inline isc_result_t -totext_opt(ARGS_TOTEXT) { - isc_region_t r; - isc_region_t or; - isc_uint16_t option; - isc_uint16_t length; - char buf[sizeof("64000 64000")]; - - /* - * OPT records do not have a text format. - */ - - REQUIRE(rdata->type == 41); - - dns_rdata_toregion(rdata, &r); - while (r.length > 0) { - option = uint16_fromregion(&r); - isc_region_consume(&r, 2); - length = uint16_fromregion(&r); - isc_region_consume(&r, 2); - sprintf(buf, "%u %u", option, length); - RETERR(str_totext(buf, target)); - INSIST(r.length >= length); - if (length > 0) { - if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) - RETERR(str_totext(" (", target)); - RETERR(str_totext(tctx->linebreak, target)); - or = r; - or.length = length; - RETERR(isc_base64_totext(&or, tctx->width - 2, - tctx->linebreak, target)); - isc_region_consume(&r, length); - if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) - RETERR(str_totext(" )", target)); - } - if (r.length > 0) - RETERR(str_totext(" ", target)); - } - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -fromwire_opt(ARGS_FROMWIRE) { - isc_region_t sregion; - isc_region_t tregion; - isc_uint16_t length; - unsigned int total; - - REQUIRE(type == 41); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(dctx); - UNUSED(options); - - isc_buffer_activeregion(source, &sregion); - total = 0; - while (sregion.length != 0) { - if (sregion.length < 4) - return (ISC_R_UNEXPECTEDEND); - /* - * Eat the 16bit option code. There is nothing to - * be done with it currently. - */ - isc_region_consume(&sregion, 2); - length = uint16_fromregion(&sregion); - isc_region_consume(&sregion, 2); - total += 4; - if (sregion.length < length) - return (ISC_R_UNEXPECTEDEND); - isc_region_consume(&sregion, length); - total += length; - } - - isc_buffer_activeregion(source, &sregion); - isc_buffer_availableregion(target, &tregion); - if (tregion.length < total) - return (ISC_R_NOSPACE); - memcpy(tregion.base, sregion.base, total); - isc_buffer_forward(source, total); - isc_buffer_add(target, total); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -towire_opt(ARGS_TOWIRE) { - - REQUIRE(rdata->type == 41); - - UNUSED(cctx); - - return (mem_tobuffer(target, rdata->data, rdata->length)); -} - -static inline int -compare_opt(ARGS_COMPARE) { - isc_region_t r1; - isc_region_t r2; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 41); - - dns_rdata_toregion(rdata1, &r1); - dns_rdata_toregion(rdata2, &r2); - return (isc_region_compare(&r1, &r2)); -} - -static inline isc_result_t -fromstruct_opt(ARGS_FROMSTRUCT) { - dns_rdata_opt_t *opt = source; - isc_region_t region; - isc_uint16_t length; - - REQUIRE(type == 41); - REQUIRE(source != NULL); - REQUIRE(opt->common.rdtype == type); - REQUIRE(opt->common.rdclass == rdclass); - REQUIRE(opt->options != NULL || opt->length == 0); - - UNUSED(type); - UNUSED(rdclass); - - region.base = opt->options; - region.length = opt->length; - while (region.length >= 4) { - isc_region_consume(®ion, 2); /* opt */ - length = uint16_fromregion(®ion); - isc_region_consume(®ion, 2); - if (region.length < length) - return (ISC_R_UNEXPECTEDEND); - isc_region_consume(®ion, length); - } - if (region.length != 0) - return (ISC_R_UNEXPECTEDEND); - - return (mem_tobuffer(target, opt->options, opt->length)); -} - -static inline isc_result_t -tostruct_opt(ARGS_TOSTRUCT) { - dns_rdata_opt_t *opt = target; - isc_region_t r; - - REQUIRE(rdata->type == 41); - REQUIRE(target != NULL); - - opt->common.rdclass = rdata->rdclass; - opt->common.rdtype = rdata->type; - ISC_LINK_INIT(&opt->common, link); - - dns_rdata_toregion(rdata, &r); - opt->length = r.length; - opt->options = mem_maybedup(mctx, r.base, r.length); - if (opt->options == NULL) - return (ISC_R_NOMEMORY); - - opt->offset = 0; - opt->mctx = mctx; - return (ISC_R_SUCCESS); -} - -static inline void -freestruct_opt(ARGS_FREESTRUCT) { - dns_rdata_opt_t *opt = source; - - REQUIRE(source != NULL); - REQUIRE(opt->common.rdtype == 41); - - if (opt->mctx == NULL) - return; - - if (opt->options != NULL) - isc_mem_free(opt->mctx, opt->options); - opt->mctx = NULL; -} - -static inline isc_result_t -additionaldata_opt(ARGS_ADDLDATA) { - REQUIRE(rdata->type == 41); - - UNUSED(rdata); - UNUSED(add); - UNUSED(arg); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_opt(ARGS_DIGEST) { - - /* - * OPT records are not digested. - */ - - REQUIRE(rdata->type == 41); - - UNUSED(rdata); - UNUSED(digest); - UNUSED(arg); - - return (ISC_R_NOTIMPLEMENTED); -} - -static inline isc_boolean_t -checkowner_opt(ARGS_CHECKOWNER) { - - REQUIRE(type == 41); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (dns_name_equal(name, dns_rootname)); -} - -static inline isc_boolean_t -checknames_opt(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 41); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_GENERIC_OPT_41_C */ diff --git a/contrib/bind9/lib/dns/rdata/generic/opt_41.h b/contrib/bind9/lib/dns/rdata/generic/opt_41.h deleted file mode 100644 index 827936e..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/opt_41.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef GENERIC_OPT_41_H -#define GENERIC_OPT_41_H 1 - -/* $Id: opt_41.h,v 1.14.18.2 2005/04/29 00:16:38 marka Exp $ */ - -/*! - * \brief Per RFC2671 */ - -typedef struct dns_rdata_opt_opcode { - isc_uint16_t opcode; - isc_uint16_t length; - unsigned char *data; -} dns_rdata_opt_opcode_t; - -typedef struct dns_rdata_opt { - dns_rdatacommon_t common; - isc_mem_t *mctx; - unsigned char *options; - isc_uint16_t length; - /* private */ - isc_uint16_t offset; -} dns_rdata_opt_t; - -/* - * ISC_LANG_BEGINDECLS and ISC_LANG_ENDDECLS are already done - * via rdatastructpre.h and rdatastructsuf.h. - */ - -isc_result_t -dns_rdata_opt_first(dns_rdata_opt_t *); - -isc_result_t -dns_rdata_opt_next(dns_rdata_opt_t *); - -isc_result_t -dns_rdata_opt_current(dns_rdata_opt_t *, dns_rdata_opt_opcode_t *); - -#endif /* GENERIC_OPT_41_H */ diff --git a/contrib/bind9/lib/dns/rdata/generic/proforma.c b/contrib/bind9/lib/dns/rdata/generic/proforma.c deleted file mode 100644 index bf8b2fd..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/proforma.c +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2002 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: proforma.c,v 1.34 2004/03/05 05:10:17 marka Exp $ */ - -#ifndef RDATA_GENERIC_#_#_C -#define RDATA_GENERIC_#_#_C - -#define RRTYPE_#_ATTRIBUTES (0) - -static inline isc_result_t -fromtext_#(ARGS_FROMTEXT) { - isc_token_t token; - - REQUIRE(type == #); - REQUIRE(rdclass == #); - - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - - return (ISC_R_NOTIMPLEMENTED); -} - -static inline isc_result_t -totext_#(ARGS_TOTEXT) { - - REQUIRE(rdata->type == #); - REQUIRE(rdata->rdclass == #); - REQUIRE(rdata->length != 0); /* XXX */ - - return (ISC_R_NOTIMPLEMENTED); -} - -static inline isc_result_t -fromwire_#(ARGS_FROMWIRE) { - - REQUIRE(type == #); - REQUIRE(rdclass == #); - - /* NONE or GLOBAL14 */ - dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE); - - return (ISC_R_NOTIMPLEMENTED); -} - -static inline isc_result_t -towire_#(ARGS_TOWIRE) { - - REQUIRE(rdata->type == #); - REQUIRE(rdata->rdclass == #); - REQUIRE(rdata->length != 0); /* XXX */ - - /* NONE or GLOBAL14 */ - dns_compress_setmethods(cctx, DNS_COMPRESS_NONE); - - return (ISC_R_NOTIMPLEMENTED); -} - -static inline int -compare_#(ARGS_COMPARE) { - isc_region_t r1; - isc_region_t r2; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == #); - REQUIRE(rdata1->rdclass == #); - REQUIRE(rdata1->length != 0); /* XXX */ - REQUIRE(rdata2->length != 0); /* XXX */ - - dns_rdata_toregion(rdata1, &r1); - dns_rdata_toregion(rdata2, &r2); - return (isc_region_compare(&r1, &r2)); -} - -static inline isc_result_t -fromstruct_#(ARGS_FROMSTRUCT) { - dns_rdata_#_t *# = source; - - REQUIRE(type == #); - REQUIRE(rdclass == #); - REQUIRE(source != NULL); - REQUIRE(#->common.rdtype == type); - REQUIRE(#->common.rdclass == rdclass); - - return (ISC_R_NOTIMPLEMENTED); -} - -static inline isc_result_t -tostruct_#(ARGS_TOSTRUCT) { - - REQUIRE(rdata->type == #); - REQUIRE(rdata->rdclass == #); - REQUIRE(rdata->length != 0); /* XXX */ - - return (ISC_R_NOTIMPLEMENTED); -} - -static inline void -freestruct_#(ARGS_FREESTRUCT) { - dns_rdata_#_t *# = source; - - REQUIRE(source != NULL); - REQUIRE(#->common.rdtype == #); - REQUIRE(#->common.rdclass == #); - -} - -static inline isc_result_t -additionaldata_#(ARGS_ADDLDATA) { - REQUIRE(rdata->type == #); - REQUIRE(rdata->rdclass == #); - - (void)add; - (void)arg; - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_#(ARGS_DIGEST) { - isc_region_t r; - - REQUIRE(rdata->type == #); - REQUIRE(rdata->rdclass == #); - - dns_rdata_toregion(rdata, &r); - - return ((digest)(arg, &r)); -} - -static inline isc_boolean_t -checkowner_#(ARGS_CHECKOWNER) { - - REQUIRE(type == #); - REQUIRE(rdclass == #); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_#(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == #); - REQUIRE(rdata->rdclass == #); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_GENERIC_#_#_C */ diff --git a/contrib/bind9/lib/dns/rdata/generic/proforma.h b/contrib/bind9/lib/dns/rdata/generic/proforma.h deleted file mode 100644 index 89d1606..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/proforma.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* */ -#ifndef GENERIC_PROFORMA_H -#define GENERIC_PROFORMA_H 1 - -/* $Id: proforma.h,v 1.19.18.2 2005/04/29 00:16:39 marka Exp $ */ - -typedef struct dns_rdata_# { - dns_rdatacommon_t common; - isc_mem_t *mctx; /* if required */ - /* type & class specific elements */ -} dns_rdata_#_t; - -#endif /* GENERIC_PROFORMA_H */ diff --git a/contrib/bind9/lib/dns/rdata/generic/ptr_12.c b/contrib/bind9/lib/dns/rdata/generic/ptr_12.c deleted file mode 100644 index 16d5706..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/ptr_12.c +++ /dev/null @@ -1,291 +0,0 @@ -/* - * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: ptr_12.c,v 1.41 2004/03/05 05:10:17 marka Exp $ */ - -/* Reviewed: Thu Mar 16 14:05:12 PST 2000 by explorer */ - -#ifndef RDATA_GENERIC_PTR_12_C -#define RDATA_GENERIC_PTR_12_C - -#define RRTYPE_PTR_ATTRIBUTES (0) - -static inline isc_result_t -fromtext_ptr(ARGS_FROMTEXT) { - isc_token_t token; - dns_name_t name; - isc_buffer_t buffer; - - REQUIRE(type == 12); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(callbacks); - - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - - dns_name_init(&name, NULL); - buffer_fromregion(&buffer, &token.value.as_region); - origin = (origin != NULL) ? origin : dns_rootname; - RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target)); - if (rdclass == dns_rdataclass_in && - (options & DNS_RDATA_CHECKNAMES) != 0 && - (options & DNS_RDATA_CHECKREVERSE) != 0) { - isc_boolean_t ok; - ok = dns_name_ishostname(&name, ISC_FALSE); - if (!ok && (options & DNS_RDATA_CHECKNAMESFAIL) != 0) - RETTOK(DNS_R_BADNAME); - if (!ok && callbacks != NULL) - warn_badname(&name, lexer, callbacks); - } - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -totext_ptr(ARGS_TOTEXT) { - isc_region_t region; - dns_name_t name; - dns_name_t prefix; - isc_boolean_t sub; - - REQUIRE(rdata->type == 12); - REQUIRE(rdata->length != 0); - - dns_name_init(&name, NULL); - dns_name_init(&prefix, NULL); - - dns_rdata_toregion(rdata, ®ion); - dns_name_fromregion(&name, ®ion); - - sub = name_prefix(&name, tctx->origin, &prefix); - - return (dns_name_totext(&prefix, sub, target)); -} - -static inline isc_result_t -fromwire_ptr(ARGS_FROMWIRE) { - dns_name_t name; - - REQUIRE(type == 12); - - UNUSED(type); - UNUSED(rdclass); - - dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14); - - dns_name_init(&name, NULL); - return (dns_name_fromwire(&name, source, dctx, options, target)); -} - -static inline isc_result_t -towire_ptr(ARGS_TOWIRE) { - dns_name_t name; - dns_offsets_t offsets; - isc_region_t region; - - REQUIRE(rdata->type == 12); - REQUIRE(rdata->length != 0); - - dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14); - - dns_name_init(&name, offsets); - dns_rdata_toregion(rdata, ®ion); - dns_name_fromregion(&name, ®ion); - - return (dns_name_towire(&name, cctx, target)); -} - -static inline int -compare_ptr(ARGS_COMPARE) { - dns_name_t name1; - dns_name_t name2; - isc_region_t region1; - isc_region_t region2; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 12); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - dns_name_init(&name1, NULL); - dns_name_init(&name2, NULL); - - dns_rdata_toregion(rdata1, ®ion1); - dns_rdata_toregion(rdata2, ®ion2); - - dns_name_fromregion(&name1, ®ion1); - dns_name_fromregion(&name2, ®ion2); - - return (dns_name_rdatacompare(&name1, &name2)); -} - -static inline isc_result_t -fromstruct_ptr(ARGS_FROMSTRUCT) { - dns_rdata_ptr_t *ptr = source; - isc_region_t region; - - REQUIRE(type == 12); - REQUIRE(source != NULL); - REQUIRE(ptr->common.rdtype == type); - REQUIRE(ptr->common.rdclass == rdclass); - - UNUSED(type); - UNUSED(rdclass); - - dns_name_toregion(&ptr->ptr, ®ion); - return (isc_buffer_copyregion(target, ®ion)); -} - -static inline isc_result_t -tostruct_ptr(ARGS_TOSTRUCT) { - isc_region_t region; - dns_rdata_ptr_t *ptr = target; - dns_name_t name; - - REQUIRE(rdata->type == 12); - REQUIRE(target != NULL); - REQUIRE(rdata->length != 0); - - ptr->common.rdclass = rdata->rdclass; - ptr->common.rdtype = rdata->type; - ISC_LINK_INIT(&ptr->common, link); - - dns_name_init(&name, NULL); - dns_rdata_toregion(rdata, ®ion); - dns_name_fromregion(&name, ®ion); - dns_name_init(&ptr->ptr, NULL); - RETERR(name_duporclone(&name, mctx, &ptr->ptr)); - ptr->mctx = mctx; - return (ISC_R_SUCCESS); -} - -static inline void -freestruct_ptr(ARGS_FREESTRUCT) { - dns_rdata_ptr_t *ptr = source; - - REQUIRE(source != NULL); - REQUIRE(ptr->common.rdtype == 12); - - if (ptr->mctx == NULL) - return; - - dns_name_free(&ptr->ptr, ptr->mctx); - ptr->mctx = NULL; -} - -static inline isc_result_t -additionaldata_ptr(ARGS_ADDLDATA) { - REQUIRE(rdata->type == 12); - - UNUSED(rdata); - UNUSED(add); - UNUSED(arg); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_ptr(ARGS_DIGEST) { - isc_region_t r; - dns_name_t name; - - REQUIRE(rdata->type == 12); - - dns_rdata_toregion(rdata, &r); - dns_name_init(&name, NULL); - dns_name_fromregion(&name, &r); - - return (dns_name_digest(&name, digest, arg)); -} - -static inline isc_boolean_t -checkowner_ptr(ARGS_CHECKOWNER) { - - REQUIRE(type == 12); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static unsigned char ip6_arpa_data[] = "\003IP6\004ARPA"; -static unsigned char ip6_arpa_offsets[] = { 0, 4, 9 }; -static const dns_name_t ip6_arpa = -{ - DNS_NAME_MAGIC, - ip6_arpa_data, 10, 3, - DNS_NAMEATTR_READONLY | DNS_NAMEATTR_ABSOLUTE, - ip6_arpa_offsets, NULL, - {(void *)-1, (void *)-1}, - {NULL, NULL} -}; - -static unsigned char ip6_int_data[] = "\003IP6\003INT"; -static unsigned char ip6_int_offsets[] = { 0, 4, 8 }; -static const dns_name_t ip6_int = -{ - DNS_NAME_MAGIC, - ip6_int_data, 9, 3, - DNS_NAMEATTR_READONLY | DNS_NAMEATTR_ABSOLUTE, - ip6_int_offsets, NULL, - {(void *)-1, (void *)-1}, - {NULL, NULL} -}; - -static unsigned char in_addr_arpa_data[] = "\007IN-ADDR\004ARPA"; -static unsigned char in_addr_arpa_offsets[] = { 0, 8, 13 }; -static const dns_name_t in_addr_arpa = -{ - DNS_NAME_MAGIC, - in_addr_arpa_data, 14, 3, - DNS_NAMEATTR_READONLY | DNS_NAMEATTR_ABSOLUTE, - in_addr_arpa_offsets, NULL, - {(void *)-1, (void *)-1}, - {NULL, NULL} -}; - -static inline isc_boolean_t -checknames_ptr(ARGS_CHECKNAMES) { - isc_region_t region; - dns_name_t name; - - REQUIRE(rdata->type == 12); - - if (rdata->rdclass != dns_rdataclass_in) - return (ISC_TRUE); - - if (dns_name_issubdomain(owner, &in_addr_arpa) || - dns_name_issubdomain(owner, &ip6_arpa) || - dns_name_issubdomain(owner, &ip6_int)) { - dns_rdata_toregion(rdata, ®ion); - dns_name_init(&name, NULL); - dns_name_fromregion(&name, ®ion); - if (!dns_name_ishostname(&name, ISC_FALSE)) { - if (bad != NULL) - dns_name_clone(&name, bad); - return (ISC_FALSE); - } - } - return (ISC_TRUE); -} - -#endif /* RDATA_GENERIC_PTR_12_C */ diff --git a/contrib/bind9/lib/dns/rdata/generic/ptr_12.h b/contrib/bind9/lib/dns/rdata/generic/ptr_12.h deleted file mode 100644 index 4eb8fa7..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/ptr_12.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* */ -#ifndef GENERIC_PTR_12_H -#define GENERIC_PTR_12_H 1 - -/* $Id: ptr_12.h,v 1.23.18.2 2005/04/29 00:16:39 marka Exp $ */ - -typedef struct dns_rdata_ptr { - dns_rdatacommon_t common; - isc_mem_t *mctx; - dns_name_t ptr; -} dns_rdata_ptr_t; - -#endif /* GENERIC_PTR_12_H */ diff --git a/contrib/bind9/lib/dns/rdata/generic/rp_17.c b/contrib/bind9/lib/dns/rdata/generic/rp_17.c deleted file mode 100644 index b153643..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/rp_17.c +++ /dev/null @@ -1,314 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: rp_17.c,v 1.38.18.2 2005/04/29 00:16:39 marka Exp $ */ - -/* RFC1183 */ - -#ifndef RDATA_GENERIC_RP_17_C -#define RDATA_GENERIC_RP_17_C - -#define RRTYPE_RP_ATTRIBUTES (0) - -static inline isc_result_t -fromtext_rp(ARGS_FROMTEXT) { - isc_token_t token; - dns_name_t name; - isc_buffer_t buffer; - int i; - isc_boolean_t ok; - - REQUIRE(type == 17); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(callbacks); - - origin = (origin != NULL) ? origin : dns_rootname; - - for (i = 0; i < 2; i++) { - RETERR(isc_lex_getmastertoken(lexer, &token, - isc_tokentype_string, - ISC_FALSE)); - dns_name_init(&name, NULL); - buffer_fromregion(&buffer, &token.value.as_region); - RETTOK(dns_name_fromtext(&name, &buffer, origin, - options, target)); - ok = ISC_TRUE; - if ((options & DNS_RDATA_CHECKNAMES) != 0 && i == 0) - ok = dns_name_ismailbox(&name); - if (!ok && (options & DNS_RDATA_CHECKNAMESFAIL) != 0) - RETTOK(DNS_R_BADNAME); - if (!ok && callbacks != NULL) - warn_badname(&name, lexer, callbacks); - } - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -totext_rp(ARGS_TOTEXT) { - isc_region_t region; - dns_name_t rmail; - dns_name_t email; - dns_name_t prefix; - isc_boolean_t sub; - - REQUIRE(rdata->type == 17); - REQUIRE(rdata->length != 0); - - dns_name_init(&rmail, NULL); - dns_name_init(&email, NULL); - dns_name_init(&prefix, NULL); - - dns_rdata_toregion(rdata, ®ion); - - dns_name_fromregion(&rmail, ®ion); - isc_region_consume(®ion, rmail.length); - - dns_name_fromregion(&email, ®ion); - isc_region_consume(®ion, email.length); - - sub = name_prefix(&rmail, tctx->origin, &prefix); - RETERR(dns_name_totext(&prefix, sub, target)); - - RETERR(str_totext(" ", target)); - - sub = name_prefix(&email, tctx->origin, &prefix); - return (dns_name_totext(&prefix, sub, target)); -} - -static inline isc_result_t -fromwire_rp(ARGS_FROMWIRE) { - dns_name_t rmail; - dns_name_t email; - - REQUIRE(type == 17); - - UNUSED(type); - UNUSED(rdclass); - - dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE); - - dns_name_init(&rmail, NULL); - dns_name_init(&email, NULL); - - RETERR(dns_name_fromwire(&rmail, source, dctx, options, target)); - return (dns_name_fromwire(&email, source, dctx, options, target)); -} - -static inline isc_result_t -towire_rp(ARGS_TOWIRE) { - isc_region_t region; - dns_name_t rmail; - dns_name_t email; - dns_offsets_t roffsets; - dns_offsets_t eoffsets; - - REQUIRE(rdata->type == 17); - REQUIRE(rdata->length != 0); - - dns_compress_setmethods(cctx, DNS_COMPRESS_NONE); - dns_name_init(&rmail, roffsets); - dns_name_init(&email, eoffsets); - - dns_rdata_toregion(rdata, ®ion); - - dns_name_fromregion(&rmail, ®ion); - isc_region_consume(®ion, rmail.length); - - RETERR(dns_name_towire(&rmail, cctx, target)); - - dns_name_fromregion(&rmail, ®ion); - isc_region_consume(®ion, rmail.length); - - return (dns_name_towire(&rmail, cctx, target)); -} - -static inline int -compare_rp(ARGS_COMPARE) { - isc_region_t region1; - isc_region_t region2; - dns_name_t name1; - dns_name_t name2; - int order; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 17); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - dns_name_init(&name1, NULL); - dns_name_init(&name2, NULL); - - dns_rdata_toregion(rdata1, ®ion1); - dns_rdata_toregion(rdata2, ®ion2); - - dns_name_fromregion(&name1, ®ion1); - dns_name_fromregion(&name2, ®ion2); - - order = dns_name_rdatacompare(&name1, &name2); - if (order != 0) - return (order); - - isc_region_consume(®ion1, name_length(&name1)); - isc_region_consume(®ion2, name_length(&name2)); - - dns_name_init(&name1, NULL); - dns_name_init(&name2, NULL); - - dns_name_fromregion(&name1, ®ion1); - dns_name_fromregion(&name2, ®ion2); - - return (dns_name_rdatacompare(&name1, &name2)); -} - -static inline isc_result_t -fromstruct_rp(ARGS_FROMSTRUCT) { - dns_rdata_rp_t *rp = source; - isc_region_t region; - - REQUIRE(type == 17); - REQUIRE(source != NULL); - REQUIRE(rp->common.rdtype == type); - REQUIRE(rp->common.rdclass == rdclass); - - UNUSED(type); - UNUSED(rdclass); - - dns_name_toregion(&rp->mail, ®ion); - RETERR(isc_buffer_copyregion(target, ®ion)); - dns_name_toregion(&rp->text, ®ion); - return (isc_buffer_copyregion(target, ®ion)); -} - -static inline isc_result_t -tostruct_rp(ARGS_TOSTRUCT) { - isc_result_t result; - isc_region_t region; - dns_rdata_rp_t *rp = target; - dns_name_t name; - - REQUIRE(rdata->type == 17); - REQUIRE(target != NULL); - REQUIRE(rdata->length != 0); - - rp->common.rdclass = rdata->rdclass; - rp->common.rdtype = rdata->type; - ISC_LINK_INIT(&rp->common, link); - - dns_name_init(&name, NULL); - dns_rdata_toregion(rdata, ®ion); - dns_name_fromregion(&name, ®ion); - dns_name_init(&rp->mail, NULL); - RETERR(name_duporclone(&name, mctx, &rp->mail)); - isc_region_consume(®ion, name_length(&name)); - dns_name_fromregion(&name, ®ion); - dns_name_init(&rp->text, NULL); - result = name_duporclone(&name, mctx, &rp->text); - if (result != ISC_R_SUCCESS) - goto cleanup; - - rp->mctx = mctx; - return (ISC_R_SUCCESS); - - cleanup: - if (mctx != NULL) - dns_name_free(&rp->mail, mctx); - return (ISC_R_NOMEMORY); -} - -static inline void -freestruct_rp(ARGS_FREESTRUCT) { - dns_rdata_rp_t *rp = source; - - REQUIRE(source != NULL); - REQUIRE(rp->common.rdtype == 17); - - if (rp->mctx == NULL) - return; - - dns_name_free(&rp->mail, rp->mctx); - dns_name_free(&rp->text, rp->mctx); - rp->mctx = NULL; -} - -static inline isc_result_t -additionaldata_rp(ARGS_ADDLDATA) { - REQUIRE(rdata->type == 17); - - UNUSED(rdata); - UNUSED(add); - UNUSED(arg); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_rp(ARGS_DIGEST) { - isc_region_t r; - dns_name_t name; - - REQUIRE(rdata->type == 17); - - dns_rdata_toregion(rdata, &r); - dns_name_init(&name, NULL); - - dns_name_fromregion(&name, &r); - RETERR(dns_name_digest(&name, digest, arg)); - isc_region_consume(&r, name_length(&name)); - - dns_name_init(&name, NULL); - dns_name_fromregion(&name, &r); - - return (dns_name_digest(&name, digest, arg)); -} - -static inline isc_boolean_t -checkowner_rp(ARGS_CHECKOWNER) { - - REQUIRE(type == 17); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_rp(ARGS_CHECKNAMES) { - isc_region_t region; - dns_name_t name; - - REQUIRE(rdata->type == 17); - - UNUSED(owner); - - dns_rdata_toregion(rdata, ®ion); - dns_name_init(&name, NULL); - dns_name_fromregion(&name, ®ion); - if (!dns_name_ismailbox(&name)) { - if (bad != NULL) - dns_name_clone(&name, bad); - return (ISC_FALSE); - } - return (ISC_TRUE); -} - -#endif /* RDATA_GENERIC_RP_17_C */ diff --git a/contrib/bind9/lib/dns/rdata/generic/rp_17.h b/contrib/bind9/lib/dns/rdata/generic/rp_17.h deleted file mode 100644 index 533c7e7..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/rp_17.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef GENERIC_RP_17_H -#define GENERIC_RP_17_H 1 - -/* $Id: rp_17.h,v 1.17.18.2 2005/04/29 00:16:39 marka Exp $ */ - -/*! - * \brief Per RFC1183 */ - -typedef struct dns_rdata_rp { - dns_rdatacommon_t common; - isc_mem_t *mctx; - dns_name_t mail; - dns_name_t text; -} dns_rdata_rp_t; - - -#endif /* GENERIC_RP_17_H */ diff --git a/contrib/bind9/lib/dns/rdata/generic/rrsig_46.c b/contrib/bind9/lib/dns/rdata/generic/rrsig_46.c deleted file mode 100644 index 6561f28..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/rrsig_46.c +++ /dev/null @@ -1,551 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: rrsig_46.c,v 1.5.18.3 2005/04/29 00:16:39 marka Exp $ */ - -/* Reviewed: Fri Mar 17 09:05:02 PST 2000 by gson */ - -/* RFC2535 */ - -#ifndef RDATA_GENERIC_RRSIG_46_C -#define RDATA_GENERIC_RRSIG_46_C - -#define RRTYPE_RRSIG_ATTRIBUTES (DNS_RDATATYPEATTR_DNSSEC) - -static inline isc_result_t -fromtext_rrsig(ARGS_FROMTEXT) { - isc_token_t token; - unsigned char c; - long i; - dns_rdatatype_t covered; - char *e; - isc_result_t result; - dns_name_t name; - isc_buffer_t buffer; - isc_uint32_t time_signed, time_expire; - - REQUIRE(type == 46); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(callbacks); - - /* - * Type covered. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - result = dns_rdatatype_fromtext(&covered, &token.value.as_textregion); - if (result != ISC_R_SUCCESS && result != ISC_R_NOTIMPLEMENTED) { - i = strtol(DNS_AS_STR(token), &e, 10); - if (i < 0 || i > 65535) - RETTOK(ISC_R_RANGE); - if (*e != 0) - RETTOK(result); - covered = (dns_rdatatype_t)i; - } - RETERR(uint16_tobuffer(covered, target)); - - /* - * Algorithm. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - RETTOK(dns_secalg_fromtext(&c, &token.value.as_textregion)); - RETERR(mem_tobuffer(target, &c, 1)); - - /* - * Labels. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - if (token.value.as_ulong > 0xffU) - RETTOK(ISC_R_RANGE); - c = (unsigned char)token.value.as_ulong; - RETERR(mem_tobuffer(target, &c, 1)); - - /* - * Original ttl. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - RETERR(uint32_tobuffer(token.value.as_ulong, target)); - - /* - * Signature expiration. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - RETTOK(dns_time32_fromtext(DNS_AS_STR(token), &time_expire)); - RETERR(uint32_tobuffer(time_expire, target)); - - /* - * Time signed. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - RETTOK(dns_time32_fromtext(DNS_AS_STR(token), &time_signed)); - RETERR(uint32_tobuffer(time_signed, target)); - - /* - * Key footprint. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - RETERR(uint16_tobuffer(token.value.as_ulong, target)); - - /* - * Signer. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - dns_name_init(&name, NULL); - buffer_fromregion(&buffer, &token.value.as_region); - origin = (origin != NULL) ? origin : dns_rootname; - RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target)); - - /* - * Sig. - */ - return (isc_base64_tobuffer(lexer, target, -1)); -} - -static inline isc_result_t -totext_rrsig(ARGS_TOTEXT) { - isc_region_t sr; - char buf[sizeof("4294967295")]; - dns_rdatatype_t covered; - unsigned long ttl; - unsigned long when; - unsigned long exp; - unsigned long foot; - dns_name_t name; - dns_name_t prefix; - isc_boolean_t sub; - - REQUIRE(rdata->type == 46); - REQUIRE(rdata->length != 0); - - dns_rdata_toregion(rdata, &sr); - - /* - * Type covered. - */ - covered = uint16_fromregion(&sr); - isc_region_consume(&sr, 2); - /* - * XXXAG We should have something like dns_rdatatype_isknown() - * that does the right thing with type 0. - */ - if (dns_rdatatype_isknown(covered) && covered != 0) { - RETERR(dns_rdatatype_totext(covered, target)); - } else { - char buf[sizeof("TYPE65535")]; - sprintf(buf, "TYPE%u", covered); - RETERR(str_totext(buf, target)); - } - RETERR(str_totext(" ", target)); - - /* - * Algorithm. - */ - sprintf(buf, "%u", sr.base[0]); - isc_region_consume(&sr, 1); - RETERR(str_totext(buf, target)); - RETERR(str_totext(" ", target)); - - /* - * Labels. - */ - sprintf(buf, "%u", sr.base[0]); - isc_region_consume(&sr, 1); - RETERR(str_totext(buf, target)); - RETERR(str_totext(" ", target)); - - /* - * Ttl. - */ - ttl = uint32_fromregion(&sr); - isc_region_consume(&sr, 4); - sprintf(buf, "%lu", ttl); - RETERR(str_totext(buf, target)); - RETERR(str_totext(" ", target)); - - /* - * Sig exp. - */ - exp = uint32_fromregion(&sr); - isc_region_consume(&sr, 4); - RETERR(dns_time32_totext(exp, target)); - - if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) - RETERR(str_totext(" (", target)); - RETERR(str_totext(tctx->linebreak, target)); - - /* - * Time signed. - */ - when = uint32_fromregion(&sr); - isc_region_consume(&sr, 4); - RETERR(dns_time32_totext(when, target)); - RETERR(str_totext(" ", target)); - - /* - * Footprint. - */ - foot = uint16_fromregion(&sr); - isc_region_consume(&sr, 2); - sprintf(buf, "%lu", foot); - RETERR(str_totext(buf, target)); - RETERR(str_totext(" ", target)); - - /* - * Signer. - */ - dns_name_init(&name, NULL); - dns_name_init(&prefix, NULL); - dns_name_fromregion(&name, &sr); - isc_region_consume(&sr, name_length(&name)); - sub = name_prefix(&name, tctx->origin, &prefix); - RETERR(dns_name_totext(&prefix, sub, target)); - - /* - * Sig. - */ - RETERR(str_totext(tctx->linebreak, target)); - RETERR(isc_base64_totext(&sr, tctx->width - 2, - tctx->linebreak, target)); - if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) - RETERR(str_totext(" )", target)); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -fromwire_rrsig(ARGS_FROMWIRE) { - isc_region_t sr; - dns_name_t name; - - REQUIRE(type == 46); - - UNUSED(type); - UNUSED(rdclass); - - dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE); - - isc_buffer_activeregion(source, &sr); - /* - * type covered: 2 - * algorithm: 1 - * labels: 1 - * original ttl: 4 - * signature expiration: 4 - * time signed: 4 - * key footprint: 2 - */ - if (sr.length < 18) - return (ISC_R_UNEXPECTEDEND); - - isc_buffer_forward(source, 18); - RETERR(mem_tobuffer(target, sr.base, 18)); - - /* - * Signer. - */ - dns_name_init(&name, NULL); - RETERR(dns_name_fromwire(&name, source, dctx, options, target)); - - /* - * Sig. - */ - isc_buffer_activeregion(source, &sr); - isc_buffer_forward(source, sr.length); - return (mem_tobuffer(target, sr.base, sr.length)); -} - -static inline isc_result_t -towire_rrsig(ARGS_TOWIRE) { - isc_region_t sr; - dns_name_t name; - dns_offsets_t offsets; - - REQUIRE(rdata->type == 46); - REQUIRE(rdata->length != 0); - - dns_compress_setmethods(cctx, DNS_COMPRESS_NONE); - dns_rdata_toregion(rdata, &sr); - /* - * type covered: 2 - * algorithm: 1 - * labels: 1 - * original ttl: 4 - * signature expiration: 4 - * time signed: 4 - * key footprint: 2 - */ - RETERR(mem_tobuffer(target, sr.base, 18)); - isc_region_consume(&sr, 18); - - /* - * Signer. - */ - dns_name_init(&name, offsets); - dns_name_fromregion(&name, &sr); - isc_region_consume(&sr, name_length(&name)); - RETERR(dns_name_towire(&name, cctx, target)); - - /* - * Signature. - */ - return (mem_tobuffer(target, sr.base, sr.length)); -} - -static inline int -compare_rrsig(ARGS_COMPARE) { - isc_region_t r1; - isc_region_t r2; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 46); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - dns_rdata_toregion(rdata1, &r1); - dns_rdata_toregion(rdata2, &r2); - return (isc_region_compare(&r1, &r2)); -} - -static inline isc_result_t -fromstruct_rrsig(ARGS_FROMSTRUCT) { - dns_rdata_rrsig_t *sig = source; - - REQUIRE(type == 46); - REQUIRE(source != NULL); - REQUIRE(sig->common.rdtype == type); - REQUIRE(sig->common.rdclass == rdclass); - REQUIRE(sig->signature != NULL || sig->siglen == 0); - - UNUSED(type); - UNUSED(rdclass); - - /* - * Type covered. - */ - RETERR(uint16_tobuffer(sig->covered, target)); - - /* - * Algorithm. - */ - RETERR(uint8_tobuffer(sig->algorithm, target)); - - /* - * Labels. - */ - RETERR(uint8_tobuffer(sig->labels, target)); - - /* - * Original TTL. - */ - RETERR(uint32_tobuffer(sig->originalttl, target)); - - /* - * Expire time. - */ - RETERR(uint32_tobuffer(sig->timeexpire, target)); - - /* - * Time signed. - */ - RETERR(uint32_tobuffer(sig->timesigned, target)); - - /* - * Key ID. - */ - RETERR(uint16_tobuffer(sig->keyid, target)); - - /* - * Signer name. - */ - RETERR(name_tobuffer(&sig->signer, target)); - - /* - * Signature. - */ - return (mem_tobuffer(target, sig->signature, sig->siglen)); -} - -static inline isc_result_t -tostruct_rrsig(ARGS_TOSTRUCT) { - isc_region_t sr; - dns_rdata_rrsig_t *sig = target; - dns_name_t signer; - - REQUIRE(rdata->type == 46); - REQUIRE(target != NULL); - REQUIRE(rdata->length != 0); - - sig->common.rdclass = rdata->rdclass; - sig->common.rdtype = rdata->type; - ISC_LINK_INIT(&sig->common, link); - - dns_rdata_toregion(rdata, &sr); - - /* - * Type covered. - */ - sig->covered = uint16_fromregion(&sr); - isc_region_consume(&sr, 2); - - /* - * Algorithm. - */ - sig->algorithm = uint8_fromregion(&sr); - isc_region_consume(&sr, 1); - - /* - * Labels. - */ - sig->labels = uint8_fromregion(&sr); - isc_region_consume(&sr, 1); - - /* - * Original TTL. - */ - sig->originalttl = uint32_fromregion(&sr); - isc_region_consume(&sr, 4); - - /* - * Expire time. - */ - sig->timeexpire = uint32_fromregion(&sr); - isc_region_consume(&sr, 4); - - /* - * Time signed. - */ - sig->timesigned = uint32_fromregion(&sr); - isc_region_consume(&sr, 4); - - /* - * Key ID. - */ - sig->keyid = uint16_fromregion(&sr); - isc_region_consume(&sr, 2); - - dns_name_init(&signer, NULL); - dns_name_fromregion(&signer, &sr); - dns_name_init(&sig->signer, NULL); - RETERR(name_duporclone(&signer, mctx, &sig->signer)); - isc_region_consume(&sr, name_length(&sig->signer)); - - /* - * Signature. - */ - sig->siglen = sr.length; - sig->signature = mem_maybedup(mctx, sr.base, sig->siglen); - if (sig->signature == NULL) - goto cleanup; - - - sig->mctx = mctx; - return (ISC_R_SUCCESS); - - cleanup: - if (mctx != NULL) - dns_name_free(&sig->signer, mctx); - return (ISC_R_NOMEMORY); -} - -static inline void -freestruct_rrsig(ARGS_FREESTRUCT) { - dns_rdata_rrsig_t *sig = (dns_rdata_rrsig_t *) source; - - REQUIRE(source != NULL); - REQUIRE(sig->common.rdtype == 46); - - if (sig->mctx == NULL) - return; - - dns_name_free(&sig->signer, sig->mctx); - if (sig->signature != NULL) - isc_mem_free(sig->mctx, sig->signature); - sig->mctx = NULL; -} - -static inline isc_result_t -additionaldata_rrsig(ARGS_ADDLDATA) { - REQUIRE(rdata->type == 46); - - UNUSED(rdata); - UNUSED(add); - UNUSED(arg); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_rrsig(ARGS_DIGEST) { - - REQUIRE(rdata->type == 46); - - UNUSED(rdata); - UNUSED(digest); - UNUSED(arg); - - return (ISC_R_NOTIMPLEMENTED); -} - -static inline dns_rdatatype_t -covers_rrsig(dns_rdata_t *rdata) { - dns_rdatatype_t type; - isc_region_t r; - - REQUIRE(rdata->type == 46); - - dns_rdata_toregion(rdata, &r); - type = uint16_fromregion(&r); - - return (type); -} - -static inline isc_boolean_t -checkowner_rrsig(ARGS_CHECKOWNER) { - - REQUIRE(type == 46); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_rrsig(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 46); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_GENERIC_RRSIG_46_C */ diff --git a/contrib/bind9/lib/dns/rdata/generic/rrsig_46.h b/contrib/bind9/lib/dns/rdata/generic/rrsig_46.h deleted file mode 100644 index b8b35a2..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/rrsig_46.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef GENERIC_DNSSIG_46_H -#define GENERIC_DNSSIG_46_H 1 - -/* $Id: rrsig_46.h,v 1.3.20.2 2005/04/29 00:16:39 marka Exp $ */ - -/*! - * \brief Per RFC2535 */ -typedef struct dns_rdata_rrsig { - dns_rdatacommon_t common; - isc_mem_t * mctx; - dns_rdatatype_t covered; - dns_secalg_t algorithm; - isc_uint8_t labels; - isc_uint32_t originalttl; - isc_uint32_t timeexpire; - isc_uint32_t timesigned; - isc_uint16_t keyid; - dns_name_t signer; - isc_uint16_t siglen; - unsigned char * signature; -} dns_rdata_rrsig_t; - - -#endif /* GENERIC_DNSSIG_46_H */ diff --git a/contrib/bind9/lib/dns/rdata/generic/rt_21.c b/contrib/bind9/lib/dns/rdata/generic/rt_21.c deleted file mode 100644 index 6977e98..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/rt_21.c +++ /dev/null @@ -1,311 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001, 2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: rt_21.c,v 1.41.18.3 2005/04/27 05:01:52 sra Exp $ */ - -/* reviewed: Thu Mar 16 15:02:31 PST 2000 by brister */ - -/* RFC1183 */ - -#ifndef RDATA_GENERIC_RT_21_C -#define RDATA_GENERIC_RT_21_C - -#define RRTYPE_RT_ATTRIBUTES (0) - -static inline isc_result_t -fromtext_rt(ARGS_FROMTEXT) { - isc_token_t token; - dns_name_t name; - isc_buffer_t buffer; - isc_boolean_t ok; - - REQUIRE(type == 21); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(callbacks); - - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - if (token.value.as_ulong > 0xffffU) - RETTOK(ISC_R_RANGE); - RETERR(uint16_tobuffer(token.value.as_ulong, target)); - - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - - dns_name_init(&name, NULL); - buffer_fromregion(&buffer, &token.value.as_region); - origin = (origin != NULL) ? origin : dns_rootname; - RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target)); - ok = ISC_TRUE; - if ((options & DNS_RDATA_CHECKNAMES) != 0) - ok = dns_name_ishostname(&name, ISC_FALSE); - if (!ok && (options & DNS_RDATA_CHECKNAMESFAIL) != 0) - RETTOK(DNS_R_BADNAME); - if (!ok && callbacks != NULL) - warn_badname(&name, lexer, callbacks); - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -totext_rt(ARGS_TOTEXT) { - isc_region_t region; - dns_name_t name; - dns_name_t prefix; - isc_boolean_t sub; - char buf[sizeof("64000")]; - unsigned short num; - - REQUIRE(rdata->type == 21); - REQUIRE(rdata->length != 0); - - dns_name_init(&name, NULL); - dns_name_init(&prefix, NULL); - - dns_rdata_toregion(rdata, ®ion); - num = uint16_fromregion(®ion); - isc_region_consume(®ion, 2); - sprintf(buf, "%u", num); - RETERR(str_totext(buf, target)); - RETERR(str_totext(" ", target)); - dns_name_fromregion(&name, ®ion); - sub = name_prefix(&name, tctx->origin, &prefix); - return (dns_name_totext(&prefix, sub, target)); -} - -static inline isc_result_t -fromwire_rt(ARGS_FROMWIRE) { - dns_name_t name; - isc_region_t sregion; - isc_region_t tregion; - - REQUIRE(type == 21); - - UNUSED(type); - UNUSED(rdclass); - - dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE); - - dns_name_init(&name, NULL); - - isc_buffer_activeregion(source, &sregion); - isc_buffer_availableregion(target, &tregion); - if (tregion.length < 2) - return (ISC_R_NOSPACE); - if (sregion.length < 2) - return (ISC_R_UNEXPECTEDEND); - memcpy(tregion.base, sregion.base, 2); - isc_buffer_forward(source, 2); - isc_buffer_add(target, 2); - return (dns_name_fromwire(&name, source, dctx, options, target)); -} - -static inline isc_result_t -towire_rt(ARGS_TOWIRE) { - dns_name_t name; - dns_offsets_t offsets; - isc_region_t region; - isc_region_t tr; - - REQUIRE(rdata->type == 21); - REQUIRE(rdata->length != 0); - - dns_compress_setmethods(cctx, DNS_COMPRESS_NONE); - isc_buffer_availableregion(target, &tr); - dns_rdata_toregion(rdata, ®ion); - if (tr.length < 2) - return (ISC_R_NOSPACE); - memcpy(tr.base, region.base, 2); - isc_region_consume(®ion, 2); - isc_buffer_add(target, 2); - - dns_name_init(&name, offsets); - dns_name_fromregion(&name, ®ion); - - return (dns_name_towire(&name, cctx, target)); -} - -static inline int -compare_rt(ARGS_COMPARE) { - dns_name_t name1; - dns_name_t name2; - isc_region_t region1; - isc_region_t region2; - int order; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 21); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - order = memcmp(rdata1->data, rdata2->data, 2); - if (order != 0) - return (order < 0 ? -1 : 1); - - dns_name_init(&name1, NULL); - dns_name_init(&name2, NULL); - - dns_rdata_toregion(rdata1, ®ion1); - dns_rdata_toregion(rdata2, ®ion2); - - isc_region_consume(®ion1, 2); - isc_region_consume(®ion2, 2); - - dns_name_fromregion(&name1, ®ion1); - dns_name_fromregion(&name2, ®ion2); - - return (dns_name_rdatacompare(&name1, &name2)); -} - -static inline isc_result_t -fromstruct_rt(ARGS_FROMSTRUCT) { - dns_rdata_rt_t *rt = source; - isc_region_t region; - - REQUIRE(type == 21); - REQUIRE(source != NULL); - REQUIRE(rt->common.rdtype == type); - REQUIRE(rt->common.rdclass == rdclass); - - UNUSED(type); - UNUSED(rdclass); - - RETERR(uint16_tobuffer(rt->preference, target)); - dns_name_toregion(&rt->host, ®ion); - return (isc_buffer_copyregion(target, ®ion)); -} - -static inline isc_result_t -tostruct_rt(ARGS_TOSTRUCT) { - isc_region_t region; - dns_rdata_rt_t *rt = target; - dns_name_t name; - - REQUIRE(rdata->type == 21); - REQUIRE(target != NULL); - REQUIRE(rdata->length != 0); - - rt->common.rdclass = rdata->rdclass; - rt->common.rdtype = rdata->type; - ISC_LINK_INIT(&rt->common, link); - - dns_name_init(&name, NULL); - dns_rdata_toregion(rdata, ®ion); - rt->preference = uint16_fromregion(®ion); - isc_region_consume(®ion, 2); - dns_name_fromregion(&name, ®ion); - dns_name_init(&rt->host, NULL); - RETERR(name_duporclone(&name, mctx, &rt->host)); - - rt->mctx = mctx; - return (ISC_R_SUCCESS); -} - -static inline void -freestruct_rt(ARGS_FREESTRUCT) { - dns_rdata_rt_t *rt = source; - - REQUIRE(source != NULL); - REQUIRE(rt->common.rdtype == 21); - - if (rt->mctx == NULL) - return; - - dns_name_free(&rt->host, rt->mctx); - rt->mctx = NULL; -} - -static inline isc_result_t -additionaldata_rt(ARGS_ADDLDATA) { - dns_name_t name; - dns_offsets_t offsets; - isc_region_t region; - isc_result_t result; - - REQUIRE(rdata->type == 21); - - dns_name_init(&name, offsets); - dns_rdata_toregion(rdata, ®ion); - isc_region_consume(®ion, 2); - dns_name_fromregion(&name, ®ion); - - result = (add)(arg, &name, dns_rdatatype_x25); - if (result != ISC_R_SUCCESS) - return (result); - result = (add)(arg, &name, dns_rdatatype_isdn); - if (result != ISC_R_SUCCESS) - return (result); - return ((add)(arg, &name, dns_rdatatype_a)); -} - -static inline isc_result_t -digest_rt(ARGS_DIGEST) { - isc_region_t r1, r2; - isc_result_t result; - dns_name_t name; - - REQUIRE(rdata->type == 21); - - dns_rdata_toregion(rdata, &r1); - r2 = r1; - isc_region_consume(&r2, 2); - r1.length = 2; - result = (digest)(arg, &r1); - if (result != ISC_R_SUCCESS) - return (result); - dns_name_init(&name, NULL); - dns_name_fromregion(&name, &r2); - return (dns_name_digest(&name, digest, arg)); -} - -static inline isc_boolean_t -checkowner_rt(ARGS_CHECKOWNER) { - - REQUIRE(type == 21); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_rt(ARGS_CHECKNAMES) { - isc_region_t region; - dns_name_t name; - - REQUIRE(rdata->type == 21); - - UNUSED(owner); - - dns_rdata_toregion(rdata, ®ion); - isc_region_consume(®ion, 2); - dns_name_init(&name, NULL); - dns_name_fromregion(&name, ®ion); - if (!dns_name_ishostname(&name, ISC_FALSE)) { - if (bad != NULL) - dns_name_clone(&name, bad); - return (ISC_FALSE); - } - return (ISC_TRUE); -} - -#endif /* RDATA_GENERIC_RT_21_C */ diff --git a/contrib/bind9/lib/dns/rdata/generic/rt_21.h b/contrib/bind9/lib/dns/rdata/generic/rt_21.h deleted file mode 100644 index b8ec969..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/rt_21.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef GENERIC_RT_21_H -#define GENERIC_RT_21_H 1 - -/* $Id: rt_21.h,v 1.17.18.2 2005/04/29 00:16:40 marka Exp $ */ - -/*! - * \brief Per RFC1183 */ - -typedef struct dns_rdata_rt { - dns_rdatacommon_t common; - isc_mem_t *mctx; - isc_uint16_t preference; - dns_name_t host; -} dns_rdata_rt_t; - -#endif /* GENERIC_RT_21_H */ diff --git a/contrib/bind9/lib/dns/rdata/generic/sig_24.c b/contrib/bind9/lib/dns/rdata/generic/sig_24.c deleted file mode 100644 index 9842953..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/sig_24.c +++ /dev/null @@ -1,578 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: sig_24.c,v 1.62.18.2 2005/04/29 00:16:40 marka Exp $ */ - -/* Reviewed: Fri Mar 17 09:05:02 PST 2000 by gson */ - -/* RFC2535 */ - -#ifndef RDATA_GENERIC_SIG_24_C -#define RDATA_GENERIC_SIG_24_C - -#define RRTYPE_SIG_ATTRIBUTES (0) - -static inline isc_result_t -fromtext_sig(ARGS_FROMTEXT) { - isc_token_t token; - unsigned char c; - long i; - dns_rdatatype_t covered; - char *e; - isc_result_t result; - dns_name_t name; - isc_buffer_t buffer; - isc_uint32_t time_signed, time_expire; - - REQUIRE(type == 24); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(callbacks); - - /* - * Type covered. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - result = dns_rdatatype_fromtext(&covered, &token.value.as_textregion); - if (result != ISC_R_SUCCESS && result != ISC_R_NOTIMPLEMENTED) { - i = strtol(DNS_AS_STR(token), &e, 10); - if (i < 0 || i > 65535) - RETTOK(ISC_R_RANGE); - if (*e != 0) - RETTOK(result); - covered = (dns_rdatatype_t)i; - } - RETERR(uint16_tobuffer(covered, target)); - - /* - * Algorithm. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - RETTOK(dns_secalg_fromtext(&c, &token.value.as_textregion)); - RETERR(mem_tobuffer(target, &c, 1)); - - /* - * Labels. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - if (token.value.as_ulong > 0xffU) - RETTOK(ISC_R_RANGE); - c = (unsigned char)token.value.as_ulong; - RETERR(mem_tobuffer(target, &c, 1)); - - /* - * Original ttl. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - RETERR(uint32_tobuffer(token.value.as_ulong, target)); - - /* - * Signature expiration. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - RETTOK(dns_time32_fromtext(DNS_AS_STR(token), &time_expire)); - RETERR(uint32_tobuffer(time_expire, target)); - - /* - * Time signed. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - RETTOK(dns_time32_fromtext(DNS_AS_STR(token), &time_signed)); - RETERR(uint32_tobuffer(time_signed, target)); - - /* - * Key footprint. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - RETERR(uint16_tobuffer(token.value.as_ulong, target)); - - /* - * Signer. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - dns_name_init(&name, NULL); - buffer_fromregion(&buffer, &token.value.as_region); - origin = (origin != NULL) ? origin : dns_rootname; - RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target)); - - /* - * Sig. - */ - return (isc_base64_tobuffer(lexer, target, -1)); -} - -static inline isc_result_t -totext_sig(ARGS_TOTEXT) { - isc_region_t sr; - char buf[sizeof("4294967295")]; - dns_rdatatype_t covered; - unsigned long ttl; - unsigned long when; - unsigned long exp; - unsigned long foot; - dns_name_t name; - dns_name_t prefix; - isc_boolean_t sub; - - REQUIRE(rdata->type == 24); - REQUIRE(rdata->length != 0); - - dns_rdata_toregion(rdata, &sr); - - /* - * Type covered. - */ - covered = uint16_fromregion(&sr); - isc_region_consume(&sr, 2); - /* - * XXXAG We should have something like dns_rdatatype_isknown() - * that does the right thing with type 0. - */ - if (dns_rdatatype_isknown(covered) && covered != 0) { - RETERR(dns_rdatatype_totext(covered, target)); - } else { - char buf[sizeof("65535")]; - sprintf(buf, "%u", covered); - RETERR(str_totext(buf, target)); - } - RETERR(str_totext(" ", target)); - - /* - * Algorithm. - */ - sprintf(buf, "%u", sr.base[0]); - isc_region_consume(&sr, 1); - RETERR(str_totext(buf, target)); - RETERR(str_totext(" ", target)); - - /* - * Labels. - */ - sprintf(buf, "%u", sr.base[0]); - isc_region_consume(&sr, 1); - RETERR(str_totext(buf, target)); - RETERR(str_totext(" ", target)); - - /* - * Ttl. - */ - ttl = uint32_fromregion(&sr); - isc_region_consume(&sr, 4); - sprintf(buf, "%lu", ttl); - RETERR(str_totext(buf, target)); - RETERR(str_totext(" ", target)); - - /* - * Sig exp. - */ - exp = uint32_fromregion(&sr); - isc_region_consume(&sr, 4); - RETERR(dns_time32_totext(exp, target)); - - if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) - RETERR(str_totext(" (", target)); - RETERR(str_totext(tctx->linebreak, target)); - - /* - * Time signed. - */ - when = uint32_fromregion(&sr); - isc_region_consume(&sr, 4); - RETERR(dns_time32_totext(when, target)); - RETERR(str_totext(" ", target)); - - /* - * Footprint. - */ - foot = uint16_fromregion(&sr); - isc_region_consume(&sr, 2); - sprintf(buf, "%lu", foot); - RETERR(str_totext(buf, target)); - RETERR(str_totext(" ", target)); - - /* - * Signer. - */ - dns_name_init(&name, NULL); - dns_name_init(&prefix, NULL); - dns_name_fromregion(&name, &sr); - isc_region_consume(&sr, name_length(&name)); - sub = name_prefix(&name, tctx->origin, &prefix); - RETERR(dns_name_totext(&prefix, sub, target)); - - /* - * Sig. - */ - RETERR(str_totext(tctx->linebreak, target)); - RETERR(isc_base64_totext(&sr, tctx->width - 2, - tctx->linebreak, target)); - if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) - RETERR(str_totext(" )", target)); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -fromwire_sig(ARGS_FROMWIRE) { - isc_region_t sr; - dns_name_t name; - - REQUIRE(type == 24); - - UNUSED(type); - UNUSED(rdclass); - - dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE); - - isc_buffer_activeregion(source, &sr); - /* - * type covered: 2 - * algorithm: 1 - * labels: 1 - * original ttl: 4 - * signature expiration: 4 - * time signed: 4 - * key footprint: 2 - */ - if (sr.length < 18) - return (ISC_R_UNEXPECTEDEND); - - isc_buffer_forward(source, 18); - RETERR(mem_tobuffer(target, sr.base, 18)); - - /* - * Signer. - */ - dns_name_init(&name, NULL); - RETERR(dns_name_fromwire(&name, source, dctx, options, target)); - - /* - * Sig. - */ - isc_buffer_activeregion(source, &sr); - isc_buffer_forward(source, sr.length); - return (mem_tobuffer(target, sr.base, sr.length)); -} - -static inline isc_result_t -towire_sig(ARGS_TOWIRE) { - isc_region_t sr; - dns_name_t name; - dns_offsets_t offsets; - - REQUIRE(rdata->type == 24); - REQUIRE(rdata->length != 0); - - dns_compress_setmethods(cctx, DNS_COMPRESS_NONE); - dns_rdata_toregion(rdata, &sr); - /* - * type covered: 2 - * algorithm: 1 - * labels: 1 - * original ttl: 4 - * signature expiration: 4 - * time signed: 4 - * key footprint: 2 - */ - RETERR(mem_tobuffer(target, sr.base, 18)); - isc_region_consume(&sr, 18); - - /* - * Signer. - */ - dns_name_init(&name, offsets); - dns_name_fromregion(&name, &sr); - isc_region_consume(&sr, name_length(&name)); - RETERR(dns_name_towire(&name, cctx, target)); - - /* - * Signature. - */ - return (mem_tobuffer(target, sr.base, sr.length)); -} - -static inline int -compare_sig(ARGS_COMPARE) { - isc_region_t r1; - isc_region_t r2; - dns_name_t name1; - dns_name_t name2; - int order; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 24); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - dns_rdata_toregion(rdata1, &r1); - dns_rdata_toregion(rdata2, &r2); - - INSIST(r1.length > 18); - INSIST(r2.length > 18); - r1.length = 18; - r2.length = 18; - order = isc_region_compare(&r1, &r2); - if (order != 0) - return (order); - - dns_name_init(&name1, NULL); - dns_name_init(&name2, NULL); - dns_rdata_toregion(rdata1, &r1); - dns_rdata_toregion(rdata2, &r2); - isc_region_consume(&r1, 18); - isc_region_consume(&r2, 18); - dns_name_fromregion(&name1, &r1); - dns_name_fromregion(&name2, &r2); - order = dns_name_rdatacompare(&name1, &name2); - if (order != 0) - return (order); - - isc_region_consume(&r1, name_length(&name1)); - isc_region_consume(&r2, name_length(&name2)); - - return (isc_region_compare(&r1, &r2)); -} - -static inline isc_result_t -fromstruct_sig(ARGS_FROMSTRUCT) { - dns_rdata_sig_t *sig = source; - - REQUIRE(type == 24); - REQUIRE(source != NULL); - REQUIRE(sig->common.rdtype == type); - REQUIRE(sig->common.rdclass == rdclass); - REQUIRE(sig->signature != NULL || sig->siglen == 0); - - UNUSED(type); - UNUSED(rdclass); - - /* - * Type covered. - */ - RETERR(uint16_tobuffer(sig->covered, target)); - - /* - * Algorithm. - */ - RETERR(uint8_tobuffer(sig->algorithm, target)); - - /* - * Labels. - */ - RETERR(uint8_tobuffer(sig->labels, target)); - - /* - * Original TTL. - */ - RETERR(uint32_tobuffer(sig->originalttl, target)); - - /* - * Expire time. - */ - RETERR(uint32_tobuffer(sig->timeexpire, target)); - - /* - * Time signed. - */ - RETERR(uint32_tobuffer(sig->timesigned, target)); - - /* - * Key ID. - */ - RETERR(uint16_tobuffer(sig->keyid, target)); - - /* - * Signer name. - */ - RETERR(name_tobuffer(&sig->signer, target)); - - /* - * Signature. - */ - return (mem_tobuffer(target, sig->signature, sig->siglen)); -} - -static inline isc_result_t -tostruct_sig(ARGS_TOSTRUCT) { - isc_region_t sr; - dns_rdata_sig_t *sig = target; - dns_name_t signer; - - REQUIRE(rdata->type == 24); - REQUIRE(target != NULL); - REQUIRE(rdata->length != 0); - - sig->common.rdclass = rdata->rdclass; - sig->common.rdtype = rdata->type; - ISC_LINK_INIT(&sig->common, link); - - dns_rdata_toregion(rdata, &sr); - - /* - * Type covered. - */ - sig->covered = uint16_fromregion(&sr); - isc_region_consume(&sr, 2); - - /* - * Algorithm. - */ - sig->algorithm = uint8_fromregion(&sr); - isc_region_consume(&sr, 1); - - /* - * Labels. - */ - sig->labels = uint8_fromregion(&sr); - isc_region_consume(&sr, 1); - - /* - * Original TTL. - */ - sig->originalttl = uint32_fromregion(&sr); - isc_region_consume(&sr, 4); - - /* - * Expire time. - */ - sig->timeexpire = uint32_fromregion(&sr); - isc_region_consume(&sr, 4); - - /* - * Time signed. - */ - sig->timesigned = uint32_fromregion(&sr); - isc_region_consume(&sr, 4); - - /* - * Key ID. - */ - sig->keyid = uint16_fromregion(&sr); - isc_region_consume(&sr, 2); - - dns_name_init(&signer, NULL); - dns_name_fromregion(&signer, &sr); - dns_name_init(&sig->signer, NULL); - RETERR(name_duporclone(&signer, mctx, &sig->signer)); - isc_region_consume(&sr, name_length(&sig->signer)); - - /* - * Signature. - */ - sig->siglen = sr.length; - sig->signature = mem_maybedup(mctx, sr.base, sig->siglen); - if (sig->signature == NULL) - goto cleanup; - - - sig->mctx = mctx; - return (ISC_R_SUCCESS); - - cleanup: - if (mctx != NULL) - dns_name_free(&sig->signer, mctx); - return (ISC_R_NOMEMORY); -} - -static inline void -freestruct_sig(ARGS_FREESTRUCT) { - dns_rdata_sig_t *sig = (dns_rdata_sig_t *) source; - - REQUIRE(source != NULL); - REQUIRE(sig->common.rdtype == 24); - - if (sig->mctx == NULL) - return; - - dns_name_free(&sig->signer, sig->mctx); - if (sig->signature != NULL) - isc_mem_free(sig->mctx, sig->signature); - sig->mctx = NULL; -} - -static inline isc_result_t -additionaldata_sig(ARGS_ADDLDATA) { - REQUIRE(rdata->type == 24); - - UNUSED(rdata); - UNUSED(add); - UNUSED(arg); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_sig(ARGS_DIGEST) { - - REQUIRE(rdata->type == 24); - - UNUSED(rdata); - UNUSED(digest); - UNUSED(arg); - - return (ISC_R_NOTIMPLEMENTED); -} - -static inline dns_rdatatype_t -covers_sig(dns_rdata_t *rdata) { - dns_rdatatype_t type; - isc_region_t r; - - REQUIRE(rdata->type == 24); - - dns_rdata_toregion(rdata, &r); - type = uint16_fromregion(&r); - - return (type); -} - -static inline isc_boolean_t -checkowner_sig(ARGS_CHECKOWNER) { - - REQUIRE(type == 24); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_sig(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 24); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_GENERIC_SIG_24_C */ diff --git a/contrib/bind9/lib/dns/rdata/generic/sig_24.h b/contrib/bind9/lib/dns/rdata/generic/sig_24.h deleted file mode 100644 index 96ed767..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/sig_24.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef GENERIC_SIG_24_H -#define GENERIC_SIG_24_H 1 - -/* $Id: sig_24.h,v 1.22.18.2 2005/04/29 00:16:40 marka Exp $ */ - -/*! - * \brief Per RFC2535 */ - -typedef struct dns_rdata_sig_t { - dns_rdatacommon_t common; - isc_mem_t * mctx; - dns_rdatatype_t covered; - dns_secalg_t algorithm; - isc_uint8_t labels; - isc_uint32_t originalttl; - isc_uint32_t timeexpire; - isc_uint32_t timesigned; - isc_uint16_t keyid; - dns_name_t signer; - isc_uint16_t siglen; - unsigned char * signature; -} dns_rdata_sig_t; - - -#endif /* GENERIC_SIG_24_H */ diff --git a/contrib/bind9/lib/dns/rdata/generic/soa_6.c b/contrib/bind9/lib/dns/rdata/generic/soa_6.c deleted file mode 100644 index 8de678c..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/soa_6.c +++ /dev/null @@ -1,443 +0,0 @@ -/* - * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2002 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: soa_6.c,v 1.59 2004/03/05 05:10:18 marka Exp $ */ - -/* Reviewed: Thu Mar 16 15:18:32 PST 2000 by explorer */ - -#ifndef RDATA_GENERIC_SOA_6_C -#define RDATA_GENERIC_SOA_6_C - -#define RRTYPE_SOA_ATTRIBUTES (DNS_RDATATYPEATTR_SINGLETON) - -static inline isc_result_t -fromtext_soa(ARGS_FROMTEXT) { - isc_token_t token; - dns_name_t name; - isc_buffer_t buffer; - int i; - isc_uint32_t n; - isc_boolean_t ok; - - REQUIRE(type == 6); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(callbacks); - - origin = (origin != NULL) ? origin : dns_rootname; - - for (i = 0; i < 2; i++) { - RETERR(isc_lex_getmastertoken(lexer, &token, - isc_tokentype_string, - ISC_FALSE)); - - dns_name_init(&name, NULL); - buffer_fromregion(&buffer, &token.value.as_region); - RETTOK(dns_name_fromtext(&name, &buffer, origin, - options, target)); - ok = ISC_TRUE; - if ((options & DNS_RDATA_CHECKNAMES) != 0) - switch (i) { - case 0: - ok = dns_name_ishostname(&name, ISC_FALSE); - break; - case 1: - ok = dns_name_ismailbox(&name); - break; - - } - if (!ok && (options & DNS_RDATA_CHECKNAMESFAIL) != 0) - RETTOK(DNS_R_BADNAME); - if (!ok && callbacks != NULL) - warn_badname(&name, lexer, callbacks); - } - - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - RETERR(uint32_tobuffer(token.value.as_ulong, target)); - - for (i = 0; i < 4; i++) { - RETERR(isc_lex_getmastertoken(lexer, &token, - isc_tokentype_string, - ISC_FALSE)); - RETTOK(dns_counter_fromtext(&token.value.as_textregion, &n)); - RETERR(uint32_tobuffer(n, target)); - } - - return (ISC_R_SUCCESS); -} - -static const char *soa_fieldnames[5] = { - "serial", "refresh", "retry", "expire", "minimum" -}; - -static inline isc_result_t -totext_soa(ARGS_TOTEXT) { - isc_region_t dregion; - dns_name_t mname; - dns_name_t rname; - dns_name_t prefix; - isc_boolean_t sub; - int i; - isc_boolean_t multiline; - isc_boolean_t comment; - - REQUIRE(rdata->type == 6); - REQUIRE(rdata->length != 0); - - multiline = ISC_TF((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0); - comment = ISC_TF((tctx->flags & DNS_STYLEFLAG_COMMENT) != 0); - - dns_name_init(&mname, NULL); - dns_name_init(&rname, NULL); - dns_name_init(&prefix, NULL); - - dns_rdata_toregion(rdata, &dregion); - - dns_name_fromregion(&mname, &dregion); - isc_region_consume(&dregion, name_length(&mname)); - - dns_name_fromregion(&rname, &dregion); - isc_region_consume(&dregion, name_length(&rname)); - - sub = name_prefix(&mname, tctx->origin, &prefix); - RETERR(dns_name_totext(&prefix, sub, target)); - - RETERR(str_totext(" ", target)); - - sub = name_prefix(&rname, tctx->origin, &prefix); - RETERR(dns_name_totext(&prefix, sub, target)); - - if (multiline) - RETERR(str_totext(" (" , target)); - RETERR(str_totext(tctx->linebreak, target)); - - for (i = 0; i < 5; i++) { - char buf[sizeof("2147483647")]; - unsigned long num; - unsigned int numlen; - num = uint32_fromregion(&dregion); - isc_region_consume(&dregion, 4); - numlen = sprintf(buf, "%lu", num); - INSIST(numlen > 0 && numlen < sizeof("2147483647")); - RETERR(str_totext(buf, target)); - if (multiline && comment) { - RETERR(str_totext(" ; " + numlen, target)); - RETERR(str_totext(soa_fieldnames[i], target)); - /* Print times in week/day/hour/minute/second form */ - if (i >= 1) { - RETERR(str_totext(" (", target)); - RETERR(dns_ttl_totext(num, ISC_TRUE, target)); - RETERR(str_totext(")", target)); - } - RETERR(str_totext(tctx->linebreak, target)); - } else if (i < 4) { - RETERR(str_totext(tctx->linebreak, target)); - } - } - - if (multiline) - RETERR(str_totext(")", target)); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -fromwire_soa(ARGS_FROMWIRE) { - dns_name_t mname; - dns_name_t rname; - isc_region_t sregion; - isc_region_t tregion; - - REQUIRE(type == 6); - - UNUSED(type); - UNUSED(rdclass); - - dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14); - - dns_name_init(&mname, NULL); - dns_name_init(&rname, NULL); - - RETERR(dns_name_fromwire(&mname, source, dctx, options, target)); - RETERR(dns_name_fromwire(&rname, source, dctx, options, target)); - - isc_buffer_activeregion(source, &sregion); - isc_buffer_availableregion(target, &tregion); - - if (sregion.length < 20) - return (ISC_R_UNEXPECTEDEND); - if (tregion.length < 20) - return (ISC_R_NOSPACE); - - memcpy(tregion.base, sregion.base, 20); - isc_buffer_forward(source, 20); - isc_buffer_add(target, 20); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -towire_soa(ARGS_TOWIRE) { - isc_region_t sregion; - isc_region_t tregion; - dns_name_t mname; - dns_name_t rname; - dns_offsets_t moffsets; - dns_offsets_t roffsets; - - REQUIRE(rdata->type == 6); - REQUIRE(rdata->length != 0); - - dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14); - - dns_name_init(&mname, moffsets); - dns_name_init(&rname, roffsets); - - dns_rdata_toregion(rdata, &sregion); - - dns_name_fromregion(&mname, &sregion); - isc_region_consume(&sregion, name_length(&mname)); - RETERR(dns_name_towire(&mname, cctx, target)); - - dns_name_fromregion(&rname, &sregion); - isc_region_consume(&sregion, name_length(&rname)); - RETERR(dns_name_towire(&rname, cctx, target)); - - isc_buffer_availableregion(target, &tregion); - if (tregion.length < 20) - return (ISC_R_NOSPACE); - - memcpy(tregion.base, sregion.base, 20); - isc_buffer_add(target, 20); - return (ISC_R_SUCCESS); -} - -static inline int -compare_soa(ARGS_COMPARE) { - isc_region_t region1; - isc_region_t region2; - dns_name_t name1; - dns_name_t name2; - int order; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 6); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - dns_name_init(&name1, NULL); - dns_name_init(&name2, NULL); - - dns_rdata_toregion(rdata1, ®ion1); - dns_rdata_toregion(rdata2, ®ion2); - - dns_name_fromregion(&name1, ®ion1); - dns_name_fromregion(&name2, ®ion2); - - order = dns_name_rdatacompare(&name1, &name2); - if (order != 0) - return (order); - - isc_region_consume(®ion1, name_length(&name1)); - isc_region_consume(®ion2, name_length(&name2)); - - dns_name_init(&name1, NULL); - dns_name_init(&name2, NULL); - - dns_name_fromregion(&name1, ®ion1); - dns_name_fromregion(&name2, ®ion2); - - order = dns_name_rdatacompare(&name1, &name2); - if (order != 0) - return (order); - - isc_region_consume(®ion1, name_length(&name1)); - isc_region_consume(®ion2, name_length(&name2)); - - return (isc_region_compare(®ion1, ®ion2)); -} - -static inline isc_result_t -fromstruct_soa(ARGS_FROMSTRUCT) { - dns_rdata_soa_t *soa = source; - isc_region_t region; - - REQUIRE(type == 6); - REQUIRE(source != NULL); - REQUIRE(soa->common.rdtype == type); - REQUIRE(soa->common.rdclass == rdclass); - - UNUSED(type); - UNUSED(rdclass); - - dns_name_toregion(&soa->origin, ®ion); - RETERR(isc_buffer_copyregion(target, ®ion)); - dns_name_toregion(&soa->contact, ®ion); - RETERR(isc_buffer_copyregion(target, ®ion)); - RETERR(uint32_tobuffer(soa->serial, target)); - RETERR(uint32_tobuffer(soa->refresh, target)); - RETERR(uint32_tobuffer(soa->retry, target)); - RETERR(uint32_tobuffer(soa->expire, target)); - return (uint32_tobuffer(soa->minimum, target)); -} - -static inline isc_result_t -tostruct_soa(ARGS_TOSTRUCT) { - isc_region_t region; - dns_rdata_soa_t *soa = target; - dns_name_t name; - isc_result_t result; - - REQUIRE(rdata->type == 6); - REQUIRE(target != NULL); - REQUIRE(rdata->length != 0); - - soa->common.rdclass = rdata->rdclass; - soa->common.rdtype = rdata->type; - ISC_LINK_INIT(&soa->common, link); - - - dns_rdata_toregion(rdata, ®ion); - - dns_name_init(&name, NULL); - dns_name_fromregion(&name, ®ion); - isc_region_consume(®ion, name_length(&name)); - dns_name_init(&soa->origin, NULL); - RETERR(name_duporclone(&name, mctx, &soa->origin)); - - dns_name_fromregion(&name, ®ion); - isc_region_consume(®ion, name_length(&name)); - dns_name_init(&soa->contact, NULL); - result = name_duporclone(&name, mctx, &soa->contact); - if (result != ISC_R_SUCCESS) - goto cleanup; - - soa->serial = uint32_fromregion(®ion); - isc_region_consume(®ion, 4); - - soa->refresh = uint32_fromregion(®ion); - isc_region_consume(®ion, 4); - - soa->retry = uint32_fromregion(®ion); - isc_region_consume(®ion, 4); - - soa->expire = uint32_fromregion(®ion); - isc_region_consume(®ion, 4); - - soa->minimum = uint32_fromregion(®ion); - - soa->mctx = mctx; - return (ISC_R_SUCCESS); - - cleanup: - if (mctx != NULL) - dns_name_free(&soa->origin, mctx); - return (ISC_R_NOMEMORY); -} - -static inline void -freestruct_soa(ARGS_FREESTRUCT) { - dns_rdata_soa_t *soa = source; - - REQUIRE(source != NULL); - REQUIRE(soa->common.rdtype == 6); - - if (soa->mctx == NULL) - return; - - dns_name_free(&soa->origin, soa->mctx); - dns_name_free(&soa->contact, soa->mctx); - soa->mctx = NULL; -} - -static inline isc_result_t -additionaldata_soa(ARGS_ADDLDATA) { - UNUSED(rdata); - UNUSED(add); - UNUSED(arg); - - REQUIRE(rdata->type == 6); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_soa(ARGS_DIGEST) { - isc_region_t r; - dns_name_t name; - - REQUIRE(rdata->type == 6); - - dns_rdata_toregion(rdata, &r); - - dns_name_init(&name, NULL); - dns_name_fromregion(&name, &r); - RETERR(dns_name_digest(&name, digest, arg)); - isc_region_consume(&r, name_length(&name)); - - dns_name_init(&name, NULL); - dns_name_fromregion(&name, &r); - RETERR(dns_name_digest(&name, digest, arg)); - isc_region_consume(&r, name_length(&name)); - - return ((digest)(arg, &r)); -} - -static inline isc_boolean_t -checkowner_soa(ARGS_CHECKOWNER) { - - REQUIRE(type == 6); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_soa(ARGS_CHECKNAMES) { - isc_region_t region; - dns_name_t name; - - REQUIRE(rdata->type == 6); - - UNUSED(owner); - - dns_rdata_toregion(rdata, ®ion); - dns_name_init(&name, NULL); - dns_name_fromregion(&name, ®ion); - if (!dns_name_ishostname(&name, ISC_FALSE)) { - if (bad != NULL) - dns_name_clone(&name, bad); - return (ISC_FALSE); - } - isc_region_consume(®ion, name_length(&name)); - dns_name_fromregion(&name, ®ion); - if (!dns_name_ismailbox(&name)) { - if (bad != NULL) - dns_name_clone(&name, bad); - return (ISC_FALSE); - } - return (ISC_TRUE); -} - -#endif /* RDATA_GENERIC_SOA_6_C */ diff --git a/contrib/bind9/lib/dns/rdata/generic/soa_6.h b/contrib/bind9/lib/dns/rdata/generic/soa_6.h deleted file mode 100644 index 4211786..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/soa_6.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* */ -#ifndef GENERIC_SOA_6_H -#define GENERIC_SOA_6_H 1 - -/* $Id: soa_6.h,v 1.28.18.2 2005/04/29 00:16:40 marka Exp $ */ - -typedef struct dns_rdata_soa { - dns_rdatacommon_t common; - isc_mem_t *mctx; - dns_name_t origin; - dns_name_t contact; - isc_uint32_t serial; /*%< host order */ - isc_uint32_t refresh; /*%< host order */ - isc_uint32_t retry; /*%< host order */ - isc_uint32_t expire; /*%< host order */ - isc_uint32_t minimum; /*%< host order */ -} dns_rdata_soa_t; - - -#endif /* GENERIC_SOA_6_H */ diff --git a/contrib/bind9/lib/dns/rdata/generic/spf_99.c b/contrib/bind9/lib/dns/rdata/generic/spf_99.c deleted file mode 100644 index b65f580..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/spf_99.c +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2002 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: spf_99.c,v 1.1.2.2 2005/07/16 00:40:54 marka Exp $ */ - -/* Reviewed: Thu Mar 16 15:40:00 PST 2000 by bwelling */ - -#ifndef RDATA_GENERIC_SPF_99_C -#define RDATA_GENERIC_SPF_99_C - -#define RRTYPE_SPF_ATTRIBUTES (0) - -static inline isc_result_t -fromtext_spf(ARGS_FROMTEXT) { - isc_token_t token; - int strings; - - REQUIRE(type == 99); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(origin); - UNUSED(options); - UNUSED(callbacks); - - strings = 0; - for (;;) { - RETERR(isc_lex_getmastertoken(lexer, &token, - isc_tokentype_qstring, - ISC_TRUE)); - if (token.type != isc_tokentype_qstring && - token.type != isc_tokentype_string) - break; - RETTOK(txt_fromtext(&token.value.as_textregion, target)); - strings++; - } - /* Let upper layer handle eol/eof. */ - isc_lex_ungettoken(lexer, &token); - return (strings == 0 ? ISC_R_UNEXPECTEDEND : ISC_R_SUCCESS); -} - -static inline isc_result_t -totext_spf(ARGS_TOTEXT) { - isc_region_t region; - - UNUSED(tctx); - - REQUIRE(rdata->type == 99); - - dns_rdata_toregion(rdata, ®ion); - - while (region.length > 0) { - RETERR(txt_totext(®ion, target)); - if (region.length > 0) - RETERR(str_totext(" ", target)); - } - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -fromwire_spf(ARGS_FROMWIRE) { - isc_result_t result; - - REQUIRE(type == 99); - - UNUSED(type); - UNUSED(dctx); - UNUSED(rdclass); - UNUSED(options); - - do { - result = txt_fromwire(source, target); - if (result != ISC_R_SUCCESS) - return (result); - } while (!buffer_empty(source)); - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -towire_spf(ARGS_TOWIRE) { - isc_region_t region; - - REQUIRE(rdata->type == 99); - - UNUSED(cctx); - - isc_buffer_availableregion(target, ®ion); - if (region.length < rdata->length) - return (ISC_R_NOSPACE); - - memcpy(region.base, rdata->data, rdata->length); - isc_buffer_add(target, rdata->length); - return (ISC_R_SUCCESS); -} - -static inline int -compare_spf(ARGS_COMPARE) { - isc_region_t r1; - isc_region_t r2; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 99); - - dns_rdata_toregion(rdata1, &r1); - dns_rdata_toregion(rdata2, &r2); - return (isc_region_compare(&r1, &r2)); -} - -static inline isc_result_t -fromstruct_spf(ARGS_FROMSTRUCT) { - dns_rdata_spf_t *txt = source; - isc_region_t region; - isc_uint8_t length; - - REQUIRE(type == 99); - REQUIRE(source != NULL); - REQUIRE(txt->common.rdtype == type); - REQUIRE(txt->common.rdclass == rdclass); - REQUIRE(txt->txt != NULL && txt->txt_len != 0); - - UNUSED(type); - UNUSED(rdclass); - - region.base = txt->txt; - region.length = txt->txt_len; - while (region.length > 0) { - length = uint8_fromregion(®ion); - isc_region_consume(®ion, 1); - if (region.length <= length) - return (ISC_R_UNEXPECTEDEND); - isc_region_consume(®ion, length); - } - - return (mem_tobuffer(target, txt->txt, txt->txt_len)); -} - -static inline isc_result_t -tostruct_spf(ARGS_TOSTRUCT) { - dns_rdata_spf_t *txt = target; - isc_region_t r; - - REQUIRE(rdata->type == 99); - REQUIRE(target != NULL); - - txt->common.rdclass = rdata->rdclass; - txt->common.rdtype = rdata->type; - ISC_LINK_INIT(&txt->common, link); - - dns_rdata_toregion(rdata, &r); - txt->txt_len = r.length; - txt->txt = mem_maybedup(mctx, r.base, r.length); - if (txt->txt == NULL) - return (ISC_R_NOMEMORY); - - txt->offset = 0; - txt->mctx = mctx; - return (ISC_R_SUCCESS); -} - -static inline void -freestruct_spf(ARGS_FREESTRUCT) { - dns_rdata_spf_t *txt = source; - - REQUIRE(source != NULL); - REQUIRE(txt->common.rdtype == 99); - - if (txt->mctx == NULL) - return; - - if (txt->txt != NULL) - isc_mem_free(txt->mctx, txt->txt); - txt->mctx = NULL; -} - -static inline isc_result_t -additionaldata_spf(ARGS_ADDLDATA) { - REQUIRE(rdata->type == 99); - - UNUSED(rdata); - UNUSED(add); - UNUSED(arg); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_spf(ARGS_DIGEST) { - isc_region_t r; - - REQUIRE(rdata->type == 99); - - dns_rdata_toregion(rdata, &r); - - return ((digest)(arg, &r)); -} - -static inline isc_boolean_t -checkowner_spf(ARGS_CHECKOWNER) { - - REQUIRE(type == 99); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_spf(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 99); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_GENERIC_SPF_99_C */ diff --git a/contrib/bind9/lib/dns/rdata/generic/spf_99.h b/contrib/bind9/lib/dns/rdata/generic/spf_99.h deleted file mode 100644 index afe77ec..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/spf_99.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef GENERIC_SPF_99_H -#define GENERIC_SPF_99_H 1 - -/* $Id: spf_99.h,v 1.1.2.2 2005/07/16 00:40:54 marka Exp $ */ - -typedef struct dns_rdata_spf_string { - isc_uint8_t length; - unsigned char *data; -} dns_rdata_spf_string_t; - -typedef struct dns_rdata_spf { - dns_rdatacommon_t common; - isc_mem_t *mctx; - unsigned char *txt; - isc_uint16_t txt_len; - /* private */ - isc_uint16_t offset; -} dns_rdata_spf_t; - -/* - * ISC_LANG_BEGINDECLS and ISC_LANG_ENDDECLS are already done - * via rdatastructpre.h and rdatastructsuf.h. - */ - -isc_result_t -dns_rdata_spf_first(dns_rdata_spf_t *); - -isc_result_t -dns_rdata_spf_next(dns_rdata_spf_t *); - -isc_result_t -dns_rdata_spf_current(dns_rdata_spf_t *, dns_rdata_spf_string_t *); - -#endif /* GENERIC_SPF_99_H */ diff --git a/contrib/bind9/lib/dns/rdata/generic/sshfp_44.c b/contrib/bind9/lib/dns/rdata/generic/sshfp_44.c deleted file mode 100644 index 64b51c7..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/sshfp_44.c +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Copyright (C) 2004, 2006 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: sshfp_44.c,v 1.3.18.1 2006/03/10 04:04:32 marka Exp $ */ - -/* RFC 4255 */ - -#ifndef RDATA_GENERIC_SSHFP_44_C -#define RDATA_GENERIC_SSHFP_44_C - -#define RRTYPE_SSHFP_ATTRIBUTES (0) - -static inline isc_result_t -fromtext_sshfp(ARGS_FROMTEXT) { - isc_token_t token; - - REQUIRE(type == 44); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(origin); - UNUSED(options); - UNUSED(callbacks); - - /* - * Algorithm. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - if (token.value.as_ulong > 0xffU) - RETTOK(ISC_R_RANGE); - RETERR(uint8_tobuffer(token.value.as_ulong, target)); - - /* - * Digest type. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - if (token.value.as_ulong > 0xffU) - RETTOK(ISC_R_RANGE); - RETERR(uint8_tobuffer(token.value.as_ulong, target)); - type = (isc_uint16_t) token.value.as_ulong; - - /* - * Digest. - */ - return (isc_hex_tobuffer(lexer, target, -1)); -} - -static inline isc_result_t -totext_sshfp(ARGS_TOTEXT) { - isc_region_t sr; - char buf[sizeof("64000 ")]; - unsigned int n; - - REQUIRE(rdata->type == 44); - REQUIRE(rdata->length != 0); - - UNUSED(tctx); - - dns_rdata_toregion(rdata, &sr); - - /* - * Algorithm. - */ - n = uint8_fromregion(&sr); - isc_region_consume(&sr, 1); - sprintf(buf, "%u ", n); - RETERR(str_totext(buf, target)); - - /* - * Digest type. - */ - n = uint8_fromregion(&sr); - isc_region_consume(&sr, 1); - sprintf(buf, "%u", n); - RETERR(str_totext(buf, target)); - - /* - * Digest. - */ - if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) - RETERR(str_totext(" (", target)); - RETERR(str_totext(tctx->linebreak, target)); - RETERR(isc_hex_totext(&sr, tctx->width - 2, tctx->linebreak, target)); - if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) - RETERR(str_totext(" )", target)); - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -fromwire_sshfp(ARGS_FROMWIRE) { - isc_region_t sr; - - REQUIRE(type == 44); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(dctx); - UNUSED(options); - - isc_buffer_activeregion(source, &sr); - if (sr.length < 4) - return (ISC_R_UNEXPECTEDEND); - - isc_buffer_forward(source, sr.length); - return (mem_tobuffer(target, sr.base, sr.length)); -} - -static inline isc_result_t -towire_sshfp(ARGS_TOWIRE) { - isc_region_t sr; - - REQUIRE(rdata->type == 44); - REQUIRE(rdata->length != 0); - - UNUSED(cctx); - - dns_rdata_toregion(rdata, &sr); - return (mem_tobuffer(target, sr.base, sr.length)); -} - -static inline int -compare_sshfp(ARGS_COMPARE) { - isc_region_t r1; - isc_region_t r2; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 44); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - dns_rdata_toregion(rdata1, &r1); - dns_rdata_toregion(rdata2, &r2); - return (isc_region_compare(&r1, &r2)); -} - -static inline isc_result_t -fromstruct_sshfp(ARGS_FROMSTRUCT) { - dns_rdata_sshfp_t *sshfp = source; - - REQUIRE(type == 44); - REQUIRE(source != NULL); - REQUIRE(sshfp->common.rdtype == type); - REQUIRE(sshfp->common.rdclass == rdclass); - - UNUSED(type); - UNUSED(rdclass); - - RETERR(uint8_tobuffer(sshfp->algorithm, target)); - RETERR(uint8_tobuffer(sshfp->digest_type, target)); - - return (mem_tobuffer(target, sshfp->digest, sshfp->length)); -} - -static inline isc_result_t -tostruct_sshfp(ARGS_TOSTRUCT) { - dns_rdata_sshfp_t *sshfp = target; - isc_region_t region; - - REQUIRE(rdata->type == 44); - REQUIRE(target != NULL); - REQUIRE(rdata->length != 0); - - sshfp->common.rdclass = rdata->rdclass; - sshfp->common.rdtype = rdata->type; - ISC_LINK_INIT(&sshfp->common, link); - - dns_rdata_toregion(rdata, ®ion); - - sshfp->algorithm = uint8_fromregion(®ion); - isc_region_consume(®ion, 1); - sshfp->digest_type = uint8_fromregion(®ion); - isc_region_consume(®ion, 1); - sshfp->length = region.length; - - sshfp->digest = mem_maybedup(mctx, region.base, region.length); - if (sshfp->digest == NULL) - return (ISC_R_NOMEMORY); - - sshfp->mctx = mctx; - return (ISC_R_SUCCESS); -} - -static inline void -freestruct_sshfp(ARGS_FREESTRUCT) { - dns_rdata_sshfp_t *sshfp = source; - - REQUIRE(sshfp != NULL); - REQUIRE(sshfp->common.rdtype == 44); - - if (sshfp->mctx == NULL) - return; - - if (sshfp->digest != NULL) - isc_mem_free(sshfp->mctx, sshfp->digest); - sshfp->mctx = NULL; -} - -static inline isc_result_t -additionaldata_sshfp(ARGS_ADDLDATA) { - REQUIRE(rdata->type == 44); - - UNUSED(rdata); - UNUSED(add); - UNUSED(arg); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_sshfp(ARGS_DIGEST) { - isc_region_t r; - - REQUIRE(rdata->type == 44); - - dns_rdata_toregion(rdata, &r); - - return ((digest)(arg, &r)); -} - -static inline isc_boolean_t -checkowner_sshfp(ARGS_CHECKOWNER) { - - REQUIRE(type == 44); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_sshfp(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 44); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_GENERIC_SSHFP_44_C */ diff --git a/contrib/bind9/lib/dns/rdata/generic/sshfp_44.h b/contrib/bind9/lib/dns/rdata/generic/sshfp_44.h deleted file mode 100644 index 513eeac..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/sshfp_44.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: sshfp_44.h,v 1.2.18.3 2006/03/10 04:04:32 marka Exp $ */ - -/*! - * \brief Per RFC 4255 */ - -#ifndef GENERIC_SSHFP_44_H -#define GENERIC_SSHFP_44_H 1 - -typedef struct dns_rdata_sshfp { - dns_rdatacommon_t common; - isc_mem_t *mctx; - isc_uint8_t algorithm; - isc_uint8_t digest_type; - isc_uint16_t length; - unsigned char *digest; -} dns_rdata_sshfp_t; - -#endif /* GENERIC_SSHFP_44_H */ diff --git a/contrib/bind9/lib/dns/rdata/generic/tkey_249.c b/contrib/bind9/lib/dns/rdata/generic/tkey_249.c deleted file mode 100644 index cee16ab..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/tkey_249.c +++ /dev/null @@ -1,555 +0,0 @@ -/* - * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: tkey_249.c,v 1.55 2004/03/05 05:10:18 marka Exp $ */ - -/* - * Reviewed: Thu Mar 16 17:35:30 PST 2000 by halley. - */ - -/* draft-ietf-dnsext-tkey-01.txt */ - -#ifndef RDATA_GENERIC_TKEY_249_C -#define RDATA_GENERIC_TKEY_249_C - -#define RRTYPE_TKEY_ATTRIBUTES (DNS_RDATATYPEATTR_META) - -static inline isc_result_t -fromtext_tkey(ARGS_FROMTEXT) { - isc_token_t token; - dns_rcode_t rcode; - dns_name_t name; - isc_buffer_t buffer; - long i; - char *e; - - REQUIRE(type == 249); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(callbacks); - - /* - * Algorithm. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - dns_name_init(&name, NULL); - buffer_fromregion(&buffer, &token.value.as_region); - origin = (origin != NULL) ? origin : dns_rootname; - RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target)); - - - /* - * Inception. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - RETERR(uint32_tobuffer(token.value.as_ulong, target)); - - /* - * Expiration. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - RETERR(uint32_tobuffer(token.value.as_ulong, target)); - - /* - * Mode. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - if (token.value.as_ulong > 0xffffU) - RETTOK(ISC_R_RANGE); - RETERR(uint16_tobuffer(token.value.as_ulong, target)); - - /* - * Error. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - if (dns_tsigrcode_fromtext(&rcode, &token.value.as_textregion) - != ISC_R_SUCCESS) - { - i = strtol(DNS_AS_STR(token), &e, 10); - if (*e != 0) - RETTOK(DNS_R_UNKNOWN); - if (i < 0 || i > 0xffff) - RETTOK(ISC_R_RANGE); - rcode = (dns_rcode_t)i; - } - RETERR(uint16_tobuffer(rcode, target)); - - /* - * Key Size. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - if (token.value.as_ulong > 0xffffU) - RETTOK(ISC_R_RANGE); - RETERR(uint16_tobuffer(token.value.as_ulong, target)); - - /* - * Key Data. - */ - RETERR(isc_base64_tobuffer(lexer, target, (int)token.value.as_ulong)); - - /* - * Other Size. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - if (token.value.as_ulong > 0xffffU) - RETTOK(ISC_R_RANGE); - RETERR(uint16_tobuffer(token.value.as_ulong, target)); - - /* - * Other Data. - */ - return (isc_base64_tobuffer(lexer, target, (int)token.value.as_ulong)); -} - -static inline isc_result_t -totext_tkey(ARGS_TOTEXT) { - isc_region_t sr, dr; - char buf[sizeof("4294967295 ")]; - unsigned long n; - dns_name_t name; - dns_name_t prefix; - isc_boolean_t sub; - - REQUIRE(rdata->type == 249); - REQUIRE(rdata->length != 0); - - dns_rdata_toregion(rdata, &sr); - - /* - * Algorithm. - */ - dns_name_init(&name, NULL); - dns_name_init(&prefix, NULL); - dns_name_fromregion(&name, &sr); - sub = name_prefix(&name, tctx->origin, &prefix); - RETERR(dns_name_totext(&prefix, sub, target)); - RETERR(str_totext(" ", target)); - isc_region_consume(&sr, name_length(&name)); - - /* - * Inception. - */ - n = uint32_fromregion(&sr); - isc_region_consume(&sr, 4); - sprintf(buf, "%lu ", n); - RETERR(str_totext(buf, target)); - - /* - * Expiration. - */ - n = uint32_fromregion(&sr); - isc_region_consume(&sr, 4); - sprintf(buf, "%lu ", n); - RETERR(str_totext(buf, target)); - - /* - * Mode. - */ - n = uint16_fromregion(&sr); - isc_region_consume(&sr, 2); - sprintf(buf, "%lu ", n); - RETERR(str_totext(buf, target)); - - /* - * Error. - */ - n = uint16_fromregion(&sr); - isc_region_consume(&sr, 2); - if (dns_tsigrcode_totext((dns_rcode_t)n, target) == ISC_R_SUCCESS) - RETERR(str_totext(" ", target)); - else { - sprintf(buf, "%lu ", n); - RETERR(str_totext(buf, target)); - } - - /* - * Key Size. - */ - n = uint16_fromregion(&sr); - isc_region_consume(&sr, 2); - sprintf(buf, "%lu", n); - RETERR(str_totext(buf, target)); - - /* - * Key Data. - */ - REQUIRE(n <= sr.length); - dr = sr; - dr.length = n; - if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) - RETERR(str_totext(" (", target)); - RETERR(str_totext(tctx->linebreak, target)); - RETERR(isc_base64_totext(&dr, tctx->width - 2, - tctx->linebreak, target)); - if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) - RETERR(str_totext(" ) ", target)); - else - RETERR(str_totext(" ", target)); - isc_region_consume(&sr, n); - - /* - * Other Size. - */ - n = uint16_fromregion(&sr); - isc_region_consume(&sr, 2); - sprintf(buf, "%lu", n); - RETERR(str_totext(buf, target)); - - /* - * Other Data. - */ - REQUIRE(n <= sr.length); - if (n != 0U) { - dr = sr; - dr.length = n; - if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) - RETERR(str_totext(" (", target)); - RETERR(str_totext(tctx->linebreak, target)); - RETERR(isc_base64_totext(&dr, tctx->width - 2, - tctx->linebreak, target)); - if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) - RETERR(str_totext(" )", target)); - } - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -fromwire_tkey(ARGS_FROMWIRE) { - isc_region_t sr; - unsigned long n; - dns_name_t name; - - REQUIRE(type == 249); - - UNUSED(type); - UNUSED(rdclass); - - dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE); - - /* - * Algorithm. - */ - dns_name_init(&name, NULL); - RETERR(dns_name_fromwire(&name, source, dctx, options, target)); - - /* - * Inception: 4 - * Expiration: 4 - * Mode: 2 - * Error: 2 - */ - isc_buffer_activeregion(source, &sr); - if (sr.length < 12) - return (ISC_R_UNEXPECTEDEND); - RETERR(mem_tobuffer(target, sr.base, 12)); - isc_region_consume(&sr, 12); - isc_buffer_forward(source, 12); - - /* - * Key Length + Key Data. - */ - if (sr.length < 2) - return (ISC_R_UNEXPECTEDEND); - n = uint16_fromregion(&sr); - if (sr.length < n + 2) - return (ISC_R_UNEXPECTEDEND); - RETERR(mem_tobuffer(target, sr.base, n + 2)); - isc_region_consume(&sr, n + 2); - isc_buffer_forward(source, n + 2); - - /* - * Other Length + Other Data. - */ - if (sr.length < 2) - return (ISC_R_UNEXPECTEDEND); - n = uint16_fromregion(&sr); - if (sr.length < n + 2) - return (ISC_R_UNEXPECTEDEND); - isc_buffer_forward(source, n + 2); - return (mem_tobuffer(target, sr.base, n + 2)); -} - -static inline isc_result_t -towire_tkey(ARGS_TOWIRE) { - isc_region_t sr; - dns_name_t name; - dns_offsets_t offsets; - - REQUIRE(rdata->type == 249); - REQUIRE(rdata->length != 0); - - dns_compress_setmethods(cctx, DNS_COMPRESS_NONE); - /* - * Algorithm. - */ - dns_rdata_toregion(rdata, &sr); - dns_name_init(&name, offsets); - dns_name_fromregion(&name, &sr); - RETERR(dns_name_towire(&name, cctx, target)); - isc_region_consume(&sr, name_length(&name)); - - return (mem_tobuffer(target, sr.base, sr.length)); -} - -static inline int -compare_tkey(ARGS_COMPARE) { - isc_region_t r1; - isc_region_t r2; - dns_name_t name1; - dns_name_t name2; - int order; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 249); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - /* - * Algorithm. - */ - dns_rdata_toregion(rdata1, &r1); - dns_rdata_toregion(rdata2, &r2); - dns_name_init(&name1, NULL); - dns_name_init(&name2, NULL); - dns_name_fromregion(&name1, &r1); - dns_name_fromregion(&name2, &r2); - if ((order = dns_name_rdatacompare(&name1, &name2)) != 0) - return (order); - isc_region_consume(&r1, name_length(&name1)); - isc_region_consume(&r2, name_length(&name2)); - return (isc_region_compare(&r1, &r2)); -} - -static inline isc_result_t -fromstruct_tkey(ARGS_FROMSTRUCT) { - dns_rdata_tkey_t *tkey = source; - - REQUIRE(type == 249); - REQUIRE(source != NULL); - REQUIRE(tkey->common.rdtype == type); - REQUIRE(tkey->common.rdclass == rdclass); - - UNUSED(type); - UNUSED(rdclass); - - /* - * Algorithm Name. - */ - RETERR(name_tobuffer(&tkey->algorithm, target)); - - /* - * Inception: 32 bits. - */ - RETERR(uint32_tobuffer(tkey->inception, target)); - - /* - * Expire: 32 bits. - */ - RETERR(uint32_tobuffer(tkey->expire, target)); - - /* - * Mode: 16 bits. - */ - RETERR(uint16_tobuffer(tkey->mode, target)); - - /* - * Error: 16 bits. - */ - RETERR(uint16_tobuffer(tkey->error, target)); - - /* - * Key size: 16 bits. - */ - RETERR(uint16_tobuffer(tkey->keylen, target)); - - /* - * Key. - */ - RETERR(mem_tobuffer(target, tkey->key, tkey->keylen)); - - /* - * Other size: 16 bits. - */ - RETERR(uint16_tobuffer(tkey->otherlen, target)); - - /* - * Other data. - */ - return (mem_tobuffer(target, tkey->other, tkey->otherlen)); -} - -static inline isc_result_t -tostruct_tkey(ARGS_TOSTRUCT) { - dns_rdata_tkey_t *tkey = target; - dns_name_t alg; - isc_region_t sr; - - REQUIRE(rdata->type == 249); - REQUIRE(target != NULL); - REQUIRE(rdata->length != 0); - - tkey->common.rdclass = rdata->rdclass; - tkey->common.rdtype = rdata->type; - ISC_LINK_INIT(&tkey->common, link); - - dns_rdata_toregion(rdata, &sr); - - /* - * Algorithm Name. - */ - dns_name_init(&alg, NULL); - dns_name_fromregion(&alg, &sr); - dns_name_init(&tkey->algorithm, NULL); - RETERR(name_duporclone(&alg, mctx, &tkey->algorithm)); - isc_region_consume(&sr, name_length(&tkey->algorithm)); - - /* - * Inception. - */ - tkey->inception = uint32_fromregion(&sr); - isc_region_consume(&sr, 4); - - /* - * Expire. - */ - tkey->expire = uint32_fromregion(&sr); - isc_region_consume(&sr, 4); - - /* - * Mode. - */ - tkey->mode = uint16_fromregion(&sr); - isc_region_consume(&sr, 2); - - /* - * Error. - */ - tkey->error = uint16_fromregion(&sr); - isc_region_consume(&sr, 2); - - /* - * Key size. - */ - tkey->keylen = uint16_fromregion(&sr); - isc_region_consume(&sr, 2); - - /* - * Key. - */ - tkey->key = mem_maybedup(mctx, sr.base, tkey->keylen); - if (tkey->key == NULL) - goto cleanup; - isc_region_consume(&sr, tkey->keylen); - - /* - * Other size. - */ - tkey->otherlen = uint16_fromregion(&sr); - isc_region_consume(&sr, 2); - - /* - * Other. - */ - tkey->other = mem_maybedup(mctx, sr.base, tkey->otherlen); - if (tkey->other == NULL) - goto cleanup; - - tkey->mctx = mctx; - return (ISC_R_SUCCESS); - - cleanup: - if (mctx != NULL) - dns_name_free(&tkey->algorithm, mctx); - if (mctx != NULL && tkey->key != NULL) - isc_mem_free(mctx, tkey->key); - return (ISC_R_NOMEMORY); -} - -static inline void -freestruct_tkey(ARGS_FREESTRUCT) { - dns_rdata_tkey_t *tkey = (dns_rdata_tkey_t *) source; - - REQUIRE(source != NULL); - - if (tkey->mctx == NULL) - return; - - dns_name_free(&tkey->algorithm, tkey->mctx); - if (tkey->key != NULL) - isc_mem_free(tkey->mctx, tkey->key); - if (tkey->other != NULL) - isc_mem_free(tkey->mctx, tkey->other); - tkey->mctx = NULL; -} - -static inline isc_result_t -additionaldata_tkey(ARGS_ADDLDATA) { - UNUSED(rdata); - UNUSED(add); - UNUSED(arg); - - REQUIRE(rdata->type == 249); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_tkey(ARGS_DIGEST) { - UNUSED(rdata); - UNUSED(digest); - UNUSED(arg); - - REQUIRE(rdata->type == 249); - - return (ISC_R_NOTIMPLEMENTED); -} - -static inline isc_boolean_t -checkowner_tkey(ARGS_CHECKOWNER) { - - REQUIRE(type == 249); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_tkey(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 249); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_GENERIC_TKEY_249_C */ diff --git a/contrib/bind9/lib/dns/rdata/generic/tkey_249.h b/contrib/bind9/lib/dns/rdata/generic/tkey_249.h deleted file mode 100644 index c1d2f06..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/tkey_249.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001, 2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef GENERIC_TKEY_249_H -#define GENERIC_TKEY_249_H 1 - -/* $Id: tkey_249.h,v 1.20.18.2 2005/04/29 00:16:40 marka Exp $ */ - -/*! - * \brief Per draft-ietf-dnsind-tkey-00.txt */ - -typedef struct dns_rdata_tkey { - dns_rdatacommon_t common; - isc_mem_t * mctx; - dns_name_t algorithm; - isc_uint32_t inception; - isc_uint32_t expire; - isc_uint16_t mode; - isc_uint16_t error; - isc_uint16_t keylen; - unsigned char * key; - isc_uint16_t otherlen; - unsigned char * other; -} dns_rdata_tkey_t; - - -#endif /* GENERIC_TKEY_249_H */ diff --git a/contrib/bind9/lib/dns/rdata/generic/txt_16.c b/contrib/bind9/lib/dns/rdata/generic/txt_16.c deleted file mode 100644 index fa3ffef..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/txt_16.c +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2002 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: txt_16.c,v 1.41 2004/03/05 05:10:18 marka Exp $ */ - -/* Reviewed: Thu Mar 16 15:40:00 PST 2000 by bwelling */ - -#ifndef RDATA_GENERIC_TXT_16_C -#define RDATA_GENERIC_TXT_16_C - -#define RRTYPE_TXT_ATTRIBUTES (0) - -static inline isc_result_t -fromtext_txt(ARGS_FROMTEXT) { - isc_token_t token; - int strings; - - REQUIRE(type == 16); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(origin); - UNUSED(options); - UNUSED(callbacks); - - strings = 0; - for (;;) { - RETERR(isc_lex_getmastertoken(lexer, &token, - isc_tokentype_qstring, - ISC_TRUE)); - if (token.type != isc_tokentype_qstring && - token.type != isc_tokentype_string) - break; - RETTOK(txt_fromtext(&token.value.as_textregion, target)); - strings++; - } - /* Let upper layer handle eol/eof. */ - isc_lex_ungettoken(lexer, &token); - return (strings == 0 ? ISC_R_UNEXPECTEDEND : ISC_R_SUCCESS); -} - -static inline isc_result_t -totext_txt(ARGS_TOTEXT) { - isc_region_t region; - - UNUSED(tctx); - - REQUIRE(rdata->type == 16); - - dns_rdata_toregion(rdata, ®ion); - - while (region.length > 0) { - RETERR(txt_totext(®ion, target)); - if (region.length > 0) - RETERR(str_totext(" ", target)); - } - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -fromwire_txt(ARGS_FROMWIRE) { - isc_result_t result; - - REQUIRE(type == 16); - - UNUSED(type); - UNUSED(dctx); - UNUSED(rdclass); - UNUSED(options); - - do { - result = txt_fromwire(source, target); - if (result != ISC_R_SUCCESS) - return (result); - } while (!buffer_empty(source)); - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -towire_txt(ARGS_TOWIRE) { - isc_region_t region; - - REQUIRE(rdata->type == 16); - - UNUSED(cctx); - - isc_buffer_availableregion(target, ®ion); - if (region.length < rdata->length) - return (ISC_R_NOSPACE); - - memcpy(region.base, rdata->data, rdata->length); - isc_buffer_add(target, rdata->length); - return (ISC_R_SUCCESS); -} - -static inline int -compare_txt(ARGS_COMPARE) { - isc_region_t r1; - isc_region_t r2; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 16); - - dns_rdata_toregion(rdata1, &r1); - dns_rdata_toregion(rdata2, &r2); - return (isc_region_compare(&r1, &r2)); -} - -static inline isc_result_t -fromstruct_txt(ARGS_FROMSTRUCT) { - dns_rdata_txt_t *txt = source; - isc_region_t region; - isc_uint8_t length; - - REQUIRE(type == 16); - REQUIRE(source != NULL); - REQUIRE(txt->common.rdtype == type); - REQUIRE(txt->common.rdclass == rdclass); - REQUIRE(txt->txt != NULL && txt->txt_len != 0); - - UNUSED(type); - UNUSED(rdclass); - - region.base = txt->txt; - region.length = txt->txt_len; - while (region.length > 0) { - length = uint8_fromregion(®ion); - isc_region_consume(®ion, 1); - if (region.length <= length) - return (ISC_R_UNEXPECTEDEND); - isc_region_consume(®ion, length); - } - - return (mem_tobuffer(target, txt->txt, txt->txt_len)); -} - -static inline isc_result_t -tostruct_txt(ARGS_TOSTRUCT) { - dns_rdata_txt_t *txt = target; - isc_region_t r; - - REQUIRE(rdata->type == 16); - REQUIRE(target != NULL); - - txt->common.rdclass = rdata->rdclass; - txt->common.rdtype = rdata->type; - ISC_LINK_INIT(&txt->common, link); - - dns_rdata_toregion(rdata, &r); - txt->txt_len = r.length; - txt->txt = mem_maybedup(mctx, r.base, r.length); - if (txt->txt == NULL) - return (ISC_R_NOMEMORY); - - txt->offset = 0; - txt->mctx = mctx; - return (ISC_R_SUCCESS); -} - -static inline void -freestruct_txt(ARGS_FREESTRUCT) { - dns_rdata_txt_t *txt = source; - - REQUIRE(source != NULL); - REQUIRE(txt->common.rdtype == 16); - - if (txt->mctx == NULL) - return; - - if (txt->txt != NULL) - isc_mem_free(txt->mctx, txt->txt); - txt->mctx = NULL; -} - -static inline isc_result_t -additionaldata_txt(ARGS_ADDLDATA) { - REQUIRE(rdata->type == 16); - - UNUSED(rdata); - UNUSED(add); - UNUSED(arg); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_txt(ARGS_DIGEST) { - isc_region_t r; - - REQUIRE(rdata->type == 16); - - dns_rdata_toregion(rdata, &r); - - return ((digest)(arg, &r)); -} - -static inline isc_boolean_t -checkowner_txt(ARGS_CHECKOWNER) { - - REQUIRE(type == 16); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_txt(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 16); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_GENERIC_TXT_16_C */ diff --git a/contrib/bind9/lib/dns/rdata/generic/txt_16.h b/contrib/bind9/lib/dns/rdata/generic/txt_16.h deleted file mode 100644 index 57d986a..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/txt_16.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* */ -#ifndef GENERIC_TXT_16_H -#define GENERIC_TXT_16_H 1 - -/* $Id: txt_16.h,v 1.24.18.2 2005/04/29 00:16:40 marka Exp $ */ - -typedef struct dns_rdata_txt_string { - isc_uint8_t length; - unsigned char *data; -} dns_rdata_txt_string_t; - -typedef struct dns_rdata_txt { - dns_rdatacommon_t common; - isc_mem_t *mctx; - unsigned char *txt; - isc_uint16_t txt_len; - /* private */ - isc_uint16_t offset; -} dns_rdata_txt_t; - -/* - * ISC_LANG_BEGINDECLS and ISC_LANG_ENDDECLS are already done - * via rdatastructpre.h and rdatastructsuf.h. - */ - -isc_result_t -dns_rdata_txt_first(dns_rdata_txt_t *); - -isc_result_t -dns_rdata_txt_next(dns_rdata_txt_t *); - -isc_result_t -dns_rdata_txt_current(dns_rdata_txt_t *, dns_rdata_txt_string_t *); - -#endif /* GENERIC_TXT_16_H */ diff --git a/contrib/bind9/lib/dns/rdata/generic/unspec_103.c b/contrib/bind9/lib/dns/rdata/generic/unspec_103.c deleted file mode 100644 index f316ad9..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/unspec_103.c +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2002 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: unspec_103.c,v 1.33 2004/03/05 05:10:18 marka Exp $ */ - -#ifndef RDATA_GENERIC_UNSPEC_103_C -#define RDATA_GENERIC_UNSPEC_103_C - -#define RRTYPE_UNSPEC_ATTRIBUTES (0) - -static inline isc_result_t -fromtext_unspec(ARGS_FROMTEXT) { - - REQUIRE(type == 103); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(origin); - UNUSED(options); - UNUSED(callbacks); - - return (atob_tobuffer(lexer, target)); -} - -static inline isc_result_t -totext_unspec(ARGS_TOTEXT) { - - REQUIRE(rdata->type == 103); - - UNUSED(tctx); - - return (btoa_totext(rdata->data, rdata->length, target)); -} - -static inline isc_result_t -fromwire_unspec(ARGS_FROMWIRE) { - isc_region_t sr; - - REQUIRE(type == 103); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(dctx); - UNUSED(options); - - isc_buffer_activeregion(source, &sr); - isc_buffer_forward(source, sr.length); - return (mem_tobuffer(target, sr.base, sr.length)); -} - -static inline isc_result_t -towire_unspec(ARGS_TOWIRE) { - - REQUIRE(rdata->type == 103); - - UNUSED(cctx); - - return (mem_tobuffer(target, rdata->data, rdata->length)); -} - -static inline int -compare_unspec(ARGS_COMPARE) { - isc_region_t r1; - isc_region_t r2; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 103); - - dns_rdata_toregion(rdata1, &r1); - dns_rdata_toregion(rdata2, &r2); - return (isc_region_compare(&r1, &r2)); -} - -static inline isc_result_t -fromstruct_unspec(ARGS_FROMSTRUCT) { - dns_rdata_unspec_t *unspec = source; - - REQUIRE(type == 103); - REQUIRE(source != NULL); - REQUIRE(unspec->common.rdtype == type); - REQUIRE(unspec->common.rdclass == rdclass); - REQUIRE(unspec->data != NULL || unspec->datalen == 0); - - UNUSED(type); - UNUSED(rdclass); - - return (mem_tobuffer(target, unspec->data, unspec->datalen)); -} - -static inline isc_result_t -tostruct_unspec(ARGS_TOSTRUCT) { - dns_rdata_unspec_t *unspec = target; - isc_region_t r; - - REQUIRE(rdata->type == 103); - REQUIRE(target != NULL); - - unspec->common.rdclass = rdata->rdclass; - unspec->common.rdtype = rdata->type; - ISC_LINK_INIT(&unspec->common, link); - - dns_rdata_toregion(rdata, &r); - unspec->datalen = r.length; - unspec->data = mem_maybedup(mctx, r.base, r.length); - if (unspec->data == NULL) - return (ISC_R_NOMEMORY); - - unspec->mctx = mctx; - return (ISC_R_SUCCESS); -} - -static inline void -freestruct_unspec(ARGS_FREESTRUCT) { - dns_rdata_unspec_t *unspec = source; - - REQUIRE(source != NULL); - REQUIRE(unspec->common.rdtype == 103); - - if (unspec->mctx == NULL) - return; - - if (unspec->data != NULL) - isc_mem_free(unspec->mctx, unspec->data); - unspec->mctx = NULL; -} - -static inline isc_result_t -additionaldata_unspec(ARGS_ADDLDATA) { - REQUIRE(rdata->type == 103); - - UNUSED(rdata); - UNUSED(add); - UNUSED(arg); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_unspec(ARGS_DIGEST) { - isc_region_t r; - - REQUIRE(rdata->type == 103); - - dns_rdata_toregion(rdata, &r); - - return ((digest)(arg, &r)); -} - -static inline isc_boolean_t -checkowner_unspec(ARGS_CHECKOWNER) { - - REQUIRE(type == 103); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_unspec(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 103); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_GENERIC_UNSPEC_103_C */ diff --git a/contrib/bind9/lib/dns/rdata/generic/unspec_103.h b/contrib/bind9/lib/dns/rdata/generic/unspec_103.h deleted file mode 100644 index 6575c1a..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/unspec_103.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* */ -#ifndef GENERIC_UNSPEC_103_H -#define GENERIC_UNSPEC_103_H 1 - -/* $Id: unspec_103.h,v 1.13.18.2 2005/04/29 00:16:40 marka Exp $ */ - -typedef struct dns_rdata_unspec_t { - dns_rdatacommon_t common; - isc_mem_t *mctx; - unsigned char *data; - isc_uint16_t datalen; -} dns_rdata_unspec_t; - -#endif /* GENERIC_UNSPEC_103_H */ diff --git a/contrib/bind9/lib/dns/rdata/generic/x25_19.c b/contrib/bind9/lib/dns/rdata/generic/x25_19.c deleted file mode 100644 index 1199195..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/x25_19.c +++ /dev/null @@ -1,219 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2002 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: x25_19.c,v 1.35.18.2 2005/04/29 00:16:40 marka Exp $ */ - -/* Reviewed: Thu Mar 16 16:15:57 PST 2000 by bwelling */ - -/* RFC1183 */ - -#ifndef RDATA_GENERIC_X25_19_C -#define RDATA_GENERIC_X25_19_C - -#define RRTYPE_X25_ATTRIBUTES (0) - -static inline isc_result_t -fromtext_x25(ARGS_FROMTEXT) { - isc_token_t token; - unsigned int i; - - REQUIRE(type == 19); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(origin); - UNUSED(options); - UNUSED(callbacks); - - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_qstring, - ISC_FALSE)); - if (token.value.as_textregion.length < 4) - RETTOK(DNS_R_SYNTAX); - for (i = 0; i < token.value.as_textregion.length; i++) - if (!isdigit(token.value.as_textregion.base[i] & 0xff)) - RETTOK(ISC_R_RANGE); - RETTOK(txt_fromtext(&token.value.as_textregion, target)); - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -totext_x25(ARGS_TOTEXT) { - isc_region_t region; - - UNUSED(tctx); - - REQUIRE(rdata->type == 19); - REQUIRE(rdata->length != 0); - - dns_rdata_toregion(rdata, ®ion); - return (txt_totext(®ion, target)); -} - -static inline isc_result_t -fromwire_x25(ARGS_FROMWIRE) { - isc_region_t sr; - - REQUIRE(type == 19); - - UNUSED(type); - UNUSED(dctx); - UNUSED(rdclass); - UNUSED(options); - - isc_buffer_activeregion(source, &sr); - if (sr.length < 5) - return (DNS_R_FORMERR); - return (txt_fromwire(source, target)); -} - -static inline isc_result_t -towire_x25(ARGS_TOWIRE) { - UNUSED(cctx); - - REQUIRE(rdata->type == 19); - REQUIRE(rdata->length != 0); - - return (mem_tobuffer(target, rdata->data, rdata->length)); -} - -static inline int -compare_x25(ARGS_COMPARE) { - isc_region_t r1; - isc_region_t r2; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 19); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - dns_rdata_toregion(rdata1, &r1); - dns_rdata_toregion(rdata2, &r2); - return (isc_region_compare(&r1, &r2)); -} - -static inline isc_result_t -fromstruct_x25(ARGS_FROMSTRUCT) { - dns_rdata_x25_t *x25 = source; - isc_uint8_t i; - - REQUIRE(type == 19); - REQUIRE(source != NULL); - REQUIRE(x25->common.rdtype == type); - REQUIRE(x25->common.rdclass == rdclass); - REQUIRE(x25->x25 != NULL && x25->x25_len != 0); - - UNUSED(type); - UNUSED(rdclass); - - if (x25->x25_len < 4) - return (ISC_R_RANGE); - - for (i = 0; i < x25->x25_len; i++) - if (!isdigit(x25->x25[i] & 0xff)) - return (ISC_R_RANGE); - - RETERR(uint8_tobuffer(x25->x25_len, target)); - return (mem_tobuffer(target, x25->x25, x25->x25_len)); -} - -static inline isc_result_t -tostruct_x25(ARGS_TOSTRUCT) { - dns_rdata_x25_t *x25 = target; - isc_region_t r; - - REQUIRE(rdata->type == 19); - REQUIRE(target != NULL); - REQUIRE(rdata->length != 0); - - x25->common.rdclass = rdata->rdclass; - x25->common.rdtype = rdata->type; - ISC_LINK_INIT(&x25->common, link); - - dns_rdata_toregion(rdata, &r); - x25->x25_len = uint8_fromregion(&r); - isc_region_consume(&r, 1); - x25->x25 = mem_maybedup(mctx, r.base, x25->x25_len); - if (x25->x25 == NULL) - return (ISC_R_NOMEMORY); - - x25->mctx = mctx; - return (ISC_R_SUCCESS); -} - -static inline void -freestruct_x25(ARGS_FREESTRUCT) { - dns_rdata_x25_t *x25 = source; - REQUIRE(source != NULL); - REQUIRE(x25->common.rdtype == 19); - - if (x25->mctx == NULL) - return; - - if (x25->x25 != NULL) - isc_mem_free(x25->mctx, x25->x25); - x25->mctx = NULL; -} - -static inline isc_result_t -additionaldata_x25(ARGS_ADDLDATA) { - REQUIRE(rdata->type == 19); - - UNUSED(rdata); - UNUSED(add); - UNUSED(arg); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_x25(ARGS_DIGEST) { - isc_region_t r; - - REQUIRE(rdata->type == 19); - - dns_rdata_toregion(rdata, &r); - - return ((digest)(arg, &r)); -} - -static inline isc_boolean_t -checkowner_x25(ARGS_CHECKOWNER) { - - REQUIRE(type == 19); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_x25(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 19); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_GENERIC_X25_19_C */ diff --git a/contrib/bind9/lib/dns/rdata/generic/x25_19.h b/contrib/bind9/lib/dns/rdata/generic/x25_19.h deleted file mode 100644 index 32320d0..0000000 --- a/contrib/bind9/lib/dns/rdata/generic/x25_19.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef GENERIC_X25_19_H -#define GENERIC_X25_19_H 1 - -/* $Id: x25_19.h,v 1.14.18.2 2005/04/29 00:16:40 marka Exp $ */ - -/*! - * \brief Per RFC1183 */ - -typedef struct dns_rdata_x25 { - dns_rdatacommon_t common; - isc_mem_t *mctx; - unsigned char *x25; - isc_uint8_t x25_len; -} dns_rdata_x25_t; - -#endif /* GENERIC_X25_19_H */ diff --git a/contrib/bind9/lib/dns/rdata/hs_4/a_1.c b/contrib/bind9/lib/dns/rdata/hs_4/a_1.c deleted file mode 100644 index 5d3ddae..0000000 --- a/contrib/bind9/lib/dns/rdata/hs_4/a_1.c +++ /dev/null @@ -1,232 +0,0 @@ -/* - * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2002 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: a_1.c,v 1.29 2004/03/05 05:10:20 marka Exp $ */ - -/* reviewed: Thu Mar 16 15:58:36 PST 2000 by brister */ - -#ifndef RDATA_HS_4_A_1_C -#define RDATA_HS_4_A_1_C - -#include <isc/net.h> - -#define RRTYPE_A_ATTRIBUTES (0) - -static inline isc_result_t -fromtext_hs_a(ARGS_FROMTEXT) { - isc_token_t token; - struct in_addr addr; - isc_region_t region; - - REQUIRE(type == 1); - REQUIRE(rdclass == 4); - - UNUSED(type); - UNUSED(origin); - UNUSED(options); - UNUSED(rdclass); - - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - - if (getquad(DNS_AS_STR(token), &addr, lexer, callbacks) != 1) - RETTOK(DNS_R_BADDOTTEDQUAD); - isc_buffer_availableregion(target, ®ion); - if (region.length < 4) - return (ISC_R_NOSPACE); - memcpy(region.base, &addr, 4); - isc_buffer_add(target, 4); - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -totext_hs_a(ARGS_TOTEXT) { - isc_region_t region; - - REQUIRE(rdata->type == 1); - REQUIRE(rdata->rdclass == 4); - REQUIRE(rdata->length == 4); - - UNUSED(tctx); - - dns_rdata_toregion(rdata, ®ion); - return (inet_totext(AF_INET, ®ion, target)); -} - -static inline isc_result_t -fromwire_hs_a(ARGS_FROMWIRE) { - isc_region_t sregion; - isc_region_t tregion; - - REQUIRE(type == 1); - REQUIRE(rdclass == 4); - - UNUSED(type); - UNUSED(dctx); - UNUSED(options); - UNUSED(rdclass); - - isc_buffer_activeregion(source, &sregion); - isc_buffer_availableregion(target, &tregion); - if (sregion.length < 4) - return (ISC_R_UNEXPECTEDEND); - if (tregion.length < 4) - return (ISC_R_NOSPACE); - - memcpy(tregion.base, sregion.base, 4); - isc_buffer_forward(source, 4); - isc_buffer_add(target, 4); - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -towire_hs_a(ARGS_TOWIRE) { - isc_region_t region; - - REQUIRE(rdata->type == 1); - REQUIRE(rdata->rdclass == 4); - REQUIRE(rdata->length == 4); - - UNUSED(cctx); - - isc_buffer_availableregion(target, ®ion); - if (region.length < rdata->length) - return (ISC_R_NOSPACE); - memcpy(region.base, rdata->data, rdata->length); - isc_buffer_add(target, 4); - return (ISC_R_SUCCESS); -} - -static inline int -compare_hs_a(ARGS_COMPARE) { - int order; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 1); - REQUIRE(rdata1->rdclass == 4); - REQUIRE(rdata1->length == 4); - REQUIRE(rdata2->length == 4); - - order = memcmp(rdata1->data, rdata2->data, 4); - if (order != 0) - order = (order < 0) ? -1 : 1; - - return (order); -} - -static inline isc_result_t -fromstruct_hs_a(ARGS_FROMSTRUCT) { - dns_rdata_hs_a_t *a = source; - isc_uint32_t n; - - REQUIRE(type == 1); - REQUIRE(rdclass == 4); - REQUIRE(source != NULL); - REQUIRE(a->common.rdtype == type); - REQUIRE(a->common.rdclass == rdclass); - - UNUSED(type); - UNUSED(rdclass); - - n = ntohl(a->in_addr.s_addr); - - return (uint32_tobuffer(n, target)); -} - -static inline isc_result_t -tostruct_hs_a(ARGS_TOSTRUCT) { - dns_rdata_hs_a_t *a = target; - isc_uint32_t n; - isc_region_t region; - - REQUIRE(rdata->type == 1); - REQUIRE(rdata->rdclass == 4); - REQUIRE(rdata->length == 4); - - UNUSED(mctx); - - a->common.rdclass = rdata->rdclass; - a->common.rdtype = rdata->type; - ISC_LINK_INIT(&a->common, link); - - dns_rdata_toregion(rdata, ®ion); - n = uint32_fromregion(®ion); - a->in_addr.s_addr = htonl(n); - - return (ISC_R_SUCCESS); -} - -static inline void -freestruct_hs_a(ARGS_FREESTRUCT) { - UNUSED(source); - - REQUIRE(source != NULL); -} - -static inline isc_result_t -additionaldata_hs_a(ARGS_ADDLDATA) { - REQUIRE(rdata->type == 1); - REQUIRE(rdata->rdclass == 4); - - UNUSED(rdata); - UNUSED(add); - UNUSED(arg); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_hs_a(ARGS_DIGEST) { - isc_region_t r; - - REQUIRE(rdata->type == 1); - REQUIRE(rdata->rdclass == 4); - - dns_rdata_toregion(rdata, &r); - - return ((digest)(arg, &r)); -} - -static inline isc_boolean_t -checkowner_hs_a(ARGS_CHECKOWNER) { - - REQUIRE(type == 1); - REQUIRE(rdclass == 4); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_hs_a(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 1); - REQUIRE(rdata->rdclass == 4); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_HS_4_A_1_C */ diff --git a/contrib/bind9/lib/dns/rdata/hs_4/a_1.h b/contrib/bind9/lib/dns/rdata/hs_4/a_1.h deleted file mode 100644 index 59f54b5..0000000 --- a/contrib/bind9/lib/dns/rdata/hs_4/a_1.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* */ -#ifndef HS_4_A_1_H -#define HS_4_A_1_H 1 - -/* $Id: a_1.h,v 1.8.18.2 2005/04/29 00:16:41 marka Exp $ */ - -typedef struct dns_rdata_hs_a { - dns_rdatacommon_t common; - struct in_addr in_addr; -} dns_rdata_hs_a_t; - -#endif /* HS_4_A_1_H */ diff --git a/contrib/bind9/lib/dns/rdata/in_1/a6_38.c b/contrib/bind9/lib/dns/rdata/in_1/a6_38.c deleted file mode 100644 index 50017e1..0000000 --- a/contrib/bind9/lib/dns/rdata/in_1/a6_38.c +++ /dev/null @@ -1,461 +0,0 @@ -/* - * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: a6_38.c,v 1.52 2004/03/05 05:10:23 marka Exp $ */ - -/* RFC2874 */ - -#ifndef RDATA_IN_1_A6_28_C -#define RDATA_IN_1_A6_28_C - -#include <isc/net.h> - -#define RRTYPE_A6_ATTRIBUTES (0) - -static inline isc_result_t -fromtext_in_a6(ARGS_FROMTEXT) { - isc_token_t token; - unsigned char addr[16]; - unsigned char prefixlen; - unsigned char octets; - unsigned char mask; - dns_name_t name; - isc_buffer_t buffer; - isc_boolean_t ok; - - REQUIRE(type == 38); - REQUIRE(rdclass == 1); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(callbacks); - - /* - * Prefix length. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - if (token.value.as_ulong > 128U) - RETTOK(ISC_R_RANGE); - - prefixlen = (unsigned char)token.value.as_ulong; - RETERR(mem_tobuffer(target, &prefixlen, 1)); - - /* - * Suffix. - */ - if (prefixlen != 128) { - /* - * Prefix 0..127. - */ - octets = prefixlen/8; - /* - * Octets 0..15. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, - isc_tokentype_string, - ISC_FALSE)); - if (inet_pton(AF_INET6, DNS_AS_STR(token), addr) != 1) - RETTOK(DNS_R_BADAAAA); - mask = 0xff >> (prefixlen % 8); - addr[octets] &= mask; - RETERR(mem_tobuffer(target, &addr[octets], 16 - octets)); - } - - if (prefixlen == 0) - return (ISC_R_SUCCESS); - - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - dns_name_init(&name, NULL); - buffer_fromregion(&buffer, &token.value.as_region); - origin = (origin != NULL) ? origin : dns_rootname; - RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target)); - ok = ISC_TRUE; - if ((options & DNS_RDATA_CHECKNAMES) != 0) - ok = dns_name_ishostname(&name, ISC_FALSE); - if (!ok && (options & DNS_RDATA_CHECKNAMESFAIL) != 0) - RETTOK(DNS_R_BADNAME); - if (!ok && callbacks != NULL) - warn_badname(&name, lexer, callbacks); - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -totext_in_a6(ARGS_TOTEXT) { - isc_region_t sr, ar; - unsigned char addr[16]; - unsigned char prefixlen; - unsigned char octets; - unsigned char mask; - char buf[sizeof("128")]; - dns_name_t name; - dns_name_t prefix; - isc_boolean_t sub; - - REQUIRE(rdata->type == 38); - REQUIRE(rdata->rdclass == 1); - REQUIRE(rdata->length != 0); - - dns_rdata_toregion(rdata, &sr); - prefixlen = sr.base[0]; - INSIST(prefixlen <= 128); - isc_region_consume(&sr, 1); - sprintf(buf, "%u", prefixlen); - RETERR(str_totext(buf, target)); - RETERR(str_totext(" ", target)); - - if (prefixlen != 128) { - octets = prefixlen/8; - memset(addr, 0, sizeof(addr)); - memcpy(&addr[octets], sr.base, 16 - octets); - mask = 0xff >> (prefixlen % 8); - addr[octets] &= mask; - ar.base = addr; - ar.length = sizeof(addr); - RETERR(inet_totext(AF_INET6, &ar, target)); - isc_region_consume(&sr, 16 - octets); - } - - if (prefixlen == 0) - return (ISC_R_SUCCESS); - - RETERR(str_totext(" ", target)); - dns_name_init(&name, NULL); - dns_name_init(&prefix, NULL); - dns_name_fromregion(&name, &sr); - sub = name_prefix(&name, tctx->origin, &prefix); - return (dns_name_totext(&prefix, sub, target)); -} - -static inline isc_result_t -fromwire_in_a6(ARGS_FROMWIRE) { - isc_region_t sr; - unsigned char prefixlen; - unsigned char octets; - unsigned char mask; - dns_name_t name; - - REQUIRE(type == 38); - REQUIRE(rdclass == 1); - - UNUSED(type); - UNUSED(rdclass); - - dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE); - - isc_buffer_activeregion(source, &sr); - /* - * Prefix length. - */ - if (sr.length < 1) - return (ISC_R_UNEXPECTEDEND); - prefixlen = sr.base[0]; - if (prefixlen > 128) - return (ISC_R_RANGE); - isc_region_consume(&sr, 1); - RETERR(mem_tobuffer(target, &prefixlen, 1)); - isc_buffer_forward(source, 1); - - /* - * Suffix. - */ - if (prefixlen != 128) { - octets = 16 - prefixlen / 8; - if (sr.length < octets) - return (ISC_R_UNEXPECTEDEND); - mask = 0xff >> (prefixlen % 8); - sr.base[0] &= mask; /* Ensure pad bits are zero. */ - RETERR(mem_tobuffer(target, sr.base, octets)); - isc_buffer_forward(source, octets); - } - - if (prefixlen == 0) - return (ISC_R_SUCCESS); - - dns_name_init(&name, NULL); - return (dns_name_fromwire(&name, source, dctx, options, target)); -} - -static inline isc_result_t -towire_in_a6(ARGS_TOWIRE) { - isc_region_t sr; - dns_name_t name; - dns_offsets_t offsets; - unsigned char prefixlen; - unsigned char octets; - - REQUIRE(rdata->type == 38); - REQUIRE(rdata->rdclass == 1); - REQUIRE(rdata->length != 0); - - dns_compress_setmethods(cctx, DNS_COMPRESS_NONE); - dns_rdata_toregion(rdata, &sr); - prefixlen = sr.base[0]; - INSIST(prefixlen <= 128); - - octets = 1 + 16 - prefixlen / 8; - RETERR(mem_tobuffer(target, sr.base, octets)); - isc_region_consume(&sr, octets); - - if (prefixlen == 0) - return (ISC_R_SUCCESS); - - dns_name_init(&name, offsets); - dns_name_fromregion(&name, &sr); - return (dns_name_towire(&name, cctx, target)); -} - -static inline int -compare_in_a6(ARGS_COMPARE) { - int order; - unsigned char prefixlen1, prefixlen2; - unsigned char octets; - dns_name_t name1; - dns_name_t name2; - isc_region_t region1; - isc_region_t region2; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 38); - REQUIRE(rdata1->rdclass == 1); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - dns_rdata_toregion(rdata1, ®ion1); - dns_rdata_toregion(rdata2, ®ion2); - prefixlen1 = region1.base[0]; - prefixlen2 = region2.base[0]; - isc_region_consume(®ion1, 1); - isc_region_consume(®ion2, 1); - if (prefixlen1 < prefixlen2) - return (-1); - else if (prefixlen1 > prefixlen2) - return (1); - /* - * Prefix lengths are equal. - */ - octets = 16 - prefixlen1 / 8; - - if (octets > 0) { - order = memcmp(region1.base, region2.base, octets); - if (order < 0) - return (-1); - else if (order > 0) - return (1); - /* - * Address suffixes are equal. - */ - if (prefixlen1 == 0) - return (order); - isc_region_consume(®ion1, octets); - isc_region_consume(®ion2, octets); - } - - dns_name_init(&name1, NULL); - dns_name_init(&name2, NULL); - dns_name_fromregion(&name1, ®ion1); - dns_name_fromregion(&name2, ®ion2); - return (dns_name_rdatacompare(&name1, &name2)); -} - -static inline isc_result_t -fromstruct_in_a6(ARGS_FROMSTRUCT) { - dns_rdata_in_a6_t *a6 = source; - isc_region_t region; - int octets; - isc_uint8_t bits; - isc_uint8_t first; - isc_uint8_t mask; - - REQUIRE(type == 38); - REQUIRE(rdclass == 1); - REQUIRE(source != NULL); - REQUIRE(a6->common.rdtype == type); - REQUIRE(a6->common.rdclass == rdclass); - - UNUSED(type); - UNUSED(rdclass); - - if (a6->prefixlen > 128) - return (ISC_R_RANGE); - - RETERR(uint8_tobuffer(a6->prefixlen, target)); - - /* Suffix */ - if (a6->prefixlen != 128) { - octets = 16 - a6->prefixlen / 8; - bits = a6->prefixlen % 8; - if (bits != 0) { - mask = 0xffU >> bits; - first = a6->in6_addr.s6_addr[16 - octets] & mask; - RETERR(uint8_tobuffer(first, target)); - octets--; - } - if (octets > 0) - RETERR(mem_tobuffer(target, - a6->in6_addr.s6_addr + 16 - octets, - octets)); - } - - if (a6->prefixlen == 0) - return (ISC_R_SUCCESS); - dns_name_toregion(&a6->prefix, ®ion); - return (isc_buffer_copyregion(target, ®ion)); -} - -static inline isc_result_t -tostruct_in_a6(ARGS_TOSTRUCT) { - dns_rdata_in_a6_t *a6 = target; - unsigned char octets; - dns_name_t name; - isc_region_t r; - - REQUIRE(rdata->type == 38); - REQUIRE(rdata->rdclass == 1); - REQUIRE(target != NULL); - REQUIRE(rdata->length != 0); - - a6->common.rdclass = rdata->rdclass; - a6->common.rdtype = rdata->type; - ISC_LINK_INIT(&a6->common, link); - - dns_rdata_toregion(rdata, &r); - - a6->prefixlen = uint8_fromregion(&r); - isc_region_consume(&r, 1); - memset(a6->in6_addr.s6_addr, 0, sizeof(a6->in6_addr.s6_addr)); - - /* - * Suffix. - */ - if (a6->prefixlen != 128) { - octets = 16 - a6->prefixlen / 8; - INSIST(r.length >= octets); - memcpy(a6->in6_addr.s6_addr + 16 - octets, r.base, octets); - isc_region_consume(&r, octets); - } - - /* - * Prefix. - */ - dns_name_init(&a6->prefix, NULL); - if (a6->prefixlen != 0) { - dns_name_init(&name, NULL); - dns_name_fromregion(&name, &r); - RETERR(name_duporclone(&name, mctx, &a6->prefix)); - } - a6->mctx = mctx; - return (ISC_R_SUCCESS); -} - -static inline void -freestruct_in_a6(ARGS_FREESTRUCT) { - dns_rdata_in_a6_t *a6 = source; - - REQUIRE(source != NULL); - REQUIRE(a6->common.rdclass == 1); - REQUIRE(a6->common.rdtype == 38); - - if (a6->mctx == NULL) - return; - - if (dns_name_dynamic(&a6->prefix)) - dns_name_free(&a6->prefix, a6->mctx); - a6->mctx = NULL; -} - -static inline isc_result_t -additionaldata_in_a6(ARGS_ADDLDATA) { - REQUIRE(rdata->type == 38); - REQUIRE(rdata->rdclass == 1); - - UNUSED(rdata); - UNUSED(add); - UNUSED(arg); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_in_a6(ARGS_DIGEST) { - isc_region_t r1, r2; - unsigned char prefixlen, octets; - isc_result_t result; - dns_name_t name; - - REQUIRE(rdata->type == 38); - REQUIRE(rdata->rdclass == 1); - - dns_rdata_toregion(rdata, &r1); - r2 = r1; - prefixlen = r1.base[0]; - octets = 1 + 16 - prefixlen / 8; - - r1.length = octets; - result = (digest)(arg, &r1); - if (result != ISC_R_SUCCESS) - return (result); - if (prefixlen == 0) - return (ISC_R_SUCCESS); - - isc_region_consume(&r2, octets); - dns_name_init(&name, NULL); - dns_name_fromregion(&name, &r2); - return (dns_name_digest(&name, digest, arg)); -} - -static inline isc_boolean_t -checkowner_in_a6(ARGS_CHECKOWNER) { - - REQUIRE(type == 38); - REQUIRE(rdclass == 1); - - UNUSED(type); - UNUSED(rdclass); - - return (dns_name_ishostname(name, wildcard)); -} - -static inline isc_boolean_t -checknames_in_a6(ARGS_CHECKNAMES) { - isc_region_t region; - dns_name_t name; - unsigned int prefixlen; - - REQUIRE(rdata->type == 38); - REQUIRE(rdata->rdclass == 1); - - UNUSED(owner); - - dns_rdata_toregion(rdata, ®ion); - prefixlen = uint8_fromregion(®ion); - if (prefixlen == 0) - return (ISC_TRUE); - isc_region_consume(®ion, 1 + 16 - prefixlen / 8); - dns_name_init(&name, NULL); - dns_name_fromregion(&name, ®ion); - if (!dns_name_ishostname(&name, ISC_FALSE)) { - if (bad != NULL) - dns_name_clone(&name, bad); - return (ISC_FALSE); - } - return (ISC_TRUE); -} - -#endif /* RDATA_IN_1_A6_38_C */ diff --git a/contrib/bind9/lib/dns/rdata/in_1/a6_38.h b/contrib/bind9/lib/dns/rdata/in_1/a6_38.h deleted file mode 100644 index bb15dad..0000000 --- a/contrib/bind9/lib/dns/rdata/in_1/a6_38.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef IN_1_A6_38_H -#define IN_1_A6_38_H 1 - -/* $Id: a6_38.h,v 1.20.18.2 2005/04/29 00:16:41 marka Exp $ */ - -/*! - * \brief Per RFC2874 */ - -typedef struct dns_rdata_in_a6 { - dns_rdatacommon_t common; - isc_mem_t *mctx; - dns_name_t prefix; - isc_uint8_t prefixlen; - struct in6_addr in6_addr; -} dns_rdata_in_a6_t; - -#endif /* IN_1_A6_38_H */ diff --git a/contrib/bind9/lib/dns/rdata/in_1/a_1.c b/contrib/bind9/lib/dns/rdata/in_1/a_1.c deleted file mode 100644 index e8cb8ce..0000000 --- a/contrib/bind9/lib/dns/rdata/in_1/a_1.c +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2002 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: a_1.c,v 1.51 2004/03/05 05:10:23 marka Exp $ */ - -/* Reviewed: Thu Mar 16 16:52:50 PST 2000 by bwelling */ - -#ifndef RDATA_IN_1_A_1_C -#define RDATA_IN_1_A_1_C - -#include <string.h> - -#include <isc/net.h> - -#define RRTYPE_A_ATTRIBUTES (0) - -static inline isc_result_t -fromtext_in_a(ARGS_FROMTEXT) { - isc_token_t token; - struct in_addr addr; - isc_region_t region; - - REQUIRE(type == 1); - REQUIRE(rdclass == 1); - - UNUSED(type); - UNUSED(origin); - UNUSED(options); - UNUSED(rdclass); - - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - - if (getquad(DNS_AS_STR(token), &addr, lexer, callbacks) != 1) - RETTOK(DNS_R_BADDOTTEDQUAD); - isc_buffer_availableregion(target, ®ion); - if (region.length < 4) - return (ISC_R_NOSPACE); - memcpy(region.base, &addr, 4); - isc_buffer_add(target, 4); - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -totext_in_a(ARGS_TOTEXT) { - isc_region_t region; - - REQUIRE(rdata->type == 1); - REQUIRE(rdata->rdclass == 1); - REQUIRE(rdata->length == 4); - - UNUSED(tctx); - - dns_rdata_toregion(rdata, ®ion); - return (inet_totext(AF_INET, ®ion, target)); -} - -static inline isc_result_t -fromwire_in_a(ARGS_FROMWIRE) { - isc_region_t sregion; - isc_region_t tregion; - - REQUIRE(type == 1); - REQUIRE(rdclass == 1); - - UNUSED(type); - UNUSED(dctx); - UNUSED(options); - UNUSED(rdclass); - - isc_buffer_activeregion(source, &sregion); - isc_buffer_availableregion(target, &tregion); - if (sregion.length < 4) - return (ISC_R_UNEXPECTEDEND); - if (tregion.length < 4) - return (ISC_R_NOSPACE); - - memcpy(tregion.base, sregion.base, 4); - isc_buffer_forward(source, 4); - isc_buffer_add(target, 4); - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -towire_in_a(ARGS_TOWIRE) { - isc_region_t region; - - REQUIRE(rdata->type == 1); - REQUIRE(rdata->rdclass == 1); - REQUIRE(rdata->length == 4); - - UNUSED(cctx); - - isc_buffer_availableregion(target, ®ion); - if (region.length < rdata->length) - return (ISC_R_NOSPACE); - memcpy(region.base, rdata->data, rdata->length); - isc_buffer_add(target, 4); - return (ISC_R_SUCCESS); -} - -static inline int -compare_in_a(ARGS_COMPARE) { - isc_region_t r1; - isc_region_t r2; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 1); - REQUIRE(rdata1->rdclass == 1); - REQUIRE(rdata1->length == 4); - REQUIRE(rdata2->length == 4); - - dns_rdata_toregion(rdata1, &r1); - dns_rdata_toregion(rdata2, &r2); - return (isc_region_compare(&r1, &r2)); -} - -static inline isc_result_t -fromstruct_in_a(ARGS_FROMSTRUCT) { - dns_rdata_in_a_t *a = source; - isc_uint32_t n; - - REQUIRE(type == 1); - REQUIRE(rdclass == 1); - REQUIRE(source != NULL); - REQUIRE(a->common.rdtype == type); - REQUIRE(a->common.rdclass == rdclass); - - UNUSED(type); - UNUSED(rdclass); - - n = ntohl(a->in_addr.s_addr); - - return (uint32_tobuffer(n, target)); -} - - -static inline isc_result_t -tostruct_in_a(ARGS_TOSTRUCT) { - dns_rdata_in_a_t *a = target; - isc_uint32_t n; - isc_region_t region; - - REQUIRE(rdata->type == 1); - REQUIRE(rdata->rdclass == 1); - REQUIRE(rdata->length == 4); - - UNUSED(mctx); - - a->common.rdclass = rdata->rdclass; - a->common.rdtype = rdata->type; - ISC_LINK_INIT(&a->common, link); - - dns_rdata_toregion(rdata, ®ion); - n = uint32_fromregion(®ion); - a->in_addr.s_addr = htonl(n); - - return (ISC_R_SUCCESS); -} - -static inline void -freestruct_in_a(ARGS_FREESTRUCT) { - dns_rdata_in_a_t *a = source; - - REQUIRE(source != NULL); - REQUIRE(a->common.rdtype == 1); - REQUIRE(a->common.rdclass == 1); - - UNUSED(a); -} - -static inline isc_result_t -additionaldata_in_a(ARGS_ADDLDATA) { - REQUIRE(rdata->type == 1); - REQUIRE(rdata->rdclass == 1); - - UNUSED(rdata); - UNUSED(add); - UNUSED(arg); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_in_a(ARGS_DIGEST) { - isc_region_t r; - - REQUIRE(rdata->type == 1); - REQUIRE(rdata->rdclass == 1); - - dns_rdata_toregion(rdata, &r); - - return ((digest)(arg, &r)); -} - -static inline isc_boolean_t -checkowner_in_a(ARGS_CHECKOWNER) { - - REQUIRE(type == 1); - REQUIRE(rdclass == 1); - - UNUSED(type); - UNUSED(rdclass); - - return (dns_name_ishostname(name, wildcard)); -} - -static inline isc_boolean_t -checknames_in_a(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 1); - REQUIRE(rdata->rdclass == 1); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_IN_1_A_1_C */ diff --git a/contrib/bind9/lib/dns/rdata/in_1/a_1.h b/contrib/bind9/lib/dns/rdata/in_1/a_1.h deleted file mode 100644 index d92a973..0000000 --- a/contrib/bind9/lib/dns/rdata/in_1/a_1.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1998-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* */ -#ifndef IN_1_A_1_H -#define IN_1_A_1_H 1 - -/* $Id: a_1.h,v 1.24.18.2 2005/04/29 00:16:41 marka Exp $ */ - -typedef struct dns_rdata_in_a { - dns_rdatacommon_t common; - struct in_addr in_addr; -} dns_rdata_in_a_t; - -#endif /* IN_1_A_1_H */ diff --git a/contrib/bind9/lib/dns/rdata/in_1/aaaa_28.c b/contrib/bind9/lib/dns/rdata/in_1/aaaa_28.c deleted file mode 100644 index 1dd32cf..0000000 --- a/contrib/bind9/lib/dns/rdata/in_1/aaaa_28.c +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2002 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: aaaa_28.c,v 1.41.18.2 2005/04/29 00:16:41 marka Exp $ */ - -/* Reviewed: Thu Mar 16 16:52:50 PST 2000 by bwelling */ - -/* RFC1886 */ - -#ifndef RDATA_IN_1_AAAA_28_C -#define RDATA_IN_1_AAAA_28_C - -#include <isc/net.h> - -#define RRTYPE_AAAA_ATTRIBUTES (0) - -static inline isc_result_t -fromtext_in_aaaa(ARGS_FROMTEXT) { - isc_token_t token; - unsigned char addr[16]; - isc_region_t region; - - REQUIRE(type == 28); - REQUIRE(rdclass == 1); - - UNUSED(type); - UNUSED(origin); - UNUSED(options); - UNUSED(rdclass); - UNUSED(callbacks); - - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - - if (inet_pton(AF_INET6, DNS_AS_STR(token), addr) != 1) - RETTOK(DNS_R_BADAAAA); - isc_buffer_availableregion(target, ®ion); - if (region.length < 16) - return (ISC_R_NOSPACE); - memcpy(region.base, addr, 16); - isc_buffer_add(target, 16); - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -totext_in_aaaa(ARGS_TOTEXT) { - isc_region_t region; - - UNUSED(tctx); - - REQUIRE(rdata->type == 28); - REQUIRE(rdata->rdclass == 1); - REQUIRE(rdata->length == 16); - - dns_rdata_toregion(rdata, ®ion); - return (inet_totext(AF_INET6, ®ion, target)); -} - -static inline isc_result_t -fromwire_in_aaaa(ARGS_FROMWIRE) { - isc_region_t sregion; - isc_region_t tregion; - - REQUIRE(type == 28); - REQUIRE(rdclass == 1); - - UNUSED(type); - UNUSED(dctx); - UNUSED(options); - UNUSED(rdclass); - - isc_buffer_activeregion(source, &sregion); - isc_buffer_availableregion(target, &tregion); - if (sregion.length < 16) - return (ISC_R_UNEXPECTEDEND); - if (tregion.length < 16) - return (ISC_R_NOSPACE); - - memcpy(tregion.base, sregion.base, 16); - isc_buffer_forward(source, 16); - isc_buffer_add(target, 16); - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -towire_in_aaaa(ARGS_TOWIRE) { - isc_region_t region; - - UNUSED(cctx); - - REQUIRE(rdata->type == 28); - REQUIRE(rdata->rdclass == 1); - REQUIRE(rdata->length == 16); - - isc_buffer_availableregion(target, ®ion); - if (region.length < rdata->length) - return (ISC_R_NOSPACE); - memcpy(region.base, rdata->data, rdata->length); - isc_buffer_add(target, 16); - return (ISC_R_SUCCESS); -} - -static inline int -compare_in_aaaa(ARGS_COMPARE) { - isc_region_t r1; - isc_region_t r2; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 28); - REQUIRE(rdata1->rdclass == 1); - REQUIRE(rdata1->length == 16); - REQUIRE(rdata2->length == 16); - - dns_rdata_toregion(rdata1, &r1); - dns_rdata_toregion(rdata2, &r2); - return (isc_region_compare(&r1, &r2)); -} - -static inline isc_result_t -fromstruct_in_aaaa(ARGS_FROMSTRUCT) { - dns_rdata_in_aaaa_t *aaaa = source; - - REQUIRE(type == 28); - REQUIRE(rdclass == 1); - REQUIRE(source != NULL); - REQUIRE(aaaa->common.rdtype == type); - REQUIRE(aaaa->common.rdclass == rdclass); - - UNUSED(type); - UNUSED(rdclass); - - return (mem_tobuffer(target, aaaa->in6_addr.s6_addr, 16)); -} - -static inline isc_result_t -tostruct_in_aaaa(ARGS_TOSTRUCT) { - dns_rdata_in_aaaa_t *aaaa = target; - isc_region_t r; - - REQUIRE(rdata->type == 28); - REQUIRE(rdata->rdclass == 1); - REQUIRE(target != NULL); - REQUIRE(rdata->length == 16); - - UNUSED(mctx); - - aaaa->common.rdclass = rdata->rdclass; - aaaa->common.rdtype = rdata->type; - ISC_LINK_INIT(&aaaa->common, link); - - dns_rdata_toregion(rdata, &r); - INSIST(r.length == 16); - memcpy(aaaa->in6_addr.s6_addr, r.base, 16); - - return (ISC_R_SUCCESS); -} - -static inline void -freestruct_in_aaaa(ARGS_FREESTRUCT) { - dns_rdata_in_aaaa_t *aaaa = source; - - REQUIRE(source != NULL); - REQUIRE(aaaa->common.rdclass == 1); - REQUIRE(aaaa->common.rdtype == 28); - - UNUSED(aaaa); -} - -static inline isc_result_t -additionaldata_in_aaaa(ARGS_ADDLDATA) { - REQUIRE(rdata->type == 28); - REQUIRE(rdata->rdclass == 1); - - UNUSED(rdata); - UNUSED(add); - UNUSED(arg); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_in_aaaa(ARGS_DIGEST) { - isc_region_t r; - - REQUIRE(rdata->type == 28); - REQUIRE(rdata->rdclass == 1); - - dns_rdata_toregion(rdata, &r); - - return ((digest)(arg, &r)); -} - -static inline isc_boolean_t -checkowner_in_aaaa(ARGS_CHECKOWNER) { - - REQUIRE(type == 28); - REQUIRE(rdclass == 1); - - UNUSED(type); - UNUSED(rdclass); - - return (dns_name_ishostname(name, wildcard)); -} - -static inline isc_boolean_t -checknames_in_aaaa(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 28); - REQUIRE(rdata->rdclass == 1); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_IN_1_AAAA_28_C */ diff --git a/contrib/bind9/lib/dns/rdata/in_1/aaaa_28.h b/contrib/bind9/lib/dns/rdata/in_1/aaaa_28.h deleted file mode 100644 index 31ad6a6..0000000 --- a/contrib/bind9/lib/dns/rdata/in_1/aaaa_28.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef IN_1_AAAA_28_H -#define IN_1_AAAA_28_H 1 - -/* $Id: aaaa_28.h,v 1.17.18.2 2005/04/29 00:16:42 marka Exp $ */ - -/*! - * \brief Per RFC1886 */ - -typedef struct dns_rdata_in_aaaa { - dns_rdatacommon_t common; - struct in6_addr in6_addr; -} dns_rdata_in_aaaa_t; - -#endif /* IN_1_AAAA_28_H */ diff --git a/contrib/bind9/lib/dns/rdata/in_1/apl_42.c b/contrib/bind9/lib/dns/rdata/in_1/apl_42.c deleted file mode 100644 index 42b2e7f..0000000 --- a/contrib/bind9/lib/dns/rdata/in_1/apl_42.c +++ /dev/null @@ -1,402 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2002 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: apl_42.c,v 1.8.18.2 2005/04/29 00:16:42 marka Exp $ */ - -/* RFC3123 */ - -#ifndef RDATA_IN_1_APL_42_C -#define RDATA_IN_1_APL_42_C - -#define RRTYPE_APL_ATTRIBUTES (0) - -static inline isc_result_t -fromtext_in_apl(ARGS_FROMTEXT) { - isc_token_t token; - unsigned char addr[16]; - unsigned long afi; - isc_uint8_t prefix; - isc_uint8_t len; - isc_boolean_t neg; - char *cp, *ap, *slash; - int n; - - REQUIRE(type == 42); - REQUIRE(rdclass == 1); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(origin); - UNUSED(options); - UNUSED(callbacks); - - do { - RETERR(isc_lex_getmastertoken(lexer, &token, - isc_tokentype_string, ISC_TRUE)); - if (token.type != isc_tokentype_string) - break; - - cp = DNS_AS_STR(token); - neg = ISC_TF(*cp == '!'); - if (neg) - cp++; - afi = strtoul(cp, &ap, 10); - if (*ap++ != ':' || cp == ap) - RETTOK(DNS_R_SYNTAX); - if (afi > 0xffffU) - RETTOK(ISC_R_RANGE); - slash = strchr(ap, '/'); - if (slash == NULL || slash == ap) - RETTOK(DNS_R_SYNTAX); - RETTOK(isc_parse_uint8(&prefix, slash + 1, 10)); - switch (afi) { - case 1: - *slash = '\0'; - n = inet_pton(AF_INET, ap, addr); - *slash = '/'; - if (n != 1) - RETTOK(DNS_R_BADDOTTEDQUAD); - if (prefix > 32) - RETTOK(ISC_R_RANGE); - for (len = 4; len > 0; len--) - if (addr[len - 1] != 0) - break; - break; - - case 2: - *slash = '\0'; - n = inet_pton(AF_INET6, ap, addr); - *slash = '/'; - if (n != 1) - RETTOK(DNS_R_BADAAAA); - if (prefix > 128) - RETTOK(ISC_R_RANGE); - for (len = 16; len > 0; len--) - if (addr[len - 1] != 0) - break; - break; - - default: - RETTOK(ISC_R_NOTIMPLEMENTED); - } - RETERR(uint16_tobuffer(afi, target)); - RETERR(uint8_tobuffer(prefix, target)); - RETERR(uint8_tobuffer(len | ((neg) ? 0x80 : 0), target)); - RETERR(mem_tobuffer(target, addr, len)); - } while (1); - - /* - * Let upper layer handle eol/eof. - */ - isc_lex_ungettoken(lexer, &token); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -totext_in_apl(ARGS_TOTEXT) { - isc_region_t sr; - isc_region_t ir; - isc_uint16_t afi; - isc_uint8_t prefix; - isc_uint8_t len; - isc_boolean_t neg; - unsigned char buf[16]; - char txt[sizeof(" !64000")]; - const char *sep = ""; - int n; - - REQUIRE(rdata->type == 42); - REQUIRE(rdata->rdclass == 1); - - UNUSED(tctx); - - dns_rdata_toregion(rdata, &sr); - ir.base = buf; - ir.length = sizeof(buf); - - while (sr.length > 0) { - INSIST(sr.length >= 4); - afi = uint16_fromregion(&sr); - isc_region_consume(&sr, 2); - prefix = *sr.base; - isc_region_consume(&sr, 1); - len = (*sr.base & 0x7f); - neg = ISC_TF((*sr.base & 0x80) != 0); - isc_region_consume(&sr, 1); - INSIST(len <= sr.length); - n = snprintf(txt, sizeof(txt), "%s%s%u:", sep, - neg ? "!": "", afi); - INSIST(n < (int)sizeof(txt)); - RETERR(str_totext(txt, target)); - switch (afi) { - case 1: - INSIST(len <= 4); - INSIST(prefix <= 32); - memset(buf, 0, sizeof(buf)); - memcpy(buf, sr.base, len); - RETERR(inet_totext(AF_INET, &ir, target)); - break; - - case 2: - INSIST(len <= 16); - INSIST(prefix <= 128); - memset(buf, 0, sizeof(buf)); - memcpy(buf, sr.base, len); - RETERR(inet_totext(AF_INET6, &ir, target)); - break; - - default: - return (ISC_R_NOTIMPLEMENTED); - } - n = snprintf(txt, sizeof(txt), "/%u", prefix); - INSIST(n < (int)sizeof(txt)); - RETERR(str_totext(txt, target)); - isc_region_consume(&sr, len); - sep = " "; - } - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -fromwire_in_apl(ARGS_FROMWIRE) { - isc_region_t sr, sr2; - isc_region_t tr; - isc_uint16_t afi; - isc_uint8_t prefix; - isc_uint8_t len; - - REQUIRE(type == 42); - REQUIRE(rdclass == 1); - - UNUSED(type); - UNUSED(dctx); - UNUSED(rdclass); - UNUSED(options); - - isc_buffer_activeregion(source, &sr); - isc_buffer_availableregion(target, &tr); - if (sr.length > tr.length) - return (ISC_R_NOSPACE); - sr2 = sr; - - /* Zero or more items */ - while (sr.length > 0) { - if (sr.length < 4) - return (ISC_R_UNEXPECTEDEND); - afi = uint16_fromregion(&sr); - isc_region_consume(&sr, 2); - prefix = *sr.base; - isc_region_consume(&sr, 1); - len = (*sr.base & 0x7f); - isc_region_consume(&sr, 1); - if (len > sr.length) - return (ISC_R_UNEXPECTEDEND); - switch (afi) { - case 1: - if (prefix > 32 || len > 4) - return (ISC_R_RANGE); - break; - case 2: - if (prefix > 128 || len > 16) - return (ISC_R_RANGE); - } - if (len > 0 && sr.base[len - 1] == 0) - return (DNS_R_FORMERR); - isc_region_consume(&sr, len); - } - isc_buffer_forward(source, sr2.length); - return (mem_tobuffer(target, sr2.base, sr2.length)); -} - -static inline isc_result_t -towire_in_apl(ARGS_TOWIRE) { - UNUSED(cctx); - - REQUIRE(rdata->type == 42); - REQUIRE(rdata->rdclass == 1); - - return (mem_tobuffer(target, rdata->data, rdata->length)); -} - -static inline int -compare_in_apl(ARGS_COMPARE) { - isc_region_t r1; - isc_region_t r2; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 42); - REQUIRE(rdata1->rdclass == 1); - - dns_rdata_toregion(rdata1, &r1); - dns_rdata_toregion(rdata2, &r2); - return (isc_region_compare(&r1, &r2)); -} - -static inline isc_result_t -fromstruct_in_apl(ARGS_FROMSTRUCT) { - dns_rdata_in_apl_t *apl = source; - isc_buffer_t b; - - REQUIRE(type == 42); - REQUIRE(rdclass == 1); - REQUIRE(source != NULL); - REQUIRE(apl->common.rdtype == type); - REQUIRE(apl->common.rdclass == rdclass); - REQUIRE(apl->apl != NULL || apl->apl_len == 0); - - isc_buffer_init(&b, apl->apl, apl->apl_len); - isc_buffer_add(&b, apl->apl_len); - isc_buffer_setactive(&b, apl->apl_len); - return(fromwire_in_apl(rdclass, type, &b, NULL, ISC_FALSE, target)); -} - -static inline isc_result_t -tostruct_in_apl(ARGS_TOSTRUCT) { - dns_rdata_in_apl_t *apl = target; - isc_region_t r; - - REQUIRE(rdata->type == 42); - REQUIRE(rdata->rdclass == 1); - - apl->common.rdclass = rdata->rdclass; - apl->common.rdtype = rdata->type; - ISC_LINK_INIT(&apl->common, link); - - dns_rdata_toregion(rdata, &r); - apl->apl_len = r.length; - apl->apl = mem_maybedup(mctx, r.base, r.length); - if (apl->apl == NULL) - return (ISC_R_NOMEMORY); - - apl->offset = 0; - apl->mctx = mctx; - return (ISC_R_SUCCESS); -} - -static inline void -freestruct_in_apl(ARGS_FREESTRUCT) { - dns_rdata_in_apl_t *apl = source; - - REQUIRE(source != NULL); - REQUIRE(apl->common.rdtype == 42); - REQUIRE(apl->common.rdclass == 1); - - if (apl->mctx == NULL) - return; - if (apl->apl != NULL) - isc_mem_free(apl->mctx, apl->apl); - apl->mctx = NULL; -} - -isc_result_t -dns_rdata_apl_first(dns_rdata_in_apl_t *apl) { - REQUIRE(apl->common.rdtype == 42); - REQUIRE(apl->common.rdclass == 1); - REQUIRE(apl->apl != NULL || apl->apl_len == 0); - - apl->offset = 0; - return ((apl->apl_len != 0) ? ISC_R_SUCCESS : ISC_R_NOMORE); -} - -isc_result_t -dns_rdata_apl_next(dns_rdata_in_apl_t *apl) { - REQUIRE(apl->common.rdtype == 42); - REQUIRE(apl->common.rdclass == 1); - REQUIRE(apl->apl != NULL || apl->apl_len == 0); - - if (apl->offset + 3 < apl->apl_len) - return (ISC_R_NOMORE); - apl->offset += apl->apl[apl->offset + 3] & 0x7f; - return ((apl->offset >= apl->apl_len) ? ISC_R_SUCCESS : ISC_R_NOMORE); -} - -isc_result_t -dns_rdata_apl_current(dns_rdata_in_apl_t *apl, dns_rdata_apl_ent_t *ent) { - - REQUIRE(apl->common.rdtype == 42); - REQUIRE(apl->common.rdclass == 1); - REQUIRE(ent != NULL); - REQUIRE(apl->apl != NULL || apl->apl_len == 0); - - if (apl->offset >= apl->apl_len) - return (ISC_R_NOMORE); - - ent->family = (apl->apl[apl->offset] << 8) + apl->apl[apl->offset + 1]; - ent->prefix = apl->apl[apl->offset + 2]; - ent->length = apl->apl[apl->offset + 3] & 0x7f; - ent->negative = ISC_TF((apl->apl[apl->offset + 3] & 0x80) != 0); - if (ent->length != 0) - ent->data = &apl->apl[apl->offset + 4]; - else - ent->data = NULL; - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -additionaldata_in_apl(ARGS_ADDLDATA) { - REQUIRE(rdata->type == 42); - REQUIRE(rdata->rdclass == 1); - - (void)add; - (void)arg; - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_in_apl(ARGS_DIGEST) { - isc_region_t r; - - REQUIRE(rdata->type == 42); - REQUIRE(rdata->rdclass == 1); - - dns_rdata_toregion(rdata, &r); - - return ((digest)(arg, &r)); -} - -static inline isc_boolean_t -checkowner_in_apl(ARGS_CHECKOWNER) { - - REQUIRE(type == 42); - REQUIRE(rdclass == 1); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - - -static inline isc_boolean_t -checknames_in_apl(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 42); - REQUIRE(rdata->rdclass == 1); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_IN_1_APL_42_C */ diff --git a/contrib/bind9/lib/dns/rdata/in_1/apl_42.h b/contrib/bind9/lib/dns/rdata/in_1/apl_42.h deleted file mode 100644 index d434ace..0000000 --- a/contrib/bind9/lib/dns/rdata/in_1/apl_42.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 2002 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* */ -#ifndef IN_1_APL_42_H -#define IN_1_APL_42_H 1 - -/* $Id: apl_42.h,v 1.2.18.2 2005/04/29 00:16:42 marka Exp $ */ - -typedef struct dns_rdata_apl_ent { - isc_boolean_t negative; - isc_uint16_t family; - isc_uint8_t prefix; - isc_uint8_t length; - unsigned char *data; -} dns_rdata_apl_ent_t; - -typedef struct dns_rdata_in_apl { - dns_rdatacommon_t common; - isc_mem_t *mctx; - /* type & class specific elements */ - unsigned char *apl; - isc_uint16_t apl_len; - /* private */ - isc_uint16_t offset; -} dns_rdata_in_apl_t; - -/* - * ISC_LANG_BEGINDECLS and ISC_LANG_ENDDECLS are already done - * via rdatastructpre.h and rdatastructsuf.h. - */ - -isc_result_t -dns_rdata_apl_first(dns_rdata_in_apl_t *); - -isc_result_t -dns_rdata_apl_next(dns_rdata_in_apl_t *); - -isc_result_t -dns_rdata_apl_current(dns_rdata_in_apl_t *, dns_rdata_apl_ent_t *); - -#endif /* IN_1_APL_42_H */ diff --git a/contrib/bind9/lib/dns/rdata/in_1/kx_36.c b/contrib/bind9/lib/dns/rdata/in_1/kx_36.c deleted file mode 100644 index 8a64aac..0000000 --- a/contrib/bind9/lib/dns/rdata/in_1/kx_36.c +++ /dev/null @@ -1,288 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001, 2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: kx_36.c,v 1.41.18.2 2005/04/29 00:16:42 marka Exp $ */ - -/* Reviewed: Thu Mar 16 17:24:54 PST 2000 by explorer */ - -/* RFC2230 */ - -#ifndef RDATA_IN_1_KX_36_C -#define RDATA_IN_1_KX_36_C - -#define RRTYPE_KX_ATTRIBUTES (0) - -static inline isc_result_t -fromtext_in_kx(ARGS_FROMTEXT) { - isc_token_t token; - dns_name_t name; - isc_buffer_t buffer; - - REQUIRE(type == 36); - REQUIRE(rdclass == 1); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(callbacks); - - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - if (token.value.as_ulong > 0xffffU) - RETTOK(ISC_R_RANGE); - RETERR(uint16_tobuffer(token.value.as_ulong, target)); - - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - dns_name_init(&name, NULL); - buffer_fromregion(&buffer, &token.value.as_region); - origin = (origin != NULL) ? origin : dns_rootname; - RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target)); - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -totext_in_kx(ARGS_TOTEXT) { - isc_region_t region; - dns_name_t name; - dns_name_t prefix; - isc_boolean_t sub; - char buf[sizeof("64000")]; - unsigned short num; - - REQUIRE(rdata->type == 36); - REQUIRE(rdata->rdclass == 1); - REQUIRE(rdata->length != 0); - - dns_name_init(&name, NULL); - dns_name_init(&prefix, NULL); - - dns_rdata_toregion(rdata, ®ion); - num = uint16_fromregion(®ion); - isc_region_consume(®ion, 2); - sprintf(buf, "%u", num); - RETERR(str_totext(buf, target)); - - RETERR(str_totext(" ", target)); - - dns_name_fromregion(&name, ®ion); - sub = name_prefix(&name, tctx->origin, &prefix); - return (dns_name_totext(&prefix, sub, target)); -} - -static inline isc_result_t -fromwire_in_kx(ARGS_FROMWIRE) { - dns_name_t name; - isc_region_t sregion; - - REQUIRE(type == 36); - REQUIRE(rdclass == 1); - - UNUSED(type); - UNUSED(rdclass); - - dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE); - - dns_name_init(&name, NULL); - - isc_buffer_activeregion(source, &sregion); - if (sregion.length < 2) - return (ISC_R_UNEXPECTEDEND); - RETERR(mem_tobuffer(target, sregion.base, 2)); - isc_buffer_forward(source, 2); - return (dns_name_fromwire(&name, source, dctx, options, target)); -} - -static inline isc_result_t -towire_in_kx(ARGS_TOWIRE) { - dns_name_t name; - dns_offsets_t offsets; - isc_region_t region; - - REQUIRE(rdata->type == 36); - REQUIRE(rdata->rdclass == 1); - REQUIRE(rdata->length != 0); - - dns_compress_setmethods(cctx, DNS_COMPRESS_NONE); - dns_rdata_toregion(rdata, ®ion); - RETERR(mem_tobuffer(target, region.base, 2)); - isc_region_consume(®ion, 2); - - dns_name_init(&name, offsets); - dns_name_fromregion(&name, ®ion); - - return (dns_name_towire(&name, cctx, target)); -} - -static inline int -compare_in_kx(ARGS_COMPARE) { - dns_name_t name1; - dns_name_t name2; - isc_region_t region1; - isc_region_t region2; - int order; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 36); - REQUIRE(rdata1->rdclass == 1); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - order = memcmp(rdata1->data, rdata2->data, 2); - if (order != 0) - return (order < 0 ? -1 : 1); - - dns_name_init(&name1, NULL); - dns_name_init(&name2, NULL); - - dns_rdata_toregion(rdata1, ®ion1); - dns_rdata_toregion(rdata2, ®ion2); - - isc_region_consume(®ion1, 2); - isc_region_consume(®ion2, 2); - - dns_name_fromregion(&name1, ®ion1); - dns_name_fromregion(&name2, ®ion2); - - return (dns_name_rdatacompare(&name1, &name2)); -} - -static inline isc_result_t -fromstruct_in_kx(ARGS_FROMSTRUCT) { - dns_rdata_in_kx_t *kx = source; - isc_region_t region; - - REQUIRE(type == 36); - REQUIRE(rdclass == 1); - REQUIRE(source != NULL); - REQUIRE(kx->common.rdtype == type); - REQUIRE(kx->common.rdclass == rdclass); - - UNUSED(type); - UNUSED(rdclass); - - RETERR(uint16_tobuffer(kx->preference, target)); - dns_name_toregion(&kx->exchange, ®ion); - return (isc_buffer_copyregion(target, ®ion)); -} - -static inline isc_result_t -tostruct_in_kx(ARGS_TOSTRUCT) { - isc_region_t region; - dns_rdata_in_kx_t *kx = target; - dns_name_t name; - - REQUIRE(rdata->type == 36); - REQUIRE(rdata->rdclass == 1); - REQUIRE(target != NULL); - REQUIRE(rdata->length != 0); - - kx->common.rdclass = rdata->rdclass; - kx->common.rdtype = rdata->type; - ISC_LINK_INIT(&kx->common, link); - - dns_name_init(&name, NULL); - dns_rdata_toregion(rdata, ®ion); - - kx->preference = uint16_fromregion(®ion); - isc_region_consume(®ion, 2); - - dns_name_fromregion(&name, ®ion); - dns_name_init(&kx->exchange, NULL); - RETERR(name_duporclone(&name, mctx, &kx->exchange)); - kx->mctx = mctx; - return (ISC_R_SUCCESS); -} - -static inline void -freestruct_in_kx(ARGS_FREESTRUCT) { - dns_rdata_in_kx_t *kx = source; - - REQUIRE(source != NULL); - REQUIRE(kx->common.rdclass == 1); - REQUIRE(kx->common.rdtype == 36); - - if (kx->mctx == NULL) - return; - - dns_name_free(&kx->exchange, kx->mctx); - kx->mctx = NULL; -} - -static inline isc_result_t -additionaldata_in_kx(ARGS_ADDLDATA) { - dns_name_t name; - dns_offsets_t offsets; - isc_region_t region; - - REQUIRE(rdata->type == 36); - REQUIRE(rdata->rdclass == 1); - - dns_name_init(&name, offsets); - dns_rdata_toregion(rdata, ®ion); - isc_region_consume(®ion, 2); - dns_name_fromregion(&name, ®ion); - - return ((add)(arg, &name, dns_rdatatype_a)); -} - -static inline isc_result_t -digest_in_kx(ARGS_DIGEST) { - isc_region_t r1, r2; - dns_name_t name; - - REQUIRE(rdata->type == 36); - REQUIRE(rdata->rdclass == 1); - - dns_rdata_toregion(rdata, &r1); - r2 = r1; - isc_region_consume(&r2, 2); - r1.length = 2; - RETERR((digest)(arg, &r1)); - dns_name_init(&name, NULL); - dns_name_fromregion(&name, &r2); - return (dns_name_digest(&name, digest, arg)); -} - -static inline isc_boolean_t -checkowner_in_kx(ARGS_CHECKOWNER) { - - REQUIRE(type == 36); - REQUIRE(rdclass == 1); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_in_kx(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 36); - REQUIRE(rdata->rdclass == 1); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_IN_1_KX_36_C */ diff --git a/contrib/bind9/lib/dns/rdata/in_1/kx_36.h b/contrib/bind9/lib/dns/rdata/in_1/kx_36.h deleted file mode 100644 index c44883d..0000000 --- a/contrib/bind9/lib/dns/rdata/in_1/kx_36.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef IN_1_KX_36_H -#define IN_1_KX_36_H 1 - -/* $Id: kx_36.h,v 1.16.18.2 2005/04/29 00:16:42 marka Exp $ */ - -/*! - * \brief Per RFC2230 */ - -typedef struct dns_rdata_in_kx { - dns_rdatacommon_t common; - isc_mem_t *mctx; - isc_uint16_t preference; - dns_name_t exchange; -} dns_rdata_in_kx_t; - -#endif /* IN_1_KX_36_H */ diff --git a/contrib/bind9/lib/dns/rdata/in_1/naptr_35.c b/contrib/bind9/lib/dns/rdata/in_1/naptr_35.c deleted file mode 100644 index 0e5961a..0000000 --- a/contrib/bind9/lib/dns/rdata/in_1/naptr_35.c +++ /dev/null @@ -1,578 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001, 2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: naptr_35.c,v 1.47.18.2 2005/04/29 00:16:42 marka Exp $ */ - -/* Reviewed: Thu Mar 16 16:52:50 PST 2000 by bwelling */ - -/* RFC2915 */ - -#ifndef RDATA_IN_1_NAPTR_35_C -#define RDATA_IN_1_NAPTR_35_C - -#define RRTYPE_NAPTR_ATTRIBUTES (0) - -static inline isc_result_t -fromtext_in_naptr(ARGS_FROMTEXT) { - isc_token_t token; - dns_name_t name; - isc_buffer_t buffer; - - REQUIRE(type == 35); - REQUIRE(rdclass == 1); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(callbacks); - - /* - * Order. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - if (token.value.as_ulong > 0xffffU) - RETTOK(ISC_R_RANGE); - RETERR(uint16_tobuffer(token.value.as_ulong, target)); - - /* - * Preference. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - if (token.value.as_ulong > 0xffffU) - RETTOK(ISC_R_RANGE); - RETERR(uint16_tobuffer(token.value.as_ulong, target)); - - /* - * Flags. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_qstring, - ISC_FALSE)); - RETTOK(txt_fromtext(&token.value.as_textregion, target)); - - /* - * Service. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_qstring, - ISC_FALSE)); - RETTOK(txt_fromtext(&token.value.as_textregion, target)); - - /* - * Regexp. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_qstring, - ISC_FALSE)); - RETTOK(txt_fromtext(&token.value.as_textregion, target)); - - /* - * Replacement. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - dns_name_init(&name, NULL); - buffer_fromregion(&buffer, &token.value.as_region); - origin = (origin != NULL) ? origin : dns_rootname; - RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target)); - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -totext_in_naptr(ARGS_TOTEXT) { - isc_region_t region; - dns_name_t name; - dns_name_t prefix; - isc_boolean_t sub; - char buf[sizeof("64000")]; - unsigned short num; - - REQUIRE(rdata->type == 35); - REQUIRE(rdata->rdclass == 1); - REQUIRE(rdata->length != 0); - - dns_name_init(&name, NULL); - dns_name_init(&prefix, NULL); - - dns_rdata_toregion(rdata, ®ion); - - /* - * Order. - */ - num = uint16_fromregion(®ion); - isc_region_consume(®ion, 2); - sprintf(buf, "%u", num); - RETERR(str_totext(buf, target)); - RETERR(str_totext(" ", target)); - - /* - * Preference. - */ - num = uint16_fromregion(®ion); - isc_region_consume(®ion, 2); - sprintf(buf, "%u", num); - RETERR(str_totext(buf, target)); - RETERR(str_totext(" ", target)); - - /* - * Flags. - */ - RETERR(txt_totext(®ion, target)); - RETERR(str_totext(" ", target)); - - /* - * Service. - */ - RETERR(txt_totext(®ion, target)); - RETERR(str_totext(" ", target)); - - /* - * Regexp. - */ - RETERR(txt_totext(®ion, target)); - RETERR(str_totext(" ", target)); - - /* - * Replacement. - */ - dns_name_fromregion(&name, ®ion); - sub = name_prefix(&name, tctx->origin, &prefix); - return (dns_name_totext(&prefix, sub, target)); -} - -static inline isc_result_t -fromwire_in_naptr(ARGS_FROMWIRE) { - dns_name_t name; - isc_region_t sr; - - REQUIRE(type == 35); - REQUIRE(rdclass == 1); - - UNUSED(type); - UNUSED(rdclass); - - dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE); - - dns_name_init(&name, NULL); - - /* - * Order, preference. - */ - isc_buffer_activeregion(source, &sr); - if (sr.length < 4) - return (ISC_R_UNEXPECTEDEND); - RETERR(mem_tobuffer(target, sr.base, 4)); - isc_buffer_forward(source, 4); - - /* - * Flags. - */ - RETERR(txt_fromwire(source, target)); - - /* - * Service. - */ - RETERR(txt_fromwire(source, target)); - - /* - * Regexp. - */ - RETERR(txt_fromwire(source, target)); - - /* - * Replacement. - */ - return (dns_name_fromwire(&name, source, dctx, options, target)); -} - -static inline isc_result_t -towire_in_naptr(ARGS_TOWIRE) { - dns_name_t name; - dns_offsets_t offsets; - isc_region_t sr; - - REQUIRE(rdata->type == 35); - REQUIRE(rdata->rdclass == 1); - REQUIRE(rdata->length != 0); - - dns_compress_setmethods(cctx, DNS_COMPRESS_NONE); - /* - * Order, preference. - */ - dns_rdata_toregion(rdata, &sr); - RETERR(mem_tobuffer(target, sr.base, 4)); - isc_region_consume(&sr, 4); - - /* - * Flags. - */ - RETERR(mem_tobuffer(target, sr.base, sr.base[0] + 1)); - isc_region_consume(&sr, sr.base[0] + 1); - - /* - * Service. - */ - RETERR(mem_tobuffer(target, sr.base, sr.base[0] + 1)); - isc_region_consume(&sr, sr.base[0] + 1); - - /* - * Regexp. - */ - RETERR(mem_tobuffer(target, sr.base, sr.base[0] + 1)); - isc_region_consume(&sr, sr.base[0] + 1); - - /* - * Replacement. - */ - dns_name_init(&name, offsets); - dns_name_fromregion(&name, &sr); - return (dns_name_towire(&name, cctx, target)); -} - -static inline int -compare_in_naptr(ARGS_COMPARE) { - dns_name_t name1; - dns_name_t name2; - isc_region_t region1; - isc_region_t region2; - int order, len; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 35); - REQUIRE(rdata1->rdclass == 1); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - dns_rdata_toregion(rdata1, ®ion1); - dns_rdata_toregion(rdata2, ®ion2); - - /* - * Order, preference. - */ - order = memcmp(region1.base, region2.base, 4); - if (order != 0) - return (order < 0 ? -1 : 1); - isc_region_consume(®ion1, 4); - isc_region_consume(®ion2, 4); - - /* - * Flags. - */ - len = ISC_MIN(region1.base[0], region2.base[0]); - order = memcmp(region1.base, region2.base, len + 1); - if (order != 0) - return (order < 0 ? -1 : 1); - isc_region_consume(®ion1, region1.base[0] + 1); - isc_region_consume(®ion2, region2.base[0] + 1); - - /* - * Service. - */ - len = ISC_MIN(region1.base[0], region2.base[0]); - order = memcmp(region1.base, region2.base, len + 1); - if (order != 0) - return (order < 0 ? -1 : 1); - isc_region_consume(®ion1, region1.base[0] + 1); - isc_region_consume(®ion2, region2.base[0] + 1); - - /* - * Regexp. - */ - len = ISC_MIN(region1.base[0], region2.base[0]); - order = memcmp(region1.base, region2.base, len + 1); - if (order != 0) - return (order < 0 ? -1 : 1); - isc_region_consume(®ion1, region1.base[0] + 1); - isc_region_consume(®ion2, region2.base[0] + 1); - - /* - * Replacement. - */ - dns_name_init(&name1, NULL); - dns_name_init(&name2, NULL); - - dns_name_fromregion(&name1, ®ion1); - dns_name_fromregion(&name2, ®ion2); - - return (dns_name_rdatacompare(&name1, &name2)); -} - -static inline isc_result_t -fromstruct_in_naptr(ARGS_FROMSTRUCT) { - dns_rdata_in_naptr_t *naptr = source; - isc_region_t region; - - REQUIRE(type == 35); - REQUIRE(rdclass == 1); - REQUIRE(source != NULL); - REQUIRE(naptr->common.rdtype == type); - REQUIRE(naptr->common.rdclass == rdclass); - REQUIRE(naptr->flags != NULL || naptr->flags_len == 0); - REQUIRE(naptr->service != NULL && naptr->service_len == 0); - REQUIRE(naptr->regexp != NULL && naptr->regexp_len == 0); - - UNUSED(type); - UNUSED(rdclass); - - RETERR(uint16_tobuffer(naptr->order, target)); - RETERR(uint16_tobuffer(naptr->preference, target)); - RETERR(uint8_tobuffer(naptr->flags_len, target)); - RETERR(mem_tobuffer(target, naptr->flags, naptr->flags_len)); - RETERR(uint8_tobuffer(naptr->service_len, target)); - RETERR(mem_tobuffer(target, naptr->service, naptr->service_len)); - RETERR(uint8_tobuffer(naptr->regexp_len, target)); - RETERR(mem_tobuffer(target, naptr->regexp, naptr->regexp_len)); - dns_name_toregion(&naptr->replacement, ®ion); - return (isc_buffer_copyregion(target, ®ion)); -} - -static inline isc_result_t -tostruct_in_naptr(ARGS_TOSTRUCT) { - dns_rdata_in_naptr_t *naptr = target; - isc_region_t r; - isc_result_t result; - dns_name_t name; - - REQUIRE(rdata->type == 35); - REQUIRE(rdata->rdclass == 1); - REQUIRE(target != NULL); - REQUIRE(rdata->length != 0); - - naptr->common.rdclass = rdata->rdclass; - naptr->common.rdtype = rdata->type; - ISC_LINK_INIT(&naptr->common, link); - - naptr->flags = NULL; - naptr->service = NULL; - naptr->regexp = NULL; - - dns_rdata_toregion(rdata, &r); - - naptr->order = uint16_fromregion(&r); - isc_region_consume(&r, 2); - - naptr->preference = uint16_fromregion(&r); - isc_region_consume(&r, 2); - - naptr->flags_len = uint8_fromregion(&r); - isc_region_consume(&r, 1); - INSIST(naptr->flags_len <= r.length); - naptr->flags = mem_maybedup(mctx, r.base, naptr->flags_len); - if (naptr->flags == NULL) - goto cleanup; - isc_region_consume(&r, naptr->flags_len); - - naptr->service_len = uint8_fromregion(&r); - isc_region_consume(&r, 1); - INSIST(naptr->service_len <= r.length); - naptr->service = mem_maybedup(mctx, r.base, naptr->service_len); - if (naptr->service == NULL) - goto cleanup; - isc_region_consume(&r, naptr->service_len); - - naptr->regexp_len = uint8_fromregion(&r); - isc_region_consume(&r, 1); - INSIST(naptr->regexp_len <= r.length); - naptr->regexp = mem_maybedup(mctx, r.base, naptr->regexp_len); - if (naptr->regexp == NULL) - goto cleanup; - isc_region_consume(&r, naptr->regexp_len); - - dns_name_init(&name, NULL); - dns_name_fromregion(&name, &r); - dns_name_init(&naptr->replacement, NULL); - result = name_duporclone(&name, mctx, &naptr->replacement); - if (result != ISC_R_SUCCESS) - goto cleanup; - naptr->mctx = mctx; - return (ISC_R_SUCCESS); - - cleanup: - if (mctx != NULL && naptr->flags != NULL) - isc_mem_free(mctx, naptr->flags); - if (mctx != NULL && naptr->service != NULL) - isc_mem_free(mctx, naptr->service); - if (mctx != NULL && naptr->regexp != NULL) - isc_mem_free(mctx, naptr->regexp); - return (ISC_R_NOMEMORY); -} - -static inline void -freestruct_in_naptr(ARGS_FREESTRUCT) { - dns_rdata_in_naptr_t *naptr = source; - - REQUIRE(source != NULL); - REQUIRE(naptr->common.rdclass == 1); - REQUIRE(naptr->common.rdtype == 35); - - if (naptr->mctx == NULL) - return; - - if (naptr->flags != NULL) - isc_mem_free(naptr->mctx, naptr->flags); - if (naptr->service != NULL) - isc_mem_free(naptr->mctx, naptr->service); - if (naptr->regexp != NULL) - isc_mem_free(naptr->mctx, naptr->regexp); - dns_name_free(&naptr->replacement, naptr->mctx); - naptr->mctx = NULL; -} - -static inline isc_result_t -additionaldata_in_naptr(ARGS_ADDLDATA) { - dns_name_t name; - dns_offsets_t offsets; - isc_region_t sr; - dns_rdatatype_t atype; - unsigned int i, flagslen; - char *cp; - - REQUIRE(rdata->type == 35); - REQUIRE(rdata->rdclass == 1); - - /* - * Order, preference. - */ - dns_rdata_toregion(rdata, &sr); - isc_region_consume(&sr, 4); - - /* - * Flags. - */ - atype = 0; - flagslen = sr.base[0]; - cp = (char *)&sr.base[1]; - for (i = 0; i < flagslen; i++, cp++) { - if (*cp == 'S' || *cp == 's') { - atype = dns_rdatatype_srv; - break; - } - if (*cp == 'A' || *cp == 'a') { - atype = dns_rdatatype_a; - break; - } - } - isc_region_consume(&sr, flagslen + 1); - - /* - * Service. - */ - isc_region_consume(&sr, sr.base[0] + 1); - - /* - * Regexp. - */ - isc_region_consume(&sr, sr.base[0] + 1); - - /* - * Replacement. - */ - dns_name_init(&name, offsets); - dns_name_fromregion(&name, &sr); - - if (atype != 0) - return ((add)(arg, &name, atype)); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_in_naptr(ARGS_DIGEST) { - isc_region_t r1, r2; - unsigned int length, n; - isc_result_t result; - dns_name_t name; - - REQUIRE(rdata->type == 35); - REQUIRE(rdata->rdclass == 1); - - dns_rdata_toregion(rdata, &r1); - r2 = r1; - length = 0; - - /* - * Order, preference. - */ - length += 4; - isc_region_consume(&r2, 4); - - /* - * Flags. - */ - n = r2.base[0] + 1; - length += n; - isc_region_consume(&r2, n); - - /* - * Service. - */ - n = r2.base[0] + 1; - length += n; - isc_region_consume(&r2, n); - - /* - * Regexp. - */ - n = r2.base[0] + 1; - length += n; - isc_region_consume(&r2, n); - - /* - * Digest the RR up to the replacement name. - */ - r1.length = length; - result = (digest)(arg, &r1); - if (result != ISC_R_SUCCESS) - return (result); - - /* - * Replacement. - */ - - dns_name_init(&name, NULL); - dns_name_fromregion(&name, &r2); - - return (dns_name_digest(&name, digest, arg)); -} - -static inline isc_boolean_t -checkowner_in_naptr(ARGS_CHECKOWNER) { - - REQUIRE(type == 35); - REQUIRE(rdclass == 1); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_in_naptr(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 35); - REQUIRE(rdata->rdclass == 1); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_IN_1_NAPTR_35_C */ diff --git a/contrib/bind9/lib/dns/rdata/in_1/naptr_35.h b/contrib/bind9/lib/dns/rdata/in_1/naptr_35.h deleted file mode 100644 index 2578b48..0000000 --- a/contrib/bind9/lib/dns/rdata/in_1/naptr_35.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef IN_1_NAPTR_35_H -#define IN_1_NAPTR_35_H 1 - -/* $Id: naptr_35.h,v 1.19.18.2 2005/04/29 00:16:42 marka Exp $ */ - -/*! - * \brief Per RFC2915 */ - -typedef struct dns_rdata_in_naptr { - dns_rdatacommon_t common; - isc_mem_t *mctx; - isc_uint16_t order; - isc_uint16_t preference; - char *flags; - isc_uint8_t flags_len; - char *service; - isc_uint8_t service_len; - char *regexp; - isc_uint8_t regexp_len; - dns_name_t replacement; -} dns_rdata_in_naptr_t; - -#endif /* IN_1_NAPTR_35_H */ diff --git a/contrib/bind9/lib/dns/rdata/in_1/nsap-ptr_23.c b/contrib/bind9/lib/dns/rdata/in_1/nsap-ptr_23.c deleted file mode 100644 index 1a65cbe..0000000 --- a/contrib/bind9/lib/dns/rdata/in_1/nsap-ptr_23.c +++ /dev/null @@ -1,245 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: nsap-ptr_23.c,v 1.34.18.2 2005/04/29 00:16:42 marka Exp $ */ - -/* Reviewed: Fri Mar 17 10:16:02 PST 2000 by gson */ - -/* RFC1348. Obsoleted in RFC 1706 - use PTR instead. */ - -#ifndef RDATA_IN_1_NSAP_PTR_23_C -#define RDATA_IN_1_NSAP_PTR_23_C - -#define RRTYPE_NSAP_PTR_ATTRIBUTES (0) - -static inline isc_result_t -fromtext_in_nsap_ptr(ARGS_FROMTEXT) { - isc_token_t token; - dns_name_t name; - isc_buffer_t buffer; - - REQUIRE(type == 23); - REQUIRE(rdclass == 1); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(callbacks); - - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - - dns_name_init(&name, NULL); - buffer_fromregion(&buffer, &token.value.as_region); - origin = (origin != NULL) ? origin : dns_rootname; - RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target)); - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -totext_in_nsap_ptr(ARGS_TOTEXT) { - isc_region_t region; - dns_name_t name; - dns_name_t prefix; - isc_boolean_t sub; - - REQUIRE(rdata->type == 23); - REQUIRE(rdata->rdclass == 1); - REQUIRE(rdata->length != 0); - - dns_name_init(&name, NULL); - dns_name_init(&prefix, NULL); - - dns_rdata_toregion(rdata, ®ion); - dns_name_fromregion(&name, ®ion); - - sub = name_prefix(&name, tctx->origin, &prefix); - - return (dns_name_totext(&prefix, sub, target)); -} - -static inline isc_result_t -fromwire_in_nsap_ptr(ARGS_FROMWIRE) { - dns_name_t name; - - REQUIRE(type == 23); - REQUIRE(rdclass == 1); - - UNUSED(type); - UNUSED(rdclass); - - dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE); - - dns_name_init(&name, NULL); - return (dns_name_fromwire(&name, source, dctx, options, target)); -} - -static inline isc_result_t -towire_in_nsap_ptr(ARGS_TOWIRE) { - dns_name_t name; - dns_offsets_t offsets; - isc_region_t region; - - REQUIRE(rdata->type == 23); - REQUIRE(rdata->rdclass == 1); - REQUIRE(rdata->length != 0); - - dns_compress_setmethods(cctx, DNS_COMPRESS_NONE); - dns_name_init(&name, offsets); - dns_rdata_toregion(rdata, ®ion); - dns_name_fromregion(&name, ®ion); - - return (dns_name_towire(&name, cctx, target)); -} - -static inline int -compare_in_nsap_ptr(ARGS_COMPARE) { - dns_name_t name1; - dns_name_t name2; - isc_region_t region1; - isc_region_t region2; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 23); - REQUIRE(rdata1->rdclass == 1); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - dns_name_init(&name1, NULL); - dns_name_init(&name2, NULL); - - dns_rdata_toregion(rdata1, ®ion1); - dns_rdata_toregion(rdata2, ®ion2); - - dns_name_fromregion(&name1, ®ion1); - dns_name_fromregion(&name2, ®ion2); - - return (dns_name_rdatacompare(&name1, &name2)); -} - -static inline isc_result_t -fromstruct_in_nsap_ptr(ARGS_FROMSTRUCT) { - dns_rdata_in_nsap_ptr_t *nsap_ptr = source; - isc_region_t region; - - REQUIRE(type == 23); - REQUIRE(rdclass == 1); - REQUIRE(source != NULL); - REQUIRE(nsap_ptr->common.rdtype == type); - REQUIRE(nsap_ptr->common.rdclass == rdclass); - - UNUSED(type); - UNUSED(rdclass); - - dns_name_toregion(&nsap_ptr->owner, ®ion); - return (isc_buffer_copyregion(target, ®ion)); -} - -static inline isc_result_t -tostruct_in_nsap_ptr(ARGS_TOSTRUCT) { - isc_region_t region; - dns_rdata_in_nsap_ptr_t *nsap_ptr = target; - dns_name_t name; - - REQUIRE(rdata->type == 23); - REQUIRE(rdata->rdclass == 1); - REQUIRE(target != NULL); - REQUIRE(rdata->length != 0); - - nsap_ptr->common.rdclass = rdata->rdclass; - nsap_ptr->common.rdtype = rdata->type; - ISC_LINK_INIT(&nsap_ptr->common, link); - - dns_name_init(&name, NULL); - dns_rdata_toregion(rdata, ®ion); - dns_name_fromregion(&name, ®ion); - dns_name_init(&nsap_ptr->owner, NULL); - RETERR(name_duporclone(&name, mctx, &nsap_ptr->owner)); - nsap_ptr->mctx = mctx; - return (ISC_R_SUCCESS); -} - -static inline void -freestruct_in_nsap_ptr(ARGS_FREESTRUCT) { - dns_rdata_in_nsap_ptr_t *nsap_ptr = source; - - REQUIRE(source != NULL); - REQUIRE(nsap_ptr->common.rdclass == 1); - REQUIRE(nsap_ptr->common.rdtype == 23); - - if (nsap_ptr->mctx == NULL) - return; - - dns_name_free(&nsap_ptr->owner, nsap_ptr->mctx); - nsap_ptr->mctx = NULL; -} - -static inline isc_result_t -additionaldata_in_nsap_ptr(ARGS_ADDLDATA) { - REQUIRE(rdata->type == 23); - REQUIRE(rdata->rdclass == 1); - - UNUSED(rdata); - UNUSED(add); - UNUSED(arg); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_in_nsap_ptr(ARGS_DIGEST) { - isc_region_t r; - dns_name_t name; - - REQUIRE(rdata->type == 23); - REQUIRE(rdata->rdclass == 1); - - dns_rdata_toregion(rdata, &r); - dns_name_init(&name, NULL); - dns_name_fromregion(&name, &r); - - return (dns_name_digest(&name, digest, arg)); -} - -static inline isc_boolean_t -checkowner_in_nsap_ptr(ARGS_CHECKOWNER) { - - REQUIRE(type == 23); - REQUIRE(rdclass == 1); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_in_nsap_ptr(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 23); - REQUIRE(rdata->rdclass == 1); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_IN_1_NSAP_PTR_23_C */ diff --git a/contrib/bind9/lib/dns/rdata/in_1/nsap-ptr_23.h b/contrib/bind9/lib/dns/rdata/in_1/nsap-ptr_23.h deleted file mode 100644 index bd8e025..0000000 --- a/contrib/bind9/lib/dns/rdata/in_1/nsap-ptr_23.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef IN_1_NSAP_PTR_23_H -#define IN_1_NSAP_PTR_23_H 1 - -/* $Id: nsap-ptr_23.h,v 1.15.18.2 2005/04/29 00:16:43 marka Exp $ */ - -/*! - * \brief Per RFC1348. Obsoleted in RFC 1706 - use PTR instead. */ - -typedef struct dns_rdata_in_nsap_ptr { - dns_rdatacommon_t common; - isc_mem_t *mctx; - dns_name_t owner; -} dns_rdata_in_nsap_ptr_t; - -#endif /* IN_1_NSAP_PTR_23_H */ diff --git a/contrib/bind9/lib/dns/rdata/in_1/nsap_22.c b/contrib/bind9/lib/dns/rdata/in_1/nsap_22.c deleted file mode 100644 index a348a30..0000000 --- a/contrib/bind9/lib/dns/rdata/in_1/nsap_22.c +++ /dev/null @@ -1,255 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2002 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: nsap_22.c,v 1.38.18.2 2005/04/29 00:16:43 marka Exp $ */ - -/* Reviewed: Fri Mar 17 10:41:07 PST 2000 by gson */ - -/* RFC1706 */ - -#ifndef RDATA_IN_1_NSAP_22_C -#define RDATA_IN_1_NSAP_22_C - -#define RRTYPE_NSAP_ATTRIBUTES (0) - -static inline isc_result_t -fromtext_in_nsap(ARGS_FROMTEXT) { - isc_token_t token; - isc_textregion_t *sr; - int n; - int digits; - unsigned char c = 0; - - REQUIRE(type == 22); - REQUIRE(rdclass == 1); - - UNUSED(type); - UNUSED(origin); - UNUSED(options); - UNUSED(rdclass); - UNUSED(callbacks); - - /* 0x<hex.string.with.periods> */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - sr = &token.value.as_textregion; - if (sr->length < 2) - RETTOK(ISC_R_UNEXPECTEDEND); - if (sr->base[0] != '0' || (sr->base[1] != 'x' && sr->base[1] != 'X')) - RETTOK(DNS_R_SYNTAX); - isc_textregion_consume(sr, 2); - digits = 0; - n = 0; - while (sr->length > 0) { - if (sr->base[0] == '.') { - isc_textregion_consume(sr, 1); - continue; - } - if ((n = hexvalue(sr->base[0])) == -1) - RETTOK(DNS_R_SYNTAX); - c <<= 4; - c += n; - if (++digits == 2) { - RETERR(mem_tobuffer(target, &c, 1)); - digits = 0; - } - isc_textregion_consume(sr, 1); - } - if (digits) - RETTOK(ISC_R_UNEXPECTEDEND); - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -totext_in_nsap(ARGS_TOTEXT) { - isc_region_t region; - char buf[sizeof("xx")]; - - REQUIRE(rdata->type == 22); - REQUIRE(rdata->rdclass == 1); - REQUIRE(rdata->length != 0); - - UNUSED(tctx); - - dns_rdata_toregion(rdata, ®ion); - RETERR(str_totext("0x", target)); - while (region.length != 0) { - sprintf(buf, "%02x", region.base[0]); - isc_region_consume(®ion, 1); - RETERR(str_totext(buf, target)); - } - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -fromwire_in_nsap(ARGS_FROMWIRE) { - isc_region_t region; - - REQUIRE(type == 22); - REQUIRE(rdclass == 1); - - UNUSED(type); - UNUSED(dctx); - UNUSED(options); - UNUSED(rdclass); - - isc_buffer_activeregion(source, ®ion); - if (region.length < 1) - return (ISC_R_UNEXPECTEDEND); - - RETERR(mem_tobuffer(target, region.base, region.length)); - isc_buffer_forward(source, region.length); - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -towire_in_nsap(ARGS_TOWIRE) { - REQUIRE(rdata->type == 22); - REQUIRE(rdata->rdclass == 1); - REQUIRE(rdata->length != 0); - - UNUSED(cctx); - - return (mem_tobuffer(target, rdata->data, rdata->length)); -} - -static inline int -compare_in_nsap(ARGS_COMPARE) { - isc_region_t r1; - isc_region_t r2; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 22); - REQUIRE(rdata1->rdclass == 1); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - dns_rdata_toregion(rdata1, &r1); - dns_rdata_toregion(rdata2, &r2); - return (isc_region_compare(&r1, &r2)); -} - -static inline isc_result_t -fromstruct_in_nsap(ARGS_FROMSTRUCT) { - dns_rdata_in_nsap_t *nsap = source; - - REQUIRE(type == 22); - REQUIRE(rdclass == 1); - REQUIRE(source != NULL); - REQUIRE(nsap->common.rdtype == type); - REQUIRE(nsap->common.rdclass == rdclass); - REQUIRE(nsap->nsap != NULL || nsap->nsap_len == 0); - - UNUSED(type); - UNUSED(rdclass); - - return (mem_tobuffer(target, nsap->nsap, nsap->nsap_len)); -} - -static inline isc_result_t -tostruct_in_nsap(ARGS_TOSTRUCT) { - dns_rdata_in_nsap_t *nsap = target; - isc_region_t r; - - REQUIRE(rdata->type == 22); - REQUIRE(rdata->rdclass == 1); - REQUIRE(target != NULL); - REQUIRE(rdata->length != 0); - - nsap->common.rdclass = rdata->rdclass; - nsap->common.rdtype = rdata->type; - ISC_LINK_INIT(&nsap->common, link); - - dns_rdata_toregion(rdata, &r); - nsap->nsap_len = r.length; - nsap->nsap = mem_maybedup(mctx, r.base, r.length); - if (nsap->nsap == NULL) - return (ISC_R_NOMEMORY); - - nsap->mctx = mctx; - return (ISC_R_SUCCESS); -} - -static inline void -freestruct_in_nsap(ARGS_FREESTRUCT) { - dns_rdata_in_nsap_t *nsap = source; - - REQUIRE(source != NULL); - REQUIRE(nsap->common.rdclass == 1); - REQUIRE(nsap->common.rdtype == 22); - - if (nsap->mctx == NULL) - return; - - if (nsap->nsap != NULL) - isc_mem_free(nsap->mctx, nsap->nsap); - nsap->mctx = NULL; -} - -static inline isc_result_t -additionaldata_in_nsap(ARGS_ADDLDATA) { - REQUIRE(rdata->type == 22); - REQUIRE(rdata->rdclass == 1); - - UNUSED(rdata); - UNUSED(add); - UNUSED(arg); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_in_nsap(ARGS_DIGEST) { - isc_region_t r; - - REQUIRE(rdata->type == 22); - REQUIRE(rdata->rdclass == 1); - - dns_rdata_toregion(rdata, &r); - - return ((digest)(arg, &r)); -} - -static inline isc_boolean_t -checkowner_in_nsap(ARGS_CHECKOWNER) { - - REQUIRE(type == 22); - REQUIRE(rdclass == 1); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_in_nsap(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 22); - REQUIRE(rdata->rdclass == 1); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_IN_1_NSAP_22_C */ diff --git a/contrib/bind9/lib/dns/rdata/in_1/nsap_22.h b/contrib/bind9/lib/dns/rdata/in_1/nsap_22.h deleted file mode 100644 index 583fbac..0000000 --- a/contrib/bind9/lib/dns/rdata/in_1/nsap_22.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef IN_1_NSAP_22_H -#define IN_1_NSAP_22_H 1 - -/* $Id: nsap_22.h,v 1.14.18.2 2005/04/29 00:16:43 marka Exp $ */ - -/*! - * \brief Per RFC1706 */ - -typedef struct dns_rdata_in_nsap { - dns_rdatacommon_t common; - isc_mem_t *mctx; - unsigned char *nsap; - isc_uint16_t nsap_len; -} dns_rdata_in_nsap_t; - -#endif /* IN_1_NSAP_22_H */ diff --git a/contrib/bind9/lib/dns/rdata/in_1/px_26.c b/contrib/bind9/lib/dns/rdata/in_1/px_26.c deleted file mode 100644 index 3df9b99..0000000 --- a/contrib/bind9/lib/dns/rdata/in_1/px_26.c +++ /dev/null @@ -1,374 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001, 2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: px_26.c,v 1.39.18.2 2005/04/29 00:16:43 marka Exp $ */ - -/* Reviewed: Mon Mar 20 10:44:27 PST 2000 */ - -/* RFC2163 */ - -#ifndef RDATA_IN_1_PX_26_C -#define RDATA_IN_1_PX_26_C - -#define RRTYPE_PX_ATTRIBUTES (0) - -static inline isc_result_t -fromtext_in_px(ARGS_FROMTEXT) { - isc_token_t token; - dns_name_t name; - isc_buffer_t buffer; - - REQUIRE(type == 26); - REQUIRE(rdclass == 1); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(callbacks); - - /* - * Preference. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - if (token.value.as_ulong > 0xffffU) - RETTOK(ISC_R_RANGE); - RETERR(uint16_tobuffer(token.value.as_ulong, target)); - - /* - * MAP822. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - dns_name_init(&name, NULL); - buffer_fromregion(&buffer, &token.value.as_region); - origin = (origin != NULL) ? origin : dns_rootname; - RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target)); - - /* - * MAPX400. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - dns_name_init(&name, NULL); - buffer_fromregion(&buffer, &token.value.as_region); - origin = (origin != NULL) ? origin : dns_rootname; - RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target)); - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -totext_in_px(ARGS_TOTEXT) { - isc_region_t region; - dns_name_t name; - dns_name_t prefix; - isc_boolean_t sub; - char buf[sizeof("64000")]; - unsigned short num; - - REQUIRE(rdata->type == 26); - REQUIRE(rdata->rdclass == 1); - REQUIRE(rdata->length != 0); - - dns_name_init(&name, NULL); - dns_name_init(&prefix, NULL); - - /* - * Preference. - */ - dns_rdata_toregion(rdata, ®ion); - num = uint16_fromregion(®ion); - isc_region_consume(®ion, 2); - sprintf(buf, "%u", num); - RETERR(str_totext(buf, target)); - RETERR(str_totext(" ", target)); - - /* - * MAP822. - */ - dns_name_fromregion(&name, ®ion); - sub = name_prefix(&name, tctx->origin, &prefix); - isc_region_consume(®ion, name_length(&name)); - RETERR(dns_name_totext(&prefix, sub, target)); - RETERR(str_totext(" ", target)); - - /* - * MAPX400. - */ - dns_name_fromregion(&name, ®ion); - sub = name_prefix(&name, tctx->origin, &prefix); - return(dns_name_totext(&prefix, sub, target)); -} - -static inline isc_result_t -fromwire_in_px(ARGS_FROMWIRE) { - dns_name_t name; - isc_region_t sregion; - - REQUIRE(type == 26); - REQUIRE(rdclass == 1); - - UNUSED(type); - UNUSED(rdclass); - - dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE); - - dns_name_init(&name, NULL); - - /* - * Preference. - */ - isc_buffer_activeregion(source, &sregion); - if (sregion.length < 2) - return (ISC_R_UNEXPECTEDEND); - RETERR(mem_tobuffer(target, sregion.base, 2)); - isc_buffer_forward(source, 2); - - /* - * MAP822. - */ - RETERR(dns_name_fromwire(&name, source, dctx, options, target)); - - /* - * MAPX400. - */ - return (dns_name_fromwire(&name, source, dctx, options, target)); -} - -static inline isc_result_t -towire_in_px(ARGS_TOWIRE) { - dns_name_t name; - dns_offsets_t offsets; - isc_region_t region; - - REQUIRE(rdata->type == 26); - REQUIRE(rdata->rdclass == 1); - REQUIRE(rdata->length != 0); - - dns_compress_setmethods(cctx, DNS_COMPRESS_NONE); - /* - * Preference. - */ - dns_rdata_toregion(rdata, ®ion); - RETERR(mem_tobuffer(target, region.base, 2)); - isc_region_consume(®ion, 2); - - /* - * MAP822. - */ - dns_name_init(&name, offsets); - dns_name_fromregion(&name, ®ion); - RETERR(dns_name_towire(&name, cctx, target)); - isc_region_consume(®ion, name_length(&name)); - - /* - * MAPX400. - */ - dns_name_init(&name, offsets); - dns_name_fromregion(&name, ®ion); - return (dns_name_towire(&name, cctx, target)); -} - -static inline int -compare_in_px(ARGS_COMPARE) { - dns_name_t name1; - dns_name_t name2; - isc_region_t region1; - isc_region_t region2; - int order; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 26); - REQUIRE(rdata1->rdclass == 1); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - order = memcmp(rdata1->data, rdata2->data, 2); - if (order != 0) - return (order < 0 ? -1 : 1); - - dns_name_init(&name1, NULL); - dns_name_init(&name2, NULL); - - dns_rdata_toregion(rdata1, ®ion1); - dns_rdata_toregion(rdata2, ®ion2); - - isc_region_consume(®ion1, 2); - isc_region_consume(®ion2, 2); - - dns_name_fromregion(&name1, ®ion1); - dns_name_fromregion(&name2, ®ion2); - - order = dns_name_rdatacompare(&name1, &name2); - if (order != 0) - return (order); - - isc_region_consume(®ion1, name_length(&name1)); - isc_region_consume(®ion2, name_length(&name2)); - - dns_name_fromregion(&name1, ®ion1); - dns_name_fromregion(&name2, ®ion2); - - return (dns_name_rdatacompare(&name1, &name2)); -} - -static inline isc_result_t -fromstruct_in_px(ARGS_FROMSTRUCT) { - dns_rdata_in_px_t *px = source; - isc_region_t region; - - REQUIRE(type == 26); - REQUIRE(rdclass == 1); - REQUIRE(source != NULL); - REQUIRE(px->common.rdtype == type); - REQUIRE(px->common.rdclass == rdclass); - - UNUSED(type); - UNUSED(rdclass); - - RETERR(uint16_tobuffer(px->preference, target)); - dns_name_toregion(&px->map822, ®ion); - RETERR(isc_buffer_copyregion(target, ®ion)); - dns_name_toregion(&px->mapx400, ®ion); - return (isc_buffer_copyregion(target, ®ion)); -} - -static inline isc_result_t -tostruct_in_px(ARGS_TOSTRUCT) { - dns_rdata_in_px_t *px = target; - dns_name_t name; - isc_region_t region; - isc_result_t result; - - REQUIRE(rdata->type == 26); - REQUIRE(rdata->rdclass == 1); - REQUIRE(target != NULL); - REQUIRE(rdata->length != 0); - - px->common.rdclass = rdata->rdclass; - px->common.rdtype = rdata->type; - ISC_LINK_INIT(&px->common, link); - - dns_name_init(&name, NULL); - dns_rdata_toregion(rdata, ®ion); - - px->preference = uint16_fromregion(®ion); - isc_region_consume(®ion, 2); - - dns_name_fromregion(&name, ®ion); - - dns_name_init(&px->map822, NULL); - RETERR(name_duporclone(&name, mctx, &px->map822)); - isc_region_consume(®ion, name_length(&px->map822)); - - dns_name_init(&px->mapx400, NULL); - result = name_duporclone(&name, mctx, &px->mapx400); - if (result != ISC_R_SUCCESS) - goto cleanup; - - px->mctx = mctx; - return (result); - - cleanup: - dns_name_free(&px->map822, mctx); - return (ISC_R_NOMEMORY); -} - -static inline void -freestruct_in_px(ARGS_FREESTRUCT) { - dns_rdata_in_px_t *px = source; - - REQUIRE(source != NULL); - REQUIRE(px->common.rdclass == 1); - REQUIRE(px->common.rdtype == 26); - - if (px->mctx == NULL) - return; - - dns_name_free(&px->map822, px->mctx); - dns_name_free(&px->mapx400, px->mctx); - px->mctx = NULL; -} - -static inline isc_result_t -additionaldata_in_px(ARGS_ADDLDATA) { - REQUIRE(rdata->type == 26); - REQUIRE(rdata->rdclass == 1); - - UNUSED(rdata); - UNUSED(add); - UNUSED(arg); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_in_px(ARGS_DIGEST) { - isc_region_t r1, r2; - dns_name_t name; - isc_result_t result; - - REQUIRE(rdata->type == 26); - REQUIRE(rdata->rdclass == 1); - - dns_rdata_toregion(rdata, &r1); - r2 = r1; - isc_region_consume(&r2, 2); - r1.length = 2; - result = (digest)(arg, &r1); - if (result != ISC_R_SUCCESS) - return (result); - dns_name_init(&name, NULL); - dns_name_fromregion(&name, &r2); - result = dns_name_digest(&name, digest, arg); - if (result != ISC_R_SUCCESS) - return (result); - isc_region_consume(&r2, name_length(&name)); - dns_name_init(&name, NULL); - dns_name_fromregion(&name, &r2); - - return (dns_name_digest(&name, digest, arg)); -} - -static inline isc_boolean_t -checkowner_in_px(ARGS_CHECKOWNER) { - - REQUIRE(type == 26); - REQUIRE(rdclass == 1); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_in_px(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 26); - REQUIRE(rdata->rdclass == 1); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_IN_1_PX_26_C */ diff --git a/contrib/bind9/lib/dns/rdata/in_1/px_26.h b/contrib/bind9/lib/dns/rdata/in_1/px_26.h deleted file mode 100644 index a38d5f81..0000000 --- a/contrib/bind9/lib/dns/rdata/in_1/px_26.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef IN_1_PX_26_H -#define IN_1_PX_26_H 1 - -/* $Id: px_26.h,v 1.15.18.2 2005/04/29 00:16:43 marka Exp $ */ - -/*! - * \brief Per RFC2163 */ - -typedef struct dns_rdata_in_px { - dns_rdatacommon_t common; - isc_mem_t *mctx; - isc_uint16_t preference; - dns_name_t map822; - dns_name_t mapx400; -} dns_rdata_in_px_t; - -#endif /* IN_1_PX_26_H */ diff --git a/contrib/bind9/lib/dns/rdata/in_1/srv_33.c b/contrib/bind9/lib/dns/rdata/in_1/srv_33.c deleted file mode 100644 index 2925a77..0000000 --- a/contrib/bind9/lib/dns/rdata/in_1/srv_33.c +++ /dev/null @@ -1,373 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001, 2003 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: srv_33.c,v 1.41.18.2 2005/04/29 00:16:43 marka Exp $ */ - -/* Reviewed: Fri Mar 17 13:01:00 PST 2000 by bwelling */ - -/* RFC2782 */ - -#ifndef RDATA_IN_1_SRV_33_C -#define RDATA_IN_1_SRV_33_C - -#define RRTYPE_SRV_ATTRIBUTES (0) - -static inline isc_result_t -fromtext_in_srv(ARGS_FROMTEXT) { - isc_token_t token; - dns_name_t name; - isc_buffer_t buffer; - isc_boolean_t ok; - - REQUIRE(type == 33); - REQUIRE(rdclass == 1); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(callbacks); - - /* - * Priority. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - if (token.value.as_ulong > 0xffffU) - RETTOK(ISC_R_RANGE); - RETERR(uint16_tobuffer(token.value.as_ulong, target)); - - /* - * Weight. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - if (token.value.as_ulong > 0xffffU) - RETTOK(ISC_R_RANGE); - RETERR(uint16_tobuffer(token.value.as_ulong, target)); - - /* - * Port. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, - ISC_FALSE)); - if (token.value.as_ulong > 0xffffU) - RETTOK(ISC_R_RANGE); - RETERR(uint16_tobuffer(token.value.as_ulong, target)); - - /* - * Target. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - dns_name_init(&name, NULL); - buffer_fromregion(&buffer, &token.value.as_region); - origin = (origin != NULL) ? origin : dns_rootname; - RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target)); - ok = ISC_TRUE; - if ((options & DNS_RDATA_CHECKNAMES) != 0) - ok = dns_name_ishostname(&name, ISC_FALSE); - if (!ok && (options & DNS_RDATA_CHECKNAMESFAIL) != 0) - RETTOK(DNS_R_BADNAME); - if (!ok && callbacks != NULL) - warn_badname(&name, lexer, callbacks); - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -totext_in_srv(ARGS_TOTEXT) { - isc_region_t region; - dns_name_t name; - dns_name_t prefix; - isc_boolean_t sub; - char buf[sizeof("64000")]; - unsigned short num; - - REQUIRE(rdata->type == 33); - REQUIRE(rdata->rdclass == 1); - REQUIRE(rdata->length != 0); - - dns_name_init(&name, NULL); - dns_name_init(&prefix, NULL); - - /* - * Priority. - */ - dns_rdata_toregion(rdata, ®ion); - num = uint16_fromregion(®ion); - isc_region_consume(®ion, 2); - sprintf(buf, "%u", num); - RETERR(str_totext(buf, target)); - RETERR(str_totext(" ", target)); - - /* - * Weight. - */ - num = uint16_fromregion(®ion); - isc_region_consume(®ion, 2); - sprintf(buf, "%u", num); - RETERR(str_totext(buf, target)); - RETERR(str_totext(" ", target)); - - /* - * Port. - */ - num = uint16_fromregion(®ion); - isc_region_consume(®ion, 2); - sprintf(buf, "%u", num); - RETERR(str_totext(buf, target)); - RETERR(str_totext(" ", target)); - - /* - * Target. - */ - dns_name_fromregion(&name, ®ion); - sub = name_prefix(&name, tctx->origin, &prefix); - return (dns_name_totext(&prefix, sub, target)); -} - -static inline isc_result_t -fromwire_in_srv(ARGS_FROMWIRE) { - dns_name_t name; - isc_region_t sr; - - REQUIRE(type == 33); - REQUIRE(rdclass == 1); - - UNUSED(type); - UNUSED(rdclass); - - dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE); - - dns_name_init(&name, NULL); - - /* - * Priority, weight, port. - */ - isc_buffer_activeregion(source, &sr); - if (sr.length < 6) - return (ISC_R_UNEXPECTEDEND); - RETERR(mem_tobuffer(target, sr.base, 6)); - isc_buffer_forward(source, 6); - - /* - * Target. - */ - return (dns_name_fromwire(&name, source, dctx, options, target)); -} - -static inline isc_result_t -towire_in_srv(ARGS_TOWIRE) { - dns_name_t name; - dns_offsets_t offsets; - isc_region_t sr; - - REQUIRE(rdata->type == 33); - REQUIRE(rdata->length != 0); - - dns_compress_setmethods(cctx, DNS_COMPRESS_NONE); - /* - * Priority, weight, port. - */ - dns_rdata_toregion(rdata, &sr); - RETERR(mem_tobuffer(target, sr.base, 6)); - isc_region_consume(&sr, 6); - - /* - * Target. - */ - dns_name_init(&name, offsets); - dns_name_fromregion(&name, &sr); - return (dns_name_towire(&name, cctx, target)); -} - -static inline int -compare_in_srv(ARGS_COMPARE) { - dns_name_t name1; - dns_name_t name2; - isc_region_t region1; - isc_region_t region2; - int order; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 33); - REQUIRE(rdata1->rdclass == 1); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - /* - * Priority, weight, port. - */ - order = memcmp(rdata1->data, rdata2->data, 6); - if (order != 0) - return (order < 0 ? -1 : 1); - - /* - * Target. - */ - dns_name_init(&name1, NULL); - dns_name_init(&name2, NULL); - - dns_rdata_toregion(rdata1, ®ion1); - dns_rdata_toregion(rdata2, ®ion2); - - isc_region_consume(®ion1, 6); - isc_region_consume(®ion2, 6); - - dns_name_fromregion(&name1, ®ion1); - dns_name_fromregion(&name2, ®ion2); - - return (dns_name_rdatacompare(&name1, &name2)); -} - -static inline isc_result_t -fromstruct_in_srv(ARGS_FROMSTRUCT) { - dns_rdata_in_srv_t *srv = source; - isc_region_t region; - - REQUIRE(type == 33); - REQUIRE(rdclass == 1); - REQUIRE(source != NULL); - REQUIRE(srv->common.rdtype == type); - REQUIRE(srv->common.rdclass == rdclass); - - UNUSED(type); - UNUSED(rdclass); - - RETERR(uint16_tobuffer(srv->priority, target)); - RETERR(uint16_tobuffer(srv->weight, target)); - RETERR(uint16_tobuffer(srv->port, target)); - dns_name_toregion(&srv->target, ®ion); - return (isc_buffer_copyregion(target, ®ion)); -} - -static inline isc_result_t -tostruct_in_srv(ARGS_TOSTRUCT) { - isc_region_t region; - dns_rdata_in_srv_t *srv = target; - dns_name_t name; - - REQUIRE(rdata->rdclass == 1); - REQUIRE(rdata->type == 33); - REQUIRE(target != NULL); - REQUIRE(rdata->length != 0); - - srv->common.rdclass = rdata->rdclass; - srv->common.rdtype = rdata->type; - ISC_LINK_INIT(&srv->common, link); - - dns_name_init(&name, NULL); - dns_rdata_toregion(rdata, ®ion); - srv->priority = uint16_fromregion(®ion); - isc_region_consume(®ion, 2); - srv->weight = uint16_fromregion(®ion); - isc_region_consume(®ion, 2); - srv->port = uint16_fromregion(®ion); - isc_region_consume(®ion, 2); - dns_name_fromregion(&name, ®ion); - dns_name_init(&srv->target, NULL); - RETERR(name_duporclone(&name, mctx, &srv->target)); - srv->mctx = mctx; - return (ISC_R_SUCCESS); -} - -static inline void -freestruct_in_srv(ARGS_FREESTRUCT) { - dns_rdata_in_srv_t *srv = source; - - REQUIRE(source != NULL); - REQUIRE(srv->common.rdclass == 1); - REQUIRE(srv->common.rdtype == 33); - - if (srv->mctx == NULL) - return; - - dns_name_free(&srv->target, srv->mctx); - srv->mctx = NULL; -} - -static inline isc_result_t -additionaldata_in_srv(ARGS_ADDLDATA) { - dns_name_t name; - dns_offsets_t offsets; - isc_region_t region; - - REQUIRE(rdata->type == 33); - REQUIRE(rdata->rdclass == 1); - - dns_name_init(&name, offsets); - dns_rdata_toregion(rdata, ®ion); - isc_region_consume(®ion, 6); - dns_name_fromregion(&name, ®ion); - - return ((add)(arg, &name, dns_rdatatype_a)); -} - -static inline isc_result_t -digest_in_srv(ARGS_DIGEST) { - isc_region_t r1, r2; - dns_name_t name; - - REQUIRE(rdata->type == 33); - REQUIRE(rdata->rdclass == 1); - - dns_rdata_toregion(rdata, &r1); - r2 = r1; - isc_region_consume(&r2, 6); - r1.length = 6; - RETERR((digest)(arg, &r1)); - dns_name_init(&name, NULL); - dns_name_fromregion(&name, &r2); - return (dns_name_digest(&name, digest, arg)); -} - -static inline isc_boolean_t -checkowner_in_srv(ARGS_CHECKOWNER) { - - REQUIRE(type == 33); - REQUIRE(rdclass == 1); - - UNUSED(name); - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); - - return (ISC_TRUE); -} - -static inline isc_boolean_t -checknames_in_srv(ARGS_CHECKNAMES) { - isc_region_t region; - dns_name_t name; - - REQUIRE(rdata->type == 33); - REQUIRE(rdata->rdclass == 1); - - UNUSED(owner); - - dns_rdata_toregion(rdata, ®ion); - isc_region_consume(®ion, 6); - dns_name_init(&name, NULL); - dns_name_fromregion(&name, ®ion); - if (!dns_name_ishostname(&name, ISC_FALSE)) { - if (bad != NULL) - dns_name_clone(&name, bad); - return (ISC_FALSE); - } - return (ISC_TRUE); -} - -#endif /* RDATA_IN_1_SRV_33_C */ diff --git a/contrib/bind9/lib/dns/rdata/in_1/srv_33.h b/contrib/bind9/lib/dns/rdata/in_1/srv_33.h deleted file mode 100644 index 7d9fef6..0000000 --- a/contrib/bind9/lib/dns/rdata/in_1/srv_33.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef IN_1_SRV_33_H -#define IN_1_SRV_33_H 1 - -/* $Id: srv_33.h,v 1.15.18.2 2005/04/29 00:16:43 marka Exp $ */ - -/* Reviewed: Fri Mar 17 13:01:00 PST 2000 by bwelling */ - -/*! - * \brief Per RFC2782 */ - -typedef struct dns_rdata_in_srv { - dns_rdatacommon_t common; - isc_mem_t *mctx; - isc_uint16_t priority; - isc_uint16_t weight; - isc_uint16_t port; - dns_name_t target; -} dns_rdata_in_srv_t; - -#endif /* IN_1_SRV_33_H */ diff --git a/contrib/bind9/lib/dns/rdata/in_1/wks_11.c b/contrib/bind9/lib/dns/rdata/in_1/wks_11.c deleted file mode 100644 index 749b8fd..0000000 --- a/contrib/bind9/lib/dns/rdata/in_1/wks_11.c +++ /dev/null @@ -1,349 +0,0 @@ -/* - * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2002 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: wks_11.c,v 1.51.18.1 2004/09/16 01:02:19 marka Exp $ */ - -/* Reviewed: Fri Mar 17 15:01:49 PST 2000 by explorer */ - -#ifndef RDATA_IN_1_WKS_11_C -#define RDATA_IN_1_WKS_11_C - -#include <limits.h> -#include <stdlib.h> - -#include <isc/net.h> -#include <isc/netdb.h> - -#define RRTYPE_WKS_ATTRIBUTES (0) - -static inline isc_result_t -fromtext_in_wks(ARGS_FROMTEXT) { - isc_token_t token; - isc_region_t region; - struct in_addr addr; - struct protoent *pe; - struct servent *se; - char *e; - long proto; - unsigned char bm[8*1024]; /* 64k bits */ - long port; - long maxport = -1; - const char *ps = NULL; - unsigned int n; - char service[32]; - int i; - - REQUIRE(type == 11); - REQUIRE(rdclass == 1); - - UNUSED(type); - UNUSED(origin); - UNUSED(options); - UNUSED(rdclass); - - /* - * IPv4 dotted quad. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - - isc_buffer_availableregion(target, ®ion); - if (getquad(DNS_AS_STR(token), &addr, lexer, callbacks) != 1) - RETTOK(DNS_R_BADDOTTEDQUAD); - if (region.length < 4) - return (ISC_R_NOSPACE); - memcpy(region.base, &addr, 4); - isc_buffer_add(target, 4); - - /* - * Protocol. - */ - RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); - - proto = strtol(DNS_AS_STR(token), &e, 10); - if (*e == 0) - ; - else if ((pe = getprotobyname(DNS_AS_STR(token))) != NULL) - proto = pe->p_proto; - else - RETTOK(DNS_R_UNKNOWNPROTO); - if (proto < 0 || proto > 0xff) - RETTOK(ISC_R_RANGE); - - if (proto == IPPROTO_TCP) - ps = "tcp"; - else if (proto == IPPROTO_UDP) - ps = "udp"; - - RETERR(uint8_tobuffer(proto, target)); - - memset(bm, 0, sizeof(bm)); - do { - RETERR(isc_lex_getmastertoken(lexer, &token, - isc_tokentype_string, ISC_TRUE)); - if (token.type != isc_tokentype_string) - break; - - /* - * Lowercase the service string as some getservbyname() are - * case sensitive and the database is usually in lowercase. - */ - strncpy(service, DNS_AS_STR(token), sizeof(service)); - service[sizeof(service)-1] = '\0'; - for (i = strlen(service) - 1; i >= 0; i--) - if (isupper(service[i]&0xff)) - service[i] = tolower(service[i]&0xff); - - port = strtol(DNS_AS_STR(token), &e, 10); - if (*e == 0) - ; - else if ((se = getservbyname(service, ps)) != NULL) - port = ntohs(se->s_port); - else if ((se = getservbyname(DNS_AS_STR(token), ps)) - != NULL) - port = ntohs(se->s_port); - else - RETTOK(DNS_R_UNKNOWNSERVICE); - if (port < 0 || port > 0xffff) - RETTOK(ISC_R_RANGE); - if (port > maxport) - maxport = port; - bm[port / 8] |= (0x80 >> (port % 8)); - } while (1); - - /* - * Let upper layer handle eol/eof. - */ - isc_lex_ungettoken(lexer, &token); - - n = (maxport + 8) / 8; - return (mem_tobuffer(target, bm, n)); -} - -static inline isc_result_t -totext_in_wks(ARGS_TOTEXT) { - isc_region_t sr; - unsigned short proto; - char buf[sizeof("65535")]; - unsigned int i, j; - - UNUSED(tctx); - - REQUIRE(rdata->type == 11); - REQUIRE(rdata->rdclass == 1); - REQUIRE(rdata->length >= 5); - - dns_rdata_toregion(rdata, &sr); - RETERR(inet_totext(AF_INET, &sr, target)); - isc_region_consume(&sr, 4); - - proto = uint8_fromregion(&sr); - sprintf(buf, "%u", proto); - RETERR(str_totext(" ", target)); - RETERR(str_totext(buf, target)); - isc_region_consume(&sr, 1); - - for (i = 0; i < sr.length; i++) { - if (sr.base[i] != 0) - for (j = 0; j < 8; j++) - if ((sr.base[i] & (0x80 >> j)) != 0) { - sprintf(buf, "%u", i * 8 + j); - RETERR(str_totext(" ", target)); - RETERR(str_totext(buf, target)); - } - } - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -fromwire_in_wks(ARGS_FROMWIRE) { - isc_region_t sr; - isc_region_t tr; - - REQUIRE(type == 11); - REQUIRE(rdclass == 1); - - UNUSED(type); - UNUSED(dctx); - UNUSED(options); - UNUSED(rdclass); - - isc_buffer_activeregion(source, &sr); - isc_buffer_availableregion(target, &tr); - - if (sr.length < 5) - return (ISC_R_UNEXPECTEDEND); - if (sr.length > 8 * 1024 + 5) - return (DNS_R_EXTRADATA); - if (tr.length < sr.length) - return (ISC_R_NOSPACE); - - memcpy(tr.base, sr.base, sr.length); - isc_buffer_add(target, sr.length); - isc_buffer_forward(source, sr.length); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -towire_in_wks(ARGS_TOWIRE) { - isc_region_t sr; - - UNUSED(cctx); - - REQUIRE(rdata->type == 11); - REQUIRE(rdata->rdclass == 1); - REQUIRE(rdata->length != 0); - - dns_rdata_toregion(rdata, &sr); - return (mem_tobuffer(target, sr.base, sr.length)); -} - -static inline int -compare_in_wks(ARGS_COMPARE) { - isc_region_t r1; - isc_region_t r2; - - REQUIRE(rdata1->type == rdata2->type); - REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 11); - REQUIRE(rdata1->rdclass == 1); - REQUIRE(rdata1->length != 0); - REQUIRE(rdata2->length != 0); - - dns_rdata_toregion(rdata1, &r1); - dns_rdata_toregion(rdata2, &r2); - return (isc_region_compare(&r1, &r2)); -} - -static inline isc_result_t -fromstruct_in_wks(ARGS_FROMSTRUCT) { - dns_rdata_in_wks_t *wks = source; - isc_uint32_t a; - - REQUIRE(type == 11); - REQUIRE(rdclass == 1); - REQUIRE(source != NULL); - REQUIRE(wks->common.rdtype == type); - REQUIRE(wks->common.rdclass == rdclass); - REQUIRE(wks->map != NULL || wks->map_len == 0); - - UNUSED(type); - UNUSED(rdclass); - - a = ntohl(wks->in_addr.s_addr); - RETERR(uint32_tobuffer(a, target)); - RETERR(uint16_tobuffer(wks->protocol, target)); - return (mem_tobuffer(target, wks->map, wks->map_len)); -} - -static inline isc_result_t -tostruct_in_wks(ARGS_TOSTRUCT) { - dns_rdata_in_wks_t *wks = target; - isc_uint32_t n; - isc_region_t region; - - REQUIRE(rdata->type == 11); - REQUIRE(rdata->rdclass == 1); - REQUIRE(rdata->length != 0); - - wks->common.rdclass = rdata->rdclass; - wks->common.rdtype = rdata->type; - ISC_LINK_INIT(&wks->common, link); - - dns_rdata_toregion(rdata, ®ion); - n = uint32_fromregion(®ion); - wks->in_addr.s_addr = htonl(n); - isc_region_consume(®ion, 4); - wks->protocol = uint16_fromregion(®ion); - isc_region_consume(®ion, 2); - wks->map_len = region.length; - wks->map = mem_maybedup(mctx, region.base, region.length); - if (wks->map == NULL) - return (ISC_R_NOMEMORY); - wks->mctx = mctx; - return (ISC_R_SUCCESS); -} - -static inline void -freestruct_in_wks(ARGS_FREESTRUCT) { - dns_rdata_in_wks_t *wks = source; - - REQUIRE(source != NULL); - REQUIRE(wks->common.rdtype == 11); - REQUIRE(wks->common.rdclass == 1); - - if (wks->mctx == NULL) - return; - - if (wks->map != NULL) - isc_mem_free(wks->mctx, wks->map); - wks->mctx = NULL; -} - -static inline isc_result_t -additionaldata_in_wks(ARGS_ADDLDATA) { - UNUSED(rdata); - UNUSED(add); - UNUSED(arg); - - REQUIRE(rdata->type == 11); - REQUIRE(rdata->rdclass == 1); - - return (ISC_R_SUCCESS); -} - -static inline isc_result_t -digest_in_wks(ARGS_DIGEST) { - isc_region_t r; - - REQUIRE(rdata->type == 11); - REQUIRE(rdata->rdclass == 1); - - dns_rdata_toregion(rdata, &r); - - return ((digest)(arg, &r)); -} - -static inline isc_boolean_t -checkowner_in_wks(ARGS_CHECKOWNER) { - - REQUIRE(type == 11); - REQUIRE(rdclass == 1); - - UNUSED(type); - UNUSED(rdclass); - - return (dns_name_ishostname(name, wildcard)); -} - -static inline isc_boolean_t -checknames_in_wks(ARGS_CHECKNAMES) { - - REQUIRE(rdata->type == 11); - REQUIRE(rdata->rdclass == 1); - - UNUSED(rdata); - UNUSED(owner); - UNUSED(bad); - - return (ISC_TRUE); -} - -#endif /* RDATA_IN_1_WKS_11_C */ diff --git a/contrib/bind9/lib/dns/rdata/in_1/wks_11.h b/contrib/bind9/lib/dns/rdata/in_1/wks_11.h deleted file mode 100644 index a0093b9..0000000 --- a/contrib/bind9/lib/dns/rdata/in_1/wks_11.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef IN_1_WKS_11_H -#define IN_1_WKS_11_H 1 - -/* $Id: wks_11.h,v 1.20 2004/03/05 05:10:25 marka Exp $ */ - -typedef struct dns_rdata_in_wks { - dns_rdatacommon_t common; - isc_mem_t *mctx; - struct in_addr in_addr; - isc_uint16_t protocol; - unsigned char *map; - isc_uint16_t map_len; -} dns_rdata_in_wks_t; - -#endif /* IN_1_WKS_11_H */ diff --git a/contrib/bind9/lib/dns/rdata/rdatastructpre.h b/contrib/bind9/lib/dns/rdata/rdatastructpre.h deleted file mode 100644 index d641ef5..0000000 --- a/contrib/bind9/lib/dns/rdata/rdatastructpre.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: rdatastructpre.h,v 1.14 2004/03/05 05:10:04 marka Exp $ */ - -#ifndef DNS_RDATASTRUCT_H -#define DNS_RDATASTRUCT_H 1 - -#include <isc/lang.h> -#include <isc/sockaddr.h> - -#include <dns/name.h> -#include <dns/types.h> - -ISC_LANG_BEGINDECLS - -typedef struct dns_rdatacommon { - dns_rdataclass_t rdclass; - dns_rdatatype_t rdtype; - ISC_LINK(struct dns_rdatacommon) link; -} dns_rdatacommon_t; - -#define DNS_RDATACOMMON_INIT(_data, _rdtype, _rdclass) \ - do { \ - (_data)->common.rdtype = (_rdtype); \ - (_data)->common.rdclass = (_rdclass); \ - ISC_LINK_INIT(&(_data)->common, link); \ - } while (0) diff --git a/contrib/bind9/lib/dns/rdata/rdatastructsuf.h b/contrib/bind9/lib/dns/rdata/rdatastructsuf.h deleted file mode 100644 index 1ab1b0a..0000000 --- a/contrib/bind9/lib/dns/rdata/rdatastructsuf.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") - * Copyright (C) 1999-2001 Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: rdatastructsuf.h,v 1.8 2004/03/05 05:10:04 marka Exp $ */ - -ISC_LANG_ENDDECLS - -#endif /* DNS_RDATASTRUCT_H */ |