Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-4]: src/dist/bind/bin Pull up revision 1.1 (new) (requested by ...
details: https://anonhg.NetBSD.org/src/rev/2db0e429d3ec
branches: netbsd-1-4
changeset: 469777:2db0e429d3ec
user: he <he%NetBSD.org@localhost>
date: Sat Dec 04 16:51:51 1999 +0000
description:
Pull up revision 1.1 (new) (requested by christos and veego):
Update to BIND 8.2.2-P5.
diffstat:
dist/bind/bin/addr/addr.c | 179 +++
dist/bind/bin/dig/dig.c | 1636 +++++++++++++++++++++++++++++++++++
dist/bind/bin/dnskeygen/dnskeygen.c | 320 ++++++
dist/bind/bin/dnsquery/dnsquery.c | 212 ++++
4 files changed, 2347 insertions(+), 0 deletions(-)
diffs (truncated from 2363 to 300 lines):
diff -r 140ae74eecf2 -r 2db0e429d3ec dist/bind/bin/addr/addr.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dist/bind/bin/addr/addr.c Sat Dec 04 16:51:51 1999 +0000
@@ -0,0 +1,179 @@
+/* $NetBSD: addr.c,v 1.1.1.1.2.2 1999/12/04 16:51:51 he Exp $ */
+
+#if !defined(lint) && !defined(SABER)
+static const char rcsid[] = "Id: addr.c,v 8.8 1999/10/13 16:38:55 vixie Exp";
+#endif /* not lint */
+
+/*
+ * 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 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.
+ */
+
+#include "port_before.h"
+#include <sys/param.h>
+#include <sys/file.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <arpa/inet.h>
+#include <ctype.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include "port_after.h"
+
+static const char *prog = "addr";
+
+#define BIGGEST_ADDRESS IN6ADDRSZ
+
+static void
+usage() {
+ fprintf(stderr,
+ "usage: %s [-4] [-6] [-n hexstring] [-p address]\n",
+ prog);
+ exit(1);
+}
+
+/* Warning: this scribbles on `dst' even if it's going to return `0'. */
+static int
+hexstring(src, dst, len)
+ const char *src;
+ u_char *dst;
+ int len;
+{
+ static const char xdigits[] = "0123456789abcdef";
+ u_char *ptr = dst, *end = dst + len;
+ u_int val;
+ int ch, digits;
+
+ val = 0;
+ digits = 0;
+ memset(dst, 0, len);
+ while ((ch = *src++) != '\0') {
+ if (ch == '0' && (*src == 'x' || *src == 'X')) {
+ src++;
+ continue;
+ }
+ if (isascii(ch) && (isspace(ch) || ispunct(ch))) {
+ if (digits > 0) {
+ if (ptr == end)
+ return (0);
+ *ptr++ = (u_char) (val & 0xff);
+ val = 0;
+ digits = 0;
+ }
+ digits = 0;
+ continue;
+ }
+ if (!isascii(ch) || !isxdigit(ch))
+ return (0);
+ if (isupper(ch))
+ ch = tolower(ch);
+ /* Clock it in using little endian arithmetic. */
+ val <<= 4;
+ val |= (strchr(xdigits, ch) - xdigits);
+ if (++digits == 2) {
+ if (ptr == end)
+ return (0);
+ *ptr++ = (u_char) (val & 0xff);
+ digits = 0;
+ val = 0;
+ }
+ }
+ if (digits > 0) {
+ if (ptr == end)
+ return (0);
+ *ptr++ = (u_char) (val & 0xff);
+ }
+ return ((ptr - dst) == len);
+}
+
+static void
+display(input, af, addr, len)
+ const char *input;
+ int af;
+ const u_char *addr;
+ int len;
+{
+ static int before = 0;
+ char p[sizeof "xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:255.255.255.255"];
+ int i;
+
+ if (before)
+ putchar('\n');
+ else
+ before++;
+
+ printf("Input: \"%s\"\n", input);
+ printf("Network: [af%d len%d]", af, len);
+ for (i = 0; i < len; i++)
+ printf(" %02x", addr[i]);
+ putchar('\n');
+ printf("Presentation: \"%s\"\n", inet_ntop(af, addr, p, sizeof p));
+}
+
+int
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+ u_char addr[BIGGEST_ADDRESS];
+ int optchr, af, len, some;
+
+ prog = argv[0];
+ af = AF_INET;
+ len = INADDRSZ;
+ some = 0;
+ while ((optchr = getopt(argc, argv, "46n:p:")) != -1) {
+ switch (optchr) {
+ case '4':
+ af = AF_INET;
+ len = INADDRSZ;
+ break;
+ case '6':
+ af = AF_INET6;
+ len = IN6ADDRSZ;
+ break;
+ case 'n':
+ if (!hexstring(optarg, addr, len)) {
+ fprintf(stderr, "bad hex string: \"%s\"\n",
+ optarg);
+ usage();
+ /* NOTREACHED */
+ }
+ display(optarg, af, addr, len);
+ some++;
+ break;
+ case 'p':
+ if (inet_pton(af, optarg, addr) <= 0) {
+ fprintf(stderr, "bad address: \"%s\"\n",
+ optarg);
+ usage();
+ /* NOTREACHED */
+ }
+ display(optarg, af, addr, len);
+ some++;
+ break;
+ default:
+ usage();
+ /* NOTREACHED */
+ }
+ }
+ if (!some)
+ usage();
+ exit(0);
+ /* NOTREACHED */
+}
diff -r 140ae74eecf2 -r 2db0e429d3ec dist/bind/bin/dig/dig.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dist/bind/bin/dig/dig.c Sat Dec 04 16:51:51 1999 +0000
@@ -0,0 +1,1636 @@
+/* $NetBSD: dig.c,v 1.1.1.1.2.2 1999/12/04 16:51:56 he Exp $ */
+
+#ifndef lint
+static const char rcsid[] = "Id: dig.c,v 8.36 1999/11/05 05:05:14 vixie Exp";
+#endif
+
+/*
+ * Copyright (c) 1989
+ * 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.
+ */
+
+/*
+ * 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 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.
+ */
+
+/*********************** Notes for the BIND 4.9 release (Paul Vixie, DEC)
+ * dig 2.0 was written by copying sections of libresolv.a and nslookup
+ * and modifying them to be more useful for a general lookup utility.
+ * as of BIND 4.9, the changes needed to support dig have mostly been
+ * incorporated into libresolv.a and nslookup; dig now links against
+ * some of nslookup's .o files rather than #including them or maintaining
+ * local copies of them.
+ *
+ * while merging dig back into the BIND release, i made a number of
+ * structural changes. for one thing, i put all of dig's private
+ * library routines into this file rather than maintaining them in
+ * separate, #included, files. i don't like to #include ".c" files.
+ * i removed all calls to "bcopy", replacing them with structure
+ * assignments. i removed all "extern"'s of standard functions,
+ * replacing them with #include's of standard header files. this
+ * version of dig is probably as portable as the rest of BIND.
+ *
+ * i had to remove the query-time and packet-count statistics since
+ * the current libresolv.a is a lot harder to modify to maintain these
+ * than the 4.8 one (used in the original dig) was. for consolation,
+ * i added a "usage" message with extensive help text.
+ *
+ * to save my (limited, albeit) sanity, i ran "indent" over the source.
+ * i also added the standard berkeley/DEC copyrights, since this file now
+ * contains a fair amount of non-USC code. note that the berkeley and
+ * DEC copyrights do not prohibit redistribution, with or without fee;
+ * we add them only to protect ourselves (you have to claim copyright
+ * in order to disclaim liability and warranty).
+ *
+ * Paul Vixie, Palo Alto, CA, April 1993
+ ****************************************************************************
+
+ ******************************************************************
+ * DiG -- Domain Information Groper *
+ * *
+ * dig.c - Version 2.1 (7/12/94) ("BIND takeover") *
+ * *
Home |
Main Index |
Thread Index |
Old Index