summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorInternet Software Consortium, Inc <@isc.org>2007-09-07 14:15:43 -0600
committerLaMont Jones <lamont@debian.org>2007-09-07 14:15:43 -0600
commitb839699f526d760de08fdb2c47b37987b3e90e3c (patch)
tree69ffa630921434643778cc4a1560479796cb8914 /lib
parent6ed2e67461f7dd53c085c56e246cef71d36ea7db (diff)
downloadbind9-b839699f526d760de08fdb2c47b37987b3e90e3c.tar.gz
9.3.2b1
Diffstat (limited to 'lib')
-rw-r--r--lib/bind/Makefile.in13
-rw-r--r--lib/bind/api4
-rw-r--r--lib/bind/config.h.in4
-rwxr-xr-xlib/bind/configure370
-rw-r--r--lib/bind/configure.in148
-rw-r--r--lib/bind/dst/dst_api.c9
-rw-r--r--lib/bind/dst/hmac_link.c15
-rw-r--r--lib/bind/dst/md5.h5
-rw-r--r--lib/bind/dst/md5_dgst.c2
-rw-r--r--lib/bind/dst/support.c18
-rw-r--r--lib/bind/include/isc/eventlib.h4
-rw-r--r--lib/bind/include/resolv.h7
-rw-r--r--lib/bind/include/resolv_mt.h47
-rw-r--r--lib/bind/inet/inet_pton.c17
-rw-r--r--lib/bind/inet/nsap_addr.c5
-rw-r--r--lib/bind/irs/getaddrinfo.c27
-rw-r--r--lib/bind/irs/gethostent_r.c14
-rw-r--r--lib/bind/irs/getnetent_r.c8
-rw-r--r--lib/bind/irs/getnetgrent_r.c13
-rw-r--r--lib/bind/irs/hesiod.c6
-rw-r--r--lib/bind/isc/ev_connects.c8
-rw-r--r--lib/bind/isc/ev_files.c25
-rw-r--r--lib/bind/isc/eventlib.c235
-rw-r--r--lib/bind/isc/eventlib_p.h63
-rw-r--r--lib/bind/isc/memcluster.c46
-rw-r--r--lib/bind/nameser/ns_parse.c7
-rw-r--r--lib/bind/nameser/ns_ttl.c5
-rw-r--r--lib/bind/port/qnx/include/Makefile.in4
-rw-r--r--lib/bind/port/unknown/include/Makefile.in21
-rw-r--r--lib/bind/port_after.h.in9
-rw-r--r--lib/bind/port_before.h.in8
-rw-r--r--lib/bind/resolv/Makefile.in8
-rw-r--r--lib/bind/resolv/mtctxres.c128
-rw-r--r--lib/bind/resolv/res_comp.c14
-rw-r--r--lib/bind/resolv/res_debug.c16
-rw-r--r--lib/bind/resolv/res_init.c66
-rw-r--r--lib/bind/resolv/res_send.c46
-rw-r--r--lib/bind/resolv/res_sendsigned.c12
-rw-r--r--lib/bind9/api2
-rw-r--r--lib/bind9/check.c6
-rw-r--r--lib/dns/adb.c6
-rw-r--r--lib/dns/api4
-rw-r--r--lib/dns/cache.c27
-rw-r--r--lib/dns/forward.c13
-rw-r--r--lib/dns/gen-unix.h8
-rw-r--r--lib/dns/include/dns/forward.h9
-rw-r--r--lib/dns/include/dns/masterdump.h6
-rw-r--r--lib/dns/include/dns/rdataset.h37
-rw-r--r--lib/dns/include/dns/validator.h10
-rw-r--r--lib/dns/journal.c17
-rw-r--r--lib/dns/key.c5
-rw-r--r--lib/dns/message.c62
-rw-r--r--lib/dns/name.c15
-rw-r--r--lib/dns/rbt.c9
-rw-r--r--lib/dns/rbtdb.c40
-rw-r--r--lib/dns/rdata.c14
-rw-r--r--lib/dns/rdata/any_255/tsig_250.c16
-rw-r--r--lib/dns/rdata/generic/ds_43.c12
-rw-r--r--lib/dns/rdata/generic/rt_21.c6
-rw-r--r--lib/dns/resolver.c226
-rw-r--r--lib/dns/tkey.c10
-rw-r--r--lib/dns/tsig.c6
-rw-r--r--lib/dns/validator.c581
-rw-r--r--lib/dns/zone.c245
-rw-r--r--lib/isc/api6
-rw-r--r--lib/isc/include/isc/Makefile.in8
-rw-r--r--lib/isc/include/isc/netaddr.h6
-rw-r--r--lib/isc/include/isc/print.h8
-rw-r--r--lib/isc/include/isc/quota.h14
-rw-r--r--lib/isc/include/isc/sockaddr.h6
-rw-r--r--lib/isc/inet_pton.c19
-rw-r--r--lib/isc/lfsr.c5
-rw-r--r--lib/isc/mem.c31
-rw-r--r--lib/isc/nls/msgcat.c5
-rw-r--r--lib/isc/pthreads/mutex.c30
-rw-r--r--lib/isc/quota.c39
-rw-r--r--lib/isc/result.c5
-rw-r--r--lib/isc/rwlock.c18
-rw-r--r--lib/isc/unix/entropy.c21
-rw-r--r--lib/isc/unix/ifiter_sysctl.c6
-rw-r--r--lib/isc/unix/net.c8
-rw-r--r--lib/isc/unix/socket.c104
-rw-r--r--lib/isc/unix/stdtime.c5
-rw-r--r--lib/isc/win32/errno2result.c31
-rw-r--r--lib/isc/win32/errno2result.h9
-rw-r--r--lib/isc/win32/libisc.def516
-rw-r--r--lib/isc/win32/socket.c259
-rw-r--r--lib/isccfg/api2
-rw-r--r--lib/isccfg/namedconf.c5
-rw-r--r--lib/lwres/Makefile.in10
-rw-r--r--lib/lwres/api6
-rw-r--r--lib/lwres/getaddrinfo.c6
-rw-r--r--lib/lwres/getipnode.c7
-rw-r--r--lib/lwres/include/lwres/platform.h.in14
-rw-r--r--lib/lwres/include/lwres/stdlib.h40
-rw-r--r--lib/lwres/lwconfig.c12
-rw-r--r--lib/lwres/lwinetpton.c19
-rw-r--r--lib/lwres/man/lwres.3178
-rw-r--r--lib/lwres/man/lwres.docbook24
-rw-r--r--lib/lwres/man/lwres.html537
-rw-r--r--lib/lwres/man/lwres_buffer.3338
-rw-r--r--lib/lwres/man/lwres_buffer.docbook23
-rw-r--r--lib/lwres/man/lwres_buffer.html832
-rw-r--r--lib/lwres/man/lwres_config.3132
-rw-r--r--lib/lwres/man/lwres_config.docbook24
-rw-r--r--lib/lwres/man/lwres_config.html388
-rw-r--r--lib/lwres/man/lwres_context.3226
-rw-r--r--lib/lwres/man/lwres_context.docbook25
-rw-r--r--lib/lwres/man/lwres_context.html653
-rw-r--r--lib/lwres/man/lwres_gabn.3200
-rw-r--r--lib/lwres/man/lwres_gabn.docbook24
-rw-r--r--lib/lwres/man/lwres_gabn.html580
-rw-r--r--lib/lwres/man/lwres_gai_strerror.385
-rw-r--r--lib/lwres/man/lwres_gai_strerror.docbook24
-rw-r--r--lib/lwres/man/lwres_gai_strerror.html381
-rw-r--r--lib/lwres/man/lwres_getaddrinfo.3255
-rw-r--r--lib/lwres/man/lwres_getaddrinfo.docbook24
-rw-r--r--lib/lwres/man/lwres_getaddrinfo.html800
-rw-r--r--lib/lwres/man/lwres_gethostent.3290
-rw-r--r--lib/lwres/man/lwres_gethostent.docbook20
-rw-r--r--lib/lwres/man/lwres_gethostent.html1110
-rw-r--r--lib/lwres/man/lwres_getipnode.3188
-rw-r--r--lib/lwres/man/lwres_getipnode.docbook24
-rw-r--r--lib/lwres/man/lwres_getipnode.html688
-rw-r--r--lib/lwres/man/lwres_getnameinfo.398
-rw-r--r--lib/lwres/man/lwres_getnameinfo.docbook24
-rw-r--r--lib/lwres/man/lwres_getnameinfo.html410
-rw-r--r--lib/lwres/man/lwres_getrrsetbyname.3131
-rw-r--r--lib/lwres/man/lwres_getrrsetbyname.docbook24
-rw-r--r--lib/lwres/man/lwres_getrrsetbyname.html455
-rw-r--r--lib/lwres/man/lwres_gnba.3199
-rw-r--r--lib/lwres/man/lwres_gnba.docbook23
-rw-r--r--lib/lwres/man/lwres_gnba.html587
-rw-r--r--lib/lwres/man/lwres_hstrerror.384
-rw-r--r--lib/lwres/man/lwres_hstrerror.docbook23
-rw-r--r--lib/lwres/man/lwres_hstrerror.html311
-rw-r--r--lib/lwres/man/lwres_inetntop.372
-rw-r--r--lib/lwres/man/lwres_inetntop.docbook23
-rw-r--r--lib/lwres/man/lwres_inetntop.html247
-rw-r--r--lib/lwres/man/lwres_noop.3180
-rw-r--r--lib/lwres/man/lwres_noop.docbook23
-rw-r--r--lib/lwres/man/lwres_noop.html585
-rw-r--r--lib/lwres/man/lwres_packet.3146
-rw-r--r--lib/lwres/man/lwres_packet.docbook23
-rw-r--r--lib/lwres/man/lwres_packet.html482
-rw-r--r--lib/lwres/man/lwres_resutil.3164
-rw-r--r--lib/lwres/man/lwres_resutil.docbook23
-rw-r--r--lib/lwres/man/lwres_resutil.html544
-rw-r--r--lib/lwres/print.c23
-rw-r--r--lib/lwres/strtoul.c135
-rw-r--r--lib/tests/t_api.c6
151 files changed, 7518 insertions, 9729 deletions
diff --git a/lib/bind/Makefile.in b/lib/bind/Makefile.in
index 0a2a1a0f..5c34c1a1 100644
--- a/lib/bind/Makefile.in
+++ b/lib/bind/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 2001-2003 Internet Software Consortium.
#
# Permission to use, copy, modify, and distribute this software for any
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.12.2.5.2.7 2004/12/09 04:07:14 marka Exp $
+# $Id: Makefile.in,v 1.12.2.5.2.9 2005/07/29 00:13:08 marka Exp $
srcdir = @srcdir@
VPATH = @srcdir@
@@ -85,10 +85,11 @@ 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/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@
+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@
diff --git a/lib/bind/api b/lib/bind/api
index acc853bb..06a9880e 100644
--- a/lib/bind/api
+++ b/lib/bind/api
@@ -1,3 +1,3 @@
-LIBINTERFACE = 3
-LIBREVISION = 8
+LIBINTERFACE = 4
+LIBREVISION = 0
LIBAGE = 0
diff --git a/lib/bind/config.h.in b/lib/bind/config.h.in
index 6c86b4de..82a1560d 100644
--- a/lib/bind/config.h.in
+++ b/lib/bind/config.h.in
@@ -1,6 +1,8 @@
#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 SYS_CDEFS_H
#undef _POSIX_PTHREAD_SEMANTICS
@@ -35,6 +37,8 @@
#undef HAS_PW_CLASS
+#undef uintptr_t
+
/* Shut up warnings about sputaux in stdio.h on BSD/OS pre-4.1 */
#undef SHUTUP_SPUTAUX
#ifdef SHUTUP_SPUTAUX
diff --git a/lib/bind/configure b/lib/bind/configure
index 1baa91ee..e4581d1c 100755
--- a/lib/bind/configure
+++ b/lib/bind/configure
@@ -1,5 +1,5 @@
#! /bin/sh
-# From configure.in Revision: 1.83.2.5.2.10 .
+# From configure.in Revision: 1.83.2.5.2.20 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.59.
#
@@ -464,7 +464,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os SET_MAKE RANLIB ac_ct_RANLIB INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA STD_CINCLUDES STD_CDEFINES STD_CWARNINGS CCOPT AR ARFLAGS LN ETAGS PERL CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP ISC_PLATFORM_NEEDSYSSELECTH WANT_IRS_GR WANT_IRS_GR_OBJS WANT_IRS_PW WANT_IRS_PW_OBJS WANT_IRS_NIS WANT_IRS_NIS_OBJS WANT_IRS_NISGR_OBJS WANT_IRS_NISPW_OBJS WANT_IRS_DBPW_OBJS ALWAYS_DEFINES DO_PTHREADS WANT_IRS_THREADSGR_OBJS WANT_IRS_THREADSPW_OBJS WANT_IRS_THREADS_OBJS WANT_THREADS_OBJS USE_IFNAMELINKID ISC_THREAD_DIR DAEMON_OBJS NEED_DAEMON STRSEP_OBJS NEED_STRSEP NEED_STRERROR MKDEPCC MKDEPCFLAGS MKDEPPROG IRIX_DNSSEC_WARNINGS_HACK purify_path PURIFY LN_S ECHO ac_ct_AR STRIP ac_ct_STRIP CXX CXXFLAGS ac_ct_CXX CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL O A SA LIBTOOL_MKDEP_SED LIBTOOL_MODE_COMPILE LIBTOOL_MODE_INSTALL LIBTOOL_MODE_LINK HAS_INET6_STRUCTS ISC_PLATFORM_NEEDNETINETIN6H ISC_PLATFORM_NEEDNETINET6IN6H HAS_IN_ADDR6 NEED_IN6ADDR_ANY ISC_PLATFORM_HAVEIN6PKTINFO ISC_PLATFORM_FIXIN6ISADDR ISC_IPV6_H ISC_IPV6_O ISC_ISCIPV6_O ISC_IPV6_C HAVE_SIN6_SCOPE_ID HAVE_SOCKADDR_STORAGE ISC_PLATFORM_NEEDNTOP ISC_PLATFORM_NEEDPTON ISC_PLATFORM_NEEDATON HAVE_SA_LEN HAVE_MINIMUM_IFREQ BSD_COMP SOLARIS_BITTYPES USE_FIONBIO_IOCTL PORT_DIR PORT_INCLUDE ISC_PLATFORM_MSGHDRFLAVOR ISC_PLATFORM_NEEDPORTT ISC_LWRES_ENDHOSTENTINT ISC_LWRES_SETNETENTINT ISC_LWRES_ENDNETENTINT ISC_LWRES_GETHOSTBYADDRVOID ISC_LWRES_NEEDHERRNO ISC_LWRES_GETIPNODEPROTO ISC_LWRES_GETADDRINFOPROTO ISC_LWRES_GETNAMEINFOPROTO NEED_PSELECT NEED_GETTIMEOFDAY HAVE_STRNDUP ISC_PLATFORM_NEEDSTRSEP ISC_PLATFORM_NEEDVSNPRINTF ISC_EXTRA_OBJS ISC_EXTRA_SRCS USE_SYSERROR_LIST ISC_PLATFORM_QUADFORMAT ISC_SOCKLEN_T GETGROUPLIST_ARGS NET_R_ARGS NET_R_BAD NET_R_COPY NET_R_COPY_ARGS NET_R_OK NET_R_SETANSWER NET_R_RETURN GETNETBYADDR_ADDR_T NETENT_DATA NET_R_ENT_ARGS NET_R_SET_RESULT NET_R_SET_RETURN NET_R_END_RESULT NET_R_END_RETURN GROUP_R_ARGS GROUP_R_BAD GROUP_R_OK GROUP_R_RETURN GROUP_R_END_RESULT GROUP_R_END_RETURN GROUP_R_ENT_ARGS GROUP_R_SET_RESULT GROUP_R_SET_RETURN HOST_R_ARGS HOST_R_BAD HOST_R_COPY HOST_R_COPY_ARGS HOST_R_ERRNO HOST_R_OK HOST_R_RETURN HOST_R_SETANSWER HOSTENT_DATA HOST_R_END_RESULT HOST_R_END_RETURN HOST_R_ENT_ARGS HOST_R_SET_RESULT HOST_R_SET_RETURN SETPWENT_VOID SETGRENT_VOID NGR_R_ARGS NGR_R_BAD NGR_R_COPY NGR_R_COPY_ARGS NGR_R_OK NGR_R_RETURN NGR_R_PRIVATE NGR_R_END_RESULT NGR_R_END_RETURN NGR_R_ENT_ARGS NGR_R_SET_RESULT NGR_R_SET_RETURN PROTO_R_ARGS PROTO_R_BAD PROTO_R_COPY PROTO_R_COPY_ARGS PROTO_R_OK PROTO_R_SETANSWER PROTO_R_RETURN PROTO_R_END_RESULT PROTO_R_END_RETURN PROTO_R_ENT_ARGS PROTO_R_SET_RESULT PROTO_R_SET_RETURN PASS_R_ARGS PASS_R_BAD PASS_R_COPY PASS_R_COPY_ARGS PASS_R_OK PASS_R_RETURN PASS_R_END_RESULT PASS_R_END_RETURN PASS_R_ENT_ARGS PASS_R_SET_RESULT PASS_R_SET_RETURN SERV_R_ARGS SERV_R_BAD SERV_R_COPY SERV_R_COPY_ARGS SERV_R_OK SERV_R_SETANSWER SERV_R_RETURN SERV_R_END_RESULT SERV_R_END_RETURN SERV_R_ENT_ARGS SERV_R_SET_RESULT SERV_R_SET_RETURN SETNETGRENT_ARGS INNETGR_ARGS BIND9_TOP_BUILDDIR BIND9_VERSION LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os SET_MAKE RANLIB ac_ct_RANLIB INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA STD_CINCLUDES STD_CDEFINES STD_CWARNINGS CCOPT AR ARFLAGS LN ETAGS PERL CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP ISC_PLATFORM_NEEDSYSSELECTH WANT_IRS_GR WANT_IRS_GR_OBJS WANT_IRS_PW WANT_IRS_PW_OBJS WANT_IRS_NIS WANT_IRS_NIS_OBJS WANT_IRS_NISGR_OBJS WANT_IRS_NISPW_OBJS WANT_IRS_DBPW_OBJS ALWAYS_DEFINES DO_PTHREADS WANT_IRS_THREADSGR_OBJS WANT_IRS_THREADSPW_OBJS WANT_IRS_THREADS_OBJS WANT_THREADS_OBJS USE_IFNAMELINKID ISC_THREAD_DIR DAEMON_OBJS NEED_DAEMON STRSEP_OBJS NEED_STRSEP NEED_STRERROR MKDEPCC MKDEPCFLAGS MKDEPPROG IRIX_DNSSEC_WARNINGS_HACK purify_path PURIFY LN_S ECHO ac_ct_AR STRIP ac_ct_STRIP CXX CXXFLAGS ac_ct_CXX CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL O A SA LIBTOOL_MKDEP_SED LIBTOOL_MODE_COMPILE LIBTOOL_MODE_INSTALL LIBTOOL_MODE_LINK HAS_INET6_STRUCTS ISC_PLATFORM_NEEDNETINETIN6H ISC_PLATFORM_NEEDNETINET6IN6H HAS_IN_ADDR6 NEED_IN6ADDR_ANY ISC_PLATFORM_HAVEIN6PKTINFO ISC_PLATFORM_FIXIN6ISADDR ISC_IPV6_H ISC_IPV6_O ISC_ISCIPV6_O ISC_IPV6_C HAVE_SIN6_SCOPE_ID HAVE_SOCKADDR_STORAGE ISC_PLATFORM_NEEDNTOP ISC_PLATFORM_NEEDPTON ISC_PLATFORM_NEEDATON HAVE_SA_LEN HAVE_MINIMUM_IFREQ BSD_COMP SOLARIS_BITTYPES USE_FIONBIO_IOCTL PORT_NONBLOCK PORT_DIR USE_POLL HAVE_MD5 SOLARIS2 PORT_INCLUDE ISC_PLATFORM_MSGHDRFLAVOR ISC_PLATFORM_NEEDPORTT ISC_LWRES_ENDHOSTENTINT ISC_LWRES_SETNETENTINT ISC_LWRES_ENDNETENTINT ISC_LWRES_GETHOSTBYADDRVOID ISC_LWRES_NEEDHERRNO ISC_LWRES_GETIPNODEPROTO ISC_LWRES_GETADDRINFOPROTO ISC_LWRES_GETNAMEINFOPROTO NEED_PSELECT NEED_GETTIMEOFDAY HAVE_STRNDUP ISC_PLATFORM_NEEDSTRSEP ISC_PLATFORM_NEEDVSNPRINTF ISC_EXTRA_OBJS ISC_EXTRA_SRCS USE_SYSERROR_LIST ISC_PLATFORM_QUADFORMAT ISC_SOCKLEN_T GETGROUPLIST_ARGS NET_R_ARGS NET_R_BAD NET_R_COPY NET_R_COPY_ARGS NET_R_OK NET_R_SETANSWER NET_R_RETURN GETNETBYADDR_ADDR_T NETENT_DATA NET_R_ENT_ARGS NET_R_SET_RESULT NET_R_SET_RETURN NET_R_END_RESULT NET_R_END_RETURN GROUP_R_ARGS GROUP_R_BAD GROUP_R_OK GROUP_R_RETURN GROUP_R_END_RESULT GROUP_R_END_RETURN GROUP_R_ENT_ARGS GROUP_R_SET_RESULT GROUP_R_SET_RETURN HOST_R_ARGS HOST_R_BAD HOST_R_COPY HOST_R_COPY_ARGS HOST_R_ERRNO HOST_R_OK HOST_R_RETURN HOST_R_SETANSWER HOSTENT_DATA HOST_R_END_RESULT HOST_R_END_RETURN HOST_R_ENT_ARGS HOST_R_SET_RESULT HOST_R_SET_RETURN SETPWENT_VOID SETGRENT_VOID NGR_R_ARGS NGR_R_BAD NGR_R_COPY NGR_R_COPY_ARGS NGR_R_OK NGR_R_RETURN NGR_R_PRIVATE NGR_R_END_RESULT NGR_R_END_RETURN NGR_R_ENT_ARGS NGR_R_SET_RESULT NGR_R_SET_RETURN PROTO_R_ARGS PROTO_R_BAD PROTO_R_COPY PROTO_R_COPY_ARGS PROTO_R_OK PROTO_R_SETANSWER PROTO_R_RETURN PROTO_R_END_RESULT PROTO_R_END_RETURN PROTO_R_ENT_ARGS PROTO_R_SET_RESULT PROTO_R_SET_RETURN PASS_R_ARGS PASS_R_BAD PASS_R_COPY PASS_R_COPY_ARGS PASS_R_OK PASS_R_RETURN PASS_R_END_RESULT PASS_R_END_RETURN PASS_R_ENT_ARGS PASS_R_SET_RESULT PASS_R_SET_RETURN SERV_R_ARGS SERV_R_BAD SERV_R_COPY SERV_R_COPY_ARGS SERV_R_OK SERV_R_SETANSWER SERV_R_RETURN SERV_R_END_RESULT SERV_R_END_RETURN SERV_R_ENT_ARGS SERV_R_SET_RESULT SERV_R_SET_RETURN SETNETGRENT_ARGS INNETGR_ARGS BIND9_TOP_BUILDDIR BIND9_VERSION LIBOBJS LTLIBOBJS'
ac_subst_files='BIND9_INCLUDES BIND9_MAKE_RULES LIBBIND_API'
# Initialize some variables set by options.
@@ -1019,7 +1019,7 @@ if test -n "$ac_init_help"; then
Optional Features:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --disable-threads disable multithreading
+ --enable-threads enable multithreading
--enable-shared[=PKGS]
build shared libraries [default=yes]
--enable-static[=PKGS]
@@ -3472,7 +3472,8 @@ done
-for ac_header in fcntl.h db.h paths.h sys/time.h unistd.h sys/sockio.h sys/select.h sys/timers.h
+
+for ac_header in fcntl.h db.h paths.h sys/time.h unistd.h sys/sockio.h sys/select.h sys/timers.h stropts.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if eval "test \"\${$as_ac_Header+set}\" = set"; then
@@ -3622,7 +3623,6 @@ fi
done
-
echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
if test "${ac_cv_c_const+set}" = set; then
@@ -3867,6 +3867,72 @@ _ACEOF
fi
+echo "$as_me:$LINENO: checking for uintptr_t" >&5
+echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6
+if test "${ac_cv_type_uintptr_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if ((uintptr_t *) 0)
+ return 0;
+if (sizeof (uintptr_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_uintptr_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_uintptr_t=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5
+echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6
+if test $ac_cv_type_uintptr_t = yes; then
+ :
+else
+
+cat >>confdefs.h <<_ACEOF
+#define uintptr_t unsigned long
+_ACEOF
+
+fi
+
echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
if test "${ac_cv_header_time+set}" = set; then
@@ -4435,24 +4501,81 @@ esac
#
# First, decide whether to use multithreading or not.
#
-echo "$as_me:$LINENO: checking whether to look for thread support" >&5
-echo $ECHO_N "checking whether to look for thread support... $ECHO_C" >&6
+# Enable multithreading by default on systems where it is known
+# to work well, and where debugging of multithreaded programs
+# is supported.
+#
+
+echo "$as_me:$LINENO: checking whether to build with thread support" >&5
+echo $ECHO_N "checking whether to build with thread support... $ECHO_C" >&6
+
+case $host in
+*-dec-osf*)
+ use_threads=true ;;
+*-solaris2.[0-6])
+ # Thread signals are broken on Solaris 2.6; they are sometimes
+ # delivered to the wrong thread.
+ use_threads=false ;;
+*-solaris*)
+ use_threads=true ;;
+*-ibm-aix*)
+ use_threads=true ;;
+*-hp-hpux10*)
+ use_threads=false ;;
+*-hp-hpux11*)
+ use_threads=true ;;
+*-sgi-irix*)
+ use_threads=true ;;
+*-sco-sysv*uw*|*-*-sysv*UnixWare*)
+ # UnixWare
+ use_threads=false ;;
+*-*-sysv*OpenUNIX*)
+ # UnixWare
+ use_threads=true ;;
+*-netbsd*)
+ if test -r /usr/lib/libpthread.so ; then
+ use_threads=true
+ else
+ # Socket I/O optimizations introduced in 9.2 expose a
+ # bug in unproven-pthreads; see PR #12650
+ use_threads=false
+ fi
+ ;;
+*-openbsd*)
+ # OpenBSD users have reported that named dumps core on
+ # startup when built with threads.
+ use_threads=false ;;
+*-freebsd*)
+ use_threads=false ;;
+*-bsdi234*)
+ # Thread signals do not work reliably on some versions of BSD/OS.
+ use_threads=false ;;
+*-bsdi5*)
+ use_threads=true ;;
+*-linux*)
+ # Threads are disabled on Linux by default because most
+ # Linux kernels produce unusable core dumps from multithreaded
+ # programs, and because of limitations in setuid().
+ use_threads=false ;;
+*)
+ use_threads=false ;;
+esac
+
# Check whether --enable-threads or --disable-threads was given.
if test "${enable_threads+set}" = set; then
enableval="$enable_threads"
fi;
case "$enable_threads" in
- yes|'')
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+ yes)
use_threads=true
;;
no)
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
use_threads=false
;;
+ '')
+ # Use system-dependent default
+ ;;
*)
{ { echo "$as_me:$LINENO: error: --enable-threads takes yes or no" >&5
echo "$as_me: error: --enable-threads takes yes or no" >&2;}
@@ -4462,6 +4585,15 @@ esac
if $use_threads
then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+if $use_threads
+then
#
# Search for / configure pthreads in a system-dependent fashion.
#
@@ -4497,23 +4629,32 @@ echo "${ECHO_T}PTL2" >&6
echo "$as_me: WARNING: linking with PTL2 is highly experimental and not expected to work" >&2;}
CC=ptlgcc
else
- if test ! -d $LOCALBASE/pthreads
+ if test -r /usr/lib/libpthread.so
then
- echo "$as_me:$LINENO: result: none" >&5
+ echo "$as_me:$LINENO: result: native" >&5
+echo "${ECHO_T}native" >&6
+ LIBS="-lpthread $LIBS"
+ else
+ if test ! -d $LOCALBASE/pthreads
+ then
+ echo "$as_me:$LINENO: result: none" >&5
echo "${ECHO_T}none" >&6
- use_threads=false
- fi
+ { { echo "$as_me:$LINENO: error: \"could not find thread libraries\"" >&5
+echo "$as_me: error: \"could not find thread libraries\"" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
- if $use_threads
- then
- echo "$as_me:$LINENO: result: mit-pthreads/unproven-pthreads" >&5
+ if $use_threads
+ then
+ echo "$as_me:$LINENO: result: mit-pthreads/unproven-pthreads" >&5
echo "${ECHO_T}mit-pthreads/unproven-pthreads" >&6
- pkg="$LOCALBASE/pthreads"
- lib1="-L$pkg/lib -Wl,-R$pkg/lib"
- lib2="-lpthread -lm -lgcc -lpthread"
- LIBS="$lib1 $lib2 $LIBS"
- CPPFLAGS="$CPPFLAGS -I$pkg/include"
- STD_CINCLUDES="$STD_CINCLUDES -I$pkg/include"
+ pkg="$LOCALBASE/pthreads"
+ lib1="-L$pkg/lib -Wl,-R$pkg/lib"
+ lib2="-lpthread -lm -lgcc -lpthread"
+ LIBS="$lib1 $lib2 $LIBS"
+ CPPFLAGS="$CPPFLAGS -I$pkg/include"
+ STD_CINCLUDES="$STD_CINCLUDES -I$pkg/include"
+ fi
fi
fi
;;
@@ -4883,7 +5024,9 @@ _ACEOF
LIBS="-lc $LIBS"
else
- use_threads=false
+ { { echo "$as_me:$LINENO: error: \"could not find thread libraries\"" >&5
+echo "$as_me: error: \"could not find thread libraries\"" >&2;}
+ { (exit 1); exit 1; }; }
fi
fi
@@ -5444,6 +5587,10 @@ _ACEOF
;;
*hpux11*)
cat >>confdefs.h <<\_ACEOF
+#define NEED_ENDNETGRENT_R 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
#define _PTHREADS_DRAFT4 1
_ACEOF
@@ -5597,6 +5744,10 @@ fi
;;
esac
fi
+ cat >>confdefs.h <<\_ACEOF
+#define _REENTRANT 1
+_ACEOF
+
ALWAYS_DEFINES="-D_REENTRANT"
DO_PTHREADS="#define DO_PTHREADS 1"
WANT_IRS_THREADSGR_OBJS="\${WANT_IRS_THREADSGR_OBJS}"
@@ -5614,6 +5765,13 @@ else
thread_dir=nothreads
fi
+
+
+
+
+
+
+
echo "$as_me:$LINENO: checking for strlcat" >&5
echo $ECHO_N "checking for strlcat... $ECHO_C" >&6
if test "${ac_cv_func_strlcat+set}" = set; then
@@ -5712,13 +5870,6 @@ _ACEOF
fi
-
-
-
-
-
-
-
echo "$as_me:$LINENO: checking for if_nametoindex" >&5
echo $ECHO_N "checking for if_nametoindex... $ECHO_C" >&6
if test "${ac_cv_func_if_nametoindex+set}" = set; then
@@ -7296,7 +7447,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 7299 "configure"' > conftest.$ac_ext
+ echo '#line 7450 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -8293,7 +8444,7 @@ fi
# Provide some information about the compiler.
-echo "$as_me:8296:" \
+echo "$as_me:8447:" \
"checking for Fortran 77 compiler version" >&5
ac_compiler=`set X $ac_compile; echo $2`
{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
@@ -9354,11 +9505,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:9357: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:9508: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:9361: \$? = $ac_status" >&5
+ echo "$as_me:9512: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -9597,11 +9748,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:9600: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:9751: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:9604: \$? = $ac_status" >&5
+ echo "$as_me:9755: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -9657,11 +9808,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:9660: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:9811: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:9664: \$? = $ac_status" >&5
+ echo "$as_me:9815: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -11842,7 +11993,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 11845 "configure"
+#line 11996 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11940,7 +12091,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 11943 "configure"
+#line 12094 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -14137,11 +14288,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14140: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14291: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:14144: \$? = $ac_status" >&5
+ echo "$as_me:14295: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -14197,11 +14348,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14200: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14351: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:14204: \$? = $ac_status" >&5
+ echo "$as_me:14355: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -15558,7 +15709,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 15561 "configure"
+#line 15712 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -15656,7 +15807,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 15659 "configure"
+#line 15810 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -16493,11 +16644,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16496: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16647: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:16500: \$? = $ac_status" >&5
+ echo "$as_me:16651: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -16553,11 +16704,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16556: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16707: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:16560: \$? = $ac_status" >&5
+ echo "$as_me:16711: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -18592,11 +18743,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:18595: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:18746: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:18599: \$? = $ac_status" >&5
+ echo "$as_me:18750: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -18835,11 +18986,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:18838: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:18989: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:18842: \$? = $ac_status" >&5
+ echo "$as_me:18993: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -18895,11 +19046,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:18898: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:19049: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:18902: \$? = $ac_status" >&5
+ echo "$as_me:19053: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -21080,7 +21231,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 21083 "configure"
+#line 21234 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -21178,7 +21329,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 21181 "configure"
+#line 21332 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -23007,6 +23158,10 @@ 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";;
@@ -23014,7 +23169,9 @@ case "$host" in
*aux3*) PORT_DIR="port/aux3";;
*-bsdi2*) PORT_DIR="port/bsdos2";;
*-bsdi*) PORT_DIR="port/bsdos";;
- *-cygwin*) PORT_DIR="port/cygwin";;
+ *-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";;
@@ -23030,16 +23187,28 @@ case "$host" in
*-openbsd*) PORT_DIR="port/openbsd";;
*-qnx*) PORT_DIR="port/qnx";;
*-rhapsody*) PORT_DIR="port/rhapsody";;
- *-solaris2.[01234]*)
+ *-sunos4*)
+ 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*)
+ *-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";;
@@ -23050,10 +23219,14 @@ esac
-PORT_INCLUDE=${PORT_DIR}/include
+
+
+PORT_INCLUDE=${PORT_DIR}/include
+
+
#
# Look for a 4.4BSD or 4.3BSD struct msghdr
#
@@ -25518,6 +25691,66 @@ else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#undef __USE_MISC
+#define __USE_MISC
+#include <netdb.h>
+int getnetbyaddr_r (uint32_t, int, struct netent *,
+ char *, size_t, struct netent **, int *);
+
+int
+main ()
+{
+return (0)
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+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"
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
@@ -26805,7 +27038,7 @@ 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="#define HOST_R_ERRNO NULL"
+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"
@@ -30489,7 +30722,6 @@ case "$host" in
hack_shutup_in6addr_init_macros=yes
;;
*-solaris2.8)
- hack_shutup_pthreadmutexinit=yes
hack_shutup_in6addr_init_macros=yes
;;
*-solaris2.9)
@@ -31304,7 +31536,11 @@ s,@HAVE_MINIMUM_IFREQ@,$HAVE_MINIMUM_IFREQ,;t t
s,@BSD_COMP@,$BSD_COMP,;t t
s,@SOLARIS_BITTYPES@,$SOLARIS_BITTYPES,;t t
s,@USE_FIONBIO_IOCTL@,$USE_FIONBIO_IOCTL,;t t
+s,@PORT_NONBLOCK@,$PORT_NONBLOCK,;t t
s,@PORT_DIR@,$PORT_DIR,;t t
+s,@USE_POLL@,$USE_POLL,;t t
+s,@HAVE_MD5@,$HAVE_MD5,;t t
+s,@SOLARIS2@,$SOLARIS2,;t t
s,@PORT_INCLUDE@,$PORT_INCLUDE,;t t
s,@ISC_PLATFORM_MSGHDRFLAVOR@,$ISC_PLATFORM_MSGHDRFLAVOR,;t t
s,@ISC_PLATFORM_NEEDPORTT@,$ISC_PLATFORM_NEEDPORTT,;t t
diff --git a/lib/bind/configure.in b/lib/bind/configure.in
index 74c18704..aad31d3b 100644
--- a/lib/bind/configure.in
+++ b/lib/bind/configure.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 2001 Internet Software Consortium.
#
# Permission to use, copy, modify, and distribute this software for any
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-AC_REVISION($Revision: 1.83.2.5.2.10 $)
+AC_REVISION($Revision: 1.83.2.5.2.20 $)
AC_INIT(resolv/herror.c)
AC_PREREQ(2.13)
@@ -169,12 +169,12 @@ 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)
-
+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)
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
+AC_CHECK_TYPE(uintptr_t,unsigned long)
AC_HEADER_TIME
#
# check if we need to #include sys/select.h explicitly
@@ -315,86 +315,7 @@ case "$use_randomdev" in
;;
esac
-#
-# Begin pthreads checking.
-#
-# First, decide whether to use multithreading or not.
-#
-AC_MSG_CHECKING(whether to look for thread support)
-AC_ARG_ENABLE(threads,
- [ --disable-threads disable multithreading])
-case "$enable_threads" in
- yes|'')
- AC_MSG_RESULT(yes)
- use_threads=true
- ;;
- no)
- AC_MSG_RESULT(no)
- use_threads=false
- ;;
- *)
- AC_MSG_ERROR([--enable-threads takes yes or no])
- ;;
-esac
-
-if $use_threads
-then
- #
- # Search for / configure pthreads in a system-dependent fashion.
- #
- case "$host" in
- *-netbsd*)
- # NetBSD has multiple pthreads implementations. The
- # recommended one to use is "unproven-pthreads". The
- # older "mit-pthreads" may also work on some NetBSD
- # versions. The PTL2 thread library does not
- # currently work with bind9, but can be chosen with
- # the --with-ptl2 option for those who wish to
- # experiment with it.
- CC="gcc"
- AC_MSG_CHECKING(which NetBSD thread library to use)
-
- AC_ARG_WITH(ptl2,
-[ --with-ptl2 on NetBSD, use the ptl2 thread library (experimental)],
- use_ptl2="$withval", use_ptl2="no")
-
- : ${LOCALBASE:=/usr/pkg}
-
- if test "X$use_ptl2" = "Xyes"
- then
- AC_MSG_RESULT(PTL2)
- AC_MSG_WARN(
-[linking with PTL2 is highly experimental and not expected to work])
- CC=ptlgcc
- else
- if test ! -d $LOCALBASE/pthreads
- then
- AC_MSG_RESULT(none)
- use_threads=false
- fi
-
- if $use_threads
- then
- AC_MSG_RESULT(mit-pthreads/unproven-pthreads)
- pkg="$LOCALBASE/pthreads"
- lib1="-L$pkg/lib -Wl,-R$pkg/lib"
- lib2="-lpthread -lm -lgcc -lpthread"
- LIBS="$lib1 $lib2 $LIBS"
- CPPFLAGS="$CPPFLAGS -I$pkg/include"
- STD_CINCLUDES="$STD_CINCLUDES -I$pkg/include"
- fi
- fi
- ;;
- *)
- AC_CHECK_LIB(pthread, pthread_create,,
- AC_CHECK_LIB(pthread, __pthread_create,,
- AC_CHECK_LIB(pthread, __pthread_create_system,,
- AC_CHECK_LIB(c_r, pthread_create,,
- AC_CHECK_LIB(c, pthread_create,,
- use_threads=false)))))
- ;;
- esac
-fi
+sinclude(../../config.threads.in)dnl
if $use_threads
then
@@ -451,6 +372,7 @@ then
AC_DEFINE(POSIX_GETGRNAM_R)
;;
*hpux11*)
+ AC_DEFINE(NEED_ENDNETGRENT_R)
AC_DEFINE(_PTHREADS_DRAFT4)
;;
#
@@ -503,6 +425,7 @@ then
;;
esac
fi
+ AC_DEFINE(_REENTRANT)
ALWAYS_DEFINES="-D_REENTRANT"
DO_PTHREADS="#define DO_PTHREADS 1"
WANT_IRS_THREADSGR_OBJS="\${WANT_IRS_THREADSGR_OBJS}"
@@ -520,8 +443,6 @@ else
thread_dir=nothreads
fi
-AC_CHECK_FUNC(strlcat, AC_DEFINE(HAVE_STRLCAT))
-
AC_SUBST(ALWAYS_DEFINES)
AC_SUBST(DO_PTHREADS)
AC_SUBST(WANT_IRS_THREADSGR_OBJS)
@@ -529,6 +450,8 @@ 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(if_nametoindex,
[USE_IFNAMELINKID="#define USE_IFNAMELINKID 1"],
[USE_IFNAMELINKID="#undef USE_IFNAMELINKID"])
@@ -1075,6 +998,10 @@ 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";;
@@ -1082,7 +1009,9 @@ case "$host" in
*aux3*) PORT_DIR="port/aux3";;
*-bsdi2*) PORT_DIR="port/bsdos2";;
*-bsdi*) PORT_DIR="port/bsdos";;
- *-cygwin*) PORT_DIR="port/cygwin";;
+ *-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";;
@@ -1098,30 +1027,46 @@ case "$host" in
*-openbsd*) PORT_DIR="port/openbsd";;
*-qnx*) PORT_DIR="port/qnx";;
*-rhapsody*) PORT_DIR="port/rhapsody";;
- *-solaris2.[[01234]]*)
+ *-sunos4*)
+ 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*)
+ *-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
#
@@ -1453,6 +1398,26 @@ 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"
+],
+)
)
)
)
@@ -1646,7 +1611,7 @@ 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="#define HOST_R_ERRNO NULL"
+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"
@@ -2327,7 +2292,6 @@ case "$host" in
hack_shutup_in6addr_init_macros=yes
;;
*-solaris2.8)
- hack_shutup_pthreadmutexinit=yes
hack_shutup_in6addr_init_macros=yes
;;
*-solaris2.9)
diff --git a/lib/bind/dst/dst_api.c b/lib/bind/dst/dst_api.c
index 5f67bd95..b33aebc8 100644
--- a/lib/bind/dst/dst_api.c
+++ b/lib/bind/dst/dst_api.c
@@ -1,5 +1,5 @@
#ifndef LINT
-static const char rcsid[] = "$Header: /proj/cvs/prod/bind9/lib/bind/dst/dst_api.c,v 1.4.2.6.8.1 2004/09/16 00:57:33 marka Exp $";
+static const char rcsid[] = "$Header: /proj/cvs/prod/bind9/lib/bind/dst/dst_api.c,v 1.4.2.6.8.2 2005/07/28 07:43:16 marka Exp $";
#endif
/*
@@ -336,7 +336,10 @@ dst_read_key(const char *in_keyname, const u_int16_t in_id,
if (in_keyname == NULL) {
EREPORT(("dst_read_private_key(): Null key name passed in\n"));
return (NULL);
- } else
+ } 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 */
@@ -347,7 +350,7 @@ dst_read_key(const char *in_keyname, const u_int16_t in_id,
return pubkey;
if (!(dg_key = dst_s_get_key_struct(keyname, pubkey->dk_alg,
- pubkey->dk_flags, pubkey->dk_proto,
+ pubkey->dk_flags, pubkey->dk_proto,
0)))
return (dg_key);
/* Fill in private key and some fields in the general key structure */
diff --git a/lib/bind/dst/hmac_link.c b/lib/bind/dst/hmac_link.c
index 8a641d0b..aa66c80e 100644
--- a/lib/bind/dst/hmac_link.c
+++ b/lib/bind/dst/hmac_link.c
@@ -1,6 +1,6 @@
#ifdef HMAC_MD5
#ifndef LINT
-static const char rcsid[] = "$Header: /proj/cvs/prod/bind9/lib/bind/dst/hmac_link.c,v 1.2.2.1 2003/06/27 03:51:36 marka Exp $";
+static const char rcsid[] = "$Header: /proj/cvs/prod/bind9/lib/bind/dst/hmac_link.c,v 1.2.2.1.4.1 2005/07/28 07:43:16 marka Exp $";
#endif
/*
* Portions Copyright (c) 1995-1998 by Trusted Information Systems, Inc.
@@ -36,8 +36,15 @@ static const char rcsid[] = "$Header: /proj/cvs/prod/bind9/lib/bind/dst/hmac_lin
#include <resolv.h>
#include "dst_internal.h"
+
#ifdef USE_MD5
-# include "md5.h"
+# 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
@@ -438,7 +445,11 @@ dst_hmac_md5_generate_key(DST_KEY *key, const int nothing)
* 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);
diff --git a/lib/bind/dst/md5.h b/lib/bind/dst/md5.h
index c886d17b..6525662b 100644
--- a/lib/bind/dst/md5.h
+++ b/lib/bind/dst/md5.h
@@ -59,6 +59,8 @@
#ifndef HEADER_MD5_H
#define HEADER_MD5_H
+#ifndef HAVE_MD5
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -99,3 +101,6 @@ unsigned char *MD5();
#endif
#endif
+#else
+#include <sys/md5.h>
+#endif /* HAVE_MD5 */
diff --git a/lib/bind/dst/md5_dgst.c b/lib/bind/dst/md5_dgst.c
index 48c327ea..ba0a5a13 100644
--- a/lib/bind/dst/md5_dgst.c
+++ b/lib/bind/dst/md5_dgst.c
@@ -58,6 +58,7 @@
#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>
@@ -367,4 +368,5 @@ unsigned long *l;
}
}
#endif
+#endif /* HAVE_MD5 */
#endif /* USE_MD5 */
diff --git a/lib/bind/dst/support.c b/lib/bind/dst/support.c
index 7b86ea98..7f66ca4f 100644
--- a/lib/bind/dst/support.c
+++ b/lib/bind/dst/support.c
@@ -1,4 +1,4 @@
-static const char rcsid[] = "$Header: /proj/cvs/prod/bind9/lib/bind/dst/support.c,v 1.2.2.1 2001/11/02 22:25:29 gson Exp $";
+static const char rcsid[] = "$Header: /proj/cvs/prod/bind9/lib/bind/dst/support.c,v 1.2.2.1.10.1 2005/07/28 07:43:17 marka Exp $";
/*
@@ -311,19 +311,15 @@ dst_s_fopen(const char *filename, const char *mode, int perm)
{
FILE *fp;
char pathname[PATH_MAX];
- size_t plen = sizeof(pathname);
+
+ if (strlen(filename) + strlen(dst_path) >= sizeof(pathname))
+ return (NULL);
if (*dst_path != '\0') {
strcpy(pathname, dst_path);
- plen -= strlen(pathname);
- }
- else
- pathname[0] = '\0';
-
- if (plen > strlen(filename))
- strncpy(&pathname[PATH_MAX - plen], filename, plen-1);
- else
- return (NULL);
+ strcat(pathname, filename);
+ } else
+ strcpy(pathname, filename);
fp = fopen(pathname, mode);
if (perm)
diff --git a/lib/bind/include/isc/eventlib.h b/lib/bind/include/isc/eventlib.h
index 6750e4d2..033b3123 100644
--- a/lib/bind/include/isc/eventlib.h
+++ b/lib/bind/include/isc/eventlib.h
@@ -18,7 +18,7 @@
/* eventlib.h - exported interfaces for eventlib
* vix 09sep95 [initial]
*
- * $Id: eventlib.h,v 1.1.2.1.4.1 2004/03/09 08:33:31 marka Exp $
+ * $Id: eventlib.h,v 1.1.2.1.4.2 2005/07/28 07:43:18 marka Exp $
*/
#ifndef _EVENTLIB_H
@@ -76,6 +76,8 @@ typedef struct { unsigned char mask[256/8]; } evByteMask;
#define EV_WRITE 2
#define EV_EXCEPT 4
+#define EV_WASNONBLOCKING 8 /* Internal library use. */
+
/* eventlib.c */
#define evCreate __evCreate
#define evSetDebug __evSetDebug
diff --git a/lib/bind/include/resolv.h b/lib/bind/include/resolv.h
index f4f3fa47..87a95200 100644
--- a/lib/bind/include/resolv.h
+++ b/lib/bind/include/resolv.h
@@ -50,7 +50,7 @@
/*
* @(#)resolv.h 8.1 (Berkeley) 6/2/93
- * $Id: resolv.h,v 1.7.2.11.4.2 2004/06/25 00:41:05 marka Exp $
+ * $Id: resolv.h,v 1.7.2.11.4.3 2005/08/25 04:44:13 marka Exp $
*/
#ifndef _RESOLV_H_
@@ -291,6 +291,11 @@ 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
diff --git a/lib/bind/include/resolv_mt.h b/lib/bind/include/resolv_mt.h
new file mode 100644
index 00000000..27963a12
--- /dev/null
+++ b/lib/bind/include/resolv_mt.h
@@ -0,0 +1,47 @@
+#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/inet_pton.c b/lib/bind/inet/inet_pton.c
index c7813f83..f18a7b64 100644
--- a/lib/bind/inet/inet_pton.c
+++ b/lib/bind/inet/inet_pton.c
@@ -16,7 +16,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: inet_pton.c,v 1.2.206.1 2004/03/09 08:33:33 marka Exp $";
+static const char rcsid[] = "$Id: inet_pton.c,v 1.2.206.2 2005/07/28 07:43:18 marka Exp $";
#endif /* LIBC_SCCS and not lint */
#include "port_before.h"
@@ -141,7 +141,7 @@ inet_pton6(src, dst)
xdigits_u[] = "0123456789ABCDEF";
u_char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp;
const char *xdigits, *curtok;
- int ch, saw_xdigit;
+ int ch, seen_xdigits;
u_int val;
memset((tp = tmp), '\0', NS_IN6ADDRSZ);
@@ -152,7 +152,7 @@ inet_pton6(src, dst)
if (*++src != ':')
return (0);
curtok = src;
- saw_xdigit = 0;
+ seen_xdigits = 0;
val = 0;
while ((ch = *src++) != '\0') {
const char *pch;
@@ -162,14 +162,13 @@ inet_pton6(src, dst)
if (pch != NULL) {
val <<= 4;
val |= (pch - xdigits);
- if (val > 0xffff)
+ if (++seen_xdigits > 4)
return (0);
- saw_xdigit = 1;
continue;
}
if (ch == ':') {
curtok = src;
- if (!saw_xdigit) {
+ if (!seen_xdigits) {
if (colonp)
return (0);
colonp = tp;
@@ -181,19 +180,19 @@ inet_pton6(src, dst)
return (0);
*tp++ = (u_char) (val >> 8) & 0xff;
*tp++ = (u_char) val & 0xff;
- saw_xdigit = 0;
+ seen_xdigits = 0;
val = 0;
continue;
}
if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) &&
inet_pton4(curtok, tp) > 0) {
tp += NS_INADDRSZ;
- saw_xdigit = 0;
+ seen_xdigits = 0;
break; /* '\0' was seen by inet_pton4(). */
}
return (0);
}
- if (saw_xdigit) {
+ if (seen_xdigits) {
if (tp + NS_INT16SZ > endp)
return (0);
*tp++ = (u_char) (val >> 8) & 0xff;
diff --git a/lib/bind/inet/nsap_addr.c b/lib/bind/inet/nsap_addr.c
index 0b9108a9..a4b98e7c 100644
--- a/lib/bind/inet/nsap_addr.c
+++ b/lib/bind/inet/nsap_addr.c
@@ -16,7 +16,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: nsap_addr.c,v 1.2.206.1 2004/03/09 08:33:33 marka Exp $";
+static const char rcsid[] = "$Id: nsap_addr.c,v 1.2.206.2 2005/07/28 07:43:18 marka Exp $";
#endif /* LIBC_SCCS and not lint */
#include "port_before.h"
@@ -31,6 +31,7 @@ static const char rcsid[] = "$Id: nsap_addr.c,v 1.2.206.1 2004/03/09 08:33:33 ma
#include <ctype.h>
#include <resolv.h>
+#include <resolv_mt.h>
#include "port_after.h"
@@ -79,7 +80,7 @@ char *
inet_nsap_ntoa(int binlen, const u_char *binary, char *ascii) {
int nib;
int i;
- static char tmpbuf[2+255*3];
+ char *tmpbuf = inet_nsap_ntoa_tmpbuf;
char *start;
if (ascii)
diff --git a/lib/bind/irs/getaddrinfo.c b/lib/bind/irs/getaddrinfo.c
index e08cf784..4f741a8e 100644
--- a/lib/bind/irs/getaddrinfo.c
+++ b/lib/bind/irs/getaddrinfo.c
@@ -244,6 +244,7 @@ do { \
goto free; \
} while (/*CONSTCOND*/0)
+#ifndef SOLARIS2
#define ERR(err) \
do { \
/* external reference: error, and label bad */ \
@@ -251,6 +252,16 @@ do { \
goto bad; \
/*NOTREACHED*/ \
} while (/*CONSTCOND*/0)
+#else
+#define ERR(err) \
+do { \
+ /* external reference: error, and label bad */ \
+ error = (err); \
+ if (error == error) \
+ goto bad; \
+} while (/*CONSTCOND*/0)
+#endif
+
#define MATCH_FAMILY(x, y, w) \
((x) == (y) || (/*CONSTCOND*/(w) && ((x) == PF_UNSPEC || (y) == PF_UNSPEC)))
@@ -321,6 +332,15 @@ getaddrinfo(hostname, servname, hints, res)
pai->ai_family = PF_UNSPEC;
pai->ai_socktype = ANY;
pai->ai_protocol = ANY;
+#ifdef __sparcv9
+ /*
+ * clear _ai_pad to preserve binary
+ * compatibility with previously compiled 64-bit
+ * applications in a pre-SUSv3 environment by
+ * guaranteeing the upper 32-bits are empty.
+ */
+ pai->_ai_pad = 0;
+#endif /* __sparcv9 */
pai->ai_addrlen = 0;
pai->ai_canonname = NULL;
pai->ai_addr = NULL;
@@ -345,6 +365,13 @@ getaddrinfo(hostname, servname, hints, res)
}
memcpy(pai, hints, sizeof(*pai));
+#ifdef __sparcv9
+ /*
+ * We need to clear _ai_pad to preserve binary
+ * compatibility. See prior comment.
+ */
+ pai->_ai_pad = 0;
+#endif
/*
* if both socktype/protocol are specified, check if they
* are meaningful combination.
diff --git a/lib/bind/irs/gethostent_r.c b/lib/bind/irs/gethostent_r.c
index 28f1a7f7..8a7cff06 100644
--- a/lib/bind/irs/gethostent_r.c
+++ b/lib/bind/irs/gethostent_r.c
@@ -16,7 +16,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: gethostent_r.c,v 1.4.206.3 2004/09/01 02:03:07 marka Exp $";
+static const char rcsid[] = "$Id: gethostent_r.c,v 1.4.206.4 2005/09/03 12:47:38 marka Exp $";
#endif /* LIBC_SCCS and not lint */
#include <port_before.h>
@@ -44,7 +44,9 @@ gethostbyname_r(const char *name, struct hostent *hptr, HOST_R_ARGS) {
int n = 0;
#endif
+#ifdef HOST_R_ERRNO
HOST_R_ERRNO;
+#endif
#ifdef HOST_R_SETANSWER
if (he == NULL || (n = copy_hostent(he, hptr, HOST_R_COPY)) != 0)
@@ -69,7 +71,9 @@ gethostbyaddr_r(const char *addr, int len, int type,
int n = 0;
#endif
+#ifdef HOST_R_ERRNO
HOST_R_ERRNO;
+#endif
#ifdef HOST_R_SETANSWER
if (he == NULL || (n = copy_hostent(he, hptr, HOST_R_COPY)) != 0)
@@ -99,7 +103,9 @@ gethostent_r(struct hostent *hptr, HOST_R_ARGS) {
int n = 0;
#endif
+#ifdef HOST_R_ERRNO
HOST_R_ERRNO;
+#endif
#ifdef HOST_R_SETANSWER
if (he == NULL || (n = copy_hostent(he, hptr, HOST_R_COPY)) != 0)
@@ -123,6 +129,9 @@ sethostent_r(int stay_open, HOST_R_ENT_ARGS)
sethostent_r(int stay_open)
#endif
{
+#ifdef HOST_R_ENT_ARGS
+ UNUSED(hdptr);
+#endif
sethostent(stay_open);
#ifdef HOST_R_SET_RESULT
return (HOST_R_SET_RESULT);
@@ -136,6 +145,9 @@ endhostent_r(HOST_R_ENT_ARGS)
endhostent_r(void)
#endif
{
+#ifdef HOST_R_ENT_ARGS
+ UNUSED(hdptr);
+#endif
endhostent();
HOST_R_END_RESULT(HOST_R_OK);
}
diff --git a/lib/bind/irs/getnetent_r.c b/lib/bind/irs/getnetent_r.c
index 0b540b00..1f8290d1 100644
--- a/lib/bind/irs/getnetent_r.c
+++ b/lib/bind/irs/getnetent_r.c
@@ -16,7 +16,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: getnetent_r.c,v 1.3.206.1 2004/03/09 08:33:36 marka Exp $";
+static const char rcsid[] = "$Id: getnetent_r.c,v 1.3.206.2 2005/09/03 12:47:38 marka Exp $";
#endif /* LIBC_SCCS and not lint */
#include <port_before.h>
@@ -118,6 +118,9 @@ setnetent_r(int stay_open, NET_R_ENT_ARGS)
setnetent_r(int stay_open)
#endif
{
+#ifdef NET_R_ENT_ARGS
+ UNUSED(ndptr);
+#endif
setnetent(stay_open);
#ifdef NET_R_SET_RESULT
return (NET_R_SET_RESULT);
@@ -131,6 +134,9 @@ endnetent_r(NET_R_ENT_ARGS)
endnetent_r()
#endif
{
+#ifdef NET_R_ENT_ARGS
+ UNUSED(ndptr);
+#endif
endnetent();
NET_R_END_RESULT(NET_R_OK);
}
diff --git a/lib/bind/irs/getnetgrent_r.c b/lib/bind/irs/getnetgrent_r.c
index bb78b562..b5d9bb16 100644
--- a/lib/bind/irs/getnetgrent_r.c
+++ b/lib/bind/irs/getnetgrent_r.c
@@ -16,7 +16,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: getnetgrent_r.c,v 1.5.2.1.4.3 2004/11/30 01:15:43 marka Exp $";
+static const char rcsid[] = "$Id: getnetgrent_r.c,v 1.5.2.1.4.4 2005/09/03 12:47:38 marka Exp $";
#endif /* LIBC_SCCS and not lint */
#include <port_before.h>
@@ -77,8 +77,14 @@ setnetgrent_r(const char *netgroup)
#endif
{
char *tmp;
+#if defined(NGR_R_ENT_ARGS) && !defined(NGR_R_PRIVATE)
+ UNUSED(buf);
+ UNUSED(buflen);
+#endif
+
DE_CONST(netgroup, tmp);
setnetgrent(tmp);
+
#ifdef NGR_R_PRIVATE
*buf = NULL;
#endif
@@ -94,6 +100,11 @@ endnetgrent_r(NGR_R_ENT_ARGS)
endnetgrent_r(void)
#endif
{
+#if defined(NGR_R_ENT_ARGS) && !defined(NGR_R_PRIVATE)
+ UNUSED(buf);
+ UNUSED(buflen);
+#endif
+
endnetgrent();
#ifdef NGR_R_PRIVATE
if (*buf != NULL)
diff --git a/lib/bind/irs/hesiod.c b/lib/bind/irs/hesiod.c
index 9b0efeb8..618c5922 100644
--- a/lib/bind/irs/hesiod.c
+++ b/lib/bind/irs/hesiod.c
@@ -1,5 +1,5 @@
#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: hesiod.c,v 1.1.2.1.4.3 2004/05/17 07:48:56 marka Exp $";
+static const char rcsid[] = "$Id: hesiod.c,v 1.1.2.1.4.4 2005/07/28 07:43:19 marka Exp $";
#endif
/*
@@ -83,9 +83,7 @@ hesiod_init(void **context) {
return (-1);
}
- ctx->LHS = NULL;
- ctx->RHS = NULL;
- ctx->res = NULL;
+ memset(ctx, 0, sizeof (*ctx));
if (parse_config_file(ctx, _PATH_HESIOD_CONF) < 0) {
#ifdef DEF_RHS
diff --git a/lib/bind/isc/ev_connects.c b/lib/bind/isc/ev_connects.c
index 043e5f49..4b0dd222 100644
--- a/lib/bind/isc/ev_connects.c
+++ b/lib/bind/isc/ev_connects.c
@@ -20,7 +20,7 @@
*/
#if !defined(LINT) && !defined(CODECENTER)
-static const char rcsid[] = "$Id: ev_connects.c,v 1.4.206.1 2004/03/09 08:33:40 marka Exp $";
+static const char rcsid[] = "$Id: ev_connects.c,v 1.4.206.2 2005/07/08 04:52:54 marka Exp $";
#endif
/* Import. */
@@ -168,10 +168,10 @@ evCancelConn(evContext opaqueCtx, evConnID id) {
return (-1);
} else {
#ifdef USE_FIONBIO_IOCTL
- int on = 1;
- OK(ioctl(this->fd, FIONBIO, (char *)&on));
+ int off = 0;
+ OK(ioctl(this->fd, FIONBIO, (char *)&off));
#else
- OK(fcntl(this->fd, F_SETFL, mode | PORT_NONBLOCK));
+ OK(fcntl(this->fd, F_SETFL, mode & ~PORT_NONBLOCK));
#endif
}
}
diff --git a/lib/bind/isc/ev_files.c b/lib/bind/isc/ev_files.c
index 4d5eb55a..1f95ed04 100644
--- a/lib/bind/isc/ev_files.c
+++ b/lib/bind/isc/ev_files.c
@@ -20,7 +20,7 @@
*/
#if !defined(LINT) && !defined(CODECENTER)
-static const char rcsid[] = "$Id: ev_files.c,v 1.3.2.1.4.1 2004/03/09 08:33:42 marka Exp $";
+static const char rcsid[] = "$Id: ev_files.c,v 1.3.2.1.4.3 2005/07/28 07:43:19 marka Exp $";
#endif
#include "port_before.h"
@@ -58,8 +58,10 @@ evSelectFD(evContext opaqueCtx,
ctx, fd, eventmask, func, uap);
if (eventmask == 0 || (eventmask & ~EV_MASK_ALL) != 0)
EV_ERR(EINVAL);
+#ifndef USE_POLL
if (fd > ctx->highestFD)
EV_ERR(EINVAL);
+#endif
OK(mode = fcntl(fd, F_GETFL, NULL)); /* side effect: validate fd. */
/*
@@ -68,6 +70,11 @@ evSelectFD(evContext opaqueCtx,
* of our deselect()'s have to leave it in O_NONBLOCK. If not, then
* all but our last deselect() has to leave it in O_NONBLOCK.
*/
+#ifdef USE_POLL
+ /* Make sure both ctx->pollfds[] and ctx->fdTable[] are large enough */
+ if (fd >= ctx->maxnfds && evPollfdRealloc(ctx, 1, fd) != 0)
+ EV_ERR(ENOMEM);
+#endif /* USE_POLL */
id = FindFD(ctx, fd, EV_MASK_ALL);
if (id == NULL) {
if (mode & PORT_NONBLOCK)
@@ -143,13 +150,6 @@ evSelectFD(evContext opaqueCtx,
if (opaqueID)
opaqueID->opaque = id;
- evPrintf(ctx, 5,
- "evSelectFD(fd %d, mask 0x%x): new masks: 0x%lx 0x%lx 0x%lx\n",
- fd, eventmask,
- (u_long)ctx->rdNext.fds_bits[0],
- (u_long)ctx->wrNext.fds_bits[0],
- (u_long)ctx->exNext.fds_bits[0]);
-
return (0);
}
@@ -204,7 +204,7 @@ evDeselectFD(evContext opaqueCtx, evFileID opaqueID) {
* and (b) the caller didn't ask us anything about O_NONBLOCK.
*/
#ifdef USE_FIONBIO_IOCTL
- int off = 1;
+ int off = 0;
(void) ioctl(del->fd, FIONBIO, (char *)&off);
#else
(void) fcntl(del->fd, F_SETFL, mode & ~PORT_NONBLOCK);
@@ -259,13 +259,6 @@ evDeselectFD(evContext opaqueCtx, evFileID opaqueID) {
if (del == ctx->fdNext)
ctx->fdNext = del->next;
- evPrintf(ctx, 5,
- "evDeselectFD(fd %d, mask 0x%x): new masks: 0x%lx 0x%lx 0x%lx\n",
- del->fd, eventmask,
- (u_long)ctx->rdNext.fds_bits[0],
- (u_long)ctx->wrNext.fds_bits[0],
- (u_long)ctx->exNext.fds_bits[0]);
-
/* Couldn't free it before now since we were using fields out of it. */
FREE(del);
diff --git a/lib/bind/isc/eventlib.c b/lib/bind/isc/eventlib.c
index 06d791e0..77b14144 100644
--- a/lib/bind/isc/eventlib.c
+++ b/lib/bind/isc/eventlib.c
@@ -20,7 +20,7 @@
*/
#if !defined(LINT) && !defined(CODECENTER)
-static const char rcsid[] = "$Id: eventlib.c,v 1.2.2.1.4.4 2004/12/09 04:07:15 marka Exp $";
+static const char rcsid[] = "$Id: eventlib.c,v 1.2.2.1.4.5 2005/07/28 07:43:20 marka Exp $";
#endif
#include "port_before.h"
@@ -29,6 +29,9 @@ static const char rcsid[] = "$Id: eventlib.c,v 1.2.2.1.4.4 2004/12/09 04:07:15 m
#include <sys/types.h>
#include <sys/time.h>
#include <sys/stat.h>
+#ifdef SOLARIS2
+#include <limits.h>
+#endif /* SOLARIS2 */
#include <errno.h>
#include <signal.h>
@@ -44,9 +47,13 @@ static const char rcsid[] = "$Id: eventlib.c,v 1.2.2.1.4.4 2004/12/09 04:07:15 m
int __evOptMonoTime;
+#ifdef USE_POLL
+#define pselect Pselect
+#endif /* USE_POLL */
+
/* Forward. */
-#ifdef NEED_PSELECT
+#if defined(NEED_PSELECT) || defined(USE_POLL)
static int pselect(int, void *, void *, void *,
struct timespec *,
const sigset_t *);
@@ -78,6 +85,18 @@ evCreate(evContext *opaqueCtx) {
INIT_LIST(ctx->accepts);
/* Files. */
+#ifdef USE_POLL
+ ctx->pollfds = NULL;
+ ctx->maxnfds = 0;
+ ctx->firstfd = 0;
+ emulMaskInit(ctx, rdLast, EV_READ, 1);
+ emulMaskInit(ctx, rdNext, EV_READ, 0);
+ emulMaskInit(ctx, wrLast, EV_WRITE, 1);
+ emulMaskInit(ctx, wrNext, EV_WRITE, 0);
+ emulMaskInit(ctx, exLast, EV_EXCEPT, 1);
+ emulMaskInit(ctx, exNext, EV_EXCEPT, 0);
+ emulMaskInit(ctx, nonblockBefore, EV_WASNONBLOCKING, 0);
+#endif /* USE_POLL */
ctx->files = NULL;
FD_ZERO(&ctx->rdNext);
FD_ZERO(&ctx->wrNext);
@@ -86,11 +105,16 @@ evCreate(evContext *opaqueCtx) {
ctx->fdMax = -1;
ctx->fdNext = NULL;
ctx->fdCount = 0; /* Invalidate {rd,wr,ex}Last. */
+#ifndef USE_POLL
ctx->highestFD = FD_SETSIZE - 1;
+ memset(ctx->fdTable, 0, sizeof ctx->fdTable);
+#else
+ ctx->highestFD = INT_MAX / sizeof(struct pollfd);
+ ctx->fdTable = NULL;
+#endif
#ifdef EVENTLIB_TIME_CHECKS
ctx->lastFdCount = 0;
#endif
- memset(ctx->fdTable, 0, sizeof ctx->fdTable);
/* Streams. */
ctx->streams = NULL;
@@ -284,34 +308,37 @@ evGetNext(evContext opaqueCtx, evEvent *opaqueEv, int options) {
}
#endif
do {
+#ifndef USE_POLL
/* XXX need to copy only the bits we are using. */
ctx->rdLast = ctx->rdNext;
ctx->wrLast = ctx->wrNext;
ctx->exLast = ctx->exNext;
-
+#else
+ /*
+ * The pollfd structure uses separate fields for
+ * the input and output events (corresponding to
+ * the ??Next and ??Last fd sets), so there's no
+ * need to copy one to the other.
+ */
+#endif /* USE_POLL */
if (m == Timer) {
INSIST(tp == &t);
t = evSubTime(nextTime, ctx->lastEventTime);
}
- evPrintf(ctx, 4,
- "pselect(%d, 0x%lx, 0x%lx, 0x%lx, %ld.%09ld)\n",
- ctx->fdMax+1,
- (u_long)ctx->rdLast.fds_bits[0],
- (u_long)ctx->wrLast.fds_bits[0],
- (u_long)ctx->exLast.fds_bits[0],
- tp ? (long)tp->tv_sec : -1L,
- tp ? tp->tv_nsec : -1);
-
/* XXX should predict system's earliness and adjust. */
x = pselect(ctx->fdMax+1,
&ctx->rdLast, &ctx->wrLast, &ctx->exLast,
tp, NULL);
pselect_errno = errno;
+#ifndef USE_POLL
evPrintf(ctx, 4, "select() returns %d (err: %s)\n",
x, (x == -1) ? strerror(errno) : "none");
-
+#else
+ evPrintf(ctx, 4, "poll() returns %d (err: %s)\n",
+ x, (x == -1) ? strerror(errno) : "none");
+#endif /* USE_POLL */
/* Anything but a poll can change the time. */
if (m != JustPoll)
ctx->lastEventTime = evNowTime();
@@ -704,7 +731,7 @@ evGetOption(evContext *opaqueCtx, const char *option, int *value) {
return (-1);
}
-#ifdef NEED_PSELECT
+#if defined(NEED_PSELECT) || defined(USE_POLL)
/* XXX needs to move to the porting library. */
static int
pselect(int nfds, void *rfds, void *wfds, void *efds,
@@ -714,15 +741,69 @@ pselect(int nfds, void *rfds, void *wfds, void *efds,
struct timeval tv, *tvp;
sigset_t sigs;
int n;
+#ifdef USE_POLL
+ int polltimeout = INFTIM;
+ evContext_p *ctx;
+ struct pollfd *fds;
+ nfds_t pnfds;
+
+ UNUSED(nfds);
+#endif /* USE_POLL */
if (tsp) {
tvp = &tv;
tv = evTimeVal(*tsp);
+#ifdef USE_POLL
+ polltimeout = 1000 * tv.tv_sec + tv.tv_usec / 1000;
+#endif /* USE_POLL */
} else
tvp = NULL;
if (sigmask)
sigprocmask(SIG_SETMASK, sigmask, &sigs);
+#ifndef USE_POLL
n = select(nfds, rfds, wfds, efds, tvp);
+#else
+ /*
+ * rfds, wfds, and efds should all be from the same evContext_p,
+ * so any of them will do. If they're all NULL, the caller is
+ * presumably calling us to block.
+ */
+ if (rfds != NULL)
+ ctx = ((__evEmulMask *)rfds)->ctx;
+ else if (wfds != NULL)
+ ctx = ((__evEmulMask *)wfds)->ctx;
+ else if (efds != NULL)
+ ctx = ((__evEmulMask *)efds)->ctx;
+ else
+ ctx = NULL;
+ if (ctx != NULL && ctx->fdMax != -1) {
+ fds = &(ctx->pollfds[ctx->firstfd]);
+ pnfds = ctx->fdMax - ctx->firstfd + 1;
+ } else {
+ fds = NULL;
+ pnfds = 0;
+ }
+ n = poll(fds, pnfds, polltimeout);
+ /*
+ * pselect() should return the total number of events on the file
+ * desriptors, not just the count of fd:s with activity. Hence,
+ * traverse the pollfds array and count the events.
+ */
+ if (n > 0) {
+ int i, e;
+ for (e = 0, i = ctx->firstfd; i <= ctx->fdMax; i++) {
+ if (ctx->pollfds[i].fd < 0)
+ continue;
+ if (FD_ISSET(i, &ctx->rdLast))
+ e++;
+ if (FD_ISSET(i, &ctx->wrLast))
+ e++;
+ if (FD_ISSET(i, &ctx->exLast))
+ e++;
+ }
+ n = e;
+ }
+#endif /* USE_POLL */
if (sigmask)
sigprocmask(SIG_SETMASK, &sigs, NULL);
if (tsp)
@@ -730,3 +811,127 @@ pselect(int nfds, void *rfds, void *wfds, void *efds,
return (n);
}
#endif
+
+#ifdef USE_POLL
+int
+evPollfdRealloc(evContext_p *ctx, int pollfd_chunk_size, int fd) {
+
+ int i, maxnfds;
+ void *pollfds, *fdTable;
+
+ if (fd < ctx->maxnfds)
+ return (0);
+
+ /* Don't allow ridiculously small values for pollfd_chunk_size */
+ if (pollfd_chunk_size < 20)
+ pollfd_chunk_size = 20;
+
+ maxnfds = (1 + (fd/pollfd_chunk_size)) * pollfd_chunk_size;
+
+ pollfds = realloc(ctx->pollfds, maxnfds * sizeof(*ctx->pollfds));
+ if (pollfds != NULL)
+ ctx->pollfds = pollfds;
+ fdTable = realloc(ctx->fdTable, maxnfds * sizeof(*ctx->fdTable));
+ if (fdTable != NULL)
+ ctx->fdTable = fdTable;
+
+ if (pollfds == NULL || fdTable == NULL) {
+ evPrintf(ctx, 2, "pollfd() realloc (%ld) failed\n",
+ (long)maxnfds*sizeof(struct pollfd));
+ return (-1);
+ }
+
+ for (i = ctx->maxnfds; i < maxnfds; i++) {
+ ctx->pollfds[i].fd = -1;
+ ctx->pollfds[i].events = 0;
+ ctx->fdTable[i] = 0;
+ }
+
+ ctx->maxnfds = maxnfds;
+
+ return (0);
+}
+
+/* Find the appropriate 'events' or 'revents' field in the pollfds array */
+short *
+__fd_eventfield(int fd, __evEmulMask *maskp) {
+
+ evContext_p *ctx = (evContext_p *)maskp->ctx;
+
+ if (!maskp->result || maskp->type == EV_WASNONBLOCKING)
+ return (&(ctx->pollfds[fd].events));
+ else
+ return (&(ctx->pollfds[fd].revents));
+}
+
+/* Translate to poll(2) event */
+short
+__poll_event(__evEmulMask *maskp) {
+
+ switch ((maskp)->type) {
+ case EV_READ:
+ return (POLLRDNORM);
+ case EV_WRITE:
+ return (POLLWRNORM);
+ case EV_EXCEPT:
+ return (POLLRDBAND | POLLPRI | POLLWRBAND);
+ case EV_WASNONBLOCKING:
+ return (POLLHUP);
+ default:
+ return (0);
+ }
+}
+
+/*
+ * Clear the events corresponding to the specified mask. If this leaves
+ * the events mask empty (apart from the POLLHUP bit), set the fd field
+ * to -1 so that poll(2) will ignore this fd.
+ */
+void
+__fd_clr(int fd, __evEmulMask *maskp) {
+
+ evContext_p *ctx = maskp->ctx;
+
+ *__fd_eventfield(fd, maskp) &= ~__poll_event(maskp);
+ if ((ctx->pollfds[fd].events & ~POLLHUP) == 0) {
+ ctx->pollfds[fd].fd = -1;
+ if (fd == ctx->fdMax)
+ while (ctx->fdMax > ctx->firstfd &&
+ ctx->pollfds[ctx->fdMax].fd < 0)
+ ctx->fdMax--;
+ if (fd == ctx->firstfd)
+ while (ctx->firstfd <= ctx->fdMax &&
+ ctx->pollfds[ctx->firstfd].fd < 0)
+ ctx->firstfd++;
+ /*
+ * Do we have a empty set of descriptors?
+ */
+ if (ctx->firstfd > ctx->fdMax) {
+ ctx->fdMax = -1;
+ ctx->firstfd = 0;
+ }
+ }
+}
+
+/*
+ * Set the events bit(s) corresponding to the specified mask. If the events
+ * field has any other bits than POLLHUP set, also set the fd field so that
+ * poll(2) will watch this fd.
+ */
+void
+__fd_set(int fd, __evEmulMask *maskp) {
+
+ evContext_p *ctx = maskp->ctx;
+
+ *__fd_eventfield(fd, maskp) |= __poll_event(maskp);
+ if ((ctx->pollfds[fd].events & ~POLLHUP) != 0) {
+ ctx->pollfds[fd].fd = fd;
+ if (fd < ctx->firstfd || ctx->fdMax == -1)
+ ctx->firstfd = fd;
+ if (fd > ctx->fdMax)
+ ctx->fdMax = fd;
+ }
+}
+#endif /* USE_POLL */
+
+/*! \file */
diff --git a/lib/bind/isc/eventlib_p.h b/lib/bind/isc/eventlib_p.h
index 8c58c7fd..b95741d7 100644
--- a/lib/bind/isc/eventlib_p.h
+++ b/lib/bind/isc/eventlib_p.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2005 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
@@ -18,7 +18,7 @@
/* eventlib_p.h - private interfaces for eventlib
* vix 09sep95 [initial]
*
- * $Id: eventlib_p.h,v 1.3.2.1.4.2 2004/12/05 22:38:43 marka Exp $
+ * $Id: eventlib_p.h,v 1.3.2.1.4.3 2005/07/28 07:43:20 marka Exp $
*/
#ifndef _EVENTLIB_P_H
@@ -63,6 +63,13 @@
#define FILL(p)
#endif
+#ifdef USE_POLL
+#ifdef HAVE_STROPTS_H
+#include <stropts.h>
+#endif
+#include <poll.h>
+#endif /* USE_POLL */
+
typedef struct evConn {
evConnFunc func;
void * uap;
@@ -166,6 +173,40 @@ typedef struct evEvent_p {
} u;
} evEvent_p;
+#ifdef USE_POLL
+typedef struct {
+ void *ctx; /* pointer to the evContext_p */
+ uint32_t type; /* READ, WRITE, EXCEPT, nonblk */
+ uint32_t result; /* 1 => revents, 0 => events */
+} __evEmulMask;
+
+#define emulMaskInit(ctx, field, ev, lastnext) \
+ ctx->field.ctx = ctx; \
+ ctx->field.type = ev; \
+ ctx->field.result = lastnext;
+
+extern short *__fd_eventfield(int fd, __evEmulMask *maskp);
+extern short __poll_event(__evEmulMask *maskp);
+extern void __fd_clr(int fd, __evEmulMask *maskp);
+extern void __fd_set(int fd, __evEmulMask *maskp);
+
+#undef FD_ZERO
+#define FD_ZERO(maskp)
+
+#undef FD_SET
+#define FD_SET(fd, maskp) \
+ __fd_set(fd, maskp)
+
+#undef FD_CLR
+#define FD_CLR(fd, maskp) \
+ __fd_clr(fd, maskp)
+
+#undef FD_ISSET
+#define FD_ISSET(fd, maskp) \
+ ((*__fd_eventfield(fd, maskp) & __poll_event(maskp)) != 0)
+
+#endif /* USE_POLL */
+
typedef struct {
/* Global. */
const evEvent_p *cur;
@@ -177,12 +218,26 @@ typedef struct {
LIST(evAccept) accepts;
/* Files. */
evFile *files, *fdNext;
+#ifndef USE_POLL
fd_set rdLast, rdNext;
fd_set wrLast, wrNext;
fd_set exLast, exNext;
fd_set nonblockBefore;
int fdMax, fdCount, highestFD;
evFile *fdTable[FD_SETSIZE];
+#else
+ struct pollfd *pollfds; /* Allocated as needed */
+ evFile **fdTable; /* Ditto */
+ int maxnfds; /* # elements in above */
+ int firstfd; /* First active fd */
+ int fdMax; /* Last active fd */
+ int fdCount; /* # fd:s with I/O */
+ int highestFD; /* max fd allowed by OS */
+ __evEmulMask rdLast, rdNext;
+ __evEmulMask wrLast, wrNext;
+ __evEmulMask exLast, exNext;
+ __evEmulMask nonblockBefore;
+#endif /* USE_POLL */
#ifdef EVENTLIB_TIME_CHECKS
struct timespec lastSelectTime;
int lastFdCount;
@@ -203,6 +258,10 @@ typedef struct {
void evPrintf(const evContext_p *ctx, int level, const char *fmt, ...)
ISC_FORMAT_PRINTF(3, 4);
+#ifdef USE_POLL
+extern int evPollfdRealloc(evContext_p *ctx, int pollfd_chunk_size, int fd);
+#endif /* USE_POLL */
+
/* ev_timers.c */
#define evCreateTimers __evCreateTimers
heap_context evCreateTimers(const evContext_p *);
diff --git a/lib/bind/isc/memcluster.c b/lib/bind/isc/memcluster.c
index 0632ec7d..8db8c51d 100644
--- a/lib/bind/isc/memcluster.c
+++ b/lib/bind/isc/memcluster.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2005 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
@@ -24,7 +24,7 @@
#if !defined(LINT) && !defined(CODECENTER)
-static const char rcsid[] = "$Id: memcluster.c,v 1.3.206.4 2004/09/16 00:57:34 marka Exp $";
+static const char rcsid[] = "$Id: memcluster.c,v 1.3.206.6 2005/08/22 01:34:30 marka Exp $";
#endif /* not lint */
#include "port_before.h"
@@ -90,6 +90,20 @@ struct stats {
u_long freefrags;
};
+#ifdef DO_PTHREADS
+#include <pthread.h>
+static pthread_mutex_t memlock = PTHREAD_MUTEX_INITIALIZER;
+#define MEMLOCK (void)pthread_mutex_lock(&memlock)
+#define MEMUNLOCK (void)pthread_mutex_unlock(&memlock)
+#else
+/*
+ * Catch bad lock usage in non threaded build.
+ */
+static unsigned int memlock = 0;
+#define MEMLOCK do { INSIST(memlock == 0); memlock = 1; } while (0)
+#define MEMUNLOCK do { INSIST(memlock == 1); memlock = 0; } while (0)
+#endif /* DO_PTHEADS */
+
/* Private data. */
static size_t max_size;
@@ -173,14 +187,20 @@ __memget_record(size_t size, const char *file, int line) {
#endif
void *ret;
+ MEMLOCK;
+
#if !defined(MEMCLUSTER_RECORD)
UNUSED(file);
UNUSED(line);
#endif
- if (freelists == NULL)
- if (meminit(0, 0) == -1)
+ if (freelists == NULL) {
+ if (meminit(0, 0) == -1) {
+ MEMUNLOCK;
return (NULL);
+ }
+ }
if (size == 0U) {
+ MEMUNLOCK;
errno = EINVAL;
return (NULL);
}
@@ -191,6 +211,7 @@ __memget_record(size_t size, const char *file, int line) {
#if defined(DEBUGGING_MEMCLUSTER)
e = malloc(new_size);
if (e == NULL) {
+ MEMUNLOCK;
errno = ENOMEM;
return (NULL);
}
@@ -202,11 +223,13 @@ __memget_record(size_t size, const char *file, int line) {
e->next = activelists[max_size];
activelists[max_size] = e;
#endif
+ MEMUNLOCK;
e->fencepost = FRONT_FENCEPOST;
p = (char *)e + sizeof *e + size;
memcpy(p, &fp, sizeof fp);
return ((char *)e + sizeof *e);
#else
+ MEMUNLOCK;
return (malloc(size));
#endif
}
@@ -226,6 +249,7 @@ __memget_record(size_t size, const char *file, int line) {
if (basic_blocks == NULL) {
new = malloc(NUM_BASIC_BLOCKS * mem_target);
if (new == NULL) {
+ MEMUNLOCK;
errno = ENOMEM;
return (NULL);
}
@@ -253,6 +277,7 @@ __memget_record(size_t size, const char *file, int line) {
total_size = mem_target;
new = malloc(total_size);
if (new == NULL) {
+ MEMUNLOCK;
errno = ENOMEM;
return (NULL);
}
@@ -318,6 +343,7 @@ __memget_record(size_t size, const char *file, int line) {
stats[size].gets++;
stats[size].totalgets++;
stats[new_size].freefrags--;
+ MEMUNLOCK;
#if defined(DEBUGGING_MEMCLUSTER)
return ((char *)e + sizeof *e);
#else
@@ -347,6 +373,8 @@ __memput_record(void *mem, size_t size, const char *file, int line) {
char *p;
#endif
+ MEMLOCK;
+
#if !defined (MEMCLUSTER_RECORD)
UNUSED(file);
UNUSED(line);
@@ -355,6 +383,7 @@ __memput_record(void *mem, size_t size, const char *file, int line) {
REQUIRE(freelists != NULL);
if (size == 0U) {
+ MEMUNLOCK;
errno = EINVAL;
return;
}
@@ -398,6 +427,7 @@ __memput_record(void *mem, size_t size, const char *file, int line) {
INSIST(stats[max_size].gets != 0U);
stats[max_size].gets--;
+ MEMUNLOCK;
return;
}
@@ -436,6 +466,7 @@ __memput_record(void *mem, size_t size, const char *file, int line) {
INSIST(stats[size].gets != 0U);
stats[size].gets--;
stats[new_size].freefrags++;
+ MEMUNLOCK;
}
void *
@@ -464,8 +495,12 @@ memstats(FILE *out) {
memcluster_element *e;
#endif
- if (freelists == NULL)
+ MEMLOCK;
+
+ if (freelists == NULL) {
+ MEMUNLOCK;
return;
+ }
for (i = 1; i <= max_size; i++) {
const struct stats *s = &stats[i];
@@ -492,6 +527,7 @@ memstats(FILE *out) {
}
}
#endif
+ MEMUNLOCK;
}
int
diff --git a/lib/bind/nameser/ns_parse.c b/lib/bind/nameser/ns_parse.c
index 34ebd3de..8dfdd6cd 100644
--- a/lib/bind/nameser/ns_parse.c
+++ b/lib/bind/nameser/ns_parse.c
@@ -16,7 +16,7 @@
*/
#ifndef lint
-static const char rcsid[] = "$Id: ns_parse.c,v 1.3.2.1.4.1 2004/03/09 08:33:44 marka Exp $";
+static const char rcsid[] = "$Id: ns_parse.c,v 1.3.2.1.4.2 2005/08/12 01:36:23 marka Exp $";
#endif
/* Import. */
@@ -40,7 +40,12 @@ static void setsection(ns_msg *msg, ns_sect sect);
/* Macros. */
+#ifndef SOLARIS2
#define RETERR(err) do { errno = (err); return (-1); } while (0)
+#else
+#define RETERR(err) \
+ do { errno = (err); if (errno == errno) return (-1); } while (0)
+#endif
/* Public. */
diff --git a/lib/bind/nameser/ns_ttl.c b/lib/bind/nameser/ns_ttl.c
index 368b05a3..4d18d3f2 100644
--- a/lib/bind/nameser/ns_ttl.c
+++ b/lib/bind/nameser/ns_ttl.c
@@ -16,7 +16,7 @@
*/
#ifndef lint
-static const char rcsid[] = "$Id: ns_ttl.c,v 1.1.206.1 2004/03/09 08:33:45 marka Exp $";
+static const char rcsid[] = "$Id: ns_ttl.c,v 1.1.206.2 2005/07/28 07:43:21 marka Exp $";
#endif
/* Import. */
@@ -133,7 +133,8 @@ ns_parse_ttl(const char *src, u_long *dst) {
goto einval;
else
ttl += tmp;
- }
+ } else if (!dirty)
+ goto einval;
*dst = ttl;
return (0);
diff --git a/lib/bind/port/qnx/include/Makefile.in b/lib/bind/port/qnx/include/Makefile.in
index b994550e..7e753453 100644
--- a/lib/bind/port/qnx/include/Makefile.in
+++ b/lib/bind/port/qnx/include/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 2001 Internet Software Consortium.
#
# Permission to use, copy, modify, and distribute this software for any
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.2.206.1 2004/03/15 01:02:50 marka Exp $
+# $Id: Makefile.in,v 1.2.206.2 2005/07/12 05:47:43 marka Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/lib/bind/port/unknown/include/Makefile.in b/lib/bind/port/unknown/include/Makefile.in
index e69de29b..fc18316d 100644
--- a/lib/bind/port/unknown/include/Makefile.in
+++ b/lib/bind/port/unknown/include/Makefile.in
@@ -0,0 +1,21 @@
+# Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2001 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.1.206.2 2005/09/05 05:13:45 marka Exp $
+
+all:
+ exit 1
+
+@BIND9_MAKE_RULES@
diff --git a/lib/bind/port_after.h.in b/lib/bind/port_after.h.in
index c043561b..73d2dbda 100644
--- a/lib/bind/port_after.h.in
+++ b/lib/bind/port_after.h.in
@@ -8,6 +8,9 @@
#if (!defined(BSD)) || (BSD < 199306)
#include <sys/bitypes.h>
#endif
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
@NEED_PSELECT@
@HAVE_SA_LEN@
@@ -27,9 +30,7 @@
@INNETGR_ARGS@
@SETNETGRENT_ARGS@
@USE_IFNAMELINKID@
-
-/* XXX sunos and cygwin needs O_NDELAY */
-#define PORT_NONBLOCK O_NONBLOCK
+@PORT_NONBLOCK@
/*
* We need to know the IPv6 address family number even on IPv4-only systems.
@@ -255,7 +256,7 @@ char * strsep(char **stringp, const char *delim);
#endif
#ifndef ALIGN
-#define ALIGN(p) (((unsigned int)(p) + (sizeof(int) - 1)) & ~(sizeof(int) - 1))
+#define ALIGN(p) (((uintptr_t)(p) + (sizeof(long) - 1)) & ~(sizeof(long) - 1))
#endif
#ifdef NEED_SETGROUPENT
diff --git a/lib/bind/port_before.h.in b/lib/bind/port_before.h.in
index d6fbe86a..c754efd2 100644
--- a/lib/bind/port_before.h.in
+++ b/lib/bind/port_before.h.in
@@ -18,6 +18,9 @@ struct timezone; /* silence warning */
@WANT_IRS_PW@
@BSD_COMP@
+@USE_POLL@
+@HAVE_MD5@
+@SOLARIS2@
@DO_PTHREADS@
@GETGROUPLIST_ARGS@
@@ -135,4 +138,9 @@ struct timezone; /* silence warning */
#define ISC_FORMAT_PRINTF(fmt, args)
#endif
+/* Pull in host order macros when _XOPEN_SOURCE_EXTENDED is defined. */
+#if defined(__hpux) && defined(_XOPEN_SOURCE_EXTENDED)
+#include <sys/byteorder.h>
+#endif
+
#endif
diff --git a/lib/bind/resolv/Makefile.in b/lib/bind/resolv/Makefile.in
index 74a20e74..a235fbc7 100644
--- a/lib/bind/resolv/Makefile.in
+++ b/lib/bind/resolv/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 2001 Internet Software Consortium.
#
# Permission to use, copy, modify, and distribute this software for any
@@ -13,16 +13,16 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.3.206.1 2004/03/15 01:02:54 marka Exp $
+# $Id: Makefile.in,v 1.3.206.3 2005/07/29 00:13:09 marka Exp $
srcdir= @srcdir@
VPATH = @srcdir@
-OBJS= herror.@O@ res_comp.@O@ res_data.@O@ res_debug.@O@ \
+OBJS= herror.@O@ mtctxres.@O@ res_comp.@O@ res_data.@O@ res_debug.@O@ \
res_findzonecut.@O@ res_init.@O@ res_mkquery.@O@ res_mkupdate.@O@ \
res_query.@O@ res_send.@O@ res_sendsigned.@O@ res_update.@O@
-SRCS= herror.c res_comp.c res_data.c res_debug.c \
+SRCS= herror.c mtctxres.c res_comp.c res_data.c res_debug.c \
res_findzonecut.c res_init.c res_mkquery.c res_mkupdate.c \
res_query.c res_send.c res_sendsigned.c res_update.c
diff --git a/lib/bind/resolv/mtctxres.c b/lib/bind/resolv/mtctxres.c
new file mode 100644
index 00000000..f33cf11e
--- /dev/null
+++ b/lib/bind/resolv/mtctxres.c
@@ -0,0 +1,128 @@
+#include <port_before.h>
+#ifdef DO_PTHREADS
+#include <pthread.h>
+#endif
+#include <errno.h>
+#include <netdb.h>
+#include <stdlib.h>
+#include <string.h>
+#include <resolv_mt.h>
+#include <irs.h>
+#include <port_after.h>
+
+#ifdef DO_PTHREADS
+static pthread_key_t key;
+static int mt_key_initialized = 0;
+
+static int __res_init_ctx(void);
+static void __res_destroy_ctx(void *);
+
+#if defined(sun) && !defined(__GNUC__)
+#pragma init (_mtctxres_init)
+#endif
+#endif
+
+static mtctxres_t sharedctx;
+
+#ifdef DO_PTHREADS
+/*
+ * Initialize the TSD key. By doing this at library load time, we're
+ * implicitly running without interference from other threads, so there's
+ * no need for locking.
+ */
+static void
+_mtctxres_init(void) {
+ int pthread_keycreate_ret;
+
+ pthread_keycreate_ret = pthread_key_create(&key, __res_destroy_ctx);
+ if (pthread_keycreate_ret == 0)
+ mt_key_initialized = 1;
+}
+#endif
+
+/*
+ * To support binaries that used the private MT-safe interface in
+ * Solaris 8, we still need to provide the __res_enable_mt()
+ * and __res_disable_mt() entry points. They're do-nothing routines.
+ */
+int
+__res_enable_mt(void) {
+ return (-1);
+}
+
+int
+__res_disable_mt(void) {
+ return (0);
+}
+
+#ifdef DO_PTHREADS
+static int
+__res_init_ctx(void) {
+
+ mtctxres_t *mt;
+ int ret;
+
+
+ if (pthread_getspecific(key) != 0) {
+ /* Already exists */
+ return (0);
+ }
+
+ if ((mt = malloc(sizeof (mtctxres_t))) == 0) {
+ errno = ENOMEM;
+ return (-1);
+ }
+
+ memset(mt, 0, sizeof (mtctxres_t));
+
+ if ((ret = pthread_setspecific(key, mt)) != 0) {
+ free(mt);
+ errno = ret;
+ return (-1);
+ }
+
+ return (0);
+}
+
+static void
+__res_destroy_ctx(void *value) {
+
+ mtctxres_t *mt = (mtctxres_t *)value;
+
+ if (mt != 0)
+ free(mt);
+}
+#endif
+
+mtctxres_t *
+___mtctxres(void) {
+#ifdef DO_PTHREADS
+ mtctxres_t *mt;
+
+ /*
+ * This if clause should only be executed if we are linking
+ * statically. When linked dynamically _mtctxres_init() should
+ * be called at binding time due the #pragma above.
+ */
+ if (!mt_key_initialized) {
+ static pthread_mutex_t keylock = PTHREAD_MUTEX_INITIALIZER;
+ pthread_mutex_lock(&keylock);
+ _mtctxres_init();
+ pthread_mutex_unlock(&keylock);
+ }
+
+ /*
+ * If we have already been called in this thread return the existing
+ * context. Otherwise recreat a new context and return it. If
+ * that fails return a global context.
+ */
+ if (mt_key_initialized) {
+ if (((mt = pthread_getspecific(key)) != 0) ||
+ (__res_init_ctx() == 0 &&
+ (mt = pthread_getspecific(key)) != 0)) {
+ return (mt);
+ }
+ }
+#endif
+ return (&sharedctx);
+}
diff --git a/lib/bind/resolv/res_comp.c b/lib/bind/resolv/res_comp.c
index 6468dbc2..8cc99a76 100644
--- a/lib/bind/resolv/res_comp.c
+++ b/lib/bind/resolv/res_comp.c
@@ -70,7 +70,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static const char sccsid[] = "@(#)res_comp.c 8.1 (Berkeley) 6/4/93";
-static const char rcsid[] = "$Id: res_comp.c,v 1.1.2.1.4.1 2004/03/09 08:33:54 marka Exp $";
+static const char rcsid[] = "$Id: res_comp.c,v 1.1.2.1.4.2 2005/07/28 07:43:22 marka Exp $";
#endif /* LIBC_SCCS and not lint */
#include "port_before.h"
@@ -242,6 +242,18 @@ res_dnok(const char *dn) {
* __getshort
* Note that one _ comes from C and the others come from us.
*/
+
+#ifdef SOLARIS2
+#ifdef __putlong
+#undef __putlong
+#endif
+#ifdef __putshort
+#undef __putshort
+#endif
+#pragma weak putlong = __putlong
+#pragma weak putshort = __putshort
+#endif /* SOLARIS2 */
+
void __putlong(u_int32_t src, u_char *dst) { ns_put32(src, dst); }
void __putshort(u_int16_t src, u_char *dst) { ns_put16(src, dst); }
#ifndef __ultrix__
diff --git a/lib/bind/resolv/res_debug.c b/lib/bind/resolv/res_debug.c
index 1e228be5..8dda12c5 100644
--- a/lib/bind/resolv/res_debug.c
+++ b/lib/bind/resolv/res_debug.c
@@ -95,7 +95,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static const char sccsid[] = "@(#)res_debug.c 8.1 (Berkeley) 6/4/93";
-static const char rcsid[] = "$Id: res_debug.c,v 1.3.2.5.4.5 2004/07/28 20:16:46 marka Exp $";
+static const char rcsid[] = "$Id: res_debug.c,v 1.3.2.5.4.6 2005/07/28 07:43:22 marka Exp $";
#endif /* LIBC_SCCS and not lint */
#include "port_before.h"
@@ -113,6 +113,7 @@ static const char rcsid[] = "$Id: res_debug.c,v 1.3.2.5.4.5 2004/07/28 20:16:46
#include <math.h>
#include <netdb.h>
#include <resolv.h>
+#include <resolv_mt.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -504,7 +505,7 @@ sym_ston(const struct res_sym *syms, const char *name, int *success) {
const char *
sym_ntos(const struct res_sym *syms, int number, int *success) {
- static char unname[20];
+ char *unname = sym_ntos_unname;
for ((void)NULL; syms->name != 0; syms++) {
if (number == syms->number) {
@@ -522,7 +523,7 @@ sym_ntos(const struct res_sym *syms, int number, int *success) {
const char *
sym_ntop(const struct res_sym *syms, int number, int *success) {
- static char unname[20];
+ char *unname = sym_ntop_unname;
for ((void)NULL; syms->name != 0; syms++) {
if (number == syms->number) {
@@ -596,7 +597,7 @@ p_class(int class) {
*/
const char *
p_option(u_long option) {
- static char nbuf[40];
+ char *nbuf = p_option_nbuf;
switch (option) {
case RES_INIT: return "init";
@@ -639,7 +640,7 @@ p_option(u_long option) {
*/
const char *
p_time(u_int32_t value) {
- static char nbuf[40]; /* XXX nonreentrant */
+ char *nbuf = p_time_nbuf;
if (ns_format_ttl(value, nbuf, sizeof nbuf) < 0)
sprintf(nbuf, "%u", value);
@@ -695,7 +696,7 @@ static const char *
precsize_ntoa(prec)
u_int8_t prec;
{
- static char retbuf[sizeof "90000000.00"]; /* XXX nonreentrant */
+ char *retbuf = precsize_ntoa_retbuf;
unsigned long val;
int mantissa, exponent;
@@ -1097,8 +1098,7 @@ dn_count_labels(const char *name) {
*/
char *
p_secstodate (u_long secs) {
- /* XXX nonreentrant */
- static char output[15]; /* YYYYMMDDHHMMSS and null */
+ char *output = p_secstodate_output;
time_t clock = secs;
struct tm *time;
#ifdef HAVE_TIME_R
diff --git a/lib/bind/resolv/res_init.c b/lib/bind/resolv/res_init.c
index 241f5f7c..ba5d7f70 100644
--- a/lib/bind/resolv/res_init.c
+++ b/lib/bind/resolv/res_init.c
@@ -70,7 +70,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static const char sccsid[] = "@(#)res_init.c 8.1 (Berkeley) 6/7/93";
-static const char rcsid[] = "$Id: res_init.c,v 1.9.2.5.4.2 2004/03/16 12:34:18 marka Exp $";
+static const char rcsid[] = "$Id: res_init.c,v 1.9.2.5.4.4 2005/09/09 00:40:56 marka Exp $";
#endif /* LIBC_SCCS and not lint */
#include "port_before.h"
@@ -102,6 +102,10 @@ static const char rcsid[] = "$Id: res_init.c,v 1.9.2.5.4.2 2004/03/16 12:34:18 m
#define RESOLVSORT
#define DEBUG
+#ifdef SOLARIS2
+#include <sys/systeminfo.h>
+#endif
+
static void res_setoptions __P((res_state, const char *, const char *));
#ifdef RESOLVSORT
@@ -163,6 +167,9 @@ __res_vinit(res_state statp, int preinit) {
int dots;
union res_sockaddr_union u[2];
+ if (statp->_u._ext.ext != NULL)
+ res_ndestroy(statp);
+
if (!preinit) {
statp->retrans = RES_TIMEOUT;
statp->retry = RES_DFLRETRY;
@@ -170,9 +177,6 @@ __res_vinit(res_state statp, int preinit) {
statp->id = res_randomid();
}
- if ((statp->options & RES_INIT) != 0U)
- res_ndestroy(statp);
-
memset(u, 0, sizeof(u));
#ifdef USELOOPBACK
u[nserv].sin.sin_addr = inet_makeaddr(IN_LOOPBACKNET, 1);
@@ -218,6 +222,35 @@ __res_vinit(res_state statp, int preinit) {
#endif
res_setservers(statp, u, nserv);
+#ifdef SOLARIS2
+ /*
+ * The old libresolv derived the defaultdomain from NIS/NIS+.
+ * We want to keep this behaviour
+ */
+ {
+ char buf[sizeof(statp->defdname)], *cp;
+ int ret;
+
+ if ((ret = sysinfo(SI_SRPC_DOMAIN, buf, sizeof(buf))) > 0 &&
+ (unsigned int)ret <= sizeof(buf)) {
+ if (buf[0] == '+')
+ buf[0] = '.';
+ cp = strchr(buf, '.');
+ if (cp == NULL) {
+ if (strlcpy(statp->defdname, buf,
+ sizeof(statp->defdname))
+ >= sizeof(statp->defdname))
+ goto freedata;
+ } else {
+ if (strlcpy(statp->defdname, cp+1,
+ sizeof(statp->defdname))
+ >= sizeof(statp->defdname))
+ goto freedata;
+ }
+ }
+ }
+#endif /* SOLARIS2 */
+
/* Allow user to override the local domain definition */
if ((cp = getenv("LOCALDOMAIN")) != NULL) {
(void)strncpy(statp->defdname, cp, sizeof(statp->defdname) - 1);
@@ -456,6 +489,15 @@ __res_vinit(res_state statp, int preinit) {
res_setoptions(statp, cp, "env");
statp->options |= RES_INIT;
return (0);
+
+#ifdef SOLARIS2
+ freedata:
+ if (statp->_u._ext.ext != NULL) {
+ free(statp->_u._ext.ext);
+ statp->_u._ext.ext = NULL;
+ }
+ return (-1);
+#endif
}
static void
@@ -495,6 +537,22 @@ res_setoptions(res_state statp, const char *options, const char *source)
if (statp->options & RES_DEBUG)
printf(";;\ttimeout=%d\n", statp->retrans);
#endif
+#ifdef SOLARIS2
+ } else if (!strncmp(cp, "retrans:", sizeof("retrans:") - 1)) {
+ /*
+ * For backward compatibility, 'retrans' is
+ * supported as an alias for 'timeout', though
+ * without an imposed maximum.
+ */
+ statp->retrans = atoi(cp + sizeof("retrans:") - 1);
+ } else if (!strncmp(cp, "retry:", sizeof("retry:") - 1)){
+ /*
+ * For backward compatibility, 'retry' is
+ * supported as an alias for 'attempts', though
+ * without an imposed maximum.
+ */
+ statp->retry = atoi(cp + sizeof("retry:") - 1);
+#endif /* SOLARIS2 */
} else if (!strncmp(cp, "attempts:", sizeof("attempts:") - 1)){
i = atoi(cp + sizeof("attempts:") - 1);
if (i <= RES_MAXRETRY)
diff --git a/lib/bind/resolv/res_send.c b/lib/bind/resolv/res_send.c
index 81c24258..5be24893 100644
--- a/lib/bind/resolv/res_send.c
+++ b/lib/bind/resolv/res_send.c
@@ -52,7 +52,7 @@
*/
/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2005 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
@@ -70,7 +70,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static const char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93";
-static const char rcsid[] = "$Id: res_send.c,v 1.5.2.2.4.5 2004/08/10 02:19:56 marka Exp $";
+static const char rcsid[] = "$Id: res_send.c,v 1.5.2.2.4.7 2005/08/15 02:04:41 marka Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -103,6 +103,13 @@ static const char rcsid[] = "$Id: res_send.c,v 1.5.2.2.4.5 2004/08/10 02:19:56 m
#include "port_after.h"
+#ifdef USE_POLL
+#ifdef HAVE_STROPTS_H
+#include <stropts.h>
+#endif
+#include <poll.h>
+#endif /* USE_POLL */
+
/* Options. Leave them on. */
#define DEBUG
#include "res_debug.h"
@@ -110,7 +117,11 @@ static const char rcsid[] = "$Id: res_send.c,v 1.5.2.2.4.5 2004/08/10 02:19:56 m
#define EXT(res) ((res)->_u._ext)
+#ifndef USE_POLL
static const int highestFD = FD_SETSIZE - 1;
+#else
+static int highestFD = 0;
+#endif
/* Forward. */
@@ -125,7 +136,7 @@ static void Aerror(const res_state, FILE *, const char *, int,
const struct sockaddr *, int);
static void Perror(const res_state, FILE *, const char *, int);
static int sock_eq(struct sockaddr *, struct sockaddr *);
-#ifdef NEED_PSELECT
+#if defined(NEED_PSELECT) && !defined(USE_POLL)
static int pselect(int, void *, void *, void *,
struct timespec *,
const sigset_t *);
@@ -280,6 +291,10 @@ res_nsend(res_state statp,
int gotsomewhere, terrno, try, v_circuit, resplen, ns, n;
char abuf[NI_MAXHOST];
+#ifdef USE_POLL
+ highestFD = sysconf(_SC_OPEN_MAX) - 1;
+#endif
+
if (statp->nscount == 0) {
errno = ESRCH;
return (-1);
@@ -760,10 +775,15 @@ send_dg(res_state statp,
const struct sockaddr *nsap;
int nsaplen;
struct timespec now, timeout, finish;
- fd_set dsmask;
struct sockaddr_storage from;
ISC_SOCKLEN_T fromlen;
int resplen, seconds, n, s;
+#ifdef USE_POLL
+ int polltimeout;
+ struct pollfd pollfd;
+#else
+ fd_set dsmask;
+#endif
nsap = get_nsaddr(statp, ns);
nsaplen = get_salen(nsap);
@@ -841,6 +861,7 @@ send_dg(res_state statp,
wait:
now = evNowTime();
nonow:
+#ifndef USE_POLL
FD_ZERO(&dsmask);
FD_SET(s, &dsmask);
if (evCmpTime(finish, now) > 0)
@@ -848,6 +869,17 @@ send_dg(res_state statp,
else
timeout = evConsTime(0, 0);
n = pselect(s + 1, &dsmask, NULL, NULL, &timeout, NULL);
+#else
+ timeout = evSubTime(finish, now);
+ if (timeout.tv_sec < 0)
+ timeout = evConsTime(0, 0);
+ polltimeout = 1000*timeout.tv_sec +
+ timeout.tv_nsec/1000000;
+ pollfd.fd = s;
+ pollfd.events = POLLRDNORM;
+ n = poll(&pollfd, 1, polltimeout);
+#endif /* USE_POLL */
+
if (n == 0) {
Dprint(statp->options & RES_DEBUG, (stdout, ";; timeout\n"));
*gotsomewhere = 1;
@@ -856,7 +888,11 @@ send_dg(res_state statp,
if (n < 0) {
if (errno == EINTR)
goto wait;
+#ifndef USE_POLL
Perror(statp, stderr, "select", errno);
+#else
+ Perror(statp, stderr, "poll", errno);
+#endif /* USE_POLL */
res_nclose(statp);
return (0);
}
@@ -1025,7 +1061,7 @@ sock_eq(struct sockaddr *a, struct sockaddr *b) {
}
}
-#ifdef NEED_PSELECT
+#if defined(NEED_PSELECT) && !defined(USE_POLL)
/* XXX needs to move to the porting library. */
static int
pselect(int nfds, void *rfds, void *wfds, void *efds,
diff --git a/lib/bind/resolv/res_sendsigned.c b/lib/bind/resolv/res_sendsigned.c
index 1984377a..d1d22745 100644
--- a/lib/bind/resolv/res_sendsigned.c
+++ b/lib/bind/resolv/res_sendsigned.c
@@ -122,8 +122,16 @@ retry:
(stdout, "%s", ""),
answer, (anslen > len) ? len : anslen);
- Dprint(statp->pfcode & RES_PRF_REPLY,
- (stdout, ";; TSIG invalid (%s)\n", p_rcode(ret)));
+ if (ret > 0) {
+ Dprint(statp->pfcode & RES_PRF_REPLY,
+ (stdout, ";; server rejected TSIG (%s)\n",
+ p_rcode(ret)));
+ } else {
+ Dprint(statp->pfcode & RES_PRF_REPLY,
+ (stdout, ";; TSIG invalid (%s)\n",
+ p_rcode(-ret)));
+ }
+
free (nstatp);
free (newmsg);
dst_free_key(dstkey);
diff --git a/lib/bind9/api b/lib/bind9/api
index b4cd78b7..9b59914b 100644
--- a/lib/bind9/api
+++ b/lib/bind9/api
@@ -1,3 +1,3 @@
LIBINTERFACE = 0
-LIBREVISION = 5
+LIBREVISION = 6
LIBAGE = 0
diff --git a/lib/bind9/check.c b/lib/bind9/check.c
index 0cf1e756..880a5691 100644
--- a/lib/bind9/check.c
+++ b/lib/bind9/check.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2001-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: check.c,v 1.37.6.29 2004/11/22 05:02:41 marka Exp $ */
+/* $Id: check.c,v 1.37.6.31 2005/05/30 01:59:25 marka Exp $ */
#include <config.h>
@@ -119,7 +119,7 @@ check_orderent(cfg_obj_t *ent, isc_log_t *logctx) {
result = ISC_R_FAILURE;
} else if (strcasecmp(cfg_obj_asstring(obj), "fixed") == 0) {
cfg_obj_log(obj, logctx, ISC_LOG_WARNING,
- "rrset-order: order 'fixed' not implemented");
+ "rrset-order: order 'fixed' not fully implemented");
} else if (/* strcasecmp(cfg_obj_asstring(obj), "fixed") != 0 && */
strcasecmp(cfg_obj_asstring(obj), "random") != 0 &&
strcasecmp(cfg_obj_asstring(obj), "cyclic") != 0) {
diff --git a/lib/dns/adb.c b/lib/dns/adb.c
index 9c8d4d5b..30e0d9b0 100644
--- a/lib/dns/adb.c
+++ b/lib/dns/adb.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: adb.c,v 1.181.2.11.2.20 2004/11/10 22:32:40 marka Exp $ */
+/* $Id: adb.c,v 1.181.2.11.2.22 2005/03/17 03:58:29 marka Exp $ */
/*
* Implementation notes
@@ -3347,7 +3347,7 @@ dns_adb_marklame(dns_adb_t *adb, dns_adbaddrinfo_t *addr, dns_name_t *zone,
bucket = addr->entry->lock_bucket;
LOCK(&adb->entrylocks[bucket]);
zi = ISC_LIST_HEAD(addr->entry->zoneinfo);
- while (zi != NULL && dns_name_equal(zone, &zi->zone))
+ while (zi != NULL && !dns_name_equal(zone, &zi->zone))
zi = ISC_LIST_NEXT(zi, plink);
if (zi != NULL) {
if (expire_time > zi->lame_timer)
diff --git a/lib/dns/api b/lib/dns/api
index c06a62ec..c7482c18 100644
--- a/lib/dns/api
+++ b/lib/dns/api
@@ -1,3 +1,3 @@
-LIBINTERFACE = 20
-LIBREVISION = 2
+LIBINTERFACE = 21
+LIBREVISION = 0
LIBAGE = 0
diff --git a/lib/dns/cache.c b/lib/dns/cache.c
index b148f602..0e17a957 100644
--- a/lib/dns/cache.c
+++ b/lib/dns/cache.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: cache.c,v 1.45.2.4.8.7 2004/03/08 02:07:52 marka Exp $ */
+/* $Id: cache.c,v 1.45.2.4.8.9 2005/03/17 03:58:30 marka Exp $ */
#include <config.h>
@@ -1021,27 +1021,10 @@ dns_cache_flushname(dns_cache_t *cache, dns_name_t *name) {
dns_rdataset_init(&rdataset);
dns_rdatasetiter_current(iter, &rdataset);
-
- for (result = dns_rdataset_first(&rdataset);
- result == ISC_R_SUCCESS;
- result = dns_rdataset_next(&rdataset))
- {
- dns_rdata_t rdata = DNS_RDATA_INIT;
- dns_rdatatype_t covers;
-
- dns_rdataset_current(&rdataset, &rdata);
- if (rdata.type == dns_rdatatype_rrsig)
- covers = dns_rdata_covers(&rdata);
- else
- covers = 0;
- result = dns_db_deleterdataset(cache->db, node, NULL,
- rdata.type, covers);
- if (result != ISC_R_SUCCESS &&
- result != DNS_R_UNCHANGED)
- break;
- }
+ result = dns_db_deleterdataset(cache->db, node, NULL,
+ rdataset.type, rdataset.covers);
dns_rdataset_disassociate(&rdataset);
- if (result != ISC_R_NOMORE)
+ if (result != ISC_R_SUCCESS && result != DNS_R_UNCHANGED)
break;
}
if (result == ISC_R_NOMORE)
diff --git a/lib/dns/forward.c b/lib/dns/forward.c
index f94abfe1..1455fbad 100644
--- a/lib/dns/forward.c
+++ b/lib/dns/forward.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000, 2001 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: forward.c,v 1.5.206.1 2004/03/06 08:13:38 marka Exp $ */
+/* $Id: forward.c,v 1.5.206.3 2005/03/17 03:58:30 marka Exp $ */
#include <config.h>
@@ -139,13 +139,20 @@ isc_result_t
dns_fwdtable_find(dns_fwdtable_t *fwdtable, dns_name_t *name,
dns_forwarders_t **forwardersp)
{
+ return (dns_fwdtable_find2(fwdtable, name, NULL, forwardersp));
+}
+
+isc_result_t
+dns_fwdtable_find2(dns_fwdtable_t *fwdtable, dns_name_t *name,
+ dns_name_t *foundname, dns_forwarders_t **forwardersp)
+{
isc_result_t result;
REQUIRE(VALID_FWDTABLE(fwdtable));
RWLOCK(&fwdtable->rwlock, isc_rwlocktype_read);
- result = dns_rbt_findname(fwdtable->table, name, 0, NULL,
+ result = dns_rbt_findname(fwdtable->table, name, 0, foundname,
(void **)forwardersp);
if (result == DNS_R_PARTIALMATCH)
result = ISC_R_SUCCESS;
diff --git a/lib/dns/gen-unix.h b/lib/dns/gen-unix.h
index 8c1818dd..bd007c45 100644
--- a/lib/dns/gen-unix.h
+++ b/lib/dns/gen-unix.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2001 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: gen-unix.h,v 1.12.12.3 2004/03/08 09:04:29 marka Exp $ */
+/* $Id: gen-unix.h,v 1.12.12.5 2005/06/09 23:54:29 marka Exp $ */
/*
* This file is responsible for defining two operations that are not
@@ -40,6 +40,10 @@
#include <isc/boolean.h>
#include <isc/lang.h>
+#ifdef NEED_OPTARG
+extern char *optarg;
+#endif
+
#define isc_commandline_parse getopt
#define isc_commandline_argument optarg
diff --git a/lib/dns/include/dns/forward.h b/lib/dns/include/dns/forward.h
index f1bf5abf..1eb62d2a 100644
--- a/lib/dns/include/dns/forward.h
+++ b/lib/dns/include/dns/forward.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000, 2001 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: forward.h,v 1.2.206.1 2004/03/06 08:13:56 marka Exp $ */
+/* $Id: forward.h,v 1.2.206.3 2005/03/17 03:58:31 marka Exp $ */
#ifndef DNS_FORWARD_H
#define DNS_FORWARD_H 1
@@ -67,6 +67,10 @@ dns_fwdtable_add(dns_fwdtable_t *fwdtable, dns_name_t *name,
isc_result_t
dns_fwdtable_find(dns_fwdtable_t *fwdtable, dns_name_t *name,
dns_forwarders_t **forwardersp);
+
+isc_result_t
+dns_fwdtable_find2(dns_fwdtable_t *fwdtable, dns_name_t *name,
+ dns_name_t *foundname, dns_forwarders_t **forwardersp);
/*
* Finds a domain in the forwarding table. The closest matching parent
* domain is returned.
@@ -75,6 +79,7 @@ dns_fwdtable_find(dns_fwdtable_t *fwdtable, dns_name_t *name,
* fwdtable is a valid forwarding table.
* name is a valid name
* forwardersp != NULL && *forwardersp == NULL
+ * foundname to be NULL or a valid name with buffer.
*
* Returns:
* ISC_R_SUCCESS
diff --git a/lib/dns/include/dns/masterdump.h b/lib/dns/include/dns/masterdump.h
index 50589454..888c588f 100644
--- a/lib/dns/include/dns/masterdump.h
+++ b/lib/dns/include/dns/masterdump.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2002 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: masterdump.h,v 1.22.12.8 2004/03/19 05:00:49 marka Exp $ */
+/* $Id: masterdump.h,v 1.22.12.10 2005/09/06 02:12:41 marka Exp $ */
#ifndef DNS_MASTERDUMP_H
#define DNS_MASTERDUMP_H 1
@@ -122,7 +122,7 @@ LIBDNS_EXTERNAL_DATA extern const dns_master_style_t dns_master_style_full;
* stop of its own, but the class and type share one.
*/
LIBDNS_EXTERNAL_DATA extern const dns_master_style_t
- dns_master_style_explicitttl;
+ dns_master_style_explicitttl;
/*
* A master style format designed for cache files. It prints explicit TTL
diff --git a/lib/dns/include/dns/rdataset.h b/lib/dns/include/dns/rdataset.h
index e2b0753a..d856784c 100644
--- a/lib/dns/include/dns/rdataset.h
+++ b/lib/dns/include/dns/rdataset.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rdataset.h,v 1.41.2.5.2.6 2004/03/08 02:08:01 marka Exp $ */
+/* $Id: rdataset.h,v 1.41.2.5.2.8 2005/03/17 03:58:31 marka Exp $ */
#ifndef DNS_RDATASET_H
#define DNS_RDATASET_H 1
@@ -130,22 +130,23 @@ struct dns_rdataset {
* Used by message.c to indicate that the rdataset's rdata had differing
* TTL values, and the rdataset->ttl holds the smallest.
*/
-#define DNS_RDATASETATTR_QUESTION 0x0001
-#define DNS_RDATASETATTR_RENDERED 0x0002 /* Used by message.c */
-#define DNS_RDATASETATTR_ANSWERED 0x0004 /* Used by server. */
-#define DNS_RDATASETATTR_CACHE 0x0008 /* Used by resolver. */
-#define DNS_RDATASETATTR_ANSWER 0x0010 /* Used by resolver. */
-#define DNS_RDATASETATTR_ANSWERSIG 0x0020 /* Used by resolver. */
-#define DNS_RDATASETATTR_EXTERNAL 0x0040 /* Used by resolver. */
-#define DNS_RDATASETATTR_NCACHE 0x0080 /* Used by resolver. */
-#define DNS_RDATASETATTR_CHAINING 0x0100 /* Used by resolver. */
-#define DNS_RDATASETATTR_TTLADJUSTED 0x0200 /* Used by message.c */
-#define DNS_RDATASETATTR_FIXEDORDER 0x0400
-#define DNS_RDATASETATTR_RANDOMIZE 0x0800
-#define DNS_RDATASETATTR_CHASE 0x1000 /* Used by resolver. */
-#define DNS_RDATASETATTR_NXDOMAIN 0x2000
-#define DNS_RDATASETATTR_NOQNAME 0x4000
-#define DNS_RDATASETATTR_CHECKNAMES 0x8000 /* Used by resolver. */
+#define DNS_RDATASETATTR_QUESTION 0x00000001
+#define DNS_RDATASETATTR_RENDERED 0x00000002 /* Used by message.c */
+#define DNS_RDATASETATTR_ANSWERED 0x00000004 /* Used by server. */
+#define DNS_RDATASETATTR_CACHE 0x00000008 /* Used by resolver. */
+#define DNS_RDATASETATTR_ANSWER 0x00000010 /* Used by resolver. */
+#define DNS_RDATASETATTR_ANSWERSIG 0x00000020 /* Used by resolver. */
+#define DNS_RDATASETATTR_EXTERNAL 0x00000040 /* Used by resolver. */
+#define DNS_RDATASETATTR_NCACHE 0x00000080 /* Used by resolver. */
+#define DNS_RDATASETATTR_CHAINING 0x00000100 /* Used by resolver. */
+#define DNS_RDATASETATTR_TTLADJUSTED 0x00000200 /* Used by message.c */
+#define DNS_RDATASETATTR_FIXEDORDER 0x00000400
+#define DNS_RDATASETATTR_RANDOMIZE 0x00000800
+#define DNS_RDATASETATTR_CHASE 0x00001000 /* Used by resolver. */
+#define DNS_RDATASETATTR_NXDOMAIN 0x00002000
+#define DNS_RDATASETATTR_NOQNAME 0x00004000
+#define DNS_RDATASETATTR_CHECKNAMES 0x00008000 /* Used by resolver. */
+#define DNS_RDATASETATTR_REQUIREDGLUE 0x00010000
/*
* _OMITDNSSEC:
diff --git a/lib/dns/include/dns/validator.h b/lib/dns/include/dns/validator.h
index c405fbb4..24769f3c 100644
--- a/lib/dns/include/dns/validator.h
+++ b/lib/dns/include/dns/validator.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: validator.h,v 1.18.12.7 2004/05/14 05:06:41 marka Exp $ */
+/* $Id: validator.h,v 1.18.12.9 2005/09/06 02:12:41 marka Exp $ */
#ifndef DNS_VALIDATOR_H
#define DNS_VALIDATOR_H 1
@@ -120,12 +120,16 @@ struct dns_validator {
dns_fixedname_t fname;
dns_fixedname_t wild;
ISC_LINK(dns_validator_t) link;
- dns_rdataset_t * dlv;
+ dns_rdataset_t dlv;
dns_fixedname_t dlvsep;
isc_boolean_t havedlvsep;
isc_boolean_t mustbesecure;
+ unsigned int dlvlabels;
+ unsigned int depth;
};
+#define DNS_VALIDATOR_DLV 1
+
ISC_LANG_BEGINDECLS
isc_result_t
diff --git a/lib/dns/journal.c b/lib/dns/journal.c
index 13fbdeef..dab992c1 100644
--- a/lib/dns/journal.c
+++ b/lib/dns/journal.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2002 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,11 +15,12 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: journal.c,v 1.77.2.1.10.9 2004/09/16 04:57:02 marka Exp $ */
+/* $Id: journal.c,v 1.77.2.1.10.12 2005/06/08 02:08:27 marka Exp $ */
#include <config.h>
#include <stdlib.h>
+#include <unistd.h>
#include <isc/file.h>
#include <isc/mem.h>
@@ -1750,6 +1751,8 @@ dns_diff_subtract(dns_diff_t diff[2], dns_diff_t *r) {
isc_result_t result;
dns_difftuple_t *p[2];
int i, t;
+ isc_boolean_t append;
+
CHECK(dns_diff_sort(&diff[0], rdata_order));
CHECK(dns_diff_sort(&diff[1], rdata_order));
@@ -1778,11 +1781,17 @@ dns_diff_subtract(dns_diff_t diff[2], dns_diff_t *r) {
}
INSIST(t == 0);
/*
- * Identical RRs in both databases; skip them both.
+ * Identical RRs in both databases; skip them both
+ * if the ttl differs.
*/
+ append = ISC_TF(p[0]->ttl != p[1]->ttl);
for (i = 0; i < 2; i++) {
ISC_LIST_UNLINK(diff[i].tuples, p[i], link);
- dns_difftuple_free(&p[i]);
+ if (append) {
+ ISC_LIST_APPEND(r->tuples, p[i], link);
+ } else {
+ dns_difftuple_free(&p[i]);
+ }
}
next: ;
}
diff --git a/lib/dns/key.c b/lib/dns/key.c
index 7abb2d7f..97d970ed 100644
--- a/lib/dns/key.c
+++ b/lib/dns/key.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2001 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,10 +15,11 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: key.c,v 1.1.4.1 2004/12/09 04:07:18 marka Exp $ */
+/* $Id: key.c,v 1.1.4.3 2005/06/09 23:54:29 marka Exp $ */
#include <config.h>
+#include <stddef.h>
#include <stdlib.h>
#include <isc/region.h>
diff --git a/lib/dns/message.c b/lib/dns/message.c
index badde6ee..d4b2e196 100644
--- a/lib/dns/message.c
+++ b/lib/dns/message.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: message.c,v 1.194.2.10.2.17 2004/05/05 01:32:16 marka Exp $ */
+/* $Id: message.c,v 1.194.2.10.2.20 2005/06/07 01:42:23 marka Exp $ */
/***
*** Imports
@@ -1476,6 +1476,13 @@ getsection(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx,
free_name = ISC_FALSE;
}
+ if (seen_problem) {
+ if (free_name)
+ isc_mempool_put(msg->namepool, name);
+ if (free_rdataset)
+ isc_mempool_put(msg->rdspool, rdataset);
+ free_name = free_rdataset = ISC_FALSE;
+ }
INSIST(free_name == ISC_FALSE);
INSIST(free_rdataset == ISC_FALSE);
}
@@ -1783,6 +1790,57 @@ dns_message_rendersection(dns_message_t *msg, dns_section_t sectionid,
if (msg->reserved == 0 && (options & DNS_MESSAGERENDER_PARTIAL) != 0)
partial = ISC_TRUE;
+ /*
+ * Render required glue first. Set TC if it won't fit.
+ */
+ name = ISC_LIST_HEAD(*section);
+ if (name != NULL) {
+ rdataset = ISC_LIST_HEAD(name->list);
+ if (rdataset != NULL &&
+ (rdataset->attributes & DNS_RDATASETATTR_REQUIREDGLUE) != 0 &&
+ (rdataset->attributes & DNS_RDATASETATTR_RENDERED) == 0) {
+ void *order_arg = msg->order_arg;
+ st = *(msg->buffer);
+ count = 0;
+ if (partial)
+ result = dns_rdataset_towirepartial(rdataset,
+ name,
+ msg->cctx,
+ msg->buffer,
+ msg->order,
+ order_arg,
+ rd_options,
+ &count,
+ NULL);
+ else
+ result = dns_rdataset_towiresorted(rdataset,
+ name,
+ msg->cctx,
+ msg->buffer,
+ msg->order,
+ order_arg,
+ rd_options,
+ &count);
+ total += count;
+ if (partial && result == ISC_R_NOSPACE) {
+ msg->flags |= DNS_MESSAGEFLAG_TC;
+ msg->buffer->length += msg->reserved;
+ msg->counts[sectionid] += total;
+ return (result);
+ }
+ if (result != ISC_R_SUCCESS) {
+ INSIST(st.used < 65536);
+ dns_compress_rollback(msg->cctx,
+ (isc_uint16_t)st.used);
+ *(msg->buffer) = st; /* rollback */
+ msg->buffer->length += msg->reserved;
+ msg->counts[sectionid] += total;
+ return (result);
+ }
+ rdataset->attributes |= DNS_RDATASETATTR_RENDERED;
+ }
+ }
+
do {
name = ISC_LIST_HEAD(*section);
if (name == NULL) {
diff --git a/lib/dns/name.c b/lib/dns/name.c
index 37a5f4e8..bebb1588 100644
--- a/lib/dns/name.c
+++ b/lib/dns/name.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1998-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: name.c,v 1.127.2.7.2.11 2004/09/01 05:19:59 marka Exp $ */
+/* $Id: name.c,v 1.127.2.7.2.13 2005/07/23 04:34:37 marka Exp $ */
#include <config.h>
@@ -1305,13 +1305,14 @@ dns_name_totext(dns_name_t *name, isc_boolean_t omit_final_dot,
trem--;
nlen--;
} else {
- char buf[5];
if (trem < 4)
return (ISC_R_NOSPACE);
- snprintf(buf, sizeof(buf),
- "\\%03u", c);
- memcpy(tdata, buf, 4);
- tdata += 4;
+ *tdata++ = 0x5c;
+ *tdata++ = 0x30 +
+ ((c / 100) % 10);
+ *tdata++ = 0x30 +
+ ((c / 10) % 10);
+ *tdata++ = 0x30 + (c % 10);
trem -= 4;
ndata++;
nlen--;
diff --git a/lib/dns/rbt.c b/lib/dns/rbt.c
index cb438580..ecff7837 100644
--- a/lib/dns/rbt.c
+++ b/lib/dns/rbt.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rbt.c,v 1.115.2.2.2.11 2004/10/25 01:36:07 marka Exp $ */
+/* $Id: rbt.c,v 1.115.2.2.2.13 2005/06/18 01:03:24 marka Exp $ */
/* Principal Authors: DCL */
@@ -2060,7 +2060,10 @@ dns_rbt_deletetreeflat(dns_rbt_t *rbt, unsigned int quantum,
if (DATA(node) != NULL && rbt->data_deleter != NULL)
rbt->data_deleter(DATA(node), rbt->deleter_arg);
- unhash_node(rbt, node);
+ /*
+ * Note: we don't call unhash_node() here as we are destroying
+ * the complete rbt tree.
+ */
#if DNS_RBT_USEMAGIC
node->magic = 0;
#endif
diff --git a/lib/dns/rbtdb.c b/lib/dns/rbtdb.c
index a0e5ab51..d2da6343 100644
--- a/lib/dns/rbtdb.c
+++ b/lib/dns/rbtdb.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rbtdb.c,v 1.168.2.11.2.16 2004/05/23 11:07:23 marka Exp $ */
+/* $Id: rbtdb.c,v 1.168.2.11.2.21 2005/07/07 02:58:53 marka Exp $ */
/*
* Principal Author: Bob Halley
@@ -97,6 +97,12 @@ typedef isc_uint32_t rbtdb_rdatatype_t;
#define RBTDB_RDATATYPE_NCACHEANY \
RBTDB_RDATATYPE_VALUE(0, dns_rdatatype_any)
+/*
+ * Allow clients with a virtual time of upto 5 minutes in the past to see
+ * records that would have otherwise have expired.
+ */
+#define RBTDB_VIRTUAL 300
+
struct noqname {
dns_name_t name;
void * nsec;
@@ -413,7 +419,7 @@ free_rbtdb(dns_rbtdb_t *rbtdb, isc_boolean_t log, isc_event_t *event) {
again:
if (rbtdb->tree != NULL) {
result = dns_rbt_destroy2(&rbtdb->tree,
- (rbtdb->task != NULL) ? 5 : 0);
+ (rbtdb->task != NULL) ? 1000 : 0);
if (result == ISC_R_QUOTA) {
INSIST(rbtdb->task != NULL);
if (event == NULL)
@@ -2786,7 +2792,9 @@ find_coveringnsec(rbtdb_search_t *search, dns_dbnode_t **nodep,
* node as dirty, so it will get cleaned up
* later.
*/
- if (node->references == 0) {
+ if (header->ttl > search->now - RBTDB_VIRTUAL)
+ header_prev = header;
+ else if (node->references == 0) {
INSIST(header->down == NULL);
if (header_prev != NULL)
header_prev->next =
@@ -2943,7 +2951,9 @@ cache_find(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version,
* mark it as stale, and the node as dirty, so it will
* get cleaned up later.
*/
- if (node->references == 0) {
+ if (header->ttl > now - RBTDB_VIRTUAL)
+ header_prev = header;
+ else if (node->references == 0) {
INSIST(header->down == NULL);
if (header_prev != NULL)
header_prev->next = header->next;
@@ -3210,7 +3220,9 @@ cache_findzonecut(dns_db_t *db, dns_name_t *name, unsigned int options,
* mark it as stale, and the node as dirty, so it will
* get cleaned up later.
*/
- if (node->references == 0) {
+ if (header->ttl > now - RBTDB_VIRTUAL)
+ header_prev = header;
+ else if (node->references == 0) {
INSIST(header->down == NULL);
if (header_prev != NULL)
header_prev->next = header->next;
@@ -3398,7 +3410,7 @@ expirenode(dns_db_t *db, dns_dbnode_t *node, isc_stdtime_t now) {
LOCK(&rbtdb->node_locks[rbtnode->locknum].lock);
for (header = rbtnode->data; header != NULL; header = header->next)
- if (header->ttl <= now) {
+ if (header->ttl <= now - RBTDB_VIRTUAL) {
/*
* We don't check if rbtnode->references == 0 and try
* to free like we do in cache_find(), because
@@ -3640,8 +3652,10 @@ cache_findrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
* rbtnode->references must be non-zero. This is so
* because 'node' is an argument to the function.
*/
- header->attributes |= RDATASET_ATTR_STALE;
- rbtnode->dirty = 1;
+ if (header->ttl <= now - RBTDB_VIRTUAL) {
+ header->attributes |= RDATASET_ATTR_STALE;
+ rbtnode->dirty = 1;
+ }
} else if (EXISTS(header)) {
if (header->type == matchtype)
found = header;
@@ -4344,6 +4358,7 @@ subtractrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
changed = add_changed(rbtdb, rbtversion, rbtnode);
if (changed == NULL) {
free_rdataset(rbtdb->common.mctx, newheader);
+ UNLOCK(&rbtdb->node_locks[rbtnode->locknum].lock);
return (ISC_R_NOMEMORY);
}
@@ -4909,6 +4924,11 @@ dns_rbtdb_create
isc_mem_attach(mctx, &rbtdb->common.mctx);
/*
+ * Must be initalized before free_rbtdb() is called.
+ */
+ isc_ondestroy_init(&rbtdb->common.ondest);
+
+ /*
* Make a copy of the origin name.
*/
result = dns_name_dupwithoffsets(origin, mctx, &rbtdb->common.origin);
@@ -4986,8 +5006,6 @@ dns_rbtdb_create
rbtdb->future_version = NULL;
ISC_LIST_INIT(rbtdb->open_versions);
- isc_ondestroy_init(&rbtdb->common.ondest);
-
rbtdb->common.magic = DNS_DB_MAGIC;
rbtdb->common.impmagic = RBTDB_MAGIC;
diff --git a/lib/dns/rdata.c b/lib/dns/rdata.c
index 6d4c0986..1b3f2a51 100644
--- a/lib/dns/rdata.c
+++ b/lib/dns/rdata.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1998-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rdata.c,v 1.147.2.11.2.16 2004/10/06 05:37:40 marka Exp $ */
+/* $Id: rdata.c,v 1.147.2.11.2.20 2005/07/22 05:27:52 marka Exp $ */
#include <config.h>
#include <ctype.h>
@@ -986,11 +986,15 @@ txt_totext(isc_region_t *source, isc_buffer_t *target) {
if (*sp < 0x20 || *sp >= 0x7f) {
if (tl < 4)
return (ISC_R_NOSPACE);
- snprintf(tp, 5, "\\%03u", *sp++);
- tp += 4;
+ *tp++ = 0x5c;
+ *tp++ = 0x30 + ((*sp / 100) % 10);
+ *tp++ = 0x30 + ((*sp / 10) % 10);
+ *tp++ = 0x30 + (*sp % 10);
+ sp++;
tl -= 4;
continue;
}
+ /* double quote, semi-colon, backslash */
if (*sp == 0x22 || *sp == 0x3b || *sp == 0x5c) {
if (tl < 2)
return (ISC_R_NOSPACE);
@@ -1213,7 +1217,7 @@ name_tobuffer(dns_name_t *name, isc_buffer_t *target) {
static isc_uint32_t
uint32_fromregion(isc_region_t *region) {
- unsigned long value;
+ isc_uint32_t value;
REQUIRE(region->length >= 4);
value = region->base[0] << 24;
diff --git a/lib/dns/rdata/any_255/tsig_250.c b/lib/dns/rdata/any_255/tsig_250.c
index 6943d824..c9b52c7e 100644
--- a/lib/dns/rdata/any_255/tsig_250.c
+++ b/lib/dns/rdata/any_255/tsig_250.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: tsig_250.c,v 1.52.2.1.2.6 2004/03/08 09:04:40 marka Exp $ */
+/* $Id: tsig_250.c,v 1.52.2.1.2.8 2005/03/20 22:34:01 marka Exp $ */
/* Reviewed: Thu Mar 16 13:39:43 PST 2000 by gson */
@@ -162,8 +162,10 @@ totext_any_tsig(ARGS_TOTEXT) {
*/
sigtime = ((isc_uint64_t)sr.base[0] << 40) |
((isc_uint64_t)sr.base[1] << 32) |
- (sr.base[2] << 24) | (sr.base[3] << 16) |
- (sr.base[4] << 8) | sr.base[5];
+ ((isc_uint64_t)sr.base[2] << 24) |
+ ((isc_uint64_t)sr.base[3] << 16) |
+ ((isc_uint64_t)sr.base[4] << 8) |
+ (isc_uint64_t)sr.base[5];
isc_region_consume(&sr, 6);
bufp = &buf[sizeof(buf) - 1];
*bufp-- = 0;
@@ -457,8 +459,10 @@ tostruct_any_tsig(ARGS_TOSTRUCT) {
INSIST(sr.length >= 6);
tsig->timesigned = ((isc_uint64_t)sr.base[0] << 40) |
((isc_uint64_t)sr.base[1] << 32) |
- (sr.base[2] << 24) | (sr.base[3] << 16) |
- (sr.base[4] << 8) | sr.base[5];
+ ((isc_uint64_t)sr.base[2] << 24) |
+ ((isc_uint64_t)sr.base[3] << 16) |
+ ((isc_uint64_t)sr.base[4] << 8) |
+ (isc_uint64_t)sr.base[5];
isc_region_consume(&sr, 6);
/*
diff --git a/lib/dns/rdata/generic/ds_43.c b/lib/dns/rdata/generic/ds_43.c
index 538f8657..0206b6f0 100644
--- a/lib/dns/rdata/generic/ds_43.c
+++ b/lib/dns/rdata/generic/ds_43.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2002 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: ds_43.c,v 1.6.2.2 2004/03/16 12:38:14 marka Exp $ */
+/* $Id: ds_43.c,v 1.6.2.4 2005/09/06 07:29:31 marka Exp $ */
/* draft-ietf-dnsext-delegation-signer-05.txt */
@@ -28,6 +28,7 @@
static inline isc_result_t
fromtext_ds(ARGS_FROMTEXT) {
isc_token_t token;
+ unsigned char c;
REQUIRE(type == 43);
@@ -49,11 +50,10 @@ fromtext_ds(ARGS_FROMTEXT) {
/*
* Algorithm.
*/
- RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number,
+ RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
ISC_FALSE));
- if (token.value.as_ulong > 0xffU)
- RETTOK(ISC_R_RANGE);
- RETERR(uint8_tobuffer(token.value.as_ulong, target));
+ RETTOK(dns_secalg_fromtext(&c, &token.value.as_textregion));
+ RETERR(mem_tobuffer(target, &c, 1));
/*
* Digest type.
diff --git a/lib/dns/rdata/generic/rt_21.c b/lib/dns/rdata/generic/rt_21.c
index 0f568e3b..daf9756f 100644
--- a/lib/dns/rdata/generic/rt_21.c
+++ b/lib/dns/rdata/generic/rt_21.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2001, 2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rt_21.c,v 1.37.2.1.2.3 2004/03/06 08:14:11 marka Exp $ */
+/* $Id: rt_21.c,v 1.37.2.1.2.5 2005/03/17 03:58:31 marka Exp $ */
/* reviewed: Thu Mar 16 15:02:31 PST 2000 by brister */
@@ -300,7 +300,7 @@ checknames_rt(ARGS_CHECKNAMES) {
isc_region_consume(&region, 2);
dns_name_init(&name, NULL);
dns_name_fromregion(&name, &region);
- if (dns_name_ishostname(&name, ISC_FALSE)) {
+ if (!dns_name_ishostname(&name, ISC_FALSE)) {
if (bad != NULL)
dns_name_clone(&name, bad);
return (ISC_FALSE);
diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c
index 90af5b02..8d1dbd7d 100644
--- a/lib/dns/resolver.c
+++ b/lib/dns/resolver.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: resolver.c,v 1.218.2.18.4.51 2005/02/08 23:59:44 marka Exp $ */
+/* $Id: resolver.c,v 1.218.2.18.4.55 2005/08/25 01:54:32 marka Exp $ */
#include <config.h>
@@ -244,6 +244,11 @@ struct fetchctx {
#define TRIEDFIND(f) (((f)->attributes & FCTX_ATTR_TRIEDFIND) != 0)
#define TRIEDALT(f) (((f)->attributes & FCTX_ATTR_TRIEDALT) != 0)
+typedef struct {
+ dns_adbaddrinfo_t * addrinfo;
+ fetchctx_t * fctx;
+} dns_valarg_t;
+
struct dns_fetch {
unsigned int magic;
fetchctx_t * private;
@@ -342,6 +347,35 @@ static isc_result_t ncache_adderesult(dns_message_t *message,
isc_stdtime_t now, dns_ttl_t maxttl,
dns_rdataset_t *ardataset,
isc_result_t *eresultp);
+static void validated(isc_task_t *task, isc_event_t *event);
+
+static isc_result_t
+valcreate(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo, dns_name_t *name,
+ dns_rdatatype_t type, dns_rdataset_t *rdataset,
+ dns_rdataset_t *sigrdataset, unsigned int valoptions,
+ isc_task_t *task)
+{
+ dns_validator_t *validator = NULL;
+ dns_valarg_t *valarg;
+ isc_result_t result;
+
+ valarg = isc_mem_get(fctx->res->mctx, sizeof(*valarg));
+ if (valarg == NULL)
+ return (ISC_R_NOMEMORY);
+
+ valarg->fctx = fctx;
+ valarg->addrinfo = addrinfo;
+
+ result = dns_validator_create(fctx->res->view, name, type, rdataset,
+ sigrdataset, fctx->rmessage,
+ valoptions, task, validated, valarg,
+ &validator);
+ if (result == ISC_R_SUCCESS)
+ ISC_LIST_APPEND(fctx->validators, validator, link);
+ else
+ isc_mem_put(fctx->res->mctx, valarg, sizeof(*valarg));
+ return (result);
+}
static isc_boolean_t
fix_mustbedelegationornxdomain(dns_message_t *message, fetchctx_t *fctx) {
@@ -1424,6 +1458,7 @@ resquery_connected(isc_task_t *task, isc_event_t *event) {
case ISC_R_CONNREFUSED:
case ISC_R_NOPERM:
case ISC_R_ADDRNOTAVAIL:
+ case ISC_R_CONNECTIONRESET:
/*
* No route to remote.
*/
@@ -2665,10 +2700,10 @@ fctx_create(dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type,
unsigned int options, unsigned int bucketnum, fetchctx_t **fctxp)
{
fetchctx_t *fctx;
- isc_result_t result = ISC_R_SUCCESS;
+ isc_result_t result;
isc_result_t iresult;
isc_interval_t interval;
- dns_fixedname_t qdomain;
+ dns_fixedname_t fixed;
unsigned int findoptions = 0;
char buf[DNS_NAME_FORMATSIZE + DNS_RDATATYPE_FORMATSIZE];
char typebuf[DNS_RDATATYPE_FORMATSIZE];
@@ -2687,8 +2722,10 @@ fctx_create(dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type,
strcat(buf, "/"); /* checked */
strcat(buf, typebuf); /* checked */
fctx->info = isc_mem_strdup(res->mctx, buf);
- if (fctx->info == NULL)
+ if (fctx->info == NULL) {
+ result = ISC_R_NOMEMORY;
goto cleanup_fetch;
+ }
FCTXTRACE("create");
dns_name_init(&fctx->name, NULL);
result = dns_name_dup(name, res->mctx, &fctx->name);
@@ -2745,8 +2782,10 @@ fctx_create(dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type,
dns_name_getlabelsequence(name, 1, labels - 1, &suffix);
name = &suffix;
}
- result = dns_fwdtable_find(fctx->res->view->fwdtable, name,
- &forwarders);
+ dns_fixedname_init(&fixed);
+ domain = dns_fixedname_name(&fixed);
+ result = dns_fwdtable_find2(fctx->res->view->fwdtable, name,
+ domain, &forwarders);
if (result == ISC_R_SUCCESS)
fctx->fwdpolicy = forwarders->fwdpolicy;
@@ -2758,27 +2797,22 @@ fctx_create(dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type,
*/
if (dns_rdatatype_atparent(type))
findoptions |= DNS_DBFIND_NOEXACT;
- dns_fixedname_init(&qdomain);
- result = dns_view_findzonecut(res->view, name,
- dns_fixedname_name(&qdomain), 0,
- findoptions, ISC_TRUE,
+ result = dns_view_findzonecut(res->view, name, domain,
+ 0, findoptions, ISC_TRUE,
&fctx->nameservers,
NULL);
if (result != ISC_R_SUCCESS)
goto cleanup_name;
- result = dns_name_dup(dns_fixedname_name(&qdomain),
- res->mctx, &fctx->domain);
+ result = dns_name_dup(domain, res->mctx, &fctx->domain);
if (result != ISC_R_SUCCESS) {
dns_rdataset_disassociate(&fctx->nameservers);
goto cleanup_name;
}
} else {
/*
- * We're in forward-only mode. Set the query domain
- * to ".".
+ * We're in forward-only mode. Set the query domain.
*/
- result = dns_name_dup(dns_rootname, res->mctx,
- &fctx->domain);
+ result = dns_name_dup(domain, res->mctx, &fctx->domain);
if (result != ISC_R_SUCCESS)
goto cleanup_name;
}
@@ -3088,11 +3122,15 @@ validated(isc_task_t *task, isc_event_t *event) {
dns_name_t *name;
dns_rdataset_t *rdataset;
dns_rdataset_t *sigrdataset;
+ dns_valarg_t *valarg;
+ dns_adbaddrinfo_t *addrinfo;
UNUSED(task); /* for now */
REQUIRE(event->ev_type == DNS_EVENT_VALIDATORDONE);
- fctx = event->ev_arg;
+ valarg = event->ev_arg;
+ fctx = valarg->fctx;
+ addrinfo = valarg->addrinfo;
REQUIRE(VALID_FCTX(fctx));
REQUIRE(!ISC_LIST_EMPTY(fctx->validators));
@@ -3107,6 +3145,7 @@ validated(isc_task_t *task, isc_event_t *event) {
* destroy the fctx if necessary.
*/
dns_validator_destroy(&vevent->validator);
+ isc_mem_put(fctx->res->mctx, valarg, sizeof(*valarg));
negative = ISC_TF(vevent->rdataset == NULL);
@@ -3164,21 +3203,27 @@ validated(isc_task_t *task, isc_event_t *event) {
if (vevent->result != ISC_R_SUCCESS) {
FCTXTRACE("validation failed");
- if (vevent->rdataset != NULL) {
+ result = ISC_R_NOTFOUND;
+ if (vevent->rdataset != NULL)
result = dns_db_findnode(fctx->cache, vevent->name,
ISC_TRUE, &node);
- if (result != ISC_R_SUCCESS)
- goto noanswer_response;
+ if (result == ISC_R_SUCCESS)
(void)dns_db_deleterdataset(fctx->cache, node, NULL,
vevent->type, 0);
- if (vevent->sigrdataset != NULL)
- (void)dns_db_deleterdataset(fctx->cache,
- node, NULL,
- dns_rdatatype_rrsig,
- vevent->type);
- }
+ if (result == ISC_R_SUCCESS && vevent->sigrdataset != NULL)
+ (void)dns_db_deleterdataset(fctx->cache, node, NULL,
+ dns_rdatatype_rrsig,
+ vevent->type);
+ if (result == ISC_R_SUCCESS)
+ dns_db_detachnode(fctx->cache, &node);
result = vevent->result;
- goto noanswer_response;
+ add_bad(fctx, &addrinfo->sockaddr, result);
+ isc_event_free(&event);
+ if (sentresponse)
+ fctx_done(fctx, result);
+ else
+ fctx_try(fctx);
+ return;
}
isc_stdtime_get(&now);
@@ -3348,7 +3393,8 @@ validated(isc_task_t *task, isc_event_t *event) {
}
static inline isc_result_t
-cache_name(fetchctx_t *fctx, dns_name_t *name, isc_stdtime_t now) {
+cache_name(fetchctx_t *fctx, dns_name_t *name, dns_adbaddrinfo_t *addrinfo,
+ isc_stdtime_t now) {
dns_rdataset_t *rdataset, *sigrdataset;
dns_rdataset_t *addedrdataset, *ardataset, *asigrdataset;
dns_rdataset_t *valrdataset = NULL, *valsigrdataset = NULL;
@@ -3361,8 +3407,8 @@ cache_name(fetchctx_t *fctx, dns_name_t *name, isc_stdtime_t now) {
dns_fetchevent_t *event;
unsigned int options;
isc_task_t *task;
- dns_validator_t *validator;
isc_boolean_t fail;
+ unsigned int valoptions = 0;
/*
* The appropriate bucket lock must be held.
@@ -3383,8 +3429,10 @@ cache_name(fetchctx_t *fctx, dns_name_t *name, isc_stdtime_t now) {
if (result != ISC_R_SUCCESS)
return (result);
- if (res->view->dlv != NULL)
+ if (!secure_domain && res->view->dlv != NULL) {
+ valoptions = DNS_VALIDATOR_DLV;
secure_domain = ISC_TRUE;
+ }
if ((fctx->options & DNS_FETCHOPT_NOVALIDATE) != 0)
need_validation = ISC_FALSE;
@@ -3567,23 +3615,11 @@ cache_name(fetchctx_t *fctx, dns_name_t *name, isc_stdtime_t now) {
* having to remember which
* rdatasets needed validation.
*/
- validator = NULL;
- result = dns_validator_create(
- res->view,
- name,
- rdataset->type,
- rdataset,
- sigrdataset,
- fctx->rmessage,
- 0,
- task,
- validated,
- fctx,
- &validator);
- if (result == ISC_R_SUCCESS)
- ISC_LIST_APPEND(
- fctx->validators,
- validator, link);
+ result = valcreate(fctx, addrinfo,
+ name, rdataset->type,
+ rdataset,
+ sigrdataset,
+ valoptions, task);
}
} else if (CHAINING(rdataset)) {
if (rdataset->type == dns_rdatatype_cname)
@@ -3658,22 +3694,10 @@ cache_name(fetchctx_t *fctx, dns_name_t *name, isc_stdtime_t now) {
}
}
- if (valrdataset != NULL) {
- validator = NULL;
- result = dns_validator_create(res->view,
- name,
- fctx->type,
- valrdataset,
- valsigrdataset,
- fctx->rmessage,
- 0,
- task,
- validated,
- fctx,
- &validator);
- if (result == ISC_R_SUCCESS)
- ISC_LIST_APPEND(fctx->validators, validator, link);
- }
+ if (valrdataset != NULL)
+ result = valcreate(fctx, addrinfo, name, fctx->type,
+ valrdataset, valsigrdataset, valoptions,
+ task);
if (result == ISC_R_SUCCESS && have_answer) {
fctx->attributes |= FCTX_ATTR_HAVEANSWER;
@@ -3693,7 +3717,8 @@ cache_name(fetchctx_t *fctx, dns_name_t *name, isc_stdtime_t now) {
}
static inline isc_result_t
-cache_message(fetchctx_t *fctx, isc_stdtime_t now) {
+cache_message(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo, isc_stdtime_t now)
+{
isc_result_t result;
dns_section_t section;
dns_name_t *name;
@@ -3713,7 +3738,7 @@ cache_message(fetchctx_t *fctx, isc_stdtime_t now) {
dns_message_currentname(fctx->rmessage, section,
&name);
if ((name->attributes & DNS_NAMEATTR_CACHE) != 0) {
- result = cache_name(fctx, name, now);
+ result = cache_name(fctx, name, addrinfo, now);
if (result != ISC_R_SUCCESS)
break;
}
@@ -3781,7 +3806,9 @@ ncache_adderesult(dns_message_t *message, dns_db_t *cache, dns_dbnode_t *node,
}
static inline isc_result_t
-ncache_message(fetchctx_t *fctx, dns_rdatatype_t covers, isc_stdtime_t now) {
+ncache_message(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo,
+ dns_rdatatype_t covers, isc_stdtime_t now)
+{
isc_result_t result, eresult;
dns_name_t *name;
dns_resolver_t *res;
@@ -3792,6 +3819,7 @@ ncache_message(fetchctx_t *fctx, dns_rdatatype_t covers, isc_stdtime_t now) {
dns_name_t *aname;
dns_fetchevent_t *event;
isc_uint32_t ttl;
+ unsigned int valoptions = 0;
FCTXTRACE("ncache_message");
@@ -3818,8 +3846,10 @@ ncache_message(fetchctx_t *fctx, dns_rdatatype_t covers, isc_stdtime_t now) {
if (result != ISC_R_SUCCESS)
return (result);
- if (res->view->dlv != NULL)
+ if (!secure_domain && res->view->dlv != NULL) {
+ valoptions = DNS_VALIDATOR_DLV;
secure_domain = ISC_TRUE;
+ }
if ((fctx->options & DNS_FETCHOPT_NOVALIDATE) != 0)
need_validation = ISC_FALSE;
@@ -3856,23 +3886,15 @@ ncache_message(fetchctx_t *fctx, dns_rdatatype_t covers, isc_stdtime_t now) {
/*
* Do negative response validation.
*/
- dns_validator_t *validator = NULL;
- isc_task_t *task = res->buckets[fctx->bucketnum].task;
-
- result = dns_validator_create(res->view, name, fctx->type,
- NULL, NULL,
- fctx->rmessage, 0, task,
- validated, fctx,
- &validator);
- if (result != ISC_R_SUCCESS)
- return (result);
- ISC_LIST_APPEND(fctx->validators, validator, link);
+ result = valcreate(fctx, addrinfo, name, fctx->type,
+ NULL, NULL, valoptions,
+ res->buckets[fctx->bucketnum].task);
/*
* If validation is necessary, return now. Otherwise continue
* to process the message, letting the validation complete
* in its own good time.
*/
- return (ISC_R_SUCCESS);
+ return (result);
}
LOCK(&res->buckets[fctx->bucketnum].lock);
@@ -4990,6 +5012,43 @@ checknames(dns_message_t *message) {
}
static void
+log_packet(dns_message_t *message, int level, isc_mem_t *mctx) {
+ isc_buffer_t buffer;
+ char *buf = NULL;
+ int len = 1024;
+ isc_result_t result;
+
+ if (! isc_log_wouldlog(dns_lctx, level))
+ return;
+
+ /*
+ * Note that these are multiline debug messages. We want a newline
+ * to appear in the log after each message.
+ */
+
+ do {
+ buf = isc_mem_get(mctx, len);
+ if (buf == NULL)
+ break;
+ isc_buffer_init(&buffer, buf, len);
+ result = dns_message_totext(message, &dns_master_style_debug,
+ 0, &buffer);
+ if (result == ISC_R_NOSPACE) {
+ isc_mem_put(mctx, buf, len);
+ len += 1024;
+ } else if (result == ISC_R_SUCCESS)
+ isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER,
+ DNS_LOGMODULE_RESOLVER, level,
+ "received packet:\n%.*s",
+ (int)isc_buffer_usedlength(&buffer),
+ buf);
+ } while (result == ISC_R_NOSPACE);
+
+ if (buf != NULL)
+ isc_mem_put(mctx, buf, len);
+}
+
+static void
resquery_response(isc_task_t *task, isc_event_t *event) {
isc_result_t result = ISC_R_SUCCESS;
resquery_t *query = event->ev_arg;
@@ -5158,6 +5217,11 @@ resquery_response(isc_task_t *task, isc_event_t *event) {
}
/*
+ * Log the incoming packet.
+ */
+ log_packet(message, ISC_LOG_DEBUG(10), fctx->res->mctx);
+
+ /*
* If the message is signed, check the signature. If not, this
* returns success anyway.
*/
@@ -5425,7 +5489,7 @@ resquery_response(isc_task_t *task, isc_event_t *event) {
* work to be queued to the DNSSEC validator.
*/
if (WANTCACHE(fctx)) {
- result = cache_message(fctx, now);
+ result = cache_message(fctx, query->addrinfo, now);
if (result != ISC_R_SUCCESS)
goto done;
}
@@ -5444,7 +5508,7 @@ resquery_response(isc_task_t *task, isc_event_t *event) {
/*
* Cache any negative cache entries in the message.
*/
- result = ncache_message(fctx, covers, now);
+ result = ncache_message(fctx, query->addrinfo, covers, now);
}
done:
diff --git a/lib/dns/tkey.c b/lib/dns/tkey.c
index dc49a337..43c8db0e 100644
--- a/lib/dns/tkey.c
+++ b/lib/dns/tkey.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2001, 2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -16,7 +16,7 @@
*/
/*
- * $Id: tkey.c,v 1.71.2.1.10.5 2004/06/11 00:30:54 marka Exp $
+ * $Id: tkey.c,v 1.71.2.1.10.7 2005/06/12 00:02:26 marka Exp $
*/
#include <config.h>
@@ -356,7 +356,7 @@ process_dhtkey(dns_message_t *msg, dns_name_t *signer, dns_name_t *name,
isc_buffer_init(&secret, secretdata, sizeof(secretdata));
- randomdata = isc_mem_get(tctx->mctx, TKEY_RANDOM_AMOUNT);
+ randomdata = isc_mem_get(tkeyout->mctx, TKEY_RANDOM_AMOUNT);
if (randomdata == NULL)
goto failure;
@@ -397,8 +397,8 @@ process_dhtkey(dns_message_t *msg, dns_name_t *signer, dns_name_t *name,
isc_buffer_free(&shared);
if (pubkey != NULL)
dst_key_free(&pubkey);
- if (randomdata == NULL)
- isc_mem_put(tctx->mctx, randomdata, TKEY_RANDOM_AMOUNT);
+ if (randomdata != NULL)
+ isc_mem_put(tkeyout->mctx, randomdata, TKEY_RANDOM_AMOUNT);
return (result);
}
diff --git a/lib/dns/tsig.c b/lib/dns/tsig.c
index fb1ac823..6a8d774a 100644
--- a/lib/dns/tsig.c
+++ b/lib/dns/tsig.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2002 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -16,7 +16,7 @@
*/
/*
- * $Id: tsig.c,v 1.112.2.3.8.4 2004/03/08 09:04:32 marka Exp $
+ * $Id: tsig.c,v 1.112.2.3.8.6 2005/03/17 03:58:31 marka Exp $
*/
#include <config.h>
@@ -167,7 +167,7 @@ dns_tsigkey_createfromkey(dns_name_t *name, dns_name_t *algorithm,
goto cleanup_name;
}
} else {
- if (key != NULL) {
+ if (dstkey != NULL) {
ret = DNS_R_BADALG;
goto cleanup_name;
}
diff --git a/lib/dns/validator.c b/lib/dns/validator.c
index 069b9c22..d65d33e5 100644
--- a/lib/dns/validator.c
+++ b/lib/dns/validator.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: validator.c,v 1.91.2.5.8.15 2005/02/09 05:13:02 marka Exp $ */
+/* $Id: validator.c,v 1.91.2.5.8.19 2005/08/25 01:54:33 marka Exp $ */
#include <config.h>
@@ -51,9 +51,7 @@
#define VALATTR_TRIEDVERIFY 0x0004
#define VALATTR_NEGATIVE 0x0008
#define VALATTR_INSECURITY 0x0010
-#define VALATTR_DLV 0x0020
-#define VALATTR_DLVTRIED 0x0040
-#define VALATTR_DLVSEPTRIED 0x0080
+#define VALATTR_DLVTRIED 0x0020
#define VALATTR_NEEDNOQNAME 0x0100
#define VALATTR_NEEDNOWILDCARD 0x0200
@@ -63,13 +61,10 @@
#define VALATTR_FOUNDNOWILDCARD 0x2000
#define VALATTR_FOUNDNODATA 0x4000
-
#define NEEDNODATA(val) ((val->attributes & VALATTR_NEEDNODATA) != 0)
#define NEEDNOQNAME(val) ((val->attributes & VALATTR_NEEDNOQNAME) != 0)
#define NEEDNOWILDCARD(val) ((val->attributes & VALATTR_NEEDNOWILDCARD) != 0)
-#define DLV(val) ((val->attributes & VALATTR_DLV) != 0)
#define DLVTRIED(val) ((val->attributes & VALATTR_DLVTRIED) != 0)
-#define DLVSEPTRIED(val) ((val->attributes & VALATTR_DLVSEPTRIED) != 0)
#define SHUTDOWN(v) (((v)->attributes & VALATTR_SHUTDOWN) != 0)
@@ -110,8 +105,20 @@ static isc_result_t
dlv_validatezonekey(dns_validator_t *val);
static isc_result_t
+dlv_validator_start(dns_validator_t *val);
+
+static isc_result_t
finddlvsep(dns_validator_t *val, isc_boolean_t resume);
+static inline void
+markanswer(dns_validator_t *val) {
+ validator_log(val, ISC_LOG_DEBUG(3), "marking as answer");
+ if (val->event->rdataset)
+ val->event->rdataset->trust = dns_trust_answer;
+ if (val->event->sigrdataset)
+ val->event->sigrdataset->trust = dns_trust_answer;
+}
+
static void
validator_done(dns_validator_t *val, isc_result_t result) {
isc_task_t *task;
@@ -285,18 +292,6 @@ dsfetched(isc_task_t *task, isc_event_t *event) {
result = validatezonekey(val);
if (result != DNS_R_WAIT)
validator_done(val, result);
- } else if (val->view->dlv != NULL && !DLVTRIED(val) &&
- (eresult == DNS_R_NXRRSET ||
- eresult == DNS_R_NCACHENXRRSET) &&
- !dns_name_issubdomain(val->event->name,
- val->view->dlv))
- {
- validator_log(val, ISC_LOG_DEBUG(2),
- "no DS record: looking for DLV");
-
- result = dlv_validatezonekey(val);
- if (result != DNS_R_WAIT)
- validator_done(val, result);
} else if (eresult == DNS_R_NXRRSET ||
eresult == DNS_R_NCACHENXRRSET)
{
@@ -358,7 +353,7 @@ dsfetched2(isc_task_t *task, isc_event_t *event) {
"must be secure failure");
validator_done(val, DNS_R_MUSTBESECURE);
} else {
- val->event->rdataset->trust = dns_trust_answer;
+ markanswer(val);
validator_done(val, ISC_R_SUCCESS);
}
} else {
@@ -553,7 +548,7 @@ nsecnoexistnodata(dns_validator_t *val, dns_name_t* name, dns_name_t *nsecname,
"nsec proves name exists (owner) data=%d",
*data);
return (ISC_R_SUCCESS);
- }
+ }
if (relation == dns_namereln_subdomain &&
dns_nsec_typepresent(&rdata, dns_rdatatype_ns) &&
@@ -916,8 +911,10 @@ create_validator(dns_validator_t *val, dns_name_t *name, dns_rdatatype_t type,
rdataset, sigrdataset, NULL, 0,
val->task, action, val,
&val->subvalidator);
- if (result == ISC_R_SUCCESS)
+ if (result == ISC_R_SUCCESS) {
val->subvalidator->parent = val;
+ val->subvalidator->depth = val->depth + 1;
+ }
return (result);
}
@@ -1252,10 +1249,7 @@ validate(dns_validator_t *val, isc_boolean_t resume) {
"must be secure failure");
return (DNS_R_MUSTBESECURE);
}
- event->rdataset->trust = dns_trust_answer;
- event->sigrdataset->trust = dns_trust_answer;
- validator_log(val, ISC_LOG_DEBUG(3),
- "marking as answer");
+ markanswer(val);
return (ISC_R_SUCCESS);
}
@@ -1344,110 +1338,9 @@ validate(dns_validator_t *val, isc_boolean_t resume) {
return (DNS_R_NOVALIDSIG);
}
-
-static void
-dlv_validated(isc_task_t *task, isc_event_t *event) {
- dns_validatorevent_t *devent;
- dns_validator_t *val;
- isc_boolean_t want_destroy;
- isc_result_t result;
- isc_result_t eresult;
-
- UNUSED(task);
- INSIST(event->ev_type == DNS_EVENT_VALIDATORDONE);
-
- devent = (dns_validatorevent_t *)event;
- val = devent->ev_arg;
- eresult = devent->result;
-
- isc_event_free(&event);
- dns_validator_destroy(&val->subvalidator);
-
- INSIST(val->event != NULL);
-
- validator_log(val, ISC_LOG_DEBUG(3), "in dsvalidated");
- LOCK(&val->lock);
- if (eresult == ISC_R_SUCCESS) {
- validator_log(val, ISC_LOG_DEBUG(3),
- "dlv with trust %d", val->frdataset.trust);
- if ((val->attributes & VALATTR_INSECURITY) != 0)
- result = proveunsecure(val, ISC_TRUE);
- else
- result = validatezonekey(val);
- if (result != DNS_R_WAIT)
- validator_done(val, result);
- } else {
- validator_log(val, ISC_LOG_DEBUG(3),
- "dlv_validated: got %s",
- isc_result_totext(eresult));
- validator_done(val, eresult);
- }
- want_destroy = exit_check(val);
- UNLOCK(&val->lock);
- if (want_destroy)
- destroy(val);
-}
-
-static void
-dlv_fetched(isc_task_t *task, isc_event_t *event) {
- dns_fetchevent_t *devent;
- dns_validator_t *val;
- dns_rdataset_t *rdataset;
- isc_boolean_t want_destroy;
- isc_result_t result;
- isc_result_t eresult;
-
- UNUSED(task);
- INSIST(event->ev_type == DNS_EVENT_FETCHDONE);
- devent = (dns_fetchevent_t *)event;
- val = devent->ev_arg;
- rdataset = &val->frdataset;
- eresult = devent->result;
-
- isc_event_free(&event);
- dns_resolver_destroyfetch(&val->fetch);
-
- INSIST(val->event != NULL);
-
- validator_log(val, ISC_LOG_DEBUG(3), "in dlv_fetched");
- LOCK(&val->lock);
- if (eresult == ISC_R_SUCCESS) {
- validator_log(val, ISC_LOG_DEBUG(3),
- "dlv set with trust %d", rdataset->trust);
- val->dlv = &val->frdataset;
- result = dlv_validatezonekey(val);
- if (result != DNS_R_WAIT)
- validator_done(val, result);
- } else if (eresult == DNS_R_NXRRSET ||
- eresult == DNS_R_NCACHENXRRSET)
- {
- validator_log(val, ISC_LOG_DEBUG(3),
- "falling back to insecurity proof");
- val->attributes |= VALATTR_INSECURITY;
- result = proveunsecure(val, ISC_FALSE);
- if (result != DNS_R_WAIT)
- validator_done(val, result);
- } else {
- validator_log(val, ISC_LOG_DEBUG(3),
- "dlv_fetched: got %s",
- isc_result_totext(eresult));
- if (eresult == ISC_R_CANCELED)
- validator_done(val, eresult);
- else
- validator_done(val, DNS_R_NOVALIDDS);
- }
- want_destroy = exit_check(val);
- UNLOCK(&val->lock);
- if (want_destroy)
- destroy(val);
-}
-
static isc_result_t
dlv_validatezonekey(dns_validator_t *val) {
- dns_fixedname_t fixed;
dns_keytag_t keytag;
- dns_name_t *name;
- dns_name_t tname;
dns_rdata_dlv_t dlv;
dns_rdata_dnskey_t key;
dns_rdata_rrsig_t sig;
@@ -1460,91 +1353,8 @@ dlv_validatezonekey(dns_validator_t *val) {
isc_boolean_t supported_algorithm;
isc_result_t result;
unsigned char dsbuf[DNS_DS_BUFFERSIZE];
- unsigned int labels;
-
- val->attributes |= VALATTR_DLVTRIED;
-
- dns_name_init(&tname, NULL);
- dns_fixedname_init(&fixed);
- name = dns_fixedname_name(&fixed);
- labels = dns_name_countlabels(val->event->name);
- dns_name_getlabelsequence(val->event->name, 0, labels - 1, &tname);
- result = dns_name_concatenate(&tname, val->view->dlv, name, NULL);
- if (result != ISC_R_SUCCESS) {
- validator_log(val, ISC_LOG_DEBUG(2),
- "DLV concatenate failed");
- return (DNS_R_NOVALIDSIG);
- }
- if (val->dlv == NULL) {
- result = view_find(val, name, dns_rdatatype_dlv);
- if (result == ISC_R_SUCCESS) {
- /*
- * We have DLV records.
- */
- val->dsset = &val->frdataset;
- if (val->frdataset.trust == dns_trust_pending &&
- dns_rdataset_isassociated(&val->fsigrdataset))
- {
- result = create_validator(val,
- val->event->name,
- dns_rdatatype_ds,
- &val->frdataset,
- &val->fsigrdataset,
- dlv_validated,
- "dlv_validatezonekey");
- if (result != ISC_R_SUCCESS)
- return (result);
- return (DNS_R_WAIT);
- } else if (val->frdataset.trust == dns_trust_pending) {
- /*
- * There should never be an unsigned DLV.
- */
- dns_rdataset_disassociate(&val->frdataset);
- validator_log(val, ISC_LOG_DEBUG(2),
- "unsigned DLV record");
- return (DNS_R_NOVALIDSIG);
- } else
- result = ISC_R_SUCCESS;
- } else if (result == ISC_R_NOTFOUND) {
- result = create_fetch(val, name, dns_rdatatype_dlv,
- dlv_fetched,
- "dlv_validatezonekey");
- if (result != ISC_R_SUCCESS)
- return (result);
- return (DNS_R_WAIT);
- } else if (result == DNS_R_NCACHENXDOMAIN ||
- result == DNS_R_NCACHENXRRSET ||
- result == DNS_R_NXDOMAIN ||
- result == DNS_R_NXRRSET)
- {
- /*
- * The DS does not exist.
- */
- if (dns_rdataset_isassociated(&val->frdataset))
- dns_rdataset_disassociate(&val->frdataset);
- if (dns_rdataset_isassociated(&val->fsigrdataset))
- dns_rdataset_disassociate(&val->fsigrdataset);
- validator_log(val, ISC_LOG_DEBUG(2), "no DLV record");
- return (DNS_R_NOVALIDSIG);
- }
- }
-
- /*
- * We have a DLV set.
- */
- INSIST(val->dlv != NULL);
-
- if (val->dlv->trust < dns_trust_secure) {
- if (val->mustbesecure) {
- validator_log(val, ISC_LOG_WARNING,
- "must be secure failure");
- return (DNS_R_MUSTBESECURE);
- }
- val->event->rdataset->trust = dns_trust_answer;
- val->event->sigrdataset->trust = dns_trust_answer;
- return (ISC_R_SUCCESS);
- }
+ validator_log(val, ISC_LOG_DEBUG(3), "dlv_validatezonekey");
/*
* Look through the DLV record and find the keys that can sign the
* key set and the matching signature. For each such key, attempt
@@ -1553,15 +1363,16 @@ dlv_validatezonekey(dns_validator_t *val) {
supported_algorithm = ISC_FALSE;
- for (result = dns_rdataset_first(val->dlv);
+ for (result = dns_rdataset_first(&val->dlv);
result == ISC_R_SUCCESS;
- result = dns_rdataset_next(val->dlv))
+ result = dns_rdataset_next(&val->dlv))
{
dns_rdata_reset(&dlvrdata);
- dns_rdataset_current(val->dlv, &dlvrdata);
+ dns_rdataset_current(&val->dlv, &dlvrdata);
(void)dns_rdata_tostruct(&dlvrdata, &dlv, NULL);
- if (!dns_resolver_algorithm_supported(val->view->resolver,
+ if (dlv.digest_type != DNS_DSDIGEST_SHA1 ||
+ !dns_resolver_algorithm_supported(val->view->resolver,
val->event->name,
dlv.algorithm))
continue;
@@ -1586,8 +1397,12 @@ dlv_validatezonekey(dns_validator_t *val) {
result = dns_ds_buildrdata(val->event->name,
&keyrdata, dlv.digest_type,
dsbuf, &newdsrdata);
- if (result != ISC_R_SUCCESS)
+ if (result != ISC_R_SUCCESS) {
+ validator_log(val, ISC_LOG_DEBUG(3),
+ "dns_ds_buildrdata() -> %s",
+ dns_result_totext(result));
continue;
+ }
/* Covert to DLV */
newdsrdata.type = dns_rdatatype_dlv;
if (dns_rdata_compare(&dlvrdata, &newdsrdata) == 0)
@@ -1598,7 +1413,9 @@ dlv_validatezonekey(dns_validator_t *val) {
"no DNSKEY matching DLV");
continue;
}
-
+ validator_log(val, ISC_LOG_DEBUG(3),
+ "Found matching DLV record: checking for signature");
+
for (result = dns_rdataset_first(val->event->sigrdataset);
result == ISC_R_SUCCESS;
result = dns_rdataset_next(val->event->sigrdataset))
@@ -1610,7 +1427,6 @@ dlv_validatezonekey(dns_validator_t *val) {
if (dlv.key_tag != sig.keyid &&
dlv.algorithm != sig.algorithm)
continue;
-
dstkey = NULL;
result = dns_dnssec_keyfromrdata(val->event->name,
&keyrdata,
@@ -1644,10 +1460,9 @@ dlv_validatezonekey(dns_validator_t *val) {
"must be secure failure");
return (DNS_R_MUSTBESECURE);
}
- val->event->rdataset->trust = dns_trust_answer;
- val->event->sigrdataset->trust = dns_trust_answer;
validator_log(val, ISC_LOG_DEBUG(3),
- "no supported algorithm (dlv)");
+ "no supported algorithm/digest (dlv)");
+ markanswer(val);
return (ISC_R_SUCCESS);
} else
return (DNS_R_NOVALIDSIG);
@@ -1685,6 +1500,10 @@ validatezonekey(dns_validator_t *val) {
event = val->event;
+ if (val->havedlvsep && val->dlv.trust >= dns_trust_secure &&
+ dns_name_equal(event->name, dns_fixedname_name(&val->dlvsep)))
+ return (dlv_validatezonekey(val));
+
if (val->dsset == NULL) {
/*
* First, see if this key was signed by a trusted key.
@@ -1783,22 +1602,6 @@ validatezonekey(dns_validator_t *val) {
if (result != ISC_R_SUCCESS)
return (result);
return (DNS_R_WAIT);
- } else if (val->view->dlv != NULL && !DLVTRIED(val) &&
- (result == DNS_R_NCACHENXRRSET ||
- result == DNS_R_NXRRSET) &&
- !dns_name_issubdomain(val->event->name,
- val->view->dlv))
- {
-
- if (dns_rdataset_isassociated(&val->frdataset))
- dns_rdataset_disassociate(&val->frdataset);
- if (dns_rdataset_isassociated(&val->fsigrdataset))
- dns_rdataset_disassociate(&val->fsigrdataset);
-
- validator_log(val, ISC_LOG_DEBUG(2),
- "no DS record: looking for DLV");
-
- return (dlv_validatezonekey(val));
} else if (result == DNS_R_NCACHENXDOMAIN ||
result == DNS_R_NCACHENXRRSET ||
result == DNS_R_NXDOMAIN ||
@@ -1827,8 +1630,7 @@ validatezonekey(dns_validator_t *val) {
"must be secure failure");
return (DNS_R_MUSTBESECURE);
}
- val->event->rdataset->trust = dns_trust_answer;
- val->event->sigrdataset->trust = dns_trust_answer;
+ markanswer(val);
return (ISC_R_SUCCESS);
}
@@ -1848,6 +1650,8 @@ validatezonekey(dns_validator_t *val) {
dns_rdataset_current(val->dsset, &dsrdata);
(void)dns_rdata_tostruct(&dsrdata, &ds, NULL);
+ if (ds.digest_type != DNS_DSDIGEST_SHA1)
+ continue;
if (!dns_resolver_algorithm_supported(val->view->resolver,
val->event->name,
ds.algorithm))
@@ -1923,24 +1727,15 @@ validatezonekey(dns_validator_t *val) {
event->sigrdataset->trust = dns_trust_secure;
validator_log(val, ISC_LOG_DEBUG(3), "marking as secure");
return (result);
- } else if (result == ISC_R_NOMORE && val->view->dlv != NULL &&
- !DLVTRIED(val) && !dns_name_issubdomain(val->event->name,
- val->view->dlv))
- {
- validator_log(val, ISC_LOG_DEBUG(2),
- "no DS/DNSKEY pair: looking for DLV");
-
- return (dlv_validatezonekey(val));
} else if (result == ISC_R_NOMORE && !supported_algorithm) {
if (val->mustbesecure) {
validator_log(val, ISC_LOG_WARNING,
"must be secure failure");
return (DNS_R_MUSTBESECURE);
}
- val->event->rdataset->trust = dns_trust_answer;
- val->event->sigrdataset->trust = dns_trust_answer;
validator_log(val, ISC_LOG_DEBUG(3),
- "no supported algorithm (ds)");
+ "no supported algorithm/digest (DS)");
+ markanswer(val);
return (ISC_R_SUCCESS);
} else
return (DNS_R_NOVALIDSIG);
@@ -2174,7 +1969,8 @@ nsecvalidate(dns_validator_t *val, isc_boolean_t resume) {
if ((val->attributes & VALATTR_FOUNDNONEXISTENCE) == 0) {
if (!val->seensig && val->soaset != NULL) {
- result = create_validator(val, name, dns_rdatatype_soa,
+ result = create_validator(val, val->soaname,
+ dns_rdatatype_soa,
val->soaset, NULL,
negauthvalidated,
"nsecvalidate");
@@ -2193,8 +1989,7 @@ nsecvalidate(dns_validator_t *val, isc_boolean_t resume) {
}
static isc_boolean_t
-check_ds_algorithm(dns_validator_t *val, dns_name_t *name,
- dns_rdataset_t *rdataset) {
+check_ds(dns_validator_t *val, dns_name_t *name, dns_rdataset_t *rdataset) {
dns_rdata_t dsrdata = DNS_RDATA_INIT;
dns_rdata_ds_t ds;
isc_result_t result;
@@ -2205,16 +2000,20 @@ check_ds_algorithm(dns_validator_t *val, dns_name_t *name,
dns_rdataset_current(rdataset, &dsrdata);
(void)dns_rdata_tostruct(&dsrdata, &ds, NULL);
- if (dns_resolver_algorithm_supported(val->view->resolver,
- name, ds.algorithm))
+ if (ds.digest_type == DNS_DSDIGEST_SHA1 &&
+ dns_resolver_algorithm_supported(val->view->resolver,
+ name, ds.algorithm)) {
+ dns_rdata_reset(&dsrdata);
return (ISC_TRUE);
+ }
dns_rdata_reset(&dsrdata);
}
return (ISC_FALSE);
}
static void
-dlv_fetched2(isc_task_t *task, isc_event_t *event) {
+dlvfetched(isc_task_t *task, isc_event_t *event) {
+ char namebuf[DNS_NAME_FORMATSIZE];
dns_fetchevent_t *devent;
dns_validator_t *val;
isc_boolean_t want_destroy;
@@ -2226,18 +2025,22 @@ dlv_fetched2(isc_task_t *task, isc_event_t *event) {
devent = (dns_fetchevent_t *)event;
val = devent->ev_arg;
eresult = devent->result;
-
+
isc_event_free(&event);
dns_resolver_destroyfetch(&val->fetch);
-
+
INSIST(val->event != NULL);
- validator_log(val, ISC_LOG_DEBUG(3), "in dlv_fetched2: %s",
+ validator_log(val, ISC_LOG_DEBUG(3), "in dlvfetched: %s",
dns_result_totext(eresult));
LOCK(&val->lock);
if (eresult == ISC_R_SUCCESS) {
+ dns_name_format(dns_fixedname_name(&val->dlvsep), namebuf,
+ sizeof(namebuf));
+ dns_rdataset_clone(&val->frdataset, &val->dlv);
val->havedlvsep = ISC_TRUE;
- result = proveunsecure(val, ISC_FALSE);
+ validator_log(val, ISC_LOG_DEBUG(3), "DLV %s found", namebuf);
+ result = dlv_validator_start(val);
if (result != DNS_R_WAIT)
validator_done(val, result);
} else if (eresult == DNS_R_NXRRSET ||
@@ -2246,13 +2049,26 @@ dlv_fetched2(isc_task_t *task, isc_event_t *event) {
eresult == DNS_R_NCACHENXDOMAIN) {
result = finddlvsep(val, ISC_TRUE);
if (result == ISC_R_SUCCESS) {
- result = proveunsecure(val, ISC_FALSE);
+ dns_name_format(dns_fixedname_name(&val->dlvsep),
+ namebuf, sizeof(namebuf));
+ validator_log(val, ISC_LOG_DEBUG(3), "DLV %s found",
+ namebuf);
+ result = dlv_validator_start(val);
if (result != DNS_R_WAIT)
validator_done(val, result);
} else if (result == ISC_R_NOTFOUND) {
+ validator_log(val, ISC_LOG_DEBUG(3), "DLV not found");
+ markanswer(val);
validator_done(val, ISC_R_SUCCESS);
- } else if (result != DNS_R_WAIT)
- validator_done(val, result);
+ } else {
+ validator_log(val, ISC_LOG_DEBUG(3), "DLV lookup: %s",
+ dns_result_totext(result));
+ if (result != DNS_R_WAIT)
+ validator_done(val, result);
+ }
+ } else {
+ validator_log(val, ISC_LOG_DEBUG(3), "DLV lookup: %s",
+ dns_result_totext(eresult));
}
want_destroy = exit_check(val);
UNLOCK(&val->lock);
@@ -2261,19 +2077,72 @@ dlv_fetched2(isc_task_t *task, isc_event_t *event) {
}
static isc_result_t
+startfinddlvsep(dns_validator_t *val, dns_name_t *unsecure) {
+ char namebuf[DNS_NAME_FORMATSIZE];
+ isc_result_t result;
+
+ INSIST(!DLVTRIED(val));
+
+ val->attributes |= VALATTR_DLVTRIED;
+
+ dns_name_format(unsecure, namebuf, sizeof(namebuf));
+ validator_log(val, ISC_LOG_DEBUG(3),
+ "plain DNSSEC returns unsecure (%s): looking for DLV",
+ namebuf);
+
+ if (dns_name_issubdomain(val->event->name, val->view->dlv)) {
+ validator_log(val, ISC_LOG_WARNING, "must be secure failure");
+ return (DNS_R_MUSTBESECURE);
+ }
+
+ val->dlvlabels = dns_name_countlabels(unsecure) - 1;
+ result = finddlvsep(val, ISC_FALSE);
+ if (result == ISC_R_NOTFOUND) {
+ validator_log(val, ISC_LOG_DEBUG(3), "DLV not found");
+ markanswer(val);
+ return (ISC_R_SUCCESS);
+ }
+ if (result != ISC_R_SUCCESS) {
+ validator_log(val, ISC_LOG_DEBUG(3), "DLV lookup: %s",
+ dns_result_totext(result));
+ return (result);
+ }
+ dns_name_format(dns_fixedname_name(&val->dlvsep), namebuf,
+ sizeof(namebuf));
+ validator_log(val, ISC_LOG_DEBUG(3), "DLV %s found", namebuf);
+ return (dlv_validator_start(val));
+}
+
+static isc_result_t
finddlvsep(dns_validator_t *val, isc_boolean_t resume) {
+ char namebuf[DNS_NAME_FORMATSIZE];
dns_fixedname_t dlvfixed;
dns_name_t *dlvname;
dns_name_t *dlvsep;
dns_name_t noroot;
isc_result_t result;
unsigned int labels;
+
+ INSIST(val->view->dlv != NULL);
if (!resume) {
+
+ if (dns_name_issubdomain(val->event->name, val->view->dlv)) {
+ validator_log(val, ISC_LOG_WARNING,
+ "must be secure failure");
+ return (DNS_R_MUSTBESECURE);
+ }
+
dns_fixedname_init(&val->dlvsep);
dlvsep = dns_fixedname_name(&val->dlvsep);
dns_name_copy(val->event->name, dlvsep, NULL);
- val->attributes |= VALATTR_DLVSEPTRIED;
+ if (val->event->type == dns_rdatatype_ds) {
+ labels = dns_name_countlabels(dlvsep);
+ if (labels == 0)
+ return (ISC_R_NOTFOUND);
+ dns_name_getlabelsequence(dlvsep, 1, labels - 1,
+ dlvsep);
+ }
} else {
dlvsep = dns_fixedname_name(&val->dlvsep);
labels = dns_name_countlabels(dlvsep);
@@ -2283,6 +2152,8 @@ finddlvsep(dns_validator_t *val, isc_boolean_t resume) {
dns_fixedname_init(&dlvfixed);
dlvname = dns_fixedname_name(&dlvfixed);
labels = dns_name_countlabels(dlvsep);
+ if (labels == 0)
+ return (ISC_R_NOTFOUND);
dns_name_getlabelsequence(dlvsep, 0, labels - 1, &noroot);
result = dns_name_concatenate(&noroot, val->view->dlv, dlvname, NULL);
while (result == ISC_R_NOSPACE) {
@@ -2297,32 +2168,37 @@ finddlvsep(dns_validator_t *val, isc_boolean_t resume) {
return (DNS_R_NOVALIDSIG);
}
- while (dns_name_countlabels(dlvname) >
- dns_name_countlabels(val->view->dlv))
- {
+ while (dns_name_countlabels(dlvname) >=
+ dns_name_countlabels(val->view->dlv) + val->dlvlabels) {
+ dns_name_format(dlvname, namebuf, sizeof(namebuf));
+ validator_log(val, ISC_LOG_DEBUG(3), "looking for DLV %s",
+ namebuf);
result = view_find(val, dlvname, dns_rdatatype_dlv);
if (result == ISC_R_SUCCESS) {
if (val->frdataset.trust < dns_trust_secure)
return (DNS_R_NOVALIDSIG);
val->havedlvsep = ISC_TRUE;
+ dns_rdataset_clone(&val->frdataset, &val->dlv);
return (ISC_R_SUCCESS);
}
if (result == ISC_R_NOTFOUND) {
- result = create_fetch(val, dlvname, dns_rdatatype_dlv,
- dlv_fetched2, "finddlvsep");
- if (result != ISC_R_SUCCESS)
- return (result);
- return (DNS_R_WAIT);
+ result = create_fetch(val, dlvname, dns_rdatatype_dlv,
+ dlvfetched, "finddlvsep");
+ if (result != ISC_R_SUCCESS)
+ return (result);
+ return (DNS_R_WAIT);
}
if (result != DNS_R_NXRRSET &&
result != DNS_R_NXDOMAIN &&
result != DNS_R_NCACHENXRRSET &&
- result != DNS_R_NCACHENXDOMAIN)
+ result != DNS_R_NCACHENXDOMAIN)
return (result);
/*
* Strip first labels from both dlvsep and dlvname.
*/
labels = dns_name_countlabels(dlvsep);
+ if (labels == 0)
+ break;
dns_name_getlabelsequence(dlvsep, 1, labels - 1, dlvsep);
labels = dns_name_countlabels(dlvname);
dns_name_getlabelsequence(dlvname, 1, labels - 1, dlvname);
@@ -2330,73 +2206,76 @@ finddlvsep(dns_validator_t *val, isc_boolean_t resume) {
return (ISC_R_NOTFOUND);
}
+/*
+ * proveunsecure walks down from the SEP looking for a break in the
+ * chain of trust. That occurs when we can prove the DS record does
+ * not exist at a delegation point or the DS exists at a delegation
+ * but we don't support the algorithm/digest.
+ */
static isc_result_t
proveunsecure(dns_validator_t *val, isc_boolean_t resume) {
isc_result_t result;
- isc_result_t tresult;
- dns_fixedname_t secroot;
+ dns_fixedname_t fixedsecroot;
+ dns_name_t *secroot;
dns_name_t *tname;
+ char namebuf[DNS_NAME_FORMATSIZE];
- dns_fixedname_init(&secroot);
- result = dns_keytable_finddeepestmatch(val->keytable,
- val->event->name,
- dns_fixedname_name(&secroot));
- /*
- * If the name is not under a security root, it must be insecure.
- */
- if (val->view->dlv != NULL && !DLVSEPTRIED(val) &&
- !dns_name_issubdomain(val->event->name, val->view->dlv)) {
- tresult = finddlvsep(val, ISC_FALSE);
- if (tresult != ISC_R_NOTFOUND && tresult != ISC_R_SUCCESS) {
- validator_log(val, ISC_LOG_DEBUG(3),
- "finddlvsep returned: %s",
- dns_result_totext(tresult));
- return (tresult);
- }
- }
+ dns_fixedname_init(&fixedsecroot);
+ secroot = dns_fixedname_name(&fixedsecroot);
+ if (val->havedlvsep)
+ dns_name_copy(dns_fixedname_name(&val->dlvsep), secroot, NULL);
+ else {
+ result = dns_keytable_finddeepestmatch(val->keytable,
+ val->event->name,
+ secroot);
- if (result == ISC_R_NOTFOUND) {
- if (!val->havedlvsep) {
+ if (result == ISC_R_NOTFOUND) {
validator_log(val, ISC_LOG_DEBUG(3),
- "not beneath secure root / DLV");
+ "not beneath secure root");
if (val->mustbesecure) {
validator_log(val, ISC_LOG_WARNING,
"must be secure failure");
result = DNS_R_MUSTBESECURE;
goto out;
}
- val->event->rdataset->trust = dns_trust_answer;
- return (ISC_R_SUCCESS);
- }
- dns_name_copy(dns_fixedname_name(&val->dlvsep),
- dns_fixedname_name(&secroot), NULL);
- } else if (result != ISC_R_SUCCESS)
- return (result);
- else if (val->havedlvsep &&
- dns_name_issubdomain(dns_fixedname_name(&val->dlvsep),
- dns_fixedname_name(&secroot))) {
- dns_name_copy(dns_fixedname_name(&val->dlvsep),
- dns_fixedname_name(&secroot), NULL);
+ if (val->view->dlv == NULL || DLVTRIED(val)) {
+ markanswer(val);
+ return (ISC_R_SUCCESS);
+ }
+ return (startfinddlvsep(val, dns_rootname));
+ } else if (result != ISC_R_SUCCESS)
+ return (result);
}
if (!resume) {
- val->labels =
- dns_name_countlabels(dns_fixedname_name(&secroot)) + 1;
+ /*
+ * We are looking for breaks below the SEP so add a label.
+ */
+ val->labels = dns_name_countlabels(secroot) + 1;
} else {
validator_log(val, ISC_LOG_DEBUG(3), "resuming proveunsecure");
if (val->frdataset.trust >= dns_trust_secure &&
- !check_ds_algorithm(val, dns_fixedname_name(&val->fname),
- &val->frdataset)) {
+ !check_ds(val, dns_fixedname_name(&val->fname),
+ &val->frdataset)) {
+ dns_name_format(dns_fixedname_name(&val->fname),
+ namebuf, sizeof(namebuf));
if (val->mustbesecure) {
validator_log(val, ISC_LOG_WARNING,
- "must be secure failure");
+ "must be secure failure at '%s'",
+ namebuf);
result = DNS_R_MUSTBESECURE;
goto out;
}
validator_log(val, ISC_LOG_DEBUG(3),
- "no supported algorithm (ds)");
- val->event->rdataset->trust = dns_trust_answer;
- result = ISC_R_SUCCESS;
+ "no supported algorithm/digest (%s/DS)",
+ namebuf);
+ if (val->view->dlv == NULL || DLVTRIED(val)) {
+ markanswer(val);
+ result = ISC_R_SUCCESS;
+ goto out;
+ }
+ result = startfinddlvsep(val,
+ dns_fixedname_name(&val->fname));
goto out;
}
val->labels++;
@@ -2406,7 +2285,6 @@ proveunsecure(dns_validator_t *val, isc_boolean_t resume) {
val->labels <= dns_name_countlabels(val->event->name);
val->labels++)
{
- char namebuf[DNS_NAME_FORMATSIZE];
dns_fixedname_init(&val->fname);
tname = dns_fixedname_name(&val->fname);
@@ -2425,7 +2303,7 @@ proveunsecure(dns_validator_t *val, isc_boolean_t resume) {
if (result == DNS_R_NXRRSET || result == DNS_R_NCACHENXRRSET) {
/*
* There is no DS. If this is a delegation,
- * we're done.
+ * we maybe done.
*/
if (val->frdataset.trust < dns_trust_secure) {
/*
@@ -2443,8 +2321,11 @@ proveunsecure(dns_validator_t *val, isc_boolean_t resume) {
"must be secure failure");
return (DNS_R_MUSTBESECURE);
}
- val->event->rdataset->trust = dns_trust_answer;
- return (ISC_R_SUCCESS);
+ if (val->view->dlv == NULL || DLVTRIED(val)) {
+ markanswer(val);
+ return (ISC_R_SUCCESS);
+ }
+ return (startfinddlvsep(val, tname));
}
continue;
} else if (result == ISC_R_SUCCESS) {
@@ -2453,10 +2334,10 @@ proveunsecure(dns_validator_t *val, isc_boolean_t resume) {
* continue.
*/
if (val->frdataset.trust >= dns_trust_secure) {
- if (!check_ds_algorithm(val, tname,
- &val->frdataset)) {
+ if (!check_ds(val, tname, &val->frdataset)) {
validator_log(val, ISC_LOG_DEBUG(3),
- "no supported algorithm (ds)");
+ "no supported algorithm/"
+ "digest (%s/DS)", namebuf);
if (val->mustbesecure) {
validator_log(val,
ISC_LOG_WARNING,
@@ -2464,9 +2345,13 @@ proveunsecure(dns_validator_t *val, isc_boolean_t resume) {
result = DNS_R_MUSTBESECURE;
goto out;
}
- val->event->rdataset->trust =
- dns_trust_answer;
- result = ISC_R_SUCCESS;
+ if (val->view->dlv == NULL ||
+ DLVTRIED(val)) {
+ markanswer(val);
+ result = ISC_R_SUCCESS;
+ goto out;
+ }
+ result = startfinddlvsep(val, tname);
goto out;
}
continue;
@@ -2531,6 +2416,23 @@ proveunsecure(dns_validator_t *val, isc_boolean_t resume) {
return (result);
}
+static isc_result_t
+dlv_validator_start(dns_validator_t *val) {
+ isc_event_t *event;
+
+ validator_log(val, ISC_LOG_DEBUG(3), "dlv_validator_start");
+
+ /*
+ * Reset state and try again.
+ */
+ val->attributes &= VALATTR_DLVTRIED;
+ val->options &= ~DNS_VALIDATOR_DLV;
+
+ event = (isc_event_t *)val->event;
+ isc_task_send(val->task, &event);
+ return (DNS_R_WAIT);
+}
+
static void
validator_start(isc_task_t *task, isc_event_t *event) {
dns_validator_t *val;
@@ -2547,11 +2449,18 @@ validator_start(isc_task_t *task, isc_event_t *event) {
if (val->event == NULL)
return;
- validator_log(val, ISC_LOG_DEBUG(3), "starting");
+ if (DLVTRIED(val))
+ validator_log(val, ISC_LOG_DEBUG(3), "restarting using DLV");
+ else
+ validator_log(val, ISC_LOG_DEBUG(3), "starting");
LOCK(&val->lock);
- if (val->event->rdataset != NULL && val->event->sigrdataset != NULL) {
+ if ((val->options & DNS_VALIDATOR_DLV) != 0) {
+ validator_log(val, ISC_LOG_DEBUG(3), "looking for DLV");
+ result = startfinddlvsep(val, dns_rootname);
+ } else if (val->event->rdataset != NULL &&
+ val->event->sigrdataset != NULL) {
isc_result_t saved_result;
/*
@@ -2635,7 +2544,6 @@ dns_validator_create(dns_view_t *view, dns_name_t *name, dns_rdatatype_t type,
REQUIRE(type != 0);
REQUIRE(rdataset != NULL ||
(rdataset == NULL && sigrdataset == NULL && message != NULL));
- REQUIRE(options == 0);
REQUIRE(validatorp != NULL && *validatorp == NULL);
tclone = NULL;
@@ -2685,12 +2593,13 @@ dns_validator_create(dns_view_t *view, dns_name_t *name, dns_rdatatype_t type,
val->currentset = NULL;
val->keyset = NULL;
val->dsset = NULL;
- val->dlv = NULL;
+ dns_rdataset_init(&val->dlv);
val->soaset = NULL;
val->nsecset = NULL;
val->soaname = NULL;
val->seensig = ISC_FALSE;
val->havedlvsep = ISC_FALSE;
+ val->depth = 0;
val->mustbesecure = dns_resolver_getmustbesecure(view->resolver, name);
dns_rdataset_init(&val->frdataset);
dns_rdataset_init(&val->fsigrdataset);
@@ -2749,6 +2658,8 @@ destroy(dns_validator_t *val) {
dns_keytable_detach(&val->keytable);
if (val->subvalidator != NULL)
dns_validator_destroy(&val->subvalidator);
+ if (val->havedlvsep)
+ dns_rdataset_disassociate(&val->dlv);
mctx = val->view->mctx;
if (val->siginfo != NULL)
isc_mem_put(mctx, val->siginfo, sizeof(*val->siginfo));
@@ -2787,9 +2698,14 @@ validator_logv(dns_validator_t *val, isc_logcategory_t *category,
isc_logmodule_t *module, int level, const char *fmt, va_list ap)
{
char msgbuf[2048];
+ static const char spaces[] = " *";
+ int depth = val->depth * 2;
vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap);
+ if ((unsigned int) depth >= sizeof spaces)
+ depth = sizeof spaces - 1;
+
if (val->event != NULL && val->event->name != NULL) {
char namebuf[DNS_NAME_FORMATSIZE];
char typebuf[DNS_RDATATYPE_FORMATSIZE];
@@ -2798,11 +2714,12 @@ validator_logv(dns_validator_t *val, isc_logcategory_t *category,
dns_rdatatype_format(val->event->type, typebuf,
sizeof(typebuf));
isc_log_write(dns_lctx, category, module, level,
- "validating %s %s: %s", namebuf, typebuf,
- msgbuf);
+ "%.*svalidating @%p: %s %s: %s", depth, spaces,
+ val, namebuf, typebuf, msgbuf);
} else {
isc_log_write(dns_lctx, category, module, level,
- "validator @%p: %s", val, msgbuf);
+ "%.*svalidator @%p: %s", depth, spaces,
+ val, msgbuf);
}
}
diff --git a/lib/dns/zone.c b/lib/dns/zone.c
index 29f99cb1..a993877e 100644
--- a/lib/dns/zone.c
+++ b/lib/dns/zone.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: zone.c,v 1.333.2.23.2.55 2005/02/03 23:50:45 marka Exp $ */
+/* $Id: zone.c,v 1.333.2.23.2.59 2005/07/29 00:38:33 marka Exp $ */
#include <config.h>
@@ -167,6 +167,7 @@ struct dns_zone {
isc_sockaddr_t *masters;
dns_name_t **masterkeynames;
+ isc_boolean_t *mastersok;
unsigned int masterscnt;
unsigned int curmaster;
isc_sockaddr_t masteraddr;
@@ -536,6 +537,7 @@ dns_zone_create(dns_zone_t **zonep, isc_mem_t *mctx) {
zone->minretry = DNS_ZONE_MINRETRY;
zone->masters = NULL;
zone->masterkeynames = NULL;
+ zone->mastersok = NULL;
zone->masterscnt = 0;
zone->curmaster = 0;
zone->notify = NULL;
@@ -590,7 +592,8 @@ dns_zone_create(dns_zone_t **zonep, isc_mem_t *mctx) {
free_mutex:
DESTROYLOCK(&zone->lock);
- return (ISC_R_NOMEMORY);
+ isc_mem_putanddetach(&zone->mctx, zone, sizeof(*zone));
+ return (result);
}
/*
@@ -1250,6 +1253,7 @@ zone_postload(dns_zone_t *zone, dns_db_t *db, isc_time_t loadtime,
isc_uint32_t serial, refresh, retry, expire, minimum;
isc_time_t now;
isc_boolean_t needdump = ISC_FALSE;
+ isc_boolean_t hasinclude = DNS_ZONE_FLAG(zone, DNS_ZONEFLG_HASINCLUDE);
TIME_NOW(&now);
@@ -1355,10 +1359,32 @@ zone_postload(dns_zone_t *zone, dns_db_t *db, isc_time_t loadtime,
if (result != ISC_R_SUCCESS)
goto cleanup;
if (zone->db != NULL) {
- if (!isc_serial_ge(serial, zone->serial)) {
+ /*
+ * This is checked in zone_replacedb() for slave zones
+ * as they don't reload from disk.
+ */
+ if (DNS_ZONE_OPTION(zone, DNS_ZONEOPT_IXFRFROMDIFFS) &&
+ !isc_serial_gt(serial, zone->serial)) {
+ isc_uint32_t serialmin, serialmax;
+
+ INSIST(zone->type == dns_zone_master);
+
+ serialmin = (zone->serial + 1) & 0xffffffffU;
+ serialmax = (zone->serial + 0x7fffffffU) &
+ 0xffffffffU;
+ dns_zone_log(zone, ISC_LOG_ERROR,
+ "ixfr-from-differences: "
+ "new serial (%u) out of range "
+ "[%u - %u]", serial, serialmin,
+ serialmax);
+ result = DNS_R_BADZONE;
+ goto cleanup;
+ } else if (!isc_serial_ge(serial, zone->serial))
dns_zone_log(zone, ISC_LOG_ERROR,
"zone serial has gone backwards");
- }
+ else if (serial == zone->serial && !hasinclude)
+ dns_zone_log(zone, ISC_LOG_ERROR,
+ "zone serial unchanged");
}
zone->serial = serial;
zone->refresh = RANGE(refresh,
@@ -1943,6 +1969,7 @@ dns_zone_setmasterswithkeys(dns_zone_t *zone, isc_sockaddr_t *masters,
isc_sockaddr_t *new;
isc_result_t result = ISC_R_SUCCESS;
dns_name_t **newname;
+ isc_boolean_t *newok;
unsigned int i;
REQUIRE(DNS_ZONE_VALID(zone));
@@ -1972,10 +1999,15 @@ dns_zone_setmasterswithkeys(dns_zone_t *zone, isc_sockaddr_t *masters,
zone->masterscnt * sizeof(dns_name_t *));
zone->masterkeynames = NULL;
}
+ if (zone->mastersok != NULL) {
+ isc_mem_put(zone->mctx, zone->mastersok,
+ zone->masterscnt * sizeof(isc_boolean_t));
+ zone->mastersok = NULL;
+ }
zone->masterscnt = 0;
/*
- * If count == 0, don't allocate any space for masters or keynames
- * so internally, those pointers are NULL if count == 0
+ * If count == 0, don't allocate any space for masters, mastersok or
+ * keynames so internally, those pointers are NULL if count == 0
*/
if (count == 0)
goto unlock;
@@ -1983,27 +2015,35 @@ dns_zone_setmasterswithkeys(dns_zone_t *zone, isc_sockaddr_t *masters,
/*
* masters must countain count elements!
*/
- new = isc_mem_get(zone->mctx,
- count * sizeof(isc_sockaddr_t));
+ new = isc_mem_get(zone->mctx, count * sizeof(*new));
if (new == NULL) {
result = ISC_R_NOMEMORY;
goto unlock;
}
memcpy(new, masters, count * sizeof(*new));
- zone->masters = new;
- zone->masterscnt = count;
- DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_NOMASTERS);
+
+ /*
+ * Similarly for mastersok.
+ */
+ newok = isc_mem_get(zone->mctx, count * sizeof(*newok));
+ if (newok == NULL) {
+ result = ISC_R_NOMEMORY;
+ isc_mem_put(zone->mctx, new, count * sizeof(*new));
+ goto unlock;
+ };
+ for (i = 0; i < count; i++)
+ newok[i] = ISC_FALSE;
/*
* if keynames is non-NULL, it must contain count elements!
*/
+ newname = NULL;
if (keynames != NULL) {
- newname = isc_mem_get(zone->mctx,
- count * sizeof(dns_name_t *));
+ newname = isc_mem_get(zone->mctx, count * sizeof(*newname));
if (newname == NULL) {
result = ISC_R_NOMEMORY;
- isc_mem_put(zone->mctx, zone->masters,
- count * sizeof(*new));
+ isc_mem_put(zone->mctx, new, count * sizeof(*new));
+ isc_mem_put(zone->mctx, newok, count * sizeof(*newok));
goto unlock;
}
for (i = 0; i < count; i++)
@@ -2024,16 +2064,27 @@ dns_zone_setmasterswithkeys(dns_zone_t *zone, isc_sockaddr_t *masters,
dns_name_free(
newname[i],
zone->mctx);
- isc_mem_put(zone->mctx, zone->masters,
+ isc_mem_put(zone->mctx, new,
count * sizeof(*new));
+ isc_mem_put(zone->mctx, newok,
+ count * sizeof(*newok));
isc_mem_put(zone->mctx, newname,
count * sizeof(*newname));
goto unlock;
}
}
}
- zone->masterkeynames = newname;
}
+
+ /*
+ * Everything is ok so attach to the zone.
+ */
+ zone->masters = new;
+ zone->mastersok = newok;
+ zone->masterkeynames = newname;
+ zone->masterscnt = count;
+ DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_NOMASTERS);
+
unlock:
UNLOCK_ZONE(zone);
return (result);
@@ -2222,6 +2273,7 @@ void
dns_zone_refresh(dns_zone_t *zone) {
isc_interval_t i;
isc_uint32_t oldflags;
+ unsigned int j;
REQUIRE(DNS_ZONE_VALID(zone));
@@ -2266,6 +2318,8 @@ dns_zone_refresh(dns_zone_t *zone) {
zone->retry = ISC_MIN(zone->retry * 2, 6 * 3600);
zone->curmaster = 0;
+ for (j = 0; j < zone->masterscnt; j++)
+ zone->mastersok[j] = ISC_FALSE;
/* initiate soa query */
queue_soa_query(zone);
unlock:
@@ -3186,6 +3240,7 @@ stub_callback(isc_task_t *task, isc_event_t *event) {
isc_time_t now;
isc_boolean_t exiting = ISC_FALSE;
isc_interval_t i;
+ unsigned int j;
stub = revent->ev_arg;
INSIST(DNS_STUB_VALID(stub));
@@ -3360,13 +3415,37 @@ stub_callback(isc_task_t *task, isc_event_t *event) {
isc_event_free(&event);
LOCK_ZONE(zone);
dns_request_destroy(&zone->request);
- zone->curmaster++;
+ /*
+ * Skip to next failed / untried master.
+ */
+ do {
+ zone->curmaster++;
+ } while (zone->curmaster < zone->masterscnt &&
+ zone->mastersok[zone->curmaster]);
DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_NOEDNS);
if (exiting || zone->curmaster >= zone->masterscnt) {
+ isc_boolean_t done = ISC_TRUE;
if (!exiting &&
DNS_ZONE_OPTION(zone, DNS_ZONEOPT_USEALTXFRSRC) &&
!DNS_ZONE_FLAG(zone, DNS_ZONEFLG_USEALTXFRSRC)) {
+ /*
+ * Did we get a good answer from all the masters?
+ */
+ for (j = 0; j < zone->masterscnt; j++)
+ if (zone->mastersok[j] == ISC_FALSE) {
+ done = ISC_FALSE;
+ break;
+ }
+ } else
+ done = ISC_TRUE;
+ if (!done) {
zone->curmaster = 0;
+ /*
+ * Find the next failed master.
+ */
+ while (zone->curmaster < zone->masterscnt &&
+ zone->mastersok[zone->curmaster])
+ zone->curmaster++;
DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_USEALTXFRSRC);
} else {
DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_REFRESH);
@@ -3420,6 +3499,7 @@ refresh_callback(isc_task_t *task, isc_event_t *event) {
dns_rdata_soa_t soa;
isc_result_t result;
isc_uint32_t serial;
+ unsigned int j;
zone = revent->ev_arg;
INSIST(DNS_ZONE_VALID(zone));
@@ -3668,6 +3748,7 @@ refresh_callback(isc_task_t *task, isc_event_t *event) {
}
DNS_ZONE_JITTER_ADD(&now, zone->refresh, &zone->refreshtime);
DNS_ZONE_TIME_ADD(&now, zone->expire, &zone->expiretime);
+ zone->mastersok[zone->curmaster] = ISC_TRUE;
goto next_master;
} else {
if (!DNS_ZONE_OPTION(zone, DNS_ZONEOPT_MULTIMASTER))
@@ -3676,6 +3757,7 @@ refresh_callback(isc_task_t *task, isc_event_t *event) {
soa.serial, master, zone->serial);
else
zone_debuglog(zone, me, 1, "ahead");
+ zone->mastersok[zone->curmaster] = ISC_TRUE;
goto next_master;
}
if (msg != NULL)
@@ -3688,13 +3770,37 @@ refresh_callback(isc_task_t *task, isc_event_t *event) {
isc_event_free(&event);
LOCK_ZONE(zone);
dns_request_destroy(&zone->request);
- zone->curmaster++;
+ /*
+ * Skip to next failed / untried master.
+ */
+ do {
+ zone->curmaster++;
+ } while (zone->curmaster < zone->masterscnt &&
+ zone->mastersok[zone->curmaster]);
DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_NOEDNS);
if (zone->curmaster >= zone->masterscnt) {
+ isc_boolean_t done = ISC_TRUE;
if (DNS_ZONE_OPTION(zone, DNS_ZONEOPT_USEALTXFRSRC) &&
!DNS_ZONE_FLAG(zone, DNS_ZONEFLG_USEALTXFRSRC)) {
+ /*
+ * Did we get a good answer from all the masters?
+ */
+ for (j = 0; j < zone->masterscnt; j++)
+ if (zone->mastersok[j] == ISC_FALSE) {
+ done = ISC_FALSE;
+ break;
+ }
+ } else
+ done = ISC_TRUE;
+ if (!done) {
DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_USEALTXFRSRC);
zone->curmaster = 0;
+ /*
+ * Find the next failed master.
+ */
+ while (zone->curmaster < zone->masterscnt &&
+ zone->mastersok[zone->curmaster])
+ zone->curmaster++;
goto requeue;
}
DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_REFRESH);
@@ -4023,7 +4129,13 @@ soa_query(isc_task_t *task, isc_event_t *event) {
skip_master:
if (key != NULL)
dns_tsigkey_detach(&key);
- zone->curmaster++;
+ /*
+ * Skip to next failed / untried master.
+ */
+ do {
+ zone->curmaster++;
+ } while (zone->curmaster < zone->masterscnt &&
+ zone->mastersok[zone->curmaster]);
if (zone->curmaster < zone->masterscnt)
goto again;
zone->curmaster = 0;
@@ -5275,40 +5387,58 @@ zone_replacedb(dns_zone_t *zone, dns_db_t *db, isc_boolean_t dump) {
* is enabled in the configuration.
*/
if (zone->db != NULL && zone->journal != NULL &&
- DNS_ZONE_OPTION(zone, DNS_ZONEOPT_IXFRFROMDIFFS)) {
- isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL,
- DNS_LOGMODULE_ZONE, ISC_LOG_DEBUG(3),
- "generating diffs");
- result = dns_db_diff(zone->mctx, db, ver,
- zone->db, NULL /* XXX */,
+ DNS_ZONE_OPTION(zone, DNS_ZONEOPT_IXFRFROMDIFFS) &&
+ !DNS_ZONE_FLAG(zone, DNS_ZONEFLG_FORCEXFER)) {
+ isc_uint32_t serial;
+
+ dns_zone_log(zone, ISC_LOG_DEBUG(3), "generating diffs");
+
+ result = dns_db_getsoaserial(db, ver, &serial);
+ if (result != ISC_R_SUCCESS) {
+ dns_zone_log(zone, ISC_LOG_ERROR,
+ "ixfr-from-differences: unable to get "
+ "new serial");
+ goto fail;
+ }
+
+ /*
+ * This is checked in zone_postload() for master zones.
+ */
+ if (zone->type == dns_zone_slave &&
+ !isc_serial_gt(serial, zone->serial)) {
+ isc_uint32_t serialmin, serialmax;
+ serialmin = (zone->serial + 1) & 0xffffffffU;
+ serialmax = (zone->serial + 0x7fffffffU) & 0xffffffffU;
+ dns_zone_log(zone, ISC_LOG_ERROR,
+ "ixfr-from-differences: failed: "
+ "new serial (%u) out of range [%u - %u]",
+ serial, serialmin, serialmax);
+ result = ISC_R_RANGE;
+ goto fail;
+ }
+
+ result = dns_db_diff(zone->mctx, db, ver, zone->db, NULL,
zone->journal);
if (result != ISC_R_SUCCESS)
goto fail;
if (dump)
zone_needdump(zone, DNS_DUMP_DELAY);
else if (zone->journalsize != -1) {
- isc_uint32_t serial;
-
- result = dns_db_getsoaserial(db, ver, &serial);
- if (result == ISC_R_SUCCESS) {
- result = dns_journal_compact(zone->mctx,
- zone->journal,
- serial,
- zone->journalsize);
- switch (result) {
- case ISC_R_SUCCESS:
- case ISC_R_NOSPACE:
- case ISC_R_NOTFOUND:
- dns_zone_log(zone, ISC_LOG_DEBUG(3),
- "dns_journal_compact: %s",
- dns_result_totext(result));
- break;
- default:
- dns_zone_log(zone, ISC_LOG_ERROR,
+ result = dns_journal_compact(zone->mctx, zone->journal,
+ serial, zone->journalsize);
+ switch (result) {
+ case ISC_R_SUCCESS:
+ case ISC_R_NOSPACE:
+ case ISC_R_NOTFOUND:
+ dns_zone_log(zone, ISC_LOG_DEBUG(3),
+ "dns_journal_compact: %s",
+ dns_result_totext(result));
+ break;
+ default:
+ dns_zone_log(zone, ISC_LOG_ERROR,
"dns_journal_compact failed: %s",
- dns_result_totext(result));
- break;
- }
+ dns_result_totext(result));
+ break;
}
}
} else {
@@ -5503,7 +5633,14 @@ zone_xfrdone(dns_zone_t *zone, isc_result_t result) {
default:
next_master:
- zone->curmaster++;
+ /*
+ * Skip to next failed / untried master.
+ */
+ do {
+ zone->curmaster++;
+ } while (zone->curmaster < zone->masterscnt &&
+ zone->mastersok[zone->curmaster]);
+ /* FALLTHROUGH */
same_master:
if (zone->curmaster >= zone->masterscnt) {
zone->curmaster = 0;
@@ -5511,6 +5648,9 @@ zone_xfrdone(dns_zone_t *zone, isc_result_t result) {
!DNS_ZONE_FLAG(zone, DNS_ZONEFLG_USEALTXFRSRC)) {
DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_REFRESH);
DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_USEALTXFRSRC);
+ while (zone->curmaster < zone->masterscnt &&
+ zone->mastersok[zone->curmaster])
+ zone->curmaster++;
again = ISC_TRUE;
} else
DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_USEALTXFRSRC);
@@ -5697,7 +5837,11 @@ got_transfer_quota(isc_task_t *task, isc_event_t *event) {
"requesting AXFR of "
"initial version from %s", mastertext);
xfrtype = dns_rdatatype_axfr;
- } else if (dns_zone_isforced(zone)) {
+ } else if (DNS_ZONE_OPTION(zone, DNS_ZONEOPT_IXFRFROMDIFFS)) {
+ dns_zone_log(zone, ISC_LOG_DEBUG(1), "ixfr-from-differences "
+ "set, requesting AXFR from %s", mastertext);
+ xfrtype = dns_rdatatype_axfr;
+ } else if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_FORCEXFER)) {
dns_zone_log(zone, ISC_LOG_DEBUG(1),
"forced reload, requesting AXFR of "
"initial version from %s", mastertext);
@@ -6663,6 +6807,9 @@ void
dns_zone_forcereload(dns_zone_t *zone) {
REQUIRE(DNS_ZONE_VALID(zone));
+ if (zone->type == dns_zone_master)
+ return;
+
LOCK_ZONE(zone);
DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_FORCEXFER);
UNLOCK_ZONE(zone);
diff --git a/lib/isc/api b/lib/isc/api
index 63704dd6..8fe74f7f 100644
--- a/lib/isc/api
+++ b/lib/isc/api
@@ -1,3 +1,3 @@
-LIBINTERFACE = 10
-LIBREVISION = 5
-LIBAGE = 1
+LIBINTERFACE = 11
+LIBREVISION = 0
+LIBAGE = 0
diff --git a/lib/isc/include/isc/Makefile.in b/lib/isc/include/isc/Makefile.in
index 10cad7e0..f484c0bd 100644
--- a/lib/isc/include/isc/Makefile.in
+++ b/lib/isc/include/isc/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 1998-2001, 2003 Internet Software Consortium.
#
# Permission to use, copy, modify, and distribute this software for any
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.50.12.4 2004/03/06 08:14:38 marka Exp $
+# $Id: Makefile.in,v 1.50.12.6 2005/03/22 02:32:07 marka Exp $
srcdir = @srcdir@
VPATH = @srcdir@
@@ -28,8 +28,8 @@ top_srcdir = @top_srcdir@
#
HEADERS = app.h assertions.h base64.h bitstring.h boolean.h buffer.h \
bufferlist.h commandline.h entropy.h error.h event.h \
- eventclass.h \
- file.h formatcheck.h fsaccess.h heap.h hex.h hmacmd5.h \
+ eventclass.h file.h formatcheck.h fsaccess.h \
+ hash.h heap.h hex.h hmacmd5.h \
interfaceiter.h @ISC_IPV6_H@ lang.h lex.h \
lfsr.h lib.h list.h log.h magic.h md5.h mem.h msgcat.h msgs.h \
mutexblock.h netaddr.h ondestroy.h os.h parseint.h \
diff --git a/lib/isc/include/isc/netaddr.h b/lib/isc/include/isc/netaddr.h
index e209a9fa..ad3328c4 100644
--- a/lib/isc/include/isc/netaddr.h
+++ b/lib/isc/include/isc/netaddr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1998-2002 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: netaddr.h,v 1.18.12.7 2004/03/08 09:04:52 marka Exp $ */
+/* $Id: netaddr.h,v 1.18.12.9 2005/07/29 00:13:10 marka Exp $ */
#ifndef ISC_NETADDR_H
#define ISC_NETADDR_H 1
@@ -81,7 +81,7 @@ isc_netaddr_format(const isc_netaddr_t *na, char *array, unsigned int size);
*/
#define ISC_NETADDR_FORMATSIZE \
- sizeof("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:XXX.XXX.XXX.XXX")
+ sizeof("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:XXX.XXX.XXX.XXX%SSSSSSSSSS")
/*
* Minimum size of array to pass to isc_netaddr_format().
*/
diff --git a/lib/isc/include/isc/print.h b/lib/isc/include/isc/print.h
index 19da6b09..1bf3704a 100644
--- a/lib/isc/include/isc/print.h
+++ b/lib/isc/include/isc/print.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2001, 2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: print.h,v 1.17.188.2 2004/03/06 08:14:46 marka Exp $ */
+/* $Id: print.h,v 1.17.188.4 2005/06/09 23:54:30 marka Exp $ */
#ifndef ISC_PRINT_H
#define ISC_PRINT_H 1
@@ -55,6 +55,10 @@
#include <stdarg.h>
#include <stddef.h>
#endif
+#ifdef ISC_PLATFORM_NEEDSPRINTF
+#include <stdio.h>
+#endif
+
ISC_LANG_BEGINDECLS
diff --git a/lib/isc/include/isc/quota.h b/lib/isc/include/isc/quota.h
index 86478761..40441187 100644
--- a/lib/isc/include/isc/quota.h
+++ b/lib/isc/include/isc/quota.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000, 2001 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: quota.h,v 1.8.12.3 2004/03/08 09:04:52 marka Exp $ */
+/* $Id: quota.h,v 1.8.12.6 2005/08/11 15:00:08 marka Exp $ */
#ifndef ISC_QUOTA_H
#define ISC_QUOTA_H 1
@@ -53,7 +53,7 @@ struct isc_quota {
/* Locked by lock. */
int max;
int used;
- isc_boolean_t soft;
+ int soft;
};
isc_result_t
@@ -73,11 +73,17 @@ isc_quota_destroy(isc_quota_t *quota);
*/
void
-isc_quota_soft(isc_quota_t *quota, isc_boolean_t soft);
+isc_quota_soft(isc_quota_t *quota, int soft);
/*
* Turn on/off soft quotas.
*/
+void
+isc_quota_max(isc_quota_t *quota, int max);
+/*
+ * Re-set a maximum quota.
+ */
+
isc_result_t
isc_quota_reserve(isc_quota_t *quota);
/*
diff --git a/lib/isc/include/isc/sockaddr.h b/lib/isc/include/isc/sockaddr.h
index ffe4105d..1ffbca64 100644
--- a/lib/isc/include/isc/sockaddr.h
+++ b/lib/isc/include/isc/sockaddr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1998-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: sockaddr.h,v 1.35.12.6 2004/03/08 09:04:53 marka Exp $ */
+/* $Id: sockaddr.h,v 1.35.12.8 2005/07/29 00:13:10 marka Exp $ */
#ifndef ISC_SOCKADDR_H
#define ISC_SOCKADDR_H 1
@@ -192,7 +192,7 @@ isc_sockaddr_issitelocal(isc_sockaddr_t *sa);
*/
#define ISC_SOCKADDR_FORMATSIZE \
- sizeof("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:XXX.XXX.XXX.XXX#YYYYY")
+ sizeof("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:XXX.XXX.XXX.XXX#YYYYY%SSSSSSSSSS")
/*
* Minimum size of array to pass to isc_sockaddr_format().
*/
diff --git a/lib/isc/inet_pton.c b/lib/isc/inet_pton.c
index b253069e..026fedf2 100644
--- a/lib/isc/inet_pton.c
+++ b/lib/isc/inet_pton.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1996-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -17,7 +17,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static char rcsid[] =
- "$Id: inet_pton.c,v 1.10.2.4.2.1 2004/03/06 08:14:31 marka Exp $";
+ "$Id: inet_pton.c,v 1.10.2.4.2.3 2005/03/31 23:56:14 marka Exp $";
#endif /* LIBC_SCCS and not lint */
#include <config.h>
@@ -132,7 +132,7 @@ inet_pton6(const char *src, unsigned char *dst) {
xdigits_u[] = "0123456789ABCDEF";
unsigned char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp;
const char *xdigits, *curtok;
- int ch, saw_xdigit;
+ int ch, seen_xdigits;
unsigned int val;
memset((tp = tmp), '\0', NS_IN6ADDRSZ);
@@ -143,7 +143,7 @@ inet_pton6(const char *src, unsigned char *dst) {
if (*++src != ':')
return (0);
curtok = src;
- saw_xdigit = 0;
+ seen_xdigits = 0;
val = 0;
while ((ch = *src++) != '\0') {
const char *pch;
@@ -153,14 +153,13 @@ inet_pton6(const char *src, unsigned char *dst) {
if (pch != NULL) {
val <<= 4;
val |= (pch - xdigits);
- if (val > 0xffff)
+ if (++seen_xdigits > 4)
return (0);
- saw_xdigit = 1;
continue;
}
if (ch == ':') {
curtok = src;
- if (!saw_xdigit) {
+ if (!seen_xdigits) {
if (colonp)
return (0);
colonp = tp;
@@ -170,19 +169,19 @@ inet_pton6(const char *src, unsigned char *dst) {
return (0);
*tp++ = (unsigned char) (val >> 8) & 0xff;
*tp++ = (unsigned char) val & 0xff;
- saw_xdigit = 0;
+ seen_xdigits = 0;
val = 0;
continue;
}
if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) &&
inet_pton4(curtok, tp) > 0) {
tp += NS_INADDRSZ;
- saw_xdigit = 0;
+ seen_xdigits = 0;
break; /* '\0' was seen by inet_pton4(). */
}
return (0);
}
- if (saw_xdigit) {
+ if (seen_xdigits) {
if (tp + NS_INT16SZ > endp)
return (0);
*tp++ = (unsigned char) (val >> 8) & 0xff;
diff --git a/lib/isc/lfsr.c b/lib/isc/lfsr.c
index e1de6aa2..5a566a25 100644
--- a/lib/isc/lfsr.c
+++ b/lib/isc/lfsr.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2002 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,10 +15,11 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lfsr.c,v 1.11.2.2.2.3 2004/03/08 09:04:49 marka Exp $ */
+/* $Id: lfsr.c,v 1.11.2.2.2.5 2005/06/09 23:54:30 marka Exp $ */
#include <config.h>
+#include <stddef.h>
#include <stdlib.h>
#include <isc/assertions.h>
diff --git a/lib/isc/mem.c b/lib/isc/mem.c
index 762aa177..f5069fb7 100644
--- a/lib/isc/mem.c
+++ b/lib/isc/mem.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1997-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: mem.c,v 1.98.2.7.2.5 2004/03/16 05:50:24 marka Exp $ */
+/* $Id: mem.c,v 1.98.2.7.2.7 2005/03/17 03:58:32 marka Exp $ */
#include <config.h>
@@ -717,6 +717,15 @@ isc_mem_createx(size_t init_max_size, size_t target_size,
if (ctx == NULL)
return (ISC_R_NOMEMORY);
+ if (isc_mutex_init(&ctx->lock) != ISC_R_SUCCESS) {
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "isc_mutex_init() %s",
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED, "failed"));
+ (memfree)(arg, ctx);
+ return (ISC_R_UNEXPECTED);
+ }
+
if (init_max_size == 0U)
ctx->max_size = DEF_MAX_SIZE;
else
@@ -775,15 +784,6 @@ isc_mem_createx(size_t init_max_size, size_t target_size,
ctx->highest = NULL;
#endif /* ISC_MEM_USE_INTERNAL_MALLOC */
- if (isc_mutex_init(&ctx->lock) != ISC_R_SUCCESS) {
- UNEXPECTED_ERROR(__FILE__, __LINE__,
- "isc_mutex_init() %s",
- isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
- ISC_MSG_FAILED, "failed"));
- result = ISC_R_UNEXPECTED;
- goto error;
- }
-
#if ISC_MEM_TRACKLINES
if ((isc_mem_debugging & ISC_MEM_DEBUGRECORD) != 0) {
unsigned int i;
@@ -805,17 +805,18 @@ isc_mem_createx(size_t init_max_size, size_t target_size,
return (ISC_R_SUCCESS);
error:
- if (ctx) {
- if (ctx->stats)
+ if (ctx != NULL) {
+ if (ctx->stats != NULL)
(memfree)(arg, ctx->stats);
#if ISC_MEM_USE_INTERNAL_MALLOC
- if (ctx->freelists)
+ if (ctx->freelists != NULL)
(memfree)(arg, ctx->freelists);
#endif /* ISC_MEM_USE_INTERNAL_MALLOC */
#if ISC_MEM_TRACKLINES
- if (ctx->debuglist)
+ if (ctx->debuglist != NULL)
(ctx->memfree)(ctx->arg, ctx->debuglist);
#endif /* ISC_MEM_TRACKLINES */
+ DESTROYLOCK(&ctx->lock);
(memfree)(arg, ctx);
}
diff --git a/lib/isc/nls/msgcat.c b/lib/isc/nls/msgcat.c
index 484ab514..906e26e9 100644
--- a/lib/isc/nls/msgcat.c
+++ b/lib/isc/nls/msgcat.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2001 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: msgcat.c,v 1.10.12.4 2004/03/08 09:04:54 marka Exp $ */
+/* $Id: msgcat.c,v 1.10.12.6 2005/06/09 23:54:31 marka Exp $ */
/*
* Principal Author: Bob Halley
@@ -23,6 +23,7 @@
#include <config.h>
+#include <stddef.h>
#include <stdlib.h>
#include <isc/magic.h>
diff --git a/lib/isc/pthreads/mutex.c b/lib/isc/pthreads/mutex.c
index e29e92bd..71db6696 100644
--- a/lib/isc/pthreads/mutex.c
+++ b/lib/isc/pthreads/mutex.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000-2002 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: mutex.c,v 1.6.26.3 2004/03/08 09:04:55 marka Exp $ */
+/* $Id: mutex.c,v 1.6.26.5 2005/03/17 03:58:32 marka Exp $ */
#include <config.h>
@@ -126,19 +126,6 @@ isc_mutex_lock_profile(isc_mutex_t *mp, const char *file, int line) {
isc_mutexlocker_t *locker = NULL;
int i;
- for (i = 0; i < ISC_MUTEX_MAX_LOCKERS; i++) {
- if (mp->stats->lockers[i].file == NULL) {
- locker = &mp->stats->lockers[i];
- locker->file = file;
- locker->line = line;
- break;
- } else if (mp->stats->lockers[i].file == file &&
- mp->stats->lockers[i].line == line) {
- locker = &mp->stats->lockers[i];
- break;
- }
- }
-
gettimeofday(&prelock_t, NULL);
if (pthread_mutex_lock(&mp->mutex) != 0)
@@ -152,6 +139,19 @@ isc_mutex_lock_profile(isc_mutex_t *mp, const char *file, int line) {
mp->stats->count++;
timevaladd(&mp->stats->wait_total, &postlock_t);
+ for (i = 0; i < ISC_MUTEX_MAX_LOCKERS; i++) {
+ if (mp->stats->lockers[i].file == NULL) {
+ locker = &mp->stats->lockers[i];
+ locker->file = file;
+ locker->line = line;
+ break;
+ } else if (mp->stats->lockers[i].file == file &&
+ mp->stats->lockers[i].line == line) {
+ locker = &mp->stats->lockers[i];
+ break;
+ }
+ }
+
if (locker != NULL) {
locker->count++;
timevaladd(&locker->wait_total, &postlock_t);
diff --git a/lib/isc/quota.c b/lib/isc/quota.c
index 012bfbb3..273a1b2a 100644
--- a/lib/isc/quota.c
+++ b/lib/isc/quota.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000, 2001 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: quota.c,v 1.11.12.3 2004/03/08 09:04:49 marka Exp $ */
+/* $Id: quota.c,v 1.11.12.5 2005/07/29 00:13:09 marka Exp $ */
#include <config.h>
@@ -28,38 +28,45 @@ isc_result_t
isc_quota_init(isc_quota_t *quota, int max) {
quota->max = max;
quota->used = 0;
- quota->soft = ISC_FALSE;
+ quota->soft = 0;
return (isc_mutex_init(&quota->lock));
}
void
isc_quota_destroy(isc_quota_t *quota) {
INSIST(quota->used == 0);
- quota->max = -1;
- quota->used = -1;
- quota->soft = ISC_FALSE;
+ quota->max = 0;
+ quota->used = 0;
+ quota->soft = 0;
DESTROYLOCK(&quota->lock);
}
void
-isc_quota_soft(isc_quota_t *quota, isc_boolean_t soft) {
+isc_quota_soft(isc_quota_t *quota, int soft) {
+ LOCK(&quota->lock);
quota->soft = soft;
+ UNLOCK(&quota->lock);
+}
+
+void
+isc_quota_max(isc_quota_t *quota, int max) {
+ LOCK(&quota->lock);
+ quota->max = max;
+ UNLOCK(&quota->lock);
}
isc_result_t
isc_quota_reserve(isc_quota_t *quota) {
isc_result_t result;
LOCK(&quota->lock);
- if (quota->used < quota->max) {
- quota->used++;
- result = ISC_R_SUCCESS;
- } else {
- if (quota->soft) {
- quota->used++;
+ if (quota->max == 0 || quota->used < quota->max) {
+ if (quota->soft == 0 || quota->used < quota->soft)
+ result = ISC_R_SUCCESS;
+ else
result = ISC_R_SOFTQUOTA;
- } else
- result = ISC_R_QUOTA;
- }
+ quota->used++;
+ } else
+ result = ISC_R_QUOTA;
UNLOCK(&quota->lock);
return (result);
}
diff --git a/lib/isc/result.c b/lib/isc/result.c
index 5b0ddd3f..fd4e5c6c 100644
--- a/lib/isc/result.c
+++ b/lib/isc/result.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1998-2001, 2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,10 +15,11 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: result.c,v 1.56.2.2.8.7 2004/06/11 00:31:01 marka Exp $ */
+/* $Id: result.c,v 1.56.2.2.8.9 2005/06/09 23:54:30 marka Exp $ */
#include <config.h>
+#include <stddef.h>
#include <stdlib.h>
#include <isc/lib.h>
diff --git a/lib/isc/rwlock.c b/lib/isc/rwlock.c
index 63f0c68d..3e444d8a 100644
--- a/lib/isc/rwlock.c
+++ b/lib/isc/rwlock.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1998-2001, 2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rwlock.c,v 1.33.2.4.2.1 2004/03/06 08:14:35 marka Exp $ */
+/* $Id: rwlock.c,v 1.33.2.4.2.3 2005/03/17 03:58:32 marka Exp $ */
#include <config.h>
@@ -109,7 +109,9 @@ isc_rwlock_init(isc_rwlock_t *rwl, unsigned int read_quota,
isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
ISC_MSG_FAILED, "failed"),
isc_result_totext(result));
- return (ISC_R_UNEXPECTED);
+ result = ISC_R_UNEXPECTED;
+ goto destroy_lock;
+
}
result = isc_condition_init(&rwl->writeable);
if (result != ISC_R_SUCCESS) {
@@ -118,12 +120,20 @@ isc_rwlock_init(isc_rwlock_t *rwl, unsigned int read_quota,
isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
ISC_MSG_FAILED, "failed"),
isc_result_totext(result));
- return (ISC_R_UNEXPECTED);
+ result = ISC_R_UNEXPECTED;
+ goto destroy_rcond;
}
rwl->magic = RWLOCK_MAGIC;
return (ISC_R_SUCCESS);
+
+ destroy_rcond:
+ (void)isc_condition_destroy(&rwl->readable);
+ destroy_lock:
+ DESTROYLOCK(&rwl->lock);
+
+ return (result);
}
static isc_result_t
diff --git a/lib/isc/unix/entropy.c b/lib/isc/unix/entropy.c
index a2cbb3c6..50506634 100644
--- a/lib/isc/unix/entropy.c
+++ b/lib/isc/unix/entropy.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: entropy.c,v 1.60.2.3.8.9 2004/03/16 05:02:31 marka Exp $ */
+/* $Id: entropy.c,v 1.60.2.3.8.11 2005/07/12 05:47:43 marka Exp $ */
/*
* This is the system depenedent part of the ISC entropy API.
@@ -446,16 +446,25 @@ make_nonblock(int fd) {
int ret;
int flags;
char strbuf[ISC_STRERRORSIZE];
+#ifdef USE_FIONBIO_IOCTL
+ int on = 1;
+ ret = ioctl(fd, FIONBIO, (char *)&on);
+#else
flags = fcntl(fd, F_GETFL, 0);
- flags |= O_NONBLOCK;
+ flags |= PORT_NONBLOCK;
ret = fcntl(fd, F_SETFL, flags);
+#endif
if (ret == -1) {
isc__strerror(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
- "fcntl(%d, F_SETFL, %d): %s",
- fd, flags, strbuf);
+#ifdef USE_FIONBIO_IOCTL
+ "ioctl(%d, FIONBIO, &on): %s", fd,
+#else
+ "fcntl(%d, F_SETFL, %d): %s", fd, flags,
+#endif
+ strbuf);
return (ISC_R_UNEXPECTED);
}
@@ -501,7 +510,7 @@ isc_entropy_createfilesource(isc_entropy_t *ent, const char *fname) {
if (is_usocket)
fd = socket(PF_UNIX, SOCK_STREAM, 0);
else
- fd = open(fname, O_RDONLY | O_NONBLOCK, 0);
+ fd = open(fname, O_RDONLY | PORT_NONBLOCK, 0);
if (fd < 0) {
ret = isc__errno2result(errno);
diff --git a/lib/isc/unix/ifiter_sysctl.c b/lib/isc/unix/ifiter_sysctl.c
index c0f678b9..b10a2d20 100644
--- a/lib/isc/unix/ifiter_sysctl.c
+++ b/lib/isc/unix/ifiter_sysctl.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: ifiter_sysctl.c,v 1.14.12.7 2004/03/08 09:04:56 marka Exp $ */
+/* $Id: ifiter_sysctl.c,v 1.14.12.9 2005/03/17 03:58:33 marka Exp $ */
/*
* Obtain the list of network interfaces using sysctl.
@@ -251,7 +251,7 @@ internal_current(isc_interfaceiter_t *iter) {
iter->current.name);
if (dst_sa != NULL &&
- (iter->current.flags & IFF_POINTOPOINT) != 0)
+ (iter->current.flags & INTERFACE_F_POINTTOPOINT) != 0)
get_addr(family, &iter->current.dstaddress, dst_sa,
iter->current.name);
diff --git a/lib/isc/unix/net.c b/lib/isc/unix/net.c
index 05f41215..e0aeccbb 100644
--- a/lib/isc/unix/net.c
+++ b/lib/isc/unix/net.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: net.c,v 1.22.2.2.10.7 2004/04/29 01:31:22 marka Exp $ */
+/* $Id: net.c,v 1.22.2.2.10.9 2005/03/17 03:58:33 marka Exp $ */
#include <config.h>
@@ -237,6 +237,7 @@ initialize_ipv6only(void) {
}
#endif /* IPV6_V6ONLY */
+#ifdef ISC_PLATFORM_HAVEIN6PKTINFO
static void
try_ipv6pktinfo(void) {
int s, on;
@@ -289,6 +290,7 @@ initialize_ipv6pktinfo(void) {
RUNTIME_CHECK(isc_once_do(&once_ipv6pktinfo,
try_ipv6pktinfo) == ISC_R_SUCCESS);
}
+#endif /* ISC_PLATFORM_HAVEIN6PKTINFO */
#endif /* WANT_IPV6 */
isc_result_t
@@ -306,12 +308,14 @@ isc_net_probe_ipv6only(void) {
isc_result_t
isc_net_probe_ipv6pktinfo(void) {
#ifdef ISC_PLATFORM_HAVEIPV6
+#ifdef ISC_PLATFORM_HAVEIN6PKTINFO
#ifdef WANT_IPV6
initialize_ipv6pktinfo();
#else
ipv6pktinfo_result = ISC_R_NOTFOUND;
#endif
#endif
+#endif
return (ipv6pktinfo_result);
}
diff --git a/lib/isc/unix/socket.c b/lib/isc/unix/socket.c
index f23b72b0..13bf6fb3 100644
--- a/lib/isc/unix/socket.c
+++ b/lib/isc/unix/socket.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1998-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: socket.c,v 1.207.2.19.2.15 2004/11/18 21:31:16 marka Exp $ */
+/* $Id: socket.c,v 1.207.2.19.2.21 2005/08/25 04:32:55 marka Exp $ */
#include <config.h>
@@ -280,7 +280,7 @@ socket_log(isc_socket_t *sock, isc_sockaddr_t *address,
const char *fmt, ...)
{
char msgbuf[2048];
- char peerbuf[256];
+ char peerbuf[ISC_SOCKADDR_FORMATSIZE];
va_list ap;
if (! isc_log_wouldlog(isc_lctx, level))
@@ -363,7 +363,7 @@ select_poke(isc_socketmgr_t *mgr, int fd, int msg) {
}
#endif
} while (cc < 0 && SOFT_ERROR(errno));
-
+
if (cc < 0) {
isc__strerror(errno, strbuf, sizeof(strbuf));
FATAL_ERROR(__FILE__, __LINE__,
@@ -429,16 +429,25 @@ make_nonblock(int fd) {
int ret;
int flags;
char strbuf[ISC_STRERRORSIZE];
+#ifdef USE_FIONBIO_IOCTL
+ int on = 1;
+ ret = ioctl(fd, FIONBIO, (char *)&on);
+#else
flags = fcntl(fd, F_GETFL, 0);
- flags |= O_NONBLOCK;
+ flags |= PORT_NONBLOCK;
ret = fcntl(fd, F_SETFL, flags);
+#endif
if (ret == -1) {
isc__strerror(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
- "fcntl(%d, F_SETFL, %d): %s",
- fd, flags, strbuf);
+#ifdef USE_FIONBIO_IOCTL
+ "ioctl(%d, FIONBIO, &on): %s", fd,
+#else
+ "fcntl(%d, F_SETFL, %d): %s", fd, flags,
+#endif
+ strbuf);
return (ISC_R_UNEXPECTED);
}
@@ -461,7 +470,11 @@ cmsg_len(ISC_SOCKADDR_LEN_T len) {
#else
ISC_SOCKADDR_LEN_T hdrlen;
- hdrlen = (ISC_SOCKADDR_LEN_T)CMSG_DATA(NULL); /* XXX */
+ /*
+ * Cast NULL so that any pointer arithmetic performed by CMSG_DATA
+ * is correct.
+ */
+ hdrlen = (ISC_SOCKADDR_LEN_T)CMSG_DATA(((struct cmsghdr *)NULL));
return (hdrlen + len);
#endif
}
@@ -1222,7 +1235,7 @@ allocate_socket(isc_socketmgr_t *manager, isc_sockettype_t type,
cmsgbuflen += cmsg_space(sizeof(struct timeval));
#endif
sock->recvcmsgbuflen = cmsgbuflen;
- if (sock->recvcmsgbuflen != 0) {
+ if (sock->recvcmsgbuflen != 0U) {
sock->recvcmsgbuf = isc_mem_get(manager->mctx, cmsgbuflen);
if (sock->recvcmsgbuf == NULL)
goto error;
@@ -1233,7 +1246,7 @@ allocate_socket(isc_socketmgr_t *manager, isc_sockettype_t type,
cmsgbuflen = cmsg_space(sizeof(struct in6_pktinfo));
#endif
sock->sendcmsgbuflen = cmsgbuflen;
- if (sock->sendcmsgbuflen != 0) {
+ if (sock->sendcmsgbuflen != 0U) {
sock->sendcmsgbuf = isc_mem_get(manager->mctx, cmsgbuflen);
if (sock->sendcmsgbuf == NULL)
goto error;
@@ -1348,6 +1361,7 @@ isc_socket_create(isc_socketmgr_t *manager, int pf, isc_sockettype_t type,
int on = 1;
#endif
char strbuf[ISC_STRERRORSIZE];
+ const char *err = "socket";
REQUIRE(VALID_MANAGER(manager));
REQUIRE(socketp != NULL && *socketp == NULL);
@@ -1367,23 +1381,24 @@ isc_socket_create(isc_socketmgr_t *manager, int pf, isc_sockettype_t type,
}
#ifdef F_DUPFD
- /*
- * Leave a space for stdio to work in.
- */
- if (sock->fd >= 0 && sock->fd < 20) {
- int new, tmp;
- new = fcntl(sock->fd, F_DUPFD, 20);
- tmp = errno;
- (void)close(sock->fd);
- errno = tmp;
- sock->fd = new;
- }
+ /*
+ * Leave a space for stdio to work in.
+ */
+ if (sock->fd >= 0 && sock->fd < 20) {
+ int new, tmp;
+ new = fcntl(sock->fd, F_DUPFD, 20);
+ tmp = errno;
+ (void)close(sock->fd);
+ errno = tmp;
+ sock->fd = new;
+ err = "isc_socket_create: fcntl";
+ }
#endif
if (sock->fd >= (int)FD_SETSIZE) {
(void)close(sock->fd);
isc_log_iwrite(isc_lctx, ISC_LOGCATEGORY_GENERAL,
- ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR,
+ ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR,
isc_msgcat, ISC_MSGSET_SOCKET,
ISC_MSG_TOOMANYFDS,
"%s: too many open file descriptors", "socket");
@@ -1413,7 +1428,7 @@ isc_socket_create(isc_socketmgr_t *manager, int pf, isc_sockettype_t type,
default:
isc__strerror(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
- "socket() %s: %s",
+ "%s() %s: %s", err,
isc_msgcat_get(isc_msgcat,
ISC_MSGSET_GENERAL,
ISC_MSG_FAILED,
@@ -1464,7 +1479,7 @@ isc_socket_create(isc_socketmgr_t *manager, int pf, isc_sockettype_t type,
#endif /* SO_TIMESTAMP */
#if defined(ISC_PLATFORM_HAVEIPV6)
- if (pf == AF_INET6 && sock->recvcmsgbuflen == 0) {
+ if (pf == AF_INET6 && sock->recvcmsgbuflen == 0U) {
/*
* Warn explicitly because this anomaly can be hidden
* in usual operation (and unexpectedly appear later).
@@ -1764,6 +1779,7 @@ internal_accept(isc_task_t *me, isc_event_t *ev) {
int fd;
isc_result_t result = ISC_R_SUCCESS;
char strbuf[ISC_STRERRORSIZE];
+ const char *err = "accept";
UNUSED(me);
@@ -1817,17 +1833,18 @@ internal_accept(isc_task_t *me, isc_event_t *ev) {
(void *)&addrlen);
#ifdef F_DUPFD
- /*
- * Leave a space for stdio to work in.
- */
- if (fd >= 0 && fd < 20) {
- int new, tmp;
- new = fcntl(fd, F_DUPFD, 20);
- tmp = errno;
- (void)close(fd);
- errno = tmp;
- fd = new;
- }
+ /*
+ * Leave a space for stdio to work in.
+ */
+ if (fd >= 0 && fd < 20) {
+ int new, tmp;
+ new = fcntl(fd, F_DUPFD, 20);
+ tmp = errno;
+ (void)close(fd);
+ errno = tmp;
+ fd = new;
+ err = "fcntl";
+ }
#endif
if (fd < 0) {
@@ -1856,7 +1873,7 @@ internal_accept(isc_task_t *me, isc_event_t *ev) {
}
isc__strerror(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
- "internal_accept: accept() %s: %s",
+ "internal_accept: %s() %s: %s", err,
isc_msgcat_get(isc_msgcat,
ISC_MSGSET_GENERAL,
ISC_MSG_FAILED,
@@ -1865,7 +1882,7 @@ internal_accept(isc_task_t *me, isc_event_t *ev) {
fd = -1;
result = ISC_R_UNEXPECTED;
} else {
- if (addrlen == 0) {
+ if (addrlen == 0U) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"internal_accept(): "
"accept() failed to return "
@@ -2197,7 +2214,7 @@ watcher(void *uap) {
cc = select(maxfd, &readfds, &writefds, NULL, NULL);
if (cc < 0) {
if (!SOFT_ERROR(errno)) {
- isc__strerror(errno, strbuf,
+ isc__strerror(errno, strbuf,
sizeof(strbuf));
FATAL_ERROR(__FILE__, __LINE__,
"select() %s: %s",
@@ -3094,6 +3111,7 @@ isc_socket_connect(isc_socket_t *sock, isc_sockaddr_t *addr,
ERROR_MATCH(ENOBUFS, ISC_R_NORESOURCES);
ERROR_MATCH(EPERM, ISC_R_HOSTUNREACH);
ERROR_MATCH(EPIPE, ISC_R_NOTCONNECTED);
+ ERROR_MATCH(ECONNRESET, ISC_R_CONNECTIONRESET);
#undef ERROR_MATCH
}
@@ -3163,6 +3181,7 @@ internal_connect(isc_task_t *me, isc_event_t *ev) {
int cc;
ISC_SOCKADDR_LEN_T optlen;
char strbuf[ISC_STRERRORSIZE];
+ char peerbuf[ISC_SOCKADDR_FORMATSIZE];
UNUSED(me);
INSIST(ev->ev_type == ISC_SOCKEVENT_INTW);
@@ -3239,13 +3258,16 @@ internal_connect(isc_task_t *me, isc_event_t *ev) {
ERROR_MATCH(EPERM, ISC_R_HOSTUNREACH);
ERROR_MATCH(EPIPE, ISC_R_NOTCONNECTED);
ERROR_MATCH(ETIMEDOUT, ISC_R_TIMEDOUT);
+ ERROR_MATCH(ECONNRESET, ISC_R_CONNECTIONRESET);
#undef ERROR_MATCH
default:
dev->result = ISC_R_UNEXPECTED;
+ isc_sockaddr_format(&sock->address, peerbuf,
+ sizeof(peerbuf));
isc__strerror(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
- "internal_connect: connect() %s",
- strbuf);
+ "internal_connect: connect(%s) %s",
+ peerbuf, strbuf);
}
} else {
dev->result = ISC_R_SUCCESS;
@@ -3407,7 +3429,7 @@ isc_socket_cancel(isc_socket_t *sock, isc_task_t *task, unsigned int how) {
dev->result = ISC_R_CANCELED;
dev->ev_sender = sock;
isc_task_sendanddetach(&current_task,
- ISC_EVENT_PTR(&dev));
+ ISC_EVENT_PTR(&dev));
}
dev = next;
diff --git a/lib/isc/unix/stdtime.c b/lib/isc/unix/stdtime.c
index 8946a605..b8d818dc 100644
--- a/lib/isc/unix/stdtime.c
+++ b/lib/isc/unix/stdtime.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2001 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,10 +15,11 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: stdtime.c,v 1.11.2.1.10.3 2004/03/08 09:04:57 marka Exp $ */
+/* $Id: stdtime.c,v 1.11.2.1.10.5 2005/06/09 23:54:31 marka Exp $ */
#include <config.h>
+#include <stddef.h> /* NULL */
#include <stdlib.h> /* NULL */
#include <syslog.h>
diff --git a/lib/isc/win32/errno2result.c b/lib/isc/win32/errno2result.c
index 2209e997..8005d65f 100644
--- a/lib/isc/win32/errno2result.c
+++ b/lib/isc/win32/errno2result.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000-2002 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: errno2result.c,v 1.4.2.5.2.3 2004/03/08 09:04:59 marka Exp $ */
+/* $Id: errno2result.c,v 1.4.2.5.2.6 2005/09/01 03:16:12 marka Exp $ */
#include <config.h>
@@ -32,7 +32,7 @@
* not already there.
*/
isc_result_t
-isc__errno2result(int posixerrno) {
+isc__errno2resultx(int posixerrno, const char *file, int line) {
char strbuf[ISC_STRERRORSIZE];
switch (posixerrno) {
@@ -61,12 +61,28 @@ isc__errno2result(int posixerrno) {
case EMFILE:
case WSAEMFILE:
return (ISC_R_TOOMANYOPENFILES);
+ case ERROR_OPERATION_ABORTED:
+ return (ISC_R_CONNECTIONRESET);
+ case ERROR_PORT_UNREACHABLE:
+ return (ISC_R_HOSTUNREACH);
+ case ERROR_HOST_UNREACHABLE:
+ return (ISC_R_HOSTUNREACH);
+ case ERROR_NETWORK_UNREACHABLE:
+ return (ISC_R_NETUNREACH);
+ case WSAEADDRNOTAVAIL:
+ return (ISC_R_ADDRNOTAVAIL);
+ case WSAEHOSTUNREACH:
+ return (ISC_R_HOSTUNREACH);
+ case WSAEHOSTDOWN:
+ return (ISC_R_HOSTUNREACH);
+ case WSAENETUNREACH:
+ return (ISC_R_NETUNREACH);
+ case WSAENOBUFS:
+ return (ISC_R_NORESOURCES);
default:
isc__strerror(posixerrno, strbuf, sizeof(strbuf));
- UNEXPECTED_ERROR(__FILE__, __LINE__,
- "unable to convert errno "
- "to isc_result: %d: %s",
- posixerrno, strbuf);
+ UNEXPECTED_ERROR(file, line, "unable to convert errno "
+ "to isc_result: %d: %s", posixerrno, strbuf);
/*
* XXXDCL would be nice if perhaps this function could
* return the system's error string, so the caller
@@ -76,4 +92,3 @@ isc__errno2result(int posixerrno) {
return (ISC_R_UNEXPECTED);
}
}
-
diff --git a/lib/isc/win32/errno2result.h b/lib/isc/win32/errno2result.h
index 961ee40c..743a1725 100644
--- a/lib/isc/win32/errno2result.h
+++ b/lib/isc/win32/errno2result.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000, 2001 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: errno2result.h,v 1.4.12.3 2004/03/08 09:04:59 marka Exp $ */
+/* $Id: errno2result.h,v 1.4.12.5 2005/06/09 23:54:32 marka Exp $ */
#ifndef UNIX_ERRNO2RESULT_H
#define UNIX_ERRNO2RESULT_H 1
@@ -29,8 +29,11 @@
ISC_LANG_BEGINDECLS
+#define isc__errno2result(posixerrno) \
+ isc__errno2resultx(posixerrno, __FILE__, __LINE__)
+
isc_result_t
-isc__errno2result(int posixerrno);
+isc__errno2resultx(int posixerrno, const char *file, int line);
ISC_LANG_ENDDECLS
diff --git a/lib/isc/win32/libisc.def b/lib/isc/win32/libisc.def
index b7daaaa7..2f3c28a4 100644
--- a/lib/isc/win32/libisc.def
+++ b/lib/isc/win32/libisc.def
@@ -3,87 +3,118 @@ LIBRARY libisc
; Exported Functions
EXPORTS
+NTReportError
+closelog
+isc__buffer_activeregion
+isc__buffer_add
+isc__buffer_availableregion
+isc__buffer_back
+isc__buffer_clear
+isc__buffer_consumedregion
+isc__buffer_first
+isc__buffer_forward
+isc__buffer_init
+isc__buffer_invalidate
+isc__buffer_putmem
+isc__buffer_putstr
+isc__buffer_putuint16
+isc__buffer_putuint32
+isc__buffer_putuint8
+isc__buffer_region
+isc__buffer_remainingregion
+isc__buffer_setactive
+isc__buffer_subtract
+isc__buffer_usedregion
+isc__mem_allocate
+isc__mem_free
+isc__mem_get
+isc__mem_put
+isc__mem_putanddetach
+isc__mem_strdup
+isc__mempool_get
+isc__mempool_put
+isc__strerror
+isc_app_block
+isc_app_finish
+isc_app_onrun
+isc_app_reload
+isc_app_run
+isc_app_shutdown
+isc_app_start
+isc_app_unblock
isc_assertion_setcallback
isc_assertion_typetotext
-isc_base64_totext
isc_base64_decodestring
isc_base64_tobuffer
+isc_base64_totext
+isc_bitstring_copy
isc_bitstring_init
isc_bitstring_invalidate
-isc_bitstring_copy
isc_buffer_allocate
-isc_buffer_free
-isc__buffer_init
-isc__buffer_invalidate
-isc__buffer_region
-isc__buffer_usedregion
-isc__buffer_availableregion
-isc__buffer_add
-isc__buffer_subtract
-isc__buffer_clear
-isc__buffer_consumedregion
-isc__buffer_remainingregion
-isc__buffer_activeregion
-isc__buffer_setactive
-isc__buffer_first
-isc__buffer_forward
-isc__buffer_back
isc_buffer_compact
-isc_buffer_getuint8
-isc__buffer_putuint8
+isc_buffer_copyregion
+isc_buffer_free
isc_buffer_getuint16
-isc__buffer_putuint16
isc_buffer_getuint32
-isc__buffer_putuint32
-isc__buffer_putmem
-isc__buffer_putstr
-isc_buffer_copyregion
-isc_bufferlist_usedcount
+isc_buffer_getuint8
isc_bufferlist_availablecount
+isc_bufferlist_usedcount
isc_commandline_parse
-
-
-isc_entropy_create
+isc_condition_broadcast
+isc_condition_destroy
+isc_condition_init
+isc_condition_signal
+isc_condition_wait
+isc_condition_waituntil
+isc_dir_chdir
+isc_dir_chroot
+isc_dir_close
+isc_dir_init
+isc_dir_open
+isc_dir_read
+isc_dir_reset
+isc_entropy_addcallbacksample
+isc_entropy_addsample
isc_entropy_attach
-isc_entropy_detach
+isc_entropy_create
+isc_entropy_createcallbacksource
isc_entropy_createfilesource
-isc_entropy_destroysource
isc_entropy_createsamplesource
-isc_entropy_createcallbacksource
-isc_entropy_stopcallbacksources
-isc_entropy_addcallbacksample
-isc_entropy_addsample
+isc_entropy_destroysource
+isc_entropy_detach
isc_entropy_getdata
isc_entropy_putdata
isc_entropy_stats
+isc_entropy_stopcallbacksources
isc_entropy_usebestsource
-isc_error_setunexpected
-isc_error_setfatal
-isc_error_unexpected
isc_error_fatal
isc_error_runtimecheck
+isc_error_setfatal
+isc_error_setunexpected
+isc_error_unexpected
isc_event_allocate
isc_event_free
-isc_file_settime
+isc_file_absolutepath
+isc_file_basename
+isc_file_exists
isc_file_getmodtime
+isc_file_isabsolute
+isc_file_ischdiridempotent
+isc_file_iscurrentdir
isc_file_mktemplate
isc_file_openunique
+isc_file_progname
isc_file_remove
isc_file_rename
-isc_file_exists
-isc_file_ischdiridempotent
-isc_file_isabsolute
-isc_file_iscurrentdir
-isc_file_template
isc_file_renameunique
-isc_file_basename
-isc_file_progname
isc_file_safemovefile
-isc_file_absolutepath
+isc_file_settime
+isc_file_template
+isc_file_truncate
isc_fsaccess_add
+isc_fsaccess_changeowner
isc_fsaccess_remove
isc_fsaccess_set
-isc_fsaccess_changeowner
isc_hash_calc
isc_hash_create
isc_hash_ctxattach
@@ -93,347 +124,312 @@ isc_hash_ctxdetach
isc_hash_ctxinit
isc_hash_destroy
isc_hash_init
-isc_hex_totext
isc_hex_decodestring
isc_hex_tobuffer
+isc_hex_totext
isc_hmacmd5_init
isc_hmacmd5_invalidate
-isc_hmacmd5_update
isc_hmacmd5_sign
+isc_hmacmd5_update
isc_hmacmd5_verify
isc_interfaceiter_create
-isc_interfaceiter_first
isc_interfaceiter_current
-isc_interfaceiter_next
isc_interfaceiter_destroy
-isc_lex_setcomments
+isc_interfaceiter_first
+isc_interfaceiter_next
+isc_interval_iszero
+isc_interval_set
+isc_keyboard_canceled
+isc_keyboard_close
+isc_keyboard_getchar
+isc_keyboard_open
+isc_lex_close
isc_lex_create
isc_lex_destroy
isc_lex_getcomments
-isc_lex_setcomments
+isc_lex_getlasttokentext
+isc_lex_getmastertoken
+isc_lex_getsourceline
+isc_lex_getsourcename
isc_lex_getspecials
-isc_lex_setspecials
+isc_lex_gettoken
+isc_lex_isfile
+isc_lex_openbuffer
isc_lex_openfile
isc_lex_openstream
-isc_lex_openbuffer
-isc_lex_close
-isc_lex_gettoken
-isc_lex_getmastertoken
+isc_lex_setcomments
+isc_lex_setcomments
+isc_lex_setspecials
isc_lex_ungettoken
-isc_lex_getlasttokentext
-isc_lex_getsourcename
-isc_lex_getsourceline
-isc_lex_isfile
-isc_lfsr_init
isc_lfsr_generate
-isc_lfsr_skip
isc_lfsr_generate32
+isc_lfsr_init
+isc_lfsr_skip
isc_lib_initmsgcat
+isc_log_categorybyname
+isc_log_closefilelogs
+isc_log_create
+isc_log_createchannel
isc_log_createchannel
isc_log_createchannel
-isc_log_create
-isc_logconfig_create
-isc_logconfig_get
-isc_logconfig_use
isc_log_destroy
-isc_logconfig_destroy
+isc_log_getdebuglevel
+isc_log_getduplicateinterval
+isc_log_gettag
+isc_log_ivwrite
+isc_log_ivwrite1
+isc_log_iwrite
+isc_log_iwrite1
+isc_log_modulebyname
+isc_log_opensyslog
isc_log_registercategories
isc_log_registermodules
-isc_log_createchannel
+isc_log_setcontext
+isc_log_setdebuglevel
+isc_log_setduplicateinterval
+isc_log_settag
isc_log_usechannel
-isc_log_write
isc_log_vwrite
-isc_log_write1
isc_log_vwrite1
-isc_log_iwrite
-isc_log_ivwrite
-isc_log_iwrite1
-isc_log_ivwrite1
-isc_log_setdebuglevel
-isc_log_getdebuglevel
isc_log_wouldlog
isc_log_write
-isc_log_setduplicateinterval
-isc_log_getduplicateinterval
-isc_log_settag
-isc_log_gettag
-isc_log_opensyslog
-isc_log_closefilelogs
-isc_log_categorybyname
-isc_log_modulebyname
-isc_log_setcontext
+isc_log_write
+isc_log_write1
+isc_logconfig_create
+isc_logconfig_destroy
+isc_logconfig_get
+isc_logconfig_use
+isc_md5_final
isc_md5_init
isc_md5_invalidate
isc_md5_update
-isc_md5_final
isc_mem_attach
-isc_mem_detach
-isc_mem_detach
+isc_mem_attach
isc_mem_create
isc_mem_createx
-isc_mem_attach
-isc_mem_detach
isc_mem_destroy
+isc_mem_detach
+isc_mem_detach
+isc_mem_detach
+isc_mem_getquota
+isc_mem_inuse
isc_mem_ondestroy
-isc_mem_stats
isc_mem_setdestroycheck
isc_mem_setquota
-isc_mem_getquota
-isc_mem_inuse
isc_mem_setwater
+isc_mem_stats
+isc_mempool_associatelock
isc_mempool_create
isc_mempool_destroy
-isc_mempool_setname
-isc_mempool_associatelock
-isc_mempool_getfreemax
-isc_mempool_setfreemax
-isc_mempool_getfreecount
-isc_mempool_getmaxalloc
-isc_mempool_setmaxalloc
isc_mempool_getallocated
isc_mempool_getfillcount
+isc_mempool_getfreecount
+isc_mempool_getfreemax
+isc_mempool_getmaxalloc
isc_mempool_setfillcount
-isc__mem_get
-isc__mem_putanddetach
-isc__mem_put
-isc__mem_allocate
-isc__mem_free
-isc__mem_strdup
-isc__mempool_get
-isc__mempool_put
-isc_msgcat_open
+isc_mempool_setfreemax
+isc_mempool_setmaxalloc
+isc_mempool_setname
isc_msgcat_close
isc_msgcat_get
-isc_mutexblock_init
+isc_msgcat_open
isc_mutexblock_destroy
-isc_netaddr_equal
+isc_mutexblock_init
+isc_net_aton
+isc_net_aton
+isc_net_disableipv4
+isc_net_disableipv6
+isc_net_ntop
+isc_net_ntop
+isc_net_probe_ipv6only
+isc_net_probe_ipv6pktinfo
+isc_net_probeipv4
+isc_net_probeipv4
+isc_net_probeipv6
+isc_net_probeipv6
+isc_net_pton
+isc_net_pton
+isc_netaddr_any
+isc_netaddr_any6
isc_netaddr_eqprefix
-isc_netaddr_masktoprefixlen
-isc_netaddr_totext
+isc_netaddr_equal
isc_netaddr_format
-isc_netaddr_fromsockaddr
isc_netaddr_fromin
isc_netaddr_fromin6
-isc_netaddr_any
-isc_netaddr_any6
-isc_netaddr_ismulticast
+isc_netaddr_fromsockaddr
isc_netaddr_fromv4mapped
+isc_netaddr_ismulticast
+isc_netaddr_masktoprefixlen
isc_netaddr_setzone
+isc_netaddr_totext
isc_netscope_pton
-isc_ntpaths_init
isc_ntpaths_get
+isc_ntpaths_init
+isc_once_do
isc_ondestroy_init
-isc_ondestroy_register
isc_ondestroy_notify
-isc_task_sendanddetach
+isc_ondestroy_register
isc_os_ncpus
-isc_quota_init
-isc_quota_destroy
-isc_quota_soft
-isc_quota_reserve
-isc_quota_release
+isc_parse_uint16
+isc_parse_uint32
+isc_parse_uint8
isc_quota_attach
+isc_quota_destroy
isc_quota_detach
-isc_random_seed
+isc_quota_init
+isc_quota_max
+isc_quota_release
+isc_quota_reserve
+isc_quota_soft
isc_random_get
isc_random_jitter
+isc_random_seed
+isc_ratelimiter_attach
isc_ratelimiter_create
+isc_ratelimiter_detach
+isc_ratelimiter_enqueue
isc_ratelimiter_setinterval
isc_ratelimiter_setpertic
-isc_ratelimiter_enqueue
isc_ratelimiter_shutdown
-isc_ratelimiter_attach
-isc_ratelimiter_detach
-isc_resource_setlimit
+isc_region_compare
isc_resource_getlimit
-isc_result_totext
+isc_resource_setlimit
isc_result_register
+isc_result_totext
+isc_rwlock_destroy
+isc_rwlock_downgrade
isc_rwlock_init
isc_rwlock_lock
isc_rwlock_trylock
+isc_rwlock_tryupgrade
isc_rwlock_unlock
-isc_rwlock_destroy
-isc_serial_lt
+isc_serial_eq
+isc_serial_ge
isc_serial_gt
isc_serial_le
-isc_serial_ge
-isc_serial_eq
+isc_serial_lt
isc_serial_ne
+isc_sha1_final
isc_sha1_init
isc_sha1_invalidate
isc_sha1_update
-isc_sha1_final
-isc_sockaddr_equal
-isc_sockaddr_eqaddr
-isc_sockaddr_eqaddrprefix
-isc_sockaddr_hash
isc_sockaddr_any
isc_sockaddr_any6
isc_sockaddr_anyofpf
+isc_sockaddr_eqaddr
+isc_sockaddr_eqaddrprefix
+isc_sockaddr_equal
+isc_sockaddr_format
isc_sockaddr_fromin
isc_sockaddr_fromin6
-isc_sockaddr_v6fromin
isc_sockaddr_fromnetaddr
+isc_sockaddr_getport
+isc_sockaddr_hash
+isc_sockaddr_isexperimental
+isc_sockaddr_ismulticast
isc_sockaddr_pf
isc_sockaddr_setport
-isc_sockaddr_getport
isc_sockaddr_totext
-isc_sockaddr_format
-isc_sockaddr_ismulticast
-isc_socket_create
-isc_socket_cancel
-;isc_socket_shutdown
+isc_sockaddr_v6fromin
+isc_socket_accept
isc_socket_attach
-isc_socket_detach
isc_socket_bind
-isc_socket_listen
-isc_socket_accept
+isc_socket_cancel
isc_socket_connect
+isc_socket_create
+isc_socket_detach
+isc_socket_filter
isc_socket_getpeername
isc_socket_getsockname
+isc_socket_gettype
+isc_socket_ipv6only
+isc_socket_isbound
+isc_socket_listen
isc_socket_recv
-isc_socket_recvv
isc_socket_recv2
+isc_socket_recvv
isc_socket_send
isc_socket_sendto
-isc_socket_sendv
-isc_socket_sendtov
isc_socket_sendto2
+isc_socket_sendtov
+isc_socket_sendv
isc_socketmgr_create
isc_socketmgr_destroy
-isc_socket_gettype
-isc_socket_isbound
-isc_stdio_open
isc_stdio_close
-isc_stdio_seek
-isc_stdio_read
-isc_stdio_write
isc_stdio_flush
+isc_stdio_open
+isc_stdio_read
+isc_stdio_seek
isc_stdio_sync
-isc_string_touint64
+isc_stdio_write
+isc_stdtime_get
isc_string_separate
+isc_string_strlcat
+isc_string_strlcpy
+isc_string_strlcpy
+isc_string_touint64
isc_symtab_create
+isc_symtab_define
isc_symtab_destroy
isc_symtab_lookup
-isc_symtab_define
isc_symtab_undefine
-isc_task_create
+isc_syslog_facilityfromstring
isc_task_attach
+isc_task_beginexclusive
+isc_task_create
+isc_task_destroy
isc_task_detach
-isc_task_send
-isc_task_sendanddetach
-isc_task_purgerange
+isc_task_endexclusive
+isc_task_endexclusive
+isc_task_getcurrenttime
+isc_task_getname
+isc_task_gettag
+isc_task_onshutdown
isc_task_purge
isc_task_purgeevent
-isc_task_unsendrange
-isc_task_unsend
-isc_task_onshutdown
-isc_task_shutdown
-isc_task_destroy
+isc_task_purgerange
+isc_task_send
+isc_task_sendanddetach
+isc_task_sendanddetach
isc_task_setname
-isc_task_getname
-isc_task_gettag
-isc_task_beginexclusive
-isc_task_endexclusive
-isc_task_endexclusive
+isc_task_shutdown
+isc_task_unsend
+isc_task_unsendrange
isc_taskmgr_create
isc_taskmgr_destroy
isc_taskpool_create
-isc_taskpool_gettask
isc_taskpool_destroy
-isc_timer_create
-isc_timer_reset
-isc_timer_touch
-isc_timer_attach
-isc_timer_detach
-isc_timermgr_create
-isc_timermgr_destroy
-isc_condition_init
-isc_condition_wait
-isc_condition_signal
-isc_condition_broadcast
-isc_condition_destroy
-isc_condition_waituntil
-isc_dir_init
-isc_dir_open
-isc_dir_read
-isc_dir_reset
-isc_dir_close
-isc_dir_chdir
-isc_dir_chroot
-isc_net_probeipv4
-isc_net_probeipv6
-isc_net_ntop
-isc_net_pton
-isc_net_aton
-isc_once_do
-isc_stdtime_get
-
+isc_taskpool_gettask
+isc_thread_create
isc_thread_create
isc_thread_join
+isc_thread_join
isc_thread_setconcurrency
-isc_interval_set
-isc_time_subtract
-isc_interval_iszero
-isc_time_settoepoch
+isc_thread_setconcurrency
+isc_time_add
+isc_time_compare
isc_time_isepoch
+isc_time_microdiff
+isc_time_nanoseconds
isc_time_now
isc_time_nowplusinterval
-isc_time_compare
-isc_time_add
+isc_time_settoepoch
isc_time_subtract
-isc_time_microdiff
-isc_time_nanoseconds
-isc_keyboard_open
-isc_keyboard_close
-isc_keyboard_getchar
-isc_keyboard_canceled
-isc_app_start
-isc_app_onrun
-isc_app_run
-isc_app_shutdown
-isc_app_reload
-isc_app_finish
-isc_app_block
-isc_app_unblock
-isc_thread_create
-isc_thread_join
-isc_thread_setconcurrency
-isc_net_probeipv4
-isc_net_probeipv6
-isc_net_ntop
-isc_net_pton
-isc_net_aton
-openlog
-syslog
-closelog
-isc_syslog_facilityfromstring
-NTReportError
-
-isc_file_truncate
-isc__strerror
-isc_parse_uint32
-isc_parse_uint16
-isc_parse_uint8
+isc_time_subtract
+isc_timer_attach
+isc_timer_create
+isc_timer_detach
+isc_timer_reset
+isc_timer_touch
+isc_timermgr_create
+isc_timermgr_destroy
isc_win32os_majorversion
isc_win32os_minorversion
isc_win32os_servicepackmajor
isc_win32os_servicepackminor
isc_win32os_versioncheck
-isc_socket_ipv6only
-isc_region_compare
-isc_socket_filter
-isc_string_strlcpy
-isc_rwlock_tryupgrade
-isc_rwlock_downgrade
-isc_sockaddr_isexperimental
-isc_net_disableipv4
-isc_net_disableipv6
-isc_task_getcurrenttime
-isc_net_probe_ipv6only
-isc_net_probe_ipv6pktinfo
-isc_string_strlcat
-isc_string_strlcpy
+openlog
+syslog
; Exported Data
diff --git a/lib/isc/win32/socket.c b/lib/isc/win32/socket.c
index 0743fb19..7f800ed1 100644
--- a/lib/isc/win32/socket.c
+++ b/lib/isc/win32/socket.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: socket.c,v 1.5.2.13.2.13 2004/09/01 04:32:18 marka Exp $ */
+/* $Id: socket.c,v 1.5.2.13.2.16 2005/09/01 03:16:12 marka Exp $ */
/* This code has been rewritten to take advantage of Windows Sockets
* I/O Completion Ports and Events. I/O Completion Ports is ONLY
@@ -98,8 +98,8 @@
* NOTE: This requires that Windows 2000 systems install Service Pack 2
* or later.
*/
-#ifndef SIO_UDP_CONNRESET
-#define SIO_UDP_CONNRESET _WSAIOW(IOC_VENDOR,12)
+#ifndef SIO_UDP_CONNRESET
+#define SIO_UDP_CONNRESET _WSAIOW(IOC_VENDOR,12)
#endif
/*
@@ -113,19 +113,26 @@
/*
* Define what the possible "soft" errors can be. These are non-fatal returns
* of various network related functions, like recv() and so on.
- *
- * For some reason, BSDI (and perhaps others) will sometimes return <0
- * from recv() but will have errno==0. This is broken, but we have to
- * work around it here.
*/
#define SOFT_ERROR(e) ((e) == WSAEINTR || \
- (e) == WSA_IO_PENDING || \
(e) == WSAEWOULDBLOCK || \
(e) == EWOULDBLOCK || \
(e) == EINTR || \
(e) == EAGAIN || \
(e) == 0)
+/*
+ * Pending errors are not really errors and should be
+ * kept separate
+ */
+#define PENDING_ERROR(e) ((e) == WSA_IO_PENDING || (e) == 0)
+
+#define DOIO_SUCCESS 0 /* i/o ok, event sent */
+#define DOIO_SOFT 1 /* i/o ok, soft error, no event sent */
+#define DOIO_HARD 2 /* i/o error, event sent */
+#define DOIO_EOF 3 /* EOF, no event sent */
+#define DOIO_PENDING 4 /* status when i/o is in process */
+
#define DLVL(x) ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_DEBUG(x)
/*
@@ -164,14 +171,8 @@ typedef isc_event_t intev_t;
#endif
/*
- * NetBSD and FreeBSD can timestamp packets. XXXMLG Should we have
- * a setsockopt() like interface to request timestamps, and if the OS
- * doesn't do it for us, call gettimeofday() on every UDP receive?
- */
-
-/*
* We really don't want to try and use these control messages. Win32
- * doesn't have this mechanism
+ * doesn't have this mechanism before XP.
*/
#undef USE_CMSG
@@ -182,17 +183,19 @@ typedef isc_event_t intev_t;
struct msghdr {
- void *msg_name; /* optional address */
- u_int msg_namelen; /* size of address */
- WSABUF *msg_iov; /* scatter/gather array */
- u_int msg_iovlen; /* # elements in msg_iov */
- void *msg_control; /* ancillary data, see below */
- u_int msg_controllen; /* ancillary data buffer len */
- int msg_flags; /* flags on received message */
+ void *msg_name; /* optional address */
+ u_int msg_namelen; /* size of address */
+ WSABUF *msg_iov; /* scatter/gather array */
+ u_int msg_iovlen; /* # elements in msg_iov */
+ void *msg_control; /* ancillary data, see below */
+ u_int msg_controllen; /* ancillary data buffer len */
+ int msg_flags; /* flags on received message */
+ int msg_totallen; /* total length of this message */
} msghdr;
-
+
/*
- * The number of times a send operation is repeated if the result is EINTR.
+ * The number of times a send operation is repeated if the result
+ * is WSAEINTR.
*/
#define NRETRIES 10
@@ -205,13 +208,11 @@ struct isc_socket {
OVERLAPPED overlapped;
/* Pointers to scatter/gather buffers */
WSABUF iov[ISC_SOCKET_MAXSCATTERGATHER];
- size_t totalBytes;
WSAEVENT hEvent; /* Event Handle */
long wait_type; /* Events to wait on */
WSAEVENT hAlert; /* Alert Event Handle */
DWORD evthread_id; /* Event Thread Id for socket */
-
/* Locked by socket lock. */
ISC_LINK(isc_socket_t) link;
unsigned int references;
@@ -282,7 +283,7 @@ struct event_change {
/*
* Note: We are using an array here since *WaitForMultiple* wants an array
- * WARNING: This value may not be greater than 64 since the
+ * WARNING: This value may not be greater than 64 since the
* WSAWaitForMultipleEvents function is limited to 64 events.
*/
@@ -333,10 +334,6 @@ struct isc_socketmgr {
DWORD dwIOCPThreadIds[MAX_IOCPTHREADS];
};
-#define CLOSED 0 /* this one must be zero */
-#define MANAGED 1
-#define CLOSE_PENDING 2
-
/*
* send() and recv() iovec counts
*/
@@ -497,13 +494,13 @@ iocompletionport_init(isc_socketmgr_t *manager) {
strbuf);
exit(1);
}
-
+
/*
* Worker threads for servicing the I/O
*/
iocompletionport_createthreads(manager->maxIOCPThreads, manager);
}
-
+
void
iocompletionport_exit(isc_socketmgr_t *manager) {
@@ -787,7 +784,7 @@ notify_eventlist(isc_socket_t *sock, isc_socketmgr_t *manager,
REQUIRE(VALID_MANAGER(manager));
REQUIRE(sock != NULL);
-
+
evchange = HeapAlloc(hHeapHandle, HEAP_ZERO_MEMORY,
sizeof(event_change_t));
evchange->sock = sock;
@@ -824,7 +821,7 @@ socket_event_add(isc_socket_t *sock, long type) {
if (hEvent == WSA_INVALID_EVENT) {
stat = WSAGetLastError();
isc__strerror(stat, strbuf, sizeof(strbuf));
- msg = isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ msg = isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
ISC_MSG_FAILED, "failed"),
UNEXPECTED_ERROR(__FILE__, __LINE__, "WSACreateEvent: %s: %s",
msg, strbuf);
@@ -833,7 +830,7 @@ socket_event_add(isc_socket_t *sock, long type) {
if (WSAEventSelect(sock->fd, hEvent, type) != 0) {
stat = WSAGetLastError();
isc__strerror(stat, strbuf, sizeof(strbuf));
- msg = isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ msg = isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
ISC_MSG_FAILED, "failed");
UNEXPECTED_ERROR(__FILE__, __LINE__, "WSAEventSelect: %s: %s",
msg, strbuf);
@@ -899,7 +896,7 @@ BOOL InitSockets() {
/* Need Winsock 2.0 or better */
wVersionRequested = MAKEWORD(2, 0);
-
+
err = WSAStartup(wVersionRequested, &wsaData);
if ( err != 0 ) {
/* Tell the user that we could not find a usable Winsock DLL */
@@ -918,24 +915,20 @@ internal_sendmsg(isc_socket_t *sock, IoCompletionInfo *lpo,
int total_sent;
*Error = 0;
- Result = WSASendTo((SOCKET) sock->fd,
- messagehdr->msg_iov,
- messagehdr->msg_iovlen,
- &BytesSent,
- Flags,
- messagehdr->msg_name,
- messagehdr->msg_namelen,
- (LPOVERLAPPED) lpo,
- NULL);
+ Result = WSASendTo((SOCKET) sock->fd, messagehdr->msg_iov,
+ messagehdr->msg_iovlen, &BytesSent,
+ Flags, messagehdr->msg_name,
+ messagehdr->msg_namelen, (LPOVERLAPPED) lpo,
+ NULL);
total_sent = (int) BytesSent;
-
+
/* Check for errors.*/
if (Result == SOCKET_ERROR) {
*Error = WSAGetLastError();
-
- switch (*Error) {
+
+ switch (*Error) {
case WSA_IO_INCOMPLETE :
case WSA_WAIT_IO_COMPLETION :
case WSA_IO_PENDING :
@@ -981,8 +974,8 @@ internal_recvmsg(isc_socket_t *sock, IoCompletionInfo *lpo,
if (Result == SOCKET_ERROR) {
*Error = WSAGetLastError();
-
- switch (*Error) {
+
+ switch (*Error) {
case WSA_IO_INCOMPLETE:
case WSA_WAIT_IO_COMPLETION:
case WSA_IO_PENDING:
@@ -1003,7 +996,7 @@ internal_recvmsg(isc_socket_t *sock, IoCompletionInfo *lpo,
return (-1);
else
return (total_bytes);
-}
+}
static void
manager_log(isc_socketmgr_t *sockmgr, isc_logcategory_t *category,
@@ -1124,14 +1117,10 @@ connection_reset_fix(SOCKET fd) {
*
* Nothing can be NULL, and the done event must list at least one buffer
* on the buffer linked list for this function to be meaningful.
- *
- * If write_countp != NULL, *write_countp will hold the number of bytes
- * this transaction can send.
*/
static void
build_msghdr_send(isc_socket_t *sock, isc_socketevent_t *dev,
- struct msghdr *msg, char *cmsg,
- WSABUF *iov, size_t *write_countp)
+ struct msghdr *msg, char *cmsg, WSABUF *iov)
{
unsigned int iovcount;
isc_buffer_t *buffer;
@@ -1199,9 +1188,7 @@ build_msghdr_send(isc_socket_t *sock, isc_socketevent_t *dev,
config:
msg->msg_iov = iov;
msg->msg_iovlen = iovcount;
-
- if (write_countp != NULL)
- *write_countp = write_count;
+ msg->msg_totallen = write_count;
}
/*
@@ -1212,14 +1199,10 @@ build_msghdr_send(isc_socket_t *sock, isc_socketevent_t *dev,
*
* Nothing can be NULL, and the done event must list at least one buffer
* on the buffer linked list for this function to be meaningful.
- *
- * If read_countp != NULL, *read_countp will hold the number of bytes
- * this transaction can receive.
*/
static void
build_msghdr_recv(isc_socket_t *sock, isc_socketevent_t *dev,
- struct msghdr *msg, char *cmsg,
- WSABUF *iov, size_t *read_countp)
+ struct msghdr *msg, char *cmsg, WSABUF *iov)
{
unsigned int iovcount;
isc_buffer_t *buffer;
@@ -1285,9 +1268,7 @@ build_msghdr_recv(isc_socket_t *sock, isc_socketevent_t *dev,
msg->msg_iov = iov;
msg->msg_iovlen = iovcount;
-
- if (read_countp != NULL)
- *read_countp = read_count;
+ msg->msg_totallen = read_count;
}
static void
@@ -1344,11 +1325,6 @@ dump_msg(struct msghdr *msg, isc_socket_t *sock) {
}
#endif
-#define DOIO_SUCCESS 0 /* i/o ok, event sent */
-#define DOIO_SOFT 1 /* i/o ok, soft error, no event sent */
-#define DOIO_HARD 2 /* i/o error, event sent */
-#define DOIO_EOF 3 /* EOF, no event sent */
-
static int
completeio_recv(isc_socket_t *sock, isc_socketevent_t *dev,
struct msghdr *messagehdr, int cc, int recv_errno)
@@ -1385,9 +1361,11 @@ completeio_recv(isc_socket_t *sock, isc_socketevent_t *dev,
SOFT_OR_HARD(WSAEDISCON, ISC_R_CONNECTIONRESET);
SOFT_OR_HARD(WSAENETDOWN, ISC_R_NETDOWN);
ALWAYS_HARD(ERROR_OPERATION_ABORTED, ISC_R_CONNECTIONRESET);
+ ALWAYS_HARD(ERROR_NETNAME_DELETED, ISC_R_CONNECTIONRESET);
ALWAYS_HARD(ERROR_PORT_UNREACHABLE, ISC_R_HOSTUNREACH);
ALWAYS_HARD(ERROR_HOST_UNREACHABLE, ISC_R_HOSTUNREACH);
ALWAYS_HARD(ERROR_NETWORK_UNREACHABLE, ISC_R_NETUNREACH);
+ ALWAYS_HARD(ERROR_NETNAME_DELETED, ISC_R_NETUNREACH);
ALWAYS_HARD(WSAENOBUFS, ISC_R_NORESOURCES);
#undef SOFT_OR_HARD
@@ -1411,7 +1389,7 @@ completeio_recv(isc_socket_t *sock, isc_socketevent_t *dev,
if (isc_log_wouldlog(isc_lctx, IOEVENT_LEVEL)) {
socket_log(sock, &dev->address, IOEVENT,
isc_msgcat, ISC_MSGSET_SOCKET,
- ISC_MSG_ZEROPORT,
+ ISC_MSG_ZEROPORT,
"dropping source port zero packet");
}
return (DOIO_SOFT);
@@ -1461,7 +1439,7 @@ completeio_recv(isc_socket_t *sock, isc_socketevent_t *dev,
* If we read less than we expected, update counters,
* and let the upper layer handle it.
*/
- if (((size_t)cc != sock->totalBytes) && (dev->n < dev->minimum))
+ if ((cc != messagehdr->msg_totallen) && (dev->n < dev->minimum))
return (DOIO_SOFT);
/*
@@ -1489,8 +1467,7 @@ startio_recv(isc_socket_t *sock, isc_socketevent_t *dev, int *nbytes,
msghdr = &lpo->messagehdr;
memset(msghdr, 0, sizeof(struct msghdr));
- build_msghdr_recv(sock, dev, msghdr, cmsg, sock->iov,
- &(sock->totalBytes));
+ build_msghdr_recv(sock, dev, msghdr, cmsg, sock->iov);
#if defined(ISC_SOCKET_DEBUG)
dump_msg(msghdr, sock);
@@ -1499,22 +1476,32 @@ startio_recv(isc_socket_t *sock, isc_socketevent_t *dev, int *nbytes,
*nbytes = internal_recvmsg(sock, lpo, msghdr, 0, recv_errno);
if (*nbytes < 0) {
+ /*
+ * I/O has been initiated
+ * return will be via the completion port
+ */
+ if (PENDING_ERROR(*recv_errno)) {
+ status = DOIO_PENDING;
+ goto done;
+ }
if (SOFT_ERROR(*recv_errno)) {
status = DOIO_SOFT;
goto done;
}
+ /*
+ * If we got this far something is wrong
+ */
if (isc_log_wouldlog(isc_lctx, IOEVENT_LEVEL)) {
isc__strerror(*recv_errno, strbuf, sizeof(strbuf));
socket_log(sock, NULL, IOEVENT,
isc_msgcat, ISC_MSGSET_SOCKET,
- ISC_MSG_DOIORECV,
+ ISC_MSG_DOIORECV,
"startio_recv: recvmsg(%d) %d bytes, "
"err %d/%s",
sock->fd, *nbytes, *recv_errno, strbuf);
}
- status = completeio_recv(sock, dev, msghdr,
- *nbytes, *recv_errno);
+ status = DOIO_HARD;
goto done;
}
dev->result = ISC_R_SUCCESS;
@@ -1545,6 +1532,7 @@ completeio_send(isc_socket_t *sock, isc_socketevent_t *dev,
if(send_errno != 0) {
+
if (SOFT_ERROR(send_errno))
return (DOIO_SOFT);
@@ -1572,6 +1560,7 @@ completeio_send(isc_socket_t *sock, isc_socketevent_t *dev,
SOFT_OR_HARD(WSAEDISCON, ISC_R_CONNECTIONRESET);
SOFT_OR_HARD(WSAENETDOWN, ISC_R_NETDOWN);
ALWAYS_HARD(ERROR_OPERATION_ABORTED, ISC_R_CONNECTIONRESET);
+ ALWAYS_HARD(ERROR_NETNAME_DELETED, ISC_R_CONNECTIONRESET);
ALWAYS_HARD(ERROR_PORT_UNREACHABLE, ISC_R_HOSTUNREACH);
ALWAYS_HARD(ERROR_HOST_UNREACHABLE, ISC_R_HOSTUNREACH);
ALWAYS_HARD(ERROR_NETWORK_UNREACHABLE, ISC_R_NETUNREACH);
@@ -1607,7 +1596,7 @@ completeio_send(isc_socket_t *sock, isc_socketevent_t *dev,
* If we write less than we expected, update counters, poke.
*/
dev->n += cc;
- if ((size_t)cc != sock->totalBytes)
+ if (cc != messagehdr->msg_totallen)
return (DOIO_SOFT);
/*
@@ -1636,28 +1625,38 @@ startio_send(isc_socket_t *sock, isc_socketevent_t *dev, int *nbytes,
msghdr = &lpo->messagehdr;
memset(msghdr, 0, sizeof(struct msghdr));
- build_msghdr_send(sock, dev, msghdr, cmsg, sock->iov,
- &(sock->totalBytes));
+ build_msghdr_send(sock, dev, msghdr, cmsg, sock->iov);
*nbytes = internal_sendmsg(sock, lpo, msghdr, 0, send_errno);
+
if (*nbytes < 0) {
+ /*
+ * I/O has been initiated
+ * completion will be through the completion port
+ */
+ if (PENDING_ERROR(*send_errno)) {
+ status = DOIO_PENDING;
+ goto done;
+ }
+
if (SOFT_ERROR(*send_errno)) {
status = DOIO_SOFT;
goto done;
}
+ /*
+ * If we got this far then something is wrong
+ */
if (isc_log_wouldlog(isc_lctx, IOEVENT_LEVEL)) {
isc__strerror(*send_errno, strbuf, sizeof(strbuf));
socket_log(sock, NULL, IOEVENT,
isc_msgcat, ISC_MSGSET_SOCKET,
- ISC_MSG_INTERNALSEND,
+ ISC_MSG_INTERNALSEND,
"startio_send: internal_sendmsg(%d) %d "
"bytes, err %d/%s",
sock->fd, *nbytes, *send_errno, strbuf);
}
- status = completeio_send(sock, dev, msghdr,
- *nbytes, *send_errno);
goto done;
}
dev->result = ISC_R_SUCCESS;
@@ -1859,7 +1858,7 @@ isc_socket_create(isc_socketmgr_t *manager, int pf, isc_sockettype_t type,
sock->fd = socket(pf, SOCK_STREAM, IPPROTO_TCP);
break;
}
-
+
if (sock->fd == INVALID_SOCKET) {
socket_errno = WSAGetLastError();
free_socket(&sock);
@@ -1929,7 +1928,7 @@ isc_socket_create(isc_socketmgr_t *manager, int pf, isc_sockettype_t type,
strbuf);
}
#endif /* IPV6_RECVPKTINFO */
-#ifdef IPV6_USE_MIN_MTU /*2292bis, not too common yet*/
+#ifdef IPV6_USE_MIN_MTU /*2292bis, not too common yet*/
/* use minimum MTU */
if (pf == AF_INET6) {
(void)setsockopt(sock->fd, IPPROTO_IPV6,
@@ -2117,7 +2116,7 @@ internal_accept(isc_socket_t *sock, int accept_errno) {
UNLOCK(&sock->lock);
return;
}
-
+
/*
* Get the first item off the accept list.
* If it is empty, unlock the socket and return.
@@ -2146,7 +2145,7 @@ internal_accept(isc_socket_t *sock, int accept_errno) {
/*
* Try to accept the new connection. If the accept fails with
- * EAGAIN or EINTR, the event wait will be notified again since
+ * WSAEINTR, the event wait will be notified again since
* the event will be reset on return to caller.
*/
addrlen = sizeof(dev->newsocket->address.type);
@@ -2184,7 +2183,7 @@ internal_accept(isc_socket_t *sock, int accept_errno) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"internal_accept(): "
"accept() returned peer address "
- "family %u (expected %u)",
+ "family %u (expected %u)",
dev->newsocket->address.
type.sa.sa_family,
sock->pf);
@@ -2212,7 +2211,7 @@ internal_accept(isc_socket_t *sock, int accept_errno) {
const char *msg;
stat = WSAGetLastError();
isc__strerror(stat, strbuf, sizeof(strbuf));
- msg = isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ msg = isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
ISC_MSG_FAILED, "failed");
UNEXPECTED_ERROR(__FILE__, __LINE__, "WSAEventSelect: %s: %s",
msg, strbuf);
@@ -2252,7 +2251,7 @@ internal_accept(isc_socket_t *sock, int accept_errno) {
const char *msg;
stat = WSAGetLastError();
isc__strerror(stat, strbuf, sizeof(strbuf));
- msg = isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ msg = isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
ISC_MSG_FAILED, "failed");
UNEXPECTED_ERROR(__FILE__, __LINE__,
"WSAEventSelect: %s: %s", msg, strbuf);
@@ -2320,7 +2319,7 @@ internal_connect(isc_socket_t *sock, int connect_errno) {
*/
if (connect_errno != 0) {
/*
- * If the error is EAGAIN, just try again on this
+ * If the error is SOFT, just try again on this
* fd and pretend nothing strange happened.
*/
if (SOFT_ERROR(connect_errno) ||
@@ -2431,8 +2430,6 @@ internal_send(isc_socket_t *sock, isc_socketevent_t *dev,
struct msghdr *messagehdr, int nbytes, int send_errno)
{
isc_socketevent_t *ldev;
- int io_state;
- int cc;
/*
* Find out what socket this is and lock it.
@@ -2460,11 +2457,7 @@ internal_send(isc_socket_t *sock, isc_socketevent_t *dev,
*/
switch (completeio_send(sock, dev, messagehdr, nbytes, send_errno)) {
case DOIO_SOFT:
- cc = 0;
- send_errno = 0;
- io_state = startio_send(sock, dev, &cc, &send_errno);
- goto done;
-
+ break;
case DOIO_HARD:
case DOIO_SUCCESS:
send_senddone_event(sock, &dev);
@@ -2517,12 +2510,10 @@ SocketIoThread(LPVOID ThreadContext) {
* Loop forever waiting on I/O Completions and then processing them
*/
while (TRUE) {
- bSuccess = GetQueuedCompletionStatus (
- manager->hIoCompletionPort,
- &nbytes,
- (LPDWORD) &sock,
- (LPOVERLAPPED *)&lpo,
- INFINITE);
+ bSuccess = GetQueuedCompletionStatus(manager->hIoCompletionPort,
+ &nbytes, (LPDWORD) &sock,
+ (LPOVERLAPPED *)&lpo,
+ INFINITE);
if (lpo == NULL) {
/*
* Received request to exit
@@ -2536,7 +2527,7 @@ SocketIoThread(LPVOID ThreadContext) {
/*
* Was this the socket closed under us?
*/
- errstatus = WSAGetLastError();
+ errstatus = GetLastError();
if (nbytes == 0 && errstatus == WSA_OPERATION_ABORTED) {
LOCK(&sock->lock);
switch (lpo->request_type) {
@@ -2633,7 +2624,7 @@ event_wait(void *uap) {
if (cc == WSA_WAIT_FAILED) {
event_errno = WSAGetLastError();
if (!SOFT_ERROR(event_errno)) {
- isc__strerror(event_errno, strbuf,
+ isc__strerror(event_errno, strbuf,
sizeof(strbuf));
FATAL_ERROR(__FILE__, __LINE__,
"WSAWaitForMultipleEvents() %s: %s",
@@ -2891,6 +2882,7 @@ socket_recv(isc_socket_t *sock, isc_socketevent_t *dev, isc_task_t *task,
io_state = startio_recv(sock, dev, &cc, &recv_errno);
switch (io_state) {
+ case DOIO_PENDING: /* I/O Started. Nothing to be done */
case DOIO_SOFT:
/*
* We couldn't read all or part of the request right now, so
@@ -3069,31 +3061,33 @@ socket_send(isc_socket_t *sock, isc_socketevent_t *dev, isc_task_t *task,
io_state = startio_send(sock, dev, &cc, &send_errno);
switch (io_state) {
+ case DOIO_PENDING: /* I/O started. Nothing more to do */
case DOIO_SOFT:
/*
* We couldn't send all or part of the request right now, so
* queue it unless ISC_SOCKFLAG_NORETRY is set.
*/
- isc_task_attach(task, &ntask);
- dev->attributes |= ISC_SOCKEVENTATTR_ATTACHED;
-
- if (!have_lock) {
- LOCK(&sock->lock);
- have_lock = ISC_TRUE;
- }
+ if ((flags & ISC_SOCKFLAG_NORETRY) == 0) {
+ isc_task_attach(task, &ntask);
+ dev->attributes |= ISC_SOCKEVENTATTR_ATTACHED;
+ if (!have_lock) {
+ LOCK(&sock->lock);
+ have_lock = ISC_TRUE;
+ }
- /*
- * Enqueue the request.
- */
- ISC_LIST_ENQUEUE(sock->send_list, dev, ev_link);
+ /*
+ * Enqueue the request.
+ */
+ ISC_LIST_ENQUEUE(sock->send_list, dev, ev_link);
- socket_log(sock, NULL, EVENT, NULL, 0, 0,
- "socket_send: event %p -> task %p",
- dev, ntask);
+ socket_log(sock, NULL, EVENT, NULL, 0, 0,
+ "socket_send: event %p -> task %p",
+ dev, ntask);
- if ((flags & ISC_SOCKFLAG_IMMEDIATE) != 0)
- result = ISC_R_INPROGRESS;
- break;
+ if ((flags & ISC_SOCKFLAG_IMMEDIATE) != 0)
+ result = ISC_R_INPROGRESS;
+ break;
+ }
case DOIO_SUCCESS:
break;
@@ -3267,10 +3261,10 @@ isc_socket_bind(isc_socket_t *sock, isc_sockaddr_t *sockaddr) {
isc_result_t
isc_socket_filter(isc_socket_t *sock, const char *filter) {
- UNUSED(sock);
- UNUSED(filter);
+ UNUSED(sock);
+ UNUSED(filter);
- REQUIRE(VALID_SOCKET(sock));
+ REQUIRE(VALID_SOCKET(sock));
return (ISC_R_NOTIMPLEMENTED);
}
@@ -3324,7 +3318,6 @@ isc_socket_listen(isc_socket_t *sock, unsigned int backlog) {
return (retstat);
}
-
UNLOCK(&sock->lock);
return (ISC_R_SUCCESS);
}
@@ -3390,7 +3383,7 @@ isc_socket_accept(isc_socket_t *sock,
const char *msg;
stat = WSAGetLastError();
isc__strerror(stat, strbuf, sizeof(strbuf));
- msg = isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ msg = isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
ISC_MSG_FAILED, "failed");
UNEXPECTED_ERROR(__FILE__, __LINE__, "WSAEventSelect: %s: %s",
msg, strbuf);
@@ -3691,7 +3684,7 @@ isc_socket_cancel(isc_socket_t *sock, isc_task_t *task, unsigned int how) {
const char *msg;
stat = WSAGetLastError();
isc__strerror(stat, strbuf, sizeof(strbuf));
- msg = isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ msg = isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
ISC_MSG_FAILED, "failed");
UNEXPECTED_ERROR(__FILE__, __LINE__,
"WSAEventSelect: %s: %s", msg, strbuf);
diff --git a/lib/isccfg/api b/lib/isccfg/api
index 7e9f0b65..59ed93b0 100644
--- a/lib/isccfg/api
+++ b/lib/isccfg/api
@@ -1,3 +1,3 @@
LIBINTERFACE = 1
-LIBREVISION = 5
+LIBREVISION = 6
LIBAGE = 0
diff --git a/lib/isccfg/namedconf.c b/lib/isccfg/namedconf.c
index 3321bd6d..254b0d63 100644
--- a/lib/isccfg/namedconf.c
+++ b/lib/isccfg/namedconf.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2002, 2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: namedconf.c,v 1.21.44.29 2004/10/17 23:19:51 marka Exp $ */
+/* $Id: namedconf.c,v 1.21.44.31 2005/05/13 01:22:36 marka Exp $ */
#include <config.h>
@@ -619,6 +619,7 @@ options_clauses[] = {
{ "use-id-pool", &cfg_type_boolean, CFG_CLAUSEFLAG_OBSOLETE },
{ "use-ixfr", &cfg_type_boolean, 0 },
{ "version", &cfg_type_qstringornone, 0 },
+ { "flush-zones-on-shutdown", &cfg_type_boolean, 0 },
{ NULL, NULL, 0 }
};
diff --git a/lib/lwres/Makefile.in b/lib/lwres/Makefile.in
index 548c5d51..024b9884 100644
--- a/lib/lwres/Makefile.in
+++ b/lib/lwres/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 2000, 2001 Internet Software Consortium.
#
# Permission to use, copy, modify, and distribute this software for any
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.25.12.6 2004/08/28 06:25:23 marka Exp $
+# $Id: Makefile.in,v 1.25.12.8 2005/06/09 23:54:32 marka Exp $
srcdir = @srcdir@
VPATH = @srcdir@
@@ -35,14 +35,16 @@ OBJS = context.@O@ gai_strerror.@O@ getaddrinfo.@O@ gethost.@O@ \
getipnode.@O@ getnameinfo.@O@ getrrset.@O@ herror.@O@ \
lwbuffer.@O@ lwconfig.@O@ lwpacket.@O@ lwresutil.@O@ \
lwres_gabn.@O@ lwres_gnba.@O@ lwres_grbn.@O@ lwres_noop.@O@ \
- lwinetaton.@O@ lwinetpton.@O@ lwinetntop.@O@ print.@O@
+ lwinetaton.@O@ lwinetpton.@O@ lwinetntop.@O@ print.@O@ \
+ strtoul.@O@
# Alphabetically
SRCS = context.c gai_strerror.c getaddrinfo.c gethost.c \
getipnode.c getnameinfo.c getrrset.c herror.c \
lwbuffer.c lwconfig.c lwpacket.c lwresutil.c \
lwres_gabn.c lwres_gnba.c lwres_grbn.c lwres_noop.c \
- lwinetaton.c lwinetpton.c lwinetntop.c print.c
+ lwinetaton.c lwinetpton.c lwinetntop.c print.c \
+ strtoul.c
LIBS = @LIBS@
diff --git a/lib/lwres/api b/lib/lwres/api
index 01be8733..75a50276 100644
--- a/lib/lwres/api
+++ b/lib/lwres/api
@@ -1,3 +1,3 @@
-LIBINTERFACE = 3
-LIBREVISION = 2
-LIBAGE = 2
+LIBINTERFACE = 10
+LIBREVISION = 0
+LIBAGE = 1
diff --git a/lib/lwres/getaddrinfo.c b/lib/lwres/getaddrinfo.c
index 86f48aa9..c0632744 100644
--- a/lib/lwres/getaddrinfo.c
+++ b/lib/lwres/getaddrinfo.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2001 Internet Software Consortium.
*
* This code is derived from software contributed to ISC by
@@ -18,17 +18,17 @@
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: getaddrinfo.c,v 1.41.206.1 2004/03/06 08:15:30 marka Exp $ */
+/* $Id: getaddrinfo.c,v 1.41.206.3 2005/06/09 23:54:33 marka Exp $ */
#include <config.h>
#include <string.h>
#include <errno.h>
-#include <stdlib.h>
#include <lwres/lwres.h>
#include <lwres/net.h>
#include <lwres/netdb.h>
+#include <lwres/stdlib.h>
#define SA(addr) ((struct sockaddr *)(addr))
#define SIN(addr) ((struct sockaddr_in *)(addr))
diff --git a/lib/lwres/getipnode.c b/lib/lwres/getipnode.c
index 5bda15e6..9b1a07bd 100644
--- a/lib/lwres/getipnode.c
+++ b/lib/lwres/getipnode.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: getipnode.c,v 1.30.2.4.2.4 2004/03/06 08:15:31 marka Exp $ */
+/* $Id: getipnode.c,v 1.30.2.4.2.6 2005/04/29 00:03:32 marka Exp $ */
#include <config.h>
@@ -331,6 +331,8 @@ lwres_getipnodebyaddr(const void *src, size_t len, int af, int *error_num) {
n = lwres_getnamebyaddr(lwrctx, LWRES_ADDRTYPE_V6, IN6ADDRSZ,
src, &by);
if (n != 0) {
+ lwres_conf_clear(lwrctx);
+ lwres_context_destroy(&lwrctx);
*error_num = HOST_NOT_FOUND;
return (NULL);
}
@@ -338,6 +340,7 @@ lwres_getipnodebyaddr(const void *src, size_t len, int af, int *error_num) {
lwres_gnbaresponse_free(lwrctx, &by);
if (he1 == NULL)
*error_num = NO_RECOVERY;
+ lwres_conf_clear(lwrctx);
lwres_context_destroy(&lwrctx);
return (he1);
}
diff --git a/lib/lwres/include/lwres/platform.h.in b/lib/lwres/include/lwres/platform.h.in
index 9c6502b5..e995aa46 100644
--- a/lib/lwres/include/lwres/platform.h.in
+++ b/lib/lwres/include/lwres/platform.h.in
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000, 2001 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: platform.h.in,v 1.12.2.1.10.2 2004/08/28 06:25:26 marka Exp $ */
+/* $Id: platform.h.in,v 1.12.2.1.10.5 2005/06/08 02:08:32 marka Exp $ */
#ifndef LWRES_PLATFORM_H
#define LWRES_PLATFORM_H 1
@@ -88,6 +88,16 @@
*/
@LWRES_PLATFORM_NEEDSPRINTF@
+/*
+ * The printf format string modifier to use with lwres_uint64_t values.
+ */
+@LWRES_PLATFORM_QUADFORMAT@
+
+/*! \brief
+ * Define if this system needs strtoul.
+ */
+@LWRES_PLATFORM_NEEDSTRTOUL@
+
#ifndef LWRES_PLATFORM_USEDECLSPEC
#define LIBLWRES_EXTERNAL_DATA
#else
diff --git a/lib/lwres/include/lwres/stdlib.h b/lib/lwres/include/lwres/stdlib.h
new file mode 100644
index 00000000..f5d4db28
--- /dev/null
+++ b/lib/lwres/include/lwres/stdlib.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 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: stdlib.h,v 1.2.4.1 2005/06/08 02:08:32 marka Exp $ */
+
+#ifndef LWRES_STDLIB_H
+#define LWRES_STDLIB_H 1
+
+/*! \file */
+
+#include <stdlib.h>
+
+#include <lwres/lang.h>
+#include <lwres/platform.h>
+
+#ifdef LWRES_PLATFORM_NEEDSTRTOUL
+#define strtoul lwres_strtoul
+#endif
+
+LWRES_LANG_BEGINDECLS
+
+unsigned long lwres_strtoul(const char *, char **, int);
+
+LWRES_LANG_ENDDECLS
+
+#endif
diff --git a/lib/lwres/lwconfig.c b/lib/lwres/lwconfig.c
index 9fc78250..7fc2c5d0 100644
--- a/lib/lwres/lwconfig.c
+++ b/lib/lwres/lwconfig.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lwconfig.c,v 1.33.2.1.2.5 2004/03/08 09:05:10 marka Exp $ */
+/* $Id: lwconfig.c,v 1.33.2.1.2.8 2005/06/08 02:35:21 marka Exp $ */
/***
*** Module for parsing resolv.conf files.
@@ -277,6 +277,7 @@ lwres_conf_parsenameserver(lwres_context_t *ctx, FILE *fp) {
char word[LWRES_CONFMAXLINELEN];
int res;
lwres_conf_t *confdata;
+ lwres_addr_t address;
confdata = &ctx->confdata;
@@ -292,10 +293,9 @@ lwres_conf_parsenameserver(lwres_context_t *ctx, FILE *fp) {
if (res != EOF && res != '\n')
return (LWRES_R_FAILURE); /* Extra junk on line. */
- res = lwres_create_addr(word,
- &confdata->nameservers[confdata->nsnext++], 1);
- if (res != LWRES_R_SUCCESS)
- return (res);
+ res = lwres_create_addr(word, &address, 1);
+ if (res == LWRES_R_SUCCESS)
+ confdata->nameservers[confdata->nsnext++] = address;
return (LWRES_R_SUCCESS);
}
diff --git a/lib/lwres/lwinetpton.c b/lib/lwres/lwinetpton.c
index 280b077c..e24334b1 100644
--- a/lib/lwres/lwinetpton.c
+++ b/lib/lwres/lwinetpton.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1996-2001 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -16,7 +16,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$Id: lwinetpton.c,v 1.6.206.1 2004/03/06 08:15:32 marka Exp $";
+static char rcsid[] = "$Id: lwinetpton.c,v 1.6.206.3 2005/03/31 23:56:15 marka Exp $";
#endif /* LIBC_SCCS and not lint */
#include <config.h>
@@ -129,7 +129,7 @@ inet_pton6(const char *src, unsigned char *dst) {
xdigits_u[] = "0123456789ABCDEF";
unsigned char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp;
const char *xdigits, *curtok;
- int ch, saw_xdigit;
+ int ch, seen_xdigits;
unsigned int val;
memset((tp = tmp), '\0', NS_IN6ADDRSZ);
@@ -140,7 +140,7 @@ inet_pton6(const char *src, unsigned char *dst) {
if (*++src != ':')
return (0);
curtok = src;
- saw_xdigit = 0;
+ seen_xdigits = 0;
val = 0;
while ((ch = *src++) != '\0') {
const char *pch;
@@ -150,14 +150,13 @@ inet_pton6(const char *src, unsigned char *dst) {
if (pch != NULL) {
val <<= 4;
val |= (pch - xdigits);
- if (val > 0xffff)
+ if (++seen_xdigits > 4)
return (0);
- saw_xdigit = 1;
continue;
}
if (ch == ':') {
curtok = src;
- if (!saw_xdigit) {
+ if (!seen_xdigits) {
if (colonp)
return (0);
colonp = tp;
@@ -167,19 +166,19 @@ inet_pton6(const char *src, unsigned char *dst) {
return (0);
*tp++ = (unsigned char) (val >> 8) & 0xff;
*tp++ = (unsigned char) val & 0xff;
- saw_xdigit = 0;
+ seen_xdigits = 0;
val = 0;
continue;
}
if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) &&
inet_pton4(curtok, tp) > 0) {
tp += NS_INADDRSZ;
- saw_xdigit = 0;
+ seen_xdigits = 0;
break; /* '\0' was seen by inet_pton4(). */
}
return (0);
}
- if (saw_xdigit) {
+ if (seen_xdigits) {
if (tp + NS_INT16SZ > endp)
return (0);
*tp++ = (unsigned char) (val >> 8) & 0xff;
diff --git a/lib/lwres/man/lwres.3 b/lib/lwres/man/lwres.3
index ad125d26..fd8542a5 100644
--- a/lib/lwres/man/lwres.3
+++ b/lib/lwres/man/lwres.3
@@ -1,159 +1,97 @@
-.\" Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
-.\" Copyright (C) 2000, 2001 Internet Software Consortium.
-.\"
+.\" Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+.\" Copyright (C) 2000, 2001 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,
+.\" 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: lwres.3,v 1.15.206.1 2004/03/06 07:41:42 marka Exp $
+.\" $Id: lwres.3,v 1.15.206.4 2005/09/12 00:47:30 marka Exp $
.\"
-.TH "LWRES" "3" "Jun 30, 2000" "BIND9" ""
+.hy 0
+.ad l
+.\"Generated by db2man.xsl. Don't modify this, modify the source.
+.de Sh \" Subsection
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Ip \" List item
+.br
+.ie \\n(.$>=3 .ne \\$3
+.el .ne 3
+.IP "\\$1" \\$2
+..
+.TH "LWRES" 3 "Jun 30, 2000" "" ""
.SH NAME
lwres \- introduction to the lightweight resolver library
-.SH SYNOPSIS
-\fB#include <lwres/lwres.h>\fR
+.SH "SYNOPSIS"
+.nf
+#include <lwres/lwres\&.h>
+.fi
.SH "DESCRIPTION"
.PP
-The BIND 9 lightweight resolver library is a simple, name service
-independent stub resolver library. It provides hostname-to-address
-and address-to-hostname lookup services to applications by
-transmitting lookup requests to a resolver daemon
-\fBlwresd\fR
-running on the local host. The resover daemon performs the
-lookup using the DNS or possibly other name service protocols,
-and returns the results to the application through the library.
-The library and resolver daemon communicate using a simple
-UDP-based protocol.
+The BIND 9 lightweight resolver library is a simple, name service independent stub resolver library\&. It provides hostname\-to\-address and address\-to\-hostname lookup services to applications by transmitting lookup requests to a resolver daemon \fBlwresd\fR running on the local host\&. The resover daemon performs the lookup using the DNS or possibly other name service protocols, and returns the results to the application through the library\&. The library and resolver daemon communicate using a simple UDP\-based protocol\&.
.SH "OVERVIEW"
.PP
-The lwresd library implements multiple name service APIs.
-The standard
-\fBgethostbyname()\fR,
-\fBgethostbyaddr()\fR,
-\fBgethostbyname_r()\fR,
-\fBgethostbyaddr_r()\fR,
-\fBgetaddrinfo()\fR,
-\fBgetipnodebyname()\fR,
-and
-\fBgetipnodebyaddr()\fR
-functions are all supported. To allow the lwres library to coexist
-with system libraries that define functions of the same name,
-the library defines these functions with names prefixed by
-lwres_.
-To define the standard names, applications must include the
-header file
-\fI<lwres/netdb.h>\fR
-which contains macro definitions mapping the standard function names
-into
-lwres_
-prefixed ones. Operating system vendors who integrate the lwres
-library into their base distributions should rename the functions
-in the library proper so that the renaming macros are not needed.
-.PP
-The library also provides a native API consisting of the functions
-\fBlwres_getaddrsbyname()\fR
-and
-\fBlwres_getnamebyaddr()\fR.
-These may be called by applications that require more detailed
-control over the lookup process than the standard functions
-provide.
-.PP
-In addition to these name service independent address lookup
-functions, the library implements a new, experimental API
-for looking up arbitrary DNS resource records, using the
-\fBlwres_getaddrsbyname()\fR
-function.
-.PP
-Finally, there is a low-level API for converting lookup
-requests and responses to and from raw lwres protocol packets.
-This API can be used by clients requiring nonblocking operation,
-and is also used when implementing the server side of the lwres
-protocol, for example in the
-\fBlwresd\fR
-resolver daemon. The use of this low-level API in clients
-and servers is outlined in the following sections.
+The lwresd library implements multiple name service APIs\&. The standard \fBgethostbyname()\fR, \fBgethostbyaddr()\fR, \fBgethostbyname_r()\fR, \fBgethostbyaddr_r()\fR, \fBgetaddrinfo()\fR, \fBgetipnodebyname()\fR, and \fBgetipnodebyaddr()\fR functions are all supported\&. To allow the lwres library to coexist with system libraries that define functions of the same name, the library defines these functions with names prefixed by lwres_\&. To define the standard names, applications must include the header file \fI<lwres/netdb\&.h>\fR which contains macro definitions mapping the standard function names into lwres_ prefixed ones\&. Operating system vendors who integrate the lwres library into their base distributions should rename the functions in the library proper so that the renaming macros are not needed\&.
+.PP
+The library also provides a native API consisting of the functions \fBlwres_getaddrsbyname()\fR and \fBlwres_getnamebyaddr()\fR\&. These may be called by applications that require more detailed control over the lookup process than the standard functions provide\&.
+.PP
+In addition to these name service independent address lookup functions, the library implements a new, experimental API for looking up arbitrary DNS resource records, using the \fBlwres_getaddrsbyname()\fR function\&.
+.PP
+Finally, there is a low\-level API for converting lookup requests and responses to and from raw lwres protocol packets\&. This API can be used by clients requiring nonblocking operation, and is also used when implementing the server side of the lwres protocol, for example in the \fBlwresd\fR resolver daemon\&. The use of this low\-level API in clients and servers is outlined in the following sections\&.
.SH "CLIENT-SIDE LOW-LEVEL API CALL FLOW"
.PP
-When a client program wishes to make an lwres request using the
-native low-level API, it typically performs the following
-sequence of actions.
+When a client program wishes to make an lwres request using the native low\-level API, it typically performs the following sequence of actions\&.
.PP
-(1) Allocate or use an existing \fBlwres_packet_t\fR,
-called pkt below.
+(1) Allocate or use an existing \fBlwres_packet_t\fR, called \fIpkt\fR below\&.
.PP
-(2) Set \fBpkt.recvlength\fR to the maximum length we will accept.
-This is done so the receiver of our packets knows how large our receive
-buffer is. The "default" is a constant in
-\fIlwres.h\fR: LWRES_RECVLENGTH = 4096.
+(2) Set pkt\&.recvlength to the maximum length we will accept\&. This is done so the receiver of our packets knows how large our receive buffer is\&. The "default" is a constant in \fIlwres\&.h\fR: \fBLWRES_RECVLENGTH = 4096\fR\&.
.PP
-(3) Set \fBpkt.serial\fR
-to a unique serial number. This value is echoed
-back to the application by the remote server.
+(3) Set pkt\&.serial to a unique serial number\&. This value is echoed back to the application by the remote server\&.
.PP
-(4) Set \fBpkt.pktflags\fR. Usually this is set to 0.
+(4) Set pkt\&.pktflags\&. Usually this is set to 0\&.
.PP
-(5) Set \fBpkt.result\fR to 0.
+(5) Set pkt\&.result to 0\&.
.PP
-(6) Call \fBlwres_*request_render()\fR,
-or marshall in the data using the primitives
-such as \fBlwres_packet_render()\fR
-and storing the packet data.
+(6) Call \fBlwres_*request_render()\fR, or marshall in the data using the primitives such as \fBlwres_packet_render()\fR and storing the packet data\&.
.PP
-(7) Transmit the resulting buffer.
+(7) Transmit the resulting buffer\&.
.PP
-(8) Call \fBlwres_*response_parse()\fR
-to parse any packets received.
+(8) Call \fBlwres_*response_parse()\fR to parse any packets received\&.
.PP
-(9) Verify that the opcode and serial match a request, and process the
-packet specific information contained in the body.
+(9) Verify that the opcode and serial match a request, and process the packet specific information contained in the body\&.
.SH "SERVER-SIDE LOW-LEVEL API CALL FLOW"
.PP
-When implementing the server side of the lightweight resolver
-protocol using the lwres library, a sequence of actions like the
-following is typically involved in processing each request packet.
+When implementing the server side of the lightweight resolver protocol using the lwres library, a sequence of actions like the following is typically involved in processing each request packet\&.
.PP
-Note that the same \fBlwres_packet_t\fR is used
-in both the \fB_parse()\fR and \fB_render()\fR calls,
-with only a few modifications made
-to the packet header's contents between uses. This method is recommended
-as it keeps the serial, opcode, and other fields correct.
+Note that the same \fBlwres_packet_t\fR is used in both the \fB_parse()\fR and \fB_render()\fR calls, with only a few modifications made to the packet header's contents between uses\&. This method is recommended as it keeps the serial, opcode, and other fields correct\&.
.PP
-(1) When a packet is received, call \fBlwres_*request_parse()\fR to
-unmarshall it. This returns a \fBlwres_packet_t\fR (also called pkt, below)
-as well as a data specific type, such as \fBlwres_gabnrequest_t\fR.
+(1) When a packet is received, call \fBlwres_*request_parse()\fR to unmarshall it\&. This returns a \fBlwres_packet_t\fR (also called \fIpkt\fR, below) as well as a data specific type, such as \fBlwres_gabnrequest_t\fR\&.
.PP
-(2) Process the request in the data specific type.
+(2) Process the request in the data specific type\&.
.PP
-(3) Set the \fBpkt.result\fR,
-\fBpkt.recvlength\fR as above. All other fields can
-be left untouched since they were filled in by the \fB*_parse()\fR call
-above. If using \fBlwres_*response_render()\fR,
-\fBpkt.pktflags\fR will be set up
-properly. Otherwise, the LWRES_LWPACKETFLAG_RESPONSE bit should be
-set.
+(3) Set the pkt\&.result, pkt\&.recvlength as above\&. All other fields can be left untouched since they were filled in by the \fB*_parse()\fR call above\&. If using \fBlwres_*response_render()\fR, pkt\&.pktflags will be set up properly\&. Otherwise, the \fBLWRES_LWPACKETFLAG_RESPONSE\fR bit should be set\&.
.PP
-(4) Call the data specific rendering function, such as
-\fBlwres_gabnresponse_render()\fR.
+(4) Call the data specific rendering function, such as \fBlwres_gabnresponse_render()\fR\&.
.PP
-(5) Send the resulting packet to the client.
+(5) Send the resulting packet to the client\&.
.PP
.SH "SEE ALSO"
.PP
-\fBlwres_gethostent\fR(3),
-\fBlwres_getipnode\fR(3),
-\fBlwres_getnameinfo\fR(3),
-\fBlwres_noop\fR(3),
-\fBlwres_gabn\fR(3),
-\fBlwres_gnba\fR(3),
-\fBlwres_context\fR(3),
-\fBlwres_config\fR(3),
-\fBresolver\fR(5),
-\fBlwresd\fR(8).
+ \fBlwres_gethostent\fR(3), \fBlwres_getipnode\fR(3), \fBlwres_getnameinfo\fR(3), \fBlwres_noop\fR(3), \fBlwres_gabn\fR(3), \fBlwres_gnba\fR(3), \fBlwres_context\fR(3), \fBlwres_config\fR(3), \fBresolver\fR(5), \fBlwresd\fR(8)\&.
diff --git a/lib/lwres/man/lwres.docbook b/lib/lwres/man/lwres.docbook
index 511d82e9..83258a9d 100644
--- a/lib/lwres/man/lwres.docbook
+++ b/lib/lwres/man/lwres.docbook
@@ -1,7 +1,9 @@
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.0//EN"
+ "http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd"
+ [<!ENTITY mdash "&#8212;">]>
<!--
- - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- - Copyright (C) 2001 Internet Software Consortium.
+ - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2000, 2001 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
@@ -16,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: lwres.docbook,v 1.3.206.1 2004/03/06 08:15:37 marka Exp $ -->
+<!-- $Id: lwres.docbook,v 1.3.206.3 2005/05/12 21:36:11 sra Exp $ -->
<refentry>
<refentryinfo>
@@ -28,6 +30,20 @@
<manvolnum>3</manvolnum>
<refmiscinfo>BIND9</refmiscinfo>
</refmeta>
+
+ <docinfo>
+ <copyright>
+ <year>2004</year>
+ <year>2005</year>
+ <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
+ </copyright>
+ <copyright>
+ <year>2000</year>
+ <year>2001</year>
+ <holder>Internet Software Consortium.</holder>
+ </copyright>
+ </docinfo>
+
<refnamediv>
<refname>lwres</refname>
<refpurpose>introduction to the lightweight resolver library</refpurpose>
diff --git a/lib/lwres/man/lwres.html b/lib/lwres/man/lwres.html
index 793ab72a..0e8b0581 100644
--- a/lib/lwres/man/lwres.html
+++ b/lib/lwres/man/lwres.html
@@ -1,433 +1,216 @@
<!--
- - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- - Copyright (C) 2001 Internet Software Consortium.
- -
+ - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2000, 2001 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,
+ - 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: lwres.html,v 1.4.2.1.4.2 2004/08/22 23:39:02 marka Exp $ -->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<HTML
-><HEAD
-><TITLE
->lwres</TITLE
-><META
-NAME="GENERATOR"
-CONTENT="Modular DocBook HTML Stylesheet Version 1.7"></HEAD
-><BODY
-CLASS="REFENTRY"
-BGCOLOR="#FFFFFF"
-TEXT="#000000"
-LINK="#0000FF"
-VLINK="#840084"
-ALINK="#0000FF"
-><H1
-><A
-NAME="AEN1"
-></A
->lwres</H1
-><DIV
-CLASS="REFNAMEDIV"
-><A
-NAME="AEN8"
-></A
-><H2
->Name</H2
->lwres&nbsp;--&nbsp;introduction to the lightweight resolver library</DIV
-><DIV
-CLASS="REFSYNOPSISDIV"
-><A
-NAME="AEN11"
-></A
-><H2
->Synopsis</H2
-><DIV
-CLASS="FUNCSYNOPSIS"
-><P
-></P
-><A
-NAME="AEN12"
-></A
-><PRE
-CLASS="FUNCSYNOPSISINFO"
->#include &lt;lwres/lwres.h&gt;</PRE
-><P
-></P
-></DIV
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN14"
-></A
-><H2
->DESCRIPTION</H2
-><P
->The BIND 9 lightweight resolver library is a simple, name service
+<!-- $Id: lwres.html,v 1.4.2.1.4.7 2005/07/18 02:36:51 marka Exp $ -->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>lwres</title>
+<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
+<a name="id2456972"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2>Name</h2>
+<p>lwres &#8212; introduction to the lightweight resolver library</p>
+</div>
+<div class="refsynopsisdiv">
+<h2>Synopsis</h2>
+<div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;lwres/lwres.h&gt;</pre></div>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514515"></a><h2>DESCRIPTION</h2>
+<p>
+The BIND 9 lightweight resolver library is a simple, name service
independent stub resolver library. It provides hostname-to-address
and address-to-hostname lookup services to applications by
transmitting lookup requests to a resolver daemon
-<B
-CLASS="COMMAND"
->lwresd</B
->
+<span><strong class="command">lwresd</strong></span>
running on the local host. The resover daemon performs the
lookup using the DNS or possibly other name service protocols,
and returns the results to the application through the library.
The library and resolver daemon communicate using a simple
-UDP-based protocol.</P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN18"
-></A
-><H2
->OVERVIEW</H2
-><P
->The lwresd library implements multiple name service APIs.
+UDP-based protocol.
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514528"></a><h2>OVERVIEW</h2>
+<p>
+The lwresd library implements multiple name service APIs.
The standard
-<CODE
-CLASS="FUNCTION"
->gethostbyname()</CODE
->,
-<CODE
-CLASS="FUNCTION"
->gethostbyaddr()</CODE
->,
-<CODE
-CLASS="FUNCTION"
->gethostbyname_r()</CODE
->,
-<CODE
-CLASS="FUNCTION"
->gethostbyaddr_r()</CODE
->,
-<CODE
-CLASS="FUNCTION"
->getaddrinfo()</CODE
->,
-<CODE
-CLASS="FUNCTION"
->getipnodebyname()</CODE
->,
+<code class="function">gethostbyname()</code>,
+<code class="function">gethostbyaddr()</code>,
+<code class="function">gethostbyname_r()</code>,
+<code class="function">gethostbyaddr_r()</code>,
+<code class="function">getaddrinfo()</code>,
+<code class="function">getipnodebyname()</code>,
and
-<CODE
-CLASS="FUNCTION"
->getipnodebyaddr()</CODE
->
+<code class="function">getipnodebyaddr()</code>
functions are all supported. To allow the lwres library to coexist
with system libraries that define functions of the same name,
the library defines these functions with names prefixed by
-<VAR
-CLASS="LITERAL"
->lwres_</VAR
->.
+<code class="literal">lwres_</code>.
To define the standard names, applications must include the
header file
-<TT
-CLASS="FILENAME"
->&lt;lwres/netdb.h&gt;</TT
->
+<code class="filename">&lt;lwres/netdb.h&gt;</code>
which contains macro definitions mapping the standard function names
into
-<VAR
-CLASS="LITERAL"
->lwres_</VAR
->
+<code class="literal">lwres_</code>
prefixed ones. Operating system vendors who integrate the lwres
library into their base distributions should rename the functions
-in the library proper so that the renaming macros are not needed.</P
-><P
->The library also provides a native API consisting of the functions
-<CODE
-CLASS="FUNCTION"
->lwres_getaddrsbyname()</CODE
->
+in the library proper so that the renaming macros are not needed.
+</p>
+<p>
+The library also provides a native API consisting of the functions
+<code class="function">lwres_getaddrsbyname()</code>
and
-<CODE
-CLASS="FUNCTION"
->lwres_getnamebyaddr()</CODE
->.
+<code class="function">lwres_getnamebyaddr()</code>.
These may be called by applications that require more detailed
control over the lookup process than the standard functions
-provide.</P
-><P
->In addition to these name service independent address lookup
+provide.
+</p>
+<p>
+In addition to these name service independent address lookup
functions, the library implements a new, experimental API
for looking up arbitrary DNS resource records, using the
-<CODE
-CLASS="FUNCTION"
->lwres_getaddrsbyname()</CODE
->
-function.</P
-><P
->Finally, there is a low-level API for converting lookup
+<code class="function">lwres_getaddrsbyname()</code>
+function.
+</p>
+<p>
+Finally, there is a low-level API for converting lookup
requests and responses to and from raw lwres protocol packets.
This API can be used by clients requiring nonblocking operation,
and is also used when implementing the server side of the lwres
protocol, for example in the
-<B
-CLASS="COMMAND"
->lwresd</B
->
+<span><strong class="command">lwresd</strong></span>
resolver daemon. The use of this low-level API in clients
-and servers is outlined in the following sections.</P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN38"
-></A
-><H2
->CLIENT-SIDE LOW-LEVEL API CALL FLOW</H2
-><P
->When a client program wishes to make an lwres request using the
+and servers is outlined in the following sections.
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514592"></a><h2>CLIENT-SIDE LOW-LEVEL API CALL FLOW</h2>
+<p>
+When a client program wishes to make an lwres request using the
native low-level API, it typically performs the following
-sequence of actions.</P
-><P
->(1) Allocate or use an existing <SPAN
-CLASS="TYPE"
->lwres_packet_t</SPAN
->,
-called <VAR
-CLASS="VARNAME"
->pkt</VAR
-> below.</P
-><P
->(2) Set <CODE
-CLASS="STRUCTFIELD"
->pkt.recvlength</CODE
-> to the maximum length we will accept.
+sequence of actions.
+</p>
+<p>
+(1) Allocate or use an existing <span class="type">lwres_packet_t</span>,
+called <code class="varname">pkt</code> below.
+</p>
+<p>
+(2) Set <em class="structfield"><code>pkt.recvlength</code></em> to the maximum length we will accept.
This is done so the receiver of our packets knows how large our receive
buffer is. The "default" is a constant in
-<TT
-CLASS="FILENAME"
->lwres.h</TT
->: <CODE
-CLASS="CONSTANT"
->LWRES_RECVLENGTH = 4096</CODE
->.</P
-><P
->(3) Set <CODE
-CLASS="STRUCTFIELD"
->pkt.serial</CODE
->
+<code class="filename">lwres.h</code>: <code class="constant">LWRES_RECVLENGTH = 4096</code>.
+</p>
+<p>
+(3) Set <em class="structfield"><code>pkt.serial</code></em>
to a unique serial number. This value is echoed
-back to the application by the remote server.</P
-><P
->(4) Set <CODE
-CLASS="STRUCTFIELD"
->pkt.pktflags</CODE
->. Usually this is set to 0.</P
-><P
->(5) Set <CODE
-CLASS="STRUCTFIELD"
->pkt.result</CODE
-> to 0.</P
-><P
->(6) Call <CODE
-CLASS="FUNCTION"
->lwres_*request_render()</CODE
->,
+back to the application by the remote server.
+</p>
+<p>
+(4) Set <em class="structfield"><code>pkt.pktflags</code></em>. Usually this is set to 0.
+</p>
+<p>
+(5) Set <em class="structfield"><code>pkt.result</code></em> to 0.
+</p>
+<p>
+(6) Call <code class="function">lwres_*request_render()</code>,
or marshall in the data using the primitives
-such as <CODE
-CLASS="FUNCTION"
->lwres_packet_render()</CODE
->
-and storing the packet data.</P
-><P
->(7) Transmit the resulting buffer.</P
-><P
->(8) Call <CODE
-CLASS="FUNCTION"
->lwres_*response_parse()</CODE
->
-to parse any packets received.</P
-><P
->(9) Verify that the opcode and serial match a request, and process the
-packet specific information contained in the body.</P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN61"
-></A
-><H2
->SERVER-SIDE LOW-LEVEL API CALL FLOW</H2
-><P
->When implementing the server side of the lightweight resolver
+such as <code class="function">lwres_packet_render()</code>
+and storing the packet data.
+</p>
+<p>
+(7) Transmit the resulting buffer.
+</p>
+<p>
+(8) Call <code class="function">lwres_*response_parse()</code>
+to parse any packets received.
+</p>
+<p>
+(9) Verify that the opcode and serial match a request, and process the
+packet specific information contained in the body.
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514875"></a><h2>SERVER-SIDE LOW-LEVEL API CALL FLOW</h2>
+<p>
+When implementing the server side of the lightweight resolver
protocol using the lwres library, a sequence of actions like the
-following is typically involved in processing each request packet.</P
-><P
->Note that the same <SPAN
-CLASS="TYPE"
->lwres_packet_t</SPAN
-> is used
-in both the <CODE
-CLASS="FUNCTION"
->_parse()</CODE
-> and <CODE
-CLASS="FUNCTION"
->_render()</CODE
-> calls,
+following is typically involved in processing each request packet.
+</p>
+<p>
+Note that the same <span class="type">lwres_packet_t</span> is used
+in both the <code class="function">_parse()</code> and <code class="function">_render()</code> calls,
with only a few modifications made
to the packet header's contents between uses. This method is recommended
-as it keeps the serial, opcode, and other fields correct.</P
-><P
->(1) When a packet is received, call <CODE
-CLASS="FUNCTION"
->lwres_*request_parse()</CODE
-> to
-unmarshall it. This returns a <SPAN
-CLASS="TYPE"
->lwres_packet_t</SPAN
-> (also called <VAR
-CLASS="VARNAME"
->pkt</VAR
->, below)
-as well as a data specific type, such as <SPAN
-CLASS="TYPE"
->lwres_gabnrequest_t</SPAN
->.</P
-><P
->(2) Process the request in the data specific type.</P
-><P
->(3) Set the <CODE
-CLASS="STRUCTFIELD"
->pkt.result</CODE
->,
-<CODE
-CLASS="STRUCTFIELD"
->pkt.recvlength</CODE
-> as above. All other fields can
-be left untouched since they were filled in by the <CODE
-CLASS="FUNCTION"
->*_parse()</CODE
-> call
-above. If using <CODE
-CLASS="FUNCTION"
->lwres_*response_render()</CODE
->,
-<CODE
-CLASS="STRUCTFIELD"
->pkt.pktflags</CODE
-> will be set up
-properly. Otherwise, the <CODE
-CLASS="CONSTANT"
->LWRES_LWPACKETFLAG_RESPONSE</CODE
-> bit should be
-set.</P
-><P
->(4) Call the data specific rendering function, such as
-<CODE
-CLASS="FUNCTION"
->lwres_gabnresponse_render()</CODE
->.</P
-><P
->(5) Send the resulting packet to the client.</P
-><P
-></P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN85"
-></A
-><H2
->SEE ALSO</H2
-><P
-><SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->lwres_gethostent</SPAN
->(3)</SPAN
->,
+as it keeps the serial, opcode, and other fields correct.
+</p>
+<p>
+(1) When a packet is received, call <code class="function">lwres_*request_parse()</code> to
+unmarshall it. This returns a <span class="type">lwres_packet_t</span> (also called <code class="varname">pkt</code>, below)
+as well as a data specific type, such as <span class="type">lwres_gabnrequest_t</span>.
+</p>
+<p>
+(2) Process the request in the data specific type.
+</p>
+<p>
+(3) Set the <em class="structfield"><code>pkt.result</code></em>,
+<em class="structfield"><code>pkt.recvlength</code></em> as above. All other fields can
+be left untouched since they were filled in by the <code class="function">*_parse()</code> call
+above. If using <code class="function">lwres_*response_render()</code>,
+<em class="structfield"><code>pkt.pktflags</code></em> will be set up
+properly. Otherwise, the <code class="constant">LWRES_LWPACKETFLAG_RESPONSE</code> bit should be
+set.
+</p>
+<p>
+(4) Call the data specific rendering function, such as
+<code class="function">lwres_gabnresponse_render()</code>.
+</p>
+<p>
+(5) Send the resulting packet to the client.
+</p>
+<p>
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514961"></a><h2>SEE ALSO</h2>
+<p>
+<span class="citerefentry"><span class="refentrytitle">lwres_gethostent</span>(3)</span>,
+
+<span class="citerefentry"><span class="refentrytitle">lwres_getipnode</span>(3)</span>,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->lwres_getipnode</SPAN
->(3)</SPAN
->,
+<span class="citerefentry"><span class="refentrytitle">lwres_getnameinfo</span>(3)</span>,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->lwres_getnameinfo</SPAN
->(3)</SPAN
->,
+<span class="citerefentry"><span class="refentrytitle">lwres_noop</span>(3)</span>,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->lwres_noop</SPAN
->(3)</SPAN
->,
+<span class="citerefentry"><span class="refentrytitle">lwres_gabn</span>(3)</span>,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->lwres_gabn</SPAN
->(3)</SPAN
->,
+<span class="citerefentry"><span class="refentrytitle">lwres_gnba</span>(3)</span>,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->lwres_gnba</SPAN
->(3)</SPAN
->,
+<span class="citerefentry"><span class="refentrytitle">lwres_context</span>(3)</span>,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->lwres_context</SPAN
->(3)</SPAN
->,
+<span class="citerefentry"><span class="refentrytitle">lwres_config</span>(3)</span>,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->lwres_config</SPAN
->(3)</SPAN
->,
+<span class="citerefentry"><span class="refentrytitle">resolver</span>(5)</span>,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->resolver</SPAN
->(5)</SPAN
->,
+<span class="citerefentry"><span class="refentrytitle">lwresd</span>(8)</span>.
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->lwresd</SPAN
->(8)</SPAN
->.&#13;</P
-></DIV
-></BODY
-></HTML
->
+</p>
+</div>
+</div></body>
+</html>
diff --git a/lib/lwres/man/lwres_buffer.3 b/lib/lwres/man/lwres_buffer.3
index 232742aa..fc177a1e 100644
--- a/lib/lwres/man/lwres_buffer.3
+++ b/lib/lwres/man/lwres_buffer.3
@@ -1,279 +1,123 @@
-.\" Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
-.\" Copyright (C) 2000, 2001 Internet Software Consortium.
-.\"
+.\" Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+.\" Copyright (C) 2000, 2001 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,
+.\" 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: lwres_buffer.3,v 1.12.2.1.8.1 2004/03/06 07:41:42 marka Exp $
+.\" $Id: lwres_buffer.3,v 1.12.2.1.8.4 2005/09/12 00:47:30 marka Exp $
.\"
-.TH "LWRES_BUFFER" "3" "Jun 30, 2000" "BIND9" ""
+.hy 0
+.ad l
+.\"Generated by db2man.xsl. Don't modify this, modify the source.
+.de Sh \" Subsection
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Ip \" List item
+.br
+.ie \\n(.$>=3 .ne \\$3
+.el .ne 3
+.IP "\\$1" \\$2
+..
+.TH "LWRES_BUFFER" 3 "Jun 30, 2000" "" ""
.SH NAME
lwres_buffer_init, lwres_buffer_invalidate, lwres_buffer_add, lwres_buffer_subtract, lwres_buffer_clear, lwres_buffer_first, lwres_buffer_forward, lwres_buffer_back, lwres_buffer_getuint8, lwres_buffer_putuint8, lwres_buffer_getuint16, lwres_buffer_putuint16, lwres_buffer_getuint32, lwres_buffer_putuint32, lwres_buffer_putmem, lwres_buffer_getmem \- lightweight resolver buffer management
-.SH SYNOPSIS
-\fB#include <lwres/lwbuffer.h>
-.sp
-.na
-void
-lwres_buffer_init(lwres_buffer_t *b, void *base, unsigned int length);
-.ad
-.sp
-.na
-void
-lwres_buffer_invalidate(lwres_buffer_t *b);
-.ad
-.sp
-.na
-void
-lwres_buffer_add(lwres_buffer_t *b, unsigned int n);
-.ad
-.sp
-.na
-void
-lwres_buffer_subtract(lwres_buffer_t *b, unsigned int n);
-.ad
-.sp
-.na
-void
-lwres_buffer_clear(lwres_buffer_t *b);
-.ad
-.sp
-.na
-void
-lwres_buffer_first(lwres_buffer_t *b);
-.ad
-.sp
-.na
-void
-lwres_buffer_forward(lwres_buffer_t *b, unsigned int n);
-.ad
-.sp
-.na
-void
-lwres_buffer_back(lwres_buffer_t *b, unsigned int n);
-.ad
-.sp
-.na
-lwres_uint8_t
-lwres_buffer_getuint8(lwres_buffer_t *b);
-.ad
-.sp
-.na
-void
-lwres_buffer_putuint8(lwres_buffer_t *b, lwres_uint8_t val);
-.ad
-.sp
-.na
-lwres_uint16_t
-lwres_buffer_getuint16(lwres_buffer_t *b);
-.ad
-.sp
-.na
-void
-lwres_buffer_putuint16(lwres_buffer_t *b, lwres_uint16_t val);
-.ad
-.sp
-.na
-lwres_uint32_t
-lwres_buffer_getuint32(lwres_buffer_t *b);
-.ad
-.sp
-.na
-void
-lwres_buffer_putuint32(lwres_buffer_t *b, lwres_uint32_t val);
-.ad
-.sp
-.na
-void
-lwres_buffer_putmem(lwres_buffer_t *b, const unsigned char *base, unsigned int length);
-.ad
-.sp
-.na
-void
-lwres_buffer_getmem(lwres_buffer_t *b, unsigned char *base, unsigned int length);
-.ad
-\fR
+.SH "SYNOPSIS"
+.nf
+#include <lwres/lwbuffer\&.h>
+.fi
+.HP 24
+void\ \fBlwres_buffer_init\fR\ (lwres_buffer_t\ *b, void\ *base, unsigned\ int\ length);
+.HP 30
+void\ \fBlwres_buffer_invalidate\fR\ (lwres_buffer_t\ *b);
+.HP 23
+void\ \fBlwres_buffer_add\fR\ (lwres_buffer_t\ *b, unsigned\ int\ n);
+.HP 28
+void\ \fBlwres_buffer_subtract\fR\ (lwres_buffer_t\ *b, unsigned\ int\ n);
+.HP 25
+void\ \fBlwres_buffer_clear\fR\ (lwres_buffer_t\ *b);
+.HP 25
+void\ \fBlwres_buffer_first\fR\ (lwres_buffer_t\ *b);
+.HP 27
+void\ \fBlwres_buffer_forward\fR\ (lwres_buffer_t\ *b, unsigned\ int\ n);
+.HP 24
+void\ \fBlwres_buffer_back\fR\ (lwres_buffer_t\ *b, unsigned\ int\ n);
+.HP 37
+lwres_uint8_t\ \fBlwres_buffer_getuint8\fR\ (lwres_buffer_t\ *b);
+.HP 28
+void\ \fBlwres_buffer_putuint8\fR\ (lwres_buffer_t\ *b, lwres_uint8_t\ val);
+.HP 39
+lwres_uint16_t\ \fBlwres_buffer_getuint16\fR\ (lwres_buffer_t\ *b);
+.HP 29
+void\ \fBlwres_buffer_putuint16\fR\ (lwres_buffer_t\ *b, lwres_uint16_t\ val);
+.HP 39
+lwres_uint32_t\ \fBlwres_buffer_getuint32\fR\ (lwres_buffer_t\ *b);
+.HP 29
+void\ \fBlwres_buffer_putuint32\fR\ (lwres_buffer_t\ *b, lwres_uint32_t\ val);
+.HP 26
+void\ \fBlwres_buffer_putmem\fR\ (lwres_buffer_t\ *b, const\ unsigned\ char\ *base, unsigned\ int\ length);
+.HP 26
+void\ \fBlwres_buffer_getmem\fR\ (lwres_buffer_t\ *b, unsigned\ char\ *base, unsigned\ int\ length);
.SH "DESCRIPTION"
.PP
-These functions provide bounds checked access to a region of memory
-where data is being read or written.
-They are based on, and similar to, the
-isc_buffer_
-functions in the ISC library.
+These functions provide bounds checked access to a region of memory where data is being read or written\&. They are based on, and similar to, the isc_buffer_ functions in the ISC library\&.
.PP
-A buffer is a region of memory, together with a set of related
-subregions.
-The \fBused region\fR and the
-\fBavailable\fR region are disjoint, and
-their union is the buffer's region.
-The used region extends from the beginning of the buffer region to the
-last used byte.
-The available region extends from one byte greater than the last used
-byte to the end of the buffer's region.
-The size of the used region can be changed using various
-buffer commands.
-Initially, the used region is empty.
+A buffer is a region of memory, together with a set of related subregions\&. The \fIused region\fR and the \fIavailable\fR region are disjoint, and their union is the buffer's region\&. The used region extends from the beginning of the buffer region to the last used byte\&. The available region extends from one byte greater than the last used byte to the end of the buffer's region\&. The size of the used region can be changed using various buffer commands\&. Initially, the used region is empty\&.
.PP
-The used region is further subdivided into two disjoint regions: the
-\fBconsumed region\fR and the \fBremaining region\fR.
-The union of these two regions is the used region.
-The consumed region extends from the beginning of the used region to
-the byte before the \fBcurrent\fR offset (if any).
-The \fBremaining\fR region the current pointer to the end of the used
-region.
-The size of the consumed region can be changed using various
-buffer commands.
-Initially, the consumed region is empty.
+The used region is further subdivided into two disjoint regions: the \fIconsumed region\fR and the \fIremaining region\fR\&. The union of these two regions is the used region\&. The consumed region extends from the beginning of the used region to the byte before the \fIcurrent\fR offset (if any)\&. The \fIremaining\fR region the current pointer to the end of the used region\&. The size of the consumed region can be changed using various buffer commands\&. Initially, the consumed region is empty\&.
.PP
-The \fBactive region\fR is an (optional) subregion of the remaining
-region.
-It extends from the current offset to an offset in the
-remaining region.
-Initially, the active region is empty.
-If the current offset advances beyond the chosen offset,
-the active region will also be empty.
+The \fIactive region\fR is an (optional) subregion of the remaining region\&. It extends from the current offset to an offset in the remaining region\&. Initially, the active region is empty\&. If the current offset advances beyond the chosen offset, the active region will also be empty\&.
.PP
-.sp
.nf
-
- /------------entire length---------------\\\\
- /----- used region -----\\\\/-- available --\\\\
- +----------------------------------------+
+ /\-\-\-\-\-\-\-\-\-\-\-\-entire length\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\\\\
+ /\-\-\-\-\- used region \-\-\-\-\-\\\\/\-\- available \-\-\\\\
+ +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+
| consumed | remaining | |
- +----------------------------------------+
+ +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+
a b c d e
-
- a == base of buffer.
- b == current pointer. Can be anywhere between a and d.
- c == active pointer. Meaningful between b and d.
- d == used pointer.
- e == length of buffer.
-
- a-e == entire length of buffer.
- a-d == used region.
- a-b == consumed region.
- b-d == remaining region.
- b-c == optional active region.
-.sp
+ a == base of buffer\&.
+ b == current pointer\&. Can be anywhere between a and d\&.
+ c == active pointer\&. Meaningful between b and d\&.
+ d == used pointer\&.
+ e == length of buffer\&.
+ a\-e == entire length of buffer\&.
+ a\-d == used region\&.
+ a\-b == consumed region\&.
+ b\-d == remaining region\&.
+ b\-c == optional active region\&.
.fi
.PP
-\fBlwres_buffer_init()\fR
-initializes the
-\fBlwres_buffer_t\fR
-\fI*b\fR
-and assocates it with the memory region of size
-\fIlength\fR
-bytes starting at location
-\fIbase.\fR
+ \fBlwres_buffer_init()\fR initializes the \fBlwres_buffer_t\fR \fI*b\fR and assocates it with the memory region of size \fIlength\fR bytes starting at location \fIbase\&.\fR
.PP
-\fBlwres_buffer_invalidate()\fR
-marks the buffer
-\fI*b\fR
-as invalid. Invalidating a buffer after use is not required,
-but makes it possible to catch its possible accidental use.
+ \fBlwres_buffer_invalidate()\fR marks the buffer \fI*b\fR as invalid\&. Invalidating a buffer after use is not required, but makes it possible to catch its possible accidental use\&.
.PP
-The functions
-\fBlwres_buffer_add()\fR
-and
-\fBlwres_buffer_subtract()\fR
-respectively increase and decrease the used space in
-buffer
-\fI*b\fR
-by
-\fIn\fR
-bytes.
-\fBlwres_buffer_add()\fR
-checks for buffer overflow and
-\fBlwres_buffer_subtract()\fR
-checks for underflow.
-These functions do not allocate or deallocate memory.
-They just change the value of
-\fBused\fR.
+The functions \fBlwres_buffer_add()\fR and \fBlwres_buffer_subtract()\fR respectively increase and decrease the used space in buffer \fI*b\fR by \fIn\fR bytes\&. \fBlwres_buffer_add()\fR checks for buffer overflow and \fBlwres_buffer_subtract()\fR checks for underflow\&. These functions do not allocate or deallocate memory\&. They just change the value of used\&.
.PP
-A buffer is re-initialised by
-\fBlwres_buffer_clear()\fR.
-The function sets
-\fBused\fR ,
-\fBcurrent\fR
-and
-\fBactive\fR
-to zero.
+A buffer is re\-initialised by \fBlwres_buffer_clear()\fR\&. The function sets used , current and active to zero\&.
.PP
-\fBlwres_buffer_first\fR
-makes the consumed region of buffer
-\fI*p\fR
-empty by setting
-\fBcurrent\fR
-to zero (the start of the buffer).
+ \fBlwres_buffer_first\fR makes the consumed region of buffer \fI*p\fR empty by setting current to zero (the start of the buffer)\&.
.PP
-\fBlwres_buffer_forward()\fR
-increases the consumed region of buffer
-\fI*b\fR
-by
-\fIn\fR
-bytes, checking for overflow.
-Similarly,
-\fBlwres_buffer_back()\fR
-decreases buffer
-\fIb\fR's
-consumed region by
-\fIn\fR
-bytes and checks for underflow.
+ \fBlwres_buffer_forward()\fR increases the consumed region of buffer \fI*b\fR by \fIn\fR bytes, checking for overflow\&. Similarly, \fBlwres_buffer_back()\fR decreases buffer \fIb\fR's consumed region by \fIn\fR bytes and checks for underflow\&.
.PP
-\fBlwres_buffer_getuint8()\fR
-reads an unsigned 8-bit integer from
-\fI*b\fR
-and returns it.
-\fBlwres_buffer_putuint8()\fR
-writes the unsigned 8-bit integer
-\fIval\fR
-to buffer
-\fI*b\fR.
+ \fBlwres_buffer_getuint8()\fR reads an unsigned 8\-bit integer from \fI*b\fR and returns it\&. \fBlwres_buffer_putuint8()\fR writes the unsigned 8\-bit integer \fIval\fR to buffer \fI*b\fR\&.
.PP
-\fBlwres_buffer_getuint16()\fR
-and
-\fBlwres_buffer_getuint32()\fR
-are identical to
-\fBlwres_buffer_putuint8()\fR
-except that they respectively read an unsigned 16-bit or 32-bit integer
-in network byte order from
-\fIb\fR.
-Similarly,
-\fBlwres_buffer_putuint16()\fR
-and
-\fBlwres_buffer_putuint32()\fR
-writes the unsigned 16-bit or 32-bit integer
-\fIval\fR
-to buffer
-\fIb\fR,
-in network byte order.
+ \fBlwres_buffer_getuint16()\fR and \fBlwres_buffer_getuint32()\fR are identical to \fBlwres_buffer_putuint8()\fR except that they respectively read an unsigned 16\-bit or 32\-bit integer in network byte order from \fIb\fR\&. Similarly, \fBlwres_buffer_putuint16()\fR and \fBlwres_buffer_putuint32()\fR writes the unsigned 16\-bit or 32\-bit integer \fIval\fR to buffer \fIb\fR, in network byte order\&.
.PP
-Arbitrary amounts of data are read or written from a lightweight
-resolver buffer with
-\fBlwres_buffer_getmem()\fR
-and
-\fBlwres_buffer_putmem()\fR
-respectively.
-\fBlwres_buffer_putmem()\fR
-copies
-\fIlength\fR
-bytes of memory at
-\fIbase\fR
-to
-\fIb\fR.
-Conversely,
-\fBlwres_buffer_getmem()\fR
-copies
-\fIlength\fR
-bytes of memory from
-\fIb\fR
-to
-\fIbase\fR.
+Arbitrary amounts of data are read or written from a lightweight resolver buffer with \fBlwres_buffer_getmem()\fR and \fBlwres_buffer_putmem()\fR respectively\&. \fBlwres_buffer_putmem()\fR copies \fIlength\fR bytes of memory at \fIbase\fR to \fIb\fR\&. Conversely, \fBlwres_buffer_getmem()\fR copies \fIlength\fR bytes of memory from \fIb\fR to \fIbase\fR\&.
diff --git a/lib/lwres/man/lwres_buffer.docbook b/lib/lwres/man/lwres_buffer.docbook
index 4db9fd3a..c70aee50 100644
--- a/lib/lwres/man/lwres_buffer.docbook
+++ b/lib/lwres/man/lwres_buffer.docbook
@@ -1,7 +1,9 @@
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.0//EN"
+ "http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd"
+ [<!ENTITY mdash "&#8212;">]>
<!--
- - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- - Copyright (C) 2001 Internet Software Consortium.
+ - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2000, 2001 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
@@ -16,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: lwres_buffer.docbook,v 1.3.206.1 2004/03/06 08:15:37 marka Exp $ -->
+<!-- $Id: lwres_buffer.docbook,v 1.3.206.3 2005/05/12 21:36:11 sra Exp $ -->
<refentry>
<refentryinfo>
@@ -29,6 +31,19 @@
<refmiscinfo>BIND9</refmiscinfo>
</refmeta>
+ <docinfo>
+ <copyright>
+ <year>2004</year>
+ <year>2005</year>
+ <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
+ </copyright>
+ <copyright>
+ <year>2000</year>
+ <year>2001</year>
+ <holder>Internet Software Consortium.</holder>
+ </copyright>
+ </docinfo>
+
<refnamediv>
<refname>lwres_buffer_init</refname>
<refname>lwres_buffer_invalidate</refname>
diff --git a/lib/lwres/man/lwres_buffer.html b/lib/lwres/man/lwres_buffer.html
index 79354fc0..c6bcf387 100644
--- a/lib/lwres/man/lwres_buffer.html
+++ b/lib/lwres/man/lwres_buffer.html
@@ -1,232 +1,267 @@
<!--
- - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- - Copyright (C) 2001 Internet Software Consortium.
- -
+ - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2000, 2001 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,
+ - 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: lwres_buffer.html,v 1.4.2.1.4.2 2004/08/22 23:39:03 marka Exp $ -->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<HTML
-><HEAD
-><TITLE
->lwres_buffer</TITLE
-><META
-NAME="GENERATOR"
-CONTENT="Modular DocBook HTML Stylesheet Version 1.7"></HEAD
-><BODY
-CLASS="REFENTRY"
-BGCOLOR="#FFFFFF"
-TEXT="#000000"
-LINK="#0000FF"
-VLINK="#840084"
-ALINK="#0000FF"
-><H1
-><A
-NAME="AEN1"
-></A
->lwres_buffer</H1
-><DIV
-CLASS="REFNAMEDIV"
-><A
-NAME="AEN8"
-></A
-><H2
->Name</H2
->lwres_buffer_init, lwres_buffer_invalidate, lwres_buffer_add, lwres_buffer_subtract, lwres_buffer_clear, lwres_buffer_first, lwres_buffer_forward, lwres_buffer_back, lwres_buffer_getuint8, lwres_buffer_putuint8, lwres_buffer_getuint16, lwres_buffer_putuint16, lwres_buffer_getuint32, lwres_buffer_putuint32, lwres_buffer_putmem, lwres_buffer_getmem&nbsp;--&nbsp;lightweight resolver buffer management</DIV
-><DIV
-CLASS="REFSYNOPSISDIV"
-><A
-NAME="AEN26"
-></A
-><H2
->Synopsis</H2
-><DIV
-CLASS="FUNCSYNOPSIS"
-><P
-></P
-><A
-NAME="AEN27"
-></A
-><PRE
-CLASS="FUNCSYNOPSISINFO"
->#include &lt;lwres/lwbuffer.h&gt;</PRE
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->void
-lwres_buffer_init</CODE
->(lwres_buffer_t *b, void *base, unsigned int length);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->void
-lwres_buffer_invalidate</CODE
->(lwres_buffer_t *b);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->void
-lwres_buffer_add</CODE
->(lwres_buffer_t *b, unsigned int n);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->void
-lwres_buffer_subtract</CODE
->(lwres_buffer_t *b, unsigned int n);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->void
-lwres_buffer_clear</CODE
->(lwres_buffer_t *b);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->void
-lwres_buffer_first</CODE
->(lwres_buffer_t *b);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->void
-lwres_buffer_forward</CODE
->(lwres_buffer_t *b, unsigned int n);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->void
-lwres_buffer_back</CODE
->(lwres_buffer_t *b, unsigned int n);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->lwres_uint8_t
-lwres_buffer_getuint8</CODE
->(lwres_buffer_t *b);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->void
-lwres_buffer_putuint8</CODE
->(lwres_buffer_t *b, lwres_uint8_t val);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->lwres_uint16_t
-lwres_buffer_getuint16</CODE
->(lwres_buffer_t *b);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->void
-lwres_buffer_putuint16</CODE
->(lwres_buffer_t *b, lwres_uint16_t val);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->lwres_uint32_t
-lwres_buffer_getuint32</CODE
->(lwres_buffer_t *b);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->void
-lwres_buffer_putuint32</CODE
->(lwres_buffer_t *b, lwres_uint32_t val);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->void
-lwres_buffer_putmem</CODE
->(lwres_buffer_t *b, const unsigned char *base, unsigned int length);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->void
-lwres_buffer_getmem</CODE
->(lwres_buffer_t *b, unsigned char *base, unsigned int length);</CODE
-></P
-><P
-></P
-></DIV
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN106"
-></A
-><H2
->DESCRIPTION</H2
-><P
->These functions provide bounds checked access to a region of memory
+<!-- $Id: lwres_buffer.html,v 1.4.2.1.4.7 2005/07/18 02:36:52 marka Exp $ -->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>lwres_buffer</title>
+<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
+<a name="id2456972"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2>Name</h2>
+<p>lwres_buffer_init, lwres_buffer_invalidate, lwres_buffer_add, lwres_buffer_subtract, lwres_buffer_clear, lwres_buffer_first, lwres_buffer_forward, lwres_buffer_back, lwres_buffer_getuint8, lwres_buffer_putuint8, lwres_buffer_getuint16, lwres_buffer_putuint16, lwres_buffer_getuint32, lwres_buffer_putuint32, lwres_buffer_putmem, lwres_buffer_getmem &#8212; lightweight resolver buffer management</p>
+</div>
+<div class="refsynopsisdiv">
+<h2>Synopsis</h2>
+<div class="funcsynopsis">
+<pre class="funcsynopsisinfo">
+#include &lt;lwres/lwbuffer.h&gt;
+</pre>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+void
+<b class="fsfunc">lwres_buffer_init</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr>
+<td><code class="funcdef">
+void
+<b class="fsfunc">lwres_buffer_invalidate</b>(</code></td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr></table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+void
+<b class="fsfunc">lwres_buffer_add</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+void
+<b class="fsfunc">lwres_buffer_subtract</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr>
+<td><code class="funcdef">
+void
+<b class="fsfunc">lwres_buffer_clear</b>(</code></td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr></table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr>
+<td><code class="funcdef">
+void
+<b class="fsfunc">lwres_buffer_first</b>(</code></td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr></table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+void
+<b class="fsfunc">lwres_buffer_forward</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+void
+<b class="fsfunc">lwres_buffer_back</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr>
+<td><code class="funcdef">
+lwres_uint8_t
+<b class="fsfunc">lwres_buffer_getuint8</b>(</code></td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr></table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+void
+<b class="fsfunc">lwres_buffer_putuint8</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr>
+<td><code class="funcdef">
+lwres_uint16_t
+<b class="fsfunc">lwres_buffer_getuint16</b>(</code></td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr></table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+void
+<b class="fsfunc">lwres_buffer_putuint16</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr>
+<td><code class="funcdef">
+lwres_uint32_t
+<b class="fsfunc">lwres_buffer_getuint32</b>(</code></td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr></table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+void
+<b class="fsfunc">lwres_buffer_putuint32</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+void
+<b class="fsfunc">lwres_buffer_putmem</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0">
+<tr>
+<td><code class="funcdef">
+void
+<b class="fsfunc">lwres_buffer_getmem</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+</div>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514860"></a><h2>DESCRIPTION</h2>
+<p>
+These functions provide bounds checked access to a region of memory
where data is being read or written.
They are based on, and similar to, the
-<VAR
-CLASS="LITERAL"
->isc_buffer_</VAR
->
-functions in the ISC library.</P
-><P
->A buffer is a region of memory, together with a set of related
+<code class="literal">isc_buffer_</code>
+functions in the ISC library.
+</p>
+<p>
+A buffer is a region of memory, together with a set of related
subregions.
-The <SPAN
-CLASS="emphasis"
-><I
-CLASS="EMPHASIS"
->used region</I
-></SPAN
-> and the
-<SPAN
-CLASS="emphasis"
-><I
-CLASS="EMPHASIS"
->available</I
-></SPAN
-> region are disjoint, and
+The <span class="emphasis"><em>used region</em></span> and the
+<span class="emphasis"><em>available</em></span> region are disjoint, and
their union is the buffer's region.
The used region extends from the beginning of the buffer region to the
last used byte.
@@ -234,60 +269,33 @@ The available region extends from one byte greater than the last used
byte to the end of the buffer's region.
The size of the used region can be changed using various
buffer commands.
-Initially, the used region is empty.</P
-><P
->The used region is further subdivided into two disjoint regions: the
-<SPAN
-CLASS="emphasis"
-><I
-CLASS="EMPHASIS"
->consumed region</I
-></SPAN
-> and the <SPAN
-CLASS="emphasis"
-><I
-CLASS="EMPHASIS"
->remaining region</I
-></SPAN
->.
+Initially, the used region is empty.
+</p>
+<p>
+The used region is further subdivided into two disjoint regions: the
+<span class="emphasis"><em>consumed region</em></span> and the <span class="emphasis"><em>remaining region</em></span>.
The union of these two regions is the used region.
The consumed region extends from the beginning of the used region to
-the byte before the <SPAN
-CLASS="emphasis"
-><I
-CLASS="EMPHASIS"
->current</I
-></SPAN
-> offset (if any).
-The <SPAN
-CLASS="emphasis"
-><I
-CLASS="EMPHASIS"
->remaining</I
-></SPAN
-> region the current pointer to the end of the used
+the byte before the <span class="emphasis"><em>current</em></span> offset (if any).
+The <span class="emphasis"><em>remaining</em></span> region the current pointer to the end of the used
region.
The size of the consumed region can be changed using various
buffer commands.
-Initially, the consumed region is empty.</P
-><P
->The <SPAN
-CLASS="emphasis"
-><I
-CLASS="EMPHASIS"
->active region</I
-></SPAN
-> is an (optional) subregion of the remaining
+Initially, the consumed region is empty.
+</p>
+<p>
+The <span class="emphasis"><em>active region</em></span> is an (optional) subregion of the remaining
region.
It extends from the current offset to an offset in the
remaining region.
Initially, the active region is empty.
If the current offset advances beyond the chosen offset,
-the active region will also be empty.</P
-><P
-><PRE
-CLASS="PROGRAMLISTING"
->
+the active region will also be empty.
+</p>
+<p>
+</p>
+<pre class="programlisting">
+
/------------entire length---------------\\
/----- used region -----\\/-- available --\\
+----------------------------------------+
@@ -305,272 +313,132 @@ CLASS="PROGRAMLISTING"
a-d == used region.
a-b == consumed region.
b-d == remaining region.
- b-c == optional active region.</PRE
-></P
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_buffer_init()</CODE
->
+ b-c == optional active region.
+</pre>
+<p>
+</p>
+<p>
+<code class="function">lwres_buffer_init()</code>
initializes the
-<SPAN
-CLASS="TYPE"
->lwres_buffer_t</SPAN
->
-<VAR
-CLASS="PARAMETER"
->*b</VAR
->
+<span class="type">lwres_buffer_t</span>
+<em class="parameter"><code>*b</code></em>
and assocates it with the memory region of size
-<VAR
-CLASS="PARAMETER"
->length</VAR
->
+<em class="parameter"><code>length</code></em>
bytes starting at location
-<VAR
-CLASS="PARAMETER"
->base.</VAR
-></P
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_buffer_invalidate()</CODE
->
+<em class="parameter"><code>base.</code></em>
+</p>
+<p>
+<code class="function">lwres_buffer_invalidate()</code>
marks the buffer
-<VAR
-CLASS="PARAMETER"
->*b</VAR
->
+<em class="parameter"><code>*b</code></em>
as invalid. Invalidating a buffer after use is not required,
-but makes it possible to catch its possible accidental use.</P
-><P
->The functions
-<CODE
-CLASS="FUNCTION"
->lwres_buffer_add()</CODE
->
+but makes it possible to catch its possible accidental use.
+</p>
+<p>
+The functions
+<code class="function">lwres_buffer_add()</code>
and
-<CODE
-CLASS="FUNCTION"
->lwres_buffer_subtract()</CODE
->
+<code class="function">lwres_buffer_subtract()</code>
respectively increase and decrease the used space in
buffer
-<VAR
-CLASS="PARAMETER"
->*b</VAR
->
+<em class="parameter"><code>*b</code></em>
by
-<VAR
-CLASS="PARAMETER"
->n</VAR
->
+<em class="parameter"><code>n</code></em>
bytes.
-<CODE
-CLASS="FUNCTION"
->lwres_buffer_add()</CODE
->
+<code class="function">lwres_buffer_add()</code>
checks for buffer overflow and
-<CODE
-CLASS="FUNCTION"
->lwres_buffer_subtract()</CODE
->
+<code class="function">lwres_buffer_subtract()</code>
checks for underflow.
These functions do not allocate or deallocate memory.
They just change the value of
-<CODE
-CLASS="STRUCTFIELD"
->used</CODE
->.</P
-><P
->A buffer is re-initialised by
-<CODE
-CLASS="FUNCTION"
->lwres_buffer_clear()</CODE
->.
+<em class="structfield"><code>used</code></em>.
+</p>
+<p>
+A buffer is re-initialised by
+<code class="function">lwres_buffer_clear()</code>.
The function sets
-<CODE
-CLASS="STRUCTFIELD"
->used</CODE
-> ,
-<CODE
-CLASS="STRUCTFIELD"
->current</CODE
->
+<em class="structfield"><code>used</code></em> ,
+<em class="structfield"><code>current</code></em>
and
-<CODE
-CLASS="STRUCTFIELD"
->active</CODE
->
-to zero.</P
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_buffer_first</CODE
->
+<em class="structfield"><code>active</code></em>
+to zero.
+</p>
+<p>
+<code class="function">lwres_buffer_first</code>
makes the consumed region of buffer
-<VAR
-CLASS="PARAMETER"
->*p</VAR
->
+<em class="parameter"><code>*p</code></em>
empty by setting
-<CODE
-CLASS="STRUCTFIELD"
->current</CODE
->
-to zero (the start of the buffer).</P
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_buffer_forward()</CODE
->
+<em class="structfield"><code>current</code></em>
+to zero (the start of the buffer).
+</p>
+<p>
+<code class="function">lwres_buffer_forward()</code>
increases the consumed region of buffer
-<VAR
-CLASS="PARAMETER"
->*b</VAR
->
+<em class="parameter"><code>*b</code></em>
by
-<VAR
-CLASS="PARAMETER"
->n</VAR
->
+<em class="parameter"><code>n</code></em>
bytes, checking for overflow.
Similarly,
-<CODE
-CLASS="FUNCTION"
->lwres_buffer_back()</CODE
->
+<code class="function">lwres_buffer_back()</code>
decreases buffer
-<VAR
-CLASS="PARAMETER"
->b</VAR
->'s
+<em class="parameter"><code>b</code></em>'s
consumed region by
-<VAR
-CLASS="PARAMETER"
->n</VAR
->
-bytes and checks for underflow.</P
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_buffer_getuint8()</CODE
->
+<em class="parameter"><code>n</code></em>
+bytes and checks for underflow.
+</p>
+<p>
+<code class="function">lwres_buffer_getuint8()</code>
reads an unsigned 8-bit integer from
-<VAR
-CLASS="PARAMETER"
->*b</VAR
->
+<em class="parameter"><code>*b</code></em>
and returns it.
-<CODE
-CLASS="FUNCTION"
->lwres_buffer_putuint8()</CODE
->
+<code class="function">lwres_buffer_putuint8()</code>
writes the unsigned 8-bit integer
-<VAR
-CLASS="PARAMETER"
->val</VAR
->
+<em class="parameter"><code>val</code></em>
to buffer
-<VAR
-CLASS="PARAMETER"
->*b</VAR
->.</P
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_buffer_getuint16()</CODE
->
+<em class="parameter"><code>*b</code></em>.
+</p>
+<p>
+<code class="function">lwres_buffer_getuint16()</code>
and
-<CODE
-CLASS="FUNCTION"
->lwres_buffer_getuint32()</CODE
->
+<code class="function">lwres_buffer_getuint32()</code>
are identical to
-<CODE
-CLASS="FUNCTION"
->lwres_buffer_putuint8()</CODE
->
+<code class="function">lwres_buffer_putuint8()</code>
except that they respectively read an unsigned 16-bit or 32-bit integer
in network byte order from
-<VAR
-CLASS="PARAMETER"
->b</VAR
->.
+<em class="parameter"><code>b</code></em>.
Similarly,
-<CODE
-CLASS="FUNCTION"
->lwres_buffer_putuint16()</CODE
->
+<code class="function">lwres_buffer_putuint16()</code>
and
-<CODE
-CLASS="FUNCTION"
->lwres_buffer_putuint32()</CODE
->
+<code class="function">lwres_buffer_putuint32()</code>
writes the unsigned 16-bit or 32-bit integer
-<VAR
-CLASS="PARAMETER"
->val</VAR
->
+<em class="parameter"><code>val</code></em>
to buffer
-<VAR
-CLASS="PARAMETER"
->b</VAR
->,
-in network byte order.</P
-><P
->Arbitrary amounts of data are read or written from a lightweight
+<em class="parameter"><code>b</code></em>,
+in network byte order.
+</p>
+<p>
+Arbitrary amounts of data are read or written from a lightweight
resolver buffer with
-<CODE
-CLASS="FUNCTION"
->lwres_buffer_getmem()</CODE
->
+<code class="function">lwres_buffer_getmem()</code>
and
-<CODE
-CLASS="FUNCTION"
->lwres_buffer_putmem()</CODE
->
+<code class="function">lwres_buffer_putmem()</code>
respectively.
-<CODE
-CLASS="FUNCTION"
->lwres_buffer_putmem()</CODE
->
+<code class="function">lwres_buffer_putmem()</code>
copies
-<VAR
-CLASS="PARAMETER"
->length</VAR
->
+<em class="parameter"><code>length</code></em>
bytes of memory at
-<VAR
-CLASS="PARAMETER"
->base</VAR
->
+<em class="parameter"><code>base</code></em>
to
-<VAR
-CLASS="PARAMETER"
->b</VAR
->.
+<em class="parameter"><code>b</code></em>.
Conversely,
-<CODE
-CLASS="FUNCTION"
->lwres_buffer_getmem()</CODE
->
+<code class="function">lwres_buffer_getmem()</code>
copies
-<VAR
-CLASS="PARAMETER"
->length</VAR
->
+<em class="parameter"><code>length</code></em>
bytes of memory from
-<VAR
-CLASS="PARAMETER"
->b</VAR
->
+<em class="parameter"><code>b</code></em>
to
-<VAR
-CLASS="PARAMETER"
->base</VAR
->.</P
-></DIV
-></BODY
-></HTML
->
+<em class="parameter"><code>base</code></em>.
+</p>
+</div>
+</div></body>
+</html>
diff --git a/lib/lwres/man/lwres_config.3 b/lib/lwres/man/lwres_config.3
index 0c345efa..20d95a3d 100644
--- a/lib/lwres/man/lwres_config.3
+++ b/lib/lwres/man/lwres_config.3
@@ -1,107 +1,75 @@
-.\" Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
-.\" Copyright (C) 2000, 2001 Internet Software Consortium.
-.\"
+.\" Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+.\" Copyright (C) 2000, 2001 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,
+.\" 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: lwres_config.3,v 1.12.2.1.8.1 2004/03/06 07:41:42 marka Exp $
+.\" $Id: lwres_config.3,v 1.12.2.1.8.4 2005/09/12 00:47:30 marka Exp $
.\"
-.TH "LWRES_CONFIG" "3" "Jun 30, 2000" "BIND9" ""
+.hy 0
+.ad l
+.\"Generated by db2man.xsl. Don't modify this, modify the source.
+.de Sh \" Subsection
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Ip \" List item
+.br
+.ie \\n(.$>=3 .ne \\$3
+.el .ne 3
+.IP "\\$1" \\$2
+..
+.TH "LWRES_CONFIG" 3 "Jun 30, 2000" "" ""
.SH NAME
lwres_conf_init, lwres_conf_clear, lwres_conf_parse, lwres_conf_print, lwres_conf_get \- lightweight resolver configuration
-.SH SYNOPSIS
-\fB#include <lwres/lwres.h>
-.sp
-.na
-void
-lwres_conf_init(lwres_context_t *ctx);
-.ad
-.sp
-.na
-void
-lwres_conf_clear(lwres_context_t *ctx);
-.ad
-.sp
-.na
-lwres_result_t
-lwres_conf_parse(lwres_context_t *ctx, const char *filename);
-.ad
-.sp
-.na
-lwres_result_t
-lwres_conf_print(lwres_context_t *ctx, FILE *fp);
-.ad
-.sp
-.na
-lwres_conf_t *
-lwres_conf_get(lwres_context_t *ctx);
-.ad
-\fR
+.SH "SYNOPSIS"
+.nf
+#include <lwres/lwres\&.h>
+.fi
+.HP 22
+void\ \fBlwres_conf_init\fR\ (lwres_context_t\ *ctx);
+.HP 23
+void\ \fBlwres_conf_clear\fR\ (lwres_context_t\ *ctx);
+.HP 33
+lwres_result_t\ \fBlwres_conf_parse\fR\ (lwres_context_t\ *ctx, const\ char\ *filename);
+.HP 33
+lwres_result_t\ \fBlwres_conf_print\fR\ (lwres_context_t\ *ctx, FILE\ *fp);
+.HP 32
+lwres_conf_t\ *\ \fBlwres_conf_get\fR\ (lwres_context_t\ *ctx);
.SH "DESCRIPTION"
.PP
-\fBlwres_conf_init()\fR
-creates an empty
-\fBlwres_conf_t\fR
-structure for lightweight resolver context
-\fIctx\fR.
+ \fBlwres_conf_init()\fR creates an empty \fBlwres_conf_t\fR structure for lightweight resolver context \fIctx\fR\&.
.PP
-\fBlwres_conf_clear()\fR
-frees up all the internal memory used by
-that
-\fBlwres_conf_t\fR
-structure in resolver context
-\fIctx\fR.
+ \fBlwres_conf_clear()\fR frees up all the internal memory used by that \fBlwres_conf_t\fR structure in resolver context \fIctx\fR\&.
.PP
-\fBlwres_conf_parse()\fR
-opens the file
-\fIfilename\fR
-and parses it to initialise the resolver context
-\fIctx\fR's
-\fBlwres_conf_t\fR
-structure.
+ \fBlwres_conf_parse()\fR opens the file \fIfilename\fR and parses it to initialise the resolver context \fIctx\fR's \fBlwres_conf_t\fR structure\&.
.PP
-\fBlwres_conf_print()\fR
-prints the
-\fBlwres_conf_t\fR
-structure for resolver context
-\fIctx\fR
-to the
-\fBFILE\fR
-\fIfp\fR.
+ \fBlwres_conf_print()\fR prints the \fBlwres_conf_t\fR structure for resolver context \fIctx\fR to the \fBFILE\fR \fIfp\fR\&.
.SH "RETURN VALUES"
.PP
-\fBlwres_conf_parse()\fR
-returns
-LWRES_R_SUCCESS
-if it successfully read and parsed
-\fIfilename\fR.
-It returns
-LWRES_R_FAILURE
-if
-\fIfilename\fR
-could not be opened or contained incorrect
-resolver statements.
+ \fBlwres_conf_parse()\fR returns \fBLWRES_R_SUCCESS\fR if it successfully read and parsed \fIfilename\fR\&. It returns \fBLWRES_R_FAILURE\fR if \fIfilename\fR could not be opened or contained incorrect resolver statements\&.
.PP
-\fBlwres_conf_print()\fR
-returns
-LWRES_R_SUCCESS
-unless an error occurred when converting the network addresses to a
-numeric host address string.
-If this happens, the function returns
-LWRES_R_FAILURE.
+ \fBlwres_conf_print()\fR returns \fBLWRES_R_SUCCESS\fR unless an error occurred when converting the network addresses to a numeric host address string\&. If this happens, the function returns \fBLWRES_R_FAILURE\fR\&.
.SH "SEE ALSO"
.PP
-\fBstdio\fR(3),
-\fBresolver\fR(5).
+ \fBstdio\fR(3), \fBresolver\fR(5)\&.
.SH "FILES"
.PP
-\fI/etc/resolv.conf\fR
+ \fI/etc/resolv\&.conf\fR
diff --git a/lib/lwres/man/lwres_config.docbook b/lib/lwres/man/lwres_config.docbook
index eeb244ed..03426beb 100644
--- a/lib/lwres/man/lwres_config.docbook
+++ b/lib/lwres/man/lwres_config.docbook
@@ -1,7 +1,9 @@
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.0//EN"
+ "http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd"
+ [<!ENTITY mdash "&#8212;">]>
<!--
- - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- - Copyright (C) 2001 Internet Software Consortium.
+ - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2000, 2001 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
@@ -16,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: lwres_config.docbook,v 1.2.206.1 2004/03/06 08:15:37 marka Exp $ -->
+<!-- $Id: lwres_config.docbook,v 1.2.206.3 2005/05/12 21:36:12 sra Exp $ -->
<refentry>
<refentryinfo>
@@ -30,6 +32,19 @@
<refmiscinfo>BIND9</refmiscinfo>
</refmeta>
+ <docinfo>
+ <copyright>
+ <year>2004</year>
+ <year>2005</year>
+ <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
+ </copyright>
+ <copyright>
+ <year>2000</year>
+ <year>2001</year>
+ <holder>Internet Software Consortium.</holder>
+ </copyright>
+ </docinfo>
+
<refnamediv>
<refname>lwres_conf_init</refname>
<refname>lwres_conf_clear</refname>
@@ -149,6 +164,7 @@ If this happens, the function returns
<citerefentry>
<refentrytitle>resolver</refentrytitle><manvolnum>5</manvolnum>
</citerefentry>.
+</para>
</refsect1>
<refsect1>
<title>FILES</title>
diff --git a/lib/lwres/man/lwres_config.html b/lib/lwres/man/lwres_config.html
index cd7c63be..41f04877 100644
--- a/lib/lwres/man/lwres_config.html
+++ b/lib/lwres/man/lwres_config.html
@@ -1,282 +1,166 @@
<!--
- - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- - Copyright (C) 2001 Internet Software Consortium.
- -
+ - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2000, 2001 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,
+ - 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: lwres_config.html,v 1.4.2.1.4.2 2004/08/22 23:39:03 marka Exp $ -->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<HTML
-><HEAD
-><TITLE
->lwres_config</TITLE
-><META
-NAME="GENERATOR"
-CONTENT="Modular DocBook HTML Stylesheet Version 1.7"></HEAD
-><BODY
-CLASS="REFENTRY"
-BGCOLOR="#FFFFFF"
-TEXT="#000000"
-LINK="#0000FF"
-VLINK="#840084"
-ALINK="#0000FF"
-><H1
-><A
-NAME="AEN1"
-></A
->lwres_config</H1
-><DIV
-CLASS="REFNAMEDIV"
-><A
-NAME="AEN8"
-></A
-><H2
->Name</H2
->lwres_conf_init, lwres_conf_clear, lwres_conf_parse, lwres_conf_print, lwres_conf_get&nbsp;--&nbsp;lightweight resolver configuration</DIV
-><DIV
-CLASS="REFSYNOPSISDIV"
-><A
-NAME="AEN15"
-></A
-><H2
->Synopsis</H2
-><DIV
-CLASS="FUNCSYNOPSIS"
-><P
-></P
-><A
-NAME="AEN16"
-></A
-><PRE
-CLASS="FUNCSYNOPSISINFO"
->#include &lt;lwres/lwres.h&gt;</PRE
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->void
-lwres_conf_init</CODE
->(lwres_context_t *ctx);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->void
-lwres_conf_clear</CODE
->(lwres_context_t *ctx);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->lwres_result_t
-lwres_conf_parse</CODE
->(lwres_context_t *ctx, const char *filename);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->lwres_result_t
-lwres_conf_print</CODE
->(lwres_context_t *ctx, FILE *fp);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->lwres_conf_t *
-lwres_conf_get</CODE
->(lwres_context_t *ctx);</CODE
-></P
-><P
-></P
-></DIV
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN40"
-></A
-><H2
->DESCRIPTION</H2
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_conf_init()</CODE
->
+<!-- $Id: lwres_config.html,v 1.4.2.1.4.7 2005/07/18 02:36:52 marka Exp $ -->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>lwres_config</title>
+<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
+<a name="id2456972"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2>Name</h2>
+<p>lwres_conf_init, lwres_conf_clear, lwres_conf_parse, lwres_conf_print, lwres_conf_get &#8212; lightweight resolver configuration</p>
+</div>
+<div class="refsynopsisdiv">
+<h2>Synopsis</h2>
+<div class="funcsynopsis">
+<pre class="funcsynopsisinfo">#include &lt;lwres/lwres.h&gt;</pre>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr>
+<td><code class="funcdef">
+void
+<b class="fsfunc">lwres_conf_init</b>(</code></td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr></table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr>
+<td><code class="funcdef">
+void
+<b class="fsfunc">lwres_conf_clear</b>(</code></td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr></table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+lwres_result_t
+<b class="fsfunc">lwres_conf_parse</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+lwres_result_t
+<b class="fsfunc">lwres_conf_print</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr>
+<td><code class="funcdef">
+lwres_conf_t *
+<b class="fsfunc">lwres_conf_get</b>(</code></td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr></table>
+</div>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514593"></a><h2>DESCRIPTION</h2>
+<p>
+<code class="function">lwres_conf_init()</code>
creates an empty
-<SPAN
-CLASS="TYPE"
->lwres_conf_t</SPAN
->
+<span class="type">lwres_conf_t</span>
structure for lightweight resolver context
-<VAR
-CLASS="PARAMETER"
->ctx</VAR
->.</P
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_conf_clear()</CODE
->
+<em class="parameter"><code>ctx</code></em>.
+</p>
+<p>
+<code class="function">lwres_conf_clear()</code>
frees up all the internal memory used by
that
-<SPAN
-CLASS="TYPE"
->lwres_conf_t</SPAN
->
+<span class="type">lwres_conf_t</span>
structure in resolver context
-<VAR
-CLASS="PARAMETER"
->ctx</VAR
->.</P
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_conf_parse()</CODE
->
+<em class="parameter"><code>ctx</code></em>.
+</p>
+<p>
+<code class="function">lwres_conf_parse()</code>
opens the file
-<VAR
-CLASS="PARAMETER"
->filename</VAR
->
+<em class="parameter"><code>filename</code></em>
and parses it to initialise the resolver context
-<VAR
-CLASS="PARAMETER"
->ctx</VAR
->'s
-<SPAN
-CLASS="TYPE"
->lwres_conf_t</SPAN
->
-structure.</P
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_conf_print()</CODE
->
+<em class="parameter"><code>ctx</code></em>'s
+<span class="type">lwres_conf_t</span>
+structure.
+</p>
+<p>
+<code class="function">lwres_conf_print()</code>
prints the
-<SPAN
-CLASS="TYPE"
->lwres_conf_t</SPAN
->
+<span class="type">lwres_conf_t</span>
structure for resolver context
-<VAR
-CLASS="PARAMETER"
->ctx</VAR
->
+<em class="parameter"><code>ctx</code></em>
to the
-<SPAN
-CLASS="TYPE"
->FILE</SPAN
->
-<VAR
-CLASS="PARAMETER"
->fp</VAR
->.</P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN61"
-></A
-><H2
->RETURN VALUES</H2
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_conf_parse()</CODE
->
+<span class="type">FILE</span>
+<em class="parameter"><code>fp</code></em>.
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514664"></a><h2>RETURN VALUES</h2>
+<p>
+<code class="function">lwres_conf_parse()</code>
returns
-<SPAN
-CLASS="ERRORCODE"
->LWRES_R_SUCCESS</SPAN
->
+<span class="errorcode">LWRES_R_SUCCESS</span>
if it successfully read and parsed
-<VAR
-CLASS="PARAMETER"
->filename</VAR
->.
+<em class="parameter"><code>filename</code></em>.
It returns
-<SPAN
-CLASS="ERRORCODE"
->LWRES_R_FAILURE</SPAN
->
+<span class="errorcode">LWRES_R_FAILURE</span>
if
-<VAR
-CLASS="PARAMETER"
->filename</VAR
->
+<em class="parameter"><code>filename</code></em>
could not be opened or contained incorrect
-resolver statements.</P
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_conf_print()</CODE
->
+resolver statements.
+</p>
+<p>
+<code class="function">lwres_conf_print()</code>
returns
-<SPAN
-CLASS="ERRORCODE"
->LWRES_R_SUCCESS</SPAN
->
+<span class="errorcode">LWRES_R_SUCCESS</span>
unless an error occurred when converting the network addresses to a
numeric host address string.
If this happens, the function returns
-<SPAN
-CLASS="ERRORCODE"
->LWRES_R_FAILURE</SPAN
->.</P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN73"
-></A
-><H2
->SEE ALSO</H2
-><P
-><SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->stdio</SPAN
->(3)</SPAN
->,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->resolver</SPAN
->(5)</SPAN
->.</P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN82"
-></A
-><H2
->FILES</H2
-><P
-><TT
-CLASS="FILENAME"
->/etc/resolv.conf</TT
-></P
-></DIV
-></BODY
-></HTML
->
+<span class="errorcode">LWRES_R_FAILURE</span>.
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514772"></a><h2>SEE ALSO</h2>
+<p>
+<span class="citerefentry"><span class="refentrytitle">stdio</span>(3)</span>,
+<span class="citerefentry"><span class="refentrytitle">resolver</span>(5)</span>.
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514798"></a><h2>FILES</h2>
+<p>
+<code class="filename">/etc/resolv.conf</code>
+</p>
+</div>
+</div></body>
+</html>
diff --git a/lib/lwres/man/lwres_context.3 b/lib/lwres/man/lwres_context.3
index d19b18a2..c839781d 100644
--- a/lib/lwres/man/lwres_context.3
+++ b/lib/lwres/man/lwres_context.3
@@ -1,196 +1,84 @@
-.\" Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
-.\" Copyright (C) 2000, 2001 Internet Software Consortium.
-.\"
+.\" Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+.\" Copyright (C) 2000, 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,
+.\" 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: lwres_context.3,v 1.13.2.2.2.2 2004/03/08 09:05:12 marka Exp $
+.\" $Id: lwres_context.3,v 1.13.2.2.2.5 2005/09/12 00:47:26 marka Exp $
.\"
-.TH "LWRES_CONTEXT" "3" "Jun 30, 2000" "BIND9" ""
+.hy 0
+.ad l
+.\"Generated by db2man.xsl. Don't modify this, modify the source.
+.de Sh \" Subsection
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Ip \" List item
+.br
+.ie \\n(.$>=3 .ne \\$3
+.el .ne 3
+.IP "\\$1" \\$2
+..
+.TH "LWRES_CONTEXT" 3 "Jun 30, 2000" "" ""
.SH NAME
lwres_context_create, lwres_context_destroy, lwres_context_nextserial, lwres_context_initserial, lwres_context_freemem, lwres_context_allocmem, lwres_context_sendrecv \- lightweight resolver context management
-.SH SYNOPSIS
-\fB#include <lwres/lwres.h>
-.sp
-.na
-lwres_result_t
-lwres_context_create(lwres_context_t **contextp, void *arg, lwres_malloc_t malloc_function, lwres_free_t free_function);
-.ad
-.sp
-.na
-lwres_result_t
-lwres_context_destroy(lwres_context_t **contextp);
-.ad
-.sp
-.na
-void
-lwres_context_initserial(lwres_context_t *ctx, lwres_uint32_t serial);
-.ad
-.sp
-.na
-lwres_uint32_t
-lwres_context_nextserial(lwres_context_t *ctx);
-.ad
-.sp
-.na
-void
-lwres_context_freemem(lwres_context_t *ctx, void *mem, size_t len);
-.ad
-.sp
-.na
-void
-lwres_context_allocmem(lwres_context_t *ctx, size_t len);
-.ad
-.sp
-.na
-void *
-lwres_context_sendrecv(lwres_context_t *ctx, void *sendbase, int sendlen, void *recvbase, int recvlen, int *recvd_len);
-.ad
-\fR
+.SH "SYNOPSIS"
+.nf
+#include <lwres/lwres\&.h>
+.fi
+.HP 37
+lwres_result_t\ \fBlwres_context_create\fR\ (lwres_context_t\ **contextp, void\ *arg, lwres_malloc_t\ malloc_function, lwres_free_t\ free_function);
+.HP 38
+lwres_result_t\ \fBlwres_context_destroy\fR\ (lwres_context_t\ **contextp);
+.HP 31
+void\ \fBlwres_context_initserial\fR\ (lwres_context_t\ *ctx, lwres_uint32_t\ serial);
+.HP 41
+lwres_uint32_t\ \fBlwres_context_nextserial\fR\ (lwres_context_t\ *ctx);
+.HP 28
+void\ \fBlwres_context_freemem\fR\ (lwres_context_t\ *ctx, void\ *mem, size_t\ len);
+.HP 29
+void\ \fBlwres_context_allocmem\fR\ (lwres_context_t\ *ctx, size_t\ len);
+.HP 32
+void\ *\ \fBlwres_context_sendrecv\fR\ (lwres_context_t\ *ctx, void\ *sendbase, int\ sendlen, void\ *recvbase, int\ recvlen, int\ *recvd_len);
.SH "DESCRIPTION"
.PP
-\fBlwres_context_create()\fR
-creates a
-\fBlwres_context_t\fR
-structure for use in lightweight resolver operations.
-It holds a socket and other data needed for communicating
-with a resolver daemon.
-The new
-\fBlwres_context_t\fR
-is returned through
-\fIcontextp\fR,
-a pointer to a
-\fBlwres_context_t\fR
-pointer. This
-\fBlwres_context_t\fR
-pointer must initially be NULL, and is modified
-to point to the newly created
-\fBlwres_context_t\fR.
+ \fBlwres_context_create()\fR creates a \fBlwres_context_t\fR structure for use in lightweight resolver operations\&. It holds a socket and other data needed for communicating with a resolver daemon\&. The new \fBlwres_context_t\fR is returned through \fIcontextp\fR, a pointer to a \fBlwres_context_t\fR pointer\&. This \fBlwres_context_t\fR pointer must initially be NULL, and is modified to point to the newly created \fBlwres_context_t\fR\&.
.PP
-When the lightweight resolver needs to perform dynamic memory
-allocation, it will call
-\fImalloc_function\fR
-to allocate memory and
-\fIfree_function\fR
-to free it. If
-\fImalloc_function\fR
-and
-\fIfree_function\fR
-are NULL, memory is allocated using
-\&.Xr malloc 3
-and
-\fBfree\fR(3).
-It is not permitted to have a NULL
-\fImalloc_function\fR
-and a non-NULL
-\fIfree_function\fR
-or vice versa.
-\fIarg\fR
-is passed as the first parameter to the memory
-allocation functions.
-If
-\fImalloc_function\fR
-and
-\fIfree_function\fR
-are NULL,
-\fIarg\fR
-is unused and should be passed as NULL.
+When the lightweight resolver needs to perform dynamic memory allocation, it will call \fImalloc_function\fR to allocate memory and \fIfree_function\fR to free it\&. If \fImalloc_function\fR and \fIfree_function\fR are NULL, memory is allocated using \&.Xr malloc 3 and \fBfree\fR(3)\&. It is not permitted to have a NULL \fImalloc_function\fR and a non\-NULL \fIfree_function\fR or vice versa\&. \fIarg\fR is passed as the first parameter to the memory allocation functions\&. If \fImalloc_function\fR and \fIfree_function\fR are NULL, \fIarg\fR is unused and should be passed as NULL\&.
.PP
-Once memory for the structure has been allocated,
-it is initialized using
-\fBlwres_conf_init\fR(3)
-and returned via
-\fI*contextp\fR.
+Once memory for the structure has been allocated, it is initialized using \fBlwres_conf_init\fR(3) and returned via \fI*contextp\fR\&.
.PP
-\fBlwres_context_destroy()\fR
-destroys a
-\fBlwres_context_t\fR,
-closing its socket.
-\fIcontextp\fR
-is a pointer to a pointer to the context that is to be destroyed.
-The pointer will be set to NULL when the context has been destroyed.
+ \fBlwres_context_destroy()\fR destroys a \fBlwres_context_t\fR, closing its socket\&. \fIcontextp\fR is a pointer to a pointer to the context that is to be destroyed\&. The pointer will be set to NULL when the context has been destroyed\&.
.PP
-The context holds a serial number that is used to identify resolver
-request packets and associate responses with the corresponding requests.
-This serial number is controlled using
-\fBlwres_context_initserial()\fR
-and
-\fBlwres_context_nextserial()\fR.
-\fBlwres_context_initserial()\fR
-sets the serial number for context
-\fI*ctx\fR
-to
-\fIserial\fR.
-\fBlwres_context_nextserial()\fR
-increments the serial number and returns the previous value.
+The context holds a serial number that is used to identify resolver request packets and associate responses with the corresponding requests\&. This serial number is controlled using \fBlwres_context_initserial()\fR and \fBlwres_context_nextserial()\fR\&. \fBlwres_context_initserial()\fR sets the serial number for context \fI*ctx\fR to \fIserial\fR\&. \fBlwres_context_nextserial()\fR increments the serial number and returns the previous value\&.
.PP
-Memory for a lightweight resolver context is allocated and freed using
-\fBlwres_context_allocmem()\fR
-and
-\fBlwres_context_freemem()\fR.
-These use whatever allocations were defined when the context was
-created with
-\fBlwres_context_create()\fR.
-\fBlwres_context_allocmem()\fR
-allocates
-\fIlen\fR
-bytes of memory and if successful returns a pointer to the allocated
-storage.
-\fBlwres_context_freemem()\fR
-frees
-\fIlen\fR
-bytes of space starting at location
-\fImem\fR.
+Memory for a lightweight resolver context is allocated and freed using \fBlwres_context_allocmem()\fR and \fBlwres_context_freemem()\fR\&. These use whatever allocations were defined when the context was created with \fBlwres_context_create()\fR\&. \fBlwres_context_allocmem()\fR allocates \fIlen\fR bytes of memory and if successful returns a pointer to the allocated storage\&. \fBlwres_context_freemem()\fR frees \fIlen\fR bytes of space starting at location \fImem\fR\&.
.PP
-\fBlwres_context_sendrecv()\fR
-performs I/O for the context
-\fIctx\fR.
-Data are read and written from the context's socket.
-It writes data from
-\fIsendbase\fR
-\(em typically a lightweight resolver query packet \(em
-and waits for a reply which is copied to the receive buffer at
-\fIrecvbase\fR.
-The number of bytes that were written to this receive buffer is
-returned in
-\fI*recvd_len\fR.
+ \fBlwres_context_sendrecv()\fR performs I/O for the context \fIctx\fR\&. Data are read and written from the context's socket\&. It writes data from \fIsendbase\fR -- typically a lightweight resolver query packet -- and waits for a reply which is copied to the receive buffer at \fIrecvbase\fR\&. The number of bytes that were written to this receive buffer is returned in \fI*recvd_len\fR\&.
.SH "RETURN VALUES"
.PP
-\fBlwres_context_create()\fR
-returns
-LWRES_R_NOMEMORY
-if memory for the
-\fBstruct lwres_context\fR
-could not be allocated,
-LWRES_R_SUCCESS
-otherwise.
+ \fBlwres_context_create()\fR returns \fBLWRES_R_NOMEMORY\fR if memory for the \fBstruct lwres_context\fR could not be allocated, \fBLWRES_R_SUCCESS\fR otherwise\&.
.PP
-Successful calls to the memory allocator
-\fBlwres_context_allocmem()\fR
-return a pointer to the start of the allocated space.
-It returns NULL if memory could not be allocated.
+Successful calls to the memory allocator \fBlwres_context_allocmem()\fR return a pointer to the start of the allocated space\&. It returns NULL if memory could not be allocated\&.
.PP
-LWRES_R_SUCCESS
-is returned when
-\fBlwres_context_sendrecv()\fR
-completes successfully.
-LWRES_R_IOERROR
-is returned if an I/O error occurs and
-LWRES_R_TIMEOUT
-is returned if
-\fBlwres_context_sendrecv()\fR
-times out waiting for a response.
+ \fBLWRES_R_SUCCESS\fR is returned when \fBlwres_context_sendrecv()\fR completes successfully\&. \fBLWRES_R_IOERROR\fR is returned if an I/O error occurs and \fBLWRES_R_TIMEOUT\fR is returned if \fBlwres_context_sendrecv()\fR times out waiting for a response\&.
.SH "SEE ALSO"
.PP
-\fBlwres_conf_init\fR(3),
-\fBmalloc\fR(3),
-\fBfree\fR(3).
+ \fBlwres_conf_init\fR(3), \fBmalloc\fR(3), \fBfree\fR(3 )\&.
diff --git a/lib/lwres/man/lwres_context.docbook b/lib/lwres/man/lwres_context.docbook
index 137e4bc2..48d43362 100644
--- a/lib/lwres/man/lwres_context.docbook
+++ b/lib/lwres/man/lwres_context.docbook
@@ -1,7 +1,9 @@
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.0//EN"
+ "http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd"
+ [<!ENTITY mdash "&#8212;">]>
<!--
- - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- - Copyright (C) 2001, 2003 Internet Software Consortium.
+ - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2000, 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
@@ -16,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: lwres_context.docbook,v 1.3.2.2.2.1 2004/03/06 08:15:38 marka Exp $ -->
+<!-- $Id: lwres_context.docbook,v 1.3.2.2.2.3 2005/05/12 21:36:12 sra Exp $ -->
<refentry>
<refentryinfo>
@@ -29,6 +31,21 @@
<manvolnum>3</manvolnum>
<refmiscinfo>BIND9</refmiscinfo>
</refmeta>
+
+ <docinfo>
+ <copyright>
+ <year>2004</year>
+ <year>2005</year>
+ <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
+ </copyright>
+ <copyright>
+ <year>2000</year>
+ <year>2001</year>
+ <year>2003</year>
+ <holder>Internet Software Consortium.</holder>
+ </copyright>
+ </docinfo>
+
<refnamediv>
<refname>lwres_context_create</refname>
<refname>lwres_context_destroy</refname>
diff --git a/lib/lwres/man/lwres_context.html b/lib/lwres/man/lwres_context.html
index cca12d7d..7ef6a708 100644
--- a/lib/lwres/man/lwres_context.html
+++ b/lib/lwres/man/lwres_context.html
@@ -1,478 +1,335 @@
<!--
- - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- - Copyright (C) 2001 Internet Software Consortium.
- -
+ - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2000, 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,
+ - 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: lwres_context.html,v 1.5.2.2.2.3 2004/08/22 23:39:03 marka Exp $ -->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<HTML
-><HEAD
-><TITLE
->lwres_context</TITLE
-><META
-NAME="GENERATOR"
-CONTENT="Modular DocBook HTML Stylesheet Version 1.7"></HEAD
-><BODY
-CLASS="REFENTRY"
-BGCOLOR="#FFFFFF"
-TEXT="#000000"
-LINK="#0000FF"
-VLINK="#840084"
-ALINK="#0000FF"
-><H1
-><A
-NAME="AEN1"
-></A
->lwres_context</H1
-><DIV
-CLASS="REFNAMEDIV"
-><A
-NAME="AEN8"
-></A
-><H2
->Name</H2
->lwres_context_create, lwres_context_destroy, lwres_context_nextserial, lwres_context_initserial, lwres_context_freemem, lwres_context_allocmem, lwres_context_sendrecv&nbsp;--&nbsp;lightweight resolver context management</DIV
-><DIV
-CLASS="REFSYNOPSISDIV"
-><A
-NAME="AEN17"
-></A
-><H2
->Synopsis</H2
-><DIV
-CLASS="FUNCSYNOPSIS"
-><P
-></P
-><A
-NAME="AEN18"
-></A
-><PRE
-CLASS="FUNCSYNOPSISINFO"
->#include &lt;lwres/lwres.h&gt;</PRE
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->lwres_result_t
-lwres_context_create</CODE
->(lwres_context_t **contextp, void *arg, lwres_malloc_t malloc_function, lwres_free_t free_function);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->lwres_result_t
-lwres_context_destroy</CODE
->(lwres_context_t **contextp);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->void
-lwres_context_initserial</CODE
->(lwres_context_t *ctx, lwres_uint32_t serial);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->lwres_uint32_t
-lwres_context_nextserial</CODE
->(lwres_context_t *ctx);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->void
-lwres_context_freemem</CODE
->(lwres_context_t *ctx, void *mem, size_t len);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->void
-lwres_context_allocmem</CODE
->(lwres_context_t *ctx, size_t len);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->void *
-lwres_context_sendrecv</CODE
->(lwres_context_t *ctx, void *sendbase, int sendlen, void *recvbase, int recvlen, int *recvd_len);</CODE
-></P
-><P
-></P
-></DIV
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN60"
-></A
-><H2
->DESCRIPTION</H2
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_context_create()</CODE
->
+<!-- $Id: lwres_context.html,v 1.5.2.2.2.8 2005/07/18 02:36:52 marka Exp $ -->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>lwres_context</title>
+<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
+<a name="id2456972"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2>Name</h2>
+<p>lwres_context_create, lwres_context_destroy, lwres_context_nextserial, lwres_context_initserial, lwres_context_freemem, lwres_context_allocmem, lwres_context_sendrecv &#8212; lightweight resolver context management</p>
+</div>
+<div class="refsynopsisdiv">
+<h2>Synopsis</h2>
+<div class="funcsynopsis">
+<pre class="funcsynopsisinfo">#include &lt;lwres/lwres.h&gt;</pre>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+lwres_result_t
+<b class="fsfunc">lwres_context_create</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr>
+<td><code class="funcdef">
+lwres_result_t
+<b class="fsfunc">lwres_context_destroy</b>(</code></td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr></table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+void
+<b class="fsfunc">lwres_context_initserial</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr>
+<td><code class="funcdef">
+lwres_uint32_t
+<b class="fsfunc">lwres_context_nextserial</b>(</code></td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr></table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+void
+<b class="fsfunc">lwres_context_freemem</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+void
+<b class="fsfunc">lwres_context_allocmem</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0">
+<tr>
+<td><code class="funcdef">
+void *
+<b class="fsfunc">lwres_context_sendrecv</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+</div>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514658"></a><h2>DESCRIPTION</h2>
+<p>
+<code class="function">lwres_context_create()</code>
creates a
-<SPAN
-CLASS="TYPE"
->lwres_context_t</SPAN
->
+<span class="type">lwres_context_t</span>
structure for use in lightweight resolver operations.
It holds a socket and other data needed for communicating
with a resolver daemon.
The new
-<SPAN
-CLASS="TYPE"
->lwres_context_t</SPAN
->
+<span class="type">lwres_context_t</span>
is returned through
-<VAR
-CLASS="PARAMETER"
->contextp</VAR
->,
+<em class="parameter"><code>contextp</code></em>,
a pointer to a
-<SPAN
-CLASS="TYPE"
->lwres_context_t</SPAN
->
+<span class="type">lwres_context_t</span>
pointer. This
-<SPAN
-CLASS="TYPE"
->lwres_context_t</SPAN
->
+<span class="type">lwres_context_t</span>
pointer must initially be NULL, and is modified
to point to the newly created
-<SPAN
-CLASS="TYPE"
->lwres_context_t</SPAN
->.&#13;</P
-><P
->When the lightweight resolver needs to perform dynamic memory
+<span class="type">lwres_context_t</span>.
+
+</p>
+<p>
+When the lightweight resolver needs to perform dynamic memory
allocation, it will call
-<VAR
-CLASS="PARAMETER"
->malloc_function</VAR
->
+<em class="parameter"><code>malloc_function</code></em>
to allocate memory and
-<VAR
-CLASS="PARAMETER"
->free_function</VAR
->
+<em class="parameter"><code>free_function</code></em>
to free it. If
-<VAR
-CLASS="PARAMETER"
->malloc_function</VAR
->
+<em class="parameter"><code>malloc_function</code></em>
and
-<VAR
-CLASS="PARAMETER"
->free_function</VAR
->
+<em class="parameter"><code>free_function</code></em>
are NULL, memory is allocated using
.Xr malloc 3
and
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->free</SPAN
->(3)</SPAN
->.
+<span class="citerefentry"><span class="refentrytitle">free</span>(3)</span>.
It is not permitted to have a NULL
-<VAR
-CLASS="PARAMETER"
->malloc_function</VAR
->
+<em class="parameter"><code>malloc_function</code></em>
and a non-NULL
-<VAR
-CLASS="PARAMETER"
->free_function</VAR
->
+<em class="parameter"><code>free_function</code></em>
or vice versa.
-<VAR
-CLASS="PARAMETER"
->arg</VAR
->
+<em class="parameter"><code>arg</code></em>
is passed as the first parameter to the memory
allocation functions.
If
-<VAR
-CLASS="PARAMETER"
->malloc_function</VAR
->
+<em class="parameter"><code>malloc_function</code></em>
and
-<VAR
-CLASS="PARAMETER"
->free_function</VAR
->
+<em class="parameter"><code>free_function</code></em>
are NULL,
-<VAR
-CLASS="PARAMETER"
->arg</VAR
->
+<em class="parameter"><code>arg</code></em>
-is unused and should be passed as NULL.</P
-><P
->Once memory for the structure has been allocated,
+is unused and should be passed as NULL.
+</p>
+<p>
+Once memory for the structure has been allocated,
it is initialized using
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->lwres_conf_init</SPAN
->(3)</SPAN
->
+<span class="citerefentry"><span class="refentrytitle">lwres_conf_init</span>(3)</span>
and returned via
-<VAR
-CLASS="PARAMETER"
->*contextp</VAR
->.&#13;</P
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_context_destroy()</CODE
->
+<em class="parameter"><code>*contextp</code></em>.
+
+</p>
+<p>
+<code class="function">lwres_context_destroy()</code>
destroys a
-<SPAN
-CLASS="TYPE"
->lwres_context_t</SPAN
->,
+<span class="type">lwres_context_t</span>,
closing its socket.
-<VAR
-CLASS="PARAMETER"
->contextp</VAR
->
+<em class="parameter"><code>contextp</code></em>
is a pointer to a pointer to the context that is to be destroyed.
-The pointer will be set to NULL when the context has been destroyed.</P
-><P
->The context holds a serial number that is used to identify resolver
+The pointer will be set to NULL when the context has been destroyed.
+</p>
+<p>
+The context holds a serial number that is used to identify resolver
request packets and associate responses with the corresponding requests.
This serial number is controlled using
-<CODE
-CLASS="FUNCTION"
->lwres_context_initserial()</CODE
->
+<code class="function">lwres_context_initserial()</code>
and
-<CODE
-CLASS="FUNCTION"
->lwres_context_nextserial()</CODE
->.
-<CODE
-CLASS="FUNCTION"
->lwres_context_initserial()</CODE
->
+<code class="function">lwres_context_nextserial()</code>.
+<code class="function">lwres_context_initserial()</code>
sets the serial number for context
-<VAR
-CLASS="PARAMETER"
->*ctx</VAR
->
+<em class="parameter"><code>*ctx</code></em>
to
-<VAR
-CLASS="PARAMETER"
->serial</VAR
->.
+<em class="parameter"><code>serial</code></em>.
-<CODE
-CLASS="FUNCTION"
->lwres_context_nextserial()</CODE
->
-increments the serial number and returns the previous value.</P
-><P
->Memory for a lightweight resolver context is allocated and freed using
-<CODE
-CLASS="FUNCTION"
->lwres_context_allocmem()</CODE
->
+<code class="function">lwres_context_nextserial()</code>
+increments the serial number and returns the previous value.
+</p>
+<p>
+Memory for a lightweight resolver context is allocated and freed using
+<code class="function">lwres_context_allocmem()</code>
and
-<CODE
-CLASS="FUNCTION"
->lwres_context_freemem()</CODE
->.
+<code class="function">lwres_context_freemem()</code>.
These use whatever allocations were defined when the context was
created with
-<CODE
-CLASS="FUNCTION"
->lwres_context_create()</CODE
->.
-<CODE
-CLASS="FUNCTION"
->lwres_context_allocmem()</CODE
->
+<code class="function">lwres_context_create()</code>.
+<code class="function">lwres_context_allocmem()</code>
allocates
-<VAR
-CLASS="PARAMETER"
->len</VAR
->
+<em class="parameter"><code>len</code></em>
bytes of memory and if successful returns a pointer to the allocated
storage.
-<CODE
-CLASS="FUNCTION"
->lwres_context_freemem()</CODE
->
+<code class="function">lwres_context_freemem()</code>
frees
-<VAR
-CLASS="PARAMETER"
->len</VAR
->
+<em class="parameter"><code>len</code></em>
bytes of space starting at location
-<VAR
-CLASS="PARAMETER"
->mem</VAR
->.&#13;</P
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_context_sendrecv()</CODE
->
+<em class="parameter"><code>mem</code></em>.
+
+</p>
+<p>
+<code class="function">lwres_context_sendrecv()</code>
performs I/O for the context
-<VAR
-CLASS="PARAMETER"
->ctx</VAR
->.
+<em class="parameter"><code>ctx</code></em>.
Data are read and written from the context's socket.
It writes data from
-<VAR
-CLASS="PARAMETER"
->sendbase</VAR
->
-&mdash; typically a lightweight resolver query packet &mdash;
+<em class="parameter"><code>sendbase</code></em>
+&#8212; typically a lightweight resolver query packet &#8212;
and waits for a reply which is copied to the receive buffer at
-<VAR
-CLASS="PARAMETER"
->recvbase</VAR
->.
+<em class="parameter"><code>recvbase</code></em>.
The number of bytes that were written to this receive buffer is
returned in
-<VAR
-CLASS="PARAMETER"
->*recvd_len</VAR
->.&#13;</P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN115"
-></A
-><H2
->RETURN VALUES</H2
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_context_create()</CODE
->
+<em class="parameter"><code>*recvd_len</code></em>.
+
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514976"></a><h2>RETURN VALUES</h2>
+<p>
+<code class="function">lwres_context_create()</code>
returns
-<SPAN
-CLASS="ERRORCODE"
->LWRES_R_NOMEMORY</SPAN
->
+<span class="errorcode">LWRES_R_NOMEMORY</span>
if memory for the
-<SPAN
-CLASS="TYPE"
->struct lwres_context</SPAN
->
+<span class="type">struct lwres_context</span>
could not be allocated,
-<SPAN
-CLASS="ERRORCODE"
->LWRES_R_SUCCESS</SPAN
->
-otherwise.</P
-><P
->Successful calls to the memory allocator
-<CODE
-CLASS="FUNCTION"
->lwres_context_allocmem()</CODE
->
+<span class="errorcode">LWRES_R_SUCCESS</span>
+otherwise.
+</p>
+<p>
+Successful calls to the memory allocator
+<code class="function">lwres_context_allocmem()</code>
return a pointer to the start of the allocated space.
-It returns NULL if memory could not be allocated.</P
-><P
-><SPAN
-CLASS="ERRORCODE"
->LWRES_R_SUCCESS</SPAN
->
+It returns NULL if memory could not be allocated.
+</p>
+<p>
+<span class="errorcode">LWRES_R_SUCCESS</span>
is returned when
-<CODE
-CLASS="FUNCTION"
->lwres_context_sendrecv()</CODE
->
+<code class="function">lwres_context_sendrecv()</code>
completes successfully.
-<SPAN
-CLASS="ERRORCODE"
->LWRES_R_IOERROR</SPAN
->
+<span class="errorcode">LWRES_R_IOERROR</span>
is returned if an I/O error occurs and
-<SPAN
-CLASS="ERRORCODE"
->LWRES_R_TIMEOUT</SPAN
->
+<span class="errorcode">LWRES_R_TIMEOUT</span>
is returned if
-<CODE
-CLASS="FUNCTION"
->lwres_context_sendrecv()</CODE
->
-times out waiting for a response.</P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN130"
-></A
-><H2
->SEE ALSO</H2
-><P
-><SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->lwres_conf_init</SPAN
->(3)</SPAN
->,
+<code class="function">lwres_context_sendrecv()</code>
+times out waiting for a response.
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2515027"></a><h2>SEE ALSO</h2>
+<p>
+<span class="citerefentry"><span class="refentrytitle">lwres_conf_init</span>(3)</span>,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->malloc</SPAN
->(3)</SPAN
->,
+<span class="citerefentry"><span class="refentrytitle">malloc</span>(3)</span>,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->free</SPAN
->(3)</SPAN
->.</P
-></DIV
-></BODY
-></HTML
->
+<span class="citerefentry"><span class="refentrytitle">free</span>(3
+)</span>.
+</p>
+</div>
+</div></body>
+</html>
diff --git a/lib/lwres/man/lwres_gabn.3 b/lib/lwres/man/lwres_gabn.3
index a309f3e6..07bd783b 100644
--- a/lib/lwres/man/lwres_gabn.3
+++ b/lib/lwres/man/lwres_gabn.3
@@ -1,91 +1,77 @@
-.\" Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
-.\" Copyright (C) 2000, 2001 Internet Software Consortium.
-.\"
+.\" Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+.\" Copyright (C) 2000, 2001 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,
+.\" 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: lwres_gabn.3,v 1.13.2.1.8.1 2004/03/06 07:41:42 marka Exp $
+.\" $Id: lwres_gabn.3,v 1.13.2.1.8.4 2005/09/12 00:47:26 marka Exp $
.\"
-.TH "LWRES_GABN" "3" "Jun 30, 2000" "BIND9" ""
+.hy 0
+.ad l
+.\"Generated by db2man.xsl. Don't modify this, modify the source.
+.de Sh \" Subsection
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Ip \" List item
+.br
+.ie \\n(.$>=3 .ne \\$3
+.el .ne 3
+.IP "\\$1" \\$2
+..
+.TH "LWRES_GABN" 3 "Jun 30, 2000" "" ""
.SH NAME
lwres_gabnrequest_render, lwres_gabnresponse_render, lwres_gabnrequest_parse, lwres_gabnresponse_parse, lwres_gabnresponse_free, lwres_gabnrequest_free \- lightweight resolver getaddrbyname message handling
-.SH SYNOPSIS
-\fB#include <lwres/lwres.h>
-.sp
-.na
-lwres_result_t
-lwres_gabnrequest_render(lwres_context_t *ctx, lwres_gabnrequest_t *req, lwres_lwpacket_t *pkt, lwres_buffer_t *b);
-.ad
-.sp
-.na
-lwres_result_t
-lwres_gabnresponse_render(lwres_context_t *ctx, lwres_gabnresponse_t *req, lwres_lwpacket_t *pkt, lwres_buffer_t *b);
-.ad
-.sp
-.na
-lwres_result_t
-lwres_gabnrequest_parse(lwres_context_t *ctx, lwres_buffer_t *b, lwres_lwpacket_t *pkt, lwres_gabnrequest_t **structp);
-.ad
-.sp
-.na
-lwres_result_t
-lwres_gabnresponse_parse(lwres_context_t *ctx, lwres_buffer_t *b, lwres_lwpacket_t *pkt, lwres_gabnresponse_t **structp);
-.ad
-.sp
-.na
-void
-lwres_gabnresponse_free(lwres_context_t *ctx, lwres_gabnresponse_t **structp);
-.ad
-.sp
-.na
-void
-lwres_gabnrequest_free(lwres_context_t *ctx, lwres_gabnrequest_t **structp);
-.ad
-\fR
+.SH "SYNOPSIS"
+.nf
+#include <lwres/lwres\&.h>
+.fi
+.HP 41
+lwres_result_t\ \fBlwres_gabnrequest_render\fR\ (lwres_context_t\ *ctx, lwres_gabnrequest_t\ *req, lwres_lwpacket_t\ *pkt, lwres_buffer_t\ *b);
+.HP 42
+lwres_result_t\ \fBlwres_gabnresponse_render\fR\ (lwres_context_t\ *ctx, lwres_gabnresponse_t\ *req, lwres_lwpacket_t\ *pkt, lwres_buffer_t\ *b);
+.HP 40
+lwres_result_t\ \fBlwres_gabnrequest_parse\fR\ (lwres_context_t\ *ctx, lwres_buffer_t\ *b, lwres_lwpacket_t\ *pkt, lwres_gabnrequest_t\ **structp);
+.HP 41
+lwres_result_t\ \fBlwres_gabnresponse_parse\fR\ (lwres_context_t\ *ctx, lwres_buffer_t\ *b, lwres_lwpacket_t\ *pkt, lwres_gabnresponse_t\ **structp);
+.HP 30
+void\ \fBlwres_gabnresponse_free\fR\ (lwres_context_t\ *ctx, lwres_gabnresponse_t\ **structp);
+.HP 29
+void\ \fBlwres_gabnrequest_free\fR\ (lwres_context_t\ *ctx, lwres_gabnrequest_t\ **structp);
.SH "DESCRIPTION"
.PP
-These are low-level routines for creating and parsing
-lightweight resolver name-to-address lookup request and
-response messages.
+These are low\-level routines for creating and parsing lightweight resolver name\-to\-address lookup request and response messages\&.
.PP
-There are four main functions for the getaddrbyname opcode.
-One render function converts a getaddrbyname request structure \(em
-\fBlwres_gabnrequest_t\fR \(em
-to the lighweight resolver's canonical format.
-It is complemented by a parse function that converts a packet in this
-canonical format to a getaddrbyname request structure.
-Another render function converts the getaddrbyname response structure \(em
-\fBlwres_gabnresponse_t\fR \(em
-to the canonical format.
-This is complemented by a parse function which converts a packet in
-canonical format to a getaddrbyname response structure.
+There are four main functions for the getaddrbyname opcode\&. One render function converts a getaddrbyname request structure -- \fBlwres_gabnrequest_t\fR -- to the lighweight resolver's canonical format\&. It is complemented by a parse function that converts a packet in this canonical format to a getaddrbyname request structure\&. Another render function converts the getaddrbyname response structure -- \fBlwres_gabnresponse_t\fR -- to the canonical format\&. This is complemented by a parse function which converts a packet in canonical format to a getaddrbyname response structure\&.
.PP
-These structures are defined in
-\fI<lwres/lwres.h>\fR.
-They are shown below.
-.sp
+These structures are defined in \fI<lwres/lwres\&.h>\fR\&. They are shown below\&.
.nf
#define LWRES_OPCODE_GETADDRSBYNAME 0x00010001U
-
typedef struct lwres_addr lwres_addr_t;
typedef LWRES_LIST(lwres_addr_t) lwres_addrlist_t;
-
typedef struct {
lwres_uint32_t flags;
lwres_uint32_t addrtypes;
lwres_uint16_t namelen;
char *name;
} lwres_gabnrequest_t;
-
typedef struct {
lwres_uint32_t flags;
lwres_uint16_t naliases;
@@ -98,98 +84,16 @@ typedef struct {
void *base;
size_t baselen;
} lwres_gabnresponse_t;
-.sp
.fi
.PP
-\fBlwres_gabnrequest_render()\fR
-uses resolver context
-\fIctx\fR
-to convert getaddrbyname request structure
-\fIreq\fR
-to canonical format.
-The packet header structure
-\fIpkt\fR
-is initialised and transferred to
-buffer
-\fIb\fR.
-The contents of
-\fI*req\fR
-are then appended to the buffer in canonical format.
-\fBlwres_gabnresponse_render()\fR
-performs the same task, except it converts a getaddrbyname response structure
-\fBlwres_gabnresponse_t\fR
-to the lightweight resolver's canonical format.
+ \fBlwres_gabnrequest_render()\fR uses resolver context \fIctx\fR to convert getaddrbyname request structure \fIreq\fR to canonical format\&. The packet header structure \fIpkt\fR is initialised and transferred to buffer \fIb\fR\&. The contents of \fI*req\fR are then appended to the buffer in canonical format\&. \fBlwres_gabnresponse_render()\fR performs the same task, except it converts a getaddrbyname response structure \fBlwres_gabnresponse_t\fR to the lightweight resolver's canonical format\&.
.PP
-\fBlwres_gabnrequest_parse()\fR
-uses context
-\fIctx\fR
-to convert the contents of packet
-\fIpkt\fR
-to a
-\fBlwres_gabnrequest_t\fR
-structure.
-Buffer
-\fIb\fR
-provides space to be used for storing this structure.
-When the function succeeds, the resulting
-\fBlwres_gabnrequest_t\fR
-is made available through
-\fI*structp\fR.
-\fBlwres_gabnresponse_parse()\fR
-offers the same semantics as
-\fBlwres_gabnrequest_parse()\fR
-except it yields a
-\fBlwres_gabnresponse_t\fR
-structure.
+ \fBlwres_gabnrequest_parse()\fR uses context \fIctx\fR to convert the contents of packet \fIpkt\fR to a \fBlwres_gabnrequest_t\fR structure\&. Buffer \fIb\fR provides space to be used for storing this structure\&. When the function succeeds, the resulting \fBlwres_gabnrequest_t\fR is made available through \fI*structp\fR\&. \fBlwres_gabnresponse_parse()\fR offers the same semantics as \fBlwres_gabnrequest_parse()\fR except it yields a \fBlwres_gabnresponse_t\fR structure\&.
.PP
-\fBlwres_gabnresponse_free()\fR
-and
-\fBlwres_gabnrequest_free()\fR
-release the memory in resolver context
-\fIctx\fR
-that was allocated to the
-\fBlwres_gabnresponse_t\fR
-or
-\fBlwres_gabnrequest_t\fR
-structures referenced via
-\fIstructp\fR.
-Any memory associated with ancillary buffers and strings for those
-structures is also discarded.
+ \fBlwres_gabnresponse_free()\fR and \fBlwres_gabnrequest_free()\fR release the memory in resolver context \fIctx\fR that was allocated to the \fBlwres_gabnresponse_t\fR or \fBlwres_gabnrequest_t\fR structures referenced via \fIstructp\fR\&. Any memory associated with ancillary buffers and strings for those structures is also discarded\&.
.SH "RETURN VALUES"
.PP
-The getaddrbyname opcode functions
-\fBlwres_gabnrequest_render()\fR,
-\fBlwres_gabnresponse_render()\fR
-\fBlwres_gabnrequest_parse()\fR
-and
-\fBlwres_gabnresponse_parse()\fR
-all return
-LWRES_R_SUCCESS
-on success.
-They return
-LWRES_R_NOMEMORY
-if memory allocation fails.
-LWRES_R_UNEXPECTEDEND
-is returned if the available space in the buffer
-\fIb\fR
-is too small to accommodate the packet header or the
-\fBlwres_gabnrequest_t\fR
-and
-\fBlwres_gabnresponse_t\fR
-structures.
-\fBlwres_gabnrequest_parse()\fR
-and
-\fBlwres_gabnresponse_parse()\fR
-will return
-LWRES_R_UNEXPECTEDEND
-if the buffer is not empty after decoding the received packet.
-These functions will return
-LWRES_R_FAILURE
-if
-\fBpktflags\fR
-in the packet header structure
-\fBlwres_lwpacket_t\fR
-indicate that the packet is not a response to an earlier query.
+The getaddrbyname opcode functions \fBlwres_gabnrequest_render()\fR, \fBlwres_gabnresponse_render()\fR \fBlwres_gabnrequest_parse()\fR and \fBlwres_gabnresponse_parse()\fR all return \fBLWRES_R_SUCCESS\fR on success\&. They return \fBLWRES_R_NOMEMORY\fR if memory allocation fails\&. \fBLWRES_R_UNEXPECTEDEND\fR is returned if the available space in the buffer \fIb\fR is too small to accommodate the packet header or the \fBlwres_gabnrequest_t\fR and \fBlwres_gabnresponse_t\fR structures\&. \fBlwres_gabnrequest_parse()\fR and \fBlwres_gabnresponse_parse()\fR will return \fBLWRES_R_UNEXPECTEDEND\fR if the buffer is not empty after decoding the received packet\&. These functions will return \fBLWRES_R_FAILURE\fR if pktflags in the packet header structure \fBlwres_lwpacket_t\fR indicate that the packet is not a response to an earlier query\&.
.SH "SEE ALSO"
.PP
-\fBlwres_packet\fR(3)
+ \fBlwres_packet\fR(3 )
diff --git a/lib/lwres/man/lwres_gabn.docbook b/lib/lwres/man/lwres_gabn.docbook
index cb9481f4..6e90ea39 100644
--- a/lib/lwres/man/lwres_gabn.docbook
+++ b/lib/lwres/man/lwres_gabn.docbook
@@ -1,7 +1,9 @@
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.0//EN"
+ "http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd"
+ [<!ENTITY mdash "&#8212;">]>
<!--
- - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- - Copyright (C) 2001 Internet Software Consortium.
+ - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2000, 2001 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
@@ -16,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: lwres_gabn.docbook,v 1.3.206.1 2004/03/06 08:15:38 marka Exp $ -->
+<!-- $Id: lwres_gabn.docbook,v 1.3.206.3 2005/05/12 21:36:12 sra Exp $ -->
<refentry>
<refentryinfo>
@@ -29,6 +31,20 @@
<manvolnum>3</manvolnum>
<refmiscinfo>BIND9</refmiscinfo>
</refmeta>
+
+ <docinfo>
+ <copyright>
+ <year>2004</year>
+ <year>2005</year>
+ <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
+ </copyright>
+ <copyright>
+ <year>2000</year>
+ <year>2001</year>
+ <holder>Internet Software Consortium.</holder>
+ </copyright>
+ </docinfo>
+
<refnamediv>
<refname>lwres_gabnrequest_render</refname>
<refname>lwres_gabnresponse_render</refname>
diff --git a/lib/lwres/man/lwres_gabn.html b/lib/lwres/man/lwres_gabn.html
index 6cb6614c..a1cf0728 100644
--- a/lib/lwres/man/lwres_gabn.html
+++ b/lib/lwres/man/lwres_gabn.html
@@ -1,158 +1,195 @@
<!--
- - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- - Copyright (C) 2001 Internet Software Consortium.
- -
+ - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2000, 2001 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,
+ - 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: lwres_gabn.html,v 1.6.2.1.4.2 2004/08/22 23:39:03 marka Exp $ -->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<HTML
-><HEAD
-><TITLE
->lwres_gabn</TITLE
-><META
-NAME="GENERATOR"
-CONTENT="Modular DocBook HTML Stylesheet Version 1.7"></HEAD
-><BODY
-CLASS="REFENTRY"
-BGCOLOR="#FFFFFF"
-TEXT="#000000"
-LINK="#0000FF"
-VLINK="#840084"
-ALINK="#0000FF"
-><H1
-><A
-NAME="AEN1"
-></A
->lwres_gabn</H1
-><DIV
-CLASS="REFNAMEDIV"
-><A
-NAME="AEN8"
-></A
-><H2
->Name</H2
->lwres_gabnrequest_render, lwres_gabnresponse_render, lwres_gabnrequest_parse, lwres_gabnresponse_parse, lwres_gabnresponse_free, lwres_gabnrequest_free&nbsp;--&nbsp;lightweight resolver getaddrbyname message handling</DIV
-><DIV
-CLASS="REFSYNOPSISDIV"
-><A
-NAME="AEN16"
-></A
-><H2
->Synopsis</H2
-><DIV
-CLASS="FUNCSYNOPSIS"
-><P
-></P
-><A
-NAME="AEN17"
-></A
-><PRE
-CLASS="FUNCSYNOPSISINFO"
->#include &lt;lwres/lwres.h&gt;</PRE
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->lwres_result_t
-lwres_gabnrequest_render</CODE
->(lwres_context_t *ctx, lwres_gabnrequest_t *req, lwres_lwpacket_t *pkt, lwres_buffer_t *b);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->lwres_result_t
-lwres_gabnresponse_render</CODE
->(lwres_context_t *ctx, lwres_gabnresponse_t *req, lwres_lwpacket_t *pkt, lwres_buffer_t *b);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->lwres_result_t
-lwres_gabnrequest_parse</CODE
->(lwres_context_t *ctx, lwres_buffer_t *b, lwres_lwpacket_t *pkt, lwres_gabnrequest_t **structp);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->lwres_result_t
-lwres_gabnresponse_parse</CODE
->(lwres_context_t *ctx, lwres_buffer_t *b, lwres_lwpacket_t *pkt, lwres_gabnresponse_t **structp);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->void
-lwres_gabnresponse_free</CODE
->(lwres_context_t *ctx, lwres_gabnresponse_t **structp);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->void
-lwres_gabnrequest_free</CODE
->(lwres_context_t *ctx, lwres_gabnrequest_t **structp);</CODE
-></P
-><P
-></P
-></DIV
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN57"
-></A
-><H2
->DESCRIPTION</H2
-><P
->These are low-level routines for creating and parsing
+<!-- $Id: lwres_gabn.html,v 1.6.2.1.4.7 2005/07/18 02:36:52 marka Exp $ -->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>lwres_gabn</title>
+<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
+<a name="id2456972"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2>Name</h2>
+<p>lwres_gabnrequest_render, lwres_gabnresponse_render, lwres_gabnrequest_parse, lwres_gabnresponse_parse, lwres_gabnresponse_free, lwres_gabnrequest_free &#8212; lightweight resolver getaddrbyname message handling</p>
+</div>
+<div class="refsynopsisdiv">
+<h2>Synopsis</h2>
+<div class="funcsynopsis">
+<pre class="funcsynopsisinfo">#include &lt;lwres/lwres.h&gt;</pre>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+lwres_result_t
+<b class="fsfunc">lwres_gabnrequest_render</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+lwres_result_t
+<b class="fsfunc">lwres_gabnresponse_render</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+lwres_result_t
+<b class="fsfunc">lwres_gabnrequest_parse</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+lwres_result_t
+<b class="fsfunc">lwres_gabnresponse_parse</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+void
+<b class="fsfunc">lwres_gabnresponse_free</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0">
+<tr>
+<td><code class="funcdef">
+void
+<b class="fsfunc">lwres_gabnrequest_free</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+</div>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514646"></a><h2>DESCRIPTION</h2>
+<p>
+These are low-level routines for creating and parsing
lightweight resolver name-to-address lookup request and
-response messages.</P
-><P
->There are four main functions for the getaddrbyname opcode.
-One render function converts a getaddrbyname request structure &mdash;
-<SPAN
-CLASS="TYPE"
->lwres_gabnrequest_t</SPAN
-> &mdash;
+response messages.
+</p>
+<p>
+There are four main functions for the getaddrbyname opcode.
+One render function converts a getaddrbyname request structure &#8212;
+<span class="type">lwres_gabnrequest_t</span> &#8212;
to the lighweight resolver's canonical format.
It is complemented by a parse function that converts a packet in this
canonical format to a getaddrbyname request structure.
-Another render function converts the getaddrbyname response structure &mdash;
-<SPAN
-CLASS="TYPE"
->lwres_gabnresponse_t</SPAN
-> &mdash;
+Another render function converts the getaddrbyname response structure &#8212;
+<span class="type">lwres_gabnresponse_t</span> &#8212;
to the canonical format.
This is complemented by a parse function which converts a packet in
-canonical format to a getaddrbyname response structure.</P
-><P
->These structures are defined in
-<TT
-CLASS="FILENAME"
->&lt;lwres/lwres.h&gt;</TT
->.
+canonical format to a getaddrbyname response structure.
+</p>
+<p>
+These structures are defined in
+<code class="filename">&lt;lwres/lwres.h&gt;</code>.
They are shown below.
-<PRE
-CLASS="PROGRAMLISTING"
->#define LWRES_OPCODE_GETADDRSBYNAME 0x00010001U
+</p>
+<pre class="programlisting">
+#define LWRES_OPCODE_GETADDRSBYNAME 0x00010001U
typedef struct lwres_addr lwres_addr_t;
typedef LWRES_LIST(lwres_addr_t) lwres_addrlist_t;
@@ -175,245 +212,116 @@ typedef struct {
lwres_addrlist_t addrs;
void *base;
size_t baselen;
-} lwres_gabnresponse_t;</PRE
-></P
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_gabnrequest_render()</CODE
->
+} lwres_gabnresponse_t;
+</pre>
+<p>
+</p>
+<p>
+<code class="function">lwres_gabnrequest_render()</code>
uses resolver context
-<VAR
-CLASS="PARAMETER"
->ctx</VAR
->
+<em class="parameter"><code>ctx</code></em>
to convert getaddrbyname request structure
-<VAR
-CLASS="PARAMETER"
->req</VAR
->
+<em class="parameter"><code>req</code></em>
to canonical format.
The packet header structure
-<VAR
-CLASS="PARAMETER"
->pkt</VAR
->
+<em class="parameter"><code>pkt</code></em>
is initialised and transferred to
buffer
-<VAR
-CLASS="PARAMETER"
->b</VAR
->.
+<em class="parameter"><code>b</code></em>.
The contents of
-<VAR
-CLASS="PARAMETER"
->*req</VAR
->
+<em class="parameter"><code>*req</code></em>
are then appended to the buffer in canonical format.
-<CODE
-CLASS="FUNCTION"
->lwres_gabnresponse_render()</CODE
->
+<code class="function">lwres_gabnresponse_render()</code>
performs the same task, except it converts a getaddrbyname response structure
-<SPAN
-CLASS="TYPE"
->lwres_gabnresponse_t</SPAN
->
-to the lightweight resolver's canonical format.</P
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_gabnrequest_parse()</CODE
->
+<span class="type">lwres_gabnresponse_t</span>
+to the lightweight resolver's canonical format.
+</p>
+<p>
+<code class="function">lwres_gabnrequest_parse()</code>
uses context
-<VAR
-CLASS="PARAMETER"
->ctx</VAR
->
+<em class="parameter"><code>ctx</code></em>
to convert the contents of packet
-<VAR
-CLASS="PARAMETER"
->pkt</VAR
->
+<em class="parameter"><code>pkt</code></em>
to a
-<SPAN
-CLASS="TYPE"
->lwres_gabnrequest_t</SPAN
->
+<span class="type">lwres_gabnrequest_t</span>
structure.
Buffer
-<VAR
-CLASS="PARAMETER"
->b</VAR
->
+<em class="parameter"><code>b</code></em>
provides space to be used for storing this structure.
When the function succeeds, the resulting
-<SPAN
-CLASS="TYPE"
->lwres_gabnrequest_t</SPAN
->
+<span class="type">lwres_gabnrequest_t</span>
is made available through
-<VAR
-CLASS="PARAMETER"
->*structp</VAR
->.
+<em class="parameter"><code>*structp</code></em>.
-<CODE
-CLASS="FUNCTION"
->lwres_gabnresponse_parse()</CODE
->
+<code class="function">lwres_gabnresponse_parse()</code>
offers the same semantics as
-<CODE
-CLASS="FUNCTION"
->lwres_gabnrequest_parse()</CODE
->
+<code class="function">lwres_gabnrequest_parse()</code>
except it yields a
-<SPAN
-CLASS="TYPE"
->lwres_gabnresponse_t</SPAN
->
-structure.</P
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_gabnresponse_free()</CODE
->
+<span class="type">lwres_gabnresponse_t</span>
+structure.
+</p>
+<p>
+<code class="function">lwres_gabnresponse_free()</code>
and
-<CODE
-CLASS="FUNCTION"
->lwres_gabnrequest_free()</CODE
->
+<code class="function">lwres_gabnrequest_free()</code>
release the memory in resolver context
-<VAR
-CLASS="PARAMETER"
->ctx</VAR
->
+<em class="parameter"><code>ctx</code></em>
that was allocated to the
-<SPAN
-CLASS="TYPE"
->lwres_gabnresponse_t</SPAN
->
+<span class="type">lwres_gabnresponse_t</span>
or
-<SPAN
-CLASS="TYPE"
->lwres_gabnrequest_t</SPAN
->
+<span class="type">lwres_gabnrequest_t</span>
structures referenced via
-<VAR
-CLASS="PARAMETER"
->structp</VAR
->.
+<em class="parameter"><code>structp</code></em>.
Any memory associated with ancillary buffers and strings for those
-structures is also discarded.</P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN93"
-></A
-><H2
->RETURN VALUES</H2
-><P
->The getaddrbyname opcode functions
-<CODE
-CLASS="FUNCTION"
->lwres_gabnrequest_render()</CODE
->,
-<CODE
-CLASS="FUNCTION"
->lwres_gabnresponse_render()</CODE
->
-<CODE
-CLASS="FUNCTION"
->lwres_gabnrequest_parse()</CODE
->
+structures is also discarded.
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514906"></a><h2>RETURN VALUES</h2>
+<p>
+The getaddrbyname opcode functions
+<code class="function">lwres_gabnrequest_render()</code>,
+<code class="function">lwres_gabnresponse_render()</code>
+<code class="function">lwres_gabnrequest_parse()</code>
and
-<CODE
-CLASS="FUNCTION"
->lwres_gabnresponse_parse()</CODE
->
+<code class="function">lwres_gabnresponse_parse()</code>
all return
-<SPAN
-CLASS="ERRORCODE"
->LWRES_R_SUCCESS</SPAN
->
+<span class="errorcode">LWRES_R_SUCCESS</span>
on success.
They return
-<SPAN
-CLASS="ERRORCODE"
->LWRES_R_NOMEMORY</SPAN
->
+<span class="errorcode">LWRES_R_NOMEMORY</span>
if memory allocation fails.
-<SPAN
-CLASS="ERRORCODE"
->LWRES_R_UNEXPECTEDEND</SPAN
->
+<span class="errorcode">LWRES_R_UNEXPECTEDEND</span>
is returned if the available space in the buffer
-<VAR
-CLASS="PARAMETER"
->b</VAR
->
+<em class="parameter"><code>b</code></em>
is too small to accommodate the packet header or the
-<SPAN
-CLASS="TYPE"
->lwres_gabnrequest_t</SPAN
->
+<span class="type">lwres_gabnrequest_t</span>
and
-<SPAN
-CLASS="TYPE"
->lwres_gabnresponse_t</SPAN
->
+<span class="type">lwres_gabnresponse_t</span>
structures.
-<CODE
-CLASS="FUNCTION"
->lwres_gabnrequest_parse()</CODE
->
+<code class="function">lwres_gabnrequest_parse()</code>
and
-<CODE
-CLASS="FUNCTION"
->lwres_gabnresponse_parse()</CODE
->
+<code class="function">lwres_gabnresponse_parse()</code>
will return
-<SPAN
-CLASS="ERRORCODE"
->LWRES_R_UNEXPECTEDEND</SPAN
->
+<span class="errorcode">LWRES_R_UNEXPECTEDEND</span>
if the buffer is not empty after decoding the received packet.
These functions will return
-<SPAN
-CLASS="ERRORCODE"
->LWRES_R_FAILURE</SPAN
->
+<span class="errorcode">LWRES_R_FAILURE</span>
if
-<CODE
-CLASS="STRUCTFIELD"
->pktflags</CODE
->
+<em class="structfield"><code>pktflags</code></em>
in the packet header structure
-<SPAN
-CLASS="TYPE"
->lwres_lwpacket_t</SPAN
->
-indicate that the packet is not a response to an earlier query.</P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN112"
-></A
-><H2
->SEE ALSO</H2
-><P
-><SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->lwres_packet</SPAN
->(3)</SPAN
-></P
-></DIV
-></BODY
-></HTML
->
+<span class="type">lwres_lwpacket_t</span>
+indicate that the packet is not a response to an earlier query.
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2515040"></a><h2>SEE ALSO</h2>
+<p>
+<span class="citerefentry"><span class="refentrytitle">lwres_packet</span>(3
+)</span>
+</p>
+</div>
+</div></body>
+</html>
diff --git a/lib/lwres/man/lwres_gai_strerror.3 b/lib/lwres/man/lwres_gai_strerror.3
index ea75066f..90086bbe 100644
--- a/lib/lwres/man/lwres_gai_strerror.3
+++ b/lib/lwres/man/lwres_gai_strerror.3
@@ -1,38 +1,53 @@
-.\" Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
-.\" Copyright (C) 2000, 2001 Internet Software Consortium.
-.\"
+.\" Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+.\" Copyright (C) 2000, 2001 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,
+.\" 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: lwres_gai_strerror.3,v 1.13.2.1.8.1 2004/03/06 07:41:43 marka Exp $
+.\" $Id: lwres_gai_strerror.3,v 1.13.2.1.8.4 2005/09/12 00:47:26 marka Exp $
.\"
-.TH "LWRES_GAI_STRERROR" "3" "Jun 30, 2000" "BIND9" ""
+.hy 0
+.ad l
+.\"Generated by db2man.xsl. Don't modify this, modify the source.
+.de Sh \" Subsection
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Ip \" List item
+.br
+.ie \\n(.$>=3 .ne \\$3
+.el .ne 3
+.IP "\\$1" \\$2
+..
+.TH "LWRES_GAI_STRERROR" 3 "Jun 30, 2000" "" ""
.SH NAME
gai_strerror \- print suitable error string
-.SH SYNOPSIS
-\fB#include <lwres/netdb.h>
-.sp
-.na
-char *
-gai_strerror(int ecode);
-.ad
-\fR
+.SH "SYNOPSIS"
+.nf
+#include <lwres/netdb\&.h>
+.fi
+.HP 22
+char\ *\ \fBgai_strerror\fR\ (int\ ecode);
.SH "DESCRIPTION"
.PP
-\fBlwres_gai_strerror()\fR
-returns an error message corresponding to an error code returned by
-\fBgetaddrinfo()\fR.
-The following error codes and their meaning are defined in
-\fIinclude/lwres/netdb.h\fR.
+ \fBlwres_gai_strerror()\fR returns an error message corresponding to an error code returned by \fBgetaddrinfo()\fR\&. The following error codes and their meaning are defined in \fIinclude/lwres/netdb\&.h\fR\&.
.TP
\fBEAI_ADDRFAMILY\fR
address family for hostname not supported
@@ -41,14 +56,13 @@ address family for hostname not supported
temporary failure in name resolution
.TP
\fBEAI_BADFLAGS\fR
-invalid value for
-ai_flags
+invalid value for \fBai_flags\fR
.TP
\fBEAI_FAIL\fR
-non-recoverable failure in name resolution
+non\-recoverable failure in name resolution
.TP
\fBEAI_FAMILY\fR
-ai_family not supported
+ \fBai_family\fR not supported
.TP
\fBEAI_MEMORY\fR
memory allocation failure
@@ -60,29 +74,16 @@ no address associated with hostname
hostname or servname not provided, or not known
.TP
\fBEAI_SERVICE\fR
-servname not supported for ai_socktype
+servname not supported for \fBai_socktype\fR
.TP
\fBEAI_SOCKTYPE\fR
-ai_socktype not supported
+ \fBai_socktype\fR not supported
.TP
\fBEAI_SYSTEM\fR
system error returned in errno
+ The message invalid error code is returned if \fIecode\fR is out of range\&.
.PP
-The message \fBinvalid error code\fR is returned if
-\fIecode\fR
-is out of range.
-.PP
-ai_flags,
-ai_family
-and
-ai_socktype
-are elements of the
-\fBstruct addrinfo\fR
-used by
-\fBlwres_getaddrinfo()\fR.
+ \fBai_flags\fR, \fBai_family\fR and \fBai_socktype\fR are elements of the \fBstruct addrinfo\fR used by \fBlwres_getaddrinfo()\fR\&.
.SH "SEE ALSO"
.PP
-\fBstrerror\fR(3),
-\fBlwres_getaddrinfo\fR(3),
-\fBgetaddrinfo\fR(3),
-\fBRFC2133\fR.
+ \fBstrerror\fR(3), \fBlwres_getaddrinfo\fR(3), \fBgetaddrinfo\fR(3), \fBRFC2133\fR()\&.
diff --git a/lib/lwres/man/lwres_gai_strerror.docbook b/lib/lwres/man/lwres_gai_strerror.docbook
index 475d4441..f34836d2 100644
--- a/lib/lwres/man/lwres_gai_strerror.docbook
+++ b/lib/lwres/man/lwres_gai_strerror.docbook
@@ -1,7 +1,9 @@
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.0//EN"
+ "http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd"
+ [<!ENTITY mdash "&#8212;">]>
<!--
- - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- - Copyright (C) 2001 Internet Software Consortium.
+ - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2000, 2001 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
@@ -16,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: lwres_gai_strerror.docbook,v 1.3.206.1 2004/03/06 08:15:38 marka Exp $ -->
+<!-- $Id: lwres_gai_strerror.docbook,v 1.3.206.3 2005/05/12 21:36:13 sra Exp $ -->
<refentry>
<refentryinfo>
@@ -29,6 +31,20 @@
<manvolnum>3</manvolnum>
<refmiscinfo>BIND9</refmiscinfo>
</refmeta>
+
+ <docinfo>
+ <copyright>
+ <year>2004</year>
+ <year>2005</year>
+ <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
+ </copyright>
+ <copyright>
+ <year>2000</year>
+ <year>2001</year>
+ <holder>Internet Software Consortium.</holder>
+ </copyright>
+ </docinfo>
+
<refnamediv>
<refname>gai_strerror</refname>
<refpurpose>print suitable error string</refpurpose>
diff --git a/lib/lwres/man/lwres_gai_strerror.html b/lib/lwres/man/lwres_gai_strerror.html
index 45dc5cb3..f54fa509 100644
--- a/lib/lwres/man/lwres_gai_strerror.html
+++ b/lib/lwres/man/lwres_gai_strerror.html
@@ -1,295 +1,124 @@
<!--
- - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- - Copyright (C) 2001 Internet Software Consortium.
- -
+ - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2000, 2001 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,
+ - 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: lwres_gai_strerror.html,v 1.5.2.1.4.2 2004/08/22 23:39:03 marka Exp $ -->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<HTML
-><HEAD
-><TITLE
->lwres_gai_strerror</TITLE
-><META
-NAME="GENERATOR"
-CONTENT="Modular DocBook HTML Stylesheet Version 1.7"></HEAD
-><BODY
-CLASS="REFENTRY"
-BGCOLOR="#FFFFFF"
-TEXT="#000000"
-LINK="#0000FF"
-VLINK="#840084"
-ALINK="#0000FF"
-><H1
-><A
-NAME="AEN1"
-></A
->lwres_gai_strerror</H1
-><DIV
-CLASS="REFNAMEDIV"
-><A
-NAME="AEN8"
-></A
-><H2
->Name</H2
->gai_strerror&nbsp;--&nbsp;print suitable error string</DIV
-><DIV
-CLASS="REFSYNOPSISDIV"
-><A
-NAME="AEN11"
-></A
-><H2
->Synopsis</H2
-><DIV
-CLASS="FUNCSYNOPSIS"
-><P
-></P
-><A
-NAME="AEN12"
-></A
-><PRE
-CLASS="FUNCSYNOPSISINFO"
->#include &lt;lwres/netdb.h&gt;</PRE
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->char *
-gai_strerror</CODE
->(int ecode);</CODE
-></P
-><P
-></P
-></DIV
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN18"
-></A
-><H2
->DESCRIPTION</H2
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_gai_strerror()</CODE
->
+<!-- $Id: lwres_gai_strerror.html,v 1.5.2.1.4.7 2005/07/18 02:36:52 marka Exp $ -->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>lwres_gai_strerror</title>
+<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
+<a name="id2456972"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2>Name</h2>
+<p>gai_strerror &#8212; print suitable error string</p>
+</div>
+<div class="refsynopsisdiv">
+<h2>Synopsis</h2>
+<div class="funcsynopsis">
+<pre class="funcsynopsisinfo">#include &lt;lwres/netdb.h&gt;</pre>
+<p><code class="funcdef">
+char *
+<b class="fsfunc">gai_strerror</b>(</code>int ecode<code>)</code>;</p>
+</div>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514525"></a><h2>DESCRIPTION</h2>
+<p>
+<code class="function">lwres_gai_strerror()</code>
returns an error message corresponding to an error code returned by
-<CODE
-CLASS="FUNCTION"
->getaddrinfo()</CODE
->.
+<code class="function">getaddrinfo()</code>.
The following error codes and their meaning are defined in
-<TT
-CLASS="FILENAME"
->include/lwres/netdb.h</TT
->.
-<P
-></P
-><DIV
-CLASS="VARIABLELIST"
-><DL
-><DT
-><SPAN
-CLASS="ERRORCODE"
->EAI_ADDRFAMILY</SPAN
-></DT
-><DD
-><P
->address family for hostname not supported</P
-></DD
-><DT
-><SPAN
-CLASS="ERRORCODE"
->EAI_AGAIN</SPAN
-></DT
-><DD
-><P
->temporary failure in name resolution</P
-></DD
-><DT
-><SPAN
-CLASS="ERRORCODE"
->EAI_BADFLAGS</SPAN
-></DT
-><DD
-><P
->invalid value for
-<CODE
-CLASS="CONSTANT"
->ai_flags</CODE
-></P
-></DD
-><DT
-><SPAN
-CLASS="ERRORCODE"
->EAI_FAIL</SPAN
-></DT
-><DD
-><P
->non-recoverable failure in name resolution</P
-></DD
-><DT
-><SPAN
-CLASS="ERRORCODE"
->EAI_FAMILY</SPAN
-></DT
-><DD
-><P
-><CODE
-CLASS="CONSTANT"
->ai_family</CODE
-> not supported</P
-></DD
-><DT
-><SPAN
-CLASS="ERRORCODE"
->EAI_MEMORY</SPAN
-></DT
-><DD
-><P
->memory allocation failure</P
-></DD
-><DT
-><SPAN
-CLASS="ERRORCODE"
->EAI_NODATA</SPAN
-></DT
-><DD
-><P
->no address associated with hostname</P
-></DD
-><DT
-><SPAN
-CLASS="ERRORCODE"
->EAI_NONAME</SPAN
-></DT
-><DD
-><P
->hostname or servname not provided, or not known</P
-></DD
-><DT
-><SPAN
-CLASS="ERRORCODE"
->EAI_SERVICE</SPAN
-></DT
-><DD
-><P
->servname not supported for <CODE
-CLASS="CONSTANT"
->ai_socktype</CODE
-></P
-></DD
-><DT
-><SPAN
-CLASS="ERRORCODE"
->EAI_SOCKTYPE</SPAN
-></DT
-><DD
-><P
-><CODE
-CLASS="CONSTANT"
->ai_socktype</CODE
-> not supported</P
-></DD
-><DT
-><SPAN
-CLASS="ERRORCODE"
->EAI_SYSTEM</SPAN
-></DT
-><DD
-><P
->system error returned in errno</P
-></DD
-></DL
-></DIV
->
-The message <SPAN
-CLASS="ERRORNAME"
->invalid error code</SPAN
-> is returned if
-<VAR
-CLASS="PARAMETER"
->ecode</VAR
->
-is out of range.</P
-><P
-><CODE
-CLASS="CONSTANT"
->ai_flags</CODE
->,
-<CODE
-CLASS="CONSTANT"
->ai_family</CODE
->
+<code class="filename">include/lwres/netdb.h</code>.
+</p>
+<div class="variablelist"><dl>
+<dt><span class="term"><span class="errorcode">EAI_ADDRFAMILY</span></span></dt>
+<dd><p>
+address family for hostname not supported
+</p></dd>
+<dt><span class="term"><span class="errorcode">EAI_AGAIN</span></span></dt>
+<dd><p>
+temporary failure in name resolution
+</p></dd>
+<dt><span class="term"><span class="errorcode">EAI_BADFLAGS</span></span></dt>
+<dd><p>
+invalid value for
+<code class="constant">ai_flags</code>
+</p></dd>
+<dt><span class="term"><span class="errorcode">EAI_FAIL</span></span></dt>
+<dd><p>
+non-recoverable failure in name resolution
+</p></dd>
+<dt><span class="term"><span class="errorcode">EAI_FAMILY</span></span></dt>
+<dd><p>
+<code class="constant">ai_family</code> not supported
+</p></dd>
+<dt><span class="term"><span class="errorcode">EAI_MEMORY</span></span></dt>
+<dd><p>
+memory allocation failure
+</p></dd>
+<dt><span class="term"><span class="errorcode">EAI_NODATA</span></span></dt>
+<dd><p>
+no address associated with hostname
+</p></dd>
+<dt><span class="term"><span class="errorcode">EAI_NONAME</span></span></dt>
+<dd><p>
+hostname or servname not provided, or not known
+</p></dd>
+<dt><span class="term"><span class="errorcode">EAI_SERVICE</span></span></dt>
+<dd><p>
+servname not supported for <code class="constant">ai_socktype</code>
+</p></dd>
+<dt><span class="term"><span class="errorcode">EAI_SOCKTYPE</span></span></dt>
+<dd><p>
+<code class="constant">ai_socktype</code> not supported
+</p></dd>
+<dt><span class="term"><span class="errorcode">EAI_SYSTEM</span></span></dt>
+<dd><p>
+system error returned in errno
+</p></dd>
+</dl></div>
+<p>
+The message <span class="errorname">invalid error code</span> is returned if
+<em class="parameter"><code>ecode</code></em>
+is out of range.
+</p>
+<p>
+<code class="constant">ai_flags</code>,
+<code class="constant">ai_family</code>
and
-<CODE
-CLASS="CONSTANT"
->ai_socktype</CODE
->
+<code class="constant">ai_socktype</code>
are elements of the
-<SPAN
-CLASS="TYPE"
->struct addrinfo</SPAN
->
+<span class="type">struct addrinfo</span>
used by
-<CODE
-CLASS="FUNCTION"
->lwres_getaddrinfo()</CODE
->.</P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN92"
-></A
-><H2
->SEE ALSO</H2
-><P
-><SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->strerror</SPAN
->(3)</SPAN
->,
+<code class="function">lwres_getaddrinfo()</code>.
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514791"></a><h2>SEE ALSO</h2>
+<p>
+<span class="citerefentry"><span class="refentrytitle">strerror</span>(3)</span>,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->lwres_getaddrinfo</SPAN
->(3)</SPAN
->,
+<span class="citerefentry"><span class="refentrytitle">lwres_getaddrinfo</span>(3)</span>,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->getaddrinfo</SPAN
->(3)</SPAN
->,
+<span class="citerefentry"><span class="refentrytitle">getaddrinfo</span>(3)</span>,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->RFC2133</SPAN
-></SPAN
->.</P
-></DIV
-></BODY
-></HTML
->
+<span class="citerefentry"><span class="refentrytitle">RFC2133</span></span>.
+</p>
+</div>
+</div></body>
+</html>
diff --git a/lib/lwres/man/lwres_getaddrinfo.3 b/lib/lwres/man/lwres_getaddrinfo.3
index d360b3e8..3b9ea6c6 100644
--- a/lib/lwres/man/lwres_getaddrinfo.3
+++ b/lib/lwres/man/lwres_getaddrinfo.3
@@ -1,41 +1,54 @@
-.\" Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
-.\" Copyright (C) 2000, 2001 Internet Software Consortium.
-.\"
+.\" Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+.\" Copyright (C) 2000, 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,
+.\" 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: lwres_getaddrinfo.3,v 1.16.2.1.8.2 2004/03/06 07:41:43 marka Exp $
+.\" $Id: lwres_getaddrinfo.3,v 1.16.2.1.8.5 2005/09/12 00:47:26 marka Exp $
.\"
-.TH "LWRES_GETADDRINFO" "3" "Jun 30, 2000" "BIND9" ""
+.hy 0
+.ad l
+.\"Generated by db2man.xsl. Don't modify this, modify the source.
+.de Sh \" Subsection
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Ip \" List item
+.br
+.ie \\n(.$>=3 .ne \\$3
+.el .ne 3
+.IP "\\$1" \\$2
+..
+.TH "LWRES_GETADDRINFO" 3 "Jun 30, 2000" "" ""
.SH NAME
lwres_getaddrinfo, lwres_freeaddrinfo \- socket address structure to host and service name
-.SH SYNOPSIS
-\fB#include <lwres/netdb.h>
-.sp
-.na
-int
-lwres_getaddrinfo(const char *hostname, const char *servname, const struct addrinfo *hints, struct addrinfo **res);
-.ad
-.sp
-.na
-void
-lwres_freeaddrinfo(struct addrinfo *ai);
-.ad
-\fR
+.SH "SYNOPSIS"
+.nf
+#include <lwres/netdb\&.h>
+.fi
+.HP 23
+int\ \fBlwres_getaddrinfo\fR\ (const\ char\ *hostname, const\ char\ *servname, const\ struct\ addrinfo\ *hints, struct\ addrinfo\ **res);
+.HP 25
+void\ \fBlwres_freeaddrinfo\fR\ (struct\ addrinfo\ *ai);
.PP
-If the operating system does not provide a
-\fBstruct addrinfo\fR,
-the following structure is used:
-.sp
+If the operating system does not provide a \fBstruct addrinfo\fR, the following structure is used:
.nf
struct addrinfo {
int ai_flags; /* AI_PASSIVE, AI_CANONNAME */
@@ -47,203 +60,37 @@ struct addrinfo {
struct sockaddr *ai_addr; /* binary address */
struct addrinfo *ai_next; /* next structure in linked list */
};
-.sp
.fi
.SH "DESCRIPTION"
.PP
-\fBlwres_getaddrinfo()\fR
-is used to get a list of IP addresses and port numbers for host
-\fIhostname\fR
-and service
-\fIservname\fR.
-The function is the lightweight resolver's implementation of
-\fBgetaddrinfo()\fR
-as defined in RFC2133.
-\fIhostname\fR
-and
-\fIservname\fR
-are pointers to null-terminated
-strings or
-\fBNULL\fR.
-\fIhostname\fR
-is either a host name or a numeric host address string: a dotted decimal
-IPv4 address or an IPv6 address.
-\fIservname\fR
-is either a decimal port number or a service name as listed in
-\fI/etc/services\fR.
+ \fBlwres_getaddrinfo()\fR is used to get a list of IP addresses and port numbers for host \fIhostname\fR and service \fIservname\fR\&. The function is the lightweight resolver's implementation of \fBgetaddrinfo()\fR as defined in RFC2133\&. \fIhostname\fR and \fIservname\fR are pointers to null\-terminated strings or \fBNULL\fR\&. \fIhostname\fR is either a host name or a numeric host address string: a dotted decimal IPv4 address or an IPv6 address\&. \fIservname\fR is either a decimal port number or a service name as listed in \fI/etc/services\fR\&.
.PP
-\fIhints\fR
-is an optional pointer to a
-\fBstruct addrinfo\fR.
-This structure can be used to provide hints concerning the type of socket
-that the caller supports or wishes to use.
-The caller can supply the following structure elements in
-\fI*hints\fR:
+ \fIhints\fR is an optional pointer to a \fBstruct addrinfo\fR\&. This structure can be used to provide hints concerning the type of socket that the caller supports or wishes to use\&. The caller can supply the following structure elements in \fI*hints\fR:
.TP
\fBai_family\fR
-The protocol family that should be used.
-When
-ai_family
-is set to
-\fBPF_UNSPEC\fR,
-it means the caller will accept any protocol family supported by the
-operating system.
+The protocol family that should be used\&. When \fBai_family\fR is set to \fBPF_UNSPEC\fR, it means the caller will accept any protocol family supported by the operating system\&.
.TP
\fBai_socktype\fR
-denotes the type of socket \(em
-\fBSOCK_STREAM\fR,
-\fBSOCK_DGRAM\fR
-or
-\fBSOCK_RAW\fR
-\(em that is wanted.
-When
-ai_socktype
-is zero the caller will accept any socket type.
+denotes the type of socket -- \fBSOCK_STREAM\fR, \fBSOCK_DGRAM\fR or \fBSOCK_RAW\fR -- that is wanted\&. When \fBai_socktype\fR is zero the caller will accept any socket type\&.
.TP
\fBai_protocol\fR
-indicates which transport protocol is wanted: IPPROTO_UDP or
-IPPROTO_TCP.
-If
-ai_protocol
-is zero the caller will accept any protocol.
+indicates which transport protocol is wanted: IPPROTO_UDP or IPPROTO_TCP\&. If \fBai_protocol\fR is zero the caller will accept any protocol\&.
.TP
\fBai_flags\fR
-Flag bits.
-If the
-\fBAI_CANONNAME\fR
-bit is set, a successful call to
-\fBlwres_getaddrinfo()\fR
-will return a null-terminated string containing the canonical name
-of the specified hostname in
-ai_canonname
-of the first
-\fBaddrinfo\fR
-structure returned.
-Setting the
-\fBAI_PASSIVE\fR
-bit indicates that the returned socket address structure is intended
-for used in a call to
-\fBbind\fR(2).
-In this case, if the hostname argument is a
-\fBNULL\fR
-pointer, then the IP address portion of the socket
-address structure will be set to
-\fBINADDR_ANY\fR
-for an IPv4 address or
-\fBIN6ADDR_ANY_INIT\fR
-for an IPv6 address.
-
-When
-ai_flags
-does not set the
-\fBAI_PASSIVE\fR
-bit, the returned socket address structure will be ready
-for use in a call to
-\fBconnect\fR(2)
-for a connection-oriented protocol or
-\fBconnect\fR(2),
-\fBsendto\fR(2),
-or
-\fBsendmsg\fR(2)
-if a connectionless protocol was chosen.
-The IP address portion of the socket address structure will be
-set to the loopback address if
-\fIhostname\fR
-is a
-\fBNULL\fR
-pointer and
-\fBAI_PASSIVE\fR
-is not set in
-ai_flags.
-
-If
-ai_flags
-is set to
-\fBAI_NUMERICHOST\fR
-it indicates that
-\fIhostname\fR
-should be treated as a numeric string defining an IPv4 or IPv6 address
-and no name resolution should be attempted.
+Flag bits\&. If the \fBAI_CANONNAME\fR bit is set, a successful call to \fBlwres_getaddrinfo()\fR will return a null\-terminated string containing the canonical name of the specified hostname in \fBai_canonname\fR of the first \fBaddrinfo\fR structure returned\&. Setting the \fBAI_PASSIVE\fR bit indicates that the returned socket address structure is intended for used in a call to \fBbind\fR(2)\&. In this case, if the hostname argument is a \fBNULL\fR pointer, then the IP address portion of the socket address structure will be set to \fBINADDR_ANY\fR for an IPv4 address or \fBIN6ADDR_ANY_INIT\fR for an IPv6 address\&.
+When \fBai_flags\fR does not set the \fBAI_PASSIVE\fR bit, the returned socket address structure will be ready for use in a call to \fBconnect\fR(2 ) for a connection\-oriented protocol or \fBconnect\fR(2), \fBsendto\fR(2), or \fBsendmsg\fR(2 ) if a connectionless protocol was chosen\&. The IP address portion of the socket address structure will be set to the loopback address if \fIhostname\fR is a \fBNULL\fR pointer and \fBAI_PASSIVE\fR is not set in \fBai_flags\fR\&.
+If \fBai_flags\fR is set to \fBAI_NUMERICHOST\fR it indicates that \fIhostname\fR should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted\&.
.PP
-All other elements of the \fBstruct addrinfo\fR passed
-via \fIhints\fR must be zero.
+All other elements of the \fBstruct addrinfo\fR passed via \fIhints\fR must be zero\&.
.PP
-A \fIhints\fR of \fBNULL\fR is treated as if
-the caller provided a \fBstruct addrinfo\fR initialized to zero
-with ai_familyset to
-PF_UNSPEC.
+A \fIhints\fR of \fBNULL\fR is treated as if the caller provided a \fBstruct addrinfo\fR initialized to zero with \fBai_family\fRset to \fBPF_UNSPEC\fR\&.
.PP
-After a successful call to
-\fBlwres_getaddrinfo()\fR,
-\fI*res\fR
-is a pointer to a linked list of one or more
-\fBaddrinfo\fR
-structures.
-Each
-\fBstruct addrinfo\fR
-in this list cn be processed by following
-the
-ai_next
-pointer, until a
-\fBNULL\fR
-pointer is encountered.
-The three members
-ai_family,
-ai_socktype,
-and
-ai_protocol
-in each
-returned
-\fBaddrinfo\fR
-structure contain the corresponding arguments for a call to
-\fBsocket\fR(2).
-For each
-\fBaddrinfo\fR
-structure in the list, the
-ai_addr
-member points to a filled-in socket address structure of length
-ai_addrlen.
+After a successful call to \fBlwres_getaddrinfo()\fR, \fI*res\fR is a pointer to a linked list of one or more \fBaddrinfo\fR structures\&. Each \fBstruct addrinfo\fR in this list cn be processed by following the \fBai_next\fR pointer, until a \fBNULL\fR pointer is encountered\&. The three members \fBai_family\fR, \fBai_socktype\fR, and \fBai_protocol\fR in each returned \fBaddrinfo\fR structure contain the corresponding arguments for a call to \fBsocket\fR(2)\&. For each \fBaddrinfo\fR structure in the list, the \fBai_addr\fR member points to a filled\-in socket address structure of length \fBai_addrlen\fR\&.
.PP
-All of the information returned by
-\fBlwres_getaddrinfo()\fR
-is dynamically allocated: the addrinfo structures, and the socket
-address structures and canonical host name strings pointed to by the
-addrinfostructures.
-Memory allocated for the dynamically allocated structures created by
-a successful call to
-\fBlwres_getaddrinfo()\fR
-is released by
-\fBlwres_freeaddrinfo()\fR.
-\fIai\fR
-is a pointer to a
-\fBstruct addrinfo\fR
-created by a call to
-\fBlwres_getaddrinfo()\fR.
+All of the information returned by \fBlwres_getaddrinfo()\fR is dynamically allocated: the addrinfo structures, and the socket address structures and canonical host name strings pointed to by the \fBaddrinfo\fRstructures\&. Memory allocated for the dynamically allocated structures created by a successful call to \fBlwres_getaddrinfo()\fR is released by \fBlwres_freeaddrinfo()\fR\&. \fIai\fR is a pointer to a \fBstruct addrinfo\fR created by a call to \fBlwres_getaddrinfo()\fR\&.
.SH "RETURN VALUES"
.PP
-\fBlwres_getaddrinfo()\fR
-returns zero on success or one of the error codes listed in
-\fBgai_strerror\fR(3)
-if an error occurs.
-If both
-\fIhostname\fR
-and
-\fIservname\fR
-are
-\fBNULL\fR
-\fBlwres_getaddrinfo()\fR
-returns
-EAI_NONAME.
+ \fBlwres_getaddrinfo()\fR returns zero on success or one of the error codes listed in \fBgai_strerror\fR(3 ) if an error occurs\&. If both \fIhostname\fR and \fIservname\fR are \fBNULL\fR \fBlwres_getaddrinfo()\fR returns \fBEAI_NONAME\fR\&.
.SH "SEE ALSO"
.PP
-\fBlwres\fR(3),
-\fBlwres_getaddrinfo\fR(3),
-\fBlwres_freeaddrinfo\fR(3),
-\fBlwres_gai_strerror\fR(3),
-\fBRFC2133\fR,
-\fBgetservbyname\fR(3),
-\fBbind\fR(2),
-\fBconnect\fR(2),
-\fBsendto\fR(2),
-\fBsendmsg\fR(2),
-\fBsocket\fR(2).
+ \fBlwres\fR(3), \fBlwres_getaddrinfo\fR(3), \fBlwres_freeaddrinfo\fR(3), \fBlwres_gai_strerror\fR(3), \fBRFC2133\fR(), \fBgetservbyname\fR(3), \fBbind\fR(2), \fBconnect\fR(2), \fBsendto\fR(2), \fBsendmsg\fR(2), \fBsocket\fR(2)\&.
diff --git a/lib/lwres/man/lwres_getaddrinfo.docbook b/lib/lwres/man/lwres_getaddrinfo.docbook
index 2f2fc829..19072192 100644
--- a/lib/lwres/man/lwres_getaddrinfo.docbook
+++ b/lib/lwres/man/lwres_getaddrinfo.docbook
@@ -1,7 +1,9 @@
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.0//EN"
+ "http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd"
+ [<!ENTITY mdash "&#8212;">]>
<!--
- - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- - Copyright (C) 2001, 2003 Internet Software Consortium.
+ - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2000, 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
@@ -16,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: lwres_getaddrinfo.docbook,v 1.5.206.2 2004/03/06 08:15:39 marka Exp $ -->
+<!-- $Id: lwres_getaddrinfo.docbook,v 1.5.206.4 2005/05/12 21:36:14 sra Exp $ -->
<refentry>
@@ -30,6 +32,20 @@
<refmiscinfo>BIND9</refmiscinfo>
</refmeta>
+ <docinfo>
+ <copyright>
+ <year>2004</year>
+ <year>2005</year>
+ <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
+ </copyright>
+ <copyright>
+ <year>2000</year>
+ <year>2001</year>
+ <year>2003</year>
+ <holder>Internet Software Consortium.</holder>
+ </copyright>
+ </docinfo>
+
<refnamediv>
<refname>lwres_getaddrinfo</refname>
<refname>lwres_freeaddrinfo</refname>
diff --git a/lib/lwres/man/lwres_getaddrinfo.html b/lib/lwres/man/lwres_getaddrinfo.html
index b568e591..41475a69 100644
--- a/lib/lwres/man/lwres_getaddrinfo.html
+++ b/lib/lwres/man/lwres_getaddrinfo.html
@@ -1,97 +1,78 @@
<!--
- - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- - Copyright (C) 2001, 2003 Internet Software Consortium.
- -
+ - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2000, 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,
+ - 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: lwres_getaddrinfo.html,v 1.8.2.1.4.3 2004/08/22 23:39:03 marka Exp $ -->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<HTML
-><HEAD
-><TITLE
->lwres_getaddrinfo</TITLE
-><META
-NAME="GENERATOR"
-CONTENT="Modular DocBook HTML Stylesheet Version 1.7"></HEAD
-><BODY
-CLASS="REFENTRY"
-BGCOLOR="#FFFFFF"
-TEXT="#000000"
-LINK="#0000FF"
-VLINK="#840084"
-ALINK="#0000FF"
-><H1
-><A
-NAME="AEN1"
-></A
->lwres_getaddrinfo</H1
-><DIV
-CLASS="REFNAMEDIV"
-><A
-NAME="AEN8"
-></A
-><H2
->Name</H2
->lwres_getaddrinfo, lwres_freeaddrinfo&nbsp;--&nbsp;socket address structure to host and service name</DIV
-><DIV
-CLASS="REFSYNOPSISDIV"
-><A
-NAME="AEN12"
-></A
-><H2
->Synopsis</H2
-><DIV
-CLASS="FUNCSYNOPSIS"
-><P
-></P
-><A
-NAME="AEN13"
-></A
-><PRE
-CLASS="FUNCSYNOPSISINFO"
->#include &lt;lwres/netdb.h&gt;</PRE
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->int
-lwres_getaddrinfo</CODE
->(const char *hostname, const char *servname, const struct addrinfo *hints, struct addrinfo **res);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->void
-lwres_freeaddrinfo</CODE
->(struct addrinfo *ai);</CODE
-></P
-><P
-></P
-></DIV
-><P
->If the operating system does not provide a
-<SPAN
-CLASS="TYPE"
->struct addrinfo</SPAN
->,
+<!-- $Id: lwres_getaddrinfo.html,v 1.8.2.1.4.8 2005/07/18 02:36:52 marka Exp $ -->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>lwres_getaddrinfo</title>
+<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
+<a name="id2456972"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2>Name</h2>
+<p>lwres_getaddrinfo, lwres_freeaddrinfo &#8212; socket address structure to host and service name</p>
+</div>
+<div class="refsynopsisdiv">
+<h2>Synopsis</h2>
+<div class="funcsynopsis">
+<pre class="funcsynopsisinfo">#include &lt;lwres/netdb.h&gt;</pre>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+int
+<b class="fsfunc">lwres_getaddrinfo</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr>
+<td><code class="funcdef">
+void
+<b class="fsfunc">lwres_freeaddrinfo</b>(</code></td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr></table>
+</div>
+<p>
+If the operating system does not provide a
+<span class="type">struct addrinfo</span>,
the following structure is used:
-<PRE
-CLASS="PROGRAMLISTING"
->struct addrinfo {
+</p>
+<pre class="programlisting">
+struct addrinfo {
int ai_flags; /* AI_PASSIVE, AI_CANONNAME */
int ai_family; /* PF_xxx */
int ai_socktype; /* SOCK_xxx */
@@ -100,594 +81,253 @@ CLASS="PROGRAMLISTING"
char *ai_canonname; /* canonical name for hostname */
struct sockaddr *ai_addr; /* binary address */
struct addrinfo *ai_next; /* next structure in linked list */
-};</PRE
-></P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN29"
-></A
-><H2
->DESCRIPTION</H2
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_getaddrinfo()</CODE
->
+};
+</pre>
+<p>
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514566"></a><h2>DESCRIPTION</h2>
+<p>
+<code class="function">lwres_getaddrinfo()</code>
is used to get a list of IP addresses and port numbers for host
-<VAR
-CLASS="PARAMETER"
->hostname</VAR
->
+<em class="parameter"><code>hostname</code></em>
and service
-<VAR
-CLASS="PARAMETER"
->servname</VAR
->.
+<em class="parameter"><code>servname</code></em>.
The function is the lightweight resolver's implementation of
-<CODE
-CLASS="FUNCTION"
->getaddrinfo()</CODE
->
+<code class="function">getaddrinfo()</code>
as defined in RFC2133.
-<VAR
-CLASS="PARAMETER"
->hostname</VAR
->
+<em class="parameter"><code>hostname</code></em>
and
-<VAR
-CLASS="PARAMETER"
->servname</VAR
->
+<em class="parameter"><code>servname</code></em>
are pointers to null-terminated
strings or
-<SPAN
-CLASS="TYPE"
->NULL</SPAN
->.
+<span class="type">NULL</span>.
-<VAR
-CLASS="PARAMETER"
->hostname</VAR
->
+<em class="parameter"><code>hostname</code></em>
is either a host name or a numeric host address string: a dotted decimal
IPv4 address or an IPv6 address.
-<VAR
-CLASS="PARAMETER"
->servname</VAR
->
+<em class="parameter"><code>servname</code></em>
is either a decimal port number or a service name as listed in
-<TT
-CLASS="FILENAME"
->/etc/services</TT
->.</P
-><P
-><VAR
-CLASS="PARAMETER"
->hints</VAR
->
+<code class="filename">/etc/services</code>.
+</p>
+<p>
+<em class="parameter"><code>hints</code></em>
is an optional pointer to a
-<SPAN
-CLASS="TYPE"
->struct addrinfo</SPAN
->.
+<span class="type">struct addrinfo</span>.
This structure can be used to provide hints concerning the type of socket
that the caller supports or wishes to use.
The caller can supply the following structure elements in
-<VAR
-CLASS="PARAMETER"
->*hints</VAR
->:
+<em class="parameter"><code>*hints</code></em>:
-<P
-></P
-><DIV
-CLASS="VARIABLELIST"
-><DL
-><DT
-><CODE
-CLASS="CONSTANT"
->ai_family</CODE
-></DT
-><DD
-><P
->The protocol family that should be used.
+</p>
+<div class="variablelist"><dl>
+<dt><span class="term"><code class="constant">ai_family</code></span></dt>
+<dd><p>The protocol family that should be used.
When
-<CODE
-CLASS="CONSTANT"
->ai_family</CODE
->
+<code class="constant">ai_family</code>
is set to
-<SPAN
-CLASS="TYPE"
->PF_UNSPEC</SPAN
->,
+<span class="type">PF_UNSPEC</span>,
it means the caller will accept any protocol family supported by the
-operating system.</P
-></DD
-><DT
-><CODE
-CLASS="CONSTANT"
->ai_socktype</CODE
-></DT
-><DD
-><P
->denotes the type of socket &mdash;
-<SPAN
-CLASS="TYPE"
->SOCK_STREAM</SPAN
->,
-<SPAN
-CLASS="TYPE"
->SOCK_DGRAM</SPAN
->
+operating system.
+</p></dd>
+<dt><span class="term"><code class="constant">ai_socktype</code></span></dt>
+<dd><p>
+denotes the type of socket &#8212;
+<span class="type">SOCK_STREAM</span>,
+<span class="type">SOCK_DGRAM</span>
or
-<SPAN
-CLASS="TYPE"
->SOCK_RAW</SPAN
->
-&mdash; that is wanted.
+<span class="type">SOCK_RAW</span>
+&#8212; that is wanted.
When
-<CODE
-CLASS="CONSTANT"
->ai_socktype</CODE
->
-is zero the caller will accept any socket type.</P
-></DD
-><DT
-><CODE
-CLASS="CONSTANT"
->ai_protocol</CODE
-></DT
-><DD
-><P
->indicates which transport protocol is wanted: IPPROTO_UDP or
+<code class="constant">ai_socktype</code>
+is zero the caller will accept any socket type.
+</p></dd>
+<dt><span class="term"><code class="constant">ai_protocol</code></span></dt>
+<dd><p>
+indicates which transport protocol is wanted: IPPROTO_UDP or
IPPROTO_TCP.
If
-<CODE
-CLASS="CONSTANT"
->ai_protocol</CODE
->
-is zero the caller will accept any protocol.</P
-></DD
-><DT
-><CODE
-CLASS="CONSTANT"
->ai_flags</CODE
-></DT
-><DD
-><P
->Flag bits.
+<code class="constant">ai_protocol</code>
+is zero the caller will accept any protocol.
+</p></dd>
+<dt><span class="term"><code class="constant">ai_flags</code></span></dt>
+<dd>
+<p>
+Flag bits.
If the
-<SPAN
-CLASS="TYPE"
->AI_CANONNAME</SPAN
->
+<span class="type">AI_CANONNAME</span>
bit is set, a successful call to
-<CODE
-CLASS="FUNCTION"
->lwres_getaddrinfo()</CODE
->
+<code class="function">lwres_getaddrinfo()</code>
will return a null-terminated string containing the canonical name
of the specified hostname in
-<CODE
-CLASS="CONSTANT"
->ai_canonname</CODE
->
+<code class="constant">ai_canonname</code>
of the first
-<SPAN
-CLASS="TYPE"
->addrinfo</SPAN
->
+<span class="type">addrinfo</span>
structure returned.
Setting the
-<SPAN
-CLASS="TYPE"
->AI_PASSIVE</SPAN
->
+<span class="type">AI_PASSIVE</span>
bit indicates that the returned socket address structure is intended
for used in a call to
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->bind</SPAN
->(2)</SPAN
->.
+<span class="citerefentry"><span class="refentrytitle">bind</span>(2)</span>.
In this case, if the hostname argument is a
-<SPAN
-CLASS="TYPE"
->NULL</SPAN
->
+<span class="type">NULL</span>
pointer, then the IP address portion of the socket
address structure will be set to
-<SPAN
-CLASS="TYPE"
->INADDR_ANY</SPAN
->
+<span class="type">INADDR_ANY</span>
for an IPv4 address or
-<SPAN
-CLASS="TYPE"
->IN6ADDR_ANY_INIT</SPAN
->
-for an IPv6 address.</P
-><P
->When
-<CODE
-CLASS="CONSTANT"
->ai_flags</CODE
->
+<span class="type">IN6ADDR_ANY_INIT</span>
+for an IPv6 address.
+</p>
+<p>
+When
+<code class="constant">ai_flags</code>
does not set the
-<SPAN
-CLASS="TYPE"
->AI_PASSIVE</SPAN
->
+<span class="type">AI_PASSIVE</span>
bit, the returned socket address structure will be ready
for use in a call to
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->connect</SPAN
->(2)</SPAN
->
+<span class="citerefentry"><span class="refentrytitle">connect</span>(2
+)</span>
for a connection-oriented protocol or
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->connect</SPAN
->(2)</SPAN
->,
+<span class="citerefentry"><span class="refentrytitle">connect</span>(2)</span>,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->sendto</SPAN
->(2)</SPAN
->,
+<span class="citerefentry"><span class="refentrytitle">sendto</span>(2)</span>,
or
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->sendmsg</SPAN
->(2)</SPAN
->
+<span class="citerefentry"><span class="refentrytitle">sendmsg</span>(2
+)</span>
if a connectionless protocol was chosen.
The IP address portion of the socket address structure will be
set to the loopback address if
-<VAR
-CLASS="PARAMETER"
->hostname</VAR
->
+<em class="parameter"><code>hostname</code></em>
is a
-<SPAN
-CLASS="TYPE"
->NULL</SPAN
->
+<span class="type">NULL</span>
pointer and
-<SPAN
-CLASS="TYPE"
->AI_PASSIVE</SPAN
->
+<span class="type">AI_PASSIVE</span>
is not set in
-<CODE
-CLASS="CONSTANT"
->ai_flags</CODE
->.</P
-><P
->If
-<CODE
-CLASS="CONSTANT"
->ai_flags</CODE
->
+<code class="constant">ai_flags</code>.
+</p>
+<p>
+If
+<code class="constant">ai_flags</code>
is set to
-<SPAN
-CLASS="TYPE"
->AI_NUMERICHOST</SPAN
->
+<span class="type">AI_NUMERICHOST</span>
it indicates that
-<VAR
-CLASS="PARAMETER"
->hostname</VAR
->
+<em class="parameter"><code>hostname</code></em>
should be treated as a numeric string defining an IPv4 or IPv6 address
-and no name resolution should be attempted.</P
-></DD
-></DL
-></DIV
-></P
-><P
->All other elements of the <SPAN
-CLASS="TYPE"
->struct addrinfo</SPAN
-> passed
-via <VAR
-CLASS="PARAMETER"
->hints</VAR
-> must be zero.</P
-><P
->A <VAR
-CLASS="PARAMETER"
->hints</VAR
-> of <SPAN
-CLASS="TYPE"
->NULL</SPAN
-> is treated as if
-the caller provided a <SPAN
-CLASS="TYPE"
->struct addrinfo</SPAN
-> initialized to zero
-with <CODE
-CLASS="CONSTANT"
->ai_family</CODE
->set to
-<CODE
-CLASS="CONSTANT"
->PF_UNSPEC</CODE
->.</P
-><P
->After a successful call to
-<CODE
-CLASS="FUNCTION"
->lwres_getaddrinfo()</CODE
->,
-<VAR
-CLASS="PARAMETER"
->*res</VAR
->
+and no name resolution should be attempted.
+</p>
+</dd>
+</dl></div>
+<p>
+</p>
+<p>
+All other elements of the <span class="type">struct addrinfo</span> passed
+via <em class="parameter"><code>hints</code></em> must be zero.
+</p>
+<p>
+A <em class="parameter"><code>hints</code></em> of <span class="type">NULL</span> is treated as if
+the caller provided a <span class="type">struct addrinfo</span> initialized to zero
+with <code class="constant">ai_family</code>set to
+<code class="constant">PF_UNSPEC</code>.
+</p>
+<p>
+After a successful call to
+<code class="function">lwres_getaddrinfo()</code>,
+<em class="parameter"><code>*res</code></em>
is a pointer to a linked list of one or more
-<SPAN
-CLASS="TYPE"
->addrinfo</SPAN
->
+<span class="type">addrinfo</span>
structures.
Each
-<SPAN
-CLASS="TYPE"
->struct addrinfo</SPAN
->
+<span class="type">struct addrinfo</span>
in this list cn be processed by following
the
-<CODE
-CLASS="CONSTANT"
->ai_next</CODE
->
+<code class="constant">ai_next</code>
pointer, until a
-<SPAN
-CLASS="TYPE"
->NULL</SPAN
->
+<span class="type">NULL</span>
pointer is encountered.
The three members
-<CODE
-CLASS="CONSTANT"
->ai_family</CODE
->,
-<CODE
-CLASS="CONSTANT"
->ai_socktype</CODE
->,
+<code class="constant">ai_family</code>,
+<code class="constant">ai_socktype</code>,
and
-<CODE
-CLASS="CONSTANT"
->ai_protocol</CODE
->
+<code class="constant">ai_protocol</code>
in each
returned
-<SPAN
-CLASS="TYPE"
->addrinfo</SPAN
->
+<span class="type">addrinfo</span>
structure contain the corresponding arguments for a call to
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->socket</SPAN
->(2)</SPAN
->.
+<span class="citerefentry"><span class="refentrytitle">socket</span>(2)</span>.
For each
-<SPAN
-CLASS="TYPE"
->addrinfo</SPAN
->
+<span class="type">addrinfo</span>
structure in the list, the
-<CODE
-CLASS="CONSTANT"
->ai_addr</CODE
->
+<code class="constant">ai_addr</code>
member points to a filled-in socket address structure of length
-<CODE
-CLASS="CONSTANT"
->ai_addrlen</CODE
->.</P
-><P
->All of the information returned by
-<CODE
-CLASS="FUNCTION"
->lwres_getaddrinfo()</CODE
->
+<code class="constant">ai_addrlen</code>.
+</p>
+<p>
+All of the information returned by
+<code class="function">lwres_getaddrinfo()</code>
is dynamically allocated: the addrinfo structures, and the socket
address structures and canonical host name strings pointed to by the
-<CODE
-CLASS="CONSTANT"
->addrinfo</CODE
->structures.
+<code class="constant">addrinfo</code>structures.
Memory allocated for the dynamically allocated structures created by
a successful call to
-<CODE
-CLASS="FUNCTION"
->lwres_getaddrinfo()</CODE
->
+<code class="function">lwres_getaddrinfo()</code>
is released by
-<CODE
-CLASS="FUNCTION"
->lwres_freeaddrinfo()</CODE
->.
-<VAR
-CLASS="PARAMETER"
->ai</VAR
->
+<code class="function">lwres_freeaddrinfo()</code>.
+<em class="parameter"><code>ai</code></em>
is a pointer to a
-<SPAN
-CLASS="TYPE"
->struct addrinfo</SPAN
->
+<span class="type">struct addrinfo</span>
created by a call to
-<CODE
-CLASS="FUNCTION"
->lwres_getaddrinfo()</CODE
->.</P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN142"
-></A
-><H2
->RETURN VALUES</H2
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_getaddrinfo()</CODE
->
+<code class="function">lwres_getaddrinfo()</code>.
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2515128"></a><h2>RETURN VALUES</h2>
+<p>
+<code class="function">lwres_getaddrinfo()</code>
returns zero on success or one of the error codes listed in
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->gai_strerror</SPAN
->(3)</SPAN
->
+<span class="citerefentry"><span class="refentrytitle">gai_strerror</span>(3
+)</span>
if an error occurs.
If both
-<VAR
-CLASS="PARAMETER"
->hostname</VAR
->
+<em class="parameter"><code>hostname</code></em>
and
-<VAR
-CLASS="PARAMETER"
->servname</VAR
->
+<em class="parameter"><code>servname</code></em>
are
-<SPAN
-CLASS="TYPE"
->NULL</SPAN
->
-<CODE
-CLASS="FUNCTION"
->lwres_getaddrinfo()</CODE
->
+<span class="type">NULL</span>
+<code class="function">lwres_getaddrinfo()</code>
returns
-<SPAN
-CLASS="ERRORCODE"
->EAI_NONAME</SPAN
->.&#13;</P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN154"
-></A
-><H2
->SEE ALSO</H2
-><P
-><SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->lwres</SPAN
->(3)</SPAN
->,
+<span class="errorcode">EAI_NONAME</span>.
+
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2515166"></a><h2>SEE ALSO</h2>
+<p>
+<span class="citerefentry"><span class="refentrytitle">lwres</span>(3)</span>,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->lwres_getaddrinfo</SPAN
->(3)</SPAN
->,
+<span class="citerefentry"><span class="refentrytitle">lwres_getaddrinfo</span>(3)</span>,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->lwres_freeaddrinfo</SPAN
->(3)</SPAN
->,
+<span class="citerefentry"><span class="refentrytitle">lwres_freeaddrinfo</span>(3)</span>,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->lwres_gai_strerror</SPAN
->(3)</SPAN
->,
+<span class="citerefentry"><span class="refentrytitle">lwres_gai_strerror</span>(3)</span>,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->RFC2133</SPAN
-></SPAN
->,
+<span class="citerefentry"><span class="refentrytitle">RFC2133</span></span>,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->getservbyname</SPAN
->(3)</SPAN
->,
+<span class="citerefentry"><span class="refentrytitle">getservbyname</span>(3)</span>,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->bind</SPAN
->(2)</SPAN
->,
+<span class="citerefentry"><span class="refentrytitle">bind</span>(2)</span>,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->connect</SPAN
->(2)</SPAN
->,
+<span class="citerefentry"><span class="refentrytitle">connect</span>(2)</span>,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->sendto</SPAN
->(2)</SPAN
->,
+<span class="citerefentry"><span class="refentrytitle">sendto</span>(2)</span>,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->sendmsg</SPAN
->(2)</SPAN
->,
+<span class="citerefentry"><span class="refentrytitle">sendmsg</span>(2)</span>,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->socket</SPAN
->(2)</SPAN
->.</P
-></DIV
-></BODY
-></HTML
->
+<span class="citerefentry"><span class="refentrytitle">socket</span>(2)</span>.
+</p>
+</div>
+</div></body>
+</html>
diff --git a/lib/lwres/man/lwres_gethostent.3 b/lib/lwres/man/lwres_gethostent.3
index 5a423479..3dcc2b71 100644
--- a/lib/lwres/man/lwres_gethostent.3
+++ b/lib/lwres/man/lwres_gethostent.3
@@ -1,93 +1,73 @@
-.\" Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
-.\" Copyright (C) 2001 Internet Software Consortium.
-.\"
+.\" Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+.\" Copyright (C) 2001 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,
+.\" 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: lwres_gethostent.3,v 1.16.2.1.8.1 2004/03/06 07:41:43 marka Exp $
+.\" $Id: lwres_gethostent.3,v 1.16.2.1.8.4 2005/09/12 00:47:27 marka Exp $
.\"
-.TH "LWRES_GETHOSTENT" "3" "Jun 30, 2000" "BIND9" ""
+.hy 0
+.ad l
+.\"Generated by db2man.xsl. Don't modify this, modify the source.
+.de Sh \" Subsection
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Ip \" List item
+.br
+.ie \\n(.$>=3 .ne \\$3
+.el .ne 3
+.IP "\\$1" \\$2
+..
+.TH "LWRES_GETHOSTENT" 3 "Jun 30, 2000" "" ""
.SH NAME
lwres_gethostbyname, lwres_gethostbyname2, lwres_gethostbyaddr, lwres_gethostent, lwres_sethostent, lwres_endhostent, lwres_gethostbyname_r, lwres_gethostbyaddr_r, lwres_gethostent_r, lwres_sethostent_r, lwres_endhostent_r \- lightweight resolver get network host entry
-.SH SYNOPSIS
-\fB#include <lwres/netdb.h>
-.sp
-.na
-struct hostent *
-lwres_gethostbyname(const char *name);
-.ad
-.sp
-.na
-struct hostent *
-lwres_gethostbyname2(const char *name, int af);
-.ad
-.sp
-.na
-struct hostent *
-lwres_gethostbyaddr(const char *addr, int len, int type);
-.ad
-.sp
-.na
-struct hostent *
-lwres_gethostent(void);
-.ad
-.sp
-.na
-void
-lwres_sethostent(int stayopen);
-.ad
-.sp
-.na
-void
-lwres_endhostent(void);
-.ad
-.sp
-.na
-struct hostent *
-lwres_gethostbyname_r(const char *name, struct hostent *resbuf, char *buf, int buflen, int *error);
-.ad
-.sp
-.na
-struct hostent *
-lwres_gethostbyaddr_r(const char *addr, int len, int type, struct hostent *resbuf, char *buf, int buflen, int *error);
-.ad
-.sp
-.na
-struct hostent *
-lwres_gethostent_r(struct hostent *resbuf, char *buf, int buflen, int *error);
-.ad
-.sp
-.na
-void
-lwres_sethostent_r(int stayopen);
-.ad
-.sp
-.na
-void
-lwres_endhostent_r(void);
-.ad
-\fR
+.SH "SYNOPSIS"
+.nf
+#include <lwres/netdb\&.h>
+.fi
+.HP 40
+struct\ hostent\ *\ \fBlwres_gethostbyname\fR\ (const\ char\ *name);
+.HP 41
+struct\ hostent\ *\ \fBlwres_gethostbyname2\fR\ (const\ char\ *name, int\ af);
+.HP 40
+struct\ hostent\ *\ \fBlwres_gethostbyaddr\fR\ (const\ char\ *addr, int\ len, int\ type);
+.HP 37
+struct\ hostent\ *\ \fBlwres_gethostent\fR\ (void);
+.HP 23
+void\ \fBlwres_sethostent\fR\ (int\ stayopen);
+.HP 23
+void\ \fBlwres_endhostent\fR\ (void);
+.HP 42
+struct\ hostent\ *\ \fBlwres_gethostbyname_r\fR\ (const\ char\ *name, struct\ hostent\ *resbuf, char\ *buf, int\ buflen, int\ *error);
+.HP 42
+struct\ hostent\ *\ \fBlwres_gethostbyaddr_r\fR\ (const\ char\ *addr, int\ len, int\ type, struct\ hostent\ *resbuf, char\ *buf, int\ buflen, int\ *error);
+.HP 39
+struct\ hostent\ *\ \fBlwres_gethostent_r\fR\ (struct\ hostent\ *resbuf, char\ *buf, int\ buflen, int\ *error);
+.HP 25
+void\ \fBlwres_sethostent_r\fR\ (int\ stayopen);
+.HP 25
+void\ \fBlwres_endhostent_r\fR\ (void);
.SH "DESCRIPTION"
.PP
-These functions provide hostname-to-address and
-address-to-hostname lookups by means of the lightweight resolver.
-They are similar to the standard
-\fBgethostent\fR(3)
-functions provided by most operating systems.
-They use a
-\fBstruct hostent\fR
-which is usually defined in
-\fI<namedb.h>\fR.
-.sp
+These functions provide hostname\-to\-address and address\-to\-hostname lookups by means of the lightweight resolver\&. They are similar to the standard \fBgethostent\fR(3 ) functions provided by most operating systems\&. They use a \fBstruct hostent\fR which is usually defined in \fI<namedb\&.h>\fR\&.
.nf
struct hostent {
char *h_name; /* official name of host */
@@ -97,176 +77,60 @@ struct hostent {
char **h_addr_list; /* list of addresses from name server */
};
#define h_addr h_addr_list[0] /* address, for backward compatibility */
-.sp
.fi
.PP
-The members of this structure are:
+The members of this structure are:
.TP
\fBh_name\fR
-The official (canonical) name of the host.
+The official (canonical) name of the host\&.
.TP
\fBh_aliases\fR
-A NULL-terminated array of alternate names (nicknames) for the host.
+A NULL\-terminated array of alternate names (nicknames) for the host\&.
.TP
\fBh_addrtype\fR
-The type of address being returned \(em
-\fBPF_INET\fR
-or
-\fBPF_INET6\fR.
+The type of address being returned -- \fBPF_INET\fR or \fBPF_INET6\fR\&.
.TP
\fBh_length\fR
-The length of the address in bytes.
+The length of the address in bytes\&.
.TP
\fBh_addr_list\fR
-A \fBNULL\fR
-terminated array of network addresses for the host.
-Host addresses are returned in network byte order.
+A \fBNULL\fR terminated array of network addresses for the host\&. Host addresses are returned in network byte order\&.
.PP
-For backward compatibility with very old software,
-h_addr
-is the first address in
-h_addr_list.
+For backward compatibility with very old software, \fBh_addr\fR is the first address in \fBh_addr_list\&.\fR
.PP
-\fBlwres_gethostent()\fR,
-\fBlwres_sethostent()\fR,
-\fBlwres_endhostent()\fR,
-\fBlwres_gethostent_r()\fR,
-\fBlwres_sethostent_r()\fR
-and
-\fBlwres_endhostent_r()\fR
-provide iteration over the known host entries on systems that
-provide such functionality through facilities like
-\fI/etc/hosts\fR
-or NIS. The lightweight resolver does not currently implement
-these functions; it only provides them as stub functions that always
-return failure.
+ \fBlwres_gethostent()\fR, \fBlwres_sethostent()\fR, \fBlwres_endhostent()\fR, \fBlwres_gethostent_r()\fR, \fBlwres_sethostent_r()\fR and \fBlwres_endhostent_r()\fR provide iteration over the known host entries on systems that provide such functionality through facilities like \fI/etc/hosts\fR or NIS\&. The lightweight resolver does not currently implement these functions; it only provides them as stub functions that always return failure\&.
.PP
-\fBlwres_gethostbyname()\fR and
-\fBlwres_gethostbyname2()\fR look up the hostname
-\fIname\fR.
-\fBlwres_gethostbyname()\fR always looks for an IPv4
-address while \fBlwres_gethostbyname2()\fR looks for an
-address of protocol family \fIaf\fR: either
-\fBPF_INET\fR or \fBPF_INET6\fR \(em IPv4 or IPV6
-addresses respectively. Successful calls of the functions return a
-\fBstruct hostent\fRfor the name that was looked up.
-\fBNULL\fR is returned if the lookups by
-\fBlwres_gethostbyname()\fR or
-\fBlwres_gethostbyname2()\fR fail.
+ \fBlwres_gethostbyname()\fR and \fBlwres_gethostbyname2()\fR look up the hostname \fIname\fR\&. \fBlwres_gethostbyname()\fR always looks for an IPv4 address while \fBlwres_gethostbyname2()\fR looks for an address of protocol family \fIaf\fR: either \fBPF_INET\fR or \fBPF_INET6\fR -- IPv4 or IPV6 addresses respectively\&. Successful calls of the functions return a \fBstruct hostent\fRfor the name that was looked up\&. \fBNULL\fR is returned if the lookups by \fBlwres_gethostbyname()\fR or \fBlwres_gethostbyname2()\fR fail\&.
.PP
-Reverse lookups of addresses are performed by
-\fBlwres_gethostbyaddr()\fR.
-\fIaddr\fR is an address of length
-\fIlen\fR bytes and protocol family
-\fItype\fR \(em \fBPF_INET\fR or
-\fBPF_INET6\fR.
-\fBlwres_gethostbyname_r()\fR is a thread-safe function
-for forward lookups. If an error occurs, an error code is returned in
-\fI*error\fR.
-\fIresbuf\fR is a pointer to a \fBstruct
-hostent\fR which is initialised by a successful call to
-\fBlwres_gethostbyname_r()\fR .
-\fIbuf\fR is a buffer of length
-\fIlen\fR bytes which is used to store the
-h_name, h_aliases, and
-h_addr_list elements of the \fBstruct
-hostent\fR returned in \fIresbuf\fR.
-Successful calls to \fBlwres_gethostbyname_r()\fR
-return \fIresbuf\fR,
-which is a pointer to the \fBstruct hostent\fR it created.
+Reverse lookups of addresses are performed by \fBlwres_gethostbyaddr()\fR\&. \fIaddr\fR is an address of length \fIlen\fR bytes and protocol family \fItype\fR -- \fBPF_INET\fR or \fBPF_INET6\fR\&. \fBlwres_gethostbyname_r()\fR is a thread\-safe function for forward lookups\&. If an error occurs, an error code is returned in \fI*error\fR\&. \fIresbuf\fR is a pointer to a \fBstruct hostent\fR which is initialised by a successful call to \fBlwres_gethostbyname_r()\fR \&. \fIbuf\fR is a buffer of length \fIlen\fR bytes which is used to store the \fBh_name\fR, \fBh_aliases\fR, and \fBh_addr_list\fR elements of the \fBstruct hostent\fR returned in \fIresbuf\fR\&. Successful calls to \fBlwres_gethostbyname_r()\fR return \fIresbuf\fR, which is a pointer to the \fBstruct hostent\fR it created\&.
.PP
-\fBlwres_gethostbyaddr_r()\fR is a thread-safe function
-that performs a reverse lookup of address \fIaddr\fR
-which is \fIlen\fR bytes long and is of protocol
-family \fItype\fR \(em \fBPF_INET\fR or
-\fBPF_INET6\fR. If an error occurs, the error code is returned
-in \fI*error\fR. The other function parameters are
-identical to those in \fBlwres_gethostbyname_r()\fR.
-\fIresbuf\fR is a pointer to a \fBstruct
-hostent\fR which is initialised by a successful call to
-\fBlwres_gethostbyaddr_r()\fR.
-\fIbuf\fR is a buffer of length
-\fIlen\fR bytes which is used to store the
-h_name, h_aliases, and
-h_addr_list elements of the \fBstruct
-hostent\fR returned in \fIresbuf\fR. Successful
-calls to \fBlwres_gethostbyaddr_r()\fR return
-\fIresbuf\fR, which is a pointer to the
-\fBstruct hostent()\fR it created.
+ \fBlwres_gethostbyaddr_r()\fR is a thread\-safe function that performs a reverse lookup of address \fIaddr\fR which is \fIlen\fR bytes long and is of protocol family \fItype\fR -- \fBPF_INET\fR or \fBPF_INET6\fR\&. If an error occurs, the error code is returned in \fI*error\fR\&. The other function parameters are identical to those in \fBlwres_gethostbyname_r()\fR\&. \fIresbuf\fR is a pointer to a \fBstruct hostent\fR which is initialised by a successful call to \fBlwres_gethostbyaddr_r()\fR\&. \fIbuf\fR is a buffer of length \fIlen\fR bytes which is used to store the \fBh_name\fR, \fBh_aliases\fR, and \fBh_addr_list\fR elements of the \fBstruct hostent\fR returned in \fIresbuf\fR\&. Successful calls to \fBlwres_gethostbyaddr_r()\fR return \fIresbuf\fR, which is a pointer to the \fBstruct hostent()\fR it created\&.
.SH "RETURN VALUES"
.PP
-The functions
-\fBlwres_gethostbyname()\fR,
-\fBlwres_gethostbyname2()\fR,
-\fBlwres_gethostbyaddr()\fR,
-and
-\fBlwres_gethostent()\fR
-return NULL to indicate an error. In this case the global variable
-\fBlwres_h_errno\fR
-will contain one of the following error codes defined in
-\fI<lwres/netdb.h>\fR:
+The functions \fBlwres_gethostbyname()\fR, \fBlwres_gethostbyname2()\fR, \fBlwres_gethostbyaddr()\fR, and \fBlwres_gethostent()\fR return NULL to indicate an error\&. In this case the global variable \fBlwres_h_errno\fR will contain one of the following error codes defined in \fI<lwres/netdb\&.h>\fR:
.TP
\fBHOST_NOT_FOUND\fR
-The host or address was not found.
+The host or address was not found\&.
.TP
\fBTRY_AGAIN\fR
-A recoverable error occurred, e.g., a timeout.
-Retrying the lookup may succeed.
+A recoverable error occurred, e\&.g\&., a timeout\&. Retrying the lookup may succeed\&.
.TP
\fBNO_RECOVERY\fR
-A non-recoverable error occurred.
+A non\-recoverable error occurred\&.
.TP
\fBNO_DATA\fR
-The name exists, but has no address information
-associated with it (or vice versa in the case
-of a reverse lookup). The code NO_ADDRESS
-is accepted as a synonym for NO_DATA for backwards
-compatibility.
+The name exists, but has no address information associated with it (or vice versa in the case of a reverse lookup)\&. The code NO_ADDRESS is accepted as a synonym for NO_DATA for backwards compatibility\&.
.PP
-\fBlwres_hstrerror\fR(3)
-translates these error codes to suitable error messages.
+ \fBlwres_hstrerror\fR(3 ) translates these error codes to suitable error messages\&.
.PP
-\fBlwres_gethostent()\fR
-and
-\fBlwres_gethostent_r()\fR
-always return
-\fBNULL\fR.
+ \fBlwres_gethostent()\fR and \fBlwres_gethostent_r()\fR always return \fBNULL\fR\&.
.PP
-Successful calls to \fBlwres_gethostbyname_r()\fR and
-\fBlwres_gethostbyaddr_r()\fR return
-\fIresbuf\fR, a pointer to the \fBstruct
-hostent\fR that was initialised by these functions. They return
-\fBNULL\fR if the lookups fail or if \fIbuf\fR
-was too small to hold the list of addresses and names referenced by
-the h_name, h_aliases, and
-h_addr_list elements of the \fBstruct
-hostent\fR. If \fIbuf\fR was too small, both
-\fBlwres_gethostbyname_r()\fR and
-\fBlwres_gethostbyaddr_r()\fR set the global variable
-\fBerrno\fR to ERANGE.
+Successful calls to \fBlwres_gethostbyname_r()\fR and \fBlwres_gethostbyaddr_r()\fR return \fIresbuf\fR, a pointer to the \fBstruct hostent\fR that was initialised by these functions\&. They return \fBNULL\fR if the lookups fail or if \fIbuf\fR was too small to hold the list of addresses and names referenced by the \fBh_name\fR, \fBh_aliases\fR, and \fBh_addr_list\fR elements of the \fBstruct hostent\fR\&. If \fIbuf\fR was too small, both \fBlwres_gethostbyname_r()\fR and \fBlwres_gethostbyaddr_r()\fR set the global variable \fBerrno\fR to \fBERANGE\fR\&.
.SH "SEE ALSO"
.PP
-\fBgethostent\fR(3),
-\fBlwres_getipnode\fR(3),
-\fBlwres_hstrerror\fR(3)
+ \fBgethostent\fR(3), \fBlwres_getipnode\fR(3), \fBlwres_hstrerror\fR(3 )
.SH "BUGS"
.PP
-\fBlwres_gethostbyname()\fR,
-\fBlwres_gethostbyname2()\fR,
-\fBlwres_gethostbyaddr()\fR
-and
-\fBlwres_endhostent()\fR
-are not thread safe; they return pointers to static data and
-provide error codes through a global variable.
-Thread-safe versions for name and address lookup are provided by
-\fBlwres_gethostbyname_r()\fR,
-and
-\fBlwres_gethostbyaddr_r()\fR
-respectively.
+ \fBlwres_gethostbyname()\fR, \fBlwres_gethostbyname2()\fR, \fBlwres_gethostbyaddr()\fR and \fBlwres_endhostent()\fR are not thread safe; they return pointers to static data and provide error codes through a global variable\&. Thread\-safe versions for name and address lookup are provided by \fBlwres_gethostbyname_r()\fR, and \fBlwres_gethostbyaddr_r()\fR respectively\&.
.PP
-The resolver daemon does not currently support any non-DNS
-name services such as
-\fI/etc/hosts\fR
-or
-\fBNIS\fR,
-consequently the above functions don't, either.
+The resolver daemon does not currently support any non\-DNS name services such as \fI/etc/hosts\fR or \fBNIS\fR, consequently the above functions don't, either\&.
diff --git a/lib/lwres/man/lwres_gethostent.docbook b/lib/lwres/man/lwres_gethostent.docbook
index 10324c31..9f92d3b3 100644
--- a/lib/lwres/man/lwres_gethostent.docbook
+++ b/lib/lwres/man/lwres_gethostent.docbook
@@ -1,6 +1,8 @@
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.0//EN"
+ "http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd"
+ [<!ENTITY mdash "&#8212;">]>
<!--
- - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
- Copyright (C) 2001 Internet Software Consortium.
-
- Permission to use, copy, modify, and distribute this software for any
@@ -16,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: lwres_gethostent.docbook,v 1.5.206.1 2004/03/06 08:15:39 marka Exp $ -->
+<!-- $Id: lwres_gethostent.docbook,v 1.5.206.3 2005/05/13 01:22:36 marka Exp $ -->
<refentry>
@@ -30,6 +32,18 @@
<refmiscinfo>BIND9</refmiscinfo>
</refmeta>
+ <docinfo>
+ <copyright>
+ <year>2004</year>
+ <year>2005</year>
+ <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
+ </copyright>
+ <copyright>
+ <year>2001</year>
+ <holder>Internet Software Consortium.</holder>
+ </copyright>
+ </docinfo>
+
<refnamediv>
<refname>lwres_gethostbyname</refname>
<refname>lwres_gethostbyname2</refname>
diff --git a/lib/lwres/man/lwres_gethostent.html b/lib/lwres/man/lwres_gethostent.html
index 00b285db..8e6d708b 100644
--- a/lib/lwres/man/lwres_gethostent.html
+++ b/lib/lwres/man/lwres_gethostent.html
@@ -1,784 +1,430 @@
<!--
- - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- - Copyright (C) 2001 Internet Software Consortium.
- -
+ - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2001 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,
+ - 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: lwres_gethostent.html,v 1.8.2.1.4.2 2004/08/22 23:39:04 marka Exp $ -->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<HTML
-><HEAD
-><TITLE
->lwres_gethostent</TITLE
-><META
-NAME="GENERATOR"
-CONTENT="Modular DocBook HTML Stylesheet Version 1.7"></HEAD
-><BODY
-CLASS="REFENTRY"
-BGCOLOR="#FFFFFF"
-TEXT="#000000"
-LINK="#0000FF"
-VLINK="#840084"
-ALINK="#0000FF"
-><H1
-><A
-NAME="AEN1"
-></A
->lwres_gethostent</H1
-><DIV
-CLASS="REFNAMEDIV"
-><A
-NAME="AEN8"
-></A
-><H2
->Name</H2
->lwres_gethostbyname, lwres_gethostbyname2, lwres_gethostbyaddr, lwres_gethostent, lwres_sethostent, lwres_endhostent, lwres_gethostbyname_r, lwres_gethostbyaddr_r, lwres_gethostent_r, lwres_sethostent_r, lwres_endhostent_r&nbsp;--&nbsp;lightweight resolver get network host entry</DIV
-><DIV
-CLASS="REFSYNOPSISDIV"
-><A
-NAME="AEN21"
-></A
-><H2
->Synopsis</H2
-><DIV
-CLASS="FUNCSYNOPSIS"
-><P
-></P
-><A
-NAME="AEN22"
-></A
-><PRE
-CLASS="FUNCSYNOPSISINFO"
->#include &lt;lwres/netdb.h&gt;</PRE
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->struct hostent *
-lwres_gethostbyname</CODE
->(const char *name);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->struct hostent *
-lwres_gethostbyname2</CODE
->(const char *name, int af);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->struct hostent *
-lwres_gethostbyaddr</CODE
->(const char *addr, int len, int type);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->struct hostent *
-lwres_gethostent</CODE
->(void);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->void
-lwres_sethostent</CODE
->(int stayopen);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->void
-lwres_endhostent</CODE
->(void);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->struct hostent *
-lwres_gethostbyname_r</CODE
->(const char *name, struct hostent *resbuf, char *buf, int buflen, int *error);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->struct hostent *
-lwres_gethostbyaddr_r</CODE
->(const char *addr, int len, int type, struct hostent *resbuf, char *buf, int buflen, int *error);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->struct hostent *
-lwres_gethostent_r</CODE
->(struct hostent *resbuf, char *buf, int buflen, int *error);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->void
-lwres_sethostent_r</CODE
->(int stayopen);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->void
-lwres_endhostent_r</CODE
->(void);</CODE
-></P
-><P
-></P
-></DIV
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN84"
-></A
-><H2
->DESCRIPTION</H2
-><P
->These functions provide hostname-to-address and
+<!-- $Id: lwres_gethostent.html,v 1.8.2.1.4.6 2005/07/18 02:36:52 marka Exp $ -->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>lwres_gethostent</title>
+<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
+<a name="id2456972"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2>Name</h2>
+<p>lwres_gethostbyname, lwres_gethostbyname2, lwres_gethostbyaddr, lwres_gethostent, lwres_sethostent, lwres_endhostent, lwres_gethostbyname_r, lwres_gethostbyaddr_r, lwres_gethostent_r, lwres_sethostent_r, lwres_endhostent_r &#8212; lightweight resolver get network host entry</p>
+</div>
+<div class="refsynopsisdiv">
+<h2>Synopsis</h2>
+<div class="funcsynopsis">
+<pre class="funcsynopsisinfo">#include &lt;lwres/netdb.h&gt;</pre>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr>
+<td><code class="funcdef">
+struct hostent *
+<b class="fsfunc">lwres_gethostbyname</b>(</code></td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr></table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+struct hostent *
+<b class="fsfunc">lwres_gethostbyname2</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+struct hostent *
+<b class="fsfunc">lwres_gethostbyaddr</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<p><code class="funcdef">
+struct hostent *
+<b class="fsfunc">lwres_gethostent</b>(</code>void<code>)</code>;</p>
+<p><code class="funcdef">
+void
+<b class="fsfunc">lwres_sethostent</b>(</code>int stayopen<code>)</code>;</p>
+<p><code class="funcdef">
+void
+<b class="fsfunc">lwres_endhostent</b>(</code>void<code>)</code>;</p>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+struct hostent *
+<b class="fsfunc">lwres_gethostbyname_r</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+struct hostent *
+<b class="fsfunc">lwres_gethostbyaddr_r</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+struct hostent *
+<b class="fsfunc">lwres_gethostent_r</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<p><code class="funcdef">
+void
+<b class="fsfunc">lwres_sethostent_r</b>(</code>int stayopen<code>)</code>;</p>
+<p><code class="funcdef">
+void
+<b class="fsfunc">lwres_endhostent_r</b>(</code>void<code>)</code>;</p>
+</div>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514724"></a><h2>DESCRIPTION</h2>
+<p>
+These functions provide hostname-to-address and
address-to-hostname lookups by means of the lightweight resolver.
They are similar to the standard
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->gethostent</SPAN
->(3)</SPAN
->
+<span class="citerefentry"><span class="refentrytitle">gethostent</span>(3
+)</span>
functions provided by most operating systems.
They use a
-<SPAN
-CLASS="TYPE"
->struct hostent</SPAN
->
+<span class="type">struct hostent</span>
which is usually defined in
-<TT
-CLASS="FILENAME"
->&lt;namedb.h&gt;</TT
->.
+<code class="filename">&lt;namedb.h&gt;</code>.
-<PRE
-CLASS="PROGRAMLISTING"
->struct hostent {
+</p>
+<pre class="programlisting">
+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 compatibility */</PRE
-></P
-><P
->The members of this structure are:
-<P
-></P
-><DIV
-CLASS="VARIABLELIST"
-><DL
-><DT
-><CODE
-CLASS="CONSTANT"
->h_name</CODE
-></DT
-><DD
-><P
->The official (canonical) name of the host.</P
-></DD
-><DT
-><CODE
-CLASS="CONSTANT"
->h_aliases</CODE
-></DT
-><DD
-><P
->A NULL-terminated array of alternate names (nicknames) for the host.</P
-></DD
-><DT
-><CODE
-CLASS="CONSTANT"
->h_addrtype</CODE
-></DT
-><DD
-><P
->The type of address being returned &mdash;
-<SPAN
-CLASS="TYPE"
->PF_INET</SPAN
->
+#define h_addr h_addr_list[0] /* address, for backward compatibility */
+</pre>
+<p>
+</p>
+<p>
+The members of this structure are:
+</p>
+<div class="variablelist"><dl>
+<dt><span class="term"><code class="constant">h_name</code></span></dt>
+<dd><p>
+The official (canonical) name of the host.
+</p></dd>
+<dt><span class="term"><code class="constant">h_aliases</code></span></dt>
+<dd><p>
+A NULL-terminated array of alternate names (nicknames) for the host.
+</p></dd>
+<dt><span class="term"><code class="constant">h_addrtype</code></span></dt>
+<dd><p>
+The type of address being returned &#8212;
+<span class="type">PF_INET</span>
or
-<SPAN
-CLASS="TYPE"
->PF_INET6</SPAN
->.</P
-></DD
-><DT
-><CODE
-CLASS="CONSTANT"
->h_length</CODE
-></DT
-><DD
-><P
->The length of the address in bytes.</P
-></DD
-><DT
-><CODE
-CLASS="CONSTANT"
->h_addr_list</CODE
-></DT
-><DD
-><P
->A <SPAN
-CLASS="TYPE"
->NULL</SPAN
->
+<span class="type">PF_INET6</span>.
+</p></dd>
+<dt><span class="term"><code class="constant">h_length</code></span></dt>
+<dd><p>
+The length of the address in bytes.
+</p></dd>
+<dt><span class="term"><code class="constant">h_addr_list</code></span></dt>
+<dd><p>
+A <span class="type">NULL</span>
terminated array of network addresses for the host.
-Host addresses are returned in network byte order.</P
-></DD
-></DL
-></DIV
-></P
-><P
->For backward compatibility with very old software,
-<CODE
-CLASS="CONSTANT"
->h_addr</CODE
->
+Host addresses are returned in network byte order.
+</p></dd>
+</dl></div>
+<p>
+</p>
+<p>
+For backward compatibility with very old software,
+<code class="constant">h_addr</code>
is the first address in
-<CODE
-CLASS="CONSTANT"
->h_addr_list.</CODE
-></P
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_gethostent()</CODE
->,
-<CODE
-CLASS="FUNCTION"
->lwres_sethostent()</CODE
->,
-<CODE
-CLASS="FUNCTION"
->lwres_endhostent()</CODE
->,
-<CODE
-CLASS="FUNCTION"
->lwres_gethostent_r()</CODE
->,
-<CODE
-CLASS="FUNCTION"
->lwres_sethostent_r()</CODE
->
+<code class="constant">h_addr_list.</code>
+</p>
+<p>
+<code class="function">lwres_gethostent()</code>,
+<code class="function">lwres_sethostent()</code>,
+<code class="function">lwres_endhostent()</code>,
+<code class="function">lwres_gethostent_r()</code>,
+<code class="function">lwres_sethostent_r()</code>
and
-<CODE
-CLASS="FUNCTION"
->lwres_endhostent_r()</CODE
->
+<code class="function">lwres_endhostent_r()</code>
provide iteration over the known host entries on systems that
provide such functionality through facilities like
-<TT
-CLASS="FILENAME"
->/etc/hosts</TT
->
+<code class="filename">/etc/hosts</code>
or NIS. The lightweight resolver does not currently implement
these functions; it only provides them as stub functions that always
-return failure.</P
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_gethostbyname()</CODE
-> and
-<CODE
-CLASS="FUNCTION"
->lwres_gethostbyname2()</CODE
-> look up the hostname
-<VAR
-CLASS="PARAMETER"
->name</VAR
->.
-<CODE
-CLASS="FUNCTION"
->lwres_gethostbyname()</CODE
-> always looks for an IPv4
-address while <CODE
-CLASS="FUNCTION"
->lwres_gethostbyname2()</CODE
-> looks for an
-address of protocol family <VAR
-CLASS="PARAMETER"
->af</VAR
->: either
-<SPAN
-CLASS="TYPE"
->PF_INET</SPAN
-> or <SPAN
-CLASS="TYPE"
->PF_INET6</SPAN
-> &mdash; IPv4 or IPV6
+return failure.
+</p>
+<p>
+<code class="function">lwres_gethostbyname()</code> and
+<code class="function">lwres_gethostbyname2()</code> look up the hostname
+<em class="parameter"><code>name</code></em>.
+<code class="function">lwres_gethostbyname()</code> always looks for an IPv4
+address while <code class="function">lwres_gethostbyname2()</code> looks for an
+address of protocol family <em class="parameter"><code>af</code></em>: either
+<span class="type">PF_INET</span> or <span class="type">PF_INET6</span> &#8212; IPv4 or IPV6
addresses respectively. Successful calls of the functions return a
-<SPAN
-CLASS="TYPE"
->struct hostent</SPAN
->for the name that was looked up.
-<SPAN
-CLASS="TYPE"
->NULL</SPAN
-> is returned if the lookups by
-<CODE
-CLASS="FUNCTION"
->lwres_gethostbyname()</CODE
-> or
-<CODE
-CLASS="FUNCTION"
->lwres_gethostbyname2()</CODE
-> fail.</P
-><P
->Reverse lookups of addresses are performed by
-<CODE
-CLASS="FUNCTION"
->lwres_gethostbyaddr()</CODE
->.
-<VAR
-CLASS="PARAMETER"
->addr</VAR
-> is an address of length
-<VAR
-CLASS="PARAMETER"
->len</VAR
-> bytes and protocol family
-<VAR
-CLASS="PARAMETER"
->type</VAR
-> &mdash; <SPAN
-CLASS="TYPE"
->PF_INET</SPAN
-> or
-<SPAN
-CLASS="TYPE"
->PF_INET6</SPAN
->.
-<CODE
-CLASS="FUNCTION"
->lwres_gethostbyname_r()</CODE
-> is a thread-safe function
+<span class="type">struct hostent</span>for the name that was looked up.
+<span class="type">NULL</span> is returned if the lookups by
+<code class="function">lwres_gethostbyname()</code> or
+<code class="function">lwres_gethostbyname2()</code> fail.
+</p>
+<p>
+Reverse lookups of addresses are performed by
+<code class="function">lwres_gethostbyaddr()</code>.
+<em class="parameter"><code>addr</code></em> is an address of length
+<em class="parameter"><code>len</code></em> bytes and protocol family
+<em class="parameter"><code>type</code></em> &#8212; <span class="type">PF_INET</span> or
+<span class="type">PF_INET6</span>.
+<code class="function">lwres_gethostbyname_r()</code> is a thread-safe function
for forward lookups. If an error occurs, an error code is returned in
-<VAR
-CLASS="PARAMETER"
->*error</VAR
->.
-<VAR
-CLASS="PARAMETER"
->resbuf</VAR
-> is a pointer to a <SPAN
-CLASS="TYPE"
->struct
-hostent</SPAN
-> which is initialised by a successful call to
-<CODE
-CLASS="FUNCTION"
->lwres_gethostbyname_r()</CODE
-> .
-<VAR
-CLASS="PARAMETER"
->buf</VAR
-> is a buffer of length
-<VAR
-CLASS="PARAMETER"
->len</VAR
-> bytes which is used to store the
-<CODE
-CLASS="CONSTANT"
->h_name</CODE
->, <CODE
-CLASS="CONSTANT"
->h_aliases</CODE
->, and
-<CODE
-CLASS="CONSTANT"
->h_addr_list</CODE
-> elements of the <SPAN
-CLASS="TYPE"
->struct
-hostent</SPAN
-> returned in <VAR
-CLASS="PARAMETER"
->resbuf</VAR
->.
-Successful calls to <CODE
-CLASS="FUNCTION"
->lwres_gethostbyname_r()</CODE
->
-return <VAR
-CLASS="PARAMETER"
->resbuf</VAR
->,
-which is a pointer to the <SPAN
-CLASS="TYPE"
->struct hostent</SPAN
-> it created.</P
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_gethostbyaddr_r()</CODE
-> is a thread-safe function
-that performs a reverse lookup of address <VAR
-CLASS="PARAMETER"
->addr</VAR
->
-which is <VAR
-CLASS="PARAMETER"
->len</VAR
-> bytes long and is of protocol
-family <VAR
-CLASS="PARAMETER"
->type</VAR
-> &mdash; <SPAN
-CLASS="TYPE"
->PF_INET</SPAN
-> or
-<SPAN
-CLASS="TYPE"
->PF_INET6</SPAN
->. If an error occurs, the error code is returned
-in <VAR
-CLASS="PARAMETER"
->*error</VAR
->. The other function parameters are
-identical to those in <CODE
-CLASS="FUNCTION"
->lwres_gethostbyname_r()</CODE
->.
-<VAR
-CLASS="PARAMETER"
->resbuf</VAR
-> is a pointer to a <SPAN
-CLASS="TYPE"
->struct
-hostent</SPAN
-> which is initialised by a successful call to
-<CODE
-CLASS="FUNCTION"
->lwres_gethostbyaddr_r()</CODE
->.
-<VAR
-CLASS="PARAMETER"
->buf</VAR
-> is a buffer of length
-<VAR
-CLASS="PARAMETER"
->len</VAR
-> bytes which is used to store the
-<CODE
-CLASS="CONSTANT"
->h_name</CODE
->, <CODE
-CLASS="CONSTANT"
->h_aliases</CODE
->, and
-<CODE
-CLASS="CONSTANT"
->h_addr_list</CODE
-> elements of the <SPAN
-CLASS="TYPE"
->struct
-hostent</SPAN
-> returned in <VAR
-CLASS="PARAMETER"
->resbuf</VAR
->. Successful
-calls to <CODE
-CLASS="FUNCTION"
->lwres_gethostbyaddr_r()</CODE
-> return
-<VAR
-CLASS="PARAMETER"
->resbuf</VAR
->, which is a pointer to the
-<CODE
-CLASS="FUNCTION"
->struct hostent()</CODE
-> it created.</P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN191"
-></A
-><H2
->RETURN VALUES</H2
-><P
->The functions
-<CODE
-CLASS="FUNCTION"
->lwres_gethostbyname()</CODE
->,
-<CODE
-CLASS="FUNCTION"
->lwres_gethostbyname2()</CODE
->,
-<CODE
-CLASS="FUNCTION"
->lwres_gethostbyaddr()</CODE
->,
+<em class="parameter"><code>*error</code></em>.
+<em class="parameter"><code>resbuf</code></em> is a pointer to a <span class="type">struct
+hostent</span> which is initialised by a successful call to
+<code class="function">lwres_gethostbyname_r()</code> .
+<em class="parameter"><code>buf</code></em> is a buffer of length
+<em class="parameter"><code>len</code></em> bytes which is used to store the
+<code class="constant">h_name</code>, <code class="constant">h_aliases</code>, and
+<code class="constant">h_addr_list</code> elements of the <span class="type">struct
+hostent</span> returned in <em class="parameter"><code>resbuf</code></em>.
+Successful calls to <code class="function">lwres_gethostbyname_r()</code>
+return <em class="parameter"><code>resbuf</code></em>,
+which is a pointer to the <span class="type">struct hostent</span> it created.
+</p>
+<p>
+<code class="function">lwres_gethostbyaddr_r()</code> is a thread-safe function
+that performs a reverse lookup of address <em class="parameter"><code>addr</code></em>
+which is <em class="parameter"><code>len</code></em> bytes long and is of protocol
+family <em class="parameter"><code>type</code></em> &#8212; <span class="type">PF_INET</span> or
+<span class="type">PF_INET6</span>. If an error occurs, the error code is returned
+in <em class="parameter"><code>*error</code></em>. The other function parameters are
+identical to those in <code class="function">lwres_gethostbyname_r()</code>.
+<em class="parameter"><code>resbuf</code></em> is a pointer to a <span class="type">struct
+hostent</span> which is initialised by a successful call to
+<code class="function">lwres_gethostbyaddr_r()</code>.
+<em class="parameter"><code>buf</code></em> is a buffer of length
+<em class="parameter"><code>len</code></em> bytes which is used to store the
+<code class="constant">h_name</code>, <code class="constant">h_aliases</code>, and
+<code class="constant">h_addr_list</code> elements of the <span class="type">struct
+hostent</span> returned in <em class="parameter"><code>resbuf</code></em>. Successful
+calls to <code class="function">lwres_gethostbyaddr_r()</code> return
+<em class="parameter"><code>resbuf</code></em>, which is a pointer to the
+<code class="function">struct hostent()</code> it created.
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2515200"></a><h2>RETURN VALUES</h2>
+<p>
+The functions
+<code class="function">lwres_gethostbyname()</code>,
+<code class="function">lwres_gethostbyname2()</code>,
+<code class="function">lwres_gethostbyaddr()</code>,
and
-<CODE
-CLASS="FUNCTION"
->lwres_gethostent()</CODE
->
+<code class="function">lwres_gethostent()</code>
return NULL to indicate an error. In this case the global variable
-<SPAN
-CLASS="TYPE"
->lwres_h_errno</SPAN
->
+<span class="type">lwres_h_errno</span>
will contain one of the following error codes defined in
-<TT
-CLASS="FILENAME"
->&lt;lwres/netdb.h&gt;</TT
->:
+<code class="filename">&lt;lwres/netdb.h&gt;</code>:
-<P
-></P
-><DIV
-CLASS="VARIABLELIST"
-><DL
-><DT
-><CODE
-CLASS="CONSTANT"
->HOST_NOT_FOUND</CODE
-></DT
-><DD
-><P
->The host or address was not found.</P
-></DD
-><DT
-><CODE
-CLASS="CONSTANT"
->TRY_AGAIN</CODE
-></DT
-><DD
-><P
->A recoverable error occurred, e.g., a timeout.
-Retrying the lookup may succeed.</P
-></DD
-><DT
-><CODE
-CLASS="CONSTANT"
->NO_RECOVERY</CODE
-></DT
-><DD
-><P
->A non-recoverable error occurred.</P
-></DD
-><DT
-><CODE
-CLASS="CONSTANT"
->NO_DATA</CODE
-></DT
-><DD
-><P
->The name exists, but has no address information
+</p>
+<div class="variablelist"><dl>
+<dt><span class="term"><code class="constant">HOST_NOT_FOUND</code></span></dt>
+<dd><p>
+The host or address was not found.
+</p></dd>
+<dt><span class="term"><code class="constant">TRY_AGAIN</code></span></dt>
+<dd><p>
+A recoverable error occurred, e.g., a timeout.
+Retrying the lookup may succeed.
+</p></dd>
+<dt><span class="term"><code class="constant">NO_RECOVERY</code></span></dt>
+<dd><p>
+A non-recoverable error occurred.
+</p></dd>
+<dt><span class="term"><code class="constant">NO_DATA</code></span></dt>
+<dd><p>
+The name exists, but has no address information
associated with it (or vice versa in the case
of a reverse lookup). The code NO_ADDRESS
is accepted as a synonym for NO_DATA for backwards
-compatibility.</P
-></DD
-></DL
-></DIV
-></P
-><P
-><SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->lwres_hstrerror</SPAN
->(3)</SPAN
->
-translates these error codes to suitable error messages.</P
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_gethostent()</CODE
->
+compatibility.
+</p></dd>
+</dl></div>
+<p>
+</p>
+<p>
+<span class="citerefentry"><span class="refentrytitle">lwres_hstrerror</span>(3
+)</span>
+translates these error codes to suitable error messages.
+</p>
+<p>
+<code class="function">lwres_gethostent()</code>
and
-<CODE
-CLASS="FUNCTION"
->lwres_gethostent_r()</CODE
->
+<code class="function">lwres_gethostent_r()</code>
always return
-<SPAN
-CLASS="TYPE"
->NULL</SPAN
->.</P
-><P
->Successful calls to <CODE
-CLASS="FUNCTION"
->lwres_gethostbyname_r()</CODE
-> and
-<CODE
-CLASS="FUNCTION"
->lwres_gethostbyaddr_r()</CODE
-> return
-<VAR
-CLASS="PARAMETER"
->resbuf</VAR
->, a pointer to the <SPAN
-CLASS="TYPE"
->struct
-hostent</SPAN
-> that was initialised by these functions. They return
-<SPAN
-CLASS="TYPE"
->NULL</SPAN
-> if the lookups fail or if <VAR
-CLASS="PARAMETER"
->buf</VAR
->
+<span class="type">NULL</span>.
+</p>
+<p>
+Successful calls to <code class="function">lwres_gethostbyname_r()</code> and
+<code class="function">lwres_gethostbyaddr_r()</code> return
+<em class="parameter"><code>resbuf</code></em>, a pointer to the <span class="type">struct
+hostent</span> that was initialised by these functions. They return
+<span class="type">NULL</span> if the lookups fail or if <em class="parameter"><code>buf</code></em>
was too small to hold the list of addresses and names referenced by
-the <CODE
-CLASS="CONSTANT"
->h_name</CODE
->, <CODE
-CLASS="CONSTANT"
->h_aliases</CODE
->, and
-<CODE
-CLASS="CONSTANT"
->h_addr_list</CODE
-> elements of the <SPAN
-CLASS="TYPE"
->struct
-hostent</SPAN
->. If <VAR
-CLASS="PARAMETER"
->buf</VAR
-> was too small, both
-<CODE
-CLASS="FUNCTION"
->lwres_gethostbyname_r()</CODE
-> and
-<CODE
-CLASS="FUNCTION"
->lwres_gethostbyaddr_r()</CODE
-> set the global variable
-<SPAN
-CLASS="TYPE"
->errno</SPAN
-> to <SPAN
-CLASS="ERRORCODE"
->ERANGE</SPAN
->.</P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN245"
-></A
-><H2
->SEE ALSO</H2
-><P
-><SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->gethostent</SPAN
->(3)</SPAN
->,
+the <code class="constant">h_name</code>, <code class="constant">h_aliases</code>, and
+<code class="constant">h_addr_list</code> elements of the <span class="type">struct
+hostent</span>. If <em class="parameter"><code>buf</code></em> was too small, both
+<code class="function">lwres_gethostbyname_r()</code> and
+<code class="function">lwres_gethostbyaddr_r()</code> set the global variable
+<span class="type">errno</span> to <span class="errorcode">ERANGE</span>.
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2515360"></a><h2>SEE ALSO</h2>
+<p>
+<span class="citerefentry"><span class="refentrytitle">gethostent</span>(3)</span>,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->lwres_getipnode</SPAN
->(3)</SPAN
->,
+<span class="citerefentry"><span class="refentrytitle">lwres_getipnode</span>(3)</span>,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->lwres_hstrerror</SPAN
->(3)</SPAN
-></P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN257"
-></A
-><H2
->BUGS</H2
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_gethostbyname()</CODE
->,
-<CODE
-CLASS="FUNCTION"
->lwres_gethostbyname2()</CODE
->,
-<CODE
-CLASS="FUNCTION"
->lwres_gethostbyaddr()</CODE
->
+<span class="citerefentry"><span class="refentrytitle">lwres_hstrerror</span>(3
+)</span>
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2515395"></a><h2>BUGS</h2>
+<p>
+<code class="function">lwres_gethostbyname()</code>,
+<code class="function">lwres_gethostbyname2()</code>,
+<code class="function">lwres_gethostbyaddr()</code>
and
-<CODE
-CLASS="FUNCTION"
->lwres_endhostent()</CODE
->
+<code class="function">lwres_endhostent()</code>
are not thread safe; they return pointers to static data and
provide error codes through a global variable.
Thread-safe versions for name and address lookup are provided by
-<CODE
-CLASS="FUNCTION"
->lwres_gethostbyname_r()</CODE
->,
+<code class="function">lwres_gethostbyname_r()</code>,
and
-<CODE
-CLASS="FUNCTION"
->lwres_gethostbyaddr_r()</CODE
->
-respectively.</P
-><P
->The resolver daemon does not currently support any non-DNS
+<code class="function">lwres_gethostbyaddr_r()</code>
+respectively.
+</p>
+<p>
+The resolver daemon does not currently support any non-DNS
name services such as
-<TT
-CLASS="FILENAME"
->/etc/hosts</TT
->
+<code class="filename">/etc/hosts</code>
or
-<SPAN
-CLASS="TYPE"
->NIS</SPAN
->,
-consequently the above functions don't, either.</P
-></DIV
-></BODY
-></HTML
->
+<span class="type">NIS</span>,
+consequently the above functions don't, either.
+</p>
+</div>
+</div></body>
+</html>
diff --git a/lib/lwres/man/lwres_getipnode.3 b/lib/lwres/man/lwres_getipnode.3
index 815a8415..1f7907c8 100644
--- a/lib/lwres/man/lwres_getipnode.3
+++ b/lib/lwres/man/lwres_getipnode.3
@@ -1,52 +1,59 @@
-.\" Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
-.\" Copyright (C) 2000, 2001 Internet Software Consortium.
-.\"
+.\" Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+.\" Copyright (C) 2000, 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,
+.\" 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: lwres_getipnode.3,v 1.13.2.2.4.2 2004/03/09 05:21:10 marka Exp $
+.\" $Id: lwres_getipnode.3,v 1.13.2.2.4.5 2005/09/12 00:47:27 marka Exp $
.\"
-.TH "LWRES_GETIPNODE" "3" "Jun 30, 2000" "BIND9" ""
+.hy 0
+.ad l
+.\"Generated by db2man.xsl. Don't modify this, modify the source.
+.de Sh \" Subsection
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Ip \" List item
+.br
+.ie \\n(.$>=3 .ne \\$3
+.el .ne 3
+.IP "\\$1" \\$2
+..
+.TH "LWRES_GETIPNODE" 3 "Jun 30, 2000" "" ""
.SH NAME
lwres_getipnodebyname, lwres_getipnodebyaddr, lwres_freehostent \- lightweight resolver nodename / address translation API
-.SH SYNOPSIS
-\fB#include <lwres/netdb.h>
-.sp
-.na
-struct hostent *
-lwres_getipnodebyname(const char *name, int af, int flags, int *error_num);
-.ad
-.sp
-.na
-struct hostent *
-lwres_getipnodebyaddr(const void *src, size_t len, int af, int *error_num);
-.ad
-.sp
-.na
-void
-lwres_freehostent(struct hostent *he);
-.ad
-\fR
+.SH "SYNOPSIS"
+.nf
+#include <lwres/netdb\&.h>
+.fi
+.HP 42
+struct\ hostent\ *\ \fBlwres_getipnodebyname\fR\ (const\ char\ *name, int\ af, int\ flags, int\ *error_num);
+.HP 42
+struct\ hostent\ *\ \fBlwres_getipnodebyaddr\fR\ (const\ void\ *src, size_t\ len, int\ af, int\ *error_num);
+.HP 24
+void\ \fBlwres_freehostent\fR\ (struct\ hostent\ *he);
.SH "DESCRIPTION"
.PP
-These functions perform thread safe, protocol independent
-nodename-to-address and address-to-nodename
-translation as defined in RFC2553.
+These functions perform thread safe, protocol independent nodename\-to\-address and address\-to\-nodename translation as defined in RFC2553\&.
.PP
-They use a
-\fBstruct hostent\fR
-which is defined in
-\fInamedb.h\fR:
-.sp
+They use a \fBstruct hostent\fR which is defined in \fInamedb\&.h\fR:
.nf
struct hostent {
char *h_name; /* official name of host */
@@ -56,134 +63,59 @@ struct hostent {
char **h_addr_list; /* list of addresses from name server */
};
#define h_addr h_addr_list[0] /* address, for backward compatibility */
-.sp
.fi
.PP
-The members of this structure are:
+The members of this structure are:
.TP
\fBh_name\fR
-The official (canonical) name of the host.
+The official (canonical) name of the host\&.
.TP
\fBh_aliases\fR
-A NULL-terminated array of alternate names (nicknames) for the host.
+A NULL\-terminated array of alternate names (nicknames) for the host\&.
.TP
\fBh_addrtype\fR
-The type of address being returned - usually
-\fBPF_INET\fR
-or
-\fBPF_INET6\fR.
+The type of address being returned \- usually \fBPF_INET\fR or \fBPF_INET6\fR\&.
.TP
\fBh_length\fR
-The length of the address in bytes.
+The length of the address in bytes\&.
.TP
\fBh_addr_list\fR
-A
-\fBNULL\fR
-terminated array of network addresses for the host.
-Host addresses are returned in network byte order.
+A \fBNULL\fR terminated array of network addresses for the host\&. Host addresses are returned in network byte order\&.
.PP
-\fBlwres_getipnodebyname()\fR
-looks up addresses of protocol family
-\fIaf\fR
-for the hostname
-\fIname\fR.
-The
-\fIflags\fR
-parameter contains ORed flag bits to
-specify the types of addresses that are searched
-for, and the types of addresses that are returned.
-The flag bits are:
+ \fBlwres_getipnodebyname()\fR looks up addresses of protocol family \fIaf\fR for the hostname \fIname\fR\&. The \fIflags\fR parameter contains ORed flag bits to specify the types of addresses that are searched for, and the types of addresses that are returned\&. The flag bits are:
.TP
\fBAI_V4MAPPED\fR
-This is used with an
-\fIaf\fR
-of AF_INET6, and causes IPv4 addresses to be returned as IPv4-mapped
-IPv6 addresses.
+This is used with an \fIaf\fR of AF_INET6, and causes IPv4 addresses to be returned as IPv4\-mapped IPv6 addresses\&.
.TP
\fBAI_ALL\fR
-This is used with an
-\fIaf\fR
-of AF_INET6, and causes all known addresses (IPv6 and IPv4) to be returned.
-If AI_V4MAPPED is also set, the IPv4 addresses are return as mapped
-IPv6 addresses.
+This is used with an \fIaf\fR of AF_INET6, and causes all known addresses (IPv6 and IPv4) to be returned\&. If AI_V4MAPPED is also set, the IPv4 addresses are return as mapped IPv6 addresses\&.
.TP
\fBAI_ADDRCONFIG\fR
-Only return an IPv6 or IPv4 address if here is an active network
-interface of that type. This is not currently implemented
-in the BIND 9 lightweight resolver, and the flag is ignored.
+Only return an IPv6 or IPv4 address if here is an active network interface of that type\&. This is not currently implemented in the BIND 9 lightweight resolver, and the flag is ignored\&.
.TP
\fBAI_DEFAULT\fR
-This default sets the
-AI_V4MAPPED
-and
-AI_ADDRCONFIG
-flag bits.
+This default sets the \fBAI_V4MAPPED\fR and \fBAI_ADDRCONFIG\fR flag bits\&.
.PP
-\fBlwres_getipnodebyaddr()\fR
-performs a reverse lookup
-of address
-\fIsrc\fR
-which is
-\fIlen\fR
-bytes long.
-\fIaf\fR
-denotes the protocol family, typically
-\fBPF_INET\fR
-or
-\fBPF_INET6\fR.
+ \fBlwres_getipnodebyaddr()\fR performs a reverse lookup of address \fIsrc\fR which is \fIlen\fR bytes long\&. \fIaf\fR denotes the protocol family, typically \fBPF_INET\fR or \fBPF_INET6\fR\&.
.PP
-\fBlwres_freehostent()\fR
-releases all the memory associated with
-the
-\fBstruct hostent\fR
-pointer
-\fIhe\fR.
-Any memory allocated for the
-h_name,
-h_addr_list
-and
-h_aliases
-is freed, as is the memory for the
-\fBhostent\fR
-structure itself.
+ \fBlwres_freehostent()\fR releases all the memory associated with the \fBstruct hostent\fR pointer \fIhe\fR\&. Any memory allocated for the \fBh_name\fR, \fBh_addr_list\fR and \fBh_aliases\fR is freed, as is the memory for the \fBhostent\fR structure itself\&.
.SH "RETURN VALUES"
.PP
-If an error occurs,
-\fBlwres_getipnodebyname()\fR
-and
-\fBlwres_getipnodebyaddr()\fR
-set
-\fI*error_num\fR
-to an appropriate error code and the function returns a
-\fBNULL\fR
-pointer.
-The error codes and their meanings are defined in
-\fI<lwres/netdb.h>\fR:
+If an error occurs, \fBlwres_getipnodebyname()\fR and \fBlwres_getipnodebyaddr()\fR set \fI*error_num\fR to an appropriate error code and the function returns a \fBNULL\fR pointer\&. The error codes and their meanings are defined in \fI<lwres/netdb\&.h>\fR:
.TP
\fBHOST_NOT_FOUND\fR
-No such host is known.
+No such host is known\&.
.TP
\fBNO_ADDRESS\fR
-The server recognised the request and the name but no address is
-available. Another type of request to the name server for the
-domain might return an answer.
+The server recognised the request and the name but no address is available\&. Another type of request to the name server for the domain might return an answer\&.
.TP
\fBTRY_AGAIN\fR
-A temporary and possibly transient error occurred, such as a
-failure of a server to respond. The request may succeed if
-retried.
+A temporary and possibly transient error occurred, such as a failure of a server to respond\&. The request may succeed if retried\&.
.TP
\fBNO_RECOVERY\fR
-An unexpected failure occurred, and retrying the request
-is pointless.
+An unexpected failure occurred, and retrying the request is pointless\&.
.PP
-\fBlwres_hstrerror\fR(3)
-translates these error codes to suitable error messages.
+ \fBlwres_hstrerror\fR(3 ) translates these error codes to suitable error messages\&.
.SH "SEE ALSO"
.PP
-\fBRFC2553\fR,
-\fBlwres\fR(3),
-\fBlwres_gethostent\fR(3),
-\fBlwres_getaddrinfo\fR(3),
-\fBlwres_getnameinfo\fR(3),
-\fBlwres_hstrerror\fR(3).
+ \fBRFC2553\fR(), \fBlwres\fR(3), \fBlwres_gethostent\fR(3), \fBlwres_getaddrinfo\fR(3), \fBlwres_getnameinfo\fR(3), \fBlwres_hstrerror\fR(3)\&.
diff --git a/lib/lwres/man/lwres_getipnode.docbook b/lib/lwres/man/lwres_getipnode.docbook
index 30c04a35..94de72c0 100644
--- a/lib/lwres/man/lwres_getipnode.docbook
+++ b/lib/lwres/man/lwres_getipnode.docbook
@@ -1,7 +1,9 @@
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.0//EN"
+ "http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd"
+ [<!ENTITY mdash "&#8212;">]>
<!--
- - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- - Copyright (C) 2001, 2003 Internet Software Consortium.
+ - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2000, 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
@@ -16,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: lwres_getipnode.docbook,v 1.4.2.2.4.1 2004/03/06 08:15:39 marka Exp $ -->
+<!-- $Id: lwres_getipnode.docbook,v 1.4.2.2.4.3 2005/05/12 21:36:14 sra Exp $ -->
<refentry>
@@ -30,6 +32,20 @@
<refmiscinfo>BIND9</refmiscinfo>
</refmeta>
+ <docinfo>
+ <copyright>
+ <year>2004</year>
+ <year>2005</year>
+ <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
+ </copyright>
+ <copyright>
+ <year>2000</year>
+ <year>2001</year>
+ <year>2003</year>
+ <holder>Internet Software Consortium.</holder>
+ </copyright>
+ </docinfo>
+
<refnamediv>
<refname>lwres_getipnodebyname</refname>
<refname>lwres_getipnodebyaddr</refname>
diff --git a/lib/lwres/man/lwres_getipnode.html b/lib/lwres/man/lwres_getipnode.html
index 3063d440..7f650ac1 100644
--- a/lib/lwres/man/lwres_getipnode.html
+++ b/lib/lwres/man/lwres_getipnode.html
@@ -1,512 +1,298 @@
<!--
- - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- - Copyright (C) 2001, 2003 Internet Software Consortium.
- -
+ - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2000, 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,
+ - 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: lwres_getipnode.html,v 1.7.2.1.4.2 2004/08/22 23:39:04 marka Exp $ -->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<HTML
-><HEAD
-><TITLE
->lwres_getipnode</TITLE
-><META
-NAME="GENERATOR"
-CONTENT="Modular DocBook HTML Stylesheet Version 1.7"></HEAD
-><BODY
-CLASS="REFENTRY"
-BGCOLOR="#FFFFFF"
-TEXT="#000000"
-LINK="#0000FF"
-VLINK="#840084"
-ALINK="#0000FF"
-><H1
-><A
-NAME="AEN1"
-></A
->lwres_getipnode</H1
-><DIV
-CLASS="REFNAMEDIV"
-><A
-NAME="AEN8"
-></A
-><H2
->Name</H2
->lwres_getipnodebyname, lwres_getipnodebyaddr, lwres_freehostent&nbsp;--&nbsp;lightweight resolver nodename / address translation API</DIV
-><DIV
-CLASS="REFSYNOPSISDIV"
-><A
-NAME="AEN13"
-></A
-><H2
->Synopsis</H2
-><DIV
-CLASS="FUNCSYNOPSIS"
-><P
-></P
-><A
-NAME="AEN14"
-></A
-><PRE
-CLASS="FUNCSYNOPSISINFO"
->#include &lt;lwres/netdb.h&gt;</PRE
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->struct hostent *
-lwres_getipnodebyname</CODE
->(const char *name, int af, int flags, int *error_num);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->struct hostent *
-lwres_getipnodebyaddr</CODE
->(const void *src, size_t len, int af, int *error_num);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->void
-lwres_freehostent</CODE
->(struct hostent *he);</CODE
-></P
-><P
-></P
-></DIV
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN34"
-></A
-><H2
->DESCRIPTION</H2
-><P
->These functions perform thread safe, protocol independent
+<!-- $Id: lwres_getipnode.html,v 1.7.2.1.4.7 2005/07/18 02:36:53 marka Exp $ -->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>lwres_getipnode</title>
+<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
+<a name="id2456972"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2>Name</h2>
+<p>lwres_getipnodebyname, lwres_getipnodebyaddr, lwres_freehostent &#8212; lightweight resolver nodename / address translation API</p>
+</div>
+<div class="refsynopsisdiv">
+<h2>Synopsis</h2>
+<div class="funcsynopsis">
+<pre class="funcsynopsisinfo">#include &lt;lwres/netdb.h&gt;</pre>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+struct hostent *
+<b class="fsfunc">lwres_getipnodebyname</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+struct hostent *
+<b class="fsfunc">lwres_getipnodebyaddr</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr>
+<td><code class="funcdef">
+void
+<b class="fsfunc">lwres_freehostent</b>(</code></td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr></table>
+</div>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514579"></a><h2>DESCRIPTION</h2>
+<p>
+These functions perform thread safe, protocol independent
nodename-to-address and address-to-nodename
-translation as defined in RFC2553.</P
-><P
->They use a
-<SPAN
-CLASS="TYPE"
->struct hostent</SPAN
->
+translation as defined in RFC2553.
+</p>
+<p>
+They use a
+<span class="type">struct hostent</span>
which is defined in
-<TT
-CLASS="FILENAME"
->namedb.h</TT
->:
-<PRE
-CLASS="PROGRAMLISTING"
->struct hostent {
+<code class="filename">namedb.h</code>:
+</p>
+<pre class="programlisting">
+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 compatibility */</PRE
-></P
-><P
->The members of this structure are:
-<P
-></P
-><DIV
-CLASS="VARIABLELIST"
-><DL
-><DT
-><CODE
-CLASS="CONSTANT"
->h_name</CODE
-></DT
-><DD
-><P
->The official (canonical) name of the host.</P
-></DD
-><DT
-><CODE
-CLASS="CONSTANT"
->h_aliases</CODE
-></DT
-><DD
-><P
->A NULL-terminated array of alternate names (nicknames) for the host.</P
-></DD
-><DT
-><CODE
-CLASS="CONSTANT"
->h_addrtype</CODE
-></DT
-><DD
-><P
->The type of address being returned - usually
-<SPAN
-CLASS="TYPE"
->PF_INET</SPAN
->
+#define h_addr h_addr_list[0] /* address, for backward compatibility */
+</pre>
+<p>
+</p>
+<p>
+The members of this structure are:
+</p>
+<div class="variablelist"><dl>
+<dt><span class="term"><code class="constant">h_name</code></span></dt>
+<dd><p>
+The official (canonical) name of the host.
+</p></dd>
+<dt><span class="term"><code class="constant">h_aliases</code></span></dt>
+<dd><p>
+A NULL-terminated array of alternate names (nicknames) for the host.
+</p></dd>
+<dt><span class="term"><code class="constant">h_addrtype</code></span></dt>
+<dd><p>
+The type of address being returned - usually
+<span class="type">PF_INET</span>
or
-<SPAN
-CLASS="TYPE"
->PF_INET6</SPAN
->.&#13;</P
-></DD
-><DT
-><CODE
-CLASS="CONSTANT"
->h_length</CODE
-></DT
-><DD
-><P
->The length of the address in bytes.</P
-></DD
-><DT
-><CODE
-CLASS="CONSTANT"
->h_addr_list</CODE
-></DT
-><DD
-><P
->A
-<SPAN
-CLASS="TYPE"
->NULL</SPAN
->
+<span class="type">PF_INET6</span>.
+
+</p></dd>
+<dt><span class="term"><code class="constant">h_length</code></span></dt>
+<dd><p>
+The length of the address in bytes.
+</p></dd>
+<dt><span class="term"><code class="constant">h_addr_list</code></span></dt>
+<dd><p>
+A
+<span class="type">NULL</span>
terminated array of network addresses for the host.
-Host addresses are returned in network byte order.</P
-></DD
-></DL
-></DIV
-></P
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_getipnodebyname()</CODE
->
+Host addresses are returned in network byte order.
+</p></dd>
+</dl></div>
+<p>
+</p>
+<p>
+<code class="function">lwres_getipnodebyname()</code>
looks up addresses of protocol family
-<VAR
-CLASS="PARAMETER"
->af</VAR
->
+<em class="parameter"><code>af</code></em>
for the hostname
-<VAR
-CLASS="PARAMETER"
->name</VAR
->.
+<em class="parameter"><code>name</code></em>.
The
-<VAR
-CLASS="PARAMETER"
->flags</VAR
->
+<em class="parameter"><code>flags</code></em>
parameter contains ORed flag bits to
specify the types of addresses that are searched
for, and the types of addresses that are returned.
The flag bits are:
-<P
-></P
-><DIV
-CLASS="VARIABLELIST"
-><DL
-><DT
-><CODE
-CLASS="CONSTANT"
->AI_V4MAPPED</CODE
-></DT
-><DD
-><P
->This is used with an
-<VAR
-CLASS="PARAMETER"
->af</VAR
->
+</p>
+<div class="variablelist"><dl>
+<dt><span class="term"><code class="constant">AI_V4MAPPED</code></span></dt>
+<dd><p>
+This is used with an
+<em class="parameter"><code>af</code></em>
of AF_INET6, and causes IPv4 addresses to be returned as IPv4-mapped
-IPv6 addresses.</P
-></DD
-><DT
-><CODE
-CLASS="CONSTANT"
->AI_ALL</CODE
-></DT
-><DD
-><P
->This is used with an
-<VAR
-CLASS="PARAMETER"
->af</VAR
->
+IPv6 addresses.
+</p></dd>
+<dt><span class="term"><code class="constant">AI_ALL</code></span></dt>
+<dd><p>
+This is used with an
+<em class="parameter"><code>af</code></em>
of AF_INET6, and causes all known addresses (IPv6 and IPv4) to be returned.
If AI_V4MAPPED is also set, the IPv4 addresses are return as mapped
-IPv6 addresses.</P
-></DD
-><DT
-><CODE
-CLASS="CONSTANT"
->AI_ADDRCONFIG</CODE
-></DT
-><DD
-><P
->Only return an IPv6 or IPv4 address if here is an active network
+IPv6 addresses.
+</p></dd>
+<dt><span class="term"><code class="constant">AI_ADDRCONFIG</code></span></dt>
+<dd><p>
+Only return an IPv6 or IPv4 address if here is an active network
interface of that type. This is not currently implemented
-in the BIND 9 lightweight resolver, and the flag is ignored.</P
-></DD
-><DT
-><CODE
-CLASS="CONSTANT"
->AI_DEFAULT</CODE
-></DT
-><DD
-><P
->This default sets the
-<CODE
-CLASS="CONSTANT"
->AI_V4MAPPED</CODE
->
+in the BIND 9 lightweight resolver, and the flag is ignored.
+</p></dd>
+<dt><span class="term"><code class="constant">AI_DEFAULT</code></span></dt>
+<dd><p>
+This default sets the
+<code class="constant">AI_V4MAPPED</code>
and
-<CODE
-CLASS="CONSTANT"
->AI_ADDRCONFIG</CODE
->
-flag bits.</P
-></DD
-></DL
-></DIV
-></P
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_getipnodebyaddr()</CODE
->
+<code class="constant">AI_ADDRCONFIG</code>
+flag bits.
+</p></dd>
+</dl></div>
+<p>
+</p>
+<p>
+<code class="function">lwres_getipnodebyaddr()</code>
performs a reverse lookup
of address
-<VAR
-CLASS="PARAMETER"
->src</VAR
->
+<em class="parameter"><code>src</code></em>
which is
-<VAR
-CLASS="PARAMETER"
->len</VAR
->
+<em class="parameter"><code>len</code></em>
bytes long.
-<VAR
-CLASS="PARAMETER"
->af</VAR
->
+<em class="parameter"><code>af</code></em>
denotes the protocol family, typically
-<SPAN
-CLASS="TYPE"
->PF_INET</SPAN
->
+<span class="type">PF_INET</span>
or
-<SPAN
-CLASS="TYPE"
->PF_INET6</SPAN
->.&#13;</P
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_freehostent()</CODE
->
+<span class="type">PF_INET6</span>.
+
+</p>
+<p>
+<code class="function">lwres_freehostent()</code>
releases all the memory associated with
the
-<SPAN
-CLASS="TYPE"
->struct hostent</SPAN
->
+<span class="type">struct hostent</span>
pointer
-<VAR
-CLASS="PARAMETER"
->he</VAR
->.
+<em class="parameter"><code>he</code></em>.
Any memory allocated for the
-<CODE
-CLASS="CONSTANT"
->h_name</CODE
->,
+<code class="constant">h_name</code>,
-<CODE
-CLASS="CONSTANT"
->h_addr_list</CODE
->
+<code class="constant">h_addr_list</code>
and
-<CODE
-CLASS="CONSTANT"
->h_aliases</CODE
->
+<code class="constant">h_aliases</code>
is freed, as is the memory for the
-<SPAN
-CLASS="TYPE"
->hostent</SPAN
->
-structure itself.</P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN116"
-></A
-><H2
->RETURN VALUES</H2
-><P
->If an error occurs,
-<CODE
-CLASS="FUNCTION"
->lwres_getipnodebyname()</CODE
->
+<span class="type">hostent</span>
+structure itself.
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514950"></a><h2>RETURN VALUES</h2>
+<p>
+If an error occurs,
+<code class="function">lwres_getipnodebyname()</code>
and
-<CODE
-CLASS="FUNCTION"
->lwres_getipnodebyaddr()</CODE
->
+<code class="function">lwres_getipnodebyaddr()</code>
set
-<VAR
-CLASS="PARAMETER"
->*error_num</VAR
->
+<em class="parameter"><code>*error_num</code></em>
to an appropriate error code and the function returns a
-<SPAN
-CLASS="TYPE"
->NULL</SPAN
->
+<span class="type">NULL</span>
pointer.
The error codes and their meanings are defined in
-<TT
-CLASS="FILENAME"
->&lt;lwres/netdb.h&gt;</TT
->:
-<P
-></P
-><DIV
-CLASS="VARIABLELIST"
-><DL
-><DT
-><CODE
-CLASS="CONSTANT"
->HOST_NOT_FOUND</CODE
-></DT
-><DD
-><P
->No such host is known.</P
-></DD
-><DT
-><CODE
-CLASS="CONSTANT"
->NO_ADDRESS</CODE
-></DT
-><DD
-><P
->The server recognised the request and the name but no address is
+<code class="filename">&lt;lwres/netdb.h&gt;</code>:
+</p>
+<div class="variablelist"><dl>
+<dt><span class="term"><code class="constant">HOST_NOT_FOUND</code></span></dt>
+<dd><p>
+No such host is known.
+</p></dd>
+<dt><span class="term"><code class="constant">NO_ADDRESS</code></span></dt>
+<dd><p>
+The server recognised the request and the name but no address is
available. Another type of request to the name server for the
-domain might return an answer.</P
-></DD
-><DT
-><CODE
-CLASS="CONSTANT"
->TRY_AGAIN</CODE
-></DT
-><DD
-><P
->A temporary and possibly transient error occurred, such as a
+domain might return an answer.
+</p></dd>
+<dt><span class="term"><code class="constant">TRY_AGAIN</code></span></dt>
+<dd><p>
+A temporary and possibly transient error occurred, such as a
failure of a server to respond. The request may succeed if
-retried.</P
-></DD
-><DT
-><CODE
-CLASS="CONSTANT"
->NO_RECOVERY</CODE
-></DT
-><DD
-><P
->An unexpected failure occurred, and retrying the request
-is pointless.</P
-></DD
-></DL
-></DIV
-></P
-><P
-><SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->lwres_hstrerror</SPAN
->(3)</SPAN
->
-translates these error codes to suitable error messages.</P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN149"
-></A
-><H2
->SEE ALSO</H2
-><P
-><SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->RFC2553</SPAN
-></SPAN
->,
+retried.
+</p></dd>
+<dt><span class="term"><code class="constant">NO_RECOVERY</code></span></dt>
+<dd><p>
+An unexpected failure occurred, and retrying the request
+is pointless.
+</p></dd>
+</dl></div>
+<p>
+</p>
+<p>
+<span class="citerefentry"><span class="refentrytitle">lwres_hstrerror</span>(3
+)</span>
+translates these error codes to suitable error messages.
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2515041"></a><h2>SEE ALSO</h2>
+<p>
+<span class="citerefentry"><span class="refentrytitle">RFC2553</span></span>,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->lwres</SPAN
->(3)</SPAN
->,
+<span class="citerefentry"><span class="refentrytitle">lwres</span>(3)</span>,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->lwres_gethostent</SPAN
->(3)</SPAN
->,
+<span class="citerefentry"><span class="refentrytitle">lwres_gethostent</span>(3)</span>,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->lwres_getaddrinfo</SPAN
->(3)</SPAN
->,
+<span class="citerefentry"><span class="refentrytitle">lwres_getaddrinfo</span>(3)</span>,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->lwres_getnameinfo</SPAN
->(3)</SPAN
->,
+<span class="citerefentry"><span class="refentrytitle">lwres_getnameinfo</span>(3)</span>,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->lwres_hstrerror</SPAN
->(3)</SPAN
->.</P
-></DIV
-></BODY
-></HTML
->
+<span class="citerefentry"><span class="refentrytitle">lwres_hstrerror</span>(3)</span>.
+</p>
+</div>
+</div></body>
+</html>
diff --git a/lib/lwres/man/lwres_getnameinfo.3 b/lib/lwres/man/lwres_getnameinfo.3
index a5122706..185d19fd 100644
--- a/lib/lwres/man/lwres_getnameinfo.3
+++ b/lib/lwres/man/lwres_getnameinfo.3
@@ -1,86 +1,78 @@
-.\" Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
-.\" Copyright (C) 2000, 2001 Internet Software Consortium.
-.\"
+.\" Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+.\" Copyright (C) 2000, 2001 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,
+.\" 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: lwres_getnameinfo.3,v 1.15.2.1.8.1 2004/03/06 07:41:43 marka Exp $
+.\" $Id: lwres_getnameinfo.3,v 1.15.2.1.8.4 2005/09/12 00:47:28 marka Exp $
.\"
-.TH "LWRES_GETNAMEINFO" "3" "Jun 30, 2000" "BIND9" ""
+.hy 0
+.ad l
+.\"Generated by db2man.xsl. Don't modify this, modify the source.
+.de Sh \" Subsection
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Ip \" List item
+.br
+.ie \\n(.$>=3 .ne \\$3
+.el .ne 3
+.IP "\\$1" \\$2
+..
+.TH "LWRES_GETNAMEINFO" 3 "Jun 30, 2000" "" ""
.SH NAME
lwres_getnameinfo \- lightweight resolver socket address structure to hostname and service name
-.SH SYNOPSIS
-\fB#include <lwres/netdb.h>
-.sp
-.na
-int
-lwres_getnameinfo(const struct sockaddr *sa, size_t salen, char *host, size_t hostlen, char *serv, size_t servlen, int flags);
-.ad
-\fR
+.SH "SYNOPSIS"
+.nf
+#include <lwres/netdb\&.h>
+.fi
+.HP 23
+int\ \fBlwres_getnameinfo\fR\ (const\ struct\ sockaddr\ *sa, size_t\ salen, char\ *host, size_t\ hostlen, char\ *serv, size_t\ servlen, int\ flags);
.SH "DESCRIPTION"
.PP
-This function is equivalent to the \fBgetnameinfo\fR(3) function defined in RFC2133.
-\fBlwres_getnameinfo()\fR returns the hostname for the
-\fBstruct sockaddr\fR \fIsa\fR which is
-\fIsalen\fR bytes long. The hostname is of length
-\fIhostlen\fR and is returned via
-\fI*host.\fR The maximum length of the hostname is
-1025 bytes: NI_MAXHOST.
+This function is equivalent to the \fBgetnameinfo\fR(3) function defined in RFC2133\&. \fBlwres_getnameinfo()\fR returns the hostname for the \fBstruct sockaddr\fR \fIsa\fR which is \fIsalen\fR bytes long\&. The hostname is of length \fIhostlen\fR and is returned via \fI*host\&.\fR The maximum length of the hostname is 1025 bytes: \fBNI_MAXHOST\fR\&.
.PP
-The name of the service associated with the port number in
-\fIsa\fR is returned in \fI*serv.\fR
-It is \fIservlen\fR bytes long. The maximum length
-of the service name is NI_MAXSERV - 32 bytes.
+The name of the service associated with the port number in \fIsa\fR is returned in \fI*serv\&.\fR It is \fIservlen\fR bytes long\&. The maximum length of the service name is \fBNI_MAXSERV\fR \- 32 bytes\&.
.PP
-The \fIflags\fR argument sets the following
-bits:
+The \fIflags\fR argument sets the following bits:
.TP
\fBNI_NOFQDN\fR
-A fully qualified domain name is not required for local hosts.
-The local part of the fully qualified domain name is returned instead.
+A fully qualified domain name is not required for local hosts\&. The local part of the fully qualified domain name is returned instead\&.
.TP
\fBNI_NUMERICHOST\fR
-Return the address in numeric form, as if calling inet_ntop(),
-instead of a host name.
+Return the address in numeric form, as if calling inet_ntop(), instead of a host name\&.
.TP
\fBNI_NAMEREQD\fR
-A name is required. If the hostname cannot be found in the DNS and
-this flag is set, a non-zero error code is returned.
-If the hostname is not found and the flag is not set, the
-address is returned in numeric form.
+A name is required\&. If the hostname cannot be found in the DNS and this flag is set, a non\-zero error code is returned\&. If the hostname is not found and the flag is not set, the address is returned in numeric form\&.
.TP
\fBNI_NUMERICSERV\fR
-The service name is returned as a digit string representing the port number.
+The service name is returned as a digit string representing the port number\&.
.TP
\fBNI_DGRAM\fR
-Specifies that the service being looked up is a datagram
-service, and causes getservbyport() to be called with a second
-argument of "udp" instead of its default of "tcp". This is required
-for the few ports (512-514) that have different services for UDP and
-TCP.
+Specifies that the service being looked up is a datagram service, and causes getservbyport() to be called with a second argument of "udp" instead of its default of "tcp"\&. This is required for the few ports (512\-514) that have different services for UDP and TCP\&.
.SH "RETURN VALUES"
.PP
-\fBlwres_getnameinfo()\fR
-returns 0 on success or a non-zero error code if an error occurs.
+ \fBlwres_getnameinfo()\fR returns 0 on success or a non\-zero error code if an error occurs\&.
.SH "SEE ALSO"
.PP
-\fBRFC2133\fR,
-\fBgetservbyport\fR(3),
-\fBlwres\fR(3),
-\fBlwres_getnameinfo\fR(3),
-\fBlwres_getnamebyaddr\fR(3).
-\fBlwres_net_ntop\fR(3).
+ \fBRFC2133\fR(), \fBgetservbyport\fR(3), \fBlwres\fR(3), \fBlwres_getnameinfo\fR(3), \fBlwres_getnamebyaddr\fR(3)\&. \fBlwres_net_ntop\fR(3)\&.
.SH "BUGS"
.PP
-RFC2133 fails to define what the nonzero return values of
-\fBgetnameinfo\fR(3)
-are.
+RFC2133 fails to define what the nonzero return values of \fBgetnameinfo\fR(3) are\&.
diff --git a/lib/lwres/man/lwres_getnameinfo.docbook b/lib/lwres/man/lwres_getnameinfo.docbook
index ff2eaad0..b6e10ac3 100644
--- a/lib/lwres/man/lwres_getnameinfo.docbook
+++ b/lib/lwres/man/lwres_getnameinfo.docbook
@@ -1,7 +1,9 @@
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.0//EN"
+ "http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd"
+ [<!ENTITY mdash "&#8212;">]>
<!--
- - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- - Copyright (C) 2001 Internet Software Consortium.
+ - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2000, 2001 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
@@ -16,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: lwres_getnameinfo.docbook,v 1.3.206.1 2004/03/06 08:15:40 marka Exp $ -->
+<!-- $Id: lwres_getnameinfo.docbook,v 1.3.206.3 2005/05/12 21:36:15 sra Exp $ -->
<refentry>
@@ -30,6 +32,19 @@
<refmiscinfo>BIND9</refmiscinfo>
</refmeta>
+ <docinfo>
+ <copyright>
+ <year>2004</year>
+ <year>2005</year>
+ <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
+ </copyright>
+ <copyright>
+ <year>2000</year>
+ <year>2001</year>
+ <holder>Internet Software Consortium.</holder>
+ </copyright>
+ </docinfo>
+
<refnamediv>
<refname>lwres_getnameinfo</refname>
<refpurpose>lightweight resolver socket address structure to hostname and service name</refpurpose>
@@ -140,6 +155,7 @@ returns 0 on success or a non-zero error code if an error occurs.
<citerefentry>
<refentrytitle>lwres_net_ntop</refentrytitle><manvolnum>3</manvolnum>
</citerefentry>.
+</para>
</refsect1>
<refsect1>
<title>BUGS</title>
diff --git a/lib/lwres/man/lwres_getnameinfo.html b/lib/lwres/man/lwres_getnameinfo.html
index 8130fe83..700cedad 100644
--- a/lib/lwres/man/lwres_getnameinfo.html
+++ b/lib/lwres/man/lwres_getnameinfo.html
@@ -1,290 +1,154 @@
<!--
- - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- - Copyright (C) 2001 Internet Software Consortium.
- -
+ - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2000, 2001 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,
+ - 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: lwres_getnameinfo.html,v 1.5.2.1.4.2 2004/08/22 23:39:04 marka Exp $ -->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<HTML
-><HEAD
-><TITLE
->lwres_getnameinfo</TITLE
-><META
-NAME="GENERATOR"
-CONTENT="Modular DocBook HTML Stylesheet Version 1.7"></HEAD
-><BODY
-CLASS="REFENTRY"
-BGCOLOR="#FFFFFF"
-TEXT="#000000"
-LINK="#0000FF"
-VLINK="#840084"
-ALINK="#0000FF"
-><H1
-><A
-NAME="AEN1"
-></A
->lwres_getnameinfo</H1
-><DIV
-CLASS="REFNAMEDIV"
-><A
-NAME="AEN8"
-></A
-><H2
->Name</H2
->lwres_getnameinfo&nbsp;--&nbsp;lightweight resolver socket address structure to hostname and service name</DIV
-><DIV
-CLASS="REFSYNOPSISDIV"
-><A
-NAME="AEN11"
-></A
-><H2
->Synopsis</H2
-><DIV
-CLASS="FUNCSYNOPSIS"
-><P
-></P
-><A
-NAME="AEN12"
-></A
-><PRE
-CLASS="FUNCSYNOPSISINFO"
->#include &lt;lwres/netdb.h&gt;</PRE
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->int
-lwres_getnameinfo</CODE
->(const struct sockaddr *sa, size_t salen, char *host, size_t hostlen, char *serv, size_t servlen, int flags);</CODE
-></P
-><P
-></P
-></DIV
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN24"
-></A
-><H2
->DESCRIPTION</H2
-><P
-> This function is equivalent to the <SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->getnameinfo</SPAN
->(3)</SPAN
-> function defined in RFC2133.
-<CODE
-CLASS="FUNCTION"
->lwres_getnameinfo()</CODE
-> returns the hostname for the
-<SPAN
-CLASS="TYPE"
->struct sockaddr</SPAN
-> <VAR
-CLASS="PARAMETER"
->sa</VAR
-> which is
-<VAR
-CLASS="PARAMETER"
->salen</VAR
-> bytes long. The hostname is of length
-<VAR
-CLASS="PARAMETER"
->hostlen</VAR
-> and is returned via
-<VAR
-CLASS="PARAMETER"
->*host.</VAR
-> The maximum length of the hostname is
-1025 bytes: <CODE
-CLASS="CONSTANT"
->NI_MAXHOST</CODE
->.</P
-><P
-> The name of the service associated with the port number in
-<VAR
-CLASS="PARAMETER"
->sa</VAR
-> is returned in <VAR
-CLASS="PARAMETER"
->*serv.</VAR
->
-It is <VAR
-CLASS="PARAMETER"
->servlen</VAR
-> bytes long. The maximum length
-of the service name is <CODE
-CLASS="CONSTANT"
->NI_MAXSERV</CODE
-> - 32 bytes.</P
-><P
-> The <VAR
-CLASS="PARAMETER"
->flags</VAR
-> argument sets the following
+<!-- $Id: lwres_getnameinfo.html,v 1.5.2.1.4.7 2005/07/18 02:36:53 marka Exp $ -->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>lwres_getnameinfo</title>
+<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
+<a name="id2456972"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2>Name</h2>
+<p>lwres_getnameinfo &#8212; lightweight resolver socket address structure to hostname and service name</p>
+</div>
+<div class="refsynopsisdiv">
+<h2>Synopsis</h2>
+<div class="funcsynopsis">
+<pre class="funcsynopsisinfo">#include &lt;lwres/netdb.h&gt;</pre>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0">
+<tr>
+<td><code class="funcdef">
+int
+<b class="fsfunc">lwres_getnameinfo</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+</div>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514545"></a><h2>DESCRIPTION</h2>
+<p> This function is equivalent to the <span class="citerefentry"><span class="refentrytitle">getnameinfo</span>(3)</span> function defined in RFC2133.
+<code class="function">lwres_getnameinfo()</code> returns the hostname for the
+<span class="type">struct sockaddr</span> <em class="parameter"><code>sa</code></em> which is
+<em class="parameter"><code>salen</code></em> bytes long. The hostname is of length
+<em class="parameter"><code>hostlen</code></em> and is returned via
+<em class="parameter"><code>*host.</code></em> The maximum length of the hostname is
+1025 bytes: <code class="constant">NI_MAXHOST</code>.</p>
+<p> The name of the service associated with the port number in
+<em class="parameter"><code>sa</code></em> is returned in <em class="parameter"><code>*serv.</code></em>
+It is <em class="parameter"><code>servlen</code></em> bytes long. The maximum length
+of the service name is <code class="constant">NI_MAXSERV</code> - 32 bytes.
+</p>
+<p> The <em class="parameter"><code>flags</code></em> argument sets the following
bits:
-<P
-></P
-><DIV
-CLASS="VARIABLELIST"
-><DL
-><DT
-><CODE
-CLASS="CONSTANT"
->NI_NOFQDN</CODE
-></DT
-><DD
-><P
->A fully qualified domain name is not required for local hosts.
-The local part of the fully qualified domain name is returned instead.</P
-></DD
-><DT
-><CODE
-CLASS="CONSTANT"
->NI_NUMERICHOST</CODE
-></DT
-><DD
-><P
->Return the address in numeric form, as if calling inet_ntop(),
-instead of a host name.</P
-></DD
-><DT
-><CODE
-CLASS="CONSTANT"
->NI_NAMEREQD</CODE
-></DT
-><DD
-><P
->A name is required. If the hostname cannot be found in the DNS and
+</p>
+<div class="variablelist"><dl>
+<dt><span class="term"><code class="constant">NI_NOFQDN</code></span></dt>
+<dd><p>
+A fully qualified domain name is not required for local hosts.
+The local part of the fully qualified domain name is returned instead.
+</p></dd>
+<dt><span class="term"><code class="constant">NI_NUMERICHOST</code></span></dt>
+<dd><p>
+Return the address in numeric form, as if calling inet_ntop(),
+instead of a host name.
+</p></dd>
+<dt><span class="term"><code class="constant">NI_NAMEREQD</code></span></dt>
+<dd><p>
+A name is required. If the hostname cannot be found in the DNS and
this flag is set, a non-zero error code is returned.
If the hostname is not found and the flag is not set, the
-address is returned in numeric form.</P
-></DD
-><DT
-><CODE
-CLASS="CONSTANT"
->NI_NUMERICSERV</CODE
-></DT
-><DD
-><P
->The service name is returned as a digit string representing the port number.</P
-></DD
-><DT
-><CODE
-CLASS="CONSTANT"
->NI_DGRAM</CODE
-></DT
-><DD
-><P
->Specifies that the service being looked up is a datagram
+address is returned in numeric form.
+</p></dd>
+<dt><span class="term"><code class="constant">NI_NUMERICSERV</code></span></dt>
+<dd><p>
+The service name is returned as a digit string representing the port number.
+</p></dd>
+<dt><span class="term"><code class="constant">NI_DGRAM</code></span></dt>
+<dd><p>
+Specifies that the service being looked up is a datagram
service, and causes getservbyport() to be called with a second
argument of "udp" instead of its default of "tcp". This is required
for the few ports (512-514) that have different services for UDP and
-TCP.</P
-></DD
-></DL
-></DIV
-></P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN70"
-></A
-><H2
->RETURN VALUES</H2
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_getnameinfo()</CODE
->
-returns 0 on success or a non-zero error code if an error occurs.</P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN74"
-></A
-><H2
->SEE ALSO</H2
-><P
-><SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->RFC2133</SPAN
-></SPAN
->,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->getservbyport</SPAN
->(3)</SPAN
->,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->lwres</SPAN
->(3)</SPAN
->,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->lwres_getnameinfo</SPAN
->(3)</SPAN
->,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->lwres_getnamebyaddr</SPAN
->(3)</SPAN
->.
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->lwres_net_ntop</SPAN
->(3)</SPAN
->.</P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN94"
-></A
-><H2
->BUGS</H2
-><P
->RFC2133 fails to define what the nonzero return values of
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->getnameinfo</SPAN
->(3)</SPAN
->
-are.</P
-></DIV
-></BODY
-></HTML
->
+TCP.
+</p></dd>
+</dl></div>
+<p>
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514807"></a><h2>RETURN VALUES</h2>
+<p>
+<code class="function">lwres_getnameinfo()</code>
+returns 0 on success or a non-zero error code if an error occurs.
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514820"></a><h2>SEE ALSO</h2>
+<p>
+<span class="citerefentry"><span class="refentrytitle">RFC2133</span></span>,
+<span class="citerefentry"><span class="refentrytitle">getservbyport</span>(3)</span>,
+<span class="citerefentry"><span class="refentrytitle">lwres</span>(3)</span>,
+<span class="citerefentry"><span class="refentrytitle">lwres_getnameinfo</span>(3)</span>,
+<span class="citerefentry"><span class="refentrytitle">lwres_getnamebyaddr</span>(3)</span>.
+<span class="citerefentry"><span class="refentrytitle">lwres_net_ntop</span>(3)</span>.
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514878"></a><h2>BUGS</h2>
+<p>
+RFC2133 fails to define what the nonzero return values of
+<span class="citerefentry"><span class="refentrytitle">getnameinfo</span>(3)</span>
+are.
+</p>
+</div>
+</div></body>
+</html>
diff --git a/lib/lwres/man/lwres_getrrsetbyname.3 b/lib/lwres/man/lwres_getrrsetbyname.3
index 1558f6d5..256061b8 100644
--- a/lib/lwres/man/lwres_getrrsetbyname.3
+++ b/lib/lwres/man/lwres_getrrsetbyname.3
@@ -1,47 +1,61 @@
-.\" Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
-.\" Copyright (C) 2000, 2001 Internet Software Consortium.
-.\"
+.\" Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+.\" Copyright (C) 2000, 2001 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,
+.\" 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: lwres_getrrsetbyname.3,v 1.11.2.1.8.1 2004/03/06 07:41:43 marka Exp $
+.\" $Id: lwres_getrrsetbyname.3,v 1.11.2.1.8.4 2005/09/12 00:47:28 marka Exp $
.\"
-.TH "LWRES_GETRRSETBYNAME" "3" "Oct 18, 2000" "BIND9" ""
+.hy 0
+.ad l
+.\"Generated by db2man.xsl. Don't modify this, modify the source.
+.de Sh \" Subsection
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Ip \" List item
+.br
+.ie \\n(.$>=3 .ne \\$3
+.el .ne 3
+.IP "\\$1" \\$2
+..
+.TH "LWRES_GETRRSETBYNA" 3 "Oct 18, 2000" "" ""
.SH NAME
lwres_getrrsetbyname, lwres_freerrset \- retrieve DNS records
-.SH SYNOPSIS
-\fB#include <lwres/netdb.h>
-.sp
-.na
-int
-lwres_getrrsetbyname(const char *hostname, unsigned int rdclass, unsigned int rdtype, unsigned int flags, struct rrsetinfo **res);
-.ad
-.sp
-.na
-void
-lwres_freerrset(struct rrsetinfo *rrset);
-.ad
-\fR
+.SH "SYNOPSIS"
+.nf
+#include <lwres/netdb\&.h>
+.fi
+.HP 26
+int\ \fBlwres_getrrsetbyname\fR\ (const\ char\ *hostname, unsigned\ int\ rdclass, unsigned\ int\ rdtype, unsigned\ int\ flags, struct\ rrsetinfo\ **res);
+.HP 22
+void\ \fBlwres_freerrset\fR\ (struct\ rrsetinfo\ *rrset);
.PP
-The following structures are used:
-.sp
+The following structures are used:
.nf
struct rdatainfo {
unsigned int rdi_length; /* length of data */
unsigned char *rdi_data; /* record data */
};
-
struct rrsetinfo {
- unsigned int rri_flags; /* RRSET_VALIDATED... */
+ unsigned int rri_flags; /* RRSET_VALIDATED\&.\&.\&. */
unsigned int rri_rdclass; /* class number */
unsigned int rri_rdtype; /* RR type number */
unsigned int rri_ttl; /* time to live */
@@ -51,77 +65,18 @@ struct rrsetinfo {
struct rdatainfo *rri_rdatas; /* individual records */
struct rdatainfo *rri_sigs; /* individual signatures */
};
-.sp
.fi
.SH "DESCRIPTION"
.PP
-\fBlwres_getrrsetbyname()\fR
-gets a set of resource records associated with a
-\fIhostname\fR,
-\fIclass\fR,
-and
-\fItype\fR.
-\fIhostname\fR
-is
-a pointer a to null-terminated string. The
-\fIflags\fR
-field is currently unused and must be zero.
+ \fBlwres_getrrsetbyname()\fR gets a set of resource records associated with a \fIhostname\fR, \fIclass\fR, and \fItype\fR\&. \fIhostname\fR is a pointer a to null\-terminated string\&. The \fIflags\fR field is currently unused and must be zero\&.
.PP
-After a successful call to
-\fBlwres_getrrsetbyname()\fR,
-\fI*res\fR
-is a pointer to an
-\fBrrsetinfo\fR
-structure, containing a list of one or more
-\fBrdatainfo\fR
-structures containing resource records and potentially another list of
-\fBrdatainfo\fR
-structures containing SIG resource records
-associated with those records.
-The members
-rri_rdclass
-and
-rri_rdtype
-are copied from the parameters.
-rri_ttl
-and
-rri_name
-are properties of the obtained rrset.
-The resource records contained in
-rri_rdatas
-and
-rri_sigs
-are in uncompressed DNS wire format.
-Properties of the rdataset are represented in the
-rri_flags
-bitfield. If the RRSET_VALIDATED bit is set, the data has been DNSSEC
-validated and the signatures verified.
+After a successful call to \fBlwres_getrrsetbyname()\fR, \fI*res\fR is a pointer to an \fBrrsetinfo\fR structure, containing a list of one or more \fBrdatainfo\fR structures containing resource records and potentially another list of \fBrdatainfo\fR structures containing SIG resource records associated with those records\&. The members \fBrri_rdclass\fR and \fBrri_rdtype\fR are copied from the parameters\&. \fBrri_ttl\fR and \fBrri_name\fR are properties of the obtained rrset\&. The resource records contained in \fBrri_rdatas\fR and \fBrri_sigs\fR are in uncompressed DNS wire format\&. Properties of the rdataset are represented in the \fBrri_flags\fR bitfield\&. If the RRSET_VALIDATED bit is set, the data has been DNSSEC validated and the signatures verified\&.
.PP
-All of the information returned by
-\fBlwres_getrrsetbyname()\fR
-is dynamically allocated: the
-rrsetinfo
-and
-rdatainfo
-structures,
-and the canonical host name strings pointed to by the
-rrsetinfostructure.
-Memory allocated for the dynamically allocated structures created by
-a successful call to
-\fBlwres_getrrsetbyname()\fR
-is released by
-\fBlwres_freerrset()\fR.
-\fIrrset\fR
-is a pointer to a
-\fBstruct rrset\fR
-created by a call to
-\fBlwres_getrrsetbyname()\fR.
+All of the information returned by \fBlwres_getrrsetbyname()\fR is dynamically allocated: the \fBrrsetinfo\fR and \fBrdatainfo\fR structures, and the canonical host name strings pointed to by the \fBrrsetinfo\fRstructure\&. Memory allocated for the dynamically allocated structures created by a successful call to \fBlwres_getrrsetbyname()\fR is released by \fBlwres_freerrset()\fR\&. \fIrrset\fR is a pointer to a \fBstruct rrset\fR created by a call to \fBlwres_getrrsetbyname()\fR\&.
.PP
.SH "RETURN VALUES"
.PP
-\fBlwres_getrrsetbyname()\fR
-returns zero on success, and one of the following error
-codes if an error occurred:
+ \fBlwres_getrrsetbyname()\fR returns zero on success, and one of the following error codes if an error occurred:
.TP
\fBERRSET_NONAME\fR
the name does not exist
@@ -141,4 +96,4 @@ other failure
\fB\fR
.SH "SEE ALSO"
.PP
-\fBlwres\fR(3).
+ \fBlwres\fR(3)\&.
diff --git a/lib/lwres/man/lwres_getrrsetbyname.docbook b/lib/lwres/man/lwres_getrrsetbyname.docbook
index 5ec7884b..53c33bef 100644
--- a/lib/lwres/man/lwres_getrrsetbyname.docbook
+++ b/lib/lwres/man/lwres_getrrsetbyname.docbook
@@ -1,7 +1,9 @@
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.0//EN"
+ "http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd"
+ [<!ENTITY mdash "&#8212;">]>
<!--
- - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- - Copyright (C) 2001 Internet Software Consortium.
+ - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2000, 2001 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
@@ -16,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: lwres_getrrsetbyname.docbook,v 1.3.206.1 2004/03/06 08:15:40 marka Exp $ -->
+<!-- $Id: lwres_getrrsetbyname.docbook,v 1.3.206.3 2005/05/12 21:36:15 sra Exp $ -->
<refentry>
<refentryinfo>
@@ -29,6 +31,20 @@
<manvolnum>3</manvolnum>
<refmiscinfo>BIND9</refmiscinfo>
</refmeta>
+
+ <docinfo>
+ <copyright>
+ <year>2004</year>
+ <year>2005</year>
+ <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
+ </copyright>
+ <copyright>
+ <year>2000</year>
+ <year>2001</year>
+ <holder>Internet Software Consortium.</holder>
+ </copyright>
+ </docinfo>
+
<refnamediv>
<refname>lwres_getrrsetbyname</refname>
<refname>lwres_freerrset</refname>
diff --git a/lib/lwres/man/lwres_getrrsetbyname.html b/lib/lwres/man/lwres_getrrsetbyname.html
index 8a688e9b..980e40ae 100644
--- a/lib/lwres/man/lwres_getrrsetbyname.html
+++ b/lib/lwres/man/lwres_getrrsetbyname.html
@@ -1,91 +1,80 @@
<!--
- - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- - Copyright (C) 2001 Internet Software Consortium.
- -
+ - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2000, 2001 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,
+ - 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: lwres_getrrsetbyname.html,v 1.5.2.1.4.2 2004/08/22 23:39:04 marka Exp $ -->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<HTML
-><HEAD
-><TITLE
->lwres_getrrsetbyname</TITLE
-><META
-NAME="GENERATOR"
-CONTENT="Modular DocBook HTML Stylesheet Version 1.7"></HEAD
-><BODY
-CLASS="REFENTRY"
-BGCOLOR="#FFFFFF"
-TEXT="#000000"
-LINK="#0000FF"
-VLINK="#840084"
-ALINK="#0000FF"
-><H1
-><A
-NAME="AEN1"
-></A
->lwres_getrrsetbyname</H1
-><DIV
-CLASS="REFNAMEDIV"
-><A
-NAME="AEN8"
-></A
-><H2
->Name</H2
->lwres_getrrsetbyname, lwres_freerrset&nbsp;--&nbsp;retrieve DNS records</DIV
-><DIV
-CLASS="REFSYNOPSISDIV"
-><A
-NAME="AEN12"
-></A
-><H2
->Synopsis</H2
-><DIV
-CLASS="FUNCSYNOPSIS"
-><P
-></P
-><A
-NAME="AEN13"
-></A
-><PRE
-CLASS="FUNCSYNOPSISINFO"
->#include &lt;lwres/netdb.h&gt;</PRE
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->int
-lwres_getrrsetbyname</CODE
->(const char *hostname, unsigned int rdclass, unsigned int rdtype, unsigned int flags, struct rrsetinfo **res);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->void
-lwres_freerrset</CODE
->(struct rrsetinfo *rrset);</CODE
-></P
-><P
-></P
-></DIV
-><P
->The following structures are used:
-<PRE
-CLASS="PROGRAMLISTING"
->struct rdatainfo {
+<!-- $Id: lwres_getrrsetbyname.html,v 1.5.2.1.4.7 2005/07/18 02:36:53 marka Exp $ -->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>lwres_getrrsetbyname</title>
+<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
+<a name="id2456972"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2>Name</h2>
+<p>lwres_getrrsetbyname, lwres_freerrset &#8212; retrieve DNS records</p>
+</div>
+<div class="refsynopsisdiv">
+<h2>Synopsis</h2>
+<div class="funcsynopsis">
+<pre class="funcsynopsisinfo">#include &lt;lwres/netdb.h&gt;</pre>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+int
+<b class="fsfunc">lwres_getrrsetbyname</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr>
+<td><code class="funcdef">
+void
+<b class="fsfunc">lwres_freerrset</b>(</code></td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr></table>
+</div>
+<p>
+The following structures are used:
+</p>
+<pre class="programlisting">
+struct rdatainfo {
unsigned int rdi_length; /* length of data */
unsigned char *rdi_data; /* record data */
};
@@ -100,261 +89,129 @@ struct rrsetinfo {
char *rri_name; /* canonical name */
struct rdatainfo *rri_rdatas; /* individual records */
struct rdatainfo *rri_sigs; /* individual signatures */
-};</PRE
-></P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN29"
-></A
-><H2
->DESCRIPTION</H2
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_getrrsetbyname()</CODE
->
+};
+</pre>
+<p>
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514561"></a><h2>DESCRIPTION</h2>
+<p>
+<code class="function">lwres_getrrsetbyname()</code>
gets a set of resource records associated with a
-<VAR
-CLASS="PARAMETER"
->hostname</VAR
->,
+<em class="parameter"><code>hostname</code></em>,
-<VAR
-CLASS="PARAMETER"
->class</VAR
->,
+<em class="parameter"><code>class</code></em>,
and
-<VAR
-CLASS="PARAMETER"
->type</VAR
->.
+<em class="parameter"><code>type</code></em>.
-<VAR
-CLASS="PARAMETER"
->hostname</VAR
->
+<em class="parameter"><code>hostname</code></em>
is
a pointer a to null-terminated string. The
-<VAR
-CLASS="PARAMETER"
->flags</VAR
->
-field is currently unused and must be zero.</P
-><P
->After a successful call to
-<CODE
-CLASS="FUNCTION"
->lwres_getrrsetbyname()</CODE
->,
+<em class="parameter"><code>flags</code></em>
+field is currently unused and must be zero.
+</p>
+<p>
+After a successful call to
+<code class="function">lwres_getrrsetbyname()</code>,
-<VAR
-CLASS="PARAMETER"
->*res</VAR
->
+<em class="parameter"><code>*res</code></em>
is a pointer to an
-<SPAN
-CLASS="TYPE"
->rrsetinfo</SPAN
->
+<span class="type">rrsetinfo</span>
structure, containing a list of one or more
-<SPAN
-CLASS="TYPE"
->rdatainfo</SPAN
->
+<span class="type">rdatainfo</span>
structures containing resource records and potentially another list of
-<SPAN
-CLASS="TYPE"
->rdatainfo</SPAN
->
+<span class="type">rdatainfo</span>
structures containing SIG resource records
associated with those records.
The members
-<CODE
-CLASS="CONSTANT"
->rri_rdclass</CODE
->
+<code class="constant">rri_rdclass</code>
and
-<CODE
-CLASS="CONSTANT"
->rri_rdtype</CODE
->
+<code class="constant">rri_rdtype</code>
are copied from the parameters.
-<CODE
-CLASS="CONSTANT"
->rri_ttl</CODE
->
+<code class="constant">rri_ttl</code>
and
-<CODE
-CLASS="CONSTANT"
->rri_name</CODE
->
+<code class="constant">rri_name</code>
are properties of the obtained rrset.
The resource records contained in
-<CODE
-CLASS="CONSTANT"
->rri_rdatas</CODE
->
+<code class="constant">rri_rdatas</code>
and
-<CODE
-CLASS="CONSTANT"
->rri_sigs</CODE
->
+<code class="constant">rri_sigs</code>
are in uncompressed DNS wire format.
Properties of the rdataset are represented in the
-<CODE
-CLASS="CONSTANT"
->rri_flags</CODE
->
+<code class="constant">rri_flags</code>
bitfield. If the RRSET_VALIDATED bit is set, the data has been DNSSEC
-validated and the signatures verified. </P
-><P
->All of the information returned by
-<CODE
-CLASS="FUNCTION"
->lwres_getrrsetbyname()</CODE
->
+validated and the signatures verified.
+</p>
+<p>
+All of the information returned by
+<code class="function">lwres_getrrsetbyname()</code>
is dynamically allocated: the
-<CODE
-CLASS="CONSTANT"
->rrsetinfo</CODE
->
+<code class="constant">rrsetinfo</code>
and
-<CODE
-CLASS="CONSTANT"
->rdatainfo</CODE
->
+<code class="constant">rdatainfo</code>
structures,
and the canonical host name strings pointed to by the
-<CODE
-CLASS="CONSTANT"
->rrsetinfo</CODE
->structure.
+<code class="constant">rrsetinfo</code>structure.
Memory allocated for the dynamically allocated structures created by
a successful call to
-<CODE
-CLASS="FUNCTION"
->lwres_getrrsetbyname()</CODE
->
+<code class="function">lwres_getrrsetbyname()</code>
is released by
-<CODE
-CLASS="FUNCTION"
->lwres_freerrset()</CODE
->.
+<code class="function">lwres_freerrset()</code>.
-<VAR
-CLASS="PARAMETER"
->rrset</VAR
->
+<em class="parameter"><code>rrset</code></em>
is a pointer to a
-<SPAN
-CLASS="TYPE"
->struct rrset</SPAN
->
+<span class="type">struct rrset</span>
created by a call to
-<CODE
-CLASS="FUNCTION"
->lwres_getrrsetbyname()</CODE
->.&#13;</P
-><P
-></P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN62"
-></A
-><H2
->RETURN VALUES</H2
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_getrrsetbyname()</CODE
->
+<code class="function">lwres_getrrsetbyname()</code>.
+
+</p>
+<p>
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514877"></a><h2>RETURN VALUES</h2>
+<p>
+<code class="function">lwres_getrrsetbyname()</code>
returns zero on success, and one of the following error
codes if an error occurred:
-<P
-></P
-><DIV
-CLASS="VARIABLELIST"
-><DL
-><DT
-><CODE
-CLASS="CONSTANT"
->ERRSET_NONAME</CODE
-></DT
-><DD
-><P
->the name does not exist</P
-></DD
-><DT
-><CODE
-CLASS="CONSTANT"
->ERRSET_NODATA</CODE
-></DT
-><DD
-><P
->the name exists, but does not have data of the desired type</P
-></DD
-><DT
-><CODE
-CLASS="CONSTANT"
->ERRSET_NOMEMORY</CODE
-></DT
-><DD
-><P
->memory could not be allocated</P
-></DD
-><DT
-><CODE
-CLASS="CONSTANT"
->ERRSET_INVAL</CODE
-></DT
-><DD
-><P
->a parameter is invalid</P
-></DD
-><DT
-><CODE
-CLASS="CONSTANT"
->ERRSET_FAIL</CODE
-></DT
-><DD
-><P
->other failure</P
-></DD
-><DT
-><CODE
-CLASS="CONSTANT"
-></CODE
-></DT
-><DD
-><P
-></P
-></DD
-></DL
-></DIV
->&#13;</P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN97"
-></A
-><H2
->SEE ALSO</H2
-><P
-><SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->lwres</SPAN
->(3)</SPAN
->.</P
-></DIV
-></BODY
-></HTML
->
+</p>
+<div class="variablelist"><dl>
+<dt><span class="term"><code class="constant">ERRSET_NONAME</code></span></dt>
+<dd><p>
+the name does not exist
+</p></dd>
+<dt><span class="term"><code class="constant">ERRSET_NODATA</code></span></dt>
+<dd><p>
+the name exists, but does not have data of the desired type
+</p></dd>
+<dt><span class="term"><code class="constant">ERRSET_NOMEMORY</code></span></dt>
+<dd><p>
+memory could not be allocated
+</p></dd>
+<dt><span class="term"><code class="constant">ERRSET_INVAL</code></span></dt>
+<dd><p>
+a parameter is invalid
+</p></dd>
+<dt><span class="term"><code class="constant">ERRSET_FAIL</code></span></dt>
+<dd><p>
+other failure
+</p></dd>
+<dt><span class="term"><code class="constant"></code></span></dt>
+<dd><p>
+</p></dd>
+</dl></div>
+<p>
+
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514951"></a><h2>SEE ALSO</h2>
+<p>
+<span class="citerefentry"><span class="refentrytitle">lwres</span>(3)</span>.
+</p>
+</div>
+</div></body>
+</html>
diff --git a/lib/lwres/man/lwres_gnba.3 b/lib/lwres/man/lwres_gnba.3
index 404ae414..b3158d68 100644
--- a/lib/lwres/man/lwres_gnba.3
+++ b/lib/lwres/man/lwres_gnba.3
@@ -1,86 +1,73 @@
-.\" Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
-.\" Copyright (C) 2000, 2001 Internet Software Consortium.
-.\"
+.\" Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+.\" Copyright (C) 2000, 2001 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,
+.\" 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: lwres_gnba.3,v 1.13.2.1.8.1 2004/03/06 07:41:43 marka Exp $
+.\" $Id: lwres_gnba.3,v 1.13.2.1.8.4 2005/09/12 00:47:28 marka Exp $
.\"
-.TH "LWRES_GNBA" "3" "Jun 30, 2000" "BIND9" ""
+.hy 0
+.ad l
+.\"Generated by db2man.xsl. Don't modify this, modify the source.
+.de Sh \" Subsection
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Ip \" List item
+.br
+.ie \\n(.$>=3 .ne \\$3
+.el .ne 3
+.IP "\\$1" \\$2
+..
+.TH "LWRES_GNBA" 3 "Jun 30, 2000" "" ""
.SH NAME
lwres_gnbarequest_render, lwres_gnbaresponse_render, lwres_gnbarequest_parse, lwres_gnbaresponse_parse, lwres_gnbaresponse_free, lwres_gnbarequest_free \- lightweight resolver getnamebyaddress message handling
-.SH SYNOPSIS
-\fB#include <lwres/lwres.h>
-.sp
-.na
-lwres_result_t
-lwres_gnbarequest_render(lwres_context_t *\fIctx\fB, lwres_gnbarequest_t *\fIreq\fB, lwres_lwpacket_t *\fIpkt\fB, lwres_buffer_t *\fIb\fB);
-.ad
-.sp
-.na
-lwres_result_t
-lwres_gnbaresponse_render(lwres_context_t *ctx, lwres_gnbaresponse_t *req, lwres_lwpacket_t *pkt, lwres_buffer_t *b);
-.ad
-.sp
-.na
-lwres_result_t
-lwres_gnbarequest_parse(lwres_context_t *ctx, lwres_buffer_t *b, lwres_lwpacket_t *pkt, lwres_gnbarequest_t **structp);
-.ad
-.sp
-.na
-lwres_result_t
-lwres_gnbaresponse_parse(lwres_context_t *ctx, lwres_buffer_t *b, lwres_lwpacket_t *pkt, lwres_gnbaresponse_t **structp);
-.ad
-.sp
-.na
-void
-lwres_gnbaresponse_free(lwres_context_t *ctx, lwres_gnbaresponse_t **structp);
-.ad
-.sp
-.na
-void
-lwres_gnbarequest_free(lwres_context_t *ctx, lwres_gnbarequest_t **structp);
-.ad
-\fR
+.SH "SYNOPSIS"
+.nf
+#include <lwres/lwres\&.h>
+.fi
+.HP 41
+lwres_result_t\ \fBlwres_gnbarequest_render\fR\ (lwres_context_t\ *\fIctx\fR, lwres_gnbarequest_t\ *\fIreq\fR, lwres_lwpacket_t\ *\fIpkt\fR, lwres_buffer_t\ *\fIb\fR);
+.HP 42
+lwres_result_t\ \fBlwres_gnbaresponse_render\fR\ (lwres_context_t\ *ctx, lwres_gnbaresponse_t\ *req, lwres_lwpacket_t\ *pkt, lwres_buffer_t\ *b);
+.HP 40
+lwres_result_t\ \fBlwres_gnbarequest_parse\fR\ (lwres_context_t\ *ctx, lwres_buffer_t\ *b, lwres_lwpacket_t\ *pkt, lwres_gnbarequest_t\ **structp);
+.HP 41
+lwres_result_t\ \fBlwres_gnbaresponse_parse\fR\ (lwres_context_t\ *ctx, lwres_buffer_t\ *b, lwres_lwpacket_t\ *pkt, lwres_gnbaresponse_t\ **structp);
+.HP 30
+void\ \fBlwres_gnbaresponse_free\fR\ (lwres_context_t\ *ctx, lwres_gnbaresponse_t\ **structp);
+.HP 29
+void\ \fBlwres_gnbarequest_free\fR\ (lwres_context_t\ *ctx, lwres_gnbarequest_t\ **structp);
.SH "DESCRIPTION"
.PP
-These are low-level routines for creating and parsing
-lightweight resolver address-to-name lookup request and
-response messages.
+These are low\-level routines for creating and parsing lightweight resolver address\-to\-name lookup request and response messages\&.
.PP
-There are four main functions for the getnamebyaddr opcode.
-One render function converts a getnamebyaddr request structure \(em
-\fBlwres_gnbarequest_t\fR \(em
-to the lightweight resolver's canonical format.
-It is complemented by a parse function that converts a packet in this
-canonical format to a getnamebyaddr request structure.
-Another render function converts the getnamebyaddr response structure \(em
-\fBlwres_gnbaresponse_t\fR
-to the canonical format.
-This is complemented by a parse function which converts a packet in
-canonical format to a getnamebyaddr response structure.
+There are four main functions for the getnamebyaddr opcode\&. One render function converts a getnamebyaddr request structure -- \fBlwres_gnbarequest_t\fR -- to the lightweight resolver's canonical format\&. It is complemented by a parse function that converts a packet in this canonical format to a getnamebyaddr request structure\&. Another render function converts the getnamebyaddr response structure -- \fBlwres_gnbaresponse_t\fR to the canonical format\&. This is complemented by a parse function which converts a packet in canonical format to a getnamebyaddr response structure\&.
.PP
-These structures are defined in
-\fIlwres/lwres.h\fR.
-They are shown below.
-.sp
+These structures are defined in \fIlwres/lwres\&.h\fR\&. They are shown below\&.
.nf
#define LWRES_OPCODE_GETNAMEBYADDR 0x00010002U
-
typedef struct {
lwres_uint32_t flags;
lwres_addr_t addr;
} lwres_gnbarequest_t;
-
typedef struct {
lwres_uint32_t flags;
lwres_uint16_t naliases;
@@ -91,98 +78,16 @@ typedef struct {
void *base;
size_t baselen;
} lwres_gnbaresponse_t;
-.sp
.fi
.PP
-\fBlwres_gnbarequest_render()\fR
-uses resolver context
-ctx
-to convert getnamebyaddr request structure
-req
-to canonical format.
-The packet header structure
-pkt
-is initialised and transferred to
-buffer
-b.
-The contents of
-*req
-are then appended to the buffer in canonical format.
-\fBlwres_gnbaresponse_render()\fR
-performs the same task, except it converts a getnamebyaddr response structure
-\fBlwres_gnbaresponse_t\fR
-to the lightweight resolver's canonical format.
+ \fBlwres_gnbarequest_render()\fR uses resolver context \fIctx\fR to convert getnamebyaddr request structure \fIreq\fR to canonical format\&. The packet header structure \fIpkt\fR is initialised and transferred to buffer \fIb\fR\&. The contents of \fI*req\fR are then appended to the buffer in canonical format\&. \fBlwres_gnbaresponse_render()\fR performs the same task, except it converts a getnamebyaddr response structure \fBlwres_gnbaresponse_t\fR to the lightweight resolver's canonical format\&.
.PP
-\fBlwres_gnbarequest_parse()\fR
-uses context
-ctx
-to convert the contents of packet
-pkt
-to a
-\fBlwres_gnbarequest_t\fR
-structure.
-Buffer
-b
-provides space to be used for storing this structure.
-When the function succeeds, the resulting
-\fBlwres_gnbarequest_t\fR
-is made available through
-*structp.
-\fBlwres_gnbaresponse_parse()\fR
-offers the same semantics as
-\fBlwres_gnbarequest_parse()\fR
-except it yields a
-\fBlwres_gnbaresponse_t\fR
-structure.
+ \fBlwres_gnbarequest_parse()\fR uses context \fIctx\fR to convert the contents of packet \fIpkt\fR to a \fBlwres_gnbarequest_t\fR structure\&. Buffer \fIb\fR provides space to be used for storing this structure\&. When the function succeeds, the resulting \fBlwres_gnbarequest_t\fR is made available through \fI*structp\fR\&. \fBlwres_gnbaresponse_parse()\fR offers the same semantics as \fBlwres_gnbarequest_parse()\fR except it yields a \fBlwres_gnbaresponse_t\fR structure\&.
.PP
-\fBlwres_gnbaresponse_free()\fR
-and
-\fBlwres_gnbarequest_free()\fR
-release the memory in resolver context
-ctx
-that was allocated to the
-\fBlwres_gnbaresponse_t\fR
-or
-\fBlwres_gnbarequest_t\fR
-structures referenced via
-structp.
-Any memory associated with ancillary buffers and strings for those
-structures is also discarded.
+ \fBlwres_gnbaresponse_free()\fR and \fBlwres_gnbarequest_free()\fR release the memory in resolver context \fIctx\fR that was allocated to the \fBlwres_gnbaresponse_t\fR or \fBlwres_gnbarequest_t\fR structures referenced via \fIstructp\fR\&. Any memory associated with ancillary buffers and strings for those structures is also discarded\&.
.SH "RETURN VALUES"
.PP
-The getnamebyaddr opcode functions
-\fBlwres_gnbarequest_render()\fR,
-\fBlwres_gnbaresponse_render()\fR
-\fBlwres_gnbarequest_parse()\fR
-and
-\fBlwres_gnbaresponse_parse()\fR
-all return
-LWRES_R_SUCCESS
-on success.
-They return
-LWRES_R_NOMEMORY
-if memory allocation fails.
-LWRES_R_UNEXPECTEDEND
-is returned if the available space in the buffer
-b
-is too small to accommodate the packet header or the
-\fBlwres_gnbarequest_t\fR
-and
-\fBlwres_gnbaresponse_t\fR
-structures.
-\fBlwres_gnbarequest_parse()\fR
-and
-\fBlwres_gnbaresponse_parse()\fR
-will return
-LWRES_R_UNEXPECTEDEND
-if the buffer is not empty after decoding the received packet.
-These functions will return
-LWRES_R_FAILURE
-if
-\fBpktflags\fR
-in the packet header structure
-\fBlwres_lwpacket_t\fR
-indicate that the packet is not a response to an earlier query.
+The getnamebyaddr opcode functions \fBlwres_gnbarequest_render()\fR, \fBlwres_gnbaresponse_render()\fR \fBlwres_gnbarequest_parse()\fR and \fBlwres_gnbaresponse_parse()\fR all return \fBLWRES_R_SUCCESS\fR on success\&. They return \fBLWRES_R_NOMEMORY\fR if memory allocation fails\&. \fBLWRES_R_UNEXPECTEDEND\fR is returned if the available space in the buffer \fIb\fR is too small to accommodate the packet header or the \fBlwres_gnbarequest_t\fR and \fBlwres_gnbaresponse_t\fR structures\&. \fBlwres_gnbarequest_parse()\fR and \fBlwres_gnbaresponse_parse()\fR will return \fBLWRES_R_UNEXPECTEDEND\fR if the buffer is not empty after decoding the received packet\&. These functions will return \fBLWRES_R_FAILURE\fR if pktflags in the packet header structure \fBlwres_lwpacket_t\fR indicate that the packet is not a response to an earlier query\&.
.SH "SEE ALSO"
.PP
-\fBlwres_packet\fR(3).
+ \fBlwres_packet\fR(3)\&.
diff --git a/lib/lwres/man/lwres_gnba.docbook b/lib/lwres/man/lwres_gnba.docbook
index 5bd41724..75314864 100644
--- a/lib/lwres/man/lwres_gnba.docbook
+++ b/lib/lwres/man/lwres_gnba.docbook
@@ -1,7 +1,9 @@
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.0//EN"
+ "http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd"
+ [<!ENTITY mdash "&#8212;">]>
<!--
- - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- - Copyright (C) 2001 Internet Software Consortium.
+ - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2000, 2001 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
@@ -16,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: lwres_gnba.docbook,v 1.4.206.1 2004/03/06 08:15:40 marka Exp $ -->
+<!-- $Id: lwres_gnba.docbook,v 1.4.206.3 2005/05/12 21:36:15 sra Exp $ -->
<refentry>
@@ -30,6 +32,19 @@
<refmiscinfo>BIND9</refmiscinfo>
</refmeta>
+ <docinfo>
+ <copyright>
+ <year>2004</year>
+ <year>2005</year>
+ <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
+ </copyright>
+ <copyright>
+ <year>2000</year>
+ <year>2001</year>
+ <holder>Internet Software Consortium.</holder>
+ </copyright>
+ </docinfo>
+
<refnamediv>
<refname>lwres_gnbarequest_render</refname>
<refname>lwres_gnbaresponse_render</refname>
diff --git a/lib/lwres/man/lwres_gnba.html b/lib/lwres/man/lwres_gnba.html
index 537b2593..19ac7d3a 100644
--- a/lib/lwres/man/lwres_gnba.html
+++ b/lib/lwres/man/lwres_gnba.html
@@ -1,158 +1,203 @@
<!--
- - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- - Copyright (C) 2001 Internet Software Consortium.
- -
+ - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2000, 2001 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,
+ - 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: lwres_gnba.html,v 1.6.2.1.4.2 2004/08/22 23:39:04 marka Exp $ -->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<HTML
-><HEAD
-><TITLE
->lwres_gnba</TITLE
-><META
-NAME="GENERATOR"
-CONTENT="Modular DocBook HTML Stylesheet Version 1.7"></HEAD
-><BODY
-CLASS="REFENTRY"
-BGCOLOR="#FFFFFF"
-TEXT="#000000"
-LINK="#0000FF"
-VLINK="#840084"
-ALINK="#0000FF"
-><H1
-><A
-NAME="AEN1"
-></A
->lwres_gnba</H1
-><DIV
-CLASS="REFNAMEDIV"
-><A
-NAME="AEN8"
-></A
-><H2
->Name</H2
->lwres_gnbarequest_render, lwres_gnbaresponse_render, lwres_gnbarequest_parse, lwres_gnbaresponse_parse, lwres_gnbaresponse_free, lwres_gnbarequest_free&nbsp;--&nbsp;lightweight resolver getnamebyaddress message handling</DIV
-><DIV
-CLASS="REFSYNOPSISDIV"
-><A
-NAME="AEN16"
-></A
-><H2
->Synopsis</H2
-><DIV
-CLASS="FUNCSYNOPSIS"
-><P
-></P
-><A
-NAME="AEN17"
-></A
-><PRE
-CLASS="FUNCSYNOPSISINFO"
->#include &lt;lwres/lwres.h&gt;</PRE
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->lwres_result_t
-lwres_gnbarequest_render</CODE
->(lwres_context_t *ctx, lwres_gnbarequest_t *req, lwres_lwpacket_t *pkt, lwres_buffer_t *b);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->lwres_result_t
-lwres_gnbaresponse_render</CODE
->(lwres_context_t *ctx, lwres_gnbaresponse_t *req, lwres_lwpacket_t *pkt, lwres_buffer_t *b);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->lwres_result_t
-lwres_gnbarequest_parse</CODE
->(lwres_context_t *ctx, lwres_buffer_t *b, lwres_lwpacket_t *pkt, lwres_gnbarequest_t **structp);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->lwres_result_t
-lwres_gnbaresponse_parse</CODE
->(lwres_context_t *ctx, lwres_buffer_t *b, lwres_lwpacket_t *pkt, lwres_gnbaresponse_t **structp);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->void
-lwres_gnbaresponse_free</CODE
->(lwres_context_t *ctx, lwres_gnbaresponse_t **structp);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->void
-lwres_gnbarequest_free</CODE
->(lwres_context_t *ctx, lwres_gnbarequest_t **structp);</CODE
-></P
-><P
-></P
-></DIV
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN61"
-></A
-><H2
->DESCRIPTION</H2
-><P
->These are low-level routines for creating and parsing
+<!-- $Id: lwres_gnba.html,v 1.6.2.1.4.7 2005/07/18 02:36:53 marka Exp $ -->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>lwres_gnba</title>
+<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
+<a name="id2456972"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2>Name</h2>
+<p>lwres_gnbarequest_render, lwres_gnbaresponse_render, lwres_gnbarequest_parse, lwres_gnbaresponse_parse, lwres_gnbaresponse_free, lwres_gnbarequest_free &#8212; lightweight resolver getnamebyaddress message handling</p>
+</div>
+<div class="refsynopsisdiv">
+<h2>Synopsis</h2>
+<div class="funcsynopsis">
+<pre class="funcsynopsisinfo">
+#include &lt;lwres/lwres.h&gt;
+</pre>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+lwres_result_t
+<b class="fsfunc">lwres_gnbarequest_render</b>
+(</code></td>
+<td>lwres_context_t * </td>
+<td>
+<var class="pdparam">ctx</var>, </td>
+</tr>
+<tr>
+<td> </td>
+<td>lwres_gnbarequest_t * </td>
+<td>
+<var class="pdparam">req</var>, </td>
+</tr>
+<tr>
+<td> </td>
+<td>lwres_lwpacket_t * </td>
+<td>
+<var class="pdparam">pkt</var>, </td>
+</tr>
+<tr>
+<td> </td>
+<td>lwres_buffer_t * </td>
+<td>
+<var class="pdparam">b</var><code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+lwres_result_t
+<b class="fsfunc">lwres_gnbaresponse_render</b>
+(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+lwres_result_t
+<b class="fsfunc">lwres_gnbarequest_parse</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+lwres_result_t
+<b class="fsfunc">lwres_gnbaresponse_parse</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+void
+<b class="fsfunc">lwres_gnbaresponse_free</b>
+(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0">
+<tr>
+<td><code class="funcdef">
+void
+<b class="fsfunc">lwres_gnbarequest_free</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+</div>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514658"></a><h2>DESCRIPTION</h2>
+<p>
+These are low-level routines for creating and parsing
lightweight resolver address-to-name lookup request and
-response messages.</P
-><P
->There are four main functions for the getnamebyaddr opcode.
-One render function converts a getnamebyaddr request structure &mdash;
-<SPAN
-CLASS="TYPE"
->lwres_gnbarequest_t</SPAN
-> &mdash;
+response messages.
+</p>
+<p>
+There are four main functions for the getnamebyaddr opcode.
+One render function converts a getnamebyaddr request structure &#8212;
+<span class="type">lwres_gnbarequest_t</span> &#8212;
to the lightweight resolver's canonical format.
It is complemented by a parse function that converts a packet in this
canonical format to a getnamebyaddr request structure.
-Another render function converts the getnamebyaddr response structure &mdash;
-<SPAN
-CLASS="TYPE"
->lwres_gnbaresponse_t</SPAN
->
+Another render function converts the getnamebyaddr response structure &#8212;
+<span class="type">lwres_gnbaresponse_t</span>
to the canonical format.
This is complemented by a parse function which converts a packet in
-canonical format to a getnamebyaddr response structure.</P
-><P
->These structures are defined in
-<TT
-CLASS="FILENAME"
->lwres/lwres.h</TT
->.
+canonical format to a getnamebyaddr response structure.
+</p>
+<p>
+These structures are defined in
+<code class="filename">lwres/lwres.h</code>.
They are shown below.
-<PRE
-CLASS="PROGRAMLISTING"
->#define LWRES_OPCODE_GETNAMEBYADDR 0x00010002U
+</p>
+<pre class="programlisting">
+#define LWRES_OPCODE_GETNAMEBYADDR 0x00010002U
typedef struct {
lwres_uint32_t flags;
@@ -168,242 +213,112 @@ typedef struct {
lwres_uint16_t *aliaslen;
void *base;
size_t baselen;
-} lwres_gnbaresponse_t;</PRE
-></P
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_gnbarequest_render()</CODE
->
+} lwres_gnbaresponse_t;
+</pre>
+<p>
+</p>
+<p>
+<code class="function">lwres_gnbarequest_render()</code>
uses resolver context
-<VAR
-CLASS="VARNAME"
->ctx</VAR
->
+<code class="varname">ctx</code>
to convert getnamebyaddr request structure
-<VAR
-CLASS="VARNAME"
->req</VAR
->
+<code class="varname">req</code>
to canonical format.
The packet header structure
-<VAR
-CLASS="VARNAME"
->pkt</VAR
->
+<code class="varname">pkt</code>
is initialised and transferred to
buffer
-<VAR
-CLASS="VARNAME"
->b</VAR
->.
+<code class="varname">b</code>.
The contents of
-<VAR
-CLASS="VARNAME"
->*req</VAR
->
+<code class="varname">*req</code>
are then appended to the buffer in canonical format.
-<CODE
-CLASS="FUNCTION"
->lwres_gnbaresponse_render()</CODE
->
+<code class="function">lwres_gnbaresponse_render()</code>
performs the same task, except it converts a getnamebyaddr response structure
-<SPAN
-CLASS="TYPE"
->lwres_gnbaresponse_t</SPAN
->
-to the lightweight resolver's canonical format.</P
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_gnbarequest_parse()</CODE
->
+<span class="type">lwres_gnbaresponse_t</span>
+to the lightweight resolver's canonical format.
+</p>
+<p>
+<code class="function">lwres_gnbarequest_parse()</code>
uses context
-<VAR
-CLASS="VARNAME"
->ctx</VAR
->
+<code class="varname">ctx</code>
to convert the contents of packet
-<VAR
-CLASS="VARNAME"
->pkt</VAR
->
+<code class="varname">pkt</code>
to a
-<SPAN
-CLASS="TYPE"
->lwres_gnbarequest_t</SPAN
->
+<span class="type">lwres_gnbarequest_t</span>
structure.
Buffer
-<VAR
-CLASS="VARNAME"
->b</VAR
->
+<code class="varname">b</code>
provides space to be used for storing this structure.
When the function succeeds, the resulting
-<SPAN
-CLASS="TYPE"
->lwres_gnbarequest_t</SPAN
->
+<span class="type">lwres_gnbarequest_t</span>
is made available through
-<VAR
-CLASS="VARNAME"
->*structp</VAR
->.
-<CODE
-CLASS="FUNCTION"
->lwres_gnbaresponse_parse()</CODE
->
+<code class="varname">*structp</code>.
+<code class="function">lwres_gnbaresponse_parse()</code>
offers the same semantics as
-<CODE
-CLASS="FUNCTION"
->lwres_gnbarequest_parse()</CODE
->
+<code class="function">lwres_gnbarequest_parse()</code>
except it yields a
-<SPAN
-CLASS="TYPE"
->lwres_gnbaresponse_t</SPAN
->
-structure.</P
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_gnbaresponse_free()</CODE
->
+<span class="type">lwres_gnbaresponse_t</span>
+structure.
+</p>
+<p>
+<code class="function">lwres_gnbaresponse_free()</code>
and
-<CODE
-CLASS="FUNCTION"
->lwres_gnbarequest_free()</CODE
->
+<code class="function">lwres_gnbarequest_free()</code>
release the memory in resolver context
-<VAR
-CLASS="VARNAME"
->ctx</VAR
->
+<code class="varname">ctx</code>
that was allocated to the
-<SPAN
-CLASS="TYPE"
->lwres_gnbaresponse_t</SPAN
->
+<span class="type">lwres_gnbaresponse_t</span>
or
-<SPAN
-CLASS="TYPE"
->lwres_gnbarequest_t</SPAN
->
+<span class="type">lwres_gnbarequest_t</span>
structures referenced via
-<VAR
-CLASS="VARNAME"
->structp</VAR
->.
+<code class="varname">structp</code>.
Any memory associated with ancillary buffers and strings for those
-structures is also discarded.</P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN97"
-></A
-><H2
->RETURN VALUES</H2
-><P
->The getnamebyaddr opcode functions
-<CODE
-CLASS="FUNCTION"
->lwres_gnbarequest_render()</CODE
->,
-<CODE
-CLASS="FUNCTION"
->lwres_gnbaresponse_render()</CODE
->
-<CODE
-CLASS="FUNCTION"
->lwres_gnbarequest_parse()</CODE
->
+structures is also discarded.
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514782"></a><h2>RETURN VALUES</h2>
+<p>
+The getnamebyaddr opcode functions
+<code class="function">lwres_gnbarequest_render()</code>,
+<code class="function">lwres_gnbaresponse_render()</code>
+<code class="function">lwres_gnbarequest_parse()</code>
and
-<CODE
-CLASS="FUNCTION"
->lwres_gnbaresponse_parse()</CODE
->
+<code class="function">lwres_gnbaresponse_parse()</code>
all return
-<SPAN
-CLASS="ERRORCODE"
->LWRES_R_SUCCESS</SPAN
->
+<span class="errorcode">LWRES_R_SUCCESS</span>
on success.
They return
-<SPAN
-CLASS="ERRORCODE"
->LWRES_R_NOMEMORY</SPAN
->
+<span class="errorcode">LWRES_R_NOMEMORY</span>
if memory allocation fails.
-<SPAN
-CLASS="ERRORCODE"
->LWRES_R_UNEXPECTEDEND</SPAN
->
+<span class="errorcode">LWRES_R_UNEXPECTEDEND</span>
is returned if the available space in the buffer
-<VAR
-CLASS="VARNAME"
->b</VAR
->
+<code class="varname">b</code>
is too small to accommodate the packet header or the
-<SPAN
-CLASS="TYPE"
->lwres_gnbarequest_t</SPAN
->
+<span class="type">lwres_gnbarequest_t</span>
and
-<SPAN
-CLASS="TYPE"
->lwres_gnbaresponse_t</SPAN
->
+<span class="type">lwres_gnbaresponse_t</span>
structures.
-<CODE
-CLASS="FUNCTION"
->lwres_gnbarequest_parse()</CODE
->
+<code class="function">lwres_gnbarequest_parse()</code>
and
-<CODE
-CLASS="FUNCTION"
->lwres_gnbaresponse_parse()</CODE
->
+<code class="function">lwres_gnbaresponse_parse()</code>
will return
-<SPAN
-CLASS="ERRORCODE"
->LWRES_R_UNEXPECTEDEND</SPAN
->
+<span class="errorcode">LWRES_R_UNEXPECTEDEND</span>
if the buffer is not empty after decoding the received packet.
These functions will return
-<SPAN
-CLASS="ERRORCODE"
->LWRES_R_FAILURE</SPAN
->
+<span class="errorcode">LWRES_R_FAILURE</span>
if
-<CODE
-CLASS="STRUCTFIELD"
->pktflags</CODE
->
+<em class="structfield"><code>pktflags</code></em>
in the packet header structure
-<SPAN
-CLASS="TYPE"
->lwres_lwpacket_t</SPAN
->
-indicate that the packet is not a response to an earlier query.</P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN116"
-></A
-><H2
->SEE ALSO</H2
-><P
-><SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->lwres_packet</SPAN
->(3)</SPAN
->.</P
-></DIV
-></BODY
-></HTML
->
+<span class="type">lwres_lwpacket_t</span>
+indicate that the packet is not a response to an earlier query.
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514984"></a><h2>SEE ALSO</h2>
+<p>
+<span class="citerefentry"><span class="refentrytitle">lwres_packet</span>(3)</span>.
+</p>
+</div>
+</div></body>
+</html>
diff --git a/lib/lwres/man/lwres_hstrerror.3 b/lib/lwres/man/lwres_hstrerror.3
index 2260088e..4ca84ce5 100644
--- a/lib/lwres/man/lwres_hstrerror.3
+++ b/lib/lwres/man/lwres_hstrerror.3
@@ -1,69 +1,75 @@
-.\" Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
-.\" Copyright (C) 2000, 2001 Internet Software Consortium.
-.\"
+.\" Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+.\" Copyright (C) 2000, 2001 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,
+.\" 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: lwres_hstrerror.3,v 1.13.2.1.8.1 2004/03/06 07:41:43 marka Exp $
+.\" $Id: lwres_hstrerror.3,v 1.13.2.1.8.4 2005/09/12 00:47:29 marka Exp $
.\"
-.TH "LWRES_HSTRERROR" "3" "Jun 30, 2000" "BIND9" ""
+.hy 0
+.ad l
+.\"Generated by db2man.xsl. Don't modify this, modify the source.
+.de Sh \" Subsection
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Ip \" List item
+.br
+.ie \\n(.$>=3 .ne \\$3
+.el .ne 3
+.IP "\\$1" \\$2
+..
+.TH "LWRES_HSTRERROR" 3 "Jun 30, 2000" "" ""
.SH NAME
lwres_herror, lwres_hstrerror \- lightweight resolver error message generation
-.SH SYNOPSIS
-\fB#include <lwres/netdb.h>
-.sp
-.na
-void
-lwres_herror(const char *s);
-.ad
-.sp
-.na
-const char *
-lwres_hstrerror(int err);
-.ad
-\fR
+.SH "SYNOPSIS"
+.nf
+#include <lwres/netdb\&.h>
+.fi
+.HP 19
+void\ \fBlwres_herror\fR\ (const\ char\ *s);
+.HP 32
+const\ char\ *\ \fBlwres_hstrerror\fR\ (int\ err);
.SH "DESCRIPTION"
.PP
-\fBlwres_herror()\fR prints the string
-\fIs\fR on \fBstderr\fR followed by the string
-generated by \fBlwres_hstrerror()\fR for the error code
-stored in the global variable lwres_h_errno.
+ \fBlwres_herror()\fR prints the string \fIs\fR on \fBstderr\fR followed by the string generated by \fBlwres_hstrerror()\fR for the error code stored in the global variable \fBlwres_h_errno\fR\&.
.PP
-\fBlwres_hstrerror()\fR returns an appropriate string
-for the error code gievn by \fIerr\fR. The values of
-the error codes and messages are as follows:
+ \fBlwres_hstrerror()\fR returns an appropriate string for the error code gievn by \fIerr\fR\&. The values of the error codes and messages are as follows:
.TP
\fBNETDB_SUCCESS\fR
-\fBResolver Error 0 (no error)\fR
+ Resolver Error 0 (no error)
.TP
\fBHOST_NOT_FOUND\fR
-\fBUnknown host\fR
+ Unknown host
.TP
\fBTRY_AGAIN\fR
-\fBHost name lookup failure\fR
+ Host name lookup failure
.TP
\fBNO_RECOVERY\fR
-\fBUnknown server error\fR
+ Unknown server error
.TP
\fBNO_DATA\fR
-\fBNo address associated with name\fR
+ No address associated with name
.SH "RETURN VALUES"
.PP
-The string \fBUnknown resolver error\fR is returned by
-\fBlwres_hstrerror()\fR
-when the value of
-lwres_h_errno
-is not a valid error code.
+The string Unknown resolver error is returned by \fBlwres_hstrerror()\fR when the value of \fBlwres_h_errno\fR is not a valid error code\&.
.SH "SEE ALSO"
.PP
-\fBherror\fR(3),
-\fBlwres_hstrerror\fR(3).
+ \fBherror\fR(3), \fBlwres_hstrerror\fR(3)\&.
diff --git a/lib/lwres/man/lwres_hstrerror.docbook b/lib/lwres/man/lwres_hstrerror.docbook
index 2ad4c498..a36c072e 100644
--- a/lib/lwres/man/lwres_hstrerror.docbook
+++ b/lib/lwres/man/lwres_hstrerror.docbook
@@ -1,7 +1,9 @@
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.0//EN"
+ "http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd"
+ [<!ENTITY mdash "&#8212;">]>
<!--
- - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- - Copyright (C) 2001 Internet Software Consortium.
+ - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2000, 2001 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
@@ -16,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: lwres_hstrerror.docbook,v 1.4.206.1 2004/03/06 08:15:41 marka Exp $ -->
+<!-- $Id: lwres_hstrerror.docbook,v 1.4.206.3 2005/05/12 21:36:15 sra Exp $ -->
<refentry>
@@ -30,6 +32,19 @@
<refmiscinfo>BIND9</refmiscinfo>
</refmeta>
+ <docinfo>
+ <copyright>
+ <year>2004</year>
+ <year>2005</year>
+ <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
+ </copyright>
+ <copyright>
+ <year>2000</year>
+ <year>2001</year>
+ <holder>Internet Software Consortium.</holder>
+ </copyright>
+ </docinfo>
+
<refnamediv>
<refname>lwres_herror</refname>
<refname>lwres_hstrerror</refname>
diff --git a/lib/lwres/man/lwres_hstrerror.html b/lib/lwres/man/lwres_hstrerror.html
index 0c264af1..8f0081b6 100644
--- a/lib/lwres/man/lwres_hstrerror.html
+++ b/lib/lwres/man/lwres_hstrerror.html
@@ -1,241 +1,100 @@
<!--
- - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- - Copyright (C) 2001 Internet Software Consortium.
- -
+ - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2000, 2001 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,
+ - 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: lwres_hstrerror.html,v 1.5.2.1.4.2 2004/08/22 23:39:04 marka Exp $ -->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<HTML
-><HEAD
-><TITLE
->lwres_hstrerror</TITLE
-><META
-NAME="GENERATOR"
-CONTENT="Modular DocBook HTML Stylesheet Version 1.7"></HEAD
-><BODY
-CLASS="REFENTRY"
-BGCOLOR="#FFFFFF"
-TEXT="#000000"
-LINK="#0000FF"
-VLINK="#840084"
-ALINK="#0000FF"
-><H1
-><A
-NAME="AEN1"
-></A
->lwres_hstrerror</H1
-><DIV
-CLASS="REFNAMEDIV"
-><A
-NAME="AEN8"
-></A
-><H2
->Name</H2
->lwres_herror, lwres_hstrerror&nbsp;--&nbsp;lightweight resolver error message generation</DIV
-><DIV
-CLASS="REFSYNOPSISDIV"
-><A
-NAME="AEN12"
-></A
-><H2
->Synopsis</H2
-><DIV
-CLASS="FUNCSYNOPSIS"
-><P
-></P
-><A
-NAME="AEN13"
-></A
-><PRE
-CLASS="FUNCSYNOPSISINFO"
->#include &lt;lwres/netdb.h&gt;</PRE
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->void
-lwres_herror</CODE
->(const char *s);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->const char *
-lwres_hstrerror</CODE
->(int err);</CODE
-></P
-><P
-></P
-></DIV
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN23"
-></A
-><H2
->DESCRIPTION</H2
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_herror()</CODE
-> prints the string
-<VAR
-CLASS="PARAMETER"
->s</VAR
-> on <SPAN
-CLASS="TYPE"
->stderr</SPAN
-> followed by the string
-generated by <CODE
-CLASS="FUNCTION"
->lwres_hstrerror()</CODE
-> for the error code
-stored in the global variable <CODE
-CLASS="CONSTANT"
->lwres_h_errno</CODE
->.</P
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_hstrerror()</CODE
-> returns an appropriate string
-for the error code gievn by <VAR
-CLASS="PARAMETER"
->err</VAR
->. The values of
+<!-- $Id: lwres_hstrerror.html,v 1.5.2.1.4.7 2005/07/18 02:36:53 marka Exp $ -->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>lwres_hstrerror</title>
+<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
+<a name="id2456972"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2>Name</h2>
+<p>lwres_herror, lwres_hstrerror &#8212; lightweight resolver error message generation</p>
+</div>
+<div class="refsynopsisdiv">
+<h2>Synopsis</h2>
+<div class="funcsynopsis">
+<pre class="funcsynopsisinfo">#include &lt;lwres/netdb.h&gt;</pre>
+<p><code class="funcdef">
+void
+<b class="fsfunc">lwres_herror</b>(</code>const char *s<code>)</code>;</p>
+<p><code class="funcdef">
+const char *
+<b class="fsfunc">lwres_hstrerror</b>(</code>int err<code>)</code>;</p>
+</div>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514541"></a><h2>DESCRIPTION</h2>
+<p>
+<code class="function">lwres_herror()</code> prints the string
+<em class="parameter"><code>s</code></em> on <span class="type">stderr</span> followed by the string
+generated by <code class="function">lwres_hstrerror()</code> for the error code
+stored in the global variable <code class="constant">lwres_h_errno</code>.
+</p>
+<p>
+<code class="function">lwres_hstrerror()</code> returns an appropriate string
+for the error code gievn by <em class="parameter"><code>err</code></em>. The values of
the error codes and messages are as follows:
-<P
-></P
-><DIV
-CLASS="VARIABLELIST"
-><DL
-><DT
-><SPAN
-CLASS="ERRORCODE"
->NETDB_SUCCESS</SPAN
-></DT
-><DD
-><P
-><SPAN
-CLASS="ERRORNAME"
->Resolver Error 0 (no error)</SPAN
-></P
-></DD
-><DT
-><SPAN
-CLASS="ERRORCODE"
->HOST_NOT_FOUND</SPAN
-></DT
-><DD
-><P
-><SPAN
-CLASS="ERRORNAME"
->Unknown host</SPAN
-></P
-></DD
-><DT
-><SPAN
-CLASS="ERRORCODE"
->TRY_AGAIN</SPAN
-></DT
-><DD
-><P
-><SPAN
-CLASS="ERRORNAME"
->Host name lookup failure</SPAN
-></P
-></DD
-><DT
-><SPAN
-CLASS="ERRORCODE"
->NO_RECOVERY</SPAN
-></DT
-><DD
-><P
-><SPAN
-CLASS="ERRORNAME"
->Unknown server error</SPAN
-></P
-></DD
-><DT
-><SPAN
-CLASS="ERRORCODE"
->NO_DATA</SPAN
-></DT
-><DD
-><P
-><SPAN
-CLASS="ERRORNAME"
->No address associated with name</SPAN
-></P
-></DD
-></DL
-></DIV
-></P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN65"
-></A
-><H2
->RETURN VALUES</H2
-><P
->The string <SPAN
-CLASS="ERRORNAME"
->Unknown resolver error</SPAN
-> is returned by
-<CODE
-CLASS="FUNCTION"
->lwres_hstrerror()</CODE
->
+</p>
+<div class="variablelist"><dl>
+<dt><span class="term"><span class="errorcode">NETDB_SUCCESS</span></span></dt>
+<dd><p>
+<span class="errorname">Resolver Error 0 (no error)</span>
+</p></dd>
+<dt><span class="term"><span class="errorcode">HOST_NOT_FOUND</span></span></dt>
+<dd><p>
+<span class="errorname">Unknown host</span>
+</p></dd>
+<dt><span class="term"><span class="errorcode">TRY_AGAIN</span></span></dt>
+<dd><p>
+<span class="errorname">Host name lookup failure</span>
+</p></dd>
+<dt><span class="term"><span class="errorcode">NO_RECOVERY</span></span></dt>
+<dd><p>
+<span class="errorname">Unknown server error</span>
+</p></dd>
+<dt><span class="term"><span class="errorcode">NO_DATA</span></span></dt>
+<dd><p>
+<span class="errorname">No address associated with name</span>
+</p></dd>
+</dl></div>
+<p>
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514722"></a><h2>RETURN VALUES</h2>
+<p>
+The string <span class="errorname">Unknown resolver error</span> is returned by
+<code class="function">lwres_hstrerror()</code>
when the value of
-<CODE
-CLASS="CONSTANT"
->lwres_h_errno</CODE
->
-is not a valid error code.</P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN71"
-></A
-><H2
->SEE ALSO</H2
-><P
-><SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->herror</SPAN
->(3)</SPAN
->,
+<code class="constant">lwres_h_errno</code>
+is not a valid error code.
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514741"></a><h2>SEE ALSO</h2>
+<p>
+<span class="citerefentry"><span class="refentrytitle">herror</span>(3)</span>,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->lwres_hstrerror</SPAN
->(3)</SPAN
->.</P
-></DIV
-></BODY
-></HTML
->
+<span class="citerefentry"><span class="refentrytitle">lwres_hstrerror</span>(3)</span>.
+</p>
+</div>
+</div></body>
+</html>
diff --git a/lib/lwres/man/lwres_inetntop.3 b/lib/lwres/man/lwres_inetntop.3
index a4603c60..6b43b9d1 100644
--- a/lib/lwres/man/lwres_inetntop.3
+++ b/lib/lwres/man/lwres_inetntop.3
@@ -1,54 +1,58 @@
-.\" Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
-.\" Copyright (C) 2000, 2001 Internet Software Consortium.
-.\"
+.\" Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+.\" Copyright (C) 2000, 2001 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,
+.\" 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: lwres_inetntop.3,v 1.12.2.1.8.1 2004/03/06 07:41:44 marka Exp $
+.\" $Id: lwres_inetntop.3,v 1.12.2.1.8.4 2005/09/12 00:47:29 marka Exp $
.\"
-.TH "LWRES_INETNTOP" "3" "Jun 30, 2000" "BIND9" ""
+.hy 0
+.ad l
+.\"Generated by db2man.xsl. Don't modify this, modify the source.
+.de Sh \" Subsection
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Ip \" List item
+.br
+.ie \\n(.$>=3 .ne \\$3
+.el .ne 3
+.IP "\\$1" \\$2
+..
+.TH "LWRES_INETNTOP" 3 "Jun 30, 2000" "" ""
.SH NAME
lwres_net_ntop \- lightweight resolver IP address presentation
-.SH SYNOPSIS
-\fB#include <lwres/net.h>
-.sp
-.na
-const char *
-lwres_net_ntop(int af, const void *src, char *dst, size_t size);
-.ad
-\fR
+.SH "SYNOPSIS"
+.nf
+#include <lwres/net\&.h>
+.fi
+.HP 31
+const\ char\ *\ \fBlwres_net_ntop\fR\ (int\ af, const\ void\ *src, char\ *dst, size_t\ size);
.SH "DESCRIPTION"
.PP
-\fBlwres_net_ntop()\fR converts an IP address of
-protocol family \fIaf\fR \(em IPv4 or IPv6 \(em
-at location \fIsrc\fR from network format to its
-conventional representation as a string. For IPv4 addresses, that
-string would be a dotted-decimal. An IPv6 address would be
-represented in colon notation as described in RFC1884.
+ \fBlwres_net_ntop()\fR converts an IP address of protocol family \fIaf\fR -- IPv4 or IPv6 -- at location \fIsrc\fR from network format to its conventional representation as a string\&. For IPv4 addresses, that string would be a dotted\-decimal\&. An IPv6 address would be represented in colon notation as described in RFC1884\&.
.PP
-The generated string is copied to \fIdst\fR provided
-\fIsize\fR indicates it is long enough to store the
-ASCII representation of the address.
+The generated string is copied to \fIdst\fR provided \fIsize\fR indicates it is long enough to store the ASCII representation of the address\&.
.SH "RETURN VALUES"
.PP
-If successful, the function returns \fIdst\fR:
-a pointer to a string containing the presentation format of the
-address. \fBlwres_net_ntop()\fR returns
-\fBNULL\fR and sets the global variable
-errno to EAFNOSUPPORT if
-the protocol family given in \fIaf\fR is not
-supported.
+If successful, the function returns \fIdst\fR: a pointer to a string containing the presentation format of the address\&. \fBlwres_net_ntop()\fR returns \fBNULL\fR and sets the global variable \fBerrno\fR to \fBEAFNOSUPPORT\fR if the protocol family given in \fIaf\fR is not supported\&.
.SH "SEE ALSO"
.PP
-\fBRFC1884\fR,
-\fBinet_ntop\fR(3),
-\fBerrno\fR(3).
+ \fBRFC1884\fR(), \fBinet_ntop\fR(3), \fBerrno\fR(3)\&.
diff --git a/lib/lwres/man/lwres_inetntop.docbook b/lib/lwres/man/lwres_inetntop.docbook
index e771478b..651ef04d 100644
--- a/lib/lwres/man/lwres_inetntop.docbook
+++ b/lib/lwres/man/lwres_inetntop.docbook
@@ -1,7 +1,9 @@
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.0//EN"
+ "http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd"
+ [<!ENTITY mdash "&#8212;">]>
<!--
- - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- - Copyright (C) 2001 Internet Software Consortium.
+ - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2000, 2001 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
@@ -16,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: lwres_inetntop.docbook,v 1.3.206.1 2004/03/06 08:15:41 marka Exp $ -->
+<!-- $Id: lwres_inetntop.docbook,v 1.3.206.3 2005/05/12 21:36:15 sra Exp $ -->
<refentry>
@@ -30,6 +32,19 @@
<refmiscinfo>BIND9</refmiscinfo>
</refmeta>
+ <docinfo>
+ <copyright>
+ <year>2004</year>
+ <year>2005</year>
+ <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
+ </copyright>
+ <copyright>
+ <year>2000</year>
+ <year>2001</year>
+ <holder>Internet Software Consortium.</holder>
+ </copyright>
+ </docinfo>
+
<refnamediv>
<refname>lwres_net_ntop</refname>
<refpurpose>lightweight resolver IP address presentation</refpurpose>
diff --git a/lib/lwres/man/lwres_inetntop.html b/lib/lwres/man/lwres_inetntop.html
index 34533454..5625f562 100644
--- a/lib/lwres/man/lwres_inetntop.html
+++ b/lib/lwres/man/lwres_inetntop.html
@@ -1,177 +1,98 @@
<!--
- - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- - Copyright (C) 2001 Internet Software Consortium.
- -
+ - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2000, 2001 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,
+ - 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: lwres_inetntop.html,v 1.5.2.1.4.2 2004/08/22 23:39:05 marka Exp $ -->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<HTML
-><HEAD
-><TITLE
->lwres_inetntop</TITLE
-><META
-NAME="GENERATOR"
-CONTENT="Modular DocBook HTML Stylesheet Version 1.7"></HEAD
-><BODY
-CLASS="REFENTRY"
-BGCOLOR="#FFFFFF"
-TEXT="#000000"
-LINK="#0000FF"
-VLINK="#840084"
-ALINK="#0000FF"
-><H1
-><A
-NAME="AEN1"
-></A
->lwres_inetntop</H1
-><DIV
-CLASS="REFNAMEDIV"
-><A
-NAME="AEN8"
-></A
-><H2
->Name</H2
->lwres_net_ntop&nbsp;--&nbsp;lightweight resolver IP address presentation</DIV
-><DIV
-CLASS="REFSYNOPSISDIV"
-><A
-NAME="AEN11"
-></A
-><H2
->Synopsis</H2
-><DIV
-CLASS="FUNCSYNOPSIS"
-><P
-></P
-><A
-NAME="AEN12"
-></A
-><PRE
-CLASS="FUNCSYNOPSISINFO"
->#include &lt;lwres/net.h&gt;</PRE
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->const char *
-lwres_net_ntop</CODE
->(int af, const void *src, char *dst, size_t size);</CODE
-></P
-><P
-></P
-></DIV
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN21"
-></A
-><H2
->DESCRIPTION</H2
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_net_ntop()</CODE
-> converts an IP address of
-protocol family <VAR
-CLASS="PARAMETER"
->af</VAR
-> &mdash; IPv4 or IPv6 &mdash;
-at location <VAR
-CLASS="PARAMETER"
->src</VAR
-> from network format to its
+<!-- $Id: lwres_inetntop.html,v 1.5.2.1.4.7 2005/07/18 02:36:54 marka Exp $ -->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>lwres_inetntop</title>
+<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
+<a name="id2456972"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2>Name</h2>
+<p>lwres_net_ntop &#8212; lightweight resolver IP address presentation</p>
+</div>
+<div class="refsynopsisdiv">
+<h2>Synopsis</h2>
+<div class="funcsynopsis">
+<pre class="funcsynopsisinfo">#include &lt;lwres/net.h&gt;</pre>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0">
+<tr>
+<td><code class="funcdef">
+const char *
+<b class="fsfunc">lwres_net_ntop</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+</div>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514537"></a><h2>DESCRIPTION</h2>
+<p>
+<code class="function">lwres_net_ntop()</code> converts an IP address of
+protocol family <em class="parameter"><code>af</code></em> &#8212; IPv4 or IPv6 &#8212;
+at location <em class="parameter"><code>src</code></em> from network format to its
conventional representation as a string. For IPv4 addresses, that
string would be a dotted-decimal. An IPv6 address would be
-represented in colon notation as described in RFC1884.</P
-><P
->The generated string is copied to <VAR
-CLASS="PARAMETER"
->dst</VAR
-> provided
-<VAR
-CLASS="PARAMETER"
->size</VAR
-> indicates it is long enough to store the
-ASCII representation of the address.</P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN30"
-></A
-><H2
->RETURN VALUES</H2
-><P
->If successful, the function returns <VAR
-CLASS="PARAMETER"
->dst</VAR
->:
+represented in colon notation as described in RFC1884.
+</p>
+<p>
+The generated string is copied to <em class="parameter"><code>dst</code></em> provided
+<em class="parameter"><code>size</code></em> indicates it is long enough to store the
+ASCII representation of the address.
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514570"></a><h2>RETURN VALUES</h2>
+<p>
+If successful, the function returns <em class="parameter"><code>dst</code></em>:
a pointer to a string containing the presentation format of the
-address. <CODE
-CLASS="FUNCTION"
->lwres_net_ntop()</CODE
-> returns
-<SPAN
-CLASS="TYPE"
->NULL</SPAN
-> and sets the global variable
-<CODE
-CLASS="CONSTANT"
->errno</CODE
-> to <SPAN
-CLASS="ERRORCODE"
->EAFNOSUPPORT</SPAN
-> if
-the protocol family given in <VAR
-CLASS="PARAMETER"
->af</VAR
-> is not
-supported.</P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN39"
-></A
-><H2
->SEE ALSO</H2
-><P
-><SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->RFC1884</SPAN
-></SPAN
->,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->inet_ntop</SPAN
->(3)</SPAN
->,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->errno</SPAN
->(3)</SPAN
->.</P
-></DIV
-></BODY
-></HTML
->
+address. <code class="function">lwres_net_ntop()</code> returns
+<span class="type">NULL</span> and sets the global variable
+<code class="constant">errno</code> to <span class="errorcode">EAFNOSUPPORT</span> if
+the protocol family given in <em class="parameter"><code>af</code></em> is not
+supported.
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514601"></a><h2>SEE ALSO</h2>
+<p>
+<span class="citerefentry"><span class="refentrytitle">RFC1884</span></span>,
+<span class="citerefentry"><span class="refentrytitle">inet_ntop</span>(3)</span>,
+<span class="citerefentry"><span class="refentrytitle">errno</span>(3)</span>.
+</p>
+</div>
+</div></body>
+</html>
diff --git a/lib/lwres/man/lwres_noop.3 b/lib/lwres/man/lwres_noop.3
index 36bb9042..0efce1af 100644
--- a/lib/lwres/man/lwres_noop.3
+++ b/lib/lwres/man/lwres_noop.3
@@ -1,162 +1,90 @@
-.\" Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
-.\" Copyright (C) 2000, 2001 Internet Software Consortium.
-.\"
+.\" Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+.\" Copyright (C) 2000, 2001 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,
+.\" 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: lwres_noop.3,v 1.14.2.1.8.1 2004/03/06 07:41:44 marka Exp $
+.\" $Id: lwres_noop.3,v 1.14.2.1.8.4 2005/09/12 00:47:29 marka Exp $
.\"
-.TH "LWRES_NOOP" "3" "Jun 30, 2000" "BIND9" ""
+.hy 0
+.ad l
+.\"Generated by db2man.xsl. Don't modify this, modify the source.
+.de Sh \" Subsection
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Ip \" List item
+.br
+.ie \\n(.$>=3 .ne \\$3
+.el .ne 3
+.IP "\\$1" \\$2
+..
+.TH "LWRES_NOOP" 3 "Jun 30, 2000" "" ""
.SH NAME
lwres_nooprequest_render, lwres_noopresponse_render, lwres_nooprequest_parse, lwres_noopresponse_parse, lwres_noopresponse_free, lwres_nooprequest_free \- lightweight resolver no-op message handling
-.SH SYNOPSIS
-\fB#include <lwres/lwres.h>
-.sp
-.na
-lwres_result_t
-lwres_nooprequest_render(lwres_context_t *ctx, lwres_nooprequest_t *req, lwres_lwpacket_t *pkt, lwres_buffer_t *b);
-.ad
-.sp
-.na
-lwres_result_t
-lwres_noopresponse_render(lwres_context_t *ctx, lwres_noopresponse_t *req, lwres_lwpacket_t *pkt, lwres_buffer_t *b);
-.ad
-.sp
-.na
-lwres_result_t
-lwres_nooprequest_parse(lwres_context_t *ctx, lwres_buffer_t *b, lwres_lwpacket_t *pkt, lwres_nooprequest_t **structp);
-.ad
-.sp
-.na
-lwres_result_t
-lwres_noopresponse_parse(lwres_context_t *ctx, lwres_buffer_t *b, lwres_lwpacket_t *pkt, lwres_noopresponse_t **structp);
-.ad
-.sp
-.na
-void
-lwres_noopresponse_free(lwres_context_t *ctx, lwres_noopresponse_t **structp);
-.ad
-.sp
-.na
-void
-lwres_nooprequest_free(lwres_context_t *ctx, lwres_nooprequest_t **structp);
-.ad
-\fR
+.SH "SYNOPSIS"
+.nf
+#include <lwres/lwres\&.h>
+.fi
+.HP 41
+lwres_result_t\ \fBlwres_nooprequest_render\fR\ (lwres_context_t\ *ctx, lwres_nooprequest_t\ *req, lwres_lwpacket_t\ *pkt, lwres_buffer_t\ *b);
+.HP 42
+lwres_result_t\ \fBlwres_noopresponse_render\fR\ (lwres_context_t\ *ctx, lwres_noopresponse_t\ *req, lwres_lwpacket_t\ *pkt, lwres_buffer_t\ *b);
+.HP 40
+lwres_result_t\ \fBlwres_nooprequest_parse\fR\ (lwres_context_t\ *ctx, lwres_buffer_t\ *b, lwres_lwpacket_t\ *pkt, lwres_nooprequest_t\ **structp);
+.HP 41
+lwres_result_t\ \fBlwres_noopresponse_parse\fR\ (lwres_context_t\ *ctx, lwres_buffer_t\ *b, lwres_lwpacket_t\ *pkt, lwres_noopresponse_t\ **structp);
+.HP 30
+void\ \fBlwres_noopresponse_free\fR\ (lwres_context_t\ *ctx, lwres_noopresponse_t\ **structp);
+.HP 29
+void\ \fBlwres_nooprequest_free\fR\ (lwres_context_t\ *ctx, lwres_nooprequest_t\ **structp);
.SH "DESCRIPTION"
.PP
-These are low-level routines for creating and parsing
-lightweight resolver no-op request and response messages.
+These are low\-level routines for creating and parsing lightweight resolver no\-op request and response messages\&.
.PP
-The no-op message is analogous to a \fBping\fR packet:
-a packet is sent to the resolver daemon and is simply echoed back.
-The opcode is intended to allow a client to determine if the server is
-operational or not.
+The no\-op message is analogous to a \fBping\fR packet: a packet is sent to the resolver daemon and is simply echoed back\&. The opcode is intended to allow a client to determine if the server is operational or not\&.
.PP
-There are four main functions for the no-op opcode.
-One render function converts a no-op request structure \(em
-\fBlwres_nooprequest_t\fR \(em
-to the lighweight resolver's canonical format.
-It is complemented by a parse function that converts a packet in this
-canonical format to a no-op request structure.
-Another render function converts the no-op response structure \(em
-\fBlwres_noopresponse_t\fR
-to the canonical format.
-This is complemented by a parse function which converts a packet in
-canonical format to a no-op response structure.
+There are four main functions for the no\-op opcode\&. One render function converts a no\-op request structure -- \fBlwres_nooprequest_t\fR -- to the lighweight resolver's canonical format\&. It is complemented by a parse function that converts a packet in this canonical format to a no\-op request structure\&. Another render function converts the no\-op response structure -- \fBlwres_noopresponse_t\fR to the canonical format\&. This is complemented by a parse function which converts a packet in canonical format to a no\-op response structure\&.
.PP
-These structures are defined in
-\fIlwres/lwres.h\fR.
-They are shown below.
-.sp
+These structures are defined in \fIlwres/lwres\&.h\fR\&. They are shown below\&.
.nf
#define LWRES_OPCODE_NOOP 0x00000000U
-
typedef struct {
lwres_uint16_t datalength;
unsigned char *data;
} lwres_nooprequest_t;
-
typedef struct {
lwres_uint16_t datalength;
unsigned char *data;
} lwres_noopresponse_t;
-.sp
.fi
-Although the structures have different types, they are identical.
-This is because the no-op opcode simply echos whatever data was sent:
-the response is therefore identical to the request.
+ Although the structures have different types, they are identical\&. This is because the no\-op opcode simply echos whatever data was sent: the response is therefore identical to the request\&.
.PP
-\fBlwres_nooprequest_render()\fR uses resolver
-context \fIctx\fR to convert no-op request structure
-\fIreq\fR to canonical format. The packet header
-structure \fIpkt\fR is initialised and transferred to
-buffer \fIb\fR. The contents of
-\fI*req\fR are then appended to the buffer in
-canonical format. \fBlwres_noopresponse_render()\fR
-performs the same task, except it converts a no-op response structure
-\fBlwres_noopresponse_t\fR to the lightweight resolver's
-canonical format.
+ \fBlwres_nooprequest_render()\fR uses resolver context \fIctx\fR to convert no\-op request structure \fIreq\fR to canonical format\&. The packet header structure \fIpkt\fR is initialised and transferred to buffer \fIb\fR\&. The contents of \fI*req\fR are then appended to the buffer in canonical format\&. \fBlwres_noopresponse_render()\fR performs the same task, except it converts a no\-op response structure \fBlwres_noopresponse_t\fR to the lightweight resolver's canonical format\&.
.PP
-\fBlwres_nooprequest_parse()\fR uses context
-\fIctx\fR to convert the contents of packet
-\fIpkt\fR to a \fBlwres_nooprequest_t\fR
-structure. Buffer \fIb\fR provides space to be used
-for storing this structure. When the function succeeds, the resulting
-\fBlwres_nooprequest_t\fR is made available through
-\fI*structp\fR.
-\fBlwres_noopresponse_parse()\fR offers the same
-semantics as \fBlwres_nooprequest_parse()\fR except it
-yields a \fBlwres_noopresponse_t\fR structure.
+ \fBlwres_nooprequest_parse()\fR uses context \fIctx\fR to convert the contents of packet \fIpkt\fR to a \fBlwres_nooprequest_t\fR structure\&. Buffer \fIb\fR provides space to be used for storing this structure\&. When the function succeeds, the resulting \fBlwres_nooprequest_t\fR is made available through \fI*structp\fR\&. \fBlwres_noopresponse_parse()\fR offers the same semantics as \fBlwres_nooprequest_parse()\fR except it yields a \fBlwres_noopresponse_t\fR structure\&.
.PP
-\fBlwres_noopresponse_free()\fR and
-\fBlwres_nooprequest_free()\fR release the memory in
-resolver context \fIctx\fR that was allocated to the
-\fBlwres_noopresponse_t\fR or \fBlwres_nooprequest_t\fR
-structures referenced via \fIstructp\fR.
+ \fBlwres_noopresponse_free()\fR and \fBlwres_nooprequest_free()\fR release the memory in resolver context \fIctx\fR that was allocated to the \fBlwres_noopresponse_t\fR or \fBlwres_nooprequest_t\fR structures referenced via \fIstructp\fR\&.
.SH "RETURN VALUES"
.PP
-The no-op opcode functions
-\fBlwres_nooprequest_render()\fR,
-\fBlwres_noopresponse_render()\fR
-\fBlwres_nooprequest_parse()\fR
-and
-\fBlwres_noopresponse_parse()\fR
-all return
-LWRES_R_SUCCESS
-on success.
-They return
-LWRES_R_NOMEMORY
-if memory allocation fails.
-LWRES_R_UNEXPECTEDEND
-is returned if the available space in the buffer
-\fIb\fR
-is too small to accommodate the packet header or the
-\fBlwres_nooprequest_t\fR
-and
-\fBlwres_noopresponse_t\fR
-structures.
-\fBlwres_nooprequest_parse()\fR
-and
-\fBlwres_noopresponse_parse()\fR
-will return
-LWRES_R_UNEXPECTEDEND
-if the buffer is not empty after decoding the received packet.
-These functions will return
-LWRES_R_FAILURE
-if
-pktflags
-in the packet header structure
-\fBlwres_lwpacket_t\fR
-indicate that the packet is not a response to an earlier query.
+The no\-op opcode functions \fBlwres_nooprequest_render()\fR, \fBlwres_noopresponse_render()\fR \fBlwres_nooprequest_parse()\fR and \fBlwres_noopresponse_parse()\fR all return \fBLWRES_R_SUCCESS\fR on success\&. They return \fBLWRES_R_NOMEMORY\fR if memory allocation fails\&. \fBLWRES_R_UNEXPECTEDEND\fR is returned if the available space in the buffer \fIb\fR is too small to accommodate the packet header or the \fBlwres_nooprequest_t\fR and \fBlwres_noopresponse_t\fR structures\&. \fBlwres_nooprequest_parse()\fR and \fBlwres_noopresponse_parse()\fR will return \fBLWRES_R_UNEXPECTEDEND\fR if the buffer is not empty after decoding the received packet\&. These functions will return \fBLWRES_R_FAILURE\fR if \fBpktflags\fR in the packet header structure \fBlwres_lwpacket_t\fR indicate that the packet is not a response to an earlier query\&.
.SH "SEE ALSO"
.PP
-\fBlwres_packet\fR(3)
+ \fBlwres_packet\fR(3 )
diff --git a/lib/lwres/man/lwres_noop.docbook b/lib/lwres/man/lwres_noop.docbook
index dde2795c..fcb3c593 100644
--- a/lib/lwres/man/lwres_noop.docbook
+++ b/lib/lwres/man/lwres_noop.docbook
@@ -1,7 +1,9 @@
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.0//EN"
+ "http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd"
+ [<!ENTITY mdash "&#8212;">]>
<!--
- - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- - Copyright (C) 2001 Internet Software Consortium.
+ - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2000, 2001 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
@@ -16,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: lwres_noop.docbook,v 1.4.206.1 2004/03/06 08:15:41 marka Exp $ -->
+<!-- $Id: lwres_noop.docbook,v 1.4.206.3 2005/05/12 21:36:16 sra Exp $ -->
<refentry>
@@ -30,6 +32,19 @@
<refmiscinfo>BIND9</refmiscinfo>
</refmeta>
+ <docinfo>
+ <copyright>
+ <year>2004</year>
+ <year>2005</year>
+ <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
+ </copyright>
+ <copyright>
+ <year>2000</year>
+ <year>2001</year>
+ <holder>Internet Software Consortium.</holder>
+ </copyright>
+ </docinfo>
+
<refnamediv>
<refname>lwres_nooprequest_render</refname>
<refname>lwres_noopresponse_render</refname>
diff --git a/lib/lwres/man/lwres_noop.html b/lib/lwres/man/lwres_noop.html
index 0962883d..be9ffe8b 100644
--- a/lib/lwres/man/lwres_noop.html
+++ b/lib/lwres/man/lwres_noop.html
@@ -1,166 +1,202 @@
<!--
- - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- - Copyright (C) 2001 Internet Software Consortium.
- -
+ - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2000, 2001 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,
+ - 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: lwres_noop.html,v 1.7.2.1.4.2 2004/08/22 23:39:05 marka Exp $ -->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<HTML
-><HEAD
-><TITLE
->lwres_noop</TITLE
-><META
-NAME="GENERATOR"
-CONTENT="Modular DocBook HTML Stylesheet Version 1.7"></HEAD
-><BODY
-CLASS="REFENTRY"
-BGCOLOR="#FFFFFF"
-TEXT="#000000"
-LINK="#0000FF"
-VLINK="#840084"
-ALINK="#0000FF"
-><H1
-><A
-NAME="AEN1"
-></A
->lwres_noop</H1
-><DIV
-CLASS="REFNAMEDIV"
-><A
-NAME="AEN8"
-></A
-><H2
->Name</H2
->lwres_nooprequest_render, lwres_noopresponse_render, lwres_nooprequest_parse, lwres_noopresponse_parse, lwres_noopresponse_free, lwres_nooprequest_free&nbsp;--&nbsp;lightweight resolver no-op message handling</DIV
-><DIV
-CLASS="REFSYNOPSISDIV"
-><A
-NAME="AEN16"
-></A
-><H2
->Synopsis</H2
-><DIV
-CLASS="FUNCSYNOPSIS"
-><P
-></P
-><A
-NAME="AEN17"
-></A
-><PRE
-CLASS="FUNCSYNOPSISINFO"
->#include &lt;lwres/lwres.h&gt;</PRE
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->lwres_result_t
-lwres_nooprequest_render</CODE
->(lwres_context_t *ctx, lwres_nooprequest_t *req, lwres_lwpacket_t *pkt, lwres_buffer_t *b);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->lwres_result_t
-lwres_noopresponse_render</CODE
->(lwres_context_t *ctx, lwres_noopresponse_t *req, lwres_lwpacket_t *pkt, lwres_buffer_t *b);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->lwres_result_t
-lwres_nooprequest_parse</CODE
->(lwres_context_t *ctx, lwres_buffer_t *b, lwres_lwpacket_t *pkt, lwres_nooprequest_t **structp);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->lwres_result_t
-lwres_noopresponse_parse</CODE
->(lwres_context_t *ctx, lwres_buffer_t *b, lwres_lwpacket_t *pkt, lwres_noopresponse_t **structp);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->void
-lwres_noopresponse_free</CODE
->(lwres_context_t *ctx, lwres_noopresponse_t **structp);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->void
-lwres_nooprequest_free</CODE
->(lwres_context_t *ctx, lwres_nooprequest_t **structp);</CODE
-></P
-><P
-></P
-></DIV
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN57"
-></A
-><H2
->DESCRIPTION</H2
-><P
->These are low-level routines for creating and parsing
-lightweight resolver no-op request and response messages.</P
-><P
->The no-op message is analogous to a <B
-CLASS="COMMAND"
->ping</B
-> packet:
+<!-- $Id: lwres_noop.html,v 1.7.2.1.4.7 2005/07/18 02:36:54 marka Exp $ -->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>lwres_noop</title>
+<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
+<a name="id2456972"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2>Name</h2>
+<p>lwres_nooprequest_render, lwres_noopresponse_render, lwres_nooprequest_parse, lwres_noopresponse_parse, lwres_noopresponse_free, lwres_nooprequest_free &#8212; lightweight resolver no-op message handling</p>
+</div>
+<div class="refsynopsisdiv">
+<h2>Synopsis</h2>
+<div class="funcsynopsis">
+<pre class="funcsynopsisinfo">
+#include &lt;lwres/lwres.h&gt;</pre>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+lwres_result_t
+<b class="fsfunc">lwres_nooprequest_render</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+lwres_result_t
+<b class="fsfunc">lwres_noopresponse_render</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+lwres_result_t
+<b class="fsfunc">lwres_nooprequest_parse</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+lwres_result_t
+<b class="fsfunc">lwres_noopresponse_parse</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+void
+<b class="fsfunc">lwres_noopresponse_free</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0">
+<tr>
+<td><code class="funcdef">
+void
+<b class="fsfunc">lwres_nooprequest_free</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+</div>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514646"></a><h2>DESCRIPTION</h2>
+<p>
+These are low-level routines for creating and parsing
+lightweight resolver no-op request and response messages.
+</p>
+<p>
+The no-op message is analogous to a <span><strong class="command">ping</strong></span> packet:
a packet is sent to the resolver daemon and is simply echoed back.
The opcode is intended to allow a client to determine if the server is
-operational or not.</P
-><P
->There are four main functions for the no-op opcode.
-One render function converts a no-op request structure &mdash;
-<SPAN
-CLASS="TYPE"
->lwres_nooprequest_t</SPAN
-> &mdash;
+operational or not.
+</p>
+<p>
+There are four main functions for the no-op opcode.
+One render function converts a no-op request structure &#8212;
+<span class="type">lwres_nooprequest_t</span> &#8212;
to the lighweight resolver's canonical format.
It is complemented by a parse function that converts a packet in this
canonical format to a no-op request structure.
-Another render function converts the no-op response structure &mdash;
-<SPAN
-CLASS="TYPE"
->lwres_noopresponse_t</SPAN
->
+Another render function converts the no-op response structure &#8212;
+<span class="type">lwres_noopresponse_t</span>
to the canonical format.
This is complemented by a parse function which converts a packet in
-canonical format to a no-op response structure.</P
-><P
->These structures are defined in
-<TT
-CLASS="FILENAME"
->lwres/lwres.h</TT
->.
+canonical format to a no-op response structure.
+</p>
+<p>
+These structures are defined in
+<code class="filename">lwres/lwres.h</code>.
They are shown below.
-<PRE
-CLASS="PROGRAMLISTING"
->#define LWRES_OPCODE_NOOP 0x00000000U
+</p>
+<pre class="programlisting">
+#define LWRES_OPCODE_NOOP 0x00000000U
typedef struct {
lwres_uint16_t datalength;
@@ -170,219 +206,90 @@ typedef struct {
typedef struct {
lwres_uint16_t datalength;
unsigned char *data;
-} lwres_noopresponse_t;</PRE
->
+} lwres_noopresponse_t;
+</pre>
+<p>
Although the structures have different types, they are identical.
This is because the no-op opcode simply echos whatever data was sent:
-the response is therefore identical to the request.</P
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_nooprequest_render()</CODE
-> uses resolver
-context <VAR
-CLASS="PARAMETER"
->ctx</VAR
-> to convert no-op request structure
-<VAR
-CLASS="PARAMETER"
->req</VAR
-> to canonical format. The packet header
-structure <VAR
-CLASS="PARAMETER"
->pkt</VAR
-> is initialised and transferred to
-buffer <VAR
-CLASS="PARAMETER"
->b</VAR
->. The contents of
-<VAR
-CLASS="PARAMETER"
->*req</VAR
-> are then appended to the buffer in
-canonical format. <CODE
-CLASS="FUNCTION"
->lwres_noopresponse_render()</CODE
->
+the response is therefore identical to the request.
+</p>
+<p>
+<code class="function">lwres_nooprequest_render()</code> uses resolver
+context <em class="parameter"><code>ctx</code></em> to convert no-op request structure
+<em class="parameter"><code>req</code></em> to canonical format. The packet header
+structure <em class="parameter"><code>pkt</code></em> is initialised and transferred to
+buffer <em class="parameter"><code>b</code></em>. The contents of
+<em class="parameter"><code>*req</code></em> are then appended to the buffer in
+canonical format. <code class="function">lwres_noopresponse_render()</code>
performs the same task, except it converts a no-op response structure
-<SPAN
-CLASS="TYPE"
->lwres_noopresponse_t</SPAN
-> to the lightweight resolver's
-canonical format.</P
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_nooprequest_parse()</CODE
-> uses context
-<VAR
-CLASS="PARAMETER"
->ctx</VAR
-> to convert the contents of packet
-<VAR
-CLASS="PARAMETER"
->pkt</VAR
-> to a <SPAN
-CLASS="TYPE"
->lwres_nooprequest_t</SPAN
->
-structure. Buffer <VAR
-CLASS="PARAMETER"
->b</VAR
-> provides space to be used
+<span class="type">lwres_noopresponse_t</span> to the lightweight resolver's
+canonical format.
+</p>
+<p>
+<code class="function">lwres_nooprequest_parse()</code> uses context
+<em class="parameter"><code>ctx</code></em> to convert the contents of packet
+<em class="parameter"><code>pkt</code></em> to a <span class="type">lwres_nooprequest_t</span>
+structure. Buffer <em class="parameter"><code>b</code></em> provides space to be used
for storing this structure. When the function succeeds, the resulting
-<SPAN
-CLASS="TYPE"
->lwres_nooprequest_t</SPAN
-> is made available through
-<VAR
-CLASS="PARAMETER"
->*structp</VAR
->.
-<CODE
-CLASS="FUNCTION"
->lwres_noopresponse_parse()</CODE
-> offers the same
-semantics as <CODE
-CLASS="FUNCTION"
->lwres_nooprequest_parse()</CODE
-> except it
-yields a <SPAN
-CLASS="TYPE"
->lwres_noopresponse_t</SPAN
-> structure.</P
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_noopresponse_free()</CODE
-> and
-<CODE
-CLASS="FUNCTION"
->lwres_nooprequest_free()</CODE
-> release the memory in
-resolver context <VAR
-CLASS="PARAMETER"
->ctx</VAR
-> that was allocated to the
-<SPAN
-CLASS="TYPE"
->lwres_noopresponse_t</SPAN
-> or <SPAN
-CLASS="TYPE"
->lwres_nooprequest_t</SPAN
->
-structures referenced via <VAR
-CLASS="PARAMETER"
->structp</VAR
->.</P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN95"
-></A
-><H2
->RETURN VALUES</H2
-><P
->The no-op opcode functions
-<CODE
-CLASS="FUNCTION"
->lwres_nooprequest_render()</CODE
->,
+<span class="type">lwres_nooprequest_t</span> is made available through
+<em class="parameter"><code>*structp</code></em>.
+<code class="function">lwres_noopresponse_parse()</code> offers the same
+semantics as <code class="function">lwres_nooprequest_parse()</code> except it
+yields a <span class="type">lwres_noopresponse_t</span> structure.
+</p>
+<p>
+<code class="function">lwres_noopresponse_free()</code> and
+<code class="function">lwres_nooprequest_free()</code> release the memory in
+resolver context <em class="parameter"><code>ctx</code></em> that was allocated to the
+<span class="type">lwres_noopresponse_t</span> or <span class="type">lwres_nooprequest_t</span>
+structures referenced via <em class="parameter"><code>structp</code></em>.
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514846"></a><h2>RETURN VALUES</h2>
+<p>
+The no-op opcode functions
+<code class="function">lwres_nooprequest_render()</code>,
-<CODE
-CLASS="FUNCTION"
->lwres_noopresponse_render()</CODE
->
-<CODE
-CLASS="FUNCTION"
->lwres_nooprequest_parse()</CODE
->
+<code class="function">lwres_noopresponse_render()</code>
+<code class="function">lwres_nooprequest_parse()</code>
and
-<CODE
-CLASS="FUNCTION"
->lwres_noopresponse_parse()</CODE
->
+<code class="function">lwres_noopresponse_parse()</code>
all return
-<SPAN
-CLASS="ERRORCODE"
->LWRES_R_SUCCESS</SPAN
->
+<span class="errorcode">LWRES_R_SUCCESS</span>
on success.
They return
-<SPAN
-CLASS="ERRORCODE"
->LWRES_R_NOMEMORY</SPAN
->
+<span class="errorcode">LWRES_R_NOMEMORY</span>
if memory allocation fails.
-<SPAN
-CLASS="ERRORCODE"
->LWRES_R_UNEXPECTEDEND</SPAN
->
+<span class="errorcode">LWRES_R_UNEXPECTEDEND</span>
is returned if the available space in the buffer
-<VAR
-CLASS="PARAMETER"
->b</VAR
->
+<em class="parameter"><code>b</code></em>
is too small to accommodate the packet header or the
-<SPAN
-CLASS="TYPE"
->lwres_nooprequest_t</SPAN
->
+<span class="type">lwres_nooprequest_t</span>
and
-<SPAN
-CLASS="TYPE"
->lwres_noopresponse_t</SPAN
->
+<span class="type">lwres_noopresponse_t</span>
structures.
-<CODE
-CLASS="FUNCTION"
->lwres_nooprequest_parse()</CODE
->
+<code class="function">lwres_nooprequest_parse()</code>
and
-<CODE
-CLASS="FUNCTION"
->lwres_noopresponse_parse()</CODE
->
+<code class="function">lwres_noopresponse_parse()</code>
will return
-<SPAN
-CLASS="ERRORCODE"
->LWRES_R_UNEXPECTEDEND</SPAN
->
+<span class="errorcode">LWRES_R_UNEXPECTEDEND</span>
if the buffer is not empty after decoding the received packet.
These functions will return
-<SPAN
-CLASS="ERRORCODE"
->LWRES_R_FAILURE</SPAN
->
+<span class="errorcode">LWRES_R_FAILURE</span>
if
-<CODE
-CLASS="CONSTANT"
->pktflags</CODE
->
+<code class="constant">pktflags</code>
in the packet header structure
-<SPAN
-CLASS="TYPE"
->lwres_lwpacket_t</SPAN
->
-indicate that the packet is not a response to an earlier query.</P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN114"
-></A
-><H2
->SEE ALSO</H2
-><P
-><SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->lwres_packet</SPAN
->(3)</SPAN
-></P
-></DIV
-></BODY
-></HTML
->
+<span class="type">lwres_lwpacket_t</span>
+indicate that the packet is not a response to an earlier query.
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514979"></a><h2>SEE ALSO</h2>
+<p>
+<span class="citerefentry"><span class="refentrytitle">lwres_packet</span>(3
+)</span>
+</p>
+</div>
+</div></body>
+</html>
diff --git a/lib/lwres/man/lwres_packet.3 b/lib/lwres/man/lwres_packet.3
index 1fbc417e..51e7b79d 100644
--- a/lib/lwres/man/lwres_packet.3
+++ b/lib/lwres/man/lwres_packet.3
@@ -1,46 +1,57 @@
-.\" Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
-.\" Copyright (C) 2000, 2001 Internet Software Consortium.
-.\"
+.\" Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+.\" Copyright (C) 2000, 2001 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,
+.\" 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: lwres_packet.3,v 1.15.2.1.8.1 2004/03/06 07:41:44 marka Exp $
+.\" $Id: lwres_packet.3,v 1.15.2.1.8.4 2005/09/12 00:47:29 marka Exp $
.\"
-.TH "LWRES_PACKET" "3" "Jun 30, 2000" "BIND9" ""
+.hy 0
+.ad l
+.\"Generated by db2man.xsl. Don't modify this, modify the source.
+.de Sh \" Subsection
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Ip \" List item
+.br
+.ie \\n(.$>=3 .ne \\$3
+.el .ne 3
+.IP "\\$1" \\$2
+..
+.TH "LWRES_PACKET" 3 "Jun 30, 2000" "" ""
.SH NAME
lwres_lwpacket_renderheader, lwres_lwpacket_parseheader \- lightweight resolver packet handling functions
-.SH SYNOPSIS
-\fB#include <lwres/lwpacket.h>
-.sp
-.na
-lwres_result_t
-lwres_lwpacket_renderheader(lwres_buffer_t *b, lwres_lwpacket_t *pkt);
-.ad
-.sp
-.na
-lwres_result_t
-lwres_lwpacket_parseheader(lwres_buffer_t *b, lwres_lwpacket_t *pkt);
-.ad
-\fR
+.SH "SYNOPSIS"
+.nf
+#include <lwres/lwpacket\&.h>
+.fi
+.HP 44
+lwres_result_t\ \fBlwres_lwpacket_renderheader\fR\ (lwres_buffer_t\ *b, lwres_lwpacket_t\ *pkt);
+.HP 43
+lwres_result_t\ \fBlwres_lwpacket_parseheader\fR\ (lwres_buffer_t\ *b, lwres_lwpacket_t\ *pkt);
.SH "DESCRIPTION"
.PP
-These functions rely on a
-\fBstruct lwres_lwpacket\fR
-which is defined in
-\fIlwres/lwpacket.h\fR.
-.sp
+These functions rely on a \fBstruct lwres_lwpacket\fR which is defined in \fIlwres/lwpacket\&.h\fR\&.
.nf
typedef struct lwres_lwpacket lwres_lwpacket_t;
-
struct lwres_lwpacket {
lwres_uint32_t length;
lwres_uint16_t version;
@@ -52,100 +63,51 @@ struct lwres_lwpacket {
lwres_uint16_t authtype;
lwres_uint16_t authlength;
};
-.sp
.fi
.PP
-The elements of this structure are:
+The elements of this structure are:
.TP
\fBlength\fR
-the overall packet length, including the entire packet header.
-This field is filled in by the lwres_gabn_*() and lwres_gnba_*()
-calls.
+the overall packet length, including the entire packet header\&. This field is filled in by the lwres_gabn_*() and lwres_gnba_*() calls\&.
.TP
\fBversion\fR
-the header format. There is currently only one format,
-\fBLWRES_LWPACKETVERSION_0\fR.
-This field is filled in by the lwres_gabn_*() and lwres_gnba_*()
-calls.
+the header format\&. There is currently only one format, \fBLWRES_LWPACKETVERSION_0\fR\&. This field is filled in by the lwres_gabn_*() and lwres_gnba_*() calls\&.
.TP
\fBpktflags\fR
-library-defined flags for this packet: for instance whether the packet
-is a request or a reply. Flag values can be set, but not defined by
-the caller.
-This field is filled in by the application wit the exception of the
-LWRES_LWPACKETFLAG_RESPONSE bit, which is set by the library in the
-lwres_gabn_*() and lwres_gnba_*() calls.
+library\-defined flags for this packet: for instance whether the packet is a request or a reply\&. Flag values can be set, but not defined by the caller\&. This field is filled in by the application wit the exception of the LWRES_LWPACKETFLAG_RESPONSE bit, which is set by the library in the lwres_gabn_*() and lwres_gnba_*() calls\&.
.TP
\fBserial\fR
-is set by the requestor and is returned in all replies. If two or more
-packets from the same source have the same serial number and are from
-the same source, they are assumed to be duplicates and the latter ones
-may be dropped.
-This field must be set by the application.
+is set by the requestor and is returned in all replies\&. If two or more packets from the same source have the same serial number and are from the same source, they are assumed to be duplicates and the latter ones may be dropped\&. This field must be set by the application\&.
.TP
\fBopcode\fR
-indicates the operation.
-Opcodes between 0x00000000 and 0x03ffffff are
-reserved for use by the lightweight resolver library. Opcodes between
-0x04000000 and 0xffffffff are application defined.
-This field is filled in by the lwres_gabn_*() and lwres_gnba_*()
-calls.
+indicates the operation\&. Opcodes between 0x00000000 and 0x03ffffff are reserved for use by the lightweight resolver library\&. Opcodes between 0x04000000 and 0xffffffff are application defined\&. This field is filled in by the lwres_gabn_*() and lwres_gnba_*() calls\&.
.TP
\fBresult\fR
-is only valid for replies.
-Results between 0x04000000 and 0xffffffff are application defined.
-Results between 0x00000000 and 0x03ffffff are reserved for library use.
-This field is filled in by the lwres_gabn_*() and lwres_gnba_*()
-calls.
+is only valid for replies\&. Results between 0x04000000 and 0xffffffff are application defined\&. Results between 0x00000000 and 0x03ffffff are reserved for library use\&. This field is filled in by the lwres_gabn_*() and lwres_gnba_*() calls\&.
.TP
\fBrecvlength\fR
-is the maximum buffer size that the receiver can handle on requests
-and the size of the buffer needed to satisfy a request when the buffer
-is too large for replies.
-This field is supplied by the application.
+is the maximum buffer size that the receiver can handle on requests and the size of the buffer needed to satisfy a request when the buffer is too large for replies\&. This field is supplied by the application\&.
.TP
\fBauthtype\fR
-defines the packet level authentication that is used.
-Authorisation types between 0x1000 and 0xffff are application defined
-and types between 0x0000 and 0x0fff are reserved for library use.
-Currently these are not used and must be zero.
+defines the packet level authentication that is used\&. Authorisation types between 0x1000 and 0xffff are application defined and types between 0x0000 and 0x0fff are reserved for library use\&. Currently these are not used and must be zero\&.
.TP
\fBauthlen\fR
-gives the length of the authentication data.
-Since packet authentication is currently not used, this must be zero.
+gives the length of the authentication data\&. Since packet authentication is currently not used, this must be zero\&.
.PP
-The following opcodes are currently defined:
+The following opcodes are currently defined:
.TP
\fBNOOP\fR
-Success is always returned and the packet contents are echoed.
-The lwres_noop_*() functions should be used for this type.
+Success is always returned and the packet contents are echoed\&. The lwres_noop_*() functions should be used for this type\&.
.TP
\fBGETADDRSBYNAME\fR
-returns all known addresses for a given name.
-The lwres_gabn_*() functions should be used for this type.
+returns all known addresses for a given name\&. The lwres_gabn_*() functions should be used for this type\&.
.TP
\fBGETNAMEBYADDR\fR
-return the hostname for the given address.
-The lwres_gnba_*() functions should be used for this type.
+return the hostname for the given address\&. The lwres_gnba_*() functions should be used for this type\&.
.PP
-\fBlwres_lwpacket_renderheader()\fR transfers the
-contents of lightweight resolver packet structure
-\fBlwres_lwpacket_t\fR \fI*pkt\fR in network
-byte order to the lightweight resolver buffer,
-\fI*b\fR.
+ \fBlwres_lwpacket_renderheader()\fR transfers the contents of lightweight resolver packet structure \fBlwres_lwpacket_t\fR \fI*pkt\fR in network byte order to the lightweight resolver buffer, \fI*b\fR\&.
.PP
-\fBlwres_lwpacket_parseheader()\fR performs the
-converse operation. It transfers data in network byte order from
-buffer \fI*b\fR to resolver packet
-\fI*pkt\fR. The contents of the buffer
-\fIb\fR should correspond to a
-\fBlwres_lwpacket_t\fR.
+ \fBlwres_lwpacket_parseheader()\fR performs the converse operation\&. It transfers data in network byte order from buffer \fI*b\fR to resolver packet \fI*pkt\fR\&. The contents of the buffer \fIb\fR should correspond to a \fBlwres_lwpacket_t\fR\&.
.SH "RETURN VALUES"
.PP
-Successful calls to
-\fBlwres_lwpacket_renderheader()\fR and
-\fBlwres_lwpacket_parseheader()\fR return
-LWRES_R_SUCCESS. If there is insufficient
-space to copy data between the buffer \fI*b\fR and
-lightweight resolver packet \fI*pkt\fR both functions
-return LWRES_R_UNEXPECTEDEND.
+Successful calls to \fBlwres_lwpacket_renderheader()\fR and \fBlwres_lwpacket_parseheader()\fR return \fBLWRES_R_SUCCESS\fR\&. If there is insufficient space to copy data between the buffer \fI*b\fR and lightweight resolver packet \fI*pkt\fR both functions return \fBLWRES_R_UNEXPECTEDEND\fR\&.
diff --git a/lib/lwres/man/lwres_packet.docbook b/lib/lwres/man/lwres_packet.docbook
index 7795ebc7..226f9942 100644
--- a/lib/lwres/man/lwres_packet.docbook
+++ b/lib/lwres/man/lwres_packet.docbook
@@ -1,7 +1,9 @@
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.0//EN"
+ "http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd"
+ [<!ENTITY mdash "&#8212;">]>
<!--
- - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- - Copyright (C) 2001 Internet Software Consortium.
+ - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2000, 2001 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
@@ -16,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: lwres_packet.docbook,v 1.6.206.1 2004/03/06 08:15:42 marka Exp $ -->
+<!-- $Id: lwres_packet.docbook,v 1.6.206.3 2005/05/12 21:36:16 sra Exp $ -->
<refentry>
@@ -30,6 +32,19 @@
<refmiscinfo>BIND9</refmiscinfo>
</refmeta>
+ <docinfo>
+ <copyright>
+ <year>2004</year>
+ <year>2005</year>
+ <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
+ </copyright>
+ <copyright>
+ <year>2000</year>
+ <year>2001</year>
+ <holder>Internet Software Consortium.</holder>
+ </copyright>
+ </docinfo>
+
<refnamediv>
<refname>lwres_lwpacket_renderheader</refname>
<refname>lwres_lwpacket_parseheader</refname>
diff --git a/lib/lwres/man/lwres_packet.html b/lib/lwres/man/lwres_packet.html
index cb61e0a4..cdbb5406 100644
--- a/lib/lwres/man/lwres_packet.html
+++ b/lib/lwres/man/lwres_packet.html
@@ -1,109 +1,79 @@
<!--
- - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- - Copyright (C) 2001 Internet Software Consortium.
- -
+ - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2000, 2001 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,
+ - 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: lwres_packet.html,v 1.8.2.1.4.2 2004/08/22 23:39:05 marka Exp $ -->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<HTML
-><HEAD
-><TITLE
->lwres_packet</TITLE
-><META
-NAME="GENERATOR"
-CONTENT="Modular DocBook HTML Stylesheet Version 1.7"></HEAD
-><BODY
-CLASS="REFENTRY"
-BGCOLOR="#FFFFFF"
-TEXT="#000000"
-LINK="#0000FF"
-VLINK="#840084"
-ALINK="#0000FF"
-><H1
-><A
-NAME="AEN1"
-></A
->lwres_packet</H1
-><DIV
-CLASS="REFNAMEDIV"
-><A
-NAME="AEN8"
-></A
-><H2
->Name</H2
->lwres_lwpacket_renderheader, lwres_lwpacket_parseheader&nbsp;--&nbsp;lightweight resolver packet handling functions</DIV
-><DIV
-CLASS="REFSYNOPSISDIV"
-><A
-NAME="AEN12"
-></A
-><H2
->Synopsis</H2
-><DIV
-CLASS="FUNCSYNOPSIS"
-><P
-></P
-><A
-NAME="AEN13"
-></A
-><PRE
-CLASS="FUNCSYNOPSISINFO"
->#include &lt;lwres/lwpacket.h&gt;</PRE
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->lwres_result_t
-lwres_lwpacket_renderheader</CODE
->(lwres_buffer_t *b, lwres_lwpacket_t *pkt);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->lwres_result_t
-lwres_lwpacket_parseheader</CODE
->(lwres_buffer_t *b, lwres_lwpacket_t *pkt);</CODE
-></P
-><P
-></P
-></DIV
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN25"
-></A
-><H2
->DESCRIPTION</H2
-><P
->These functions rely on a
-<SPAN
-CLASS="TYPE"
->struct lwres_lwpacket</SPAN
->
+<!-- $Id: lwres_packet.html,v 1.8.2.1.4.7 2005/07/18 02:36:54 marka Exp $ -->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>lwres_packet</title>
+<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
+<a name="id2456972"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2>Name</h2>
+<p>lwres_lwpacket_renderheader, lwres_lwpacket_parseheader &#8212; lightweight resolver packet handling functions</p>
+</div>
+<div class="refsynopsisdiv">
+<h2>Synopsis</h2>
+<div class="funcsynopsis">
+<pre class="funcsynopsisinfo">#include &lt;lwres/lwpacket.h&gt;</pre>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+lwres_result_t
+<b class="fsfunc">lwres_lwpacket_renderheader</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0">
+<tr>
+<td><code class="funcdef">
+lwres_result_t
+<b class="fsfunc">lwres_lwpacket_parseheader</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+</div>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514548"></a><h2>DESCRIPTION</h2>
+<p>
+These functions rely on a
+<span class="type">struct lwres_lwpacket</span>
which is defined in
-<TT
-CLASS="FILENAME"
->lwres/lwpacket.h</TT
->.
+<code class="filename">lwres/lwpacket.h</code>.
-<PRE
-CLASS="PROGRAMLISTING"
->typedef struct lwres_lwpacket lwres_lwpacket_t;
+</p>
+<pre class="programlisting">
+typedef struct lwres_lwpacket lwres_lwpacket_t;
struct lwres_lwpacket {
lwres_uint32_t length;
@@ -115,248 +85,132 @@ struct lwres_lwpacket {
lwres_uint32_t recvlength;
lwres_uint16_t authtype;
lwres_uint16_t authlength;
-};</PRE
-></P
-><P
->The elements of this structure are:
-<P
-></P
-><DIV
-CLASS="VARIABLELIST"
-><DL
-><DT
-><CODE
-CLASS="CONSTANT"
->length</CODE
-></DT
-><DD
-><P
->the overall packet length, including the entire packet header.
+};
+</pre>
+<p>
+</p>
+<p>
+The elements of this structure are:
+</p>
+<div class="variablelist"><dl>
+<dt><span class="term"><code class="constant">length</code></span></dt>
+<dd><p>
+the overall packet length, including the entire packet header.
This field is filled in by the lwres_gabn_*() and lwres_gnba_*()
-calls.</P
-></DD
-><DT
-><CODE
-CLASS="CONSTANT"
->version</CODE
-></DT
-><DD
-><P
->the header format. There is currently only one format,
-<SPAN
-CLASS="TYPE"
->LWRES_LWPACKETVERSION_0</SPAN
->.
+calls.
+</p></dd>
+<dt><span class="term"><code class="constant">version</code></span></dt>
+<dd><p>
+the header format. There is currently only one format,
+<span class="type">LWRES_LWPACKETVERSION_0</span>.
This field is filled in by the lwres_gabn_*() and lwres_gnba_*()
-calls.</P
-></DD
-><DT
-><CODE
-CLASS="CONSTANT"
->pktflags</CODE
-></DT
-><DD
-><P
->library-defined flags for this packet: for instance whether the packet
+calls.
+</p></dd>
+<dt><span class="term"><code class="constant">pktflags</code></span></dt>
+<dd><p>
+library-defined flags for this packet: for instance whether the packet
is a request or a reply. Flag values can be set, but not defined by
the caller.
This field is filled in by the application wit the exception of the
LWRES_LWPACKETFLAG_RESPONSE bit, which is set by the library in the
-lwres_gabn_*() and lwres_gnba_*() calls.</P
-></DD
-><DT
-><CODE
-CLASS="CONSTANT"
->serial</CODE
-></DT
-><DD
-><P
->is set by the requestor and is returned in all replies. If two or more
+lwres_gabn_*() and lwres_gnba_*() calls.
+</p></dd>
+<dt><span class="term"><code class="constant">serial</code></span></dt>
+<dd><p>
+is set by the requestor and is returned in all replies. If two or more
packets from the same source have the same serial number and are from
the same source, they are assumed to be duplicates and the latter ones
may be dropped.
-This field must be set by the application.</P
-></DD
-><DT
-><CODE
-CLASS="CONSTANT"
->opcode</CODE
-></DT
-><DD
-><P
->indicates the operation.
+This field must be set by the application.
+</p></dd>
+<dt><span class="term"><code class="constant">opcode</code></span></dt>
+<dd><p>
+indicates the operation.
Opcodes between 0x00000000 and 0x03ffffff are
reserved for use by the lightweight resolver library. Opcodes between
0x04000000 and 0xffffffff are application defined.
This field is filled in by the lwres_gabn_*() and lwres_gnba_*()
-calls.</P
-></DD
-><DT
-><CODE
-CLASS="CONSTANT"
->result</CODE
-></DT
-><DD
-><P
->is only valid for replies.
+calls.
+</p></dd>
+<dt><span class="term"><code class="constant">result</code></span></dt>
+<dd><p>
+is only valid for replies.
Results between 0x04000000 and 0xffffffff are application defined.
Results between 0x00000000 and 0x03ffffff are reserved for library use.
This field is filled in by the lwres_gabn_*() and lwres_gnba_*()
-calls.</P
-></DD
-><DT
-><CODE
-CLASS="CONSTANT"
->recvlength</CODE
-></DT
-><DD
-><P
->is the maximum buffer size that the receiver can handle on requests
+calls.
+</p></dd>
+<dt><span class="term"><code class="constant">recvlength</code></span></dt>
+<dd><p>
+is the maximum buffer size that the receiver can handle on requests
and the size of the buffer needed to satisfy a request when the buffer
is too large for replies.
-This field is supplied by the application.</P
-></DD
-><DT
-><CODE
-CLASS="CONSTANT"
->authtype</CODE
-></DT
-><DD
-><P
->defines the packet level authentication that is used.
+This field is supplied by the application.
+</p></dd>
+<dt><span class="term"><code class="constant">authtype</code></span></dt>
+<dd><p>
+defines the packet level authentication that is used.
Authorisation types between 0x1000 and 0xffff are application defined
and types between 0x0000 and 0x0fff are reserved for library use.
-Currently these are not used and must be zero.</P
-></DD
-><DT
-><CODE
-CLASS="CONSTANT"
->authlen</CODE
-></DT
-><DD
-><P
->gives the length of the authentication data.
-Since packet authentication is currently not used, this must be zero.</P
-></DD
-></DL
-></DIV
-></P
-><P
->The following opcodes are currently defined:
-<P
-></P
-><DIV
-CLASS="VARIABLELIST"
-><DL
-><DT
-><CODE
-CLASS="CONSTANT"
->NOOP</CODE
-></DT
-><DD
-><P
->Success is always returned and the packet contents are echoed.
-The lwres_noop_*() functions should be used for this type.</P
-></DD
-><DT
-><CODE
-CLASS="CONSTANT"
->GETADDRSBYNAME</CODE
-></DT
-><DD
-><P
->returns all known addresses for a given name.
-The lwres_gabn_*() functions should be used for this type.</P
-></DD
-><DT
-><CODE
-CLASS="CONSTANT"
->GETNAMEBYADDR</CODE
-></DT
-><DD
-><P
->return the hostname for the given address.
-The lwres_gnba_*() functions should be used for this type.</P
-></DD
-></DL
-></DIV
-></P
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_lwpacket_renderheader()</CODE
-> transfers the
+Currently these are not used and must be zero.
+</p></dd>
+<dt><span class="term"><code class="constant">authlen</code></span></dt>
+<dd><p>
+gives the length of the authentication data.
+Since packet authentication is currently not used, this must be zero.
+</p></dd>
+</dl></div>
+<p>
+</p>
+<p>
+The following opcodes are currently defined:
+</p>
+<div class="variablelist"><dl>
+<dt><span class="term"><code class="constant">NOOP</code></span></dt>
+<dd><p>
+Success is always returned and the packet contents are echoed.
+The lwres_noop_*() functions should be used for this type.
+</p></dd>
+<dt><span class="term"><code class="constant">GETADDRSBYNAME</code></span></dt>
+<dd><p>
+returns all known addresses for a given name.
+The lwres_gabn_*() functions should be used for this type.
+</p></dd>
+<dt><span class="term"><code class="constant">GETNAMEBYADDR</code></span></dt>
+<dd><p>
+return the hostname for the given address.
+The lwres_gnba_*() functions should be used for this type.
+</p></dd>
+</dl></div>
+<p>
+</p>
+<p>
+<code class="function">lwres_lwpacket_renderheader()</code> transfers the
contents of lightweight resolver packet structure
-<SPAN
-CLASS="TYPE"
->lwres_lwpacket_t</SPAN
-> <VAR
-CLASS="PARAMETER"
->*pkt</VAR
-> in network
+<span class="type">lwres_lwpacket_t</span> <em class="parameter"><code>*pkt</code></em> in network
byte order to the lightweight resolver buffer,
-<VAR
-CLASS="PARAMETER"
->*b</VAR
->.</P
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_lwpacket_parseheader()</CODE
-> performs the
+<em class="parameter"><code>*b</code></em>.
+</p>
+<p>
+<code class="function">lwres_lwpacket_parseheader()</code> performs the
converse operation. It transfers data in network byte order from
-buffer <VAR
-CLASS="PARAMETER"
->*b</VAR
-> to resolver packet
-<VAR
-CLASS="PARAMETER"
->*pkt</VAR
->. The contents of the buffer
-<VAR
-CLASS="PARAMETER"
->b</VAR
-> should correspond to a
-<SPAN
-CLASS="TYPE"
->lwres_lwpacket_t</SPAN
->.</P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN107"
-></A
-><H2
->RETURN VALUES</H2
-><P
-> Successful calls to
-<CODE
-CLASS="FUNCTION"
->lwres_lwpacket_renderheader()</CODE
-> and
-<CODE
-CLASS="FUNCTION"
->lwres_lwpacket_parseheader()</CODE
-> return
-<SPAN
-CLASS="ERRORCODE"
->LWRES_R_SUCCESS</SPAN
->. If there is insufficient
-space to copy data between the buffer <VAR
-CLASS="PARAMETER"
->*b</VAR
-> and
-lightweight resolver packet <VAR
-CLASS="PARAMETER"
->*pkt</VAR
-> both functions
-return <SPAN
-CLASS="ERRORCODE"
->LWRES_R_UNEXPECTEDEND</SPAN
->.</P
-></DIV
-></BODY
-></HTML
->
+buffer <em class="parameter"><code>*b</code></em> to resolver packet
+<em class="parameter"><code>*pkt</code></em>. The contents of the buffer
+<em class="parameter"><code>b</code></em> should correspond to a
+<span class="type">lwres_lwpacket_t</span>.
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514955"></a><h2>RETURN VALUES</h2>
+<p> Successful calls to
+<code class="function">lwres_lwpacket_renderheader()</code> and
+<code class="function">lwres_lwpacket_parseheader()</code> return
+<span class="errorcode">LWRES_R_SUCCESS</span>. If there is insufficient
+space to copy data between the buffer <em class="parameter"><code>*b</code></em> and
+lightweight resolver packet <em class="parameter"><code>*pkt</code></em> both functions
+return <span class="errorcode">LWRES_R_UNEXPECTEDEND</span>.
+</p>
+</div>
+</div></body>
+</html>
diff --git a/lib/lwres/man/lwres_resutil.3 b/lib/lwres/man/lwres_resutil.3
index d73122d3..82800b59 100644
--- a/lib/lwres/man/lwres_resutil.3
+++ b/lib/lwres/man/lwres_resutil.3
@@ -1,76 +1,63 @@
-.\" Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
-.\" Copyright (C) 2000, 2001 Internet Software Consortium.
-.\"
+.\" Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+.\" Copyright (C) 2000, 2001 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,
+.\" 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: lwres_resutil.3,v 1.14.2.1.8.1 2004/03/06 07:41:44 marka Exp $
+.\" $Id: lwres_resutil.3,v 1.14.2.1.8.4 2005/09/12 00:47:29 marka Exp $
.\"
-.TH "LWRES_RESUTIL" "3" "Jun 30, 2000" "BIND9" ""
+.hy 0
+.ad l
+.\"Generated by db2man.xsl. Don't modify this, modify the source.
+.de Sh \" Subsection
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Ip \" List item
+.br
+.ie \\n(.$>=3 .ne \\$3
+.el .ne 3
+.IP "\\$1" \\$2
+..
+.TH "LWRES_RESUTIL" 3 "Jun 30, 2000" "" ""
.SH NAME
lwres_string_parse, lwres_addr_parse, lwres_getaddrsbyname, lwres_getnamebyaddr \- lightweight resolver utility functions
-.SH SYNOPSIS
-\fB#include <lwres/lwres.h>
-.sp
-.na
-lwres_result_t
-lwres_string_parse(lwres_buffer_t *b, char **c, lwres_uint16_t *len);
-.ad
-.sp
-.na
-lwres_result_t
-lwres_addr_parse(lwres_buffer_t *b, lwres_addr_t *addr);
-.ad
-.sp
-.na
-lwres_result_t
-lwres_getaddrsbyname(lwres_context_t *ctx, const char *name, lwres_uint32_t addrtypes, lwres_gabnresponse_t **structp);
-.ad
-.sp
-.na
-lwres_result_t
-lwres_getnamebyaddr(lwres_context_t *ctx, lwres_uint32_t addrtype, lwres_uint16_t addrlen, const unsigned char *addr, lwres_gnbaresponse_t **structp);
-.ad
-\fR
+.SH "SYNOPSIS"
+.nf
+#include <lwres/lwres\&.h>
+.fi
+.HP 35
+lwres_result_t\ \fBlwres_string_parse\fR\ (lwres_buffer_t\ *b, char\ **c, lwres_uint16_t\ *len);
+.HP 33
+lwres_result_t\ \fBlwres_addr_parse\fR\ (lwres_buffer_t\ *b, lwres_addr_t\ *addr);
+.HP 37
+lwres_result_t\ \fBlwres_getaddrsbyname\fR\ (lwres_context_t\ *ctx, const\ char\ *name, lwres_uint32_t\ addrtypes, lwres_gabnresponse_t\ **structp);
+.HP 36
+lwres_result_t\ \fBlwres_getnamebyaddr\fR\ (lwres_context_t\ *ctx, lwres_uint32_t\ addrtype, lwres_uint16_t\ addrlen, const\ unsigned\ char\ *addr, lwres_gnbaresponse_t\ **structp);
.SH "DESCRIPTION"
.PP
-\fBlwres_string_parse()\fR retrieves a DNS-encoded
-string starting the current pointer of lightweight resolver buffer
-\fIb\fR: i.e. b->current.
-When the function returns, the address of the first byte of the
-encoded string is returned via \fI*c\fR and the
-length of that string is given by \fI*len\fR. The
-buffer's current pointer is advanced to point at the character
-following the string length, the encoded string, and the trailing
-\fBNULL\fR character.
+ \fBlwres_string_parse()\fR retrieves a DNS\-encoded string starting the current pointer of lightweight resolver buffer \fIb\fR: i\&.e\&. \fBb\->current\fR\&. When the function returns, the address of the first byte of the encoded string is returned via \fI*c\fR and the length of that string is given by \fI*len\fR\&. The buffer's current pointer is advanced to point at the character following the string length, the encoded string, and the trailing \fBNULL\fR character\&.
.PP
-\fBlwres_addr_parse()\fR extracts an address from the
-buffer \fIb\fR. The buffer's current pointer
-b->current is presumed to point at an encoded
-address: the address preceded by a 32-bit protocol family identifier
-and a 16-bit length field. The encoded address is copied to
-addr->address and
-addr->length indicates the size in bytes of
-the address that was copied. b->current is
-advanced to point at the next byte of available data in the buffer
-following the encoded address.
+ \fBlwres_addr_parse()\fR extracts an address from the buffer \fIb\fR\&. The buffer's current pointer \fBb\->current\fR is presumed to point at an encoded address: the address preceded by a 32\-bit protocol family identifier and a 16\-bit length field\&. The encoded address is copied to \fBaddr\->address\fR and \fBaddr\->length\fR indicates the size in bytes of the address that was copied\&. \fBb\->current\fR is advanced to point at the next byte of available data in the buffer following the encoded address\&.
.PP
-\fBlwres_getaddrsbyname()\fR
-and
-\fBlwres_getnamebyaddr()\fR
-use the
-\fBlwres_gnbaresponse_t\fR
-structure defined below:
-.sp
+ \fBlwres_getaddrsbyname()\fR and \fBlwres_getnamebyaddr()\fR use the \fBlwres_gnbaresponse_t\fR structure defined below:
.nf
typedef struct {
lwres_uint32_t flags;
@@ -84,70 +71,21 @@ typedef struct {
void *base;
size_t baselen;
} lwres_gabnresponse_t;
-.sp
.fi
-The contents of this structure are not manipulated directly but
-they are controlled through the
-\fBlwres_gabn\fR(3)
-functions.
+ The contents of this structure are not manipulated directly but they are controlled through the \fBlwres_gabn\fR(3 ) functions\&.
.PP
-The lightweight resolver uses
-\fBlwres_getaddrsbyname()\fR to perform foward lookups.
-Hostname \fIname\fR is looked up using the resolver
-context \fIctx\fR for memory allocation.
-\fIaddrtypes\fR is a bitmask indicating which type of
-addresses are to be looked up. Current values for this bitmask are
-\fBLWRES_ADDRTYPE_V4\fR for IPv4 addresses and
-\fBLWRES_ADDRTYPE_V6\fR for IPv6 addresses. Results of the
-lookup are returned in \fI*structp\fR.
+The lightweight resolver uses \fBlwres_getaddrsbyname()\fR to perform foward lookups\&. Hostname \fIname\fR is looked up using the resolver context \fIctx\fR for memory allocation\&. \fIaddrtypes\fR is a bitmask indicating which type of addresses are to be looked up\&. Current values for this bitmask are \fBLWRES_ADDRTYPE_V4\fR for IPv4 addresses and \fBLWRES_ADDRTYPE_V6\fR for IPv6 addresses\&. Results of the lookup are returned in \fI*structp\fR\&.
.PP
-\fBlwres_getnamebyaddr()\fR performs reverse lookups.
-Resolver context \fIctx\fR is used for memory
-allocation. The address type is indicated by
-\fIaddrtype\fR: \fBLWRES_ADDRTYPE_V4\fR or
-\fBLWRES_ADDRTYPE_V6\fR. The address to be looked up is given
-by \fIaddr\fR and its length is
-\fIaddrlen\fR bytes. The result of the function call
-is made available through \fI*structp\fR.
+ \fBlwres_getnamebyaddr()\fR performs reverse lookups\&. Resolver context \fIctx\fR is used for memory allocation\&. The address type is indicated by \fIaddrtype\fR: \fBLWRES_ADDRTYPE_V4\fR or \fBLWRES_ADDRTYPE_V6\fR\&. The address to be looked up is given by \fIaddr\fR and its length is \fIaddrlen\fR bytes\&. The result of the function call is made available through \fI*structp\fR\&.
.SH "RETURN VALUES"
.PP
-Successful calls to
-\fBlwres_string_parse()\fR
-and
-\fBlwres_addr_parse()\fR
-return
-LWRES_R_SUCCESS.
-Both functions return
-LWRES_R_FAILURE
-if the buffer is corrupt or
-LWRES_R_UNEXPECTEDEND
-if the buffer has less space than expected for the components of the
-encoded string or address.
+Successful calls to \fBlwres_string_parse()\fR and \fBlwres_addr_parse()\fR return \fBLWRES_R_SUCCESS\&.\fR Both functions return \fBLWRES_R_FAILURE\fR if the buffer is corrupt or \fBLWRES_R_UNEXPECTEDEND\fR if the buffer has less space than expected for the components of the encoded string or address\&.
.PP
-\fBlwres_getaddrsbyname()\fR
-returns
-LWRES_R_SUCCESS
-on success and it returns
-LWRES_R_NOTFOUND
-if the hostname
-\fIname\fR
-could not be found.
+ \fBlwres_getaddrsbyname()\fR returns \fBLWRES_R_SUCCESS\fR on success and it returns \fBLWRES_R_NOTFOUND\fR if the hostname \fIname\fR could not be found\&.
.PP
-LWRES_R_SUCCESS
-is returned by a successful call to
-\fBlwres_getnamebyaddr()\fR.
+ \fBLWRES_R_SUCCESS\fR is returned by a successful call to \fBlwres_getnamebyaddr()\fR\&.
.PP
-Both
-\fBlwres_getaddrsbyname()\fR
-and
-\fBlwres_getnamebyaddr()\fR
-return
-LWRES_R_NOMEMORY
-when memory allocation requests fail and
-LWRES_R_UNEXPECTEDEND
-if the buffers used for sending queries and receiving replies are too
-small.
+Both \fBlwres_getaddrsbyname()\fR and \fBlwres_getnamebyaddr()\fR return \fBLWRES_R_NOMEMORY\fR when memory allocation requests fail and \fBLWRES_R_UNEXPECTEDEND\fR if the buffers used for sending queries and receiving replies are too small\&.
.SH "SEE ALSO"
.PP
-\fBlwres_buffer\fR(3),
-\fBlwres_gabn\fR(3).
+ \fBlwres_buffer\fR(3), \fBlwres_gabn\fR(3)\&.
diff --git a/lib/lwres/man/lwres_resutil.docbook b/lib/lwres/man/lwres_resutil.docbook
index e5f891fa..7ab2146b 100644
--- a/lib/lwres/man/lwres_resutil.docbook
+++ b/lib/lwres/man/lwres_resutil.docbook
@@ -1,7 +1,9 @@
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.0//EN"
+ "http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd"
+ [<!ENTITY mdash "&#8212;">]>
<!--
- - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- - Copyright (C) 2001 Internet Software Consortium.
+ - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2000, 2001 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
@@ -16,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: lwres_resutil.docbook,v 1.5.206.1 2004/03/06 08:15:42 marka Exp $ -->
+<!-- $Id: lwres_resutil.docbook,v 1.5.206.3 2005/05/12 21:36:16 sra Exp $ -->
<refentry>
@@ -30,6 +32,19 @@
<refmiscinfo>BIND9</refmiscinfo>
</refmeta>
+ <docinfo>
+ <copyright>
+ <year>2004</year>
+ <year>2005</year>
+ <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
+ </copyright>
+ <copyright>
+ <year>2000</year>
+ <year>2001</year>
+ <holder>Internet Software Consortium.</holder>
+ </copyright>
+ </docinfo>
+
<refnamediv>
<refname>lwres_string_parse</refname>
<refname>lwres_addr_parse</refname>
diff --git a/lib/lwres/man/lwres_resutil.html b/lib/lwres/man/lwres_resutil.html
index cc45556a..d34a6a4e 100644
--- a/lib/lwres/man/lwres_resutil.html
+++ b/lib/lwres/man/lwres_resutil.html
@@ -1,186 +1,163 @@
<!--
- - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- - Copyright (C) 2001 Internet Software Consortium.
- -
+ - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2000, 2001 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,
+ - 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: lwres_resutil.html,v 1.8.2.1.4.2 2004/08/22 23:39:05 marka Exp $ -->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<HTML
-><HEAD
-><TITLE
->lwres_resutil</TITLE
-><META
-NAME="GENERATOR"
-CONTENT="Modular DocBook HTML Stylesheet Version 1.7"></HEAD
-><BODY
-CLASS="REFENTRY"
-BGCOLOR="#FFFFFF"
-TEXT="#000000"
-LINK="#0000FF"
-VLINK="#840084"
-ALINK="#0000FF"
-><H1
-><A
-NAME="AEN1"
-></A
->lwres_resutil</H1
-><DIV
-CLASS="REFNAMEDIV"
-><A
-NAME="AEN8"
-></A
-><H2
->Name</H2
->lwres_string_parse, lwres_addr_parse, lwres_getaddrsbyname, lwres_getnamebyaddr&nbsp;--&nbsp;lightweight resolver utility functions</DIV
-><DIV
-CLASS="REFSYNOPSISDIV"
-><A
-NAME="AEN14"
-></A
-><H2
->Synopsis</H2
-><DIV
-CLASS="FUNCSYNOPSIS"
-><P
-></P
-><A
-NAME="AEN15"
-></A
-><PRE
-CLASS="FUNCSYNOPSISINFO"
->#include &lt;lwres/lwres.h&gt;</PRE
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->lwres_result_t
-lwres_string_parse</CODE
->(lwres_buffer_t *b, char **c, lwres_uint16_t *len);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->lwres_result_t
-lwres_addr_parse</CODE
->(lwres_buffer_t *b, lwres_addr_t *addr);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->lwres_result_t
-lwres_getaddrsbyname</CODE
->(lwres_context_t *ctx, const char *name, lwres_uint32_t addrtypes, lwres_gabnresponse_t **structp);</CODE
-></P
-><P
-><CODE
-><CODE
-CLASS="FUNCDEF"
->lwres_result_t
-lwres_getnamebyaddr</CODE
->(lwres_context_t *ctx, lwres_uint32_t addrtype, lwres_uint16_t addrlen, const unsigned char *addr, lwres_gnbaresponse_t **structp);</CODE
-></P
-><P
-></P
-></DIV
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN43"
-></A
-><H2
->DESCRIPTION</H2
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_string_parse()</CODE
-> retrieves a DNS-encoded
+<!-- $Id: lwres_resutil.html,v 1.8.2.1.4.7 2005/07/18 02:36:54 marka Exp $ -->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>lwres_resutil</title>
+<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
+<a name="id2456972"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2>Name</h2>
+<p>lwres_string_parse, lwres_addr_parse, lwres_getaddrsbyname, lwres_getnamebyaddr &#8212; lightweight resolver utility functions</p>
+</div>
+<div class="refsynopsisdiv">
+<h2>Synopsis</h2>
+<div class="funcsynopsis">
+<pre class="funcsynopsisinfo">#include &lt;lwres/lwres.h&gt;</pre>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+lwres_result_t
+<b class="fsfunc">lwres_string_parse</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+lwres_result_t
+<b class="fsfunc">lwres_addr_parse</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
+<td><code class="funcdef">
+lwres_result_t
+<b class="fsfunc">lwres_getaddrsbyname</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0">
+<tr>
+<td><code class="funcdef">
+lwres_result_t
+<b class="fsfunc">lwres_getnamebyaddr</b>(</code></td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+</div>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514603"></a><h2>DESCRIPTION</h2>
+<p>
+<code class="function">lwres_string_parse()</code> retrieves a DNS-encoded
string starting the current pointer of lightweight resolver buffer
-<VAR
-CLASS="PARAMETER"
->b</VAR
->: i.e. <CODE
-CLASS="CONSTANT"
->b-&gt;current</CODE
->.
+<em class="parameter"><code>b</code></em>: i.e. <code class="constant">b-&gt;current</code>.
When the function returns, the address of the first byte of the
-encoded string is returned via <VAR
-CLASS="PARAMETER"
->*c</VAR
-> and the
-length of that string is given by <VAR
-CLASS="PARAMETER"
->*len</VAR
->. The
+encoded string is returned via <em class="parameter"><code>*c</code></em> and the
+length of that string is given by <em class="parameter"><code>*len</code></em>. The
buffer's current pointer is advanced to point at the character
following the string length, the encoded string, and the trailing
-<SPAN
-CLASS="TYPE"
->NULL</SPAN
-> character.</P
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_addr_parse()</CODE
-> extracts an address from the
-buffer <VAR
-CLASS="PARAMETER"
->b</VAR
->. The buffer's current pointer
-<CODE
-CLASS="CONSTANT"
->b-&gt;current</CODE
-> is presumed to point at an encoded
+<span class="type">NULL</span> character.
+</p>
+<p>
+<code class="function">lwres_addr_parse()</code> extracts an address from the
+buffer <em class="parameter"><code>b</code></em>. The buffer's current pointer
+<code class="constant">b-&gt;current</code> is presumed to point at an encoded
address: the address preceded by a 32-bit protocol family identifier
and a 16-bit length field. The encoded address is copied to
-<CODE
-CLASS="CONSTANT"
->addr-&gt;address</CODE
-> and
-<CODE
-CLASS="CONSTANT"
->addr-&gt;length</CODE
-> indicates the size in bytes of
-the address that was copied. <CODE
-CLASS="CONSTANT"
->b-&gt;current</CODE
-> is
+<code class="constant">addr-&gt;address</code> and
+<code class="constant">addr-&gt;length</code> indicates the size in bytes of
+the address that was copied. <code class="constant">b-&gt;current</code> is
advanced to point at the next byte of available data in the buffer
-following the encoded address.</P
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_getaddrsbyname()</CODE
->
+following the encoded address.
+</p>
+<p>
+<code class="function">lwres_getaddrsbyname()</code>
and
-<CODE
-CLASS="FUNCTION"
->lwres_getnamebyaddr()</CODE
->
+<code class="function">lwres_getnamebyaddr()</code>
use the
-<SPAN
-CLASS="TYPE"
->lwres_gnbaresponse_t</SPAN
->
+<span class="type">lwres_gnbaresponse_t</span>
structure defined below:
-<PRE
-CLASS="PROGRAMLISTING"
->typedef struct {
+</p>
+<pre class="programlisting">
+typedef struct {
lwres_uint32_t flags;
lwres_uint16_t naliases;
lwres_uint16_t naddrs;
@@ -191,197 +168,88 @@ CLASS="PROGRAMLISTING"
lwres_addrlist_t addrs;
void *base;
size_t baselen;
-} lwres_gabnresponse_t;</PRE
->
+} lwres_gabnresponse_t;
+</pre>
+<p>
The contents of this structure are not manipulated directly but
they are controlled through the
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->lwres_gabn</SPAN
->(3)</SPAN
->
-functions.</P
-><P
->The lightweight resolver uses
-<CODE
-CLASS="FUNCTION"
->lwres_getaddrsbyname()</CODE
-> to perform foward lookups.
-Hostname <VAR
-CLASS="PARAMETER"
->name</VAR
-> is looked up using the resolver
-context <VAR
-CLASS="PARAMETER"
->ctx</VAR
-> for memory allocation.
-<VAR
-CLASS="PARAMETER"
->addrtypes</VAR
-> is a bitmask indicating which type of
+<span class="citerefentry"><span class="refentrytitle">lwres_gabn</span>(3
+)</span>
+functions.
+</p>
+<p>
+The lightweight resolver uses
+<code class="function">lwres_getaddrsbyname()</code> to perform foward lookups.
+Hostname <em class="parameter"><code>name</code></em> is looked up using the resolver
+context <em class="parameter"><code>ctx</code></em> for memory allocation.
+<em class="parameter"><code>addrtypes</code></em> is a bitmask indicating which type of
addresses are to be looked up. Current values for this bitmask are
-<SPAN
-CLASS="TYPE"
->LWRES_ADDRTYPE_V4</SPAN
-> for IPv4 addresses and
-<SPAN
-CLASS="TYPE"
->LWRES_ADDRTYPE_V6</SPAN
-> for IPv6 addresses. Results of the
-lookup are returned in <VAR
-CLASS="PARAMETER"
->*structp</VAR
->.</P
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_getnamebyaddr()</CODE
-> performs reverse lookups.
-Resolver context <VAR
-CLASS="PARAMETER"
->ctx</VAR
-> is used for memory
+<span class="type">LWRES_ADDRTYPE_V4</span> for IPv4 addresses and
+<span class="type">LWRES_ADDRTYPE_V6</span> for IPv6 addresses. Results of the
+lookup are returned in <em class="parameter"><code>*structp</code></em>.
+</p>
+<p>
+<code class="function">lwres_getnamebyaddr()</code> performs reverse lookups.
+Resolver context <em class="parameter"><code>ctx</code></em> is used for memory
allocation. The address type is indicated by
-<VAR
-CLASS="PARAMETER"
->addrtype</VAR
->: <SPAN
-CLASS="TYPE"
->LWRES_ADDRTYPE_V4</SPAN
-> or
-<SPAN
-CLASS="TYPE"
->LWRES_ADDRTYPE_V6</SPAN
->. The address to be looked up is given
-by <VAR
-CLASS="PARAMETER"
->addr</VAR
-> and its length is
-<VAR
-CLASS="PARAMETER"
->addrlen</VAR
-> bytes. The result of the function call
-is made available through <VAR
-CLASS="PARAMETER"
->*structp</VAR
->.</P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN84"
-></A
-><H2
->RETURN VALUES</H2
-><P
->Successful calls to
-<CODE
-CLASS="FUNCTION"
->lwres_string_parse()</CODE
->
+<em class="parameter"><code>addrtype</code></em>: <span class="type">LWRES_ADDRTYPE_V4</span> or
+<span class="type">LWRES_ADDRTYPE_V6</span>. The address to be looked up is given
+by <em class="parameter"><code>addr</code></em> and its length is
+<em class="parameter"><code>addrlen</code></em> bytes. The result of the function call
+is made available through <em class="parameter"><code>*structp</code></em>.
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514880"></a><h2>RETURN VALUES</h2>
+<p>
+Successful calls to
+<code class="function">lwres_string_parse()</code>
and
-<CODE
-CLASS="FUNCTION"
->lwres_addr_parse()</CODE
->
+<code class="function">lwres_addr_parse()</code>
return
-<SPAN
-CLASS="ERRORCODE"
->LWRES_R_SUCCESS.</SPAN
->
+<span class="errorcode">LWRES_R_SUCCESS.</span>
Both functions return
-<SPAN
-CLASS="ERRORCODE"
->LWRES_R_FAILURE</SPAN
->
+<span class="errorcode">LWRES_R_FAILURE</span>
if the buffer is corrupt or
-<SPAN
-CLASS="ERRORCODE"
->LWRES_R_UNEXPECTEDEND</SPAN
->
+<span class="errorcode">LWRES_R_UNEXPECTEDEND</span>
if the buffer has less space than expected for the components of the
-encoded string or address.</P
-><P
-><CODE
-CLASS="FUNCTION"
->lwres_getaddrsbyname()</CODE
->
+encoded string or address.
+</p>
+<p>
+<code class="function">lwres_getaddrsbyname()</code>
returns
-<SPAN
-CLASS="ERRORCODE"
->LWRES_R_SUCCESS</SPAN
->
+<span class="errorcode">LWRES_R_SUCCESS</span>
on success and it returns
-<SPAN
-CLASS="ERRORCODE"
->LWRES_R_NOTFOUND</SPAN
->
+<span class="errorcode">LWRES_R_NOTFOUND</span>
if the hostname
-<VAR
-CLASS="PARAMETER"
->name</VAR
->
-could not be found.</P
-><P
-><SPAN
-CLASS="ERRORCODE"
->LWRES_R_SUCCESS</SPAN
->
+<em class="parameter"><code>name</code></em>
+could not be found.
+</p>
+<p>
+<span class="errorcode">LWRES_R_SUCCESS</span>
is returned by a successful call to
-<CODE
-CLASS="FUNCTION"
->lwres_getnamebyaddr()</CODE
->.</P
-><P
->Both
-<CODE
-CLASS="FUNCTION"
->lwres_getaddrsbyname()</CODE
->
+<code class="function">lwres_getnamebyaddr()</code>.
+</p>
+<p>
+Both
+<code class="function">lwres_getaddrsbyname()</code>
and
-<CODE
-CLASS="FUNCTION"
->lwres_getnamebyaddr()</CODE
->
+<code class="function">lwres_getnamebyaddr()</code>
return
-<SPAN
-CLASS="ERRORCODE"
->LWRES_R_NOMEMORY</SPAN
->
+<span class="errorcode">LWRES_R_NOMEMORY</span>
when memory allocation requests fail and
-<SPAN
-CLASS="ERRORCODE"
->LWRES_R_UNEXPECTEDEND</SPAN
->
+<span class="errorcode">LWRES_R_UNEXPECTEDEND</span>
if the buffers used for sending queries and receiving replies are too
-small.</P
-></DIV
-><DIV
-CLASS="REFSECT1"
-><A
-NAME="AEN105"
-></A
-><H2
->SEE ALSO</H2
-><P
-><SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->lwres_buffer</SPAN
->(3)</SPAN
->,
+small.
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2514949"></a><h2>SEE ALSO</h2>
+<p>
+<span class="citerefentry"><span class="refentrytitle">lwres_buffer</span>(3)</span>,
-<SPAN
-CLASS="CITEREFENTRY"
-><SPAN
-CLASS="REFENTRYTITLE"
->lwres_gabn</SPAN
->(3)</SPAN
->.</P
-></DIV
-></BODY
-></HTML
->
+<span class="citerefentry"><span class="refentrytitle">lwres_gabn</span>(3)</span>.
+</p>
+</div>
+</div></body>
+</html>
diff --git a/lib/lwres/print.c b/lib/lwres/print.c
index e8dd37a7..9bf3f187 100644
--- a/lib/lwres/print.c
+++ b/lib/lwres/print.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2001, 2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: print.c,v 1.2.4.3 2004/09/16 07:01:13 marka Exp $ */
+/* $Id: print.c,v 1.2.4.6 2005/06/08 02:08:31 marka Exp $ */
#include <config.h>
@@ -25,11 +25,13 @@
#define LWRES__PRINT_SOURCE /* Used to get the lwres_print_* prototypes. */
-#include <stdlib.h>
+#include <lwres/stdlib.h>
#include "assert_p.h"
#include "print_p.h"
+#define LWRES_PRINT_QUADFORMAT LWRES_PLATFORM_QUADFORMAT
+
int
lwres__print_sprintf(char *str, const char *format, ...) {
va_list ap;
@@ -242,7 +244,7 @@ lwres__print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
head = "";
tmpui = tmpi;
}
- sprintf(buf, "%llu",
+ sprintf(buf, "%" LWRES_PRINT_QUADFORMAT "u",
tmpui);
goto printint;
case 'o':
@@ -254,7 +256,9 @@ lwres__print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
else
tmpui = va_arg(ap, int);
sprintf(buf,
- alt ? "%#llo" : "%llo", tmpui);
+ alt ? "%#" LWRES_PRINT_QUADFORMAT "o"
+ : "%" LWRES_PRINT_QUADFORMAT "o",
+ tmpui);
goto printint;
case 'u':
if (q)
@@ -264,7 +268,8 @@ lwres__print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
tmpui = va_arg(ap, unsigned long int);
else
tmpui = va_arg(ap, unsigned int);
- sprintf(buf, "%llu", tmpui);
+ sprintf(buf, "%" LWRES_PRINT_QUADFORMAT "u",
+ tmpui);
goto printint;
case 'x':
if (q)
@@ -279,7 +284,8 @@ lwres__print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
if (precision > 2U)
precision -= 2;
}
- sprintf(buf, "%llx", tmpui);
+ sprintf(buf, "%" LWRES_PRINT_QUADFORMAT "x",
+ tmpui);
goto printint;
case 'X':
if (q)
@@ -294,7 +300,8 @@ lwres__print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
if (precision > 2U)
precision -= 2;
}
- sprintf(buf, "%llX", tmpui);
+ sprintf(buf, "%" LWRES_PRINT_QUADFORMAT "X",
+ tmpui);
goto printint;
printint:
if (precision != 0U || width != 0U) {
diff --git a/lib/lwres/strtoul.c b/lib/lwres/strtoul.c
new file mode 100644
index 00000000..9cda1947
--- /dev/null
+++ b/lib/lwres/strtoul.c
@@ -0,0 +1,135 @@
+/*
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 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.
+ */
+
+/*
+ * 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.
+ */
+
+/*! \file */
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)strtoul.c 8.1 (Berkeley) 6/4/93";
+#endif /* LIBC_SCCS and not lint */
+
+/* $Id: strtoul.c,v 1.2.4.1 2005/06/08 02:08:31 marka Exp $ */
+
+#include <config.h>
+
+#include <limits.h>
+#include <ctype.h>
+#include <errno.h>
+
+#include <lwres/stdlib.h>
+
+#define DE_CONST(konst, var) \
+ do { \
+ union { const void *k; void *v; } _u; \
+ _u.k = konst; \
+ var = _u.v; \
+ } while (0)
+
+/*!
+ * Convert a string to an unsigned long integer.
+ *
+ * Ignores `locale' stuff. Assumes that the upper and lower case
+ * alphabets and digits are each contiguous.
+ */
+unsigned long
+lwres_strtoul(const char *nptr, char **endptr, int base) {
+ const char *s = nptr;
+ unsigned long acc;
+ unsigned char c;
+ unsigned long cutoff;
+ int neg = 0, any, cutlim;
+
+ /*
+ * See strtol for comments as to the logic used.
+ */
+ do {
+ c = *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 = (unsigned long)ULONG_MAX / (unsigned long)base;
+ cutlim = (unsigned long)ULONG_MAX % (unsigned long)base;
+ for (acc = 0, any = 0;; c = *s++) {
+ if (!isascii(c))
+ break;
+ 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);
+}
diff --git a/lib/tests/t_api.c b/lib/tests/t_api.c
index c9683063..22a0280c 100644
--- a/lib/tests/t_api.c
+++ b/lib/tests/t_api.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: t_api.c,v 1.48.2.1.2.6 2004/08/28 06:25:27 marka Exp $ */
+/* $Id: t_api.c,v 1.48.2.1.2.8 2005/06/18 01:03:24 marka Exp $ */
#include <config.h>
@@ -35,6 +35,7 @@
#include <isc/commandline.h>
#include <isc/print.h>
#include <isc/string.h>
+#include <isc/mem.h>
#include <dns/compress.h>
#include <dns/result.h>
@@ -119,6 +120,7 @@ main(int argc, char **argv) {
testspec_t *pts;
struct sigaction sa;
+ isc_mem_debugging = ISC_MEM_DEBUGRECORD;
first = ISC_TRUE;
subprocs = 1;
T_timeout = T_TCTOUT;