Added nslint
This commit is contained in:
parent
9bbbc17676
commit
5894b1b168
25 changed files with 13757 additions and 0 deletions
|
@ -11,3 +11,6 @@ Directories
|
||||||
|
|
||||||
# zodiac
|
# zodiac
|
||||||
* DNS Spoofer
|
* DNS Spoofer
|
||||||
|
|
||||||
|
# nslint-2.1a8
|
||||||
|
nslint is a lint-like program that checks DNS files for errors. DNS or Domain Name System generally maps names to IP addresses and E-mail addresses in a hierarchical fashion. Errors detected include missing trailing dots, illegal characters (RFC 1034), records without matching PTR records and vice-versa, duplicate names in a subnet, duplicate names for an address, names with cname records (RFC 1033), missing quotes, and unknown keywords.
|
||||||
|
|
197
dns/nslint-2.1a8/CHANGES
Normal file
197
dns/nslint-2.1a8/CHANGES
Normal file
|
@ -0,0 +1,197 @@
|
||||||
|
@(#) $Id: CHANGES,v 1.50 2007/10/17 21:17:28 leres Exp $ (LBL)
|
||||||
|
|
||||||
|
v2.1 Wed Oct 17 14:15:20 PDT 2007
|
||||||
|
|
||||||
|
- Handle "srv" records.
|
||||||
|
|
||||||
|
- Fix some ttl parsing problems.
|
||||||
|
|
||||||
|
- Add "ignore" option
|
||||||
|
|
||||||
|
- Hack in support for "view"
|
||||||
|
|
||||||
|
- Check for duplicate "cname" records.
|
||||||
|
|
||||||
|
- Upgrade to autoconf 2.61
|
||||||
|
|
||||||
|
v2.0.2 Tue Mar 20 17:49:13 PST 2001
|
||||||
|
|
||||||
|
- Allow missing trailing dot in certain special cases.
|
||||||
|
|
||||||
|
- Include zone names when checking NS records.
|
||||||
|
|
||||||
|
- Document nslint.conf network keyword.
|
||||||
|
|
||||||
|
v2.0.1 Tue Dec 14 11:24:31 PST 1999
|
||||||
|
|
||||||
|
- Handle $ttl.
|
||||||
|
|
||||||
|
- Fix some minor portability/compiler problems for OSF 4.
|
||||||
|
|
||||||
|
- Correctly detect mx records that point to themselves but not a
|
||||||
|
real "a" record.
|
||||||
|
|
||||||
|
- Fix file descriptor leak in doconf(). Thanks to Paul McIlfatrick
|
||||||
|
(paul.mcilfatrick@bt.com)
|
||||||
|
|
||||||
|
v2.0 Wed Dec 9 16:48:54 PST 1998
|
||||||
|
|
||||||
|
- Add support for BIND 8 named.conf file.
|
||||||
|
|
||||||
|
- Support protocols in addition to tcp and udp for WKS records.
|
||||||
|
Resulted from a bug report from Petter Reinholdtsen (pere@td.org.uit.no)
|
||||||
|
|
||||||
|
- Support dotted serial numbers in SOA records. Resulted from a
|
||||||
|
bug report from Frank Ederveen (frank@our.domaintje.com)
|
||||||
|
|
||||||
|
- Ignore unknown statements and options in named.boot and named.conf
|
||||||
|
(instead of issuing warnings).
|
||||||
|
|
||||||
|
- Handle '#' and C style named.conf comments.
|
||||||
|
|
||||||
|
- Handle optional "in" in named.conf zone statements. Reported by
|
||||||
|
DJ Coster (djc@discoverbrokerage.com)
|
||||||
|
|
||||||
|
- Add support for include directives in named.boot and named.conf.
|
||||||
|
|
||||||
|
- Redo differing ttls check and do mx records in addition to a
|
||||||
|
records. Change place where soa values gets zeroed so they don't
|
||||||
|
get clobbered when we use includes.
|
||||||
|
|
||||||
|
- Allow "@" abbr. for ptr, mx, cname and ns records.
|
||||||
|
|
||||||
|
- Detect cname referenced by another cname or mx record.
|
||||||
|
|
||||||
|
- Handle chaos records (to some minor extent).
|
||||||
|
|
||||||
|
v1.7 Tue Jul 22 14:26:21 PDT 1997
|
||||||
|
|
||||||
|
- Report differing ttls in A records. Check SOA records.
|
||||||
|
|
||||||
|
- Detect hosts with more than one ip address on a subnet.
|
||||||
|
|
||||||
|
v1.6.1 Sat Jun 7 03:12:01 PDT 1997
|
||||||
|
|
||||||
|
- Fix "unknown service" printf format.
|
||||||
|
|
||||||
|
- Fix off-by-one error in the ptr parsing code. Thanks to Andreas
|
||||||
|
Lamprecht (andreas.lamprecht@siemens.at)
|
||||||
|
|
||||||
|
- Fix broken $origin code.
|
||||||
|
|
||||||
|
v1.6 Mon Apr 7 19:09:52 PDT 1997
|
||||||
|
|
||||||
|
- Add support for classless delegation.
|
||||||
|
|
||||||
|
- Fix some case sensitive bugs.
|
||||||
|
|
||||||
|
- Report domain names outside the current zone.
|
||||||
|
|
||||||
|
- Fixed off-by-one bug that broke single character hostnames.
|
||||||
|
|
||||||
|
- Increase size of hash table.
|
||||||
|
|
||||||
|
- Make tcp and udp service name tables dynamic.
|
||||||
|
|
||||||
|
- Improved error message for garbage in /etc/services.
|
||||||
|
|
||||||
|
v1.5.1 Thu Jul 18 21:44:44 PDT 1996
|
||||||
|
|
||||||
|
- Use $CC when checking gcc version. Thanks to Carl Lindberg
|
||||||
|
(carl_lindberg@blacksmith.com)
|
||||||
|
|
||||||
|
- Raise size of hash table to 65K.
|
||||||
|
|
||||||
|
v1.5 Fri Jul 12 18:58:47 PDT 1996
|
||||||
|
|
||||||
|
- Detect extra octets and other garbage in PTR records.
|
||||||
|
|
||||||
|
- Handle multi-line WKS records.
|
||||||
|
|
||||||
|
- Allow multple WKS records (since we can have udp and tcp).
|
||||||
|
|
||||||
|
- Convert to autoconf.
|
||||||
|
|
||||||
|
- Declare optarg, optind and opterr extern. Thanks to Howard Moftich
|
||||||
|
(howardm@lsil.com).
|
||||||
|
|
||||||
|
- BS/DOS does not have malloc.h. Thanks to Jordan Hayes
|
||||||
|
(jordan@thinkbank.com).
|
||||||
|
|
||||||
|
- Correctly handle named.boot comments with leading whitespace.
|
||||||
|
|
||||||
|
- Handle fully specified in-addr.arpa records. Resulted from a bug
|
||||||
|
report from Joe Kelly (joe@gol.com).
|
||||||
|
|
||||||
|
- Fix endian problems. Thanks to Carl Lindberg (carl_lindberg@blacksmith.com).
|
||||||
|
|
||||||
|
- Fixed some mixed case problems.
|
||||||
|
|
||||||
|
- Update man page to describe how nslint.boot works.
|
||||||
|
|
||||||
|
v1.4 Sat Jun 3 23:38:14 PDT 1995
|
||||||
|
|
||||||
|
- Allow TXT records to exist with no other records.
|
||||||
|
|
||||||
|
- Full system prototypes.
|
||||||
|
|
||||||
|
- Complain about extra arguments.
|
||||||
|
|
||||||
|
- Detect MX record chains.
|
||||||
|
|
||||||
|
- Handle single line SOA records correctly. Thanks to Edward J. O'Brien
|
||||||
|
(ejobrie@sam.wal-mart.com)
|
||||||
|
|
||||||
|
v1.3 Wed Mar 8 17:27:20 PST 1995
|
||||||
|
|
||||||
|
- Add "allowdupa" record type for use with nslint.boot. This allows ip
|
||||||
|
addresses to have multiple A records.
|
||||||
|
|
||||||
|
- Fixed bug that caused dangling cname references to not be reported
|
||||||
|
properly. Thanks to Edward J. O'Brien (ejobrie@sam.wal-mart.com).
|
||||||
|
|
||||||
|
v1.2 Thu Sep 1 15:55:38 PDT 1994
|
||||||
|
|
||||||
|
- Allow hostnames with a leading numeric as per rfc1123. Thanks to Bill
|
||||||
|
Gianopoulos (wag@sccux1.msd.ray.com).
|
||||||
|
|
||||||
|
- Remove (undocumented) -u flag and allow uppercase.
|
||||||
|
|
||||||
|
- Support TXT records. Thanks to Paul Pomes (paul@uxc.cso.uiuc.edu).
|
||||||
|
|
||||||
|
- Support RP records.
|
||||||
|
|
||||||
|
- Ignore new bind keywords.
|
||||||
|
|
||||||
|
- Fix bug where we could exit with a zero status even though errors had
|
||||||
|
been detected
|
||||||
|
|
||||||
|
- Complain about hosts that have smtp/tcp WKS entries but no MX records.
|
||||||
|
|
||||||
|
- Add -B flag to handle PTR records that point outside the domains
|
||||||
|
listed in named.boot.
|
||||||
|
|
||||||
|
v1.1 Sun May 22 20:43:03 PDT 1994
|
||||||
|
|
||||||
|
- Allow ns records with no a records (the preferred way to go).
|
||||||
|
|
||||||
|
- Fix typos in the sawstr array.
|
||||||
|
|
||||||
|
- Use string.h instead of strings.h and add rindex(), index() and
|
||||||
|
bzero() macros for SYSV compatibility. Thanks to Bill King
|
||||||
|
(wrk@cle.ab.com).
|
||||||
|
|
||||||
|
- Handle $origin directives. Thanks to Bill Gianopoulos
|
||||||
|
(wag@sccux1.msd.ray.com).
|
||||||
|
|
||||||
|
- Fix add_domain() to work for the root. Thanks to Bill Gianopoulos.
|
||||||
|
|
||||||
|
- Handle quotes in hinfo records. Thanks to Bill Gianopoulos.
|
||||||
|
|
||||||
|
- Fix endian problems in parseinaddr() and parseptr().
|
||||||
|
|
||||||
|
- Check non in-addr.arpa names for cname conflicts.
|
||||||
|
|
||||||
|
v1.0 Thu Apr 21 11:02:59 PDT 1994
|
||||||
|
|
||||||
|
- Initial release.
|
24
dns/nslint-2.1a8/FILES
Normal file
24
dns/nslint-2.1a8/FILES
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
CHANGES
|
||||||
|
FILES
|
||||||
|
INSTALL
|
||||||
|
Makefile.in
|
||||||
|
README
|
||||||
|
VERSION
|
||||||
|
aclocal.m4
|
||||||
|
config.guess
|
||||||
|
config.sub
|
||||||
|
configure
|
||||||
|
configure.in
|
||||||
|
install-sh
|
||||||
|
lbl/gnuc.h
|
||||||
|
lbl/os-irix5.h
|
||||||
|
lbl/os-osf3.h
|
||||||
|
lbl/os-solaris2.h
|
||||||
|
lbl/os-sunos4.h
|
||||||
|
lbl/os-ultrix4.h
|
||||||
|
mkdep
|
||||||
|
nslint.8
|
||||||
|
nslint.c
|
||||||
|
savestr.c
|
||||||
|
savestr.h
|
||||||
|
strerror.c
|
42
dns/nslint-2.1a8/INSTALL
Normal file
42
dns/nslint-2.1a8/INSTALL
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
@(#) $Header: INSTALL,v 1.2 98/12/09 16:32:58 leres Exp $ (LBL)
|
||||||
|
|
||||||
|
You will need an ANSI C compiler to build nslint. The configure
|
||||||
|
script will abort if your compiler is not ANSI compliant. If this
|
||||||
|
happens, use the GNU C compiler, available via anonymous ftp:
|
||||||
|
|
||||||
|
ftp://prep.ai.mit.edu/pub/gnu/gcc.tar.gz
|
||||||
|
|
||||||
|
If necessary, edit the BINDEST and MANDEST paths in Makefile.in
|
||||||
|
and run ./configure (a shell script). "configure" will determine
|
||||||
|
your system attributes and generate an appropriate Makefile from
|
||||||
|
Makefile.in. Now build nslint by running "make".
|
||||||
|
|
||||||
|
If everything builds ok, su and type "make install" (and optionally
|
||||||
|
"make install-man). This will install nslint and its manual entry.
|
||||||
|
|
||||||
|
If your system is not one which we have tested nslint on, you may
|
||||||
|
have to modify the configure script and Makefile.in. Please send
|
||||||
|
us patches for any modifications you need to make.
|
||||||
|
|
||||||
|
FILES
|
||||||
|
-----
|
||||||
|
CHANGES - description of differences between releases
|
||||||
|
FILES - list of files exported as part of the distribution
|
||||||
|
INSTALL - this file
|
||||||
|
Makefile.in - compilation rules (input to the configure script)
|
||||||
|
README - description of distribution
|
||||||
|
VERSION - version of this release
|
||||||
|
aclocal.m4 - autoconf macros
|
||||||
|
config.guess - autoconf support
|
||||||
|
config.sub - autoconf support
|
||||||
|
configure - configure script (run this first)
|
||||||
|
configure.in - configure script source
|
||||||
|
install-sh - BSD style install script
|
||||||
|
lbl/gnuc.h - gcc macros and defines
|
||||||
|
lbl/os-*.h - os dependent defines and prototypes
|
||||||
|
mkdep - construct Makefile dependency list
|
||||||
|
nslint.8 - manual entry
|
||||||
|
nslint.c - main program
|
||||||
|
savestr.c - strdup() replacement
|
||||||
|
savestr.h - savestr prototypes
|
||||||
|
strerror.c - missing routine
|
122
dns/nslint-2.1a8/Makefile.in
Normal file
122
dns/nslint-2.1a8/Makefile.in
Normal file
|
@ -0,0 +1,122 @@
|
||||||
|
# Copyright (c) 1992, 1993, 1994, 1995, 1996, 1997, 2000
|
||||||
|
# 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: (1) source code distributions
|
||||||
|
# retain the above copyright notice and this paragraph in its entirety, (2)
|
||||||
|
# distributions including binary code include the above copyright notice and
|
||||||
|
# this paragraph in its entirety in the documentation or other materials
|
||||||
|
# provided with the distribution, and (3) all advertising materials mentioning
|
||||||
|
# features or use of this software display the following acknowledgement:
|
||||||
|
# ``This product includes software developed by the University of California,
|
||||||
|
# Lawrence Berkeley Laboratory and its contributors.'' 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 ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||||
|
# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||||
|
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
#
|
||||||
|
# @(#) $Id: Makefile.in,v 1.24 2000/03/08 01:51:38 leres Exp $ (LBL)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Various configurable paths (remember to edit Makefile.in, not Makefile)
|
||||||
|
#
|
||||||
|
|
||||||
|
# Top level hierarchy
|
||||||
|
prefix = @prefix@
|
||||||
|
exec_prefix = @exec_prefix@
|
||||||
|
# Pathname of directory to install the binary
|
||||||
|
BINDEST = @bindir@
|
||||||
|
# Pathname of directory to install the man page
|
||||||
|
MANDEST = @mandir@
|
||||||
|
|
||||||
|
# VPATH
|
||||||
|
srcdir = @srcdir@
|
||||||
|
VPATH = @srcdir@
|
||||||
|
|
||||||
|
#
|
||||||
|
# You shouldn't need to edit anything below here.
|
||||||
|
#
|
||||||
|
|
||||||
|
PROG = nslint
|
||||||
|
CC = @CC@
|
||||||
|
CCOPT = @V_CCOPT@
|
||||||
|
INCLS = @V_INCLS@
|
||||||
|
DEFS = @DEFS@
|
||||||
|
|
||||||
|
# Standard CFLAGS
|
||||||
|
CFLAGS = $(CCOPT) $(DEFS) $(INCLS)
|
||||||
|
|
||||||
|
# Standard LIBS
|
||||||
|
LIBS = @LIBS@
|
||||||
|
|
||||||
|
INSTALL = @INSTALL@
|
||||||
|
|
||||||
|
# Explicitly define compilation rule since SunOS 4's make doesn't like gcc.
|
||||||
|
# Also, gcc does not remove the .o before forking 'as', which can be a
|
||||||
|
# problem if you don't own the file but can write to the directory.
|
||||||
|
.c.o:
|
||||||
|
@rm -f $@
|
||||||
|
$(CC) $(CFLAGS) -c $(srcdir)/$*.c
|
||||||
|
|
||||||
|
CSRC = nslint.c savestr.c
|
||||||
|
GENSRC = version.c
|
||||||
|
|
||||||
|
SRC = $(CSRC) $(GENSRC)
|
||||||
|
|
||||||
|
# We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot
|
||||||
|
# hack the extra indirection
|
||||||
|
OBJ = $(CSRC:.c=.o) $(GENSRC:.c=.o) @LIBOBJS@
|
||||||
|
|
||||||
|
TAGHDR = \
|
||||||
|
/usr/include/sys/types.h \
|
||||||
|
/usr/include/netinet/in.h
|
||||||
|
|
||||||
|
TAGFILES = $(SRC) $(TAGHDR)
|
||||||
|
|
||||||
|
CLEANFILES = $(PROG) $(OBJ) $(GENSRC)
|
||||||
|
|
||||||
|
$(PROG): $(OBJ)
|
||||||
|
@rm -f $@
|
||||||
|
$(CC) $(CFLAGS) -o $@ $(OBJ) $(LIBS)
|
||||||
|
|
||||||
|
version.o: version.c
|
||||||
|
version.c: $(srcdir)/VERSION
|
||||||
|
@rm -f $@
|
||||||
|
sed -e 's/.*/char version[] = "&";/' $(srcdir)/VERSION > $@
|
||||||
|
|
||||||
|
install: force
|
||||||
|
$(INSTALL) -m 555 -o bin -g bin $(PROG) $(DESTDIR)$(BINDEST)/$(PROG)
|
||||||
|
|
||||||
|
install-man: force
|
||||||
|
$(INSTALL) -m 444 -o bin -g bin $(srcdir)/$(PROG).8 \
|
||||||
|
$(DESTDIR)$(MANDEST)/man8/$(PROG).8
|
||||||
|
|
||||||
|
clean: force
|
||||||
|
rm -f $(CLEANFILES)
|
||||||
|
|
||||||
|
distclean: force
|
||||||
|
rm -f $(CLEANFILES) Makefile config.cache config.log config.status \
|
||||||
|
gnuc.h os-proto.h
|
||||||
|
|
||||||
|
tags: $(TAGFILES)
|
||||||
|
ctags -wtd $(TAGFILES)
|
||||||
|
|
||||||
|
tar: force
|
||||||
|
@cwd=`pwd` ; name=$(PROG)-`cat VERSION` ; \
|
||||||
|
list="" ; tar="tar chf" ; temp="$$name.tar.gz" ; \
|
||||||
|
for i in `cat FILES` ; do list="$$list $$name/$$i" ; done; \
|
||||||
|
echo \
|
||||||
|
"rm -f $$name; ln -s . $$name" ; \
|
||||||
|
rm -f $$name; ln -s . $$name ; \
|
||||||
|
echo \
|
||||||
|
"$$tar - [lots of files] | gzip > $$temp" ; \
|
||||||
|
$$tar - $$list | gzip > $$temp ; \
|
||||||
|
echo \
|
||||||
|
"rm -f $$name" ; \
|
||||||
|
rm -f $$name
|
||||||
|
|
||||||
|
force: /tmp
|
||||||
|
depend: $(GENSRC) force
|
||||||
|
./mkdep -c $(CC) $(DEFS) $(INCLS) $(SRC)
|
14
dns/nslint-2.1a8/README
Normal file
14
dns/nslint-2.1a8/README
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
@(#) $Id: README,v 1.10 2001/11/26 18:52:13 leres Exp $ (LBL)
|
||||||
|
|
||||||
|
NSLINT 2.0
|
||||||
|
Lawrence Berkeley National Laboratory
|
||||||
|
Network Research Group
|
||||||
|
nslint@ee.lbl.gov
|
||||||
|
ftp://ftp.ee.lbl.gov/nslint.tar.gz
|
||||||
|
|
||||||
|
This directory contains source code for nslint, a lint program for dns
|
||||||
|
files.
|
||||||
|
|
||||||
|
Please send bugs and comments to nslint@ee.lbl.gov.
|
||||||
|
|
||||||
|
- Craig Leres
|
1
dns/nslint-2.1a8/VERSION
Normal file
1
dns/nslint-2.1a8/VERSION
Normal file
|
@ -0,0 +1 @@
|
||||||
|
2.1a8
|
817
dns/nslint-2.1a8/aclocal.m4
vendored
Normal file
817
dns/nslint-2.1a8/aclocal.m4
vendored
Normal file
|
@ -0,0 +1,817 @@
|
||||||
|
dnl @(#) $Id: aclocal.m4,v 1.80 2003/04/07 19:13:48 leres Exp $ (LBL)
|
||||||
|
dnl
|
||||||
|
dnl Copyright (c) 1995, 1996, 1997, 1998, 1999, 2002, 2003
|
||||||
|
dnl The Regents of the University of California. All rights reserved.
|
||||||
|
dnl
|
||||||
|
dnl Redistribution and use in source and binary forms, with or without
|
||||||
|
dnl modification, are permitted provided that: (1) source code distributions
|
||||||
|
dnl retain the above copyright notice and this paragraph in its entirety, (2)
|
||||||
|
dnl distributions including binary code include the above copyright notice and
|
||||||
|
dnl this paragraph in its entirety in the documentation or other materials
|
||||||
|
dnl provided with the distribution, and (3) all advertising materials mentioning
|
||||||
|
dnl features or use of this software display the following acknowledgement:
|
||||||
|
dnl ``This product includes software developed by the University of California,
|
||||||
|
dnl Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
|
||||||
|
dnl the University nor the names of its contributors may be used to endorse
|
||||||
|
dnl or promote products derived from this software without specific prior
|
||||||
|
dnl written permission.
|
||||||
|
dnl THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||||
|
dnl WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||||
|
dnl MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
dnl
|
||||||
|
dnl LBL autoconf macros
|
||||||
|
dnl
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl Determine which compiler we're using (cc or gcc)
|
||||||
|
dnl If using gcc, determine the version number
|
||||||
|
dnl If using cc, require that it support ansi prototypes
|
||||||
|
dnl If using gcc, use -O2 (otherwise use -O)
|
||||||
|
dnl If using cc, explicitly specify /usr/local/include
|
||||||
|
dnl
|
||||||
|
dnl usage:
|
||||||
|
dnl
|
||||||
|
dnl AC_LBL_C_INIT(copt, incls)
|
||||||
|
dnl
|
||||||
|
dnl results:
|
||||||
|
dnl
|
||||||
|
dnl $1 (copt set)
|
||||||
|
dnl $2 (incls set)
|
||||||
|
dnl CC
|
||||||
|
dnl LDFLAGS
|
||||||
|
dnl LBL_CFLAGS
|
||||||
|
dnl
|
||||||
|
AC_DEFUN(AC_LBL_C_INIT,
|
||||||
|
[AC_PREREQ(2.12)
|
||||||
|
AC_BEFORE([$0], [AC_PROG_CC])
|
||||||
|
AC_BEFORE([$0], [AC_LBL_FIXINCLUDES])
|
||||||
|
AC_BEFORE([$0], [AC_LBL_DEVEL])
|
||||||
|
AC_ARG_WITH(gcc, [ --without-gcc don't use gcc])
|
||||||
|
$1="-O"
|
||||||
|
$2=""
|
||||||
|
if test "${srcdir}" != "." ; then
|
||||||
|
$2="-I\$\(srcdir\)"
|
||||||
|
fi
|
||||||
|
if test "${CFLAGS+set}" = set; then
|
||||||
|
LBL_CFLAGS="$CFLAGS"
|
||||||
|
fi
|
||||||
|
if test -z "$CC" ; then
|
||||||
|
case "$target_os" in
|
||||||
|
|
||||||
|
bsdi*)
|
||||||
|
AC_CHECK_PROG(SHLICC2, shlicc2, yes, no)
|
||||||
|
if test $SHLICC2 = yes ; then
|
||||||
|
CC=shlicc2
|
||||||
|
export CC
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
if test -z "$CC" -a "$with_gcc" = no ; then
|
||||||
|
CC=cc
|
||||||
|
export CC
|
||||||
|
fi
|
||||||
|
AC_PROG_CC
|
||||||
|
if test "$GCC" != yes ; then
|
||||||
|
AC_MSG_CHECKING(that $CC handles ansi prototypes)
|
||||||
|
AC_CACHE_VAL(ac_cv_lbl_cc_ansi_prototypes,
|
||||||
|
AC_TRY_COMPILE(
|
||||||
|
[#include <sys/types.h>],
|
||||||
|
[int frob(int, char *)],
|
||||||
|
ac_cv_lbl_cc_ansi_prototypes=yes,
|
||||||
|
ac_cv_lbl_cc_ansi_prototypes=no))
|
||||||
|
AC_MSG_RESULT($ac_cv_lbl_cc_ansi_prototypes)
|
||||||
|
if test $ac_cv_lbl_cc_ansi_prototypes = no ; then
|
||||||
|
case "$target_os" in
|
||||||
|
|
||||||
|
hpux*)
|
||||||
|
AC_MSG_CHECKING(for HP-UX ansi compiler ($CC -Aa -D_HPUX_SOURCE))
|
||||||
|
savedcflags="$CFLAGS"
|
||||||
|
CFLAGS="-Aa -D_HPUX_SOURCE $CFLAGS"
|
||||||
|
AC_CACHE_VAL(ac_cv_lbl_cc_hpux_cc_aa,
|
||||||
|
AC_TRY_COMPILE(
|
||||||
|
[#include <sys/types.h>],
|
||||||
|
[int frob(int, char *)],
|
||||||
|
ac_cv_lbl_cc_hpux_cc_aa=yes,
|
||||||
|
ac_cv_lbl_cc_hpux_cc_aa=no))
|
||||||
|
AC_MSG_RESULT($ac_cv_lbl_cc_hpux_cc_aa)
|
||||||
|
if test $ac_cv_lbl_cc_hpux_cc_aa = no ; then
|
||||||
|
AC_MSG_ERROR(see the INSTALL doc for more info)
|
||||||
|
fi
|
||||||
|
CFLAGS="$savedcflags"
|
||||||
|
$1="-Aa $$1"
|
||||||
|
AC_DEFINE(_HPUX_SOURCE,,[HP-UX ansi compiler])
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
AC_MSG_ERROR(see the INSTALL doc for more info)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
$2="$$2 -I/usr/local/include"
|
||||||
|
LDFLAGS="$LDFLAGS -L/usr/local/lib"
|
||||||
|
|
||||||
|
case "$target_os" in
|
||||||
|
|
||||||
|
irix*)
|
||||||
|
$1="$$1 -xansi -signed -g3"
|
||||||
|
;;
|
||||||
|
|
||||||
|
osf*)
|
||||||
|
$1="$$1 -std1 -g3"
|
||||||
|
;;
|
||||||
|
|
||||||
|
ultrix*)
|
||||||
|
AC_MSG_CHECKING(that Ultrix $CC hacks const in prototypes)
|
||||||
|
AC_CACHE_VAL(ac_cv_lbl_cc_const_proto,
|
||||||
|
AC_TRY_COMPILE(
|
||||||
|
[#include <sys/types.h>],
|
||||||
|
[struct a { int b; };
|
||||||
|
void c(const struct a *)],
|
||||||
|
ac_cv_lbl_cc_const_proto=yes,
|
||||||
|
ac_cv_lbl_cc_const_proto=no))
|
||||||
|
AC_MSG_RESULT($ac_cv_lbl_cc_const_proto)
|
||||||
|
if test $ac_cv_lbl_cc_const_proto = no ; then
|
||||||
|
AC_DEFINE(const,,[ultrix can't hack const])
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_LBL_ENABLE_CHECK(brov6 activemapping expire-dfa-states)
|
||||||
|
dnl
|
||||||
|
dnl This allows us to check for bogus configure enable/disable
|
||||||
|
dnl command line options
|
||||||
|
dnl
|
||||||
|
dnl usage:
|
||||||
|
dnl
|
||||||
|
dnl AC_LBL_ENABLE_CHECK(opt ...)
|
||||||
|
dnl
|
||||||
|
AC_DEFUN(AC_LBL_ENABLE_CHECK,
|
||||||
|
[set |
|
||||||
|
sed -n -e 's/^enable_\([[^=]]*\)=[[^=]]*$/\1/p' |
|
||||||
|
while read var; do
|
||||||
|
ok=0
|
||||||
|
for o in $1; do
|
||||||
|
if test "${o}" = "${var}" ; then
|
||||||
|
ok=1
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if test ${ok} -eq 0 ; then
|
||||||
|
# It's hard to kill configure script from subshell!
|
||||||
|
AC_MSG_ERROR(unknown enable option: ${var})
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if test $? -ne 0 ; then
|
||||||
|
exit 1
|
||||||
|
fi])
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl Use pfopen.c if available and pfopen() not in standard libraries
|
||||||
|
dnl Require libpcap
|
||||||
|
dnl Look for libpcap in ..
|
||||||
|
dnl Use the installed libpcap if there is no local version
|
||||||
|
dnl
|
||||||
|
dnl usage:
|
||||||
|
dnl
|
||||||
|
dnl AC_LBL_LIBPCAP(pcapdep, incls)
|
||||||
|
dnl
|
||||||
|
dnl results:
|
||||||
|
dnl
|
||||||
|
dnl $1 (pcapdep set)
|
||||||
|
dnl $2 (incls appended)
|
||||||
|
dnl LIBS
|
||||||
|
dnl LDFLAGS
|
||||||
|
dnl LBL_LIBS
|
||||||
|
dnl
|
||||||
|
AC_DEFUN(AC_LBL_LIBPCAP,
|
||||||
|
[AC_REQUIRE([AC_LBL_LIBRARY_NET])
|
||||||
|
dnl
|
||||||
|
dnl save a copy before locating libpcap.a
|
||||||
|
dnl
|
||||||
|
LBL_LIBS="$LIBS"
|
||||||
|
pfopen=/usr/examples/packetfilter/pfopen.c
|
||||||
|
if test -f $pfopen ; then
|
||||||
|
AC_CHECK_FUNCS(pfopen)
|
||||||
|
if test $ac_cv_func_pfopen = "no" ; then
|
||||||
|
AC_MSG_RESULT(Using $pfopen)
|
||||||
|
LIBS="$LIBS $pfopen"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
AC_MSG_CHECKING(for local pcap library)
|
||||||
|
libpcap=FAIL
|
||||||
|
lastdir=FAIL
|
||||||
|
places=`ls .. | sed -e 's,/$,,' -e 's,^,../,' | \
|
||||||
|
egrep '/libpcap-[[0-9]]*\.[[0-9]]*(\.[[0-9]]*)?([[ab]][[0-9]]*)?$'`
|
||||||
|
for dir in $places ../libpcap libpcap ; do
|
||||||
|
basedir=`echo $dir | sed -e 's/[[ab]][[0-9]]*$//'`
|
||||||
|
if test $lastdir = $basedir ; then
|
||||||
|
dnl skip alphas when an actual release is present
|
||||||
|
continue;
|
||||||
|
fi
|
||||||
|
lastdir=$dir
|
||||||
|
if test -r $dir/pcap.c ; then
|
||||||
|
libpcap=$dir/libpcap.a
|
||||||
|
d=$dir
|
||||||
|
dnl continue and select the last one that exists
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if test "x$libpcap" = xFAIL ; then
|
||||||
|
AC_MSG_RESULT(not found)
|
||||||
|
AC_CHECK_LIB(pcap, pcap_open_live, libpcap="-lpcap")
|
||||||
|
unset ac_cv_lib_pcap_pcap_open_live
|
||||||
|
if test "x$libpcap" = xFAIL ; then
|
||||||
|
CFLAGS="$CFLAGS -I/usr/local/include"
|
||||||
|
LIBS="$LIBS -L/usr/local/lib"
|
||||||
|
AC_CHECK_LIB(pcap, pcap_open_live, libpcap="-lpcap")
|
||||||
|
unset ac_cv_lib_pcap_pcap_open_live
|
||||||
|
if test "x$libpcap" = xFAIL ; then
|
||||||
|
AC_MSG_ERROR(see the INSTALL doc for more info)
|
||||||
|
fi
|
||||||
|
$2="$$2 -I/usr/local/include"
|
||||||
|
fi
|
||||||
|
LIBS="$LIBS -lpcap"
|
||||||
|
else
|
||||||
|
$1=$libpcap
|
||||||
|
$2="-I$d $$2"
|
||||||
|
AC_MSG_RESULT($libpcap)
|
||||||
|
fi
|
||||||
|
if test "x$libpcap" != "x-lpcap" ; then
|
||||||
|
LIBS="$libpcap $LIBS"
|
||||||
|
fi
|
||||||
|
case "$target_os" in
|
||||||
|
|
||||||
|
aix*)
|
||||||
|
pseexe="/lib/pse.exp"
|
||||||
|
AC_MSG_CHECKING(for $pseexe)
|
||||||
|
if test -f $pseexe ; then
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
LIBS="$LIBS -I:$pseexe"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac])
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl Define RETSIGTYPE and RETSIGVAL
|
||||||
|
dnl
|
||||||
|
dnl usage:
|
||||||
|
dnl
|
||||||
|
dnl AC_LBL_TYPE_SIGNAL
|
||||||
|
dnl
|
||||||
|
dnl results:
|
||||||
|
dnl
|
||||||
|
dnl RETSIGTYPE (defined)
|
||||||
|
dnl RETSIGVAL (defined)
|
||||||
|
dnl
|
||||||
|
AC_DEFUN(AC_LBL_TYPE_SIGNAL,
|
||||||
|
[AC_BEFORE([$0], [AC_LBL_LIBPCAP])
|
||||||
|
AC_TYPE_SIGNAL
|
||||||
|
if test "$ac_cv_type_signal" = void ; then
|
||||||
|
AC_DEFINE(RETSIGVAL,,[signal function return value])
|
||||||
|
else
|
||||||
|
AC_DEFINE(RETSIGVAL,(0))
|
||||||
|
fi
|
||||||
|
case "$target_os" in
|
||||||
|
|
||||||
|
irix*)
|
||||||
|
AC_DEFINE(_BSD_SIGNALS,,[irix's BSD style signals])
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
dnl prefer sigset() to sigaction()
|
||||||
|
AC_CHECK_FUNCS(sigset)
|
||||||
|
if test $ac_cv_func_sigset = yes ; then
|
||||||
|
AC_DEFINE(signal,sigset,[use sigset() instead of signal()])
|
||||||
|
else
|
||||||
|
AC_CHECK_FUNCS(sigaction)
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac])
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl If using gcc, make sure we have ANSI ioctl definitions
|
||||||
|
dnl
|
||||||
|
dnl usage:
|
||||||
|
dnl
|
||||||
|
dnl AC_LBL_FIXINCLUDES
|
||||||
|
dnl
|
||||||
|
AC_DEFUN(AC_LBL_FIXINCLUDES,
|
||||||
|
[if test "$GCC" = yes ; then
|
||||||
|
AC_MSG_CHECKING(for ANSI ioctl definitions)
|
||||||
|
AC_CACHE_VAL(ac_cv_lbl_gcc_fixincludes,
|
||||||
|
AC_TRY_COMPILE(
|
||||||
|
[/*
|
||||||
|
* This generates a "duplicate case value" when fixincludes
|
||||||
|
* has not be run.
|
||||||
|
*/
|
||||||
|
# include <sys/types.h>
|
||||||
|
# include <sys/time.h>
|
||||||
|
# include <sys/ioctl.h>
|
||||||
|
# ifdef HAVE_SYS_IOCCOM_H
|
||||||
|
# include <sys/ioccom.h>
|
||||||
|
# endif],
|
||||||
|
[switch (0) {
|
||||||
|
case _IO('A', 1):;
|
||||||
|
case _IO('B', 1):;
|
||||||
|
}],
|
||||||
|
ac_cv_lbl_gcc_fixincludes=yes,
|
||||||
|
ac_cv_lbl_gcc_fixincludes=no))
|
||||||
|
AC_MSG_RESULT($ac_cv_lbl_gcc_fixincludes)
|
||||||
|
if test $ac_cv_lbl_gcc_fixincludes = no ; then
|
||||||
|
# Don't cache failure
|
||||||
|
unset ac_cv_lbl_gcc_fixincludes
|
||||||
|
AC_MSG_ERROR(see the INSTALL for more info)
|
||||||
|
fi
|
||||||
|
fi])
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl Check for flex, default to lex
|
||||||
|
dnl Require flex 2.4 or higher
|
||||||
|
dnl Check for bison, default to yacc
|
||||||
|
dnl Default to lex/yacc if both flex and bison are not available
|
||||||
|
dnl Define the yy prefix string if using flex and bison
|
||||||
|
dnl
|
||||||
|
dnl usage:
|
||||||
|
dnl
|
||||||
|
dnl AC_LBL_LEX_AND_YACC(lex, yacc, yyprefix)
|
||||||
|
dnl
|
||||||
|
dnl results:
|
||||||
|
dnl
|
||||||
|
dnl $1 (lex set)
|
||||||
|
dnl $2 (yacc appended)
|
||||||
|
dnl $3 (optional flex and bison -P prefix)
|
||||||
|
dnl
|
||||||
|
AC_DEFUN(AC_LBL_LEX_AND_YACC,
|
||||||
|
[AC_ARG_WITH(flex, [ --without-flex don't use flex])
|
||||||
|
AC_ARG_WITH(bison, [ --without-bison don't use bison])
|
||||||
|
if test "$with_flex" = no ; then
|
||||||
|
$1=lex
|
||||||
|
else
|
||||||
|
AC_CHECK_PROGS($1, flex, lex)
|
||||||
|
fi
|
||||||
|
if test "$$1" = flex ; then
|
||||||
|
# The -V flag was added in 2.4
|
||||||
|
AC_MSG_CHECKING(for flex 2.4 or higher)
|
||||||
|
AC_CACHE_VAL(ac_cv_lbl_flex_v24,
|
||||||
|
if flex -V >/dev/null 2>&1; then
|
||||||
|
ac_cv_lbl_flex_v24=yes
|
||||||
|
else
|
||||||
|
ac_cv_lbl_flex_v24=no
|
||||||
|
fi)
|
||||||
|
AC_MSG_RESULT($ac_cv_lbl_flex_v24)
|
||||||
|
if test $ac_cv_lbl_flex_v24 = no ; then
|
||||||
|
s="2.4 or higher required"
|
||||||
|
AC_MSG_WARN(ignoring obsolete flex executable ($s))
|
||||||
|
$1=lex
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if test "$with_bison" = no ; then
|
||||||
|
$2=yacc
|
||||||
|
else
|
||||||
|
AC_CHECK_PROGS($2, bison, yacc)
|
||||||
|
fi
|
||||||
|
if test "$$2" = bison ; then
|
||||||
|
$2="$$2 -y"
|
||||||
|
fi
|
||||||
|
if test "$$1" != lex -a "$$2" = yacc -o "$$1" = lex -a "$$2" != yacc ; then
|
||||||
|
AC_MSG_WARN(don't have both flex and bison; reverting to lex/yacc)
|
||||||
|
$1=lex
|
||||||
|
$2=yacc
|
||||||
|
fi
|
||||||
|
if test "$$1" = flex -a -n "$3" ; then
|
||||||
|
$1="$$1 -P$3"
|
||||||
|
$2="$$2 -p $3"
|
||||||
|
fi])
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl Checks to see if union wait is used with WEXITSTATUS()
|
||||||
|
dnl
|
||||||
|
dnl usage:
|
||||||
|
dnl
|
||||||
|
dnl AC_LBL_UNION_WAIT
|
||||||
|
dnl
|
||||||
|
dnl results:
|
||||||
|
dnl
|
||||||
|
dnl DECLWAITSTATUS (defined)
|
||||||
|
dnl
|
||||||
|
AC_DEFUN(AC_LBL_UNION_WAIT,
|
||||||
|
[AC_MSG_CHECKING(if union wait is used)
|
||||||
|
AC_CACHE_VAL(ac_cv_lbl_union_wait,
|
||||||
|
AC_TRY_COMPILE([
|
||||||
|
# include <sys/types.h>
|
||||||
|
# include <sys/wait.h>],
|
||||||
|
[int status;
|
||||||
|
u_int i = WEXITSTATUS(status);
|
||||||
|
u_int j = waitpid(0, &status, 0);],
|
||||||
|
ac_cv_lbl_union_wait=no,
|
||||||
|
ac_cv_lbl_union_wait=yes))
|
||||||
|
AC_MSG_RESULT($ac_cv_lbl_union_wait)
|
||||||
|
if test $ac_cv_lbl_union_wait = yes ; then
|
||||||
|
AC_DEFINE(DECLWAITSTATUS,union wait)
|
||||||
|
else
|
||||||
|
AC_DEFINE(DECLWAITSTATUS,int)
|
||||||
|
fi])
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl Checks to see if the sockaddr struct has the 4.4 BSD sa_len member
|
||||||
|
dnl
|
||||||
|
dnl usage:
|
||||||
|
dnl
|
||||||
|
dnl AC_LBL_SOCKADDR_SA_LEN
|
||||||
|
dnl
|
||||||
|
dnl results:
|
||||||
|
dnl
|
||||||
|
dnl HAVE_SOCKADDR_SA_LEN (defined)
|
||||||
|
dnl
|
||||||
|
AC_DEFUN(AC_LBL_SOCKADDR_SA_LEN,
|
||||||
|
[AC_CHECK_MEMBERS(struct sockaddr.sa_len,,,[
|
||||||
|
# include <sys/types.h>
|
||||||
|
# include <sys/socket.h>])])
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl Makes sure socklen_t is defined
|
||||||
|
dnl
|
||||||
|
dnl usage:
|
||||||
|
dnl
|
||||||
|
dnl AC_LBL_SOCKLEN_T
|
||||||
|
dnl
|
||||||
|
dnl results:
|
||||||
|
dnl
|
||||||
|
dnl socklen_t (defined if missing)
|
||||||
|
dnl
|
||||||
|
AC_DEFUN(AC_LBL_SOCKLEN_T,
|
||||||
|
[AC_MSG_CHECKING(for socklen_t in sys/socket.h using $CC)
|
||||||
|
AC_CACHE_VAL(ac_cv_lbl_socklen_t,
|
||||||
|
AC_TRY_COMPILE([
|
||||||
|
# include "confdefs.h"
|
||||||
|
# include <sys/types.h>
|
||||||
|
# include <sys/socket.h>
|
||||||
|
# if STDC_HEADERS
|
||||||
|
# include <stdlib.h>
|
||||||
|
# include <stddef.h>
|
||||||
|
# endif],
|
||||||
|
[socklen_t i],
|
||||||
|
ac_cv_lbl_socklen_t=yes,
|
||||||
|
ac_cv_lbl_socklen_t=no))
|
||||||
|
AC_MSG_RESULT($ac_cv_lbl_socklen_t)
|
||||||
|
if test $ac_cv_lbl_socklen_t = no ; then
|
||||||
|
AC_DEFINE(socklen_t, int, [Define socklen_t if missing])
|
||||||
|
fi])
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl Checks to see if the IFF_LOOPBACK exists as a define or enum
|
||||||
|
dnl
|
||||||
|
dnl (stupidly some versions of linux use an enum...)
|
||||||
|
dnl
|
||||||
|
dnl usage:
|
||||||
|
dnl
|
||||||
|
dnl AC_LBL_IFF_LOOPBACK
|
||||||
|
dnl
|
||||||
|
dnl results:
|
||||||
|
dnl
|
||||||
|
dnl HAVE_IFF_LOOPBACK (defined)
|
||||||
|
dnl
|
||||||
|
AC_DEFUN(AC_LBL_IFF_LOOPBACK,
|
||||||
|
[AC_MSG_CHECKING(for IFF_LOOPBACK define/enum)
|
||||||
|
AC_CACHE_VAL(ac_cv_lbl_have_iff_loopback,
|
||||||
|
AC_TRY_COMPILE([
|
||||||
|
# include <sys/param.h>
|
||||||
|
# include <sys/file.h>
|
||||||
|
# include <sys/ioctl.h>
|
||||||
|
# include <sys/socket.h>
|
||||||
|
# ifdef HAVE_SYS_SOCKIO_H
|
||||||
|
# include <sys/sockio.h>
|
||||||
|
# endif
|
||||||
|
# include <sys/time.h>
|
||||||
|
# include <net/if.h>
|
||||||
|
# include <netinet/in.h>],
|
||||||
|
[int i = IFF_LOOPBACK],
|
||||||
|
ac_cv_lbl_have_iff_loopback=yes,
|
||||||
|
ac_cv_lbl_have_iff_loopback=no))
|
||||||
|
AC_MSG_RESULT($ac_cv_lbl_have_iff_loopback)
|
||||||
|
if test $ac_cv_lbl_have_iff_loopback = yes ; then
|
||||||
|
AC_DEFINE(HAVE_IFF_LOOPBACK,, [Have IFF_LOOPBACK define/enum])
|
||||||
|
fi])
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl Checks to see if -R is used
|
||||||
|
dnl
|
||||||
|
dnl usage:
|
||||||
|
dnl
|
||||||
|
dnl AC_LBL_HAVE_RUN_PATH
|
||||||
|
dnl
|
||||||
|
dnl results:
|
||||||
|
dnl
|
||||||
|
dnl ac_cv_lbl_have_run_path (yes or no)
|
||||||
|
dnl
|
||||||
|
AC_DEFUN(AC_LBL_HAVE_RUN_PATH,
|
||||||
|
[AC_MSG_CHECKING(for ${CC-cc} -R)
|
||||||
|
AC_CACHE_VAL(ac_cv_lbl_have_run_path,
|
||||||
|
[echo 'main(){}' > conftest.c
|
||||||
|
${CC-cc} -o conftest conftest.c -R/a1/b2/c3 >conftest.out 2>&1
|
||||||
|
if test ! -s conftest.out ; then
|
||||||
|
ac_cv_lbl_have_run_path=yes
|
||||||
|
else
|
||||||
|
ac_cv_lbl_have_run_path=no
|
||||||
|
fi
|
||||||
|
rm -f conftest*])
|
||||||
|
AC_MSG_RESULT($ac_cv_lbl_have_run_path)
|
||||||
|
])
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl Due to the stupid way it's implemented, AC_CHECK_TYPE is nearly useless.
|
||||||
|
dnl
|
||||||
|
dnl usage:
|
||||||
|
dnl
|
||||||
|
dnl AC_LBL_CHECK_TYPE
|
||||||
|
dnl
|
||||||
|
dnl results:
|
||||||
|
dnl
|
||||||
|
dnl int32_t (defined)
|
||||||
|
dnl u_int32_t (defined)
|
||||||
|
dnl
|
||||||
|
AC_DEFUN(AC_LBL_CHECK_TYPE,
|
||||||
|
[AC_MSG_CHECKING(for $1 using $CC)
|
||||||
|
AC_CACHE_VAL(ac_cv_lbl_have_$1,
|
||||||
|
AC_TRY_COMPILE([
|
||||||
|
# include "confdefs.h"
|
||||||
|
# include <sys/types.h>
|
||||||
|
# if STDC_HEADERS
|
||||||
|
# include <stdlib.h>
|
||||||
|
# include <stddef.h>
|
||||||
|
# endif],
|
||||||
|
[$1 i],
|
||||||
|
ac_cv_lbl_have_$1=yes,
|
||||||
|
ac_cv_lbl_have_$1=no))
|
||||||
|
AC_MSG_RESULT($ac_cv_lbl_have_$1)
|
||||||
|
if test $ac_cv_lbl_have_$1 = no ; then
|
||||||
|
AC_DEFINE($1, $2, Define $1)
|
||||||
|
fi])
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl Checks to see if unaligned memory accesses fail
|
||||||
|
dnl
|
||||||
|
dnl usage:
|
||||||
|
dnl
|
||||||
|
dnl AC_LBL_UNALIGNED_ACCESS
|
||||||
|
dnl
|
||||||
|
dnl results:
|
||||||
|
dnl
|
||||||
|
dnl LBL_ALIGN (DEFINED)
|
||||||
|
dnl
|
||||||
|
AC_DEFUN(AC_LBL_UNALIGNED_ACCESS,
|
||||||
|
[AC_MSG_CHECKING(if unaligned accesses fail)
|
||||||
|
AC_CACHE_VAL(ac_cv_lbl_unaligned_fail,
|
||||||
|
[case "$target_cpu" in
|
||||||
|
|
||||||
|
alpha|hp*|mips|sparc)
|
||||||
|
ac_cv_lbl_unaligned_fail=yes
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
cat >conftest.c <<EOF
|
||||||
|
# include <sys/types.h>
|
||||||
|
# include <sys/wait.h>
|
||||||
|
# include <stdio.h>
|
||||||
|
unsigned char a[[5]] = { 1, 2, 3, 4, 5 };
|
||||||
|
main() {
|
||||||
|
unsigned int i;
|
||||||
|
pid_t pid;
|
||||||
|
int status;
|
||||||
|
/* avoid "core dumped" message */
|
||||||
|
pid = fork();
|
||||||
|
if (pid < 0)
|
||||||
|
exit(2);
|
||||||
|
if (pid > 0) {
|
||||||
|
/* parent */
|
||||||
|
pid = waitpid(pid, &status, 0);
|
||||||
|
if (pid < 0)
|
||||||
|
exit(3);
|
||||||
|
exit(!WIFEXITED(status));
|
||||||
|
}
|
||||||
|
/* child */
|
||||||
|
i = *(unsigned int *)&a[[1]];
|
||||||
|
printf("%d\n", i);
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS \
|
||||||
|
conftest.c $LIBS >/dev/null 2>&1
|
||||||
|
if test ! -x conftest ; then
|
||||||
|
dnl failed to compile for some reason
|
||||||
|
ac_cv_lbl_unaligned_fail=yes
|
||||||
|
else
|
||||||
|
./conftest >conftest.out
|
||||||
|
if test ! -s conftest.out ; then
|
||||||
|
ac_cv_lbl_unaligned_fail=yes
|
||||||
|
else
|
||||||
|
ac_cv_lbl_unaligned_fail=no
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
rm -f conftest* core core.conftest
|
||||||
|
;;
|
||||||
|
esac])
|
||||||
|
AC_MSG_RESULT($ac_cv_lbl_unaligned_fail)
|
||||||
|
if test $ac_cv_lbl_unaligned_fail = yes ; then
|
||||||
|
AC_DEFINE(LBL_ALIGN)
|
||||||
|
fi])
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl add all warning option to CFLAGS
|
||||||
|
dnl
|
||||||
|
dnl usage:
|
||||||
|
dnl
|
||||||
|
dnl AC_LBL_CHECK_WALL(copt)
|
||||||
|
dnl
|
||||||
|
dnl results:
|
||||||
|
dnl
|
||||||
|
dnl $1 (copt appended)
|
||||||
|
dnl ac_cv_lbl_gcc_vers
|
||||||
|
dnl
|
||||||
|
AC_DEFUN(AC_LBL_CHECK_WALL,
|
||||||
|
[ if test "$GCC" = yes ; then
|
||||||
|
if test "$SHLICC2" = yes ; then
|
||||||
|
ac_cv_lbl_gcc_vers=2
|
||||||
|
$1="`echo $$1 | sed -e 's/-O/-O2/'`"
|
||||||
|
else
|
||||||
|
AC_MSG_CHECKING(gcc version)
|
||||||
|
AC_CACHE_VAL(ac_cv_lbl_gcc_vers,
|
||||||
|
# Gag, the gcc folks keep changing the output...
|
||||||
|
ac_cv_lbl_gcc_vers=`$CC --version 2>&1 | \
|
||||||
|
sed -e '1!d' -e 's/.* //' -e 's/\..*//'`)
|
||||||
|
AC_MSG_RESULT($ac_cv_lbl_gcc_vers)
|
||||||
|
if test $ac_cv_lbl_gcc_vers -gt 1 ; then
|
||||||
|
$1="`echo $$1 | sed -e 's/-O/-O2/'`"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if test "${LBL_CFLAGS+set}" != set; then
|
||||||
|
if test "$ac_cv_prog_cc_g" = yes ; then
|
||||||
|
$1="-g $$1"
|
||||||
|
fi
|
||||||
|
$1="$$1 -Wall"
|
||||||
|
if test $ac_cv_lbl_gcc_vers -gt 1 ; then
|
||||||
|
$1="$$1 -Wmissing-prototypes -Wstrict-prototypes"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
case "$target_os" in
|
||||||
|
|
||||||
|
irix6*)
|
||||||
|
$1="$$1 -fullwarn -n32"
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi])
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl If using gcc and the file .devel exists:
|
||||||
|
dnl Compile with -g (if supported) and -Wall
|
||||||
|
dnl If using gcc 2, do extra prototype checking
|
||||||
|
dnl If an os prototype include exists, symlink os-proto.h to it
|
||||||
|
dnl
|
||||||
|
dnl usage:
|
||||||
|
dnl
|
||||||
|
dnl AC_LBL_DEVEL(copt)
|
||||||
|
dnl
|
||||||
|
dnl results:
|
||||||
|
dnl
|
||||||
|
dnl $1 (copt appended)
|
||||||
|
dnl HAVE_OS_PROTO_H (defined)
|
||||||
|
dnl os-proto.h (symlinked)
|
||||||
|
dnl
|
||||||
|
AC_DEFUN(AC_LBL_DEVEL,
|
||||||
|
[rm -f os-proto.h
|
||||||
|
if test "${LBL_CFLAGS+set}" = set; then
|
||||||
|
$1="$$1 ${LBL_CFLAGS}"
|
||||||
|
fi
|
||||||
|
if test -f .devel ; then
|
||||||
|
AC_LBL_CHECK_WALL($1)
|
||||||
|
os=`echo $target_os | sed -e 's/\([[0-9]][[0-9]]*\)[[^0-9]].*$/\1/'`
|
||||||
|
name="lbl/os-$os.h"
|
||||||
|
if test -f $name ; then
|
||||||
|
ln -s $name os-proto.h
|
||||||
|
AC_DEFINE(HAVE_OS_PROTO_H,,[have os-proto.h])
|
||||||
|
else
|
||||||
|
AC_MSG_WARN(can't find $name)
|
||||||
|
fi
|
||||||
|
fi])
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl Improved version of AC_CHECK_LIB
|
||||||
|
dnl
|
||||||
|
dnl Thanks to John Hawkinson (jhawk@mit.edu)
|
||||||
|
dnl
|
||||||
|
dnl usage:
|
||||||
|
dnl
|
||||||
|
dnl AC_LBL_CHECK_LIB(LIBRARY, FUNCTION [, ACTION-IF-FOUND [,
|
||||||
|
dnl ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]])
|
||||||
|
dnl
|
||||||
|
dnl results:
|
||||||
|
dnl
|
||||||
|
dnl LIBS
|
||||||
|
dnl
|
||||||
|
|
||||||
|
define(AC_LBL_CHECK_LIB,
|
||||||
|
[AC_MSG_CHECKING([for $2 in -l$1])
|
||||||
|
dnl Use a cache variable name containing both the library and function name,
|
||||||
|
dnl because the test really is for library $1 defining function $2, not
|
||||||
|
dnl just for library $1. Separate tests with the same $1 and different $2's
|
||||||
|
dnl may have different results.
|
||||||
|
ac_lib_var=`echo $1['_']$2['_']$5 | sed 'y%./+- %__p__%'`
|
||||||
|
AC_CACHE_VAL(ac_cv_lbl_lib_$ac_lib_var,
|
||||||
|
[ac_save_LIBS="$LIBS"
|
||||||
|
LIBS="-l$1 $5 $LIBS"
|
||||||
|
AC_TRY_LINK(dnl
|
||||||
|
ifelse([$2], [main], , dnl Avoid conflicting decl of main.
|
||||||
|
[/* Override any gcc2 internal prototype to avoid an error. */
|
||||||
|
]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
|
||||||
|
extern "C"
|
||||||
|
#endif
|
||||||
|
])dnl
|
||||||
|
[/* We use char because int might match the return type of a gcc2
|
||||||
|
builtin and then its argument prototype would still apply. */
|
||||||
|
char $2();
|
||||||
|
]),
|
||||||
|
[$2()],
|
||||||
|
eval "ac_cv_lbl_lib_$ac_lib_var=yes",
|
||||||
|
eval "ac_cv_lbl_lib_$ac_lib_var=no")
|
||||||
|
LIBS="$ac_save_LIBS"
|
||||||
|
])dnl
|
||||||
|
if eval "test \"`echo '$ac_cv_lbl_lib_'$ac_lib_var`\" = yes"; then
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
ifelse([$3], ,
|
||||||
|
[changequote(, )dnl
|
||||||
|
ac_tr_lib=HAVE_LIB`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
|
||||||
|
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
|
||||||
|
changequote([, ])dnl
|
||||||
|
AC_DEFINE_UNQUOTED($ac_tr_lib)
|
||||||
|
LIBS="-l$1 $LIBS"
|
||||||
|
], [$3])
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
ifelse([$4], , , [$4
|
||||||
|
])dnl
|
||||||
|
fi
|
||||||
|
])
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl AC_LBL_LIBRARY_NET
|
||||||
|
dnl
|
||||||
|
dnl This test is for network applications that need socket() and
|
||||||
|
dnl gethostbyname() -ish functions. Under Solaris, those applications
|
||||||
|
dnl need to link with "-lsocket -lnsl". Under IRIX, they need to link
|
||||||
|
dnl with "-lnsl" but should *not* link with "-lsocket" because
|
||||||
|
dnl libsocket.a breaks a number of things (for instance:
|
||||||
|
dnl gethostbyname() under IRIX 5.2, and snoop sockets under most
|
||||||
|
dnl versions of IRIX).
|
||||||
|
dnl
|
||||||
|
dnl Unfortunately, many application developers are not aware of this,
|
||||||
|
dnl and mistakenly write tests that cause -lsocket to be used under
|
||||||
|
dnl IRIX. It is also easy to write tests that cause -lnsl to be used
|
||||||
|
dnl under operating systems where neither are necessary (or useful),
|
||||||
|
dnl such as SunOS 4.1.4, which uses -lnsl for TLI.
|
||||||
|
dnl
|
||||||
|
dnl This test exists so that every application developer does not test
|
||||||
|
dnl this in a different, and subtly broken fashion.
|
||||||
|
|
||||||
|
dnl It has been argued that this test should be broken up into two
|
||||||
|
dnl seperate tests, one for the resolver libraries, and one for the
|
||||||
|
dnl libraries necessary for using Sockets API. Unfortunately, the two
|
||||||
|
dnl are carefully intertwined and allowing the autoconf user to use
|
||||||
|
dnl them independantly potentially results in unfortunate ordering
|
||||||
|
dnl dependancies -- as such, such component macros would have to
|
||||||
|
dnl carefully use indirection and be aware if the other components were
|
||||||
|
dnl executed. Since other autoconf macros do not go to this trouble,
|
||||||
|
dnl and almost no applications use sockets without the resolver, this
|
||||||
|
dnl complexity has not been implemented.
|
||||||
|
dnl
|
||||||
|
dnl The check for libresolv is in case you are attempting to link
|
||||||
|
dnl statically and happen to have a libresolv.a lying around (and no
|
||||||
|
dnl libnsl.a).
|
||||||
|
dnl
|
||||||
|
AC_DEFUN(AC_LBL_LIBRARY_NET, [
|
||||||
|
# Most operating systems have gethostbyname() in the default searched
|
||||||
|
# libraries (i.e. libc):
|
||||||
|
AC_CHECK_FUNC(gethostbyname, ,
|
||||||
|
# Some OSes (eg. Solaris) place it in libnsl:
|
||||||
|
AC_CHECK_LIB(nsl, gethostbyname, ,
|
||||||
|
# Some strange OSes (SINIX) have it in libsocket:
|
||||||
|
AC_CHECK_LIB(socket, gethostbyname, ,
|
||||||
|
# Unfortunately libsocket sometimes depends on libnsl.
|
||||||
|
# AC_CHECK_LIB's API is essentially broken so the
|
||||||
|
# following ugliness is necessary:
|
||||||
|
AC_CHECK_LIB(socket, gethostbyname,
|
||||||
|
LIBS="-lsocket -lnsl $LIBS",
|
||||||
|
AC_CHECK_LIB(resolv, gethostbyname),
|
||||||
|
-lnsl))))
|
||||||
|
AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket, ,
|
||||||
|
AC_CHECK_LIB(socket, socket, LIBS="-lsocket -lnsl $LIBS", ,
|
||||||
|
-lnsl)))
|
||||||
|
# DLPI needs putmsg under HPUX so test for -lstr while we're at it
|
||||||
|
AC_CHECK_LIB(str, putmsg)
|
||||||
|
])
|
1407
dns/nslint-2.1a8/config.guess
vendored
Executable file
1407
dns/nslint-2.1a8/config.guess
vendored
Executable file
File diff suppressed because it is too large
Load diff
1504
dns/nslint-2.1a8/config.sub
vendored
Executable file
1504
dns/nslint-2.1a8/config.sub
vendored
Executable file
File diff suppressed because it is too large
Load diff
5385
dns/nslint-2.1a8/configure
vendored
Executable file
5385
dns/nslint-2.1a8/configure
vendored
Executable file
File diff suppressed because it is too large
Load diff
47
dns/nslint-2.1a8/configure.in
Normal file
47
dns/nslint-2.1a8/configure.in
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
dnl @(#) $Header: /usr/src/local/bin/nslint/RCS/configure.in,v 1.11 2006/03/09 02:27:20 leres Exp $ (LBL)
|
||||||
|
dnl
|
||||||
|
dnl Copyright (c) 1995, 1996, 1997, 2006
|
||||||
|
dnl The Regents of the University of California. All rights reserved.
|
||||||
|
dnl
|
||||||
|
dnl Process this file with autoconf to produce a configure script.
|
||||||
|
dnl
|
||||||
|
|
||||||
|
AC_INIT(nslint.c)
|
||||||
|
|
||||||
|
AC_CANONICAL_SYSTEM
|
||||||
|
|
||||||
|
umask 002
|
||||||
|
|
||||||
|
if test -z "$PWD" ; then
|
||||||
|
PWD=`pwd`
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_LBL_C_INIT(V_CCOPT, V_INCLS)
|
||||||
|
|
||||||
|
AC_CHECK_HEADERS(fcntl.h memory.h)
|
||||||
|
|
||||||
|
AC_REPLACE_FUNCS(strerror)
|
||||||
|
AC_CHECK_LIB(nsl, main)
|
||||||
|
AC_CHECK_LIB(socket, main)
|
||||||
|
|
||||||
|
AC_LBL_CHECK_TYPE(int32_t, int)
|
||||||
|
AC_LBL_CHECK_TYPE(u_int32_t, u_int)
|
||||||
|
|
||||||
|
AC_LBL_DEVEL(V_CCOPT)
|
||||||
|
|
||||||
|
if test -r lbl/gnuc.h ; then
|
||||||
|
rm -f gnuc.h
|
||||||
|
ln -s lbl/gnuc.h gnuc.h
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_SUBST(V_CCOPT)
|
||||||
|
AC_SUBST(V_INCLS)
|
||||||
|
|
||||||
|
AC_PROG_INSTALL
|
||||||
|
|
||||||
|
AC_OUTPUT(Makefile)
|
||||||
|
|
||||||
|
if test -f .devel ; then
|
||||||
|
make depend
|
||||||
|
fi
|
||||||
|
exit 0
|
507
dns/nslint-2.1a8/install-sh
Executable file
507
dns/nslint-2.1a8/install-sh
Executable file
|
@ -0,0 +1,507 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# install - install a program, script, or datafile
|
||||||
|
|
||||||
|
scriptversion=2006-10-14.15
|
||||||
|
|
||||||
|
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||||
|
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||||
|
# following copyright and license.
|
||||||
|
#
|
||||||
|
# Copyright (C) 1994 X Consortium
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
# of this software and associated documentation files (the "Software"), to
|
||||||
|
# deal in the Software without restriction, including without limitation the
|
||||||
|
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||||
|
# sell copies of the Software, and to permit persons to whom the Software is
|
||||||
|
# furnished to do so, subject to the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice shall be included in
|
||||||
|
# all copies or substantial portions of the Software.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||||
|
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
||||||
|
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
#
|
||||||
|
# Except as contained in this notice, the name of the X Consortium shall not
|
||||||
|
# be used in advertising or otherwise to promote the sale, use or other deal-
|
||||||
|
# ings in this Software without prior written authorization from the X Consor-
|
||||||
|
# tium.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# FSF changes to this file are in the public domain.
|
||||||
|
#
|
||||||
|
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||||
|
# `make' implicit rules from creating a file called install from it
|
||||||
|
# when there is no Makefile.
|
||||||
|
#
|
||||||
|
# This script is compatible with the BSD install script, but was written
|
||||||
|
# from scratch.
|
||||||
|
|
||||||
|
nl='
|
||||||
|
'
|
||||||
|
IFS=" "" $nl"
|
||||||
|
|
||||||
|
# set DOITPROG to echo to test this script
|
||||||
|
|
||||||
|
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||||
|
doit="${DOITPROG-}"
|
||||||
|
if test -z "$doit"; then
|
||||||
|
doit_exec=exec
|
||||||
|
else
|
||||||
|
doit_exec=$doit
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Put in absolute file names if you don't have them in your path;
|
||||||
|
# or use environment vars.
|
||||||
|
|
||||||
|
mvprog="${MVPROG-mv}"
|
||||||
|
cpprog="${CPPROG-cp}"
|
||||||
|
chmodprog="${CHMODPROG-chmod}"
|
||||||
|
chownprog="${CHOWNPROG-chown}"
|
||||||
|
chgrpprog="${CHGRPPROG-chgrp}"
|
||||||
|
stripprog="${STRIPPROG-strip}"
|
||||||
|
rmprog="${RMPROG-rm}"
|
||||||
|
mkdirprog="${MKDIRPROG-mkdir}"
|
||||||
|
|
||||||
|
posix_glob=
|
||||||
|
posix_mkdir=
|
||||||
|
|
||||||
|
# Desired mode of installed file.
|
||||||
|
mode=0755
|
||||||
|
|
||||||
|
chmodcmd=$chmodprog
|
||||||
|
chowncmd=
|
||||||
|
chgrpcmd=
|
||||||
|
stripcmd=
|
||||||
|
rmcmd="$rmprog -f"
|
||||||
|
mvcmd="$mvprog"
|
||||||
|
src=
|
||||||
|
dst=
|
||||||
|
dir_arg=
|
||||||
|
dstarg=
|
||||||
|
no_target_directory=
|
||||||
|
|
||||||
|
usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
||||||
|
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
||||||
|
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
|
||||||
|
or: $0 [OPTION]... -d DIRECTORIES...
|
||||||
|
|
||||||
|
In the 1st form, copy SRCFILE to DSTFILE.
|
||||||
|
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
|
||||||
|
In the 4th, create DIRECTORIES.
|
||||||
|
|
||||||
|
Options:
|
||||||
|
-c (ignored)
|
||||||
|
-d create directories instead of installing files.
|
||||||
|
-g GROUP $chgrpprog installed files to GROUP.
|
||||||
|
-m MODE $chmodprog installed files to MODE.
|
||||||
|
-o USER $chownprog installed files to USER.
|
||||||
|
-s $stripprog installed files.
|
||||||
|
-t DIRECTORY install into DIRECTORY.
|
||||||
|
-T report an error if DSTFILE is a directory.
|
||||||
|
--help display this help and exit.
|
||||||
|
--version display version info and exit.
|
||||||
|
|
||||||
|
Environment variables override the default commands:
|
||||||
|
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
|
||||||
|
"
|
||||||
|
|
||||||
|
while test $# -ne 0; do
|
||||||
|
case $1 in
|
||||||
|
-c) shift
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
-d) dir_arg=true
|
||||||
|
shift
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
-g) chgrpcmd="$chgrpprog $2"
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
--help) echo "$usage"; exit $?;;
|
||||||
|
|
||||||
|
-m) mode=$2
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
case $mode in
|
||||||
|
*' '* | *' '* | *'
|
||||||
|
'* | *'*'* | *'?'* | *'['*)
|
||||||
|
echo "$0: invalid mode: $mode" >&2
|
||||||
|
exit 1;;
|
||||||
|
esac
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
-o) chowncmd="$chownprog $2"
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
-s) stripcmd=$stripprog
|
||||||
|
shift
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
-t) dstarg=$2
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
-T) no_target_directory=true
|
||||||
|
shift
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
--version) echo "$0 $scriptversion"; exit $?;;
|
||||||
|
|
||||||
|
--) shift
|
||||||
|
break;;
|
||||||
|
|
||||||
|
-*) echo "$0: invalid option: $1" >&2
|
||||||
|
exit 1;;
|
||||||
|
|
||||||
|
*) break;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
if test $# -ne 0 && test -z "$dir_arg$dstarg"; then
|
||||||
|
# When -d is used, all remaining arguments are directories to create.
|
||||||
|
# When -t is used, the destination is already specified.
|
||||||
|
# Otherwise, the last argument is the destination. Remove it from $@.
|
||||||
|
for arg
|
||||||
|
do
|
||||||
|
if test -n "$dstarg"; then
|
||||||
|
# $@ is not empty: it contains at least $arg.
|
||||||
|
set fnord "$@" "$dstarg"
|
||||||
|
shift # fnord
|
||||||
|
fi
|
||||||
|
shift # arg
|
||||||
|
dstarg=$arg
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test $# -eq 0; then
|
||||||
|
if test -z "$dir_arg"; then
|
||||||
|
echo "$0: no input file specified." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
# It's OK to call `install-sh -d' without argument.
|
||||||
|
# This can happen when creating conditional directories.
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -z "$dir_arg"; then
|
||||||
|
trap '(exit $?); exit' 1 2 13 15
|
||||||
|
|
||||||
|
# Set umask so as not to create temps with too-generous modes.
|
||||||
|
# However, 'strip' requires both read and write access to temps.
|
||||||
|
case $mode in
|
||||||
|
# Optimize common cases.
|
||||||
|
*644) cp_umask=133;;
|
||||||
|
*755) cp_umask=22;;
|
||||||
|
|
||||||
|
*[0-7])
|
||||||
|
if test -z "$stripcmd"; then
|
||||||
|
u_plus_rw=
|
||||||
|
else
|
||||||
|
u_plus_rw='% 200'
|
||||||
|
fi
|
||||||
|
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
|
||||||
|
*)
|
||||||
|
if test -z "$stripcmd"; then
|
||||||
|
u_plus_rw=
|
||||||
|
else
|
||||||
|
u_plus_rw=,u+rw
|
||||||
|
fi
|
||||||
|
cp_umask=$mode$u_plus_rw;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
for src
|
||||||
|
do
|
||||||
|
# Protect names starting with `-'.
|
||||||
|
case $src in
|
||||||
|
-*) src=./$src ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if test -n "$dir_arg"; then
|
||||||
|
dst=$src
|
||||||
|
dstdir=$dst
|
||||||
|
test -d "$dstdir"
|
||||||
|
dstdir_status=$?
|
||||||
|
else
|
||||||
|
|
||||||
|
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
|
||||||
|
# might cause directories to be created, which would be especially bad
|
||||||
|
# if $src (and thus $dsttmp) contains '*'.
|
||||||
|
if test ! -f "$src" && test ! -d "$src"; then
|
||||||
|
echo "$0: $src does not exist." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -z "$dstarg"; then
|
||||||
|
echo "$0: no destination specified." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
dst=$dstarg
|
||||||
|
# Protect names starting with `-'.
|
||||||
|
case $dst in
|
||||||
|
-*) dst=./$dst ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# If destination is a directory, append the input filename; won't work
|
||||||
|
# if double slashes aren't ignored.
|
||||||
|
if test -d "$dst"; then
|
||||||
|
if test -n "$no_target_directory"; then
|
||||||
|
echo "$0: $dstarg: Is a directory" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
dstdir=$dst
|
||||||
|
dst=$dstdir/`basename "$src"`
|
||||||
|
dstdir_status=0
|
||||||
|
else
|
||||||
|
# Prefer dirname, but fall back on a substitute if dirname fails.
|
||||||
|
dstdir=`
|
||||||
|
(dirname "$dst") 2>/dev/null ||
|
||||||
|
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
|
||||||
|
X"$dst" : 'X\(//\)[^/]' \| \
|
||||||
|
X"$dst" : 'X\(//\)$' \| \
|
||||||
|
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
|
||||||
|
echo X"$dst" |
|
||||||
|
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
|
||||||
|
s//\1/
|
||||||
|
q
|
||||||
|
}
|
||||||
|
/^X\(\/\/\)[^/].*/{
|
||||||
|
s//\1/
|
||||||
|
q
|
||||||
|
}
|
||||||
|
/^X\(\/\/\)$/{
|
||||||
|
s//\1/
|
||||||
|
q
|
||||||
|
}
|
||||||
|
/^X\(\/\).*/{
|
||||||
|
s//\1/
|
||||||
|
q
|
||||||
|
}
|
||||||
|
s/.*/./; q'
|
||||||
|
`
|
||||||
|
|
||||||
|
test -d "$dstdir"
|
||||||
|
dstdir_status=$?
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
obsolete_mkdir_used=false
|
||||||
|
|
||||||
|
if test $dstdir_status != 0; then
|
||||||
|
case $posix_mkdir in
|
||||||
|
'')
|
||||||
|
# Create intermediate dirs using mode 755 as modified by the umask.
|
||||||
|
# This is like FreeBSD 'install' as of 1997-10-28.
|
||||||
|
umask=`umask`
|
||||||
|
case $stripcmd.$umask in
|
||||||
|
# Optimize common cases.
|
||||||
|
*[2367][2367]) mkdir_umask=$umask;;
|
||||||
|
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
|
||||||
|
|
||||||
|
*[0-7])
|
||||||
|
mkdir_umask=`expr $umask + 22 \
|
||||||
|
- $umask % 100 % 40 + $umask % 20 \
|
||||||
|
- $umask % 10 % 4 + $umask % 2
|
||||||
|
`;;
|
||||||
|
*) mkdir_umask=$umask,go-w;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# With -d, create the new directory with the user-specified mode.
|
||||||
|
# Otherwise, rely on $mkdir_umask.
|
||||||
|
if test -n "$dir_arg"; then
|
||||||
|
mkdir_mode=-m$mode
|
||||||
|
else
|
||||||
|
mkdir_mode=
|
||||||
|
fi
|
||||||
|
|
||||||
|
posix_mkdir=false
|
||||||
|
case $umask in
|
||||||
|
*[123567][0-7][0-7])
|
||||||
|
# POSIX mkdir -p sets u+wx bits regardless of umask, which
|
||||||
|
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
|
||||||
|
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
|
||||||
|
|
||||||
|
if (umask $mkdir_umask &&
|
||||||
|
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
if test -z "$dir_arg" || {
|
||||||
|
# Check for POSIX incompatibilities with -m.
|
||||||
|
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
||||||
|
# other-writeable bit of parent directory when it shouldn't.
|
||||||
|
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
||||||
|
ls_ld_tmpdir=`ls -ld "$tmpdir"`
|
||||||
|
case $ls_ld_tmpdir in
|
||||||
|
d????-?r-*) different_mode=700;;
|
||||||
|
d????-?--*) different_mode=755;;
|
||||||
|
*) false;;
|
||||||
|
esac &&
|
||||||
|
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
|
||||||
|
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
|
||||||
|
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
then posix_mkdir=:
|
||||||
|
fi
|
||||||
|
rmdir "$tmpdir/d" "$tmpdir"
|
||||||
|
else
|
||||||
|
# Remove any dirs left behind by ancient mkdir implementations.
|
||||||
|
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
|
||||||
|
fi
|
||||||
|
trap '' 0;;
|
||||||
|
esac;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if
|
||||||
|
$posix_mkdir && (
|
||||||
|
umask $mkdir_umask &&
|
||||||
|
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
|
||||||
|
)
|
||||||
|
then :
|
||||||
|
else
|
||||||
|
|
||||||
|
# The umask is ridiculous, or mkdir does not conform to POSIX,
|
||||||
|
# or it failed possibly due to a race condition. Create the
|
||||||
|
# directory the slow way, step by step, checking for races as we go.
|
||||||
|
|
||||||
|
case $dstdir in
|
||||||
|
/*) prefix=/ ;;
|
||||||
|
-*) prefix=./ ;;
|
||||||
|
*) prefix= ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
case $posix_glob in
|
||||||
|
'')
|
||||||
|
if (set -f) 2>/dev/null; then
|
||||||
|
posix_glob=true
|
||||||
|
else
|
||||||
|
posix_glob=false
|
||||||
|
fi ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
oIFS=$IFS
|
||||||
|
IFS=/
|
||||||
|
$posix_glob && set -f
|
||||||
|
set fnord $dstdir
|
||||||
|
shift
|
||||||
|
$posix_glob && set +f
|
||||||
|
IFS=$oIFS
|
||||||
|
|
||||||
|
prefixes=
|
||||||
|
|
||||||
|
for d
|
||||||
|
do
|
||||||
|
test -z "$d" && continue
|
||||||
|
|
||||||
|
prefix=$prefix$d
|
||||||
|
if test -d "$prefix"; then
|
||||||
|
prefixes=
|
||||||
|
else
|
||||||
|
if $posix_mkdir; then
|
||||||
|
(umask=$mkdir_umask &&
|
||||||
|
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
|
||||||
|
# Don't fail if two instances are running concurrently.
|
||||||
|
test -d "$prefix" || exit 1
|
||||||
|
else
|
||||||
|
case $prefix in
|
||||||
|
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
|
||||||
|
*) qprefix=$prefix;;
|
||||||
|
esac
|
||||||
|
prefixes="$prefixes '$qprefix'"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
prefix=$prefix/
|
||||||
|
done
|
||||||
|
|
||||||
|
if test -n "$prefixes"; then
|
||||||
|
# Don't fail if two instances are running concurrently.
|
||||||
|
(umask $mkdir_umask &&
|
||||||
|
eval "\$doit_exec \$mkdirprog $prefixes") ||
|
||||||
|
test -d "$dstdir" || exit 1
|
||||||
|
obsolete_mkdir_used=true
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -n "$dir_arg"; then
|
||||||
|
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
|
||||||
|
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
|
||||||
|
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
|
||||||
|
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
|
||||||
|
else
|
||||||
|
|
||||||
|
# Make a couple of temp file names in the proper directory.
|
||||||
|
dsttmp=$dstdir/_inst.$$_
|
||||||
|
rmtmp=$dstdir/_rm.$$_
|
||||||
|
|
||||||
|
# Trap to clean up those temp files at exit.
|
||||||
|
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
|
||||||
|
|
||||||
|
# Copy the file name to the temp name.
|
||||||
|
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
|
||||||
|
|
||||||
|
# and set any options; do chmod last to preserve setuid bits.
|
||||||
|
#
|
||||||
|
# If any of these fail, we abort the whole thing. If we want to
|
||||||
|
# ignore errors from any of these, just make sure not to ignore
|
||||||
|
# errors from the above "$doit $cpprog $src $dsttmp" command.
|
||||||
|
#
|
||||||
|
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
|
||||||
|
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
|
||||||
|
&& { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
|
||||||
|
&& { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
|
||||||
|
|
||||||
|
# Now rename the file to the real destination.
|
||||||
|
{ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \
|
||||||
|
|| {
|
||||||
|
# The rename failed, perhaps because mv can't rename something else
|
||||||
|
# to itself, or perhaps because mv is so ancient that it does not
|
||||||
|
# support -f.
|
||||||
|
|
||||||
|
# Now remove or move aside any old file at destination location.
|
||||||
|
# We try this two ways since rm can't unlink itself on some
|
||||||
|
# systems and the destination file might be busy for other
|
||||||
|
# reasons. In this case, the final cleanup might fail but the new
|
||||||
|
# file should still install successfully.
|
||||||
|
{
|
||||||
|
if test -f "$dst"; then
|
||||||
|
$doit $rmcmd -f "$dst" 2>/dev/null \
|
||||||
|
|| { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \
|
||||||
|
&& { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\
|
||||||
|
|| {
|
||||||
|
echo "$0: cannot unlink or rename $dst" >&2
|
||||||
|
(exit 1); exit 1
|
||||||
|
}
|
||||||
|
else
|
||||||
|
:
|
||||||
|
fi
|
||||||
|
} &&
|
||||||
|
|
||||||
|
# Now rename the file to the real destination.
|
||||||
|
$doit $mvcmd "$dsttmp" "$dst"
|
||||||
|
}
|
||||||
|
} || exit 1
|
||||||
|
|
||||||
|
trap '' 0
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Local variables:
|
||||||
|
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||||
|
# time-stamp-start: "scriptversion="
|
||||||
|
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||||
|
# time-stamp-end: "$"
|
||||||
|
# End:
|
49
dns/nslint-2.1a8/lbl/gnuc.h
Normal file
49
dns/nslint-2.1a8/lbl/gnuc.h
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
/* @(#) $Id: gnuc.h,v 1.4 2006/04/30 03:58:45 leres Exp $ (LBL) */
|
||||||
|
|
||||||
|
/* Define __P() macro, if necessary */
|
||||||
|
#ifndef __P
|
||||||
|
#if __STDC__
|
||||||
|
#define __P(protos) protos
|
||||||
|
#else
|
||||||
|
#define __P(protos) ()
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* inline foo */
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#define inline __inline
|
||||||
|
#else
|
||||||
|
#define inline
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Handle new and old "dead" routine prototypes
|
||||||
|
*
|
||||||
|
* For example:
|
||||||
|
*
|
||||||
|
* __dead void foo(void) __attribute__((noreturn));
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#ifndef __dead
|
||||||
|
#if __GNUC__ >= 4
|
||||||
|
#define __dead
|
||||||
|
#define noreturn __noreturn__
|
||||||
|
#else
|
||||||
|
#define __dead volatile
|
||||||
|
#define noreturn volatile
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
|
||||||
|
#ifndef __attribute__
|
||||||
|
#define __attribute__(args)
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#ifndef __dead
|
||||||
|
#define __dead
|
||||||
|
#endif
|
||||||
|
#ifndef __attribute__
|
||||||
|
#define __attribute__(args)
|
||||||
|
#endif
|
||||||
|
#endif
|
38
dns/nslint-2.1a8/lbl/os-irix5.h
Normal file
38
dns/nslint-2.1a8/lbl/os-irix5.h
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 1994, 1995, 1996
|
||||||
|
* 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: (1) source code distributions
|
||||||
|
* retain the above copyright notice and this paragraph in its entirety, (2)
|
||||||
|
* distributions including binary code include the above copyright notice and
|
||||||
|
* this paragraph in its entirety in the documentation or other materials
|
||||||
|
* provided with the distribution, and (3) all advertising materials mentioning
|
||||||
|
* features or use of this software display the following acknowledgement:
|
||||||
|
* ``This product includes software developed by the University of California,
|
||||||
|
* Lawrence Berkeley Laboratory and its contributors.'' 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 ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||||
|
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||||
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
* @(#) $Header: os-irix5.h,v 1.7 96/11/29 15:17:43 leres Exp $ (LBL)
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Prototypes missing in IRIX 5 */
|
||||||
|
#ifdef __STDC__
|
||||||
|
struct ether_addr;
|
||||||
|
#endif
|
||||||
|
int ether_hostton(char *, struct ether_addr *);
|
||||||
|
char *ether_ntoa(struct ether_addr *);
|
||||||
|
#ifdef __STDC__
|
||||||
|
struct utmp;
|
||||||
|
#endif
|
||||||
|
void login(struct utmp *);
|
||||||
|
int setenv(const char *, const char *, int);
|
||||||
|
int sigblock(int);
|
||||||
|
int sigsetmask(int);
|
||||||
|
int snprintf(char *, size_t, const char *, ...);
|
||||||
|
time_t time(time_t *);
|
32
dns/nslint-2.1a8/lbl/os-osf3.h
Normal file
32
dns/nslint-2.1a8/lbl/os-osf3.h
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 1995, 1996
|
||||||
|
* 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: (1) source code distributions
|
||||||
|
* retain the above copyright notice and this paragraph in its entirety, (2)
|
||||||
|
* distributions including binary code include the above copyright notice and
|
||||||
|
* this paragraph in its entirety in the documentation or other materials
|
||||||
|
* provided with the distribution, and (3) all advertising materials mentioning
|
||||||
|
* features or use of this software display the following acknowledgement:
|
||||||
|
* ``This product includes software developed by the University of California,
|
||||||
|
* Lawrence Berkeley Laboratory and its contributors.'' 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 ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||||
|
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||||
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
* @(#) $Header: os-osf3.h,v 1.8 96/11/29 15:17:43 leres Exp $ (LBL)
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Prototypes missing in osf3 */
|
||||||
|
int flock(int, int);
|
||||||
|
int ioctl(int, int, caddr_t);
|
||||||
|
int iruserok(u_int, int, char *, char *);
|
||||||
|
int pfopen(char *, int);
|
||||||
|
int rcmd(char **, u_short, const char *, const char *, const char *, int *);
|
||||||
|
int rresvport(int *);
|
||||||
|
int snprintf(char *, size_t, const char *, ...);
|
||||||
|
void sync(void);
|
50
dns/nslint-2.1a8/lbl/os-solaris2.h
Normal file
50
dns/nslint-2.1a8/lbl/os-solaris2.h
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 1993, 1994, 1995, 1996, 1997, 2000
|
||||||
|
* 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: (1) source code distributions
|
||||||
|
* retain the above copyright notice and this paragraph in its entirety, (2)
|
||||||
|
* distributions including binary code include the above copyright notice and
|
||||||
|
* this paragraph in its entirety in the documentation or other materials
|
||||||
|
* provided with the distribution, and (3) all advertising materials mentioning
|
||||||
|
* features or use of this software display the following acknowledgement:
|
||||||
|
* ``This product includes software developed by the University of California,
|
||||||
|
* Lawrence Berkeley Laboratory and its contributors.'' 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 ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||||
|
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||||
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
* @(#) $Id: os-solaris2.h,v 1.18 1997/10/01 01:10:22 leres Exp leres $ (LBL)
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Prototypes missing in SunOS 5 */
|
||||||
|
int daemon(int, int);
|
||||||
|
int dn_expand(const u_char *, const u_char *, const u_char *, char *, int);
|
||||||
|
int dn_skipname(const u_char *, const u_char *);
|
||||||
|
int flock(int, int);
|
||||||
|
int getdtablesize(void);
|
||||||
|
int gethostname(char *, int);
|
||||||
|
int getpagesize(void);
|
||||||
|
char *getusershell(void);
|
||||||
|
char *getwd(char *);
|
||||||
|
int iruserok(u_int, int, char *, char *);
|
||||||
|
#ifdef __STDC__
|
||||||
|
struct utmp;
|
||||||
|
void login(struct utmp *);
|
||||||
|
#endif
|
||||||
|
int logout(const char *);
|
||||||
|
int res_query(const char *, int, int, u_char *, int);
|
||||||
|
int setenv(const char *, const char *, int);
|
||||||
|
#if defined(_STDIO_H) && defined(HAVE_SETLINEBUF)
|
||||||
|
int setlinebuf(FILE *);
|
||||||
|
#endif
|
||||||
|
int sigblock(int);
|
||||||
|
int sigsetmask(int);
|
||||||
|
char *strerror(int);
|
||||||
|
int snprintf(char *, size_t, const char *, ...);
|
||||||
|
int strcasecmp(const char *, const char *);
|
||||||
|
void unsetenv(const char *);
|
215
dns/nslint-2.1a8/lbl/os-sunos4.h
Normal file
215
dns/nslint-2.1a8/lbl/os-sunos4.h
Normal file
|
@ -0,0 +1,215 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 1989, 1990, 1993, 1994, 1995, 1996
|
||||||
|
* 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: (1) source code distributions
|
||||||
|
* retain the above copyright notice and this paragraph in its entirety, (2)
|
||||||
|
* distributions including binary code include the above copyright notice and
|
||||||
|
* this paragraph in its entirety in the documentation or other materials
|
||||||
|
* provided with the distribution, and (3) all advertising materials mentioning
|
||||||
|
* features or use of this software display the following acknowledgement:
|
||||||
|
* ``This product includes software developed by the University of California,
|
||||||
|
* Lawrence Berkeley Laboratory and its contributors.'' 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 ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||||
|
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||||
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
* @(#) $Header: os-sunos4.h,v 1.32 96/11/29 15:18:18 leres Exp $ (LBL)
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Prototypes missing in SunOS 4 */
|
||||||
|
#ifdef FILE
|
||||||
|
int _filbuf(FILE *);
|
||||||
|
int _flsbuf(u_char, FILE *);
|
||||||
|
int fclose(FILE *);
|
||||||
|
int fflush(FILE *);
|
||||||
|
int fgetc(FILE *);
|
||||||
|
int fprintf(FILE *, const char *, ...);
|
||||||
|
int fputc(int, FILE *);
|
||||||
|
int fputs(const char *, FILE *);
|
||||||
|
u_int fread(void *, u_int, u_int, FILE *);
|
||||||
|
int fseek(FILE *, long, int);
|
||||||
|
u_int fwrite(const void *, u_int, u_int, FILE *);
|
||||||
|
int pclose(FILE *);
|
||||||
|
void rewind(FILE *);
|
||||||
|
void setbuf(FILE *, char *);
|
||||||
|
int setlinebuf(FILE *);
|
||||||
|
int ungetc(int, FILE *);
|
||||||
|
int vfprintf(FILE *, const char *, ...);
|
||||||
|
int vprintf(const char *, ...);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if __GNUC__ <= 1
|
||||||
|
int read(int, char *, u_int);
|
||||||
|
int write(int, char *, u_int);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
long a64l(const char *);
|
||||||
|
#ifdef __STDC__
|
||||||
|
struct sockaddr;
|
||||||
|
#endif
|
||||||
|
int accept(int, struct sockaddr *, int *);
|
||||||
|
int bind(int, struct sockaddr *, int);
|
||||||
|
int bcmp(const void *, const void *, u_int);
|
||||||
|
void bcopy(const void *, void *, u_int);
|
||||||
|
void bzero(void *, int);
|
||||||
|
int chroot(const char *);
|
||||||
|
int close(int);
|
||||||
|
void closelog(void);
|
||||||
|
int connect(int, struct sockaddr *, int);
|
||||||
|
char *crypt(const char *, const char *);
|
||||||
|
int daemon(int, int);
|
||||||
|
int fchmod(int, int);
|
||||||
|
int fchown(int, int, int);
|
||||||
|
void endgrent(void);
|
||||||
|
void endpwent(void);
|
||||||
|
void endservent(void);
|
||||||
|
#ifdef __STDC__
|
||||||
|
struct ether_addr;
|
||||||
|
#endif
|
||||||
|
struct ether_addr *ether_aton(const char *);
|
||||||
|
int flock(int, int);
|
||||||
|
#ifdef __STDC__
|
||||||
|
struct stat;
|
||||||
|
#endif
|
||||||
|
int fstat(int, struct stat *);
|
||||||
|
#ifdef __STDC__
|
||||||
|
struct statfs;
|
||||||
|
#endif
|
||||||
|
int fstatfs(int, struct statfs *);
|
||||||
|
int fsync(int);
|
||||||
|
#ifdef __STDC__
|
||||||
|
struct timeb;
|
||||||
|
#endif
|
||||||
|
int ftime(struct timeb *);
|
||||||
|
int ftruncate(int, off_t);
|
||||||
|
int getdtablesize(void);
|
||||||
|
long gethostid(void);
|
||||||
|
int gethostname(char *, int);
|
||||||
|
int getopt(int, char * const *, const char *);
|
||||||
|
int getpagesize(void);
|
||||||
|
char *getpass(char *);
|
||||||
|
int getpeername(int, struct sockaddr *, int *);
|
||||||
|
int getpriority(int, int);
|
||||||
|
#ifdef __STDC__
|
||||||
|
struct rlimit;
|
||||||
|
#endif
|
||||||
|
int getrlimit(int, struct rlimit *);
|
||||||
|
int getsockname(int, struct sockaddr *, int *);
|
||||||
|
int getsockopt(int, int, int, char *, int *);
|
||||||
|
#ifdef __STDC__
|
||||||
|
struct timeval;
|
||||||
|
struct timezone;
|
||||||
|
#endif
|
||||||
|
int gettimeofday(struct timeval *, struct timezone *);
|
||||||
|
char *getusershell(void);
|
||||||
|
char *getwd(char *);
|
||||||
|
int initgroups(const char *, int);
|
||||||
|
int ioctl(int, int, caddr_t);
|
||||||
|
int iruserok(u_long, int, char *, char *);
|
||||||
|
int isatty(int);
|
||||||
|
int killpg(int, int);
|
||||||
|
int listen(int, int);
|
||||||
|
#ifdef __STDC__
|
||||||
|
struct utmp;
|
||||||
|
#endif
|
||||||
|
void login(struct utmp *);
|
||||||
|
int logout(const char *);
|
||||||
|
off_t lseek(int, off_t, int);
|
||||||
|
int lstat(const char *, struct stat *);
|
||||||
|
int mkstemp(char *);
|
||||||
|
char *mktemp(char *);
|
||||||
|
int munmap(caddr_t, int);
|
||||||
|
void openlog(const char *, int, int);
|
||||||
|
void perror(const char *);
|
||||||
|
int printf(const char *, ...);
|
||||||
|
int puts(const char *);
|
||||||
|
long random(void);
|
||||||
|
int readlink(const char *, char *, int);
|
||||||
|
#ifdef __STDC__
|
||||||
|
struct iovec;
|
||||||
|
#endif
|
||||||
|
int readv(int, struct iovec *, int);
|
||||||
|
int recv(int, char *, u_int, int);
|
||||||
|
int recvfrom(int, char *, u_int, int, struct sockaddr *, int *);
|
||||||
|
int rename(const char *, const char *);
|
||||||
|
int rcmd(char **, u_short, char *, char *, char *, int *);
|
||||||
|
int rresvport(int *);
|
||||||
|
int send(int, char *, u_int, int);
|
||||||
|
int sendto(int, char *, u_int, int, struct sockaddr *, int);
|
||||||
|
int setenv(const char *, const char *, int);
|
||||||
|
int seteuid(int);
|
||||||
|
int setpriority(int, int, int);
|
||||||
|
int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
|
||||||
|
int setpgrp(int, int);
|
||||||
|
void setpwent(void);
|
||||||
|
int setrlimit(int, struct rlimit *);
|
||||||
|
void setservent(int);
|
||||||
|
int setsockopt(int, int, int, char *, int);
|
||||||
|
int shutdown(int, int);
|
||||||
|
int sigblock(int);
|
||||||
|
void (*signal (int, void (*) (int))) (int);
|
||||||
|
int sigpause(int);
|
||||||
|
int sigsetmask(int);
|
||||||
|
#ifdef __STDC__
|
||||||
|
struct sigvec;
|
||||||
|
#endif
|
||||||
|
int sigvec(int, struct sigvec *, struct sigvec*);
|
||||||
|
int snprintf(char *, size_t, const char *, ...);
|
||||||
|
int socket(int, int, int);
|
||||||
|
int socketpair(int, int, int, int *);
|
||||||
|
int symlink(const char *, const char *);
|
||||||
|
void srandom(int);
|
||||||
|
int sscanf(char *, const char *, ...);
|
||||||
|
int stat(const char *, struct stat *);
|
||||||
|
int statfs(char *, struct statfs *);
|
||||||
|
char *strerror(int);
|
||||||
|
int strcasecmp(const char *, const char *);
|
||||||
|
#ifdef __STDC__
|
||||||
|
struct tm;
|
||||||
|
#endif
|
||||||
|
int strftime(char *, int, char *, struct tm *);
|
||||||
|
int strncasecmp(const char *, const char *, int);
|
||||||
|
long strtol(const char *, char **, int);
|
||||||
|
void sync(void);
|
||||||
|
void syslog(int, const char *, ...);
|
||||||
|
int system(const char *);
|
||||||
|
long tell(int);
|
||||||
|
time_t time(time_t *);
|
||||||
|
char *timezone(int, int);
|
||||||
|
int tolower(int);
|
||||||
|
int toupper(int);
|
||||||
|
int truncate(char *, off_t);
|
||||||
|
void unsetenv(const char *);
|
||||||
|
int vfork(void);
|
||||||
|
int vsprintf(char *, const char *, ...);
|
||||||
|
int writev(int, struct iovec *, int);
|
||||||
|
#ifdef __STDC__
|
||||||
|
struct rusage;
|
||||||
|
#endif
|
||||||
|
int utimes(const char *, struct timeval *);
|
||||||
|
#if __GNUC__ <= 1
|
||||||
|
int wait(int *);
|
||||||
|
pid_t wait3(int *, int, struct rusage *);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Ugly signal hacking */
|
||||||
|
#ifdef SIG_ERR
|
||||||
|
#undef SIG_ERR
|
||||||
|
#define SIG_ERR (void (*)(int))-1
|
||||||
|
#undef SIG_DFL
|
||||||
|
#define SIG_DFL (void (*)(int))0
|
||||||
|
#undef SIG_IGN
|
||||||
|
#define SIG_IGN (void (*)(int))1
|
||||||
|
|
||||||
|
#ifdef KERNEL
|
||||||
|
#undef SIG_CATCH
|
||||||
|
#define SIG_CATCH (void (*)(int))2
|
||||||
|
#endif
|
||||||
|
#undef SIG_HOLD
|
||||||
|
#define SIG_HOLD (void (*)(int))3
|
||||||
|
#endif
|
39
dns/nslint-2.1a8/lbl/os-ultrix4.h
Normal file
39
dns/nslint-2.1a8/lbl/os-ultrix4.h
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 1990, 1993, 1994, 1995, 1996
|
||||||
|
* 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: (1) source code distributions
|
||||||
|
* retain the above copyright notice and this paragraph in its entirety, (2)
|
||||||
|
* distributions including binary code include the above copyright notice and
|
||||||
|
* this paragraph in its entirety in the documentation or other materials
|
||||||
|
* provided with the distribution, and (3) all advertising materials mentioning
|
||||||
|
* features or use of this software display the following acknowledgement:
|
||||||
|
* ``This product includes software developed by the University of California,
|
||||||
|
* Lawrence Berkeley Laboratory and its contributors.'' 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 ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||||
|
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||||
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
* @(#) $Header: os-ultrix4.h,v 1.19 96/11/29 15:33:19 leres Exp $ (LBL)
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Prototypes missing in Ultrix 4 */
|
||||||
|
int bcmp(const char *, const char *, u_int);
|
||||||
|
void bcopy(const void *, void *, u_int);
|
||||||
|
void bzero(void *, u_int);
|
||||||
|
void endservent(void);
|
||||||
|
int getopt(int, char * const *, const char *);
|
||||||
|
#ifdef __STDC__
|
||||||
|
struct timeval;
|
||||||
|
struct timezone;
|
||||||
|
#endif
|
||||||
|
int gettimeofday(struct timeval *, struct timezone *);
|
||||||
|
int ioctl(int, int, caddr_t);
|
||||||
|
int pfopen(char *, int);
|
||||||
|
int setlinebuf(FILE *);
|
||||||
|
int socket(int, int, int);
|
||||||
|
int strcasecmp(const char *, const char *);
|
109
dns/nslint-2.1a8/mkdep
Executable file
109
dns/nslint-2.1a8/mkdep
Executable file
|
@ -0,0 +1,109 @@
|
||||||
|
#!/bin/sh -
|
||||||
|
#
|
||||||
|
# Copyright (c) 1994, 1996
|
||||||
|
# The Regents of the University of California. All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms are permitted
|
||||||
|
# provided that this notice is preserved and that due credit is given
|
||||||
|
# to the University of California at Berkeley. The name of the University
|
||||||
|
# may not be used to endorse or promote products derived from this
|
||||||
|
# software without specific prior written permission. This software
|
||||||
|
# is provided ``as is'' without express or implied warranty.
|
||||||
|
#
|
||||||
|
# @(#)mkdep.sh 5.11 (Berkeley) 5/5/88
|
||||||
|
#
|
||||||
|
|
||||||
|
PATH=/bin:/usr/bin:/usr/ucb:/usr/local:/usr/local/bin
|
||||||
|
export PATH
|
||||||
|
|
||||||
|
MAKE=Makefile # default makefile name is "Makefile"
|
||||||
|
CC=cc # default C compiler is "cc"
|
||||||
|
|
||||||
|
while :
|
||||||
|
do case "$1" in
|
||||||
|
# -c allows you to specify the C compiler
|
||||||
|
-c)
|
||||||
|
CC=$2
|
||||||
|
shift; shift ;;
|
||||||
|
|
||||||
|
# -f allows you to select a makefile name
|
||||||
|
-f)
|
||||||
|
MAKE=$2
|
||||||
|
shift; shift ;;
|
||||||
|
|
||||||
|
# the -p flag produces "program: program.c" style dependencies
|
||||||
|
# so .o's don't get produced
|
||||||
|
-p)
|
||||||
|
SED='s;\.o;;'
|
||||||
|
shift ;;
|
||||||
|
*)
|
||||||
|
break ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ $# = 0 ] ; then
|
||||||
|
echo 'usage: mkdep [-p] [-c cc] [-f makefile] [flags] file ...'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -w $MAKE ]; then
|
||||||
|
echo "mkdep: no writeable file \"$MAKE\""
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
TMP=/tmp/mkdep$$
|
||||||
|
|
||||||
|
trap 'rm -f $TMP ; exit 1' 1 2 3 13 15
|
||||||
|
|
||||||
|
cp $MAKE ${MAKE}.bak
|
||||||
|
|
||||||
|
sed -e '/DO NOT DELETE THIS LINE/,$d' < $MAKE > $TMP
|
||||||
|
|
||||||
|
cat << _EOF_ >> $TMP
|
||||||
|
# DO NOT DELETE THIS LINE -- mkdep uses it.
|
||||||
|
# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
|
||||||
|
|
||||||
|
_EOF_
|
||||||
|
|
||||||
|
# If your compiler doesn't have -M, add it. If you can't, the next two
|
||||||
|
# lines will try and replace the "cc -M". The real problem is that this
|
||||||
|
# hack can't deal with anything that requires a search path, and doesn't
|
||||||
|
# even try for anything using bracket (<>) syntax.
|
||||||
|
#
|
||||||
|
# egrep '^#include[ ]*".*"' /dev/null $* |
|
||||||
|
# sed -e 's/:[^"]*"\([^"]*\)".*/: \1/' -e 's/\.c/.o/' |
|
||||||
|
|
||||||
|
# XXX this doesn't work with things like "-DDECLWAITSTATUS=union\ wait"
|
||||||
|
$CC -M $* |
|
||||||
|
sed "
|
||||||
|
s; \./; ;g
|
||||||
|
$SED" |
|
||||||
|
awk '{
|
||||||
|
if ($1 != prev) {
|
||||||
|
if (rec != "")
|
||||||
|
print rec;
|
||||||
|
rec = $0;
|
||||||
|
prev = $1;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (length(rec $2) > 78) {
|
||||||
|
print rec;
|
||||||
|
rec = $0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
rec = rec " " $2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
END {
|
||||||
|
print rec
|
||||||
|
}' >> $TMP
|
||||||
|
|
||||||
|
cat << _EOF_ >> $TMP
|
||||||
|
|
||||||
|
# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
|
||||||
|
_EOF_
|
||||||
|
|
||||||
|
# copy to preserve permissions
|
||||||
|
cp $TMP $MAKE
|
||||||
|
rm -f ${MAKE}.bak $TMP
|
||||||
|
exit 0
|
497
dns/nslint-2.1a8/nslint.8
Normal file
497
dns/nslint-2.1a8/nslint.8
Normal file
|
@ -0,0 +1,497 @@
|
||||||
|
.\" @(#) $Id: nslint.8,v 1.14 2002/05/03 04:10:52 leres Exp $ (LBL)
|
||||||
|
.\"
|
||||||
|
.\" Copyright (c) 1994, 1996, 1997, 1999, 2001, 2002
|
||||||
|
.\" The Regents of the University of California. All rights reserved.
|
||||||
|
.\" All rights reserved.
|
||||||
|
.\"
|
||||||
|
.\" Redistribution and use in source and binary forms, with or without
|
||||||
|
.\" modification, are permitted provided that: (1) source code distributions
|
||||||
|
.\" retain the above copyright notice and this paragraph in its entirety, (2)
|
||||||
|
.\" distributions including binary code include the above copyright notice and
|
||||||
|
.\" this paragraph in its entirety in the documentation or other materials
|
||||||
|
.\" provided with the distribution, and (3) all advertising materials mentioning
|
||||||
|
.\" features or use of this software display the following acknowledgement:
|
||||||
|
.\" ``This product includes software developed by the University of California,
|
||||||
|
.\" Lawrence Berkeley Laboratory and its contributors.'' 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 ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||||
|
.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||||
|
.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
.\"
|
||||||
|
.TH nslint 8 "2 May 2002"
|
||||||
|
.UC 4
|
||||||
|
.SH NAME
|
||||||
|
nslint - perform consistency checks on dns files
|
||||||
|
.SH SYNOPSIS
|
||||||
|
.B nslint
|
||||||
|
[
|
||||||
|
.B -d
|
||||||
|
] [
|
||||||
|
.B -c
|
||||||
|
.I named.conf
|
||||||
|
] [
|
||||||
|
.B -C
|
||||||
|
.I nslint.conf
|
||||||
|
]
|
||||||
|
.br
|
||||||
|
.B nslint
|
||||||
|
[
|
||||||
|
.B -d
|
||||||
|
] [
|
||||||
|
.B -b
|
||||||
|
.I named.boot
|
||||||
|
] [
|
||||||
|
.B -B
|
||||||
|
.I nslint.boot
|
||||||
|
]
|
||||||
|
.SH DESCRIPTION
|
||||||
|
.B Nslint
|
||||||
|
reads the nameserver configuration files and performs a number of
|
||||||
|
consistency checks on the dns records. If any problems are discovered,
|
||||||
|
error messages are displayed on
|
||||||
|
.I stderr
|
||||||
|
and
|
||||||
|
.B nslint
|
||||||
|
exits with a non-zero status.
|
||||||
|
.LP
|
||||||
|
Here is a partial list of errors
|
||||||
|
.B nslint
|
||||||
|
detects:
|
||||||
|
.IP
|
||||||
|
Records that are malformed.
|
||||||
|
.IP
|
||||||
|
Names that contain dots but are missing a trailing dot.
|
||||||
|
.IP
|
||||||
|
.B PTR
|
||||||
|
records with names that are missing a trailing dot.
|
||||||
|
.IP
|
||||||
|
Names that contain illegal characters (rfc1034).
|
||||||
|
.IP
|
||||||
|
.B A
|
||||||
|
records
|
||||||
|
without matching
|
||||||
|
.B PTR
|
||||||
|
records
|
||||||
|
.IP
|
||||||
|
.B PTR
|
||||||
|
records
|
||||||
|
without matching
|
||||||
|
.B A
|
||||||
|
records
|
||||||
|
.IP
|
||||||
|
Names with more than one address on the same subnet.
|
||||||
|
.IP
|
||||||
|
Addresses in use by more than one name.
|
||||||
|
.IP
|
||||||
|
Names with
|
||||||
|
.B CNAME
|
||||||
|
and other records (rfc1033).
|
||||||
|
.IP
|
||||||
|
Unknown service and/or protocol keywords in
|
||||||
|
.B WKS
|
||||||
|
records.
|
||||||
|
.IP
|
||||||
|
Missing semicolons and quotes.
|
||||||
|
.LP
|
||||||
|
.SH OPTIONS
|
||||||
|
.TP
|
||||||
|
.B -b
|
||||||
|
Specify an alternate
|
||||||
|
.I named.boot
|
||||||
|
file. The default is
|
||||||
|
.IR /etc/named.boot .
|
||||||
|
.TP
|
||||||
|
.TP
|
||||||
|
.B -c
|
||||||
|
Specify an alternate
|
||||||
|
.I named.conf
|
||||||
|
file. The default is
|
||||||
|
.IR /etc/named.conf .
|
||||||
|
.TP
|
||||||
|
.B -B
|
||||||
|
Specify an alternate
|
||||||
|
.I nslint.boot
|
||||||
|
file. The default is
|
||||||
|
.I nslint.boot
|
||||||
|
in the last
|
||||||
|
.B directory
|
||||||
|
line processed in
|
||||||
|
.I named.boot
|
||||||
|
(or the current working directory).
|
||||||
|
This file is processed like a second
|
||||||
|
.IR named.boot .
|
||||||
|
The most common use is to tell
|
||||||
|
.B nslint
|
||||||
|
about
|
||||||
|
.B A
|
||||||
|
records that match
|
||||||
|
.B PTR
|
||||||
|
records that point outside the domains listed in
|
||||||
|
.IR named.boot .
|
||||||
|
.TP
|
||||||
|
.B -C
|
||||||
|
Specify an alternate
|
||||||
|
.I nslint.conf
|
||||||
|
file. The default is
|
||||||
|
.I nslint.conf
|
||||||
|
in the last
|
||||||
|
.B directory
|
||||||
|
line processed in
|
||||||
|
.I named.conf
|
||||||
|
(or the current working directory).
|
||||||
|
This file is processed like a second
|
||||||
|
.IR named.conf .
|
||||||
|
.TP
|
||||||
|
.B -d
|
||||||
|
Raise the debugging level. Debugging information is
|
||||||
|
displayed on
|
||||||
|
.IR stdout .
|
||||||
|
.LP
|
||||||
|
.B Nslint
|
||||||
|
knows how to read
|
||||||
|
BIND 8 and 9's
|
||||||
|
.I named.conf
|
||||||
|
configuration file and also
|
||||||
|
older BIND's
|
||||||
|
.I named.boot
|
||||||
|
file. If both files exist,
|
||||||
|
.B nslint
|
||||||
|
will prefer
|
||||||
|
.I named.conf
|
||||||
|
(on the theory that you forgot to delete
|
||||||
|
.I named.boot
|
||||||
|
when you upgraded BIND).
|
||||||
|
.LP
|
||||||
|
.SH "ADVANCED CONFIGURATION"
|
||||||
|
There are some cases where it is necessary to use the
|
||||||
|
advanced configuration features of
|
||||||
|
.BR nslint .
|
||||||
|
Advanced configuration is done with the
|
||||||
|
.I nslint.conf
|
||||||
|
file. (You can also use
|
||||||
|
.I nslint.boot
|
||||||
|
which has a syntax similar to
|
||||||
|
.I named.boot
|
||||||
|
but is not described here.)
|
||||||
|
.LP
|
||||||
|
The most common is when a site has a demilitarized zone (DMZ).
|
||||||
|
The problem here is that the DMZ network will have
|
||||||
|
.B PTR
|
||||||
|
records for hosts outside its domain. For example lets say
|
||||||
|
we have
|
||||||
|
.I 128.0.rev
|
||||||
|
with:
|
||||||
|
.LP
|
||||||
|
.RS
|
||||||
|
.nf
|
||||||
|
.sp .5
|
||||||
|
1.1 604800 in ptr gateway.lbl.gov.
|
||||||
|
2.1 604800 in ptr gateway.es.net.
|
||||||
|
.sp .5
|
||||||
|
.fi
|
||||||
|
.RE
|
||||||
|
.LP
|
||||||
|
Obviously we will define an
|
||||||
|
.B A
|
||||||
|
record for
|
||||||
|
.I gateway.lbl.gov
|
||||||
|
pointing to
|
||||||
|
.I 128.0.1.1
|
||||||
|
but we will get errors because there is no
|
||||||
|
.B A
|
||||||
|
record defined for
|
||||||
|
.IR gateway.es.net .
|
||||||
|
The solution is to create a
|
||||||
|
.I nslint.conf
|
||||||
|
file (in the same directory as the other dns files)
|
||||||
|
with:
|
||||||
|
.LP
|
||||||
|
.RS
|
||||||
|
.nf
|
||||||
|
.sp .5
|
||||||
|
zone "es.net" {
|
||||||
|
.RS
|
||||||
|
type master;
|
||||||
|
file "nslint.es.net";
|
||||||
|
.RE
|
||||||
|
};
|
||||||
|
.sp .5
|
||||||
|
.fi
|
||||||
|
.RE
|
||||||
|
.LP
|
||||||
|
And then create the file
|
||||||
|
.I nslint.es.net
|
||||||
|
with:
|
||||||
|
.LP
|
||||||
|
.RS
|
||||||
|
.nf
|
||||||
|
.sp .5
|
||||||
|
gateway 1 in a 128.0.1.2
|
||||||
|
.sp .5
|
||||||
|
.fi
|
||||||
|
.RE
|
||||||
|
.LP
|
||||||
|
Another problem occurs when there is a
|
||||||
|
.B CNAME
|
||||||
|
that points to a host outside the local domains. Let's say we have
|
||||||
|
.I info.lbl.gov
|
||||||
|
pointing to
|
||||||
|
.IR larry.es.net :
|
||||||
|
.LP
|
||||||
|
.RS
|
||||||
|
.nf
|
||||||
|
.sp .5
|
||||||
|
info 604800 in cname larry.es.net.
|
||||||
|
.sp .5
|
||||||
|
.fi
|
||||||
|
.RE
|
||||||
|
.LP
|
||||||
|
In this case we would need:
|
||||||
|
.LP
|
||||||
|
.RS
|
||||||
|
.nf
|
||||||
|
.sp .5
|
||||||
|
zone "es.net" {
|
||||||
|
.RS
|
||||||
|
type master;
|
||||||
|
file "nslint.es.net";
|
||||||
|
.RE
|
||||||
|
};
|
||||||
|
.sp .5
|
||||||
|
.fi
|
||||||
|
.RE
|
||||||
|
.LP
|
||||||
|
in
|
||||||
|
.I nslint.boot
|
||||||
|
and:
|
||||||
|
.LP
|
||||||
|
.RS
|
||||||
|
.nf
|
||||||
|
.sp .5
|
||||||
|
larry 1 in txt "place holder"
|
||||||
|
.sp .5
|
||||||
|
.fi
|
||||||
|
.RE
|
||||||
|
.LP
|
||||||
|
.IR nslint.es.net .
|
||||||
|
.LP
|
||||||
|
One last problem
|
||||||
|
when a pseudo host is setup to allow two more
|
||||||
|
more actual hosts provide a service. For, let's say that
|
||||||
|
.I lbl.gov
|
||||||
|
contains:
|
||||||
|
.LP
|
||||||
|
.RS
|
||||||
|
.nf
|
||||||
|
.sp .5
|
||||||
|
server 604800 in a 128.0.6.6
|
||||||
|
server 604800 in a 128.0.6.94
|
||||||
|
;
|
||||||
|
tom 604800 in a 128.0.6.6
|
||||||
|
tom 604800 in mx 0 lbl.gov.
|
||||||
|
;
|
||||||
|
jerry 604800 in a 128.0.6.94
|
||||||
|
jerry 604800 in mx 0 lbl.gov.
|
||||||
|
.sp .5
|
||||||
|
.fi
|
||||||
|
.RE
|
||||||
|
.LP
|
||||||
|
In this case
|
||||||
|
.B nslint
|
||||||
|
would complain about missing
|
||||||
|
.B PTR
|
||||||
|
records and ip addresses in use by more than one host.
|
||||||
|
To suppress these warnings, add you would the lines:
|
||||||
|
.LP
|
||||||
|
.RS
|
||||||
|
.nf
|
||||||
|
.sp .5
|
||||||
|
zone "lbl.gov" {
|
||||||
|
.RS
|
||||||
|
type master;
|
||||||
|
file "nslint.lbl.gov";
|
||||||
|
.RE
|
||||||
|
};
|
||||||
|
.LP
|
||||||
|
zone "0.128.in-addr.arpa" {
|
||||||
|
.RS
|
||||||
|
type master;
|
||||||
|
file "nslint.128.0.rev";
|
||||||
|
.RE
|
||||||
|
};
|
||||||
|
.sp .5
|
||||||
|
.fi
|
||||||
|
.RE
|
||||||
|
.LP
|
||||||
|
to
|
||||||
|
.I nslint.conf
|
||||||
|
and create
|
||||||
|
.I nslint.lbl.gov
|
||||||
|
with:
|
||||||
|
.LP
|
||||||
|
.RS
|
||||||
|
.nf
|
||||||
|
.sp .5
|
||||||
|
server 1 in allowdupa 128.0.6.6
|
||||||
|
server 1 in allowdupa 128.0.6.94
|
||||||
|
.sp .5
|
||||||
|
.fi
|
||||||
|
.RE
|
||||||
|
.LP
|
||||||
|
and create
|
||||||
|
.I nslint.128.0.rev
|
||||||
|
with:
|
||||||
|
.LP
|
||||||
|
.RS
|
||||||
|
.nf
|
||||||
|
.sp .5
|
||||||
|
6.6 604800 in ptr server.lbl.gov.
|
||||||
|
94.6 604800 in ptr server.lbl.gov.
|
||||||
|
.sp .5
|
||||||
|
.fi
|
||||||
|
.RE
|
||||||
|
.LP
|
||||||
|
In this example, the
|
||||||
|
.B allowdupa
|
||||||
|
keyword tells
|
||||||
|
.B nslint
|
||||||
|
that it's ok for
|
||||||
|
.I 128.0.6.6
|
||||||
|
and
|
||||||
|
.I 128.0.6.94
|
||||||
|
to be shared by
|
||||||
|
.IR server.lbl.gov ,
|
||||||
|
.IR tom.lbl.gov ,
|
||||||
|
and
|
||||||
|
.IR jerry.lbl.gov .
|
||||||
|
.LP
|
||||||
|
Another
|
||||||
|
.B nslint
|
||||||
|
feature helps detect hosts that have mistakenly had two ip addresses
|
||||||
|
assigned on the same subnet. This can happen when two different
|
||||||
|
people request an ip address for the same hostname or when someone
|
||||||
|
forgets an address has been assigned and requests a new number.
|
||||||
|
.LP
|
||||||
|
To detect such
|
||||||
|
.B A
|
||||||
|
records, add a
|
||||||
|
.B nslint
|
||||||
|
section to your
|
||||||
|
.I nslint.conf
|
||||||
|
containing something similar to:
|
||||||
|
.LP
|
||||||
|
.RS
|
||||||
|
.nf
|
||||||
|
.sp .5
|
||||||
|
nslint {
|
||||||
|
.RS
|
||||||
|
network "128.0.6/22";
|
||||||
|
.RE
|
||||||
|
};
|
||||||
|
.sp .5
|
||||||
|
.fi
|
||||||
|
.RE
|
||||||
|
.LP
|
||||||
|
or:
|
||||||
|
.LP
|
||||||
|
.RS
|
||||||
|
.nf
|
||||||
|
.sp .5
|
||||||
|
nslint {
|
||||||
|
.RS
|
||||||
|
network "128.0.6 255.255.252.0";
|
||||||
|
.RE
|
||||||
|
};
|
||||||
|
.sp .5
|
||||||
|
.fi
|
||||||
|
.RE
|
||||||
|
.LP
|
||||||
|
These two examples are are equivalent ways of saying the same thing;
|
||||||
|
that subnet
|
||||||
|
.I 128.0.6
|
||||||
|
has a 22 bit wide subnet mask.
|
||||||
|
.LP
|
||||||
|
Using information from the above
|
||||||
|
.B network
|
||||||
|
statement,
|
||||||
|
.B nslint
|
||||||
|
would would flag the following
|
||||||
|
.B A
|
||||||
|
records as being in error:
|
||||||
|
.LP
|
||||||
|
.RS
|
||||||
|
.nf
|
||||||
|
.sp .5
|
||||||
|
server 1 in a 128.0.6.48
|
||||||
|
server 1 in a 128.0.7.16
|
||||||
|
.sp .5
|
||||||
|
.fi
|
||||||
|
.RE
|
||||||
|
.LP
|
||||||
|
Note that if you specify any
|
||||||
|
.B network
|
||||||
|
lines in your
|
||||||
|
.I nslint.conf
|
||||||
|
file,
|
||||||
|
.B nslint
|
||||||
|
requires you to include lines for all networks;
|
||||||
|
otherwise you might forget to add
|
||||||
|
.B network
|
||||||
|
lines for new networks.
|
||||||
|
.LP
|
||||||
|
Sometimes you have a zone that
|
||||||
|
.B nslint
|
||||||
|
just can't deal with. A good example is
|
||||||
|
a dynamic dns zone. To handle this, you can
|
||||||
|
add the following to
|
||||||
|
.IB nslint.com :
|
||||||
|
.LP
|
||||||
|
.RS
|
||||||
|
.nf
|
||||||
|
.sp .5
|
||||||
|
nslint {
|
||||||
|
.RS
|
||||||
|
ignorezone "dhcp.lbl.gov";
|
||||||
|
.RE
|
||||||
|
};
|
||||||
|
.sp .5
|
||||||
|
.fi
|
||||||
|
.RE
|
||||||
|
.LP
|
||||||
|
This will suppress "name referenced without other records" warnings.
|
||||||
|
.LP
|
||||||
|
.SH FILES
|
||||||
|
.na
|
||||||
|
.nh
|
||||||
|
.nf
|
||||||
|
/etc/named.conf - default named configuration file
|
||||||
|
/etc/named.boot - old style named configuration file
|
||||||
|
nslint.conf - default nslint configuration file
|
||||||
|
nslint.boot - old style nslint configuration file
|
||||||
|
.ad
|
||||||
|
.hy
|
||||||
|
.fi
|
||||||
|
.LP
|
||||||
|
.SH "SEE ALSO"
|
||||||
|
.na
|
||||||
|
.nh
|
||||||
|
.IR named (8),
|
||||||
|
rfc1033,
|
||||||
|
rfc1034
|
||||||
|
.ad
|
||||||
|
.hy
|
||||||
|
.SH AUTHOR
|
||||||
|
Craig Leres of the
|
||||||
|
Lawrence Berkeley National Laboratory, University of California, Berkeley, CA.
|
||||||
|
.LP
|
||||||
|
The current version is available via anonymous ftp:
|
||||||
|
.LP
|
||||||
|
.RS
|
||||||
|
.I ftp://ftp.ee.lbl.gov/nslint.tar.gz
|
||||||
|
.RE
|
||||||
|
.SH BUGS
|
||||||
|
Please send bug reports to nslint@ee.lbl.gov.
|
||||||
|
.LP
|
||||||
|
Not everyone is guaranteed to agree with all the checks done.
|
2494
dns/nslint-2.1a8/nslint.c
Normal file
2494
dns/nslint-2.1a8/nslint.c
Normal file
File diff suppressed because it is too large
Load diff
65
dns/nslint-2.1a8/savestr.c
Normal file
65
dns/nslint-2.1a8/savestr.c
Normal file
|
@ -0,0 +1,65 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2006, 2007
|
||||||
|
* 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: (1) source code distributions
|
||||||
|
* retain the above copyright notice and this paragraph in its entirety, (2)
|
||||||
|
* distributions including binary code include the above copyright notice and
|
||||||
|
* this paragraph in its entirety in the documentation or other materials
|
||||||
|
* provided with the distribution, and (3) all advertising materials mentioning
|
||||||
|
* features or use of this software display the following acknowledgement:
|
||||||
|
* ``This product includes software developed by the University of California,
|
||||||
|
* Lawrence Berkeley Laboratory and its contributors.'' 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 ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||||
|
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||||
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef lint
|
||||||
|
static const char rcsid[] =
|
||||||
|
"@(#) $Id: savestr.c,v 1.3 2007/03/04 18:18:09 leres Exp $ (LBL)";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "gnuc.h"
|
||||||
|
#ifdef HAVE_OS_PROTO_H
|
||||||
|
#include "os-proto.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "savestr.h"
|
||||||
|
|
||||||
|
/* A replacement for strdup() that cuts down on malloc() overhead */
|
||||||
|
char *
|
||||||
|
savestr(const char *str)
|
||||||
|
{
|
||||||
|
u_int size;
|
||||||
|
char *p;
|
||||||
|
static char *strptr = NULL;
|
||||||
|
static u_int strsize = 0;
|
||||||
|
|
||||||
|
size = strlen(str) + 1;
|
||||||
|
if (size > strsize) {
|
||||||
|
strsize = 1024;
|
||||||
|
if (strsize < size)
|
||||||
|
strsize = size;
|
||||||
|
strptr = (char *)malloc(strsize);
|
||||||
|
if (strptr == NULL) {
|
||||||
|
fprintf(stderr, "savestr: malloc\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
(void)strcpy(strptr, str);
|
||||||
|
p = strptr;
|
||||||
|
strptr += size;
|
||||||
|
strsize -= size;
|
||||||
|
return (p);
|
||||||
|
}
|
24
dns/nslint-2.1a8/savestr.h
Normal file
24
dns/nslint-2.1a8/savestr.h
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 1997
|
||||||
|
* 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: (1) source code distributions
|
||||||
|
* retain the above copyright notice and this paragraph in its entirety, (2)
|
||||||
|
* distributions including binary code include the above copyright notice and
|
||||||
|
* this paragraph in its entirety in the documentation or other materials
|
||||||
|
* provided with the distribution, and (3) all advertising materials mentioning
|
||||||
|
* features or use of this software display the following acknowledgement:
|
||||||
|
* ``This product includes software developed by the University of California,
|
||||||
|
* Lawrence Berkeley Laboratory and its contributors.'' 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 ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||||
|
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||||
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
* @(#) $Header: savestr.h,v 1.1 97/04/22 13:30:21 leres Exp $ (LBL)
|
||||||
|
*/
|
||||||
|
|
||||||
|
extern char *savestr(const char *);
|
75
dns/nslint-2.1a8/strerror.c
Normal file
75
dns/nslint-2.1a8/strerror.c
Normal file
|
@ -0,0 +1,75 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 1988, 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined(LIBC_SCCS) && !defined(lint)
|
||||||
|
static const char sccsid[] = "@(#)strerror.c 8.1 (Berkeley) 6/4/93";
|
||||||
|
#endif /* LIBC_SCCS and not lint */
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "gnuc.h"
|
||||||
|
#ifdef HAVE_OS_PROTO_H
|
||||||
|
#include "os-proto.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
char *
|
||||||
|
strerror(num)
|
||||||
|
int num;
|
||||||
|
{
|
||||||
|
extern int sys_nerr;
|
||||||
|
extern char *sys_errlist[];
|
||||||
|
#define UPREFIX "Unknown error: "
|
||||||
|
static char ebuf[40] = UPREFIX; /* 64-bit number + slop */
|
||||||
|
register unsigned int errnum;
|
||||||
|
register char *p, *t;
|
||||||
|
char tmp[40];
|
||||||
|
|
||||||
|
errnum = num; /* convert to unsigned */
|
||||||
|
if (errnum < sys_nerr)
|
||||||
|
return(sys_errlist[errnum]);
|
||||||
|
|
||||||
|
/* Do this by hand, so we don't include stdio(3). */
|
||||||
|
t = tmp;
|
||||||
|
do {
|
||||||
|
*t++ = "0123456789"[errnum % 10];
|
||||||
|
} while (errnum /= 10);
|
||||||
|
for (p = ebuf + sizeof(UPREFIX) - 1;;) {
|
||||||
|
*p++ = *--t;
|
||||||
|
if (t <= tmp)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
*p = '\0';
|
||||||
|
return(ebuf);
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue