From ba8f85b49c38af7bc2a9acdef5dcde2de008d25e Mon Sep 17 00:00:00 2001 From: peter Date: Sat, 12 Jul 2008 05:00:28 +0000 Subject: Flatten bind9 vendor work area --- contrib/bind9/lib/bind/resolv/Makefile.in | 34 - contrib/bind9/lib/bind/resolv/herror.c | 129 --- contrib/bind9/lib/bind/resolv/mtctxres.c | 129 --- contrib/bind9/lib/bind/resolv/res_comp.c | 265 ------ contrib/bind9/lib/bind/resolv/res_data.c | 297 ------ contrib/bind9/lib/bind/resolv/res_debug.c | 1165 ----------------------- contrib/bind9/lib/bind/resolv/res_debug.h | 35 - contrib/bind9/lib/bind/resolv/res_findzonecut.c | 722 -------------- contrib/bind9/lib/bind/resolv/res_init.c | 801 ---------------- contrib/bind9/lib/bind/resolv/res_mkquery.c | 257 ----- contrib/bind9/lib/bind/resolv/res_mkupdate.c | 1162 ---------------------- contrib/bind9/lib/bind/resolv/res_mkupdate.h | 25 - contrib/bind9/lib/bind/resolv/res_private.h | 22 - contrib/bind9/lib/bind/resolv/res_query.c | 432 --------- contrib/bind9/lib/bind/resolv/res_send.c | 1094 --------------------- contrib/bind9/lib/bind/resolv/res_sendsigned.c | 170 ---- contrib/bind9/lib/bind/resolv/res_update.c | 213 ----- 17 files changed, 6952 deletions(-) delete mode 100644 contrib/bind9/lib/bind/resolv/Makefile.in delete mode 100644 contrib/bind9/lib/bind/resolv/herror.c delete mode 100644 contrib/bind9/lib/bind/resolv/mtctxres.c delete mode 100644 contrib/bind9/lib/bind/resolv/res_comp.c delete mode 100644 contrib/bind9/lib/bind/resolv/res_data.c delete mode 100644 contrib/bind9/lib/bind/resolv/res_debug.c delete mode 100644 contrib/bind9/lib/bind/resolv/res_debug.h delete mode 100644 contrib/bind9/lib/bind/resolv/res_findzonecut.c delete mode 100644 contrib/bind9/lib/bind/resolv/res_init.c delete mode 100644 contrib/bind9/lib/bind/resolv/res_mkquery.c delete mode 100644 contrib/bind9/lib/bind/resolv/res_mkupdate.c delete mode 100644 contrib/bind9/lib/bind/resolv/res_mkupdate.h delete mode 100644 contrib/bind9/lib/bind/resolv/res_private.h delete mode 100644 contrib/bind9/lib/bind/resolv/res_query.c delete mode 100644 contrib/bind9/lib/bind/resolv/res_send.c delete mode 100644 contrib/bind9/lib/bind/resolv/res_sendsigned.c delete mode 100644 contrib/bind9/lib/bind/resolv/res_update.c (limited to 'contrib/bind9/lib/bind/resolv') diff --git a/contrib/bind9/lib/bind/resolv/Makefile.in b/contrib/bind9/lib/bind/resolv/Makefile.in deleted file mode 100644 index cc661b6..0000000 --- a/contrib/bind9/lib/bind/resolv/Makefile.in +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") -# Copyright (C) 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: Makefile.in,v 1.4.18.2 2005/07/29 00:12:55 marka Exp $ - -srcdir= @srcdir@ -VPATH = @srcdir@ - -OBJS= herror.@O@ mtctxres.@O@ res_comp.@O@ res_data.@O@ res_debug.@O@ \ - res_findzonecut.@O@ res_init.@O@ res_mkquery.@O@ res_mkupdate.@O@ \ - res_query.@O@ res_send.@O@ res_sendsigned.@O@ res_update.@O@ - -SRCS= herror.c mtctxres.c res_comp.c res_data.c res_debug.c \ - res_findzonecut.c res_init.c res_mkquery.c res_mkupdate.c \ - res_query.c res_send.c res_sendsigned.c res_update.c - -TARGETS= ${OBJS} - -CINCLUDES= -I.. -I${srcdir}/../include -CWARNINGS= - -@BIND9_MAKE_RULES@ diff --git a/contrib/bind9/lib/bind/resolv/herror.c b/contrib/bind9/lib/bind/resolv/herror.c deleted file mode 100644 index 9232426..0000000 --- a/contrib/bind9/lib/bind/resolv/herror.c +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (c) 1987, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -/* - * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") - * Portions Copyright (c) 1996-1999 by 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. - */ - -#if defined(LIBC_SCCS) && !defined(lint) -static const char sccsid[] = "@(#)herror.c 8.1 (Berkeley) 6/4/93"; -static const char rcsid[] = "$Id: herror.c,v 1.3.18.1 2005/04/27 05:01:09 sra Exp $"; -#endif /* LIBC_SCCS and not lint */ - -#include "port_before.h" - -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include - -#include "port_after.h" - -const char *h_errlist[] = { - "Resolver Error 0 (no error)", - "Unknown host", /*%< 1 HOST_NOT_FOUND */ - "Host name lookup failure", /*%< 2 TRY_AGAIN */ - "Unknown server error", /*%< 3 NO_RECOVERY */ - "No address associated with name", /*%< 4 NO_ADDRESS */ -}; -int h_nerr = { sizeof h_errlist / sizeof h_errlist[0] }; - -#if !(__GLIBC__ > 2 || __GLIBC__ == 2 && __GLIBC_MINOR__ >= 3) -#undef h_errno -int h_errno; -#endif - -/*% - * herror -- - * print the error indicated by the h_errno value. - */ -void -herror(const char *s) { - struct iovec iov[4], *v = iov; - char *t; - - if (s != NULL && *s != '\0') { - DE_CONST(s, t); - v->iov_base = t; - v->iov_len = strlen(t); - v++; - DE_CONST(": ", t); - v->iov_base = t; - v->iov_len = 2; - v++; - } - DE_CONST(hstrerror(*__h_errno()), t); - v->iov_base = t; - v->iov_len = strlen(v->iov_base); - v++; - DE_CONST("\n", t); - v->iov_base = t; - v->iov_len = 1; - writev(STDERR_FILENO, iov, (v - iov) + 1); -} - -/*% - * hstrerror -- - * return the string associated with a given "host" errno value. - */ -const char * -hstrerror(int err) { - if (err < 0) - return ("Resolver internal error"); - else if (err < h_nerr) - return (h_errlist[err]); - return ("Unknown resolver error"); -} - -/*! \file */ diff --git a/contrib/bind9/lib/bind/resolv/mtctxres.c b/contrib/bind9/lib/bind/resolv/mtctxres.c deleted file mode 100644 index 635bbd4..0000000 --- a/contrib/bind9/lib/bind/resolv/mtctxres.c +++ /dev/null @@ -1,129 +0,0 @@ -#include -#ifdef DO_PTHREADS -#include -#endif -#include -#include -#include -#include -#include -#include -#include - -#ifdef DO_PTHREADS -static pthread_key_t key; -static int mt_key_initialized = 0; - -static int __res_init_ctx(void); -static void __res_destroy_ctx(void *); - -#if defined(sun) && !defined(__GNUC__) -#pragma init (_mtctxres_init) -#endif -#endif - -static mtctxres_t sharedctx; - -#ifdef DO_PTHREADS -/* - * Initialize the TSD key. By doing this at library load time, we're - * implicitly running without interference from other threads, so there's - * no need for locking. - */ -static void -_mtctxres_init(void) { - int pthread_keycreate_ret; - - pthread_keycreate_ret = pthread_key_create(&key, __res_destroy_ctx); - if (pthread_keycreate_ret == 0) - mt_key_initialized = 1; -} -#endif - -/* - * To support binaries that used the private MT-safe interface in - * Solaris 8, we still need to provide the __res_enable_mt() - * and __res_disable_mt() entry points. They're do-nothing routines. - */ -int -__res_enable_mt(void) { - return (-1); -} - -int -__res_disable_mt(void) { - return (0); -} - -#ifdef DO_PTHREADS -static int -__res_init_ctx(void) { - - mtctxres_t *mt; - int ret; - - - if (pthread_getspecific(key) != 0) { - /* Already exists */ - return (0); - } - - if ((mt = malloc(sizeof (mtctxres_t))) == 0) { - errno = ENOMEM; - return (-1); - } - - memset(mt, 0, sizeof (mtctxres_t)); - - if ((ret = pthread_setspecific(key, mt)) != 0) { - free(mt); - errno = ret; - return (-1); - } - - return (0); -} - -static void -__res_destroy_ctx(void *value) { - - mtctxres_t *mt = (mtctxres_t *)value; - - if (mt != 0) - free(mt); -} -#endif - -mtctxres_t * -___mtctxres(void) { -#ifdef DO_PTHREADS - mtctxres_t *mt; - - /* - * This if clause should only be executed if we are linking - * statically. When linked dynamically _mtctxres_init() should - * be called at binding time due the #pragma above. - */ - if (!mt_key_initialized) { - static pthread_mutex_t keylock = PTHREAD_MUTEX_INITIALIZER; - if (pthread_mutex_lock(&keylock) == 0) { - _mtctxres_init(); - (void) pthread_mutex_unlock(&keylock); - } - } - - /* - * If we have already been called in this thread return the existing - * context. Otherwise recreat a new context and return it. If - * that fails return a global context. - */ - if (mt_key_initialized) { - if (((mt = pthread_getspecific(key)) != 0) || - (__res_init_ctx() == 0 && - (mt = pthread_getspecific(key)) != 0)) { - return (mt); - } - } -#endif - return (&sharedctx); -} diff --git a/contrib/bind9/lib/bind/resolv/res_comp.c b/contrib/bind9/lib/bind/resolv/res_comp.c deleted file mode 100644 index 4dc3c2a..0000000 --- a/contrib/bind9/lib/bind/resolv/res_comp.c +++ /dev/null @@ -1,265 +0,0 @@ -/* - * Copyright (c) 1985, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -/* - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * - * 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, and that - * the name of Digital Equipment Corporation not be used in advertising or - * publicity pertaining to distribution of the document or software without - * specific, written prior permission. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT - * CORPORATION 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. - */ - -/* - * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") - * Portions Copyright (c) 1996-1999 by 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. - */ - -#if defined(LIBC_SCCS) && !defined(lint) -static const char sccsid[] = "@(#)res_comp.c 8.1 (Berkeley) 6/4/93"; -static const char rcsid[] = "$Id: res_comp.c,v 1.3.18.2 2005/07/28 07:38:11 marka Exp $"; -#endif /* LIBC_SCCS and not lint */ - -#include "port_before.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "port_after.h" - -/*% - * Expand compressed domain name 'src' to full domain name. - * - * \li 'msg' is a pointer to the begining of the message, - * \li 'eom' points to the first location after the message, - * \li 'dst' is a pointer to a buffer of size 'dstsiz' for the result. - * \li Return size of compressed name or -1 if there was an error. - */ -int -dn_expand(const u_char *msg, const u_char *eom, const u_char *src, - char *dst, int dstsiz) -{ - int n = ns_name_uncompress(msg, eom, src, dst, (size_t)dstsiz); - - if (n > 0 && dst[0] == '.') - dst[0] = '\0'; - return (n); -} - -/*% - * Pack domain name 'exp_dn' in presentation form into 'comp_dn'. - * - * \li Return the size of the compressed name or -1. - * \li 'length' is the size of the array pointed to by 'comp_dn'. - */ -int -dn_comp(const char *src, u_char *dst, int dstsiz, - u_char **dnptrs, u_char **lastdnptr) -{ - return (ns_name_compress(src, dst, (size_t)dstsiz, - (const u_char **)dnptrs, - (const u_char **)lastdnptr)); -} - -/*% - * Skip over a compressed domain name. Return the size or -1. - */ -int -dn_skipname(const u_char *ptr, const u_char *eom) { - const u_char *saveptr = ptr; - - if (ns_name_skip(&ptr, eom) == -1) - return (-1); - return (ptr - saveptr); -} - -/*% - * Verify that a domain name uses an acceptable character set. - * - * Note the conspicuous absence of ctype macros in these definitions. On - * non-ASCII hosts, we can't depend on string literals or ctype macros to - * tell us anything about network-format data. The rest of the BIND system - * is not careful about this, but for some reason, we're doing it right here. - */ -#define PERIOD 0x2e -#define hyphenchar(c) ((c) == 0x2d) -#define bslashchar(c) ((c) == 0x5c) -#define periodchar(c) ((c) == PERIOD) -#define asterchar(c) ((c) == 0x2a) -#define alphachar(c) (((c) >= 0x41 && (c) <= 0x5a) \ - || ((c) >= 0x61 && (c) <= 0x7a)) -#define digitchar(c) ((c) >= 0x30 && (c) <= 0x39) - -#define borderchar(c) (alphachar(c) || digitchar(c)) -#define middlechar(c) (borderchar(c) || hyphenchar(c)) -#define domainchar(c) ((c) > 0x20 && (c) < 0x7f) - -int -res_hnok(const char *dn) { - int pch = PERIOD, ch = *dn++; - - while (ch != '\0') { - int nch = *dn++; - - if (periodchar(ch)) { - (void)NULL; - } else if (periodchar(pch)) { - if (!borderchar(ch)) - return (0); - } else if (periodchar(nch) || nch == '\0') { - if (!borderchar(ch)) - return (0); - } else { - if (!middlechar(ch)) - return (0); - } - pch = ch, ch = nch; - } - return (1); -} - -/*% - * hostname-like (A, MX, WKS) owners can have "*" as their first label - * but must otherwise be as a host name. - */ -int -res_ownok(const char *dn) { - if (asterchar(dn[0])) { - if (periodchar(dn[1])) - return (res_hnok(dn+2)); - if (dn[1] == '\0') - return (1); - } - return (res_hnok(dn)); -} - -/*% - * SOA RNAMEs and RP RNAMEs can have any printable character in their first - * label, but the rest of the name has to look like a host name. - */ -int -res_mailok(const char *dn) { - int ch, escaped = 0; - - /* "." is a valid missing representation */ - if (*dn == '\0') - return (1); - - /* otherwise