From 14b93edab315672d87e6fe82aaff8e7ee7378e0b Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Thu, 11 Jun 1998 09:03:02 +0000 Subject: Update the resolver parts to bind-8.1.2 level. I have not touched the getXXXXbyYYYY() interfaces yet. Obtained from: diff relative to bind-8.1.2 sources --- lib/libc/net/res_comp.c | 748 +++--------------------------------------------- 1 file changed, 42 insertions(+), 706 deletions(-) (limited to 'lib/libc/net/res_comp.c') diff --git a/lib/libc/net/res_comp.c b/lib/libc/net/res_comp.c index 8cd74696e348..de14f072c2f1 100644 --- a/lib/libc/net/res_comp.c +++ b/lib/libc/net/res_comp.c @@ -1,6 +1,4 @@ /* - * ++Copyright++ 1985, 1993 - * - * Copyright (c) 1985, 1993 * The Regents of the University of California. All rights reserved. * @@ -31,7 +29,9 @@ * 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 @@ -49,40 +49,42 @@ * 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-- + */ + +/* + * Portions Copyright (c) 1996 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 INTERNET SOFTWARE CONSORTIUM DISCLAIMS + * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE + * CONSORTIUM 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 char sccsid[] = "@(#)res_comp.c 8.1 (Berkeley) 6/4/93"; -static char orig_rcsid[] = "From: Id: res_comp.c,v 8.13 1998/04/07 04:24:06 vixie Exp $"; -static char rcsid[] = "$Id: res_comp.c,v 1.12 1997/06/27 08:22:02 peter Exp $"; +static char orig_rcsid[] = "From: Id: res_comp.c,v 8.11 1997/05/21 19:31:04 halley Exp $"; +static char rcsid[] = "$Id: res_comp.c,v 1.13 1998/05/02 13:10:56 peter Exp $"; #endif /* LIBC_SCCS and not lint */ #include #include #include #include - -#include -#include #include -#include - -#include +#include +#include #include +#include -static int ns_name_ntop __P((const u_char *, char *, size_t)); -static int ns_name_pton __P((const char *, u_char *, size_t)); -static int ns_name_unpack __P((const u_char *, const u_char *, - const u_char *, u_char *, size_t)); -static int ns_name_pack __P((const u_char *, u_char *, int, - const u_char **, const u_char **)); -static int ns_name_uncompress __P((const u_char *, const u_char *, - const u_char *, char *, size_t)); -static int ns_name_compress __P((const char *, u_char *, size_t, - const u_char **, const u_char **)); -static int ns_name_skip __P((const u_char **, const u_char *)); +#define BIND_4_COMPAT /* * Expand compressed domain name 'comp_dn' to full domain name. @@ -120,7 +122,7 @@ dn_comp(const char *src, u_char *dst, int dstsiz, * Skip over a compressed domain name. Return the size or -1. */ int -__dn_skipname(const u_char *ptr, const u_char *eom) { +dn_skipname(const u_char *ptr, const u_char *eom) { const u_char *saveptr = ptr; if (ns_name_skip(&ptr, eom) == -1) @@ -161,7 +163,7 @@ res_hnok(dn) int nch = *dn++; if (periodchar(ch)) { - NULL; + (void)NULL; } else if (periodchar(pch)) { if (!borderchar(ch)) return (0); @@ -206,7 +208,7 @@ res_mailok(dn) /* "." is a valid missing representation */ if (*dn == '\0') - return(1); + return (1); /* otherwise