aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Barton <dougb@FreeBSD.org>2009-05-30 23:50:12 +0000
committerDoug Barton <dougb@FreeBSD.org>2009-05-30 23:50:12 +0000
commit9097ac2a7ff12d10a4bb41b10496fdce85cadfae (patch)
tree6864df96e4080a2d4b7f1b322fc540ee9b7860a1
parentde7e1db19da108c11098aad4d4237554b83e1c90 (diff)
downloadsrc-9097ac2a7ff12d10a4bb41b10496fdce85cadfae.tar.gz
src-9097ac2a7ff12d10a4bb41b10496fdce85cadfae.zip
In preparation for the BIND 9.6.1rc1 import, remove this directory.
The libbind library is no longer distributed as part of the main BIND package, and we never built it in any case.
Notes
Notes: svn path=/vendor/bind9/dist/; revision=193136
-rw-r--r--lib/bind/Makefile.in133
-rw-r--r--lib/bind/README4
-rw-r--r--lib/bind/aclocal.m42
-rw-r--r--lib/bind/api3
-rw-r--r--lib/bind/bsd/Makefile.in39
-rw-r--r--lib/bind/bsd/daemon.c81
-rw-r--r--lib/bind/bsd/ftruncate.c64
-rw-r--r--lib/bind/bsd/gettimeofday.c64
-rw-r--r--lib/bind/bsd/mktemp.c156
-rw-r--r--lib/bind/bsd/putenv.c27
-rw-r--r--lib/bind/bsd/readv.c39
-rw-r--r--lib/bind/bsd/setenv.c151
-rw-r--r--lib/bind/bsd/setitimer.c29
-rw-r--r--lib/bind/bsd/strcasecmp.c124
-rw-r--r--lib/bind/bsd/strdup.c20
-rw-r--r--lib/bind/bsd/strerror.c94
-rw-r--r--lib/bind/bsd/strpbrk.c70
-rw-r--r--lib/bind/bsd/strsep.c88
-rw-r--r--lib/bind/bsd/strtoul.c119
-rw-r--r--lib/bind/bsd/utimes.c40
-rw-r--r--lib/bind/bsd/writev.c89
-rw-r--r--lib/bind/config.h.in68
-rw-r--r--lib/bind/configure.in2872
-rw-r--r--lib/bind/dst/Makefile.in32
-rw-r--r--lib/bind/dst/dst_api.c1048
-rw-r--r--lib/bind/dst/dst_internal.h155
-rw-r--r--lib/bind/dst/hmac_link.c489
-rw-r--r--lib/bind/dst/md5.h108
-rw-r--r--lib/bind/dst/md5_dgst.c374
-rw-r--r--lib/bind/dst/md5_locl.h193
-rw-r--r--lib/bind/dst/support.c342
-rw-r--r--lib/bind/include/Makefile.in47
-rw-r--r--lib/bind/include/arpa/inet.h126
-rw-r--r--lib/bind/include/arpa/nameser.h575
-rw-r--r--lib/bind/include/arpa/nameser_compat.h232
-rw-r--r--lib/bind/include/fd_setsize.h10
-rw-r--r--lib/bind/include/hesiod.h39
-rw-r--r--lib/bind/include/irp.h107
-rw-r--r--lib/bind/include/irs.h348
-rw-r--r--lib/bind/include/isc/assertions.h123
-rw-r--r--lib/bind/include/isc/ctl.h112
-rw-r--r--lib/bind/include/isc/dst.h168
-rw-r--r--lib/bind/include/isc/eventlib.h206
-rw-r--r--lib/bind/include/isc/heap.h49
-rw-r--r--lib/bind/include/isc/irpmarshall.h112
-rw-r--r--lib/bind/include/isc/list.h117
-rw-r--r--lib/bind/include/isc/logging.h113
-rw-r--r--lib/bind/include/isc/memcluster.h50
-rw-r--r--lib/bind/include/isc/misc.h44
-rw-r--r--lib/bind/include/isc/platform.h.in36
-rw-r--r--lib/bind/include/isc/tree.h59
-rw-r--r--lib/bind/include/netdb.h582
-rw-r--r--lib/bind/include/netgroup.h26
-rw-r--r--lib/bind/include/res_update.h69
-rw-r--r--lib/bind/include/resolv.h509
-rw-r--r--lib/bind/include/resolv_mt.h47
-rw-r--r--lib/bind/inet/Makefile.in35
-rw-r--r--lib/bind/inet/inet_addr.c208
-rw-r--r--lib/bind/inet/inet_cidr_ntop.c263
-rw-r--r--lib/bind/inet/inet_cidr_pton.c277
-rw-r--r--lib/bind/inet/inet_data.c46
-rw-r--r--lib/bind/inet/inet_lnaof.c65
-rw-r--r--lib/bind/inet/inet_makeaddr.c68
-rw-r--r--lib/bind/inet/inet_net_ntop.c279
-rw-r--r--lib/bind/inet/inet_net_pton.c407
-rw-r--r--lib/bind/inet/inet_neta.c89
-rw-r--r--lib/bind/inet/inet_netof.c64
-rw-r--r--lib/bind/inet/inet_network.c106
-rw-r--r--lib/bind/inet/inet_ntoa.c64
-rw-r--r--lib/bind/inet/inet_ntop.c207
-rw-r--r--lib/bind/inet/inet_pton.c223
-rw-r--r--lib/bind/inet/nsap_addr.c111
-rw-r--r--lib/bind/irs/Makefile.in70
-rw-r--r--lib/bind/irs/dns.c154
-rw-r--r--lib/bind/irs/dns_gr.c294
-rw-r--r--lib/bind/irs/dns_ho.c1143
-rw-r--r--lib/bind/irs/dns_nw.c591
-rw-r--r--lib/bind/irs/dns_p.h52
-rw-r--r--lib/bind/irs/dns_pr.c268
-rw-r--r--lib/bind/irs/dns_pw.c232
-rw-r--r--lib/bind/irs/dns_sv.c300
-rw-r--r--lib/bind/irs/gai_strerror.c105
-rw-r--r--lib/bind/irs/gen.c433
-rw-r--r--lib/bind/irs/gen_gr.c493
-rw-r--r--lib/bind/irs/gen_ho.c391
-rw-r--r--lib/bind/irs/gen_ng.c174
-rw-r--r--lib/bind/irs/gen_nw.c264
-rw-r--r--lib/bind/irs/gen_p.h113
-rw-r--r--lib/bind/irs/gen_pr.c228
-rw-r--r--lib/bind/irs/gen_pw.c234
-rw-r--r--lib/bind/irs/gen_sv.c229
-rw-r--r--lib/bind/irs/getaddrinfo.c1253
-rw-r--r--lib/bind/irs/getgrent.c224
-rw-r--r--lib/bind/irs/getgrent_r.c230
-rw-r--r--lib/bind/irs/gethostent.c1070
-rw-r--r--lib/bind/irs/gethostent_r.c275
-rw-r--r--lib/bind/irs/getnameinfo.c334
-rw-r--r--lib/bind/irs/getnetent.c345
-rw-r--r--lib/bind/irs/getnetent_r.c234
-rw-r--r--lib/bind/irs/getnetgrent.c160
-rw-r--r--lib/bind/irs/getnetgrent_r.c219
-rw-r--r--lib/bind/irs/getprotoent.c176
-rw-r--r--lib/bind/irs/getprotoent_r.c223
-rw-r--r--lib/bind/irs/getpwent.c201
-rw-r--r--lib/bind/irs/getpwent_r.c276
-rw-r--r--lib/bind/irs/getservent.c179
-rw-r--r--lib/bind/irs/getservent_r.c242
-rw-r--r--lib/bind/irs/hesiod.c505
-rw-r--r--lib/bind/irs/hesiod_p.h48
-rw-r--r--lib/bind/irs/irp.c583
-rw-r--r--lib/bind/irs/irp_gr.c357
-rw-r--r--lib/bind/irs/irp_ho.c405
-rw-r--r--lib/bind/irs/irp_ng.c253
-rw-r--r--lib/bind/irs/irp_nw.c348
-rw-r--r--lib/bind/irs/irp_p.h60
-rw-r--r--lib/bind/irs/irp_pr.c327
-rw-r--r--lib/bind/irs/irp_pw.c340
-rw-r--r--lib/bind/irs/irp_sv.c346
-rw-r--r--lib/bind/irs/irpmarshall.c2301
-rw-r--r--lib/bind/irs/irs_data.c246
-rw-r--r--lib/bind/irs/irs_data.h63
-rw-r--r--lib/bind/irs/irs_p.h51
-rw-r--r--lib/bind/irs/lcl.c142
-rw-r--r--lib/bind/irs/lcl_gr.c354
-rw-r--r--lib/bind/irs/lcl_ho.c578
-rw-r--r--lib/bind/irs/lcl_ng.c446
-rw-r--r--lib/bind/irs/lcl_nw.c373
-rw-r--r--lib/bind/irs/lcl_p.h51
-rw-r--r--lib/bind/irs/lcl_pr.c294
-rw-r--r--lib/bind/irs/lcl_pw.c309
-rw-r--r--lib/bind/irs/lcl_sv.c432
-rw-r--r--lib/bind/irs/nis.c156
-rw-r--r--lib/bind/irs/nis_gr.c354
-rw-r--r--lib/bind/irs/nis_ho.c535
-rw-r--r--lib/bind/irs/nis_ng.c304
-rw-r--r--lib/bind/irs/nis_nw.c385
-rw-r--r--lib/bind/irs/nis_p.h47
-rw-r--r--lib/bind/irs/nis_pr.c302
-rw-r--r--lib/bind/irs/nis_pw.c288
-rw-r--r--lib/bind/irs/nis_sv.c310
-rw-r--r--lib/bind/irs/nul_ng.c127
-rw-r--r--lib/bind/irs/pathnames.h52
-rw-r--r--lib/bind/irs/util.c109
-rw-r--r--lib/bind/isc/Makefile.in35
-rw-r--r--lib/bind/isc/assertions.c94
-rw-r--r--lib/bind/isc/assertions.mdoc138
-rw-r--r--lib/bind/isc/base64.c322
-rw-r--r--lib/bind/isc/bitncmp.c68
-rw-r--r--lib/bind/isc/bitncmp.mdoc82
-rw-r--r--lib/bind/isc/ctl_clnt.c620
-rw-r--r--lib/bind/isc/ctl_p.c188
-rw-r--r--lib/bind/isc/ctl_p.h28
-rw-r--r--lib/bind/isc/ctl_srvr.c787
-rw-r--r--lib/bind/isc/ev_connects.c369
-rw-r--r--lib/bind/isc/ev_files.c277
-rw-r--r--lib/bind/isc/ev_streams.c308
-rw-r--r--lib/bind/isc/ev_timers.c499
-rw-r--r--lib/bind/isc/ev_waits.c247
-rw-r--r--lib/bind/isc/eventlib.c933
-rw-r--r--lib/bind/isc/eventlib.mdoc918
-rw-r--r--lib/bind/isc/eventlib_p.h281
-rw-r--r--lib/bind/isc/heap.c236
-rw-r--r--lib/bind/isc/heap.mdoc378
-rw-r--r--lib/bind/isc/hex.c119
-rw-r--r--lib/bind/isc/logging.c716
-rw-r--r--lib/bind/isc/logging.mdoc1056
-rw-r--r--lib/bind/isc/logging_p.h61
-rw-r--r--lib/bind/isc/memcluster.c588
-rw-r--r--lib/bind/isc/memcluster.mdoc376
-rw-r--r--lib/bind/isc/movefile.c37
-rw-r--r--lib/bind/isc/tree.c534
-rw-r--r--lib/bind/isc/tree.mdoc154
-rw-r--r--lib/bind/make/includes.in44
-rw-r--r--lib/bind/make/mkdep.in147
-rw-r--r--lib/bind/make/rules.in177
-rwxr-xr-xlib/bind/mkinstalldirs40
-rw-r--r--lib/bind/nameser/Makefile.in31
-rw-r--r--lib/bind/nameser/ns_date.c129
-rw-r--r--lib/bind/nameser/ns_name.c973
-rw-r--r--lib/bind/nameser/ns_netint.c58
-rw-r--r--lib/bind/nameser/ns_parse.c211
-rw-r--r--lib/bind/nameser/ns_print.c897
-rw-r--r--lib/bind/nameser/ns_samedomain.c207
-rw-r--r--lib/bind/nameser/ns_sign.c387
-rw-r--r--lib/bind/nameser/ns_ttl.c162
-rw-r--r--lib/bind/nameser/ns_verify.c484
-rw-r--r--lib/bind/port/Makefile.in14
-rw-r--r--lib/bind/port/freebsd/Makefile.in14
-rw-r--r--lib/bind/port/freebsd/include/Makefile.in34
-rw-r--r--lib/bind/port/freebsd/include/sys/bitypes.h37
-rw-r--r--lib/bind/port_after.h.in507
-rw-r--r--lib/bind/port_before.h.in173
-rw-r--r--lib/bind/resolv/Makefile.in34
-rw-r--r--lib/bind/resolv/herror.c129
-rw-r--r--lib/bind/resolv/mtctxres.c129
-rw-r--r--lib/bind/resolv/res_comp.c265
-rw-r--r--lib/bind/resolv/res_data.c297
-rw-r--r--lib/bind/resolv/res_debug.c1212
-rw-r--r--lib/bind/resolv/res_debug.h35
-rw-r--r--lib/bind/resolv/res_findzonecut.c722
-rw-r--r--lib/bind/resolv/res_init.c801
-rw-r--r--lib/bind/resolv/res_mkquery.c303
-rw-r--r--lib/bind/resolv/res_mkupdate.c1162
-rw-r--r--lib/bind/resolv/res_mkupdate.h25
-rw-r--r--lib/bind/resolv/res_private.h22
-rw-r--r--lib/bind/resolv/res_query.c440
-rw-r--r--lib/bind/resolv/res_send.c1108
-rw-r--r--lib/bind/resolv/res_sendsigned.c170
-rw-r--r--lib/bind/resolv/res_update.c213
209 files changed, 0 insertions, 59367 deletions
diff --git a/lib/bind/Makefile.in b/lib/bind/Makefile.in
deleted file mode 100644
index fd9a16f67f7c..000000000000
--- a/lib/bind/Makefile.in
+++ /dev/null
@@ -1,133 +0,0 @@
-# Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC")
-# Copyright (C) 2001-2003 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 ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS. IN NO EVENT SHALL ISC 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.in,v 1.22.18.7 2006/06/24 00:25:39 marka Exp $
-
-srcdir = @srcdir@
-VPATH = @srcdir@
-top_srcdir = @top_srcdir@
-
-
-@LIBBIND_API@
-
-LIBS = @LIBS@
-
-DAEMON_OBJS=bsd/daemon.@O@
-STRSEP_OBJS=bsd/strsep.@O@
-
-BSDOBJS= @DAEMON_OBJS@ @STRSEP_OBJS@ bsd/ftruncate.@O@ bsd/gettimeofday.@O@ \
- bsd/mktemp.@O@ bsd/putenv.@O@ bsd/readv.@O@ bsd/setenv.@O@ \
- bsd/setitimer.@O@ bsd/strcasecmp.@O@ bsd/strdup.@O@ \
- bsd/strerror.@O@ bsd/strpbrk.@O@ bsd/strtoul.@O@ bsd/utimes.@O@ \
- bsd/writev.@O@
-
-DSTOBJS= dst/dst_api.@O@ dst/hmac_link.@O@ dst/md5_dgst.@O@ dst/support.@O@
-
-INETOBJS= inet/inet_addr.@O@ inet/inet_cidr_ntop.@O@ inet/inet_cidr_pton.@O@ \
- inet/inet_data.@O@ inet/inet_lnaof.@O@ inet/inet_makeaddr.@O@ \
- inet/inet_net_ntop.@O@ inet/inet_net_pton.@O@ inet/inet_neta.@O@ \
- inet/inet_netof.@O@ inet/inet_network.@O@ inet/inet_ntoa.@O@ \
- inet/inet_ntop.@O@ inet/inet_pton.@O@ inet/nsap_addr.@O@
-
-WANT_IRS_THREADS_OBJS= irs/gethostent_r.@O@ irs/getnetent_r.@O@ \
- irs/getnetgrent_r.@O@ irs/getprotoent_r.@O@ irs/getservent_r.@O@
-
-WANT_IRS_NISGR_OBJS= irs/nis_gr.@O@
-WANT_IRS_GR_OBJS= irs/dns_gr.@O@ irs/irp_gr.@O@ irs/lcl_gr.@O@ irs/gen_gr.@O@ \
- irs/getgrent.@O@ @WANT_IRS_NISGR_OBJS@ @WANT_IRS_THREADSGR_OBJS@
-
-WANT_IRS_THREADSPW_OBJS=irs/getpwent_r.@O@
-WANT_IRS_NISPW_OBJS= irs/nis_pw.@O@
-WANT_IRS_DBPW_OBJS=irs/irp_pw.@O@ irs/lcl_pw.@O@
-WANT_IRS_PW_OBJS= irs/dns_pw.@O@ irs/gen_pw.@O@ irs/getpwent.@O@ \
- @WANT_IRS_DBPW_OBJS@ @WANT_IRS_NISPW_OBJS@ @WANT_IRS_THREADSPW_OBJS@
-
-WANT_IRS_NIS_OBJS= irs/nis_ho.@O@ irs/nis_ng.@O@ irs/nis_nw.@O@ \
- irs/nis_pr.@O@ irs/nis_sv.@O@
-
-IRSOBJS= @WANT_IRS_GR_OBJS@ @WANT_IRS_NIS_OBJS@ @WANT_IRS_THREADS_OBJS@ \
- @WANT_IRS_PW_OBJS@ \
- irs/dns.@O@ irs/dns_ho.@O@ irs/dns_nw.@O@ irs/dns_pr.@O@ \
- irs/dns_sv.@O@ irs/gai_strerror.@O@ irs/gen.@O@ irs/gen_ho.@O@ \
- irs/gen_ng.@O@ irs/gen_nw.@O@ irs/gen_pr.@O@ irs/gen_sv.@O@ \
- irs/getaddrinfo.@O@ irs/gethostent.@O@ irs/getnameinfo.@O@ \
- irs/getnetent.@O@ irs/getnetgrent.@O@ \
- irs/getprotoent.@O@ irs/getservent.@O@ irs/hesiod.@O@ \
- irs/irp.@O@ irs/irp_ho.@O@ irs/irp_ng.@O@ irs/irp_nw.@O@ \
- irs/irp_pr.@O@ irs/irp_sv.@O@ irs/irpmarshall.@O@ irs/irs_data.@O@ \
- irs/lcl.@O@ irs/lcl_ho.@O@ irs/lcl_ng.@O@ irs/lcl_nw.@O@ \
- irs/lcl_pr.@O@ irs/lcl_sv.@O@ irs/nis.@O@ irs/nul_ng.@O@ irs/util.@O@
-
-WANT_IRS_THREADSGR_OBJS=irs/getgrent_r.@O@
-
-ISCOBJS= isc/assertions.@O@ isc/base64.@O@ isc/bitncmp.@O@ isc/ctl_clnt.@O@ \
- isc/ctl_p.@O@ isc/ctl_srvr.@O@ isc/ev_connects.@O@ isc/ev_files.@O@ \
- isc/ev_streams.@O@ isc/ev_timers.@O@ isc/ev_waits.@O@ \
- isc/eventlib.@O@ isc/heap.@O@ isc/hex.@O@ isc/logging.@O@ \
- isc/memcluster.@O@ isc/movefile.@O@ isc/tree.@O@
-
-NAMESEROBJS= nameser/ns_date.@O@ nameser/ns_name.@O@ nameser/ns_netint.@O@ \
- nameser/ns_parse.@O@ nameser/ns_print.@O@ nameser/ns_samedomain.@O@ \
- nameser/ns_sign.@O@ nameser/ns_ttl.@O@ nameser/ns_verify.@O@
-
-RESOLVOBJS= resolv/herror.@O@ resolv/mtctxres.@O@ resolv/res_comp.@O@ \
- resolv/res_data.@O@ resolv/res_debug.@O@ resolv/res_findzonecut.@O@ \
- resolv/res_init.@O@ resolv/res_mkquery.@O@ resolv/res_mkupdate.@O@ \
- resolv/res_query.@O@ resolv/res_send.@O@ resolv/res_sendsigned.@O@ \
- resolv/res_update.@O@
-
-SUBDIRS = bsd dst include inet irs isc nameser resolv @PORT_INCLUDE@
-
-TARGETS= timestamp
-OBJS= ${BSDOBJS} ${DSTOBJS} ${INETOBJS} ${IRSOBJS} ${ISCOBJS} \
- ${NAMESEROBJS} ${RESOLVOBJS}
-
-@BIND9_MAKE_RULES@
-
-# Attempt to disable parallel processing.
-.NOTPARALLEL:
-.NO_PARALLEL:
-
-libbind.@SA@: ${OBJS}
- ${AR} ${ARFLAGS} $@ ${OBJS}
- ${RANLIB} $@
-
-libbind.la: ${OBJS}
- ${LIBTOOL_MODE_LINK} \
- ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o libbind.la -rpath ${libdir} \
- -version-info ${LIBINTERFACE}:${LIBREVISION}:${LIBAGE} \
- ${OBJS} ${LIBS}
-
-timestamp: libbind.@A@
- touch timestamp
-
-installdirs:
- $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${libdir}
-
-install:: timestamp installdirs
- ${LIBTOOL_MODE_INSTALL} ${INSTALL_DATA} libbind.@A@ ${DESTDIR}${libdir}
-
-clean distclean::
- rm -f libbind.@SA@ libbind.la
-
-distclean::
- rm -f make/rules make/includes make/mkdep
-
-distclean::
- rm -f config.cache config.h config.log config.status libtool
- rm -f port_before.h port_after.h configure.lineno
- rm -f port/Makefile @PORT_DIR@/Makefile
-
-man:
diff --git a/lib/bind/README b/lib/bind/README
deleted file mode 100644
index b89cff7095d1..000000000000
--- a/lib/bind/README
+++ /dev/null
@@ -1,4 +0,0 @@
---with-irs-gr=yes #define WANT_IRS_GR
---with-irs-nis=yes #define WANT_IRS_NIS
---with-irs-pw=yes #define WANT_IRS_PW
-
diff --git a/lib/bind/aclocal.m4 b/lib/bind/aclocal.m4
deleted file mode 100644
index 110ed87832da..000000000000
--- a/lib/bind/aclocal.m4
+++ /dev/null
@@ -1,2 +0,0 @@
-sinclude(../../libtool.m4)dnl
-
diff --git a/lib/bind/api b/lib/bind/api
deleted file mode 100644
index 7ffeba810f24..000000000000
--- a/lib/bind/api
+++ /dev/null
@@ -1,3 +0,0 @@
-LIBINTERFACE = 5
-LIBREVISION = 2
-LIBAGE = 1
diff --git a/lib/bind/bsd/Makefile.in b/lib/bind/bsd/Makefile.in
deleted file mode 100644
index 72a52f61ff1a..000000000000
--- a/lib/bind/bsd/Makefile.in
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2004, 2008 Internet Systems Consortium, Inc. ("ISC")
-# Copyright (C) 2001 Internet Software Consortium.
-#
-# Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS. IN NO EVENT SHALL ISC 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.in,v 1.7.18.2 2008/03/20 23:46:01 tbox Exp $
-
-srcdir= @srcdir@
-VPATH = @srcdir@
-
-DAEMON_OBJS=daemon.@O@
-STRSEP_OBJS=strsep.@O@
-
-OBJS= @DAEMON_OBJS@ @STRSEP_OBJS@ ftruncate.@O@ gettimeofday.@O@ \
- mktemp.@O@ putenv.@O@ \
- readv.@O@ setenv.@O@ setitimer.@O@ strcasecmp.@O@ strdup.@O@ \
- strerror.@O@ strpbrk.@O@ strtoul.@O@ utimes.@O@ \
- writev.@O@
-
-SRCS= daemon.c ftruncate.c gettimeofday.c mktemp.c putenv.c \
- readv.c setenv.c setitimer.c strcasecmp.c strdup.c \
- strerror.c strpbrk.c strsep.c strtoul.c utimes.c \
- writev.c
-
-TARGETS= ${OBJS}
-
-CINCLUDES= -I.. -I../include -I${srcdir}/../include
-
-@BIND9_MAKE_RULES@
diff --git a/lib/bind/bsd/daemon.c b/lib/bind/bsd/daemon.c
deleted file mode 100644
index a7d2ded9b576..000000000000
--- a/lib/bind/bsd/daemon.c
+++ /dev/null
@@ -1,81 +0,0 @@
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char sccsid[] = "@(#)daemon.c 8.1 (Berkeley) 6/4/93";
-static const char rcsid[] = "$Id: daemon.c,v 1.1.352.1 2005/04/27 05:00:42 sra Exp $";
-#endif /* LIBC_SCCS and not lint */
-
-/*
- * Copyright (c) 1990, 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.
- */
-
-#include "port_before.h"
-
-#include <fcntl.h>
-#include <paths.h>
-#include <unistd.h>
-
-#include "port_after.h"
-
-#ifndef NEED_DAEMON
-int __bind_daemon__;
-#else
-
-int
-daemon(int nochdir, int noclose) {
- int fd;
-
- switch (fork()) {
- case -1:
- return (-1);
- case 0:
- break;
- default:
- _exit(0);
- }
-
- if (setsid() == -1)
- return (-1);
-
- if (!nochdir)
- (void)chdir("/");
-
- if (!noclose && (fd = open(_PATH_DEVNULL, O_RDWR, 0)) != -1) {
- (void)dup2(fd, STDIN_FILENO);
- (void)dup2(fd, STDOUT_FILENO);
- (void)dup2(fd, STDERR_FILENO);
- if (fd > 2)
- (void)close (fd);
- }
- return (0);
-}
-#endif
-
-/*! \file */
diff --git a/lib/bind/bsd/ftruncate.c b/lib/bind/bsd/ftruncate.c
deleted file mode 100644
index b222c8b25e7a..000000000000
--- a/lib/bind/bsd/ftruncate.c
+++ /dev/null
@@ -1,64 +0,0 @@
-#ifndef LINT
-static const char rcsid[] = "$Id: ftruncate.c,v 1.1.352.3 2005/06/22 22:05:45 marka Exp $";
-#endif
-
-/*! \file
- * \brief
- * ftruncate - set file size, BSD Style
- *
- * shortens or enlarges the file as neeeded
- * uses some undocumented locking call. It is known to work on SCO unix,
- * other vendors should try.
- * The #error directive prevents unsupported OSes
- */
-
-#include "port_before.h"
-
-#if defined(M_UNIX)
-#define OWN_FTRUNCATE
-#include <stdio.h>
-#ifdef _XOPEN_SOURCE
-#undef _XOPEN_SOURCE
-#endif
-#ifdef _POSIX_SOURCE
-#undef _POSIX_SOURCE
-#endif
-
-#include <fcntl.h>
-
-#include "port_after.h"
-
-int
-__ftruncate(int fd, long wantsize) {
- long cursize;
-
- /* determine current file size */
- if ((cursize = lseek(fd, 0L, 2)) == -1)
- return (-1);
-
- /* maybe lengthen... */
- if (cursize < wantsize) {
- if (lseek(fd, wantsize - 1, 0) == -1 ||
- write(fd, "", 1) == -1) {
- return (-1);
- }
- return (0);
- }
-
- /* maybe shorten... */
- if (wantsize < cursize) {
- struct flock fl;
-
- fl.l_whence = 0;
- fl.l_len = 0;
- fl.l_start = wantsize;
- fl.l_type = F_WRLCK;
- return (fcntl(fd, F_FREESP, &fl));
- }
- return (0);
-}
-#endif
-
-#ifndef OWN_FTRUNCATE
-int __bindcompat_ftruncate;
-#endif
diff --git a/lib/bind/bsd/gettimeofday.c b/lib/bind/bsd/gettimeofday.c
deleted file mode 100644
index 0c88e009c583..000000000000
--- a/lib/bind/bsd/gettimeofday.c
+++ /dev/null
@@ -1,64 +0,0 @@
-#ifndef LINT
-static const char rcsid[] = "$Id: gettimeofday.c,v 1.3.332.1 2005/04/27 05:00:43 sra Exp $";
-#endif
-
-#include "port_before.h"
-#include <stdio.h>
-#include <syslog.h>
-#include <sys/time.h>
-#include "port_after.h"
-
-#if !defined(NEED_GETTIMEOFDAY)
-/*%
- * gettimeofday() occasionally returns invalid tv_usec on some platforms.
- */
-#define MILLION 1000000
-#undef gettimeofday
-
-int
-isc__gettimeofday(struct timeval *tp, struct timezone *tzp) {
- int res;
-
- res = gettimeofday(tp, tzp);
- if (res < 0)
- return (res);
- if (tp == NULL)
- return (res);
- if (tp->tv_usec < 0) {
- do {
- tp->tv_usec += MILLION;
- tp->tv_sec--;
- } while (tp->tv_usec < 0);
- goto log;
- } else if (tp->tv_usec > MILLION) {
- do {
- tp->tv_usec -= MILLION;
- tp->tv_sec++;
- } while (tp->tv_usec > MILLION);
- goto log;
- }
- return (res);
- log:
- syslog(LOG_ERR, "gettimeofday: tv_usec out of range\n");
- return (res);
-}
-#else
-int
-gettimeofday(struct timeval *tvp, struct _TIMEZONE *tzp) {
- time_t clock, time(time_t *);
-
- if (time(&clock) == (time_t) -1)
- return (-1);
- if (tvp) {
- tvp->tv_sec = clock;
- tvp->tv_usec = 0;
- }
- if (tzp) {
- tzp->tz_minuteswest = 0;
- tzp->tz_dsttime = 0;
- }
- return (0);
-}
-#endif /*NEED_GETTIMEOFDAY*/
-
-/*! \file */
diff --git a/lib/bind/bsd/mktemp.c b/lib/bind/bsd/mktemp.c
deleted file mode 100644
index f201c2d7bf8e..000000000000
--- a/lib/bind/bsd/mktemp.c
+++ /dev/null
@@ -1,156 +0,0 @@
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char sccsid[] = "@(#)mktemp.c 8.1 (Berkeley) 6/4/93";
-static const char rcsid[] = "$Id: mktemp.c,v 1.1.352.1 2005/04/27 05:00:43 sra Exp $";
-#endif /* LIBC_SCCS and not lint */
-
-/*
- * Copyright (c) 1987, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#include "port_before.h"
-
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#include <ctype.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <stdio.h>
-
-#include "port_after.h"
-
-#if (!defined(NEED_MKTEMP)) && (!defined(NEED_MKSTEMP))
-int __mktemp_unneeded__;
-#else
-
-static int gettemp(char *path, int *doopen);
-
-#ifdef NEED_MKSTEMP
-mkstemp(char *path) {
- int fd;
-
- return (gettemp(path, &fd) ? fd : -1);
-}
-#endif
-
-#ifdef NEED_MKTEMP
-char *
-mktemp(char *path) {
- return(gettemp(path, (int *)NULL) ? path : (char *)NULL);
-}
-#endif
-
-static int
-gettemp(char *path, int *doopen) {
- char *start, *trv;
- struct stat sbuf;
- u_int pid;
-
- pid = getpid();
- for (trv = path; *trv; ++trv); /*%< extra X's get set to 0's */
- while (*--trv == 'X') {
- *trv = (pid % 10) + '0';
- pid /= 10;
- }
-
- /*
- * check the target directory; if you have six X's and it
- * doesn't exist this runs for a *very* long time.
- */
- for (start = trv + 1;; --trv) {
- if (trv <= path)
- break;
- if (*trv == '/') {
- *trv = '\0';
- if (stat(path, &sbuf))
- return(0);
- if (!S_ISDIR(sbuf.st_mode)) {
- errno = ENOTDIR;
- return(0);
- }
- *trv = '/';
- break;
- }
- }
-
- for (;;) {
- if (doopen) {
- if ((*doopen =
- open(path, O_CREAT|O_EXCL|O_RDWR, 0600)) >= 0)
- return(1);
- if (errno != EEXIST)
- return(0);
- }
- else if (stat(path, &sbuf))
- return(errno == ENOENT ? 1 : 0);
-
- /* tricky little algorithm for backward compatibility */
- for (trv = start;;) {
- if (!*trv)
- return(0);
- if (*trv == 'z')
- *trv++ = 'a';
- else {
- if (isdigit(*trv))
- *trv = 'a';
- else
- ++*trv;
- break;
- }
- }
- }
- /*NOTREACHED*/
-}
-
-#endif /*NEED_MKTEMP*/
-
-/*! \file */
diff --git a/lib/bind/bsd/putenv.c b/lib/bind/bsd/putenv.c
deleted file mode 100644
index dca02c10e6b4..000000000000
--- a/lib/bind/bsd/putenv.c
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef LINT
-static const char rcsid[] = "$Id: putenv.c,v 1.1.352.1 2005/04/27 05:00:43 sra Exp $";
-#endif
-
-#include "port_before.h"
-#include "port_after.h"
-
-/*%
- * To give a little credit to Sun, SGI,
- * and many vendors in the SysV world.
- */
-
-#if !defined(NEED_PUTENV)
-int __bindcompat_putenv;
-#else
-int
-putenv(char *str) {
- char *tmp;
-
- for (tmp = str; *tmp && (*tmp != '='); tmp++)
- ;
-
- return (setenv(str, tmp, 1));
-}
-#endif
-
-/*! \file */
diff --git a/lib/bind/bsd/readv.c b/lib/bind/bsd/readv.c
deleted file mode 100644
index eb13bccd0130..000000000000
--- a/lib/bind/bsd/readv.c
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef LINT
-static const char rcsid[] = "$Id: readv.c,v 1.1.352.1 2005/04/27 05:00:43 sra Exp $";
-#endif
-
-#include "port_before.h"
-
-#include <sys/types.h>
-#include <sys/uio.h>
-#include <sys/stat.h>
-#include <sys/socket.h>
-
-#include "port_after.h"
-
-#ifndef NEED_READV
-int __bindcompat_readv;
-#else
-
-int
-__readv(fd, vp, vpcount)
- int fd;
- const struct iovec *vp;
- int vpcount;
-{
- int count = 0;
-
- while (vpcount-- > 0) {
- int bytes = read(fd, vp->iov_base, vp->iov_len);
-
- if (bytes < 0)
- return (-1);
- count += bytes;
- if (bytes != vp->iov_len)
- break;
- vp++;
- }
- return (count);
-}
-#endif /* NEED_READV */
-/*! \file */
diff --git a/lib/bind/bsd/setenv.c b/lib/bind/bsd/setenv.c
deleted file mode 100644
index ce2f06398151..000000000000
--- a/lib/bind/bsd/setenv.c
+++ /dev/null
@@ -1,151 +0,0 @@
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char sccsid[] = "@(#)setenv.c 8.1 (Berkeley) 6/4/93";
-static const char rcsid[] = "$Id: setenv.c,v 1.1.352.1 2005/04/27 05:00:44 sra Exp $";
-#endif /* LIBC_SCCS and not lint */
-
-/*
- * Copyright (c) 1987, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "port_before.h"
-
-#include <stddef.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "port_after.h"
-
-#if !defined(NEED_SETENV)
-int __bindcompat_setenv;
-#else
-
-extern char **environ;
-
-static char *findenv(const char *name, int *offset);
-
-/*%
- * setenv --
- * Set the value of the environmental variable "name" to be
- * "value". If rewrite is set, replace any current value.
- */
-setenv(const char *name, const char *value, int rewrite) {
- extern char **environ;
- static int alloced; /*%< if allocated space before */
- char *c;
- int l_value, offset;
-
- if (*value == '=') /*%< no `=' in value */
- ++value;
- l_value = strlen(value);
- if ((c = findenv(name, &offset))) { /*%< find if already exists */
- if (!rewrite)
- return (0);
- if (strlen(c) >= l_value) { /*%< old larger; copy over */
- while (*c++ = *value++);
- return (0);
- }
- } else { /*%< create new slot */
- int cnt;
- char **p;
-
- for (p = environ, cnt = 0; *p; ++p, ++cnt);
- if (alloced) { /*%< just increase size */
- environ = (char **)realloc((char *)environ,
- (size_t)(sizeof(char *) * (cnt + 2)));
- if (!environ)
- return (-1);
- }
- else { /*%< get new space */
- alloced = 1; /*%< copy old entries into it */
- p = malloc((size_t)(sizeof(char *) * (cnt + 2)));
- if (!p)
- return (-1);
- memcpy(p, environ, cnt * sizeof(char *));
- environ = p;
- }
- environ[cnt + 1] = NULL;
- offset = cnt;
- }
- for (c = (char *)name; *c && *c != '='; ++c); /*%< no `=' in name */
- if (!(environ[offset] = /*%< name + `=' + value */
- malloc((size_t)((int)(c - name) + l_value + 2))))
- return (-1);
- for (c = environ[offset]; (*c = *name++) && *c != '='; ++c);
- for (*c++ = '='; *c++ = *value++;);
- return (0);
-}
-
-/*%
- * unsetenv(name) --
- * Delete environmental variable "name".
- */
-void
-unsetenv(const char *name) {
- char **p;
- int offset;
-
- while (findenv(name, &offset)) /*%< if set multiple times */
- for (p = &environ[offset];; ++p)
- if (!(*p = *(p + 1)))
- break;
-}
-
-/*%
- * findenv --
- * Returns pointer to value associated with name, if any, else NULL.
- * Sets offset to be the offset of the name/value combination in the
- * environmental array, for use by setenv(3) and unsetenv(3).
- * Explicitly removes '=' in argument name.
- *
- * This routine *should* be a static; don't use it.
- */
-static char *
-findenv(const char *name, int *offset) {
- const char *np;
- char **p, *c;
- int len;
-
- if (name == NULL || environ == NULL)
- return (NULL);
- for (np = name; *np && *np != '='; ++np)
- continue;
- len = np - name;
- for (p = environ; (c = *p) != NULL; ++p)
- if (strncmp(c, name, len) == 0 && c[len] == '=') {
- *offset = p - environ;
- return (c + len + 1);
- }
- return (NULL);
-}
-#endif
-
-/*! \file */
diff --git a/lib/bind/bsd/setitimer.c b/lib/bind/bsd/setitimer.c
deleted file mode 100644
index 2d5a4e4cb57f..000000000000
--- a/lib/bind/bsd/setitimer.c
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef LINT
-static const char rcsid[] = "$Id: setitimer.c,v 1.1.352.1 2005/04/27 05:00:44 sra Exp $";
-#endif
-
-#include "port_before.h"
-
-#include <sys/time.h>
-
-#include "port_after.h"
-
-/*%
- * Setitimer emulation routine.
- */
-#ifndef NEED_SETITIMER
-int __bindcompat_setitimer;
-#else
-
-int
-__setitimer(int which, const struct itimerval *value,
- struct itimerval *ovalue)
-{
- if (alarm(value->it_value.tv_sec) >= 0)
- return (0);
- else
- return (-1);
-}
-#endif
-
-/*! \file */
diff --git a/lib/bind/bsd/strcasecmp.c b/lib/bind/bsd/strcasecmp.c
deleted file mode 100644
index fd768373e834..000000000000
--- a/lib/bind/bsd/strcasecmp.c
+++ /dev/null
@@ -1,124 +0,0 @@
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char sccsid[] = "@(#)strcasecmp.c 8.1 (Berkeley) 6/4/93";
-static const char rcsid[] = "$Id: strcasecmp.c,v 1.1.352.1 2005/04/27 05:00:45 sra Exp $";
-#endif /* LIBC_SCCS and not lint */
-
-/*
- * Copyright (c) 1987, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "port_before.h"
-
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/cdefs.h>
-
-#include <string.h>
-
-#include "port_after.h"
-
-#ifndef NEED_STRCASECMP
-int __strcasecmp_unneeded__;
-#else
-
-/*%
- * This array is designed for mapping upper and lower case letter
- * together for a case independent comparison. The mappings are
- * based upon ascii character sequences.
- */
-static const u_char charmap[] = {
- 0000, 0001, 0002, 0003, 0004, 0005, 0006, 0007,
- 0010, 0011, 0012, 0013, 0014, 0015, 0016, 0017,
- 0020, 0021, 0022, 0023, 0024, 0025, 0026, 0027,
- 0030, 0031, 0032, 0033, 0034, 0035, 0036, 0037,
- 0040, 0041, 0042, 0043, 0044, 0045, 0046, 0047,
- 0050, 0051, 0052, 0053, 0054, 0055, 0056, 0057,
- 0060, 0061, 0062, 0063, 0064, 0065, 0066, 0067,
- 0070, 0071, 0072, 0073, 0074, 0075, 0076, 0077,
- 0100, 0141, 0142, 0143, 0144, 0145, 0146, 0147,
- 0150, 0151, 0152, 0153, 0154, 0155, 0156, 0157,
- 0160, 0161, 0162, 0163, 0164, 0165, 0166, 0167,
- 0170, 0171, 0172, 0133, 0134, 0135, 0136, 0137,
- 0140, 0141, 0142, 0143, 0144, 0145, 0146, 0147,
- 0150, 0151, 0152, 0153, 0154, 0155, 0156, 0157,
- 0160, 0161, 0162, 0163, 0164, 0165, 0166, 0167,
- 0170, 0171, 0172, 0173, 0174, 0175, 0176, 0177,
- 0200, 0201, 0202, 0203, 0204, 0205, 0206, 0207,
- 0210, 0211, 0212, 0213, 0214, 0215, 0216, 0217,
- 0220, 0221, 0222, 0223, 0224, 0225, 0226, 0227,
- 0230, 0231, 0232, 0233, 0234, 0235, 0236, 0237,
- 0240, 0241, 0242, 0243, 0244, 0245, 0246, 0247,
- 0250, 0251, 0252, 0253, 0254, 0255, 0256, 0257,
- 0260, 0261, 0262, 0263, 0264, 0265, 0266, 0267,
- 0270, 0271, 0272, 0273, 0274, 0275, 0276, 0277,
- 0300, 0301, 0302, 0303, 0304, 0305, 0306, 0307,
- 0310, 0311, 0312, 0313, 0314, 0315, 0316, 0317,
- 0320, 0321, 0322, 0323, 0324, 0325, 0326, 0327,
- 0330, 0331, 0332, 0333, 0334, 0335, 0336, 0337,
- 0340, 0341, 0342, 0343, 0344, 0345, 0346, 0347,
- 0350, 0351, 0352, 0353, 0354, 0355, 0356, 0357,
- 0360, 0361, 0362, 0363, 0364, 0365, 0366, 0367,
- 0370, 0371, 0372, 0373, 0374, 0375, 0376, 0377
-};
-
-int
-strcasecmp(const char *s1, const char *s2) {
- const u_char *cm = charmap,
- *us1 = (const u_char *)s1,
- *us2 = (const u_char *)s2;
-
- while (cm[*us1] == cm[*us2++])
- if (*us1++ == '\0')
- return (0);
- return (cm[*us1] - cm[*--us2]);
-}
-
-int
-strncasecmp(const char *s1, const char *s2, size_t n) {
- if (n != 0) {
- const u_char *cm = charmap,
- *us1 = (const u_char *)s1,
- *us2 = (const u_char *)s2;
-
- do {
- if (cm[*us1] != cm[*us2++])
- return (cm[*us1] - cm[*--us2]);
- if (*us1++ == '\0')
- break;
- } while (--n != 0);
- }
- return (0);
-}
-
-#endif /*NEED_STRCASECMP*/
-
-/*! \file */
diff --git a/lib/bind/bsd/strdup.c b/lib/bind/bsd/strdup.c
deleted file mode 100644
index a8d31e958722..000000000000
--- a/lib/bind/bsd/strdup.c
+++ /dev/null
@@ -1,20 +0,0 @@
-#include "port_before.h"
-
-#include <stdlib.h>
-
-#include "port_after.h"
-
-#ifndef NEED_STRDUP
-int __bind_strdup_unneeded;
-#else
-char *
-strdup(const char *src) {
- char *dst = malloc(strlen(src) + 1);
-
- if (dst)
- strcpy(dst, src);
- return (dst);
-}
-#endif
-
-/*! \file */
diff --git a/lib/bind/bsd/strerror.c b/lib/bind/bsd/strerror.c
deleted file mode 100644
index 325cd5204425..000000000000
--- a/lib/bind/bsd/strerror.c
+++ /dev/null
@@ -1,94 +0,0 @@
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char sccsid[] = "@(#)strerror.c 8.1 (Berkeley) 6/4/93";
-static const char rcsid[] = "$Id: strerror.c,v 1.4.332.2 2008/02/18 04:04:06 marka Exp $";
-#endif /* LIBC_SCCS and not lint */
-
-/*
- * 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.
- */
-
-#include "port_before.h"
-
-#include <sys/param.h>
-#include <sys/types.h>
-
-#include <string.h>
-
-#include "port_after.h"
-
-#ifndef NEED_STRERROR
-int __strerror_unneeded__;
-#else
-
-#ifdef USE_SYSERROR_LIST
-extern int sys_nerr;
-extern char *sys_errlist[];
-#endif
-
-const char *
-isc_strerror(int num) {
-#define UPREFIX "Unknown error: "
- static char ebuf[40] = UPREFIX; /*%< 64-bit number + slop */
- u_int errnum;
- char *p, *t;
-#ifndef USE_SYSERROR_LIST
- const char *ret;
-#endif
- char tmp[40];
-
- errnum = num; /*%< convert to unsigned */
-#ifdef USE_SYSERROR_LIST
- if (errnum < (u_int)sys_nerr)
- return (sys_errlist[errnum]);
-#else
-#undef strerror
- ret = strerror(num); /*%< call strerror() in libc */
- if (ret != NULL)
- return(ret);
-#endif
-
- /* 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;
- }
- return (ebuf);
-}
-
-#endif /*NEED_STRERROR*/
-
-/*! \file */
diff --git a/lib/bind/bsd/strpbrk.c b/lib/bind/bsd/strpbrk.c
deleted file mode 100644
index 45025726e568..000000000000
--- a/lib/bind/bsd/strpbrk.c
+++ /dev/null
@@ -1,70 +0,0 @@
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char sccsid[] = "@(#)strpbrk.c 8.1 (Berkeley) 6/4/93";
-static const char rcsid[] = "$Id: strpbrk.c,v 1.1.352.1 2005/04/27 05:00:46 sra Exp $";
-#endif /* LIBC_SCCS and not lint */
-
-/*
- * Copyright (c) 1985, 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.
- */
-
-#include "port_before.h"
-
-#include <sys/param.h>
-#include <sys/cdefs.h>
-
-#include <string.h>
-
-#include "port_after.h"
-
-#ifndef NEED_STRPBRK
-int __strpbrk_unneeded__;
-#else
-
-/*%
- * Find the first occurrence in s1 of a character in s2 (excluding NUL).
- */
-char *
-strpbrk(const char *s1, const char *s2) {
- const char *scanp;
- int c, sc;
-
- while ((c = *s1++) != 0) {
- for (scanp = s2; (sc = *scanp++) != 0;)
- if (sc == c)
- return ((char *)(s1 - 1));
- }
- return (NULL);
-}
-
-#endif /*NEED_STRPBRK*/
-
-/*! \file */
diff --git a/lib/bind/bsd/strsep.c b/lib/bind/bsd/strsep.c
deleted file mode 100644
index 1214f80363fc..000000000000
--- a/lib/bind/bsd/strsep.c
+++ /dev/null
@@ -1,88 +0,0 @@
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char sccsid[] = "strsep.c 8.1 (Berkeley) 6/4/93";
-static const char rcsid[] = "$Id: strsep.c,v 1.1.352.1 2005/04/27 05:00:47 sra Exp $";
-#endif /* LIBC_SCCS and not lint */
-
-/*
- * Copyright (c) 1990, 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.
- */
-
-#include "port_before.h"
-#include <sys/cdefs.h>
-#include <string.h>
-#include <stdio.h>
-#include "port_after.h"
-
-#ifndef NEED_STRSEP
-int __strsep_unneeded__;
-#else
-
-/*%
- * Get next token from string *stringp, where tokens are possibly-empty
- * strings separated by characters from delim.
- *
- * Writes NULs into the string at *stringp to end tokens.
- * delim need not remain constant from call to call.
- * On return, *stringp points past the last NUL written (if there might
- * be further tokens), or is NULL (if there are definitely no more tokens).
- *
- * If *stringp is NULL, strsep returns NULL.
- */
-char *
-strsep(char **stringp, const char *delim) {
- char *s;
- const char *spanp;
- int c, sc;
- char *tok;
-
- if ((s = *stringp) == NULL)
- return (NULL);
- for (tok = s;;) {
- c = *s++;
- spanp = delim;
- do {
- if ((sc = *spanp++) == c) {
- if (c == 0)
- s = NULL;
- else
- s[-1] = 0;
- *stringp = s;
- return (tok);
- }
- } while (sc != 0);
- }
- /* NOTREACHED */
-}
-
-#endif /*NEED_STRSEP*/
-
-/*! \file */
diff --git a/lib/bind/bsd/strtoul.c b/lib/bind/bsd/strtoul.c
deleted file mode 100644
index c2efeda197cf..000000000000
--- a/lib/bind/bsd/strtoul.c
+++ /dev/null
@@ -1,119 +0,0 @@
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char sccsid[] = "@(#)strtoul.c 8.1 (Berkeley) 6/4/93";
-static const char rcsid[] = "$Id: strtoul.c,v 1.2.164.2 2008/02/18 04:04:06 marka Exp $";
-#endif /* LIBC_SCCS and not lint */
-
-/*
- * Copyright (c) 1990, 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.
- */
-
-#include "port_before.h"
-
-#include <sys/types.h>
-#include <sys/param.h>
-
-#include <ctype.h>
-#include <errno.h>
-#include <limits.h>
-#include <stdlib.h>
-
-#include "port_after.h"
-
-#ifndef NEED_STRTOUL
-int __strtoul_unneeded__;
-#else
-
-/*%
- * Convert a string to an unsigned long integer.
- *
- * Ignores `locale' stuff. Assumes that the upper and lower case
- * alphabets and digits are each contiguous.
- */
-u_long
-strtoul(const char *nptr, char **endptr, int base) {
- const char *s = nptr;
- u_long acc, cutoff;
- int neg, c, any, cutlim;
-
- neg = 0;
-
- /*
- * See strtol for comments as to the logic used.
- */
- do {
- c = *(const unsigned char *)s++;
- } while (isspace(c));
- if (c == '-') {
- neg = 1;
- c = *s++;
- } else if (c == '+')
- c = *s++;
- if ((base == 0 || base == 16) &&
- c == '0' && (*s == 'x' || *s == 'X')) {
- c = s[1];
- s += 2;
- base = 16;
- }
- if (base == 0)
- base = c == '0' ? 8 : 10;
- cutoff = (u_long)ULONG_MAX / (u_long)base;
- cutlim = (u_long)ULONG_MAX % (u_long)base;
- for (acc = 0, any = 0;; c = *(const unsigned char*)s++) {
- if (isdigit(c))
- c -= '0';
- else if (isalpha(c))
- c -= isupper(c) ? 'A' - 10 : 'a' - 10;
- else
- break;
- if (c >= base)
- break;
- if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim))
- any = -1;
- else {
- any = 1;
- acc *= base;
- acc += c;
- }
- }
- if (any < 0) {
- acc = ULONG_MAX;
- errno = ERANGE;
- } else if (neg)
- acc = -acc;
- if (endptr != 0)
- DE_CONST((any ? s - 1 : nptr), *endptr);
- return (acc);
-}
-
-#endif /*NEED_STRTOUL*/
-
-/*! \file */
diff --git a/lib/bind/bsd/utimes.c b/lib/bind/bsd/utimes.c
deleted file mode 100644
index 2f65cffe2598..000000000000
--- a/lib/bind/bsd/utimes.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * Copyright (c) 1997,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 ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
- * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include "port_before.h"
-
-#include <sys/types.h>
-#include <sys/time.h>
-#include <utime.h>
-
-#include "port_after.h"
-
-#ifndef NEED_UTIMES
-int __bind_utimes_unneeded;
-#else
-
-int
-__utimes(char *filename, struct timeval *tvp) {
- struct utimbuf utb;
-
- utb.actime = (time_t)tvp[0].tv_sec;
- utb.modtime = (time_t)tvp[1].tv_sec;
- return (utime(filename, &utb));
-}
-
-#endif /* NEED_UTIMES */
-/*! \file */
diff --git a/lib/bind/bsd/writev.c b/lib/bind/bsd/writev.c
deleted file mode 100644
index 0e81c260c938..000000000000
--- a/lib/bind/bsd/writev.c
+++ /dev/null
@@ -1,89 +0,0 @@
-#ifndef LINT
-static const char rcsid[] = "$Id: writev.c,v 1.2.164.1 2005/04/27 05:00:47 sra Exp $";
-#endif
-
-#include "port_before.h"
-
-#include <sys/types.h>
-#include <sys/uio.h>
-#include <sys/stat.h>
-#include <sys/socket.h>
-
-#include "port_after.h"
-
-#ifndef NEED_WRITEV
-int __bindcompat_writev;
-#else
-
-#ifdef _CRAY
-#define OWN_WRITEV
-int
-__writev(int fd, struct iovec *iov, int iovlen)
-{
- struct stat statbuf;
-
- if (fstat(fd, &statbuf) < 0)
- return (-1);
-
- /*
- * Allow for atomic writes to network.
- */
- if (statbuf.st_mode & S_IFSOCK) {
- struct msghdr mesg;
-
- memset(&mesg, 0, sizeof(mesg));
- mesg.msg_name = 0;
- mesg.msg_namelen = 0;
- mesg.msg_iov = iov;
- mesg.msg_iovlen = iovlen;
- mesg.msg_accrights = 0;
- mesg.msg_accrightslen = 0;
- return (sendmsg(fd, &mesg, 0));
- } else {
- struct iovec *tv;
- int i, rcode = 0, count = 0;
-
- for (i = 0, tv = iov; i <= iovlen; tv++) {
- rcode = write(fd, tv->iov_base, tv->iov_len);
-
- if (rcode < 0)
- break;
-
- count += rcode;
- }
-
- if (count == 0)
- return (rcode);
- else
- return (count);
- }
-}
-
-#else /*_CRAY*/
-
-int
-__writev(fd, vp, vpcount)
- int fd;
- const struct iovec *vp;
- int vpcount;
-{
- int count = 0;
-
- while (vpcount-- > 0) {
- int written = write(fd, vp->iov_base, vp->iov_len);
-
- if (written < 0)
- return (-1);
- count += written;
- if (written != vp->iov_len)
- break;
- vp++;
- }
- return (count);
-}
-
-#endif /*_CRAY*/
-
-#endif /*NEED_WRITEV*/
-
-/*! \file */
diff --git a/lib/bind/config.h.in b/lib/bind/config.h.in
deleted file mode 100644
index 5e2a83defbd7..000000000000
--- a/lib/bind/config.h.in
+++ /dev/null
@@ -1,68 +0,0 @@
-#undef _SOCKADDR_LEN
-#undef HAVE_FCNTL_H
-#undef HAVE_PATHS_H
-#undef HAVE_INTTYPES_H
-#undef HAVE_STROPTS_H
-#undef HAVE_SYS_TIMERS_H
-#undef HAVE_SYS_SELECT_H
-#undef HAVE_MEMORY_H
-#undef SYS_CDEFS_H
-#undef _POSIX_PTHREAD_SEMANTICS
-#undef POSIX_GETPWUID_R
-#undef POSIX_GETPWNAM_R
-#undef POSIX_GETGRGID_R
-#undef POSIX_GETGRNAM_R
-#undef HAVE_MEMMOVE
-#undef HAVE_MEMCHR
-#undef SPRINTF_CHAR
-#undef VSPRINTF_CHAR
-#undef USE_SYSERROR_LIST
-#undef NEED_STRTOUL
-#undef NEED_SUN4PROTOS
-#undef REENABLE_SEND
-
-#undef NEED_SETGROUPENT
-#undef NEED_GETGROUPLIST
-
-/* define if prototype for getgrnam_r() is required */
-#undef NEED_GETGRNAM_R
-#undef NEED_GETGRGID_R
-#undef NEED_GETGRENT_R
-#undef NEED_SETGRENT_R
-#undef NEED_ENDGRENT_R
-
-#undef NEED_INNETGR_R
-#undef NEED_SETNETGRENT_R
-#undef NEED_ENDNETGRENT_R
-
-#undef NEED_GETPWNAM_R
-#undef NEED_GETPWUID_R
-#undef NEED_SETPWENT_R
-#undef NEED_SETPASSENT_R
-#undef NEED_SETPWENT_R
-#undef NEED_GETPWENT_R
-#undef NEED_ENDPWENT_R
-
-#undef NEED_SETPASSENT
-
-#undef HAS_PW_CLASS
-
-#undef ssize_t
-#undef uintptr_t
-
-/* Shut up warnings about sputaux in stdio.h on BSD/OS pre-4.1 */
-#undef SHUTUP_SPUTAUX
-#ifdef SHUTUP_SPUTAUX
-struct __sFILE;
-extern __inline int __sputaux(int _c, struct __sFILE *_p);
-#endif
-#undef BROKEN_IN6ADDR_INIT_MACROS
-#undef HAVE_STRLCAT
-/* Shut up warnings about missing braces */
-#undef SHUTUP_MUTEX_INITIALIZER
-#ifdef SHUTUP_MUTEX_INITIALIZER
-#define LIBBIND_MUTEX_INITIALIZER { PTHREAD_MUTEX_INITIALIZER }
-#else
-#define LIBBIND_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
-#endif
-
diff --git a/lib/bind/configure.in b/lib/bind/configure.in
deleted file mode 100644
index 9b9b53b81cb4..000000000000
--- a/lib/bind/configure.in
+++ /dev/null
@@ -1,2872 +0,0 @@
-# Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
-# Copyright (C) 2001, 2003 Internet Software Consortium.
-#
-# Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS. IN NO EVENT SHALL ISC 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.
-
-AC_REVISION($Revision: 1.90.18.43 $)
-
-AC_INIT(resolv/herror.c)
-AC_PREREQ(2.13)
-
-AC_CONFIG_HEADER(config.h)
-
-AC_CANONICAL_HOST
-
-AC_PROG_MAKE_SET
-AC_PROG_RANLIB
-AC_PROG_INSTALL
-
-AC_SUBST(STD_CINCLUDES)
-AC_SUBST(STD_CDEFINES)
-AC_SUBST(STD_CWARNINGS)
-AC_SUBST(CCOPT)
-
-AC_PATH_PROG(AR, ar)
-ARFLAGS="cruv"
-AC_SUBST(AR)
-AC_SUBST(ARFLAGS)
-
-# The POSIX ln(1) program. Non-POSIX systems may substitute
-# "copy" or something.
-LN=ln
-AC_SUBST(LN)
-
-case "$AR" in
- "")
- AC_MSG_ERROR([
-ar program not found. Please fix your PATH to include the directory in
-which ar resides, or set AR in the environment with the full path to ar.
-])
-
- ;;
-esac
-
-#
-# Etags.
-#
-AC_PATH_PROGS(ETAGS, etags emacs-etags)
-
-#
-# Some systems, e.g. RH7, have the Exuberant Ctags etags instead of
-# GNU emacs etags, and it requires the -L flag.
-#
-if test "X$ETAGS" != "X"; then
- AC_MSG_CHECKING(for Exuberant Ctags etags)
- if $ETAGS --version 2>&1 | grep 'Exuberant Ctags' >/dev/null 2>&1; then
- AC_MSG_RESULT(yes)
- ETAGS="$ETAGS -L"
- else
- AC_MSG_RESULT(no)
- fi
-fi
-AC_SUBST(ETAGS)
-
-#
-# Perl is optional; it is used only by some of the system test scripts.
-#
-AC_PATH_PROGS(PERL, perl5 perl)
-AC_SUBST(PERL)
-
-#
-# isc/list.h and others clash with the rest of BIND 9
-#
-case "$includedir" in
- '${prefix}/include')
- includedir='${prefix}/bind/include'
- ;;
-esac
-case "$libdir" in
- '${prefix}/lib')
- libdir='${prefix}/bind/lib'
- ;;
-esac
-
-#
-# Make sure INSTALL uses an absolute path, else it will be wrong in all
-# Makefiles, since they use make/rules.in and INSTALL will be adjusted by
-# configure based on the location of the file where it is substituted.
-# Since in BIND9 INSTALL is only substituted into make/rules.in, an immediate
-# subdirectory of install-sh, This relative path will be wrong for all
-# directories more than one level down from install-sh.
-#
-case "$INSTALL" in
- /*)
- ;;
- *)
- #
- # Not all systems have dirname.
- #
- changequote({, })
- ac_dir="`echo $INSTALL | sed 's%/[^/]*$%%'`"
- changequote([, ])
-
- ac_prog="`echo $INSTALL | sed 's%.*/%%'`"
- test "$ac_dir" = "$ac_prog" && ac_dir=.
- test -d "$ac_dir" && ac_dir="`(cd \"$ac_dir\" && pwd)`"
- INSTALL="$ac_dir/$ac_prog"
- ;;
-esac
-
-#
-# On these hosts, we really want to use cc, not gcc, even if it is
-# found. The gcc that these systems have will not correctly handle
-# pthreads.
-#
-# However, if the user sets $CC to be something, let that override
-# our change.
-#
-if test "X$CC" = "X" ; then
- case "$host" in
- *-dec-osf*)
- CC="cc"
- ;;
- *-solaris*)
- # Use Sun's cc if it is available, but watch
- # out for /usr/ucb/cc; it will never be the right
- # compiler to use.
- #
- # If setting CC here fails, the AC_PROG_CC done
- # below might still find gcc.
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- case "$ac_dir" in
- /usr/ucb)
- # exclude
- ;;
- *)
- if test -f "$ac_dir/cc"; then
- CC="$ac_dir/cc"
- break
- fi
- ;;
- esac
- done
- IFS="$ac_save_ifs"
- ;;
- *-hp-hpux*)
- CC="cc"
- ;;
- mips-sgi-irix*)
- CC="cc"
- ;;
- esac
-fi
-
-
-AC_PROG_CC
-
-AC_HEADER_STDC
-
-
-AC_CHECK_HEADERS(fcntl.h db.h paths.h sys/time.h unistd.h sys/sockio.h sys/select.h sys/timers.h stropts.h memory.h)
-
-AC_C_CONST
-AC_C_INLINE
-AC_TYPE_SIZE_T
-AC_CHECK_TYPE(ssize_t,signed)
-AC_CHECK_TYPE(uintptr_t,unsigned long)
-AC_HEADER_TIME
-#
-# check if we need to #include sys/select.h explicitly
-#
-case $ac_cv_header_unistd_h in
-yes)
-AC_MSG_CHECKING(if unistd.h defines fd_set)
-AC_TRY_COMPILE([
-#include <unistd.h>],
-[fd_set read_set; return (0);],
- [AC_MSG_RESULT(yes)
- ISC_PLATFORM_NEEDSYSSELECTH="#undef ISC_PLATFORM_NEEDSYSSELECTH"
- ],
- [AC_MSG_RESULT(no)
- case ac_cv_header_sys_select_h in
- yes)
- ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
- ;;
- no)
- AC_MSG_ERROR([need either working unistd.h or sys/select.h])
- ;;
- esac
- ])
- ;;
-no)
- case ac_cv_header_sys_select_h in
- yes)
- ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
- ;;
- no)
- AC_MSG_ERROR([need either unistd.h or sys/select.h])
- ;;
- esac
- ;;
-esac
-AC_SUBST(ISC_PLATFORM_NEEDSYSSELECTH)
-
-#
-# Find the machine's endian flavor.
-#
-AC_C_BIGENDIAN
-
-AC_ARG_WITH(irs-gr,[ --with-irs-gr Build ....],
-want_irs_gr="$withval", want_irs_gr="no")
-case "$want_irs_gr" in
-yes) WANT_IRS_GR="#define WANT_IRS_GR 1"
- WANT_IRS_GR_OBJS="\${WANT_IRS_GR_OBJS}"
- ;;
-*) WANT_IRS_GR="#undef WANT_IRS_GR" WANT_IRS_GR_OBJS="";;
-esac
-AC_SUBST(WANT_IRS_GR)
-AC_SUBST(WANT_IRS_GR_OBJS)
-
-AC_ARG_WITH(irs-pw,[ --with-irs-pw Build ....],
-want_irs_pw="$withval", want_irs_pw="no")
-case "$want_irs_pw" in
-yes) WANT_IRS_PW="#define WANT_IRS_PW 1"
- WANT_IRS_PW_OBJS="\${WANT_IRS_PW_OBJS}";;
-*) WANT_IRS_PW="#undef WANT_IRS_PW" WANT_IRS_PW_OBJS="";;
-esac
-AC_SUBST(WANT_IRS_PW)
-AC_SUBST(WANT_IRS_PW_OBJS)
-
-AC_ARG_WITH(irs-nis,[ --with-irs-nis Build ....],
-want_irs_nis="$withval", want_irs_nis="no")
-case "$want_irs_nis" in
-yes)
- WANT_IRS_NIS="#define WANT_IRS_NIS 1"
- WANT_IRS_NIS_OBJS="\${WANT_IRS_NIS_OBJS}"
- case "$want_irs_gr" in
- yes)
- WANT_IRS_NISGR_OBJS="\${WANT_IRS_NISGR_OBJS}";;
- *)
- WANT_IRS_NISGR_OBJS="";;
- esac
- case "$want_irs_pw" in
- yes)
- WANT_IRS_NISPW_OBJS="\${WANT_IRS_NISPW_OBJS}";;
- *)
- WANT_IRS_NISPW_OBJS="";;
- esac
- ;;
-*)
- WANT_IRS_NIS="#undef WANT_IRS_NIS"
- WANT_IRS_NIS_OBJS=""
- WANT_IRS_NISGR_OBJS=""
- WANT_IRS_NISPW_OBJS="";;
-esac
-AC_SUBST(WANT_IRS_NIS)
-AC_SUBST(WANT_IRS_NIS_OBJS)
-AC_SUBST(WANT_IRS_NISGR_OBJS)
-AC_SUBST(WANT_IRS_NISPW_OBJS)
-AC_TRY_RUN([
-#ifdef HAVE_DB_H
-int have_db_h = 1;
-#else
-int have_db_h = 0;
-#endif
-main() { return(!have_db_h); }
-],
-WANT_IRS_DBPW_OBJS="\${WANT_IRS_DBPW_OBJS}"
-,
-WANT_IRS_DBPW_OBJS=""
-,
-WANT_IRS_DBPW_OBJS=""
-)
-AC_SUBST(WANT_IRS_DBPW_OBJS)
-
-#
-# was --with-randomdev specified?
-#
-AC_MSG_CHECKING(for random device)
-AC_ARG_WITH(randomdev,
-[ --with-randomdev=PATH Specify path for random device],
- use_randomdev="$withval", use_randomdev="unspec")
-
-case "$use_randomdev" in
- unspec)
- case "$host" in
- *-openbsd*)
- devrandom=/dev/srandom
- ;;
- *)
- devrandom=/dev/random
- ;;
- esac
- AC_MSG_RESULT($devrandom)
- AC_CHECK_FILE($devrandom,
- AC_DEFINE_UNQUOTED(PATH_RANDOMDEV,
- "$devrandom"),)
- ;;
- yes)
- AC_MSG_ERROR([--with-randomdev must specify a path])
- ;;
- *)
- AC_DEFINE_UNQUOTED(PATH_RANDOMDEV, "$use_randomdev")
- AC_MSG_RESULT(using "$use_randomdev")
- ;;
-esac
-
-sinclude(../../config.threads.in)dnl
-
-if $use_threads
-then
- if test "X$GCC" = "Xyes"; then
- case "$host" in
- *-freebsd*)
- CC="$CC -pthread"
- CCOPT="$CCOPT -pthread"
- STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
- ;;
- *-openbsd*)
- CC="$CC -pthread"
- CCOPT="$CCOPT -pthread"
- ;;
- *-solaris*)
- LIBS="$LIBS -lthread"
- ;;
- *-ibm-aix*)
- STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
- ;;
- esac
- else
- case $host in
- *-dec-osf*)
- CC="$CC -pthread"
- CCOPT="$CCOPT -pthread"
- ;;
- *-solaris*)
- CC="$CC -mt"
- CCOPT="$CCOPT -mt"
- ;;
- *-ibm-aix*)
- STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
- ;;
- *-UnixWare*)
- CC="$CC -Kthread"
- CCOPT="$CCOPT -Kthread"
- ;;
- esac
- fi
- AC_DEFINE(_REENTRANT)
- ALWAYS_DEFINES="-D_REENTRANT"
- DO_PTHREADS="#define DO_PTHREADS 1"
- WANT_IRS_THREADSGR_OBJS="\${WANT_IRS_THREADSGR_OBJS}"
- WANT_IRS_THREADSPW_OBJS="\${WANT_IRS_THREADSPW_OBJS}"
- case $host in
- ia64-hp-hpux11.*)
- WANT_IRS_THREADS_OBJS="";;
- *)
- WANT_IRS_THREADS_OBJS="\${WANT_IRS_THREADS_OBJS}";;
- esac
- WANT_THREADS_OBJS="\${WANT_THREADS_OBJS}"
- thread_dir=pthreads
-
- #
- # We'd like to use sigwait() too
- #
- AC_CHECK_FUNC(sigwait,
- AC_DEFINE(HAVE_SIGWAIT),
- AC_CHECK_LIB(c, sigwait,
- AC_DEFINE(HAVE_SIGWAIT),
- AC_CHECK_LIB(pthread, sigwait,
- AC_DEFINE(HAVE_SIGWAIT),
- AC_CHECK_LIB(pthread, _Psigwait,
- AC_DEFINE(HAVE_SIGWAIT),))))
-
- AC_CHECK_FUNC(pthread_attr_getstacksize,
- AC_DEFINE(HAVE_PTHREAD_ATTR_GETSTACKSIZE),)
-
- #
- # Additional OS-specific issues related to pthreads and sigwait.
- #
- case "$host" in
- #
- # One more place to look for sigwait.
- #
- *-freebsd*)
- AC_CHECK_LIB(c_r, sigwait, AC_DEFINE(HAVE_SIGWAIT),)
- ;;
- #
- # BSDI 3.0 through 4.0.1 needs pthread_init() to be
- # called before certain pthreads calls. This is deprecated
- # in BSD/OS 4.1.
- #
- *-bsdi3.*|*-bsdi4.0*)
- AC_DEFINE(NEED_PTHREAD_INIT)
- ;;
- #
- # LinuxThreads requires some changes to the way we
- # deal with signals.
- #
- *-linux*)
- AC_DEFINE(HAVE_LINUXTHREADS)
- ;;
- #
- # Ensure the right sigwait() semantics on Solaris and make
- # sure we call pthread_setconcurrency.
- #
- *-solaris*)
- AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
- AC_CHECK_FUNC(pthread_setconcurrency,
- AC_DEFINE(CALL_PTHREAD_SETCONCURRENCY))
- AC_DEFINE(POSIX_GETPWUID_R)
- AC_DEFINE(POSIX_GETPWNAM_R)
- AC_DEFINE(POSIX_GETGRGID_R)
- AC_DEFINE(POSIX_GETGRNAM_R)
- ;;
- *hpux11*)
- AC_DEFINE(NEED_ENDNETGRENT_R)
- AC_DEFINE(_PTHREADS_DRAFT4)
- ;;
- #
- # UnixWare does things its own way.
- #
- *-UnixWare*)
- AC_DEFINE(HAVE_UNIXWARE_SIGWAIT)
- ;;
- esac
-
- #
- # Look for sysconf to allow detection of the number of processors.
- #
- AC_CHECK_FUNC(sysconf, AC_DEFINE(HAVE_SYSCONF),)
-
-else
- ALWAYS_DEFINES=""
- DO_PTHREADS="#undef DO_PTHREADS"
- WANT_IRS_THREADSGR_OBJS=""
- WANT_IRS_THREADSPW_OBJS=""
- WANT_IRS_THREADS_OBJS=""
- WANT_THREADS_OBJS=""
- thread_dir=nothreads
-fi
-
-AC_SUBST(ALWAYS_DEFINES)
-AC_SUBST(DO_PTHREADS)
-AC_SUBST(WANT_IRS_THREADSGR_OBJS)
-AC_SUBST(WANT_IRS_THREADSPW_OBJS)
-AC_SUBST(WANT_IRS_THREADS_OBJS)
-AC_SUBST(WANT_THREADS_OBJS)
-
-AC_CHECK_FUNC(strlcat, AC_DEFINE(HAVE_STRLCAT))
-AC_CHECK_FUNC(memmove, AC_DEFINE(HAVE_MEMMOVE))
-AC_CHECK_FUNC(memchr, AC_DEFINE(HAVE_MEMCHR))
-AC_CHECK_FUNC(strtoul, , AC_DEFINE(NEED_STRTOUL))
-
-AC_CHECK_FUNC(if_nametoindex,
- [USE_IFNAMELINKID="#define USE_IFNAMELINKID 1"],
- [USE_IFNAMELINKID="#undef USE_IFNAMELINKID"])
-AC_SUBST(USE_IFNAMELINKID)
-
-ISC_THREAD_DIR=$thread_dir
-AC_SUBST(ISC_THREAD_DIR)
-
-AC_CHECK_FUNC(daemon,
-[DAEMON_OBJS="" NEED_DAEMON="#undef NEED_DAEMON"]
-,
-[DAEMON_OBJS="\${DAEMON_OBJS}" NEED_DAEMON="#define NEED_DAEMON 1"]
-)
-AC_SUBST(DAEMON_OBJS)
-AC_SUBST(NEED_DAEMON)
-
-AC_CHECK_FUNC(strsep,
-[STRSEP_OBJS="" NEED_STRSEP="#undef NEED_STRSEP"]
-,
-[STRSEP_OBJS="\${STRSEP_OBJS}" NEED_STRSEP="#define NEED_STRSEP 1"]
-)
-AC_SUBST(STRSEP_OBJS)
-AC_SUBST(NEED_STRSEP)
-
-AC_CHECK_FUNC(strerror, [NEED_STRERROR="#undef NEED_STRERROR"],
-[NEED_STRERROR="#define NEED_STRERROR 1"])
-AC_SUBST(NEED_STRERROR)
-
-if test -n "$NEED_STRERROR"
-then
- AC_MSG_CHECKING([for extern char * sys_errlist[]])
- AC_TRY_LINK([ extern int sys_nerr; extern char *sys_errlist[]; ],
- [ const char *p = sys_errlist[0]; ],
- AC_MSG_RESULT(yes)
- AC_DEFINE(USE_SYSERROR_LIST),
- AC_MSG_RESULT(no))
-fi
-
-#
-# flockfile is usually provided by pthreads, but we may want to use it
-# even if compiled with --disable-threads.
-#
-AC_CHECK_FUNC(flockfile, AC_DEFINE(HAVE_FLOCKFILE),)
-
-#
-# Indicate what the final decision was regarding threads.
-#
-AC_MSG_CHECKING(whether to build with threads)
-if $use_threads; then
- AC_MSG_RESULT(yes)
-else
- AC_MSG_RESULT(no)
-fi
-
-#
-# End of pthreads stuff.
-#
-
-#
-# Additional compiler settings.
-#
-MKDEPCC="$CC"
-MKDEPCFLAGS="-M"
-IRIX_DNSSEC_WARNINGS_HACK=""
-
-if test "X$GCC" = "Xyes"; then
- AC_MSG_CHECKING(if "$CC" supports -fno-strict-aliasing)
- SAVE_CFLAGS=$CFLAGS
- CFLAGS=-fno-strict-aliasing
- AC_TRY_COMPILE(,, [FNOSTRICTALIASING=yes],[FNOSTRICTALIASING=no])
- CFLAGS=$SAVE_CFLAGS
- if test "$FNOSTRICTALIASING" = "yes"; then
- AC_MSG_RESULT(yes)
- STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith -fno-strict-aliasing"
- else
- AC_MSG_RESULT(no)
- STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith"
- fi
-else
- case $host in
- *-dec-osf*)
- CC="$CC -std"
- CCOPT="$CCOPT -std"
- MKDEPCC="$CC"
- ;;
- *-hp-hpux*)
- CC="$CC -Ae -z"
- # The version of the C compiler that constantly warns about
- # 'const' as well as alignment issues is unfortunately not
- # able to be discerned via the version of the operating
- # system, nor does cc have a version flag.
- case "`$CC +W 123 2>&1`" in
- *Unknown?option*)
- STD_CWARNINGS="+w1"
- ;;
- *)
- # Turn off the pointlessly noisy warnings.
- STD_CWARNINGS="+w1 +W 474,530,2193,2236"
- ;;
- esac
- CCOPT="$CCOPT -Ae -z"
- LIBS="-Wl,+vnocompatwarnings $LIBS"
-MKDEPPROG='cc -Ae -E -Wp,-M >/dev/null 2>&1 | awk '"'"'BEGIN {colon=0; rec="";} { for (i = 0 ; i < NF; i++) { if (colon && a[$i]) continue; if ($i == "\\") continue; if (!colon) { rec = $i continue; } if ($i == ":") { rec = rec " :" colon = 1 continue; } if (length(rec $i) > 76) { print rec " \\"; rec = "\t" $i; a[$i] = 1; } else { rec = rec " " $i a[$i] = 1; } } } END {print rec}'"'"' >>$TMP'
- MKDEPPROG='cc -Ae -E -Wp,-M >/dev/null 2>>$TMP'
- ;;
- *-sgi-irix*)
- STD_CWARNINGS="-fullwarn -woff 1209"
- #
- # Silence more than 250 instances of
- # "prototyped function redeclared without prototype"
- # and 11 instances of
- # "variable ... was set but never used"
- # from lib/dns/sec/openssl.
- #
- IRIX_DNSSEC_WARNINGS_HACK="-woff 1692,1552"
- ;;
- *-solaris*)
- MKDEPCFLAGS="-xM"
- ;;
- *-UnixWare*)
- CC="$CC -w"
- ;;
- esac
-fi
-
-#
-# _GNU_SOURCE is needed to access the fd_bits field of struct fd_set, which
-# is supposed to be opaque.
-#
-case $host in
- *linux*)
- STD_CDEFINES="$STD_CDEFINES -D_GNU_SOURCE"
- ;;
-esac
-
-AC_SUBST(MKDEPCC)
-AC_SUBST(MKDEPCFLAGS)
-AC_SUBST(MKDEPPROG)
-AC_SUBST(IRIX_DNSSEC_WARNINGS_HACK)
-
-#
-# NLS
-#
-AC_CHECK_FUNC(catgets, AC_DEFINE(HAVE_CATGETS),)
-
-#
-# -lxnet buys us one big porting headache... standards, gotta love 'em.
-#
-# AC_CHECK_LIB(xnet, socket, ,
-# AC_CHECK_LIB(socket, socket)
-# AC_CHECK_LIB(nsl, inet_ntoa)
-# )
-#
-# Use this for now, instead:
-#
-case "$host" in
- mips-sgi-irix*)
- ;;
- ia64-hp-hpux11.*)
- AC_CHECK_LIB(socket, socket)
- AC_CHECK_LIB(nsl, inet_ntoa)
- ;;
- *)
- AC_CHECK_LIB(d4r, gethostbyname_r)
- AC_CHECK_LIB(socket, socket)
- AC_CHECK_LIB(nsl, inet_ntoa)
- ;;
-esac
-
-#
-# Purify support
-#
-AC_MSG_CHECKING(whether to use purify)
-AC_ARG_WITH(purify,
- [ --with-purify[=PATH] use Rational purify],
- use_purify="$withval", use_purify="no")
-
-case "$use_purify" in
- no)
- ;;
- yes)
- AC_PATH_PROG(purify_path, purify, purify)
- ;;
- *)
- purify_path="$use_purify"
- ;;
-esac
-
-case "$use_purify" in
- no)
- AC_MSG_RESULT(no)
- PURIFY=""
- ;;
- *)
- if test -f $purify_path || test $purify_path = purify; then
- AC_MSG_RESULT($purify_path)
- PURIFYFLAGS="`echo $PURIFYOPTIONS`"
- PURIFY="$purify_path $PURIFYFLAGS"
- else
- AC_MSG_ERROR([$purify_path not found.
-
-Please choose the proper path with the following command:
-
- configure --with-purify=PATH
-])
- fi
- ;;
-esac
-
-AC_SUBST(PURIFY)
-
-#
-# GNU libtool support
-#
-case $host in
-sunos*)
- # Just set the maximum command line length for sunos as it otherwise
- # takes a exceptionally long time to work it out. Required for libtool.
- lt_cv_sys_max_cmd_len=4096;
- ;;
-esac
-
-AC_ARG_WITH(libtool,
- [ --with-libtool use GNU libtool (following indented options supported)],
- use_libtool="$withval", use_libtool="no")
-
-case $use_libtool in
- yes)
- AM_PROG_LIBTOOL
- O=lo
- A=la
- LIBTOOL_MKDEP_SED='s;\.o;\.lo;'
- LIBTOOL_MODE_COMPILE='--mode=compile'
- LIBTOOL_MODE_INSTALL='--mode=install'
- LIBTOOL_MODE_LINK='--mode=link'
- ;;
- *)
- O=o
- A=a
- LIBTOOL=
- AC_SUBST(LIBTOOL)
- LIBTOOL_MKDEP_SED=
- LIBTOOL_MODE_COMPILE=
- LIBTOOL_MODE_INSTALL=
- LIBTOOL_MODE_LINK=
- ;;
-esac
-
-#
-# File name extension for static archive files, for those few places
-# where they are treated differently from dynamic ones.
-#
-SA=a
-
-AC_SUBST(O)
-AC_SUBST(A)
-AC_SUBST(SA)
-AC_SUBST(LIBTOOL_MKDEP_SED)
-AC_SUBST(LIBTOOL_MODE_COMPILE)
-AC_SUBST(LIBTOOL_MODE_INSTALL)
-AC_SUBST(LIBTOOL_MODE_LINK)
-
-#
-# Here begins a very long section to determine the system's networking
-# capabilities. The order of the tests is signficant.
-#
-
-#
-# IPv6
-#
-AC_ARG_ENABLE(ipv6,
- [ --enable-ipv6 use IPv6 [default=autodetect]])
-
-case "$enable_ipv6" in
- yes|''|autodetect)
- AC_DEFINE(WANT_IPV6)
- ;;
- no)
- ;;
-esac
-
-#
-# We do the IPv6 compilation checking after libtool so that we can put
-# the right suffix on the files.
-#
-AC_MSG_CHECKING(for IPv6 structures)
-AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>],
-[struct sockaddr_in6 sin6; return (0);],
- [AC_MSG_RESULT(yes)
- found_ipv6=yes],
- [AC_MSG_RESULT(no)
- found_ipv6=no])
-
-#
-# See whether IPv6 support is provided via a Kame add-on.
-# This is done before other IPv6 linking tests to LIBS is properly set.
-#
-AC_MSG_CHECKING(for Kame IPv6 support)
-AC_ARG_WITH(kame,
- [ --with-kame[=PATH] use Kame IPv6 [default path /usr/local/v6]],
- use_kame="$withval", use_kame="no")
-
-case "$use_kame" in
- no)
- ;;
- yes)
- kame_path=/usr/local/v6
- ;;
- *)
- kame_path="$use_kame"
- ;;
-esac
-
-case "$use_kame" in
- no)
- AC_MSG_RESULT(no)
- ;;
- *)
- if test -f $kame_path/lib/libinet6.a; then
- AC_MSG_RESULT($kame_path/lib/libinet6.a)
- LIBS="-L$kame_path/lib -linet6 $LIBS"
- else
- AC_MSG_ERROR([$kame_path/lib/libinet6.a not found.
-
-Please choose the proper path with the following command:
-
- configure --with-kame=PATH
-])
- fi
- ;;
-esac
-
-#
-# Whether netinet6/in6.h is needed has to be defined in isc/platform.h.
-# Including it on Kame-using platforms is very bad, though, because
-# Kame uses #error against direct inclusion. So include it on only
-# the platform that is otherwise broken without it -- BSD/OS 4.0 through 4.1.
-# This is done before the in6_pktinfo check because that's what
-# netinet6/in6.h is needed for.
-#
-changequote({, })
-case "$host" in
-*-bsdi4.[01]*)
- ISC_PLATFORM_NEEDNETINET6IN6H="#define ISC_PLATFORM_NEEDNETINET6IN6H 1"
- isc_netinet6in6_hack="#include <netinet6/in6.h>"
- ;;
-*)
- ISC_PLATFORM_NEEDNETINET6IN6H="#undef ISC_PLATFORM_NEEDNETINET6IN6H"
- isc_netinet6in6_hack=""
- ;;
-esac
-changequote([, ])
-
-#
-# This is similar to the netinet6/in6.h issue.
-#
-case "$host" in
-*-UnixWare*)
- ISC_PLATFORM_NEEDNETINETIN6H="#define ISC_PLATFORM_NEEDNETINETIN6H 1"
- ISC_PLATFORM_FIXIN6ISADDR="#define ISC_PLATFORM_FIXIN6ISADDR 1"
- isc_netinetin6_hack="#include <netinet/in6.h>"
- ;;
-*)
- ISC_PLATFORM_NEEDNETINETIN6H="#undef ISC_PLATFORM_NEEDNETINETIN6H"
- ISC_PLATFORM_FIXIN6ISADDR="#undef ISC_PLATFORM_FIXIN6ISADDR"
- isc_netinetin6_hack=""
- ;;
-esac
-
-#
-# Now delve deeper into the suitability of the IPv6 support.
-#
-case "$found_ipv6" in
- yes)
- HAS_INET6_STRUCTS="#define HAS_INET6_STRUCTS 1"
-
- AC_MSG_CHECKING(for in6_addr)
- AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-$isc_netinetin6_hack
-$isc_netinet6in6_hack
-],
-[struct in6_addr in6; return (0);],
- [AC_MSG_RESULT(yes)
- HAS_IN_ADDR6="#undef HAS_IN_ADDR6"
- isc_in_addr6_hack=""],
- [AC_MSG_RESULT(no)
- HAS_IN_ADDR6="#define HAS_IN_ADDR6 1"
- isc_in_addr6_hack="#define in6_addr in_addr6"])
-
- AC_MSG_CHECKING(for in6addr_any)
- AC_TRY_LINK([
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-$isc_netinetin6_hack
-$isc_netinet6in6_hack
-$isc_in_addr6_hack
-],
- [struct in6_addr in6; in6 = in6addr_any; return (0);],
- [AC_MSG_RESULT(yes)
- NEED_IN6ADDR_ANY="#undef NEED_IN6ADDR_ANY"],
- [AC_MSG_RESULT(no)
- NEED_IN6ADDR_ANY="#define NEED_IN6ADDR_ANY 1"])
-
- AC_MSG_CHECKING(for sin6_scope_id in struct sockaddr_in6)
- AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-$isc_netinetin6_hack
-$isc_netinet6in6_hack
-],
- [struct sockaddr_in6 xyzzy; xyzzy.sin6_scope_id = 0; return (0);],
- [AC_MSG_RESULT(yes)
- result="#define HAVE_SIN6_SCOPE_ID 1"],
- [AC_MSG_RESULT(no)
- result="#undef HAVE_SIN6_SCOPE_ID"])
- HAVE_SIN6_SCOPE_ID="$result"
-
- AC_MSG_CHECKING(for in6_pktinfo)
- AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-$isc_netinetin6_hack
-$isc_netinet6in6_hack
-],
- [struct in6_pktinfo xyzzy; return (0);],
- [AC_MSG_RESULT(yes)
- ISC_PLATFORM_HAVEIN6PKTINFO="#define ISC_PLATFORM_HAVEIN6PKTINFO 1"],
- [AC_MSG_RESULT(no -- disabling runtime ipv6 support)
- ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO"])
- ;;
- no)
- HAS_INET6_STRUCTS="#undef HAS_INET6_STRUCTS"
- NEED_IN6ADDR_ANY="#undef NEED_IN6ADDR_ANY"
- ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO"
- HAVE_SIN6_SCOPE_ID="#define HAVE_SIN6_SCOPE_ID 1"
- ISC_IPV6_H="ipv6.h"
- ISC_IPV6_O="ipv6.$O"
- ISC_ISCIPV6_O="unix/ipv6.$O"
- ISC_IPV6_C="ipv6.c"
- ;;
-esac
-
-AC_MSG_CHECKING(for sockaddr_storage)
-AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-],
-[struct sockaddr_storage xyzzy; return (0);],
- [AC_MSG_RESULT(yes)
- HAVE_SOCKADDR_STORAGE="#define HAVE_SOCKADDR_STORAGE 1"],
- [AC_MSG_RESULT(no)
- HAVE_SOCKADDR_STORAGE="#undef HAVE_SOCKADDR_STORAGE"])
-
-AC_SUBST(HAS_INET6_STRUCTS)
-AC_SUBST(ISC_PLATFORM_NEEDNETINETIN6H)
-AC_SUBST(ISC_PLATFORM_NEEDNETINET6IN6H)
-AC_SUBST(HAS_IN_ADDR6)
-AC_SUBST(NEED_IN6ADDR_ANY)
-AC_SUBST(ISC_PLATFORM_HAVEIN6PKTINFO)
-AC_SUBST(ISC_PLATFORM_FIXIN6ISADDR)
-AC_SUBST(ISC_IPV6_H)
-AC_SUBST(ISC_IPV6_O)
-AC_SUBST(ISC_ISCIPV6_O)
-AC_SUBST(ISC_IPV6_C)
-AC_SUBST(HAVE_SIN6_SCOPE_ID)
-AC_SUBST(HAVE_SOCKADDR_STORAGE)
-
-#
-# Check for network functions that are often missing. We do this
-# after the libtool checking, so we can put the right suffix on
-# the files. It also needs to come after checking for a Kame add-on,
-# which provides some (all?) of the desired functions.
-#
-AC_MSG_CHECKING([for inet_ntop])
-AC_TRY_LINK([
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>],
- [inet_ntop(0, 0, 0, 0); return (0);],
- [AC_MSG_RESULT(yes)
- ISC_PLATFORM_NEEDNTOP="#undef ISC_PLATFORM_NEEDNTOP"],
-
- [AC_MSG_RESULT(no)
- ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_ntop.$O"
- ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_ntop.c"
- ISC_PLATFORM_NEEDNTOP="#define ISC_PLATFORM_NEEDNTOP 1"])
-AC_MSG_CHECKING([for inet_pton])
-AC_TRY_LINK([
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>],
- [inet_pton(0, 0, 0); return (0);],
- [AC_MSG_RESULT(yes)
- ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"],
-
- [AC_MSG_RESULT(no)
- ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_pton.$O"
- ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_pton.c"
- ISC_PLATFORM_NEEDPTON="#define ISC_PLATFORM_NEEDPTON 1"])
-AC_MSG_CHECKING([for inet_aton])
-AC_TRY_LINK([
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>],
- [struct in_addr in; inet_aton(0, &in); return (0);],
- [AC_MSG_RESULT(yes)
- ISC_PLATFORM_NEEDATON="#undef ISC_PLATFORM_NEEDATON"],
-
- [AC_MSG_RESULT(no)
- ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_aton.$O"
- ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_aton.c"
- ISC_PLATFORM_NEEDATON="#define ISC_PLATFORM_NEEDATON 1"])
-
-AC_SUBST(ISC_PLATFORM_NEEDNTOP)
-AC_SUBST(ISC_PLATFORM_NEEDPTON)
-AC_SUBST(ISC_PLATFORM_NEEDATON)
-
-#
-# Look for a 4.4BSD-style sa_len member in struct sockaddr.
-#
-case "$host" in
- *-dec-osf*)
- # Tru64 broke send() by defining it to send_OBSOLETE
- AC_DEFINE(REENABLE_SEND)
- # Turn on 4.4BSD style sa_len support.
- AC_DEFINE(_SOCKADDR_LEN)
- ;;
-esac
-
-AC_MSG_CHECKING(for sa_len in struct sockaddr)
-AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <sys/socket.h>],
-[struct sockaddr sa; sa.sa_len = 0; return (0);],
- [AC_MSG_RESULT(yes)
- HAVE_SA_LEN="#define HAVE_SA_LEN 1"],
- [AC_MSG_RESULT(no)
- HAVE_SA_LEN="#undef HAVE_SA_LEN"])
-AC_SUBST(HAVE_SA_LEN)
-
-# HAVE_MINIMUM_IFREQ
-
-case "$host" in
- *-bsdi[2345]*) have_minimum_ifreq=yes;;
- *-darwin*) have_minimum_ifreq=yes;;
- *-freebsd*) have_minimum_ifreq=yes;;
- *-lynxos*) have_minimum_ifreq=yes;;
- *-netbsd*) have_minimum_ifreq=yes;;
- *-next*) have_minimum_ifreq=yes;;
- *-openbsd*) have_minimum_ifreq=yes;;
- *-rhapsody*) have_minimum_ifreq=yes;;
-esac
-
-case "$have_minimum_ifreq" in
- yes)
- HAVE_MINIMUM_IFREQ="#define HAVE_MINIMUM_IFREQ 1";;
- no)
- HAVE_MINIMUM_IFREQ="#undef HAVE_MINIMUM_IFREQ";;
- *)
- HAVE_MINIMUM_IFREQ="#undef HAVE_MINIMUM_IFREQ";;
-esac
-AC_SUBST(HAVE_MINIMUM_IFREQ)
-
-# PORT_DIR
-PORT_DIR=port/unknown
-SOLARIS_BITTYPES="#undef NEED_SOLARIS_BITTYPES"
-BSD_COMP="#undef BSD_COMP"
-USE_FIONBIO_IOCTL="#undef USE_FIONBIO_IOCTL"
-PORT_NONBLOCK="#define PORT_NONBLOCK O_NONBLOCK"
-HAVE_MD5="#undef HAVE_MD5"
-USE_POLL="#undef HAVE_POLL"
-SOLARIS2="#undef SOLARIS2"
-case "$host" in
- *aix3.2*) PORT_DIR="port/aix32";;
- *aix4*) PORT_DIR="port/aix4";;
- *aix5*) PORT_DIR="port/aix5";;
- *aux3*) PORT_DIR="port/aux3";;
- *-bsdi2*) PORT_DIR="port/bsdos2";;
- *-bsdi*) PORT_DIR="port/bsdos";;
- *-cygwin*)
- PORT_NONBLOCK="#define PORT_NONBLOCK O_NDELAY"
- PORT_DIR="port/cygwin";;
- *-darwin*) PORT_DIR="port/darwin";;
- *-osf*) PORT_DIR="port/decunix";;
- *-freebsd*) PORT_DIR="port/freebsd";;
- *-hpux9*) PORT_DIR="port/hpux9";;
- *-hpux10*) PORT_DIR="port/hpux10";;
- *-hpux11*) PORT_DIR="port/hpux";;
- *-irix*) PORT_DIR="port/irix";;
- *-linux*) PORT_DIR="port/linux";;
- *-lynxos*) PORT_DIR="port/lynxos";;
- *-mpe*) PORT_DIR="port/mpe";;
- *-netbsd*) PORT_DIR="port/netbsd";;
- *-next*) PORT_DIR="port/next";;
- *-openbsd*) PORT_DIR="port/openbsd";;
- *-qnx*) PORT_DIR="port/qnx";;
- *-rhapsody*) PORT_DIR="port/rhapsody";;
- *-sunos4*)
- AC_DEFINE(NEED_SUN4PROTOS)
- PORT_NONBLOCK="#define PORT_NONBLOCK O_NDELAY"
- PORT_DIR="port/sunos";;
- *-solaris2.[[01234]])
- BSD_COMP="#define BSD_COMP 1"
- SOLARIS_BITTYPES="#define NEED_SOLARIS_BITTYPES 1"
- USE_FIONBIO_IOCTL="#define USE_FIONBIO_IOCTL 1"
- SOLARIS2="#define SOLARIS2 1"
- PORT_DIR="port/solaris";;
- *-solaris2.5)
- BSD_COMP="#define BSD_COMP 1"
- SOLARIS_BITTYPES="#define NEED_SOLARIS_BITTYPES 1"
- SOLARIS2="#define SOLARIS2 1"
- PORT_DIR="port/solaris";;
- *-solaris2.[[67]])
- BSD_COMP="#define BSD_COMP 1"
- SOLARIS2="#define SOLARIS2 1"
- PORT_DIR="port/solaris";;
- *-solaris2*) BSD_COMP="#define BSD_COMP 1"
- USE_POLL="#define USE_POLL 1"
- HAVE_MD5="#define HAVE_MD5 1"
- SOLARIS2="#define SOLARIS2 1"
- PORT_DIR="port/solaris";;
- *-ultrix*) PORT_DIR="port/ultrix";;
- *-sco-sysv*uw2.0*) PORT_DIR="port/unixware20";;
- *-sco-sysv*uw2.1.2*) PORT_DIR="port/unixware212";;
- *-sco-sysv*uw7*) PORT_DIR="port/unixware7";;
-esac
-
-AC_SUBST(BSD_COMP)
-AC_SUBST(SOLARIS_BITTYPES)
-AC_SUBST(USE_FIONBIO_IOCTL)
-AC_SUBST(PORT_NONBLOCK)
-AC_SUBST(PORT_DIR)
-AC_SUBST(USE_POLL)
-AC_SUBST(HAVE_MD5)
-AC_SUBST(SOLARIS2)
-PORT_INCLUDE=${PORT_DIR}/include
-AC_SUBST(PORT_INCLUDE)
-
-#
-# Look for a 4.4BSD or 4.3BSD struct msghdr
-#
-AC_MSG_CHECKING(for struct msghdr flavor)
-AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <sys/socket.h>],
-[struct msghdr msg; msg.msg_flags = 0; return (0);],
- [AC_MSG_RESULT(4.4BSD)
- ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD44MSGHDR 1"],
- [AC_MSG_RESULT(4.3BSD)
- ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD43MSGHDR 1"])
-AC_SUBST(ISC_PLATFORM_MSGHDRFLAVOR)
-
-#
-# Look for in_port_t.
-#
-AC_MSG_CHECKING(for type in_port_t)
-AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <netinet/in.h>],
-[in_port_t port = 25; return (0);],
- [AC_MSG_RESULT(yes)
- ISC_PLATFORM_NEEDPORTT="#undef ISC_PLATFORM_NEEDPORTT"],
- [AC_MSG_RESULT(no)
- ISC_PLATFORM_NEEDPORTT="#define ISC_PLATFORM_NEEDPORTT 1"])
-AC_SUBST(ISC_PLATFORM_NEEDPORTT)
-
-AC_MSG_CHECKING(for struct timespec)
-AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <time.h>],
-[struct timespec ts = { 0, 0 }; return (0);],
- [AC_MSG_RESULT(yes)
- ISC_PLATFORM_NEEDTIMESPEC="#undef ISC_PLATFORM_NEEDTIMESPEC"],
- [AC_MSG_RESULT(no)
- ISC_PLATFORM_NEEDTIMESPEC="#define ISC_PLATFORM_NEEDTIMESPEC 1"])
-AC_SUBST(ISC_PLATFORM_NEEDTIMESPEC)
-
-#
-# Check for addrinfo
-#
-AC_MSG_CHECKING(for struct addrinfo)
-AC_TRY_COMPILE([
-#include <netdb.h>],
-[struct addrinfo a; return (0);],
- [AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_ADDRINFO)],
- [AC_MSG_RESULT(no)])
-
-AC_MSG_CHECKING(for int sethostent)
-AC_TRY_COMPILE([
-#include <netdb.h>],
-[int i = sethostent(0); return(0);],
- [AC_MSG_RESULT(yes)],
- [AC_MSG_RESULT(no)])
-
-AC_MSG_CHECKING(for int endhostent)
-AC_TRY_COMPILE([
-#include <netdb.h>],
-[int i = endhostent(); return(0);],
- [AC_MSG_RESULT(yes)
- ISC_LWRES_ENDHOSTENTINT="#define ISC_LWRES_ENDHOSTENTINT 1"],
- [AC_MSG_RESULT(no)
- ISC_LWRES_ENDHOSTENTINT="#undef ISC_LWRES_ENDHOSTENTINT"])
-AC_SUBST(ISC_LWRES_ENDHOSTENTINT)
-
-AC_MSG_CHECKING(for int setnetent)
-AC_TRY_COMPILE([
-#include <netdb.h>],
-[int i = setnetent(0); return(0);],
- [AC_MSG_RESULT(yes)
- ISC_LWRES_SETNETENTINT="#define ISC_LWRES_SETNETENTINT 1"],
- [AC_MSG_RESULT(no)
- ISC_LWRES_SETNETENTINT="#undef ISC_LWRES_SETNETENTINT"])
-AC_SUBST(ISC_LWRES_SETNETENTINT)
-
-AC_MSG_CHECKING(for int endnetent)
-AC_TRY_COMPILE([
-#include <netdb.h>],
-[int i = endnetent(); return(0);],
- [AC_MSG_RESULT(yes)
- ISC_LWRES_ENDNETENTINT="#define ISC_LWRES_ENDNETENTINT 1"],
- [AC_MSG_RESULT(no)
- ISC_LWRES_ENDNETENTINT="#undef ISC_LWRES_ENDNETENTINT"])
-AC_SUBST(ISC_LWRES_ENDNETENTINT)
-
-AC_MSG_CHECKING(for gethostbyaddr(const void *, size_t, ...))
-AC_TRY_COMPILE([
-#include <netdb.h>
-struct hostent *gethostbyaddr(const void *, size_t, int);],
-[return(0);],
- [AC_MSG_RESULT(yes)
- ISC_LWRES_GETHOSTBYADDRVOID="#define ISC_LWRES_GETHOSTBYADDRVOID 1"],
- [AC_MSG_RESULT(no)
- ISC_LWRES_GETHOSTBYADDRVOID="#undef ISC_LWRES_GETHOSTBYADDRVOID"])
-AC_SUBST(ISC_LWRES_GETHOSTBYADDRVOID)
-
-AC_MSG_CHECKING(for h_errno in netdb.h)
-AC_TRY_COMPILE([
-#include <netdb.h>],
-[h_errno = 1; return(0);],
- [AC_MSG_RESULT(yes)
- ISC_LWRES_NEEDHERRNO="#undef ISC_LWRES_NEEDHERRNO"],
- [AC_MSG_RESULT(no)
- ISC_LWRES_NEEDHERRNO="#define ISC_LWRES_NEEDHERRNO 1"])
-AC_SUBST(ISC_LWRES_NEEDHERRNO)
-
-AC_CHECK_FUNC(getipnodebyname,
- [ISC_LWRES_GETIPNODEPROTO="#undef ISC_LWRES_GETIPNODEPROTO"],
- [ISC_LWRES_GETIPNODEPROTO="#define ISC_LWRES_GETIPNODEPROTO 1"])
-AC_CHECK_FUNC(getnameinfo,
- [ISC_LWRES_GETNAMEINFOPROTO="#undef ISC_LWRES_GETNAMEINFOPROTO"],
- [ISC_LWRES_GETNAMEINFOPROTO="#define ISC_LWRES_GETNAMEINFOPROTO 1"])
-AC_CHECK_FUNC(getaddrinfo,
- [ISC_LWRES_GETADDRINFOPROTO="#undef ISC_LWRES_GETADDRINFOPROTO"
- AC_DEFINE(HAVE_GETADDRINFO)],
- [ISC_LWRES_GETADDRINFOPROTO="#define ISC_LWRES_GETADDRINFOPROTO 1"])
-AC_CHECK_FUNC(gai_strerror, AC_DEFINE(HAVE_GAISTRERROR))
-AC_SUBST(ISC_LWRES_GETIPNODEPROTO)
-AC_SUBST(ISC_LWRES_GETADDRINFOPROTO)
-AC_SUBST(ISC_LWRES_GETNAMEINFOPROTO)
-AC_CHECK_FUNC(pselect,
- [NEED_PSELECT="#undef NEED_PSELECT"],
- [NEED_PSELECT="#define NEED_PSELECT"])
-AC_SUBST(NEED_PSELECT)
-AC_CHECK_FUNC(gettimeofday,
- [NEED_GETTIMEOFDAY="#undef NEED_GETTIMEOFDAY"],
- [NEED_GETTIMEOFDAY="#define NEED_GETTIMEOFDAY 1"])
-AC_SUBST(NEED_GETTIMEOFDAY)
-AC_CHECK_FUNC(strndup,
- [HAVE_STRNDUP="#define HAVE_STRNDUP 1"],
- [HAVE_STRNDUP="#undef HAVE_STRNDUP"])
-AC_SUBST(HAVE_STRNDUP)
-
-#
-# Look for a sysctl call to get the list of network interfaces.
-#
-AC_MSG_CHECKING(for interface list sysctl)
-AC_EGREP_CPP(found_rt_iflist, [
-#include <sys/param.h>
-#include <sys/sysctl.h>
-#include <sys/socket.h>
-#ifdef NET_RT_IFLIST
-found_rt_iflist
-#endif
-],
- [AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_IFLIST_SYSCTL)],
- [AC_MSG_RESULT(no)])
-
-#
-# Check for some other useful functions that are not ever-present.
-#
-AC_CHECK_FUNC(strsep,
- [ISC_PLATFORM_NEEDSTRSEP="#undef ISC_PLATFORM_NEEDSTRSEP"],
- [ISC_PLATFORM_NEEDSTRSEP="#define ISC_PLATFORM_NEEDSTRSEP 1"])
-
-
-AC_MSG_CHECKING(for char *sprintf)
-AC_TRY_COMPILE([
-#include <stdio.h>
-],
-[ char buf[2]; return(*sprintf(buf,"x"));],
-AC_DEFINE(SPRINTF_CHAR)
-AC_MSG_RESULT(yes)
-,
-AC_MSG_RESULT(no)
-)
-
-AC_MSG_CHECKING(for char *vsprintf)
-case $host in
-*sunos4*) # not decared in any header file.
-AC_DEFINE(VSPRINTF_CHAR)
-AC_MSG_RESULT(yes)
-;;
-*)
-AC_TRY_COMPILE([
-#include <stdio.h>
-],
-[ char buf[2]; return(*vsprintf(buf,"x"));],
-AC_DEFINE(VSPRINTF_CHAR)
-AC_MSG_RESULT(yes)
-,
-AC_MSG_RESULT(no)
-)
-;;
-esac
-
-AC_CHECK_FUNC(vsnprintf,
- [ISC_PLATFORM_NEEDVSNPRINTF="#undef ISC_PLATFORM_NEEDVSNPRINTF"],
- [ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS print.$O"
- ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS print.c"
- ISC_PLATFORM_NEEDVSNPRINTF="#define ISC_PLATFORM_NEEDVSNPRINTF 1"])
-AC_SUBST(ISC_PLATFORM_NEEDSTRSEP)
-AC_SUBST(ISC_PLATFORM_NEEDVSNPRINTF)
-
-AC_SUBST(ISC_EXTRA_OBJS)
-AC_SUBST(ISC_EXTRA_SRCS)
-
-# Determine the printf format characters to use when printing
-# values of type isc_int64_t. We make the assumption that platforms
-# where a "long long" is the same size as a "long" (e.g., Alpha/OSF1)
-# want "%ld" and everyone else can use "%lld". Win32 uses "%I64d",
-# but that's defined elsewhere since we don't use configure on Win32.
-#
-AC_MSG_CHECKING(printf format modifier for 64-bit integers)
-AC_TRY_RUN([main() { exit(!(sizeof(long long int) == sizeof(long int))); }],
- [AC_MSG_RESULT(l)
- ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "l"'],
- [AC_MSG_RESULT(ll)
- ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'],
- [AC_MSG_RESULT(default ll)
- ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'])
-AC_SUBST(ISC_PLATFORM_QUADFORMAT)
-
-#
-# Security Stuff
-#
-AC_CHECK_FUNC(chroot, AC_DEFINE(HAVE_CHROOT))
-
-#
-# for accept, recvfrom, getpeername etc.
-#
-AC_MSG_CHECKING(for socket length type)
-AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <sys/socket.h>
-int accept(int, struct sockaddr *, socklen_t *);
-],[],
-[ISC_SOCKLEN_T="#define ISC_SOCKLEN_T socklen_t"
-AC_MSG_RESULT(socklen_t)]
-,
-AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <sys/socket.h>
-int accept(int, struct sockaddr *, unsigned int *);
-],[],
-[ISC_SOCKLEN_T="#define ISC_SOCKLEN_T unsigned int"
-AC_MSG_RESULT(unsigned int)]
-,
-AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <sys/socket.h>
-int accept(int, struct sockaddr *, unsigned long *);
-],[],
-[ISC_SOCKLEN_T="#define ISC_SOCKLEN_T unsigned long"
-AC_MSG_RESULT(unsigned long)]
-,
-AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <sys/socket.h>
-int accept(int, struct sockaddr *, long *);
-],[],
-[ISC_SOCKLEN_T="#define ISC_SOCKLEN_T long"
-AC_MSG_RESULT(long)]
-,
-ISC_SOCKLEN_T="#define ISC_SOCKLEN_T int"
-AC_MSG_RESULT(int)
-))))
-AC_SUBST(ISC_SOCKLEN_T)
-
-AC_CHECK_FUNC(getgrouplist,
-AC_TRY_COMPILE(
-[#include <unistd.h>
-int
-getgrouplist(const char *name, int basegid, int *groups, int *ngroups) {
-}
-],
-[return (0);],
-GETGROUPLIST_ARGS="#define GETGROUPLIST_ARGS const char *name, int basegid, int *groups, int *ngroups"
-,
-GETGROUPLIST_ARGS="#define GETGROUPLIST_ARGS const char *name, gid_t basegid, gid_t *groups, int *ngroups"
-),
-GETGROUPLIST_ARGS="#define GETGROUPLIST_ARGS const char *name, gid_t basegid, gid_t *groups, int *ngroups"
-AC_DEFINE(NEED_GETGROUPLIST)
-)
-AC_SUBST(GETGROUPLIST_ARGS)
-
-AC_CHECK_FUNC(setgroupent,,AC_DEFINE(NEED_SETGROUPENT))
-
-case $host in
-ia64-hp-hpux11.*)
-;;
-*)
-AC_CHECK_FUNC(getnetbyaddr_r,
-AC_TRY_COMPILE(
-[
-#undef _REENTRANT
-#define _REENTRANT
-#define _OSF_SOURCE
-#undef __USE_MISC
-#define __USE_MISC
-#include <netdb.h>
-struct netent *
-getnetbyaddr_r(long net, int type, struct netent *result, char *buffer,
-int buflen) {}
-],
-[return (0)],
-[
-NET_R_ARGS="#define NET_R_ARGS char *buf, int buflen"
-NET_R_BAD="#define NET_R_BAD NULL"
-NET_R_COPY="#define NET_R_COPY buf, buflen"
-NET_R_COPY_ARGS="#define NET_R_COPY_ARGS NET_R_ARGS"
-NET_R_OK="#define NET_R_OK nptr"
-NET_R_SETANSWER="#undef NET_R_SETANSWER"
-NET_R_RETURN="#define NET_R_RETURN struct netent *"
-GETNETBYADDR_ADDR_T="#define GETNETBYADDR_ADDR_T long"
-NETENT_DATA="#undef NETENT_DATA"
-],
-AC_TRY_COMPILE(
-[
-#undef _REENTRANT
-#define _REENTRANT
-#define _OSF_SOURCE
-#undef __USE_MISC
-#define __USE_MISC
-#include <netdb.h>
-int getnetbyaddr_r (unsigned long int, int, struct netent *,
- char *, size_t, struct netent **, int *);
-],
-[return (0)],
-[
-NET_R_ARGS="#define NET_R_ARGS char *buf, size_t buflen, struct netent **answerp, int *h_errnop"
-NET_R_BAD="#define NET_R_BAD ERANGE"
-NET_R_COPY="#define NET_R_COPY buf, buflen"
-NET_R_COPY_ARGS="#define NET_R_COPY_ARGS char *buf, size_t buflen"
-NET_R_OK="#define NET_R_OK 0"
-NET_R_SETANSWER="#define NET_R_SETANSWER 1"
-NET_R_RETURN="#define NET_R_RETURN int"
-GETNETBYADDR_ADDR_T="#define GETNETBYADDR_ADDR_T unsigned long int"
-NETENT_DATA="#undef NETENT_DATA"
-],
-AC_TRY_COMPILE(
-[
-#undef _REENTRANT
-#define _REENTRANT
-#define _OSF_SOURCE
-#undef __USE_MISC
-#define __USE_MISC
-#include <netdb.h>
-extern int getnetbyaddr_r(int, int, struct netent *, struct netent_data *);
-],
-[return (0)],
-[
-NET_R_ARGS="#define NET_R_ARGS struct netent_data *ndptr"
-NET_R_BAD="#define NET_R_BAD (-1)"
-NET_R_COPY="#define NET_R_COPY ndptr"
-NET_R_COPY_ARGS="#define NET_R_COPY_ARGS struct netent_data *ndptr"
-NET_R_OK="#define NET_R_OK 0"
-NET_R_SETANSWER="#undef NET_R_SETANSWER"
-NET_R_RETURN="#define NET_R_RETURN int"
-GETNETBYADDR_ADDR_T="#define GETNETBYADDR_ADDR_T int"
-NETENT_DATA="#define NETENT_DATA 1"
-],
-AC_TRY_COMPILE(
-#undef __USE_MISC
-#define __USE_MISC
-[#include <netdb.h>
-int getnetbyaddr_r (in_addr_t, int, struct netent *, struct netent_data *);
-],
-[return (0)],
-[
-NET_R_ARGS="#define NET_R_ARGS struct netent_data *ndptr"
-NET_R_BAD="#define NET_R_BAD (-1)"
-NET_R_COPY="#define NET_R_COPY ndptr"
-NET_R_COPY_ARGS="#define NET_R_COPY_ARGS struct netent_data *ndptr"
-NET_R_OK="#define NET_R_OK 0"
-NET_R_SETANSWER="#undef NET_R_SETANSWER"
-NET_R_RETURN="#define NET_R_RETURN int"
-GETNETBYADDR_ADDR_T="#define GETNETBYADDR_ADDR_T long"
-NETENT_DATA="#define NETENT_DATA 1"
-],
-AC_TRY_COMPILE(
-#undef __USE_MISC
-#define __USE_MISC
-[#include <netdb.h>
-int getnetbyaddr_r (long, int, struct netent *, struct netent_data *);
-],
-[return (0)],
-[
-NET_R_ARGS="#define NET_R_ARGS struct netent_data *ndptr"
-NET_R_BAD="#define NET_R_BAD (-1)"
-NET_R_COPY="#define NET_R_COPY ndptr"
-NET_R_COPY_ARGS="#define NET_R_COPY_ARGS struct netent_data *ndptr"
-NET_R_OK="#define NET_R_OK 0"
-NET_R_SETANSWER="#undef NET_R_SETANSWER"
-NET_R_RETURN="#define NET_R_RETURN int"
-GETNETBYADDR_ADDR_T="#define GETNETBYADDR_ADDR_T long"
-NETENT_DATA="#define NETENT_DATA 1"
-],
-AC_TRY_COMPILE(
-#undef __USE_MISC
-#define __USE_MISC
-[#include <netdb.h>
-int getnetbyaddr_r (uint32_t, int, struct netent *,
- char *, size_t, struct netent **, int *);
-],
-[return (0)],
-[
-NET_R_ARGS="#define NET_R_ARGS char *buf, size_t buflen, struct netent **answerp, int *h_errnop"
-NET_R_BAD="#define NET_R_BAD ERANGE"
-NET_R_COPY="#define NET_R_COPY buf, buflen"
-NET_R_COPY_ARGS="#define NET_R_COPY_ARGS char *buf, size_t buflen"
-NET_R_OK="#define NET_R_OK 0"
-NET_R_SETANSWER="#define NET_R_SETANSWER 1"
-NET_R_RETURN="#define NET_R_RETURN int"
-GETNETBYADDR_ADDR_T="#define GETNETBYADDR_ADDR_T unsigned long int"
-NETENT_DATA="#undef NETENT_DATA"
-],
-)
-)
-)
-)
-)
-)
-,
-NET_R_ARGS="#define NET_R_ARGS char *buf, int buflen"
-NET_R_BAD="#define NET_R_BAD NULL"
-NET_R_COPY="#define NET_R_COPY buf, buflen"
-NET_R_COPY_ARGS="#define NET_R_COPY_ARGS NET_R_ARGS"
-NET_R_OK="#define NET_R_OK nptr"
-NET_R_SETANSWER="#undef NET_R_SETANSWER"
-NET_R_RETURN="#define NET_R_RETURN struct netent *"
-GETNETBYADDR_ADDR_T="#define GETNETBYADDR_ADDR_T long"
-NETENT_DATA="#undef NETENT_DATA"
-)
-esac
-
-case "$host" in
-*dec-osf*) GETNETBYADDR_ADDR_T="#define GETNETBYADDR_ADDR_T int" ;;
-esac
-AC_SUBST(NET_R_ARGS)
-AC_SUBST(NET_R_BAD)
-AC_SUBST(NET_R_COPY)
-AC_SUBST(NET_R_COPY_ARGS)
-AC_SUBST(NET_R_OK)
-AC_SUBST(NET_R_SETANSWER)
-AC_SUBST(NET_R_RETURN)
-AC_SUBST(GETNETBYADDR_ADDR_T)
-AC_SUBST(NETENT_DATA)
-
-AC_CHECK_FUNC(setnetent_r,
-AC_TRY_COMPILE(
-[
-#undef __USE_MISC
-#define __USE_MISC
-#include <netdb.h>
-void setnetent_r (int);
-] ,[return (0);],[
-NET_R_ENT_ARGS="#undef NET_R_ENT_ARGS /*empty*/"
-NET_R_SET_RESULT="#undef NET_R_SET_RESULT /*empty*/"
-NET_R_SET_RETURN="#define NET_R_SET_RETURN void"
-],
-AC_TRY_COMPILE(
-[
-#define _REENTRANT
-#undef __USE_MISC
-#define __USE_MISC
-#include <netdb.h>
-extern int setnetent_r(int, struct netent_data *);
-] ,[return (0);],[
-NET_R_ENT_ARGS="#define NET_R_ENT_ARGS struct netent_data *ndptr"
-NET_R_SET_RESULT="#define NET_R_SET_RESULT NET_R_OK"
-NET_R_SET_RETURN="#define NET_R_SET_RETURN int"
-],
-)
-)
-,
-NET_R_ENT_ARGS="#undef NET_R_ENT_ARGS /*empty*/"
-NET_R_SET_RESULT="#undef NET_R_SET_RESULT /*empty*/"
-NET_R_SET_RETURN="#define NET_R_SET_RETURN void"
-)
-AC_SUBST(NET_R_ENT_ARGS)
-AC_SUBST(NET_R_SET_RESULT)
-AC_SUBST(NET_R_SET_RETURN)
-
-
-case $host in
-ia64-hp-hpux11.*)
-;;
-*)
-AC_CHECK_FUNC(endnetent_r,
-AC_TRY_COMPILE(
-[
-#undef _REENTRANT
-#define _REENTRANT
-#undef __USE_MISC
-#define __USE_MISC
-#include <netdb.h>
-void endnetent_r (void);
-] ,[return (0);],[
-NET_R_END_RESULT="#define NET_R_END_RESULT(x) /*empty*/"
-NET_R_END_RETURN="#define NET_R_END_RETURN void"
-],
-AC_TRY_COMPILE(
-[
-#undef _REENTRANT
-#define _REENTRANT
-#undef __USE_MISC
-#define __USE_MISC
-#include <netdb.h>
-extern int endnetent_r(struct netent_data *);
-] ,[return (0);],[
-NET_R_END_RESULT="#define NET_R_END_RESULT(x) return (x)"
-NET_R_END_RETURN="#define NET_R_END_RETURN int"
-],
-AC_TRY_COMPILE(
-[
-#undef _REENTRANT
-#define _REENTRANT
-#undef __USE_MISC
-#define __USE_MISC
-#include <netdb.h>
-extern void endnetent_r(struct netent_data *);
-] ,[return (0);],[
-NET_R_END_RESULT="#define NET_R_END_RESULT(x) /*empty*/"
-NET_R_END_RETURN="#define NET_R_END_RETURN void"
-],
-)
-)
-)
-,
-NET_R_END_RESULT="#define NET_R_END_RESULT(x) /*empty*/"
-NET_R_END_RETURN="#define NET_R_END_RETURN void"
-)
-esac
-AC_SUBST(NET_R_END_RESULT)
-AC_SUBST(NET_R_END_RETURN)
-
-AC_CHECK_FUNC(getgrnam_r,,AC_DEFINE(NEED_GETGRNAM_R))
-AC_CHECK_FUNC(getgrgid_r,,AC_DEFINE(NEED_GETGRGID_R))
-
-AC_CHECK_FUNC(getgrent_r,
-AC_TRY_COMPILE(
-[
-#include <grp.h>
-struct group *getgrent_r(struct group *grp, char *buffer,
- int buflen) {}
-] ,[return (0);],[
-GROUP_R_ARGS="#define GROUP_R_ARGS char *buf, int buflen"
-GROUP_R_BAD="#define GROUP_R_BAD NULL"
-GROUP_R_OK="#define GROUP_R_OK gptr"
-GROUP_R_RETURN="#define GROUP_R_RETURN struct group *"
-],
-)
-,
-GROUP_R_ARGS="#define GROUP_R_ARGS char *buf, int buflen"
-GROUP_R_BAD="#define GROUP_R_BAD NULL"
-GROUP_R_OK="#define GROUP_R_OK gptr"
-GROUP_R_RETURN="#define GROUP_R_RETURN struct group *"
-AC_DEFINE(NEED_GETGRENT_R)
-)
-AC_SUBST(GROUP_R_ARGS)
-AC_SUBST(GROUP_R_BAD)
-AC_SUBST(GROUP_R_OK)
-AC_SUBST(GROUP_R_RETURN)
-
-AC_CHECK_FUNC(endgrent_r,
-,
-GROUP_R_END_RESULT="#define GROUP_R_END_RESULT(x) /*empty*/"
-GROUP_R_END_RETURN="#define GROUP_R_END_RETURN void"
-GROUP_R_ENT_ARGS="#define GROUP_R_ENT_ARGS void"
-AC_DEFINE(NEED_ENDGRENT_R)
-)
-AC_SUBST(GROUP_R_END_RESULT)
-AC_SUBST(GROUP_R_END_RETURN)
-AC_SUBST(GROUP_R_ENT_ARGS)
-
-AC_CHECK_FUNC(setgrent_r,
-,
-GROUP_R_SET_RESULT="#undef GROUP_R_SET_RESULT /*empty*/"
-GROUP_R_SET_RETURN="#define GROUP_R_SET_RETURN void"
-AC_DEFINE(NEED_SETGRENT_R)
-)
-AC_SUBST(GROUP_R_SET_RESULT)
-AC_SUBST(GROUP_R_SET_RETURN)
-
-
-case $host in
-ia64-hp-hpux11.*)
-;;
-*)
-AC_CHECK_FUNC(gethostbyname_r,
-AC_TRY_COMPILE(
-[
-#undef __USE_MISC
-#define __USE_MISC
-#include <netdb.h>
-struct hostent *gethostbyname_r
-(const char *name, struct hostent *hp, char *buf, int len, int *h_errnop) {}
-],
-[return (0);],
-[
-HOST_R_ARGS="#define HOST_R_ARGS char *buf, int buflen, int *h_errnop"
-HOST_R_BAD="#define HOST_R_BAD NULL"
-HOST_R_COPY="#define HOST_R_COPY buf, buflen"
-HOST_R_COPY_ARGS="#define HOST_R_COPY_ARGS char *buf, int buflen"
-HOST_R_ERRNO="#define HOST_R_ERRNO *h_errnop = h_errno"
-HOST_R_OK="#define HOST_R_OK hptr"
-HOST_R_RETURN="#define HOST_R_RETURN struct hostent *"
-HOST_R_SETANSWER="#undef HOST_R_SETANSWER"
-HOSTENT_DATA="#undef HOSTENT_DATA"
-]
-,
-AC_TRY_COMPILE([
-#undef __USE_MISC
-#define __USE_MISC
-#include <netdb.h>
-int gethostbyname_r(const char *name,
- struct hostent *result,
- struct hostent_data *hdptr);
-],,[
-HOST_R_ARGS="#define HOST_R_ARGS struct hostent_data *hdptr"
-HOST_R_BAD="#define HOST_R_BAD (-1)"
-HOST_R_COPY="#define HOST_R_COPY hdptr"
-HOST_R_COPY_ARGS="#define HOST_R_COPY_ARGS HOST_R_ARGS"
-HOST_R_ERRNO="#undef HOST_R_ERRNO"
-HOST_R_OK="#define HOST_R_OK 0"
-HOST_R_RETURN="#define HOST_R_RETURN int"
-HOST_R_SETANSWER="#undef HOST_R_SETANSWER"
-HOSTENT_DATA="#define HOSTENT_DATA 1"
-],
-AC_TRY_COMPILE([
-#undef __USE_MISC
-#define __USE_MISC
-#include <netdb.h>
-extern int gethostbyname_r (const char *,
- struct hostent *,
- char *, size_t,
- struct hostent **,
- int *);
-],,[
-HOST_R_ARGS="#define HOST_R_ARGS char *buf, size_t buflen, struct hostent **answerp, int *h_errnop"
-HOST_R_BAD="#define HOST_R_BAD ERANGE"
-HOST_R_COPY="#define HOST_R_COPY buf, buflen"
-HOST_R_COPY_ARGS="#define HOST_R_COPY_ARGS char *buf, int buflen"
-HOST_R_ERRNO="#define HOST_R_ERRNO *h_errnop = h_errno"
-HOST_R_OK="#define HOST_R_OK 0"
-HOST_R_RETURN="#define HOST_R_RETURN int"
-HOST_R_SETANSWER="#define HOST_R_SETANSWER 1"
-HOSTENT_DATA="#undef HOSTENT_DATA"
-],
-)))
-,
-HOST_R_ARGS="#define HOST_R_ARGS char *buf, int buflen, int *h_errnop"
-HOST_R_BAD="#define HOST_R_BAD NULL"
-HOST_R_COPY="#define HOST_R_COPY buf, buflen"
-HOST_R_COPY_ARGS="#define HOST_R_COPY_ARGS char *buf, int buflen"
-HOST_R_ERRNO="#define HOST_R_ERRNO *h_errnop = h_errno"
-HOST_R_OK="#define HOST_R_OK hptr"
-HOST_R_RETURN="#define HOST_R_RETURN struct hostent *"
-HOST_R_SETANSWER="#undef HOST_R_SETANSWER"
-HOSTENT_DATA="#undef HOSTENT_DATA"
-)
-esac
-AC_SUBST(HOST_R_ARGS)
-AC_SUBST(HOST_R_BAD)
-AC_SUBST(HOST_R_COPY)
-AC_SUBST(HOST_R_COPY_ARGS)
-AC_SUBST(HOST_R_ERRNO)
-AC_SUBST(HOST_R_OK)
-AC_SUBST(HOST_R_RETURN)
-AC_SUBST(HOST_R_SETANSWER)
-AC_SUBST(HOSTENT_DATA)
-
-case $host in
-ia64-hp-hpux11.*)
-;;
-*)
-AC_CHECK_FUNC(endhostent_r,
-AC_TRY_COMPILE([
-#undef _REENTRANT
-#define _REENTRANT
-#undef __USE_MISC
-#define __USE_MISC
-#include <netdb.h>
-int endhostent_r(struct hostent_data *buffer);
-], ,
-HOST_R_END_RESULT="#define HOST_R_END_RESULT(x) return (x)"
-HOST_R_END_RETURN="#define HOST_R_END_RETURN int"
-HOST_R_ENT_ARGS="#define HOST_R_ENT_ARGS struct hostent_data *hdptr"
-,
-AC_TRY_COMPILE([
-#undef _REENTRANT
-#define _REENTRANT
-#undef __USE_MISC
-#define __USE_MISC
-#include <netdb.h>
-extern void endhostent_r(struct hostent_data *ht_data);
-],[],[
-HOST_R_END_RESULT="#define HOST_R_END_RESULT(x)"
-HOST_R_END_RETURN="#define HOST_R_END_RETURN void"
-HOST_R_ENT_ARGS="#define HOST_R_ENT_ARGS struct hostent_data *hdptr"
-],
-AC_TRY_COMPILE([
-#undef _REENTRANT
-#define _REENTRANT
-#undef __USE_MISC
-#define __USE_MISC
-#include <netdb.h>
-extern void endhostent_r(void);
-],[],[
-HOST_R_END_RESULT="#define HOST_R_END_RESULT(x) /*empty*/"
-HOST_R_END_RETURN="#define HOST_R_END_RETURN void"
-HOST_R_ENT_ARGS="#undef HOST_R_ENT_ARGS /*empty*/"
-],
-)
-)
-)
-,
-HOST_R_END_RESULT="#define HOST_R_END_RESULT(x) /*empty*/"
-HOST_R_END_RETURN="#define HOST_R_END_RETURN void"
-HOST_R_ENT_ARGS="#undef HOST_R_ENT_ARGS /*empty*/"
-)
-esac;
-AC_SUBST(HOST_R_END_RESULT)
-AC_SUBST(HOST_R_END_RETURN)
-AC_SUBST(HOST_R_ENT_ARGS)
-
-case $host in
-ia64-hp-hpux11.*)
-;;
-*)
-AC_CHECK_FUNC(sethostent_r,
-AC_TRY_COMPILE([
-#undef _REENTRANT
-#define _REENTRANT
-#undef __USE_MISC
-#define __USE_MISC
-#include <netdb.h>
-extern void sethostent_r(int flag, struct hostent_data *ht_data);],[],
-[HOST_R_SET_RESULT="#undef HOST_R_SET_RESULT /*empty*/"
-HOST_R_SET_RETURN="#define HOST_R_SET_RETURN void"],
-AC_TRY_COMPILE([
-#undef _REENTRANT
-#define _REENTRANT
-#undef __USE_MISC
-#define __USE_MISC
-#include <netdb.h>
-extern int sethostent_r(int flag, struct hostent_data *ht_data);],[],
-[HOST_R_SET_RESULT="#define HOST_R_SET_RESULT 0"
-HOST_R_SET_RETURN="#define HOST_R_SET_RETURN int"],
-AC_TRY_COMPILE([
-#undef _REENTRANT
-#define _REENTRANT
-#undef __USE_MISC
-#define __USE_MISC
-#include <netdb.h>
-void sethostent_r (int);],[],
-[HOST_R_SET_RESULT="#undef HOST_R_SET_RESULT"
-HOST_R_SET_RETURN="#define HOST_R_SET_RETURN void"],
-)
-)
-)
-,
-HOST_R_SET_RESULT="#undef HOST_R_SET_RESULT"
-HOST_R_SET_RETURN="#define HOST_R_SET_RETURN void"
-)
-esac
-AC_SUBST(HOST_R_SET_RESULT)
-AC_SUBST(HOST_R_SET_RETURN)
-
-
-AC_MSG_CHECKING(struct passwd element pw_class)
-AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <pwd.h>
-],[struct passwd *pw; pw->pw_class = "";],
-AC_MSG_RESULT(yes)
-AC_DEFINE(HAS_PW_CLASS)
-,
- AC_MSG_RESULT(no)
-)
-
-AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <pwd.h>
-void
-setpwent(void) {}
-],
-[return (0);],
-SETPWENT_VOID="#define SETPWENT_VOID 1"
-,
-SETPWENT_VOID="#undef SETPWENT_VOID"
-)
-AC_SUBST(SETPWENT_VOID)
-
-AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <grp.h>
-void
-setgrent(void) {}
-],
-[return (0);],
-SETGRENT_VOID="#define SETGRENT_VOID 1"
-,
-SETGRENT_VOID="#undef SETGRENT_VOID"
-)
-AC_SUBST(SETGRENT_VOID)
-
-case $host in
-ia64-hp-hpux11.*)
-NGR_R_CONST="#define NGR_R_CONST"
-;;
-*-hp-hpux11.*)
-#
-# HPUX doesn't have a prototype for getnetgrent_r().
-#
-NGR_R_CONST="#define NGR_R_CONST"
-NGR_R_ARGS="#define NGR_R_ARGS char *buf, int buflen"
-NGR_R_BAD="#define NGR_R_BAD (0)"
-NGR_R_COPY="#define NGR_R_COPY buf, buflen"
-NGR_R_COPY_ARGS="#define NGR_R_COPY_ARGS NGR_R_ARGS"
-NGR_R_OK="#define NGR_R_OK 1"
-NGR_R_RETURN="#define NGR_R_RETURN int"
-;;
-
-*)
-AC_CHECK_FUNC(getnetgrent_r,
-AC_TRY_COMPILE(
-[
-#undef __USE_MISC
-#define __USE_MISC
-#undef _REEENTRANT
-#define _REEENTRANT
-#include <netdb.h>
-#include <unistd.h>
-int getnetgrent_r(char **m, char **u, char **d, char *b, int l) {}
-]
-,
-[return (0);],
-[
-NGR_R_CONST="#define NGR_R_CONST"
-NGR_R_ARGS="#define NGR_R_ARGS char *buf, int buflen"
-NGR_R_BAD="#define NGR_R_BAD (0)"
-NGR_R_COPY="#define NGR_R_COPY buf, buflen"
-NGR_R_COPY_ARGS="#define NGR_R_COPY_ARGS NGR_R_ARGS"
-NGR_R_OK="#define NGR_R_OK 1"
-NGR_R_RETURN="#define NGR_R_RETURN int"
-]
-,
-AC_TRY_COMPILE(
-[
-#undef __USE_MISC
-#define __USE_MISC
-#undef _REEENTRANT
-#define _REEENTRANT
-#include <netdb.h>
-#include <unistd.h>
-int getnetgrent_r(char **m, char **u, char **d, char *b, size_t l) {}
-]
-,
-[return (0);],
-[
-NGR_R_CONST="#define NGR_R_CONST"
-NGR_R_ARGS="#define NGR_R_ARGS char *buf, size_t buflen"
-NGR_R_BAD="#define NGR_R_BAD (0)"
-NGR_R_COPY="#define NGR_R_COPY buf, buflen"
-NGR_R_COPY_ARGS="#define NGR_R_COPY_ARGS NGR_R_ARGS"
-NGR_R_OK="#define NGR_R_OK 1"
-NGR_R_RETURN="#define NGR_R_RETURN int"
-]
-,
-AC_TRY_COMPILE(
-[
-#undef __USE_MISC
-#define __USE_MISC
-#undef _REEENTRANT
-#define _REEENTRANT
-#include <netdb.h>
-#include <unistd.h>
-extern int getnetgrent_r(char **, char **, char **, void **);
-]
-,
-[return (0);],
-[
-NGR_R_CONST="#define NGR_R_CONST"
-NGR_R_ARGS="#define NGR_R_ARGS void **buf"
-NGR_R_BAD="#define NGR_R_BAD (0)"
-NGR_R_COPY="#define NGR_R_COPY buf"
-NGR_R_COPY_ARGS="#define NGR_R_COPY_ARGS NGR_R_ARGS"
-NGR_R_OK="#define NGR_R_OK 1"
-NGR_R_RETURN="#define NGR_R_RETURN int"
-NGR_R_PRIVATE="#define NGR_R_PRIVATE 1"
-]
-,
-AC_TRY_COMPILE(
-[
-#undef __USE_MISC
-#define __USE_MISC
-#undef _REEENTRANT
-#define _REEENTRANT
-#include <netdb.h>
-#include <unistd.h>
-extern int getnetgrent_r(const char **, const char **, const char **, void *);
-]
-,
-[return (0);],
-[
-NGR_R_CONST="#define NGR_R_CONST const"
-NGR_R_ARGS="#define NGR_R_ARGS void *buf"
-NGR_R_BAD="#define NGR_R_BAD (0)"
-NGR_R_COPY="#define NGR_R_COPY buf"
-NGR_R_COPY_ARGS="#define NGR_R_COPY_ARGS NGR_R_ARGS"
-NGR_R_OK="#define NGR_R_OK 1"
-NGR_R_RETURN="#define NGR_R_RETURN int"
-NGR_R_PRIVATE="#define NGR_R_PRIVATE 2"
-]
-,
-)
-)
-)
-)
-,
-NGR_R_CONST="#define NGR_R_CONST"
-NGR_R_ARGS="#define NGR_R_ARGS char *buf, int buflen"
-NGR_R_BAD="#define NGR_R_BAD (0)"
-NGR_R_COPY="#define NGR_R_COPY buf, buflen"
-NGR_R_COPY_ARGS="#define NGR_R_COPY_ARGS NGR_R_ARGS"
-NGR_R_OK="#define NGR_R_OK 1"
-NGR_R_RETURN="#define NGR_R_RETURN int"
-)
-esac
-AC_SUBST(NGR_R_CONST)
-AC_SUBST(NGR_R_ARGS)
-AC_SUBST(NGR_R_BAD)
-AC_SUBST(NGR_R_COPY)
-AC_SUBST(NGR_R_COPY_ARGS)
-AC_SUBST(NGR_R_OK)
-AC_SUBST(NGR_R_RETURN)
-AC_SUBST(NGR_R_PRIVATE)
-
-AC_CHECK_FUNC(endnetgrent_r,
-AC_TRY_COMPILE(
-[
-#undef __USE_MISC
-#define __USE_MISC
-#undef _REEENTRANT
-#define _REEENTRANT
-#include <netdb.h>
-#include <unistd.h>
-void endnetgrent_r(void **ptr);
-]
-,
-[return (0);]
-,
-[
-NGR_R_END_RESULT="#define NGR_R_END_RESULT(x) /* empty */"
-NGR_R_END_RETURN="#define NGR_R_END_RETURN void"
-NGR_R_END_ARGS="#define NGR_R_END_ARGS NGR_R_ARGS"
-]
-,
-AC_TRY_COMPILE(
-[
-#undef __USE_MISC
-#define __USE_MISC
-#undef _REEENTRANT
-#define _REEENTRANT
-#include <netdb.h>
-#include <unistd.h>
-void endnetgrent_r(void *ptr);
-]
-,
-[return (0);]
-,
-[
-NGR_R_END_RESULT="#define NGR_R_END_RESULT(x) /* empty */"
-NGR_R_END_RETURN="#define NGR_R_END_RETURN void"
-NGR_R_END_ARGS="#define NGR_R_END_ARGS void *buf"
-]
-,
-[
-NGR_R_END_RESULT="#define NGR_R_END_RESULT(x) return (x)"
-NGR_R_END_RETURN="#define NGR_R_END_RETURN int"
-NGR_R_END_ARGS="#define NGR_R_END_ARGS NGR_R_ARGS"
-]
-)
-)
-,
-NGR_R_END_RESULT="#define NGR_R_END_RESULT(x) /*empty*/"
-NGR_R_END_RETURN="#define NGR_R_END_RETURN void"
-NGR_R_END_ARGS="#undef NGR_R_END_ARGS /*empty*/"
-AC_DEFINE(NEED_ENDNETGRENT_R)
-)
-AC_SUBST(NGR_R_END_RESULT)
-AC_SUBST(NGR_R_END_RETURN)
-AC_SUBST(NGR_R_END_ARGS)
-
-AC_CHECK_FUNC(setnetgrent_r,
-[
-case "$host" in
-*bsdi*)
- #
- # No prototype
- #
- NGR_R_SET_RESULT="#undef NGR_R_SET_RESULT /*empty*/"
- NGR_R_SET_RETURN="#define NGR_R_SET_RETURN void"
- NGR_R_SET_ARGS="#define NGR_R_SET_ARGS NGR_R_ARGS"
- NGR_R_SET_CONST="#define NGR_R_SET_CONST"
- ;;
-*hpux*)
- #
- # No prototype
- #
- NGR_R_SET_RESULT="#define NGR_R_SET_RESULT NGR_R_OK"
- NGR_R_SET_RETURN="#define NGR_R_SET_RETURN int"
- NGR_R_SET_ARGS="#undef NGR_R_SET_ARGS /* empty */"
- NGR_R_SET_CONST="#define NGR_R_SET_CONST"
- ;;
-*)
-AC_TRY_COMPILE(
-[
-#undef __USE_MISC
-#define __USE_MISC
-#undef _REEENTRANT
-#define _REEENTRANT
-#include <netdb.h>
-#include <unistd.h>
-void setnetgrent_r(void **ptr);
-]
-,
-[return (0);]
-,
-[
-NGR_R_SET_RESULT="#undef NGR_R_SET_RESULT /* empty */"
-NGR_R_SET_RETURN="#define NGR_R_SET_RETURN void"
-NGR_R_SET_ARGS="#define NGR_R_SET_ARGS void **buf"
-NGR_R_SET_CONST="#define NGR_R_SET_CONST"
-]
-,
-AC_TRY_COMPILE(
-[
-#undef __USE_MISC
-#define __USE_MISC
-#undef _REEENTRANT
-#define _REEENTRANT
-#include <netdb.h>
-#include <unistd.h>
-extern int setnetgrent_r(char *, void **);
-]
-,
-[return (0);]
-,
-[
-NGR_R_SET_RESULT="#define NGR_R_SET_RESULT NGR_R_OK"
-NGR_R_SET_RETURN="#define NGR_R_SET_RETURN int"
-NGR_R_SET_ARGS="#define NGR_R_SET_ARGS void **buf"
-NGR_R_SET_CONST="#define NGR_R_SET_CONST"
-]
-,
-[
-NGR_R_SET_RESULT="#define NGR_R_SET_RESULT NGR_R_OK"
-NGR_R_SET_RETURN="#define NGR_R_SET_RETURN int"
-NGR_R_SET_ARGS="#undef NGR_R_SET_ARGS"
-NGR_R_SET_CONST="#define NGR_R_SET_CONST const"
-]
-))
-;;
-esac
-]
-,
-NGR_R_SET_RESULT="#undef NGR_R_SET_RESULT /*empty*/"
-NGR_R_SET_RETURN="#define NGR_R_SET_RETURN void"
-NGR_R_SET_ARGS="#undef NGR_R_SET_ARGS"
-NGR_R_SET_CONST="#define NGR_R_SET_CONST const"
-)
-
-AC_SUBST(NGR_R_SET_RESULT)
-AC_SUBST(NGR_R_SET_RETURN)
-AC_SUBST(NGR_R_SET_ARGS)
-AC_SUBST(NGR_R_SET_CONST)
-
-AC_CHECK_FUNC(innetgr_r,,AC_DEFINE(NEED_INNETGR_R))
-
-case $host in
-ia64-hp-hpux11.*)
-;;
-*)
-AC_CHECK_FUNC(getprotoent_r,
-AC_TRY_COMPILE(
-[
-#undef __USE_MISC
-#define __USE_MISC
-#include <netdb.h>
-struct protoent *getprotoent_r(struct protoent *result,
- char *buffer, int buflen) {}
-]
-,
-[return (0);]
-,
-[
-PROTO_R_ARGS="#define PROTO_R_ARGS char *buf, int buflen"
-PROTO_R_BAD="#define PROTO_R_BAD NULL"
-PROTO_R_COPY="#define PROTO_R_COPY buf, buflen"
-PROTO_R_COPY_ARGS="#define PROTO_R_COPY_ARGS PROTO_R_ARGS"
-PROTO_R_OK="#define PROTO_R_OK pptr"
-PROTO_R_SETANSWER="#undef PROTO_R_SETANSWER"
-PROTO_R_RETURN="#define PROTO_R_RETURN struct protoent *"
-PROTOENT_DATA="#undef PROTOENT_DATA"
-]
-,
-AC_TRY_COMPILE(
-[
-#undef __USE_MISC
-#define __USE_MISC
-#include <netdb.h>
-int getprotoent_r (struct protoent *, char *, size_t, struct protoent **);
-
-]
-,
-[return (0);]
-,
-[
-PROTO_R_ARGS="#define PROTO_R_ARGS char *buf, size_t buflen, struct protoent **answerp"
-PROTO_R_BAD="#define PROTO_R_BAD ERANGE"
-PROTO_R_COPY="#define PROTO_R_COPY buf, buflen"
-PROTO_R_COPY_ARGS="#define PROTO_R_COPY_ARGS char *buf, size_t buflen"
-PROTO_R_OK="#define PROTO_R_OK 0"
-PROTO_R_SETANSWER="#define PROTO_R_SETANSWER 1"
-PROTO_R_RETURN="#define PROTO_R_RETURN int"
-PROTOENT_DATA="#undef PROTOENT_DATA"
-]
-,
-AC_TRY_COMPILE(
-[
-#undef __USE_MISC
-#define __USE_MISC
-#include <netdb.h>
-int getprotoent_r (struct protoent *, struct protoent_data *prot_data);
-
-]
-,
-[return (0);]
-,
-[
-PROTO_R_ARGS="#define PROTO_R_ARGS struct protoent_data *prot_data"
-PROTO_R_BAD="#define PROTO_R_BAD (-1)"
-PROTO_R_COPY="#define PROTO_R_COPY prot_data"
-PROTO_R_COPY_ARGS="#define PROTO_R_COPY_ARGS struct protoent_data *pdptr"
-PROTO_R_OK="#define PROTO_R_OK 0"
-PROTO_R_SETANSWER="#undef PROTO_R_SETANSWER"
-PROTO_R_RETURN="#define PROTO_R_RETURN int"
-PROTOENT_DATA="#define PROTOENT_DATA 1"
-]
-,
-)
-)
-)
-,
-PROTO_R_ARGS="#define PROTO_R_ARGS char *buf, int buflen"
-PROTO_R_BAD="#define PROTO_R_BAD NULL"
-PROTO_R_COPY="#define PROTO_R_COPY buf, buflen"
-PROTO_R_COPY_ARGS="#define PROTO_R_COPY_ARGS PROTO_R_ARGS"
-PROTO_R_OK="#define PROTO_R_OK pptr"
-PROTO_R_SETANSWER="#undef PROTO_R_SETANSWER"
-PROTO_R_RETURN="#define PROTO_R_RETURN struct protoent *"
-PROTOENT_DATA="#undef PROTOENT_DATA"
-)
-;;
-esac
-AC_SUBST(PROTO_R_ARGS)
-AC_SUBST(PROTO_R_BAD)
-AC_SUBST(PROTO_R_COPY)
-AC_SUBST(PROTO_R_COPY_ARGS)
-AC_SUBST(PROTO_R_OK)
-AC_SUBST(PROTO_R_SETANSWER)
-AC_SUBST(PROTO_R_RETURN)
-AC_SUBST(PROTOENT_DATA)
-
-case $host in
-ia64-hp-hpux11.*)
-;;
-*)
-AC_CHECK_FUNC(endprotoent_r,
-AC_TRY_COMPILE(
-[
-#undef _REENTRANT
-#define _REENTRANT
-#undef __USE_MISC
-#define __USE_MISC
-#include <netdb.h>
-void endprotoent_r(void);
-]
-,,
-[
-PROTO_R_END_RESULT="#define PROTO_R_END_RESULT(x) /*empty*/"
-PROTO_R_END_RETURN="#define PROTO_R_END_RETURN void"
-PROTO_R_ENT_ARGS="#undef PROTO_R_ENT_ARGS"
-PROTO_R_ENT_UNUSED="#undef PROTO_R_ENT_UNUSED"
-]
-,
-AC_TRY_COMPILE(
-[
-#undef _REENTRANT
-#define _REENTRANT
-#undef __USE_MISC
-#define __USE_MISC
-#include <netdb.h>
-void endprotoent_r(struct protoent_data *);
-]
-,,
-[
-PROTO_R_END_RESULT="#define PROTO_R_END_RESULT(x) /*empty*/"
-PROTO_R_END_RETURN="#define PROTO_R_END_RETURN void"
-PROTO_R_ENT_ARGS="#define PROTO_R_ENT_ARGS struct protoent_data *proto_data"
-PROTO_R_ENT_UNUSED="#define PROTO_R_ENT_UNUSED UNUSED(proto_data)"
-]
-,
-AC_TRY_COMPILE(
-[
-#undef _REENTRANT
-#define _REENTRANT
-#undef __USE_MISC
-#define __USE_MISC
-#include <netdb.h>
-int endprotoent_r(struct protoent_data *);
-]
-,,
-[
-PROTO_R_END_RESULT="#define PROTO_R_END_RESULT(x) return(0)"
-PROTO_R_END_RETURN="#define PROTO_R_END_RETURN int"
-PROTO_R_ENT_ARGS="#define PROTO_R_ENT_ARGS struct protoent_data *proto_data"
-PROTO_R_ENT_UNUSED="#define PROTO_R_ENT_UNUSED UNUSED(proto_data)"
-]
-,
-)
-)
-)
-,
-PROTO_R_END_RESULT="#define PROTO_R_END_RESULT(x) /*empty*/"
-PROTO_R_END_RETURN="#define PROTO_R_END_RETURN void"
-PROTO_R_ENT_ARGS="#undef PROTO_R_ENT_ARGS /*empty*/"
-PROTO_R_ENT_UNUSED="#undef PROTO_R_ENT_UNUSED"
-)
-esac
-AC_SUBST(PROTO_R_END_RESULT)
-AC_SUBST(PROTO_R_END_RETURN)
-AC_SUBST(PROTO_R_ENT_ARGS)
-AC_SUBST(PROTO_R_ENT_UNUSED)
-
-case $host in
-ia64-hp-hpux11.*)
-;;
-*)
-AC_CHECK_FUNC(setprotoent_r,
-AC_TRY_COMPILE(
-[
-#undef _REENTRANT
-#define _REENTRANT
-#undef __USE_MISC
-#define __USE_MISC
-#include <netdb.h>
-void setprotoent_r __P((int));
-],[],
-PROTO_R_SET_RESULT="#undef PROTO_R_SET_RESULT"
-PROTO_R_SET_RETURN="#define PROTO_R_SET_RETURN void"
-,
-AC_TRY_COMPILE(
-[
-#undef _REENTRANT
-#define _REENTRANT
-#undef __USE_MISC
-#define __USE_MISC
-#include <netdb.h>
-int setprotoent_r (int, struct protoent_data *);
-],[],
-PROTO_R_SET_RESULT="#define PROTO_R_SET_RESULT (0)"
-PROTO_R_SET_RETURN="#define PROTO_R_SET_RETURN int"
-,
-)
-)
-,
-PROTO_R_SET_RESULT="#undef PROTO_R_SET_RESULT"
-PROTO_R_SET_RETURN="#define PROTO_R_SET_RETURN void"
-)
-esac
-AC_SUBST(PROTO_R_SET_RESULT)
-AC_SUBST(PROTO_R_SET_RETURN)
-
-AC_CHECK_FUNC(getpwent_r,
-AC_TRY_COMPILE(
-[
-#include <sys/types.h>
-#include <pwd.h>
-struct passwd *
-getpwent_r(struct passwd *pwptr, char *buf, int buflen) {}
-]
-,
-[]
-,
-PASS_R_ARGS="#define PASS_R_ARGS char *buf, int buflen"
-PASS_R_BAD="#define PASS_R_BAD NULL"
-PASS_R_COPY="#define PASS_R_COPY buf, buflen"
-PASS_R_COPY_ARGS="#define PASS_R_COPY_ARGS PASS_R_ARGS"
-PASS_R_OK="#define PASS_R_OK pwptr"
-PASS_R_RETURN="#define PASS_R_RETURN struct passwd *"
-,
-)
-,
-PASS_R_ARGS="#define PASS_R_ARGS char *buf, int buflen"
-PASS_R_BAD="#define PASS_R_BAD NULL"
-PASS_R_COPY="#define PASS_R_COPY buf, buflen"
-PASS_R_COPY_ARGS="#define PASS_R_COPY_ARGS PASS_R_ARGS"
-PASS_R_OK="#define PASS_R_OK pwptr"
-PASS_R_RETURN="#define PASS_R_RETURN struct passwd *"
-AC_DEFINE(NEED_GETPWENT_R)
-)
-AC_SUBST(PASS_R_ARGS)
-AC_SUBST(PASS_R_BAD)
-AC_SUBST(PASS_R_COPY)
-AC_SUBST(PASS_R_COPY_ARGS)
-AC_SUBST(PASS_R_OK)
-AC_SUBST(PASS_R_RETURN)
-
-AC_CHECK_FUNC(endpwent_r,
-AC_TRY_COMPILE(
-[
-#include <pwd.h>
-void endpwent_r(FILE **pwfp);
-], ,
-PASS_R_END_RESULT="#define PASS_R_END_RESULT(x) /*empty*/"
-PASS_R_END_RETURN="#define PASS_R_END_RETURN void"
-PASS_R_ENT_ARGS="#define PASS_R_ENT_ARGS FILE **pwptr"
-,
-)
-,
-PASS_R_END_RESULT="#define PASS_R_END_RESULT(x) /*empty*/"
-PASS_R_END_RETURN="#define PASS_R_END_RETURN void"
-PASS_R_ENT_ARGS="#undef PASS_R_ENT_ARGS"
-AC_DEFINE(NEED_ENDPWENT_R)
-)
-AC_SUBST(PASS_R_END_RESULT)
-AC_SUBST(PASS_R_END_RETURN)
-AC_SUBST(PASS_R_ENT_ARGS)
-AC_CHECK_FUNC(setpassent_r,,AC_DEFINE(NEED_SETPASSENT_R))
-AC_CHECK_FUNC(setpassent,,AC_DEFINE(NEED_SETPASSENT))
-
-AC_CHECK_FUNC(setpwent_r,
-AC_TRY_COMPILE([
-#include <pwd.h>
-void setpwent_r(FILE **pwfp);
-], ,
-PASS_R_SET_RESULT="#undef PASS_R_SET_RESULT /* empty */"
-PASS_R_SET_RETURN="#define PASS_R_SET_RETURN int"
-,
-AC_TRY_COMPILE([
-#include <pwd.h>
-int setpwent_r(FILE **pwfp);
-], ,
-PASS_R_SET_RESULT="#define PASS_R_SET_RESULT 0"
-PASS_R_SET_RETURN="#define PASS_R_SET_RETURN int"
-,
-)
-)
-,
-PASS_R_SET_RESULT="#undef PASS_R_SET_RESULT /*empty*/"
-PASS_R_SET_RETURN="#define PASS_R_SET_RETURN void"
-AC_DEFINE(NEED_SETPWENT_R)
-)
-AC_SUBST(PASS_R_SET_RESULT)
-AC_SUBST(PASS_R_SET_RETURN)
-
-AC_CHECK_FUNC(getpwnam_r,,AC_DEFINE(NEED_GETPWNAM_R))
-AC_CHECK_FUNC(getpwuid_r,,AC_DEFINE(NEED_GETPWUID_R))
-
-case $host in
-ia64-hp-hpux11.*)
-;;
-*)
-AC_CHECK_FUNC(getservent_r,
-AC_TRY_COMPILE([
-#undef __USE_MISC
-#define __USE_MISC
-#include <netdb.h>
-struct servent *
-getservent_r(struct servent *result, char *buffer, int buflen) {}
-],[return (0);],
-[
-SERV_R_ARGS="#define SERV_R_ARGS char *buf, int buflen"
-SERV_R_BAD="#define SERV_R_BAD NULL"
-SERV_R_COPY="#define SERV_R_COPY buf, buflen"
-SERV_R_COPY_ARGS="#define SERV_R_COPY_ARGS SERV_R_ARGS"
-SERV_R_OK="#define SERV_R_OK sptr"
-SERV_R_SETANSWER="#undef SERV_R_SETANSWER"
-SERV_R_RETURN="#define SERV_R_RETURN struct servent *"
-]
-,
-AC_TRY_COMPILE([
-#undef __USE_MISC
-#define __USE_MISC
-#include <netdb.h>
-int
-getservent_r (struct servent *, char *, size_t, struct servent **);
-],[return (0);],
-[
-SERV_R_ARGS="#define SERV_R_ARGS char *buf, size_t buflen, struct servent **answerp"
-SERV_R_BAD="#define SERV_R_BAD ERANGE"
-SERV_R_COPY="#define SERV_R_COPY buf, buflen"
-SERV_R_COPY_ARGS="#define SERV_R_COPY_ARGS char *buf, size_t buflen"
-SERV_R_OK="#define SERV_R_OK (0)"
-SERV_R_SETANSWER="#define SERV_R_SETANSWER 1"
-SERV_R_RETURN="#define SERV_R_RETURN int"
-]
-,
-AC_TRY_COMPILE([
-#undef __USE_MISC
-#define __USE_MISC
-#include <netdb.h>
-int
-getservent_r (struct servent *, struct servent_data *serv_data);
-],[return (0);],
-[
-SERV_R_ARGS="#define SERV_R_ARGS struct servent_data *serv_data"
-SERV_R_BAD="#define SERV_R_BAD (-1)"
-SERV_R_COPY="#define SERV_R_COPY serv_data"
-SERV_R_COPY_ARGS="#define SERV_R_COPY_ARGS struct servent_data *sdptr"
-SERV_R_OK="#define SERV_R_OK (0)"
-SERV_R_SETANSWER="#undef SERV_R_SETANSWER"
-SERV_R_RETURN="#define SERV_R_RETURN int"
-SERVENT_DATA="#define SERVENT_DATA 1"
-]
-,
-)
-)
-)
-,
-SERV_R_ARGS="#define SERV_R_ARGS char *buf, int buflen"
-SERV_R_BAD="#define SERV_R_BAD NULL"
-SERV_R_COPY="#define SERV_R_COPY buf, buflen"
-SERV_R_COPY_ARGS="#define SERV_R_COPY_ARGS SERV_R_ARGS"
-SERV_R_OK="#define SERV_R_OK sptr"
-SERV_R_SETANSWER="#undef SERV_R_SETANSWER"
-SERV_R_RETURN="#define SERV_R_RETURN struct servent *"
-)
-esac
-AC_SUBST(SERV_R_ARGS)
-AC_SUBST(SERV_R_BAD)
-AC_SUBST(SERV_R_COPY)
-AC_SUBST(SERV_R_COPY_ARGS)
-AC_SUBST(SERV_R_OK)
-AC_SUBST(SERV_R_SETANSWER)
-AC_SUBST(SERV_R_RETURN)
-AC_SUBST(SERVENT_DATA)
-
-case $host in
-ia64-hp-hpux11.*)
-;;
-*)
-AC_CHECK_FUNC(endservent_r,
-AC_TRY_COMPILE(
-[
-#undef _REENTRANT
-#define _REENTRANT
-#undef __USE_MISC
-#define __USE_MISC
-#include <netdb.h>
-void endservent_r(void);
-]
-,
-,
-[
-SERV_R_END_RESULT="#define SERV_R_END_RESULT(x) /*empty*/"
-SERV_R_END_RETURN="#define SERV_R_END_RETURN void "
-SERV_R_ENT_ARGS="#undef SERV_R_ENT_ARGS /*empty*/"
-SERV_R_ENT_UNUSED="#undef SERV_R_ENT_UNUSED /*empty*/"
-]
-,
-AC_TRY_COMPILE(
-[
-#undef _REENTRANT
-#define _REENTRANT
-#undef __USE_MISC
-#define __USE_MISC
-#include <netdb.h>
-void endservent_r(struct servent_data *serv_data);
-]
-,
-,
-[
-SERV_R_END_RESULT="#define SERV_R_END_RESULT(x) /*empty*/"
-SERV_R_END_RETURN="#define SERV_R_END_RETURN void "
-SERV_R_ENT_ARGS="#define SERV_R_ENT_ARGS struct servent_data *serv_data"
-SERV_R_ENT_UNUSED="#define SERV_R_ENT_UNUSED UNUSED(serv_data)"
-]
-,
-AC_TRY_COMPILE(
-[
-#undef _REENTRANT
-#define _REENTRANT
-#undef __USE_MISC
-#define __USE_MISC
-#include <netdb.h>
-int endservent_r(struct servent_data *serv_data);
-]
-,
-,
-[
-SERV_R_END_RESULT="#define SERV_R_END_RESULT(x) return(x)"
-SERV_R_END_RETURN="#define SERV_R_END_RETURN int "
-SERV_R_ENT_ARGS="#define SERV_R_ENT_ARGS struct servent_data *serv_data"
-SERV_R_ENT_UNUSED="#define SERV_R_ENT_UNUSED UNUSED(serv_data)"
-]
-,
-)
-)
-)
-,
-SERV_R_END_RESULT="#define SERV_R_END_RESULT(x) /*empty*/"
-SERV_R_END_RETURN="#define SERV_R_END_RETURN void "
-SERV_R_ENT_ARGS="#undef SERV_R_ENT_ARGS /*empty*/"
-SERV_R_ENT_UNUSED="#undef SERV_R_ENT_UNUSED /*empty*/"
-)
-esac
-AC_SUBST(SERV_R_END_RESULT)
-AC_SUBST(SERV_R_END_RETURN)
-AC_SUBST(SERV_R_ENT_ARGS)
-AC_SUBST(SERV_R_ENT_UNUSED)
-
-case $host in
-ia64-hp-hpux11.*)
-;;
-*)
-AC_CHECK_FUNC(setservent_r,
-AC_TRY_COMPILE(
-[
-#undef _REENTRANT
-#define _REENTRANT
-#undef __USE_MISC
-#define __USE_MISC
-#include <netdb.h>
-void setservent_r(int);
-]
-,,
-[
-SERV_R_SET_RESULT="#undef SERV_R_SET_RESULT"
-SERV_R_SET_RETURN="#define SERV_R_SET_RETURN void"
-]
-,
-AC_TRY_COMPILE(
-[
-#undef _REENTRANT
-#define _REENTRANT
-#undef __USE_MISC
-#define __USE_MISC
-#include <netdb.h>
-int setservent_r(int, struct servent_data *);
-]
-,,
-[
-SERV_R_SET_RESULT="#define SERV_R_SET_RESULT (0)"
-SERV_R_SET_RETURN="#define SERV_R_SET_RETURN int"
-]
-,
-)
-)
-,
-SERV_R_SET_RESULT="#undef SERV_R_SET_RESULT"
-SERV_R_SET_RETURN="#define SERV_R_SET_RETURN void"
-)
-esac
-AC_SUBST(SERV_R_SET_RESULT)
-AC_SUBST(SERV_R_SET_RETURN)
-
-AC_TRY_COMPILE(
-[
-#undef _REENTRANT
-#define _REENTRANT
-#undef __USE_MISC
-#define __USE_MISC
-#include <unistd.h>
-#include <netdb.h>
-int innetgr(const char *netgroup, const char *host, const char *user, const char *domain);
-]
-,,
-[
-INNETGR_ARGS="#undef INNETGR_ARGS"
-]
-,
-AC_TRY_COMPILE(
-[
-#undef _REENTRANT
-#define _REENTRANT
-#undef __USE_MISC
-#define __USE_MISC
-#include <unistd.h>
-#include <netdb.h>
-int innetgr(char *netgroup, char *host, char *user, char *domain);
-]
-,,
-[
-INNETGR_ARGS="#define INNETGR_ARGS char *netgroup, char *host, char *user, char *domain"
-]
-,
-))
-
-AC_TRY_COMPILE(
-[
-#undef _REENTRANT
-#define _REENTRANT
-#undef __USE_MISC
-#define __USE_MISC
-#include <unistd.h>
-#include <netdb.h>
-void setnetgrent(const char *);
-]
-,,
-[
-SETNETGRENT_ARGS="#undef SETNETGRENT_ARGS"
-]
-,
-AC_TRY_COMPILE(
-[
-#undef _REENTRANT
-#define _REENTRANT
-#undef __USE_MISC
-#define __USE_MISC
-#include <unistd.h>
-#include <netdb.h>
-void setnetgrent(char *);
-]
-,,
-[
-SETNETGRENT_ARGS="#define SETNETGRENT_ARGS char *netgroup"
-]
-,
-))
-AC_SUBST(SETNETGRENT_ARGS)
-AC_SUBST(INNETGR_ARGS)
-
-#
-# Random remaining OS-specific issues involving compiler warnings.
-# XXXDCL print messages to indicate some compensation is being done?
-#
-BROKEN_IN6ADDR_INIT_MACROS="#undef BROKEN_IN6ADDR_INIT_MACROS"
-
-case "$host" in
- *-aix5.1.*)
- hack_shutup_pthreadmutexinit=yes
- hack_shutup_in6addr_init_macros=yes
- ;;
- *-aix5.[[23]].*)
- hack_shutup_in6addr_init_macros=yes
- ;;
- *-bsdi3.1*)
- hack_shutup_sputaux=yes
- ;;
- *-bsdi4.0*)
- hack_shutup_sigwait=yes
- hack_shutup_sputaux=yes
- hack_shutup_in6addr_init_macros=yes
- ;;
- *-bsdi4.1*)
- hack_shutup_stdargcast=yes
- ;;
- *-hpux11.11)
- hack_shutup_in6addr_init_macros=yes
- ;;
- *-osf5.1|*-osf5.1b)
- hack_shutup_in6addr_init_macros=yes
- ;;
- *-solaris2.8)
- hack_shutup_in6addr_init_macros=yes
- ;;
- *-solaris2.9)
- hack_shutup_in6addr_init_macros=yes
- ;;
- *-solaris2.1[[0-9]])
- hack_shutup_in6addr_init_macros=yes
- ;;
-esac
-
-case "$hack_shutup_pthreadmutexinit" in
- yes)
- #
- # Shut up PTHREAD_MUTEX_INITIALIZER unbraced
- # initializer warnings.
- #
- AC_DEFINE(SHUTUP_MUTEX_INITIALIZER)
- ;;
-esac
-
-case "$hack_shutup_sigwait" in
- yes)
- #
- # Shut up a -Wmissing-prototypes warning for sigwait().
- #
- AC_DEFINE(SHUTUP_SIGWAIT)
- ;;
-esac
-
-case "$hack_shutup_sputaux" in
- yes)
- #
- # Shut up a -Wmissing-prototypes warning from <stdio.h>.
- #
- AC_DEFINE(SHUTUP_SPUTAUX)
- ;;
-esac
-
-case "$hack_shutup_stdargcast" in
- yes)
- #
- # Shut up a -Wcast-qual warning from va_start().
- #
- AC_DEFINE(SHUTUP_STDARG_CAST)
- ;;
-esac
-
-case "$hack_shutup_in6addr_init_macros" in
- yes)
- AC_DEFINE(BROKEN_IN6ADDR_INIT_MACROS, 1, [Defined if IN6ADDR_ANY_INIT and IN6ADDR_LOOPBACK_INIT need to be redefined.] )
- ;;
-esac
-
-#
-# Substitutions
-#
-AC_SUBST(BIND9_TOP_BUILDDIR)
-BIND9_TOP_BUILDDIR=`pwd`
-
-AC_SUBST_FILE(BIND9_INCLUDES)
-BIND9_INCLUDES=$BIND9_TOP_BUILDDIR/make/includes
-
-AC_SUBST_FILE(BIND9_MAKE_RULES)
-BIND9_MAKE_RULES=$BIND9_TOP_BUILDDIR/make/rules
-
-. $srcdir/../../version
-BIND9_VERSION="VERSION=${MAJORVER}.${MINORVER}.${PATCHVER}${RELEASETYPE}${RELEASEVER}"
-AC_SUBST(BIND9_VERSION)
-
-AC_SUBST_FILE(LIBBIND_API)
-LIBBIND_API=$srcdir/api
-
-AC_OUTPUT(
- make/rules
- make/mkdep
- make/includes
- Makefile
- bsd/Makefile
- dst/Makefile
- include/Makefile
- inet/Makefile
- irs/Makefile
- isc/Makefile
- nameser/Makefile
- port_after.h
- port_before.h
- resolv/Makefile
- port/Makefile
- ${PORT_DIR}/Makefile
- ${PORT_INCLUDE}/Makefile
- include/isc/platform.h
-)
-
-# Tell Emacs to edit this file in shell mode.
-# Local Variables:
-# mode: sh
-# End:
diff --git a/lib/bind/dst/Makefile.in b/lib/bind/dst/Makefile.in
deleted file mode 100644
index a841d4900862..000000000000
--- a/lib/bind/dst/Makefile.in
+++ /dev/null
@@ -1,32 +0,0 @@
-# Copyright (C) 2004, 2008 Internet Systems Consortium, Inc. ("ISC")
-# Copyright (C) 2001 Internet Software Consortium.
-#
-# Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS. IN NO EVENT SHALL ISC 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.in,v 1.6.18.2 2008/03/20 23:46:01 tbox Exp $
-
-srcdir= @srcdir@
-VPATH = @srcdir@
-
-OBJS= dst_api.@O@ hmac_link.@O@ md5_dgst.@O@ support.@O@
-
-SRCS= dst_api.c hmac_link.c md5_dgst.c support.c
-
-TARGETS= ${OBJS}
-
-CRYPTFLAGS= -DCYLINK_DSS -DHMAC_MD5 -DUSE_MD5 -DDNSSAFE
-
-CINCLUDES= -I.. -I../include -I${srcdir}/../include ${CRYPTINCL}
-CDEFINES= ${CRYPTFLAGS}
-
-@BIND9_MAKE_RULES@
diff --git a/lib/bind/dst/dst_api.c b/lib/bind/dst/dst_api.c
deleted file mode 100644
index 5bcd80a5c877..000000000000
--- a/lib/bind/dst/dst_api.c
+++ /dev/null
@@ -1,1048 +0,0 @@
-#ifndef LINT
-static const char rcsid[] = "$Header: /proj/cvs/prod/bind9/lib/bind/dst/Attic/dst_api.c,v 1.10.332.7 2007/09/26 04:41:47 each Exp $";
-#endif
-
-/*
- * Portions Copyright (c) 1995-1998 by Trusted Information Systems, Inc.
- *
- * 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 TRUSTED INFORMATION SYSTEMS
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
- * TRUSTED INFORMATION SYSTEMS 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 THE SOFTWARE.
- */
-/*
- * This file contains the interface between the DST API and the crypto API.
- * This is the only file that needs to be changed if the crypto system is
- * changed. Exported functions are:
- * void dst_init() Initialize the toolkit
- * int dst_check_algorithm() Function to determines if alg is suppored.
- * int dst_compare_keys() Function to compare two keys for equality.
- * int dst_sign_data() Incremental signing routine.
- * int dst_verify_data() Incremental verify routine.
- * int dst_generate_key() Function to generate new KEY
- * DST_KEY *dst_read_key() Function to retrieve private/public KEY.
- * void dst_write_key() Function to write out a key.
- * DST_KEY *dst_dnskey_to_key() Function to convert DNS KEY RR to a DST
- * KEY structure.
- * int dst_key_to_dnskey() Function to return a public key in DNS
- * format binary
- * DST_KEY *dst_buffer_to_key() Converst a data in buffer to KEY
- * int *dst_key_to_buffer() Writes out DST_KEY key matterial in buffer
- * void dst_free_key() Releases all memory referenced by key structure
- */
-
-#include "port_before.h"
-#include <stdio.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <memory.h>
-#include <ctype.h>
-#include <time.h>
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <resolv.h>
-
-#include "dst_internal.h"
-#include "port_after.h"
-
-/* static variables */
-static int done_init = 0;
-dst_func *dst_t_func[DST_MAX_ALGS];
-const char *key_file_fmt_str = "Private-key-format: v%s\nAlgorithm: %d (%s)\n";
-const char *dst_path = "";
-
-/* internal I/O functions */
-static DST_KEY *dst_s_read_public_key(const char *in_name,
- const u_int16_t in_id, int in_alg);
-static int dst_s_read_private_key_file(char *name, DST_KEY *pk_key,
- u_int16_t in_id, int in_alg);
-static int dst_s_write_public_key(const DST_KEY *key);
-static int dst_s_write_private_key(const DST_KEY *key);
-
-/* internal function to set up data structure */
-static DST_KEY *dst_s_get_key_struct(const char *name, const int alg,
- const int flags, const int protocol,
- const int bits);
-
-/*%
- * dst_init
- * This function initializes the Digital Signature Toolkit.
- * Right now, it just checks the DSTKEYPATH environment variable.
- * Parameters
- * none
- * Returns
- * none
- */
-void
-dst_init()
-{
- char *s;
- int len;
-
- if (done_init != 0)
- return;
- done_init = 1;
-
- s = getenv("DSTKEYPATH");
- len = 0;
- if (s) {
- struct stat statbuf;
-
- len = strlen(s);
- if (len > PATH_MAX) {
- EREPORT(("%s is longer than %d characters, ignoring\n",
- s, PATH_MAX));
- } else if (stat(s, &statbuf) != 0 || !S_ISDIR(statbuf.st_mode)) {
- EREPORT(("%s is not a valid directory\n", s));
- } else {
- char *tmp;
- tmp = (char *) malloc(len + 2);
- memcpy(tmp, s, len + 1);
- if (tmp[strlen(tmp) - 1] != '/') {
- tmp[strlen(tmp) + 1] = 0;
- tmp[strlen(tmp)] = '/';
- }
- dst_path = tmp;
- }
- }
- memset(dst_t_func, 0, sizeof(dst_t_func));
- /* first one is selected */
- dst_hmac_md5_init();
-}
-
-/*%
- * dst_check_algorithm
- * This function determines if the crypto system for the specified
- * algorithm is present.
- * Parameters
- * alg 1 KEY_RSA
- * 3 KEY_DSA
- * 157 KEY_HMAC_MD5
- * future algorithms TBD and registered with IANA.
- * Returns
- * 1 - The algorithm is available.
- * 0 - The algorithm is not available.
- */
-int
-dst_check_algorithm(const int alg)
-{
- return (dst_t_func[alg] != NULL);
-}
-
-/*%
- * dst_s_get_key_struct
- * This function allocates key structure and fills in some of the
- * fields of the structure.
- * Parameters:
- * name: the name of the key
- * alg: the algorithm number
- * flags: the dns flags of the key
- * protocol: the dns protocol of the key
- * bits: the size of the key
- * Returns:
- * NULL if error
- * valid pointer otherwise
- */
-static DST_KEY *
-dst_s_get_key_struct(const char *name, const int alg, const int flags,
- const int protocol, const int bits)
-{
- DST_KEY *new_key = NULL;
-
- if (dst_check_algorithm(alg)) /*%< make sure alg is available */
- new_key = (DST_KEY *) malloc(sizeof(*new_key));
- if (new_key == NULL)
- return (NULL);
-
- memset(new_key, 0, sizeof(*new_key));
- new_key->dk_key_name = strdup(name);
- if (new_key->dk_key_name == NULL) {
- free(new_key);
- return (NULL);
- }
- new_key->dk_alg = alg;
- new_key->dk_flags = flags;
- new_key->dk_proto = protocol;
- new_key->dk_KEY_struct = NULL;
- new_key->dk_key_size = bits;
- new_key->dk_func = dst_t_func[alg];
- return (new_key);
-}
-
-/*%
- * dst_compare_keys
- * Compares two keys for equality.
- * Parameters
- * key1, key2 Two keys to be compared.
- * Returns
- * 0 The keys are equal.
- * non-zero The keys are not equal.
- */
-
-int
-dst_compare_keys(const DST_KEY *key1, const DST_KEY *key2)
-{
- if (key1 == key2)
- return (0);
- if (key1 == NULL || key2 == NULL)
- return (4);
- if (key1->dk_alg != key2->dk_alg)
- return (1);
- if (key1->dk_key_size != key2->dk_key_size)
- return (2);
- if (key1->dk_id != key2->dk_id)
- return (3);
- return (key1->dk_func->compare(key1, key2));
-}
-
-/*%
- * dst_sign_data
- * An incremental signing function. Data is signed in steps.
- * First the context must be initialized (SIG_MODE_INIT).
- * Then data is hashed (SIG_MODE_UPDATE). Finally the signature
- * itself is created (SIG_MODE_FINAL). This function can be called
- * once with INIT, UPDATE and FINAL modes all set, or it can be
- * called separately with a different mode set for each step. The
- * UPDATE step can be repeated.
- * Parameters
- * mode A bit mask used to specify operation(s) to be performed.
- * SIG_MODE_INIT 1 Initialize digest
- * SIG_MODE_UPDATE 2 Add data to digest
- * SIG_MODE_FINAL 4 Generate signature
- * from signature
- * SIG_MODE_ALL (SIG_MODE_INIT,SIG_MODE_UPDATE,SIG_MODE_FINAL
- * data Data to be signed.
- * len The length in bytes of data to be signed.
- * in_key Contains a private key to sign with.
- * KEY structures should be handled (created, converted,
- * compared, stored, freed) by the DST.
- * signature
- * The location to which the signature will be written.
- * sig_len Length of the signature field in bytes.
- * Return
- * 0 Successfull INIT or Update operation
- * &gt;0 success FINAL (sign) operation
- * &lt;0 failure
- */
-
-int
-dst_sign_data(const int mode, DST_KEY *in_key, void **context,
- const u_char *data, const int len,
- u_char *signature, const int sig_len)
-{
- DUMP(data, mode, len, "dst_sign_data()");
-
- if (mode & SIG_MODE_FINAL &&
- (in_key->dk_KEY_struct == NULL || signature == NULL))
- return (MISSING_KEY_OR_SIGNATURE);
-
- if (in_key->dk_func && in_key->dk_func->sign)
- return (in_key->dk_func->sign(mode, in_key, context, data, len,
- signature, sig_len));
- return (UNKNOWN_KEYALG);
-}
-
-/*%
- * dst_verify_data
- * An incremental verify function. Data is verified in steps.
- * First the context must be initialized (SIG_MODE_INIT).
- * Then data is hashed (SIG_MODE_UPDATE). Finally the signature
- * is verified (SIG_MODE_FINAL). This function can be called
- * once with INIT, UPDATE and FINAL modes all set, or it can be
- * called separately with a different mode set for each step. The
- * UPDATE step can be repeated.
- * Parameters
- * mode Operations to perform this time.
- * SIG_MODE_INIT 1 Initialize digest
- * SIG_MODE_UPDATE 2 add data to digest
- * SIG_MODE_FINAL 4 verify signature
- * SIG_MODE_ALL
- * (SIG_MODE_INIT,SIG_MODE_UPDATE,SIG_MODE_FINAL)
- * data Data to pass through the hash function.
- * len Length of the data in bytes.
- * in_key Key for verification.
- * signature Location of signature.
- * sig_len Length of the signature in bytes.
- * Returns
- * 0 Verify success
- * Non-Zero Verify Failure
- */
-
-int
-dst_verify_data(const int mode, DST_KEY *in_key, void **context,
- const u_char *data, const int len,
- const u_char *signature, const int sig_len)
-{
- DUMP(data, mode, len, "dst_verify_data()");
- if (mode & SIG_MODE_FINAL &&
- (in_key->dk_KEY_struct == NULL || signature == NULL))
- return (MISSING_KEY_OR_SIGNATURE);
-
- if (in_key->dk_func == NULL || in_key->dk_func->verify == NULL)
- return (UNSUPPORTED_KEYALG);
- return (in_key->dk_func->verify(mode, in_key, context, data, len,
- signature, sig_len));
-}
-
-/*%
- * dst_read_private_key
- * Access a private key. First the list of private keys that have
- * already been read in is searched, then the key accessed on disk.
- * If the private key can be found, it is returned. If the key cannot
- * be found, a null pointer is returned. The options specify required
- * key characteristics. If the private key requested does not have
- * these characteristics, it will not be read.
- * Parameters
- * in_keyname The private key name.
- * in_id The id of the private key.
- * options DST_FORCE_READ Read from disk - don't use a previously
- * read key.
- * DST_CAN_SIGN The key must be useable for signing.
- * DST_NO_AUTHEN The key must be useable for authentication.
- * DST_STANDARD Return any key
- * Returns
- * NULL If there is no key found in the current directory or
- * this key has not been loaded before.
- * !NULL Success - KEY structure returned.
- */
-
-DST_KEY *
-dst_read_key(const char *in_keyname, const u_int16_t in_id,
- const int in_alg, const int type)
-{
- char keyname[PATH_MAX];
- DST_KEY *dg_key = NULL, *pubkey = NULL;
-
- if (!dst_check_algorithm(in_alg)) { /*%< make sure alg is available */
- EREPORT(("dst_read_private_key(): Algorithm %d not suppored\n",
- in_alg));
- return (NULL);
- }
- if ((type & (DST_PUBLIC | DST_PRIVATE)) == 0)
- return (NULL);
- if (in_keyname == NULL) {
- EREPORT(("dst_read_private_key(): Null key name passed in\n"));
- return (NULL);
- } else if (strlen(in_keyname) >= sizeof(keyname)) {
- EREPORT(("dst_read_private_key(): keyname too big\n"));
- return (NULL);
- } else
- strcpy(keyname, in_keyname);
-
- /* before I read in the public key, check if it is allowed to sign */
- if ((pubkey = dst_s_read_public_key(keyname, in_id, in_alg)) == NULL)
- return (NULL);
-
- if (type == DST_PUBLIC)
- return pubkey;
-
- if (!(dg_key = dst_s_get_key_struct(keyname, pubkey->dk_alg,
- pubkey->dk_flags, pubkey->dk_proto,
- 0)))
- return (dg_key);
- /* Fill in private key and some fields in the general key structure */
- if (dst_s_read_private_key_file(keyname, dg_key, pubkey->dk_id,
- pubkey->dk_alg) == 0)
- dg_key = dst_free_key(dg_key);
-
- (void)dst_free_key(pubkey);
- return (dg_key);
-}
-
-int
-dst_write_key(const DST_KEY *key, const int type)
-{
- int pub = 0, priv = 0;
-
- if (key == NULL)
- return (0);
- if (!dst_check_algorithm(key->dk_alg)) { /*%< make sure alg is available */
- EREPORT(("dst_write_key(): Algorithm %d not suppored\n",
- key->dk_alg));
- return (UNSUPPORTED_KEYALG);
- }
- if ((type & (DST_PRIVATE|DST_PUBLIC)) == 0)
- return (0);
-
- if (type & DST_PUBLIC)
- if ((pub = dst_s_write_public_key(key)) < 0)
- return (pub);
- if (type & DST_PRIVATE)
- if ((priv = dst_s_write_private_key(key)) < 0)
- return (priv);
- return (priv+pub);
-}
-
-/*%
- * dst_write_private_key
- * Write a private key to disk. The filename will be of the form:
- * K&lt;key-&gt;dk_name&gt;+&lt;key-&gt;dk_alg+&gt;&lt;key-d&gt;k_id.&gt;&lt;private key suffix&gt;.
- * If there is already a file with this name, an error is returned.
- *
- * Parameters
- * key A DST managed key structure that contains
- * all information needed about a key.
- * Return
- * &gt;= 0 Correct behavior. Returns length of encoded key value
- * written to disk.
- * &lt; 0 error.
- */
-
-static int
-dst_s_write_private_key(const DST_KEY *key)
-{
- u_char encoded_block[RAW_KEY_SIZE];
- char file[PATH_MAX];
- int len;
- FILE *fp;
-
- /* First encode the key into the portable key format */
- if (key == NULL)
- return (-1);
- if (key->dk_KEY_struct == NULL)
- return (0); /*%< null key has no private key */
- if (key->dk_func == NULL || key->dk_func->to_file_fmt == NULL) {
- EREPORT(("dst_write_private_key(): Unsupported operation %d\n",
- key->dk_alg));
- return (-5);
- } else if ((len = key->dk_func->to_file_fmt(key, (char *)encoded_block,
- sizeof(encoded_block))) <= 0) {
- EREPORT(("dst_write_private_key(): Failed encoding private RSA bsafe key %d\n", len));
- return (-8);
- }
- /* Now I can create the file I want to use */
- dst_s_build_filename(file, key->dk_key_name, key->dk_id, key->dk_alg,
- PRIVATE_KEY, PATH_MAX);
-
- /* Do not overwrite an existing file */
- if ((fp = dst_s_fopen(file, "w", 0600)) != NULL) {
- int nn;
- if ((nn = fwrite(encoded_block, 1, len, fp)) != len) {
- EREPORT(("dst_write_private_key(): Write failure on %s %d != %d errno=%d\n",
- file, len, nn, errno));
- fclose(fp);
- return (-5);
- }
- fclose(fp);
- } else {
- EREPORT(("dst_write_private_key(): Can not create file %s\n"
- ,file));
- return (-6);
- }
- memset(encoded_block, 0, len);
- return (len);
-}
-
-/*%
-*
- * dst_read_public_key
- * Read a public key from disk and store in a DST key structure.
- * Parameters
- * in_name K&lt;in_name&gt;&lt;in_id&gt;.&lt;public key suffix&gt; is the
- * filename of the key file to be read.
- * Returns
- * NULL If the key does not exist or no name is supplied.
- * NON-NULL Initialized key structure if the key exists.
- */
-
-static DST_KEY *
-dst_s_read_public_key(const char *in_name, const u_int16_t in_id, int in_alg)
-{
- int flags, proto, alg, len, dlen;
- int c;
- char name[PATH_MAX], enckey[RAW_KEY_SIZE], *notspace;
- u_char deckey[RAW_KEY_SIZE];
- FILE *fp;
-
- if (in_name == NULL) {
- EREPORT(("dst_read_public_key(): No key name given\n"));
- return (NULL);
- }
- if (dst_s_build_filename(name, in_name, in_id, in_alg, PUBLIC_KEY,
- PATH_MAX) == -1) {
- EREPORT(("dst_read_public_key(): Cannot make filename from %s, %d, and %s\n",
- in_name, in_id, PUBLIC_KEY));
- return (NULL);
- }
- /*
- * Open the file and read it's formatted contents up to key
- * File format:
- * domain.name [ttl] [IN] KEY &lt;flags&gt; &lt;protocol&gt; &lt;algorithm&gt; &lt;key&gt;
- * flags, proto, alg stored as decimal (or hex numbers FIXME).
- * (FIXME: handle parentheses for line continuation.)
- */
- if ((fp = dst_s_fopen(name, "r", 0)) == NULL) {
- EREPORT(("dst_read_public_key(): Public Key not found %s\n",
- name));
- return (NULL);
- }
- /* Skip domain name, which ends at first blank */
- while ((c = getc(fp)) != EOF)
- if (isspace(c))
- break;
- /* Skip blank to get to next field */
- while ((c = getc(fp)) != EOF)
- if (!isspace(c))
- break;
-
- /* Skip optional TTL -- if initial digit, skip whole word. */
- if (isdigit(c)) {
- while ((c = getc(fp)) != EOF)
- if (isspace(c))
- break;
- while ((c = getc(fp)) != EOF)
- if (!isspace(c))
- break;
- }
- /* Skip optional "IN" */
- if (c == 'I' || c == 'i') {
- while ((c = getc(fp)) != EOF)
- if (isspace(c))
- break;
- while ((c = getc(fp)) != EOF)
- if (!isspace(c))
- break;
- }
- /* Locate and skip "KEY" */
- if (c != 'K' && c != 'k') {
- EREPORT(("\"KEY\" doesn't appear in file: %s", name));
- return NULL;
- }
- while ((c = getc(fp)) != EOF)
- if (isspace(c))
- break;
- while ((c = getc(fp)) != EOF)
- if (!isspace(c))
- break;
- ungetc(c, fp); /*%< return the charcter to the input field */
- /* Handle hex!! FIXME. */
-
- if (fscanf(fp, "%d %d %d", &flags, &proto, &alg) != 3) {
- EREPORT(("dst_read_public_key(): Can not read flag/proto/alg field from %s\n"
- ,name));
- return (NULL);
- }
- /* read in the key string */
- fgets(enckey, sizeof(enckey), fp);
-
- /* If we aren't at end-of-file, something is wrong. */
- while ((c = getc(fp)) != EOF)
- if (!isspace(c))
- break;
- if (!feof(fp)) {
- EREPORT(("Key too long in file: %s", name));
- return NULL;
- }
- fclose(fp);
-
- if ((len = strlen(enckey)) <= 0)
- return (NULL);
-
- /* discard \n */
- enckey[--len] = '\0';
-
- /* remove leading spaces */
- for (notspace = (char *) enckey; isspace((*notspace)&0xff); len--)
- notspace++;
-
- dlen = b64_pton(notspace, deckey, sizeof(deckey));
- if (dlen < 0) {
- EREPORT(("dst_read_public_key: bad return from b64_pton = %d",
- dlen));
- return (NULL);
- }
- /* store key and info in a key structure that is returned */
-/* return dst_store_public_key(in_name, alg, proto, 666, flags, deckey,
- dlen);*/
- return dst_buffer_to_key(in_name, alg, flags, proto, deckey, dlen);
-}
-
-/*%
- * dst_write_public_key
- * Write a key to disk in DNS format.
- * Parameters
- * key Pointer to a DST key structure.
- * Returns
- * 0 Failure
- * 1 Success
- */
-
-static int
-dst_s_write_public_key(const DST_KEY *key)
-{
- FILE *fp;
- char filename[PATH_MAX];
- u_char out_key[RAW_KEY_SIZE];
- char enc_key[RAW_KEY_SIZE];
- int len = 0;
- int mode;
-
- memset(out_key, 0, sizeof(out_key));
- if (key == NULL) {
- EREPORT(("dst_write_public_key(): No key specified \n"));
- return (0);
- } else if ((len = dst_key_to_dnskey(key, out_key, sizeof(out_key)))< 0)
- return (0);
-
- /* Make the filename */
- if (dst_s_build_filename(filename, key->dk_key_name, key->dk_id,
- key->dk_alg, PUBLIC_KEY, PATH_MAX) == -1) {
- EREPORT(("dst_write_public_key(): Cannot make filename from %s, %d, and %s\n",
- key->dk_key_name, key->dk_id, PUBLIC_KEY));
- return (0);
- }
- /* XXX in general this should be a check for symmetric keys */
- mode = (key->dk_alg == KEY_HMAC_MD5) ? 0600 : 0644;
- /* create public key file */
- if ((fp = dst_s_fopen(filename, "w+", mode)) == NULL) {
- EREPORT(("DST_write_public_key: open of file:%s failed (errno=%d)\n",
- filename, errno));
- return (0);
- }
- /*write out key first base64 the key data */
- if (key->dk_flags & DST_EXTEND_FLAG)
- b64_ntop(&out_key[6], len - 6, enc_key, sizeof(enc_key));
- else
- b64_ntop(&out_key[4], len - 4, enc_key, sizeof(enc_key));
- fprintf(fp, "%s IN KEY %d %d %d %s\n",
- key->dk_key_name,
- key->dk_flags, key->dk_proto, key->dk_alg, enc_key);
- fclose(fp);
- return (1);
-}
-
-/*%
- * dst_dnskey_to_public_key
- * This function converts the contents of a DNS KEY RR into a DST
- * key structure.
- * Paramters
- * len Length of the RDATA of the KEY RR RDATA
- * rdata A pointer to the the KEY RR RDATA.
- * in_name Key name to be stored in key structure.
- * Returns
- * NULL Failure
- * NON-NULL Success. Pointer to key structure.
- * Caller's responsibility to free() it.
- */
-
-DST_KEY *
-dst_dnskey_to_key(const char *in_name, const u_char *rdata, const int len)
-{
- DST_KEY *key_st;
- int alg ;
- int start = DST_KEY_START;
-
- if (rdata == NULL || len <= DST_KEY_ALG) /*%< no data */
- return (NULL);
- alg = (u_int8_t) rdata[DST_KEY_ALG];
- if (!dst_check_algorithm(alg)) { /*%< make sure alg is available */
- EREPORT(("dst_dnskey_to_key(): Algorithm %d not suppored\n",
- alg));
- return (NULL);
- }
-
- if (in_name == NULL)
- return (NULL);
-
- if ((key_st = dst_s_get_key_struct(in_name, alg, 0, 0, 0)) == NULL)
- return (NULL);
-
- key_st->dk_id = dst_s_dns_key_id(rdata, len);
- key_st->dk_flags = dst_s_get_int16(rdata);
- key_st->dk_proto = (u_int16_t) rdata[DST_KEY_PROT];
- if (key_st->dk_flags & DST_EXTEND_FLAG) {
- u_int32_t ext_flags;
- ext_flags = (u_int32_t) dst_s_get_int16(&rdata[DST_EXT_FLAG]);
- key_st->dk_flags = key_st->dk_flags | (ext_flags << 16);
- start += 2;
- }
- /*
- * now point to the begining of the data representing the encoding
- * of the key
- */
- if (key_st->dk_func && key_st->dk_func->from_dns_key) {
- if (key_st->dk_func->from_dns_key(key_st, &rdata[start],
- len - start) > 0)
- return (key_st);
- } else
- EREPORT(("dst_dnskey_to_public_key(): unsuppored alg %d\n",
- alg));
-
- SAFE_FREE(key_st);
- return (key_st);
-}
-
-/*%
- * dst_public_key_to_dnskey
- * Function to encode a public key into DNS KEY wire format
- * Parameters
- * key Key structure to encode.
- * out_storage Location to write the encoded key to.
- * out_len Size of the output array.
- * Returns
- * <0 Failure
- * >=0 Number of bytes written to out_storage
- */
-
-int
-dst_key_to_dnskey(const DST_KEY *key, u_char *out_storage,
- const int out_len)
-{
- u_int16_t val;
- int loc = 0;
- int enc_len = 0;
- if (key == NULL)
- return (-1);
-
- if (!dst_check_algorithm(key->dk_alg)) { /*%< make sure alg is available */
- EREPORT(("dst_key_to_dnskey(): Algorithm %d not suppored\n",
- key->dk_alg));
- return (UNSUPPORTED_KEYALG);
- }
- memset(out_storage, 0, out_len);
- val = (u_int16_t)(key->dk_flags & 0xffff);
- dst_s_put_int16(out_storage, val);
- loc += 2;
-
- out_storage[loc++] = (u_char) key->dk_proto;
- out_storage[loc++] = (u_char) key->dk_alg;
-
- if (key->dk_flags > 0xffff) { /*%< Extended flags */
- val = (u_int16_t)((key->dk_flags >> 16) & 0xffff);
- dst_s_put_int16(&out_storage[loc], val);
- loc += 2;
- }
- if (key->dk_KEY_struct == NULL)
- return (loc);
- if (key->dk_func && key->dk_func->to_dns_key) {
- enc_len = key->dk_func->to_dns_key(key,
- (u_char *) &out_storage[loc],
- out_len - loc);
- if (enc_len > 0)
- return (enc_len + loc);
- else
- return (-1);
- } else
- EREPORT(("dst_key_to_dnskey(): Unsupported ALG %d\n",
- key->dk_alg));
- return (-1);
-}
-
-/*%
- * dst_buffer_to_key
- * Function to encode a string of raw data into a DST key
- * Parameters
- * alg The algorithm (HMAC only)
- * key A pointer to the data
- * keylen The length of the data
- * Returns
- * NULL an error occurred
- * NON-NULL the DST key
- */
-DST_KEY *
-dst_buffer_to_key(const char *key_name, /*!< name of the key */
- const int alg, /*!< algorithm */
- const int flags, /*!< dns flags */
- const int protocol, /*!< dns protocol */
- const u_char *key_buf, /*!< key in dns wire fmt */
- const int key_len) /*!< size of key */
-{
-
- DST_KEY *dkey = NULL;
- int dnslen;
- u_char dns[2048];
-
- if (!dst_check_algorithm(alg)) { /*%< make sure alg is available */
- EREPORT(("dst_buffer_to_key(): Algorithm %d not suppored\n", alg));
- return (NULL);
- }
-
- dkey = dst_s_get_key_struct(key_name, alg, flags, protocol, -1);
-
- if (dkey == NULL || dkey->dk_func == NULL ||
- dkey->dk_func->from_dns_key == NULL)
- return (dst_free_key(dkey));
-
- if (dkey->dk_func->from_dns_key(dkey, key_buf, key_len) < 0) {
- EREPORT(("dst_buffer_to_key(): dst_buffer_to_hmac failed\n"));
- return (dst_free_key(dkey));
- }
-
- dnslen = dst_key_to_dnskey(dkey, dns, sizeof(dns));
- dkey->dk_id = dst_s_dns_key_id(dns, dnslen);
- return (dkey);
-}
-
-int
-dst_key_to_buffer(DST_KEY *key, u_char *out_buff, int buf_len)
-{
- int len;
- /* this function will extrac the secret of HMAC into a buffer */
- if (key == NULL)
- return (0);
- if (key->dk_func != NULL && key->dk_func->to_dns_key != NULL) {
- len = key->dk_func->to_dns_key(key, out_buff, buf_len);
- if (len < 0)
- return (0);
- return (len);
- }
- return (0);
-}
-
-/*%
- * dst_s_read_private_key_file
- * Function reads in private key from a file.
- * Fills out the KEY structure.
- * Parameters
- * name Name of the key to be read.
- * pk_key Structure that the key is returned in.
- * in_id Key identifier (tag)
- * Return
- * 1 if everthing works
- * 0 if there is any problem
- */
-
-static int
-dst_s_read_private_key_file(char *name, DST_KEY *pk_key, u_int16_t in_id,
- int in_alg)
-{
- int cnt, alg, len, major, minor, file_major, file_minor;
- int ret, id;
- char filename[PATH_MAX];
- u_char in_buff[RAW_KEY_SIZE], *p;
- FILE *fp;
- int dnslen;
- u_char dns[2048];
-
- if (name == NULL || pk_key == NULL) {
- EREPORT(("dst_read_private_key_file(): No key name given\n"));
- return (0);
- }
- /* Make the filename */
- if (dst_s_build_filename(filename, name, in_id, in_alg, PRIVATE_KEY,
- PATH_MAX) == -1) {
- EREPORT(("dst_read_private_key(): Cannot make filename from %s, %d, and %s\n",
- name, in_id, PRIVATE_KEY));
- return (0);
- }
- /* first check if we can find the key file */
- if ((fp = dst_s_fopen(filename, "r", 0)) == NULL) {
- EREPORT(("dst_s_read_private_key_file: Could not open file %s in directory %s\n",
- filename, dst_path[0] ? dst_path :
- (char *) getcwd(NULL, PATH_MAX - 1)));
- return (0);
- }
- /* now read the header info from the file */
- if ((cnt = fread(in_buff, 1, sizeof(in_buff), fp)) < 5) {
- fclose(fp);
- EREPORT(("dst_s_read_private_key_file: error reading file %s (empty file)\n",
- filename));
- return (0);
- }
- /* decrypt key */
- fclose(fp);
- if (memcmp(in_buff, "Private-key-format: v", 20) != 0)
- goto fail;
- len = cnt;
- p = in_buff;
-
- if (!dst_s_verify_str((const char **) (void *)&p,
- "Private-key-format: v")) {
- EREPORT(("dst_s_read_private_key_file(): Not a Key file/Decrypt failed %s\n", name));
- goto fail;
- }
- /* read in file format */
- sscanf((char *)p, "%d.%d", &file_major, &file_minor);
- sscanf(KEY_FILE_FORMAT, "%d.%d", &major, &minor);
- if (file_major < 1) {
- EREPORT(("dst_s_read_private_key_file(): Unknown keyfile %d.%d version for %s\n",
- file_major, file_minor, name));
- goto fail;
- } else if (file_major > major || file_minor > minor)
- EREPORT((
- "dst_s_read_private_key_file(): Keyfile %s version higher than mine %d.%d MAY FAIL\n",
- name, file_major, file_minor));
-
- while (*p++ != '\n') ; /*%< skip to end of line */
-
- if (!dst_s_verify_str((const char **) (void *)&p, "Algorithm: "))
- goto fail;
-
- if (sscanf((char *)p, "%d", &alg) != 1)
- goto fail;
- while (*p++ != '\n') ; /*%< skip to end of line */
-
- if (pk_key->dk_key_name && !strcmp(pk_key->dk_key_name, name))
- SAFE_FREE2(pk_key->dk_key_name, strlen(pk_key->dk_key_name));
- pk_key->dk_key_name = (char *) strdup(name);
-
- /* allocate and fill in key structure */
- if (pk_key->dk_func == NULL || pk_key->dk_func->from_file_fmt == NULL)
- goto fail;
-
- ret = pk_key->dk_func->from_file_fmt(pk_key, (char *)p, &in_buff[len] - p);
- if (ret < 0)
- goto fail;
-
- dnslen = dst_key_to_dnskey(pk_key, dns, sizeof(dns));
- id = dst_s_dns_key_id(dns, dnslen);
-
- /* Make sure the actual key tag matches the input tag used in the filename
- */
- if (id != in_id) {
- EREPORT(("dst_s_read_private_key_file(): actual tag of key read %d != input tag used to build filename %d.\n", id, in_id));
- goto fail;
- }
- pk_key->dk_id = (u_int16_t) id;
- pk_key->dk_alg = alg;
- memset(in_buff, 0, cnt);
- return (1);
-
- fail:
- memset(in_buff, 0, cnt);
- return (0);
-}
-
-/*%
- * Generate and store a public/private keypair.
- * Keys will be stored in formatted files.
- *
- * Parameters
- &
- *\par name Name of the new key. Used to create key files
- *\li K&lt;name&gt;+&lt;alg&gt;+&lt;id&gt;.public and K&lt;name&gt;+&lt;alg&gt;+&lt;id&gt;.private.
- *\par bits Size of the new key in bits.
- *\par exp What exponent to use:
- *\li 0 use exponent 3
- *\li non-zero use Fermant4
- *\par flags The default value of the DNS Key flags.
- *\li The DNS Key RR Flag field is defined in RFC2065,
- * section 3.3. The field has 16 bits.
- *\par protocol
- *\li Default value of the DNS Key protocol field.
- *\li The DNS Key protocol field is defined in RFC2065,
- * section 3.4. The field has 8 bits.
- *\par alg What algorithm to use. Currently defined:
- *\li KEY_RSA 1
- *\li KEY_DSA 3
- *\li KEY_HMAC 157
- *\par out_id The key tag is returned.
- *
- * Return
- *\li NULL Failure
- *\li non-NULL the generated key pair
- * Caller frees the result, and its dk_name pointer.
- */
-DST_KEY *
-dst_generate_key(const char *name, const int bits, const int exp,
- const int flags, const int protocol, const int alg)
-{
- DST_KEY *new_key = NULL;
- int dnslen;
- u_char dns[2048];
-
- if (name == NULL)
- return (NULL);
-
- if (!dst_check_algorithm(alg)) { /*%< make sure alg is available */
- EREPORT(("dst_generate_key(): Algorithm %d not suppored\n", alg));
- return (NULL);
- }
-
- new_key = dst_s_get_key_struct(name, alg, flags, protocol, bits);
- if (new_key == NULL)
- return (NULL);
- if (bits == 0) /*%< null key we are done */
- return (new_key);
- if (new_key->dk_func == NULL || new_key->dk_func->generate == NULL) {
- EREPORT(("dst_generate_key_pair():Unsupported algorithm %d\n",
- alg));
- return (dst_free_key(new_key));
- }
- if (new_key->dk_func->generate(new_key, exp) <= 0) {
- EREPORT(("dst_generate_key_pair(): Key generation failure %s %d %d %d\n",
- new_key->dk_key_name, new_key->dk_alg,
- new_key->dk_key_size, exp));
- return (dst_free_key(new_key));
- }
-
- dnslen = dst_key_to_dnskey(new_key, dns, sizeof(dns));
- if (dnslen != UNSUPPORTED_KEYALG)
- new_key->dk_id = dst_s_dns_key_id(dns, dnslen);
- else
- new_key->dk_id = 0;
-
- return (new_key);
-}
-
-/*%
- * Release all data structures pointed to by a key structure.
- *
- * Parameters
- *\li f_key Key structure to be freed.
- */
-
-DST_KEY *
-dst_free_key(DST_KEY *f_key)
-{
-
- if (f_key == NULL)
- return (f_key);
- if (f_key->dk_func && f_key->dk_func->destroy)
- f_key->dk_KEY_struct =
- f_key->dk_func->destroy(f_key->dk_KEY_struct);
- else {
- EREPORT(("dst_free_key(): Unknown key alg %d\n",
- f_key->dk_alg));
- }
- if (f_key->dk_KEY_struct) {
- free(f_key->dk_KEY_struct);
- f_key->dk_KEY_struct = NULL;
- }
- if (f_key->dk_key_name)
- SAFE_FREE(f_key->dk_key_name);
- SAFE_FREE(f_key);
- return (NULL);
-}
-
-/*%
- * Return the maximim size of signature from the key specified in bytes
- *
- * Parameters
- *\li key
- *
- * Returns
- * \li bytes
- */
-int
-dst_sig_size(DST_KEY *key) {
- switch (key->dk_alg) {
- case KEY_HMAC_MD5:
- return (16);
- case KEY_HMAC_SHA1:
- return (20);
- case KEY_RSA:
- return (key->dk_key_size + 7) / 8;
- case KEY_DSA:
- return (40);
- default:
- EREPORT(("dst_sig_size(): Unknown key alg %d\n", key->dk_alg));
- return -1;
- }
-}
-
-/*! \file */
diff --git a/lib/bind/dst/dst_internal.h b/lib/bind/dst/dst_internal.h
deleted file mode 100644
index e9bc6fc08db9..000000000000
--- a/lib/bind/dst/dst_internal.h
+++ /dev/null
@@ -1,155 +0,0 @@
-#ifndef DST_INTERNAL_H
-#define DST_INTERNAL_H
-
-/*
- * Portions Copyright (c) 1995-1998 by Trusted Information Systems, Inc.
- *
- * 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 TRUSTED INFORMATION SYSTEMS
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
- * TRUSTED INFORMATION SYSTEMS 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 THE SOFTWARE.
- */
-#include <limits.h>
-#include <sys/param.h>
-#if (!defined(BSD)) || (BSD < 199306)
-# include <sys/bitypes.h>
-#else
-# include <sys/types.h>
-#endif
-
-#ifndef PATH_MAX
-# ifdef POSIX_PATH_MAX
-# define PATH_MAX POSIX_PATH_MAX
-# else
-# define PATH_MAX 255 /*%< this is the value of POSIX_PATH_MAX */
-# endif
-#endif
-
-typedef struct dst_key {
- char *dk_key_name; /*%< name of the key */
- int dk_key_size; /*%< this is the size of the key in bits */
- int dk_proto; /*%< what protocols this key can be used for */
- int dk_alg; /*%< algorithm number from key record */
- u_int32_t dk_flags; /*%< and the flags of the public key */
- u_int16_t dk_id; /*%< identifier of the key */
- void *dk_KEY_struct; /*%< pointer to key in crypto pkg fmt */
- struct dst_func *dk_func; /*%< point to cryptto pgk specific function table */
-} DST_KEY;
-#define HAS_DST_KEY
-
-#include <isc/dst.h>
-/*
- * define what crypto systems are supported for RSA,
- * BSAFE is prefered over RSAREF; only one can be set at any time
- */
-#if defined(BSAFE) && defined(RSAREF)
-# error "Cannot have both BSAFE and RSAREF defined"
-#endif
-
-/* Declare dst_lib specific constants */
-#define KEY_FILE_FORMAT "1.2"
-
-/* suffixes for key file names */
-#define PRIVATE_KEY "private"
-#define PUBLIC_KEY "key"
-
-/* error handling */
-#ifdef REPORT_ERRORS
-#define EREPORT(str) printf str
-#else
-#define EREPORT(str) (void)0
-#endif
-
-/* use our own special macro to FRRE memory */
-
-#ifndef SAFE_FREE
-#define SAFE_FREE(a) \
-do{if(a != NULL){memset(a,0, sizeof(*a)); free(a); a=NULL;}} while (0)
-#define SAFE_FREE2(a,s) if (a != NULL && (long)s > 0){memset(a,0, s);free(a); a=NULL;}
-#endif
-
-typedef struct dst_func {
- int (*sign)(const int mode, DST_KEY *key, void **context,
- const u_int8_t *data, const int len,
- u_int8_t *signature, const int sig_len);
- int (*verify)(const int mode, DST_KEY *key, void **context,
- const u_int8_t *data, const int len,
- const u_int8_t *signature, const int sig_len);
- int (*compare)(const DST_KEY *key1, const DST_KEY *key2);
- int (*generate)(DST_KEY *key, int parms);
- void *(*destroy)(void *key);
- /* conversion functions */
- int (*to_dns_key)(const DST_KEY *key, u_int8_t *out,
- const int out_len);
- int (*from_dns_key)(DST_KEY *key, const u_int8_t *str,
- const int str_len);
- int (*to_file_fmt)(const DST_KEY *key, char *out,
- const int out_len);
- int (*from_file_fmt)(DST_KEY *key, const char *out,
- const int out_len);
-
-} dst_func;
-
-extern dst_func *dst_t_func[DST_MAX_ALGS];
-extern const char *key_file_fmt_str;
-extern const char *dst_path;
-
-#ifndef DST_HASH_SIZE
-#define DST_HASH_SIZE 20 /*%< RIPEMD160 and SHA-1 are 20 bytes MD5 is 16 */
-#endif
-
-int dst_bsafe_init(void);
-
-int dst_rsaref_init(void);
-
-int dst_hmac_md5_init(void);
-
-int dst_cylink_init(void);
-
-int dst_eay_dss_init(void);
-
-/* from higher level support routines */
-int dst_s_calculate_bits( const u_int8_t *str, const int max_bits);
-int dst_s_verify_str( const char **buf, const char *str);
-
-
-/* conversion between dns names and key file names */
-size_t dst_s_filename_length( const char *name, const char *suffix);
-int dst_s_build_filename( char *filename, const char *name,
- u_int16_t id, int alg, const char *suffix,
- size_t filename_length);
-
-FILE *dst_s_fopen (const char *filename, const char *mode, int perm);
-
-/*%
- * read and write network byte order into u_int?_t
- * all of these should be retired
- */
-u_int16_t dst_s_get_int16( const u_int8_t *buf);
-void dst_s_put_int16( u_int8_t *buf, const u_int16_t val);
-
-u_int32_t dst_s_get_int32( const u_int8_t *buf);
-void dst_s_put_int32( u_int8_t *buf, const u_int32_t val);
-
-#ifdef DUMP
-# undef DUMP
-# define DUMP(a,b,c,d) dst_s_dump(a,b,c,d)
-#else
-# define DUMP(a,b,c,d)
-#endif
-void
-dst_s_dump(const int mode, const u_char *data, const int size,
- const char *msg);
-
-
-
-#endif /* DST_INTERNAL_H */
-/*! \file */
diff --git a/lib/bind/dst/hmac_link.c b/lib/bind/dst/hmac_link.c
deleted file mode 100644
index cbd68f482780..000000000000
--- a/lib/bind/dst/hmac_link.c
+++ /dev/null
@@ -1,489 +0,0 @@
-#ifdef HMAC_MD5
-#ifndef LINT
-static const char rcsid[] = "$Header: /proj/cvs/prod/bind9/lib/bind/dst/Attic/hmac_link.c,v 1.3.164.5 2007/09/26 04:41:47 each Exp $";
-#endif
-/*
- * Portions Copyright (c) 1995-1998 by Trusted Information Systems, Inc.
- *
- * 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 TRUSTED INFORMATION SYSTEMS
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
- * TRUSTED INFORMATION SYSTEMS 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 THE SOFTWARE.
- */
-
-/*%
- * This file contains an implementation of the HMAC-MD5 algorithm.
- */
-#include "port_before.h"
-
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <memory.h>
-#include <sys/param.h>
-#include <sys/time.h>
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <resolv.h>
-
-#include "dst_internal.h"
-
-#ifdef USE_MD5
-# ifndef HAVE_MD5
-# include "md5.h"
-# else
-# ifdef SOLARIS2
-# include <sys/md5.h>
-# endif
-# endif
-# ifndef _MD5_H_
-# define _MD5_H_ 1 /*%< make sure we do not include rsaref md5.h file */
-# endif
-#endif
-
-#include "port_after.h"
-
-
-#define HMAC_LEN 64
-#define HMAC_IPAD 0x36
-#define HMAC_OPAD 0x5c
-#define MD5_LEN 16
-
-
-typedef struct hmackey {
- u_char hk_ipad[64], hk_opad[64];
-} HMAC_Key;
-
-
-/**************************************************************************
- * dst_hmac_md5_sign
- * Call HMAC signing functions to sign a block of data.
- * There are three steps to signing, INIT (initialize structures),
- * UPDATE (hash (more) data), FINAL (generate a signature). This
- * routine performs one or more of these steps.
- * Parameters
- * mode SIG_MODE_INIT, SIG_MODE_UPDATE and/or SIG_MODE_FINAL.
- * priv_key key to use for signing.
- * context the context to be used in this digest
- * data data to be signed.
- * len length in bytes of data.
- * signature location to store signature.
- * sig_len size of the signature location
- * returns
- * N Success on SIG_MODE_FINAL = returns signature length in bytes
- * 0 Success on SIG_MODE_INIT and UPDATE
- * <0 Failure
- */
-
-static int
-dst_hmac_md5_sign(const int mode, DST_KEY *d_key, void **context,
- const u_char *data, const int len,
- u_char *signature, const int sig_len)
-{
- HMAC_Key *key;
- int sign_len = 0;
- MD5_CTX *ctx = NULL;
-
- if (d_key == NULL || d_key->dk_KEY_struct == NULL)
- return (-1);
-
- if (mode & SIG_MODE_INIT)
- ctx = (MD5_CTX *) malloc(sizeof(*ctx));
- else if (context)
- ctx = (MD5_CTX *) *context;
- if (ctx == NULL)
- return (-1);
-
- key = (HMAC_Key *) d_key->dk_KEY_struct;
-
- if (mode & SIG_MODE_INIT) {
- MD5Init(ctx);
- MD5Update(ctx, key->hk_ipad, HMAC_LEN);
- }
-
- if ((mode & SIG_MODE_UPDATE) && (data && len > 0))
- MD5Update(ctx, data, len);
-
- if (mode & SIG_MODE_FINAL) {
- if (signature == NULL || sig_len < MD5_LEN)
- return (SIGN_FINAL_FAILURE);
- MD5Final(signature, ctx);
-
- /* perform outer MD5 */
- MD5Init(ctx);
- MD5Update(ctx, key->hk_opad, HMAC_LEN);
- MD5Update(ctx, signature, MD5_LEN);
- MD5Final(signature, ctx);
- sign_len = MD5_LEN;
- SAFE_FREE(ctx);
- }
- else {
- if (context == NULL)
- return (-1);
- *context = (void *) ctx;
- }
- return (sign_len);
-}
-
-
-/**************************************************************************
- * dst_hmac_md5_verify()
- * Calls HMAC verification routines. There are three steps to
- * verification, INIT (initialize structures), UPDATE (hash (more) data),
- * FINAL (generate a signature). This routine performs one or more of
- * these steps.
- * Parameters
- * mode SIG_MODE_INIT, SIG_MODE_UPDATE and/or SIG_MODE_FINAL.
- * dkey key to use for verify.
- * data data signed.
- * len length in bytes of data.
- * signature signature.
- * sig_len length in bytes of signature.
- * returns
- * 0 Success
- * <0 Failure
- */
-
-static int
-dst_hmac_md5_verify(const int mode, DST_KEY *d_key, void **context,
- const u_char *data, const int len,
- const u_char *signature, const int sig_len)
-{
- HMAC_Key *key;
- MD5_CTX *ctx = NULL;
-
- if (d_key == NULL || d_key->dk_KEY_struct == NULL)
- return (-1);
-
- if (mode & SIG_MODE_INIT)
- ctx = (MD5_CTX *) malloc(sizeof(*ctx));
- else if (context)
- ctx = (MD5_CTX *) *context;
- if (ctx == NULL)
- return (-1);
-
- key = (HMAC_Key *) d_key->dk_KEY_struct;
- if (mode & SIG_MODE_INIT) {
- MD5Init(ctx);
- MD5Update(ctx, key->hk_ipad, HMAC_LEN);
- }
- if ((mode & SIG_MODE_UPDATE) && (data && len > 0))
- MD5Update(ctx, data, len);
-
- if (mode & SIG_MODE_FINAL) {
- u_char digest[MD5_LEN];
- if (signature == NULL || key == NULL || sig_len != MD5_LEN)
- return (VERIFY_FINAL_FAILURE);
- MD5Final(digest, ctx);
-
- /* perform outer MD5 */
- MD5Init(ctx);
- MD5Update(ctx, key->hk_opad, HMAC_LEN);
- MD5Update(ctx, digest, MD5_LEN);
- MD5Final(digest, ctx);
-
- SAFE_FREE(ctx);
- if (memcmp(digest, signature, MD5_LEN) != 0)
- return (VERIFY_FINAL_FAILURE);
- }
- else {
- if (context == NULL)
- return (-1);
- *context = (void *) ctx;
- }
- return (0);
-}
-
-
-/**************************************************************************
- * dst_buffer_to_hmac_md5
- * Converts key from raw data to an HMAC Key
- * This function gets in a pointer to the data
- * Parameters
- * hkey the HMAC key to be filled in
- * key the key in raw format
- * keylen the length of the key
- * Return
- * 0 Success
- * <0 Failure
- */
-static int
-dst_buffer_to_hmac_md5(DST_KEY *dkey, const u_char *key, const int keylen)
-{
- int i;
- HMAC_Key *hkey = NULL;
- MD5_CTX ctx;
- int local_keylen = keylen;
- u_char tk[MD5_LEN];
-
- if (dkey == NULL || key == NULL || keylen < 0)
- return (-1);
-
- if ((hkey = (HMAC_Key *) malloc(sizeof(HMAC_Key))) == NULL)
- return (-2);
-
- memset(hkey->hk_ipad, 0, sizeof(hkey->hk_ipad));
- memset(hkey->hk_opad, 0, sizeof(hkey->hk_opad));
-
- /* if key is longer than HMAC_LEN bytes reset it to key=MD5(key) */
- if (keylen > HMAC_LEN) {
- MD5Init(&ctx);
- MD5Update(&ctx, key, keylen);
- MD5Final(tk, &ctx);
- memset((void *) &ctx, 0, sizeof(ctx));
- key = tk;
- local_keylen = MD5_LEN;
- }
- /* start out by storing key in pads */
- memcpy(hkey->hk_ipad, key, local_keylen);
- memcpy(hkey->hk_opad, key, local_keylen);
-
- /* XOR key with hk_ipad and opad values */
- for (i = 0; i < HMAC_LEN; i++) {
- hkey->hk_ipad[i] ^= HMAC_IPAD;
- hkey->hk_opad[i] ^= HMAC_OPAD;
- }
- dkey->dk_key_size = local_keylen;
- dkey->dk_KEY_struct = (void *) hkey;
- return (1);
-}
-
-
-/**************************************************************************
- * dst_hmac_md5_key_to_file_format
- * Encodes an HMAC Key into the portable file format.
- * Parameters
- * hkey HMAC KEY structure
- * buff output buffer
- * buff_len size of output buffer
- * Return
- * 0 Failure - null input hkey
- * -1 Failure - not enough space in output area
- * N Success - Length of data returned in buff
- */
-
-static int
-dst_hmac_md5_key_to_file_format(const DST_KEY *dkey, char *buff,
- const int buff_len)
-{
- char *bp;
- int len, i, key_len;
- u_char key[HMAC_LEN];
- HMAC_Key *hkey;
-
- if (dkey == NULL || dkey->dk_KEY_struct == NULL)
- return (0);
- /*
- * Using snprintf() would be so much simpler here.
- */
- if (buff == NULL ||
- buff_len <= (int)(strlen(key_file_fmt_str) +
- strlen(KEY_FILE_FORMAT) + 4))
- return (-1); /*%< no OR not enough space in output area */
- hkey = (HMAC_Key *) dkey->dk_KEY_struct;
- memset(buff, 0, buff_len); /*%< just in case */
- /* write file header */
- sprintf(buff, key_file_fmt_str, KEY_FILE_FORMAT, KEY_HMAC_MD5, "HMAC");
-
- bp = buff + strlen(buff);
-
- memset(key, 0, HMAC_LEN);
- for (i = 0; i < HMAC_LEN; i++)
- key[i] = hkey->hk_ipad[i] ^ HMAC_IPAD;
- for (i = HMAC_LEN - 1; i >= 0; i--)
- if (key[i] != 0)
- break;
- key_len = i + 1;
-
- if (buff_len - (bp - buff) < 6)
- return (-1);
- strcat(bp, "Key: ");
- bp += strlen("Key: ");
-
- len = b64_ntop(key, key_len, bp, buff_len - (bp - buff));
- if (len < 0)
- return (-1);
- bp += len;
- if (buff_len - (bp - buff) < 2)
- return (-1);
- *(bp++) = '\n';
- *bp = '\0';
-
- return (bp - buff);
-}
-
-
-/**************************************************************************
- * dst_hmac_md5_key_from_file_format
- * Converts contents of a key file into an HMAC key.
- * Parameters
- * hkey structure to put key into
- * buff buffer containing the encoded key
- * buff_len the length of the buffer
- * Return
- * n >= 0 Foot print of the key converted
- * n < 0 Error in conversion
- */
-
-static int
-dst_hmac_md5_key_from_file_format(DST_KEY *dkey, const char *buff,
- const int buff_len)
-{
- const char *p = buff, *eol;
- u_char key[HMAC_LEN+1]; /* b64_pton needs more than 64 bytes do decode
- * it should probably be fixed rather than doing
- * this
- */
- u_char *tmp;
- int key_len, len;
-
- if (dkey == NULL)
- return (-2);
- if (buff == NULL || buff_len < 0)
- return (-1);
-
- memset(key, 0, sizeof(key));
-
- if (!dst_s_verify_str(&p, "Key: "))
- return (-3);
-
- eol = strchr(p, '\n');
- if (eol == NULL)
- return (-4);
- len = eol - p;
- tmp = malloc(len + 2);
- if (tmp == NULL)
- return (-5);
- memcpy(tmp, p, len);
- *(tmp + len) = 0x0;
- key_len = b64_pton((char *)tmp, key, HMAC_LEN+1); /*%< see above */
- SAFE_FREE2(tmp, len + 2);
-
- if (dst_buffer_to_hmac_md5(dkey, key, key_len) < 0) {
- return (-6);
- }
- return (0);
-}
-
-/*%
- * dst_hmac_md5_to_dns_key()
- * function to extract hmac key from DST_KEY structure
- * intput:
- * in_key: HMAC-MD5 key
- * output:
- * out_str: buffer to write ot
- * out_len: size of output buffer
- * returns:
- * number of bytes written to output buffer
- */
-static int
-dst_hmac_md5_to_dns_key(const DST_KEY *in_key, u_char *out_str,
- const int out_len)
-{
-
- HMAC_Key *hkey;
- int i;
-
- if (in_key == NULL || in_key->dk_KEY_struct == NULL ||
- out_len <= in_key->dk_key_size || out_str == NULL)
- return (-1);
-
- hkey = (HMAC_Key *) in_key->dk_KEY_struct;
- for (i = 0; i < in_key->dk_key_size; i++)
- out_str[i] = hkey->hk_ipad[i] ^ HMAC_IPAD;
- return (i);
-}
-
-/**************************************************************************
- * dst_hmac_md5_compare_keys
- * Compare two keys for equality.
- * Return
- * 0 The keys are equal
- * NON-ZERO The keys are not equal
- */
-
-static int
-dst_hmac_md5_compare_keys(const DST_KEY *key1, const DST_KEY *key2)
-{
- HMAC_Key *hkey1 = (HMAC_Key *) key1->dk_KEY_struct;
- HMAC_Key *hkey2 = (HMAC_Key *) key2->dk_KEY_struct;
- return memcmp(hkey1->hk_ipad, hkey2->hk_ipad, HMAC_LEN);
-}
-
-/**************************************************************************
- * dst_hmac_md5_free_key_structure
- * Frees all (none) dynamically allocated structures in hkey
- */
-
-static void *
-dst_hmac_md5_free_key_structure(void *key)
-{
- HMAC_Key *hkey = key;
- SAFE_FREE(hkey);
- return (NULL);
-}
-
-
-/***************************************************************************
- * dst_hmac_md5_generate_key
- * Creates a HMAC key of size size with a maximum size of 63 bytes
- * generating a HMAC key larger than 63 bytes makes no sense as that key
- * is digested before use.
- */
-
-static int
-dst_hmac_md5_generate_key(DST_KEY *key, const int nothing)
-{
- (void)key;
- (void)nothing;
- return (-1);
-}
-
-/*%
- * dst_hmac_md5_init() Function to answer set up function pointers for HMAC
- * related functions
- */
-int
-#ifdef SUNW_LIBMD5
-dst_md5_hmac_init()
-#else
-dst_hmac_md5_init()
-#endif
-{
- if (dst_t_func[KEY_HMAC_MD5] != NULL)
- return (1);
- dst_t_func[KEY_HMAC_MD5] = malloc(sizeof(struct dst_func));
- if (dst_t_func[KEY_HMAC_MD5] == NULL)
- return (0);
- memset(dst_t_func[KEY_HMAC_MD5], 0, sizeof(struct dst_func));
- dst_t_func[KEY_HMAC_MD5]->sign = dst_hmac_md5_sign;
- dst_t_func[KEY_HMAC_MD5]->verify = dst_hmac_md5_verify;
- dst_t_func[KEY_HMAC_MD5]->compare = dst_hmac_md5_compare_keys;
- dst_t_func[KEY_HMAC_MD5]->generate = dst_hmac_md5_generate_key;
- dst_t_func[KEY_HMAC_MD5]->destroy = dst_hmac_md5_free_key_structure;
- dst_t_func[KEY_HMAC_MD5]->to_dns_key = dst_hmac_md5_to_dns_key;
- dst_t_func[KEY_HMAC_MD5]->from_dns_key = dst_buffer_to_hmac_md5;
- dst_t_func[KEY_HMAC_MD5]->to_file_fmt = dst_hmac_md5_key_to_file_format;
- dst_t_func[KEY_HMAC_MD5]->from_file_fmt = dst_hmac_md5_key_from_file_format;
- return (1);
-}
-
-#else
-#define dst_hmac_md5_init __dst_hmac_md5_init
-
-int
-dst_hmac_md5_init(){
- return (0);
-}
-#endif
-
-/*! \file */
diff --git a/lib/bind/dst/md5.h b/lib/bind/dst/md5.h
deleted file mode 100644
index b1ed9e13fdaf..000000000000
--- a/lib/bind/dst/md5.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/* crypto/md/md5.h */
-/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
- * All rights reserved.
- *
- * This package is an SSL implementation written
- * by Eric Young (eay@cryptsoft.com).
- * The implementation was written so as to conform with Netscapes SSL.
- *
- * This library is free for commercial and non-commercial use as long as
- * the following conditions are aheared to. The following conditions
- * apply to all code found in this distribution, be it the RC4, RSA,
- * lhash, DES, etc., code; not just the SSL code. The SSL documentation
- * included with this distribution is covered by the same copyright terms
- * except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
- * Copyright remains Eric Young's, and as such any Copyright notices in
- * the code are not to be removed.
- * If this package is used in a product, Eric Young should be given attribution
- * as the author of the parts of the library used.
- * This can be in the form of a textual message at program startup or
- * in documentation (online or textual) provided with the package.
- *
- * 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 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 cryptographic software written by
- * Eric Young (eay@cryptsoft.com)"
- * The word 'cryptographic' can be left out if the rouines from the library
- * being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
- * the apps directory (application code) you must include an acknowledgement:
- * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
- * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 AUTHOR 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.
- *
- * The licence and distribution terms for any publically available version or
- * derivative of this code cannot be changed. i.e. this code cannot simply be
- * copied and put under another distribution licence
- * [including the GNU Public Licence.]
- */
-
-#ifndef HEADER_MD5_H
-#define HEADER_MD5_H
-
-#ifndef HAVE_MD5
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define MD5_CBLOCK 64
-#define MD5_LBLOCK 16
-#define MD5_BLOCK 16
-#define MD5_LAST_BLOCK 56
-#define MD5_LENGTH_BLOCK 8
-#define MD5_DIGEST_LENGTH 16
-
-typedef struct MD5state_st
- {
- unsigned long A,B,C,D;
- unsigned long Nl,Nh;
- unsigned long data[MD5_LBLOCK];
- int num;
- } MD5_CTX;
-
-#ifndef NOPROTO
-void MD5_Init(MD5_CTX *c);
-void MD5_Update(MD5_CTX *c, const unsigned char *data, unsigned long len);
-void MD5_Final(unsigned char *md, MD5_CTX *c);
-unsigned char *MD5(unsigned char *d, unsigned long n, unsigned char *md);
-#else
-void MD5_Init();
-void MD5_Update();
-void MD5_Final();
-unsigned char *MD5();
-#endif
-
-/* to provide backward compatabilty to RSAREF calls ogud@tis.com 1997/11/14 */
-#define MD5Init(c) MD5_Init(c)
-#define MD5Update(c,data, len) MD5_Update(c,data,len)
-#define MD5Final(md, c) MD5_Final(md, c)
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-#else
-#include <sys/md5.h>
-#endif /* HAVE_MD5 */
-
-/*! \file */
diff --git a/lib/bind/dst/md5_dgst.c b/lib/bind/dst/md5_dgst.c
deleted file mode 100644
index 76b0505760e7..000000000000
--- a/lib/bind/dst/md5_dgst.c
+++ /dev/null
@@ -1,374 +0,0 @@
-/* crypto/md/md5_dgst.c */
-/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
- * All rights reserved.
- *
- * This package is an SSL implementation written
- * by Eric Young (eay@cryptsoft.com).
- * The implementation was written so as to conform with Netscapes SSL.
- *
- * This library is free for commercial and non-commercial use as long as
- * the following conditions are aheared to. The following conditions
- * apply to all code found in this distribution, be it the RC4, RSA,
- * lhash, DES, etc., code; not just the SSL code. The SSL documentation
- * included with this distribution is covered by the same copyright terms
- * except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
- * Copyright remains Eric Young's, and as such any Copyright notices in
- * the code are not to be removed.
- * If this package is used in a product, Eric Young should be given attribution
- * as the author of the parts of the library used.
- * This can be in the form of a textual message at program startup or
- * in documentation (online or textual) provided with the package.
- *
- * 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 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 cryptographic software written by
- * Eric Young (eay@cryptsoft.com)"
- * The word 'cryptographic' can be left out if the rouines from the library
- * being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
- * the apps directory (application code) you must include an acknowledgement:
- * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
- * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 AUTHOR 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.
- *
- * The licence and distribution terms for any publically available version or
- * derivative of this code cannot be changed. i.e. this code cannot simply be
- * copied and put under another distribution licence
- * [including the GNU Public Licence.]
- */
-
-#ifdef USE_MD5 /*%< Added by ogud@tis.com 1998/1/26 */
-#include <port_before.h>
-#ifndef HAVE_MD5
-#include <stdio.h>
-#include "md5_locl.h"
-#include <port_after.h>
-
-const char *MD5_version="MD5 part of SSLeay 0.8.1 19-Jul-1997";
-
-/*! \file
- * \brief
- * Implemented from RFC1321 The MD5 Message-Digest Algorithm
- */
-
-#define INIT_DATA_A (unsigned long)0x67452301L
-#define INIT_DATA_B (unsigned long)0xefcdab89L
-#define INIT_DATA_C (unsigned long)0x98badcfeL
-#define INIT_DATA_D (unsigned long)0x10325476L
-
-#ifndef NOPROTO
-static void md5_block(MD5_CTX *c, unsigned long *p);
-#else
-static void md5_block();
-#endif
-
-void MD5_Init(c)
-MD5_CTX *c;
- {
- c->A=INIT_DATA_A;
- c->B=INIT_DATA_B;
- c->C=INIT_DATA_C;
- c->D=INIT_DATA_D;
- c->Nl=0;
- c->Nh=0;
- c->num=0;
- }
-
-void MD5_Update(c, data, len)
-MD5_CTX *c;
-register const unsigned char *data;
-unsigned long len;
- {
- register ULONG *p;
- int sw,sc;
- ULONG l;
-
- if (len == 0U) return;
-
- l=(c->Nl+(len<<3))&0xffffffffL;
- /* 95-05-24 eay Fixed a bug with the overflow handling, thanks to
- * Wei Dai <weidai@eskimo.com> for pointing it out. */
- if (l < c->Nl) /*%< overflow */
- c->Nh++;
- c->Nh+=(len>>29);
- c->Nl=l;
-
- if (c->num != 0)
- {
- p=c->data;
- sw=c->num>>2;
- sc=c->num&0x03;
-
- if ((c->num+len) >= (size_t)MD5_CBLOCK)
- {
- l= p[sw];
- p_c2l(data,l,sc);
- p[sw++]=l;
- for (; sw<MD5_LBLOCK; sw++)
- {
- c2l(data,l);
- p[sw]=l;
- }
- len-=(MD5_CBLOCK-c->num);
-
- md5_block(c,p);
- c->num=0;
- /* drop through and do the rest */
- }
- else
- {
- int ew,ec;
-
- c->num+=(int)len;
- if ((sc+len) < 4U) /*%< ugly, add char's to a word */
- {
- l= p[sw];
- p_c2l_p(data,l,sc,len);
- p[sw]=l;
- }
- else
- {
- ew=(c->num>>2);
- ec=(c->num&0x03);
- l= p[sw];
- p_c2l(data,l,sc);
- p[sw++]=l;
- for (; sw < ew; sw++)
- { c2l(data,l); p[sw]=l; }
- if (ec)
- {
- c2l_p(data,l,ec);
- p[sw]=l;
- }
- }
- return;
- }
- }
- /* we now can process the input data in blocks of MD5_CBLOCK
- * chars and save the leftovers to c->data. */
- p=c->data;
- while (len >= (size_t)MD5_CBLOCK)
- {
-#if defined(L_ENDIAN) || defined(B_ENDIAN)
- memcpy(p,data,MD5_CBLOCK);
- data+=MD5_CBLOCK;
-#ifdef B_ENDIAN
- for (sw=(MD5_LBLOCK/4); sw; sw--)
- {
- Endian_Reverse32(p[0]);
- Endian_Reverse32(p[1]);
- Endian_Reverse32(p[2]);
- Endian_Reverse32(p[3]);
- p+=4;
- }
-#endif
-#else
- for (sw=(MD5_LBLOCK/4); sw; sw--)
- {
- c2l(data,l); *(p++)=l;
- c2l(data,l); *(p++)=l;
- c2l(data,l); *(p++)=l;
- c2l(data,l); *(p++)=l;
- }
-#endif
- p=c->data;
- md5_block(c,p);
- len-=MD5_CBLOCK;
- }
- sc=(int)len;
- c->num=sc;
- if (sc)
- {
- sw=sc>>2; /*%< words to copy */
-#ifdef L_ENDIAN
- p[sw]=0;
- memcpy(p,data,sc);
-#else
- sc&=0x03;
- for ( ; sw; sw--)
- { c2l(data,l); *(p++)=l; }
- c2l_p(data,l,sc);
- *p=l;
-#endif
- }
- }
-
-static void md5_block(c, X)
-MD5_CTX *c;
-register ULONG *X;
- {
- register ULONG A,B,C,D;
-
- A=c->A;
- B=c->B;
- C=c->C;
- D=c->D;
-
- /* Round 0 */
- R0(A,B,C,D,X[ 0], 7,0xd76aa478L);
- R0(D,A,B,C,X[ 1],12,0xe8c7b756L);
- R0(C,D,A,B,X[ 2],17,0x242070dbL);
- R0(B,C,D,A,X[ 3],22,0xc1bdceeeL);
- R0(A,B,C,D,X[ 4], 7,0xf57c0fafL);
- R0(D,A,B,C,X[ 5],12,0x4787c62aL);
- R0(C,D,A,B,X[ 6],17,0xa8304613L);
- R0(B,C,D,A,X[ 7],22,0xfd469501L);
- R0(A,B,C,D,X[ 8], 7,0x698098d8L);
- R0(D,A,B,C,X[ 9],12,0x8b44f7afL);
- R0(C,D,A,B,X[10],17,0xffff5bb1L);
- R0(B,C,D,A,X[11],22,0x895cd7beL);
- R0(A,B,C,D,X[12], 7,0x6b901122L);
- R0(D,A,B,C,X[13],12,0xfd987193L);
- R0(C,D,A,B,X[14],17,0xa679438eL);
- R0(B,C,D,A,X[15],22,0x49b40821L);
- /* Round 1 */
- R1(A,B,C,D,X[ 1], 5,0xf61e2562L);
- R1(D,A,B,C,X[ 6], 9,0xc040b340L);
- R1(C,D,A,B,X[11],14,0x265e5a51L);
- R1(B,C,D,A,X[ 0],20,0xe9b6c7aaL);
- R1(A,B,C,D,X[ 5], 5,0xd62f105dL);
- R1(D,A,B,C,X[10], 9,0x02441453L);
- R1(C,D,A,B,X[15],14,0xd8a1e681L);
- R1(B,C,D,A,X[ 4],20,0xe7d3fbc8L);
- R1(A,B,C,D,X[ 9], 5,0x21e1cde6L);
- R1(D,A,B,C,X[14], 9,0xc33707d6L);
- R1(C,D,A,B,X[ 3],14,0xf4d50d87L);
- R1(B,C,D,A,X[ 8],20,0x455a14edL);
- R1(A,B,C,D,X[13], 5,0xa9e3e905L);
- R1(D,A,B,C,X[ 2], 9,0xfcefa3f8L);
- R1(C,D,A,B,X[ 7],14,0x676f02d9L);
- R1(B,C,D,A,X[12],20,0x8d2a4c8aL);
- /* Round 2 */
- R2(A,B,C,D,X[ 5], 4,0xfffa3942L);
- R2(D,A,B,C,X[ 8],11,0x8771f681L);
- R2(C,D,A,B,X[11],16,0x6d9d6122L);
- R2(B,C,D,A,X[14],23,0xfde5380cL);
- R2(A,B,C,D,X[ 1], 4,0xa4beea44L);
- R2(D,A,B,C,X[ 4],11,0x4bdecfa9L);
- R2(C,D,A,B,X[ 7],16,0xf6bb4b60L);
- R2(B,C,D,A,X[10],23,0xbebfbc70L);
- R2(A,B,C,D,X[13], 4,0x289b7ec6L);
- R2(D,A,B,C,X[ 0],11,0xeaa127faL);
- R2(C,D,A,B,X[ 3],16,0xd4ef3085L);
- R2(B,C,D,A,X[ 6],23,0x04881d05L);
- R2(A,B,C,D,X[ 9], 4,0xd9d4d039L);
- R2(D,A,B,C,X[12],11,0xe6db99e5L);
- R2(C,D,A,B,X[15],16,0x1fa27cf8L);
- R2(B,C,D,A,X[ 2],23,0xc4ac5665L);
- /* Round 3 */
- R3(A,B,C,D,X[ 0], 6,0xf4292244L);
- R3(D,A,B,C,X[ 7],10,0x432aff97L);
- R3(C,D,A,B,X[14],15,0xab9423a7L);
- R3(B,C,D,A,X[ 5],21,0xfc93a039L);
- R3(A,B,C,D,X[12], 6,0x655b59c3L);
- R3(D,A,B,C,X[ 3],10,0x8f0ccc92L);
- R3(C,D,A,B,X[10],15,0xffeff47dL);
- R3(B,C,D,A,X[ 1],21,0x85845dd1L);
- R3(A,B,C,D,X[ 8], 6,0x6fa87e4fL);
- R3(D,A,B,C,X[15],10,0xfe2ce6e0L);
- R3(C,D,A,B,X[ 6],15,0xa3014314L);
- R3(B,C,D,A,X[13],21,0x4e0811a1L);
- R3(A,B,C,D,X[ 4], 6,0xf7537e82L);
- R3(D,A,B,C,X[11],10,0xbd3af235L);
- R3(C,D,A,B,X[ 2],15,0x2ad7d2bbL);
- R3(B,C,D,A,X[ 9],21,0xeb86d391L);
-
- c->A+=A&0xffffffffL;
- c->B+=B&0xffffffffL;
- c->C+=C&0xffffffffL;
- c->D+=D&0xffffffffL;
- }
-
-void MD5_Final(md, c)
-unsigned char *md;
-MD5_CTX *c;
- {
- register int i,j;
- register ULONG l;
- register ULONG *p;
- static unsigned char end[4]={0x80,0x00,0x00,0x00};
- unsigned char *cp=end;
-
- /* c->num should definitly have room for at least one more byte. */
- p=c->data;
- j=c->num;
- i=j>>2;
-
- /* purify often complains about the following line as an
- * Uninitialized Memory Read. While this can be true, the
- * following p_c2l macro will reset l when that case is true.
- * This is because j&0x03 contains the number of 'valid' bytes
- * already in p[i]. If and only if j&0x03 == 0, the UMR will
- * occur but this is also the only time p_c2l will do
- * l= *(cp++) instead of l|= *(cp++)
- * Many thanks to Alex Tang <altitude@cic.net> for pickup this
- * 'potential bug' */
-#ifdef PURIFY
- if ((j&0x03) == 0) p[i]=0;
-#endif
- l=p[i];
- p_c2l(cp,l,j&0x03);
- p[i]=l;
- i++;
- /* i is the next 'undefined word' */
- if (c->num >= MD5_LAST_BLOCK)
- {
- for (; i<MD5_LBLOCK; i++)
- p[i]=0;
- md5_block(c,p);
- i=0;
- }
- for (; i<(MD5_LBLOCK-2); i++)
- p[i]=0;
- p[MD5_LBLOCK-2]=c->Nl;
- p[MD5_LBLOCK-1]=c->Nh;
- md5_block(c,p);
- cp=md;
- l=c->A; l2c(l,cp);
- l=c->B; l2c(l,cp);
- l=c->C; l2c(l,cp);
- l=c->D; l2c(l,cp);
-
- /* clear stuff, md5_block may be leaving some stuff on the stack
- * but I'm not worried :-) */
- c->num=0;
-/* memset((char *)&c,0,sizeof(c));*/
- }
-
-#ifdef undef
-int printit(l)
-unsigned long *l;
- {
- int i,ii;
-
- for (i=0; i<2; i++)
- {
- for (ii=0; ii<8; ii++)
- {
- fprintf(stderr,"%08lx ",l[i*8+ii]);
- }
- fprintf(stderr,"\n");
- }
- }
-#endif
-#endif /* HAVE_MD5 */
-#endif /* USE_MD5 */
diff --git a/lib/bind/dst/md5_locl.h b/lib/bind/dst/md5_locl.h
deleted file mode 100644
index 657fe8c3de19..000000000000
--- a/lib/bind/dst/md5_locl.h
+++ /dev/null
@@ -1,193 +0,0 @@
-/* crypto/md/md5_locl.h */
-/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
- * All rights reserved.
- *
- * This package is an SSL implementation written
- * by Eric Young (eay@cryptsoft.com).
- * The implementation was written so as to conform with Netscapes SSL.
- *
- * This library is free for commercial and non-commercial use as long as
- * the following conditions are aheared to. The following conditions
- * apply to all code found in this distribution, be it the RC4, RSA,
- * lhash, DES, etc., code; not just the SSL code. The SSL documentation
- * included with this distribution is covered by the same copyright terms
- * except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
- * Copyright remains Eric Young's, and as such any Copyright notices in
- * the code are not to be removed.
- * If this package is used in a product, Eric Young should be given attribution
- * as the author of the parts of the library used.
- * This can be in the form of a textual message at program startup or
- * in documentation (online or textual) provided with the package.
- *
- * 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 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 cryptographic software written by
- * Eric Young (eay@cryptsoft.com)"
- * The word 'cryptographic' can be left out if the rouines from the library
- * being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
- * the apps directory (application code) you must include an acknowledgement:
- * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
- * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 AUTHOR 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.
- *
- * The licence and distribution terms for any publically available version or
- * derivative of this code cannot be changed. i.e. this code cannot simply be
- * copied and put under another distribution licence
- * [including the GNU Public Licence.]
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include "md5.h"
-
-#define ULONG unsigned long
-#define UCHAR unsigned char
-#define UINT unsigned int
-
-#if defined(NOCONST)
-#define const
-#endif
-
-#undef c2l
-#define c2l(c,l) (l = ((unsigned long)(*((c)++))) , \
- l|=(((unsigned long)(*((c)++)))<< 8), \
- l|=(((unsigned long)(*((c)++)))<<16), \
- l|=(((unsigned long)(*((c)++)))<<24))
-
-#undef p_c2l
-#define p_c2l(c,l,n) { \
- switch (n) { \
- case 0: l =((unsigned long)(*((c)++))); \
- case 1: l|=((unsigned long)(*((c)++)))<< 8; \
- case 2: l|=((unsigned long)(*((c)++)))<<16; \
- case 3: l|=((unsigned long)(*((c)++)))<<24; \
- } \
- }
-
-/* NOTE the pointer is not incremented at the end of this */
-#undef c2l_p
-#define c2l_p(c,l,n) { \
- l=0; \
- (c)+=n; \
- switch (n) { \
- case 3: l =((unsigned long)(*(--(c))))<<16; \
- case 2: l|=((unsigned long)(*(--(c))))<< 8; \
- case 1: l|=((unsigned long)(*(--(c)))) ; \
- } \
- }
-
-#undef p_c2l_p
-#define p_c2l_p(c,l,sc,len) { \
- switch (sc) \
- { \
- case 0: l =((unsigned long)(*((c)++))); \
- if (--len == 0U) break; \
- case 1: l|=((unsigned long)(*((c)++)))<< 8; \
- if (--len == 0U) break; \
- case 2: l|=((unsigned long)(*((c)++)))<<16; \
- } \
- }
-
-#undef l2c
-#define l2c(l,c) (*((c)++)=(unsigned char)(((l) )&0xff), \
- *((c)++)=(unsigned char)(((l)>> 8)&0xff), \
- *((c)++)=(unsigned char)(((l)>>16)&0xff), \
- *((c)++)=(unsigned char)(((l)>>24)&0xff))
-
-/* NOTE - c is not incremented as per l2c */
-#undef l2cn
-#define l2cn(l1,l2,c,n) { \
- c+=n; \
- switch (n) { \
- case 8: *(--(c))=(unsigned char)(((l2)>>24)&0xff); \
- case 7: *(--(c))=(unsigned char)(((l2)>>16)&0xff); \
- case 6: *(--(c))=(unsigned char)(((l2)>> 8)&0xff); \
- case 5: *(--(c))=(unsigned char)(((l2) )&0xff); \
- case 4: *(--(c))=(unsigned char)(((l1)>>24)&0xff); \
- case 3: *(--(c))=(unsigned char)(((l1)>>16)&0xff); \
- case 2: *(--(c))=(unsigned char)(((l1)>> 8)&0xff); \
- case 1: *(--(c))=(unsigned char)(((l1) )&0xff); \
- } \
- }
-
-/* A nice byte order reversal from Wei Dai <weidai@eskimo.com> */
-#if defined(WIN32)
-/* 5 instructions with rotate instruction, else 9 */
-#define Endian_Reverse32(a) \
- { \
- unsigned long l=(a); \
- (a)=((ROTATE(l,8)&0x00FF00FF)|(ROTATE(l,24)&0xFF00FF00)); \
- }
-#else
-/* 6 instructions with rotate instruction, else 8 */
-#define Endian_Reverse32(a) \
- { \
- unsigned long l=(a); \
- l=(((l&0xFF00FF00)>>8L)|((l&0x00FF00FF)<<8L)); \
- (a)=ROTATE(l,16L); \
- }
-#endif
-
-/*%
-#define F(x,y,z) (((x) & (y)) | ((~(x)) & (z)))
-#define G(x,y,z) (((x) & (z)) | ((y) & (~(z))))
-*/
-
-/* As pointed out by Wei Dai <weidai@eskimo.com>, the above can be
- * simplified to the code below. Wei attributes these optimisations
- * to Peter Gutmann's SHS code, and he attributes it to Rich Schroeppel.
- */
-#define F(x,y,z) ((((y) ^ (z)) & (x)) ^ (z))
-#define G(x,y,z) ((((x) ^ (y)) & (z)) ^ (y))
-#define H(x,y,z) ((x) ^ (y) ^ (z))
-#define I(x,y,z) (((x) | (~(z))) ^ (y))
-
-#undef ROTATE
-#if defined(WIN32)
-#define ROTATE(a,n) _lrotl(a,n)
-#else
-#define ROTATE(a,n) (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
-#endif
-
-
-#define R0(a,b,c,d,k,s,t) { \
- a+=((k)+(t)+F((b),(c),(d))); \
- a=ROTATE(a,s); \
- a+=b; };\
-
-#define R1(a,b,c,d,k,s,t) { \
- a+=((k)+(t)+G((b),(c),(d))); \
- a=ROTATE(a,s); \
- a+=b; };
-
-#define R2(a,b,c,d,k,s,t) { \
- a+=((k)+(t)+H((b),(c),(d))); \
- a=ROTATE(a,s); \
- a+=b; };
-
-#define R3(a,b,c,d,k,s,t) { \
- a+=((k)+(t)+I((b),(c),(d))); \
- a=ROTATE(a,s); \
- a+=b; };
-
-/*! \file */
diff --git a/lib/bind/dst/support.c b/lib/bind/dst/support.c
deleted file mode 100644
index 263f9578615b..000000000000
--- a/lib/bind/dst/support.c
+++ /dev/null
@@ -1,342 +0,0 @@
-static const char rcsid[] = "$Header: /proj/cvs/prod/bind9/lib/bind/dst/Attic/support.c,v 1.3.332.3 2005/10/11 00:25:09 marka Exp $";
-
-
-/*
- * Portions Copyright (c) 1995-1998 by Trusted Information Systems, Inc.
- *
- * 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 TRUSTED INFORMATION SYSTEMS
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
- * TRUSTED INFORMATION SYSTEMS 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 THE SOFTWARE.
- */
-
-#include "port_before.h"
-
-#include <stdio.h>
-#include <unistd.h>
-#include <memory.h>
-#include <string.h>
-#include <errno.h>
-#include <sys/stat.h>
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <resolv.h>
-
-#include "dst_internal.h"
-
-#include "port_after.h"
-
-/*%
- * dst_s_verify_str()
- * Validate that the input string(*str) is at the head of the input
- * buffer(**buf). If so, move the buffer head pointer (*buf) to
- * the first byte of data following the string(*str).
- * Parameters
- * buf Input buffer.
- * str Input string.
- * Return
- * 0 *str is not the head of **buff
- * 1 *str is the head of **buff, *buf is is advanced to
- * the tail of **buf.
- */
-
-int
-dst_s_verify_str(const char **buf, const char *str)
-{
- int b, s;
- if (*buf == NULL) /*%< error checks */
- return (0);
- if (str == NULL || *str == '\0')
- return (1);
-
- b = strlen(*buf); /*%< get length of strings */
- s = strlen(str);
- if (s > b || strncmp(*buf, str, s)) /*%< check if same */
- return (0); /*%< not a match */
- (*buf) += s; /*%< advance pointer */
- return (1);
-}
-
-/*%
- * dst_s_calculate_bits
- * Given a binary number represented in a u_char[], determine
- * the number of significant bits used.
- * Parameters
- * str An input character string containing a binary number.
- * max_bits The maximum possible significant bits.
- * Return
- * N The number of significant bits in str.
- */
-
-int
-dst_s_calculate_bits(const u_char *str, const int max_bits)
-{
- const u_char *p = str;
- u_char i, j = 0x80;
- int bits;
- for (bits = max_bits; *p == 0x00 && bits > 0; p++)
- bits -= 8;
- for (i = *p; (i & j) != j; j >>= 1)
- bits--;
- return (bits);
-}
-
-/*%
- * calculates a checksum used in dst for an id.
- * takes an array of bytes and a length.
- * returns a 16 bit checksum.
- */
-u_int16_t
-dst_s_id_calc(const u_char *key, const int keysize)
-{
- u_int32_t ac;
- const u_char *kp = key;
- int size = keysize;
-
- if (!key || (keysize <= 0))
- return (0xffffU);
-
- for (ac = 0; size > 1; size -= 2, kp += 2)
- ac += ((*kp) << 8) + *(kp + 1);
-
- if (size > 0)
- ac += ((*kp) << 8);
- ac += (ac >> 16) & 0xffff;
-
- return (ac & 0xffff);
-}
-
-/*%
- * dst_s_dns_key_id() Function to calculate DNSSEC footprint from KEY record
- * rdata
- * Input:
- * dns_key_rdata: the raw data in wire format
- * rdata_len: the size of the input data
- * Output:
- * the key footprint/id calculated from the key data
- */
-u_int16_t
-dst_s_dns_key_id(const u_char *dns_key_rdata, const int rdata_len)
-{
- if (!dns_key_rdata)
- return 0;
-
- /* compute id */
- if (dns_key_rdata[3] == KEY_RSA) /*%< Algorithm RSA */
- return dst_s_get_int16((const u_char *)
- &dns_key_rdata[rdata_len - 3]);
- else if (dns_key_rdata[3] == KEY_HMAC_MD5)
- /* compatibility */
- return 0;
- else
- /* compute a checksum on the key part of the key rr */
- return dst_s_id_calc(dns_key_rdata, rdata_len);
-}
-
-/*%
- * dst_s_get_int16
- * This routine extracts a 16 bit integer from a two byte character
- * string. The character string is assumed to be in network byte
- * order and may be unaligned. The number returned is in host order.
- * Parameter
- * buf A two byte character string.
- * Return
- * The converted integer value.
- */
-
-u_int16_t
-dst_s_get_int16(const u_char *buf)
-{
- register u_int16_t a = 0;
- a = ((u_int16_t)(buf[0] << 8)) | ((u_int16_t)(buf[1]));
- return (a);
-}
-
-/*%
- * dst_s_get_int32
- * This routine extracts a 32 bit integer from a four byte character
- * string. The character string is assumed to be in network byte
- * order and may be unaligned. The number returned is in host order.
- * Parameter
- * buf A four byte character string.
- * Return
- * The converted integer value.
- */
-
-u_int32_t
-dst_s_get_int32(const u_char *buf)
-{
- register u_int32_t a = 0;
- a = ((u_int32_t)(buf[0] << 24)) | ((u_int32_t)(buf[1] << 16)) |
- ((u_int32_t)(buf[2] << 8)) | ((u_int32_t)(buf[3]));
- return (a);
-}
-
-/*%
- * dst_s_put_int16
- * Take a 16 bit integer and store the value in a two byte
- * character string. The integer is assumed to be in network
- * order and the string is returned in host order.
- *
- * Parameters
- * buf Storage for a two byte character string.
- * val 16 bit integer.
- */
-
-void
-dst_s_put_int16(u_int8_t *buf, const u_int16_t val)
-{
- buf[0] = (u_int8_t)(val >> 8);
- buf[1] = (u_int8_t)(val);
-}
-
-/*%
- * dst_s_put_int32
- * Take a 32 bit integer and store the value in a four byte
- * character string. The integer is assumed to be in network
- * order and the string is returned in host order.
- *
- * Parameters
- * buf Storage for a four byte character string.
- * val 32 bit integer.
- */
-
-void
-dst_s_put_int32(u_int8_t *buf, const u_int32_t val)
-{
- buf[0] = (u_int8_t)(val >> 24);
- buf[1] = (u_int8_t)(val >> 16);
- buf[2] = (u_int8_t)(val >> 8);
- buf[3] = (u_int8_t)(val);
-}
-
-/*%
- * dst_s_filename_length
- *
- * This function returns the number of bytes needed to hold the
- * filename for a key file. '/', '\' and ':' are not allowed.
- * form: K&lt;keyname&gt;+&lt;alg&gt;+&lt;id&gt;.&lt;suffix&gt;
- *
- * Returns 0 if the filename would contain either '\', '/' or ':'
- */
-size_t
-dst_s_filename_length(const char *name, const char *suffix)
-{
- if (name == NULL)
- return (0);
- if (strrchr(name, '\\'))
- return (0);
- if (strrchr(name, '/'))
- return (0);
- if (strrchr(name, ':'))
- return (0);
- if (suffix == NULL)
- return (0);
- if (strrchr(suffix, '\\'))
- return (0);
- if (strrchr(suffix, '/'))
- return (0);
- if (strrchr(suffix, ':'))
- return (0);
- return (1 + strlen(name) + 6 + strlen(suffix));
-}
-
-/*%
- * dst_s_build_filename ()
- * Builds a key filename from the key name, it's id, and a
- * suffix. '\', '/' and ':' are not allowed. fA filename is of the
- * form: K&lt;keyname&gt;&lt;id&gt;.&lt;suffix&gt;
- * form: K&lt;keyname&gt;+&lt;alg&gt;+&lt;id&gt;.&lt;suffix&gt;
- *
- * Returns -1 if the conversion fails:
- * if the filename would be too long for space allotted
- * if the filename would contain a '\', '/' or ':'
- * Returns 0 on success
- */
-
-int
-dst_s_build_filename(char *filename, const char *name, u_int16_t id,
- int alg, const char *suffix, size_t filename_length)
-{
- u_int32_t my_id;
- if (filename == NULL)
- return (-1);
- memset(filename, 0, filename_length);
- if (name == NULL)
- return (-1);
- if (suffix == NULL)
- return (-1);
- if (filename_length < 1 + strlen(name) + 4 + 6 + 1 + strlen(suffix))
- return (-1);
- my_id = id;
- sprintf(filename, "K%s+%03d+%05d.%s", name, alg, my_id,
- (const char *) suffix);
- if (strrchr(filename, '/'))
- return (-1);
- if (strrchr(filename, '\\'))
- return (-1);
- if (strrchr(filename, ':'))
- return (-1);
- return (0);
-}
-
-/*%
- * dst_s_fopen ()
- * Open a file in the dst_path directory. If perm is specified, the
- * file is checked for existence first, and not opened if it exists.
- * Parameters
- * filename File to open
- * mode Mode to open the file (passed directly to fopen)
- * perm File permission, if creating a new file.
- * Returns
- * NULL Failure
- * NON-NULL (FILE *) of opened file.
- */
-FILE *
-dst_s_fopen(const char *filename, const char *mode, int perm)
-{
- FILE *fp;
- char pathname[PATH_MAX];
-
- if (strlen(filename) + strlen(dst_path) >= sizeof(pathname))
- return (NULL);
-
- if (*dst_path != '\0') {
- strcpy(pathname, dst_path);
- strcat(pathname, filename);
- } else
- strcpy(pathname, filename);
-
- fp = fopen(pathname, mode);
- if (perm)
- chmod(pathname, perm);
- return (fp);
-}
-
-void
-dst_s_dump(const int mode, const u_char *data, const int size,
- const char *msg)
-{
- UNUSED(data);
-
- if (size > 0) {
-#ifdef LONG_TEST
- static u_char scratch[1000];
- int n ;
- n = b64_ntop(data, scratch, size, sizeof(scratch));
- printf("%s: %x %d %s\n", msg, mode, n, scratch);
-#else
- printf("%s,%x %d\n", msg, mode, size);
-#endif
- }
-}
-
-/*! \file */
diff --git a/lib/bind/include/Makefile.in b/lib/bind/include/Makefile.in
deleted file mode 100644
index 17a69bf30057..000000000000
--- a/lib/bind/include/Makefile.in
+++ /dev/null
@@ -1,47 +0,0 @@
-# Copyright (C) 2004, 2008 Internet Systems Consortium, Inc. ("ISC")
-# Copyright (C) 2001 Internet Software Consortium.
-#
-# Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS. IN NO EVENT SHALL ISC 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.in,v 1.4.18.2 2008/01/23 02:15:02 tbox Exp $
-
-srcdir = @srcdir@
-VPATH = @srcdir@
-top_srcdir = @top_srcdir@
-
-HEADERS=fd_setsize.h hesiod.h irp.h irs.h netdb.h netgroup.h res_update.h \
- resolv.h
-AHEADERS= arpa/inet.h arpa/nameser.h arpa/nameser_compat.h
-IHEADERS= isc/assertions.h isc/ctl.h isc/dst.h isc/eventlib.h isc/heap.h \
- isc/irpmarshall.h isc/list.h isc/logging.h isc/memcluster.h \
- isc/misc.h isc/tree.h isc/platform.h.in
-
-all:
-
-@BIND9_MAKE_RULES@
-
-installdirs:
- $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${includedir} \
- ${DESTDIR}${includedir}/arpa ${DESTDIR}${includedir}/isc
-
-install:: installdirs
- for i in ${HEADERS}; do \
- ${INSTALL_DATA} ${srcdir}/$$i ${DESTDIR}${includedir}; \
- done
- for i in ${IHEADERS}; do \
- ${INSTALL_DATA} ${srcdir}/$$i ${DESTDIR}${includedir}/isc; \
- done
- for i in ${AHEADERS}; do \
- ${INSTALL_DATA} ${srcdir}/$$i ${DESTDIR}${includedir}/arpa; \
- done
-
diff --git a/lib/bind/include/arpa/inet.h b/lib/bind/include/arpa/inet.h
deleted file mode 100644
index d84987bd7aee..000000000000
--- a/lib/bind/include/arpa/inet.h
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * ++Copyright++ 1983, 1993
- * -
- * Copyright (c) 1983, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * -
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- * -
- * --Copyright--
- */
-
-/*%
- * @(#)inet.h 8.1 (Berkeley) 6/2/93
- * $Id: inet.h,v 1.2.18.1 2005/04/27 05:00:50 sra Exp $
- */
-
-#ifndef _INET_H_
-#define _INET_H_
-
-/* External definitions for functions in inet(3) */
-
-#include <sys/param.h>
-#if (!defined(BSD)) || (BSD < 199306)
-# include <sys/bitypes.h>
-#else
-# include <sys/types.h>
-#endif
-#include <sys/cdefs.h>
-
-#define inet_addr __inet_addr
-#define inet_aton __inet_aton
-#define inet_lnaof __inet_lnaof
-#define inet_makeaddr __inet_makeaddr
-#define inet_neta __inet_neta
-#define inet_netof __inet_netof
-#define inet_network __inet_network
-#define inet_net_ntop __inet_net_ntop
-#define inet_net_pton __inet_net_pton
-#define inet_cidr_ntop __inet_cidr_ntop
-#define inet_cidr_pton __inet_cidr_pton
-#define inet_ntoa __inet_ntoa
-#define inet_pton __inet_pton
-#define inet_ntop __inet_ntop
-#define inet_nsap_addr __inet_nsap_addr
-#define inet_nsap_ntoa __inet_nsap_ntoa
-
-__BEGIN_DECLS
-unsigned long inet_addr __P((const char *));
-int inet_aton __P((const char *, struct in_addr *));
-unsigned long inet_lnaof __P((struct in_addr));
-struct in_addr inet_makeaddr __P((u_long , u_long));
-char * inet_neta __P((u_long, char *, size_t));
-unsigned long inet_netof __P((struct in_addr));
-unsigned long inet_network __P((const char *));
-char *inet_net_ntop __P((int, const void *, int, char *, size_t));
-int inet_net_pton __P((int, const char *, void *, size_t));
-char *inet_cidr_ntop __P((int, const void *, int, char *, size_t));
-int inet_cidr_pton __P((int, const char *, void *, int *));
-/*const*/ char *inet_ntoa __P((struct in_addr));
-int inet_pton __P((int, const char *, void *));
-const char *inet_ntop __P((int, const void *, char *, size_t));
-u_int inet_nsap_addr __P((const char *, u_char *, int));
-char *inet_nsap_ntoa __P((int, const u_char *, char *));
-__END_DECLS
-
-#if defined(__hpux) && defined(_XOPEN_SOURCE_EXTENDED)
-/*
- * Macros for number representation conversion.
- *
- * netinet/in.h is another location for these macros
- */
-#ifndef ntohl
-#define ntohl(x) (x)
-#define ntohs(x) (x)
-#define htonl(x) (x)
-#define htons(x) (x)
-#endif
-#endif
-
-#endif /* !_INET_H_ */
-
-/*! \file */
diff --git a/lib/bind/include/arpa/nameser.h b/lib/bind/include/arpa/nameser.h
deleted file mode 100644
index 8f8d8a7cc286..000000000000
--- a/lib/bind/include/arpa/nameser.h
+++ /dev/null
@@ -1,575 +0,0 @@
-/*
- * Copyright (c) 1983, 1989, 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.
- */
-
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * 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 ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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: nameser.h,v 1.7.18.2 2008/04/03 23:15:15 marka Exp $
- */
-
-#ifndef _ARPA_NAMESER_H_
-#define _ARPA_NAMESER_H_
-
-/*! \file */
-
-#define BIND_4_COMPAT
-
-#include <sys/param.h>
-#if (!defined(BSD)) || (BSD < 199306)
-# include <sys/bitypes.h>
-#else
-# include <sys/types.h>
-#endif
-#include <sys/cdefs.h>
-
-/*%
- * Revision information. This is the release date in YYYYMMDD format.
- * It can change every day so the right thing to do with it is use it
- * in preprocessor commands such as "#if (__NAMESER > 19931104)". Do not
- * compare for equality; rather, use it to determine whether your libbind.a
- * contains a new enough lib/nameser/ to support the feature you need.
- */
-
-#define __NAMESER 19991006 /*%< New interface version stamp. */
-/*
- * Define constants based on RFC0883, RFC1034, RFC 1035
- */
-#define NS_PACKETSZ 512 /*%< default UDP packet size */
-#define NS_MAXDNAME 1025 /*%< maximum domain name */
-#define NS_MAXMSG 65535 /*%< maximum message size */
-#define NS_MAXCDNAME 255 /*%< maximum compressed domain name */
-#define NS_MAXLABEL 63 /*%< maximum length of domain label */
-#define NS_HFIXEDSZ 12 /*%< #/bytes of fixed data in header */
-#define NS_QFIXEDSZ 4 /*%< #/bytes of fixed data in query */
-#define NS_RRFIXEDSZ 10 /*%< #/bytes of fixed data in r record */
-#define NS_INT32SZ 4 /*%< #/bytes of data in a u_int32_t */
-#define NS_INT16SZ 2 /*%< #/bytes of data in a u_int16_t */
-#define NS_INT8SZ 1 /*%< #/bytes of data in a u_int8_t */
-#define NS_INADDRSZ 4 /*%< IPv4 T_A */
-#define NS_IN6ADDRSZ 16 /*%< IPv6 T_AAAA */
-#define NS_CMPRSFLGS 0xc0 /*%< Flag bits indicating name compression. */
-#define NS_DEFAULTPORT 53 /*%< For both TCP and UDP. */
-/*
- * These can be expanded with synonyms, just keep ns_parse.c:ns_parserecord()
- * in synch with it.
- */
-typedef enum __ns_sect {
- ns_s_qd = 0, /*%< Query: Question. */
- ns_s_zn = 0, /*%< Update: Zone. */
- ns_s_an = 1, /*%< Query: Answer. */
- ns_s_pr = 1, /*%< Update: Prerequisites. */
- ns_s_ns = 2, /*%< Query: Name servers. */
- ns_s_ud = 2, /*%< Update: Update. */
- ns_s_ar = 3, /*%< Query|Update: Additional records. */
- ns_s_max = 4
-} ns_sect;
-
-/*%
- * This is a message handle. It is caller allocated and has no dynamic data.
- * This structure is intended to be opaque to all but ns_parse.c, thus the
- * leading _'s on the member names. Use the accessor functions, not the _'s.
- */
-typedef struct __ns_msg {
- const u_char *_msg, *_eom;
- u_int16_t _id, _flags, _counts[ns_s_max];
- const u_char *_sections[ns_s_max];
- ns_sect _sect;
- int _rrnum;
- const u_char *_msg_ptr;
-} ns_msg;
-
-/* Private data structure - do not use from outside library. */
-struct _ns_flagdata { int mask, shift; };
-extern struct _ns_flagdata _ns_flagdata[];
-
-/* Accessor macros - this is part of the public interface. */
-
-#define ns_msg_id(handle) ((handle)._id + 0)
-#define ns_msg_base(handle) ((handle)._msg + 0)
-#define ns_msg_end(handle) ((handle)._eom + 0)
-#define ns_msg_size(handle) ((handle)._eom - (handle)._msg)
-#define ns_msg_count(handle, section) ((handle)._counts[section] + 0)
-
-/*%
- * This is a parsed record. It is caller allocated and has no dynamic data.
- */
-typedef struct __ns_rr {
- char name[NS_MAXDNAME];
- u_int16_t type;
- u_int16_t rr_class;
- u_int32_t ttl;
- u_int16_t rdlength;
- const u_char * rdata;
-} ns_rr;
-
-/* Accessor macros - this is part of the public interface. */
-#define ns_rr_name(rr) (((rr).name[0] != '\0') ? (rr).name : ".")
-#define ns_rr_type(rr) ((ns_type)((rr).type + 0))
-#define ns_rr_class(rr) ((ns_class)((rr).rr_class + 0))
-#define ns_rr_ttl(rr) ((rr).ttl + 0)
-#define ns_rr_rdlen(rr) ((rr).rdlength + 0)
-#define ns_rr_rdata(rr) ((rr).rdata + 0)
-
-/*%
- * These don't have to be in the same order as in the packet flags word,
- * and they can even overlap in some cases, but they will need to be kept
- * in synch with ns_parse.c:ns_flagdata[].
- */
-typedef enum __ns_flag {
- ns_f_qr, /*%< Question/Response. */
- ns_f_opcode, /*%< Operation code. */
- ns_f_aa, /*%< Authoritative Answer. */
- ns_f_tc, /*%< Truncation occurred. */
- ns_f_rd, /*%< Recursion Desired. */
- ns_f_ra, /*%< Recursion Available. */
- ns_f_z, /*%< MBZ. */
- ns_f_ad, /*%< Authentic Data (DNSSEC). */
- ns_f_cd, /*%< Checking Disabled (DNSSEC). */
- ns_f_rcode, /*%< Response code. */
- ns_f_max
-} ns_flag;
-
-/*%
- * Currently defined opcodes.
- */
-typedef enum __ns_opcode {
- ns_o_query = 0, /*%< Standard query. */
- ns_o_iquery = 1, /*%< Inverse query (deprecated/unsupported). */
- ns_o_status = 2, /*%< Name server status query (unsupported). */
- /* Opcode 3 is undefined/reserved. */
- ns_o_notify = 4, /*%< Zone change notification. */
- ns_o_update = 5, /*%< Zone update message. */
- ns_o_max = 6
-} ns_opcode;
-
-/*%
- * Currently defined response codes.
- */
-typedef enum __ns_rcode {
- ns_r_noerror = 0, /*%< No error occurred. */
- ns_r_formerr = 1, /*%< Format error. */
- ns_r_servfail = 2, /*%< Server failure. */
- ns_r_nxdomain = 3, /*%< Name error. */
- ns_r_notimpl = 4, /*%< Unimplemented. */
- ns_r_refused = 5, /*%< Operation refused. */
- /* these are for BIND_UPDATE */
- ns_r_yxdomain = 6, /*%< Name exists */
- ns_r_yxrrset = 7, /*%< RRset exists */
- ns_r_nxrrset = 8, /*%< RRset does not exist */
- ns_r_notauth = 9, /*%< Not authoritative for zone */
- ns_r_notzone = 10, /*%< Zone of record different from zone section */
- ns_r_max = 11,
- /* The following are EDNS extended rcodes */
- ns_r_badvers = 16,
- /* The following are TSIG errors */
- ns_r_badsig = 16,
- ns_r_badkey = 17,
- ns_r_badtime = 18
-} ns_rcode;
-
-/* BIND_UPDATE */
-typedef enum __ns_update_operation {
- ns_uop_delete = 0,
- ns_uop_add = 1,
- ns_uop_max = 2
-} ns_update_operation;
-
-/*%
- * This structure is used for TSIG authenticated messages
- */
-struct ns_tsig_key {
- char name[NS_MAXDNAME], alg[NS_MAXDNAME];
- unsigned char *data;
- int len;
-};
-typedef struct ns_tsig_key ns_tsig_key;
-
-/*%
- * This structure is used for TSIG authenticated TCP messages
- */
-struct ns_tcp_tsig_state {
- int counter;
- struct dst_key *key;
- void *ctx;
- unsigned char sig[NS_PACKETSZ];
- int siglen;
-};
-typedef struct ns_tcp_tsig_state ns_tcp_tsig_state;
-
-#define NS_TSIG_FUDGE 300
-#define NS_TSIG_TCP_COUNT 100
-#define NS_TSIG_ALG_HMAC_MD5 "HMAC-MD5.SIG-ALG.REG.INT"
-
-#define NS_TSIG_ERROR_NO_TSIG -10
-#define NS_TSIG_ERROR_NO_SPACE -11
-#define NS_TSIG_ERROR_FORMERR -12
-
-/*%
- * Currently defined type values for resources and queries.
- */
-typedef enum __ns_type {
- ns_t_invalid = 0, /*%< Cookie. */
- ns_t_a = 1, /*%< Host address. */
- ns_t_ns = 2, /*%< Authoritative server. */
- ns_t_md = 3, /*%< Mail destination. */
- ns_t_mf = 4, /*%< Mail forwarder. */
- ns_t_cname = 5, /*%< Canonical name. */
- ns_t_soa = 6, /*%< Start of authority zone. */
- ns_t_mb = 7, /*%< Mailbox domain name. */
- ns_t_mg = 8, /*%< Mail group member. */
- ns_t_mr = 9, /*%< Mail rename name. */
- ns_t_null = 10, /*%< Null resource record. */
- ns_t_wks = 11, /*%< Well known service. */
- ns_t_ptr = 12, /*%< Domain name pointer. */
- ns_t_hinfo = 13, /*%< Host information. */
- ns_t_minfo = 14, /*%< Mailbox information. */
- ns_t_mx = 15, /*%< Mail routing information. */
- ns_t_txt = 16, /*%< Text strings. */
- ns_t_rp = 17, /*%< Responsible person. */
- ns_t_afsdb = 18, /*%< AFS cell database. */
- ns_t_x25 = 19, /*%< X_25 calling address. */
- ns_t_isdn = 20, /*%< ISDN calling address. */
- ns_t_rt = 21, /*%< Router. */
- ns_t_nsap = 22, /*%< NSAP address. */
- ns_t_nsap_ptr = 23, /*%< Reverse NSAP lookup (deprecated). */
- ns_t_sig = 24, /*%< Security signature. */
- ns_t_key = 25, /*%< Security key. */
- ns_t_px = 26, /*%< X.400 mail mapping. */
- ns_t_gpos = 27, /*%< Geographical position (withdrawn). */
- ns_t_aaaa = 28, /*%< Ip6 Address. */
- ns_t_loc = 29, /*%< Location Information. */
- ns_t_nxt = 30, /*%< Next domain (security). */
- ns_t_eid = 31, /*%< Endpoint identifier. */
- ns_t_nimloc = 32, /*%< Nimrod Locator. */
- ns_t_srv = 33, /*%< Server Selection. */
- ns_t_atma = 34, /*%< ATM Address */
- ns_t_naptr = 35, /*%< Naming Authority PoinTeR */
- ns_t_kx = 36, /*%< Key Exchange */
- ns_t_cert = 37, /*%< Certification record */
- ns_t_a6 = 38, /*%< IPv6 address (deprecates AAAA) */
- ns_t_dname = 39, /*%< Non-terminal DNAME (for IPv6) */
- ns_t_sink = 40, /*%< Kitchen sink (experimentatl) */
- ns_t_opt = 41, /*%< EDNS0 option (meta-RR) */
- ns_t_apl = 42, /*%< Address prefix list (RFC3123) */
- ns_t_tkey = 249, /*%< Transaction key */
- ns_t_tsig = 250, /*%< Transaction signature. */
- ns_t_ixfr = 251, /*%< Incremental zone transfer. */
- ns_t_axfr = 252, /*%< Transfer zone of authority. */
- ns_t_mailb = 253, /*%< Transfer mailbox records. */
- ns_t_maila = 254, /*%< Transfer mail agent records. */
- ns_t_any = 255, /*%< Wildcard match. */
- ns_t_zxfr = 256, /*%< BIND-specific, nonstandard. */
- ns_t_max = 65536
-} ns_type;
-
-/* Exclusively a QTYPE? (not also an RTYPE) */
-#define ns_t_qt_p(t) (ns_t_xfr_p(t) || (t) == ns_t_any || \
- (t) == ns_t_mailb || (t) == ns_t_maila)
-/* Some kind of meta-RR? (not a QTYPE, but also not an RTYPE) */
-#define ns_t_mrr_p(t) ((t) == ns_t_tsig || (t) == ns_t_opt)
-/* Exclusively an RTYPE? (not also a QTYPE or a meta-RR) */
-#define ns_t_rr_p(t) (!ns_t_qt_p(t) && !ns_t_mrr_p(t))
-#define ns_t_udp_p(t) ((t) != ns_t_axfr && (t) != ns_t_zxfr)
-#define ns_t_xfr_p(t) ((t) == ns_t_axfr || (t) == ns_t_ixfr || \
- (t) == ns_t_zxfr)
-
-/*%
- * Values for class field
- */
-typedef enum __ns_class {
- ns_c_invalid = 0, /*%< Cookie. */
- ns_c_in = 1, /*%< Internet. */
- ns_c_2 = 2, /*%< unallocated/unsupported. */
- ns_c_chaos = 3, /*%< MIT Chaos-net. */
- ns_c_hs = 4, /*%< MIT Hesiod. */
- /* Query class values which do not appear in resource records */
- ns_c_none = 254, /*%< for prereq. sections in update requests */
- ns_c_any = 255, /*%< Wildcard match. */
- ns_c_max = 65536
-} ns_class;
-
-/* DNSSEC constants. */
-
-typedef enum __ns_key_types {
- ns_kt_rsa = 1, /*%< key type RSA/MD5 */
- ns_kt_dh = 2, /*%< Diffie Hellman */
- ns_kt_dsa = 3, /*%< Digital Signature Standard (MANDATORY) */
- ns_kt_private = 254 /*%< Private key type starts with OID */
-} ns_key_types;
-
-typedef enum __ns_cert_types {
- cert_t_pkix = 1, /*%< PKIX (X.509v3) */
- cert_t_spki = 2, /*%< SPKI */
- cert_t_pgp = 3, /*%< PGP */
- cert_t_url = 253, /*%< URL private type */
- cert_t_oid = 254 /*%< OID private type */
-} ns_cert_types;
-
-/* Flags field of the KEY RR rdata. */
-#define NS_KEY_TYPEMASK 0xC000 /*%< Mask for "type" bits */
-#define NS_KEY_TYPE_AUTH_CONF 0x0000 /*%< Key usable for both */
-#define NS_KEY_TYPE_CONF_ONLY 0x8000 /*%< Key usable for confidentiality */
-#define NS_KEY_TYPE_AUTH_ONLY 0x4000 /*%< Key usable for authentication */
-#define NS_KEY_TYPE_NO_KEY 0xC000 /*%< No key usable for either; no key */
-/* The type bits can also be interpreted independently, as single bits: */
-#define NS_KEY_NO_AUTH 0x8000 /*%< Key unusable for authentication */
-#define NS_KEY_NO_CONF 0x4000 /*%< Key unusable for confidentiality */
-#define NS_KEY_RESERVED2 0x2000 /* Security is *mandatory* if bit=0 */
-#define NS_KEY_EXTENDED_FLAGS 0x1000 /*%< reserved - must be zero */
-#define NS_KEY_RESERVED4 0x0800 /*%< reserved - must be zero */
-#define NS_KEY_RESERVED5 0x0400 /*%< reserved - must be zero */
-#define NS_KEY_NAME_TYPE 0x0300 /*%< these bits determine the type */
-#define NS_KEY_NAME_USER 0x0000 /*%< key is assoc. with user */
-#define NS_KEY_NAME_ENTITY 0x0200 /*%< key is assoc. with entity eg host */
-#define NS_KEY_NAME_ZONE 0x0100 /*%< key is zone key */
-#define NS_KEY_NAME_RESERVED 0x0300 /*%< reserved meaning */
-#define NS_KEY_RESERVED8 0x0080 /*%< reserved - must be zero */
-#define NS_KEY_RESERVED9 0x0040 /*%< reserved - must be zero */
-#define NS_KEY_RESERVED10 0x0020 /*%< reserved - must be zero */
-#define NS_KEY_RESERVED11 0x0010 /*%< reserved - must be zero */
-#define NS_KEY_SIGNATORYMASK 0x000F /*%< key can sign RR's of same name */
-#define NS_KEY_RESERVED_BITMASK ( NS_KEY_RESERVED2 | \
- NS_KEY_RESERVED4 | \
- NS_KEY_RESERVED5 | \
- NS_KEY_RESERVED8 | \
- NS_KEY_RESERVED9 | \
- NS_KEY_RESERVED10 | \
- NS_KEY_RESERVED11 )
-#define NS_KEY_RESERVED_BITMASK2 0xFFFF /*%< no bits defined here */
-/* The Algorithm field of the KEY and SIG RR's is an integer, {1..254} */
-#define NS_ALG_MD5RSA 1 /*%< MD5 with RSA */
-#define NS_ALG_DH 2 /*%< Diffie Hellman KEY */
-#define NS_ALG_DSA 3 /*%< DSA KEY */
-#define NS_ALG_DSS NS_ALG_DSA
-#define NS_ALG_EXPIRE_ONLY 253 /*%< No alg, no security */
-#define NS_ALG_PRIVATE_OID 254 /*%< Key begins with OID giving alg */
-/* Protocol values */
-/* value 0 is reserved */
-#define NS_KEY_PROT_TLS 1
-#define NS_KEY_PROT_EMAIL 2
-#define NS_KEY_PROT_DNSSEC 3
-#define NS_KEY_PROT_IPSEC 4
-#define NS_KEY_PROT_ANY 255
-
-/* Signatures */
-#define NS_MD5RSA_MIN_BITS 512 /*%< Size of a mod or exp in bits */
-#define NS_MD5RSA_MAX_BITS 4096
- /* Total of binary mod and exp */
-#define NS_MD5RSA_MAX_BYTES ((NS_MD5RSA_MAX_BITS+7/8)*2+3)
- /* Max length of text sig block */
-#define NS_MD5RSA_MAX_BASE64 (((NS_MD5RSA_MAX_BYTES+2)/3)*4)
-#define NS_MD5RSA_MIN_SIZE ((NS_MD5RSA_MIN_BITS+7)/8)
-#define NS_MD5RSA_MAX_SIZE ((NS_MD5RSA_MAX_BITS+7)/8)
-
-#define NS_DSA_SIG_SIZE 41
-#define NS_DSA_MIN_SIZE 213
-#define NS_DSA_MAX_BYTES 405
-
-/* Offsets into SIG record rdata to find various values */
-#define NS_SIG_TYPE 0 /*%< Type flags */
-#define NS_SIG_ALG 2 /*%< Algorithm */
-#define NS_SIG_LABELS 3 /*%< How many labels in name */
-#define NS_SIG_OTTL 4 /*%< Original TTL */
-#define NS_SIG_EXPIR 8 /*%< Expiration time */
-#define NS_SIG_SIGNED 12 /*%< Signature time */
-#define NS_SIG_FOOT 16 /*%< Key footprint */
-#define NS_SIG_SIGNER 18 /*%< Domain name of who signed it */
-/* How RR types are represented as bit-flags in NXT records */
-#define NS_NXT_BITS 8
-#define NS_NXT_BIT_SET( n,p) (p[(n)/NS_NXT_BITS] |= (0x80>>((n)%NS_NXT_BITS)))
-#define NS_NXT_BIT_CLEAR(n,p) (p[(n)/NS_NXT_BITS] &= ~(0x80>>((n)%NS_NXT_BITS)))
-#define NS_NXT_BIT_ISSET(n,p) (p[(n)/NS_NXT_BITS] & (0x80>>((n)%NS_NXT_BITS)))
-#define NS_NXT_MAX 127
-
-/*%
- * EDNS0 extended flags and option codes, host order.
- */
-#define NS_OPT_DNSSEC_OK 0x8000U
-#define NS_OPT_NSID 3
-
-/*%
- * Inline versions of get/put short/long. Pointer is advanced.
- */
-#define NS_GET16(s, cp) do { \
- register const u_char *t_cp = (const u_char *)(cp); \
- (s) = ((u_int16_t)t_cp[0] << 8) \
- | ((u_int16_t)t_cp[1]) \
- ; \
- (cp) += NS_INT16SZ; \
-} while (0)
-
-#define NS_GET32(l, cp) do { \
- register const u_char *t_cp = (const u_char *)(cp); \
- (l) = ((u_int32_t)t_cp[0] << 24) \
- | ((u_int32_t)t_cp[1] << 16) \
- | ((u_int32_t)t_cp[2] << 8) \
- | ((u_int32_t)t_cp[3]) \
- ; \
- (cp) += NS_INT32SZ; \
-} while (0)
-
-#define NS_PUT16(s, cp) do { \
- register u_int16_t t_s = (u_int16_t)(s); \
- register u_char *t_cp = (u_char *)(cp); \
- *t_cp++ = t_s >> 8; \
- *t_cp = t_s; \
- (cp) += NS_INT16SZ; \
-} while (0)
-
-#define NS_PUT32(l, cp) do { \
- register u_int32_t t_l = (u_int32_t)(l); \
- register u_char *t_cp = (u_char *)(cp); \
- *t_cp++ = t_l >> 24; \
- *t_cp++ = t_l >> 16; \
- *t_cp++ = t_l >> 8; \
- *t_cp = t_l; \
- (cp) += NS_INT32SZ; \
-} while (0)
-
-/*%
- * ANSI C identifier hiding for bind's lib/nameser.
- */
-#define ns_msg_getflag __ns_msg_getflag
-#define ns_get16 __ns_get16
-#define ns_get32 __ns_get32
-#define ns_put16 __ns_put16
-#define ns_put32 __ns_put32
-#define ns_initparse __ns_initparse
-#define ns_skiprr __ns_skiprr
-#define ns_parserr __ns_parserr
-#define ns_sprintrr __ns_sprintrr
-#define ns_sprintrrf __ns_sprintrrf
-#define ns_format_ttl __ns_format_ttl
-#define ns_parse_ttl __ns_parse_ttl
-#define ns_datetosecs __ns_datetosecs
-#define ns_name_ntol __ns_name_ntol
-#define ns_name_ntop __ns_name_ntop
-#define ns_name_pton __ns_name_pton
-#define ns_name_unpack __ns_name_unpack
-#define ns_name_pack __ns_name_pack
-#define ns_name_compress __ns_name_compress
-#define ns_name_uncompress __ns_name_uncompress
-#define ns_name_skip __ns_name_skip
-#define ns_name_rollback __ns_name_rollback
-#define ns_sign __ns_sign
-#define ns_sign2 __ns_sign2
-#define ns_sign_tcp __ns_sign_tcp
-#define ns_sign_tcp2 __ns_sign_tcp2
-#define ns_sign_tcp_init __ns_sign_tcp_init
-#define ns_find_tsig __ns_find_tsig
-#define ns_verify __ns_verify
-#define ns_verify_tcp __ns_verify_tcp
-#define ns_verify_tcp_init __ns_verify_tcp_init
-#define ns_samedomain __ns_samedomain
-#define ns_subdomain __ns_subdomain
-#define ns_makecanon __ns_makecanon
-#define ns_samename __ns_samename
-
-__BEGIN_DECLS
-int ns_msg_getflag __P((ns_msg, int));
-u_int ns_get16 __P((const u_char *));
-u_long ns_get32 __P((const u_char *));
-void ns_put16 __P((u_int, u_char *));
-void ns_put32 __P((u_long, u_char *));
-int ns_initparse __P((const u_char *, int, ns_msg *));
-int ns_skiprr __P((const u_char *, const u_char *, ns_sect, int));
-int ns_parserr __P((ns_msg *, ns_sect, int, ns_rr *));
-int ns_sprintrr __P((const ns_msg *, const ns_rr *,
- const char *, const char *, char *, size_t));
-int ns_sprintrrf __P((const u_char *, size_t, const char *,
- ns_class, ns_type, u_long, const u_char *,
- size_t, const char *, const char *,
- char *, size_t));
-int ns_format_ttl __P((u_long, char *, size_t));
-int ns_parse_ttl __P((const char *, u_long *));
-u_int32_t ns_datetosecs __P((const char *cp, int *errp));
-int ns_name_ntol __P((const u_char *, u_char *, size_t));
-int ns_name_ntop __P((const u_char *, char *, size_t));
-int ns_name_pton __P((const char *, u_char *, size_t));
-int ns_name_unpack __P((const u_char *, const u_char *,
- const u_char *, u_char *, size_t));
-int ns_name_pack __P((const u_char *, u_char *, int,
- const u_char **, const u_char **));
-int ns_name_uncompress __P((const u_char *, const u_char *,
- const u_char *, char *, size_t));
-int ns_name_compress __P((const char *, u_char *, size_t,
- const u_char **, const u_char **));
-int ns_name_skip __P((const u_char **, const u_char *));
-void ns_name_rollback __P((const u_char *, const u_char **,
- const u_char **));
-int ns_sign __P((u_char *, int *, int, int, void *,
- const u_char *, int, u_char *, int *, time_t));
-int ns_sign2 __P((u_char *, int *, int, int, void *,
- const u_char *, int, u_char *, int *, time_t,
- u_char **, u_char **));
-int ns_sign_tcp __P((u_char *, int *, int, int,
- ns_tcp_tsig_state *, int));
-int ns_sign_tcp2 __P((u_char *, int *, int, int,
- ns_tcp_tsig_state *, int,
- u_char **, u_char **));
-int ns_sign_tcp_init __P((void *, const u_char *, int,
- ns_tcp_tsig_state *));
-u_char *ns_find_tsig __P((u_char *, u_char *));
-int ns_verify __P((u_char *, int *, void *,
- const u_char *, int, u_char *, int *,
- time_t *, int));
-int ns_verify_tcp __P((u_char *, int *, ns_tcp_tsig_state *, int));
-int ns_verify_tcp_init __P((void *, const u_char *, int,
- ns_tcp_tsig_state *));
-int ns_samedomain __P((const char *, const char *));
-int ns_subdomain __P((const char *, const char *));
-int ns_makecanon __P((const char *, char *, size_t));
-int ns_samename __P((const char *, const char *));
-__END_DECLS
-
-#ifdef BIND_4_COMPAT
-#include <arpa/nameser_compat.h>
-#endif
-
-#endif /* !_ARPA_NAMESER_H_ */
-/*! \file */
diff --git a/lib/bind/include/arpa/nameser_compat.h b/lib/bind/include/arpa/nameser_compat.h
deleted file mode 100644
index 371329394d7a..000000000000
--- a/lib/bind/include/arpa/nameser_compat.h
+++ /dev/null
@@ -1,232 +0,0 @@
-/* Copyright (c) 1983, 1989
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*%
- * from nameser.h 8.1 (Berkeley) 6/2/93
- * $Id: nameser_compat.h,v 1.5.18.3 2006/05/19 02:36:00 marka Exp $
- */
-
-#ifndef _ARPA_NAMESER_COMPAT_
-#define _ARPA_NAMESER_COMPAT_
-
-#define __BIND 19950621 /*%< (DEAD) interface version stamp. */
-#ifndef BYTE_ORDER
-#if (BSD >= 199103)
-# include <machine/endian.h>
-#else
-#ifdef __linux
-# include <endian.h>
-#else
-#define LITTLE_ENDIAN 1234 /*%< least-significant byte first (vax, pc) */
-#define BIG_ENDIAN 4321 /*%< most-significant byte first (IBM, net) */
-#define PDP_ENDIAN 3412 /*%< LSB first in word, MSW first in long (pdp) */
-#if defined(vax) || defined(ns32000) || defined(sun386) || defined(i386) || \
- defined(__i386__) || defined(__i386) || defined(__amd64__) || \
- defined(__x86_64__) || defined(MIPSEL) || defined(_MIPSEL) || \
- defined(BIT_ZERO_ON_RIGHT) || defined(__alpha__) || defined(__alpha) || \
- (defined(__Lynx__) && defined(__x86__))
-#define BYTE_ORDER LITTLE_ENDIAN
-#endif
-
-#if defined(sel) || defined(pyr) || defined(mc68000) || defined(sparc) || \
- defined(is68k) || defined(tahoe) || defined(ibm032) || defined(ibm370) || \
- defined(MIPSEB) || defined(_MIPSEB) || defined(_IBMR2) || defined(DGUX) ||\
- defined(apollo) || defined(__convex__) || defined(_CRAY) || \
- defined(__hppa) || defined(__hp9000) || \
- defined(__hp9000s300) || defined(__hp9000s700) || \
- defined(__hp3000s900) || defined(__hpux) || defined(MPE) || \
- defined (BIT_ZERO_ON_LEFT) || defined(m68k) || defined(__sparc) || \
- (defined(__Lynx__) && \
- (defined(__68k__) || defined(__sparc__) || defined(__powerpc__)))
-#define BYTE_ORDER BIG_ENDIAN
-#endif
-#endif /* __linux */
-#endif /* BSD */
-#endif /* BYTE_ORDER */
-
-#if !defined(BYTE_ORDER) || \
- (BYTE_ORDER != BIG_ENDIAN && BYTE_ORDER != LITTLE_ENDIAN && \
- BYTE_ORDER != PDP_ENDIAN)
- /* you must determine what the correct bit order is for
- * your compiler - the next line is an intentional error
- * which will force your compiles to bomb until you fix
- * the above macros.
- */
- error "Undefined or invalid BYTE_ORDER";
-#endif
-
-/*%
- * Structure for query header. The order of the fields is machine- and
- * compiler-dependent, depending on the byte/bit order and the layout
- * of bit fields. We use bit fields only in int variables, as this
- * is all ANSI requires. This requires a somewhat confusing rearrangement.
- */
-
-typedef struct {
- unsigned id :16; /*%< query identification number */
-#if BYTE_ORDER == BIG_ENDIAN
- /* fields in third byte */
- unsigned qr: 1; /*%< response flag */
- unsigned opcode: 4; /*%< purpose of message */
- unsigned aa: 1; /*%< authoritive answer */
- unsigned tc: 1; /*%< truncated message */
- unsigned rd: 1; /*%< recursion desired */
- /* fields in fourth byte */
- unsigned ra: 1; /*%< recursion available */
- unsigned unused :1; /*%< unused bits (MBZ as of 4.9.3a3) */
- unsigned ad: 1; /*%< authentic data from named */
- unsigned cd: 1; /*%< checking disabled by resolver */
- unsigned rcode :4; /*%< response code */
-#endif
-#if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN
- /* fields in third byte */
- unsigned rd :1; /*%< recursion desired */
- unsigned tc :1; /*%< truncated message */
- unsigned aa :1; /*%< authoritive answer */
- unsigned opcode :4; /*%< purpose of message */
- unsigned qr :1; /*%< response flag */
- /* fields in fourth byte */
- unsigned rcode :4; /*%< response code */
- unsigned cd: 1; /*%< checking disabled by resolver */
- unsigned ad: 1; /*%< authentic data from named */
- unsigned unused :1; /*%< unused bits (MBZ as of 4.9.3a3) */
- unsigned ra :1; /*%< recursion available */
-#endif
- /* remaining bytes */
- unsigned qdcount :16; /*%< number of question entries */
- unsigned ancount :16; /*%< number of answer entries */
- unsigned nscount :16; /*%< number of authority entries */
- unsigned arcount :16; /*%< number of resource entries */
-} HEADER;
-
-#define PACKETSZ NS_PACKETSZ
-#define MAXDNAME NS_MAXDNAME
-#define MAXCDNAME NS_MAXCDNAME
-#define MAXLABEL NS_MAXLABEL
-#define HFIXEDSZ NS_HFIXEDSZ
-#define QFIXEDSZ NS_QFIXEDSZ
-#define RRFIXEDSZ NS_RRFIXEDSZ
-#define INT32SZ NS_INT32SZ
-#define INT16SZ NS_INT16SZ
-#define INT8SZ NS_INT8SZ
-#define INADDRSZ NS_INADDRSZ
-#define IN6ADDRSZ NS_IN6ADDRSZ
-#define INDIR_MASK NS_CMPRSFLGS
-#define NAMESERVER_PORT NS_DEFAULTPORT
-
-#define S_ZONE ns_s_zn
-#define S_PREREQ ns_s_pr
-#define S_UPDATE ns_s_ud
-#define S_ADDT ns_s_ar
-
-#define QUERY ns_o_query
-#define IQUERY ns_o_iquery
-#define STATUS ns_o_status
-#define NS_NOTIFY_OP ns_o_notify
-#define NS_UPDATE_OP ns_o_update
-
-#define NOERROR ns_r_noerror
-#define FORMERR ns_r_formerr
-#define SERVFAIL ns_r_servfail
-#define NXDOMAIN ns_r_nxdomain
-#define NOTIMP ns_r_notimpl
-#define REFUSED ns_r_refused
-#define YXDOMAIN ns_r_yxdomain
-#define YXRRSET ns_r_yxrrset
-#define NXRRSET ns_r_nxrrset
-#define NOTAUTH ns_r_notauth
-#define NOTZONE ns_r_notzone
-/*#define BADSIG ns_r_badsig*/
-/*#define BADKEY ns_r_badkey*/
-/*#define BADTIME ns_r_badtime*/
-
-
-#define DELETE ns_uop_delete
-#define ADD ns_uop_add
-
-#define T_A ns_t_a
-#define T_NS ns_t_ns
-#define T_MD ns_t_md
-#define T_MF ns_t_mf
-#define T_CNAME ns_t_cname
-#define T_SOA ns_t_soa
-#define T_MB ns_t_mb
-#define T_MG ns_t_mg
-#define T_MR ns_t_mr
-#define T_NULL ns_t_null
-#define T_WKS ns_t_wks
-#define T_PTR ns_t_ptr
-#define T_HINFO ns_t_hinfo
-#define T_MINFO ns_t_minfo
-#define T_MX ns_t_mx
-#define T_TXT ns_t_txt
-#define T_RP ns_t_rp
-#define T_AFSDB ns_t_afsdb
-#define T_X25 ns_t_x25
-#define T_ISDN ns_t_isdn
-#define T_RT ns_t_rt
-#define T_NSAP ns_t_nsap
-#define T_NSAP_PTR ns_t_nsap_ptr
-#define T_SIG ns_t_sig
-#define T_KEY ns_t_key
-#define T_PX ns_t_px
-#define T_GPOS ns_t_gpos
-#define T_AAAA ns_t_aaaa
-#define T_LOC ns_t_loc
-#define T_NXT ns_t_nxt
-#define T_EID ns_t_eid
-#define T_NIMLOC ns_t_nimloc
-#define T_SRV ns_t_srv
-#define T_ATMA ns_t_atma
-#define T_NAPTR ns_t_naptr
-#define T_A6 ns_t_a6
-#define T_TSIG ns_t_tsig
-#define T_IXFR ns_t_ixfr
-#define T_AXFR ns_t_axfr
-#define T_MAILB ns_t_mailb
-#define T_MAILA ns_t_maila
-#define T_ANY ns_t_any
-
-#define C_IN ns_c_in
-#define C_CHAOS ns_c_chaos
-#define C_HS ns_c_hs
-/* BIND_UPDATE */
-#define C_NONE ns_c_none
-#define C_ANY ns_c_any
-
-#define GETSHORT NS_GET16
-#define GETLONG NS_GET32
-#define PUTSHORT NS_PUT16
-#define PUTLONG NS_PUT32
-
-#endif /* _ARPA_NAMESER_COMPAT_ */
-/*! \file */
diff --git a/lib/bind/include/fd_setsize.h b/lib/bind/include/fd_setsize.h
deleted file mode 100644
index 0e2104974299..000000000000
--- a/lib/bind/include/fd_setsize.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef _FD_SETSIZE_H
-#define _FD_SETSIZE_H
-
-/*%
- * If you need a bigger FD_SETSIZE, this is NOT the place to set it.
- * This file is a fallback for BIND ports which don't specify their own.
- */
-
-#endif /* _FD_SETSIZE_H */
-/*! \file */
diff --git a/lib/bind/include/hesiod.h b/lib/bind/include/hesiod.h
deleted file mode 100644
index 30c08d055a6b..000000000000
--- a/lib/bind/include/hesiod.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * 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 ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-/*! \file
- * \brief
- * This file is primarily maintained by <tytso@mit.edu> and <ghudson@mit.edu>.
- */
-
-/*
- * $Id: hesiod.h,v 1.3.18.1 2005/04/27 05:00:49 sra Exp $
- */
-
-#ifndef _HESIOD_H_INCLUDED
-#define _HESIOD_H_INCLUDED
-
-int hesiod_init __P((void **));
-void hesiod_end __P((void *));
-char * hesiod_to_bind __P((void *, const char *, const char *));
-char ** hesiod_resolve __P((void *, const char *, const char *));
-void hesiod_free_list __P((void *, char **));
-struct __res_state * __hesiod_res_get __P((void *));
-void __hesiod_res_set __P((void *, struct __res_state *,
- void (*)(void *)));
-
-#endif /*_HESIOD_H_INCLUDED*/
diff --git a/lib/bind/include/irp.h b/lib/bind/include/irp.h
deleted file mode 100644
index 21d8f4875873..000000000000
--- a/lib/bind/include/irp.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * Copyright (c) 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 ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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: irp.h,v 1.3.18.1 2005/04/27 05:00:49 sra Exp $
- */
-
-#ifndef _IRP_H_INCLUDED
-#define _IRP_H_INCLUDED
-
-/*! \file */
-
-#define IRPD_TIMEOUT 30 /*%< seconds */
-#define IRPD_MAXSESS 50 /*%< number of simultaneous sessions. */
-#define IRPD_PORT 6660 /*%< 10 times the number of the beast. */
-#define IRPD_PATH "/var/run/irpd" /*%< af_unix socket path */
-
-/* If sets the environment variable IRPDSERVER to an IP address
- (e.g. "192.5.5.1"), then that's the host the client expects irpd to be
- running on. */
-#define IRPD_HOST_ENV "IRPDSERVER"
-
-/* Protocol response codes. */
-#define IRPD_WELCOME_CODE 200
-#define IRPD_NOT_WELCOME_CODE 500
-
-#define IRPD_GETHOST_ERROR 510
-#define IRPD_GETHOST_NONE 210
-#define IRPD_GETHOST_OK 211
-#define IRPD_GETHOST_SETOK 212
-
-#define IRPD_GETNET_ERROR 520
-#define IRPD_GETNET_NONE 220
-#define IRPD_GETNET_OK 221
-#define IRPD_GETNET_SETOK 222
-
-#define IRPD_GETUSER_ERROR 530
-#define IRPD_GETUSER_NONE 230
-#define IRPD_GETUSER_OK 231
-#define IRPD_GETUSER_SETOK 232
-
-#define IRPD_GETGROUP_ERROR 540
-#define IRPD_GETGROUP_NONE 240
-#define IRPD_GETGROUP_OK 241
-#define IRPD_GETGROUP_SETOK 242
-
-#define IRPD_GETSERVICE_ERROR 550
-#define IRPD_GETSERVICE_NONE 250
-#define IRPD_GETSERVICE_OK 251
-#define IRPD_GETSERVICE_SETOK 252
-
-#define IRPD_GETPROTO_ERROR 560
-#define IRPD_GETPROTO_NONE 260
-#define IRPD_GETPROTO_OK 261
-#define IRPD_GETPROTO_SETOK 262
-
-#define IRPD_GETNETGR_ERROR 570
-#define IRPD_GETNETGR_NONE 270
-#define IRPD_GETNETGR_OK 271
-#define IRPD_GETNETGR_NOMORE 272
-#define IRPD_GETNETGR_MATCHES 273
-#define IRPD_GETNETGR_NOMATCH 274
-#define IRPD_GETNETGR_SETOK 275
-#define IRPD_GETNETGR_SETERR 276
-
-#define irs_irp_read_body __irs_irp_read_body
-#define irs_irp_read_response __irs_irp_read_response
-#define irs_irp_disconnect __irs_irp_disconnect
-#define irs_irp_connect __irs_irp_connect
-#define irs_irp_connection_setup __irs_irp_connection_setup
-#define irs_irp_send_command __irs_irp_send_command
-
-struct irp_p;
-
-char *irs_irp_read_body(struct irp_p *, size_t *);
-int irs_irp_read_response(struct irp_p *, char *, size_t);
-void irs_irp_disconnect(struct irp_p *);
-int irs_irp_connect(struct irp_p *);
-int irs_irp_is_connected(struct irp_p *);
-int irs_irp_connection_setup(struct irp_p *, int *);
-#ifdef __GNUC__
-int irs_irp_send_command(struct irp_p *, const char *, ...)
- __attribute__((__format__(__printf__, 2, 3)));
-#else
-int irs_irp_send_command(struct irp_p *, const char *, ...);
-#endif
-int irs_irp_get_full_response(struct irp_p *, int *, char *, size_t,
- char **, size_t *);
-int irs_irp_read_line(struct irp_p *, char *, int);
-
-#endif
-
-/*! \file */
diff --git a/lib/bind/include/irs.h b/lib/bind/include/irs.h
deleted file mode 100644
index 582ba5bf186d..000000000000
--- a/lib/bind/include/irs.h
+++ /dev/null
@@ -1,348 +0,0 @@
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * 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 ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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: irs.h,v 1.4.18.1 2005/04/27 05:00:49 sra Exp $
- */
-
-#ifndef _IRS_H_INCLUDED
-#define _IRS_H_INCLUDED
-
-/*! \file */
-
-#include <sys/types.h>
-
-#include <arpa/nameser.h>
-
-#include <grp.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <pwd.h>
-
-/*%
- * This is the group map class.
- */
-struct irs_gr {
- void * private;
- void (*close) __P((struct irs_gr *));
- struct group * (*next) __P((struct irs_gr *));
- struct group * (*byname) __P((struct irs_gr *, const char *));
- struct group * (*bygid) __P((struct irs_gr *, gid_t));
- int (*list) __P((struct irs_gr *, const char *,
- gid_t, gid_t *, int *));
- void (*rewind) __P((struct irs_gr *));
- void (*minimize) __P((struct irs_gr *));
- struct __res_state * (*res_get) __P((struct irs_gr *));
- void (*res_set) __P((struct irs_gr *, res_state,
- void (*)(void *)));
-};
-
-/*%
- * This is the password map class.
- */
-struct irs_pw {
- void * private;
- void (*close) __P((struct irs_pw *));
- struct passwd * (*next) __P((struct irs_pw *));
- struct passwd * (*byname) __P((struct irs_pw *, const char *));
- struct passwd * (*byuid) __P((struct irs_pw *, uid_t));
- void (*rewind) __P((struct irs_pw *));
- void (*minimize) __P((struct irs_pw *));
- struct __res_state * (*res_get) __P((struct irs_pw *));
- void (*res_set) __P((struct irs_pw *, res_state,
- void (*)(void *)));
-};
-
-/*%
- * This is the service map class.
- */
-struct irs_sv {
- void * private;
- void (*close) __P((struct irs_sv *));
- struct servent *(*byname) __P((struct irs_sv *,
- const char *, const char *));
- struct servent *(*byport) __P((struct irs_sv *, int, const char *));
- struct servent *(*next) __P((struct irs_sv *));
- void (*rewind) __P((struct irs_sv *));
- void (*minimize) __P((struct irs_sv *));
- struct __res_state * (*res_get) __P((struct irs_sv *));
- void (*res_set) __P((struct irs_sv *, res_state,
- void (*)(void *)));
-};
-
-/*%
- * This is the protocols map class.
- */
-struct irs_pr {
- void * private;
- void (*close) __P((struct irs_pr *));
- struct protoent *(*byname) __P((struct irs_pr *, const char *));
- struct protoent *(*bynumber) __P((struct irs_pr *, int));
- struct protoent *(*next) __P((struct irs_pr *));
- void (*rewind) __P((struct irs_pr *));
- void (*minimize) __P((struct irs_pr *));
- struct __res_state * (*res_get) __P((struct irs_pr *));
- void (*res_set) __P((struct irs_pr *, res_state,
- void (*)(void *)));
-};
-
-/*%
- * This is the hosts map class.
- */
-struct irs_ho {
- void * private;
- void (*close) __P((struct irs_ho *));
- struct hostent *(*byname) __P((struct irs_ho *, const char *));
- struct hostent *(*byname2) __P((struct irs_ho *, const char *, int));
- struct hostent *(*byaddr) __P((struct irs_ho *,
- const void *, int, int));
- struct hostent *(*next) __P((struct irs_ho *));
- void (*rewind) __P((struct irs_ho *));
- void (*minimize) __P((struct irs_ho *));
- struct __res_state * (*res_get) __P((struct irs_ho *));
- void (*res_set) __P((struct irs_ho *, res_state,
- void (*)(void *)));
- struct addrinfo *(*addrinfo) __P((struct irs_ho *, const char *,
- const struct addrinfo *));
-};
-
-/*%
- * This is the networks map class.
- */
-struct irs_nw {
- void * private;
- void (*close) __P((struct irs_nw *));
- struct nwent * (*byname) __P((struct irs_nw *, const char *, int));
- struct nwent * (*byaddr) __P((struct irs_nw *, void *, int, int));
- struct nwent * (*next) __P((struct irs_nw *));
- void (*rewind) __P((struct irs_nw *));
- void (*minimize) __P((struct irs_nw *));
- struct __res_state * (*res_get) __P((struct irs_nw *));
- void (*res_set) __P((struct irs_nw *, res_state,
- void (*)(void *)));
-};
-
-/*%
- * This is the netgroups map class.
- */
-struct irs_ng {
- void * private;
- void (*close) __P((struct irs_ng *));
- int (*next) __P((struct irs_ng *, const char **,
- const char **, const char **));
- int (*test) __P((struct irs_ng *, const char *,
- const char *, const char *,
- const char *));
- void (*rewind) __P((struct irs_ng *, const char *));
- void (*minimize) __P((struct irs_ng *));
-};
-
-/*%
- * This is the generic map class, which copies the front of all others.
- */
-struct irs_map {
- void * private;
- void (*close) __P((void *));
-};
-
-/*%
- * This is the accessor class. It contains pointers to all of the
- * initializers for the map classes for a particular accessor.
- */
-struct irs_acc {
- void * private;
- void (*close) __P((struct irs_acc *));
- struct irs_gr * (*gr_map) __P((struct irs_acc *));
- struct irs_pw * (*pw_map) __P((struct irs_acc *));
- struct irs_sv * (*sv_map) __P((struct irs_acc *));
- struct irs_pr * (*pr_map) __P((struct irs_acc *));
- struct irs_ho * (*ho_map) __P((struct irs_acc *));
- struct irs_nw * (*nw_map) __P((struct irs_acc *));
- struct irs_ng * (*ng_map) __P((struct irs_acc *));
- struct __res_state * (*res_get) __P((struct irs_acc *));
- void (*res_set) __P((struct irs_acc *, res_state,
- void (*)(void *)));
-};
-
-/*%
- * This is because the official definition of "struct netent" has no
- * concept of CIDR even though it allows variant address families (on
- * output but not input). The compatibility stubs convert the structs
- * below into "struct netent"'s.
- */
-struct nwent {
- char *n_name; /*%< official name of net */
- char **n_aliases; /*%< alias list */
- int n_addrtype; /*%< net address type */
- void *n_addr; /*%< network address */
- int n_length; /*%< address length, in bits */
-};
-
-/*%
- * Hide external function names from POSIX.
- */
-#define irs_gen_acc __irs_gen_acc
-#define irs_lcl_acc __irs_lcl_acc
-#define irs_dns_acc __irs_dns_acc
-#define irs_nis_acc __irs_nis_acc
-#define irs_irp_acc __irs_irp_acc
-#define irs_destroy __irs_destroy
-#define irs_dns_gr __irs_dns_gr
-#define irs_dns_ho __irs_dns_ho
-#define irs_dns_nw __irs_dns_nw
-#define irs_dns_pr __irs_dns_pr
-#define irs_dns_pw __irs_dns_pw
-#define irs_dns_sv __irs_dns_sv
-#define irs_gen_gr __irs_gen_gr
-#define irs_gen_ho __irs_gen_ho
-#define irs_gen_ng __irs_gen_ng
-#define irs_gen_nw __irs_gen_nw
-#define irs_gen_pr __irs_gen_pr
-#define irs_gen_pw __irs_gen_pw
-#define irs_gen_sv __irs_gen_sv
-#define irs_irp_get_full_response __irs_irp_get_full_response
-#define irs_irp_gr __irs_irp_gr
-#define irs_irp_ho __irs_irp_ho
-#define irs_irp_is_connected __irs_irp_is_connected
-#define irs_irp_ng __irs_irp_ng
-#define irs_irp_nw __irs_irp_nw
-#define irs_irp_pr __irs_irp_pr
-#define irs_irp_pw __irs_irp_pw
-#define irs_irp_read_line __irs_irp_read_line
-#define irs_irp_sv __irs_irp_sv
-#define irs_lcl_gr __irs_lcl_gr
-#define irs_lcl_ho __irs_lcl_ho
-#define irs_lcl_ng __irs_lcl_ng
-#define irs_lcl_nw __irs_lcl_nw
-#define irs_lcl_pr __irs_lcl_pr
-#define irs_lcl_pw __irs_lcl_pw
-#define irs_lcl_sv __irs_lcl_sv
-#define irs_nis_gr __irs_nis_gr
-#define irs_nis_ho __irs_nis_ho
-#define irs_nis_ng __irs_nis_ng
-#define irs_nis_nw __irs_nis_nw
-#define irs_nis_pr __irs_nis_pr
-#define irs_nis_pw __irs_nis_pw
-#define irs_nis_sv __irs_nis_sv
-#define net_data_create __net_data_create
-#define net_data_destroy __net_data_destroy
-#define net_data_minimize __net_data_minimize
-
-/*%
- * Externs.
- */
-extern struct irs_acc * irs_gen_acc __P((const char *, const char *));
-extern struct irs_acc * irs_lcl_acc __P((const char *));
-extern struct irs_acc * irs_dns_acc __P((const char *));
-extern struct irs_acc * irs_nis_acc __P((const char *));
-extern struct irs_acc * irs_irp_acc __P((const char *));
-
-extern void irs_destroy __P((void));
-
-/*%
- * These forward declarations are for the semi-private functions in
- * the get*.c files. Each of these funcs implements the real get*
- * functionality and the standard versions are just wrappers that
- * call these. Apart from the wrappers, only irpd is expected to
- * call these directly, hence these decls are put here and not in
- * the /usr/include replacements.
- */
-
-struct net_data; /*%< forward */
-/*
- * net_data_create gets a singleton net_data object. net_data_init
- * creates as many net_data objects as times it is called. Clients using
- * the default interface will use net_data_create by default. Servers will
- * probably want net_data_init (one call per client)
- */
-struct net_data *net_data_create __P((const char *));
-struct net_data *net_data_init __P((const char *));
-void net_data_destroy __P((void *));
-
-extern struct group *getgrent_p __P((struct net_data *));
-extern struct group *getgrnam_p __P((const char *, struct net_data *));
-extern struct group *getgrgid_p __P((gid_t, struct net_data *));
-extern int setgroupent_p __P((int, struct net_data *));
-extern void endgrent_p __P((struct net_data *));
-extern int getgrouplist_p __P((const char *, gid_t, gid_t *, int *,
- struct net_data *));
-
-#ifdef SETGRENT_VOID
-extern void setgrent_p __P((struct net_data *));
-#else
-extern int setgrent_p __P((struct net_data *));
-#endif
-
-extern struct hostent *gethostbyname_p __P((const char *,
- struct net_data *));
-extern struct hostent *gethostbyname2_p __P((const char *, int,
- struct net_data *));
-extern struct hostent *gethostbyaddr_p __P((const char *, int, int,
- struct net_data *));
-extern struct hostent *gethostent_p __P((struct net_data *));
-extern void sethostent_p __P((int, struct net_data *));
-extern void endhostent_p __P((struct net_data *));
-extern struct hostent *getipnodebyname_p __P((const char *, int, int, int *,
- struct net_data *));
-extern struct hostent *getipnodebyaddr_p __P((const void *, size_t,
- int, int *, struct net_data *));
-
-extern struct netent *getnetent_p __P((struct net_data *));
-extern struct netent *getnetbyname_p __P((const char *, struct net_data *));
-extern struct netent *getnetbyaddr_p __P((unsigned long, int,
- struct net_data *));
-extern void setnetent_p __P((int, struct net_data *));
-extern void endnetent_p __P((struct net_data *));
-
-extern void setnetgrent_p __P((const char *, struct net_data *));
-extern void endnetgrent_p __P((struct net_data *));
-extern int innetgr_p __P((const char *, const char *, const char *,
- const char *, struct net_data *));
-extern int getnetgrent_p __P((const char **, const char **,
- const char **, struct net_data *));
-
-extern struct protoent *getprotoent_p __P((struct net_data *));
-extern struct protoent *getprotobyname_p __P((const char *,
- struct net_data *));
-extern struct protoent *getprotobynumber_p __P((int, struct net_data *));
-extern void setprotoent_p __P((int, struct net_data *));
-extern void endprotoent_p __P((struct net_data *));
-
-
-extern struct passwd *getpwent_p __P((struct net_data *));
-extern struct passwd *getpwnam_p __P((const char *, struct net_data *));
-extern struct passwd *getpwuid_p __P((uid_t, struct net_data *));
-extern int setpassent_p __P((int, struct net_data *));
-extern void endpwent_p __P((struct net_data *));
-
-#ifdef SETPWENT_VOID
-extern void setpwent_p __P((struct net_data *));
-#else
-extern int setpwent_p __P((struct net_data *));
-#endif
-
-extern struct servent *getservent_p __P((struct net_data *));
-extern struct servent *getservbyname_p __P((const char *, const char *,
- struct net_data *));
-extern struct servent *getservbyport_p __P((int, const char *,
- struct net_data *));
-extern void setservent_p __P((int, struct net_data *));
-extern void endservent_p __P((struct net_data *));
-
-#endif /*_IRS_H_INCLUDED*/
-
-/*! \file */
diff --git a/lib/bind/include/isc/assertions.h b/lib/bind/include/isc/assertions.h
deleted file mode 100644
index 100e586658b0..000000000000
--- a/lib/bind/include/isc/assertions.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * Copyright (c) 1997-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 ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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: assertions.h,v 1.2.18.2 2008/10/15 03:57:21 marka Exp $
- */
-
-#ifndef ASSERTIONS_H
-#define ASSERTIONS_H 1
-
-typedef enum {
- assert_require, assert_ensure, assert_insist, assert_invariant
-} assertion_type;
-
-typedef void (*assertion_failure_callback)(const char *, int, assertion_type,
- const char *, int);
-
-/* coverity[+kill] */
-extern assertion_failure_callback __assertion_failed;
-void set_assertion_failure_callback(assertion_failure_callback f);
-const char *assertion_type_to_text(assertion_type type);
-
-#if defined(CHECK_ALL) || defined(__COVERITY__)
-#define CHECK_REQUIRE 1
-#define CHECK_ENSURE 1
-#define CHECK_INSIST 1
-#define CHECK_INVARIANT 1
-#endif
-
-#if defined(CHECK_NONE) && !defined(__COVERITY__)
-#define CHECK_REQUIRE 0
-#define CHECK_ENSURE 0
-#define CHECK_INSIST 0
-#define CHECK_INVARIANT 0
-#endif
-
-#ifndef CHECK_REQUIRE
-#define CHECK_REQUIRE 1
-#endif
-
-#ifndef CHECK_ENSURE
-#define CHECK_ENSURE 1
-#endif
-
-#ifndef CHECK_INSIST
-#define CHECK_INSIST 1
-#endif
-
-#ifndef CHECK_INVARIANT
-#define CHECK_INVARIANT 1
-#endif
-
-#if CHECK_REQUIRE != 0
-#define REQUIRE(cond) \
- ((void) ((cond) || \
- ((__assertion_failed)(__FILE__, __LINE__, assert_require, \
- #cond, 0), 0)))
-#define REQUIRE_ERR(cond) \
- ((void) ((cond) || \
- ((__assertion_failed)(__FILE__, __LINE__, assert_require, \
- #cond, 1), 0)))
-#else
-#define REQUIRE(cond) ((void) (cond))
-#define REQUIRE_ERR(cond) ((void) (cond))
-#endif /* CHECK_REQUIRE */
-
-#if CHECK_ENSURE != 0
-#define ENSURE(cond) \
- ((void) ((cond) || \
- ((__assertion_failed)(__FILE__, __LINE__, assert_ensure, \
- #cond, 0), 0)))
-#define ENSURE_ERR(cond) \
- ((void) ((cond) || \
- ((__assertion_failed)(__FILE__, __LINE__, assert_ensure, \
- #cond, 1), 0)))
-#else
-#define ENSURE(cond) ((void) (cond))
-#define ENSURE_ERR(cond) ((void) (cond))
-#endif /* CHECK_ENSURE */
-
-#if CHECK_INSIST != 0
-#define INSIST(cond) \
- ((void) ((cond) || \
- ((__assertion_failed)(__FILE__, __LINE__, assert_insist, \
- #cond, 0), 0)))
-#define INSIST_ERR(cond) \
- ((void) ((cond) || \
- ((__assertion_failed)(__FILE__, __LINE__, assert_insist, \
- #cond, 1), 0)))
-#else
-#define INSIST(cond) ((void) (cond))
-#define INSIST_ERR(cond) ((void) (cond))
-#endif /* CHECK_INSIST */
-
-#if CHECK_INVARIANT != 0
-#define INVARIANT(cond) \
- ((void) ((cond) || \
- ((__assertion_failed)(__FILE__, __LINE__, assert_invariant, \
- #cond, 0), 0)))
-#define INVARIANT_ERR(cond) \
- ((void) ((cond) || \
- ((__assertion_failed)(__FILE__, __LINE__, assert_invariant, \
- #cond, 1), 0)))
-#else
-#define INVARIANT(cond) ((void) (cond))
-#define INVARIANT_ERR(cond) ((void) (cond))
-#endif /* CHECK_INVARIANT */
-#endif /* ASSERTIONS_H */
-/*! \file */
diff --git a/lib/bind/include/isc/ctl.h b/lib/bind/include/isc/ctl.h
deleted file mode 100644
index 0f6fe94f7468..000000000000
--- a/lib/bind/include/isc/ctl.h
+++ /dev/null
@@ -1,112 +0,0 @@
-#ifndef ISC_CTL_H
-#define ISC_CTL_H
-
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * Copyright (c) 1998,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 ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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: ctl.h,v 1.4.18.1 2005/04/27 05:00:51 sra Exp $
- */
-
-/*! \file */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <isc/eventlib.h>
-
-/* Macros. */
-
-#define CTL_MORE 0x0001 /*%< More will be / should be sent. */
-#define CTL_EXIT 0x0002 /*%< Close connection after this. */
-#define CTL_DATA 0x0004 /*%< Go into / this is DATA mode. */
-/* Types. */
-
-struct ctl_cctx;
-struct ctl_sctx;
-struct ctl_sess;
-struct ctl_verb;
-
-enum ctl_severity { ctl_debug, ctl_warning, ctl_error };
-
-typedef void (*ctl_logfunc)(enum ctl_severity, const char *, ...);
-
-typedef void (*ctl_verbfunc)(struct ctl_sctx *, struct ctl_sess *,
- const struct ctl_verb *, const char *,
- u_int, const void *, void *);
-
-typedef void (*ctl_srvrdone)(struct ctl_sctx *, struct ctl_sess *, void *);
-
-typedef void (*ctl_clntdone)(struct ctl_cctx *, void *, const char *, u_int);
-
-struct ctl_verb {
- const char * name;
- ctl_verbfunc func;
- const char * help;
-};
-
-/* General symbols. */
-
-#define ctl_logger __ctl_logger
-
-#ifdef __GNUC__
-void ctl_logger(enum ctl_severity, const char *, ...)
- __attribute__((__format__(__printf__, 2, 3)));
-#else
-void ctl_logger(enum ctl_severity, const char *, ...);
-#endif
-
-/* Client symbols. */
-
-#define ctl_client __ctl_client
-#define ctl_endclient __ctl_endclient
-#define ctl_command __ctl_command
-
-struct ctl_cctx * ctl_client(evContext, const struct sockaddr *, size_t,
- const struct sockaddr *, size_t,
- ctl_clntdone, void *,
- u_int, ctl_logfunc);
-void ctl_endclient(struct ctl_cctx *);
-int ctl_command(struct ctl_cctx *, const char *, size_t,
- ctl_clntdone, void *);
-
-/* Server symbols. */
-
-#define ctl_server __ctl_server
-#define ctl_endserver __ctl_endserver
-#define ctl_response __ctl_response
-#define ctl_sendhelp __ctl_sendhelp
-#define ctl_getcsctx __ctl_getcsctx
-#define ctl_setcsctx __ctl_setcsctx
-
-struct ctl_sctx * ctl_server(evContext, const struct sockaddr *, size_t,
- const struct ctl_verb *,
- u_int, u_int,
- u_int, int, int,
- ctl_logfunc, void *);
-void ctl_endserver(struct ctl_sctx *);
-void ctl_response(struct ctl_sess *, u_int,
- const char *, u_int, const void *,
- ctl_srvrdone, void *,
- const char *, size_t);
-void ctl_sendhelp(struct ctl_sess *, u_int);
-void * ctl_getcsctx(struct ctl_sess *);
-void * ctl_setcsctx(struct ctl_sess *, void *);
-
-#endif /*ISC_CTL_H*/
-
-/*! \file */
diff --git a/lib/bind/include/isc/dst.h b/lib/bind/include/isc/dst.h
deleted file mode 100644
index 90a9e6746869..000000000000
--- a/lib/bind/include/isc/dst.h
+++ /dev/null
@@ -1,168 +0,0 @@
-#ifndef DST_H
-#define DST_H
-
-#ifndef HAS_DST_KEY
-typedef struct dst_key {
- char *dk_key_name; /*%< name of the key */
- int dk_key_size; /*%< this is the size of the key in bits */
- int dk_proto; /*%< what protocols this key can be used for */
- int dk_alg; /*%< algorithm number from key record */
- u_int32_t dk_flags; /*%< and the flags of the public key */
- u_int16_t dk_id; /*%< identifier of the key */
-} DST_KEY;
-#endif /* HAS_DST_KEY */
-/*
- * do not taint namespace
- */
-#define dst_bsafe_init __dst_bsafe_init
-#define dst_buffer_to_key __dst_buffer_to_key
-#define dst_check_algorithm __dst_check_algorithm
-#define dst_compare_keys __dst_compare_keys
-#define dst_cylink_init __dst_cylink_init
-#define dst_dnskey_to_key __dst_dnskey_to_key
-#define dst_eay_dss_init __dst_eay_dss_init
-#define dst_free_key __dst_free_key
-#define dst_generate_key __dst_generate_key
-#define dst_hmac_md5_init __dst_hmac_md5_init
-#define dst_init __dst_init
-#define dst_key_to_buffer __dst_key_to_buffer
-#define dst_key_to_dnskey __dst_key_to_dnskey
-#define dst_read_key __dst_read_key
-#define dst_rsaref_init __dst_rsaref_init
-#define dst_s_build_filename __dst_s_build_filename
-#define dst_s_calculate_bits __dst_s_calculate_bits
-#define dst_s_conv_bignum_b64_to_u8 __dst_s_conv_bignum_b64_to_u8
-#define dst_s_conv_bignum_u8_to_b64 __dst_s_conv_bignum_u8_to_b64
-#define dst_s_dns_key_id __dst_s_dns_key_id
-#define dst_s_dump __dst_s_dump
-#define dst_s_filename_length __dst_s_filename_length
-#define dst_s_fopen __dst_s_fopen
-#define dst_s_get_int16 __dst_s_get_int16
-#define dst_s_get_int32 __dst_s_get_int32
-#define dst_s_id_calc __dst_s_id_calc
-#define dst_s_put_int16 __dst_s_put_int16
-#define dst_s_put_int32 __dst_s_put_int32
-#define dst_s_quick_random __dst_s_quick_random
-#define dst_s_quick_random_set __dst_s_quick_random_set
-#define dst_s_random __dst_s_random
-#define dst_s_semi_random __dst_s_semi_random
-#define dst_s_verify_str __dst_s_verify_str
-#define dst_sig_size __dst_sig_size
-#define dst_sign_data __dst_sign_data
-#define dst_verify_data __dst_verify_data
-#define dst_write_key __dst_write_key
-
-/*
- * DST Crypto API defintions
- */
-void dst_init(void);
-int dst_check_algorithm(const int);
-
-
-int dst_sign_data(const int, /*!< specifies INIT/UPDATE/FINAL/ALL */
- DST_KEY *, /*!< the key to use */
- void **, /*!< pointer to state structure */
- const u_char *, /*!< data to be signed */
- const int, /*!< length of input data */
- u_char *, /*!< buffer to write signature to */
- const int); /*!< size of output buffer */
-int dst_verify_data(const int, /*!< specifies INIT/UPDATE/FINAL/ALL */
- DST_KEY *, /*!< the key to use */
- void **, /*!< pointer to state structure */
- const u_char *, /*!< data to be verified */
- const int, /*!< length of input data */
- const u_char *, /*!< buffer containing signature */
- const int); /*!< length of signature */
-DST_KEY *dst_read_key(const char *, /*!< name of key */
- const u_int16_t, /*!< key tag identifier */
- const int, /*!< key algorithm */
- const int); /*!< Private/PublicKey wanted */
-int dst_write_key(const DST_KEY *, /*!< key to write out */
- const int); /*!< Public/Private */
-DST_KEY *dst_dnskey_to_key(const char *, /*!< KEY record name */
- const u_char *, /*!< KEY RDATA */
- const int); /*!< size of input buffer */
-int dst_key_to_dnskey(const DST_KEY *, /*!< key to translate */
- u_char *, /*!< output buffer */
- const int); /*!< size of out_storage */
-DST_KEY *dst_buffer_to_key(const char *, /*!< name of the key */
- const int, /*!< algorithm */
- const int, /*!< dns flags */
- const int, /*!< dns protocol */
- const u_char *, /*!< key in dns wire fmt */
- const int); /*!< size of key */
-int dst_key_to_buffer(DST_KEY *, u_char *, int);
-
-DST_KEY *dst_generate_key(const char *, /*!< name of new key */
- const int, /*!< key algorithm to generate */
- const int, /*!< size of new key */
- const int, /*!< alg dependent parameter */
- const int, /*!< key DNS flags */
- const int); /*!< key DNS protocol */
-DST_KEY *dst_free_key(DST_KEY *);
-int dst_compare_keys(const DST_KEY *, const DST_KEY *);
-
-int dst_sig_size(DST_KEY *);
-
-
-/* support for dns key tags/ids */
-u_int16_t dst_s_dns_key_id(const u_char *, const int);
-u_int16_t dst_s_id_calc(const u_char *, const int);
-
-/* Used by callers as well as by the library. */
-#define RAW_KEY_SIZE 8192 /*%< large enough to store any key */
-/* DST_API control flags */
-/* These are used used in functions dst_sign_data and dst_verify_data */
-#define SIG_MODE_INIT 1 /*%< initialize digest */
-#define SIG_MODE_UPDATE 2 /*%< add data to digest */
-#define SIG_MODE_FINAL 4 /*%< generate/verify signature */
-#define SIG_MODE_ALL (SIG_MODE_INIT|SIG_MODE_UPDATE|SIG_MODE_FINAL)
-
-/* Flags for dst_read_private_key() */
-#define DST_FORCE_READ 0x1000000
-#define DST_CAN_SIGN 0x010F
-#define DST_NO_AUTHEN 0x8000
-#define DST_EXTEND_FLAG 0x1000
-#define DST_STANDARD 0
-#define DST_PRIVATE 0x2000000
-#define DST_PUBLIC 0x4000000
-#define DST_RAND_SEMI 1
-#define DST_RAND_STD 2
-#define DST_RAND_KEY 3
-#define DST_RAND_DSS 4
-
-
-/* DST algorithm codes */
-#define KEY_RSA 1
-#define KEY_DH 2
-#define KEY_DSA 3
-#define KEY_PRIVATE 254
-#define KEY_EXPAND 255
-#define KEY_HMAC_MD5 157
-#define KEY_HMAC_SHA1 158
-#define UNKNOWN_KEYALG 0
-#define DST_MAX_ALGS KEY_HMAC_SHA1
-
-/* DST constants to locations in KEY record changes in new KEY record */
-#define DST_FLAGS_SIZE 2
-#define DST_KEY_PROT 2
-#define DST_KEY_ALG 3
-#define DST_EXT_FLAG 4
-#define DST_KEY_START 4
-
-#ifndef SIGN_F_NOKEY
-#define SIGN_F_NOKEY 0xC000
-#endif
-
-/* error codes from dst routines */
-#define SIGN_INIT_FAILURE (-23)
-#define SIGN_UPDATE_FAILURE (-24)
-#define SIGN_FINAL_FAILURE (-25)
-#define VERIFY_INIT_FAILURE (-26)
-#define VERIFY_UPDATE_FAILURE (-27)
-#define VERIFY_FINAL_FAILURE (-28)
-#define MISSING_KEY_OR_SIGNATURE (-30)
-#define UNSUPPORTED_KEYALG (-31)
-
-#endif /* DST_H */
-/*! \file */
diff --git a/lib/bind/include/isc/eventlib.h b/lib/bind/include/isc/eventlib.h
deleted file mode 100644
index 50038231c852..000000000000
--- a/lib/bind/include/isc/eventlib.h
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * Copyright (c) 1995-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 ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-/* eventlib.h - exported interfaces for eventlib
- * vix 09sep95 [initial]
- *
- * $Id: eventlib.h,v 1.3.18.3 2008/01/23 02:12:01 marka Exp $
- */
-
-#ifndef _EVENTLIB_H
-#define _EVENTLIB_H
-
-#include <sys/types.h>
-#include <sys/uio.h>
-#include <sys/time.h>
-#include <stdio.h>
-
-#include <isc/platform.h>
-
-#ifndef __P
-# define __EVENTLIB_P_DEFINED
-# ifdef __STDC__
-# define __P(x) x
-# else
-# define __P(x) ()
-# endif
-#endif
-
-/* In the absence of branded types... */
-typedef struct { void *opaque; } evConnID;
-typedef struct { void *opaque; } evFileID;
-typedef struct { void *opaque; } evStreamID;
-typedef struct { void *opaque; } evTimerID;
-typedef struct { void *opaque; } evWaitID;
-typedef struct { void *opaque; } evContext;
-typedef struct { void *opaque; } evEvent;
-
-#define evInitID(id) ((id)->opaque = NULL)
-#define evTestID(id) ((id).opaque != NULL)
-
-typedef void (*evConnFunc)__P((evContext, void *, int, const void *, int,
- const void *, int));
-typedef void (*evFileFunc)__P((evContext, void *, int, int));
-typedef void (*evStreamFunc)__P((evContext, void *, int, int));
-typedef void (*evTimerFunc)__P((evContext, void *,
- struct timespec, struct timespec));
-typedef void (*evWaitFunc)__P((evContext, void *, const void *));
-
-typedef struct { unsigned char mask[256/8]; } evByteMask;
-#define EV_BYTEMASK_BYTE(b) ((b) / 8)
-#define EV_BYTEMASK_MASK(b) (1 << ((b) % 8))
-#define EV_BYTEMASK_SET(bm, b) \
- ((bm).mask[EV_BYTEMASK_BYTE(b)] |= EV_BYTEMASK_MASK(b))
-#define EV_BYTEMASK_CLR(bm, b) \
- ((bm).mask[EV_BYTEMASK_BYTE(b)] &= ~EV_BYTEMASK_MASK(b))
-#define EV_BYTEMASK_TST(bm, b) \
- ((bm).mask[EV_BYTEMASK_BYTE(b)] & EV_BYTEMASK_MASK(b))
-
-#define EV_POLL 1
-#define EV_WAIT 2
-#define EV_NULL 4
-
-#define EV_READ 1
-#define EV_WRITE 2
-#define EV_EXCEPT 4
-
-#define EV_WASNONBLOCKING 8 /* Internal library use. */
-
-/* eventlib.c */
-#define evCreate __evCreate
-#define evSetDebug __evSetDebug
-#define evDestroy __evDestroy
-#define evGetNext __evGetNext
-#define evDispatch __evDispatch
-#define evDrop __evDrop
-#define evMainLoop __evMainLoop
-#define evHighestFD __evHighestFD
-#define evGetOption __evGetOption
-#define evSetOption __evSetOption
-
-int evCreate __P((evContext *));
-void evSetDebug __P((evContext, int, FILE *));
-int evDestroy __P((evContext));
-int evGetNext __P((evContext, evEvent *, int));
-int evDispatch __P((evContext, evEvent));
-void evDrop __P((evContext, evEvent));
-int evMainLoop __P((evContext));
-int evHighestFD __P((evContext));
-int evGetOption __P((evContext *, const char *, int *));
-int evSetOption __P((evContext *, const char *, int));
-
-/* ev_connects.c */
-#define evListen __evListen
-#define evConnect __evConnect
-#define evCancelConn __evCancelConn
-#define evHold __evHold
-#define evUnhold __evUnhold
-#define evTryAccept __evTryAccept
-
-int evListen __P((evContext, int, int, evConnFunc, void *, evConnID *));
-int evConnect __P((evContext, int, const void *, int,
- evConnFunc, void *, evConnID *));
-int evCancelConn __P((evContext, evConnID));
-int evHold __P((evContext, evConnID));
-int evUnhold __P((evContext, evConnID));
-int evTryAccept __P((evContext, evConnID, int *));
-
-/* ev_files.c */
-#define evSelectFD __evSelectFD
-#define evDeselectFD __evDeselectFD
-
-int evSelectFD __P((evContext, int, int, evFileFunc, void *, evFileID *));
-int evDeselectFD __P((evContext, evFileID));
-
-/* ev_streams.c */
-#define evConsIovec __evConsIovec
-#define evWrite __evWrite
-#define evRead __evRead
-#define evTimeRW __evTimeRW
-#define evUntimeRW __evUntimeRW
-#define evCancelRW __evCancelRW
-
-struct iovec evConsIovec __P((void *, size_t));
-int evWrite __P((evContext, int, const struct iovec *, int,
- evStreamFunc func, void *, evStreamID *));
-int evRead __P((evContext, int, const struct iovec *, int,
- evStreamFunc func, void *, evStreamID *));
-int evTimeRW __P((evContext, evStreamID, evTimerID timer));
-int evUntimeRW __P((evContext, evStreamID));
-int evCancelRW __P((evContext, evStreamID));
-
-/* ev_timers.c */
-#define evConsTime __evConsTime
-#define evAddTime __evAddTime
-#define evSubTime __evSubTime
-#define evCmpTime __evCmpTime
-#define evTimeSpec __evTimeSpec
-#define evTimeVal __evTimeVal
-
-#define evNowTime __evNowTime
-#define evUTCTime __evUTCTime
-#define evLastEventTime __evLastEventTime
-#define evSetTimer __evSetTimer
-#define evClearTimer __evClearTimer
-#define evConfigTimer __evConfigTimer
-#define evResetTimer __evResetTimer
-#define evSetIdleTimer __evSetIdleTimer
-#define evClearIdleTimer __evClearIdleTimer
-#define evResetIdleTimer __evResetIdleTimer
-#define evTouchIdleTimer __evTouchIdleTimer
-
-struct timespec evConsTime __P((time_t sec, long nsec));
-struct timespec evAddTime __P((struct timespec, struct timespec));
-struct timespec evSubTime __P((struct timespec, struct timespec));
-struct timespec evNowTime __P((void));
-struct timespec evUTCTime __P((void));
-struct timespec evLastEventTime __P((evContext));
-struct timespec evTimeSpec __P((struct timeval));
-struct timeval evTimeVal __P((struct timespec));
-int evCmpTime __P((struct timespec, struct timespec));
-int evSetTimer __P((evContext, evTimerFunc, void *, struct timespec,
- struct timespec, evTimerID *));
-int evClearTimer __P((evContext, evTimerID));
-int evConfigTimer __P((evContext, evTimerID, const char *param,
- int value));
-int evResetTimer __P((evContext, evTimerID, evTimerFunc, void *,
- struct timespec, struct timespec));
-int evSetIdleTimer __P((evContext, evTimerFunc, void *, struct timespec,
- evTimerID *));
-int evClearIdleTimer __P((evContext, evTimerID));
-int evResetIdleTimer __P((evContext, evTimerID, evTimerFunc, void *,
- struct timespec));
-int evTouchIdleTimer __P((evContext, evTimerID));
-
-/* ev_waits.c */
-#define evWaitFor __evWaitFor
-#define evDo __evDo
-#define evUnwait __evUnwait
-#define evDefer __evDefer
-
-int evWaitFor __P((evContext, const void *, evWaitFunc, void *, evWaitID *));
-int evDo __P((evContext, const void *));
-int evUnwait __P((evContext, evWaitID));
-int evDefer __P((evContext, evWaitFunc, void *));
-
-#ifdef __EVENTLIB_P_DEFINED
-# undef __P
-#endif
-
-#endif /*_EVENTLIB_H*/
-
-/*! \file */
diff --git a/lib/bind/include/isc/heap.h b/lib/bind/include/isc/heap.h
deleted file mode 100644
index 384d507cf552..000000000000
--- a/lib/bind/include/isc/heap.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * Copyright (c) 1997,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 ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-typedef int (*heap_higher_priority_func)(void *, void *);
-typedef void (*heap_index_func)(void *, int);
-typedef void (*heap_for_each_func)(void *, void *);
-
-typedef struct heap_context {
- int array_size;
- int array_size_increment;
- int heap_size;
- void **heap;
- heap_higher_priority_func higher_priority;
- heap_index_func index;
-} *heap_context;
-
-#define heap_new __heap_new
-#define heap_free __heap_free
-#define heap_insert __heap_insert
-#define heap_delete __heap_delete
-#define heap_increased __heap_increased
-#define heap_decreased __heap_decreased
-#define heap_element __heap_element
-#define heap_for_each __heap_for_each
-
-heap_context heap_new(heap_higher_priority_func, heap_index_func, int);
-int heap_free(heap_context);
-int heap_insert(heap_context, void *);
-int heap_delete(heap_context, int);
-int heap_increased(heap_context, int);
-int heap_decreased(heap_context, int);
-void * heap_element(heap_context, int);
-int heap_for_each(heap_context, heap_for_each_func, void *);
-
-/*! \file */
diff --git a/lib/bind/include/isc/irpmarshall.h b/lib/bind/include/isc/irpmarshall.h
deleted file mode 100644
index ef57701781b2..000000000000
--- a/lib/bind/include/isc/irpmarshall.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * Copyright (c) 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 ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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: irpmarshall.h,v 1.3.18.1 2005/04/27 05:00:51 sra Exp $
- */
-
-#ifndef _IRPMARSHALL_H_INCLUDED
-#define _IRPMARSHALL_H_INCLUDED
-
-/* Hide function names */
-#define irp_marshall_gr __irp_marshall_gr
-#define irp_marshall_ho __irp_marshall_ho
-#define irp_marshall_ne __irp_marshall_ne
-#define irp_marshall_ng __irp_marshall_ng
-#define irp_marshall_nw __irp_marshall_nw
-#define irp_marshall_pr __irp_marshall_pr
-#define irp_marshall_pw __irp_marshall_pw
-#define irp_marshall_sv __irp_marshall_sv
-#define irp_unmarshall_gr __irp_unmarshall_gr
-#define irp_unmarshall_ho __irp_unmarshall_ho
-#define irp_unmarshall_ne __irp_unmarshall_ne
-#define irp_unmarshall_ng __irp_unmarshall_ng
-#define irp_unmarshall_nw __irp_unmarshall_nw
-#define irp_unmarshall_pr __irp_unmarshall_pr
-#define irp_unmarshall_pw __irp_unmarshall_pw
-#define irp_unmarshall_sv __irp_unmarshall_sv
-
-#define MAXPADDRSIZE (sizeof "255.255.255.255" + 1)
-#define ADDR_T_STR(x) (x == AF_INET ? "AF_INET" :\
- (x == AF_INET6 ? "AF_INET6" : "UNKNOWN"))
-
-/* See comment below on usage */
-int irp_marshall_pw(const struct passwd *, char **, size_t *);
-int irp_unmarshall_pw(struct passwd *, char *);
-int irp_marshall_gr(const struct group *, char **, size_t *);
-int irp_unmarshall_gr(struct group *, char *);
-int irp_marshall_sv(const struct servent *, char **, size_t *);
-int irp_unmarshall_sv(struct servent *, char *);
-int irp_marshall_pr(struct protoent *, char **, size_t *);
-int irp_unmarshall_pr(struct protoent *, char *);
-int irp_marshall_ho(struct hostent *, char **, size_t *);
-int irp_unmarshall_ho(struct hostent *, char *);
-int irp_marshall_ng(const char *, const char *, const char *,
- char **, size_t *);
-int irp_unmarshall_ng(const char **, const char **, const char **, char *);
-int irp_marshall_nw(struct nwent *, char **, size_t *);
-int irp_unmarshall_nw(struct nwent *, char *);
-int irp_marshall_ne(struct netent *, char **, size_t *);
-int irp_unmarshall_ne(struct netent *, char *);
-
-/*! \file
- * \brief
- * Functions to marshall and unmarshall various system data structures. We
- * use a printable ascii format that is as close to various system config
- * files as reasonable (e.g. /etc/passwd format).
- *
- * We are not forgiving with unmarhsalling misformatted buffers. In
- * particular whitespace in fields is not ignored. So a formatted password
- * entry "brister :1364:100:...." will yield a username of "brister "
- *
- * We potentially do a lot of mallocs to fill fields that are of type
- * (char **) like a hostent h_addr field. Building (for example) the
- * h_addr field and its associated addresses all in one buffer is
- * certainly possible, but not done here.
- *
- * The following description is true for all the marshalling functions:
- *
- * int irp_marshall_XX(struct yyyy *XX, char **buffer, size_t *len);
- *
- * The argument XX (of type struct passwd for example) is marshalled in the
- * buffer pointed at by *BUFFER, which is of length *LEN. Returns 0
- * on success and -1 on failure. Failure will occur if *LEN is
- * smaller than needed.
- *
- * If BUFFER is NULL, then *LEN is set to the size of the buffer
- * needed to marshall the data and no marshalling is actually done.
- *
- * If *BUFFER is NULL, then a buffer large enough will be allocated
- * with memget() and the size allocated will be stored in *LEN. An extra 2
- * bytes will be allocated for the client to append CRLF if wanted. The
- * value of *LEN will include these two bytes.
- *
- * All the marshalling functions produce a buffer with the fields
- * separated by colons (except for the hostent marshalling, which uses '@'
- * to separate fields). Fields that have multiple subfields (like the
- * gr_mem field in struct group) have their subparts separated by
- * commas.
- *
- * int irp_unmarshall_XX(struct YYYYY *XX, char *buffer);
- *
- * The unmashalling functions break apart the buffer and store the
- * values in the struct pointed to by XX. All pointer values inside
- * XX are allocated with malloc. All arrays of pointers have a NULL
- * as the last element.
- */
-
-#endif
diff --git a/lib/bind/include/isc/list.h b/lib/bind/include/isc/list.h
deleted file mode 100644
index c85c6676b51c..000000000000
--- a/lib/bind/include/isc/list.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * Copyright (c) 1997,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 ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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 LIST_H
-#define LIST_H 1
-#include <isc/assertions.h>
-
-#define LIST(type) struct { type *head, *tail; }
-#define INIT_LIST(list) \
- do { (list).head = NULL; (list).tail = NULL; } while (0)
-
-#define LINK(type) struct { type *prev, *next; }
-#define INIT_LINK_TYPE(elt, link, type) \
- do { \
- (elt)->link.prev = (type *)(-1); \
- (elt)->link.next = (type *)(-1); \
- } while (0)
-#define INIT_LINK(elt, link) \
- INIT_LINK_TYPE(elt, link, void)
-#define LINKED(elt, link) ((void *)((elt)->link.prev) != (void *)(-1))
-
-#define HEAD(list) ((list).head)
-#define TAIL(list) ((list).tail)
-#define EMPTY(list) ((list).head == NULL)
-
-#define PREPEND(list, elt, link) \
- do { \
- INSIST(!LINKED(elt, link));\
- if ((list).head != NULL) \
- (list).head->link.prev = (elt); \
- else \
- (list).tail = (elt); \
- (elt)->link.prev = NULL; \
- (elt)->link.next = (list).head; \
- (list).head = (elt); \
- } while (0)
-
-#define APPEND(list, elt, link) \
- do { \
- INSIST(!LINKED(elt, link));\
- if ((list).tail != NULL) \
- (list).tail->link.next = (elt); \
- else \
- (list).head = (elt); \
- (elt)->link.prev = (list).tail; \
- (elt)->link.next = NULL; \
- (list).tail = (elt); \
- } while (0)
-
-#define UNLINK_TYPE(list, elt, link, type) \
- do { \
- INSIST(LINKED(elt, link));\
- if ((elt)->link.next != NULL) \
- (elt)->link.next->link.prev = (elt)->link.prev; \
- else { \
- INSIST((list).tail == (elt)); \
- (list).tail = (elt)->link.prev; \
- } \
- if ((elt)->link.prev != NULL) \
- (elt)->link.prev->link.next = (elt)->link.next; \
- else { \
- INSIST((list).head == (elt)); \
- (list).head = (elt)->link.next; \
- } \
- INIT_LINK_TYPE(elt, link, type); \
- } while (0)
-#define UNLINK(list, elt, link) \
- UNLINK_TYPE(list, elt, link, void)
-
-#define PREV(elt, link) ((elt)->link.prev)
-#define NEXT(elt, link) ((elt)->link.next)
-
-#define INSERT_BEFORE(list, before, elt, link) \
- do { \
- INSIST(!LINKED(elt, link));\
- if ((before)->link.prev == NULL) \
- PREPEND(list, elt, link); \
- else { \
- (elt)->link.prev = (before)->link.prev; \
- (before)->link.prev = (elt); \
- (elt)->link.prev->link.next = (elt); \
- (elt)->link.next = (before); \
- } \
- } while (0)
-
-#define INSERT_AFTER(list, after, elt, link) \
- do { \
- INSIST(!LINKED(elt, link));\
- if ((after)->link.next == NULL) \
- APPEND(list, elt, link); \
- else { \
- (elt)->link.next = (after)->link.next; \
- (after)->link.next = (elt); \
- (elt)->link.next->link.prev = (elt); \
- (elt)->link.prev = (after); \
- } \
- } while (0)
-
-#define ENQUEUE(list, elt, link) APPEND(list, elt, link)
-#define DEQUEUE(list, elt, link) UNLINK(list, elt, link)
-
-#endif /* LIST_H */
-/*! \file */
diff --git a/lib/bind/include/isc/logging.h b/lib/bind/include/isc/logging.h
deleted file mode 100644
index c539443ff83c..000000000000
--- a/lib/bind/include/isc/logging.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * 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 ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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 LOGGING_H
-#define LOGGING_H
-
-#include <sys/types.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <unistd.h>
-
-#define log_critical (-5)
-#define log_error (-4)
-#define log_warning (-3)
-#define log_notice (-2)
-#define log_info (-1)
-#define log_debug(level) (level)
-
-typedef enum { log_syslog, log_file, log_null } log_channel_type;
-
-#define LOG_MAX_VERSIONS 99
-
-#define LOG_CLOSE_STREAM 0x0001
-#define LOG_TIMESTAMP 0x0002
-#define LOG_TRUNCATE 0x0004
-#define LOG_USE_CONTEXT_LEVEL 0x0008
-#define LOG_PRINT_LEVEL 0x0010
-#define LOG_REQUIRE_DEBUG 0x0020
-#define LOG_CHANNEL_BROKEN 0x0040
-#define LOG_PRINT_CATEGORY 0x0080
-#define LOG_CHANNEL_OFF 0x0100
-
-typedef struct log_context *log_context;
-typedef struct log_channel *log_channel;
-
-#define LOG_OPTION_DEBUG 0x01
-#define LOG_OPTION_LEVEL 0x02
-
-#define log_open_stream __log_open_stream
-#define log_close_stream __log_close_stream
-#define log_get_stream __log_get_stream
-#define log_get_filename __log_get_filename
-#define log_check_channel __log_check_channel
-#define log_check __log_check
-#define log_vwrite __log_vwrite
-#define log_write __log_write
-#define log_new_context __log_new_context
-#define log_free_context __log_free_context
-#define log_add_channel __log_add_channel
-#define log_remove_channel __log_remove_channel
-#define log_option __log_option
-#define log_category_is_active __log_category_is_active
-#define log_new_syslog_channel __log_new_syslog_channel
-#define log_new_file_channel __log_new_file_channel
-#define log_set_file_owner __log_set_file_owner
-#define log_new_null_channel __log_new_null_channel
-#define log_inc_references __log_inc_references
-#define log_dec_references __log_dec_references
-#define log_get_channel_type __log_get_channel_type
-#define log_free_channel __log_free_channel
-#define log_close_debug_channels __log_close_debug_channels
-
-FILE * log_open_stream(log_channel);
-int log_close_stream(log_channel);
-FILE * log_get_stream(log_channel);
-char * log_get_filename(log_channel);
-int log_check_channel(log_context, int, log_channel);
-int log_check(log_context, int, int);
-#ifdef __GNUC__
-void log_vwrite(log_context, int, int, const char *,
- va_list args)
- __attribute__((__format__(__printf__, 4, 0)));
-void log_write(log_context, int, int, const char *, ...)
- __attribute__((__format__(__printf__, 4, 5)));
-#else
-void log_vwrite(log_context, int, int, const char *,
- va_list args);
-void log_write(log_context, int, int, const char *, ...);
-#endif
-int log_new_context(int, char **, log_context *);
-void log_free_context(log_context);
-int log_add_channel(log_context, int, log_channel);
-int log_remove_channel(log_context, int, log_channel);
-int log_option(log_context, int, int);
-int log_category_is_active(log_context, int);
-log_channel log_new_syslog_channel(unsigned int, int, int);
-log_channel log_new_file_channel(unsigned int, int, const char *,
- FILE *, unsigned int,
- unsigned long);
-int log_set_file_owner(log_channel, uid_t, gid_t);
-log_channel log_new_null_channel(void);
-int log_inc_references(log_channel);
-int log_dec_references(log_channel);
-log_channel_type log_get_channel_type(log_channel);
-int log_free_channel(log_channel);
-void log_close_debug_channels(log_context);
-
-#endif /* !LOGGING_H */
-/*! \file */
diff --git a/lib/bind/include/isc/memcluster.h b/lib/bind/include/isc/memcluster.h
deleted file mode 100644
index 0923deb5e7c2..000000000000
--- a/lib/bind/include/isc/memcluster.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * Copyright (c) 1997,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 ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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 MEMCLUSTER_H
-#define MEMCLUSTER_H
-
-#include <stdio.h>
-
-#define meminit __meminit
-#ifdef MEMCLUSTER_DEBUG
-#define memget(s) __memget_debug(s, __FILE__, __LINE__)
-#define memput(p, s) __memput_debug(p, s, __FILE__, __LINE__)
-#else /*MEMCLUSTER_DEBUG*/
-#ifdef MEMCLUSTER_RECORD
-#define memget(s) __memget_record(s, __FILE__, __LINE__)
-#define memput(p, s) __memput_record(p, s, __FILE__, __LINE__)
-#else /*MEMCLUSTER_RECORD*/
-#define memget __memget
-#define memput __memput
-#endif /*MEMCLUSTER_RECORD*/
-#endif /*MEMCLUSTER_DEBUG*/
-#define memstats __memstats
-#define memactive __memactive
-
-int meminit(size_t, size_t);
-void * __memget(size_t);
-void __memput(void *, size_t);
-void * __memget_debug(size_t, const char *, int);
-void __memput_debug(void *, size_t, const char *, int);
-void * __memget_record(size_t, const char *, int);
-void __memput_record(void *, size_t, const char *, int);
-void memstats(FILE *);
-int memactive(void);
-
-#endif /* MEMCLUSTER_H */
-/*! \file */
diff --git a/lib/bind/include/isc/misc.h b/lib/bind/include/isc/misc.h
deleted file mode 100644
index 0cd1487a4b93..000000000000
--- a/lib/bind/include/isc/misc.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * Copyright (c) 1995-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 ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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: misc.h,v 1.4.18.2 2008/02/18 04:04:06 marka Exp $
- */
-
-#ifndef _ISC_MISC_H
-#define _ISC_MISC_H
-
-/*! \file */
-
-#include <stdio.h>
-#include <sys/types.h>
-
-#define bitncmp __bitncmp
-/*#define isc_movefile __isc_movefile */
-
-extern int bitncmp(const void *, const void *, int);
-extern int isc_movefile(const char *, const char *);
-
-extern int isc_gethexstring(unsigned char *, size_t, int, FILE *,
- int *);
-extern void isc_puthexstring(FILE *, const unsigned char *, size_t,
- size_t, size_t, const char *);
-extern void isc_tohex(const unsigned char *, size_t, char *);
-
-#endif /*_ISC_MISC_H*/
-
-/*! \file */
diff --git a/lib/bind/include/isc/platform.h.in b/lib/bind/include/isc/platform.h.in
deleted file mode 100644
index 40ab5d725f83..000000000000
--- a/lib/bind/include/isc/platform.h.in
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2008 Internet Systems Consortium, Inc. ("ISC")
- *
- * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC 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: platform.h.in,v 1.2.6.2 2008/01/23 02:15:02 tbox Exp $ */
-
-/*! \file */
-
-#ifndef ISC_PLATFORM_H
-#define ISC_PLATFORM_H
-
-/*
- * Define if the OS does not define struct timespec.
- */
-@ISC_PLATFORM_NEEDTIMESPEC@
-#ifdef ISC_PLATFORM_NEEDTIMESPEC
-#include <time.h> /* For time_t */
-struct timespec {
- time_t tv_sec; /* seconds */
- long tv_nsec; /* nanoseconds */
-};
-#endif
-
-#endif
diff --git a/lib/bind/include/isc/tree.h b/lib/bind/include/isc/tree.h
deleted file mode 100644
index 8096a8dece9a..000000000000
--- a/lib/bind/include/isc/tree.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* tree.h - declare structures used by tree library
- *
- * vix 22jan93 [revisited; uses RCS, ANSI, POSIX; has bug fixes]
- * vix 27jun86 [broken out of tree.c]
- *
- * $Id: tree.h,v 1.2.164.1 2005/04/27 05:00:52 sra Exp $
- */
-
-
-#ifndef _TREE_H_INCLUDED
-#define _TREE_H_INCLUDED
-
-
-#ifndef __P
-# if defined(__STDC__) || defined(__GNUC__)
-# define __P(x) x
-# else
-# define __P(x) ()
-# endif
-#endif
-
-/*%
- * tree_t is our package-specific anonymous pointer.
- */
-#if defined(__STDC__) || defined(__GNUC__)
-typedef void *tree_t;
-#else
-typedef char *tree_t;
-#endif
-
-/*%
- * Do not taint namespace
- */
-#define tree_add __tree_add
-#define tree_delete __tree_delete
-#define tree_init __tree_init
-#define tree_mung __tree_mung
-#define tree_srch __tree_srch
-#define tree_trav __tree_trav
-
-
-typedef struct tree_s {
- tree_t data;
- struct tree_s *left, *right;
- short bal;
- }
- tree;
-
-
-void tree_init __P((tree **));
-tree_t tree_srch __P((tree **, int (*)(), tree_t));
-tree_t tree_add __P((tree **, int (*)(), tree_t, void (*)()));
-int tree_delete __P((tree **, int (*)(), tree_t, void (*)()));
-int tree_trav __P((tree **, int (*)()));
-void tree_mung __P((tree **, void (*)()));
-
-
-#endif /* _TREE_H_INCLUDED */
-/*! \file */
diff --git a/lib/bind/include/netdb.h b/lib/bind/include/netdb.h
deleted file mode 100644
index b74c6462b622..000000000000
--- a/lib/bind/include/netdb.h
+++ /dev/null
@@ -1,582 +0,0 @@
-/*
- * ++Copyright++ 1980, 1983, 1988, 1993
- * -
- * Copyright (c) 1980, 1983, 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.
- * -
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- * -
- * Portions Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
- * 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 WIDE Project and
- * its contributors.
- * 4. Neither the name of the project 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 PROJECT 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 PROJECT 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.
- * -
- * --Copyright--
- */
-
-/*
- * @(#)netdb.h 8.1 (Berkeley) 6/2/93
- * $Id: netdb.h,v 1.15.18.7 2008/02/28 05:49:37 marka Exp $
- */
-
-#ifndef _NETDB_H_
-#define _NETDB_H_
-
-#include <sys/param.h>
-#include <sys/types.h>
-#if (!defined(BSD)) || (BSD < 199306)
-# include <sys/bitypes.h>
-#endif
-#include <sys/cdefs.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <stdio.h>
-
-#ifndef _PATH_HEQUIV
-#define _PATH_HEQUIV "/etc/hosts.equiv"
-#endif
-#ifndef _PATH_HOSTS
-#define _PATH_HOSTS "/etc/hosts"
-#endif
-#ifndef _PATH_NETWORKS
-#define _PATH_NETWORKS "/etc/networks"
-#endif
-#ifndef _PATH_PROTOCOLS
-#define _PATH_PROTOCOLS "/etc/protocols"
-#endif
-#ifndef _PATH_SERVICES
-#define _PATH_SERVICES "/etc/services"
-#endif
-
-#if (__GLIBC__ > 2 || __GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)
-#define __h_errno __h_errno_location
-#endif
-__BEGIN_DECLS
-extern int * __h_errno __P((void));
-__END_DECLS
-#if defined(_REENTRANT) || \
- (__GLIBC__ > 2 || __GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)
-#define h_errno (*__h_errno())
-#else
-extern int h_errno;
-#endif
-
-/*%
- * Structures returned by network data base library. All addresses are
- * supplied in host order, and returned in network order (suitable for
- * use in system calls).
- */
-struct hostent {
- char *h_name; /*%< official name of host */
- char **h_aliases; /*%< alias list */
- int h_addrtype; /*%< host address type */
- int h_length; /*%< length of address */
- char **h_addr_list; /*%< list of addresses from name server */
-#define h_addr h_addr_list[0] /*%< address, for backward compatiblity */
-};
-
-/*%
- * Assumption here is that a network number
- * fits in an unsigned long -- probably a poor one.
- */
-struct netent {
- char *n_name; /*%< official name of net */
- char **n_aliases; /*%< alias list */
- int n_addrtype; /*%< net address type */
- unsigned long n_net; /*%< network # */
-};
-
-struct servent {
- char *s_name; /*%< official service name */
- char **s_aliases; /*%< alias list */
- int s_port; /*%< port # */
- char *s_proto; /*%< protocol to use */
-};
-
-struct protoent {
- char *p_name; /*%< official protocol name */
- char **p_aliases; /*%< alias list */
- int p_proto; /*%< protocol # */
-};
-
-struct addrinfo {
- int ai_flags; /*%< AI_PASSIVE, AI_CANONNAME */
- int ai_family; /*%< PF_xxx */
- int ai_socktype; /*%< SOCK_xxx */
- int ai_protocol; /*%< 0 or IPPROTO_xxx for IPv4 and IPv6 */
-#if defined(sun) && defined(_SOCKLEN_T)
-#ifdef __sparcv9
- int _ai_pad;
-#endif
- socklen_t ai_addrlen;
-#else
- size_t ai_addrlen; /*%< length of ai_addr */
-#endif
-#ifdef __linux
- struct sockaddr *ai_addr; /*%< binary address */
- char *ai_canonname; /*%< canonical name for hostname */
-#else
- char *ai_canonname; /*%< canonical name for hostname */
- struct sockaddr *ai_addr; /*%< binary address */
-#endif
- struct addrinfo *ai_next; /*%< next structure in linked list */
-};
-
-/*%
- * Error return codes from gethostbyname() and gethostbyaddr()
- * (left in extern int h_errno).
- */
-
-#define NETDB_INTERNAL -1 /*%< see errno */
-#define NETDB_SUCCESS 0 /*%< no problem */
-#define HOST_NOT_FOUND 1 /*%< Authoritative Answer Host not found */
-#define TRY_AGAIN 2 /*%< Non-Authoritive Host not found, or SERVERFAIL */
-#define NO_RECOVERY 3 /*%< Non recoverable errors, FORMERR, REFUSED, NOTIMP */
-#define NO_DATA 4 /*%< Valid name, no data record of requested type */
-#define NO_ADDRESS NO_DATA /*%< no address, look for MX record */
-/*
- * Error return codes from getaddrinfo()
- */
-#define EAI_ADDRFAMILY 1 /*%< address family for hostname not supported */
-#define EAI_AGAIN 2 /*%< temporary failure in name resolution */
-#define EAI_BADFLAGS 3 /*%< invalid value for ai_flags */
-#define EAI_FAIL 4 /*%< non-recoverable failure in name resolution */
-#define EAI_FAMILY 5 /*%< ai_family not supported */
-#define EAI_MEMORY 6 /*%< memory allocation failure */
-#define EAI_NODATA 7 /*%< no address associated with hostname */
-#define EAI_NONAME 8 /*%< hostname nor servname provided, or not known */
-#define EAI_SERVICE 9 /*%< servname not supported for ai_socktype */
-#define EAI_SOCKTYPE 10 /*%< ai_socktype not supported */
-#define EAI_SYSTEM 11 /*%< system error returned in errno */
-#define EAI_BADHINTS 12
-#define EAI_PROTOCOL 13
-#define EAI_MAX 14
-
-/*%
- * Flag values for getaddrinfo()
- */
-#define AI_PASSIVE 0x00000001
-#define AI_CANONNAME 0x00000002
-#define AI_NUMERICHOST 0x00000004
-#define AI_MASK 0x00000007
-
-/*%
- * Flag values for getipnodebyname()
- */
-#define AI_V4MAPPED 0x00000008
-#define AI_ALL 0x00000010
-#define AI_ADDRCONFIG 0x00000020
-#define AI_DEFAULT (AI_V4MAPPED|AI_ADDRCONFIG)
-
-/*%
- * Constants for getnameinfo()
- */
-#define NI_MAXHOST 1025
-#define NI_MAXSERV 32
-
-/*%
- * Flag values for getnameinfo()
- */
-#define NI_NOFQDN 0x00000001
-#define NI_NUMERICHOST 0x00000002
-#define NI_NAMEREQD 0x00000004
-#define NI_NUMERICSERV 0x00000008
-#define NI_DGRAM 0x00000010
-#define NI_WITHSCOPEID 0x00000020
-#define NI_NUMERICSCOPE 0x00000040
-
-/*%
- * Scope delimit character
- */
-#define SCOPE_DELIMITER '%'
-
-
-#ifdef _REENTRANT
-#if defined (__hpux) || defined(__osf__) || defined(_AIX)
-#define _MAXALIASES 35
-#define _MAXLINELEN 1024
-#define _MAXADDRS 35
-#define _HOSTBUFSIZE (BUFSIZ + 1)
-
-struct hostent_data {
- struct in_addr host_addr;
- char *h_addr_ptrs[_MAXADDRS + 1];
- char hostaddr[_MAXADDRS];
- char hostbuf[_HOSTBUFSIZE];
- char *host_aliases[_MAXALIASES];
- char *host_addrs[2];
- FILE *hostf;
-#ifdef __osf__
- int svc_gethostflag;
- int svc_gethostbind;
-#endif
-#ifdef __hpux
- short _nsw_src;
- short _flags;
- char *current;
- int currentlen;
-#endif
-};
-
-struct netent_data {
- FILE *net_fp;
-#if defined(__osf__) || defined(_AIX)
- char line[_MAXLINELEN];
-#endif
-#ifdef __hpux
- char line[_MAXLINELEN+1];
-#endif
- char *net_aliases[_MAXALIASES];
-#ifdef __osf__
- int _net_stayopen;
- int svc_getnetflag;
-#endif
-#ifdef __hpux
- short _nsw_src;
- short _flags;
- char *current;
- int currentlen;
-#endif
-#ifdef _AIX
- int _net_stayopen;
- char *current;
- int currentlen;
- void *_net_reserv1; /* reserved for future use */
- void *_net_reserv2; /* reserved for future use */
-#endif
-};
-
-struct protoent_data {
- FILE *proto_fp;
-#ifdef _AIX
- int _proto_stayopen;
- char line[_MAXLINELEN];
-#endif
-#ifdef __osf__
- char line[1024];
-#endif
-#ifdef __hpux
- char line[_MAXLINELEN+1];
-#endif
- char *proto_aliases[_MAXALIASES];
-#ifdef __osf__
- int _proto_stayopen;
- int svc_getprotoflag;
-#endif
-#ifdef __hpux
- short _nsw_src;
- short _flags;
- char *current;
- int currentlen;
-#endif
-#ifdef _AIX
- int currentlen;
- char *current;
- void *_proto_reserv1; /* reserved for future use */
- void *_proto_reserv2; /* reserved for future use */
-#endif
-};
-
-struct servent_data {
- FILE *serv_fp;
-#if defined(__osf__) || defined(_AIX)
- char line[_MAXLINELEN];
-#endif
-#ifdef __hpux
- char line[_MAXLINELEN+1];
-#endif
- char *serv_aliases[_MAXALIASES];
-#ifdef __osf__
- int _serv_stayopen;
- int svc_getservflag;
-#endif
-#ifdef __hpux
- short _nsw_src;
- short _flags;
- char *current;
- int currentlen;
-#endif
-#ifdef _AIX
- int _serv_stayopen;
- char *current;
- int currentlen;
- void *_serv_reserv1; /* reserved for future use */
- void *_serv_reserv2; /* reserved for future use */
-#endif
-};
-#endif
-#endif
-__BEGIN_DECLS
-void endhostent __P((void));
-void endnetent __P((void));
-void endprotoent __P((void));
-void endservent __P((void));
-void freehostent __P((struct hostent *));
-struct hostent *gethostbyaddr __P((const char *, int, int));
-struct hostent *gethostbyname __P((const char *));
-struct hostent *gethostbyname2 __P((const char *, int));
-struct hostent *gethostent __P((void));
-struct hostent *getipnodebyaddr __P((const void *, size_t, int, int *));
-struct hostent *getipnodebyname __P((const char *, int, int, int *));
-struct netent *getnetbyaddr __P((unsigned long, int));
-struct netent *getnetbyname __P((const char *));
-struct netent *getnetent __P((void));
-struct protoent *getprotobyname __P((const char *));
-struct protoent *getprotobynumber __P((int));
-struct protoent *getprotoent __P((void));
-struct servent *getservbyname __P((const char *, const char *));
-struct servent *getservbyport __P((int, const char *));
-struct servent *getservent __P((void));
-void herror __P((const char *));
-const char *hstrerror __P((int));
-void sethostent __P((int));
-/* void sethostfile __P((const char *)); */
-void setnetent __P((int));
-void setprotoent __P((int));
-void setservent __P((int));
-int getaddrinfo __P((const char *, const char *,
- const struct addrinfo *, struct addrinfo **));
-int getnameinfo __P((const struct sockaddr *, size_t, char *,
- size_t, char *, size_t, int));
-void freeaddrinfo __P((struct addrinfo *));
-const char *gai_strerror __P((int));
-struct hostent *getipnodebyname __P((const char *, int, int, int *));
-struct hostent *getipnodebyaddr __P((const void *, size_t, int, int *));
-void freehostent __P((struct hostent *));
-#ifdef __GLIBC__
-int getnetgrent __P((/* const */ char **, /* const */ char **,
- /* const */ char **));
-void setnetgrent __P((const char *));
-void endnetgrent __P((void));
-int innetgr __P((const char *, const char *, const char *,
- const char *));
-#endif
-
-#ifdef _REENTRANT
-#if defined(__hpux) || defined(__osf__) || defined(_AIX)
-int gethostbyaddr_r __P((const char *, int, int, struct hostent *,
- struct hostent_data *));
-int gethostbyname_r __P((const char *, struct hostent *,
- struct hostent_data *));
-int gethostent_r __P((struct hostent *, struct hostent_data *));
-#if defined(_AIX)
-void sethostent_r __P((int, struct hostent_data *));
-#else
-int sethostent_r __P((int, struct hostent_data *));
-#endif
-#if defined(__hpux)
-int endhostent_r __P((struct hostent_data *));
-#else
-void endhostent_r __P((struct hostent_data *));
-#endif
-
-#if defined(__hpux) || defined(__osf__)
-int getnetbyaddr_r __P((int, int,
- struct netent *, struct netent_data *));
-#else
-int getnetbyaddr_r __P((long, int,
- struct netent *, struct netent_data *));
-#endif
-int getnetbyname_r __P((const char *,
- struct netent *, struct netent_data *));
-int getnetent_r __P((struct netent *, struct netent_data *));
-int setnetent_r __P((int, struct netent_data *));
-#ifdef __hpux
-int endnetent_r __P((struct netent_data *buffer));
-#else
-void endnetent_r __P((struct netent_data *buffer));
-#endif
-
-int getprotobyname_r __P((const char *,
- struct protoent *, struct protoent_data *));
-int getprotobynumber_r __P((int,
- struct protoent *, struct protoent_data *));
-int getprotoent_r __P((struct protoent *, struct protoent_data *));
-int setprotoent_r __P((int, struct protoent_data *));
-#ifdef __hpux
-int endprotoent_r __P((struct protoent_data *));
-#else
-void endprotoent_r __P((struct protoent_data *));
-#endif
-
-int getservbyname_r __P((const char *, const char *,
- struct servent *, struct servent_data *));
-int getservbyport_r __P((int, const char *,
- struct servent *, struct servent_data *));
-int getservent_r __P((struct servent *, struct servent_data *));
-int setservent_r __P((int, struct servent_data *));
-#ifdef __hpux
-int endservent_r __P((struct servent_data *));
-#else
-void endservent_r __P((struct servent_data *));
-#endif
-#ifdef _AIX
-int setnetgrent_r __P((char *, void **));
-void endnetgrent_r __P((void **));
-/*
- * Note: AIX's netdb.h declares innetgr_r() as:
- * int innetgr_r(char *, char *, char *, char *, struct innetgr_data *);
- */
-int innetgr_r __P((const char *, const char *, const char *,
- const char *));
-#endif
-#else
- /* defined(sun) || defined(bsdi) */
-#if defined(__GLIBC__) || defined(__FreeBSD__) && (__FreeBSD_version + 0 >= 601103)
-int gethostbyaddr_r __P((const char *, int, int, struct hostent *,
- char *, size_t, struct hostent **, int *));
-int gethostbyname_r __P((const char *, struct hostent *,
- char *, size_t, struct hostent **, int *));
-int gethostent_r __P((struct hostent *, char *, size_t,
- struct hostent **, int *));
-#else
-struct hostent *gethostbyaddr_r __P((const char *, int, int, struct hostent *,
- char *, int, int *));
-struct hostent *gethostbyname_r __P((const char *, struct hostent *,
- char *, int, int *));
-struct hostent *gethostent_r __P((struct hostent *, char *, int, int *));
-#endif
-void sethostent_r __P((int));
-void endhostent_r __P((void));
-
-#if defined(__GLIBC__) || defined(__FreeBSD__) && (__FreeBSD_version + 0 >= 601103)
-int getnetbyname_r __P((const char *, struct netent *,
- char *, size_t, struct netent **, int*));
-int getnetbyaddr_r __P((unsigned long int, int, struct netent *,
- char *, size_t, struct netent **, int*));
-int getnetent_r __P((struct netent *, char *, size_t, struct netent **, int*));
-#else
-struct netent *getnetbyname_r __P((const char *, struct netent *,
- char *, int));
-struct netent *getnetbyaddr_r __P((long, int, struct netent *,
- char *, int));
-struct netent *getnetent_r __P((struct netent *, char *, int));
-#endif
-void setnetent_r __P((int));
-void endnetent_r __P((void));
-
-#if defined(__GLIBC__) || defined(__FreeBSD__) && (__FreeBSD_version + 0 >= 601103)
-int getprotobyname_r __P((const char *, struct protoent *, char *,
- size_t, struct protoent **));
-int getprotobynumber_r __P((int, struct protoent *, char *, size_t,
- struct protoent **));
-int getprotoent_r __P((struct protoent *, char *, size_t, struct protoent **));
-#else
-struct protoent *getprotobyname_r __P((const char *,
- struct protoent *, char *, int));
-struct protoent *getprotobynumber_r __P((int,
- struct protoent *, char *, int));
-struct protoent *getprotoent_r __P((struct protoent *, char *, int));
-#endif
-void setprotoent_r __P((int));
-void endprotoent_r __P((void));
-
-#if defined(__GLIBC__) || defined(__FreeBSD__) && (__FreeBSD_version + 0 >= 601103)
-int getservbyname_r __P((const char *name, const char *,
- struct servent *, char *, size_t, struct servent **));
-int getservbyport_r __P((int port, const char *,
- struct servent *, char *, size_t, struct servent **));
-int getservent_r __P((struct servent *, char *, size_t, struct servent **));
-#else
-struct servent *getservbyname_r __P((const char *name, const char *,
- struct servent *, char *, int));
-struct servent *getservbyport_r __P((int port, const char *,
- struct servent *, char *, int));
-struct servent *getservent_r __P((struct servent *, char *, int));
-#endif
-void setservent_r __P((int));
-void endservent_r __P((void));
-
-#ifdef __GLIBC__
-int getnetgrent_r __P((char **, char **, char **, char *, size_t));
-#endif
-
-#endif
-#endif
-__END_DECLS
-
-/* This is nec'y to make this include file properly replace the sun version. */
-#ifdef sun
-#ifdef __GNU_LIBRARY__
-#include <rpc/netdb.h>
-#else
-struct rpcent {
- char *r_name; /*%< name of server for this rpc program */
- char **r_aliases; /*%< alias list */
- int r_number; /*%< rpc program number */
-};
-struct rpcent *getrpcbyname(), *getrpcbynumber(), *getrpcent();
-#endif /* __GNU_LIBRARY__ */
-#endif /* sun */
-#endif /* !_NETDB_H_ */
-/*! \file */
diff --git a/lib/bind/include/netgroup.h b/lib/bind/include/netgroup.h
deleted file mode 100644
index e4be459fdf7c..000000000000
--- a/lib/bind/include/netgroup.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef netgroup_h
-#define netgroup_h
-#ifndef __GLIBC__
-
-/*
- * The standard is crazy. These values "belong" to getnetgrent() and
- * shouldn't be altered by the caller.
- */
-int getnetgrent __P((/* const */ char **, /* const */ char **,
- /* const */ char **));
-
-int getnetgrent_r __P((char **, char **, char **, char *, int));
-
-void endnetgrent __P((void));
-
-#ifdef __osf__
-int innetgr __P((char *, char *, char *, char *));
-void setnetgrent __P((char *));
-#else
-void setnetgrent __P((const char *));
-int innetgr __P((const char *, const char *, const char *, const char *));
-#endif
-#endif
-#endif
-
-/*! \file */
diff --git a/lib/bind/include/res_update.h b/lib/bind/include/res_update.h
deleted file mode 100644
index 2e6f171b7367..000000000000
--- a/lib/bind/include/res_update.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * Copyright (c) 1999 by Internet Software Consortium, Inc.
- *
- * 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 ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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: res_update.h,v 1.2.18.1 2005/04/27 05:00:49 sra Exp $
- */
-
-#ifndef __RES_UPDATE_H
-#define __RES_UPDATE_H
-
-/*! \file */
-
-#include <sys/types.h>
-#include <arpa/nameser.h>
-#include <isc/list.h>
-#include <resolv.h>
-
-/*%
- * This RR-like structure is particular to UPDATE.
- */
-struct ns_updrec {
- LINK(struct ns_updrec) r_link, r_glink;
- ns_sect r_section; /*%< ZONE/PREREQUISITE/UPDATE */
- char * r_dname; /*%< owner of the RR */
- ns_class r_class; /*%< class number */
- ns_type r_type; /*%< type number */
- u_int32_t r_ttl; /*%< time to live */
- u_char * r_data; /*%< rdata fields as text string */
- u_int r_size; /*%< size of r_data field */
- int r_opcode; /*%< type of operation */
- /* following fields for private use by the resolver/server routines */
- struct databuf *r_dp; /*%< databuf to process */
- struct databuf *r_deldp; /*%< databuf's deleted/overwritten */
- u_int r_zone; /*%< zone number on server */
-};
-typedef struct ns_updrec ns_updrec;
-typedef LIST(ns_updrec) ns_updque;
-
-#define res_mkupdate __res_mkupdate
-#define res_update __res_update
-#define res_mkupdrec __res_mkupdrec
-#define res_freeupdrec __res_freeupdrec
-#define res_nmkupdate __res_nmkupdate
-#define res_nupdate __res_nupdate
-
-int res_mkupdate __P((ns_updrec *, u_char *, int));
-int res_update __P((ns_updrec *));
-ns_updrec * res_mkupdrec __P((int, const char *, u_int, u_int, u_long));
-void res_freeupdrec __P((ns_updrec *));
-int res_nmkupdate __P((res_state, ns_updrec *, u_char *, int));
-int res_nupdate __P((res_state, ns_updrec *, ns_tsig_key *));
-
-#endif /*__RES_UPDATE_H*/
-
-/*! \file */
diff --git a/lib/bind/include/resolv.h b/lib/bind/include/resolv.h
deleted file mode 100644
index eebc62e05eb7..000000000000
--- a/lib/bind/include/resolv.h
+++ /dev/null
@@ -1,509 +0,0 @@
-/*
- * Copyright (c) 1983, 1987, 1989
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * Portions Copyright (c) 1996-1999 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-/*%
- * @(#)resolv.h 8.1 (Berkeley) 6/2/93
- * $Id: resolv.h,v 1.19.18.4 2008/04/03 23:15:15 marka Exp $
- */
-
-#ifndef _RESOLV_H_
-#define _RESOLV_H_
-
-#include <sys/param.h>
-#if (!defined(BSD)) || (BSD < 199306)
-# include <sys/bitypes.h>
-#else
-# include <sys/types.h>
-#endif
-#include <sys/cdefs.h>
-#include <sys/socket.h>
-#include <stdio.h>
-#include <arpa/nameser.h>
-
-/*%
- * Revision information. This is the release date in YYYYMMDD format.
- * It can change every day so the right thing to do with it is use it
- * in preprocessor commands such as "#if (__RES > 19931104)". Do not
- * compare for equality; rather, use it to determine whether your resolver
- * is new enough to contain a certain feature.
- */
-
-#define __RES 20030124
-
-/*%
- * This used to be defined in res_query.c, now it's in herror.c.
- * [XXX no it's not. It's in irs/irs_data.c]
- * It was
- * never extern'd by any *.h file before it was placed here. For thread
- * aware programs, the last h_errno value set is stored in res->h_errno.
- *
- * XXX: There doesn't seem to be a good reason for exposing RES_SET_H_ERRNO
- * (and __h_errno_set) to the public via <resolv.h>.
- * XXX: __h_errno_set is really part of IRS, not part of the resolver.
- * If somebody wants to build and use a resolver that doesn't use IRS,
- * what do they do? Perhaps something like
- * #ifdef WANT_IRS
- * # define RES_SET_H_ERRNO(r,x) __h_errno_set(r,x)
- * #else
- * # define RES_SET_H_ERRNO(r,x) (h_errno = (r)->res_h_errno = (x))
- * #endif
- */
-
-#define RES_SET_H_ERRNO(r,x) __h_errno_set(r,x)
-struct __res_state; /*%< forward */
-__BEGIN_DECLS
-void __h_errno_set(struct __res_state *res, int err);
-__END_DECLS
-
-/*%
- * Resolver configuration file.
- * Normally not present, but may contain the address of the
- * initial name server(s) to query and the domain search list.
- */
-
-#ifndef _PATH_RESCONF
-#define _PATH_RESCONF "/etc/resolv.conf"
-#endif
-
-typedef enum { res_goahead, res_nextns, res_modified, res_done, res_error }
- res_sendhookact;
-
-#ifndef __PMT
-#if defined(__STDC__) || defined(__cplusplus)
-#define __PMT(args) args
-#else
-#define __PMT(args) ()
-#endif
-#endif
-
-typedef res_sendhookact (*res_send_qhook)__PMT((struct sockaddr * const *,
- const u_char **, int *,
- u_char *, int, int *));
-
-typedef res_sendhookact (*res_send_rhook)__PMT((const struct sockaddr *,
- const u_char *, int, u_char *,
- int, int *));
-
-struct res_sym {
- int number; /*%< Identifying number, like T_MX */
- const char * name; /*%< Its symbolic name, like "MX" */
- const char * humanname; /*%< Its fun name, like "mail exchanger" */
-};
-
-/*%
- * Global defines and variables for resolver stub.
- */
-#define MAXNS 3 /*%< max # name servers we'll track */
-#define MAXDFLSRCH 3 /*%< # default domain levels to try */
-#define MAXDNSRCH 6 /*%< max # domains in search path */
-#define LOCALDOMAINPARTS 2 /*%< min levels in name that is "local" */
-#define RES_TIMEOUT 5 /*%< min. seconds between retries */
-#define MAXRESOLVSORT 10 /*%< number of net to sort on */
-#define RES_MAXNDOTS 15 /*%< should reflect bit field size */
-#define RES_MAXRETRANS 30 /*%< only for resolv.conf/RES_OPTIONS */
-#define RES_MAXRETRY 5 /*%< only for resolv.conf/RES_OPTIONS */
-#define RES_DFLRETRY 2 /*%< Default #/tries. */
-#define RES_MAXTIME 65535 /*%< Infinity, in milliseconds. */
-struct __res_state_ext;
-
-struct __res_state {
- int retrans; /*%< retransmission time interval */
- int retry; /*%< number of times to retransmit */
-#ifdef sun
- u_int options; /*%< option flags - see below. */
-#else
- u_long options; /*%< option flags - see below. */
-#endif
- int nscount; /*%< number of name servers */
- struct sockaddr_in
- nsaddr_list[MAXNS]; /*%< address of name server */
-#define nsaddr nsaddr_list[0] /*%< for backward compatibility */
- u_short id; /*%< current message id */
- char *dnsrch[MAXDNSRCH+1]; /*%< components of domain to search */
- char defdname[256]; /*%< default domain (deprecated) */
-#ifdef sun
- u_int pfcode; /*%< RES_PRF_ flags - see below. */
-#else
- u_long pfcode; /*%< RES_PRF_ flags - see below. */
-#endif
- unsigned ndots:4; /*%< threshold for initial abs. query */
- unsigned nsort:4; /*%< number of elements in sort_list[] */
- char unused[3];
- struct {
- struct in_addr addr;
- u_int32_t mask;
- } sort_list[MAXRESOLVSORT];
- res_send_qhook qhook; /*%< query hook */
- res_send_rhook rhook; /*%< response hook */
- int res_h_errno; /*%< last one set for this context */
- int _vcsock; /*%< PRIVATE: for res_send VC i/o */
- u_int _flags; /*%< PRIVATE: see below */
- u_int _pad; /*%< make _u 64 bit aligned */
- union {
- /* On an 32-bit arch this means 512b total. */
- char pad[72 - 4*sizeof (int) - 2*sizeof (void *)];
- struct {
- u_int16_t nscount;
- u_int16_t nstimes[MAXNS]; /*%< ms. */
- int nssocks[MAXNS];
- struct __res_state_ext *ext; /*%< extention for IPv6 */
- } _ext;
- } _u;
-};
-
-typedef struct __res_state *res_state;
-
-union res_sockaddr_union {
- struct sockaddr_in sin;
-#ifdef IN6ADDR_ANY_INIT
- struct sockaddr_in6 sin6;
-#endif
-#ifdef ISC_ALIGN64
- int64_t __align64; /*%< 64bit alignment */
-#else
- int32_t __align32; /*%< 32bit alignment */
-#endif
- char __space[128]; /*%< max size */
-};
-
-/*%
- * Resolver flags (used to be discrete per-module statics ints).
- */
-#define RES_F_VC 0x00000001 /*%< socket is TCP */
-#define RES_F_CONN 0x00000002 /*%< socket is connected */
-#define RES_F_EDNS0ERR 0x00000004 /*%< EDNS0 caused errors */
-#define RES_F__UNUSED 0x00000008 /*%< (unused) */
-#define RES_F_LASTMASK 0x000000F0 /*%< ordinal server of last res_nsend */
-#define RES_F_LASTSHIFT 4 /*%< bit position of LASTMASK "flag" */
-#define RES_GETLAST(res) (((res)._flags & RES_F_LASTMASK) >> RES_F_LASTSHIFT)
-
-/* res_findzonecut2() options */
-#define RES_EXHAUSTIVE 0x00000001 /*%< always do all queries */
-#define RES_IPV4ONLY 0x00000002 /*%< IPv4 only */
-#define RES_IPV6ONLY 0x00000004 /*%< IPv6 only */
-
-/*%
- * Resolver options (keep these in synch with res_debug.c, please)
- */
-#define RES_INIT 0x00000001 /*%< address initialized */
-#define RES_DEBUG 0x00000002 /*%< print debug messages */
-#define RES_AAONLY 0x00000004 /*%< authoritative answers only (!IMPL)*/
-#define RES_USEVC 0x00000008 /*%< use virtual circuit */
-#define RES_PRIMARY 0x00000010 /*%< query primary server only (!IMPL) */
-#define RES_IGNTC 0x00000020 /*%< ignore trucation errors */
-#define RES_RECURSE 0x00000040 /*%< recursion desired */
-#define RES_DEFNAMES 0x00000080 /*%< use default domain name */
-#define RES_STAYOPEN 0x00000100 /*%< Keep TCP socket open */
-#define RES_DNSRCH 0x00000200 /*%< search up local domain tree */
-#define RES_INSECURE1 0x00000400 /*%< type 1 security disabled */
-#define RES_INSECURE2 0x00000800 /*%< type 2 security disabled */
-#define RES_NOALIASES 0x00001000 /*%< shuts off HOSTALIASES feature */
-#define RES_USE_INET6 0x00002000 /*%< use/map IPv6 in gethostbyname() */
-#define RES_ROTATE 0x00004000 /*%< rotate ns list after each query */
-#define RES_NOCHECKNAME 0x00008000 /*%< do not check names for sanity. */
-#define RES_KEEPTSIG 0x00010000 /*%< do not strip TSIG records */
-#define RES_BLAST 0x00020000 /*%< blast all recursive servers */
-#define RES_NSID 0x00040000 /*%< request name server ID */
-#define RES_NOTLDQUERY 0x00100000 /*%< don't unqualified name as a tld */
-#define RES_USE_DNSSEC 0x00200000 /*%< use DNSSEC using OK bit in OPT */
-/* #define RES_DEBUG2 0x00400000 */ /* nslookup internal */
-/* KAME extensions: use higher bit to avoid conflict with ISC use */
-#define RES_USE_DNAME 0x10000000 /*%< use DNAME */
-#define RES_USE_EDNS0 0x40000000 /*%< use EDNS0 if configured */
-#define RES_NO_NIBBLE2 0x80000000 /*%< disable alternate nibble lookup */
-
-#define RES_DEFAULT (RES_RECURSE | RES_DEFNAMES | \
- RES_DNSRCH | RES_NO_NIBBLE2)
-
-/*%
- * Resolver "pfcode" values. Used by dig.
- */
-#define RES_PRF_STATS 0x00000001
-#define RES_PRF_UPDATE 0x00000002
-#define RES_PRF_CLASS 0x00000004
-#define RES_PRF_CMD 0x00000008
-#define RES_PRF_QUES 0x00000010
-#define RES_PRF_ANS 0x00000020
-#define RES_PRF_AUTH 0x00000040
-#define RES_PRF_ADD 0x00000080
-#define RES_PRF_HEAD1 0x00000100
-#define RES_PRF_HEAD2 0x00000200
-#define RES_PRF_TTLID 0x00000400
-#define RES_PRF_HEADX 0x00000800
-#define RES_PRF_QUERY 0x00001000
-#define RES_PRF_REPLY 0x00002000
-#define RES_PRF_INIT 0x00004000
-#define RES_PRF_TRUNC 0x00008000
-/* 0x00010000 */
-
-/* Things involving an internal (static) resolver context. */
-#ifdef _REENTRANT
-__BEGIN_DECLS
-extern struct __res_state *__res_state(void);
-__END_DECLS
-#define _res (*__res_state())
-#else
-#ifdef __linux
-__BEGIN_DECLS
-extern struct __res_state * __res_state(void);
-__END_DECLS
-#endif
-#ifndef __BIND_NOSTATIC
-extern struct __res_state _res;
-#endif
-#endif
-
-#ifndef __BIND_NOSTATIC
-#define fp_nquery __fp_nquery
-#define fp_query __fp_query
-#define hostalias __hostalias
-#define p_query __p_query
-#define res_close __res_close
-#define res_init __res_init
-#define res_isourserver __res_isourserver
-#define res_mkquery __res_mkquery
-#define res_query __res_query
-#define res_querydomain __res_querydomain
-#define res_search __res_search
-#define res_send __res_send
-#define res_sendsigned __res_sendsigned
-
-__BEGIN_DECLS
-void fp_nquery __P((const u_char *, int, FILE *));
-void fp_query __P((const u_char *, FILE *));
-const char * hostalias __P((const char *));
-void p_query __P((const u_char *));
-void res_close __P((void));
-int res_init __P((void));
-int res_isourserver __P((const struct sockaddr_in *));
-int res_mkquery __P((int, const char *, int, int, const u_char *,
- int, const u_char *, u_char *, int));
-int res_query __P((const char *, int, int, u_char *, int));
-int res_querydomain __P((const char *, const char *, int, int,
- u_char *, int));
-int res_search __P((const char *, int, int, u_char *, int));
-int res_send __P((const u_char *, int, u_char *, int));
-int res_sendsigned __P((const u_char *, int, ns_tsig_key *,
- u_char *, int));
-__END_DECLS
-#endif
-
-#if !defined(SHARED_LIBBIND) || defined(LIB)
-/*
- * If libbind is a shared object (well, DLL anyway)
- * these externs break the linker when resolv.h is
- * included by a lib client (like named)
- * Make them go away if a client is including this
- *
- */
-extern const struct res_sym __p_key_syms[];
-extern const struct res_sym __p_cert_syms[];
-extern const struct res_sym __p_class_syms[];
-extern const struct res_sym __p_type_syms[];
-extern const struct res_sym __p_rcode_syms[];
-#endif /* SHARED_LIBBIND */
-
-#define b64_ntop __b64_ntop
-#define b64_pton __b64_pton
-#define dn_comp __dn_comp
-#define dn_count_labels __dn_count_labels
-#define dn_expand __dn_expand
-#define dn_skipname __dn_skipname
-#define fp_resstat __fp_resstat
-#define loc_aton __loc_aton
-#define loc_ntoa __loc_ntoa
-#define p_cdname __p_cdname
-#define p_cdnname __p_cdnname
-#define p_class __p_class
-#define p_fqname __p_fqname
-#define p_fqnname __p_fqnname
-#define p_option __p_option
-#define p_secstodate __p_secstodate
-#define p_section __p_section
-#define p_time __p_time
-#define p_type __p_type
-#define p_rcode __p_rcode
-#define p_sockun __p_sockun
-#define putlong __putlong
-#define putshort __putshort
-#define res_dnok __res_dnok
-#define res_findzonecut __res_findzonecut
-#define res_findzonecut2 __res_findzonecut2
-#define res_hnok __res_hnok
-#define res_hostalias __res_hostalias
-#define res_mailok __res_mailok
-#define res_nameinquery __res_nameinquery
-#define res_nclose __res_nclose
-#define res_ninit __res_ninit
-#define res_nmkquery __res_nmkquery
-#define res_pquery __res_pquery
-#define res_nquery __res_nquery
-#define res_nquerydomain __res_nquerydomain
-#define res_nsearch __res_nsearch
-#define res_nsend __res_nsend
-#define res_nsendsigned __res_nsendsigned
-#define res_nisourserver __res_nisourserver
-#define res_ownok __res_ownok
-#define res_queriesmatch __res_queriesmatch
-#define res_randomid __res_randomid
-#define sym_ntop __sym_ntop
-#define sym_ntos __sym_ntos
-#define sym_ston __sym_ston
-#define res_nopt __res_nopt
-#define res_nopt_rdata __res_nopt_rdata
-#define res_ndestroy __res_ndestroy
-#define res_nametoclass __res_nametoclass
-#define res_nametotype __res_nametotype
-#define res_setservers __res_setservers
-#define res_getservers __res_getservers
-#define res_buildprotolist __res_buildprotolist
-#define res_destroyprotolist __res_destroyprotolist
-#define res_destroyservicelist __res_destroyservicelist
-#define res_get_nibblesuffix __res_get_nibblesuffix
-#define res_get_nibblesuffix2 __res_get_nibblesuffix2
-#define res_ourserver_p __res_ourserver_p
-#define res_protocolname __res_protocolname
-#define res_protocolnumber __res_protocolnumber
-#define res_send_setqhook __res_send_setqhook
-#define res_send_setrhook __res_send_setrhook
-#define res_servicename __res_servicename
-#define res_servicenumber __res_servicenumber
-__BEGIN_DECLS
-int res_hnok __P((const char *));
-int res_ownok __P((const char *));
-int res_mailok __P((const char *));
-int res_dnok __P((const char *));
-int sym_ston __P((const struct res_sym *, const char *, int *));
-const char * sym_ntos __P((const struct res_sym *, int, int *));
-const char * sym_ntop __P((const struct res_sym *, int, int *));
-int b64_ntop __P((u_char const *, size_t, char *, size_t));
-int b64_pton __P((char const *, u_char *, size_t));
-int loc_aton __P((const char *, u_char *));
-const char * loc_ntoa __P((const u_char *, char *));
-int dn_skipname __P((const u_char *, const u_char *));
-void putlong __P((u_int32_t, u_char *));
-void putshort __P((u_int16_t, u_char *));
-#ifndef __ultrix__
-u_int16_t _getshort __P((const u_char *));
-u_int32_t _getlong __P((const u_char *));
-#endif
-const char * p_class __P((int));
-const char * p_time __P((u_int32_t));
-const char * p_type __P((int));
-const char * p_rcode __P((int));
-const char * p_sockun __P((union res_sockaddr_union, char *, size_t));
-const u_char * p_cdnname __P((const u_char *, const u_char *, int, FILE *));
-const u_char * p_cdname __P((const u_char *, const u_char *, FILE *));
-const u_char * p_fqnname __P((const u_char *, const u_char *,
- int, char *, int));
-const u_char * p_fqname __P((const u_char *, const u_char *, FILE *));
-const char * p_option __P((u_long));
-char * p_secstodate __P((u_long));
-int dn_count_labels __P((const char *));
-int dn_comp __P((const char *, u_char *, int,
- u_char **, u_char **));
-int dn_expand __P((const u_char *, const u_char *, const u_char *,
- char *, int));
-u_int res_randomid __P((void));
-int res_nameinquery __P((const char *, int, int, const u_char *,
- const u_char *));
-int res_queriesmatch __P((const u_char *, const u_char *,
- const u_char *, const u_char *));
-const char * p_section __P((int, int));
-/* Things involving a resolver context. */
-int res_ninit __P((res_state));
-int res_nisourserver __P((const res_state,
- const struct sockaddr_in *));
-void fp_resstat __P((const res_state, FILE *));
-void res_pquery __P((const res_state, const u_char *, int, FILE *));
-const char * res_hostalias __P((const res_state, const char *,
- char *, size_t));
-int res_nquery __P((res_state, const char *, int, int,
- u_char *, int));
-int res_nsearch __P((res_state, const char *, int, int, u_char *,
- int));
-int res_nquerydomain __P((res_state, const char *, const char *,
- int, int, u_char *, int));
-int res_nmkquery __P((res_state, int, const char *, int, int,
- const u_char *, int, const u_char *,
- u_char *, int));
-int res_nsend __P((res_state, const u_char *, int, u_char *, int));
-int res_nsendsigned __P((res_state, const u_char *, int,
- ns_tsig_key *, u_char *, int));
-int res_findzonecut __P((res_state, const char *, ns_class, int,
- char *, size_t, struct in_addr *, int));
-int res_findzonecut2 __P((res_state, const char *, ns_class, int,
- char *, size_t,
- union res_sockaddr_union *, int));
-void res_nclose __P((res_state));
-int res_nopt __P((res_state, int, u_char *, int, int));
-int res_nopt_rdata __P((res_state, int, u_char *, int, u_char *,
- u_short, u_short, u_char *));
-void res_send_setqhook __P((res_send_qhook));
-void res_send_setrhook __P((res_send_rhook));
-int __res_vinit __P((res_state, int));
-void res_destroyservicelist __P((void));
-const char * res_servicename __P((u_int16_t, const char *));
-const char * res_protocolname __P((int));
-void res_destroyprotolist __P((void));
-void res_buildprotolist __P((void));
-const char * res_get_nibblesuffix __P((res_state));
-const char * res_get_nibblesuffix2 __P((res_state));
-void res_ndestroy __P((res_state));
-u_int16_t res_nametoclass __P((const char *, int *));
-u_int16_t res_nametotype __P((const char *, int *));
-void res_setservers __P((res_state,
- const union res_sockaddr_union *, int));
-int res_getservers __P((res_state,
- union res_sockaddr_union *, int));
-__END_DECLS
-
-#endif /* !_RESOLV_H_ */
-/*! \file */
diff --git a/lib/bind/include/resolv_mt.h b/lib/bind/include/resolv_mt.h
deleted file mode 100644
index 27963a12077a..000000000000
--- a/lib/bind/include/resolv_mt.h
+++ /dev/null
@@ -1,47 +0,0 @@
-#ifndef _RESOLV_MT_H
-#define _RESOLV_MT_H
-
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <resolv.h>
-
-/* Access functions for the libresolv private interface */
-
-int __res_enable_mt(void);
-int __res_disable_mt(void);
-
-/* Per-thread context */
-
-typedef struct {
-int no_hosts_fallback_private;
-int retry_save;
-int retry_private;
-char inet_nsap_ntoa_tmpbuf[255*3];
-char sym_ntos_unname[20];
-char sym_ntop_unname[20];
-char p_option_nbuf[40];
-char p_time_nbuf[40];
-char precsize_ntoa_retbuf[sizeof "90000000.00"];
-char loc_ntoa_tmpbuf[sizeof
-"1000 60 60.000 N 1000 60 60.000 W -12345678.00m 90000000.00m 90000000.00m 90000000.00m"];
-char p_secstodate_output[15];
-} mtctxres_t;
-
-/* Thread-specific data (TSD) */
-
-mtctxres_t *___mtctxres(void);
-#define mtctxres (___mtctxres())
-
-/* Various static data that should be TSD */
-
-#define sym_ntos_unname (mtctxres->sym_ntos_unname)
-#define sym_ntop_unname (mtctxres->sym_ntop_unname)
-#define inet_nsap_ntoa_tmpbuf (mtctxres->inet_nsap_ntoa_tmpbuf)
-#define p_option_nbuf (mtctxres->p_option_nbuf)
-#define p_time_nbuf (mtctxres->p_time_nbuf)
-#define precsize_ntoa_retbuf (mtctxres->precsize_ntoa_retbuf)
-#define loc_ntoa_tmpbuf (mtctxres->loc_ntoa_tmpbuf)
-#define p_secstodate_output (mtctxres->p_secstodate_output)
-
-#endif /* _RESOLV_MT_H */
diff --git a/lib/bind/inet/Makefile.in b/lib/bind/inet/Makefile.in
deleted file mode 100644
index 7b848966841b..000000000000
--- a/lib/bind/inet/Makefile.in
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2004, 2008 Internet Systems Consortium, Inc. ("ISC")
-# Copyright (C) 2001 Internet Software Consortium.
-#
-# Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS. IN NO EVENT SHALL ISC 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.in,v 1.5.18.2 2008/03/20 23:46:01 tbox Exp $
-
-srcdir= @srcdir@
-VPATH = @srcdir@
-
-OBJS= inet_addr.@O@ inet_cidr_ntop.@O@ inet_cidr_pton.@O@ inet_data.@O@ \
- inet_lnaof.@O@ inet_makeaddr.@O@ inet_net_ntop.@O@ inet_net_pton.@O@ \
- inet_neta.@O@ inet_netof.@O@ inet_network.@O@ inet_ntoa.@O@ \
- inet_ntop.@O@ inet_pton.@O@ nsap_addr.@O@
-
-SRCS= inet_addr.c inet_cidr_ntop.c inet_cidr_pton.c inet_data.c \
- inet_lnaof.c inet_makeaddr.c inet_net_ntop.c inet_net_pton.c \
- inet_neta.c inet_netof.c inet_network.c inet_ntoa.c \
- inet_ntop.c inet_pton.c nsap_addr.c
-
-TARGETS= ${OBJS}
-
-CINCLUDES= -I.. -I../include -I${srcdir}/../include
-
-@BIND9_MAKE_RULES@
diff --git a/lib/bind/inet/inet_addr.c b/lib/bind/inet/inet_addr.c
deleted file mode 100644
index c95622d34c8c..000000000000
--- a/lib/bind/inet/inet_addr.c
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * Copyright (c) 1983, 1990, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * Portions Copyright (c) 1996-1999 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char sccsid[] = "@(#)inet_addr.c 8.1 (Berkeley) 6/17/93";
-static const char rcsid[] = "$Id: inet_addr.c,v 1.4.18.1 2005/04/27 05:00:52 sra Exp $";
-#endif /* LIBC_SCCS and not lint */
-
-#include "port_before.h"
-
-#include <sys/types.h>
-#include <sys/param.h>
-
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include <ctype.h>
-
-#include "port_after.h"
-
-/*%
- * Ascii internet address interpretation routine.
- * The value returned is in network order.
- */
-u_long
-inet_addr(const char *cp) {
- struct in_addr val;
-
- if (inet_aton(cp, &val))
- return (val.s_addr);
- return (INADDR_NONE);
-}
-
-/*%
- * Check whether "cp" is a valid ascii representation
- * of an Internet address and convert to a binary address.
- * Returns 1 if the address is valid, 0 if not.
- * This replaces inet_addr, the return value from which
- * cannot distinguish between failure and a local broadcast address.
- */
-int
-inet_aton(const char *cp, struct in_addr *addr) {
- u_long val;
- int base, n;
- char c;
- u_int8_t parts[4];
- u_int8_t *pp = parts;
- int digit;
-
- c = *cp;
- for (;;) {
- /*
- * Collect number up to ``.''.
- * Values are specified as for C:
- * 0x=hex, 0=octal, isdigit=decimal.
- */
- if (!isdigit((unsigned char)c))
- return (0);
- val = 0; base = 10; digit = 0;
- if (c == '0') {
- c = *++cp;
- if (c == 'x' || c == 'X')
- base = 16, c = *++cp;
- else {
- base = 8;
- digit = 1 ;
- }
- }
- for (;;) {
- if (isascii(c) && isdigit((unsigned char)c)) {
- if (base == 8 && (c == '8' || c == '9'))
- return (0);
- val = (val * base) + (c - '0');
- c = *++cp;
- digit = 1;
- } else if (base == 16 && isascii(c) &&
- isxdigit((unsigned char)c)) {
- val = (val << 4) |
- (c + 10 - (islower((unsigned char)c) ? 'a' : 'A'));
- c = *++cp;
- digit = 1;
- } else
- break;
- }
- if (c == '.') {
- /*
- * Internet format:
- * a.b.c.d
- * a.b.c (with c treated as 16 bits)
- * a.b (with b treated as 24 bits)
- */
- if (pp >= parts + 3 || val > 0xffU)
- return (0);
- *pp++ = val;
- c = *++cp;
- } else
- break;
- }
- /*
- * Check for trailing characters.
- */
- if (c != '\0' && (!isascii(c) || !isspace((unsigned char)c)))
- return (0);
- /*
- * Did we get a valid digit?
- */
- if (!digit)
- return (0);
- /*
- * Concoct the address according to
- * the number of parts specified.
- */
- n = pp - parts + 1;
- switch (n) {
- case 1: /*%< a -- 32 bits */
- break;
-
- case 2: /*%< a.b -- 8.24 bits */
- if (val > 0xffffffU)
- return (0);
- val |= parts[0] << 24;
- break;
-
- case 3: /*%< a.b.c -- 8.8.16 bits */
- if (val > 0xffffU)
- return (0);
- val |= (parts[0] << 24) | (parts[1] << 16);
- break;
-
- case 4: /*%< a.b.c.d -- 8.8.8.8 bits */
- if (val > 0xffU)
- return (0);
- val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8);
- break;
- }
- if (addr != NULL)
- addr->s_addr = htonl(val);
- return (1);
-}
-
-/*! \file */
diff --git a/lib/bind/inet/inet_cidr_ntop.c b/lib/bind/inet/inet_cidr_ntop.c
deleted file mode 100644
index 645b3cd500ed..000000000000
--- a/lib/bind/inet/inet_cidr_ntop.c
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * Copyright (c) 1998,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 ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: inet_cidr_ntop.c,v 1.4.18.3 2006/10/11 02:32:47 marka Exp $";
-#endif
-
-#include "port_before.h"
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <arpa/inet.h>
-
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include "port_after.h"
-
-#ifdef SPRINTF_CHAR
-# define SPRINTF(x) strlen(sprintf/**/x)
-#else
-# define SPRINTF(x) ((size_t)sprintf x)
-#endif
-
-static char *
-inet_cidr_ntop_ipv4(const u_char *src, int bits, char *dst, size_t size);
-static char *
-inet_cidr_ntop_ipv6(const u_char *src, int bits, char *dst, size_t size);
-
-/*%
- * char *
- * inet_cidr_ntop(af, src, bits, dst, size)
- * convert network address from network to presentation format.
- * "src"'s size is determined from its "af".
- * return:
- * pointer to dst, or NULL if an error occurred (check errno).
- * note:
- * 192.5.5.1/28 has a nonzero host part, which means it isn't a network
- * as called for by inet_net_ntop() but it can be a host address with
- * an included netmask.
- * author:
- * Paul Vixie (ISC), October 1998
- */
-char *
-inet_cidr_ntop(int af, const void *src, int bits, char *dst, size_t size) {
- switch (af) {
- case AF_INET:
- return (inet_cidr_ntop_ipv4(src, bits, dst, size));
- case AF_INET6:
- return (inet_cidr_ntop_ipv6(src, bits, dst, size));
- default:
- errno = EAFNOSUPPORT;
- return (NULL);
- }
-}
-
-static int
-decoct(const u_char *src, int bytes, char *dst, size_t size) {
- char *odst = dst;
- char *t;
- int b;
-
- for (b = 1; b <= bytes; b++) {
- if (size < sizeof "255.")
- return (0);
- t = dst;
- dst += SPRINTF((dst, "%u", *src++));
- if (b != bytes) {
- *dst++ = '.';
- *dst = '\0';
- }
- size -= (size_t)(dst - t);
- }
- return (dst - odst);
-}
-
-/*%
- * static char *
- * inet_cidr_ntop_ipv4(src, bits, dst, size)
- * convert IPv4 network address from network to presentation format.
- * "src"'s size is determined from its "af".
- * return:
- * pointer to dst, or NULL if an error occurred (check errno).
- * note:
- * network byte order assumed. this means 192.5.5.240/28 has
- * 0b11110000 in its fourth octet.
- * author:
- * Paul Vixie (ISC), October 1998
- */
-static char *
-inet_cidr_ntop_ipv4(const u_char *src, int bits, char *dst, size_t size) {
- char *odst = dst;
- size_t len = 4;
- size_t b;
- size_t bytes;
-
- if ((bits < -1) || (bits > 32)) {
- errno = EINVAL;
- return (NULL);
- }
-
- /* Find number of significant bytes in address. */
- if (bits == -1)
- len = 4;
- else
- for (len = 1, b = 1 ; b < 4U; b++)
- if (*(src + b))
- len = b + 1;
-
- /* Format whole octets plus nonzero trailing octets. */
- bytes = (((bits <= 0) ? 1 : bits) + 7) / 8;
- if (len > bytes)
- bytes = len;
- b = decoct(src, bytes, dst, size);
- if (b == 0U)
- goto emsgsize;
- dst += b;
- size -= b;
-
- if (bits != -1) {
- /* Format CIDR /width. */
- if (size < sizeof "/32")
- goto emsgsize;
- dst += SPRINTF((dst, "/%u", bits));
- }
-
- return (odst);
-
- emsgsize:
- errno = EMSGSIZE;
- return (NULL);
-}
-
-static char *
-inet_cidr_ntop_ipv6(const u_char *src, int bits, char *dst, size_t size) {
- /*
- * Note that int32_t and int16_t need only be "at least" large enough
- * to contain a value of the specified size. On some systems, like
- * Crays, there is no such thing as an integer variable with 16 bits.
- * Keep this in mind if you think this function should have been coded
- * to use pointer overlays. All the world's not a VAX.
- */
- char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255/128"];
- char *tp;
- struct { int base, len; } best, cur;
- u_int words[NS_IN6ADDRSZ / NS_INT16SZ];
- int i;
-
- if ((bits < -1) || (bits > 128)) {
- errno = EINVAL;
- return (NULL);
- }
-
- /*
- * Preprocess:
- * Copy the input (bytewise) array into a wordwise array.
- * Find the longest run of 0x00's in src[] for :: shorthanding.
- */
- memset(words, '\0', sizeof words);
- for (i = 0; i < NS_IN6ADDRSZ; i++)
- words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3));
- best.base = -1;
- best.len = 0;
- cur.base = -1;
- cur.len = 0;
- for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
- if (words[i] == 0) {
- if (cur.base == -1)
- cur.base = i, cur.len = 1;
- else
- cur.len++;
- } else {
- if (cur.base != -1) {
- if (best.base == -1 || cur.len > best.len)
- best = cur;
- cur.base = -1;
- }
- }
- }
- if (cur.base != -1) {
- if (best.base == -1 || cur.len > best.len)
- best = cur;
- }
- if (best.base != -1 && best.len < 2)
- best.base = -1;
-
- /*
- * Format the result.
- */
- tp = tmp;
- for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
- /* Are we inside the best run of 0x00's? */
- if (best.base != -1 && i >= best.base &&
- i < (best.base + best.len)) {
- if (i == best.base)
- *tp++ = ':';
- continue;
- }
- /* Are we following an initial run of 0x00s or any real hex? */
- if (i != 0)
- *tp++ = ':';
- /* Is this address an encapsulated IPv4? */
- if (i == 6 && best.base == 0 && (best.len == 6 ||
- (best.len == 7 && words[7] != 0x0001) ||
- (best.len == 5 && words[5] == 0xffff))) {
- int n;
-
- if (src[15] || bits == -1 || bits > 120)
- n = 4;
- else if (src[14] || bits > 112)
- n = 3;
- else
- n = 2;
- n = decoct(src+12, n, tp, sizeof tmp - (tp - tmp));
- if (n == 0) {
- errno = EMSGSIZE;
- return (NULL);
- }
- tp += strlen(tp);
- break;
- }
- tp += SPRINTF((tp, "%x", words[i]));
- }
-
- /* Was it a trailing run of 0x00's? */
- if (best.base != -1 && (best.base + best.len) ==
- (NS_IN6ADDRSZ / NS_INT16SZ))
- *tp++ = ':';
- *tp = '\0';
-
- if (bits != -1)
- tp += SPRINTF((tp, "/%u", bits));
-
- /*
- * Check for overflow, copy, and we're done.
- */
- if ((size_t)(tp - tmp) > size) {
- errno = EMSGSIZE;
- return (NULL);
- }
- strcpy(dst, tmp);
- return (dst);
-}
-
-/*! \file */
diff --git a/lib/bind/inet/inet_cidr_pton.c b/lib/bind/inet/inet_cidr_pton.c
deleted file mode 100644
index b55e3ea95679..000000000000
--- a/lib/bind/inet/inet_cidr_pton.c
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * Copyright (c) 1998,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 ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: inet_cidr_pton.c,v 1.5.18.1 2005/04/27 05:00:53 sra Exp $";
-#endif
-
-#include "port_before.h"
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <arpa/inet.h>
-
-#include <isc/assertions.h>
-#include <ctype.h>
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include "port_after.h"
-
-#ifdef SPRINTF_CHAR
-# define SPRINTF(x) strlen(sprintf/**/x)
-#else
-# define SPRINTF(x) ((size_t)sprintf x)
-#endif
-
-static int inet_cidr_pton_ipv4 __P((const char *src, u_char *dst,
- int *bits, int ipv6));
-static int inet_cidr_pton_ipv6 __P((const char *src, u_char *dst,
- int *bits));
-
-static int getbits(const char *, int ipv6);
-
-/*%
- * int
- * inet_cidr_pton(af, src, dst, *bits)
- * convert network address from presentation to network format.
- * accepts inet_pton()'s input for this "af" plus trailing "/CIDR".
- * "dst" is assumed large enough for its "af". "bits" is set to the
- * /CIDR prefix length, which can have defaults (like /32 for IPv4).
- * return:
- * -1 if an error occurred (inspect errno; ENOENT means bad format).
- * 0 if successful conversion occurred.
- * note:
- * 192.5.5.1/28 has a nonzero host part, which means it isn't a network
- * as called for by inet_net_pton() but it can be a host address with
- * an included netmask.
- * author:
- * Paul Vixie (ISC), October 1998
- */
-int
-inet_cidr_pton(int af, const char *src, void *dst, int *bits) {
- switch (af) {
- case AF_INET:
- return (inet_cidr_pton_ipv4(src, dst, bits, 0));
- case AF_INET6:
- return (inet_cidr_pton_ipv6(src, dst, bits));
- default:
- errno = EAFNOSUPPORT;
- return (-1);
- }
-}
-
-static const char digits[] = "0123456789";
-
-static int
-inet_cidr_pton_ipv4(const char *src, u_char *dst, int *pbits, int ipv6) {
- const u_char *odst = dst;
- int n, ch, tmp, bits;
- size_t size = 4;
-
- /* Get the mantissa. */
- while (ch = *src++, (isascii(ch) && isdigit(ch))) {
- tmp = 0;
- do {
- n = strchr(digits, ch) - digits;
- INSIST(n >= 0 && n <= 9);
- tmp *= 10;
- tmp += n;
- if (tmp > 255)
- goto enoent;
- } while ((ch = *src++) != '\0' && isascii(ch) && isdigit(ch));
- if (size-- == 0U)
- goto emsgsize;
- *dst++ = (u_char) tmp;
- if (ch == '\0' || ch == '/')
- break;
- if (ch != '.')
- goto enoent;
- }
-
- /* Get the prefix length if any. */
- bits = -1;
- if (ch == '/' && dst > odst) {
- bits = getbits(src, ipv6);
- if (bits == -2)
- goto enoent;
- } else if (ch != '\0')
- goto enoent;
-
- /* Prefix length can default to /32 only if all four octets spec'd. */
- if (bits == -1) {
- if (dst - odst == 4)
- bits = ipv6 ? 128 : 32;
- else
- goto enoent;
- }
-
- /* If nothing was written to the destination, we found no address. */
- if (dst == odst)
- goto enoent;
-
- /* If prefix length overspecifies mantissa, life is bad. */
- if (((bits - (ipv6 ? 96 : 0)) / 8) > (dst - odst))
- goto enoent;
-
- /* Extend address to four octets. */
- while (size-- > 0U)
- *dst++ = 0;
-
- *pbits = bits;
- return (0);
-
- enoent:
- errno = ENOENT;
- return (-1);
-
- emsgsize:
- errno = EMSGSIZE;
- return (-1);
-}
-
-static int
-inet_cidr_pton_ipv6(const char *src, u_char *dst, int *pbits) {
- static const char xdigits_l[] = "0123456789abcdef",
- xdigits_u[] = "0123456789ABCDEF";
- u_char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp;
- const char *xdigits, *curtok;
- int ch, saw_xdigit;
- u_int val;
- int bits;
-
- memset((tp = tmp), '\0', NS_IN6ADDRSZ);
- endp = tp + NS_IN6ADDRSZ;
- colonp = NULL;
- /* Leading :: requires some special handling. */
- if (*src == ':')
- if (*++src != ':')
- return (0);
- curtok = src;
- saw_xdigit = 0;
- val = 0;
- bits = -1;
- while ((ch = *src++) != '\0') {
- const char *pch;
-
- if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL)
- pch = strchr((xdigits = xdigits_u), ch);
- if (pch != NULL) {
- val <<= 4;
- val |= (pch - xdigits);
- if (val > 0xffff)
- return (0);
- saw_xdigit = 1;
- continue;
- }
- if (ch == ':') {
- curtok = src;
- if (!saw_xdigit) {
- if (colonp)
- return (0);
- colonp = tp;
- continue;
- } else if (*src == '\0') {
- return (0);
- }
- if (tp + NS_INT16SZ > endp)
- return (0);
- *tp++ = (u_char) (val >> 8) & 0xff;
- *tp++ = (u_char) val & 0xff;
- saw_xdigit = 0;
- val = 0;
- continue;
- }
- if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) &&
- inet_cidr_pton_ipv4(curtok, tp, &bits, 1) == 0) {
- tp += NS_INADDRSZ;
- saw_xdigit = 0;
- break; /*%< '\\0' was seen by inet_pton4(). */
- }
- if (ch == '/') {
- bits = getbits(src, 1);
- if (bits == -2)
- goto enoent;
- break;
- }
- goto enoent;
- }
- if (saw_xdigit) {
- if (tp + NS_INT16SZ > endp)
- goto emsgsize;
- *tp++ = (u_char) (val >> 8) & 0xff;
- *tp++ = (u_char) val & 0xff;
- }
- if (colonp != NULL) {
- /*
- * Since some memmove()'s erroneously fail to handle
- * overlapping regions, we'll do the shift by hand.
- */
- const int n = tp - colonp;
- int i;
-
- if (tp == endp)
- goto enoent;
- for (i = 1; i <= n; i++) {
- endp[- i] = colonp[n - i];
- colonp[n - i] = 0;
- }
- tp = endp;
- }
-
- memcpy(dst, tmp, NS_IN6ADDRSZ);
-
- *pbits = bits;
- return (0);
-
- enoent:
- errno = ENOENT;
- return (-1);
-
- emsgsize:
- errno = EMSGSIZE;
- return (-1);
-}
-
-static int
-getbits(const char *src, int ipv6) {
- int bits = 0;
- char *cp, ch;
-
- if (*src == '\0') /*%< syntax */
- return (-2);
- do {
- ch = *src++;
- cp = strchr(digits, ch);
- if (cp == NULL) /*%< syntax */
- return (-2);
- bits *= 10;
- bits += cp - digits;
- if (bits == 0 && *src != '\0') /*%< no leading zeros */
- return (-2);
- if (bits > (ipv6 ? 128 : 32)) /*%< range error */
- return (-2);
- } while (*src != '\0');
-
- return (bits);
-}
-
-/*! \file */
diff --git a/lib/bind/inet/inet_data.c b/lib/bind/inet/inet_data.c
deleted file mode 100644
index f3fa25b9cb74..000000000000
--- a/lib/bind/inet/inet_data.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * Copyright (c) 1995-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 ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$Id: inet_data.c,v 1.3.18.1 2005/04/27 05:00:53 sra Exp $";
-#endif /* LIBC_SCCS and not lint */
-
-#include "port_before.h"
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-
-#include <ctype.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "port_after.h"
-
-const struct in6_addr isc_in6addr_any = IN6ADDR_ANY_INIT;
-const struct in6_addr isc_in6addr_loopback = IN6ADDR_LOOPBACK_INIT;
-
-/*! \file */
diff --git a/lib/bind/inet/inet_lnaof.c b/lib/bind/inet/inet_lnaof.c
deleted file mode 100644
index 70ac409512f8..000000000000
--- a/lib/bind/inet/inet_lnaof.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 1983, 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[] = "@(#)inet_lnaof.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include "port_before.h"
-
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include "port_after.h"
-
-/*%
- * Return the local network address portion of an
- * internet address; handles class a/b/c network
- * number formats.
- */
-u_long
-inet_lnaof(in)
- struct in_addr in;
-{
- register u_long i = ntohl(in.s_addr);
-
- if (IN_CLASSA(i))
- return ((i)&IN_CLASSA_HOST);
- else if (IN_CLASSB(i))
- return ((i)&IN_CLASSB_HOST);
- else
- return ((i)&IN_CLASSC_HOST);
-}
-
-/*! \file */
diff --git a/lib/bind/inet/inet_makeaddr.c b/lib/bind/inet/inet_makeaddr.c
deleted file mode 100644
index c56cb3eaeb57..000000000000
--- a/lib/bind/inet/inet_makeaddr.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 1983, 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[] = "@(#)inet_makeaddr.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include "port_before.h"
-
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include "port_after.h"
-
-/*%
- * Formulate an Internet address from network + host. Used in
- * building addresses stored in the ifnet structure.
- */
-struct in_addr
-inet_makeaddr(net, host)
- u_long net, host;
-{
- struct in_addr a;
-
- if (net < 128U)
- a.s_addr = (net << IN_CLASSA_NSHIFT) | (host & IN_CLASSA_HOST);
- else if (net < 65536U)
- a.s_addr = (net << IN_CLASSB_NSHIFT) | (host & IN_CLASSB_HOST);
- else if (net < 16777216L)
- a.s_addr = (net << IN_CLASSC_NSHIFT) | (host & IN_CLASSC_HOST);
- else
- a.s_addr = net | host;
- a.s_addr = htonl(a.s_addr);
- return (a);
-}
-
-/*! \file */
diff --git a/lib/bind/inet/inet_net_ntop.c b/lib/bind/inet/inet_net_ntop.c
deleted file mode 100644
index a1ac243da112..000000000000
--- a/lib/bind/inet/inet_net_ntop.c
+++ /dev/null
@@ -1,279 +0,0 @@
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * 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 ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: inet_net_ntop.c,v 1.3.18.2 2006/06/20 02:51:32 marka Exp $";
-#endif
-
-#include "port_before.h"
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include "port_after.h"
-
-#ifdef SPRINTF_CHAR
-# define SPRINTF(x) strlen(sprintf/**/x)
-#else
-# define SPRINTF(x) ((size_t)sprintf x)
-#endif
-
-static char * inet_net_ntop_ipv4 __P((const u_char *src, int bits,
- char *dst, size_t size));
-static char * inet_net_ntop_ipv6 __P((const u_char *src, int bits,
- char *dst, size_t size));
-
-/*%
- * char *
- * inet_net_ntop(af, src, bits, dst, size)
- * convert network number from network to presentation format.
- * generates CIDR style result always.
- * return:
- * pointer to dst, or NULL if an error occurred (check errno).
- * author:
- * Paul Vixie (ISC), July 1996
- */
-char *
-inet_net_ntop(af, src, bits, dst, size)
- int af;
- const void *src;
- int bits;
- char *dst;
- size_t size;
-{
- switch (af) {
- case AF_INET:
- return (inet_net_ntop_ipv4(src, bits, dst, size));
- case AF_INET6:
- return (inet_net_ntop_ipv6(src, bits, dst, size));
- default:
- errno = EAFNOSUPPORT;
- return (NULL);
- }
-}
-
-/*%
- * static char *
- * inet_net_ntop_ipv4(src, bits, dst, size)
- * convert IPv4 network number from network to presentation format.
- * generates CIDR style result always.
- * return:
- * pointer to dst, or NULL if an error occurred (check errno).
- * note:
- * network byte order assumed. this means 192.5.5.240/28 has
- * 0b11110000 in its fourth octet.
- * author:
- * Paul Vixie (ISC), July 1996
- */
-static char *
-inet_net_ntop_ipv4(src, bits, dst, size)
- const u_char *src;
- int bits;
- char *dst;
- size_t size;
-{
- char *odst = dst;
- char *t;
- u_int m;
- int b;
-
- if (bits < 0 || bits > 32) {
- errno = EINVAL;
- return (NULL);
- }
-
- if (bits == 0) {
- if (size < sizeof "0")
- goto emsgsize;
- *dst++ = '0';
- size--;
- *dst = '\0';
- }
-
- /* Format whole octets. */
- for (b = bits / 8; b > 0; b--) {
- if (size <= sizeof "255.")
- goto emsgsize;
- t = dst;
- dst += SPRINTF((dst, "%u", *src++));
- if (b > 1) {
- *dst++ = '.';
- *dst = '\0';
- }
- size -= (size_t)(dst - t);
- }
-
- /* Format partial octet. */
- b = bits % 8;
- if (b > 0) {
- if (size <= sizeof ".255")
- goto emsgsize;
- t = dst;
- if (dst != odst)
- *dst++ = '.';
- m = ((1 << b) - 1) << (8 - b);
- dst += SPRINTF((dst, "%u", *src & m));
- size -= (size_t)(dst - t);
- }
-
- /* Format CIDR /width. */
- if (size <= sizeof "/32")
- goto emsgsize;
- dst += SPRINTF((dst, "/%u", bits));
- return (odst);
-
- emsgsize:
- errno = EMSGSIZE;
- return (NULL);
-}
-
-/*%
- * static char *
- * inet_net_ntop_ipv6(src, bits, fakebits, dst, size)
- * convert IPv6 network number from network to presentation format.
- * generates CIDR style result always. Picks the shortest representation
- * unless the IP is really IPv4.
- * always prints specified number of bits (bits).
- * return:
- * pointer to dst, or NULL if an error occurred (check errno).
- * note:
- * network byte order assumed. this means 192.5.5.240/28 has
- * 0x11110000 in its fourth octet.
- * author:
- * Vadim Kogan (UCB), June 2001
- * Original version (IPv4) by Paul Vixie (ISC), July 1996
- */
-
-static char *
-inet_net_ntop_ipv6(const u_char *src, int bits, char *dst, size_t size) {
- u_int m;
- int b;
- int p;
- int zero_s, zero_l, tmp_zero_s, tmp_zero_l;
- int i;
- int is_ipv4 = 0;
- unsigned char inbuf[16];
- char outbuf[sizeof("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:255.255.255.255/128")];
- char *cp;
- int words;
- u_char *s;
-
- if (bits < 0 || bits > 128) {
- errno = EINVAL;
- return (NULL);
- }
-
- cp = outbuf;
-
- if (bits == 0) {
- *cp++ = ':';
- *cp++ = ':';
- *cp = '\0';
- } else {
- /* Copy src to private buffer. Zero host part. */
- p = (bits + 7) / 8;
- memcpy(inbuf, src, p);
- memset(inbuf + p, 0, 16 - p);
- b = bits % 8;
- if (b != 0) {
- m = ~0 << (8 - b);
- inbuf[p-1] &= m;
- }
-
- s = inbuf;
-
- /* how many words need to be displayed in output */
- words = (bits + 15) / 16;
- if (words == 1)
- words = 2;
-
- /* Find the longest substring of zero's */
- zero_s = zero_l = tmp_zero_s = tmp_zero_l = 0;
- for (i = 0; i < (words * 2); i += 2) {
- if ((s[i] | s[i+1]) == 0) {
- if (tmp_zero_l == 0)
- tmp_zero_s = i / 2;
- tmp_zero_l++;
- } else {
- if (tmp_zero_l && zero_l < tmp_zero_l) {
- zero_s = tmp_zero_s;
- zero_l = tmp_zero_l;
- tmp_zero_l = 0;
- }
- }
- }
-
- if (tmp_zero_l && zero_l < tmp_zero_l) {
- zero_s = tmp_zero_s;
- zero_l = tmp_zero_l;
- }
-
- if (zero_l != words && zero_s == 0 && ((zero_l == 6) ||
- ((zero_l == 5 && s[10] == 0xff && s[11] == 0xff) ||
- ((zero_l == 7 && s[14] != 0 && s[15] != 1)))))
- is_ipv4 = 1;
-
- /* Format whole words. */
- for (p = 0; p < words; p++) {
- if (zero_l != 0 && p >= zero_s && p < zero_s + zero_l) {
- /* Time to skip some zeros */
- if (p == zero_s)
- *cp++ = ':';
- if (p == words - 1)
- *cp++ = ':';
- s++;
- s++;
- continue;
- }
-
- if (is_ipv4 && p > 5 ) {
- *cp++ = (p == 6) ? ':' : '.';
- cp += SPRINTF((cp, "%u", *s++));
- /* we can potentially drop the last octet */
- if (p != 7 || bits > 120) {
- *cp++ = '.';
- cp += SPRINTF((cp, "%u", *s++));
- }
- } else {
- if (cp != outbuf)
- *cp++ = ':';
- cp += SPRINTF((cp, "%x", *s * 256 + s[1]));
- s += 2;
- }
- }
- }
- /* Format CIDR /width. */
- sprintf(cp, "/%u", bits);
- if (strlen(outbuf) + 1 > size)
- goto emsgsize;
- strcpy(dst, outbuf);
-
- return (dst);
-
-emsgsize:
- errno = EMSGSIZE;
- return (NULL);
-}
-
-/*! \file */
diff --git a/lib/bind/inet/inet_net_pton.c b/lib/bind/inet/inet_net_pton.c
deleted file mode 100644
index 71a871510393..000000000000
--- a/lib/bind/inet/inet_net_pton.c
+++ /dev/null
@@ -1,407 +0,0 @@
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * 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 ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: inet_net_pton.c,v 1.7.18.2 2008/08/26 04:42:43 marka Exp $";
-#endif
-
-#include "port_before.h"
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <arpa/inet.h>
-
-#include <isc/assertions.h>
-#include <ctype.h>
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include "port_after.h"
-
-#ifdef SPRINTF_CHAR
-# define SPRINTF(x) strlen(sprintf/**/x)
-#else
-# define SPRINTF(x) ((size_t)sprintf x)
-#endif
-
-/*%
- * static int
- * inet_net_pton_ipv4(src, dst, size)
- * convert IPv4 network number from presentation to network format.
- * accepts hex octets, hex strings, decimal octets, and /CIDR.
- * "size" is in bytes and describes "dst".
- * return:
- * number of bits, either imputed classfully or specified with /CIDR,
- * or -1 if some failure occurred (check errno). ENOENT means it was
- * not an IPv4 network specification.
- * note:
- * network byte order assumed. this means 192.5.5.240/28 has
- * 0b11110000 in its fourth octet.
- * author:
- * Paul Vixie (ISC), June 1996
- */
-static int
-inet_net_pton_ipv4(const char *src, u_char *dst, size_t size) {
- static const char xdigits[] = "0123456789abcdef";
- static const char digits[] = "0123456789";
- int n, ch, tmp = 0, dirty, bits;
- const u_char *odst = dst;
-
- ch = *src++;
- if (ch == '0' && (src[0] == 'x' || src[0] == 'X')
- && isascii((unsigned char)(src[1]))
- && isxdigit((unsigned char)(src[1]))) {
- /* Hexadecimal: Eat nybble string. */
- if (size <= 0U)
- goto emsgsize;
- dirty = 0;
- src++; /*%< skip x or X. */
- while ((ch = *src++) != '\0' && isascii(ch) && isxdigit(ch)) {
- if (isupper(ch))
- ch = tolower(ch);
- n = strchr(xdigits, ch) - xdigits;
- INSIST(n >= 0 && n <= 15);
- if (dirty == 0)
- tmp = n;
- else
- tmp = (tmp << 4) | n;
- if (++dirty == 2) {
- if (size-- <= 0U)
- goto emsgsize;
- *dst++ = (u_char) tmp;
- dirty = 0;
- }
- }
- if (dirty) { /*%< Odd trailing nybble? */
- if (size-- <= 0U)
- goto emsgsize;
- *dst++ = (u_char) (tmp << 4);
- }
- } else if (isascii(ch) && isdigit(ch)) {
- /* Decimal: eat dotted digit string. */
- for (;;) {
- tmp = 0;
- do {
- n = strchr(digits, ch) - digits;
- INSIST(n >= 0 && n <= 9);
- tmp *= 10;
- tmp += n;
- if (tmp > 255)
- goto enoent;
- } while ((ch = *src++) != '\0' &&
- isascii(ch) && isdigit(ch));
- if (size-- <= 0U)
- goto emsgsize;
- *dst++ = (u_char) tmp;
- if (ch == '\0' || ch == '/')
- break;
- if (ch != '.')
- goto enoent;
- ch = *src++;
- if (!isascii(ch) || !isdigit(ch))
- goto enoent;
- }
- } else
- goto enoent;
-
- bits = -1;
- if (ch == '/' && isascii((unsigned char)(src[0])) &&
- isdigit((unsigned char)(src[0])) && dst > odst) {
- /* CIDR width specifier. Nothing can follow it. */
- ch = *src++; /*%< Skip over the /. */
- bits = 0;
- do {
- n = strchr(digits, ch) - digits;
- INSIST(n >= 0 && n <= 9);
- bits *= 10;
- bits += n;
- if (bits > 32)
- goto enoent;
- } while ((ch = *src++) != '\0' && isascii(ch) && isdigit(ch));
- if (ch != '\0')
- goto enoent;
- }
-
- /* Firey death and destruction unless we prefetched EOS. */
- if (ch != '\0')
- goto enoent;
-
- /* If nothing was written to the destination, we found no address. */
- if (dst == odst)
- goto enoent;
- /* If no CIDR spec was given, infer width from net class. */
- if (bits == -1) {
- if (*odst >= 240) /*%< Class E */
- bits = 32;
- else if (*odst >= 224) /*%< Class D */
- bits = 8;
- else if (*odst >= 192) /*%< Class C */
- bits = 24;
- else if (*odst >= 128) /*%< Class B */
- bits = 16;
- else /*%< Class A */
- bits = 8;
- /* If imputed mask is narrower than specified octets, widen. */
- if (bits < ((dst - odst) * 8))
- bits = (dst - odst) * 8;
- /*
- * If there are no additional bits specified for a class D
- * address adjust bits to 4.
- */
- if (bits == 8 && *odst == 224)
- bits = 4;
- }
- /* Extend network to cover the actual mask. */
- while (bits > ((dst - odst) * 8)) {
- if (size-- <= 0U)
- goto emsgsize;
- *dst++ = '\0';
- }
- return (bits);
-
- enoent:
- errno = ENOENT;
- return (-1);
-
- emsgsize:
- errno = EMSGSIZE;
- return (-1);
-}
-
-static int
-getbits(const char *src, int *bitsp) {
- static const char digits[] = "0123456789";
- int n;
- int val;
- char ch;
-
- val = 0;
- n = 0;
- while ((ch = *src++) != '\0') {
- const char *pch;
-
- pch = strchr(digits, ch);
- if (pch != NULL) {
- if (n++ != 0 && val == 0) /*%< no leading zeros */
- return (0);
- val *= 10;
- val += (pch - digits);
- if (val > 128) /*%< range */
- return (0);
- continue;
- }
- return (0);
- }
- if (n == 0)
- return (0);
- *bitsp = val;
- return (1);
-}
-
-static int
-getv4(const char *src, u_char *dst, int *bitsp) {
- static const char digits[] = "0123456789";
- u_char *odst = dst;
- int n;
- u_int val;
- char ch;
-
- val = 0;
- n = 0;
- while ((ch = *src++) != '\0') {
- const char *pch;
-
- pch = strchr(digits, ch);
- if (pch != NULL) {
- if (n++ != 0 && val == 0) /*%< no leading zeros */
- return (0);
- val *= 10;
- val += (pch - digits);
- if (val > 255) /*%< range */
- return (0);
- continue;
- }
- if (ch == '.' || ch == '/') {
- if (dst - odst > 3) /*%< too many octets? */
- return (0);
- *dst++ = val;
- if (ch == '/')
- return (getbits(src, bitsp));
- val = 0;
- n = 0;
- continue;
- }
- return (0);
- }
- if (n == 0)
- return (0);
- if (dst - odst > 3) /*%< too many octets? */
- return (0);
- *dst++ = val;
- return (1);
-}
-
-static int
-inet_net_pton_ipv6(const char *src, u_char *dst, size_t size) {
- static const char xdigits_l[] = "0123456789abcdef",
- xdigits_u[] = "0123456789ABCDEF";
- u_char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp;
- const char *xdigits, *curtok;
- int ch, saw_xdigit;
- u_int val;
- int digits;
- int bits;
- size_t bytes;
- int words;
- int ipv4;
-
- memset((tp = tmp), '\0', NS_IN6ADDRSZ);
- endp = tp + NS_IN6ADDRSZ;
- colonp = NULL;
- /* Leading :: requires some special handling. */
- if (*src == ':')
- if (*++src != ':')
- goto enoent;
- curtok = src;
- saw_xdigit = 0;
- val = 0;
- digits = 0;
- bits = -1;
- ipv4 = 0;
- while ((ch = *src++) != '\0') {
- const char *pch;
-
- if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL)
- pch = strchr((xdigits = xdigits_u), ch);
- if (pch != NULL) {
- val <<= 4;
- val |= (pch - xdigits);
- if (++digits > 4)
- goto enoent;
- saw_xdigit = 1;
- continue;
- }
- if (ch == ':') {
- curtok = src;
- if (!saw_xdigit) {
- if (colonp)
- goto enoent;
- colonp = tp;
- continue;
- } else if (*src == '\0')
- goto enoent;
- if (tp + NS_INT16SZ > endp)
- return (0);
- *tp++ = (u_char) (val >> 8) & 0xff;
- *tp++ = (u_char) val & 0xff;
- saw_xdigit = 0;
- digits = 0;
- val = 0;
- continue;
- }
- if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) &&
- getv4(curtok, tp, &bits) > 0) {
- tp += NS_INADDRSZ;
- saw_xdigit = 0;
- ipv4 = 1;
- break; /*%< '\\0' was seen by inet_pton4(). */
- }
- if (ch == '/' && getbits(src, &bits) > 0)
- break;
- goto enoent;
- }
- if (saw_xdigit) {
- if (tp + NS_INT16SZ > endp)
- goto enoent;
- *tp++ = (u_char) (val >> 8) & 0xff;
- *tp++ = (u_char) val & 0xff;
- }
- if (bits == -1)
- bits = 128;
-
- words = (bits + 15) / 16;
- if (words < 2)
- words = 2;
- if (ipv4)
- words = 8;
- endp = tmp + 2 * words;
-
- if (colonp != NULL) {
- /*
- * Since some memmove()'s erroneously fail to handle
- * overlapping regions, we'll do the shift by hand.
- */
- const int n = tp - colonp;
- int i;
-
- if (tp == endp)
- goto enoent;
- for (i = 1; i <= n; i++) {
- endp[- i] = colonp[n - i];
- colonp[n - i] = 0;
- }
- tp = endp;
- }
- if (tp != endp)
- goto enoent;
-
- bytes = (bits + 7) / 8;
- if (bytes > size)
- goto emsgsize;
- memcpy(dst, tmp, bytes);
- return (bits);
-
- enoent:
- errno = ENOENT;
- return (-1);
-
- emsgsize:
- errno = EMSGSIZE;
- return (-1);
-}
-
-/*%
- * int
- * inet_net_pton(af, src, dst, size)
- * convert network number from presentation to network format.
- * accepts hex octets, hex strings, decimal octets, and /CIDR.
- * "size" is in bytes and describes "dst".
- * return:
- * number of bits, either imputed classfully or specified with /CIDR,
- * or -1 if some failure occurred (check errno). ENOENT means it was
- * not a valid network specification.
- * author:
- * Paul Vixie (ISC), June 1996
- */
-int
-inet_net_pton(int af, const char *src, void *dst, size_t size) {
- switch (af) {
- case AF_INET:
- return (inet_net_pton_ipv4(src, dst, size));
- case AF_INET6:
- return (inet_net_pton_ipv6(src, dst, size));
- default:
- errno = EAFNOSUPPORT;
- return (-1);
- }
-}
-
-/*! \file */
diff --git a/lib/bind/inet/inet_neta.c b/lib/bind/inet/inet_neta.c
deleted file mode 100644
index bc3b601e9b4e..000000000000
--- a/lib/bind/inet/inet_neta.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * 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 ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: inet_neta.c,v 1.2.18.1 2005/04/27 05:00:53 sra Exp $";
-#endif
-
-#include "port_before.h"
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "port_after.h"
-
-#ifdef SPRINTF_CHAR
-# define SPRINTF(x) strlen(sprintf/**/x)
-#else
-# define SPRINTF(x) ((size_t)sprintf x)
-#endif
-
-/*%
- * char *
- * inet_neta(src, dst, size)
- * format a u_long network number into presentation format.
- * return:
- * pointer to dst, or NULL if an error occurred (check errno).
- * note:
- * format of ``src'' is as for inet_network().
- * author:
- * Paul Vixie (ISC), July 1996
- */
-char *
-inet_neta(src, dst, size)
- u_long src;
- char *dst;
- size_t size;
-{
- char *odst = dst;
- char *tp;
-
- while (src & 0xffffffff) {
- u_char b = (src & 0xff000000) >> 24;
-
- src <<= 8;
- if (b) {
- if (size < sizeof "255.")
- goto emsgsize;
- tp = dst;
- dst += SPRINTF((dst, "%u", b));
- if (src != 0L) {
- *dst++ = '.';
- *dst = '\0';
- }
- size -= (size_t)(dst - tp);
- }
- }
- if (dst == odst) {
- if (size < sizeof "0.0.0.0")
- goto emsgsize;
- strcpy(dst, "0.0.0.0");
- }
- return (odst);
-
- emsgsize:
- errno = EMSGSIZE;
- return (NULL);
-}
-
-/*! \file */
diff --git a/lib/bind/inet/inet_netof.c b/lib/bind/inet/inet_netof.c
deleted file mode 100644
index c228e3d818f9..000000000000
--- a/lib/bind/inet/inet_netof.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 1983, 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[] = "@(#)inet_netof.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include "port_before.h"
-
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include "port_after.h"
-
-/*%
- * Return the network number from an internet
- * address; handles class a/b/c network #'s.
- */
-u_long
-inet_netof(in)
- struct in_addr in;
-{
- register u_long i = ntohl(in.s_addr);
-
- if (IN_CLASSA(i))
- return (((i)&IN_CLASSA_NET) >> IN_CLASSA_NSHIFT);
- else if (IN_CLASSB(i))
- return (((i)&IN_CLASSB_NET) >> IN_CLASSB_NSHIFT);
- else
- return (((i)&IN_CLASSC_NET) >> IN_CLASSC_NSHIFT);
-}
-
-/*! \file */
diff --git a/lib/bind/inet/inet_network.c b/lib/bind/inet/inet_network.c
deleted file mode 100644
index 47976cff68d8..000000000000
--- a/lib/bind/inet/inet_network.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 1983, 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[] = "@(#)inet_network.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include "port_before.h"
-
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <ctype.h>
-
-#include "port_after.h"
-
-/*%
- * Internet network address interpretation routine.
- * The library routines call this routine to interpret
- * network numbers.
- */
-u_long
-inet_network(cp)
- register const char *cp;
-{
- register u_long val, base, n, i;
- register char c;
- u_long parts[4], *pp = parts;
- int digit;
-
-again:
- val = 0; base = 10; digit = 0;
- if (*cp == '0')
- digit = 1, base = 8, cp++;
- if (*cp == 'x' || *cp == 'X')
- base = 16, cp++;
- while ((c = *cp) != 0) {
- if (isdigit((unsigned char)c)) {
- if (base == 8U && (c == '8' || c == '9'))
- return (INADDR_NONE);
- val = (val * base) + (c - '0');
- cp++;
- digit = 1;
- continue;
- }
- if (base == 16U && isxdigit((unsigned char)c)) {
- val = (val << 4) +
- (c + 10 - (islower((unsigned char)c) ? 'a' : 'A'));
- cp++;
- digit = 1;
- continue;
- }
- break;
- }
- if (!digit)
- return (INADDR_NONE);
- if (pp >= parts + 4 || val > 0xffU)
- return (INADDR_NONE);
- if (*cp == '.') {
- *pp++ = val, cp++;
- goto again;
- }
- if (*cp && !isspace(*cp&0xff))
- return (INADDR_NONE);
- *pp++ = val;
- n = pp - parts;
- if (n > 4U)
- return (INADDR_NONE);
- for (val = 0, i = 0; i < n; i++) {
- val <<= 8;
- val |= parts[i] & 0xff;
- }
- return (val);
-}
-
-/*! \file */
diff --git a/lib/bind/inet/inet_ntoa.c b/lib/bind/inet/inet_ntoa.c
deleted file mode 100644
index 1d566be9972f..000000000000
--- a/lib/bind/inet/inet_ntoa.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 1983, 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[] = "@(#)inet_ntoa.c 8.1 (Berkeley) 6/4/93";
-static const char rcsid[] = "$Id: inet_ntoa.c,v 1.1.352.1 2005/04/27 05:00:54 sra Exp $";
-#endif /* LIBC_SCCS and not lint */
-
-#include "port_before.h"
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include <stdio.h>
-#include <string.h>
-
-#include "port_after.h"
-
-/*%
- * Convert network-format internet address
- * to base 256 d.d.d.d representation.
- */
-/*const*/ char *
-inet_ntoa(struct in_addr in) {
- static char ret[18];
-
- strcpy(ret, "[inet_ntoa error]");
- (void) inet_ntop(AF_INET, &in, ret, sizeof ret);
- return (ret);
-}
-
-/*! \file */
diff --git a/lib/bind/inet/inet_ntop.c b/lib/bind/inet/inet_ntop.c
deleted file mode 100644
index 9ab38bc0dcda..000000000000
--- a/lib/bind/inet/inet_ntop.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * 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 ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: inet_ntop.c,v 1.3.18.2 2005/11/03 23:02:22 marka Exp $";
-#endif /* LIBC_SCCS and not lint */
-
-#include "port_before.h"
-
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "port_after.h"
-
-#ifdef SPRINTF_CHAR
-# define SPRINTF(x) strlen(sprintf/**/x)
-#else
-# define SPRINTF(x) ((size_t)sprintf x)
-#endif
-
-/*%
- * WARNING: Don't even consider trying to compile this on a system where
- * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
- */
-
-static const char *inet_ntop4 __P((const u_char *src, char *dst, size_t size));
-static const char *inet_ntop6 __P((const u_char *src, char *dst, size_t size));
-
-/* char *
- * inet_ntop(af, src, dst, size)
- * convert a network format address to presentation format.
- * return:
- * pointer to presentation format address (`dst'), or NULL (see errno).
- * author:
- * Paul Vixie, 1996.
- */
-const char *
-inet_ntop(af, src, dst, size)
- int af;
- const void *src;
- char *dst;
- size_t size;
-{
- switch (af) {
- case AF_INET:
- return (inet_ntop4(src, dst, size));
- case AF_INET6:
- return (inet_ntop6(src, dst, size));
- default:
- errno = EAFNOSUPPORT;
- return (NULL);
- }
- /* NOTREACHED */
-}
-
-/* const char *
- * inet_ntop4(src, dst, size)
- * format an IPv4 address
- * return:
- * `dst' (as a const)
- * notes:
- * (1) uses no statics
- * (2) takes a u_char* not an in_addr as input
- * author:
- * Paul Vixie, 1996.
- */
-static const char *
-inet_ntop4(src, dst, size)
- const u_char *src;
- char *dst;
- size_t size;
-{
- static const char fmt[] = "%u.%u.%u.%u";
- char tmp[sizeof "255.255.255.255"];
-
- if (SPRINTF((tmp, fmt, src[0], src[1], src[2], src[3])) >= size) {
- errno = ENOSPC;
- return (NULL);
- }
- strcpy(dst, tmp);
- return (dst);
-}
-
-/* const char *
- * inet_ntop6(src, dst, size)
- * convert IPv6 binary address into presentation (printable) format
- * author:
- * Paul Vixie, 1996.
- */
-static const char *
-inet_ntop6(src, dst, size)
- const u_char *src;
- char *dst;
- size_t size;
-{
- /*
- * Note that int32_t and int16_t need only be "at least" large enough
- * to contain a value of the specified size. On some systems, like
- * Crays, there is no such thing as an integer variable with 16 bits.
- * Keep this in mind if you think this function should have been coded
- * to use pointer overlays. All the world's not a VAX.
- */
- char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp;
- struct { int base, len; } best, cur;
- u_int words[NS_IN6ADDRSZ / NS_INT16SZ];
- int i;
-
- /*
- * Preprocess:
- * Copy the input (bytewise) array into a wordwise array.
- * Find the longest run of 0x00's in src[] for :: shorthanding.
- */
- memset(words, '\0', sizeof words);
- for (i = 0; i < NS_IN6ADDRSZ; i++)
- words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3));
- best.base = -1;
- best.len = 0;
- cur.base = -1;
- cur.len = 0;
- for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
- if (words[i] == 0) {
- if (cur.base == -1)
- cur.base = i, cur.len = 1;
- else
- cur.len++;
- } else {
- if (cur.base != -1) {
- if (best.base == -1 || cur.len > best.len)
- best = cur;
- cur.base = -1;
- }
- }
- }
- if (cur.base != -1) {
- if (best.base == -1 || cur.len > best.len)
- best = cur;
- }
- if (best.base != -1 && best.len < 2)
- best.base = -1;
-
- /*
- * Format the result.
- */
- tp = tmp;
- for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
- /* Are we inside the best run of 0x00's? */
- if (best.base != -1 && i >= best.base &&
- i < (best.base + best.len)) {
- if (i == best.base)
- *tp++ = ':';
- continue;
- }
- /* Are we following an initial run of 0x00s or any real hex? */
- if (i != 0)
- *tp++ = ':';
- /* Is this address an encapsulated IPv4? */
- if (i == 6 && best.base == 0 && (best.len == 6 ||
- (best.len == 7 && words[7] != 0x0001) ||
- (best.len == 5 && words[5] == 0xffff))) {
- if (!inet_ntop4(src+12, tp, sizeof tmp - (tp - tmp)))
- return (NULL);
- tp += strlen(tp);
- break;
- }
- tp += SPRINTF((tp, "%x", words[i]));
- }
- /* Was it a trailing run of 0x00's? */
- if (best.base != -1 && (best.base + best.len) ==
- (NS_IN6ADDRSZ / NS_INT16SZ))
- *tp++ = ':';
- *tp++ = '\0';
-
- /*
- * Check for overflow, copy, and we're done.
- */
- if ((size_t)(tp - tmp) > size) {
- errno = ENOSPC;
- return (NULL);
- }
- strcpy(dst, tmp);
- return (dst);
-}
-
-/*! \file */
diff --git a/lib/bind/inet/inet_pton.c b/lib/bind/inet/inet_pton.c
deleted file mode 100644
index 66b4c6a669b1..000000000000
--- a/lib/bind/inet/inet_pton.c
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * 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 ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: inet_pton.c,v 1.3.18.2 2005/07/28 07:38:07 marka Exp $";
-#endif /* LIBC_SCCS and not lint */
-
-#include "port_before.h"
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-#include <string.h>
-#include <errno.h>
-#include "port_after.h"
-
-/*%
- * WARNING: Don't even consider trying to compile this on a system where
- * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
- */
-
-static int inet_pton4 __P((const char *src, u_char *dst));
-static int inet_pton6 __P((const char *src, u_char *dst));
-
-/* int
- * inet_pton(af, src, dst)
- * convert from presentation format (which usually means ASCII printable)
- * to network format (which is usually some kind of binary format).
- * return:
- * 1 if the address was valid for the specified address family
- * 0 if the address wasn't valid (`dst' is untouched in this case)
- * -1 if some other error occurred (`dst' is untouched in this case, too)
- * author:
- * Paul Vixie, 1996.
- */
-int
-inet_pton(af, src, dst)
- int af;
- const char *src;
- void *dst;
-{
- switch (af) {
- case AF_INET:
- return (inet_pton4(src, dst));
- case AF_INET6:
- return (inet_pton6(src, dst));
- default:
- errno = EAFNOSUPPORT;
- return (-1);
- }
- /* NOTREACHED */
-}
-
-/* int
- * inet_pton4(src, dst)
- * like inet_aton() but without all the hexadecimal and shorthand.
- * return:
- * 1 if `src' is a valid dotted quad, else 0.
- * notice:
- * does not touch `dst' unless it's returning 1.
- * author:
- * Paul Vixie, 1996.
- */
-static int
-inet_pton4(src, dst)
- const char *src;
- u_char *dst;
-{
- static const char digits[] = "0123456789";
- int saw_digit, octets, ch;
- u_char tmp[NS_INADDRSZ], *tp;
-
- saw_digit = 0;
- octets = 0;
- *(tp = tmp) = 0;
- while ((ch = *src++) != '\0') {
- const char *pch;
-
- if ((pch = strchr(digits, ch)) != NULL) {
- u_int new = *tp * 10 + (pch - digits);
-
- if (saw_digit && *tp == 0)
- return (0);
- if (new > 255)
- return (0);
- *tp = new;
- if (!saw_digit) {
- if (++octets > 4)
- return (0);
- saw_digit = 1;
- }
- } else if (ch == '.' && saw_digit) {
- if (octets == 4)
- return (0);
- *++tp = 0;
- saw_digit = 0;
- } else
- return (0);
- }
- if (octets < 4)
- return (0);
- memcpy(dst, tmp, NS_INADDRSZ);
- return (1);
-}
-
-/* int
- * inet_pton6(src, dst)
- * convert presentation level address to network order binary form.
- * return:
- * 1 if `src' is a valid [RFC1884 2.2] address, else 0.
- * notice:
- * (1) does not touch `dst' unless it's returning 1.
- * (2) :: in a full address is silently ignored.
- * credit:
- * inspired by Mark Andrews.
- * author:
- * Paul Vixie, 1996.
- */
-static int
-inet_pton6(src, dst)
- const char *src;
- u_char *dst;
-{
- static const char xdigits_l[] = "0123456789abcdef",
- xdigits_u[] = "0123456789ABCDEF";
- u_char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp;
- const char *xdigits, *curtok;
- int ch, seen_xdigits;
- u_int val;
-
- memset((tp = tmp), '\0', NS_IN6ADDRSZ);
- endp = tp + NS_IN6ADDRSZ;
- colonp = NULL;
- /* Leading :: requires some special handling. */
- if (*src == ':')
- if (*++src != ':')
- return (0);
- curtok = src;
- seen_xdigits = 0;
- val = 0;
- while ((ch = *src++) != '\0') {
- const char *pch;
-
- if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL)
- pch = strchr((xdigits = xdigits_u), ch);
- if (pch != NULL) {
- val <<= 4;
- val |= (pch - xdigits);
- if (++seen_xdigits > 4)
- return (0);
- continue;
- }
- if (ch == ':') {
- curtok = src;
- if (!seen_xdigits) {
- if (colonp)
- return (0);
- colonp = tp;
- continue;
- } else if (*src == '\0') {
- return (0);
- }
- if (tp + NS_INT16SZ > endp)
- return (0);
- *tp++ = (u_char) (val >> 8) & 0xff;
- *tp++ = (u_char) val & 0xff;
- seen_xdigits = 0;
- val = 0;
- continue;
- }
- if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) &&
- inet_pton4(curtok, tp) > 0) {
- tp += NS_INADDRSZ;
- seen_xdigits = 0;
- break; /*%< '\\0' was seen by inet_pton4(). */
- }
- return (0);
- }
- if (seen_xdigits) {
- if (tp + NS_INT16SZ > endp)
- return (0);
- *tp++ = (u_char) (val >> 8) & 0xff;
- *tp++ = (u_char) val & 0xff;
- }
- if (colonp != NULL) {
- /*
- * Since some memmove()'s erroneously fail to handle
- * overlapping regions, we'll do the shift by hand.
- */
- const int n = tp - colonp;
- int i;
-
- if (tp == endp)
- return (0);
- for (i = 1; i <= n; i++) {
- endp[- i] = colonp[n - i];
- colonp[n - i] = 0;
- }
- tp = endp;
- }
- if (tp != endp)
- return (0);
- memcpy(dst, tmp, NS_IN6ADDRSZ);
- return (1);
-}
-
-/*! \file */
diff --git a/lib/bind/inet/nsap_addr.c b/lib/bind/inet/nsap_addr.c
deleted file mode 100644
index d8fe87c52c69..000000000000
--- a/lib/bind/inet/nsap_addr.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * 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 ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: nsap_addr.c,v 1.3.18.2 2005/07/28 07:38:08 marka Exp $";
-#endif /* LIBC_SCCS and not lint */
-
-#include "port_before.h"
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-
-#include <ctype.h>
-#include <resolv.h>
-#include <resolv_mt.h>
-
-#include "port_after.h"
-
-static char
-xtob(int c) {
- return (c - (((c >= '0') && (c <= '9')) ? '0' : '7'));
-}
-
-u_int
-inet_nsap_addr(const char *ascii, u_char *binary, int maxlen) {
- u_char c, nib;
- u_int len = 0;
-
- if (ascii[0] != '0' || (ascii[1] != 'x' && ascii[1] != 'X'))
- return (0);
- ascii += 2;
-
- while ((c = *ascii++) != '\0' && len < (u_int)maxlen) {
- if (c == '.' || c == '+' || c == '/')
- continue;
- if (!isascii(c))
- return (0);
- if (islower(c))
- c = toupper(c);
- if (isxdigit(c)) {
- nib = xtob(c);
- c = *ascii++;
- if (c != '\0') {
- c = toupper(c);
- if (isxdigit(c)) {
- *binary++ = (nib << 4) | xtob(c);
- len++;
- } else
- return (0);
- }
- else
- return (0);
- }
- else
- return (0);
- }
- return (len);
-}
-
-char *
-inet_nsap_ntoa(int binlen, const u_char *binary, char *ascii) {
- int nib;
- int i;
- char *tmpbuf = inet_nsap_ntoa_tmpbuf;
- char *start;
-
- if (ascii)
- start = ascii;
- else {
- ascii = tmpbuf;
- start = tmpbuf;
- }
-
- *ascii++ = '0';
- *ascii++ = 'x';
-
- if (binlen > 255)
- binlen = 255;
-
- for (i = 0; i < binlen; i++) {
- nib = *binary >> 4;
- *ascii++ = nib + (nib < 10 ? '0' : '7');
- nib = *binary++ & 0x0f;
- *ascii++ = nib + (nib < 10 ? '0' : '7');
- if (((i % 2) == 0 && (i + 1) < binlen))
- *ascii++ = '.';
- }
- *ascii = '\0';
- return (start);
-}
-
-/*! \file */
diff --git a/lib/bind/irs/Makefile.in b/lib/bind/irs/Makefile.in
deleted file mode 100644
index e4f38f7e09aa..000000000000
--- a/lib/bind/irs/Makefile.in
+++ /dev/null
@@ -1,70 +0,0 @@
-# Copyright (C) 2004, 2008 Internet Systems Consortium, Inc. ("ISC")
-# Copyright (C) 2001 Internet Software Consortium.
-#
-# Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS. IN NO EVENT SHALL ISC 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.in,v 1.8.18.4 2008/03/20 23:46:01 tbox Exp $
-
-srcdir= @srcdir@
-VPATH = @srcdir@
-
-WANT_IRS_THREADS_OBJS= gethostent_r.@O@ getnetent_r.@O@ getnetgrent_r.@O@ \
- getprotoent_r.@O@ getservent_r.@O@
-
-WANT_IRS_NISGR_OBJS= nis_gr.@O@
-WANT_IRS_GR_OBJS= dns_gr.@O@ irp_gr.@O@ lcl_gr.@O@ gen_gr.@O@ getgrent.@O@ \
- @WANT_IRS_NISGR_OBJS@ @WANT_IRS_THREADSGR_OBJS@
-
-WANT_IRS_THREADSPW_OBJS=getpwent_r.@O@
-WANT_IRS_NISPW_OBJS= nis_pw.@O@
-WANT_IRS_DBPW_OBJS=irp_pw.@O@ lcl_pw.@O@
-WANT_IRS_PW_OBJS= dns_pw.@O@ gen_pw.@O@ getpwent.@O@ \
- @WANT_IRS_DBPW_OBJS@ @WANT_IRS_NISPW_OBJS@ @WANT_IRS_THREADSPW_OBJS@
-
-WANT_IRS_NIS_OBJS= \
- nis_ho.@O@ nis_ng.@O@ nis_nw.@O@ nis_pr.@O@ nis_sv.@O@
-
-OBJS= @WANT_IRS_GR_OBJS@ @WANT_IRS_NIS_OBJS@ @WANT_IRS_THREADS_OBJS@ \
- @WANT_IRS_PW_OBJS@ \
- dns.@O@ dns_ho.@O@ dns_nw.@O@ dns_pr.@O@ \
- dns_sv.@O@ gai_strerror.@O@ gen.@O@ gen_ho.@O@ \
- gen_ng.@O@ gen_nw.@O@ gen_pr.@O@ gen_sv.@O@ \
- getaddrinfo.@O@ gethostent.@O@ \
- getnameinfo.@O@ getnetent.@O@ \
- getnetgrent.@O@ getprotoent.@O@ getservent.@O@ \
- hesiod.@O@ irp.@O@ irp_ho.@O@ irp_ng.@O@ irp_nw.@O@ \
- irp_pr.@O@ irp_sv.@O@ irpmarshall.@O@ irs_data.@O@ \
- lcl.@O@ lcl_ho.@O@ lcl_ng.@O@ lcl_nw.@O@ lcl_pr.@O@ \
- lcl_sv.@O@ nis.@O@ nul_ng.@O@ util.@O@
-
-SRCS= dns.c dns_gr.c dns_ho.c dns_nw.c dns_pr.c dns_pw.c \
- dns_sv.c gai_strerror.c gen.c gen_gr.c gen_ho.c \
- gen_ng.c gen_nw.c gen_pr.c gen_pw.c gen_sv.c \
- getaddrinfo.c getgrent.c gethostent.c \
- getnameinfo.c getnetent.c getnetent_r.c \
- getnetgrent.c getprotoent.c getpwent.c getservent.c \
- hesiod.c irp.c irp_gr.c irp_ho.c irp_ng.c irp_nw.c \
- irp_pr.c irp_pw.c irp_sv.c irpmarshall.c irs_data.c \
- lcl.c lcl_gr.c lcl_ho.c lcl_ng.c lcl_nw.c lcl_pr.c \
- lcl_pw.c lcl_sv.c nis.c nis_gr.c nis_ho.c nis_ng.c \
- nis_nw.c nis_pr.c nis_pw.c nis_sv.c nul_ng.c \
- util.c getgrent_r.c gethostent_r.c getnetgrent_r.c getprotoent_r.c \
- getpwent_r.c getservent_r.c
-
-WANT_IRS_THREADSGR_OBJS=getgrent_r.@O@
-
-TARGETS= ${OBJS}
-
-CINCLUDES= -I.. -I../include -I${srcdir}/../include
-
-@BIND9_MAKE_RULES@
diff --git a/lib/bind/irs/dns.c b/lib/bind/irs/dns.c
deleted file mode 100644
index b78a1d6708b8..000000000000
--- a/lib/bind/irs/dns.c
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * 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 ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: dns.c,v 1.3.18.2 2006/03/10 00:20:08 marka Exp $";
-#endif
-
-/*! \file
- * \brief
- * dns.c --- this is the top-level accessor function for the dns
- */
-
-#include "port_before.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <resolv.h>
-
-#include <resolv.h>
-
-#include <isc/memcluster.h>
-#include <irs.h>
-
-#include "port_after.h"
-
-#include "irs_p.h"
-#include "hesiod.h"
-#include "dns_p.h"
-
-/* forward */
-
-static void dns_close(struct irs_acc *);
-static struct __res_state * dns_res_get(struct irs_acc *);
-static void dns_res_set(struct irs_acc *, struct __res_state *,
- void (*)(void *));
-
-/* public */
-
-struct irs_acc *
-irs_dns_acc(const char *options) {
- struct irs_acc *acc;
- struct dns_p *dns;
-
- UNUSED(options);
-
- if (!(acc = memget(sizeof *acc))) {
- errno = ENOMEM;
- return (NULL);
- }
- memset(acc, 0x5e, sizeof *acc);
- if (!(dns = memget(sizeof *dns))) {
- errno = ENOMEM;
- memput(acc, sizeof *acc);
- return (NULL);
- }
- memset(dns, 0x5e, sizeof *dns);
- dns->res = NULL;
- dns->free_res = NULL;
- if (hesiod_init(&dns->hes_ctx) < 0) {
- /*
- * We allow the dns accessor class to initialize
- * despite hesiod failing to initialize correctly,
- * since dns host queries don't depend on hesiod.
- */
- dns->hes_ctx = NULL;
- }
- acc->private = dns;
-#ifdef WANT_IRS_GR
- acc->gr_map = irs_dns_gr;
-#else
- acc->gr_map = NULL;
-#endif
-#ifdef WANT_IRS_PW
- acc->pw_map = irs_dns_pw;
-#else
- acc->pw_map = NULL;
-#endif
- acc->sv_map = irs_dns_sv;
- acc->pr_map = irs_dns_pr;
- acc->ho_map = irs_dns_ho;
- acc->nw_map = irs_dns_nw;
- acc->ng_map = irs_nul_ng;
- acc->res_get = dns_res_get;
- acc->res_set = dns_res_set;
- acc->close = dns_close;
- return (acc);
-}
-
-/* methods */
-static struct __res_state *
-dns_res_get(struct irs_acc *this) {
- struct dns_p *dns = (struct dns_p *)this->private;
-
- if (dns->res == NULL) {
- struct __res_state *res;
- res = (struct __res_state *)malloc(sizeof *res);
- if (res == NULL)
- return (NULL);
- memset(res, 0, sizeof *res);
- dns_res_set(this, res, free);
- }
-
- if ((dns->res->options & RES_INIT) == 0U &&
- res_ninit(dns->res) < 0)
- return (NULL);
-
- return (dns->res);
-}
-
-static void
-dns_res_set(struct irs_acc *this, struct __res_state *res,
- void (*free_res)(void *)) {
- struct dns_p *dns = (struct dns_p *)this->private;
-
- if (dns->res && dns->free_res) {
- res_nclose(dns->res);
- (*dns->free_res)(dns->res);
- }
- dns->res = res;
- dns->free_res = free_res;
-}
-
-static void
-dns_close(struct irs_acc *this) {
- struct dns_p *dns;
-
- dns = (struct dns_p *)this->private;
- if (dns->res && dns->free_res)
- (*dns->free_res)(dns->res);
- if (dns->hes_ctx)
- hesiod_end(dns->hes_ctx);
- memput(dns, sizeof *dns);
- memput(this, sizeof *this);
-}
-
diff --git a/lib/bind/irs/dns_gr.c b/lib/bind/irs/dns_gr.c
deleted file mode 100644
index 358e5a78ef1b..000000000000
--- a/lib/bind/irs/dns_gr.c
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * 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 ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: dns_gr.c,v 1.3.18.1 2005/04/27 05:00:54 sra Exp $";
-#endif
-
-/*! \file
- * \brief
- * dns_gr.c --- this file contains the functions for accessing
- * group information from Hesiod.
- */
-
-#include "port_before.h"
-
-#ifndef WANT_IRS_GR
-static int __bind_irs_gr_unneeded;
-#else
-
-#include <sys/param.h>
-#include <sys/types.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <unistd.h>
-
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <resolv.h>
-
-#include <isc/memcluster.h>
-
-#include <irs.h>
-
-#include "port_after.h"
-
-#include "irs_p.h"
-#include "hesiod.h"
-#include "dns_p.h"
-
-/* Types. */
-
-struct pvt {
- /*
- * This is our private accessor data. It has a shared hesiod context.
- */
- struct dns_p * dns;
- /*
- * Need space to store the entries read from the group file.
- * The members list also needs space per member, and the
- * strings making up the user names must be allocated
- * somewhere. Rather than doing lots of small allocations,
- * we keep one buffer and resize it as needed.
- */
- struct group group;
- size_t nmemb; /*%< Malloc'd max index of gr_mem[]. */
- char * membuf;
- size_t membufsize;
-};
-
-/* Forward. */
-
-static struct group * gr_next(struct irs_gr *);
-static struct group * gr_byname(struct irs_gr *, const char *);
-static struct group * gr_bygid(struct irs_gr *, gid_t);
-static void gr_rewind(struct irs_gr *);
-static void gr_close(struct irs_gr *);
-static int gr_list(struct irs_gr *, const char *,
- gid_t, gid_t *, int *);
-static void gr_minimize(struct irs_gr *);
-static struct __res_state * gr_res_get(struct irs_gr *);
-static void gr_res_set(struct irs_gr *,
- struct __res_state *,
- void (*)(void *));
-
-static struct group * get_hes_group(struct irs_gr *this,
- const char *name,
- const char *type);
-
-/* Public. */
-
-struct irs_gr *
-irs_dns_gr(struct irs_acc *this) {
- struct dns_p *dns = (struct dns_p *)this->private;
- struct irs_gr *gr;
- struct pvt *pvt;
-
- if (!dns || !dns->hes_ctx) {
- errno = ENODEV;
- return (NULL);
- }
- if (!(pvt = memget(sizeof *pvt))) {
- errno = ENOMEM;
- return (NULL);
- }
- memset(pvt, 0, sizeof *pvt);
- pvt->dns = dns;
- if (!(gr = memget(sizeof *gr))) {
- memput(pvt, sizeof *pvt);
- errno = ENOMEM;
- return (NULL);
- }
- memset(gr, 0x5e, sizeof *gr);
- gr->private = pvt;
- gr->next = gr_next;
- gr->byname = gr_byname;
- gr->bygid = gr_bygid;
- gr->rewind = gr_rewind;
- gr->close = gr_close;
- gr->list = gr_list;
- gr->minimize = gr_minimize;
- gr->res_get = gr_res_get;
- gr->res_set = gr_res_set;
- return (gr);
-}
-
-/* methods */
-
-static void
-gr_close(struct irs_gr *this) {
- struct pvt *pvt = (struct pvt *)this->private;
-
- if (pvt->group.gr_mem)
- free(pvt->group.gr_mem);
- if (pvt->membuf)
- free(pvt->membuf);
- memput(pvt, sizeof *pvt);
- memput(this, sizeof *this);
-}
-
-static struct group *
-gr_next(struct irs_gr *this) {
-
- UNUSED(this);
-
- return (NULL);
-}
-
-static struct group *
-gr_byname(struct irs_gr *this, const char *name) {
- return (get_hes_group(this, name, "group"));
-}
-
-static struct group *
-gr_bygid(struct irs_gr *this, gid_t gid) {
- char name[32];
-
- sprintf(name, "%ld", (long)gid);
- return (get_hes_group(this, name, "gid"));
-}
-
-static void
-gr_rewind(struct irs_gr *this) {
-
- UNUSED(this);
-
- /* NOOP */
-}
-
-static int
-gr_list(struct irs_gr *this, const char *name,
- gid_t basegid, gid_t *groups, int *ngroups)
-{
- UNUSED(this);
- UNUSED(name);
- UNUSED(basegid);
- UNUSED(groups);
-
- *ngroups = 0;
- /* There's some way to do this in Hesiod. */
- return (-1);
-}
-
-static void
-gr_minimize(struct irs_gr *this) {
-
- UNUSED(this);
- /* NOOP */
-}
-
-/* Private. */
-
-static struct group *
-get_hes_group(struct irs_gr *this, const char *name, const char *type) {
- struct pvt *pvt = (struct pvt *)this->private;
- char **hes_list, *cp, **new;
- size_t num_members = 0;
- u_long t;
-
- hes_list = hesiod_resolve(pvt->dns->hes_ctx, name, type);
- if (!hes_list)
- return (NULL);
-
- /*
- * Copy the returned hesiod string into storage space.
- */
- if (pvt->membuf)
- free(pvt->membuf);
- pvt->membuf = strdup(*hes_list);
- hesiod_free_list(pvt->dns->hes_ctx, hes_list);
-
- cp = pvt->membuf;
- pvt->group.gr_name = cp;
- if (!(cp = strchr(cp, ':')))
- goto cleanup;
- *cp++ = '\0';
-
- pvt->group.gr_passwd = cp;
- if (!(cp = strchr(cp, ':')))
- goto cleanup;
- *cp++ = '\0';
-
- errno = 0;
- t = strtoul(cp, NULL, 10);
- if (errno == ERANGE)
- goto cleanup;
- pvt->group.gr_gid = (gid_t) t;
- if (!(cp = strchr(cp, ':')))
- goto cleanup;
- cp++;
-
- /*
- * Parse the members out.
- */
- while (*cp) {
- if (num_members+1 >= pvt->nmemb || pvt->group.gr_mem == NULL) {
- pvt->nmemb += 10;
- new = realloc(pvt->group.gr_mem,
- pvt->nmemb * sizeof(char *));
- if (new == NULL)
- goto cleanup;
- pvt->group.gr_mem = new;
- }
- pvt->group.gr_mem[num_members++] = cp;
- if (!(cp = strchr(cp, ',')))
- break;
- *cp++ = '\0';
- }
- if (!pvt->group.gr_mem) {
- pvt->group.gr_mem = malloc(sizeof(char*));
- if (!pvt->group.gr_mem)
- goto cleanup;
- }
- pvt->group.gr_mem[num_members] = NULL;
-
- return (&pvt->group);
-
- cleanup:
- if (pvt->group.gr_mem) {
- free(pvt->group.gr_mem);
- pvt->group.gr_mem = NULL;
- }
- if (pvt->membuf) {
- free(pvt->membuf);
- pvt->membuf = NULL;
- }
- return (NULL);
-}
-
-static struct __res_state *
-gr_res_get(struct irs_gr *this) {
- struct pvt *pvt = (struct pvt *)this->private;
- struct dns_p *dns = pvt->dns;
-
- return (__hesiod_res_get(dns->hes_ctx));
-}
-
-static void
-gr_res_set(struct irs_gr *this, struct __res_state * res,
- void (*free_res)(void *)) {
- struct pvt *pvt = (struct pvt *)this->private;
- struct dns_p *dns = pvt->dns;
-
- __hesiod_res_set(dns->hes_ctx, res, free_res);
-}
-
-#endif /* WANT_IRS_GR */
diff --git a/lib/bind/irs/dns_ho.c b/lib/bind/irs/dns_ho.c
deleted file mode 100644
index db7ff02c9c55..000000000000
--- a/lib/bind/irs/dns_ho.c
+++ /dev/null
@@ -1,1143 +0,0 @@
-/*
- * Copyright (c) 1985, 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.
- */
-
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * Portions Copyright (c) 1996-1999 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-/* from gethostnamadr.c 8.1 (Berkeley) 6/4/93 */
-/* BIND Id: gethnamaddr.c,v 8.15 1996/05/22 04:56:30 vixie Exp $ */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: dns_ho.c,v 1.14.18.8 2008/09/24 05:59:50 marka Exp $";
-#endif /* LIBC_SCCS and not lint */
-
-/* Imports. */
-
-#include "port_before.h"
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-
-#include <ctype.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <string.h>
-#include <syslog.h>
-
-#include <isc/memcluster.h>
-#include <irs.h>
-
-#include "port_after.h"
-
-#include "irs_p.h"
-#include "dns_p.h"
-
-#ifdef SPRINTF_CHAR
-# define SPRINTF(x) strlen(sprintf/**/x)
-#else
-# define SPRINTF(x) sprintf x
-#endif
-
-/* Definitions. */
-
-#define MAXALIASES 35
-#define MAXADDRS 35
-
-#define MAXPACKET (65535) /*%< Maximum TCP message size */
-#define BOUNDS_CHECK(ptr, count) \
- if ((ptr) + (count) > eom) { \
- had_error++; \
- continue; \
- } else (void)0
-
-typedef union {
- HEADER hdr;
- u_char buf[MAXPACKET];
-} querybuf;
-
-struct dns_res_target {
- struct dns_res_target *next;
- querybuf qbuf; /*%< query buffer */
- u_char *answer; /*%< buffer to put answer */
- int anslen; /*%< size of answer buffer */
- int qclass, qtype; /*%< class and type of query */
- int action; /*%< condition whether query is really issued */
- char qname[MAXDNAME +1]; /*%< domain name */
-#if 0
- int n; /*%< result length */
-#endif
-};
-enum {RESTGT_DOALWAYS, RESTGT_AFTERFAILURE, RESTGT_IGNORE};
-enum {RESQRY_SUCCESS, RESQRY_FAIL};
-
-struct pvt {
- struct hostent host;
- char * h_addr_ptrs[MAXADDRS + 1];
- char * host_aliases[MAXALIASES];
- char hostbuf[8*1024];
- u_char host_addr[16]; /*%< IPv4 or IPv6 */
- struct __res_state *res;
- void (*free_res)(void *);
-};
-
-typedef union {
- int32_t al;
- char ac;
-} align;
-
-static const u_char mapped[] = { 0,0, 0,0, 0,0, 0,0, 0,0, 0xff,0xff };
-static const u_char tunnelled[] = { 0,0, 0,0, 0,0, 0,0, 0,0, 0,0 };
-/* Note: the IPv6 loopback address is in the "tunnel" space */
-static const u_char v6local[] = { 0,0, 0,1 }; /*%< last 4 bytes of IPv6 addr */
-/* Forwards. */
-
-static void ho_close(struct irs_ho *this);
-static struct hostent * ho_byname(struct irs_ho *this, const char *name);
-static struct hostent * ho_byname2(struct irs_ho *this, const char *name,
- int af);
-static struct hostent * ho_byaddr(struct irs_ho *this, const void *addr,
- int len, int af);
-static struct hostent * ho_next(struct irs_ho *this);
-static void ho_rewind(struct irs_ho *this);
-static void ho_minimize(struct irs_ho *this);
-static struct __res_state * ho_res_get(struct irs_ho *this);
-static void ho_res_set(struct irs_ho *this,
- struct __res_state *res,
- void (*free_res)(void *));
-static struct addrinfo * ho_addrinfo(struct irs_ho *this, const char *name,
- const struct addrinfo *pai);
-
-static void map_v4v6_hostent(struct hostent *hp, char **bp,
- char *ep);
-static void addrsort(res_state, char **, int);
-static struct hostent * gethostans(struct irs_ho *this,
- const u_char *ansbuf, int anslen,
- const char *qname, int qtype,
- int af, int size,
- struct addrinfo **ret_aip,
- const struct addrinfo *pai);
-static int add_hostent(struct pvt *pvt, char *bp, char **hap,
- struct addrinfo *ai);
-static int init(struct irs_ho *this);
-
-/* Exports. */
-
-struct irs_ho *
-irs_dns_ho(struct irs_acc *this) {
- struct irs_ho *ho;
- struct pvt *pvt;
-
- UNUSED(this);
-
- if (!(pvt = memget(sizeof *pvt))) {
- errno = ENOMEM;
- return (NULL);
- }
- memset(pvt, 0, sizeof *pvt);
-
- if (!(ho = memget(sizeof *ho))) {
- memput(pvt, sizeof *pvt);
- errno = ENOMEM;
- return (NULL);
- }
- memset(ho, 0x5e, sizeof *ho);
- ho->private = pvt;
- ho->close = ho_close;
- ho->byname = ho_byname;
- ho->byname2 = ho_byname2;
- ho->byaddr = ho_byaddr;
- ho->next = ho_next;
- ho->rewind = ho_rewind;
- ho->minimize = ho_minimize;
- ho->res_get = ho_res_get;
- ho->res_set = ho_res_set;
- ho->addrinfo = ho_addrinfo;
- return (ho);
-}
-
-/* Methods. */
-
-static void
-ho_close(struct irs_ho *this) {
- struct pvt *pvt = (struct pvt *)this->private;
-
- ho_minimize(this);
- if (pvt->res && pvt->free_res)
- (*pvt->free_res)(pvt->res);
- memput(pvt, sizeof *pvt);
- memput(this, sizeof *this);
-}
-
-static struct hostent *
-ho_byname(struct irs_ho *this, const char *name) {
- struct pvt *pvt = (struct pvt *)this->private;
- struct hostent *hp;
-
- if (init(this) == -1)
- return (NULL);
-
- if (pvt->res->options & RES_USE_INET6) {
- hp = ho_byname2(this, name, AF_INET6);
- if (hp)
- return (hp);
- }
- return (ho_byname2(this, name, AF_INET));
-}
-
-static struct hostent *
-ho_byname2(struct irs_ho *this, const char *name, int af)
-{
- struct pvt *pvt = (struct pvt *)this->private;
- struct hostent *hp = NULL;
- int n, size;
- char tmp[NS_MAXDNAME];
- const char *cp;
- struct addrinfo ai;
- struct dns_res_target *q, *p;
- int querystate = RESQRY_FAIL;
-
- if (init(this) == -1)
- return (NULL);
-
- q = memget(sizeof(*q));
- if (q == NULL) {
- RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
- errno = ENOMEM;
- goto cleanup;
- }
- memset(q, 0, sizeof(*q));
-
- switch (af) {
- case AF_INET:
- size = INADDRSZ;
- q->qclass = C_IN;
- q->qtype = T_A;
- q->answer = q->qbuf.buf;
- q->anslen = sizeof(q->qbuf);
- q->action = RESTGT_DOALWAYS;
- break;
- case AF_INET6:
- size = IN6ADDRSZ;
- q->qclass = C_IN;
- q->qtype = T_AAAA;
- q->answer = q->qbuf.buf;
- q->anslen = sizeof(q->qbuf);
- q->action = RESTGT_DOALWAYS;
- break;
- default:
- RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
- errno = EAFNOSUPPORT;
- hp = NULL;
- goto cleanup;
- }
-
- /*
- * if there aren't any dots, it could be a user-level alias.
- * this is also done in res_nquery() since we are not the only
- * function that looks up host names.
- */
- if (!strchr(name, '.') && (cp = res_hostalias(pvt->res, name,
- tmp, sizeof tmp)))
- name = cp;
-
- for (p = q; p; p = p->next) {
- switch(p->action) {
- case RESTGT_DOALWAYS:
- break;
- case RESTGT_AFTERFAILURE:
- if (querystate == RESQRY_SUCCESS)
- continue;
- break;
- case RESTGT_IGNORE:
- continue;
- }
-
- if ((n = res_nsearch(pvt->res, name, p->qclass, p->qtype,
- p->answer, p->anslen)) < 0) {
- querystate = RESQRY_FAIL;
- continue;
- }
-
- memset(&ai, 0, sizeof(ai));
- ai.ai_family = af;
- if ((hp = gethostans(this, p->answer, n, name, p->qtype,
- af, size, NULL,
- (const struct addrinfo *)&ai)) != NULL)
- goto cleanup; /*%< no more loop is necessary */
- querystate = RESQRY_FAIL;
- continue;
- }
-
- cleanup:
- if (q != NULL)
- memput(q, sizeof(*q));
- return(hp);
-}
-
-static struct hostent *
-ho_byaddr(struct irs_ho *this, const void *addr, int len, int af)
-{
- struct pvt *pvt = (struct pvt *)this->private;
- const u_char *uaddr = addr;
- char *qp;
- struct hostent *hp = NULL;
- struct addrinfo ai;
- struct dns_res_target *q, *q2, *p;
- int n, size, i;
- int querystate = RESQRY_FAIL;
-
- if (init(this) == -1)
- return (NULL);
-
- q = memget(sizeof(*q));
- q2 = memget(sizeof(*q2));
- if (q == NULL || q2 == NULL) {
- RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
- errno = ENOMEM;
- goto cleanup;
- }
- memset(q, 0, sizeof(*q));
- memset(q2, 0, sizeof(*q2));
-
- if (af == AF_INET6 && len == IN6ADDRSZ &&
- (!memcmp(uaddr, mapped, sizeof mapped) ||
- (!memcmp(uaddr, tunnelled, sizeof tunnelled) &&
- memcmp(&uaddr[sizeof tunnelled], v6local, sizeof(v6local))))) {
- /* Unmap. */
- addr = (const char *)addr + sizeof mapped;
- uaddr += sizeof mapped;
- af = AF_INET;
- len = INADDRSZ;
- }
- switch (af) {
- case AF_INET:
- size = INADDRSZ;
- q->qclass = C_IN;
- q->qtype = T_PTR;
- q->answer = q->qbuf.buf;
- q->anslen = sizeof(q->qbuf);
- q->action = RESTGT_DOALWAYS;
- break;
- case AF_INET6:
- size = IN6ADDRSZ;
- q->qclass = C_IN;
- q->qtype = T_PTR;
- q->answer = q->qbuf.buf;
- q->anslen = sizeof(q->qbuf);
- q->next = q2;
- q->action = RESTGT_DOALWAYS;
- q2->qclass = C_IN;
- q2->qtype = T_PTR;
- q2->answer = q2->qbuf.buf;
- q2->anslen = sizeof(q2->qbuf);
- if ((pvt->res->options & RES_NO_NIBBLE2) != 0U)
- q2->action = RESTGT_IGNORE;
- else
- q2->action = RESTGT_AFTERFAILURE;
- break;
- default:
- errno = EAFNOSUPPORT;
- RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
- hp = NULL;
- goto cleanup;
- }
- if (size > len) {
- errno = EINVAL;
- RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
- hp = NULL;
- goto cleanup;
- }
- switch (af) {
- case AF_INET:
- qp = q->qname;
- (void) sprintf(qp, "%u.%u.%u.%u.in-addr.arpa",
- (uaddr[3] & 0xff),
- (uaddr[2] & 0xff),
- (uaddr[1] & 0xff),
- (uaddr[0] & 0xff));
- break;
- case AF_INET6:
- if (q->action != RESTGT_IGNORE) {
- const char *nibsuff = res_get_nibblesuffix(pvt->res);
- qp = q->qname;
- for (n = IN6ADDRSZ - 1; n >= 0; n--) {
- i = SPRINTF((qp, "%x.%x.",
- uaddr[n] & 0xf,
- (uaddr[n] >> 4) & 0xf));
- if (i != 4)
- abort();
- qp += i;
- }
- if (strlen(q->qname) + strlen(nibsuff) + 1 >
- sizeof q->qname) {
- errno = ENAMETOOLONG;
- RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
- hp = NULL;
- goto cleanup;
- }
- strcpy(qp, nibsuff); /* (checked) */
- }
- if (q2->action != RESTGT_IGNORE) {
- const char *nibsuff2 = res_get_nibblesuffix2(pvt->res);
- qp = q2->qname;
- for (n = IN6ADDRSZ - 1; n >= 0; n--) {
- i = SPRINTF((qp, "%x.%x.",
- uaddr[n] & 0xf,
- (uaddr[n] >> 4) & 0xf));
- if (i != 4)
- abort();
- qp += i;
- }
- if (strlen(q2->qname) + strlen(nibsuff2) + 1 >
- sizeof q2->qname) {
- errno = ENAMETOOLONG;
- RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
- hp = NULL;
- goto cleanup;
- }
- strcpy(qp, nibsuff2); /* (checked) */
- }
- break;
- default:
- abort();
- }
-
- for (p = q; p; p = p->next) {
- switch(p->action) {
- case RESTGT_DOALWAYS:
- break;
- case RESTGT_AFTERFAILURE:
- if (querystate == RESQRY_SUCCESS)
- continue;
- break;
- case RESTGT_IGNORE:
- continue;
- }
-
- if ((n = res_nquery(pvt->res, p->qname, p->qclass, p->qtype,
- p->answer, p->anslen)) < 0) {
- querystate = RESQRY_FAIL;
- continue;
- }
-
- memset(&ai, 0, sizeof(ai));
- ai.ai_family = af;
- hp = gethostans(this, p->answer, n, p->qname, T_PTR, af, size,
- NULL, (const struct addrinfo *)&ai);
- if (!hp) {
- querystate = RESQRY_FAIL;
- continue;
- }
-
- memcpy(pvt->host_addr, addr, len);
- pvt->h_addr_ptrs[0] = (char *)pvt->host_addr;
- pvt->h_addr_ptrs[1] = NULL;
- if (af == AF_INET && (pvt->res->options & RES_USE_INET6)) {
- map_v4v6_address((char*)pvt->host_addr,
- (char*)pvt->host_addr);
- pvt->host.h_addrtype = AF_INET6;
- pvt->host.h_length = IN6ADDRSZ;
- }
-
- RES_SET_H_ERRNO(pvt->res, NETDB_SUCCESS);
- goto cleanup; /*%< no more loop is necessary. */
- }
- hp = NULL; /*%< H_ERRNO was set by subroutines */
- cleanup:
- if (q != NULL)
- memput(q, sizeof(*q));
- if (q2 != NULL)
- memput(q2, sizeof(*q2));
- return(hp);
-}
-
-static struct hostent *
-ho_next(struct irs_ho *this) {
-
- UNUSED(this);
-
- return (NULL);
-}
-
-static void
-ho_rewind(struct irs_ho *this) {
-
- UNUSED(this);
-
- /* NOOP */
-}
-
-static void
-ho_minimize(struct irs_ho *this) {
- struct pvt *pvt = (struct pvt *)this->private;
-
- if (pvt->res)
- res_nclose(pvt->res);
-}
-
-static struct __res_state *
-ho_res_get(struct irs_ho *this) {
- struct pvt *pvt = (struct pvt *)this->private;
-
- if (!pvt->res) {
- struct __res_state *res;
- res = (struct __res_state *)malloc(sizeof *res);
- if (!res) {
- errno = ENOMEM;
- return (NULL);
- }
- memset(res, 0, sizeof *res);
- ho_res_set(this, res, free);
- }
-
- return (pvt->res);
-}
-
-/* XXX */
-extern struct addrinfo *addr2addrinfo __P((const struct addrinfo *,
- const char *));
-
-static struct addrinfo *
-ho_addrinfo(struct irs_ho *this, const char *name, const struct addrinfo *pai)
-{
- struct pvt *pvt = (struct pvt *)this->private;
- int n;
- char tmp[NS_MAXDNAME];
- const char *cp;
- struct dns_res_target *q, *q2, *p;
- struct addrinfo sentinel, *cur;
- int querystate = RESQRY_FAIL;
-
- if (init(this) == -1)
- return (NULL);
-
- memset(&sentinel, 0, sizeof(sentinel));
- cur = &sentinel;
-
- q = memget(sizeof(*q));
- q2 = memget(sizeof(*q2));
- if (q == NULL || q2 == NULL) {
- RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
- errno = ENOMEM;
- goto cleanup;
- }
- memset(q, 0, sizeof(*q2));
- memset(q2, 0, sizeof(*q2));
-
- switch (pai->ai_family) {
- case AF_UNSPEC:
- /* prefer IPv6 */
- q->qclass = C_IN;
- q->qtype = T_AAAA;
- q->answer = q->qbuf.buf;
- q->anslen = sizeof(q->qbuf);
- q->next = q2;
- q->action = RESTGT_DOALWAYS;
- q2->qclass = C_IN;
- q2->qtype = T_A;
- q2->answer = q2->qbuf.buf;
- q2->anslen = sizeof(q2->qbuf);
- q2->action = RESTGT_DOALWAYS;
- break;
- case AF_INET:
- q->qclass = C_IN;
- q->qtype = T_A;
- q->answer = q->qbuf.buf;
- q->anslen = sizeof(q->qbuf);
- q->action = RESTGT_DOALWAYS;
- break;
- case AF_INET6:
- q->qclass = C_IN;
- q->qtype = T_AAAA;
- q->answer = q->qbuf.buf;
- q->anslen = sizeof(q->qbuf);
- q->action = RESTGT_DOALWAYS;
- break;
- default:
- RES_SET_H_ERRNO(pvt->res, NO_RECOVERY); /*%< better error? */
- goto cleanup;
- }
-
- /*
- * if there aren't any dots, it could be a user-level alias.
- * this is also done in res_nquery() since we are not the only
- * function that looks up host names.
- */
- if (!strchr(name, '.') && (cp = res_hostalias(pvt->res, name,
- tmp, sizeof tmp)))
- name = cp;
-
- for (p = q; p; p = p->next) {
- struct addrinfo *ai;
-
- switch(p->action) {
- case RESTGT_DOALWAYS:
- break;
- case RESTGT_AFTERFAILURE:
- if (querystate == RESQRY_SUCCESS)
- continue;
- break;
- case RESTGT_IGNORE:
- continue;
- }
-
- if ((n = res_nsearch(pvt->res, name, p->qclass, p->qtype,
- p->answer, p->anslen)) < 0) {
- querystate = RESQRY_FAIL;
- continue;
- }
- (void)gethostans(this, p->answer, n, name, p->qtype,
- pai->ai_family, /*%< XXX: meaningless */
- 0, &ai, pai);
- if (ai) {
- querystate = RESQRY_SUCCESS;
- cur->ai_next = ai;
- while (cur->ai_next)
- cur = cur->ai_next;
- } else
- querystate = RESQRY_FAIL;
- }
-
- cleanup:
- if (q != NULL)
- memput(q, sizeof(*q));
- if (q2 != NULL)
- memput(q2, sizeof(*q2));
- return(sentinel.ai_next);
-}
-
-static void
-ho_res_set(struct irs_ho *this, struct __res_state *res,
- void (*free_res)(void *)) {
- struct pvt *pvt = (struct pvt *)this->private;
-
- if (pvt->res && pvt->free_res) {
- res_nclose(pvt->res);
- (*pvt->free_res)(pvt->res);
- }
-
- pvt->res = res;
- pvt->free_res = free_res;
-}
-
-/* Private. */
-
-static struct hostent *
-gethostans(struct irs_ho *this,
- const u_char *ansbuf, int anslen, const char *qname, int qtype,
- int af, int size, /*!< meaningless for addrinfo cases */
- struct addrinfo **ret_aip, const struct addrinfo *pai)
-{
- struct pvt *pvt = (struct pvt *)this->private;
- int type, class, ancount, qdcount, n, haveanswer, had_error;
- int error = NETDB_SUCCESS;
- int (*name_ok)(const char *);
- const HEADER *hp;
- const u_char *eom;
- const u_char *eor;
- const u_char *cp;
- const char *tname;
- const char *hname;
- char *bp, *ep, **ap, **hap;
- char tbuf[MAXDNAME+1];
- struct addrinfo sentinel, *cur, ai;
-
- if (pai == NULL) abort();
- if (ret_aip != NULL)
- *ret_aip = NULL;
- memset(&sentinel, 0, sizeof(sentinel));
- cur = &sentinel;
-
- tname = qname;
- eom = ansbuf + anslen;
- switch (qtype) {
- case T_A:
- case T_AAAA:
- case T_ANY: /*%< use T_ANY only for T_A/T_AAAA lookup */
- name_ok = res_hnok;
- break;
- case T_PTR:
- name_ok = res_dnok;
- break;
- default:
- abort();
- }
-
- pvt->host.h_addrtype = af;
- pvt->host.h_length = size;
- hname = pvt->host.h_name = NULL;
-
- /*
- * Find first satisfactory answer.
- */
- if (ansbuf + HFIXEDSZ > eom) {
- RES_SET_H_ERRNO(pvt->res, NO_RECOVERY);
- return (NULL);
- }
- hp = (const HEADER *)ansbuf;
- ancount = ntohs(hp->ancount);
- qdcount = ntohs(hp->qdcount);
- bp = pvt->hostbuf;
- ep = pvt->hostbuf + sizeof(pvt->hostbuf);
- cp = ansbuf + HFIXEDSZ;
- if (qdcount != 1) {
- RES_SET_H_ERRNO(pvt->res, NO_RECOVERY);
- return (NULL);
- }
- n = dn_expand(ansbuf, eom, cp, bp, ep - bp);
- if (n < 0 || !maybe_ok(pvt->res, bp, name_ok)) {
- RES_SET_H_ERRNO(pvt->res, NO_RECOVERY);
- return (NULL);
- }
- cp += n + QFIXEDSZ;
- if (cp > eom) {
- RES_SET_H_ERRNO(pvt->res, NO_RECOVERY);
- return (NULL);
- }
- if (qtype == T_A || qtype == T_AAAA || qtype == T_ANY) {
- /* res_nsend() has already verified that the query name is the
- * same as the one we sent; this just gets the expanded name
- * (i.e., with the succeeding search-domain tacked on).
- */
- n = strlen(bp) + 1; /*%< for the \\0 */
- if (n > MAXHOSTNAMELEN) {
- RES_SET_H_ERRNO(pvt->res, NO_RECOVERY);
- return (NULL);
- }
- pvt->host.h_name = bp;
- hname = bp;
- bp += n;
- /* The qname can be abbreviated, but hname is now absolute. */
- qname = pvt->host.h_name;
- }
- ap = pvt->host_aliases;
- *ap = NULL;
- pvt->host.h_aliases = pvt->host_aliases;
- hap = pvt->h_addr_ptrs;
- *hap = NULL;
- pvt->host.h_addr_list = pvt->h_addr_ptrs;
- haveanswer = 0;
- had_error = 0;
- while (ancount-- > 0 && cp < eom && !had_error) {
- n = dn_expand(ansbuf, eom, cp, bp, ep - bp);
- if (n < 0 || !maybe_ok(pvt->res, bp, name_ok)) {
- had_error++;
- continue;
- }
- cp += n; /*%< name */
- BOUNDS_CHECK(cp, 3 * INT16SZ + INT32SZ);
- type = ns_get16(cp);
- cp += INT16SZ; /*%< type */
- class = ns_get16(cp);
- cp += INT16SZ + INT32SZ; /*%< class, TTL */
- n = ns_get16(cp);
- cp += INT16SZ; /*%< len */
- BOUNDS_CHECK(cp, n);
- if (class != C_IN) {
- cp += n;
- continue;
- }
- eor = cp + n;
- if ((qtype == T_A || qtype == T_AAAA || qtype == T_ANY) &&
- type == T_CNAME) {
- if (haveanswer) {
- int level = LOG_CRIT;
-#ifdef LOG_SECURITY
- level |= LOG_SECURITY;
-#endif
- syslog(level,
- "gethostans: possible attempt to exploit buffer overflow while looking up %s",
- *qname ? qname : ".");
- }
- n = dn_expand(ansbuf, eor, cp, tbuf, sizeof tbuf);
- if (n < 0 || !maybe_ok(pvt->res, tbuf, name_ok)) {
- had_error++;
- continue;
- }
- cp += n;
- /* Store alias. */
- if (ap >= &pvt->host_aliases[MAXALIASES-1])
- continue;
- *ap++ = bp;
- n = strlen(bp) + 1; /*%< for the \\0 */
- bp += n;
- /* Get canonical name. */
- n = strlen(tbuf) + 1; /*%< for the \\0 */
- if (n > (ep - bp) || n > MAXHOSTNAMELEN) {
- had_error++;
- continue;
- }
- strcpy(bp, tbuf); /* (checked) */
- pvt->host.h_name = bp;
- hname = bp;
- bp += n;
- continue;
- }
- if (qtype == T_PTR && type == T_CNAME) {
- n = dn_expand(ansbuf, eor, cp, tbuf, sizeof tbuf);
- if (n < 0 || !maybe_dnok(pvt->res, tbuf)) {
- had_error++;
- continue;
- }
- cp += n;
-#ifdef RES_USE_DNAME
- if ((pvt->res->options & RES_USE_DNAME) != 0U)
-#endif
- {
- /*
- * We may be able to check this regardless
- * of the USE_DNAME bit, but we add the check
- * for now since the DNAME support is
- * experimental.
- */
- if (ns_samename(tname, bp) != 1)
- continue;
- }
- /* Get canonical name. */
- n = strlen(tbuf) + 1; /*%< for the \\0 */
- if (n > (ep - bp)) {
- had_error++;
- continue;
- }
- strcpy(bp, tbuf); /* (checked) */
- tname = bp;
- bp += n;
- continue;
- }
- if (qtype == T_ANY) {
- if (!(type == T_A || type == T_AAAA)) {
- cp += n;
- continue;
- }
- } else if (type != qtype) {
- cp += n;
- continue;
- }
- switch (type) {
- case T_PTR:
- if (ret_aip != NULL) {
- /* addrinfo never needs T_PTR */
- cp += n;
- continue;
- }
- if (ns_samename(tname, bp) != 1) {
- cp += n;
- continue;
- }
- n = dn_expand(ansbuf, eor, cp, bp, ep - bp);
- if (n < 0 || !maybe_hnok(pvt->res, bp) ||
- n >= MAXHOSTNAMELEN) {
- had_error++;
- break;
- }
- cp += n;
- if (!haveanswer) {
- pvt->host.h_name = bp;
- hname = bp;
- }
- else if (ap < &pvt->host_aliases[MAXALIASES-1])
- *ap++ = bp;
- else
- n = -1;
- if (n != -1) {
- n = strlen(bp) + 1; /*%< for the \\0 */
- bp += n;
- }
- break;
- case T_A:
- case T_AAAA:
- if (ns_samename(hname, bp) != 1) {
- cp += n;
- continue;
- }
- if (type == T_A && n != INADDRSZ) {
- cp += n;
- continue;
- }
- if (type == T_AAAA && n != IN6ADDRSZ) {
- cp += n;
- continue;
- }
-
- /* make addrinfo. don't overwrite constant PAI */
- ai = *pai;
- ai.ai_family = (type == T_AAAA) ? AF_INET6 : AF_INET;
- cur->ai_next = addr2addrinfo(
- (const struct addrinfo *)&ai,
- (const char *)cp);
- if (cur->ai_next == NULL)
- had_error++;
-
- if (!haveanswer) {
- int nn;
-
- nn = strlen(bp) + 1; /*%< for the \\0 */
- if (nn >= MAXHOSTNAMELEN) {
- cp += n;
- had_error++;
- continue;
- }
- pvt->host.h_name = bp;
- hname = bp;
- bp += nn;
- }
- /* Ensure alignment. */
- bp = (char *)(((u_long)bp + (sizeof(align) - 1)) &
- ~(sizeof(align) - 1));
- /* Avoid overflows. */
- if (bp + n > &pvt->hostbuf[sizeof(pvt->hostbuf) - 1]) {
- had_error++;
- continue;
- }
- if (ret_aip) { /*%< need addrinfo. keep it. */
- while (cur->ai_next)
- cur = cur->ai_next;
- } else if (cur->ai_next) { /*%< need hostent */
- struct addrinfo *aip = cur->ai_next;
-
- for (aip = cur->ai_next; aip;
- aip = aip->ai_next) {
- int m;
-
- m = add_hostent(pvt, bp, hap, aip);
- if (m < 0) {
- had_error++;
- break;
- }
- if (m == 0)
- continue;
- if (hap < &pvt->h_addr_ptrs[MAXADDRS])
- hap++;
- *hap = NULL;
- bp += m;
- }
-
- freeaddrinfo(cur->ai_next);
- cur->ai_next = NULL;
- }
- cp += n;
- break;
- default:
- abort();
- }
- if (!had_error)
- haveanswer++;
- }
- if (haveanswer) {
- if (ret_aip == NULL) {
- *ap = NULL;
- *hap = NULL;
-
- if (pvt->res->nsort && hap != pvt->h_addr_ptrs &&
- qtype == T_A)
- addrsort(pvt->res, pvt->h_addr_ptrs,
- hap - pvt->h_addr_ptrs);
- if (pvt->host.h_name == NULL) {
- n = strlen(qname) + 1; /*%< for the \\0 */
- if (n > (ep - bp) || n >= MAXHOSTNAMELEN)
- goto no_recovery;
- strcpy(bp, qname); /* (checked) */
- pvt->host.h_name = bp;
- bp += n;
- }
- if (pvt->res->options & RES_USE_INET6)
- map_v4v6_hostent(&pvt->host, &bp, ep);
- RES_SET_H_ERRNO(pvt->res, NETDB_SUCCESS);
- return (&pvt->host);
- } else {
- if ((pai->ai_flags & AI_CANONNAME) != 0) {
- if (pvt->host.h_name == NULL) {
- sentinel.ai_next->ai_canonname =
- strdup(qname);
- }
- else {
- sentinel.ai_next->ai_canonname =
- strdup(pvt->host.h_name);
- }
- }
- *ret_aip = sentinel.ai_next;
- return(NULL);
- }
- }
- no_recovery:
- if (sentinel.ai_next) {
- /* this should be impossible, but check it for safety */
- freeaddrinfo(sentinel.ai_next);
- }
- if (error == NETDB_SUCCESS)
- RES_SET_H_ERRNO(pvt->res, NO_RECOVERY);
- else
- RES_SET_H_ERRNO(pvt->res, error);
- return(NULL);
-}
-
-static int
-add_hostent(struct pvt *pvt, char *bp, char **hap, struct addrinfo *ai)
-{
- int addrlen;
- char *addrp;
- const char **tap;
- char *obp = bp;
-
- switch(ai->ai_addr->sa_family) {
- case AF_INET6:
- addrlen = IN6ADDRSZ;
- addrp = (char *)&((struct sockaddr_in6 *)ai->ai_addr)->sin6_addr;
- break;
- case AF_INET:
- addrlen = INADDRSZ;
- addrp = (char *)&((struct sockaddr_in *)ai->ai_addr)->sin_addr;
- break;
- default:
- return(-1); /*%< abort? */
- }
-
- /* Ensure alignment. */
- bp = (char *)(((u_long)bp + (sizeof(align) - 1)) &
- ~(sizeof(align) - 1));
- /* Avoid overflows. */
- if (bp + addrlen > &pvt->hostbuf[sizeof(pvt->hostbuf) - 1])
- return(-1);
- if (hap >= &pvt->h_addr_ptrs[MAXADDRS])
- return(0); /*%< fail, but not treat it as an error. */
- /* Suppress duplicates. */
- for (tap = (const char **)pvt->h_addr_ptrs;
- *tap != NULL;
- tap++)
- if (memcmp(*tap, addrp, addrlen) == 0)
- break;
- if (*tap != NULL)
- return (0);
-
- memcpy(*hap = bp, addrp, addrlen);
- return((bp + addrlen) - obp);
-}
-
-static void
-map_v4v6_hostent(struct hostent *hp, char **bpp, char *ep) {
- char **ap;
-
- if (hp->h_addrtype != AF_INET || hp->h_length != INADDRSZ)
- return;
- hp->h_addrtype = AF_INET6;
- hp->h_length = IN6ADDRSZ;
- for (ap = hp->h_addr_list; *ap; ap++) {
- int i = (u_long)*bpp % sizeof(align);
-
- if (i != 0)
- i = sizeof(align) - i;
-
- if ((ep - *bpp) < (i + IN6ADDRSZ)) {
- /* Out of memory. Truncate address list here. */
- *ap = NULL;
- return;
- }
- *bpp += i;
- map_v4v6_address(*ap, *bpp);
- *ap = *bpp;
- *bpp += IN6ADDRSZ;
- }
-}
-
-static void
-addrsort(res_state statp, char **ap, int num) {
- int i, j, needsort = 0, aval[MAXADDRS];
- char **p;
-
- p = ap;
- for (i = 0; i < num; i++, p++) {
- for (j = 0 ; (unsigned)j < statp->nsort; j++)
- if (statp->sort_list[j].addr.s_addr ==
- (((struct in_addr *)(*p))->s_addr &
- statp->sort_list[j].mask))
- break;
- aval[i] = j;
- if (needsort == 0 && i > 0 && j < aval[i-1])
- needsort = i;
- }
- if (!needsort)
- return;
-
- while (needsort < num) {
- for (j = needsort - 1; j >= 0; j--) {
- if (aval[j] > aval[j+1]) {
- char *hp;
-
- i = aval[j];
- aval[j] = aval[j+1];
- aval[j+1] = i;
-
- hp = ap[j];
- ap[j] = ap[j+1];
- ap[j+1] = hp;
-
- } else
- break;
- }
- needsort++;
- }
-}
-
-static int
-init(struct irs_ho *this) {
- struct pvt *pvt = (struct pvt *)this->private;
-
- if (!pvt->res && !ho_res_get(this))
- return (-1);
- if (((pvt->res->options & RES_INIT) == 0U) &&
- res_ninit(pvt->res) == -1)
- return (-1);
- return (0);
-}
diff --git a/lib/bind/irs/dns_nw.c b/lib/bind/irs/dns_nw.c
deleted file mode 100644
index 1d03a52a7c38..000000000000
--- a/lib/bind/irs/dns_nw.c
+++ /dev/null
@@ -1,591 +0,0 @@
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * 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 ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: dns_nw.c,v 1.9.18.3 2005/04/27 05:00:55 sra Exp $";
-#endif /* LIBC_SCCS and not lint */
-
-/* Imports. */
-
-#include "port_before.h"
-
-#include <sys/param.h>
-#include <sys/socket.h>
-
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-
-#include <ctype.h>
-#include <errno.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <isc/memcluster.h>
-#include <irs.h>
-
-#include "port_after.h"
-
-#include "irs_p.h"
-#include "dns_p.h"
-
-#ifdef SPRINTF_CHAR
-# define SPRINTF(x) strlen(sprintf/**/x)
-#else
-# define SPRINTF(x) sprintf x
-#endif
-
-/* Definitions. */
-
-#define MAXALIASES 35
-
-#define MAXPACKET (64*1024)
-
-struct pvt {
- struct nwent net;
- char * ali[MAXALIASES];
- char buf[BUFSIZ+1];
- struct __res_state * res;
- void (*free_res)(void *);
-};
-
-typedef union {
- long al;
- char ac;
-} align;
-
-enum by_what { by_addr, by_name };
-
-/* Forwards. */
-
-static void nw_close(struct irs_nw *);
-static struct nwent * nw_byname(struct irs_nw *, const char *, int);
-static struct nwent * nw_byaddr(struct irs_nw *, void *, int, int);
-static struct nwent * nw_next(struct irs_nw *);
-static void nw_rewind(struct irs_nw *);
-static void nw_minimize(struct irs_nw *);
-static struct __res_state * nw_res_get(struct irs_nw *this);
-static void nw_res_set(struct irs_nw *this,
- struct __res_state *res,
- void (*free_res)(void *));
-
-static struct nwent * get1101byaddr(struct irs_nw *, u_char *, int);
-static struct nwent * get1101byname(struct irs_nw *, const char *);
-static struct nwent * get1101answer(struct irs_nw *,
- u_char *ansbuf, int anslen,
- enum by_what by_what,
- int af, const char *name,
- const u_char *addr, int addrlen);
-static struct nwent * get1101mask(struct irs_nw *this, struct nwent *);
-static int make1101inaddr(const u_char *, int, char *, int);
-static void normalize_name(char *name);
-static int init(struct irs_nw *this);
-
-/* Exports. */
-
-struct irs_nw *
-irs_dns_nw(struct irs_acc *this) {
- struct irs_nw *nw;
- struct pvt *pvt;
-
- UNUSED(this);
-
- if (!(pvt = memget(sizeof *pvt))) {
- errno = ENOMEM;
- return (NULL);
- }
- memset(pvt, 0, sizeof *pvt);
- if (!(nw = memget(sizeof *nw))) {
- memput(pvt, sizeof *pvt);
- errno = ENOMEM;
- return (NULL);
- }
- memset(nw, 0x5e, sizeof *nw);
- nw->private = pvt;
- nw->close = nw_close;
- nw->byname = nw_byname;
- nw->byaddr = nw_byaddr;
- nw->next = nw_next;
- nw->rewind = nw_rewind;
- nw->minimize = nw_minimize;
- nw->res_get = nw_res_get;
- nw->res_set = nw_res_set;
- return (nw);
-}
-
-/* Methods. */
-
-static void
-nw_close(struct irs_nw *this) {
- struct pvt *pvt = (struct pvt *)this->private;
-
- nw_minimize(this);
-
- if (pvt->res && pvt->free_res)
- (*pvt->free_res)(pvt->res);
-
- memput(pvt, sizeof *pvt);
- memput(this, sizeof *this);
-}
-
-static struct nwent *
-nw_byname(struct irs_nw *this, const char *name, int af) {
- struct pvt *pvt = (struct pvt *)this->private;
-
- if (init(this) == -1)
- return (NULL);
-
- switch (af) {
- case AF_INET:
- return (get1101byname(this, name));
- default:
- (void)NULL;
- }
- RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
- errno = EAFNOSUPPORT;
- return (NULL);
-}
-
-static struct nwent *
-nw_byaddr(struct irs_nw *this, void *net, int len, int af) {
- struct pvt *pvt = (struct pvt *)this->private;
-
- if (init(this) == -1)
- return (NULL);
-
- switch (af) {
- case AF_INET:
- return (get1101byaddr(this, net, len));
- default:
- (void)NULL;
- }
- RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
- errno = EAFNOSUPPORT;
- return (NULL);
-}
-
-static struct nwent *
-nw_next(struct irs_nw *this) {
-
- UNUSED(this);
-
- return (NULL);
-}
-
-static void
-nw_rewind(struct irs_nw *this) {
- UNUSED(this);
- /* NOOP */
-}
-
-static void
-nw_minimize(struct irs_nw *this) {
- struct pvt *pvt = (struct pvt *)this->private;
-
- if (pvt->res)
- res_nclose(pvt->res);
-}
-
-static struct __res_state *
-nw_res_get(struct irs_nw *this) {
- struct pvt *pvt = (struct pvt *)this->private;
-
- if (!pvt->res) {
- struct __res_state *res;
- res = (struct __res_state *)malloc(sizeof *res);
- if (!res) {
- errno = ENOMEM;
- return (NULL);
- }
- memset(res, 0, sizeof *res);
- nw_res_set(this, res, free);
- }
-
- return (pvt->res);
-}
-
-static void
-nw_res_set(struct irs_nw *this, struct __res_state *res,
- void (*free_res)(void *)) {
- struct pvt *pvt = (struct pvt *)this->private;
-
- if (pvt->res && pvt->free_res) {
- res_nclose(pvt->res);
- (*pvt->free_res)(pvt->res);
- }
-
- pvt->res = res;
- pvt->free_res = free_res;
-}
-
-/* Private. */
-
-static struct nwent *
-get1101byname(struct irs_nw *this, const char *name) {
- struct pvt *pvt = (struct pvt *)this->private;
- u_char *ansbuf;
- int anslen;
- struct nwent *result;
-
- ansbuf = memget(MAXPACKET);
- if (ansbuf == NULL) {
- errno = ENOMEM;
- RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
- return (NULL);
- }
- anslen = res_nsearch(pvt->res, name, C_IN, T_PTR, ansbuf, MAXPACKET);
- if (anslen < 0) {
- memput(ansbuf, MAXPACKET);
- return (NULL);
- }
- result = get1101mask(this, get1101answer(this, ansbuf, anslen, by_name,
- AF_INET, name, NULL, 0));
- memput(ansbuf, MAXPACKET);
- return (result);
-}
-
-static struct nwent *
-get1101byaddr(struct irs_nw *this, u_char *net, int len) {
- struct pvt *pvt = (struct pvt *)this->private;
- char qbuf[sizeof "255.255.255.255.in-addr.arpa"];
- struct nwent *result;
- u_char *ansbuf;
- int anslen;
-
- if (len < 1 || len > 32) {
- errno = EINVAL;
- RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
- return (NULL);
- }
- if (make1101inaddr(net, len, qbuf, sizeof qbuf) < 0)
- return (NULL);
- ansbuf = memget(MAXPACKET);
- if (ansbuf == NULL) {
- errno = ENOMEM;
- RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
- return (NULL);
- }
- anslen = res_nquery(pvt->res, qbuf, C_IN, T_PTR, ansbuf, MAXPACKET);
- if (anslen < 0) {
- memput(ansbuf, MAXPACKET);
- return (NULL);
- }
- result = get1101mask(this, get1101answer(this, ansbuf, anslen, by_addr,
- AF_INET, NULL, net, len));
- memput(ansbuf, MAXPACKET);
- return (result);
-}
-
-static struct nwent *
-get1101answer(struct irs_nw *this,
- u_char *ansbuf, int anslen, enum by_what by_what,
- int af, const char *name, const u_char *addr, int addrlen)
-{
- struct pvt *pvt = (struct pvt *)this->private;
- int type, class, ancount, qdcount, haveanswer;
- char *bp, *ep, **ap;
- u_char *cp, *eom;
- HEADER *hp;
-
- /* Initialize, and parse header. */
- eom = ansbuf + anslen;
- if (ansbuf + HFIXEDSZ > eom) {
- RES_SET_H_ERRNO(pvt->res, NO_RECOVERY);
- return (NULL);
- }
- hp = (HEADER *)ansbuf;
- cp = ansbuf + HFIXEDSZ;
- qdcount = ntohs(hp->qdcount);
- while (qdcount-- > 0) {
- int n = dn_skipname(cp, eom);
- cp += n + QFIXEDSZ;
- if (n < 0 || cp > eom) {
- RES_SET_H_ERRNO(pvt->res, NO_RECOVERY);
- return (NULL);
- }
- }
- ancount = ntohs(hp->ancount);
- if (!ancount) {
- if (hp->aa)
- RES_SET_H_ERRNO(pvt->res, HOST_NOT_FOUND);
- else
- RES_SET_H_ERRNO(pvt->res, TRY_AGAIN);
- return (NULL);
- }
-
- /* Prepare a return structure. */
- bp = pvt->buf;
- ep = pvt->buf + sizeof(pvt->buf);
- pvt->net.n_name = NULL;
- pvt->net.n_aliases = pvt->ali;
- pvt->net.n_addrtype = af;
- pvt->net.n_addr = NULL;
- pvt->net.n_length = addrlen;
-
- /* Save input key if given. */
- switch (by_what) {
- case by_name:
- if (name != NULL) {
- int n = strlen(name) + 1;
-
- if (n > (ep - bp)) {
- RES_SET_H_ERRNO(pvt->res, NO_RECOVERY);
- return (NULL);
- }
- pvt->net.n_name = strcpy(bp, name); /* (checked) */
- bp += n;
- }
- break;
- case by_addr:
- if (addr != NULL && addrlen != 0) {
- int n = addrlen / 8 + ((addrlen % 8) != 0);
-
- if (INADDRSZ > (ep - bp)) {
- RES_SET_H_ERRNO(pvt->res, NO_RECOVERY);
- return (NULL);
- }
- memset(bp, 0, INADDRSZ);
- memcpy(bp, addr, n);
- pvt->net.n_addr = bp;
- bp += INADDRSZ;
- }
- break;
- default:
- abort();
- }
-
- /* Parse the answer, collect aliases. */
- ap = pvt->ali;
- haveanswer = 0;
- while (--ancount >= 0 && cp < eom) {
- int n = dn_expand(ansbuf, eom, cp, bp, ep - bp);
-
- cp += n; /*%< Owner */
- if (n < 0 || !maybe_dnok(pvt->res, bp) ||
- cp + 3 * INT16SZ + INT32SZ > eom) {
- RES_SET_H_ERRNO(pvt->res, NO_RECOVERY);
- return (NULL);
- }
- GETSHORT(type, cp); /*%< Type */
- GETSHORT(class, cp); /*%< Class */
- cp += INT32SZ; /*%< TTL */
- GETSHORT(n, cp); /*%< RDLENGTH */
- if (class == C_IN && type == T_PTR) {
- int nn;
-
- nn = dn_expand(ansbuf, eom, cp, bp, ep - bp);
- if (nn < 0 || !maybe_hnok(pvt->res, bp) || nn != n) {
- RES_SET_H_ERRNO(pvt->res, NO_RECOVERY);
- return (NULL);
- }
- normalize_name(bp);
- switch (by_what) {
- case by_addr: {
- if (pvt->net.n_name == NULL)
- pvt->net.n_name = bp;
- else if (ns_samename(pvt->net.n_name, bp) == 1)
- break;
- else
- *ap++ = bp;
- nn = strlen(bp) + 1;
- bp += nn;
- haveanswer++;
- break;
- }
- case by_name: {
- u_int b1, b2, b3, b4;
-
- if (pvt->net.n_addr != NULL ||
- sscanf(bp, "%u.%u.%u.%u.in-addr.arpa",
- &b1, &b2, &b3, &b4) != 4)
- break;
- if ((ep - bp) < INADDRSZ) {
- RES_SET_H_ERRNO(pvt->res, NO_RECOVERY);
- return (NULL);
- }
- pvt->net.n_addr = bp;
- *bp++ = b4;
- *bp++ = b3;
- *bp++ = b2;
- *bp++ = b1;
- pvt->net.n_length = INADDRSZ * 8;
- haveanswer++;
- }
- }
- }
- cp += n; /*%< RDATA */
- }
- if (!haveanswer) {
- RES_SET_H_ERRNO(pvt->res, TRY_AGAIN);
- return (NULL);
- }
- *ap = NULL;
-
- return (&pvt->net);
-}
-
-static struct nwent *
-get1101mask(struct irs_nw *this, struct nwent *nwent) {
- struct pvt *pvt = (struct pvt *)this->private;
- char qbuf[sizeof "255.255.255.255.in-addr.arpa"], owner[MAXDNAME];
- int anslen, type, class, ancount, qdcount;
- u_char *ansbuf, *cp, *eom;
- HEADER *hp;
-
- if (!nwent)
- return (NULL);
- if (make1101inaddr(nwent->n_addr, nwent->n_length, qbuf, sizeof qbuf)
- < 0) {
- /* "First, do no harm." */
- return (nwent);
- }
-
- ansbuf = memget(MAXPACKET);
- if (ansbuf == NULL) {
- errno = ENOMEM;
- RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
- return (NULL);
- }
- /* Query for the A RR that would hold this network's mask. */
- anslen = res_nquery(pvt->res, qbuf, C_IN, T_A, ansbuf, MAXPACKET);
- if (anslen < HFIXEDSZ) {
- memput(ansbuf, MAXPACKET);
- return (nwent);
- }
-
- /* Initialize, and parse header. */
- hp = (HEADER *)ansbuf;
- cp = ansbuf + HFIXEDSZ;
- eom = ansbuf + anslen;
- qdcount = ntohs(hp->qdcount);
- while (qdcount-- > 0) {
- int n = dn_skipname(cp, eom);
- cp += n + QFIXEDSZ;
- if (n < 0 || cp > eom) {
- memput(ansbuf, MAXPACKET);
- return (nwent);
- }
- }
- ancount = ntohs(hp->ancount);
-
- /* Parse the answer, collect aliases. */
- while (--ancount >= 0 && cp < eom) {
- int n = dn_expand(ansbuf, eom, cp, owner, sizeof owner);
-
- if (n < 0 || !maybe_dnok(pvt->res, owner))
- break;
- cp += n; /*%< Owner */
- if (cp + 3 * INT16SZ + INT32SZ > eom)
- break;
- GETSHORT(type, cp); /*%< Type */
- GETSHORT(class, cp); /*%< Class */
- cp += INT32SZ; /*%< TTL */
- GETSHORT(n, cp); /*%< RDLENGTH */
- if (cp + n > eom)
- break;
- if (n == INADDRSZ && class == C_IN && type == T_A &&
- ns_samename(qbuf, owner) == 1) {
- /* This A RR indicates the actual netmask. */
- int nn, mm;
-
- nwent->n_length = 0;
- for (nn = 0; nn < INADDRSZ; nn++)
- for (mm = 7; mm >= 0; mm--)
- if (cp[nn] & (1 << mm))
- nwent->n_length++;
- else
- break;
- }
- cp += n; /*%< RDATA */
- }
- memput(ansbuf, MAXPACKET);
- return (nwent);
-}
-
-static int
-make1101inaddr(const u_char *net, int bits, char *name, int size) {
- int n, m;
- char *ep;
-
- ep = name + size;
-
- /* Zero fill any whole bytes left out of the prefix. */
- for (n = (32 - bits) / 8; n > 0; n--) {
- if (ep - name < (int)(sizeof "0."))
- goto emsgsize;
- m = SPRINTF((name, "0."));
- name += m;
- }
-
- /* Format the partial byte, if any, within the prefix. */
- if ((n = bits % 8) != 0) {
- if (ep - name < (int)(sizeof "255."))
- goto emsgsize;
- m = SPRINTF((name, "%u.",
- net[bits / 8] & ~((1 << (8 - n)) - 1)));
- name += m;
- }
-
- /* Format the whole bytes within the prefix. */
- for (n = bits / 8; n > 0; n--) {
- if (ep - name < (int)(sizeof "255."))
- goto emsgsize;
- m = SPRINTF((name, "%u.", net[n - 1]));
- name += m;
- }
-
- /* Add the static text. */
- if (ep - name < (int)(sizeof "in-addr.arpa"))
- goto emsgsize;
- (void) SPRINTF((name, "in-addr.arpa"));
- return (0);
-
- emsgsize:
- errno = EMSGSIZE;
- return (-1);
-}
-
-static void
-normalize_name(char *name) {
- char *t;
-
- /* Make lower case. */
- for (t = name; *t; t++)
- if (isascii((unsigned char)*t) && isupper((unsigned char)*t))
- *t = tolower((*t)&0xff);
-
- /* Remove trailing dots. */
- while (t > name && t[-1] == '.')
- *--t = '\0';
-}
-
-static int
-init(struct irs_nw *this) {
- struct pvt *pvt = (struct pvt *)this->private;
-
- if (!pvt->res && !nw_res_get(this))
- return (-1);
- if (((pvt->res->options & RES_INIT) == 0U) &&
- res_ninit(pvt->res) == -1)
- return (-1);
- return (0);
-}
-
-/*! \file */
diff --git a/lib/bind/irs/dns_p.h b/lib/bind/irs/dns_p.h
deleted file mode 100644
index a19ff2d1b9ed..000000000000
--- a/lib/bind/irs/dns_p.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * 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 ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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: dns_p.h,v 1.3.18.1 2005/04/27 05:00:55 sra Exp $
- */
-
-#ifndef _DNS_P_H_INCLUDED
-#define _DNS_P_H_INCLUDED
-
-#define maybe_ok(res, nm, ok) (((res)->options & RES_NOCHECKNAME) != 0U || \
- (ok)(nm) != 0)
-#define maybe_hnok(res, hn) maybe_ok((res), (hn), res_hnok)
-#define maybe_dnok(res, dn) maybe_ok((res), (dn), res_dnok)
-
-/*%
- * Object state.
- */
-struct dns_p {
- void *hes_ctx;
- struct __res_state *res;
- void (*free_res) __P((void *));
-};
-
-/*
- * Methods.
- */
-
-extern struct irs_gr * irs_dns_gr __P((struct irs_acc *));
-extern struct irs_pw * irs_dns_pw __P((struct irs_acc *));
-extern struct irs_sv * irs_dns_sv __P((struct irs_acc *));
-extern struct irs_pr * irs_dns_pr __P((struct irs_acc *));
-extern struct irs_ho * irs_dns_ho __P((struct irs_acc *));
-extern struct irs_nw * irs_dns_nw __P((struct irs_acc *));
-
-#endif /*_DNS_P_H_INCLUDED*/
-
-/*! \file */
diff --git a/lib/bind/irs/dns_pr.c b/lib/bind/irs/dns_pr.c
deleted file mode 100644
index 7582f85a2044..000000000000
--- a/lib/bind/irs/dns_pr.c
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * 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 ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: dns_pr.c,v 1.4.18.1 2005/04/27 05:00:55 sra Exp $";
-#endif
-
-/* Imports */
-
-#include "port_before.h"
-
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <resolv.h>
-
-#include <stdio.h>
-#include <string.h>
-#include <netdb.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <errno.h>
-
-#include <isc/memcluster.h>
-#include <irs.h>
-
-#include "port_after.h"
-
-#include "irs_p.h"
-#include "hesiod.h"
-#include "dns_p.h"
-
-/* Types. */
-
-struct pvt {
- struct dns_p * dns;
- struct protoent proto;
- char * prbuf;
-};
-
-/* Forward. */
-
-static void pr_close(struct irs_pr *);
-static struct protoent * pr_byname(struct irs_pr *, const char *);
-static struct protoent * pr_bynumber(struct irs_pr *, int);
-static struct protoent * pr_next(struct irs_pr *);
-static void pr_rewind(struct irs_pr *);
-static void pr_minimize(struct irs_pr *);
-static struct __res_state * pr_res_get(struct irs_pr *);
-static void pr_res_set(struct irs_pr *,
- struct __res_state *,
- void (*)(void *));
-
-static struct protoent * parse_hes_list(struct irs_pr *, char **);
-
-/* Public. */
-
-struct irs_pr *
-irs_dns_pr(struct irs_acc *this) {
- struct dns_p *dns = (struct dns_p *)this->private;
- struct pvt *pvt;
- struct irs_pr *pr;
-
- if (!dns->hes_ctx) {
- errno = ENODEV;
- return (NULL);
- }
- if (!(pvt = memget(sizeof *pvt))) {
- errno = ENOMEM;
- return (NULL);
- }
- memset(pvt, 0, sizeof *pvt);
- if (!(pr = memget(sizeof *pr))) {
- memput(pvt, sizeof *pvt);
- errno = ENOMEM;
- return (NULL);
- }
- memset(pr, 0x5e, sizeof *pr);
- pvt->dns = dns;
- pr->private = pvt;
- pr->byname = pr_byname;
- pr->bynumber = pr_bynumber;
- pr->next = pr_next;
- pr->rewind = pr_rewind;
- pr->close = pr_close;
- pr->minimize = pr_minimize;
- pr->res_get = pr_res_get;
- pr->res_set = pr_res_set;
- return (pr);
-}
-
-/* Methods. */
-
-static void
-pr_close(struct irs_pr *this) {
- struct pvt *pvt = (struct pvt *)this->private;
-
- if (pvt->proto.p_aliases)
- free(pvt->proto.p_aliases);
- if (pvt->prbuf)
- free(pvt->prbuf);
-
- memput(pvt, sizeof *pvt);
- memput(this, sizeof *this);
-}
-
-static struct protoent *
-pr_byname(struct irs_pr *this, const char *name) {
- struct pvt *pvt = (struct pvt *)this->private;
- struct dns_p *dns = pvt->dns;
- struct protoent *proto;
- char **hes_list;
-
- if (!(hes_list = hesiod_resolve(dns->hes_ctx, name, "protocol")))
- return (NULL);
-
- proto = parse_hes_list(this, hes_list);
- hesiod_free_list(dns->hes_ctx, hes_list);
- return (proto);
-}
-
-static struct protoent *
-pr_bynumber(struct irs_pr *this, int num) {
- struct pvt *pvt = (struct pvt *)this->private;
- struct dns_p *dns = pvt->dns;
- struct protoent *proto;
- char numstr[16];
- char **hes_list;
-
- sprintf(numstr, "%d", num);
- if (!(hes_list = hesiod_resolve(dns->hes_ctx, numstr, "protonum")))
- return (NULL);
-
- proto = parse_hes_list(this, hes_list);
- hesiod_free_list(dns->hes_ctx, hes_list);
- return (proto);
-}
-
-static struct protoent *
-pr_next(struct irs_pr *this) {
- UNUSED(this);
- errno = ENODEV;
- return (NULL);
-}
-
-static void
-pr_rewind(struct irs_pr *this) {
- UNUSED(this);
- /* NOOP */
-}
-
-static void
-pr_minimize(struct irs_pr *this) {
- UNUSED(this);
- /* NOOP */
-}
-
-static struct __res_state *
-pr_res_get(struct irs_pr *this) {
- struct pvt *pvt = (struct pvt *)this->private;
- struct dns_p *dns = pvt->dns;
-
- return (__hesiod_res_get(dns->hes_ctx));
-}
-
-static void
-pr_res_set(struct irs_pr *this, struct __res_state * res,
- void (*free_res)(void *)) {
- struct pvt *pvt = (struct pvt *)this->private;
- struct dns_p *dns = pvt->dns;
-
- __hesiod_res_set(dns->hes_ctx, res, free_res);
-}
-
-/* Private. */
-
-static struct protoent *
-parse_hes_list(struct irs_pr *this, char **hes_list) {
- struct pvt *pvt = (struct pvt *)this->private;
- char *p, *cp, **cpp, **new;
- int num = 0;
- int max = 0;
-
- for (cpp = hes_list; *cpp; cpp++) {
- cp = *cpp;
-
- /* Strip away comments, if any. */
- if ((p = strchr(cp, '#')))
- *p = 0;
-
- /* Skip blank lines. */
- p = cp;
- while (*p && !isspace((unsigned char)*p))
- p++;
- if (!*p)
- continue;
-
- /* OK, we've got a live one. Let's parse it for real. */
- if (pvt->prbuf)
- free(pvt->prbuf);
- pvt->prbuf = strdup(cp);
-
- p = pvt->prbuf;
- pvt->proto.p_name = p;
- while (*p && !isspace((unsigned char)*p))
- p++;
- if (!*p)
- continue;
- *p++ = '\0';
-
- pvt->proto.p_proto = atoi(p);
- while (*p && !isspace((unsigned char)*p))
- p++;
- if (*p)
- *p++ = '\0';
-
- while (*p) {
- if ((num + 1) >= max || !pvt->proto.p_aliases) {
- max += 10;
- new = realloc(pvt->proto.p_aliases,
- max * sizeof(char *));
- if (!new) {
- errno = ENOMEM;
- goto cleanup;
- }
- pvt->proto.p_aliases = new;
- }
- pvt->proto.p_aliases[num++] = p;
- while (*p && !isspace((unsigned char)*p))
- p++;
- if (*p)
- *p++ = '\0';
- }
- if (!pvt->proto.p_aliases)
- pvt->proto.p_aliases = malloc(sizeof(char *));
- if (!pvt->proto.p_aliases)
- goto cleanup;
- pvt->proto.p_aliases[num] = NULL;
- return (&pvt->proto);
- }
-
- cleanup:
- if (pvt->proto.p_aliases) {
- free(pvt->proto.p_aliases);
- pvt->proto.p_aliases = NULL;
- }
- if (pvt->prbuf) {
- free(pvt->prbuf);
- pvt->prbuf = NULL;
- }
- return (NULL);
-}
-
-/*! \file */
diff --git a/lib/bind/irs/dns_pw.c b/lib/bind/irs/dns_pw.c
deleted file mode 100644
index 62c61d577162..000000000000
--- a/lib/bind/irs/dns_pw.c
+++ /dev/null
@@ -1,232 +0,0 @@
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * 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 ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: dns_pw.c,v 1.2.18.1 2005/04/27 05:00:55 sra Exp $";
-#endif
-
-#include "port_before.h"
-
-#ifndef WANT_IRS_PW
-static int __bind_irs_pw_unneeded;
-#else
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <string.h>
-
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <resolv.h>
-
-#include <isc/memcluster.h>
-
-#include <irs.h>
-
-#include "port_after.h"
-
-#include "irs_p.h"
-#include "hesiod.h"
-#include "dns_p.h"
-
-/* Types. */
-
-struct pvt {
- struct dns_p * dns;
- struct passwd passwd;
- char * pwbuf;
-};
-
-/* Forward. */
-
-static void pw_close(struct irs_pw *);
-static struct passwd * pw_byname(struct irs_pw *, const char *);
-static struct passwd * pw_byuid(struct irs_pw *, uid_t);
-static struct passwd * pw_next(struct irs_pw *);
-static void pw_rewind(struct irs_pw *);
-static void pw_minimize(struct irs_pw *);
-static struct __res_state * pw_res_get(struct irs_pw *);
-static void pw_res_set(struct irs_pw *,
- struct __res_state *,
- void (*)(void *));
-
-static struct passwd * getpwcommon(struct irs_pw *, const char *,
- const char *);
-
-/* Public. */
-
-struct irs_pw *
-irs_dns_pw(struct irs_acc *this) {
- struct dns_p *dns = (struct dns_p *)this->private;
- struct irs_pw *pw;
- struct pvt *pvt;
-
- if (!dns || !dns->hes_ctx) {
- errno = ENODEV;
- return (NULL);
- }
- if (!(pvt = memget(sizeof *pvt))) {
- errno = ENOMEM;
- return (NULL);
- }
- memset(pvt, 0, sizeof *pvt);
- pvt->dns = dns;
- if (!(pw = memget(sizeof *pw))) {
- memput(pvt, sizeof *pvt);
- errno = ENOMEM;
- return (NULL);
- }
- memset(pw, 0x5e, sizeof *pw);
- pw->private = pvt;
- pw->close = pw_close;
- pw->byname = pw_byname;
- pw->byuid = pw_byuid;
- pw->next = pw_next;
- pw->rewind = pw_rewind;
- pw->minimize = pw_minimize;
- pw->res_get = pw_res_get;
- pw->res_set = pw_res_set;
- return (pw);
-}
-
-/* Methods. */
-
-static void
-pw_close(struct irs_pw *this) {
- struct pvt *pvt = (struct pvt *)this->private;
-
- if (pvt->pwbuf)
- free(pvt->pwbuf);
-
- memput(pvt, sizeof *pvt);
- memput(this, sizeof *this);
-}
-
-static struct passwd *
-pw_byname(struct irs_pw *this, const char *nam) {
- return (getpwcommon(this, nam, "passwd"));
-}
-
-static struct passwd *
-pw_byuid(struct irs_pw *this, uid_t uid) {
- char uidstr[16];
-
- sprintf(uidstr, "%lu", (u_long)uid);
- return (getpwcommon(this, uidstr, "uid"));
-}
-
-static struct passwd *
-pw_next(struct irs_pw *this) {
- UNUSED(this);
- errno = ENODEV;
- return (NULL);
-}
-
-static void
-pw_rewind(struct irs_pw *this) {
- UNUSED(this);
- /* NOOP */
-}
-
-static void
-pw_minimize(struct irs_pw *this) {
- UNUSED(this);
- /* NOOP */
-}
-
-static struct __res_state *
-pw_res_get(struct irs_pw *this) {
- struct pvt *pvt = (struct pvt *)this->private;
- struct dns_p *dns = pvt->dns;
-
- return (__hesiod_res_get(dns->hes_ctx));
-}
-
-static void
-pw_res_set(struct irs_pw *this, struct __res_state * res,
- void (*free_res)(void *)) {
- struct pvt *pvt = (struct pvt *)this->private;
- struct dns_p *dns = pvt->dns;
-
- __hesiod_res_set(dns->hes_ctx, res, free_res);
-}
-
-/* Private. */
-
-static struct passwd *
-getpwcommon(struct irs_pw *this, const char *arg, const char *type) {
- struct pvt *pvt = (struct pvt *)this->private;
- char **hes_list, *cp;
-
- if (!(hes_list = hesiod_resolve(pvt->dns->hes_ctx, arg, type)))
- return (NULL);
- if (!*hes_list) {
- hesiod_free_list(pvt->dns->hes_ctx, hes_list);
- errno = ENOENT;
- return (NULL);
- }
-
- memset(&pvt->passwd, 0, sizeof pvt->passwd);
- if (pvt->pwbuf)
- free(pvt->pwbuf);
- pvt->pwbuf = strdup(*hes_list);
- hesiod_free_list(pvt->dns->hes_ctx, hes_list);
-
- cp = pvt->pwbuf;
- pvt->passwd.pw_name = cp;
- if (!(cp = strchr(cp, ':')))
- goto cleanup;
- *cp++ = '\0';
-
- pvt->passwd.pw_passwd = cp;
- if (!(cp = strchr(cp, ':')))
- goto cleanup;
- *cp++ = '\0';
-
- pvt->passwd.pw_uid = atoi(cp);
- if (!(cp = strchr(cp, ':')))
- goto cleanup;
- *cp++ = '\0';
-
- pvt->passwd.pw_gid = atoi(cp);
- if (!(cp = strchr(cp, ':')))
- goto cleanup;
- *cp++ = '\0';
-
- pvt->passwd.pw_gecos = cp;
- if (!(cp = strchr(cp, ':')))
- goto cleanup;
- *cp++ = '\0';
-
- pvt->passwd.pw_dir = cp;
- if (!(cp = strchr(cp, ':')))
- goto cleanup;
- *cp++ = '\0';
-
- pvt->passwd.pw_shell = cp;
- return (&pvt->passwd);
-
- cleanup:
- free(pvt->pwbuf);
- pvt->pwbuf = NULL;
- return (NULL);
-}
-
-#endif /* WANT_IRS_PW */
-/*! \file */
diff --git a/lib/bind/irs/dns_sv.c b/lib/bind/irs/dns_sv.c
deleted file mode 100644
index fcb25ac4ad4c..000000000000
--- a/lib/bind/irs/dns_sv.c
+++ /dev/null
@@ -1,300 +0,0 @@
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * 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 ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: dns_sv.c,v 1.4.18.1 2005/04/27 05:00:55 sra Exp $";
-#endif
-
-/* Imports */
-
-#include "port_before.h"
-
-#include <sys/types.h>
-#include <netinet/in.h>
-
-#include <stdio.h>
-#include <string.h>
-#include <netdb.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <errno.h>
-
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <resolv.h>
-
-#include <isc/memcluster.h>
-#include <irs.h>
-
-#include "port_after.h"
-
-#include "irs_p.h"
-#include "hesiod.h"
-#include "dns_p.h"
-
-/* Definitions */
-
-struct pvt {
- struct dns_p * dns;
- struct servent serv;
- char * svbuf;
- struct __res_state * res;
- void (*free_res)(void *);
-};
-
-/* Forward. */
-
-static void sv_close(struct irs_sv *);
-static struct servent * sv_byname(struct irs_sv *,
- const char *, const char *);
-static struct servent * sv_byport(struct irs_sv *, int, const char *);
-static struct servent * sv_next(struct irs_sv *);
-static void sv_rewind(struct irs_sv *);
-static void sv_minimize(struct irs_sv *);
-#ifdef SV_RES_SETGET
-static struct __res_state * sv_res_get(struct irs_sv *);
-static void sv_res_set(struct irs_sv *,
- struct __res_state *,
- void (*)(void *));
-#endif
-
-static struct servent * parse_hes_list(struct irs_sv *,
- char **, const char *);
-
-/* Public */
-
-struct irs_sv *
-irs_dns_sv(struct irs_acc *this) {
- struct dns_p *dns = (struct dns_p *)this->private;
- struct irs_sv *sv;
- struct pvt *pvt;
-
- if (!dns || !dns->hes_ctx) {
- errno = ENODEV;
- return (NULL);
- }
- if (!(pvt = memget(sizeof *pvt))) {
- errno = ENOMEM;
- return (NULL);
- }
- memset(pvt, 0, sizeof *pvt);
- pvt->dns = dns;
- if (!(sv = memget(sizeof *sv))) {
- memput(pvt, sizeof *pvt);
- errno = ENOMEM;
- return (NULL);
- }
- memset(sv, 0x5e, sizeof *sv);
- sv->private = pvt;
- sv->byname = sv_byname;
- sv->byport = sv_byport;
- sv->next = sv_next;
- sv->rewind = sv_rewind;
- sv->close = sv_close;
- sv->minimize = sv_minimize;
-#ifdef SV_RES_SETGET
- sv->res_get = sv_res_get;
- sv->res_set = sv_res_set;
-#else
- sv->res_get = NULL; /*%< sv_res_get; */
- sv->res_set = NULL; /*%< sv_res_set; */
-#endif
- return (sv);
-}
-
-/* Methods */
-
-static void
-sv_close(struct irs_sv *this) {
- struct pvt *pvt = (struct pvt *)this->private;
-
- if (pvt->serv.s_aliases)
- free(pvt->serv.s_aliases);
- if (pvt->svbuf)
- free(pvt->svbuf);
-
- if (pvt->res && pvt->free_res)
- (*pvt->free_res)(pvt->res);
- memput(pvt, sizeof *pvt);
- memput(this, sizeof *this);
-}
-
-static struct servent *
-sv_byname(struct irs_sv *this, const char *name, const char *proto) {
- struct pvt *pvt = (struct pvt *)this->private;
- struct dns_p *dns = pvt->dns;
- struct servent *s;
- char **hes_list;
-
- if (!(hes_list = hesiod_resolve(dns->hes_ctx, name, "service")))
- return (NULL);
-
- s = parse_hes_list(this, hes_list, proto);
- hesiod_free_list(dns->hes_ctx, hes_list);
- return (s);
-}
-
-static struct servent *
-sv_byport(struct irs_sv *this, int port, const char *proto) {
- struct pvt *pvt = (struct pvt *)this->private;
- struct dns_p *dns = pvt->dns;
- struct servent *s;
- char portstr[16];
- char **hes_list;
-
- sprintf(portstr, "%d", ntohs(port));
- if (!(hes_list = hesiod_resolve(dns->hes_ctx, portstr, "port")))
- return (NULL);
-
- s = parse_hes_list(this, hes_list, proto);
- hesiod_free_list(dns->hes_ctx, hes_list);
- return (s);
-}
-
-static struct servent *
-sv_next(struct irs_sv *this) {
- UNUSED(this);
- errno = ENODEV;
- return (NULL);
-}
-
-static void
-sv_rewind(struct irs_sv *this) {
- UNUSED(this);
- /* NOOP */
-}
-
-/* Private */
-
-static struct servent *
-parse_hes_list(struct irs_sv *this, char **hes_list, const char *proto) {
- struct pvt *pvt = (struct pvt *)this->private;
- char *p, *cp, **cpp, **new;
- int proto_len;
- int num = 0;
- int max = 0;
-
- for (cpp = hes_list; *cpp; cpp++) {
- cp = *cpp;
-
- /* Strip away comments, if any. */
- if ((p = strchr(cp, '#')))
- *p = 0;
-
- /* Check to make sure the protocol matches. */
- p = cp;
- while (*p && !isspace((unsigned char)*p))
- p++;
- if (!*p)
- continue;
- if (proto) {
- proto_len = strlen(proto);
- if (strncasecmp(++p, proto, proto_len) != 0)
- continue;
- if (p[proto_len] && !isspace(p[proto_len]&0xff))
- continue;
- }
- /* OK, we've got a live one. Let's parse it for real. */
- if (pvt->svbuf)
- free(pvt->svbuf);
- pvt->svbuf = strdup(cp);
-
- p = pvt->svbuf;
- pvt->serv.s_name = p;
- while (*p && !isspace(*p&0xff))
- p++;
- if (!*p)
- continue;
- *p++ = '\0';
-
- pvt->serv.s_proto = p;
- while (*p && !isspace(*p&0xff))
- p++;
- if (!*p)
- continue;
- *p++ = '\0';
-
- pvt->serv.s_port = htons((u_short) atoi(p));
- while (*p && !isspace(*p&0xff))
- p++;
- if (*p)
- *p++ = '\0';
-
- while (*p) {
- if ((num + 1) >= max || !pvt->serv.s_aliases) {
- max += 10;
- new = realloc(pvt->serv.s_aliases,
- max * sizeof(char *));
- if (!new) {
- errno = ENOMEM;
- goto cleanup;
- }
- pvt->serv.s_aliases = new;
- }
- pvt->serv.s_aliases[num++] = p;
- while (*p && !isspace(*p&0xff))
- p++;
- if (*p)
- *p++ = '\0';
- }
- if (!pvt->serv.s_aliases)
- pvt->serv.s_aliases = malloc(sizeof(char *));
- if (!pvt->serv.s_aliases)
- goto cleanup;
- pvt->serv.s_aliases[num] = NULL;
- return (&pvt->serv);
- }
-
- cleanup:
- if (pvt->serv.s_aliases) {
- free(pvt->serv.s_aliases);
- pvt->serv.s_aliases = NULL;
- }
- if (pvt->svbuf) {
- free(pvt->svbuf);
- pvt->svbuf = NULL;
- }
- return (NULL);
-}
-
-static void
-sv_minimize(struct irs_sv *this) {
- UNUSED(this);
- /* NOOP */
-}
-
-#ifdef SV_RES_SETGET
-static struct __res_state *
-sv_res_get(struct irs_sv *this) {
- struct pvt *pvt = (struct pvt *)this->private;
- struct dns_p *dns = pvt->dns;
-
- return (__hesiod_res_get(dns->hes_ctx));
-}
-
-static void
-sv_res_set(struct irs_sv *this, struct __res_state * res,
- void (*free_res)(void *)) {
- struct pvt *pvt = (struct pvt *)this->private;
- struct dns_p *dns = pvt->dns;
-
- __hesiod_res_set(dns->hes_ctx, res, free_res);
-}
-#endif
-
-/*! \file */
diff --git a/lib/bind/irs/gai_strerror.c b/lib/bind/irs/gai_strerror.c
deleted file mode 100644
index 9ca1c4bfe1d9..000000000000
--- a/lib/bind/irs/gai_strerror.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * Copyright (c) 2001 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 ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
- * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include <port_before.h>
-#include <netdb.h>
-#include <port_after.h>
-
-#ifdef DO_PTHREADS
-#include <pthread.h>
-#include <stdlib.h>
-#endif
-
-static const char *gai_errlist[] = {
- "no error",
- "address family not supported for name",/*%< EAI_ADDRFAMILY */
- "temporary failure", /*%< EAI_AGAIN */
- "invalid flags", /*%< EAI_BADFLAGS */
- "permanent failure", /*%< EAI_FAIL */
- "address family not supported", /*%< EAI_FAMILY */
- "memory failure", /*%< EAI_MEMORY */
- "no address", /*%< EAI_NODATA */
- "unknown name or service", /*%< EAI_NONAME */
- "service not supported for socktype", /*%< EAI_SERVICE */
- "socktype not supported", /*%< EAI_SOCKTYPE */
- "system failure", /*%< EAI_SYSTEM */
- "bad hints", /*%< EAI_BADHINTS */
- "bad protocol", /*%< EAI_PROTOCOL */
- "unknown error" /*%< Must be last. */
-};
-
-static const int gai_nerr = (sizeof(gai_errlist)/sizeof(*gai_errlist));
-
-#define EAI_BUFSIZE 128
-
-const char *
-gai_strerror(int ecode) {
-#ifndef DO_PTHREADS
- static char buf[EAI_BUFSIZE];
-#else /* DO_PTHREADS */
-#ifndef LIBBIND_MUTEX_INITIALIZER
-#define LIBBIND_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
-#endif
- static pthread_mutex_t lock = LIBBIND_MUTEX_INITIALIZER;
- static pthread_key_t key;
- static int once = 0;
- char *buf;
-#endif
-
- if (ecode >= 0 && ecode < (gai_nerr - 1))
- return (gai_errlist[ecode]);
-
-#ifdef DO_PTHREADS
- if (!once) {
- if (pthread_mutex_lock(&lock) != 0)
- goto unknown;
- if (!once) {
- if (pthread_key_create(&key, free) != 0) {
- (void)pthread_mutex_unlock(&lock);
- goto unknown;
- }
- once = 1;
- }
- if (pthread_mutex_unlock(&lock) != 0)
- goto unknown;
- }
-
- buf = pthread_getspecific(key);
- if (buf == NULL) {
- buf = malloc(EAI_BUFSIZE);
- if (buf == NULL)
- goto unknown;
- if (pthread_setspecific(key, buf) != 0) {
- free(buf);
- goto unknown;
- }
- }
-#endif
- /*
- * XXX This really should be snprintf(buf, EAI_BUFSIZE, ...).
- * It is safe until message catalogs are used.
- */
- sprintf(buf, "%s: %d", gai_errlist[gai_nerr - 1], ecode);
- return (buf);
-
-#ifdef DO_PTHREADS
- unknown:
- return ("unknown error");
-#endif
-}
-
-/*! \file */
diff --git a/lib/bind/irs/gen.c b/lib/bind/irs/gen.c
deleted file mode 100644
index 8e9146eb2dca..000000000000
--- a/lib/bind/irs/gen.c
+++ /dev/null
@@ -1,433 +0,0 @@
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * 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 ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#if !defined(LINT) && !defined(CODECENTER)
-static const char rcsid[] = "$Id: gen.c,v 1.5.18.2 2005/04/27 05:00:56 sra Exp $";
-#endif
-
-/*! \file
- * \brief
- * this is the top level dispatcher
- *
- * The dispatcher is implemented as an accessor class; it is an
- * accessor class that calls other accessor classes, as controlled by a
- * configuration file.
- *
- * A big difference between this accessor class and others is that the
- * map class initializers are NULL, and the map classes are already
- * filled in with method functions that will do the right thing.
- */
-
-/* Imports */
-
-#include "port_before.h"
-
-#include <isc/assertions.h>
-#include <ctype.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <resolv.h>
-
-#include <isc/memcluster.h>
-#include <irs.h>
-
-#include "port_after.h"
-
-#include "irs_p.h"
-#include "gen_p.h"
-
-/* Definitions */
-
-struct nameval {
- const char * name;
- int val;
-};
-
-static const struct nameval acc_names[irs_nacc+1] = {
- { "local", irs_lcl },
- { "dns", irs_dns },
- { "nis", irs_nis },
- { "irp", irs_irp },
- { NULL, irs_nacc }
-};
-
-typedef struct irs_acc *(*accinit) __P((const char *options));
-
-static const accinit accs[irs_nacc+1] = {
- irs_lcl_acc,
- irs_dns_acc,
-#ifdef WANT_IRS_NIS
- irs_nis_acc,
-#else
- NULL,
-#endif
- irs_irp_acc,
- NULL
-};
-
-static const struct nameval map_names[irs_nmap+1] = {
- { "group", irs_gr },
- { "passwd", irs_pw },
- { "services", irs_sv },
- { "protocols", irs_pr },
- { "hosts", irs_ho },
- { "networks", irs_nw },
- { "netgroup", irs_ng },
- { NULL, irs_nmap }
-};
-
-static const struct nameval option_names[] = {
- { "merge", IRS_MERGE },
- { "continue", IRS_CONTINUE },
- { NULL, 0 }
-};
-
-/* Forward */
-
-static void gen_close(struct irs_acc *);
-static struct __res_state * gen_res_get(struct irs_acc *);
-static void gen_res_set(struct irs_acc *, struct __res_state *,
- void (*)(void *));
-static int find_name(const char *, const struct nameval nv[]);
-static void init_map_rules(struct gen_p *, const char *conf_file);
-static struct irs_rule *release_rule(struct irs_rule *);
-static int add_rule(struct gen_p *,
- enum irs_map_id, enum irs_acc_id,
- const char *);
-
-/* Public */
-
-struct irs_acc *
-irs_gen_acc(const char *options, const char *conf_file) {
- struct irs_acc *acc;
- struct gen_p *irs;
-
- if (!(acc = memget(sizeof *acc))) {
- errno = ENOMEM;
- return (NULL);
- }
- memset(acc, 0x5e, sizeof *acc);
- if (!(irs = memget(sizeof *irs))) {
- errno = ENOMEM;
- memput(acc, sizeof *acc);
- return (NULL);
- }
- memset(irs, 0x5e, sizeof *irs);
- irs->options = strdup(options);
- irs->res = NULL;
- irs->free_res = NULL;
- memset(irs->accessors, 0, sizeof irs->accessors);
- memset(irs->map_rules, 0, sizeof irs->map_rules);
- init_map_rules(irs, conf_file);
- acc->private = irs;
-#ifdef WANT_IRS_GR
- acc->gr_map = irs_gen_gr;
-#else
- acc->gr_map = NULL;
-#endif
-#ifdef WANT_IRS_PW
- acc->pw_map = irs_gen_pw;
-#else
- acc->pw_map = NULL;
-#endif
- acc->sv_map = irs_gen_sv;
- acc->pr_map = irs_gen_pr;
- acc->ho_map = irs_gen_ho;
- acc->nw_map = irs_gen_nw;
- acc->ng_map = irs_gen_ng;
- acc->res_get = gen_res_get;
- acc->res_set = gen_res_set;
- acc->close = gen_close;
- return (acc);
-}
-
-/* Methods */
-
-static struct __res_state *
-gen_res_get(struct irs_acc *this) {
- struct gen_p *irs = (struct gen_p *)this->private;
-
- if (irs->res == NULL) {
- struct __res_state *res;
- res = (struct __res_state *)malloc(sizeof *res);
- if (res == NULL)
- return (NULL);
- memset(res, 0, sizeof *res);
- gen_res_set(this, res, free);
- }
-
- if (((irs->res->options & RES_INIT) == 0U) && res_ninit(irs->res) < 0)
- return (NULL);
-
- return (irs->res);
-}
-
-static void
-gen_res_set(struct irs_acc *this, struct __res_state *res,
- void (*free_res)(void *)) {
- struct gen_p *irs = (struct gen_p *)this->private;
-#if 0
- struct irs_rule *rule;
- struct irs_ho *ho;
- struct irs_nw *nw;
-#endif
-
- if (irs->res && irs->free_res) {
- res_nclose(irs->res);
- (*irs->free_res)(irs->res);
- }
-
- irs->res = res;
- irs->free_res = free_res;
-
-#if 0
- for (rule = irs->map_rules[irs_ho]; rule; rule = rule->next) {
- ho = rule->inst->ho;
-
- (*ho->res_set)(ho, res, NULL);
- }
- for (rule = irs->map_rules[irs_nw]; rule; rule = rule->next) {
- nw = rule->inst->nw;
-
- (*nw->res_set)(nw, res, NULL);
- }
-#endif
-}
-
-static void
-gen_close(struct irs_acc *this) {
- struct gen_p *irs = (struct gen_p *)this->private;
- int n;
-
- /* Search rules. */
- for (n = 0; n < irs_nmap; n++)
- while (irs->map_rules[n] != NULL)
- irs->map_rules[n] = release_rule(irs->map_rules[n]);
-
- /* Access methods. */
- for (n = 0; n < irs_nacc; n++) {
- /* Map objects. */
- if (irs->accessors[n].gr != NULL)
- (*irs->accessors[n].gr->close)(irs->accessors[n].gr);
- if (irs->accessors[n].pw != NULL)
- (*irs->accessors[n].pw->close)(irs->accessors[n].pw);
- if (irs->accessors[n].sv != NULL)
- (*irs->accessors[n].sv->close)(irs->accessors[n].sv);
- if (irs->accessors[n].pr != NULL)
- (*irs->accessors[n].pr->close)(irs->accessors[n].pr);
- if (irs->accessors[n].ho != NULL)
- (*irs->accessors[n].ho->close)(irs->accessors[n].ho);
- if (irs->accessors[n].nw != NULL)
- (*irs->accessors[n].nw->close)(irs->accessors[n].nw);
- if (irs->accessors[n].ng != NULL)
- (*irs->accessors[n].ng->close)(irs->accessors[n].ng);
- /* Enclosing accessor. */
- if (irs->accessors[n].acc != NULL)
- (*irs->accessors[n].acc->close)(irs->accessors[n].acc);
- }
-
- /* The options string was strdup'd. */
- free((void*)irs->options);
-
- if (irs->res && irs->free_res)
- (*irs->free_res)(irs->res);
-
- /* The private data container. */
- memput(irs, sizeof *irs);
-
- /* The object. */
- memput(this, sizeof *this);
-}
-
-/* Private */
-
-static int
-find_name(const char *name, const struct nameval names[]) {
- int n;
-
- for (n = 0; names[n].name != NULL; n++)
- if (strcmp(name, names[n].name) == 0)
- return (names[n].val);
- return (-1);
-}
-
-static struct irs_rule *
-release_rule(struct irs_rule *rule) {
- struct irs_rule *next = rule->next;
-
- memput(rule, sizeof *rule);
- return (next);
-}
-
-static int
-add_rule(struct gen_p *irs,
- enum irs_map_id map, enum irs_acc_id acc,
- const char *options)
-{
- struct irs_rule **rules, *last, *tmp, *new;
- struct irs_inst *inst;
- const char *cp;
- int n;
-
-#ifndef WANT_IRS_GR
- if (map == irs_gr)
- return (-1);
-#endif
-#ifndef WANT_IRS_PW
- if (map == irs_pw)
- return (-1);
-#endif
-#ifndef WANT_IRS_NIS
- if (acc == irs_nis)
- return (-1);
-#endif
- new = memget(sizeof *new);
- if (new == NULL)
- return (-1);
- memset(new, 0x5e, sizeof *new);
- new->next = NULL;
-
- new->inst = &irs->accessors[acc];
-
- new->flags = 0;
- cp = options;
- while (cp && *cp) {
- char option[50], *next;
-
- next = strchr(cp, ',');
- if (next)
- n = next++ - cp;
- else
- n = strlen(cp);
- if ((size_t)n > sizeof option - 1)
- n = sizeof option - 1;
- strncpy(option, cp, n);
- option[n] = '\0';
-
- n = find_name(option, option_names);
- if (n >= 0)
- new->flags |= n;
-
- cp = next;
- }
-
- rules = &irs->map_rules[map];
- for (last = NULL, tmp = *rules;
- tmp != NULL;
- last = tmp, tmp = tmp->next)
- (void)NULL;
- if (last == NULL)
- *rules = new;
- else
- last->next = new;
-
- /* Try to instantiate map accessors for this if necessary & approp. */
- inst = &irs->accessors[acc];
- if (inst->acc == NULL && accs[acc] != NULL)
- inst->acc = (*accs[acc])(irs->options);
- if (inst->acc != NULL) {
- if (inst->gr == NULL && inst->acc->gr_map != NULL)
- inst->gr = (*inst->acc->gr_map)(inst->acc);
- if (inst->pw == NULL && inst->acc->pw_map != NULL)
- inst->pw = (*inst->acc->pw_map)(inst->acc);
- if (inst->sv == NULL && inst->acc->sv_map != NULL)
- inst->sv = (*inst->acc->sv_map)(inst->acc);
- if (inst->pr == NULL && inst->acc->pr_map != NULL)
- inst->pr = (*inst->acc->pr_map)(inst->acc);
- if (inst->ho == NULL && inst->acc->ho_map != NULL)
- inst->ho = (*inst->acc->ho_map)(inst->acc);
- if (inst->nw == NULL && inst->acc->nw_map != NULL)
- inst->nw = (*inst->acc->nw_map)(inst->acc);
- if (inst->ng == NULL && inst->acc->ng_map != NULL)
- inst->ng = (*inst->acc->ng_map)(inst->acc);
- }
-
- return (0);
-}
-
-static void
-default_map_rules(struct gen_p *irs) {
- /* Install time honoured and proved BSD style rules as default. */
- add_rule(irs, irs_gr, irs_lcl, "");
- add_rule(irs, irs_pw, irs_lcl, "");
- add_rule(irs, irs_sv, irs_lcl, "");
- add_rule(irs, irs_pr, irs_lcl, "");
- add_rule(irs, irs_ho, irs_dns, "continue");
- add_rule(irs, irs_ho, irs_lcl, "");
- add_rule(irs, irs_nw, irs_dns, "continue");
- add_rule(irs, irs_nw, irs_lcl, "");
- add_rule(irs, irs_ng, irs_lcl, "");
-}
-
-static void
-init_map_rules(struct gen_p *irs, const char *conf_file) {
- char line[1024], pattern[40], mapname[20], accname[20], options[100];
- FILE *conf;
-
- if (conf_file == NULL)
- conf_file = _PATH_IRS_CONF ;
-
- /* A conf file of "" means compiled in defaults. Irpd wants this */
- if (conf_file[0] == '\0' || (conf = fopen(conf_file, "r")) == NULL) {
- default_map_rules(irs);
- return;
- }
- (void) sprintf(pattern, "%%%lus %%%lus %%%lus\n",
- (unsigned long)sizeof mapname,
- (unsigned long)sizeof accname,
- (unsigned long)sizeof options);
- while (fgets(line, sizeof line, conf)) {
- enum irs_map_id map;
- enum irs_acc_id acc;
- char *tmp;
- int n;
-
- for (tmp = line;
- isascii((unsigned char)*tmp) &&
- isspace((unsigned char)*tmp);
- tmp++)
- (void)NULL;
- if (*tmp == '#' || *tmp == '\n' || *tmp == '\0')
- continue;
- n = sscanf(tmp, pattern, mapname, accname, options);
- if (n < 2)
- continue;
- if (n < 3)
- options[0] = '\0';
-
- n = find_name(mapname, map_names);
- INSIST(n < irs_nmap);
- if (n < 0)
- continue;
- map = (enum irs_map_id) n;
-
- n = find_name(accname, acc_names);
- INSIST(n < irs_nacc);
- if (n < 0)
- continue;
- acc = (enum irs_acc_id) n;
-
- add_rule(irs, map, acc, options);
- }
- fclose(conf);
-}
diff --git a/lib/bind/irs/gen_gr.c b/lib/bind/irs/gen_gr.c
deleted file mode 100644
index 0829ed802a66..000000000000
--- a/lib/bind/irs/gen_gr.c
+++ /dev/null
@@ -1,493 +0,0 @@
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * 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 ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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.
- */
-
-#if !defined(LINT) && !defined(CODECENTER)
-static const char rcsid[] = "$Id: gen_gr.c,v 1.6.18.2 2005/04/27 05:00:56 sra Exp $";
-#endif
-
-/* Imports */
-
-#include "port_before.h"
-
-#ifndef WANT_IRS_GR
-static int __bind_irs_gr_unneeded;
-#else
-
-#include <sys/types.h>
-
-#include <isc/assertions.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <resolv.h>
-
-#include <isc/memcluster.h>
-#include <irs.h>
-
-#include "port_after.h"
-
-#include "irs_p.h"
-#include "gen_p.h"
-
-/* Definitions */
-
-struct pvt {
- struct irs_rule * rules;
- struct irs_rule * rule;
- struct irs_gr * gr;
- /*
- * Need space to store the entries read from the group file.
- * The members list also needs space per member, and the
- * strings making up the user names must be allocated
- * somewhere. Rather than doing lots of small allocations,
- * we keep one buffer and resize it as needed.
- */
- struct group group;
- size_t nmemb; /*%< Malloc'd max index of gr_mem[]. */
- char * membuf;
- size_t membufsize;
- struct __res_state * res;
- void (*free_res)(void *);
-};
-
-/* Forward */
-
-static void gr_close(struct irs_gr *);
-static struct group * gr_next(struct irs_gr *);
-static struct group * gr_byname(struct irs_gr *, const char *);
-static struct group * gr_bygid(struct irs_gr *, gid_t);
-static void gr_rewind(struct irs_gr *);
-static int gr_list(struct irs_gr *, const char *,
- gid_t, gid_t *, int *);
-static void gr_minimize(struct irs_gr *);
-static struct __res_state * gr_res_get(struct irs_gr *);
-static void gr_res_set(struct irs_gr *,
- struct __res_state *,
- void (*)(void *));
-
-static int grmerge(struct irs_gr *gr, const struct group *src,
- int preserve);
-
-static int countvec(char **vec);
-static int isnew(char **old, char *new);
-static int countnew(char **old, char **new);
-static size_t sizenew(char **old, char **new);
-static int newgid(int, gid_t *, gid_t);
-
-/* Macros */
-
-#define FREE_IF(x) do { if ((x) != NULL) { free(x); (x) = NULL; } } while (0)
-
-/* Public */
-
-struct irs_gr *
-irs_gen_gr(struct irs_acc *this) {
- struct gen_p *accpvt = (struct gen_p *)this->private;
- struct irs_gr *gr;
- struct pvt *pvt;
-
- if (!(gr = memget(sizeof *gr))) {
- errno = ENOMEM;
- return (NULL);
- }
- memset(gr, 0x5e, sizeof *gr);
- if (!(pvt = memget(sizeof *pvt))) {
- memput(gr, sizeof *gr);
- errno = ENOMEM;
- return (NULL);
- }
- memset(pvt, 0, sizeof *pvt);
- pvt->rules = accpvt->map_rules[irs_gr];
- pvt->rule = pvt->rules;
- gr->private = pvt;
- gr->close = gr_close;
- gr->next = gr_next;
- gr->byname = gr_byname;
- gr->bygid = gr_bygid;
- gr->rewind = gr_rewind;
- gr->list = gr_list;
- gr->minimize = gr_minimize;
- gr->res_get = gr_res_get;
- gr->res_set = gr_res_set;
- return (gr);
-}
-
-/* Methods. */
-
-static void
-gr_close(struct irs_gr *this) {
- struct pvt *pvt = (struct pvt *)this->private;
-
- memput(pvt, sizeof *pvt);
- memput(this, sizeof *this);
-}
-
-static struct group *
-gr_next(struct irs_gr *this) {
- struct pvt *pvt = (struct pvt *)this->private;
- struct group *rval;
- struct irs_gr *gr;
-
- while (pvt->rule) {
- gr = pvt->rule->inst->gr;
- rval = (*gr->next)(gr);
- if (rval)
- return (rval);
- if (!(pvt->rule->flags & IRS_CONTINUE))
- break;
- pvt->rule = pvt->rule->next;
- if (pvt->rule) {
- gr = pvt->rule->inst->gr;
- (*gr->rewind)(gr);
- }
- }
- return (NULL);
-}
-
-static struct group *
-gr_byname(struct irs_gr *this, const char *name) {
- struct pvt *pvt = (struct pvt *)this->private;
- struct irs_rule *rule;
- struct group *tval;
- struct irs_gr *gr;
- int dirty;
-
- dirty = 0;
- for (rule = pvt->rules; rule; rule = rule->next) {
- gr = rule->inst->gr;
- tval = (*gr->byname)(gr, name);
- if (tval) {
- if (!grmerge(this, tval, dirty++))
- return (NULL);
- if (!(rule->flags & IRS_MERGE))
- break;
- } else {
- if (!(rule->flags & IRS_CONTINUE))
- break;
- }
- }
- if (dirty)
- return (&pvt->group);
- return (NULL);
-}
-
-static struct group *
-gr_bygid(struct irs_gr *this, gid_t gid) {
- struct pvt *pvt = (struct pvt *)this->private;
- struct irs_rule *rule;
- struct group *tval;
- struct irs_gr *gr;
- int dirty;
-
- dirty = 0;
- for (rule = pvt->rules; rule; rule = rule->next) {
- gr = rule->inst->gr;
- tval = (*gr->bygid)(gr, gid);