summaryrefslogtreecommitdiffstats
path: root/contrib/bind/port/freebsd
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/bind/port/freebsd')
-rw-r--r--contrib/bind/port/freebsd/Makefile85
-rw-r--r--contrib/bind/port/freebsd/Makefile.set18
-rwxr-xr-xcontrib/bind/port/freebsd/bin/probe_ipv655
-rw-r--r--contrib/bind/port/freebsd/include/Makefile95
-rw-r--r--contrib/bind/port/freebsd/include/port_after.h175
-rw-r--r--contrib/bind/port/freebsd/include/port_before.h113
-rw-r--r--contrib/bind/port/freebsd/include/prand_conf.h43
-rw-r--r--contrib/bind/port/freebsd/include/sys/Makefile77
-rw-r--r--contrib/bind/port/freebsd/include/sys/bitypes.h37
-rw-r--r--contrib/bind/port/freebsd/noop.c4
-rwxr-xr-xcontrib/bind/port/freebsd/probe11
11 files changed, 713 insertions, 0 deletions
diff --git a/contrib/bind/port/freebsd/Makefile b/contrib/bind/port/freebsd/Makefile
new file mode 100644
index 0000000..d6c0cf0
--- /dev/null
+++ b/contrib/bind/port/freebsd/Makefile
@@ -0,0 +1,85 @@
+# Copyright (c) 1996,1999 by Internet Software Consortium
+#
+# Permission to use, copy, modify, and distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
+# ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
+# CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+# DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+# PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+# SOFTWARE.
+
+# $Id: Makefile,v 1.9 2000/11/21 12:55:03 marka Exp $
+
+# these are only appropriate for BSD 4.4 or derivatives, and are used in
+# development. normal builds will be done in the top level directory and
+# this Makefile will be invoked with a lot of overrides for the following:
+SYSTYPE= bsd
+DESTDIR =
+DESTLIB = /usr/local/lib
+O=o
+A=a
+CC= cc
+LD= ld
+SHELL= /bin/sh
+CDEBUG= -g
+TOP= ../..
+INCL = ${TOP}/include
+PORTINCL = ${TOP}/port/${SYSTYPE}/include
+LIBBIND = ${TOP}/lib/libbind.${A}
+CFLAGS= ${CDEBUG} -I${PORTINCL} -I${INCL}
+LD_LIBFLAGS= -x -r
+AR= ar cru
+RANLIB= ranlib
+INSTALL= install
+
+SUBDIRS= include
+
+SRCS= noop.c
+
+OBJS= noop.${O}
+
+MARGS= DESTDIR="${DESTDIR}" DESTINC="${DESTINC}" INSTALL="${INSTALL}"
+
+all depend clean distclean install::
+ @for x in ${SUBDIRS}; do \
+ (cd $$x; pwd; ${MAKE} ${MARGS} $@) || exit 1; \
+ done
+
+all:: ${LIBBIND}
+
+${LIBBIND}: ${OBJS}
+ ${AR} ${LIBBIND} ${ARPREF} ${OBJS} ${ARSUFF}
+ ${RANLIB} ${LIBBIND}
+
+.c.${O}:
+ ${CC} ${CPPFLAGS} ${CFLAGS} -c $*.c
+ -${LDS} ${LD} ${LD_LIBFLAGS} $*.${O} && ${LDS} mv a.out $*.${O}
+
+distclean:: clean
+
+clean:: FRC
+ rm -f .depend a.out core tags
+ rm -f *.${O} *.BAK *.CKP *~
+
+depend:: FRC
+ mkdep -I${INCL} -I${PORTINCL} ${CPPFLAGS} ${SRCS}
+
+links: FRC
+ @set -e; ln -s SRC/*.[ch] SRC/bin SRC/Makefile.set SRC/probe .
+ @set -e; for x in ${SUBDIRS}; do \
+ ( mkdir $$x; cd $$x; pwd; ln -s ../SRC/$$x SRC; \
+ cp SRC/Makefile Makefile; chmod +w Makefile; \
+ ${MAKE} ${MARGS} links ) || exit 1; \
+ done
+
+install:: FRC
+
+FRC:
+
+# DO NOT DELETE THIS LINE -- mkdep uses it.
+# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
diff --git a/contrib/bind/port/freebsd/Makefile.set b/contrib/bind/port/freebsd/Makefile.set
new file mode 100644
index 0000000..c1c9bcf
--- /dev/null
+++ b/contrib/bind/port/freebsd/Makefile.set
@@ -0,0 +1,18 @@
+'CC=cc'
+'CDEBUG=-O2 -g -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat'
+'DESTBIN=/usr/bin'
+'DESTSBIN=/usr/sbin'
+'DESTEXEC=/usr/libexec'
+'DESTMAN=/usr/share/man'
+'DESTHELP=/usr/share/misc'
+'DESTETC=/etc'
+'DESTRUN=/var/run'
+'LEX=lex -I'
+'YACC=yacc -d'
+'SYSLIBS=-ll -lutil'
+'INSTALL=install'
+'MANDIR=cat'
+'MANROFF=(tbl|nroff -man)'
+'CATEXT=0'
+'PS=ps'
+'RANLIB=ranlib'
diff --git a/contrib/bind/port/freebsd/bin/probe_ipv6 b/contrib/bind/port/freebsd/bin/probe_ipv6
new file mode 100755
index 0000000..ba7135d
--- /dev/null
+++ b/contrib/bind/port/freebsd/bin/probe_ipv6
@@ -0,0 +1,55 @@
+#!/bin/sh
+
+set -e
+PATH=/bin:/usr/bin:$PATH; export PATH
+trap "rm -f tmp$$a.c tmp$$b.c tmp$$a.o tmp$$b.o" 0
+target=port_ipv6
+new=new_${target}.h
+old=${target}.h
+
+cat > tmp$$a.c <<EOF
+#include <sys/types.h>
+#include <netinet/in.h>
+struct sockaddr_in6 xx;
+EOF
+
+cat > tmp$$b.c <<EOF
+#include <sys/types.h>
+#include <netinet/in.h>
+struct in6_addr xx;
+EOF
+
+cat > ${new} <<EOF
+
+/* This file is automatically generated. Do Not Edit. */
+
+#ifndef ${target}_h
+#define ${target}_h
+
+EOF
+
+if ${CC} -c tmp$$a.c > /dev/null 2>&1
+then
+ echo "#define HAS_INET6_STRUCTS" >> ${new}
+ if ${CC} -c tmp$$b.c > /dev/null 2>&1
+ then
+ :
+ else
+ echo "#define in6_addr in_addr6" >> ${new}
+ fi
+else
+ echo "#undef HAS_INET6_STRUCTS" >> ${new}
+fi
+echo >> ${new}
+echo "#endif" >> ${new}
+if [ -f ${old} ]; then
+ if cmp -s ${new} ${old} ; then
+ rm -f ${new}
+ else
+ rm -f ${old}
+ mv ${new} ${old}
+ fi
+else
+ mv ${new} ${old}
+fi
+exit 0
diff --git a/contrib/bind/port/freebsd/include/Makefile b/contrib/bind/port/freebsd/include/Makefile
new file mode 100644
index 0000000..9176a2d
--- /dev/null
+++ b/contrib/bind/port/freebsd/include/Makefile
@@ -0,0 +1,95 @@
+# ++Copyright++
+# -
+# Copyright (c)
+# The Regents of the University of California. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the University of
+# California, Berkeley and its contributors.
+# 4. Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+# -
+# Portions Copyright (c) 1993 by Digital Equipment Corporation.
+#
+# Permission to use, copy, modify, and distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies, and that
+# the name of Digital Equipment Corporation not be used in advertising or
+# publicity pertaining to distribution of the document or software without
+# specific, written prior permission.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
+# WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
+# CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+# DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+# PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+# SOFTWARE.
+# -
+# --Copyright--
+
+SUBDIRS = sys
+HFILES =
+
+DESTDIR=
+DESTINC= /usr/local/bind/include
+INSTALL= install
+
+MARGS= DESTDIR="${DESTDIR}" DESTINC="${DESTINC}" INSTALL="${INSTALL}"
+
+all depend clean distclean install::
+ @for x in ${SUBDIRS}; do \
+ (cd $$x; pwd; ${MAKE} ${MARGS} $@) || exit 1; \
+ done
+
+all depend::
+ probe_ipv6
+
+distclean:: clean
+
+clean::
+ rm -f *~ *.BAK *.CKP *.orig
+ rm -f port_ipv6.h new_port_ipv6.h
+
+links: FRC
+ @set -e; ln -s SRC/*.h .
+ @set -e; for x in ${SUBDIRS}; do \
+ ( mkdir $$x; cd $$x; pwd; ln -s ../SRC/$$x SRC; \
+ cp SRC/Makefile Makefile; chmod +w Makefile; \
+ ${MAKE} ${MARGS} links ) || exit 1; \
+ done
+
+install:: ${DESTDIR}${DESTINC}
+ -for x in "" ${HFILES}; do \
+ if [ -n "$$x" ]; then \
+ ${INSTALL} -c -m 444 $$x ${DESTDIR}${DESTINC}/$$x; \
+ fi; \
+ done
+
+${DESTDIR}${DESTINC}:
+ mkdir -p ${DESTDIR}${DESTINC}
+
+FRC:
diff --git a/contrib/bind/port/freebsd/include/port_after.h b/contrib/bind/port/freebsd/include/port_after.h
new file mode 100644
index 0000000..04c0441
--- /dev/null
+++ b/contrib/bind/port/freebsd/include/port_after.h
@@ -0,0 +1,175 @@
+/* $FreeBSD$ */
+#ifndef PORT_AFTER_H
+#define PORT_AFTER_H
+#define USE_POSIX
+#define POSIX_SIGNALS
+#define USE_UTIME
+#define USE_WAITPID
+#define HAVE_GETRUSAGE
+#define HAVE_FCHMOD
+#define NEED_PSELECT
+#define HAVE_SA_LEN
+#define SETPWENT_VOID
+#define RLIMIT_TYPE rlim_t
+#define RLIMIT_LONGLONG
+#define RLIMIT_FILE_INFINITY
+#define HAVE_MINIMUM_IFREQ
+#define HAVE_CHROOT
+#define CAN_CHANGE_ID
+#define MISSING_IN6ADDR_ANY
+
+#define _TIMEZONE timezone
+
+#define PORT_NONBLOCK O_NONBLOCK
+#define PORT_WOULDBLK EWOULDBLOCK
+#define WAIT_T int
+#define KSYMS "/kernel"
+#define KMEM "/dev/kmem"
+#define UDPSUM "udpcksum"
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/param.h>
+#if (!defined(BSD)) || (BSD < 199306)
+#include <sys/bitypes.h>
+#endif
+#include <netinet/in.h>
+#ifdef __KAME__
+#define HAS_INET6_STRUCTS
+#endif
+#include <sys/time.h>
+
+/*
+ * We need to know the IPv6 address family number even on IPv4-only systems.
+ * Note that this is NOT a protocol constant, and that if the system has its
+ * own AF_INET6, different from ours below, all of BIND's libraries and
+ * executables will need to be recompiled after the system <sys/socket.h>
+ * has had this type added. The type number below is correct on most BSD-
+ * derived systems for which AF_INET6 is defined.
+ */
+#ifndef AF_INET6
+#define AF_INET6 28
+#endif
+
+#ifdef SIN6_LEN
+#define HAS_INET6_STRUCTS
+#define HAVE_SA_LEN
+#endif
+
+#ifndef PF_INET6
+#define PF_INET6 AF_INET6
+#endif
+
+#ifndef HAS_INET6_STRUCTS
+/* Replace with structure from later rev of O/S if known. */
+struct in6_addr {
+ u_int8_t s6_addr[16];
+};
+
+/* Replace with structure from later rev of O/S if known. */
+struct sockaddr_in6 {
+#ifdef HAVE_SA_LEN
+ u_int8_t sin6_len; /* length of this struct */
+ u_int8_t sin6_family; /* AF_INET6 */
+#else
+ u_int16_t sin6_family; /* AF_INET6 */
+#endif
+ u_int16_t sin6_port; /* transport layer port # */
+ u_int32_t sin6_flowinfo; /* IPv6 flow information */
+ struct in6_addr sin6_addr; /* IPv6 address */
+ u_int32_t sin6_scope_id; /* set of interfaces for a scope */
+};
+
+#ifndef IN6ADDR_ANY_INIT
+#define IN6ADDR_ANY_INIT {{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}}
+#endif
+#ifndef IN6ADDR_LOOPBACK_INIT
+#define IN6ADDR_LOOPBACK_INIT {{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}}
+#endif
+#endif /* HAS_INET6_STRUCTS */
+
+#if defined(NEED_SOCKADDR_STORAGE) || !defined(HAS_INET6_STRUCTS)
+#define __SS_MAXSIZE 128
+#define __SS_ALLIGSIZE (sizeof (long))
+
+struct sockaddr_storage {
+#ifdef HAVE_SA_LEN
+ u_int8_t ss_len; /* address length */
+ u_int8_t ss_family; /* address family */
+ char __ss_pad1[__SS_ALLIGSIZE - 2 * sizeof(u_int8_t)];
+ long __ss_align;
+ char __ss_pad2[__SS_MAXSIZE - 2 * __SS_ALLIGSIZE];
+#else
+ u_int16_t ss_family; /* address family */
+ char __ss_pad1[__SS_ALLIGSIZE - sizeof(u_int16_t)];
+ long __ss_align;
+ char __ss_pad2[__SS_MAXSIZE - 2 * __SS_ALLIGSIZE];
+#endif
+};
+#endif
+
+
+#if !defined(HAS_INET6_STRUCTS) || defined(NEED_IN6ADDR_ANY)
+#define in6addr_any isc_in6addr_any
+extern const struct in6_addr in6addr_any;
+#endif
+
+#ifndef IN6_ARE_ADDR_EQUAL
+#define IN6_ARE_ADDR_EQUAL(a,b) \
+ (memcmp(&(a)->s6_addr[0], &(b)->s6_addr[0], sizeof(struct in6_addr)) == 0)
+#endif
+
+#ifndef IN6_IS_ADDR_UNSPECIFIED
+#define IN6_IS_ADDR_UNSPECIFIED(a) \
+ IN6_ARE_ADDR_EQUAL(a, &in6addr_any)
+#endif
+
+#ifndef IN6_IS_ADDR_SITELOCAL
+#define IN6_IS_ADDR_SITELOCAL(a) \
+ (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0xc0))
+#endif
+
+#ifndef IN6_IS_ADDR_MULTICAST
+#define IN6_IS_ADDR_MULTICAST(a) ((a)->s6_addr[0] == 0xff)
+#endif
+
+#ifndef __IPV6_ADDR_MC_SCOPE
+#define __IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr[1] & 0x0f)
+#endif
+
+#ifndef __IPV6_ADDR_SCOPE_SITELOCAL
+#define __IPV6_ADDR_SCOPE_SITELOCAL 0x05
+#endif
+
+#ifndef __IPV6_ADDR_SCOPE_ORGLOCAL
+#define __IPV6_ADDR_SCOPE_ORGLOCAL 0x08
+#endif
+
+#ifndef IN6_IS_ADDR_MC_SITELOCAL
+#define IN6_IS_ADDR_MC_SITELOCAL(a) \
+ (IN6_IS_ADDR_MULTICAST(a) && \
+ (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_SITELOCAL))
+#endif
+
+#ifndef IN6_IS_ADDR_MC_ORGLOCAL
+#define IN6_IS_ADDR_MC_ORGLOCAL(a) \
+ (IN6_IS_ADDR_MULTICAST(a) && \
+ (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_ORGLOCAL))
+#endif
+
+#ifndef INET6_ADDRSTRLEN
+#define INET6_ADDRSTRLEN 46
+#endif
+
+#ifndef ISC_FACILITY
+#define ISC_FACILITY LOG_DAEMON
+#endif
+
+#define UNUSED(x) (x) = (x)
+#define DE_CONST(konst, var) \
+ do { \
+ union { const void *k; void *v; } _u; \
+ _u.k = konst; \
+ var = _u.v; \
+ } while (0)
+#endif /* ! PORT_AFTER_H */
diff --git a/contrib/bind/port/freebsd/include/port_before.h b/contrib/bind/port/freebsd/include/port_before.h
new file mode 100644
index 0000000..cdedbbd
--- /dev/null
+++ b/contrib/bind/port/freebsd/include/port_before.h
@@ -0,0 +1,113 @@
+/* $FreeBSD$ */
+#define WANT_IRS_NIS
+#define WANT_IRS_PW
+#define HAVE_PW_CLASS
+#define WANT_IRS_GR
+#define SIG_FN void
+#define HAS_PTHREADS
+#define ts_sec tv_sec
+#define ts_nsec tv_nsec
+
+#if defined(HAS_PTHREADS) && defined(_REENTRANT)
+#define DO_PTHREADS
+#endif
+
+#if defined (__FreeBSD__) && __FreeBSD__>=3
+#define SETPWENT_VOID
+#endif
+
+#include <sys/types.h>
+
+#define GROUP_R_RETURN struct group *
+#define GROUP_R_SET_RETURN void
+#undef GROUP_R_SET_RESULT /*empty*/
+#define GROUP_R_END_RETURN void
+#define GROUP_R_END_RESULT(x) /*empty*/
+#define GROUP_R_ARGS char *buf, int buflen
+#define GROUP_R_ENT_ARGS void
+#define GROUP_R_OK gptr
+#define GROUP_R_BAD NULL
+#define GETGROUPLIST_ARGS const char *name, gid_t basegid, gid_t *groups, \
+ int *ngroups
+
+#define HOST_R_RETURN struct hostent *
+#define HOST_R_SET_RETURN void
+#undef HOST_R_SET_RESULT /*empty*/
+#define HOST_R_END_RETURN void
+#define HOST_R_END_RESULT(x) /*empty*/
+#define HOST_R_ARGS char *buf, int buflen, int *h_errnop
+#undef HOST_R_ENT_ARGS /*empty*/
+#define HOST_R_COPY buf, buflen
+#define HOST_R_COPY_ARGS char *buf, int buflen
+#define HOST_R_ERRNO *h_errnop = h_errno
+#define HOST_R_OK hptr
+#define HOST_R_BAD NULL
+
+#define NET_R_RETURN struct netent *
+#define NET_R_SET_RETURN void
+#undef NET_R_SET_RESULT /*empty*/
+#define NET_R_END_RETURN void
+#define NET_R_END_RESULT(x) /*empty*/
+#define NET_R_ARGS char *buf, int buflen
+#undef NET_R_ENT_ARGS /*empty*/
+#define NET_R_COPY buf, buflen
+#define NET_R_COPY_ARGS NET_R_ARGS
+#define NET_R_OK nptr
+#define NET_R_BAD NULL
+
+#define NGR_R_RETURN int
+#define NGR_R_SET_RETURN void
+#undef NGR_R_SET_RESULT /*empty*/
+#define NGR_R_END_RETURN void
+#define NGR_R_END_RESULT(x) return
+#define NGR_R_ARGS char *buf, int buflen
+#undef NGR_R_ENT_ARGS /*empty*/
+#define NGR_R_COPY buf, buflen
+#define NGR_R_COPY_ARGS NGR_R_ARGS
+#define NGR_R_OK 1
+#define NGR_R_BAD (0)
+
+#define PROTO_R_RETURN struct protoent *
+#define PROTO_R_SET_RETURN void
+#undef PROTO_R_SET_RESULT /*empty*/
+#define PROTO_R_END_RETURN void
+#define PROTO_R_END_RESULT(x) /*empty*/
+#define PROTO_R_ARGS char *buf, int buflen
+#undef PROTO_R_ENT_ARGS /*empty*/
+#define PROTO_R_COPY buf, buflen
+#define PROTO_R_COPY_ARGS PROTO_R_ARGS
+#define PROTO_R_OK pptr
+#define PROTO_R_BAD NULL
+
+#define PASS_R_RETURN struct passwd *
+#define PASS_R_SET_RETURN void
+#undef PASS_R_SET_RESULT /*empty*/
+#define PASS_R_END_RETURN void
+#define PASS_R_END_RESULT(x) /*empty*/
+#define PASS_R_ARGS char *buf, int buflen
+#undef PASS_R_ENT_ARGS /*empty*/
+#define PASS_R_COPY buf, buflen
+#define PASS_R_COPY_ARGS PASS_R_ARGS
+#define PASS_R_OK pwptr
+#define PASS_R_BAD NULL
+
+#define SERV_R_RETURN struct servent *
+#define SERV_R_SET_RETURN void
+#undef SERV_R_SET_RESULT /*empty*/
+#define SERV_R_END_RETURN void
+#define SERV_R_END_RESULT(x) /*empty*/
+#define SERV_R_ARGS char *buf, int buflen
+#undef SERV_R_ENT_ARGS /*empty*/
+#define SERV_R_COPY buf, buflen
+#define SERV_R_COPY_ARGS SERV_R_ARGS
+#define SERV_R_OK sptr
+#define SERV_R_BAD NULL
+
+#define IRS_LCL_SV_DB
+#define ISC_SOCKLEN_T int
+#ifdef __GNUC__
+#define ISC_FORMAT_PRINTF(fmt, args) \
+ __attribute__((__format__(__printf__, fmt, args)))
+#else
+#define ISC_FORMAT_PRINTF(fmt, args)
+#endif
diff --git a/contrib/bind/port/freebsd/include/prand_conf.h b/contrib/bind/port/freebsd/include/prand_conf.h
new file mode 100644
index 0000000..cf33196
--- /dev/null
+++ b/contrib/bind/port/freebsd/include/prand_conf.h
@@ -0,0 +1,43 @@
+#ifndef _PRAND_CMD_H_
+#define _PRAND_CMD_H_
+
+
+#ifndef HAVE_DEV_RANDOM
+# define HAVE_DEV_RANDOM 1
+#endif /* HAVE_DEV_RANDOM */
+
+static const char *cmds[] = {
+ "/bin/ps -axlw 2>&1",
+ "/usr/sbin/arp -an 2>&1",
+ "/usr/bin/netstat -an 2>&1",
+ "/bin/df 2>&1",
+ "/usr/bin/dig com. soa +ti=1 +retry=0 2>&1",
+ "/usr/bin/netstat -an 2>&1",
+ "/usr/bin/dig . soa +ti=1 +retry=0 2>&1",
+ "/usr/sbin/iostat 2>&1",
+ "/usr/bin/vmstat 2>&1",
+ "/usr/bin/w 2>&1",
+ NULL
+};
+
+static const char *dirs[] = {
+ "/tmp",
+ "/usr/tmp",
+ ".",
+ "/",
+ "/var/spool",
+ "/dev",
+ "/var/mail",
+ "/home",
+ "/usr/home",
+ NULL
+};
+
+static const char *files[] = {
+ "/var/log/messages",
+ "/var/log/wtmp",
+ "/var/log/lastlog",
+ NULL
+};
+
+#endif /* _PRAND_CMD_H_ */
diff --git a/contrib/bind/port/freebsd/include/sys/Makefile b/contrib/bind/port/freebsd/include/sys/Makefile
new file mode 100644
index 0000000..ad7751c
--- /dev/null
+++ b/contrib/bind/port/freebsd/include/sys/Makefile
@@ -0,0 +1,77 @@
+# ++Copyright++
+# -
+# Copyright (c)
+# The Regents of the University of California. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the University of
+# California, Berkeley and its contributors.
+# 4. Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+# -
+# Portions Copyright (c) 1993 by Digital Equipment Corporation.
+#
+# Permission to use, copy, modify, and distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies, and that
+# the name of Digital Equipment Corporation not be used in advertising or
+# publicity pertaining to distribution of the document or software without
+# specific, written prior permission.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
+# WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
+# CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+# DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+# PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+# SOFTWARE.
+# -
+# --Copyright--
+
+HFILES= bitypes.h cdefs.h
+
+DESTDIR=
+DESTINC= /usr/local/bind/include
+
+all depend:
+
+distclean: clean
+
+clean:
+ rm -f *~ *.BAK *.CKP *.orig time.h stat.h
+
+links:
+ @set -e; ln -s SRC/*.h .
+
+install: ${DESTDIR}${DESTINC}/sys
+ for x in ${HFILES}; do \
+ if [ -f $$x ]; then \
+ ${INSTALL} -c -m 444 $$x ${DESTDIR}${DESTINC}/sys/$$x;\
+ fi; \
+ done
+
+${DESTDIR}${DESTINC}/sys:
+ mkdir -p ${DESTDIR}${DESTINC}/sys
diff --git a/contrib/bind/port/freebsd/include/sys/bitypes.h b/contrib/bind/port/freebsd/include/sys/bitypes.h
new file mode 100644
index 0000000..361156a
--- /dev/null
+++ b/contrib/bind/port/freebsd/include/sys/bitypes.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 1996,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
+ * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
+ * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+#ifndef __BIT_TYPES_DEFINED__
+#define __BIT_TYPES_DEFINED__
+
+ /*
+ * Basic integral types. Omit the typedef if
+ * not possible for a machine/compiler combination.
+ */
+ typedef /*signed*/ char int8_t;
+ typedef unsigned char u_int8_t;
+ typedef short int16_t;
+ typedef unsigned short u_int16_t;
+ typedef int int32_t;
+ typedef unsigned int u_int32_t;
+
+# if 0 /* don't fight with these unless you need them */
+ typedef long long int64_t;
+ typedef unsigned long long u_int64_t;
+# endif
+
+#endif /* __BIT_TYPES_DEFINED__ */
diff --git a/contrib/bind/port/freebsd/noop.c b/contrib/bind/port/freebsd/noop.c
new file mode 100644
index 0000000..f8eb9f4
--- /dev/null
+++ b/contrib/bind/port/freebsd/noop.c
@@ -0,0 +1,4 @@
+static void
+noop() {
+ /* NOOP */
+}
diff --git a/contrib/bind/port/freebsd/probe b/contrib/bind/port/freebsd/probe
new file mode 100755
index 0000000..d1b0cfe
--- /dev/null
+++ b/contrib/bind/port/freebsd/probe
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+uname=/usr/bin/uname
+
+if [ -f $uname ]; then
+ case `$uname -s` in
+ FreeBSD) exit 0 ;;
+ esac
+fi
+
+exit 1
OpenPOWER on IntegriCloud