summaryrefslogtreecommitdiffstats
path: root/usr.sbin/named
diff options
context:
space:
mode:
authorpst <pst@FreeBSD.org>1994-09-22 20:45:34 +0000
committerpst <pst@FreeBSD.org>1994-09-22 20:45:34 +0000
commite4a39c36558ea73f4920b60c1fbf775b0ec2ae38 (patch)
tree15b4d14a41d89c6396eb037d25ea3ebc094a1a60 /usr.sbin/named
parent6d8ea83922c252abd036ee8cffc7547c8a49a7a3 (diff)
downloadFreeBSD-src-e4a39c36558ea73f4920b60c1fbf775b0ec2ae38.zip
FreeBSD-src-e4a39c36558ea73f4920b60c1fbf775b0ec2ae38.tar.gz
Port BIND to FreeBSD.
Diffstat (limited to 'usr.sbin/named')
-rw-r--r--usr.sbin/named/Makefile80
-rw-r--r--usr.sbin/named/db_dump.c13
-rw-r--r--usr.sbin/named/db_load.c10
-rw-r--r--usr.sbin/named/dmalloc.c4
-rw-r--r--usr.sbin/named/named.8378
-rw-r--r--usr.sbin/named/named.h4
-rw-r--r--usr.sbin/named/options.h160
-rw-r--r--usr.sbin/named/portability.h456
-rw-r--r--usr.sbin/named/storage.c4
-rw-r--r--usr.sbin/named/tools/Makefile5
-rw-r--r--usr.sbin/named/tools/named.reload/Makefile18
-rw-r--r--usr.sbin/named/tools/named.reload/named.reload.869
-rw-r--r--usr.sbin/named/tools/named.restart/Makefile20
-rw-r--r--usr.sbin/named/tools/named.restart/named.restart.873
-rw-r--r--usr.sbin/named/tools/nsquery/Makefile7
-rw-r--r--usr.sbin/named/tools/nsquery/nsquery.c2
-rw-r--r--usr.sbin/named/tools/nstest/Makefile7
-rw-r--r--usr.sbin/named/tools/nstest/nstest.c1
-rw-r--r--usr.sbin/named/xfer/Makefile11
-rw-r--r--usr.sbin/named/xfer/named-xfer.8146
-rw-r--r--usr.sbin/named/xfer/named-xfer.c8
21 files changed, 1458 insertions, 18 deletions
diff --git a/usr.sbin/named/Makefile b/usr.sbin/named/Makefile
new file mode 100644
index 0000000..9b225f4
--- /dev/null
+++ b/usr.sbin/named/Makefile
@@ -0,0 +1,80 @@
+#
+# @(#)Makefile 5.8 (Berkeley) 7/28/90
+#
+
+## ++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--
+
+PROG= named
+MAN8= named.8 named.restart.8 named.reload.8
+LDADD= -lutil
+SRCS= db_dump.c db_load.c db_lookup.c db_reload.c db_save.c db_update.c \
+ db_secure.c db_glue.c \
+ ns_forw.c ns_init.c ns_main.c ns_maint.c ns_req.c ns_resp.c \
+ ns_sort.c ns_stats.c ns_validate.c ns_ncache.c \
+ storage.c dmalloc.c tree.c
+OBJS+= version.o
+CLEANFILES+=version.c version.o
+SUBDIR= tools xfer
+
+VER = LOCAL-`date +%y%m%d.%H%M%S`
+
+version.c: ${.CURDIR}/Version.c ${.CURDIR}/Makefile ${SRCS}
+ (u=$${USER-root} d=`pwd |sed -e 's|/obj/|/src/|'` \
+ h=`hostname` t=`date`; \
+ sed -e "s|%WHEN%|$${t}|" -e "s|%VERSION%|"${VER}"|" \
+ -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
+ < ${.CURDIR}/Version.c > version.c)
+
+.include <bsd.prog.mk>
+
diff --git a/usr.sbin/named/db_dump.c b/usr.sbin/named/db_dump.c
index 4a0d2c9..3c9b5a4 100644
--- a/usr.sbin/named/db_dump.c
+++ b/usr.sbin/named/db_dump.c
@@ -1,6 +1,6 @@
#if !defined(lint) && !defined(SABER)
static char sccsid[] = "@(#)db_dump.c 4.33 (Berkeley) 3/3/91";
-static char rcsid[] = "$Id: db_dump.c,v 4.9.1.12 1994/07/22 08:42:39 vixie Exp $";
+static char rcsid[] = "$Id: db_dump.c,v 1.1.1.1 1994/09/22 19:46:10 pst Exp $";
#endif /* not lint */
/*
@@ -61,6 +61,7 @@ static char rcsid[] = "$Id: db_dump.c,v 4.9.1.12 1994/07/22 08:42:39 vixie Exp $
#include <sys/param.h>
#include <sys/stat.h>
#include <netinet/in.h>
+#include <netiso/iso.h>
#include <arpa/nameser.h>
#include <arpa/inet.h>
#include <netdb.h>
@@ -341,6 +342,7 @@ db_dump(htp, fp, zone, origin)
u_int32_t n;
u_int32_t addr;
int j, i;
+ struct iso_addr isoa;
register u_char *cp;
u_char *end;
char *proto, *sep;
@@ -529,9 +531,12 @@ db_dump(htp, fp, zone, origin)
break;
case T_NSAP:
- (void) fputs(inet_nsap_ntoa(dp->d_size,
- dp->d_data, NULL),
- fp);
+ isoa.isoa_len = dp->d_size;
+ if (isoa.isoa_len > sizeof(isoa.isoa_genaddr))
+ isoa.isoa_len = sizeof(isoa.isoa_genaddr);
+ bcopy(dp->d_data, isoa.isoa_genaddr,
+ isoa.isoa_len);
+ (void) fputs(iso_ntoa(&isoa), fp);
break;
case T_UINFO:
diff --git a/usr.sbin/named/db_load.c b/usr.sbin/named/db_load.c
index dfd46e3..ef6d0b4 100644
--- a/usr.sbin/named/db_load.c
+++ b/usr.sbin/named/db_load.c
@@ -65,6 +65,7 @@ static char rcsid[] = "$Id: db_load.c,v 4.9.1.18 1994/07/23 23:23:56 vixie Exp $
#include <sys/param.h>
#include <sys/stat.h>
#include <netinet/in.h>
+#include <netiso/iso.h>
#include <arpa/nameser.h>
#include <arpa/inet.h>
#include <stdio.h>
@@ -173,6 +174,7 @@ db_load(filename, in_origin, zp, doinginclude)
int c, class, type, ttl, dbflags, dataflags, multiline;
static int read_soa; /* number of soa's read */
struct databuf *dp;
+ struct iso_addr *isoa;
FILE *fp;
int slineno, i, errs = 0, didinclude = 0;
register u_int32_t n;
@@ -562,9 +564,11 @@ db_load(filename, in_origin, zp, doinginclude)
break;
case T_NSAP:
- n = inet_nsap_addr(buf, data, MAXDATA);
- if (n == 0)
- goto err;
+ isoa = iso_addr(buf);
+ if (!isoa)
+ goto err;
+ n = isoa->isoa_len;
+ bcopy(isoa->isoa_genaddr, data, n);
endline(fp);
break;
#ifdef ALLOW_T_UNSPEC
diff --git a/usr.sbin/named/dmalloc.c b/usr.sbin/named/dmalloc.c
index 4373024..f30dec4 100644
--- a/usr.sbin/named/dmalloc.c
+++ b/usr.sbin/named/dmalloc.c
@@ -3,7 +3,7 @@
* vix 24mar92 [added size calcs, improved printout]
* vix 22mar92 [original work]
*
- * $Id: dmalloc.c,v 4.9.1.3 1994/07/02 16:28:11 vixie Exp $
+ * $Id: dmalloc.c,v 1.1.1.1 1994/09/22 19:46:14 pst Exp $
*/
/*
@@ -63,8 +63,6 @@
#include <stdio.h>
#include <signal.h>
-#include "../conf/portability.h"
-#include "../conf/options.h"
#ifdef DMALLOC
diff --git a/usr.sbin/named/named.8 b/usr.sbin/named/named.8
new file mode 100644
index 0000000..9ab4e49
--- /dev/null
+++ b/usr.sbin/named/named.8
@@ -0,0 +1,378 @@
+.\" ++Copyright++ 1985
+.\" -
+.\" Copyright (c) 1985
+.\" 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--
+.\"
+.\" @(#)named.8 6.6 (Berkeley) 2/14/89
+.\"
+.TH @INDOT_U@NAMED @SYS_OPS_EXT_U@ "April 17, 1993"
+.UC 4
+.SH NAME
+@INDOT@named \- Internet domain name server
+.SH SYNOPSIS
+.B @INDOT@named
+[
+.B \-d
+.I debuglevel
+] [
+.B \-p
+.I port#
+] [{\-b}
+.I bootfile
+] [
+.B \-q
+] [
+.B \-r
+]
+.SH DESCRIPTION
+.I Named
+is the Internet domain name server.
+See RFC's 1033, 1034, and 1035 for more information on the Internet
+name-domain system. Without any arguments,
+.I named
+will read the default boot file
+.IR /etc/named.boot ,
+read any initial data and listen for queries.
+.PP
+Options are:
+.TP
+.B \-d
+Print debugging information.
+A number after the ``d'' determines the level of
+messages printed.
+.TP
+.B \-p
+Use a different port number. The default is the standard port number
+as returned by getservbyname(@LIB_NETWORK_EXT@) for service ``domain''.
+.TP
+.B \-b
+Use an alternate boot file. This is optional and allows you to
+specify a file with a leading dash.
+.TP
+.B \-q
+Trace all incoming queries if \fInamed\fP has been compiled with
+\fIQRYLOG\fP defined.
+.TP
+.B \-r
+Turns recursion off in the server. Answers can come only from local
+(primary or secondary) zones. This can be used on root servers.
+.PP
+Any additional argument is taken as the name of the boot file.
+If multiple boot files are specified, only the last is used.
+.PP
+The boot file contains information about where the name server is to get
+its initial data.
+Lines in the boot file cannot be continued on subsequent lines.
+The following is a small example:
+.in +2m
+.nf
+
+;
+; boot file for name server
+;
+directory /usr/local/adm/named
+
+.ta \w'forwarders\ 'u +\w'6.32.128.IN-ADDR.ARPA\ 'u +\w'128.32.137.8 128.32.137.3\ 'u
+; type domain source host/file backup file
+
+cache . root.cache
+primary Berkeley.EDU berkeley.edu.zone
+primary 32.128.IN-ADDR.ARPA ucbhosts.rev
+secondary CC.Berkeley.EDU 128.32.137.8 128.32.137.3 cc.zone.bak
+secondary 6.32.128.IN-ADDR.ARPA 128.32.137.8 128.32.137.3 cc.rev.bak
+primary 0.0.127.IN-ADDR.ARPA localhost.rev
+forwarders 10.0.0.78 10.2.0.78
+; slave
+
+.DT
+.fi
+.in
+The ``directory'' line causes the server to change its working directory to
+the directory specified. This can be important for the correct processing
+of \s-1$INCLUDE\s+1 files in primary zone files.
+.LP
+The ``cache'' line specifies that data in ``root.cache'' is to be placed in
+the backup cache. Its main use is to specify data such as locations of root
+domain servers. This cache is not used during normal operation, but is used
+as ``hints'' to find the current root servers. The file ``root.cache'' is
+in the same format as ``berkeley.edu.zone''. There can be more than one
+``cache'' file specified. The ``root.cache'' file should be retrieved
+periodically from \s-1FTP.RS.INTERNIC.NET\s+1 since it contains a list of
+root servers, and this list changes periodically.
+.LP
+The first example ``primary'' line states that the file
+``berkeley.edu.zone'' contains authoritative data for the ``Berkeley.EDU''
+zone. The file ``berkeley.edu.zone'' contains data in the master file
+format described in RFC883. All domain names are relative to the origin, in
+this case, ``Berkeley.EDU'' (see below for a more detailed description).
+The second ``primary'' line states that the file ``ucbhosts.rev'' contains
+authoritative data for the domain ``32.128.IN-ADDR.ARPA,'' which is used to
+translate addresses in network 128.32 to hostnames. Each master file should
+begin with an SOA record for the zone (see below).
+.LP
+The first example ``secondary'' line specifies that all authoritative data
+under ``CC.Berkeley.EDU'' is to be transferred from the name server at
+128.32.137.8. If the transfer fails it will try 128.32.137.3 and continue
+trying the addresses, up to 10, listed on this line. The secondary copy is
+also authoritative for the specified domain. The first non-dotted-quad
+address on this line will be taken as a filename in which to backup the
+transferred zone. The name server will load the zone from this backup file
+if it exists when it boots, providing a complete copy even if the master
+servers are unreachable. Whenever a new copy of the domain is received by
+automatic zone transfer from one of the master servers, this file will be
+updated. If no file name is given, a temporary file will be used, and will
+be deleted after each successful zone transfer. This is not recommended
+since it is a needless waste of bandwidth. The second example ``secondary''
+line states that the address-to-hostname mapping for the subnet 128.32.136
+should be obtained from the same list of master servers as the previous zone.
+.LP
+The ``forwarders'' line specifies the addresses of sitewide servers that
+will accept recursive queries from other servers. If the boot file
+specifies one or more forwarders, then the server will send all queries for
+data not in the cache to the forwarders first. Each forwarder will be asked
+in turn until an answer is returned or the list is exhausted. If no answer
+is forthcoming from a forwarder, the server will continue as it would have
+without the forwarders line unless it is in ``slave'' mode. The forwarding
+facility is useful to cause a large sitewide cache to be generated on a
+master, and to reduce traffic over links to outside servers. It can also be
+used to allow servers to run that do not have access directly to the
+Internet, but wish to act as though they do.
+.LP
+The ``slave'' line (shown commented out) is used to put the server in slave
+mode. In this mode, the server will only make queries to forwarders. This
+option is normally used on machine that wish to run a server but for
+physical or administrative reasons cannot be given access to the Internet,
+but have access to a host that does have access.
+.LP
+The ``sortlist'' line can be used to indicate networks that are to be
+preferred over other networks Queries for host addresses from hosts on the
+same network as the server will receive responses with local network
+addresses listed first, then addresses on the sort list, then other
+addresses.
+.LP
+The ``xfrnets'' directive (not shown) can be used to implement primative
+access control. If this directive is given, then your name server will
+only answer zone transfer requests from hosts which are on networks listed
+in your ``xfrnets'' directives. This directive may also be given as
+``tcplist'' for compatibility with older, interrim servers.
+.LP
+The ``include'' directive (not shown) can be used to process the contents
+of some other file as though they appeared in place of the ``include''
+directive. This is useful if you have a lot of zones or if you have
+logical groupings of zones which are maintained by different people.
+The ``include'' directive takes one argument, that being the name of the
+file whose contents are to be included. No quotes are necessary around
+the file name.
+.LP
+The ``bogusns'' directive (not shown) tells \s-1BIND\s+1 that no queries
+are to be sent to the specified name server addresses (which are specified
+as dotted quads, not as domain names). This is useful when you know that
+some popular server has bad data in a zone or cache, and you want to avoid
+contamination while the problem is being fixed.
+.LP
+The ``max-fetch'' directive (not shown) can be used to override the default
+limit (which is 10) to the number of named-xfer subprocesses which \s-1BIND\s+1
+can spawn at any one time.
+.PP
+The master file consists of control information and a list of resource
+records for objects in the zone of the forms:
+.RS
+.nf
+
+$INCLUDE <filename> <opt_domain>
+$ORIGIN <domain>
+<domain> <opt_ttl> <opt_class> <type> <resource_record_data>
+
+.fi
+.RE
+where
+.I domain
+is "." for root, "@" for the current origin, or a standard domain
+name. If
+.I domain
+is a standard domain name that does not end with ``.'', the current origin
+is appended to the domain. Domain names ending with ``.'' are
+unmodified.
+The
+.I opt_domain
+field is used to define an origin for the data in an included file.
+It is equivalent to placing a $ORIGIN statement before the first
+line of the included file. The field is optional.
+Neither the
+.I opt_domain
+field nor $ORIGIN statements in the included file modify the current origin
+for this file.
+The
+.I opt_ttl
+field is an optional integer number for the time-to-live field.
+It defaults to zero, meaning the minimum value specified in the SOA
+record for the zone.
+The
+.I opt_class
+field is the object address type; currently only one type is supported,
+.BR IN ,
+for objects connected to the DARPA Internet.
+The
+.I type
+field contains one of the following tokens; the data expected in the
+.I resource_record_data
+field is in parentheses.
+.TP "\w'MINFO 'u"
+A
+a host address (dotted quad)
+.IP NS
+an authoritative name server (domain)
+.IP MX
+a mail exchanger (domain), preceded by a preference value (0..32767),
+with lower numeric values representing higher logical preferences.
+.IP CNAME
+the canonical name for an alias (domain)
+.IP SOA
+marks the start of a zone of authority (domain of originating host,
+domain address of maintainer, a serial number and the following
+parameters in seconds: refresh, retry, expire and minimum TTL (see RFC883)).
+.IP NULL
+a null resource record (no format or data)
+.IP RP
+a Responsible Person for some domain name (mailbox, TXT-referral)
+.IP PTR
+a domain name pointer (domain)
+.IP HINFO
+host information (cpu_type OS_type)
+.PP
+Resource records normally end at the end of a line,
+but may be continued across lines between opening and closing parentheses.
+Comments are introduced by semicolons and continue to the end of the line.
+.PP
+Note that there are other resource record types, not shown here. You should
+consult the \s-1BIND\s+1 Operations Guide (``\s-1BOG\s+1'') for the complete
+list. Some resource record types may have been standardized in newer RFC's
+but not yet implemented in this version of \s-1BIND\s+1.
+.PP
+Each master zone file should begin with an SOA record for the zone.
+An example SOA record is as follows:
+.LP
+.nf
+@ IN SOA ucbvax.Berkeley.EDU. rwh.ucbvax.Berkeley.EDU. (
+ 1989020501 ; serial
+ 10800 ; refresh
+ 3600 ; retry
+ 3600000 ; expire
+ 86400 ) ; minimum
+.fi
+.LP
+The SOA specifies a serial number, which should be changed each time the
+master file is changed. Note that the serial number can be given as a
+dotted number, but this is a \fIvery\fP unwise thing to do since the
+translation to normal integers is via concatenation rather than
+multiplication and addition. You can spell out the year, month, day of
+month, and 0..99 version number and still fit inside the unsigned 32-bit
+size of this field. It's true that we will have to rethink this strategy in
+the year 4294 (Greg.) but we're not worried about it. Secondary servers
+check the serial number at intervals specified by the refresh time in
+seconds; if the serial number changes, a zone transfer will be done to load
+the new data. If a master server cannot be contacted when a refresh is due,
+the retry time specifies the interval at which refreshes should be attempted.
+If a master server cannot be contacted within the interval given by the
+expire time, all data from the zone is discarded by secondary servers. The
+minimum value is the time-to-live (``\s-1TTL\s+1'') used by records in the
+file with no explicit time-to-live value.
+.SH NOTES
+The boot file directives ``domain'' and ``suffixes'' have been
+obsoleted by a more useful resolver-based implementation of
+suffixing for partially qualified domain names. The prior mechanisms
+could fail under a number of situations, especially when then local
+nameserver did not have complete information.
+.sp
+The following signals have the specified effect when sent to the
+server process using the
+.IR kill (@CMD_EXT@)
+command.
+.IP SIGHUP
+Causes server to read named.boot and reload database. If the server
+is built with the FORCED_RELOAD compile-time option, then SIGHUP will
+also cause the server to check the serial number on all secondary zones.
+Normally the serial numbers are only checked at the SOA-specified intervals.
+.IP SIGINT
+Dumps current data base and cache to /var/tmp/named_dump.db
+.IP SIGIOT
+Dumps statistics data into /var/tmp/named.stats if the server is
+compiled -DSTATS. Statistics data is appended to the file.
+.IP SIGSYS
+Dumps the profiling data in /var/tmp if the server is compiled
+with profiling (server forks, chdirs and exits).
+.IP SIGTERM
+Dumps the primary and secondary database files.
+Used to save modified data on shutdown if the
+server is compiled with dynamic updating enabled.
+.IP SIGUSR1
+Turns on debugging; each SIGUSR1 increments debug level.
+(SIGEMT on older systems without SIGUSR1)
+.IP SIGUSR2
+Turns off debugging completely.
+(SIGFPE on older systems without SIGUSR2)
+.IP SIGWINCH
+Toggles logging of all incoming queries via syslog(@SYS_OPS_EXT@)
+(requires server to have been built with the QRYLOG option).
+.SH FILES
+.nf
+.ta \w'/var/tmp/named_dump.db 'u
+/etc/named.boot name server configuration boot file
+/etc/named.pid the process id (/var/run/named.pid on newer systems)
+/var/tmp/named.run debug output
+/var/tmp/named_dump.db dump of the name server database
+/var/tmp/named.stats nameserver statistics data
+.fi
+.SH "SEE ALSO"
+kill(@CMD_EXT@), gethostbyname(@LIB_NETWORK_EXT@), signal(@SYSCALL_EXT@),
+resolver(@LIB_NETWORK_EXT@), resolver(@FORMAT_EXT@), hostname(@DESC_EXT@),
+RFC 882, RFC 883, RFC 973, RFC 974, RFC 1033, RFC 1034, RFC 1035, RFC 1123,
+\fIName Server Operations Guide for \s-1BIND\s+1\fR
diff --git a/usr.sbin/named/named.h b/usr.sbin/named/named.h
index 4e597d7..e3e795d 100644
--- a/usr.sbin/named/named.h
+++ b/usr.sbin/named/named.h
@@ -4,8 +4,8 @@
* $Id: named.h,v 1.1 1993/09/08 04:57:40 vixie Exp $
*/
-#include "../conf/portability.h"
-#include "../conf/options.h"
+#include "options.h"
+#include "portability.h"
#include "pathnames.h"
diff --git a/usr.sbin/named/options.h b/usr.sbin/named/options.h
new file mode 100644
index 0000000..8461389
--- /dev/null
+++ b/usr.sbin/named/options.h
@@ -0,0 +1,160 @@
+/* options.h - specify the conditionally-compiled features
+ * vix 28mar92 [moved out of the Makefile because they were getting too big]
+ *
+ * $Id: options.h,v 4.9.1.16 1994/07/22 08:42:30 vixie Exp $
+ */
+
+/*
+ * ++Copyright++
+ * -
+ * Copyright (c)
+ * 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--
+ */
+
+/* Key:
+ * ucb = U C Berkeley 4.8.3 release
+ * vix = Paul Vixie of Digital
+ * del = Don Lewis of Harris
+ * mcsun = Piet Beertema of EUNet
+ * asp = Andrew Partan of UUNet
+ * pma = Paul Albitz of Hewlett Packard
+ * bb = Bryan Beecher of UMich
+ * mpa = Mark Andrews of CSIRO - DMS
+ * rossc = Ross Cartlidge of The Univeritsy of Sydney
+ * mtr = Marshall Rose of TPC.INT
+ */
+
+#define DEBUG /* enable -d flag and SIGUSR[12] support (ucb) */
+/*#define ALLOW_T_UNSPEC /* enable the "unspec" RR type for old athena (ucb) */
+#define INVQ /* enable inverse queries (nslookup) (ucb/vix) */
+/*#define DSTORAGE /* debug malloc overruns using storage.o (ucb/vix) */
+/*#define DMALLOC /* trace malloc orphans using dmalloc.o (vix) */
+#define XFRNETS /* enable "xfrnets" command in named.boot (vix) */
+#define PID_FIX /* be careful about overwriting named.pid file (del) */
+#define FWD_LOOP /* try to break out of forwarding loops (del) */
+#define NO_GLUE /* don't accept or send out-of-zone glue (del) */
+#define BOGUSNS /* detect bogus nameservers (mcsun) */
+#define QRYLOG /* enable SIGWINCH for query logging (bb) */
+/*#define YPKLUDGE /* deal effectively with broken "ypserv -i" (mcsun) */
+#define TRACEROOT /* trace bogus root servers and ignore them (pma,bb) */
+/*#define LOCALDOM /* permit "domain" directive in named.boot (ucb) */
+#define FORCED_RELOAD /* refresh secondary zones on SIGHUP (pma) */
+#define SLAVE_FORWARD /* use sensible timeouts on slave forwarders (pma) */
+#define WANT_PIDFILE /* if you want the named.pid file (ucb/arc) */
+#define DOTTED_SERIAL /* if you want to be able to specify dotted serial#s */
+/*#define SENSIBLE_DOTS /* if you want dotted serial#s to make numeric sense */
+#define NCACHE /* negative caching (anant@isi.edu) */
+#define VALIDATE /* validation procedure (anant@isi.edu) */
+/*#define SHORT_FNAMES /* file names used in named-xfer need to be short */
+#define RESOLVSORT /* allow sorting of addresses in gethostbyname (mpa) */
+#define STUBS /* allow transfers of NS only for a zone (mpa) (EXP) */
+/*#define SUNSECURITY /* obscure fix for sunos (see below) */
+#define LOGFAC LOG_DAEMON /* what syslog facility should named use? */
+/*#define SECURE_ZONES /* if you want to inhibit world access to zone(s) */
+#define ROUND_ROBIN /* rotate databuf list after each access (mtr) */
+#define ADDAUTH /* return NS and glue w/ authorative answers (mpa) */
+#define RFC1535 /* use RFC 1535 default for "search" list (vix) */
+#define GEN_AXFR /* distinct zones within each class */
+#define DATUMREFCNT /* use reference counts on datums (mpa) */
+#define LAME_DELEGATION /* lame delegations (original-del,reworked-bb&del)*/
+#define LAME_LOGGING LOG_WARNING /* log lame delegations, set log level */
+#define GETSER_LOGGING LOG_INFO /* log errors/timeouts getting serial number */
+/*#define RETURNSOA /* good code that the world isn't ready for yet */
+#define CLEANCACHE /* useful and necessary in the face of NCACHE */
+#define STATS /* keep nameserver statistics; uses more memory */
+/*#define RENICE /* named-xfer should run at normal priority */
+
+/*--------------------------------------------*
+ * no user-servicable parts beyond this point *
+ *--------------------------------------------*/
+
+/* if DSTORAGE is defined, we need to disable DMALLOC and remap
+ * malloc and free to storage.o's exported names. storage.o also
+ * includes a calloc and a realloc, but once we drag in its malloc
+ * and free we'll get the others automatically and so will never
+ * pull in those routines from libc.a.
+ */
+#ifdef DSTORAGE
+# ifdef DMALLOC
+# undef DMALLOC
+# endif /*DMALLOC*/
+# define malloc rt_malloc
+# define free rt_free
+#endif /*DSTORAGE*/
+
+/* if DMALLOC is defined, grab the header file which will remap
+ * all the malloc-style names to those exported by dmalloc.o. note
+ * that DMALLOC also changes the function signatures of several
+ * functions in private named source modules, and that this file
+ * (options.h) must be included before any other private *.h files
+ * since those *.h files have some conditional remapping to do.
+ */
+#ifdef DMALLOC
+# include "dmalloc.h"
+#endif
+
+/* systems with killall(1M) don't need this
+ */
+#ifdef __sgi
+# ifdef WANT_PIDFILE
+# undef WANT_PIDFILE
+# endif
+#endif
+
+#if defined(SUNOS4) || (defined(sun) && defined(SYSV))
+# ifndef SUNSECURITY
+# define SUNSECURITY /* mandatory on suns and rlogin etc. depend on this */
+# endif
+#endif
+
+#ifdef LAME_LOGGING
+# define LAME_DELEGATION
+#endif
diff --git a/usr.sbin/named/portability.h b/usr.sbin/named/portability.h
new file mode 100644
index 0000000..1aeb233
--- /dev/null
+++ b/usr.sbin/named/portability.h
@@ -0,0 +1,456 @@
+/* defs.h - include or define things that aren't present on all systems
+ * vixie@decwrl 26dec92 [new]
+ *
+ * $Id: portability.h,v 4.9.1.24 1994/07/22 08:42:30 vixie Exp $
+ */
+
+/*
+ * ++Copyright++
+ * -
+ * Copyright (c)
+ * 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--
+ */
+
+/* XXX: this file has become a hopeless morass, and will be redone someday. */
+
+#include <string.h>
+#include <sys/types.h>
+#include <sys/param.h>
+#ifndef TIME_H_INCLUDED
+# include <sys/time.h>
+# define TIME_H_INCLUDED
+#endif
+
+#if defined(__convex__)
+# if !defined(_POSIX_SOURCE)
+# define _POSIX_SOURCE
+# endif
+# define USE_UTIME
+# define NEED_PUTENV
+#endif
+
+#if defined(_CRAY)
+# if !defined(_POSIX_SOURCE)
+# define _POSIX_SOURCE
+# endif
+# define writev(a,b,c) __writev(a,b,c)
+# define setitimer(a,b,c) __setitimer(a,b,c)
+#endif
+
+/* SCO UNIX defines only this unique symbol, apparently. */
+#if defined(M_UNIX)
+/* XXX - why is this POSIX_SOURCE instead of _POSIX_SOURCE? */
+# undef POSIX_SOURCE
+# define POSIX_SIGNALS
+# define HAVE_FCHMOD 0
+# define writev(a,b,c) __writev(a,b,c)
+# define ftruncate(a,b) __ftruncate(a,b)
+#endif
+
+#ifdef NeXT
+# define NEED_PUTENV
+# define NEED_SETENV
+#endif
+
+#if defined(__sgi)
+# define BSD 43
+# define vfork fork
+#endif
+
+#if defined(SUNOS4)
+# define BSD 43
+#endif
+
+#if defined(_POSIX_SOURCE) || defined(__sgi) || defined(ultrix) || \
+ defined(__hpux) || (defined(BSD) && (BSD >= 199103)) || \
+ (defined(sun) && defined(SYSV))
+# define USE_POSIX
+#endif
+
+#if defined(ultrix) && !defined(BSD)
+# define BSD 42
+#endif
+
+#if defined(host_mips) && defined(SYSTYPE_BSD43)
+# define RISCOS_BSD
+#endif
+
+#if defined(SVR4) && !defined(SYSV)
+# define SYSV
+#endif
+
+#if defined(SYSV) || defined(ultrix) || (defined(BSD) && BSD >= 199306)
+# define USE_UTIME
+#endif
+
+#if defined(BSD) && BSD >= 199006 && !defined(i386) && !defined(RISCOS_BSD)
+# define HAVE_DAEMON
+#endif
+
+#if defined(__hpux)
+# if defined(__STDC__)
+# define select(a,b,c,d,e) select(a, (int *)b, (int *)c, (int *)d, e)
+# define ctime(x) ctime((const time_t *)x)
+# endif /*__STDC__*/
+# ifndef SYSV
+# define USE_UTIME
+# define setlinebuf(x) setvbuf(x, NULL, _IOLBF, BUFSIZ)
+# define SIGWINCH SIGWINDOW
+# endif /*SYSV*/
+#endif /*__hpux*/
+
+#if defined(_SEQUENT_)
+# include <netinet/in_systm.h>
+# define USE_UTIME
+# define USE_POSIX
+# define NEED_GETTIMEOFDAY
+# define _TIMEZONE timezoneBSD
+struct timezoneBSD {
+ int tz_minuteswest;
+ int tz_dsttime;
+};
+#endif
+
+#ifndef __P
+# if defined(__STDC__) || defined(__GNUC__)
+# define __P(x) x
+# else
+# define __P(x) ()
+# endif
+#endif
+
+#ifndef _TIMEZONE
+# define _TIMEZONE timezone
+#endif
+
+#if defined(USE_POSIX)
+# include <stdlib.h>
+# include <unistd.h>
+# include <limits.h>
+
+#else
+
+# define NEED_STRTOUL
+
+# define STDIN_FILENO 0
+# define STDOUT_FILENO 1
+# define STDERR_FILENO 2
+# ifndef NeXT
+extern char *getenv __P((char *));
+# else
+extern char *getenv __P((const char *));
+# endif
+extern int errno;
+
+# if !defined(DMALLOC) && !defined(NeXT)
+extern char *malloc(), *realloc(), *calloc();
+# if defined(sun)
+extern int free();
+# else
+extern void free();
+# endif
+# endif
+
+extern int getdtablesize __P((void));
+# ifdef SHORT_FNAMES
+extern long pathconf __P((const char *path, int name));
+# endif
+
+#endif /*USE_POSIX*/
+
+#ifndef UINT_MAX
+# ifdef __STDC__
+# define UINT_MAX 4294967295u /* max value of an "u_int" */
+# else
+# define UINT_MAX ((unsigned)4294967295) /* max value of an "u_int" */
+# endif
+# define ULONG_MAX UINT_MAX /* max decimal value of a "u_long" */
+#endif
+
+#ifndef INT_MAX
+# define INT_MAX 2147483647 /* max decimal value of an "int" */
+#endif
+
+#ifndef IN_LOOPBACKNET
+# define IN_LOOPBACKNET 127
+#endif
+
+#ifndef INADDR_NONE
+# define INADDR_NONE 0xffffffff
+#endif
+
+#if defined(apollo)
+ /* Defined in /usr/include/netinet/in.h but doesn't work */
+#undef IP_OPTIONS
+#endif
+
+#if !defined(__STDC__) && !defined(const)
+# define const /*constant*/
+#endif
+
+#if !defined(__convex__) && (!defined(BSD) || (BSD < 199103))
+int strcasecmp __P((const char *, const char *));
+#endif
+
+/* is USE_POSIX the right thing to use here? */
+#if (!defined(BSD) || (BSD <= 43)) && \
+ !defined(NeXT) && \
+ !defined(__convex__) && \
+ !defined(USE_POSIX)
+extern void syslog();
+extern char *ctime __P((const time_t *clock));
+extern int close(), setitimer(), recv(), sendto(), sigsetmask(),
+ atoi(), getpid(), fork(), read(), ioctl(),
+ setsockopt(), socket(), bind();
+#endif
+
+#if !defined(bcopy) /* some machines have their own macros for this */
+# if defined(USE_POSIX) || \
+ (defined(__STDC__) && !defined(sun) && !defined(sequent))
+/* use ANSI C3.159-1989 (``ANSI C'') functions if possible;
+ * ideally we would change the code to use them and then
+ * define them in terms of bcopy et al if !defined(__STDC__)
+ * but that's more work.
+ */
+# define bcopy(a,b,c) memmove(b,a,c)
+# define bzero(a,b) memset(a,0,b)
+# define bcmp(a,b,c) memcmp(a,b,c)
+# else
+extern void bcopy();
+extern void bzero();
+extern int bcmp();
+# endif /* BSD */
+#endif /* bcopy */
+
+#if (!defined(BSD) || (BSD < 43) || defined(RISCOS_BSD)) \
+ && !defined(USE_POSIX) && !defined(apollo) && !defined(sequent) \
+ && !defined(M_UNIX)
+# define NEED_STRERROR
+# define NEED_PUTENV
+#endif
+
+#if defined(SUNOS4)
+# define NEED_STRERROR
+#endif
+
+#if (!defined(BSD) || (BSD < 43))
+# define NEED_MKSTEMP
+# if !defined(ultrix) && !defined(apollo)
+# define NEED_STRCASECMP
+# define NEED_MKTEMP
+# define NEED_STRPBRK
+# endif
+#endif
+
+#if defined(USE_POSIX)
+# define POSIX_SIGNALS
+#endif
+
+/*
+ * Attempt to configure for type of function returned by signal-catching
+ * functions (which signal and sigvec.sv_handler take a pointer to).
+ * This can guess for BSD; otherwise, define SIG_FN externally.
+ */
+#ifndef SIG_FN
+# ifdef BSD
+# if (BSD >= 199006) || defined(NeXT) || defined(__osf__) || defined(sun) \
+ || defined(ultrix) || defined(apollo) || defined(POSIX_SIGNALS)
+# define SIG_FN void /* signal-catching functions return void */
+# else
+# define SIG_FN int /* signal-catching functions return int */
+# endif
+# else /*BSD*/
+# define SIG_FN void /* signal-catching functions return void */
+# endif /*BSD*/
+#endif
+
+#if !defined(ntohl) && !defined(htonl) && defined(BSD) && (BSD <= 43)
+/* if these aren't null macros in netinet/in.h, extern them here. */
+extern u_short htons(), ntohs();
+extern u_long htonl(), ntohl();
+#endif
+
+#if defined(USE_POSIX) && !defined(sun) && !defined(__sgi) \
+ && !defined(__convex__) && !defined(ultrix)
+# define PORT_NONBLOCK O_NONBLOCK
+# define PORT_WOULDBLK EAGAIN
+#else
+# define PORT_NONBLOCK O_NDELAY
+# define PORT_WOULDBLK EWOULDBLOCK
+#endif
+
+#if defined(USE_POSIX)
+# define USE_SETSID
+#endif
+
+#if defined(USE_POSIX) || !defined(SYSV)
+#define USE_WAITPID
+#endif
+
+#if !defined(USE_POSIX)
+#define waitpid(x,y,z) (wait3(y,z,(struct rusage *)NULL))
+#endif
+
+#if defined(NeXT) || defined(_AIX)
+# undef WIFEXITED
+# undef WEXITSTATUS
+# undef WIFSIGNALED
+# undef WTERMSIG
+#endif /* NeXT */
+
+#if defined(sequent)
+#define WEXITSTATUS(x) ((x).w_retcode)
+#define WTERMSIG(x) ((x).w_termsig)
+#endif /* sequent */
+
+#if !defined(WIFEXITED)
+# define WIFEXITED(x) (!(x & 0200))
+#endif
+#if !defined(WEXITSTATUS)
+# define WEXITSTATUS(x) (x >> 8)
+#endif
+#if !defined(WIFSIGNALED)
+# define WIFSIGNALED(x) ((x & 0200) && ((x & 0200) != 0177))
+#endif
+#if !defined(WTERMSIG)
+# define WTERMSIG(x) (x & 0177)
+#endif
+
+#ifndef S_ISDIR
+# ifndef S_IFMT
+# define S_IFMT 0170000
+# endif
+# ifndef S_IFDIR
+# define S_IFDIR 0040000
+# endif
+# define S_ISDIR(m) ((m & S_IFMT) == S_IFDIR)
+#endif
+
+#ifndef S_ISREG
+# ifndef S_IFMT
+# define S_IFMT 0170000
+# endif
+# ifndef S_IFREG
+# define S_IFREG 0100000
+# endif
+# define S_ISREG(m) ((m & S_IFMT) == S_IFREG)
+#endif
+
+#ifndef S_ISFIFO
+# ifndef S_IFMT
+# define S_IFMT 0170000
+# endif
+# ifndef S_IFIFO
+# define S_IFIFO 0010000
+# endif
+# define S_ISFIFO(m) ((m & S_IFMT) == S_IFIFO)
+#endif
+
+#if (defined(ultrix) || defined(__osf__)) && defined(NEED_STRTOUL)
+# undef NEED_STRTOUL
+#endif
+
+#if defined(ultrix) || defined(__osf__)
+# define MAYBE_HESIOD
+#endif
+
+#ifndef FD_SET
+#define NFDBITS 32
+#define FD_SETSIZE 32
+#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
+#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
+#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
+#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p)))
+#endif
+
+#ifndef MIN
+# define MIN(x, y) ((x > y) ?y :x)
+#endif
+#ifndef MAX
+# define MAX(x, y) ((x > y) ?x :y)
+#endif
+
+#if !defined(PATH_MAX)
+# if defined(_POSIX_PATH_MAX)
+# define PATH_MAX _POSIX_PATH_MAX
+# else
+# if defined(MAXPATHLEN)
+# define PATH_MAX MAXPATHLEN
+# endif
+# endif
+#endif
+
+/*
+ * Because Convex has true library function feof() which is
+ * patently wrong (it test bit _IOREAD) we need feof() as
+ * a macro.
+ */
+#if defined(__convex__) && !defined(feof)
+# define feof(p) ((p)->_flag&_IOEOF)
+#endif
+
+/*
+ * Assume that a system has fchmod() unless something above says otherwise.
+ */
+#if !defined(HAVE_FCHMOD)
+# define HAVE_FCHMOD 1
+#endif
+
+/*
+ * Prototype the functions we'll be supplying.
+ */
+#ifdef NEED_PUTENV
+extern int putenv __P((char *));
+#endif
+
+#ifdef NEED_GETTIMEOFDAY
+extern int gettimeofday __P((struct timeval *, struct _TIMEZONE *));
+#endif
diff --git a/usr.sbin/named/storage.c b/usr.sbin/named/storage.c
index 98a71b3..5f995cc 100644
--- a/usr.sbin/named/storage.c
+++ b/usr.sbin/named/storage.c
@@ -55,8 +55,6 @@
#include <sys/param.h>
#include <syslog.h>
-#include "../conf/portability.h"
-#include "../conf/options.h"
#ifdef DSTORAGE
/*
@@ -83,7 +81,7 @@
* All rights reserved.
*/
#ifndef lint
-static char RCSid[] = "$Id: storage.c,v 4.9.1.2 1993/09/08 00:01:17 vixie Exp $";
+static char RCSid[] = "$Id: storage.c,v 1.1.1.1 1994/09/22 19:46:14 pst Exp $";
#endif
#undef malloc
diff --git a/usr.sbin/named/tools/Makefile b/usr.sbin/named/tools/Makefile
new file mode 100644
index 0000000..4c6be85
--- /dev/null
+++ b/usr.sbin/named/tools/Makefile
@@ -0,0 +1,5 @@
+# @(#)Makefile 4.10 (Berkeley) 5/29/90
+
+SUBDIR= named.reload named.restart nsquery nstest
+
+.include <bsd.subdir.mk>
diff --git a/usr.sbin/named/tools/named.reload/Makefile b/usr.sbin/named/tools/named.reload/Makefile
new file mode 100644
index 0000000..db571da
--- /dev/null
+++ b/usr.sbin/named/tools/named.reload/Makefile
@@ -0,0 +1,18 @@
+# @(#)Makefile 5.1 (Berkeley) 5/28/90
+
+MAN8= named.reload.8
+CLEANFILES+=named.reload
+
+PIDDIR=/var/run
+INDOT=
+
+beforeinstall: named.reload
+ install -c -o ${BINOWN} -g ${BINGRP} -m 555 \
+ ${.CURDIR}/named.reload ${DESTDIR}${BINDIR}
+
+named.reload: named.reload.sh Makefile
+ sed -e "s|%PIDDIR%|${PIDDIR}|" \
+ < named.reload.sh > named.reload
+
+.include "${.CURDIR}/../../../Makefile.inc"
+.include <bsd.prog.mk>
diff --git a/usr.sbin/named/tools/named.reload/named.reload.8 b/usr.sbin/named/tools/named.reload/named.reload.8
new file mode 100644
index 0000000..b838ea0
--- /dev/null
+++ b/usr.sbin/named/tools/named.reload/named.reload.8
@@ -0,0 +1,69 @@
+.\" ++Copyright++ 1987, 1993
+.\" -
+.\" 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.
+.\" -
+.\" 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--
+.\"
+.\" from hostname.7 6.4 (Berkeley) 1/16/90
+.\"
+.TH @INDOT_U@NAMED.RELOAD @SYS_OPS_EXT_U@ "June 26, 1993"
+.UC 5
+.SH NAME
+@INDOT@named.reload \- cause the name server to synchronize its database
+.SH DESCRIPTION
+This command sends a \s-1SIGHUP\s+1 to the running name server. This
+signal is documented in
+.IR named (@SYS_OPS_EXT@).
+.SH BUGS
+Does not check to see if the name server is actually running, and could
+use a stale PID cache file which may result in the death of an unrelated
+process.
+.SH SEE ALSO
+@INDOT@named(@SYS_OPS_EXT@), @INDOT@named.restart(@SYS_OPS_EXT@)
diff --git a/usr.sbin/named/tools/named.restart/Makefile b/usr.sbin/named/tools/named.restart/Makefile
new file mode 100644
index 0000000..69a6512
--- /dev/null
+++ b/usr.sbin/named/tools/named.restart/Makefile
@@ -0,0 +1,20 @@
+# @(#)Makefile 5.1 (Berkeley) 5/28/90
+
+MAN8= named.restart.8
+CLEANFILES+=named.restart
+
+PIDDIR=/var/run
+INDOT=
+
+beforeinstall: named.restart
+ install -c -o ${BINOWN} -g ${BINGRP} -m 555 \
+ ${.CURDIR}/named.restart ${DESTDIR}${BINDIR}
+
+named.restart: named.restart.sh Makefile
+ sed -e "s|%PIDDIR%|${PIDDIR}|" \
+ -e "s|%INDOT%|${INDOT}|" \
+ -e "s|%DESTSBIN%|${BINDIR}|" \
+ < named.restart.sh > named.restart
+
+.include "${.CURDIR}/../../../Makefile.inc"
+.include <bsd.prog.mk>
diff --git a/usr.sbin/named/tools/named.restart/named.restart.8 b/usr.sbin/named/tools/named.restart/named.restart.8
new file mode 100644
index 0000000..034bebd
--- /dev/null
+++ b/usr.sbin/named/tools/named.restart/named.restart.8
@@ -0,0 +1,73 @@
+.\" ++Copyright++ 1987, 1993
+.\" -
+.\" 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.
+.\" -
+.\" 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--
+.\"
+.\" from hostname.7 6.4 (Berkeley) 1/16/90
+.\"
+.TH @INDOT_U@NAMED.RESTART @SYS_OPS_EXT_U@ "June 26, 1993"
+.UC 5
+.SH NAME
+@INDOT@named.restart \- stop and restart the name server
+.SH DESCRIPTION
+This command sends a \s-1SIGKILL\s+1 to the running name server and then
+starts a new one.
+.SH BUGS
+Does not check to see if the name server is actually running, and could
+use a stale PID cache file which may result in the death of an unrelated
+process.
+.PP
+Does not wait after killing the old server before starting a new one; since
+the server could take some time to die and the new one will experience a
+fatal error if the old one isn't gone by the time it starts, you can be left
+in a situation where you have no name server at all.
+.SH SEE ALSO
+@INDOT@named(@SYS_OPS_EXT@), @INDOT@named.reload(@SYS_OPS_EXT@)
diff --git a/usr.sbin/named/tools/nsquery/Makefile b/usr.sbin/named/tools/nsquery/Makefile
new file mode 100644
index 0000000..5263aa1
--- /dev/null
+++ b/usr.sbin/named/tools/nsquery/Makefile
@@ -0,0 +1,7 @@
+# @(#)Makefile 5.1 (Berkeley) 5/28/90
+
+PROG= nsquery
+NOMAN= noman
+
+.include "../../../Makefile.inc"
+.include <bsd.prog.mk>
diff --git a/usr.sbin/named/tools/nsquery/nsquery.c b/usr.sbin/named/tools/nsquery/nsquery.c
index c7ff6eb..2a00de0 100644
--- a/usr.sbin/named/tools/nsquery/nsquery.c
+++ b/usr.sbin/named/tools/nsquery/nsquery.c
@@ -73,7 +73,7 @@ static char rcsid[] = "$Id: nsquery.c,v 4.9.1.4 1994/06/11 22:05:07 vixie Exp $"
#include <stdio.h>
#include <netdb.h>
#include <resolv.h>
-#include "../conf/portability.h"
+#include <string.h>
main(argc, argv)
int argc;
diff --git a/usr.sbin/named/tools/nstest/Makefile b/usr.sbin/named/tools/nstest/Makefile
new file mode 100644
index 0000000..e976d52
--- /dev/null
+++ b/usr.sbin/named/tools/nstest/Makefile
@@ -0,0 +1,7 @@
+# @(#)Makefile 5.1 (Berkeley) 5/28/90
+
+PROG= nstest
+NOMAN= noman
+
+.include "../../../Makefile.inc"
+.include <bsd.prog.mk>
diff --git a/usr.sbin/named/tools/nstest/nstest.c b/usr.sbin/named/tools/nstest/nstest.c
index f20388d..9104a8e 100644
--- a/usr.sbin/named/tools/nstest/nstest.c
+++ b/usr.sbin/named/tools/nstest/nstest.c
@@ -72,7 +72,6 @@ static char rcsid[] = "$Id: nstest.c,v 4.9.1.6 1994/06/01 21:10:11 vixie Exp $";
#include <arpa/nameser.h>
#include <stdio.h>
#include <resolv.h>
-#include "../conf/portability.h"
char *progname;
FILE *log;
diff --git a/usr.sbin/named/xfer/Makefile b/usr.sbin/named/xfer/Makefile
new file mode 100644
index 0000000..16a93c8
--- /dev/null
+++ b/usr.sbin/named/xfer/Makefile
@@ -0,0 +1,11 @@
+# @(#)Makefile 5.1 (Berkeley) 5/28/90
+
+PROG= named-xfer
+SRCS= named-xfer.c db_glue.c
+CFLAGS+=-I${.CURDIR}/..
+.PATH: ${.CURDIR}/..
+BINDIR= /usr/libexec
+NOMAN= noman
+
+.include "../../Makefile.inc"
+.include <bsd.prog.mk>
diff --git a/usr.sbin/named/xfer/named-xfer.8 b/usr.sbin/named/xfer/named-xfer.8
new file mode 100644
index 0000000..54ae2be
--- /dev/null
+++ b/usr.sbin/named/xfer/named-xfer.8
@@ -0,0 +1,146 @@
+.\" ++Copyright++ 1985
+.\" -
+.\" Copyright (c) 1985
+.\" 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--
+.\"
+.\" from named.8 6.6 (Berkeley) 2/14/89
+.\"
+.TH @XFER_INDOT_U@NAMED-XFER @SYS_OPS_EXT_U@ "June 26, 1993"
+.UC 4
+.SH NAME
+@XFER_INDOT@named-xfer \- ancillary agent for inbound zone transfers
+.SH SYNOPSIS
+.B named-xfer
+.B \-z
+.I zone_to_transfer
+.B \-f
+.I db_file
+.B \-s
+.I serial_no
+[
+.B \-d
+.I debuglevel
+] [
+.B \-l
+.I debug_log_file
+] [
+.B \-t
+.I trace_file
+] [
+.B \-p
+.I port#
+] [
+.B \-S
+]
+.I nameserver
+...
+.SH DESCRIPTION
+.I Named-xfer
+is an ancillary program executed by
+.IR @INDOT@named (@SYS_OPS_EXT@)
+to perform an inbound zone transfer. It is rarely executed directly, and
+only by system administrators who are trying to debug a zone transfer problem.
+See RFC's 1033, 1034, and 1035 for more information on the Internet
+name-domain system.
+.PP
+Options are:
+.TP
+.B \-z
+specifies the name of the zone to be transferred.
+.TP
+.B \-f
+specifies the name of the file into which the zone should be dumped
+when it is received from the primary server.
+.TP
+.B \-s
+specifies the serial number of our current copy of this zone. If the
+\s-1SOA RR\s+1 we get from the primary server does not have a serial
+number higher than this, the transfer will be aborted.
+.TP
+.B \-d
+Print debugging information.
+A number after the ``d'' determines the level of
+messages printed.
+.TP
+.B \-l
+Specifies a log file for debugging messages. The default is system-
+dependent but is usually in
+.I /var/tmp
+or
+.IR /usr/tmp .
+Note that this only applies if
+.I \-d
+is also specified.
+.TP
+.B \-t
+Specifies a trace file which will contain a protocol trace of the zone
+transfer. This is probably only of interest to people debugging the name
+server itself.
+.TP
+.B \-p
+Use a different port number. The default is the standard port number
+as returned by getservbyname(@LIB_NETWORK_EXT@) for service ``domain''.
+.TP
+.B \-S
+Perform a restricted transfer of only the SOA, NS records and glue A records
+for the zone. The SOA record will not be loaded by named but will be used to
+determine when to verify the NS records. See the ``stubs'' directive in
+.IR @INDOT@named (@SYS_OPS_EXT@)
+for more information.
+.PP
+Additional arguments are taken as name server addresses in so-called
+``dotted-quad'' syntax only; no host name are allowed here. At least
+one address must be specified. Any additional addresses will be tried
+in order if the first one fails to transfer to us successfully.
+.SH "SEE ALSO"
+@INDOT@named(@SYS_OPS_EXT@), resolver(@LIB_NETWORK_EXT@), resolver(@FORMAT_EXT@), hostname(@DESC_EXT@),
+RFC 882, RFC 883, RFC 973, RFC 974, RFC 1033, RFC 1034, RFC 1035, RFC 1123,
+\fIName Server Operations Guide for \s-1BIND\s+1\fR
diff --git a/usr.sbin/named/xfer/named-xfer.c b/usr.sbin/named/xfer/named-xfer.c
index 5d8a9cd..b2546d0 100644
--- a/usr.sbin/named/xfer/named-xfer.c
+++ b/usr.sbin/named/xfer/named-xfer.c
@@ -80,6 +80,7 @@ static char rcsid[] = "$Id: named-xfer.c,v 4.9.1.23 1994/07/22 08:42:39 vixie Ex
#include <sys/time.h>
#include <netinet/in.h>
+#include <netiso/iso.h>
#include <net/if.h>
#include <netdb.h>
#include <arpa/inet.h>
@@ -1035,6 +1036,7 @@ print_output(msg, msglen, rrp)
register HEADER *hp = (HEADER *) msg;
u_int32_t addr, ttl;
int i, j, tab, result, class, type, dlen, n1, n;
+ struct iso_addr isoa;
char data[BUFSIZ];
u_char *cp1, *cp2, *temp_ptr;
char *cdata, *origin, *proto, dname[MAXDNAME];
@@ -1391,7 +1393,11 @@ print_output(msg, msglen, rrp)
break;
case T_NSAP:
- fprintf(dbfp, "%s\n", inet_nsap_ntoa(n, cp, NULL));
+ isoa.isoa_len = n;
+ if (isoa.isoa_len > sizeof(isoa.isoa_genaddr))
+ isoa.isoa_len = sizeof(isoa.isoa_genaddr);
+ bcopy(cp, isoa.isoa_genaddr, isoa.isoa_len);
+ fprintf(dbfp, "%s\n", iso_ntoa(&isoa));
break;
case T_UINFO:
OpenPOWER on IntegriCloud