diff options
author | cvs2svn <cvs2svn@FreeBSD.org> | 1995-10-23 13:36:48 +0000 |
---|---|---|
committer | cvs2svn <cvs2svn@FreeBSD.org> | 1995-10-23 13:36:48 +0000 |
commit | ad179c5d7cd23324cf602a6df86d3b10e052ce1f (patch) | |
tree | f640e6452cbd981060c06fe20e4c3b13ecaedf1c | |
parent | 471f05ab655c6f591d1692aa20692b6c163ccae2 (diff) |
Notes
-rw-r--r-- | usr.sbin/named/tools/nsquery/nsquery.c | 140 | ||||
-rw-r--r-- | usr.sbin/named/tools/nstest/nstest.c | 424 | ||||
-rw-r--r-- | usr.sbin/named/tree.man3 | 154 | ||||
-rw-r--r-- | usr.sbin/nslookup/Makefile | 126 | ||||
-rw-r--r-- | usr.sbin/nslookup/nslookup.8 | 387 |
5 files changed, 0 insertions, 1231 deletions
diff --git a/usr.sbin/named/tools/nsquery/nsquery.c b/usr.sbin/named/tools/nsquery/nsquery.c deleted file mode 100644 index c7ff6ebe4d72..000000000000 --- a/usr.sbin/named/tools/nsquery/nsquery.c +++ /dev/null @@ -1,140 +0,0 @@ -/* - * ++Copyright++ 1986 - * - - * Copyright (c) 1986 - * 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-- - */ - -#ifndef lint -char copyright[] = -"@(#) Copyright (c) 1986 Regents of the University of California.\n\ - portions Copyright (c) 1993 Digital Equipment Corporation\n\ - All rights reserved.\n"; -#endif /* not lint */ - -#ifndef lint -static char sccsid[] = "@(#)nsquery.c 4.8 (Berkeley) 6/1/90"; -static char rcsid[] = "$Id: nsquery.c,v 4.9.1.4 1994/06/11 22:05:07 vixie Exp $"; -#endif /* not lint */ - -#include <sys/param.h> -#include <sys/socket.h> -#include <netinet/in.h> -#include <arpa/nameser.h> -#include <arpa/inet.h> -#include <stdio.h> -#include <netdb.h> -#include <resolv.h> -#include "../conf/portability.h" - -main(argc, argv) - int argc; - char **argv; -{ - extern struct __res_state _res; - register struct hostent *hp; - register char *s; - - res_init(); - - if (argc >= 2 && strcmp(argv[1], "-d") == 0) { - _res.options |= RES_DEBUG; - argc--; - argv++; - } - if (argc < 2) { - fprintf(stderr, "usage: nsquery [-d] host [server]\n"); - exit(1); - } - if (argc == 3) { - hp = gethostbyname(argv[2]); - if (hp == NULL) { - fprintf(stderr, "nsquery:"); - herror(argv[2]); - exit(1); - } - printf("\nServer:\n"); - printanswer(hp); - _res.nsaddr.sin_addr = *(struct in_addr *)hp->h_addr; -#ifdef nsaddr /* struct __res_state includes nscount and nsaddr_list[] */ - _res.nscount = 1; -#endif - } - - hp = gethostbyname(argv[1]); - if (hp == NULL) { - fprintf(stderr, "nsquery: %s: ", argv[1]); - herror((char *)NULL); - exit(1); - } - printanswer(hp); - exit(0); -} - -printanswer(hp) - register struct hostent *hp; -{ - register char **cp; - - printf("Name: %s\n", hp->h_name); -#if BSD >= 43 || defined(h_addr) - printf("Addresses:"); - for (cp = hp->h_addr_list; cp && *cp; cp++) - printf(" %s", inet_ntoa(*(struct in_addr *)(*cp))); - printf("\n"); -#else - printf("Address: %s\n", inet_ntoa(*(struct in_addr *)hp->h_addr)); -#endif - printf("Aliases:"); - for (cp = hp->h_aliases; cp && *cp && **cp; cp++) - printf(" %s", *cp); - printf("\n\n"); -} diff --git a/usr.sbin/named/tools/nstest/nstest.c b/usr.sbin/named/tools/nstest/nstest.c deleted file mode 100644 index f20388d8696e..000000000000 --- a/usr.sbin/named/tools/nstest/nstest.c +++ /dev/null @@ -1,424 +0,0 @@ -/* - * ++Copyright++ 1986 - * - - * Copyright (c) 1986 - * 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-- - */ - -#ifndef lint -char copyright[] = -"@(#) Copyright (c) 1986 Regents of the University of California.\n\ - portions Copyright (c) 1993 Digital Equipment Corporation\n\ - All rights reserved.\n"; -#endif /* not lint */ - -#ifndef lint -static char sccsid[] = "@(#)nstest.c 4.15 (Berkeley) 3/21/91"; -static char rcsid[] = "$Id: nstest.c,v 4.9.1.6 1994/06/01 21:10:11 vixie Exp $"; -#endif /* not lint */ - -#include <sys/param.h> -#include <sys/socket.h> -#include <netinet/in.h> -#include <arpa/inet.h> -#include <arpa/nameser.h> -#include <stdio.h> -#include <resolv.h> -#include "../conf/portability.h" - -char *progname; -FILE *log; -#define MAXDATA 256 /* really should get this from named/db.h */ -main(argc, argv) - char **argv; -{ - register char *cp; - register u_char *ucp; - struct hostent *hp; - u_short port = htons(NAMESERVER_PORT); - char buf[BUFSIZ]; - u_char packet[PACKETSZ], answer[8*1024], OldRRData[MAXDATA]; - struct rrec NewRR; - u_int32_t l; - int n, dump_packet; - - NewRR.r_data = (char *) malloc(MAXDATA); - NewRR.r_data = (char *) malloc(MAXDATA); - progname = argv[0]; - dump_packet = 0; - _res.options |= RES_DEBUG|RES_RECURSE; - (void) res_init(); - while (argc > 1 && argv[1][0] == '-') { - argc--; - cp = *++argv; - while (*++cp) - switch (*cp) { - case 'p': - if (--argc <= 0) - usage(); - port = htons(atoi(*++argv)); - break; - - case 'i': - _res.options |= RES_IGNTC; - break; - - case 'v': - _res.options |= RES_USEVC|RES_STAYOPEN; - break; - - case 'r': - _res.options &= ~RES_RECURSE; - break; - - case 'd': - dump_packet++; - break; - - default: - usage(); - } - } - _res.nsaddr.sin_family = AF_INET; - _res.nsaddr.sin_addr = inet_makeaddr(IN_LOOPBACKNET, 1); - _res.nsaddr.sin_port = port; - if (argc > 1) { - if (!inet_aton(argv[1], - (struct in_addr *)&_res.nsaddr.sin_addr)) - usage(); - } - if (argc > 2) { - log = fopen(argv[2],"w"); - if (log == NULL) perror(argv[2]); - } - for (;;) { - printf("> "); - fflush(stdout); - if ((cp = fgets(buf, sizeof buf, stdin)) == NULL) - break; - switch (*cp++) { - case 'a': - n = res_mkquery(QUERY, cp, C_IN, T_A, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'A': - n = ntohl(inet_addr(cp)); - putlong((u_int32_t)n, (u_char*)cp); - n = res_mkquery(IQUERY, "", C_IN, T_A, (u_char *)cp, - INT32SZ, NULL, - packet, sizeof(packet)); - break; - - case 'f': - n = res_mkquery(QUERY, cp, C_ANY, T_UINFO, NULL, - 0, NULL, packet, sizeof packet); - break; - - case 'F': - n = res_mkquery(QUERY, cp, C_IN, T_AFSDB, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'g': - n = res_mkquery(QUERY, cp, C_ANY, T_GID, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'G': - *(int *)cp = htonl(atoi(cp)); - n = res_mkquery(IQUERY, "", C_ANY, T_GID, (u_char *)cp, - sizeof(int), NULL, packet, sizeof packet); - break; - - case 'c': - n = res_mkquery(QUERY, cp, C_IN, T_CNAME, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'h': - n = res_mkquery(QUERY, cp, C_IN, T_HINFO, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'm': - n = res_mkquery(QUERY, cp, C_IN, T_MX, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'M': - n = res_mkquery(QUERY, cp, C_IN, T_MAILB, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'n': - n = res_mkquery(QUERY, cp, C_IN, T_NS, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'p': - n = res_mkquery(QUERY, cp, C_IN, T_PTR, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 's': - n = res_mkquery(QUERY, cp, C_IN, T_SOA, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'T': - n = res_mkquery(QUERY, cp, C_IN, T_TXT, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'u': - n = res_mkquery(QUERY, cp, C_ANY, T_UID, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'U': - *(int *)cp = htonl(atoi(cp)); - n = res_mkquery(IQUERY, "", C_ANY, T_UID, (u_char *)cp, - sizeof(int), NULL, - packet, sizeof packet); - break; - - case 'x': - n = res_mkquery(QUERY, cp, C_IN, T_AXFR, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'w': - n = res_mkquery(QUERY, cp, C_IN, T_WKS, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'b': - n = res_mkquery(QUERY, cp, C_IN, T_MB, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'B': - n = res_mkquery(QUERY, cp, C_IN, T_MG, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'i': - n = res_mkquery(QUERY, cp, C_IN, T_MINFO, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'r': - n = res_mkquery(QUERY, cp, C_IN, T_MR, NULL, 0, - NULL, packet, sizeof packet); - break; - - case '*': - n = res_mkquery(QUERY, cp, C_IN, T_ANY, NULL, 0, - NULL, packet, sizeof packet); - break; - -#ifdef ALLOW_UPDATES - case '^': - { - char IType[10], TempStr[50]; - int Type, oldnbytes, nbytes, i; -#ifdef ALLOW_T_UNSPEC - printf("Data type (a = T_A, u = T_UNSPEC): "); - gets(IType); - if (IType[0] == 'u') { - Type = T_UNSPEC; - printf("How many data bytes? "); - gets(TempStr); /* Throw away CR */ - sscanf(TempStr, "%d", &nbytes); - for (i = 0; i < nbytes; i++) { - (NewRR.r_data)[i] = (char) i; - } - } else { -#endif /* ALLOW_T_UNSPEC */ - Type = T_A; - nbytes = INT32SZ; - printf( - "Inet addr for new dname (e.g., 192.4.3.2): " - ); - gets(TempStr); - putlong(ntohl(inet_addr(TempStr)), - NewRR.r_data); -#ifdef ALLOW_T_UNSPEC - } -#endif - NewRR.r_class = C_IN; - NewRR.r_type = Type; - NewRR.r_size = nbytes; - NewRR.r_ttl = 99999999; - printf("Add, modify, or modify all (a/m/M)? "); - gets(TempStr); - if (TempStr[0] == 'a') { - n = res_mkquery(UPDATEA, cp, C_IN, Type, - OldRRData, nbytes, - &NewRR, packet, - sizeof packet); - } else { - if (TempStr[0] == 'm') { - printf("How many data bytes in old RR? "); - gets(TempStr); /* Throw away CR */ - sscanf(TempStr, "%d", &oldnbytes); - for (i = 0; i < oldnbytes; i++) { - OldRRData[i] = (char) i; - } - n = res_mkquery(UPDATEM, cp, - C_IN, Type, - OldRRData, oldnbytes, - &NewRR, packet, - sizeof packet); - } else { /* Modify all */ - n = res_mkquery(UPDATEMA, cp, - C_IN, Type, NULL, 0, - &NewRR, packet, - sizeof packet); - - } - } - } - break; - -#ifdef ALLOW_T_UNSPEC - case 'D': - n = res_mkquery(UPDATEDA, cp, C_IN, T_UNSPEC, - (char *)0, 0, NULL, - packet, sizeof packet); - break; - - case 'd': - { - char TempStr[100]; - int nbytes, i; - printf("How many data bytes in oldrr data? "); - gets(TempStr); /* Throw away CR */ - sscanf(TempStr, "%d", &nbytes); - for (i = 0; i < nbytes; i++) { - OldRRData[i] = (char) i; - } - n = res_mkquery(UPDATED, cp, C_IN, T_UNSPEC, - OldRRData, nbytes, NULL, - packet, sizeof packet); - } - break; -#endif /* ALLOW_T_UNSPEC */ -#endif /* ALLOW_UPDATES */ - - default: - printf("a{host} - query T_A\n"); - printf("A{addr} - iquery T_A\n"); - printf("b{user} - query T_MB\n"); - printf("B{user} - query T_MG\n"); - printf("f{host} - query T_UINFO\n"); - printf("g{host} - query T_GID\n"); - printf("G{gid} - iquery T_GID\n"); - printf("h{host} - query T_HINFO\n"); - printf("i{host} - query T_MINFO\n"); - printf("p{host} - query T_PTR\n"); - printf("m{host} - query T_MX\n"); - printf("M{host} - query T_MAILB\n"); - printf("n{host} - query T_NS\n"); - printf("r{host} - query T_MR\n"); - printf("s{host} - query T_SOA\n"); - printf("T{host} - query T_TXT\n"); - printf("u{host} - query T_UID\n"); - printf("U{uid} - iquery T_UID\n"); - printf("x{host} - query T_AXFR\n"); - printf("w{host} - query T_WKS\n"); - printf("F{host} - query T_AFSDB\n"); - printf("c{host} - query T_CNAME\n"); - printf("*{host} - query T_ANY\n"); -#ifdef ALLOW_UPDATES - printf("^{host} - add/mod/moda (T_A/T_UNSPEC)\n"); -#ifdef ALLOW_T_UNSPEC - printf("D{host} - deletea T_UNSPEC\n"); - printf("d{host} - delete T_UNSPEC\n"); -#endif /* ALLOW_T_UNSPEC */ -#endif /* ALLOW_UPDATES */ - continue; - } - if (n < 0) { - printf("res_mkquery: buffer too small\n"); - continue; - } - if (log) { - fprintf(log,"SEND QUERY\n"); - fp_query(packet, log); - } - n = res_send(packet, n, answer, sizeof(answer)); - if (n < 0) { - printf("res_send: send error\n"); - if (log) fprintf(log, "res_send: send error\n"); - } - else { - if (dump_packet) { - int f; - f = creat("ns_packet.dump", 0644); - write(f, answer, n); - (void) close(f); - } - if (log) { - fprintf(log, "GOT ANSWER\n"); - fp_query(answer, log); - } - } - } -} - -usage() -{ - fprintf(stderr, "Usage: %s [-v] [-i] [-r] [-d] [-p port] hostaddr\n", - progname); - exit(1); -} diff --git a/usr.sbin/named/tree.man3 b/usr.sbin/named/tree.man3 deleted file mode 100644 index 5be48783e2b6..000000000000 --- a/usr.sbin/named/tree.man3 +++ /dev/null @@ -1,154 +0,0 @@ -.TH TREE 3 "5 April 1994" -.\" from .TH TREE 3 "22 Jan 1993" -.\" from .TH TREE 2 "23 June 1986" -.UC 4 -.SH NAME -tree_init, tree_mung, tree_srch, tree_add, tree_delete, tree_trav -\- balanced binary tree routines -.SH SYNOPSIS -.nf -.B void -.B tree_init(tree) -.B void **tree; -.PP -.B void * -.B tree_srch(tree, compare, data) -.B void **tree; -.B int (*compare)(); -.B void *data; -.PP -.B void -.B tree_add(tree, compare, data, del_uar) -.B void **tree; -.B int (*compare)(); -.B void *data; -.B void (*del_uar)(); -.PP -.B int -.B tree_delete(tree, compare, data, del_uar) -.B void **tree; -.B int (*compare)(); -.B void *data; -.B void (*del_uar)(); -.PP -.B int -.B tree_trav(tree, trav_uar) -.B void **tree; -.B int (*trav_uar)(); -.PP -.B void -.B tree_mung(tree, del_uar) -.B void **tree; -.B void (*del_uar)(); -.fi -.SH DESCRIPTION -These functions create and manipulate a balanced binary (AVL) tree. Each node -of the tree contains the expected left & right subtree pointers, a short int -balance indicator, and a pointer to the user data. On a 32 bit system, this -means an overhead of 4+4+2+4 bytes per node (or, on a RISC or otherwise -alignment constrained system with implied padding, 4+4+4+4 bytes per node). -There is no key data type enforced by this package; a caller supplied -compare routine is used to compare user data blocks. -.PP -Balanced binary trees are very fast on searches and replacements, but have a -moderately high cost for additions and deletions. If your application does a -lot more searches and replacements than it does additions and deletions, the -balanced (AVL) binary tree is a good choice for a data structure. -.PP -.I Tree_init -creates an empty tree and binds it to -.I tree -(which for this and all other routines in this package should be declared as -a pointer to void or int, and passed by reference), which can then be used by -other routines in this package. Note that more than one -.I tree -variable can exist at once; thus multiple trees can be manipulated -simultaneously. -.PP -.I Tree_srch -searches a tree for a specific node and returns either -.I NULL -if no node was found, or the value of the user data pointer if the node -was found. -.I compare -is the address of a function to compare two user data blocks. This routine -should work much the way -.IR strcmp (3) -does; in fact, -.I strcmp -could be used if the user data was a \s-2NUL\s+2 terminated string. -.I data -is the address of a user data block to be used by -.I compare -as the search criteria. The tree is searched for a node where -.I compare -returns 0. -.PP -.I Tree_add -inserts or replaces a node in the specified tree. The tree specified by -.I tree -is searched as in -.I tree_srch, -and if a node is found to match -.I data, -then the -.I del_uar -function, if non\-\s-2NULL\s+2, is called with the address of the user data -block for the node (this routine should deallocate any dynamic memory which -is referenced exclusively by the node); the user data pointer for the node -is then replaced by the value of -.I data. -If no node is found to match, a new node is added (which may or may not -cause a transparent rebalance operation), with a user data pointer equal to -.I data. -A rebalance may or may not occur, depending on where the node is added -and what the rest of the tree looks like. -.I Tree_add -will return the -.I data -pointer unless catastrophe occurs in which case it will return \s-2NULL\s+2. -.PP -.I Tree_delete -deletes a node from -.I tree. -A rebalance may or may not occur, depending on where the node is removed from -and what the rest of the tree looks like. -.I Tree_delete -returns TRUE if a node was deleted, FALSE otherwise. -.PP -.I Tree_trav -traverses all of -.I tree, -calling -.I trav_uar -with the address of each user data block. If -.I trav_uar -returns FALSE at any time, -.I tree_trav -will immediately return FALSE to its caller. Otherwise all nodes will be -reached and -.I tree_trav -will return TRUE. -.PP -.I Tree_mung -deletes every node in -.I tree, -calling -.I del_uar -(if it is not \s-2NULL\s+2) with the user data address from each node (see -.I tree_add -and -.I tree_delete -above). The tree is left in the same state that -.I tree_init -leaves it in \- i.e., empty. -.SH BUGS -Should have a way for the caller to specify application specific -.I malloc -and -.I free -functions to be used internally when allocating meta data. -.SH AUTHOR -Paul Vixie, converted and augumented from Modula\-2 examples in -.I Algorithms & Data Structures, -Niklaus Wirth, Prentice\-Hall, ISBN 0\-13\-022005\-1. diff --git a/usr.sbin/nslookup/Makefile b/usr.sbin/nslookup/Makefile deleted file mode 100644 index 36d83b4fef57..000000000000 --- a/usr.sbin/nslookup/Makefile +++ /dev/null @@ -1,126 +0,0 @@ -# -# @(#)Makefile 5.20 (Berkeley) 10/2/89 -# $Id: Makefile,v 8.2 1995/01/11 08:58:13 vixie Exp $ -# - -## ++Copyright++ 1987 -## - -## Copyright (c) 1987 -## 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-- - -DESTDIR = -DESTBIN = /usr/bin -COMPINCL = ../../compat/include -CC= cc -SHELL= /bin/sh -CDEBUG= -O -INCL = ../../include -RES= ../../res/libresolv.a -COMPLIB= ../../compat/lib/lib44bsd.a -LDFLAGS = -LIBS = -ll -LEX = lex -DESTHELP= /usr/lib -DEFS= -D_PATH_HELPFILE=\"$(DESTHELP)/nslookup.help\" - -#(bsd/386, 4.4bsd, other net2 descendents) -#DESTHELP= /usr/share/misc -#COMPINCL= . -#COMPLIB= -#LIBS = -ll -lutil -#LEX = lex -I - -#(sgi irix4) -#DESTHELP= /usr/bsd -#DEFS= -xansi -signed -D__STDC__ -D_BSD_SIGNALS \ -# -D_PATH_HELPFILE=\"$(DESTHELP)/nslookup.help\" -#COMPLIB= - -#(sgi irix5) -#DESTHELP= /usr/share/misc -#DEFS= -xansi -signed -D__BIT_TYPES_DEFINED__ -D_BSD_SIGNALS \ -# -D_PATH_HELPFILE=\"$(DESTHELP)/nslookup.help\" -#COMPLIB= - -CFLAGS= ${CDEBUG} -I${INCL} -I${COMPINCL} ${DEFS} -CSRCS= main.c getinfo.c debug.c send.c skip.c list.c subr.c -SRCS= ${CSRCS} commands.c -OBJS= main.o getinfo.o debug.o send.o skip.o list.o subr.o commands.o - -all: nslookup - -nslookup: ${OBJS} ${RES} ${COMPLIB} - ${CC} ${CDEBUG} ${LDFLAGS} -o $@ ${OBJS} \ - ${RES} ${COMPLIB} ${LIBS} - -clean: - rm -f ${OBJS} core nslookup commands.c lex.yy.c lex.yy.o - rm -f *.BAK *.CKP *~ - -cleandir: clean - rm -f tags .depend - -depend: ${SRCS} - mkdep ${CPPFLAGS} -I${INCL} -I${COMPINCL} ${DEFS} ${SRCS} - -install: - ${INSTALL} -s -c -o bin -g bin -m 755 nslookup ${DESTDIR}${DESTBIN}/ - ${INSTALL} -c -o bin -g bin -m 444 nslookup.help \ - ${DESTDIR}${DESTHELP}/ - -lint: ${SRCS} - lint ${SRCS} - -tags: ${CSRCS} - ctags ${CSRCS} - -# DO NOT DELETE THIS LINE -- mkdep uses it. -# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. diff --git a/usr.sbin/nslookup/nslookup.8 b/usr.sbin/nslookup/nslookup.8 deleted file mode 100644 index de0306aa0972..000000000000 --- a/usr.sbin/nslookup/nslookup.8 +++ /dev/null @@ -1,387 +0,0 @@ -.\" -.\" ++Copyright++ 1985, 1989 -.\" - -.\" Copyright (c) 1985, 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. -.\" - -.\" --Copyright-- -.\" -.\" @(#)nslookup.8 5.3 (Berkeley) 6/24/90 -.\" -.TH NSLOOKUP @SYS_OPS_EXT_U@ "June 24, 1990" -.UC 6 -.SH NAME -nslookup \- query Internet name servers interactively -.SH SYNOPSIS -.B nslookup -[ -.I \-option ... -] -[ -.I host-to-find -| \- [ -.I server -]] -.SH DESCRIPTION -.I Nslookup -is a program to query Internet domain name servers. -Nslookup has two modes: interactive and non-interactive. -Interactive mode allows the user to query name servers for -information about various hosts and domains or to print a list of hosts -in a domain. -Non-interactive mode is used to print just the name and requested information -for a host or domain. -.sp 1 -.SH ARGUMENTS -Interactive mode is entered in the following cases: -.IP a) 4 -when no arguments are given (the default name server will be used), -.IP b) 4 -when the first argument is a hyphen (\-) and the second argument -is the host name or Internet address of a name server. -.LP -Non-interactive mode is used when the name or Internet address -of the host to be looked up -is given as the first argument. The optional second argument specifies -the host name or address of a name server. -.LP -The options listed under the ``set'' command below can be specified in -the .nslookuprc file in the user's home directory if they are listed -one per line. Options can also be specified -on the command line if they precede the arguments and are prefixed with -a hyphen. For example, to change the default query type to host information, -and the initial timeout to 10 seconds, type: -.sp .5v - nslookup \-query=hinfo \-timeout=10 -.sp .5v -.SH "INTERACTIVE COMMANDS" -Commands may be interrupted at any time by typing a control-C. -To exit, type a control-D (EOF) or type exit. -The command line length must be less than 256 characters. -To treat a built-in command as a host name, -precede it with an escape character (\e). -\fBN.B.\fP an unrecognized command will be interpreted as a host name. -.sp .5v -.IP "\fIhost\fP [\fIserver\fP]" -Look up information for \fIhost\fP using the current default server -or using \fIserver\fP if specified. -If \fIhost\fP is an Internet address and the query type is A or PTR, the -name of the host is returned. -If \fIhost\fP is a name and does not have a trailing period, the default -domain name is appended to the name. (This behavior depends on the state of the -\fBset\fP options \fBdomain\fP, \fBsrchlist\fP, -\fBdefname\fP, and \fBsearch\fP). -To look up a host not in the current domain, append a period to -the name. -.sp 1 -.IP "\fBserver\fP \fIdomain\fP" -.ns -.IP "\fBlserver\fP \fIdomain\fP" -Change the default server to \fIdomain\fP. -\fBLserver\fP uses the initial server to look up -information about \fIdomain\fP while \fBserver\fP -uses the current default server. -If an authoritative answer can't be found, the names of servers -that might have the answer are returned. -.sp 1 -.IP \fBroot\fP -Changes the default server to the server for the root of the domain name space. -Currently, the host ns.internic.net is used. -(This command is a synonym for \fBlserver ns.internic.net.\fP) -The name of the root server can be changed with the \fBset root\fP command. -.sp 1 -.IP "\fBfinger\fP [\fIname\fP] [\fB>\fP \fIfilename\fP]" -.ns -.IP "\fBfinger\fP [\fIname\fP] [\fB>>\fP \fIfilename\fP]" -Connects with the finger server on the current host. -The current host is defined when a previous lookup for a host -was successful and returned address information (see the -\fBset querytype=A\fP command). -\fIName\fP is optional. -\fB>\fP and \fB>>\fP can be used to redirect output in the -usual manner. -.sp 1 -.IP "\fBls\fR [\fIoption\fR] \fIdomain\fR [\fB>\fR \fIfilename\fR]" -.ns -.IP "\fBls\fR [\fIoption\fR] \fIdomain\fR [\fB>>\fR \fIfilename\fR]" -List the information available for \fIdomain\fP, optionally creating -or appending to \fIfilename\fP. -The default output contains host names and their Internet addresses. -.I Option -can be one of the following: -.RS -.IP "\fB\-t \fIquerytype\fP" 4 -lists all records of the specified type (see \fIquerytype\fP below). -.IP \fB\-a\fP 4 -lists aliases of hosts in the domain. -synonym for \fB\-t\ \ CNAME\fP. -.IP \fB\-d\fP 4 -lists all records for the domain. -synonym for \fB\-t\ \ ANY\fP. -.IP \fB\-h\fP 4 -lists CPU and operating system information for the domain. -synonym for \fB\-t\ \ HINFO\fP. -.IP \fB\-s\fP 4 -lists well-known services of hosts in the domain. -synonym for \fB\-t\ \ WKS\fP. -.P -When output is directed to a file, hash marks are printed for every -50 records received from the server. -.RE -.sp 1 -.IP "\fBview\fP \fIfilename\fP" -Sorts and lists the output of previous \fBls\fP command(s) with -\fImore\fP(@CMD_EXT@). -.sp 1 -.ne 4 -.IP "\fBhelp\fP" -.ns -.IP "\fB?\fP" -Prints a brief summary of commands. -.sp 1 -.IP "\fBexit\fP" -Exits the program. -.sp 1 -.IP "\fBset\fP \fIkeyword\fP[=\fIvalue\fP]" -This command is used to change state information that affects the lookups. -Valid keywords are: -.RS -.IP "\fBall\fP" -Prints the current values of the frequently-used options to \fBset\fP. -Information about the current default server and host is also printed. -.IP "\fBclass=\fIvalue\fR" -Change the query class to one of: -.RS -.IP IN 10 -the Internet class. -.IP CHAOS 10 -the Chaos class. -.IP HESIOD 10 -the MIT Athena Hesiod class. -.IP ANY 10 -wildcard (any of the above). -.P -The class specifies the protocol group of the information. -.br -(Default = IN, abbreviation = cl) -.RE -.IP "\fB[no]debug\fP" -Turn debugging mode on. A lot more information is printed about the -packet sent to the server and the resulting answer. -.br -(Default = nodebug, abbreviation = [no]deb) -.IP "\fB[no]d2\fP" -Turn exhaustive debugging mode on. -Essentially all fields of every packet are printed. -.br -(Default = nod2) -.IP "\fBdomain=\fIname\fR" -Change the default domain name to \fIname\fP. -The default domain name is appended to a lookup request depending on the -state of the \fBdefname\fP and \fBsearch\fP options. -The domain search list contains the parents of the default domain if it has -at least two components in its name. -For example, if the default domain -is CC.Berkeley.EDU, the search list is CC.Berkeley.EDU and Berkeley.EDU. -Use the \fBset srchlist\fP command to specify a different list. -Use the \fBset all\fP command to display the list. -.br -(Default = value from hostname, /etc/resolv.conf or LOCALDOMAIN, -abbreviation = do) -.IP "\fBsrchlist=\fIname1/name2/...\fR" -Change the default domain name to \fIname1\fP and the domain search list -to \fIname1\fP, \fIname2\fP, etc. A maximum of 6 names separated by slashes (/) -can be specified. -For example, -.sp .5v - set\ srchlist=lcs.MIT.EDU/ai.MIT.EDU/MIT.EDU -.sp .5v -sets the domain to lcs.MIT.EDU and the search list to the three names. -This command overrides the -default domain name and search list of the \fBset domain\fP command. -Use the \fBset all\fP command to display the list. -.br -(Default = value based on hostname, /etc/resolv.conf or LOCALDOMAIN, -abbreviation = srchl) -.IP "\fB[no]defname\fP" -If set, append the default domain name to a single-component lookup request -(i.e., one that does not contain a period). -.br -(Default = defname, abbreviation = [no]def) -.IP "\fB[no]search\fP" -If the lookup request contains at least one period but doesn't end -with a trailing period, -append the domain names in the domain search list -to the request until an answer is received. -.br -(Default = search, abbreviation = [no]sea) -.IP "\fBport=\fIvalue\fR" -Change the default TCP/UDP name server port to \fIvalue\fP. -.br -(Default = 53, abbreviation = po) -.IP "\fBquerytype=\fIvalue\fR" -.ns -.IP "\fBtype=\fIvalue\fR" -.ns -Change the type of information query to one of: -.RS -.IP A 10 -the host's Internet address. -.IP CNAME 10 -the canonical name for an alias. -.IP HINFO 10 -the host CPU and operating system type. -.IP MINFO 10 -the mailbox or mail list information. -.IP MX 10 -the mail exchanger. -.IP NS 10 -the name server for the named zone. -.IP PTR 10 -the host name if the query is an Internet address, -otherwise the pointer to other information. -.IP SOA 10 -the domain's ``start-of-authority'' information. -.IP TXT 10 -the text information. -.IP UINFO 10 -the user information. -.IP WKS 10 -the supported well-known services. -.P -Other types (ANY, AXFR, MB, MD, MF, NULL) are described in the -RFC-1035 document. -.br -(Default = A, abbreviations = q, ty) -.RE -.IP "\fB[no]recurse\fP" -Tell the name server to query other servers if it does not have the -information. -.br -(Default = recurse, abbreviation = [no]rec) -.IP \fBretry=\fInumber\fR -Set the number of retries to \fInumber\fP. -When a reply to a request is not received within a certain -amount of time (changed with \fBset timeout\fP), -the timeout period is doubled and the request is resent. -The retry value controls how many times a request is resent before giving up. -.br -(Default = 4, abbreviation = ret) -.IP \fBroot=\fIhost\fR -Change the name of the root server to \fIhost\fP. This -affects the \fBroot\fP command. -.br -(Default = ns.internic.net., abbreviation = ro) -.IP \fBtimeout=\fInumber\fR -Change the initial timeout interval -for waiting for a reply -to \fInumber\fP seconds. -Each retry doubles the timeout period. -.br -(Default = 5 seconds, abbreviation = ti) -.IP "\fB[no]vc\fP" -Always use a virtual circuit when sending requests to the server. -.br -(Default = novc, abbreviation = [no]v) -.IP "\fB[no]ignoretc\fP" -Ignore packet truncation errors. -.br -(Default = noignoretc, abbreviation = [no]ig) -.RE -.SH DIAGNOSTICS -If the lookup request was not successful, an error message is printed. -Possible errors are: -.IP "Timed out" 5 -The server did not respond to a request after a certain amount of -time (changed with \fBset timeout=\fIvalue\fR) -and a certain number of retries (changed with \fBset retry=\fIvalue\fR). -.IP "No response from server" 5 -No name server is running on the server machine. -.IP "No records" 5 -The server does not have resource records of the current query type for the -host, although the host name is valid. -The query type is specified with the \fBset querytype\fP command. -.IP "Non-existent domain" 5 -The host or domain name does not exist. -.IP "Connection refused" 5 -.ns -.IP "Network is unreachable" 5 -The connection to the name or finger server could not be made -at the current time. -This error commonly occurs with \fBls\fP and \fBfinger\fP requests. -.IP "Server failure" 5 -The name server found an internal inconsistency in its database -and could not return a valid answer. -.IP "Refused" 5 -The name server refused to service the request. -.IP "Format error" 5 -The name server found that the request packet was not in the proper format. -It may indicate an error in \fInslookup\fP. -.sp 1 -.SH FILES -.ta \w'/usr/share/misc/nslookup.helpXXX'u -/etc/resolv.conf initial domain name and - name server addresses. -.br -$HOME/.nslookuprc user's initial options. -.br -/usr/share/misc/nslookup.help summary of commands. -.SH ENVIRONMENT -.ta \w'HOSTALIASESXXXX'u -HOSTALIASES file containing host aliases. -.br -LOCALDOMAIN overrides default domain. -.SH SEE ALSO -resolver(@LIB_NETWORK_EXT@), resolver(@FORMAT_EXT@), @INDOT@named(@SYS_OPS_EXT@), -.br -RFC-1034 ``Domain Names \- Concepts and Facilities'' -.br -RFC-1035 ``Domain Names \- Implementation and Specification'' -.SH AUTHOR -Andrew Cherenson |