diff options
| author | christos <christos@NetBSD.org> | 2004-11-06 23:53:21 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2004-11-06 23:53:21 +0000 |
| commit | dfd98c8a16d53dff0d1bdca29bcddc6571054129 (patch) | |
| tree | 24f3891f470a8e79f037a71c4b43266f23767859 /dist/bind/lib | |
| parent | aefec4290d9fd9e83eaf8b2b4ada33ff37ecaedb (diff) | |
Import bind-9.3.0
Diffstat (limited to 'dist/bind/lib')
115 files changed, 3517 insertions, 2382 deletions
diff --git a/dist/bind/lib/bind/Makefile.in b/dist/bind/lib/bind/Makefile.in index 5ce2fa32c18..8d39bc5a02c 100644 --- a/dist/bind/lib/bind/Makefile.in +++ b/dist/bind/lib/bind/Makefile.in @@ -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.4 2004/03/06 08:13:21 marka Exp +# Id: Makefile.in,v 1.12.2.5.2.5 2004/07/20 07:01:56 marka Exp srcdir = @srcdir@ VPATH = @srcdir@ @@ -100,7 +100,7 @@ libbind.@SA@: ${OBJS} libbind.la: ${OBJS} ${LIBTOOL_MODE_LINK} \ - ${CC} ${ALL_CFLAGS} -o libbind.la -rpath ${libdir} \ + ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o libbind.la -rpath ${libdir} \ -version-info ${LIBINTERFACE}:${LIBREVISION}:${LIBAGE} \ ${OBJS} ${LIBS} diff --git a/dist/bind/lib/bind/api b/dist/bind/lib/bind/api index c4b9059729e..3a72afa2cde 100644 --- a/dist/bind/lib/bind/api +++ b/dist/bind/lib/bind/api @@ -1,3 +1,3 @@ LIBINTERFACE = 3 -LIBREVISION = 2 +LIBREVISION = 7 LIBAGE = 0 diff --git a/dist/bind/lib/bind/configure b/dist/bind/lib/bind/configure index dd7cddb6f34..54c6c1097b2 100644 --- a/dist/bind/lib/bind/configure +++ b/dist/bind/lib/bind/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 1.83.2.5.2.1 . +# From configure.in Revision: 1.83.2.5.2.3 . # 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 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 ISC_PLATFORM_BRACEPTHREADONCEINIT 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 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 ISC_PLATFORM_BRACEPTHREADONCEINIT BIND9_TOP_BUILDDIR BIND9_VERSION LIBOBJS LTLIBOBJS' ac_subst_files='BIND9_INCLUDES BIND9_MAKE_RULES LIBBIND_API' # Initialize some variables set by options. @@ -5716,6 +5716,104 @@ 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 + 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. */ +/* Define if_nametoindex to an innocuous variant, in case <limits.h> declares if_nametoindex. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define if_nametoindex innocuous_if_nametoindex + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char if_nametoindex (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + +#undef if_nametoindex + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char if_nametoindex (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_if_nametoindex) || defined (__stub___if_nametoindex) +choke me +#else +char (*f) () = if_nametoindex; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != if_nametoindex; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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_exeext' + { (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_func_if_nametoindex=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_if_nametoindex=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_if_nametoindex" >&5 +echo "${ECHO_T}$ac_cv_func_if_nametoindex" >&6 +if test $ac_cv_func_if_nametoindex = yes; then + USE_IFNAMELINKID="#define USE_IFNAMELINKID 1" +else + USE_IFNAMELINKID="#undef USE_IFNAMELINKID" +fi + + + ISC_THREAD_DIR=$thread_dir @@ -7197,7 +7295,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 7200 "configure"' > conftest.$ac_ext + echo '#line 7298 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -8187,7 +8285,7 @@ fi # Provide some information about the compiler. -echo "$as_me:8190:" \ +echo "$as_me:8288:" \ "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 @@ -9225,11 +9323,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:9228: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9326: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:9232: \$? = $ac_status" >&5 + echo "$as_me:9330: \$? = $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 @@ -9458,11 +9556,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:9461: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9559: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:9465: \$? = $ac_status" >&5 + echo "$as_me:9563: \$? = $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 @@ -9518,11 +9616,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:9521: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9619: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:9525: \$? = $ac_status" >&5 + echo "$as_me:9623: \$? = $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 @@ -11702,7 +11800,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 11705 "configure" +#line 11803 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11800,7 +11898,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 11803 "configure" +#line 11901 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13983,11 +14081,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:13986: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14084: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:13990: \$? = $ac_status" >&5 + echo "$as_me:14088: \$? = $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 @@ -14043,11 +14141,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:14046: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14144: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14050: \$? = $ac_status" >&5 + echo "$as_me:14148: \$? = $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 @@ -15404,7 +15502,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 15407 "configure" +#line 15505 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -15502,7 +15600,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 15505 "configure" +#line 15603 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -16329,11 +16427,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:16332: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16430: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16336: \$? = $ac_status" >&5 + echo "$as_me:16434: \$? = $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 @@ -16389,11 +16487,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:16392: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16490: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:16396: \$? = $ac_status" >&5 + echo "$as_me:16494: \$? = $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 @@ -18427,11 +18525,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:18430: $lt_compile\"" >&5) + (eval echo "\"\$as_me:18528: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:18434: \$? = $ac_status" >&5 + echo "$as_me:18532: \$? = $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 @@ -18660,11 +18758,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:18663: $lt_compile\"" >&5) + (eval echo "\"\$as_me:18761: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:18667: \$? = $ac_status" >&5 + echo "$as_me:18765: \$? = $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 @@ -18720,11 +18818,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:18723: $lt_compile\"" >&5) + (eval echo "\"\$as_me:18821: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:18727: \$? = $ac_status" >&5 + echo "$as_me:18825: \$? = $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 @@ -20904,7 +21002,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 20907 "configure" +#line 21005 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -21002,7 +21100,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 21005 "configure" +#line 21103 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -31057,6 +31155,7 @@ s,@DO_PTHREADS@,$DO_PTHREADS,;t t s,@WANT_IRS_THREADSGR_OBJS@,$WANT_IRS_THREADSGR_OBJS,;t t s,@WANT_IRS_THREADSPW_OBJS@,$WANT_IRS_THREADSPW_OBJS,;t t s,@WANT_IRS_THREADS_OBJS@,$WANT_IRS_THREADS_OBJS,;t t +s,@USE_IFNAMELINKID@,$USE_IFNAMELINKID,;t t s,@ISC_THREAD_DIR@,$ISC_THREAD_DIR,;t t s,@DAEMON_OBJS@,$DAEMON_OBJS,;t t s,@NEED_DAEMON@,$NEED_DAEMON,;t t diff --git a/dist/bind/lib/bind/configure.in b/dist/bind/lib/bind/configure.in index 16709a6c9d6..7e9d7c1c748 100644 --- a/dist/bind/lib/bind/configure.in +++ b/dist/bind/lib/bind/configure.in @@ -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.1.1.1 $) +AC_REVISION($Revision: 1.1.1.2 $) AC_INIT(resolv/herror.c) AC_PREREQ(2.13) @@ -526,6 +526,11 @@ AC_SUBST(WANT_IRS_THREADSGR_OBJS) AC_SUBST(WANT_IRS_THREADSPW_OBJS) AC_SUBST(WANT_IRS_THREADS_OBJS) +AC_CHECK_FUNC(if_nametoindex, + [USE_IFNAMELINKID="#define USE_IFNAMELINKID 1"], + [USE_IFNAMELINKID="#undef USE_IFNAMELINKID"]) +AC_SUBST(USE_IFNAMELINKID) + ISC_THREAD_DIR=$thread_dir AC_SUBST(ISC_THREAD_DIR) diff --git a/dist/bind/lib/bind/include/arpa/nameser_compat.h b/dist/bind/lib/bind/include/arpa/nameser_compat.h index 03abb91ff4b..34b4875bb7d 100644 --- a/dist/bind/lib/bind/include/arpa/nameser_compat.h +++ b/dist/bind/lib/bind/include/arpa/nameser_compat.h @@ -1,4 +1,4 @@ -/* $NetBSD: nameser_compat.h,v 1.1.1.1 2004/05/17 23:44:41 christos Exp $ */ +/* $NetBSD: nameser_compat.h,v 1.1.1.2 2004/11/06 23:55:25 christos Exp $ */ /* Copyright (c) 1983, 1989 * The Regents of the University of California. All rights reserved. @@ -34,7 +34,7 @@ /* * from nameser.h 8.1 (Berkeley) 6/2/93 - * Id: nameser_compat.h,v 1.1.2.3.4.1 2004/03/09 08:33:30 marka Exp + * Id: nameser_compat.h,v 1.1.2.3.4.2 2004/07/01 04:43:41 marka Exp */ #ifndef _ARPA_NAMESER_COMPAT_ @@ -67,7 +67,7 @@ defined(__hppa) || defined(__hp9000) || \ defined(__hp9000s300) || defined(__hp9000s700) || \ defined(__hp3000s900) || defined(__hpux) || defined(MPE) || \ - defined (BIT_ZERO_ON_LEFT) || defined(m68k) || \ + defined (BIT_ZERO_ON_LEFT) || defined(m68k) || defined(__sparc) || \ (defined(__Lynx__) && \ (defined(__68k__) || defined(__sparc__) || defined(__powerpc__))) #define BYTE_ORDER BIG_ENDIAN diff --git a/dist/bind/lib/bind/include/resolv.h b/dist/bind/lib/bind/include/resolv.h index a559b38b91c..940ef62f878 100644 --- a/dist/bind/lib/bind/include/resolv.h +++ b/dist/bind/lib/bind/include/resolv.h @@ -1,4 +1,4 @@ -/* $NetBSD: resolv.h,v 1.1.1.1 2004/05/17 23:44:41 christos Exp $ */ +/* $NetBSD: resolv.h,v 1.1.1.2 2004/11/06 23:55:25 christos Exp $ */ /* * Copyright (c) 1983, 1987, 1989 @@ -52,7 +52,7 @@ /* * @(#)resolv.h 8.1 (Berkeley) 6/2/93 - * Id: resolv.h,v 1.7.2.11.4.1 2004/03/09 08:33:29 marka Exp + * Id: resolv.h,v 1.7.2.11.4.2 2004/06/25 00:41:05 marka Exp */ #ifndef _RESOLV_H_ @@ -256,6 +256,7 @@ union res_sockaddr_union { #define RES_BLAST 0x00020000 /* blast all recursive servers */ #define RES_NOTLDQUERY 0x00100000 /* don't unqualified name as a tld */ #define RES_USE_DNSSEC 0x00200000 /* use DNSSEC using OK bit in OPT */ +/* #define RES_DEBUG2 0x00400000 */ /* nslookup internal */ /* KAME extensions: use higher bit to avoid conflict with ISC use */ #define RES_USE_DNAME 0x10000000 /* use DNAME */ #define RES_USE_EDNS0 0x40000000 /* use EDNS0 if configured */ diff --git a/dist/bind/lib/bind/irs/dns_ho.c b/dist/bind/lib/bind/irs/dns_ho.c index 554cd8a569e..eeaf984f42b 100644 --- a/dist/bind/lib/bind/irs/dns_ho.c +++ b/dist/bind/lib/bind/irs/dns_ho.c @@ -1,4 +1,4 @@ -/* $NetBSD: dns_ho.c,v 1.1.1.1 2004/05/17 23:44:42 christos Exp $ */ +/* $NetBSD: dns_ho.c,v 1.1.1.2 2004/11/06 23:55:26 christos Exp $ */ /* * Copyright (c) 1985, 1988, 1993 @@ -54,7 +54,7 @@ /* BIND Id: gethnamaddr.c,v 8.15 1996/05/22 04:56:30 vixie Exp $ */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "Id: dns_ho.c,v 1.5.2.7.4.3 2004/03/17 01:13:34 marka Exp"; +static const char rcsid[] = "Id: dns_ho.c,v 1.5.2.7.4.5 2004/08/24 00:32:15 marka Exp"; #endif /* LIBC_SCCS and not lint */ /* Imports. */ @@ -416,38 +416,44 @@ ho_byaddr(struct irs_ho *this, const void *addr, int len, int af) break; case AF_INET6: if (q->action != RESTGT_IGNORE) { + const char *nibsuff = res_get_nibblesuffix(pvt->res); qp = q->qname; for (n = IN6ADDRSZ - 1; n >= 0; n--) { i = SPRINTF((qp, "%x.%x.", uaddr[n] & 0xf, (uaddr[n] >> 4) & 0xf)); - if (i < 0) + if (i != 4) abort(); qp += i; } -#ifdef HAVE_STRLCAT - strlcat(q->qname, res_get_nibblesuffix(pvt->res), - sizeof(q->qname)); -#else - strcpy(qp, res_get_nibblesuffix(pvt->res)); -#endif + if (strlen(q->qname) + strlen(nibsuff) + 1 > + sizeof q->qname) { + errno = ENAMETOOLONG; + RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL); + hp = NULL; + goto cleanup; + } + strcpy(qp, nibsuff); /* (checked) */ } if (q2->action != RESTGT_IGNORE) { + const char *nibsuff2 = res_get_nibblesuffix2(pvt->res); qp = q2->qname; for (n = IN6ADDRSZ - 1; n >= 0; n--) { i = SPRINTF((qp, "%x.%x.", uaddr[n] & 0xf, (uaddr[n] >> 4) & 0xf)); - if (i < 0) + if (i != 4) abort(); qp += i; } -#ifdef HAVE_STRLCAT - strlcat(q->qname, res_get_nibblesuffix2(pvt->res), - sizeof(q->qname)); -#else - strcpy(qp, res_get_nibblesuffix2(pvt->res)); -#endif + if (strlen(q2->qname) + strlen(nibsuff2) + 1 > + sizeof q2->qname) { + errno = ENAMETOOLONG; + RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL); + hp = NULL; + goto cleanup; + } + strcpy(qp, nibsuff2); /* (checked) */ } break; default: @@ -822,11 +828,7 @@ gethostans(struct irs_ho *this, had_error++; continue; } -#ifdef HAVE_STRLCPY - strlcpy(bp, tbuf, ep - bp); -#else - strcpy(bp, tbuf); -#endif + strcpy(bp, tbuf); /* (checked) */ pvt->host.h_name = bp; hname = bp; bp += n; @@ -858,11 +860,7 @@ gethostans(struct irs_ho *this, had_error++; continue; } -#ifdef HAVE_STRLCPY - strlcpy(bp, tbuf, ep - bp); -#else - strcpy(bp, tbuf); -#endif + strcpy(bp, tbuf); /* (checked) */ tname = bp; bp += n; continue; @@ -998,11 +996,7 @@ gethostans(struct irs_ho *this, n = strlen(qname) + 1; /* for the \0 */ if (n > (ep - bp) || n >= MAXHOSTNAMELEN) goto no_recovery; -#ifdef HAVE_STRLCPY - strlcpy(bp, qname, ep - bp); -#else - strcpy(bp, qname); -#endif + strcpy(bp, qname); /* (checked) */ pvt->host.h_name = bp; bp += n; } diff --git a/dist/bind/lib/bind/irs/dns_nw.c b/dist/bind/lib/bind/irs/dns_nw.c index 51d775121a5..38513776d41 100644 --- a/dist/bind/lib/bind/irs/dns_nw.c +++ b/dist/bind/lib/bind/irs/dns_nw.c @@ -1,4 +1,4 @@ -/* $NetBSD: dns_nw.c,v 1.1.1.1 2004/05/17 23:44:42 christos Exp $ */ +/* $NetBSD: dns_nw.c,v 1.1.1.2 2004/11/06 23:55:26 christos Exp $ */ /* * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") @@ -18,7 +18,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "Id: dns_nw.c,v 1.3.2.4.4.2 2004/03/17 00:29:48 marka Exp"; +static const char rcsid[] = "Id: dns_nw.c,v 1.3.2.4.4.3 2004/05/17 07:48:56 marka Exp"; #endif /* LIBC_SCCS and not lint */ /* Imports. */ @@ -351,12 +351,7 @@ get1101answer(struct irs_nw *this, RES_SET_H_ERRNO(pvt->res, NO_RECOVERY); return (NULL); } -#ifdef HAVE_STRLCPY - strlcpy(bp, name, ep - bp); - pvt->net.n_name = bp; -#else - pvt->net.n_name = strcpy(bp, name); -#endif + pvt->net.n_name = strcpy(bp, name); /* (checked) */ bp += n; } break; diff --git a/dist/bind/lib/bind/irs/gen_gr.c b/dist/bind/lib/bind/irs/gen_gr.c index 0499e8e8ea4..91a305d2fb9 100644 --- a/dist/bind/lib/bind/irs/gen_gr.c +++ b/dist/bind/lib/bind/irs/gen_gr.c @@ -1,4 +1,4 @@ -/* $NetBSD: gen_gr.c,v 1.1.1.1 2004/05/17 23:44:42 christos Exp $ */ +/* $NetBSD: gen_gr.c,v 1.1.1.2 2004/11/06 23:55:26 christos Exp $ */ /* * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") @@ -18,7 +18,7 @@ */ #if !defined(LINT) && !defined(CODECENTER) -static const char rcsid[] = "Id: gen_gr.c,v 1.4.2.1.4.1 2004/03/09 08:33:35 marka Exp"; +static const char rcsid[] = "Id: gen_gr.c,v 1.4.2.1.4.2 2004/05/17 07:48:56 marka Exp"; #endif /* Imports */ @@ -85,7 +85,7 @@ static void gr_res_set(struct irs_gr *, struct __res_state *, void (*)(void *)); -static void grmerge(struct irs_gr *gr, const struct group *src, +static int grmerge(struct irs_gr *gr, const struct group *src, int preserve); static int countvec(char **vec); @@ -94,6 +94,10 @@ static int countnew(char **old, char **new); static size_t sizenew(char **old, char **new); static int newgid(int, gid_t *, gid_t); +/* Macros */ + +#define FREE_IF(x) do { if ((x) != NULL) { free(x); (x) = NULL; } } while (0) + /* Public */ struct irs_gr * @@ -173,7 +177,8 @@ gr_byname(struct irs_gr *this, const char *name) { gr = rule->inst->gr; tval = (*gr->byname)(gr, name); if (tval) { - grmerge(this, tval, dirty++); + if (!grmerge(this, tval, dirty++)) + return (NULL); if (!(rule->flags & IRS_MERGE)) break; } else { @@ -199,7 +204,8 @@ gr_bygid(struct irs_gr *this, gid_t gid) { gr = rule->inst->gr; tval = (*gr->bygid)(gr, gid); if (tval) { - grmerge(this, tval, dirty++); + if (!grmerge(this, tval, dirty++)) + return (NULL); if (!(rule->flags & IRS_MERGE)) break; } else { @@ -323,7 +329,7 @@ gr_res_set(struct irs_gr *this, struct __res_state *res, /* Private. */ -static void +static int grmerge(struct irs_gr *this, const struct group *src, int preserve) { struct pvt *pvt = (struct pvt *)this->private; char *cp, **m, **p, *oldmembuf, *ep; @@ -334,9 +340,9 @@ grmerge(struct irs_gr *this, const struct group *src, int preserve) { pvt->group.gr_gid = src->gr_gid; if (pvt->nmemb < 1) { m = malloc(sizeof *m); - if (!m) { + if (m == NULL) { /* No harm done, no work done. */ - return; + return (0); } pvt->group.gr_mem = m; pvt->nmemb = 1; @@ -353,9 +359,9 @@ grmerge(struct irs_gr *this, const struct group *src, int preserve) { n = ndst + nnew + 1; if ((size_t)n > pvt->nmemb) { m = realloc(pvt->group.gr_mem, n * sizeof *m); - if (!m) { + if (m == NULL) { /* No harm done, no work done. */ - return; + return (0); } pvt->group.gr_mem = m; pvt->nmemb = n; @@ -373,13 +379,13 @@ grmerge(struct irs_gr *this, const struct group *src, int preserve) { } if (n == 0) { /* No work to do. */ - return; + return (1); } used = preserve ? pvt->membufsize : 0; cp = malloc(used + n); - if (!cp) { + if (cp == NULL) { /* No harm done, no work done. */ - return; + return (0); } ep = cp + used + n; if (used != 0) @@ -403,12 +409,13 @@ grmerge(struct irs_gr *this, const struct group *src, int preserve) { if (isnew(pvt->group.gr_mem, *m)) { *p++ = cp; *p = NULL; -#ifdef HAVE_STRLCPY - strlcpy(cp, *m, ep - cp); -#else - strcpy(cp, *m); -#endif - cp += strlen(cp) + 1; + n = strlen(*m) + 1; + if (n > ep - cp) { + FREE_IF(oldmembuf); + return (0); + } + strcpy(cp, *m); /* (checked) */ + cp += n; } if (preserve) { pvt->group.gr_name = pvt->membuf + @@ -417,23 +424,26 @@ grmerge(struct irs_gr *this, const struct group *src, int preserve) { (pvt->group.gr_passwd - oldmembuf); } else { pvt->group.gr_name = cp; -#ifdef HAVE_STRLCPY - strlcpy(cp, src->gr_name, ep - cp); -#else - strcpy(cp, src->gr_name); -#endif - cp += strlen(src->gr_name) + 1; + n = strlen(src->gr_name) + 1; + if (n > ep - cp) { + FREE_IF(oldmembuf); + return (0); + } + strcpy(cp, src->gr_name); /* (checked) */ + cp += n; + pvt->group.gr_passwd = cp; -#ifdef HAVE_STRLCPY - strlcpy(cp, src->gr_passwd, ep - cp); -#else - strcpy(cp, src->gr_passwd); -#endif - cp += strlen(src->gr_passwd) + 1; + n = strlen(src->gr_passwd) + 1; + if (n > ep - cp) { + FREE_IF(oldmembuf); + return (0); + } + strcpy(cp, src->gr_passwd); /* (checked) */ + cp += n; } - if (oldmembuf != NULL) - free(oldmembuf); + FREE_IF(oldmembuf); INSIST(cp >= pvt->membuf && cp <= &pvt->membuf[pvt->membufsize]); + return (1); } static int diff --git a/dist/bind/lib/bind/irs/getaddrinfo.c b/dist/bind/lib/bind/irs/getaddrinfo.c index e4bb2ae8fba..bb80ca63ec2 100644 --- a/dist/bind/lib/bind/irs/getaddrinfo.c +++ b/dist/bind/lib/bind/irs/getaddrinfo.c @@ -1,4 +1,4 @@ -/* $NetBSD: getaddrinfo.c,v 1.1.1.1 2004/05/17 23:44:42 christos Exp $ */ +/* $NetBSD: getaddrinfo.c,v 1.1.1.2 2004/11/06 23:55:26 christos Exp $ */ /* $KAME: getaddrinfo.c,v 1.14 2001/01/06 09:41:15 jinmei Exp $ */ @@ -939,11 +939,7 @@ copy_ai(pai) free(ai); return NULL; } -#ifdef HAVE_STRLCPY - strlcpy(ai->ai_canonname, pai->ai_canonname, l); -#else - strncpy(ai->ai_canonname, pai->ai_canonname, l); -#endif + strcpy(ai->ai_canonname, pai->ai_canonname); /* (checked) */ } else { /* just to make sure */ ai->ai_canonname = NULL; @@ -1098,7 +1094,8 @@ ip6_str2scopeid(char *scope, struct sockaddr_in6 *sin6, return (0); #ifdef USE_IFNAMELINKID - if (IN6_IS_ADDR_LINKLOCAL(a6) || IN6_IS_ADDR_MC_LINKLOCAL(a6)) { + if (IN6_IS_ADDR_LINKLOCAL(a6) || IN6_IS_ADDR_MC_LINKLOCAL(a6) || + IN6_IS_ADDR_MC_NODELOCAL(a6)) { /* * Using interface names as link indices can be allowed * only when we can assume a one-to-one mappings between @@ -1106,6 +1103,7 @@ ip6_str2scopeid(char *scope, struct sockaddr_in6 *sin6, */ scopeid = if_nametoindex(scope); if (scopeid == 0) + goto trynumeric; *scopeidp = scopeid; return (1); } diff --git a/dist/bind/lib/bind/irs/gethostent_r.c b/dist/bind/lib/bind/irs/gethostent_r.c index 70fd6e8cc09..1985eb4842c 100644 --- a/dist/bind/lib/bind/irs/gethostent_r.c +++ b/dist/bind/lib/bind/irs/gethostent_r.c @@ -1,4 +1,4 @@ -/* $NetBSD: gethostent_r.c,v 1.1.1.1 2004/05/17 23:44:42 christos Exp $ */ +/* $NetBSD: gethostent_r.c,v 1.1.1.2 2004/11/06 23:55:26 christos Exp $ */ /* * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") @@ -18,7 +18,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "Id: gethostent_r.c,v 1.4.206.2 2004/04/22 03:32:06 marka Exp"; +static const char rcsid[] = "Id: gethostent_r.c,v 1.4.206.3 2004/09/01 02:03:07 marka Exp"; #endif /* LIBC_SCCS and not lint */ #include <port_before.h> @@ -49,7 +49,7 @@ gethostbyname_r(const char *name, struct hostent *hptr, HOST_R_ARGS) { HOST_R_ERRNO; #ifdef HOST_R_SETANSWER - if (he == NULL || (n = copy_hostent(he, hptr, HOST_R_COPY)) == 0) + if (he == NULL || (n = copy_hostent(he, hptr, HOST_R_COPY)) != 0) *answerp = NULL; else *answerp = hptr; @@ -74,7 +74,7 @@ gethostbyaddr_r(const char *addr, int len, int type, HOST_R_ERRNO; #ifdef HOST_R_SETANSWER - if (he == NULL || (n = copy_hostent(he, hptr, HOST_R_COPY)) == 0) + if (he == NULL || (n = copy_hostent(he, hptr, HOST_R_COPY)) != 0) *answerp = NULL; else *answerp = hptr; @@ -104,7 +104,7 @@ gethostent_r(struct hostent *hptr, HOST_R_ARGS) { HOST_R_ERRNO; #ifdef HOST_R_SETANSWER - if (he == NULL || (n = copy_hostent(he, hptr, HOST_R_COPY)) == 0) + if (he == NULL || (n = copy_hostent(he, hptr, HOST_R_COPY)) != 0) *answerp = NULL; else *answerp = hptr; diff --git a/dist/bind/lib/bind/irs/getnameinfo.c b/dist/bind/lib/bind/irs/getnameinfo.c index 757d3802ad4..4a51774e48e 100644 --- a/dist/bind/lib/bind/irs/getnameinfo.c +++ b/dist/bind/lib/bind/irs/getnameinfo.c @@ -1,4 +1,4 @@ -/* $NetBSD: getnameinfo.c,v 1.1.1.1 2004/05/17 23:44:43 christos Exp $ */ +/* $NetBSD: getnameinfo.c,v 1.1.1.2 2004/11/06 23:55:27 christos Exp $ */ /* * Issues to be discussed: @@ -156,7 +156,7 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags) switch (sa->sa_family) { case AF_INET: - if (ntohl(*(const u_long *)addr) >> IN_CLASSA_NSHIFT == 0) + if (ntohl(*(const u_int32_t *)addr) >> IN_CLASSA_NSHIFT == 0) flags |= NI_NUMERICHOST; break; case AF_INET6: diff --git a/dist/bind/lib/bind/irs/hesiod.c b/dist/bind/lib/bind/irs/hesiod.c index 672d5efda59..ef540e04ad4 100644 --- a/dist/bind/lib/bind/irs/hesiod.c +++ b/dist/bind/lib/bind/irs/hesiod.c @@ -1,7 +1,7 @@ -/* $NetBSD: hesiod.c,v 1.1.1.1 2004/05/17 23:44:43 christos Exp $ */ +/* $NetBSD: hesiod.c,v 1.1.1.2 2004/11/06 23:55:27 christos Exp $ */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "Id: hesiod.c,v 1.1.2.1.4.2 2004/03/17 01:49:41 marka Exp"; +static const char rcsid[] = "Id: hesiod.c,v 1.1.2.1.4.3 2004/05/17 07:48:56 marka Exp"; #endif /* @@ -94,19 +94,14 @@ hesiod_init(void **context) { /* * Use compiled in defaults. */ - ctx->LHS = malloc(strlen(DEF_LHS)+1); - ctx->RHS = malloc(strlen(DEF_RHS)+1); - if (ctx->LHS == 0 || ctx->RHS == 0) { + ctx->LHS = malloc(strlen(DEF_LHS) + 1); + ctx->RHS = malloc(strlen(DEF_RHS) + 1); + if (ctx->LHS == NULL || ctx->RHS == NULL) { errno = ENOMEM; goto cleanup; } -#ifdef HAVE_STRLCPY - strlcpy(ctx->LHS, DEF_LHS, strlen(DEF_LHS) + 1); - strlcpy(ctx->RHS, DEF_RHS, strlen(DEF_RHS) + 1); -#else - strcpy(ctx->LHS, DEF_LHS); - strcpy(ctx->RHS, DEF_RHS); -#endif + strcpy(ctx->LHS, DEF_LHS); /* (checked) */ + strcpy(ctx->RHS, DEF_RHS); /* (checked) */ #else goto cleanup; #endif @@ -125,22 +120,10 @@ hesiod_init(void **context) { goto cleanup; } if (cp[0] == '.') { -#ifdef HAVE_STRLCPY - strlcpy(ctx->RHS, cp, RHSlen); -#else - strcpy(ctx->RHS, cp); -#endif + strcpy(ctx->RHS, cp); /* (checked) */ } else { -#ifdef HAVE_STRLCPY - strlcpy(ctx->RHS, ".", RHSlen); -#else - strcpy(ctx->RHS, "."); -#endif -#ifdef HAVE_STRLCAT - strlcat(ctx->RHS, cp, RHSlen); -#else - strcat(ctx->RHS, cp); -#endif + strcpy(ctx->RHS, "."); /* (checked) */ + strcat(ctx->RHS, cp); /* (checked) */ } } diff --git a/dist/bind/lib/bind/nameser/ns_name.c b/dist/bind/lib/bind/nameser/ns_name.c index fc86a33bed7..1a9dcb20740 100644 --- a/dist/bind/lib/bind/nameser/ns_name.c +++ b/dist/bind/lib/bind/nameser/ns_name.c @@ -1,4 +1,4 @@ -/* $NetBSD: ns_name.c,v 1.1.1.1 2004/05/17 23:44:46 christos Exp $ */ +/* $NetBSD: ns_name.c,v 1.1.1.2 2004/11/06 23:55:32 christos Exp $ */ /* * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") @@ -18,7 +18,7 @@ */ #ifndef lint -static const char rcsid[] = "Id: ns_name.c,v 1.3.2.4.4.1 2004/03/09 08:33:44 marka Exp"; +static const char rcsid[] = "Id: ns_name.c,v 1.3.2.4.4.2 2004/05/04 03:27:47 marka Exp"; #endif #include "port_before.h" @@ -77,9 +77,11 @@ static int dn_find(const u_char *, const u_char *, const u_char * const *, const u_char * const *); static int encode_bitsring(const char **, const char *, - char **, char **, const char *); + unsigned char **, unsigned char **, + unsigned const char *); static int labellen(const u_char *); -static int decode_bitstring(const char **, char *, const char *); +static int decode_bitstring(const unsigned char **, + char *, const char *); /* Public. */ @@ -134,7 +136,7 @@ ns_name_ntop(const u_char *src, char *dst, size_t dstsiz) errno = EINVAL; return(-1); } - if ((m = decode_bitstring((const char **)&cp, dn, eom)) < 0) + if ((m = decode_bitstring(&cp, dn, eom)) < 0) { errno = EMSGSIZE; return(-1); @@ -214,11 +216,8 @@ ns_name_pton(const char *src, u_char *dst, size_t dstsiz) errno = EINVAL; /* ??? */ return(-1); } - if ((e = encode_bitsring(&src, - cp + 2, - (char **)&label, - (char **)&bp, - (const char *)eom)) + if ((e = encode_bitsring(&src, cp + 2, + &label, &bp, eom)) != 0) { errno = e; return(-1); @@ -790,9 +789,9 @@ dn_find(const u_char *domain, const u_char *msg, } static int -decode_bitstring(const char **cpp, char *dn, const char *eom) +decode_bitstring(const unsigned char **cpp, char *dn, const char *eom) { - const char *cp = *cpp; + const unsigned char *cp = *cpp; char *beg = dn, tc; int b, blen, plen, i; @@ -838,12 +837,13 @@ decode_bitstring(const char **cpp, char *dn, const char *eom) } static int -encode_bitsring(const char **bp, const char *end, char **labelp, - char ** dst, const char *eom) +encode_bitsring(const char **bp, const char *end, unsigned char **labelp, + unsigned char ** dst, unsigned const char *eom) { int afterslash = 0; const char *cp = *bp; - char *tp, c; + unsigned char *tp; + char c; const char *beg_blen; char *end_blen = NULL; int value = 0, count = 0, tbcount = 0, blen = 0; diff --git a/dist/bind/lib/bind/nameser/ns_print.c b/dist/bind/lib/bind/nameser/ns_print.c index 5b49672e91c..6bf0c3ae3de 100644 --- a/dist/bind/lib/bind/nameser/ns_print.c +++ b/dist/bind/lib/bind/nameser/ns_print.c @@ -1,4 +1,4 @@ -/* $NetBSD: ns_print.c,v 1.1.1.1 2004/05/17 23:44:46 christos Exp $ */ +/* $NetBSD: ns_print.c,v 1.1.1.2 2004/11/06 23:55:33 christos Exp $ */ /* * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") @@ -18,7 +18,7 @@ */ #ifndef lint -static const char rcsid[] = "Id: ns_print.c,v 1.3.2.1.4.4 2004/03/17 01:13:36 marka Exp"; +static const char rcsid[] = "Id: ns_print.c,v 1.3.2.1.4.5 2004/07/28 20:16:45 marka Exp"; #endif /* Import. */ @@ -147,8 +147,6 @@ ns_sprintrrf(const u_char *msg, size_t msglen, addlen(x, &buf, &buflen); len = SPRINTF((tmp, " %s %s", p_class(class), p_type(type))); T(addstr(tmp, len, &buf, &buflen)); - if (rdlen == 0U) - return (buf - obuf); T(spaced = addtab(x + len, 16, spaced, &buf, &buflen)); /* @@ -709,7 +707,8 @@ ns_sprintrrf(const u_char *msg, size_t msglen, int n, m; char *p; - len = SPRINTF((tmp, "\\# %u (\t; %s", edata - rdata, comment)); + len = SPRINTF((tmp, "\\# %u%s\t; %s", edata - rdata, + rdlen != 0 ? " (" : "", comment)); T(addstr(tmp, len, &buf, &buflen)); while (rdata < edata) { p = tmp; diff --git a/dist/bind/lib/bind/port/aix32/include/sys/cdefs.h b/dist/bind/lib/bind/port/aix32/include/sys/cdefs.h index 5c43a903201..cd84342a093 100644 --- a/dist/bind/lib/bind/port/aix32/include/sys/cdefs.h +++ b/dist/bind/lib/bind/port/aix32/include/sys/cdefs.h @@ -1,4 +1,4 @@ -/* $NetBSD: cdefs.h,v 1.1.1.1 2004/05/17 23:44:46 christos Exp $ */ +/* $NetBSD: cdefs.h,v 1.1.1.2 2004/11/06 23:55:33 christos Exp $ */ /* * ++Copyright++ 1991, 1993 @@ -57,7 +57,7 @@ /* * @(#)cdefs.h 8.1 (Berkeley) 6/2/93 - * Id: cdefs.h,v 1.1 2001/04/11 01:30:12 marka Exp + * Id: cdefs.h,v 1.1.206.1 2004/07/19 05:53:36 marka Exp */ #ifndef _CDEFS_H_ @@ -129,7 +129,7 @@ * these work for GNU C++ (modulo a slight glitch in the C++ grammar * in the distribution version of 2.5.5). */ -#if !defined(__GNUC__) || __GNUC__ < 2 || __GNUC_MINOR__ < 5 +#if !defined(__GNUC__) || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) #define __attribute__(x) /* delete __attribute__ if non-gcc or gcc1 */ #if defined(__GNUC__) && !defined(__STRICT_ANSI__) #define __dead __volatile diff --git a/dist/bind/lib/bind/port/aix4/include/sys/cdefs.h b/dist/bind/lib/bind/port/aix4/include/sys/cdefs.h index 9e440940c95..efe7982b9c7 100644 --- a/dist/bind/lib/bind/port/aix4/include/sys/cdefs.h +++ b/dist/bind/lib/bind/port/aix4/include/sys/cdefs.h @@ -1,4 +1,4 @@ -/* $NetBSD: cdefs.h,v 1.1.1.1 2004/05/17 23:44:46 christos Exp $ */ +/* $NetBSD: cdefs.h,v 1.1.1.2 2004/11/06 23:55:33 christos Exp $ */ /* * ++Copyright++ 1991, 1993 @@ -57,7 +57,7 @@ /* * @(#)cdefs.h 8.1 (Berkeley) 6/2/93 - * Id: cdefs.h,v 1.1 2001/05/10 04:23:15 marka Exp + * Id: cdefs.h,v 1.1.206.1 2004/07/19 05:53:37 marka Exp */ #ifndef _CDEFS_H_ @@ -132,7 +132,7 @@ * these work for GNU C++ (modulo a slight glitch in the C++ grammar * in the distribution version of 2.5.5). */ -#if !defined(__GNUC__) || __GNUC__ < 2 || __GNUC_MINOR__ < 5 +#if !defined(__GNUC__) || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) #define __attribute__(x) /* delete __attribute__ if non-gcc or gcc1 */ #if defined(__GNUC__) && !defined(__STRICT_ANSI__) #define __dead __volatile diff --git a/dist/bind/lib/bind/port/aux3/include/sys/cdefs.h b/dist/bind/lib/bind/port/aux3/include/sys/cdefs.h index 2cb1e61817b..bbc6d00afbb 100644 --- a/dist/bind/lib/bind/port/aux3/include/sys/cdefs.h +++ b/dist/bind/lib/bind/port/aux3/include/sys/cdefs.h @@ -1,4 +1,4 @@ -/* $NetBSD: cdefs.h,v 1.1.1.1 2004/05/17 23:44:46 christos Exp $ */ +/* $NetBSD: cdefs.h,v 1.1.1.2 2004/11/06 23:55:33 christos Exp $ */ /* * Copyright (c) 1991, 1993 @@ -116,7 +116,7 @@ * these work for GNU C++ (modulo a slight glitch in the C++ grammar * in the distribution version of 2.5.5). */ -#if !defined(__GNUC__) || __GNUC__ < 2 || __GNUC_MINOR__ < 5 +#if !defined(__GNUC__) || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) #define __attribute__(x) /* delete __attribute__ if non-gcc or gcc1 */ #if defined(__GNUC__) && !defined(__STRICT_ANSI__) #define __dead __volatile diff --git a/dist/bind/lib/bind/port/cygwin/include/sys/cdefs.h b/dist/bind/lib/bind/port/cygwin/include/sys/cdefs.h index 7f4ecdfa1cd..e70d6bd055f 100644 --- a/dist/bind/lib/bind/port/cygwin/include/sys/cdefs.h +++ b/dist/bind/lib/bind/port/cygwin/include/sys/cdefs.h @@ -1,4 +1,4 @@ -/* $NetBSD: cdefs.h,v 1.1.1.1 2004/05/17 23:44:46 christos Exp $ */ +/* $NetBSD: cdefs.h,v 1.1.1.2 2004/11/06 23:55:33 christos Exp $ */ /* * ++Copyright++ 1991, 1993 @@ -57,7 +57,7 @@ /* * @(#)cdefs.h 8.1 (Berkeley) 6/2/93 - * Id: cdefs.h,v 1.1.150.1 2003/10/21 05:21:08 marka Exp + * Id: cdefs.h,v 1.1.150.2 2004/07/19 05:53:39 marka Exp */ #ifndef _CDEFS_H_ @@ -129,7 +129,7 @@ * these work for GNU C++ (modulo a slight glitch in the C++ grammar * in the distribution version of 2.5.5). */ -#if !defined(__GNUC__) || __GNUC__ < 2 || __GNUC_MINOR__ < 5 +#if !defined(__GNUC__) || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) #define __attribute__(x) /* delete __attribute__ if non-gcc or gcc1 */ #if defined(__GNUC__) && !defined(__STRICT_ANSI__) #define __dead __volatile diff --git a/dist/bind/lib/bind/port/hpux/include/sys/cdefs.h b/dist/bind/lib/bind/port/hpux/include/sys/cdefs.h index 83f716670af..1e8539e162e 100644 --- a/dist/bind/lib/bind/port/hpux/include/sys/cdefs.h +++ b/dist/bind/lib/bind/port/hpux/include/sys/cdefs.h @@ -1,4 +1,4 @@ -/* $NetBSD: cdefs.h,v 1.1.1.1 2004/05/17 23:44:46 christos Exp $ */ +/* $NetBSD: cdefs.h,v 1.1.1.2 2004/11/06 23:55:33 christos Exp $ */ /* * ++Copyright++ 1991, 1993 @@ -57,7 +57,7 @@ /* * @(#)cdefs.h 8.1 (Berkeley) 6/2/93 - * Id: cdefs.h,v 1.1 2001/04/09 09:17:16 marka Exp + * Id: cdefs.h,v 1.1.206.1 2004/07/19 05:53:40 marka Exp */ #ifndef _CDEFS_H_ @@ -129,7 +129,7 @@ * these work for GNU C++ (modulo a slight glitch in the C++ grammar * in the distribution version of 2.5.5). */ -#if !defined(__GNUC__) || __GNUC__ < 2 || __GNUC_MINOR__ < 5 +#if !defined(__GNUC__) || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) #define __attribute__(x) /* delete __attribute__ if non-gcc or gcc1 */ #if defined(__GNUC__) && !defined(__STRICT_ANSI__) #define __dead __volatile diff --git a/dist/bind/lib/bind/port/hpux10/include/sys/cdefs.h b/dist/bind/lib/bind/port/hpux10/include/sys/cdefs.h index c46c6179023..1e8539e162e 100644 --- a/dist/bind/lib/bind/port/hpux10/include/sys/cdefs.h +++ b/dist/bind/lib/bind/port/hpux10/include/sys/cdefs.h @@ -1,4 +1,4 @@ -/* $NetBSD: cdefs.h,v 1.1.1.1 2004/05/17 23:44:46 christos Exp $ */ +/* $NetBSD: cdefs.h,v 1.1.1.2 2004/11/06 23:55:33 christos Exp $ */ /* * ++Copyright++ 1991, 1993 @@ -57,7 +57,7 @@ /* * @(#)cdefs.h 8.1 (Berkeley) 6/2/93 - * Id: cdefs.h,v 1.1 2001/05/17 06:25:49 marka Exp + * Id: cdefs.h,v 1.1.206.1 2004/07/19 05:53:40 marka Exp */ #ifndef _CDEFS_H_ @@ -129,7 +129,7 @@ * these work for GNU C++ (modulo a slight glitch in the C++ grammar * in the distribution version of 2.5.5). */ -#if !defined(__GNUC__) || __GNUC__ < 2 || __GNUC_MINOR__ < 5 +#if !defined(__GNUC__) || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) #define __attribute__(x) /* delete __attribute__ if non-gcc or gcc1 */ #if defined(__GNUC__) && !defined(__STRICT_ANSI__) #define __dead __volatile diff --git a/dist/bind/lib/bind/port/hpux9/include/sys/cdefs.h b/dist/bind/lib/bind/port/hpux9/include/sys/cdefs.h index 0246e7afbd8..62a512fca6f 100644 --- a/dist/bind/lib/bind/port/hpux9/include/sys/cdefs.h +++ b/dist/bind/lib/bind/port/hpux9/include/sys/cdefs.h @@ -1,4 +1,4 @@ -/* $NetBSD: cdefs.h,v 1.1.1.1 2004/05/17 23:44:46 christos Exp $ */ +/* $NetBSD: cdefs.h,v 1.1.1.2 2004/11/06 23:55:33 christos Exp $ */ /* * ++Copyright++ 1991, 1993 @@ -57,7 +57,7 @@ /* * @(#)cdefs.h 8.1 (Berkeley) 6/2/93 - * Id: cdefs.h,v 1.1 2001/05/17 06:25:50 marka Exp + * Id: cdefs.h,v 1.1.206.1 2004/07/19 05:53:41 marka Exp */ #ifndef _CDEFS_H_ @@ -129,7 +129,7 @@ * these work for GNU C++ (modulo a slight glitch in the C++ grammar * in the distribution version of 2.5.5). */ -#if !defined(__GNUC__) || __GNUC__ < 2 || __GNUC_MINOR__ < 5 +#if !defined(__GNUC__) || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) #define __attribute__(x) /* delete __attribute__ if non-gcc or gcc1 */ #if defined(__GNUC__) && !defined(__STRICT_ANSI__) #define __dead __volatile diff --git a/dist/bind/lib/bind/port/irix/include/sys/cdefs.h b/dist/bind/lib/bind/port/irix/include/sys/cdefs.h index 0246e7afbd8..3c4a167cdba 100644 --- a/dist/bind/lib/bind/port/irix/include/sys/cdefs.h +++ b/dist/bind/lib/bind/port/irix/include/sys/cdefs.h @@ -1,4 +1,4 @@ -/* $NetBSD: cdefs.h,v 1.1.1.1 2004/05/17 23:44:46 christos Exp $ */ +/* $NetBSD: cdefs.h,v 1.1.1.2 2004/11/06 23:55:33 christos Exp $ */ /* * ++Copyright++ 1991, 1993 @@ -57,7 +57,7 @@ /* * @(#)cdefs.h 8.1 (Berkeley) 6/2/93 - * Id: cdefs.h,v 1.1 2001/05/17 06:25:50 marka Exp + * Id: cdefs.h,v 1.1.206.1 2004/07/19 05:53:42 marka Exp */ #ifndef _CDEFS_H_ @@ -129,7 +129,7 @@ * these work for GNU C++ (modulo a slight glitch in the C++ grammar * in the distribution version of 2.5.5). */ -#if !defined(__GNUC__) || __GNUC__ < 2 || __GNUC_MINOR__ < 5 +#if !defined(__GNUC__) || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) #define __attribute__(x) /* delete __attribute__ if non-gcc or gcc1 */ #if defined(__GNUC__) && !defined(__STRICT_ANSI__) #define __dead __volatile diff --git a/dist/bind/lib/bind/port/lynxos/include/sys/cdefs.h b/dist/bind/lib/bind/port/lynxos/include/sys/cdefs.h index 981f8b41285..5464e896f6f 100644 --- a/dist/bind/lib/bind/port/lynxos/include/sys/cdefs.h +++ b/dist/bind/lib/bind/port/lynxos/include/sys/cdefs.h @@ -1,4 +1,4 @@ -/* $NetBSD: cdefs.h,v 1.1.1.1 2004/05/17 23:44:46 christos Exp $ */ +/* $NetBSD: cdefs.h,v 1.1.1.2 2004/11/06 23:55:33 christos Exp $ */ /* * ++Copyright++ 1991, 1993 @@ -57,7 +57,7 @@ /* * @(#)cdefs.h 8.1 (Berkeley) 6/2/93 - * Id: cdefs.h,v 1.1 2001/05/17 06:25:51 marka Exp + * Id: cdefs.h,v 1.1.206.1 2004/07/19 05:53:43 marka Exp */ #ifndef _CDEFS_H_ @@ -131,7 +131,7 @@ * these work for GNU C++ (modulo a slight glitch in the C++ grammar * in the distribution version of 2.5.5). */ -#if !defined(__GNUC__) || __GNUC__ < 2 || __GNUC_MINOR__ < 5 +#if !defined(__GNUC__) || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) #define __attribute__(x) /* delete __attribute__ if non-gcc or gcc1 */ #if defined(__GNUC__) && !defined(__STRICT_ANSI__) #define __dead __volatile diff --git a/dist/bind/lib/bind/port/mpe/include/sys/cdefs.h b/dist/bind/lib/bind/port/mpe/include/sys/cdefs.h index 30da532ffa8..fd549ad23b9 100644 --- a/dist/bind/lib/bind/port/mpe/include/sys/cdefs.h +++ b/dist/bind/lib/bind/port/mpe/include/sys/cdefs.h @@ -1,4 +1,4 @@ -/* $NetBSD: cdefs.h,v 1.1.1.1 2004/05/17 23:44:46 christos Exp $ */ +/* $NetBSD: cdefs.h,v 1.1.1.2 2004/11/06 23:55:33 christos Exp $ */ /* * ++Copyright++ 1991, 1993 @@ -57,7 +57,7 @@ /* * @(#)cdefs.h 8.1 (Berkeley) 6/2/93 - * Id: cdefs.h,v 1.1 2001/05/17 06:25:51 marka Exp + * Id: cdefs.h,v 1.1.206.1 2004/07/19 05:53:44 marka Exp */ #ifndef _CDEFS_H_ @@ -129,7 +129,7 @@ * these work for GNU C++ (modulo a slight glitch in the C++ grammar * in the distribution version of 2.5.5). */ -#if !defined(__GNUC__) || __GNUC__ < 2 || __GNUC_MINOR__ < 5 +#if !defined(__GNUC__) || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) #define __attribute__(x) /* delete __attribute__ if non-gcc or gcc1 */ #if defined(__GNUC__) && !defined(__STRICT_ANSI__) #define __dead __volatile diff --git a/dist/bind/lib/bind/port/next/include/sys/cdefs.h b/dist/bind/lib/bind/port/next/include/sys/cdefs.h index 1a5c2f3b6ff..be59bb24b0a 100644 --- a/dist/bind/lib/bind/port/next/include/sys/cdefs.h +++ b/dist/bind/lib/bind/port/next/include/sys/cdefs.h @@ -1,4 +1,4 @@ -/* $NetBSD: cdefs.h,v 1.1.1.1 2004/05/17 23:44:47 christos Exp $ */ +/* $NetBSD: cdefs.h,v 1.1.1.2 2004/11/06 23:55:33 christos Exp $ */ /* * ++Copyright++ 1991, 1993 @@ -57,7 +57,7 @@ /* * @(#)cdefs.h 8.1 (Berkeley) 6/2/93 - * Id: cdefs.h,v 1.1 2001/05/17 06:25:55 marka Exp + * Id: cdefs.h,v 1.1.206.1 2004/07/19 05:53:48 marka Exp */ #ifndef _CDEFS_H_ @@ -129,7 +129,7 @@ * these work for GNU C++ (modulo a slight glitch in the C++ grammar * in the distribution version of 2.5.5). */ -#if !defined(__GNUC__) || __GNUC__ < 2 || __GNUC_MINOR__ < 5 +#if !defined(__GNUC__) || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) #define __attribute__(x) /* delete __attribute__ if non-gcc or gcc1 */ #if defined(__GNUC__) && !defined(__STRICT_ANSI__) #define __dead __volatile diff --git a/dist/bind/lib/bind/port/qnx/include/sys/cdefs.h b/dist/bind/lib/bind/port/qnx/include/sys/cdefs.h index 484dddf65e4..2675c203d7e 100644 --- a/dist/bind/lib/bind/port/qnx/include/sys/cdefs.h +++ b/dist/bind/lib/bind/port/qnx/include/sys/cdefs.h @@ -1,4 +1,4 @@ -/* $NetBSD: cdefs.h,v 1.1.1.1 2004/05/17 23:44:46 christos Exp $ */ +/* $NetBSD: cdefs.h,v 1.1.1.2 2004/11/06 23:55:33 christos Exp $ */ /* * Copyright (c) 1991, 1993 @@ -108,8 +108,7 @@ * these work for GNU C++ (modulo a slight glitch in the C++ grammar * in the distribution version of 2.5.5). */ -#if !defined(__GNUC__) || __GNUC__ < 2 || \ - (__GNUC__ == 2 && __GNUC_MINOR__ < 5) +#if !defined(__GNUC__) || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) #define __attribute__(x) /* delete __attribute__ if non-gcc or gcc1 */ #if defined(__GNUC__) && !defined(__STRICT_ANSI__) #define __dead __volatile diff --git a/dist/bind/lib/bind/port/sco42/include/sys/cdefs.h b/dist/bind/lib/bind/port/sco42/include/sys/cdefs.h index 8fc7547e3d2..c94c9d1f126 100644 --- a/dist/bind/lib/bind/port/sco42/include/sys/cdefs.h +++ b/dist/bind/lib/bind/port/sco42/include/sys/cdefs.h @@ -1,4 +1,4 @@ -/* $NetBSD: cdefs.h,v 1.1.1.1 2004/05/17 23:44:47 christos Exp $ */ +/* $NetBSD: cdefs.h,v 1.1.1.2 2004/11/06 23:55:33 christos Exp $ */ /* * ++Copyright++ 1991, 1993 @@ -57,7 +57,7 @@ /* * @(#)cdefs.h 8.1 (Berkeley) 6/2/93 - * Id: cdefs.h,v 1.1 2001/05/17 06:25:57 marka Exp + * Id: cdefs.h,v 1.1.206.1 2004/07/19 05:53:50 marka Exp */ #ifndef _CDEFS_H_ @@ -129,7 +129,7 @@ * these work for GNU C++ (modulo a slight glitch in the C++ grammar * in the distribution version of 2.5.5). */ -#if !defined(__GNUC__) || __GNUC__ < 2 || __GNUC_MINOR__ < 5 +#if !defined(__GNUC__) || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) #define __attribute__(x) /* delete __attribute__ if non-gcc or gcc1 */ #if defined(__GNUC__) && !defined(__STRICT_ANSI__) #define __dead __volatile diff --git a/dist/bind/lib/bind/port/solaris/include/sys/cdefs.h b/dist/bind/lib/bind/port/solaris/include/sys/cdefs.h index b4272bc13e8..c94c9d1f126 100644 --- a/dist/bind/lib/bind/port/solaris/include/sys/cdefs.h +++ b/dist/bind/lib/bind/port/solaris/include/sys/cdefs.h @@ -1,4 +1,4 @@ -/* $NetBSD: cdefs.h,v 1.1.1.1 2004/05/17 23:44:47 christos Exp $ */ +/* $NetBSD: cdefs.h,v 1.1.1.2 2004/11/06 23:55:33 christos Exp $ */ /* * ++Copyright++ 1991, 1993 @@ -57,7 +57,7 @@ /* * @(#)cdefs.h 8.1 (Berkeley) 6/2/93 - * Id: cdefs.h,v 1.1 2001/04/02 06:29:20 marka Exp + * Id: cdefs.h,v 1.1.206.1 2004/07/19 05:53:50 marka Exp */ #ifndef _CDEFS_H_ @@ -129,7 +129,7 @@ * these work for GNU C++ (modulo a slight glitch in the C++ grammar * in the distribution version of 2.5.5). */ -#if !defined(__GNUC__) || __GNUC__ < 2 || __GNUC_MINOR__ < 5 +#if !defined(__GNUC__) || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) #define __attribute__(x) /* delete __attribute__ if non-gcc or gcc1 */ #if defined(__GNUC__) && !defined(__STRICT_ANSI__) #define __dead __volatile diff --git a/dist/bind/lib/bind/port/sunos/include/sys/cdefs.h b/dist/bind/lib/bind/port/sunos/include/sys/cdefs.h index 5550957e0d4..8a268cb23b1 100644 --- a/dist/bind/lib/bind/port/sunos/include/sys/cdefs.h +++ b/dist/bind/lib/bind/port/sunos/include/sys/cdefs.h @@ -1,4 +1,4 @@ -/* $NetBSD: cdefs.h,v 1.1.1.1 2004/05/17 23:44:47 christos Exp $ */ +/* $NetBSD: cdefs.h,v 1.1.1.2 2004/11/06 23:55:33 christos Exp $ */ /* * ++Copyright++ 1991, 1993 @@ -57,7 +57,7 @@ /* * @(#)cdefs.h 8.1 (Berkeley) 6/2/93 - * Id: cdefs.h,v 1.1 2001/05/17 06:25:58 marka Exp + * Id: cdefs.h,v 1.1.206.1 2004/07/19 05:53:51 marka Exp */ #ifndef _CDEFS_H_ @@ -129,7 +129,7 @@ * these work for GNU C++ (modulo a slight glitch in the C++ grammar * in the distribution version of 2.5.5). */ -#if !defined(__GNUC__) || __GNUC__ < 2 || __GNUC_MINOR__ < 5 +#if !defined(__GNUC__) || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) #define __attribute__(x) /* delete __attribute__ if non-gcc or gcc1 */ #if defined(__GNUC__) && !defined(__STRICT_ANSI__) #define __dead __volatile diff --git a/dist/bind/lib/bind/port/unixware20/include/sys/cdefs.h b/dist/bind/lib/bind/port/unixware20/include/sys/cdefs.h index 678bd9f8bba..38672bd4561 100644 --- a/dist/bind/lib/bind/port/unixware20/include/sys/cdefs.h +++ b/dist/bind/lib/bind/port/unixware20/include/sys/cdefs.h @@ -1,4 +1,4 @@ -/* $NetBSD: cdefs.h,v 1.1.1.1 2004/05/17 23:44:47 christos Exp $ */ +/* $NetBSD: cdefs.h,v 1.1.1.2 2004/11/06 23:55:33 christos Exp $ */ /* * ++Copyright++ 1991, 1993 @@ -57,7 +57,7 @@ /* * @(#)cdefs.h 8.1 (Berkeley) 6/2/93 - * Id: cdefs.h,v 1.1 2001/05/17 06:26:00 marka Exp + * Id: cdefs.h,v 1.1.206.1 2004/07/19 05:53:52 marka Exp */ #ifndef _CDEFS_H_ @@ -129,7 +129,7 @@ * these work for GNU C++ (modulo a slight glitch in the C++ grammar * in the distribution version of 2.5.5). */ -#if !defined(__GNUC__) || __GNUC__ < 2 || __GNUC_MINOR__ < 5 +#if !defined(__GNUC__) || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) #define __attribute__(x) /* delete __attribute__ if non-gcc or gcc1 */ #if defined(__GNUC__) && !defined(__STRICT_ANSI__) #define __dead __volatile diff --git a/dist/bind/lib/bind/port/unixware212/include/sys/cdefs.h b/dist/bind/lib/bind/port/unixware212/include/sys/cdefs.h index 44a1704cdfe..5aa04f6ac2f 100644 --- a/dist/bind/lib/bind/port/unixware212/include/sys/cdefs.h +++ b/dist/bind/lib/bind/port/unixware212/include/sys/cdefs.h @@ -1,4 +1,4 @@ -/* $NetBSD: cdefs.h,v 1.1.1.1 2004/05/17 23:44:47 christos Exp $ */ +/* $NetBSD: cdefs.h,v 1.1.1.2 2004/11/06 23:55:33 christos Exp $ */ /* * ++Copyright++ 1991, 1993 @@ -57,7 +57,7 @@ /* * @(#)cdefs.h 8.1 (Berkeley) 6/2/93 - * Id: cdefs.h,v 1.1 2001/05/17 06:26:01 marka Exp + * Id: cdefs.h,v 1.1.206.1 2004/07/19 05:53:53 marka Exp */ #ifndef _CDEFS_H_ @@ -129,7 +129,7 @@ * these work for GNU C++ (modulo a slight glitch in the C++ grammar * in the distribution version of 2.5.5). */ -#if !defined(__GNUC__) || __GNUC__ < 2 || __GNUC_MINOR__ < 5 +#if !defined(__GNUC__) || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) #define __attribute__(x) /* delete __attribute__ if non-gcc or gcc1 */ #if defined(__GNUC__) && !defined(__STRICT_ANSI__) #define __dead __volatile diff --git a/dist/bind/lib/bind/port_after.h.in b/dist/bind/lib/bind/port_after.h.in index 9095982ec8f..6d5f4dca667 100644 --- a/dist/bind/lib/bind/port_after.h.in +++ b/dist/bind/lib/bind/port_after.h.in @@ -26,6 +26,7 @@ @USE_SYSERROR_LIST@ @INNETGR_ARGS@ @SETNETGRENT_ARGS@ +@USE_IFNAMELINKID@ /* XXX sunos and cygwin needs O_NDELAY */ #define PORT_NONBLOCK O_NONBLOCK diff --git a/dist/bind/lib/bind/resolv/res_debug.c b/dist/bind/lib/bind/resolv/res_debug.c index 91a1b001a53..cc4e18d7f6a 100644 --- a/dist/bind/lib/bind/resolv/res_debug.c +++ b/dist/bind/lib/bind/resolv/res_debug.c @@ -1,4 +1,4 @@ -/* $NetBSD: res_debug.c,v 1.1.1.1 2004/05/17 23:44:47 christos Exp $ */ +/* $NetBSD: res_debug.c,v 1.1.1.2 2004/11/06 23:55:33 christos Exp $ */ /* * Copyright (c) 1985 @@ -97,7 +97,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.4 2004/04/13 06:53:20 marka Exp"; +static const char rcsid[] = "Id: res_debug.c,v 1.3.2.5.4.5 2004/07/28 20:16:46 marka Exp"; #endif /* LIBC_SCCS and not lint */ #include "port_before.h" @@ -551,7 +551,7 @@ p_type(int type) { result = sym_ntos(__p_type_syms, type, &success); if (success) return (result); - if (type < 0 || type > 0xfff) + if (type < 0 || type > 0xffff) return ("BADTYPE"); sprintf(typebuf, "TYPE%d", type); return (typebuf); @@ -587,7 +587,7 @@ p_class(int class) { result = sym_ntos(__p_class_syms, class, &success); if (success) return (result); - if (class < 0 || class > 0xfff) + if (class < 0 || class > 0xffff) return ("BADCLASS"); sprintf(classbuf, "CLASS%d", class); return (classbuf); diff --git a/dist/bind/lib/bind/resolv/res_mkupdate.c b/dist/bind/lib/bind/resolv/res_mkupdate.c index 926925e7606..bf7174caca9 100644 --- a/dist/bind/lib/bind/resolv/res_mkupdate.c +++ b/dist/bind/lib/bind/resolv/res_mkupdate.c @@ -1,4 +1,4 @@ -/* $NetBSD: res_mkupdate.c,v 1.1.1.1 2004/05/17 23:44:47 christos Exp $ */ +/* $NetBSD: res_mkupdate.c,v 1.1.1.2 2004/11/06 23:55:34 christos Exp $ */ /* * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") @@ -23,7 +23,7 @@ */ #if !defined(lint) && !defined(SABER) -static const char rcsid[] = "Id: res_mkupdate.c,v 1.1.2.1.4.2 2004/03/16 12:34:19 marka Exp"; +static const char rcsid[] = "Id: res_mkupdate.c,v 1.1.2.1.4.3 2004/06/03 04:44:48 marka Exp"; #endif /* not lint */ #include "port_before.h" @@ -352,13 +352,13 @@ res_nmkupdate(res_state statp, ns_updrec *rrecp_in, u_char *buf, int buflen) { bm[i] = 0; while (getword_str(buf2, sizeof buf2, &startp, endp)) { - if ((n1 = res_servicenumber(buf2)) <= 0) + if ((n = res_servicenumber(buf2)) <= 0) return (-1); - if (n1 < MAXPORT) { - bm[n1/8] |= (0x80>>(n1%8)); - if (n1 > maxbm) - maxbm = n1; + if (n < MAXPORT) { + bm[n/8] |= (0x80>>(n%8)); + if ((unsigned)n > maxbm) + maxbm = n; } else return (-1); } diff --git a/dist/bind/lib/bind/resolv/res_send.c b/dist/bind/lib/bind/resolv/res_send.c index f9a2b309fe0..fb2e447b693 100644 --- a/dist/bind/lib/bind/resolv/res_send.c +++ b/dist/bind/lib/bind/resolv/res_send.c @@ -1,4 +1,4 @@ -/* $NetBSD: res_send.c,v 1.1.1.1 2004/05/17 23:44:48 christos Exp $ */ +/* $NetBSD: res_send.c,v 1.1.1.2 2004/11/06 23:55:34 christos Exp $ */ /* * Copyright (c) 1985, 1989, 1993 @@ -72,7 +72,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.3 2004/04/12 06:54:59 marka Exp"; +static const char rcsid[] = "Id: res_send.c,v 1.5.2.2.4.5 2004/08/10 02:19:56 marka Exp"; #endif /* LIBC_SCCS and not lint */ /* @@ -174,7 +174,8 @@ res_ourserver_p(const res_state statp, const struct sockaddr *sa) { if (srv6->sin6_family == in6p->sin6_family && srv6->sin6_port == in6p->sin6_port && #ifdef HAVE_SIN6_SCOPE_ID - srv6->sin6_scope_id == in6p->sin6_scope_id && + (srv6->sin6_scope_id == 0 || + srv6->sin6_scope_id == in6p->sin6_scope_id) && #endif (IN6_IS_ADDR_UNSPECIFIED(&srv6->sin6_addr) || IN6_ARE_ADDR_EQUAL(&srv6->sin6_addr, &in6p->sin6_addr))) @@ -658,7 +659,7 @@ send_vc(res_state statp, len = INT16SZ; while ((n = read(statp->_vcsock, (char *)cp, (int)len)) > 0) { cp += n; - if ((len -= n) <= 0) + if ((len -= n) == 0) break; } if (n <= 0) { diff --git a/dist/bind/lib/bind9/Makefile.in b/dist/bind/lib/bind9/Makefile.in index a179b1e5713..368f06a5a7f 100644 --- a/dist/bind/lib/bind9/Makefile.in +++ b/dist/bind/lib/bind9/Makefile.in @@ -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.200.5 2004/03/08 09:04:26 marka Exp +# Id: Makefile.in,v 1.2.200.6 2004/07/20 07:01:57 marka Exp srcdir = @srcdir@ VPATH = @srcdir@ @@ -59,7 +59,7 @@ libbind9.@SA@: ${OBJS} libbind9.la: ${OBJS} ${LIBTOOL_MODE_LINK} \ - ${CC} ${ALL_CFLAGS} -o libbind9.la -rpath ${libdir} \ + ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o libbind9.la -rpath ${libdir} \ -version-info ${LIBINTERFACE}:${LIBREVISION}:${LIBAGE} \ ${OBJS} ${LIBS} diff --git a/dist/bind/lib/bind9/api b/dist/bind/lib/bind9/api index 06977fcb711..dbaaf58cca8 100644 --- a/dist/bind/lib/bind9/api +++ b/dist/bind/lib/bind9/api @@ -1,3 +1,3 @@ LIBINTERFACE = 0 -LIBREVISION = 1 +LIBREVISION = 4 LIBAGE = 0 diff --git a/dist/bind/lib/bind9/check.c b/dist/bind/lib/bind9/check.c index 4e70b5f0797..53c79b3468f 100644 --- a/dist/bind/lib/bind9/check.c +++ b/dist/bind/lib/bind9/check.c @@ -1,4 +1,4 @@ -/* $NetBSD: check.c,v 1.1.1.1 2004/05/17 23:44:48 christos Exp $ */ +/* $NetBSD: check.c,v 1.1.1.2 2004/11/06 23:55:34 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -17,7 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* Id: check.c,v 1.37.6.25 2004/04/15 23:56:28 marka Exp */ +/* Id: check.c,v 1.37.6.28 2004/07/29 00:08:08 marka Exp */ #include <config.h> @@ -282,6 +282,39 @@ disabled_algorithms(cfg_obj_t *disabled, isc_log_t *logctx) { } static isc_result_t +nameexist(cfg_obj_t *obj, const char *name, int value, isc_symtab_t *symtab, + const char *fmt, isc_log_t *logctx, isc_mem_t *mctx) +{ + char *key; + const char *file; + unsigned int line; + isc_result_t result; + isc_symvalue_t symvalue; + + key = isc_mem_strdup(mctx, name); + if (key == NULL) + return (ISC_R_NOMEMORY); + symvalue.as_pointer = obj; + result = isc_symtab_define(symtab, key, value, symvalue, + isc_symexists_reject); + if (result == ISC_R_EXISTS) { + RUNTIME_CHECK(isc_symtab_lookup(symtab, key, value, + &symvalue) == ISC_R_SUCCESS); + file = cfg_obj_file(symvalue.as_pointer); + line = cfg_obj_line(symvalue.as_pointer); + + if (file == NULL) + file = "<unknown file>"; + cfg_obj_log(obj, logctx, ISC_LOG_ERROR, fmt, key, file, line); + isc_mem_free(mctx, key); + result = ISC_R_EXISTS; + } else if (result != ISC_R_SUCCESS) { + isc_mem_free(mctx, key); + } + return (result); +} + +static isc_result_t mustbesecure(cfg_obj_t *secure, isc_symtab_t *symtab, isc_log_t *logctx, isc_mem_t *mctx) { @@ -292,9 +325,6 @@ mustbesecure(cfg_obj_t *secure, isc_symtab_t *symtab, isc_log_t *logctx, dns_name_t *name; isc_buffer_t b; isc_result_t result = ISC_R_SUCCESS; - isc_result_t tresult; - isc_symvalue_t symvalue; - char *key; dns_fixedname_init(&fixed); name = dns_fixedname_name(&fixed); @@ -302,42 +332,16 @@ mustbesecure(cfg_obj_t *secure, isc_symtab_t *symtab, isc_log_t *logctx, str = cfg_obj_asstring(obj); isc_buffer_init(&b, str, strlen(str)); isc_buffer_add(&b, strlen(str)); - tresult = dns_name_fromtext(name, &b, dns_rootname, ISC_FALSE, NULL); - if (tresult != ISC_R_SUCCESS) { + result = dns_name_fromtext(name, &b, dns_rootname, ISC_FALSE, NULL); + if (result != ISC_R_SUCCESS) { cfg_obj_log(obj, logctx, ISC_LOG_ERROR, "bad domain name '%s'", str); - result = tresult; } else { - dns_name_format(name, namebuf, sizeof(namebuf)); - key = isc_mem_strdup(mctx, namebuf); - if (key == NULL) - return (ISC_R_NOMEMORY); - symvalue.as_pointer = secure; - tresult = isc_symtab_define(symtab, key, 1, symvalue, - isc_symexists_reject); - if (tresult == ISC_R_EXISTS) { - const char *file; - unsigned int line; - - RUNTIME_CHECK(isc_symtab_lookup(symtab, key, 1, - &symvalue) == ISC_R_SUCCESS); - isc_mem_free(mctx, key); - file = cfg_obj_file(symvalue.as_pointer); - line = cfg_obj_line(symvalue.as_pointer); - - if (file == NULL) - file = "<unknown file>"; - - cfg_obj_log(secure, logctx, ISC_LOG_ERROR, - "dnssec-must-be-secure '%s': already " - "exists previous definition: %s:%u", - namebuf, file, line); - result = tresult; - } else if (tresult != ISC_R_SUCCESS) { - isc_mem_free(mctx, key); - result = tresult; - } + result = nameexist(secure, namebuf, 1, symtab, + "dnssec-must-be-secure '%s': already " + "exists previous definition: %s:%u", + logctx, mctx); } return (result); } @@ -355,6 +359,7 @@ check_options(cfg_obj_t *options, isc_log_t *logctx, isc_mem_t *mctx) { unsigned int i; cfg_obj_t *obj = NULL; cfg_listelt_t *element; + isc_symtab_t *symtab = NULL; static intervaltable intervals[] = { { "cleaning-interval", 60, 28 * 24 * 60 }, /* 28 days */ @@ -460,21 +465,70 @@ check_options(cfg_obj_t *options, isc_log_t *logctx, isc_mem_t *mctx) { obj = NULL; (void)cfg_map_get(options, "dnssec-lookaside", &obj); if (obj != NULL) { - dns_fixedname_t fixedname; - const char *dlv; - isc_buffer_t b; - - dlv = cfg_obj_asstring(obj); - dns_fixedname_init(&fixedname); - isc_buffer_init(&b, dlv, strlen(dlv)); - isc_buffer_add(&b, strlen(dlv)); - tresult = dns_name_fromtext(dns_fixedname_name(&fixedname), &b, - dns_rootname, ISC_TRUE, NULL); - if (tresult != ISC_R_SUCCESS) { - cfg_obj_log(obj, logctx, ISC_LOG_ERROR, - "bad domain name '%s'", dlv); + tresult = isc_symtab_create(mctx, 100, freekey, mctx, + ISC_TRUE, &symtab); + if (tresult != ISC_R_SUCCESS) result = tresult; + for (element = cfg_list_first(obj); + element != NULL; + element = cfg_list_next(element)) + { + dns_fixedname_t fixedname; + dns_name_t *name; + const char *dlv; + isc_buffer_t b; + + obj = cfg_listelt_value(element); + + dlv = cfg_obj_asstring(cfg_tuple_get(obj, "domain")); + dns_fixedname_init(&fixedname); + name = dns_fixedname_name(&fixedname); + isc_buffer_init(&b, dlv, strlen(dlv)); + isc_buffer_add(&b, strlen(dlv)); + tresult = dns_name_fromtext(name, &b, dns_rootname, + ISC_TRUE, NULL); + if (tresult != ISC_R_SUCCESS) { + cfg_obj_log(obj, logctx, ISC_LOG_ERROR, + "bad domain name '%s'", dlv); + result = tresult; + } + if (symtab != NULL) { + tresult = nameexist(obj, dlv, 1, symtab, + "dnssec-lookaside '%s': " + "already exists previous " + "definition: %s:%u", + logctx, mctx); + if (tresult != ISC_R_SUCCESS && + result == ISC_R_SUCCESS) + result = tresult; + } + /* + * XXXMPA to be removed when multiple lookaside + * namespaces are supported. + */ + if (!dns_name_equal(dns_rootname, name)) { + cfg_obj_log(obj, logctx, ISC_LOG_ERROR, + "dnssec-lookaside '%s': " + "non-root not yet supported", dlv); + if (result == ISC_R_SUCCESS) + result = ISC_R_FAILURE; + } + dlv = cfg_obj_asstring(cfg_tuple_get(obj, + "trust-anchor")); + dns_fixedname_init(&fixedname); + isc_buffer_init(&b, dlv, strlen(dlv)); + isc_buffer_add(&b, strlen(dlv)); + tresult = dns_name_fromtext(name, &b, dns_rootname, + ISC_TRUE, NULL); + if (tresult != ISC_R_SUCCESS) { + cfg_obj_log(obj, logctx, ISC_LOG_ERROR, + "bad domain name '%s'", dlv); + if (result == ISC_R_SUCCESS) + result = tresult; + } } + if (symtab != NULL) + isc_symtab_destroy(&symtab); } /* @@ -645,7 +699,6 @@ check_zoneconf(cfg_obj_t *zconfig, cfg_obj_t *config, isc_symtab_t *symtab, unsigned int ztype; cfg_obj_t *zoptions; cfg_obj_t *obj = NULL; - isc_symvalue_t symvalue; isc_result_t result = ISC_R_SUCCESS; isc_result_t tresult; unsigned int i; @@ -760,48 +813,22 @@ check_zoneconf(cfg_obj_t *zconfig, cfg_obj_t *config, isc_symtab_t *symtab, dns_fixedname_init(&fixedname); isc_buffer_init(&b, zname, strlen(zname)); isc_buffer_add(&b, strlen(zname)); - result = dns_name_fromtext(dns_fixedname_name(&fixedname), &b, + tresult = dns_name_fromtext(dns_fixedname_name(&fixedname), &b, dns_rootname, ISC_TRUE, NULL); if (result != ISC_R_SUCCESS) { cfg_obj_log(zconfig, logctx, ISC_LOG_ERROR, "zone '%s': is not a valid name", zname); - result = ISC_R_FAILURE; + tresult = ISC_R_FAILURE; } else { char namebuf[DNS_NAME_FORMATSIZE]; - char *key; dns_name_format(dns_fixedname_name(&fixedname), namebuf, sizeof(namebuf)); - key = isc_mem_strdup(mctx, namebuf); - if (key == NULL) - return (ISC_R_NOMEMORY); - symvalue.as_pointer = zconfig; - tresult = isc_symtab_define(symtab, key, - ztype == HINTZONE ? 1 : 2, - symvalue, isc_symexists_reject); - if (tresult == ISC_R_EXISTS) { - const char *file; - unsigned int line; - - RUNTIME_CHECK(isc_symtab_lookup(symtab, key, - ztype == HINTZONE ? 1 : 2, - &symvalue) == ISC_R_SUCCESS); - isc_mem_free(mctx, key); - file = cfg_obj_file(symvalue.as_pointer); - line = cfg_obj_line(symvalue.as_pointer); - - if (file == NULL) - file = "<unknown file>"; - cfg_obj_log(zconfig, logctx, ISC_LOG_ERROR, - "zone '%s': already exists " - "previous definition: %s:%u", - zname, file, line); - result = ISC_R_FAILURE; - } else if (tresult != ISC_R_SUCCESS) { - isc_mem_free(mctx, key); - - return (tresult); - } + tresult = nameexist(zconfig, namebuf, ztype == HINTZONE ? 1 : 2, + symtab, "zone '%s': already exists " + "previous definition: %s:%u", logctx, mctx); + if (tresult != ISC_R_SUCCESS) + result = tresult; } /* @@ -1177,6 +1204,7 @@ bind9_check_namedconf(cfg_obj_t *config, isc_log_t *logctx, isc_mem_t *mctx) { cfg_listelt_t *velement; isc_result_t result = ISC_R_SUCCESS; isc_result_t tresult; + isc_symtab_t *symtab = NULL; static const char *builtin[] = { "localhost", "localnets", "any", "none"}; @@ -1218,6 +1246,9 @@ bind9_check_namedconf(cfg_obj_t *config, isc_log_t *logctx, isc_mem_t *mctx) { } } + tresult = isc_symtab_create(mctx, 100, NULL, NULL, ISC_TRUE, &symtab); + if (tresult != ISC_R_SUCCESS) + result = tresult; for (velement = cfg_list_first(views); velement != NULL; velement = cfg_list_next(velement)) @@ -1228,6 +1259,8 @@ bind9_check_namedconf(cfg_obj_t *config, isc_log_t *logctx, isc_mem_t *mctx) { cfg_obj_t *vclassobj = cfg_tuple_get(view, "class"); dns_rdataclass_t vclass = dns_rdataclass_in; isc_result_t tresult = ISC_R_SUCCESS; + const char *key = cfg_obj_asstring(vname); + isc_symvalue_t symvalue; if (cfg_obj_isstring(vclassobj)) { isc_textregion_t r; @@ -1240,12 +1273,43 @@ bind9_check_namedconf(cfg_obj_t *config, isc_log_t *logctx, isc_mem_t *mctx) { "view '%s': invalid class %s", cfg_obj_asstring(vname), r.base); } + if (tresult == ISC_R_SUCCESS && symtab != NULL) { + symvalue.as_pointer = view; + tresult = isc_symtab_define(symtab, key, vclass, + symvalue, + isc_symexists_reject); + if (tresult == ISC_R_EXISTS) { + const char *file; + unsigned int line; + RUNTIME_CHECK(isc_symtab_lookup(symtab, key, + vclass, &symvalue) == ISC_R_SUCCESS); + file = cfg_obj_file(symvalue.as_pointer); + line = cfg_obj_line(symvalue.as_pointer); + cfg_obj_log(view, logctx, ISC_LOG_ERROR, + "view '%s': already exists " + "previous definition: %s:%u", + key, file, line); + result = tresult; + } else if (result != ISC_R_SUCCESS) { + result = tresult; + } else if ((strcasecmp(key, "_bind") == 0 && + vclass == dns_rdataclass_ch) || + (strcasecmp(key, "_default") == 0 && + vclass == dns_rdataclass_in)) { + cfg_obj_log(view, logctx, ISC_LOG_ERROR, + "attempt to redefine builtin view " + "'%s'", key); + result = ISC_R_EXISTS; + } + } if (tresult == ISC_R_SUCCESS) tresult = check_viewconf(config, voptions, vclass, logctx, mctx); if (tresult != ISC_R_SUCCESS) result = ISC_R_FAILURE; } + if (symtab != NULL) + isc_symtab_destroy(&symtab); if (views != NULL && options != NULL) { obj = NULL; diff --git a/dist/bind/lib/bind9/getaddresses.c b/dist/bind/lib/bind9/getaddresses.c index 2b379b102f5..58745eb4d7e 100644 --- a/dist/bind/lib/bind9/getaddresses.c +++ b/dist/bind/lib/bind9/getaddresses.c @@ -1,4 +1,4 @@ -/* $NetBSD: getaddresses.c,v 1.1.1.1 2004/05/17 23:44:48 christos Exp $ */ +/* $NetBSD: getaddresses.c,v 1.1.1.2 2004/11/06 23:55:34 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -17,7 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* Id: getaddresses.c,v 1.13.126.4 2004/03/08 09:04:27 marka Exp */ +/* Id: getaddresses.c,v 1.13.126.5 2004/05/15 03:46:12 jinmei Exp */ #include <config.h> #include <string.h> @@ -25,6 +25,7 @@ #include <isc/net.h> #include <isc/netaddr.h> #include <isc/netdb.h> +#include <isc/netscope.h> #include <isc/result.h> #include <isc/sockaddr.h> #include <isc/util.h> @@ -69,19 +70,67 @@ bind9_getaddresses(const char *hostname, in_port_t port, have_ipv4 = (isc_net_probeipv4() == ISC_R_SUCCESS); have_ipv6 = (isc_net_probeipv6() == ISC_R_SUCCESS); - if (inet_pton(AF_INET6, hostname, &in6) == 1) { - if (!have_ipv6) - return (ISC_R_FAMILYNOSUPPORT); - isc_sockaddr_fromin6(&addrs[0], &in6, port); - *addrcount = 1; - return (ISC_R_SUCCESS); - } else if (inet_pton(AF_INET, hostname, &in4) == 1) { + /* + * Try IPv4, then IPv6. In order to handle the extended format + * for IPv6 scoped addresses (address%scope_ID), we'll use a local + * working buffer of 128 bytes. The length is an ad-hoc value, but + * should be enough for this purpose; the buffer can contain a string + * of at least 80 bytes for scope_ID in addition to any IPv6 numeric + * addresses (up to 46 bytes), the delimiter character and the + * terminating NULL character. + */ + if (inet_pton(AF_INET, hostname, &in4) == 1) { if (have_ipv4) isc_sockaddr_fromin(&addrs[0], &in4, port); else isc_sockaddr_v6fromin(&addrs[0], &in4, port); *addrcount = 1; return (ISC_R_SUCCESS); + } else if (strlen(hostname) <= 127) { + char tmpbuf[128], *d; + isc_uint32_t zone = 0; + + strcpy(tmpbuf, hostname); + d = strchr(tmpbuf, '%'); + if (d != NULL) + *d = '\0'; + + if (inet_pton(AF_INET6, tmpbuf, &in6) == 1) { + isc_netaddr_t na; + + if (!have_ipv6) + return (ISC_R_FAMILYNOSUPPORT); + + if (d != NULL) { +#ifdef ISC_PLATFORM_HAVESCOPEID + isc_result_t result; + + result = isc_netscope_pton(AF_INET6, d + 1, + &in6, &zone); + + if (result != ISC_R_SUCCESS) + return (result); +#else + /* + * The extended format is specified while the + * system does not provide the ability to use + * it. Throw an explicit error instead of + * ignoring the specified value. + */ + return (ISC_R_BADADDRESSFORM); +#endif + } + + isc_netaddr_fromin6(&na, &in6); + isc_netaddr_setzone(&na, zone); + isc_sockaddr_fromnetaddr(&addrs[0], + (const isc_netaddr_t *)&na, + port); + + *addrcount = 1; + return (ISC_R_SUCCESS); + + } } #ifdef USE_GETADDRINFO memset(&hints, 0, sizeof(hints)); diff --git a/dist/bind/lib/dns/Makefile.in b/dist/bind/lib/dns/Makefile.in index 15996afc583..eb1fd61f172 100644 --- a/dist/bind/lib/dns/Makefile.in +++ b/dist/bind/lib/dns/Makefile.in @@ -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.126.2.3.2.14 2004/04/15 00:34:52 marka Exp +# Id: Makefile.in,v 1.126.2.3.2.15 2004/07/20 07:01:57 marka Exp srcdir = @srcdir@ VPATH = @srcdir@ @@ -107,7 +107,7 @@ libdns.@SA@: ${OBJS} libdns.la: ${OBJS} ${LIBTOOL_MODE_LINK} \ - ${CC} ${ALL_CFLAGS} -o libdns.la -rpath ${libdir} \ + ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o libdns.la -rpath ${libdir} \ -version-info ${LIBINTERFACE}:${LIBREVISION}:${LIBAGE} \ ${OBJS} ${ISCLIBS} @DNS_CRYPTO_LIBS@ ${LIBS} @@ -151,7 +151,7 @@ code.h: gen ./gen -s ${srcdir} > code.h gen: gen.c - ${CC} ${ALL_CFLAGS} -o $@ ${srcdir}/gen.c ${LIBS} + ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o $@ ${srcdir}/gen.c ${LIBS} rbtdb64.@O@: rbtdb.c diff --git a/dist/bind/lib/dns/adb.c b/dist/bind/lib/dns/adb.c index 0272a008f23..192e0c3f170 100644 --- a/dist/bind/lib/dns/adb.c +++ b/dist/bind/lib/dns/adb.c @@ -1,4 +1,4 @@ -/* $NetBSD: adb.c,v 1.1.1.1 2004/05/17 23:44:49 christos Exp $ */ +/* $NetBSD: adb.c,v 1.1.1.2 2004/11/06 23:55:35 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -17,7 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* Id: adb.c,v 1.181.2.11.2.17 2004/03/10 02:55:57 marka Exp */ +/* Id: adb.c,v 1.181.2.11.2.19 2004/09/01 05:19:57 marka Exp */ /* * Implementation notes @@ -1009,6 +1009,8 @@ set_target(dns_adb_t *adb, dns_name_t *name, dns_name_t *fname, dns_fixedname_init(&fixed2); new_target = dns_fixedname_name(&fixed2); dns_name_split(name, nlabels, prefix, NULL); + result = dns_name_concatenate(prefix, &dname.dname, new_target, + NULL); dns_rdata_freestruct(&dname); if (result != ISC_R_SUCCESS) return (result); @@ -1581,7 +1583,7 @@ find_name_and_lock(dns_adb_t *adb, dns_name_t *name, dns_adbname_t *adbname; int bucket; - bucket = dns_fullname_hash(name, ISC_FALSE) % NBUCKETS; + bucket = dns_name_fullhash(name, ISC_FALSE) % NBUCKETS; if (*bucketp == DNS_ADB_INVALIDBUCKET) { LOCK(&adb->namelocks[bucket]); diff --git a/dist/bind/lib/dns/api b/dist/bind/lib/dns/api index a8be9070823..444e0c5cd0c 100644 --- a/dist/bind/lib/dns/api +++ b/dist/bind/lib/dns/api @@ -1,3 +1,3 @@ -LIBINTERFACE = 14 +LIBINTERFACE = 20 LIBREVISION = 0 LIBAGE = 0 diff --git a/dist/bind/lib/dns/byaddr.c b/dist/bind/lib/dns/byaddr.c index 1cfdc079098..f2183f852a0 100644 --- a/dist/bind/lib/dns/byaddr.c +++ b/dist/bind/lib/dns/byaddr.c @@ -1,4 +1,4 @@ -/* $NetBSD: byaddr.c,v 1.1.1.1 2004/05/17 23:44:48 christos Exp $ */ +/* $NetBSD: byaddr.c,v 1.1.1.2 2004/11/06 23:55:34 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -17,12 +17,13 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* Id: byaddr.c,v 1.29.2.1.2.7 2004/03/09 05:21:08 marka Exp */ +/* Id: byaddr.c,v 1.29.2.1.2.8 2004/08/28 06:25:18 marka Exp */ #include <config.h> #include <isc/mem.h> #include <isc/netaddr.h> +#include <isc/print.h> #include <isc/string.h> /* Required for HP/UX (and others?) */ #include <isc/task.h> #include <isc/util.h> diff --git a/dist/bind/lib/dns/dispatch.c b/dist/bind/lib/dns/dispatch.c index e9d05054697..cd600f90bd3 100644 --- a/dist/bind/lib/dns/dispatch.c +++ b/dist/bind/lib/dns/dispatch.c @@ -1,4 +1,4 @@ -/* $NetBSD: dispatch.c,v 1.1.1.1 2004/05/17 23:44:49 christos Exp $ */ +/* $NetBSD: dispatch.c,v 1.1.1.2 2004/11/06 23:55:36 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -17,7 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* Id: dispatch.c,v 1.101.2.6.2.7 2004/04/15 02:10:39 marka Exp */ +/* Id: dispatch.c,v 1.101.2.6.2.10 2004/09/01 04:27:41 marka Exp */ #include <config.h> @@ -157,14 +157,14 @@ static isc_boolean_t destroy_disp_ok(dns_dispatch_t *); static void destroy_disp(isc_task_t *task, isc_event_t *event); static void udp_recv(isc_task_t *, isc_event_t *); static void tcp_recv(isc_task_t *, isc_event_t *); -static inline void startrecv(dns_dispatch_t *); +static void startrecv(dns_dispatch_t *); static dns_messageid_t dns_randomid(dns_qid_t *); static isc_uint32_t dns_hash(dns_qid_t *, isc_sockaddr_t *, dns_messageid_t); static void free_buffer(dns_dispatch_t *disp, void *buf, unsigned int len); static void *allocate_udp_buffer(dns_dispatch_t *disp); static inline void free_event(dns_dispatch_t *disp, dns_dispatchevent_t *ev); static inline dns_dispatchevent_t *allocate_event(dns_dispatch_t *disp); -static void do_cancel(dns_dispatch_t *disp, dns_dispentry_t *resp); +static void do_cancel(dns_dispatch_t *disp); static dns_dispentry_t *linear_first(dns_qid_t *disp); static dns_dispentry_t *linear_next(dns_qid_t *disp, dns_dispentry_t *resp); @@ -629,26 +629,25 @@ udp_recv(isc_task_t *task, isc_event_t *ev_in) { /* query */ free_buffer(disp, ev->region.base, ev->region.length); goto restart; - } else { - /* response */ - bucket = dns_hash(qid, &ev->address, id); - LOCK(&qid->lock); - resp = bucket_search(qid, &ev->address, id, bucket); - UNLOCK(&qid->lock); - dispatch_log(disp, LVL(90), - "search for response in bucket %d: %s", - bucket, (resp == NULL ? "not found" : "found")); - - if (resp == NULL) { - free_buffer(disp, ev->region.base, ev->region.length); - goto restart; - } - queue_response = resp->item_out; - rev = allocate_event(resp->disp); - if (rev == NULL) { - free_buffer(disp, ev->region.base, ev->region.length); - goto restart; - } + } + + /* response */ + bucket = dns_hash(qid, &ev->address, id); + LOCK(&qid->lock); + resp = bucket_search(qid, &ev->address, id, bucket); + dispatch_log(disp, LVL(90), + "search for response in bucket %d: %s", + bucket, (resp == NULL ? "not found" : "found")); + + if (resp == NULL) { + free_buffer(disp, ev->region.base, ev->region.length); + goto unlock; + } + queue_response = resp->item_out; + rev = allocate_event(resp->disp); + if (rev == NULL) { + free_buffer(disp, ev->region.base, ev->region.length); + goto unlock; } /* @@ -676,6 +675,8 @@ udp_recv(isc_task_t *task, isc_event_t *ev_in) { resp->item_out = ISC_TRUE; isc_task_send(resp->task, ISC_EVENT_PTR(&rev)); } + unlock: + UNLOCK(&qid->lock); /* * Restart recv() to get the next packet. @@ -748,7 +749,7 @@ tcp_recv(isc_task_t *task, isc_event_t *ev_in) { case ISC_R_EOF: dispatch_log(disp, LVL(90), "shutting down on EOF"); - do_cancel(disp, NULL); + do_cancel(disp); break; case ISC_R_CONNECTIONRESET: @@ -762,7 +763,7 @@ tcp_recv(isc_task_t *task, isc_event_t *ev_in) { dispatch_log(disp, level, "shutting down due to TCP " "receive error: %s: %s", buf, isc_result_totext(tcpmsg->result)); - do_cancel(disp, NULL); + do_cancel(disp); break; } @@ -818,27 +819,26 @@ tcp_recv(isc_task_t *task, isc_event_t *ev_in) { * Query. */ goto restart; - } else { - /* - * Response. - */ - bucket = dns_hash(qid, &tcpmsg->address, id); - LOCK(&qid->lock); - resp = bucket_search(qid, &tcpmsg->address, id, bucket); - UNLOCK(&qid->lock); - dispatch_log(disp, LVL(90), - "search for response in bucket %d: %s", - bucket, (resp == NULL ? "not found" : "found")); - - if (resp == NULL) - goto restart; - queue_response = resp->item_out; - rev = allocate_event(disp); - if (rev == NULL) - goto restart; } /* + * Response. + */ + bucket = dns_hash(qid, &tcpmsg->address, id); + LOCK(&qid->lock); + resp = bucket_search(qid, &tcpmsg->address, id, bucket); + dispatch_log(disp, LVL(90), + "search for response in bucket %d: %s", + bucket, (resp == NULL ? "not found" : "found")); + + if (resp == NULL) + goto unlock; + queue_response = resp->item_out; + rev = allocate_event(disp); + if (rev == NULL) + goto unlock; + + /* * At this point, rev contains the event we want to fill in, and * resp contains the information on the place to send it to. * Send the event off. @@ -860,6 +860,8 @@ tcp_recv(isc_task_t *task, isc_event_t *ev_in) { resp->item_out = ISC_TRUE; isc_task_send(resp->task, ISC_EVENT_PTR(&rev)); } + unlock: + UNLOCK(&qid->lock); /* * Restart recv() to get the next packet. @@ -907,7 +909,7 @@ startrecv(dns_dispatch_t *disp) { free_buffer(disp, region.base, region.length); disp->shutdown_why = res; disp->shutting_down = 1; - do_cancel(disp, NULL); + do_cancel(disp); return; } INSIST(disp->recv_pending == 0); @@ -920,7 +922,7 @@ startrecv(dns_dispatch_t *disp) { if (res != ISC_R_SUCCESS) { disp->shutdown_why = res; disp->shutting_down = 1; - do_cancel(disp, NULL); + do_cancel(disp); return; } INSIST(disp->recv_pending == 0); @@ -1296,7 +1298,7 @@ local_addr_match(dns_dispatch_t *disp, isc_sockaddr_t *addr) { if (result != ISC_R_SUCCESS) return (ISC_FALSE); - return (isc_sockaddr_equal(&disp->local, &sockaddr)); + return (isc_sockaddr_equal(&sockaddr, addr)); } /* @@ -2020,7 +2022,7 @@ dns_dispatch_removeresponse(dns_dispentry_t **resp, res->magic = 0; isc_mempool_put(disp->mgr->rpool, res); if (disp->shutting_down == 1) - do_cancel(disp, NULL); + do_cancel(disp); else startrecv(disp); @@ -2031,8 +2033,9 @@ dns_dispatch_removeresponse(dns_dispentry_t **resp, } static void -do_cancel(dns_dispatch_t *disp, dns_dispentry_t *resp) { +do_cancel(dns_dispatch_t *disp) { dns_dispatchevent_t *ev; + dns_dispentry_t *resp; dns_qid_t *qid; if (disp->shutdown_out == 1) @@ -2043,28 +2046,16 @@ do_cancel(dns_dispatch_t *disp, dns_dispentry_t *resp) { /* * Search for the first response handler without packets outstanding. */ - if (resp == NULL) { - LOCK(&qid->lock); - resp = linear_first(qid); - if (resp == NULL) { - /* no first item? */ - UNLOCK(&qid->lock); - return; - } - do { - if (resp->item_out == ISC_FALSE) - break; - - resp = linear_next(qid, resp); - } while (resp != NULL); - UNLOCK(&qid->lock); - } - + LOCK(&qid->lock); + for (resp = linear_first(qid); + resp != NULL && resp->item_out != ISC_FALSE; + /* Empty. */) + resp = linear_next(qid, resp); /* * No one to send the cancel event to, so nothing to do. */ if (resp == NULL) - return; + goto unlock; /* * Send the shutdown failsafe event to this resp. @@ -2081,6 +2072,8 @@ do_cancel(dns_dispatch_t *disp, dns_dispentry_t *resp) { ev, resp->task); resp->item_out = ISC_TRUE; isc_task_send(resp->task, ISC_EVENT_PTR(&ev)); + unlock: + UNLOCK(&qid->lock); } isc_socket_t * @@ -2116,7 +2109,7 @@ dns_dispatch_cancel(dns_dispatch_t *disp) { disp->shutdown_why = ISC_R_CANCELED; disp->shutting_down = 1; - do_cancel(disp, NULL); + do_cancel(disp); UNLOCK(&disp->lock); diff --git a/dist/bind/lib/dns/dnssec.c b/dist/bind/lib/dns/dnssec.c index 51f85529fe8..4787f308974 100644 --- a/dist/bind/lib/dns/dnssec.c +++ b/dist/bind/lib/dns/dnssec.c @@ -1,4 +1,4 @@ -/* $NetBSD: dnssec.c,v 1.1.1.1 2004/05/17 23:44:50 christos Exp $ */ +/* $NetBSD: dnssec.c,v 1.1.1.2 2004/11/06 23:55:36 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -18,7 +18,7 @@ */ /* - * Id: dnssec.c,v 1.69.2.5.2.6 2004/03/08 21:06:26 marka Exp + * Id: dnssec.c,v 1.69.2.5.2.7 2004/06/11 00:30:54 marka Exp */ @@ -136,6 +136,8 @@ dns_dnssec_keyfromrdata(dns_name_t *name, dns_rdata_t *rdata, isc_mem_t *mctx, INSIST(mctx != NULL); INSIST(key != NULL); INSIST(*key == NULL); + REQUIRE(rdata->type == dns_rdatatype_key || + rdata->type == dns_rdatatype_dnskey); dns_rdata_toregion(rdata, &r); isc_buffer_init(&b, r.base, r.length); diff --git a/dist/bind/lib/dns/include/dns/db.h b/dist/bind/lib/dns/include/dns/db.h index 58e78ffb09c..c2ca6510acb 100644 --- a/dist/bind/lib/dns/include/dns/db.h +++ b/dist/bind/lib/dns/include/dns/db.h @@ -1,4 +1,4 @@ -/* $NetBSD: db.h,v 1.1.1.1 2004/05/17 23:44:57 christos Exp $ */ +/* $NetBSD: db.h,v 1.1.1.2 2004/11/06 23:55:44 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -17,7 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* Id: db.h,v 1.67.12.7 2004/03/08 09:04:35 marka Exp */ +/* Id: db.h,v 1.67.12.8 2004/05/14 05:06:41 marka Exp */ #ifndef DNS_DB_H #define DNS_DB_H 1 @@ -190,6 +190,7 @@ struct dns_db { #define DNS_DBFIND_PENDINGOK 0x08 #define DNS_DBFIND_NOEXACT 0x10 #define DNS_DBFIND_FORCENSEC 0x20 +#define DNS_DBFIND_COVERINGNSEC 0x40 /* * Options that can be specified for dns_db_addrdataset(). @@ -649,6 +650,12 @@ dns_db_find(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version, * is only necessary when querying a database that was not secure * when created. * + * If the DNS_DBFIND_COVERINGNSEC option is set, then look for a + * NSEC record that potentially covers 'name' if a answer cannot + * be found. Note the returned NSEC needs to be checked to ensure + * that it is correct. This only affects answers returned from the + * cache. + * * To respond to a query for SIG records, the caller should create a * rdataset iterator and extract the signatures from each rdataset. * @@ -772,6 +779,9 @@ dns_db_find(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version, * DNS_R_EMPTYNAME The name exists but there is * no data at the name. * + * DNS_R_COVERINGNSEC The returned data is a NSEC + * that potentially covers 'name'. + * * Error results: * * ISC_R_NOMEMORY diff --git a/dist/bind/lib/dns/include/dns/name.h b/dist/bind/lib/dns/include/dns/name.h index a3aa4e93b69..7370f151227 100644 --- a/dist/bind/lib/dns/include/dns/name.h +++ b/dist/bind/lib/dns/include/dns/name.h @@ -1,4 +1,4 @@ -/* $NetBSD: name.h,v 1.1.1.1 2004/05/17 23:44:58 christos Exp $ */ +/* $NetBSD: name.h,v 1.1.1.2 2004/11/06 23:55:45 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -17,7 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* Id: name.h,v 1.95.2.3.2.8 2004/03/16 12:57:17 marka Exp */ +/* Id: name.h,v 1.95.2.3.2.11 2004/09/01 05:19:59 marka Exp */ #ifndef DNS_NAME_H #define DNS_NAME_H 1 @@ -314,7 +314,7 @@ dns_name_hash(dns_name_t *name, isc_boolean_t case_sensitive); */ unsigned int -dns_fullname_hash(dns_name_t *name, isc_boolean_t case_sensitive); +dns_name_fullhash(dns_name_t *name, isc_boolean_t case_sensitive); /* * Provide a hash value for 'name'. Unlike dns_name_hash(), this function * always takes into account of the entire name to calculate the hash value. @@ -575,6 +575,9 @@ dns_name_getlabelsequence(const dns_name_t *source, unsigned int first, * Notes: * Numbering starts at 0. * + * Given "rc.vix.com.", the label 0 is "rc", and label 3 is the + * root label. + * * 'target' refers to the same memory as 'source', so 'source' * must not be changed while 'target' is still in use. * @@ -1216,7 +1219,7 @@ do { \ do { \ (r)->base = (n)->ndata; \ (r)->length = (n)->length; \ -} while (0); +} while (0) #define DNS_NAME_SPLIT(n, l, p, s) \ do { \ @@ -1228,7 +1231,7 @@ do { \ dns_name_getlabelsequence(_n, 0, _n->labels - _l, _p); \ if (_s != NULL) \ dns_name_getlabelsequence(_n, _n->labels - _l, _l, _s); \ -} while (0); +} while (0) #ifdef DNS_NAME_USEINLINE diff --git a/dist/bind/lib/dns/include/dns/result.h b/dist/bind/lib/dns/include/dns/result.h index d2fc5c76b58..bf98b76e610 100644 --- a/dist/bind/lib/dns/include/dns/result.h +++ b/dist/bind/lib/dns/include/dns/result.h @@ -1,4 +1,4 @@ -/* $NetBSD: result.h,v 1.1.1.1 2004/05/17 23:44:58 christos Exp $ */ +/* $NetBSD: result.h,v 1.1.1.2 2004/11/06 23:55:45 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -17,7 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* Id: result.h,v 1.81.2.7.2.12 2004/04/15 23:56:32 marka Exp */ +/* Id: result.h,v 1.81.2.7.2.13 2004/05/14 05:06:41 marka Exp */ #ifndef DNS_RESULT_H #define DNS_RESULT_H 1 @@ -144,8 +144,9 @@ #define DNS_R_DYNAMIC (ISC_RESULTCLASS_DNS + 98) #define DNS_R_UNKNOWNCOMMAND (ISC_RESULTCLASS_DNS + 99) #define DNS_R_MUSTBESECURE (ISC_RESULTCLASS_DNS + 100) +#define DNS_R_COVERINGNSEC (ISC_RESULTCLASS_DNS + 101) -#define DNS_R_NRESULTS 101 /* Number of results */ +#define DNS_R_NRESULTS 102 /* Number of results */ /* * DNS wire format rcodes. diff --git a/dist/bind/lib/dns/include/dns/validator.h b/dist/bind/lib/dns/include/dns/validator.h index 578222d3cbe..98ca73586c8 100644 --- a/dist/bind/lib/dns/include/dns/validator.h +++ b/dist/bind/lib/dns/include/dns/validator.h @@ -1,4 +1,4 @@ -/* $NetBSD: validator.h,v 1.1.1.1 2004/05/17 23:44:58 christos Exp $ */ +/* $NetBSD: validator.h,v 1.1.1.2 2004/11/06 23:55:45 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -17,7 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* Id: validator.h,v 1.18.12.6 2004/04/15 23:56:33 marka Exp */ +/* Id: validator.h,v 1.18.12.7 2004/05/14 05:06:41 marka Exp */ #ifndef DNS_VALIDATOR_H #define DNS_VALIDATOR_H 1 @@ -123,6 +123,8 @@ struct dns_validator { dns_fixedname_t wild; ISC_LINK(dns_validator_t) link; dns_rdataset_t * dlv; + dns_fixedname_t dlvsep; + isc_boolean_t havedlvsep; isc_boolean_t mustbesecure; }; diff --git a/dist/bind/lib/dns/journal.c b/dist/bind/lib/dns/journal.c index 42a331c07c7..7433e39e7f1 100644 --- a/dist/bind/lib/dns/journal.c +++ b/dist/bind/lib/dns/journal.c @@ -1,4 +1,4 @@ -/* $NetBSD: journal.c,v 1.1.1.1 2004/05/17 23:44:50 christos Exp $ */ +/* $NetBSD: journal.c,v 1.1.1.2 2004/11/06 23:55:37 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -17,7 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* Id: journal.c,v 1.77.2.1.10.6 2004/03/08 09:04:30 marka Exp */ +/* Id: journal.c,v 1.77.2.1.10.8 2004/05/14 05:27:47 marka Exp */ #include <config.h> @@ -1824,10 +1824,16 @@ dns_db_diff(isc_mem_t *mctx, dns_fixedname_init(&fixname[0]); dns_fixedname_init(&fixname[1]); - CHECK(dns_journal_open(mctx, journal_filename, ISC_TRUE, &journal)); + result = dns_journal_open(mctx, journal_filename, ISC_TRUE, &journal); + if (result != ISC_R_SUCCESS) + return (result); - CHECK(dns_db_createiterator(db[0], ISC_FALSE, &dbit[0])); - CHECK(dns_db_createiterator(db[1], ISC_FALSE, &dbit[1])); + result = dns_db_createiterator(db[0], ISC_FALSE, &dbit[0]); + if (result != ISC_R_SUCCESS) + goto cleanup_journal; + result = dns_db_createiterator(db[1], ISC_FALSE, &dbit[1]); + if (result != ISC_R_SUCCESS) + goto cleanup_interator0; itresult[0] = dns_dbiterator_first(dbit[0]); itresult[1] = dns_dbiterator_first(dbit[1]); @@ -1900,8 +1906,10 @@ dns_db_diff(isc_mem_t *mctx, failure: dns_diff_clear(&resultdiff); - dns_dbiterator_destroy(&dbit[0]); dns_dbiterator_destroy(&dbit[1]); + cleanup_interator0: + dns_dbiterator_destroy(&dbit[0]); + cleanup_journal: dns_journal_destroy(&journal); return (result); } @@ -2117,6 +2125,7 @@ index_to_disk(dns_journal_t *j) { } INSIST(p == j->rawindex + rawbytes); + CHECK(journal_seek(j, sizeof(journal_rawheader_t))); CHECK(journal_write(j, j->rawindex, rawbytes)); } failure: diff --git a/dist/bind/lib/dns/master.c b/dist/bind/lib/dns/master.c index 50b796512c5..43a6d2f64ec 100644 --- a/dist/bind/lib/dns/master.c +++ b/dist/bind/lib/dns/master.c @@ -1,4 +1,4 @@ -/* $NetBSD: master.c,v 1.1.1.1 2004/05/17 23:44:51 christos Exp $ */ +/* $NetBSD: master.c,v 1.1.1.2 2004/11/06 23:55:37 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -17,7 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* Id: master.c,v 1.122.2.8.2.13 2004/03/08 02:07:53 marka Exp */ +/* Id: master.c,v 1.122.2.8.2.14 2004/05/05 01:32:16 marka Exp */ #include <config.h> @@ -1647,7 +1647,8 @@ load(dns_loadctx_t *lctx) { } - if (type == dns_rdatatype_rrsig) + if (type == dns_rdatatype_rrsig || + type == dns_rdatatype_sig) covers = dns_rdata_covers(&rdata[rdcount]); else covers = 0; diff --git a/dist/bind/lib/dns/masterdump.c b/dist/bind/lib/dns/masterdump.c index ab3cf3d2e28..f3457bbda06 100644 --- a/dist/bind/lib/dns/masterdump.c +++ b/dist/bind/lib/dns/masterdump.c @@ -1,4 +1,4 @@ -/* $NetBSD: masterdump.c,v 1.1.1.1 2004/05/17 23:44:49 christos Exp $ */ +/* $NetBSD: masterdump.c,v 1.1.1.2 2004/11/06 23:55:35 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -17,7 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* Id: masterdump.c,v 1.56.2.5.2.10 2004/03/08 09:04:30 marka Exp */ +/* Id: masterdump.c,v 1.56.2.5.2.12 2004/08/28 06:25:19 marka Exp */ #include <config.h> @@ -27,6 +27,7 @@ #include <isc/file.h> #include <isc/magic.h> #include <isc/mem.h> +#include <isc/print.h> #include <isc/stdio.h> #include <isc/string.h> #include <isc/task.h> @@ -981,6 +982,7 @@ closeandrename(FILE *f, isc_result_t result, const char *temp, const char *file) static void dump_quantum(isc_task_t *task, isc_event_t *event) { isc_result_t result; + isc_result_t tresult; dns_dumpctx_t *dctx; REQUIRE(event != NULL); @@ -996,11 +998,12 @@ dump_quantum(isc_task_t *task, isc_event_t *event) { return; } - if (dctx->file != NULL) - result = closeandrename(dctx->f, result, - dctx->tmpfile, dctx->file); - if (dctx->version != NULL) - dns_db_closeversion(dctx->db, &dctx->version, ISC_FALSE); + if (dctx->file != NULL) { + tresult = closeandrename(dctx->f, result, + dctx->tmpfile, dctx->file); + if (tresult != ISC_R_SUCCESS && result == ISC_R_SUCCESS) + result = tresult; + } (dctx->done)(dctx->done_arg, result); isc_event_free(&event); dns_dumpctx_detach(&dctx); diff --git a/dist/bind/lib/dns/message.c b/dist/bind/lib/dns/message.c index 693930d1863..30be78789fe 100644 --- a/dist/bind/lib/dns/message.c +++ b/dist/bind/lib/dns/message.c @@ -1,4 +1,4 @@ -/* $NetBSD: message.c,v 1.1.1.1 2004/05/17 23:44:51 christos Exp $ */ +/* $NetBSD: message.c,v 1.1.1.2 2004/11/06 23:55:38 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -17,7 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* Id: message.c,v 1.194.2.10.2.16 2004/03/10 00:48:49 marka Exp */ +/* Id: message.c,v 1.194.2.10.2.17 2004/05/05 01:32:16 marka Exp */ /*** *** Imports @@ -1290,18 +1290,16 @@ getsection(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx, if (result != ISC_R_SUCCESS) goto cleanup; rdata->rdclass = rdclass; + issigzero = ISC_FALSE; if (rdtype == dns_rdatatype_rrsig && rdata->flags == 0) { covers = dns_rdata_covers(rdata); if (covers == 0) DO_FORMERR; - } else - covers = 0; - - issigzero = ISC_FALSE; - if (rdtype == dns_rdatatype_sig /* SIG(0) */ && - rdata->flags == 0) { - if (dns_rdata_covers(rdata) == 0) { + } else if (rdtype == dns_rdatatype_sig /* SIG(0) */ && + rdata->flags == 0) { + covers = dns_rdata_covers(rdata); + if (covers == 0) { if (sectionid != DNS_SECTION_ADDITIONAL || count != msg->counts[sectionid] - 1) DO_FORMERR; @@ -1310,7 +1308,8 @@ getsection(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx, skip_type_search = ISC_TRUE; issigzero = ISC_TRUE; } - } + } else + covers = 0; /* * If we are doing a dynamic update or this is a meta-type, diff --git a/dist/bind/lib/dns/name.c b/dist/bind/lib/dns/name.c index 8f6261e96f1..dac5874e8f4 100644 --- a/dist/bind/lib/dns/name.c +++ b/dist/bind/lib/dns/name.c @@ -1,4 +1,4 @@ -/* $NetBSD: name.c,v 1.1.1.1 2004/05/17 23:44:51 christos Exp $ */ +/* $NetBSD: name.c,v 1.1.1.2 2004/11/06 23:55:38 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -17,7 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* Id: name.c,v 1.127.2.7.2.10 2004/04/19 21:55:38 marka Exp */ +/* Id: name.c,v 1.127.2.7.2.11 2004/09/01 05:19:59 marka Exp */ #include <config.h> @@ -181,6 +181,9 @@ static dns_name_t wild = /* XXXDCL make const? */ LIBDNS_EXTERNAL_DATA dns_name_t *dns_wildcardname = &wild; +unsigned int +dns_fullname_hash(dns_name_t *name, isc_boolean_t case_sensitive); + static void set_offsets(const dns_name_t *name, unsigned char *offsets, dns_name_t *set_name); @@ -432,7 +435,7 @@ dns_name_hash(dns_name_t *name, isc_boolean_t case_sensitive) { } unsigned int -dns_fullname_hash(dns_name_t *name, isc_boolean_t case_sensitive) { +dns_name_fullhash(dns_name_t *name, isc_boolean_t case_sensitive) { /* * Provide a hash value for 'name'. */ @@ -446,6 +449,18 @@ dns_fullname_hash(dns_name_t *name, isc_boolean_t case_sensitive) { } unsigned int +dns_fullname_hash(dns_name_t *name, isc_boolean_t case_sensitive) { + /* + * This function was deprecated due to the breakage of the name space + * convention. We only keep this internally to provide binary backward + * compatibility. + */ + REQUIRE(VALID_NAME(name)); + + return (dns_name_fullhash(name, case_sensitive)); +} + +unsigned int dns_name_hashbylabel(dns_name_t *name, isc_boolean_t case_sensitive) { unsigned char *offsets; dns_offsets_t odata; diff --git a/dist/bind/lib/dns/rbtdb.c b/dist/bind/lib/dns/rbtdb.c index 87e9f72f227..181af9195c7 100644 --- a/dist/bind/lib/dns/rbtdb.c +++ b/dist/bind/lib/dns/rbtdb.c @@ -1,4 +1,4 @@ -/* $NetBSD: rbtdb.c,v 1.1.1.1 2004/05/17 23:44:52 christos Exp $ */ +/* $NetBSD: rbtdb.c,v 1.1.1.2 2004/11/06 23:55:39 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -17,7 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* Id: rbtdb.c,v 1.168.2.11.2.12 2004/03/08 02:07:55 marka Exp */ +/* Id: rbtdb.c,v 1.168.2.11.2.16 2004/05/23 11:07:23 marka Exp */ /* * Principal Author: Bob Halley @@ -844,8 +844,7 @@ clean_zone_node(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node, /* * If this is a NONEXISTENT rdataset, we can delete it. */ - if ((current->attributes & RDATASET_ATTR_NONEXISTENT) - != 0) { + if (NONEXISTENT(current)) { if (top_prev != NULL) top_prev->next = current->next; else @@ -1064,9 +1063,13 @@ closeversion(dns_db_t *db, dns_dbversion_t **versionp, isc_boolean_t commit) { * isn't being used by anyone, we can clean * it up. */ - if (rbtdb->current_version->references == 0) + if (rbtdb->current_version->references == 0) { cleanup_version = rbtdb->current_version; + APPENDLIST(version->changed_list, + cleanup_version->changed_list, + link); + } /* * Become the current version. */ @@ -1079,6 +1082,7 @@ closeversion(dns_db_t *db, dns_dbversion_t **versionp, isc_boolean_t commit) { * We're rolling back this transaction. */ cleanup_list = version->changed_list; + ISC_LIST_INIT(version->changed_list); rollback = ISC_TRUE; cleanup_version = version; rbtdb->future_version = NULL; @@ -1099,6 +1103,7 @@ closeversion(dns_db_t *db, dns_dbversion_t **versionp, isc_boolean_t commit) { if (least_greater == NULL) least_greater = rbtdb->current_version; + INSIST(version->serial < least_greater->serial); /* * Is this the least open version? */ @@ -1119,16 +1124,19 @@ closeversion(dns_db_t *db, dns_dbversion_t **versionp, isc_boolean_t commit) { version->changed_list, link); } - } + } else if (version->serial == rbtdb->least_serial) + INSIST(EMPTY(version->changed_list)); UNLINK(rbtdb->open_versions, version, link); } } least_serial = rbtdb->least_serial; UNLOCK(&rbtdb->lock); - if (cleanup_version != NULL) + if (cleanup_version != NULL) { + INSIST(EMPTY(cleanup_version->changed_list)); isc_mem_put(rbtdb->common.mctx, cleanup_version, sizeof(*cleanup_version)); + } if (!EMPTY(cleanup_list)) { for (changed = HEAD(cleanup_list); @@ -1933,8 +1941,7 @@ find_closest_nsec(rbtdb_search_t *search, dns_dbnode_t **nodep, * Is this a "this rdataset doesn't * exist" record? */ - if ((header->attributes & - RDATASET_ATTR_NONEXISTENT) != 0) + if (NONEXISTENT(header)) header = NULL; break; } else @@ -2206,8 +2213,7 @@ zone_find(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version, * Is this a "this rdataset doesn't * exist" record? */ - if ((header->attributes & - RDATASET_ATTR_NONEXISTENT) != 0) + if (NONEXISTENT(header)) header = NULL; break; } else @@ -2660,8 +2666,7 @@ find_deepest_zonecut(rbtdb_search_t *search, dns_rbtnode_t *node, node->dirty = 1; header_prev = header; } - } else if ((header->attributes & - RDATASET_ATTR_NONEXISTENT) == 0) { + } else if (EXISTS(header)) { /* * We've found an extant rdataset. See if * we're interested in it. @@ -2738,6 +2743,104 @@ find_deepest_zonecut(rbtdb_search_t *search, dns_rbtnode_t *node, } static isc_result_t +find_coveringnsec(rbtdb_search_t *search, dns_dbnode_t **nodep, + isc_stdtime_t now, dns_name_t *foundname, + dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset) +{ + dns_rbtnode_t *node; + rdatasetheader_t *header, *header_next, *header_prev; + rdatasetheader_t *found, *foundsig; + isc_boolean_t empty_node; + isc_result_t result; + dns_fixedname_t fname, forigin; + dns_name_t *name, *origin; + rbtdb_rdatatype_t matchtype, sigmatchtype, nsectype; + + matchtype = RBTDB_RDATATYPE_VALUE(dns_rdatatype_nsec, 0); + nsectype = RBTDB_RDATATYPE_VALUE(0, dns_rdatatype_nsec); + sigmatchtype = RBTDB_RDATATYPE_VALUE(dns_rdatatype_rrsig, + dns_rdatatype_nsec); + + do { + node = NULL; + dns_fixedname_init(&fname); + name = dns_fixedname_name(&fname); + dns_fixedname_init(&forigin); + origin = dns_fixedname_name(&forigin); + result = dns_rbtnodechain_current(&search->chain, name, + origin, &node); + if (result != ISC_R_SUCCESS) + return (result); + LOCK(&(search->rbtdb->node_locks[node->locknum].lock)); + found = NULL; + foundsig = NULL; + empty_node = ISC_TRUE; + header_prev = NULL; + for (header = node->data; + header != NULL; + header = header_next) { + header_next = header->next; + if (header->ttl <= now) { + /* + * This rdataset is stale. If no one else is + * using the node, we can clean it up right + * now, otherwise we mark it as stale, and the + * node as dirty, so it will get cleaned up + * later. + */ + if (node->references == 0) { + INSIST(header->down == NULL); + if (header_prev != NULL) + header_prev->next = + header->next; + else + node->data = header->next; + free_rdataset(search->rbtdb->common.mctx, + header); + } else { + header->attributes |= + RDATASET_ATTR_STALE; + node->dirty = 1; + header_prev = header; + } + continue; + } + if (NONEXISTENT(header) || NXDOMAIN(header)) { + header_prev = header; + continue; + } + empty_node = ISC_FALSE; + if (header->type == matchtype) + found = header; + else if (header->type == sigmatchtype) + foundsig = header; + header_prev = header; + } + if (found != NULL) { + result = dns_name_concatenate(name, origin, + foundname, NULL); + if (result != ISC_R_SUCCESS) + goto unlock_node; + bind_rdataset(search->rbtdb, node, found, + now, rdataset); + if (foundsig != NULL) + bind_rdataset(search->rbtdb, node, foundsig, + now, sigrdataset); + new_reference(search->rbtdb, node); + *nodep = node; + result = DNS_R_COVERINGNSEC; + } else if (!empty_node) { + result = ISC_R_NOTFOUND; + }else + result = dns_rbtnodechain_prev(&search->chain, NULL, + NULL); + unlock_node: + UNLOCK(&(search->rbtdb->node_locks[node->locknum].lock)); + } while (empty_node && result == ISC_R_SUCCESS); + return (result); +} + +static isc_result_t cache_find(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version, dns_rdatatype_t type, unsigned int options, isc_stdtime_t now, dns_dbnode_t **nodep, dns_name_t *foundname, @@ -2752,7 +2855,7 @@ cache_find(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version, rdatasetheader_t *header, *header_prev, *header_next; rdatasetheader_t *found, *nsheader; rdatasetheader_t *foundsig, *nssig, *cnamesig; - rbtdb_rdatatype_t sigtype, nsecype; + rbtdb_rdatatype_t sigtype, nsectype; UNUSED(version); @@ -2787,6 +2890,13 @@ cache_find(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version, cache_zonecut_callback, &search); if (result == DNS_R_PARTIALMATCH) { + if ((search.options & DNS_DBFIND_COVERINGNSEC) != 0) { + result = find_coveringnsec(&search, nodep, now, + foundname, rdataset, + sigrdataset); + if (result == DNS_R_COVERINGNSEC) + goto tree_exit; + } if (search.zonecut != NULL) { result = setup_delegation(&search, nodep, foundname, rdataset, sigrdataset); @@ -2820,7 +2930,7 @@ cache_find(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version, found = NULL; foundsig = NULL; sigtype = RBTDB_RDATATYPE_VALUE(dns_rdatatype_rrsig, type); - nsecype = RBTDB_RDATATYPE_VALUE(0, type); + nsectype = RBTDB_RDATATYPE_VALUE(0, type); nsheader = NULL; nssig = NULL; cnamesig = NULL; @@ -2848,8 +2958,7 @@ cache_find(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version, node->dirty = 1; header_prev = header; } - } else if ((header->attributes & RDATASET_ATTR_NONEXISTENT) - == 0) { + } else if (EXISTS(header)) { /* * We now know that there is at least one active * non-stale rdataset at this node. @@ -2891,7 +3000,7 @@ cache_find(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version, */ foundsig = header; } else if (header->type == RBTDB_RDATATYPE_NCACHEANY || - header->type == nsecype) { + header->type == nsectype) { /* * We've found a negative cache entry. */ @@ -3116,8 +3225,7 @@ cache_findzonecut(dns_db_t *db, dns_name_t *name, unsigned int options, node->dirty = 1; header_prev = header; } - } else if ((header->attributes & RDATASET_ATTR_NONEXISTENT) - == 0) { + } else if (EXISTS(header)) { /* * If we found a type we were looking for, remember * it. @@ -3180,6 +3288,7 @@ attachnode(dns_db_t *db, dns_dbnode_t *source, dns_dbnode_t **targetp) { dns_rbtnode_t *node = (dns_rbtnode_t *)source; REQUIRE(VALID_RBTDB(rbtdb)); + REQUIRE(targetp != NULL && *targetp == NULL); LOCK(&rbtdb->node_locks[node->locknum].lock); INSIST(node->references > 0); @@ -3450,8 +3559,7 @@ zone_findrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version, * Is this a "this rdataset doesn't * exist" record? */ - if ((header->attributes & - RDATASET_ATTR_NONEXISTENT) != 0) + if (NONEXISTENT(header)) header = NULL; break; } else @@ -3501,7 +3609,7 @@ cache_findrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version, dns_rbtdb_t *rbtdb = (dns_rbtdb_t *)db; dns_rbtnode_t *rbtnode = (dns_rbtnode_t *)node; rdatasetheader_t *header, *header_next, *found, *foundsig; - rbtdb_rdatatype_t matchtype, sigmatchtype, nsecype; + rbtdb_rdatatype_t matchtype, sigmatchtype, nsectype; isc_result_t result; REQUIRE(VALID_RBTDB(rbtdb)); @@ -3519,7 +3627,7 @@ cache_findrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version, found = NULL; foundsig = NULL; matchtype = RBTDB_RDATATYPE_VALUE(type, covers); - nsecype = RBTDB_RDATATYPE_VALUE(0, type); + nsectype = RBTDB_RDATATYPE_VALUE(0, type); if (covers == 0) sigmatchtype = RBTDB_RDATATYPE_VALUE(dns_rdatatype_rrsig, type); else @@ -3536,12 +3644,11 @@ cache_findrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version, */ header->attributes |= RDATASET_ATTR_STALE; rbtnode->dirty = 1; - } else if ((header->attributes & RDATASET_ATTR_NONEXISTENT) == - 0) { + } else if (EXISTS(header)) { if (header->type == matchtype) found = header; else if (header->type == RBTDB_RDATATYPE_NCACHEANY || - header->type == nsecype) + header->type == nsectype) found = header; else if (header->type == sigmatchtype) foundsig = header; @@ -3671,10 +3778,13 @@ cname_and_other_data(dns_rbtnode_t *node, rbtdb_serial_t serial) { * or RRSIG CNAME. */ rdtype = RBTDB_RDATATYPE_BASE(header->type); - if (rdtype == dns_rdatatype_rrsig) + if (rdtype == dns_rdatatype_rrsig || + rdtype == dns_rdatatype_sig) rdtype = RBTDB_RDATATYPE_EXT(header->type); if (rdtype != dns_rdatatype_nsec && rdtype != dns_rdatatype_dnskey && + rdtype != dns_rdatatype_nxt && + rdtype != dns_rdatatype_key && rdtype != dns_rdatatype_cname) { /* * We've found a type that isn't @@ -3718,7 +3828,7 @@ add(dns_rbtdb_t *rbtdb, dns_rbtnode_t *rbtnode, rbtdb_version_t *rbtversion, isc_boolean_t header_nx; isc_boolean_t newheader_nx; isc_boolean_t merge; - dns_rdatatype_t nsecype, rdtype, covers; + dns_rdatatype_t nsectype, rdtype, covers; dns_trust_t trust; /* @@ -3756,7 +3866,7 @@ add(dns_rbtdb_t *rbtdb, dns_rbtnode_t *rbtnode, rbtdb_version_t *rbtversion, newheader_nx = NONEXISTENT(newheader) ? ISC_TRUE : ISC_FALSE; topheader_prev = NULL; - nsecype = 0; + nsectype = 0; if (rbtversion == NULL && !newheader_nx) { rdtype = RBTDB_RDATATYPE_BASE(newheader->type); if (rdtype == 0) { @@ -3783,7 +3893,7 @@ add(dns_rbtdb_t *rbtdb, dns_rbtnode_t *rbtnode, rbtdb_version_t *rbtversion, rbtnode->dirty = 1; goto find_header; } - nsecype = RBTDB_RDATATYPE_VALUE(covers, 0); + nsectype = RBTDB_RDATATYPE_VALUE(covers, 0); } else { /* * We're adding something that isn't a @@ -3823,7 +3933,7 @@ add(dns_rbtdb_t *rbtdb, dns_rbtnode_t *rbtnode, rbtdb_version_t *rbtversion, topheader = NULL; goto find_header; } - nsecype = RBTDB_RDATATYPE_VALUE(0, rdtype); + nsectype = RBTDB_RDATATYPE_VALUE(0, rdtype); } } @@ -3831,7 +3941,7 @@ add(dns_rbtdb_t *rbtdb, dns_rbtnode_t *rbtnode, rbtdb_version_t *rbtversion, topheader != NULL; topheader = topheader->next) { if (topheader->type == newheader->type || - topheader->type == nsecype) + topheader->type == nsectype) break; topheader_prev = topheader; } @@ -4092,8 +4202,10 @@ addnoqname(dns_rbtdb_t *rbtdb, rdatasetheader_t *newheader, RUNTIME_CHECK(result == ISC_R_SUCCESS); noqname = isc_mem_get(mctx, sizeof(*noqname)); - if (noqname == NULL) - return (ISC_R_NOMEMORY); + if (noqname == NULL) { + result = ISC_R_NOMEMORY; + goto cleanup; + } dns_name_init(&noqname->name, NULL); noqname->nsec = NULL; noqname->nsecsig = NULL; @@ -4114,6 +4226,8 @@ addnoqname(dns_rbtdb_t *rbtdb, rdatasetheader_t *newheader, return (ISC_R_SUCCESS); cleanup: + dns_rdataset_disassociate(&nsec); + dns_rdataset_disassociate(&nsecsig); free_noqname(mctx, &noqname); return(result); } @@ -4956,7 +5070,7 @@ static void rdataset_clone(dns_rdataset_t *source, dns_rdataset_t *target) { dns_db_t *db = source->private1; dns_dbnode_t *node = source->private2; - dns_dbnode_t *cloned_node; + dns_dbnode_t *cloned_node = NULL; attachnode(db, node, &cloned_node); *target = *source; @@ -4987,9 +5101,8 @@ rdataset_getnoqname(dns_rdataset_t *rdataset, dns_name_t *name, dns_dbnode_t *cloned_node; struct noqname *noqname = rdataset->private6; + cloned_node = NULL; attachnode(db, node, &cloned_node); - attachnode(db, node, &cloned_node); - nsec->methods = &rdataset_methods; nsec->rdclass = db->rdclass; nsec->type = dns_rdatatype_nsec; @@ -5003,6 +5116,8 @@ rdataset_getnoqname(dns_rdataset_t *rdataset, dns_name_t *name, nsec->private5 = NULL; nsec->private6 = NULL; + cloned_node = NULL; + attachnode(db, node, &cloned_node); nsecsig->methods = &rdataset_methods; nsecsig->rdclass = db->rdclass; nsecsig->type = dns_rdatatype_rrsig; @@ -5021,7 +5136,6 @@ rdataset_getnoqname(dns_rdataset_t *rdataset, dns_name_t *name, return (ISC_R_SUCCESS); } - /* * Rdataset Iterator Methods */ diff --git a/dist/bind/lib/dns/rdata/generic/rrsig_46.c b/dist/bind/lib/dns/rdata/generic/rrsig_46.c index 3089a64f38b..887bec85d5a 100644 --- a/dist/bind/lib/dns/rdata/generic/rrsig_46.c +++ b/dist/bind/lib/dns/rdata/generic/rrsig_46.c @@ -1,4 +1,4 @@ -/* $NetBSD: rrsig_46.c,v 1.1.1.1 2004/05/17 23:45:00 christos Exp $ */ +/* $NetBSD: rrsig_46.c,v 1.1.1.2 2004/11/06 23:55:47 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -17,7 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* Id: rrsig_46.c,v 1.4.2.2 2004/03/16 12:38:14 marka Exp */ +/* Id: rrsig_46.c,v 1.4.2.3 2004/06/24 00:58:06 marka Exp */ /* Reviewed: Fri Mar 17 09:05:02 PST 2000 by gson */ @@ -156,8 +156,8 @@ totext_rrsig(ARGS_TOTEXT) { if (dns_rdatatype_isknown(covered) && covered != 0) { RETERR(dns_rdatatype_totext(covered, target)); } else { - char buf[sizeof("65535")]; - sprintf(buf, "%u", covered); + char buf[sizeof("TYPE65535")]; + sprintf(buf, "TYPE%u", covered); RETERR(str_totext(buf, target)); } RETERR(str_totext(" ", target)); diff --git a/dist/bind/lib/dns/resolver.c b/dist/bind/lib/dns/resolver.c index 4b953db42f1..ee58adf8d24 100644 --- a/dist/bind/lib/dns/resolver.c +++ b/dist/bind/lib/dns/resolver.c @@ -1,4 +1,4 @@ -/* $NetBSD: resolver.c,v 1.1.1.1 2004/05/17 23:44:54 christos Exp $ */ +/* $NetBSD: resolver.c,v 1.1.1.2 2004/11/06 23:55:41 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -17,10 +17,11 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* Id: resolver.c,v 1.218.2.18.4.36 2004/04/19 23:41:33 marka Exp */ +/* Id: resolver.c,v 1.218.2.18.4.43 2004/08/28 06:25:19 marka Exp */ #include <config.h> +#include <isc/print.h> #include <isc/string.h> #include <isc/task.h> #include <isc/timer.h> @@ -67,25 +68,28 @@ DNS_LOGCATEGORY_RESOLVER, \ DNS_LOGMODULE_RESOLVER, \ ISC_LOG_DEBUG(3), \ - "fctx %p: %s", fctx, (m)) + "fctx %p(%s'): %s", fctx, fctx->info, (m)) #define FCTXTRACE2(m1, m2) \ isc_log_write(dns_lctx, \ DNS_LOGCATEGORY_RESOLVER, \ DNS_LOGMODULE_RESOLVER, \ ISC_LOG_DEBUG(3), \ - "fctx %p: %s %s", fctx, (m1), (m2)) + "fctx %p(%s): %s %s", \ + fctx, fctx->info, (m1), (m2)) #define FTRACE(m) isc_log_write(dns_lctx, \ DNS_LOGCATEGORY_RESOLVER, \ DNS_LOGMODULE_RESOLVER, \ ISC_LOG_DEBUG(3), \ - "fetch %p (fctx %p): %s", \ - fetch, fetch->private, (m)) + "fetch %p (fctx %p(%s)): %s", \ + fetch, fetch->private, \ + fetch->private->info, (m)) #define QTRACE(m) isc_log_write(dns_lctx, \ DNS_LOGCATEGORY_RESOLVER, \ DNS_LOGMODULE_RESOLVER, \ ISC_LOG_DEBUG(3), \ - "resquery %p (fctx %p): %s", \ - query, query->fctx, (m)) + "resquery %p (fctx %p(%s)): %s", \ + query, query->fctx, \ + query->fctx->info, (m)) #else #define RTRACE(m) #define RRTRACE(r, m) @@ -154,6 +158,7 @@ struct fetchctx { dns_rdatatype_t type; unsigned int options; unsigned int bucketnum; + char * info; /* Locked by appropriate bucket lock. */ fetchstate state; isc_boolean_t want_shutdown; @@ -1123,6 +1128,8 @@ resquery_send(resquery_t *query) { &secure_domain); if (result != ISC_R_SUCCESS) secure_domain = ISC_FALSE; + if (res->view->dlv != NULL) + secure_domain = ISC_TRUE; if (secure_domain) fctx->qmessage->flags |= DNS_MESSAGEFLAG_CD; } else @@ -1817,8 +1824,23 @@ fctx_getaddresses(fetchctx_t *fctx) { sa = ISC_LIST_HEAD(fctx->forwarders); if (sa == NULL) { dns_forwarders_t *forwarders = NULL; - result = dns_fwdtable_find(fctx->res->view->fwdtable, - &fctx->name, &forwarders); + dns_name_t *name = &fctx->name; + dns_name_t suffix; + unsigned int labels; + + /* + * DS records are found in the parent server. + * Strip label to get the correct forwarder (if any). + */ + if (fctx->type == dns_rdatatype_ds && + dns_name_countlabels(name) > 1) { + dns_name_init(&suffix, NULL); + labels = dns_name_countlabels(name); + dns_name_getlabelsequence(name, 1, labels - 1, &suffix); + name = &suffix; + } + result = dns_fwdtable_find(fctx->res->view->fwdtable, name, + &forwarders); if (result == ISC_R_SUCCESS) { sa = ISC_LIST_HEAD(forwarders->addrs); fctx->fwdpolicy = forwarders->fwdpolicy; @@ -2055,7 +2077,7 @@ possibly_mark(fetchctx_t *fctx, dns_adbaddrinfo_t *addr) static inline dns_adbaddrinfo_t * fctx_nextaddress(fetchctx_t *fctx) { - dns_adbfind_t *find; + dns_adbfind_t *find, *start; dns_adbaddrinfo_t *addrinfo; dns_adbaddrinfo_t *faddrinfo; @@ -2098,23 +2120,26 @@ fctx_nextaddress(fetchctx_t *fctx) { * Find the first unmarked addrinfo. */ addrinfo = NULL; - while (find != fctx->find) { - for (addrinfo = ISC_LIST_HEAD(find->list); - addrinfo != NULL; - addrinfo = ISC_LIST_NEXT(addrinfo, publink)) { - if (!UNMARKED(addrinfo)) - continue; - possibly_mark(fctx, addrinfo); - if (UNMARKED(addrinfo)) { - addrinfo->flags |= FCTX_ADDRINFO_MARK; - break; + if (find != NULL) { + start = find; + do { + for (addrinfo = ISC_LIST_HEAD(find->list); + addrinfo != NULL; + addrinfo = ISC_LIST_NEXT(addrinfo, publink)) { + if (!UNMARKED(addrinfo)) + continue; + possibly_mark(fctx, addrinfo); + if (UNMARKED(addrinfo)) { + addrinfo->flags |= FCTX_ADDRINFO_MARK; + break; + } } - } - if (addrinfo != NULL) - break; - find = ISC_LIST_NEXT(find, publink); - if (find != fctx->find && find == NULL) - find = ISC_LIST_HEAD(fctx->finds); + if (addrinfo != NULL) + break; + find = ISC_LIST_NEXT(find, publink); + if (find == NULL) + find = ISC_LIST_HEAD(fctx->finds); + } while (find != start); } fctx->find = find; @@ -2140,23 +2165,26 @@ fctx_nextaddress(fetchctx_t *fctx) { * Find the first unmarked addrinfo. */ addrinfo = NULL; - while (find != fctx->altfind) { - for (addrinfo = ISC_LIST_HEAD(find->list); - addrinfo != NULL; - addrinfo = ISC_LIST_NEXT(addrinfo, publink)) { - if (!UNMARKED(addrinfo)) - continue; - possibly_mark(fctx, addrinfo); - if (UNMARKED(addrinfo)) { - addrinfo->flags |= FCTX_ADDRINFO_MARK; - break; + if (find != NULL) { + start = find; + do { + for (addrinfo = ISC_LIST_HEAD(find->list); + addrinfo != NULL; + addrinfo = ISC_LIST_NEXT(addrinfo, publink)) { + if (!UNMARKED(addrinfo)) + continue; + possibly_mark(fctx, addrinfo); + if (UNMARKED(addrinfo)) { + addrinfo->flags |= FCTX_ADDRINFO_MARK; + break; + } } - } - if (addrinfo != NULL) - break; - find = ISC_LIST_NEXT(find, publink); - if (find != fctx->altfind && find == NULL) - find = ISC_LIST_HEAD(fctx->altfinds); + if (addrinfo != NULL) + break; + find = ISC_LIST_NEXT(find, publink); + if (find == NULL) + find = ISC_LIST_HEAD(fctx->altfinds); + } while (find != start); } faddrinfo = addrinfo; @@ -2289,6 +2317,7 @@ fctx_destroy(fetchctx_t *fctx) { dns_name_free(&fctx->name, res->mctx); dns_db_detach(&fctx->cache); dns_adb_detach(&fctx->adb); + isc_mem_free(res->mctx, fctx->info); isc_mem_put(res->mctx, fctx, sizeof(*fctx)); LOCK(&res->nlock); @@ -2577,6 +2606,9 @@ fctx_create(dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type, isc_interval_t interval; dns_fixedname_t qdomain; unsigned int findoptions = 0; + char buf[DNS_NAME_FORMATSIZE + DNS_RDATATYPE_FORMATSIZE]; + char typebuf[DNS_RDATATYPE_FORMATSIZE]; + dns_name_t suffix; /* * Caller must be holding the lock for bucket number 'bucketnum'. @@ -2586,11 +2618,18 @@ fctx_create(dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type, fctx = isc_mem_get(res->mctx, sizeof(*fctx)); if (fctx == NULL) return (ISC_R_NOMEMORY); + dns_name_format(name, buf, sizeof(buf)); + dns_rdatatype_format(type, typebuf, sizeof(typebuf)); + strcat(buf, "/"); /* checked */ + strcat(buf, typebuf); /* checked */ + fctx->info = isc_mem_strdup(res->mctx, buf); + if (fctx->info == NULL) + goto cleanup_fetch; FCTXTRACE("create"); dns_name_init(&fctx->name, NULL); result = dns_name_dup(name, res->mctx, &fctx->name); if (result != ISC_R_SUCCESS) - goto cleanup_fetch; + goto cleanup_info; dns_name_init(&fctx->domain, NULL); dns_rdataset_init(&fctx->nameservers); @@ -2629,8 +2668,21 @@ fctx_create(dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type, if (domain == NULL) { dns_forwarders_t *forwarders = NULL; - result = dns_fwdtable_find(fctx->res->view->fwdtable, - &fctx->name, &forwarders); + unsigned int labels; + + /* + * DS records are found in the parent server. + * Strip label to get the correct forwarder (if any). + */ + if (fctx->type == dns_rdatatype_ds && + dns_name_countlabels(name) > 1) { + dns_name_init(&suffix, NULL); + labels = dns_name_countlabels(name); + dns_name_getlabelsequence(name, 1, labels - 1, &suffix); + name = &suffix; + } + result = dns_fwdtable_find(fctx->res->view->fwdtable, name, + &forwarders); if (result == ISC_R_SUCCESS) fctx->fwdpolicy = forwarders->fwdpolicy; @@ -2763,6 +2815,9 @@ fctx_create(dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type, cleanup_name: dns_name_free(&fctx->name, res->mctx); + cleanup_info: + isc_mem_free(res->mctx, fctx->info); + cleanup_fetch: isc_mem_put(res->mctx, fctx, sizeof(*fctx)); @@ -3093,7 +3148,6 @@ validated(isc_task_t *task, isc_event_t *event) { ardataset, &eresult); if (result != ISC_R_SUCCESS) goto noanswer_response; - goto answer_response; } @@ -3154,8 +3208,9 @@ validated(isc_task_t *task, isc_event_t *event) { goto cleanup_event; } + answer_response: /* - * Cache any NS records that happened to be validate. + * Cache any NS/NSEC records that happened to be validated. */ result = dns_message_firstname(fctx->rmessage, DNS_SECTION_AUTHORITY); while (result == ISC_R_SUCCESS) { @@ -3165,14 +3220,15 @@ validated(isc_task_t *task, isc_event_t *event) { for (rdataset = ISC_LIST_HEAD(name->list); rdataset != NULL; rdataset = ISC_LIST_NEXT(rdataset, link)) { - if (rdataset->type != dns_rdatatype_ns || + if ((rdataset->type != dns_rdatatype_ns && + rdataset->type != dns_rdatatype_nsec) || rdataset->trust != dns_trust_secure) continue; for (sigrdataset = ISC_LIST_HEAD(name->list); sigrdataset != NULL; sigrdataset = ISC_LIST_NEXT(sigrdataset, link)) { if (sigrdataset->type != dns_rdatatype_rrsig || - sigrdataset->covers != dns_rdatatype_ns) + sigrdataset->covers != rdataset->type) continue; break; } @@ -3199,7 +3255,6 @@ validated(isc_task_t *task, isc_event_t *event) { result = ISC_R_SUCCESS; - answer_response: /* * Respond with an answer, positive or negative, * as opposed to an error. 'node' must be non-NULL. @@ -3264,6 +3319,9 @@ 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) + secure_domain = ISC_TRUE; + if ((fctx->options & DNS_FETCHOPT_NOVALIDATE) != 0) need_validation = ISC_FALSE; else @@ -3688,6 +3746,9 @@ 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) + secure_domain = ISC_TRUE; + if ((fctx->options & DNS_FETCHOPT_NOVALIDATE) != 0) need_validation = ISC_FALSE; else @@ -4693,6 +4754,9 @@ resume_dslookup(isc_task_t *task, isc_event_t *event) { isc_boolean_t bucket_empty = ISC_FALSE; isc_boolean_t locked = ISC_FALSE; unsigned int bucketnum; + dns_rdataset_t nameservers; + dns_fixedname_t fixed; + dns_name_t *domain; REQUIRE(event->ev_type == DNS_EVENT_FETCHDONE); fevent = (dns_fetchevent_t *)event; @@ -4708,15 +4772,17 @@ resume_dslookup(isc_task_t *task, isc_event_t *event) { if (fevent->db != NULL) dns_db_detach(&fevent->db); - dns_resolver_destroyfetch(&fctx->nsfetch); + dns_rdataset_init(&nameservers); bucketnum = fctx->bucketnum; - if (fevent->result == ISC_R_CANCELED) + if (fevent->result == ISC_R_CANCELED) { + dns_resolver_destroyfetch(&fctx->nsfetch); fctx_done(fctx, ISC_R_CANCELED); - else if (fevent->result == ISC_R_SUCCESS) { + } else if (fevent->result == ISC_R_SUCCESS) { FCTXTRACE("resuming DS lookup"); + dns_resolver_destroyfetch(&fctx->nsfetch); if (dns_rdataset_isassociated(&fctx->nameservers)) dns_rdataset_disassociate(&fctx->nameservers); dns_rdataset_clone(fevent->rdataset, &fctx->nameservers); @@ -4735,22 +4801,29 @@ resume_dslookup(isc_task_t *task, isc_event_t *event) { } else { unsigned int n; + /* + * Retrieve state from fctx->nsfetch before we destroy it. + */ + dns_fixedname_init(&fixed); + domain = dns_fixedname_name(&fixed); + dns_name_copy(&fctx->nsfetch->private->domain, domain, NULL); + dns_rdataset_clone(&fctx->nsfetch->private->nameservers, + &nameservers); + dns_resolver_destroyfetch(&fctx->nsfetch); + if (dns_name_equal(&fctx->nsname, domain)) { + fctx_done(fctx, DNS_R_SERVFAIL); + goto cleanup; + } n = dns_name_countlabels(&fctx->nsname); dns_name_getlabelsequence(&fctx->nsname, 1, n - 1, &fctx->nsname); - if (dns_name_equal(&fctx->nsname, &fctx->domain)) { - fctx_done(fctx, DNS_R_SERVFAIL); - goto cleanup; - } if (dns_rdataset_isassociated(fevent->rdataset)) dns_rdataset_disassociate(fevent->rdataset); FCTXTRACE("continuing to look for parent's NS records"); result = dns_resolver_createfetch(fctx->res, &fctx->nsname, - dns_rdatatype_ns, - &fctx->domain, - &fctx->nameservers, NULL, - 0, task, + dns_rdatatype_ns, domain, + &nameservers, NULL, 0, task, resume_dslookup, fctx, &fctx->nsrrset, NULL, &fctx->nsfetch); @@ -4764,6 +4837,8 @@ resume_dslookup(isc_task_t *task, isc_event_t *event) { } cleanup: + if (dns_rdataset_isassociated(&nameservers)) + dns_rdataset_disassociate(&nameservers); if (dns_rdataset_isassociated(fevent->rdataset)) dns_rdataset_disassociate(fevent->rdataset); INSIST(fevent->sigrdataset == NULL); diff --git a/dist/bind/lib/dns/result.c b/dist/bind/lib/dns/result.c index 09163c77492..f4b2ecdb8e9 100644 --- a/dist/bind/lib/dns/result.c +++ b/dist/bind/lib/dns/result.c @@ -1,4 +1,4 @@ -/* $NetBSD: result.c,v 1.1.1.1 2004/05/17 23:44:54 christos Exp $ */ +/* $NetBSD: result.c,v 1.1.1.2 2004/11/06 23:55:41 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -17,7 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* Id: result.c,v 1.90.2.9.2.12 2004/04/15 23:56:30 marka Exp */ +/* Id: result.c,v 1.90.2.9.2.13 2004/05/14 05:06:39 marka Exp */ #include <config.h> @@ -152,7 +152,8 @@ static const char *text[DNS_R_NRESULTS] = { "dynamic zone", /* 98 DNS_R_DYNAMIC */ "unknown command", /* 99 DNS_R_UNKNOWNCOMMAND */ - "must-be-secure" /* 100 DNS_R_MUSTBESECURE */ + "must-be-secure", /* 100 DNS_R_MUSTBESECURE */ + "covering NSEC record returned" /* 101 DNS_R_COVERINGNSEC */ }; static const char *rcode_text[DNS_R_NRCODERESULTS] = { diff --git a/dist/bind/lib/dns/sdb.c b/dist/bind/lib/dns/sdb.c index 97a429bcfde..34c04ba8cba 100644 --- a/dist/bind/lib/dns/sdb.c +++ b/dist/bind/lib/dns/sdb.c @@ -1,4 +1,4 @@ -/* $NetBSD: sdb.c,v 1.1.1.1 2004/05/17 23:44:54 christos Exp $ */ +/* $NetBSD: sdb.c,v 1.1.1.2 2004/11/06 23:55:42 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -17,7 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* Id: sdb.c,v 1.35.12.7 2004/03/08 21:06:27 marka Exp */ +/* Id: sdb.c,v 1.35.12.8 2004/07/22 04:01:58 marka Exp */ #include <config.h> @@ -631,10 +631,10 @@ attachversion(dns_db_t *db, dns_dbversion_t *source, dns_dbversion_t **targetp) { REQUIRE(source != NULL && source == (void *) &dummy); + REQUIRE(targetp != NULL && *targetp == NULL); UNUSED(db); - UNUSED(source); - UNUSED(targetp); + *targetp = source; return; } diff --git a/dist/bind/lib/dns/sec/dst/dst_api.c b/dist/bind/lib/dns/sec/dst/dst_api.c index d8f11f5c9d2..9321870a205 100644 --- a/dist/bind/lib/dns/sec/dst/dst_api.c +++ b/dist/bind/lib/dns/sec/dst/dst_api.c @@ -1,4 +1,4 @@ -/* $NetBSD: dst_api.c,v 1.1.1.1 2004/05/17 23:45:00 christos Exp $ */ +/* $NetBSD: dst_api.c,v 1.1.1.2 2004/11/06 23:55:47 christos Exp $ */ /* * Portions Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -20,7 +20,7 @@ /* * Principal Author: Brian Wellington - * Id: dst_api.c,v 1.88.2.3.2.12 2004/03/16 05:50:22 marka Exp + * Id: dst_api.c,v 1.88.2.3.2.15 2004/06/16 01:05:01 marka Exp */ #include <config.h> @@ -72,6 +72,7 @@ static dst_key_t * get_key_struct(dns_name_t *name, dns_rdataclass_t rdclass, isc_mem_t *mctx); static isc_result_t read_public_key(const char *filename, + int type, isc_mem_t *mctx, dst_key_t **keyp); static isc_result_t write_public_key(const dst_key_t *key, int type, @@ -147,9 +148,11 @@ dst_lib_init(isc_mem_t *mctx, isc_entropy_t *ectx, unsigned int eflags) { RETERR(dst__openssl_init()); RETERR(dst__opensslrsa_init(&dst_t_func[DST_ALG_RSAMD5])); RETERR(dst__opensslrsa_init(&dst_t_func[DST_ALG_RSASHA1])); +#ifdef HAVE_OPENSSL_DSA RETERR(dst__openssldsa_init(&dst_t_func[DST_ALG_DSA])); - RETERR(dst__openssldh_init(&dst_t_func[DST_ALG_DH])); #endif + RETERR(dst__openssldh_init(&dst_t_func[DST_ALG_DH])); +#endif /* OPENSSL */ #ifdef GSSAPI RETERR(dst__gssapi_init(&dst_t_func[DST_ALG_GSSAPI])); #endif @@ -391,7 +394,7 @@ dst_key_fromnamedfile(const char *filename, int type, isc_mem_t *mctx, REQUIRE(mctx != NULL); REQUIRE(keyp != NULL && *keyp == NULL); - result = read_public_key(filename, mctx, &pubkey); + result = read_public_key(filename, type, mctx, &pubkey); if (result != ISC_R_SUCCESS) return (result); @@ -825,7 +828,9 @@ get_key_struct(dns_name_t *name, unsigned int alg, * Reads a public key from disk */ static isc_result_t -read_public_key(const char *filename, isc_mem_t *mctx, dst_key_t **keyp) { +read_public_key(const char *filename, int type, + isc_mem_t *mctx, dst_key_t **keyp) +{ u_char rdatabuf[DST_KEY_MAXSIZE]; isc_buffer_t b; dns_fixedname_t name; @@ -840,7 +845,7 @@ read_public_key(const char *filename, isc_mem_t *mctx, dst_key_t **keyp) { isc_lexspecials_t specials; isc_uint32_t ttl; isc_result_t result; - dns_rdatatype_t type; + dns_rdatatype_t keytype; newfilenamelen = strlen(filename) + 5; newfilename = isc_mem_get(mctx, newfilenamelen); @@ -913,14 +918,20 @@ read_public_key(const char *filename, isc_mem_t *mctx, dst_key_t **keyp) { BADTOKEN(); if (strcasecmp(DST_AS_STR(token), "DNSKEY") == 0) - type = dns_rdatatype_dnskey; + keytype = dns_rdatatype_dnskey; else if (strcasecmp(DST_AS_STR(token), "KEY") == 0) - type = dns_rdatatype_key; /* SIG(0) */ + keytype = dns_rdatatype_key; /* SIG(0), TKEY */ else BADTOKEN(); + if (((type & DST_TYPE_KEY) != 0 && keytype != dns_rdatatype_key) || + ((type & DST_TYPE_KEY) == 0 && keytype != dns_rdatatype_dnskey)) { + ret = DST_R_BADKEYTYPE; + goto cleanup; + } + isc_buffer_init(&b, rdatabuf, sizeof(rdatabuf)); - ret = dns_rdata_fromtext(&rdata, rdclass, type, lex, NULL, + ret = dns_rdata_fromtext(&rdata, rdclass, keytype, lex, NULL, ISC_FALSE, mctx, &b, NULL); if (ret != ISC_R_SUCCESS) goto cleanup; @@ -1138,10 +1149,12 @@ algorithm_status(unsigned int alg) { if (dst_algorithm_supported(alg)) return (ISC_R_SUCCESS); +#ifndef OPENSSL if (alg == DST_ALG_RSAMD5 || alg == DST_ALG_RSASHA1 || alg == DST_ALG_DSA || alg == DST_ALG_DH || alg == DST_ALG_HMACMD5) return (DST_R_NOCRYPTO); +#endif return (DST_R_UNSUPPORTEDALG); } diff --git a/dist/bind/lib/dns/sec/dst/dst_result.c b/dist/bind/lib/dns/sec/dst/dst_result.c index 18a8fd21efe..27a1460215a 100644 --- a/dist/bind/lib/dns/sec/dst/dst_result.c +++ b/dist/bind/lib/dns/sec/dst/dst_result.c @@ -1,4 +1,4 @@ -/* $NetBSD: dst_result.c,v 1.1.1.1 2004/05/17 23:45:00 christos Exp $ */ +/* $NetBSD: dst_result.c,v 1.1.1.2 2004/11/06 23:55:47 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -19,7 +19,7 @@ /* * Principal Author: Brian Wellington - * Id: dst_result.c,v 1.18.2.1.8.1 2004/03/06 08:14:21 marka Exp + * Id: dst_result.c,v 1.18.2.1.8.2 2004/06/11 00:30:55 marka Exp */ #include <config.h> @@ -51,6 +51,7 @@ static const char *text[DST_R_NRESULTS] = { "not a key that can compute a secret", /* 17 */ "failure computing a shared secret", /* 18 */ "no randomness available", /* 19 */ + "bad key type" /* 20 */ }; #define DST_RESULT_RESULTSET 2 diff --git a/dist/bind/lib/dns/sec/dst/include/dst/dst.h b/dist/bind/lib/dns/sec/dst/include/dst/dst.h index 7c4cc965da3..87392da810b 100644 --- a/dist/bind/lib/dns/sec/dst/include/dst/dst.h +++ b/dist/bind/lib/dns/sec/dst/include/dst/dst.h @@ -1,4 +1,4 @@ -/* $NetBSD: dst.h,v 1.1.1.1 2004/05/17 23:45:01 christos Exp $ */ +/* $NetBSD: dst.h,v 1.1.1.2 2004/11/06 23:55:48 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -17,7 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* Id: dst.h,v 1.42.2.1.8.5 2004/03/10 02:55:59 marka Exp */ +/* Id: dst.h,v 1.42.2.1.8.6 2004/06/11 00:31:01 marka Exp */ #ifndef DST_DST_H #define DST_DST_H 1 @@ -220,6 +220,7 @@ dst_key_fromfile(dns_name_t *name, dns_keytag_t id, unsigned int alg, int type, * "id" is a valid key tag identifier. * "alg" is a supported key algorithm. * "type" is DST_TYPE_PUBLIC, DST_TYPE_PRIVATE, or the bitwise union. + * DST_TYPE_KEY look for a KEY record otherwise DNSKEY * "mctx" is a valid memory context. * "keyp" is not NULL and "*keyp" is NULL. * @@ -242,6 +243,7 @@ dst_key_fromnamedfile(const char *filename, int type, isc_mem_t *mctx, * Requires: * "filename" is not NULL * "type" is DST_TYPE_PUBLIC, DST_TYPE_PRIVATE, or the bitwise union + * DST_TYPE_KEY look for a KEY record otherwise DNSKEY * "mctx" is a valid memory context * "keyp" is not NULL and "*keyp" is NULL. * diff --git a/dist/bind/lib/dns/sec/dst/include/dst/result.h b/dist/bind/lib/dns/sec/dst/include/dst/result.h index 36bd3cd9f96..73d5d1d9e49 100644 --- a/dist/bind/lib/dns/sec/dst/include/dst/result.h +++ b/dist/bind/lib/dns/sec/dst/include/dst/result.h @@ -1,4 +1,4 @@ -/* $NetBSD: result.h,v 1.1.1.1 2004/05/17 23:45:01 christos Exp $ */ +/* $NetBSD: result.h,v 1.1.1.2 2004/11/06 23:55:48 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -17,7 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* Id: result.h,v 1.20.206.1 2004/03/06 08:14:25 marka Exp */ +/* Id: result.h,v 1.20.206.2 2004/06/11 00:31:01 marka Exp */ #ifndef DST_RESULT_H #define DST_RESULT_H 1 @@ -53,8 +53,9 @@ #define DST_R_KEYCANNOTCOMPUTESECRET (ISC_RESULTCLASS_DST + 17) #define DST_R_COMPUTESECRETFAILURE (ISC_RESULTCLASS_DST + 18) #define DST_R_NORANDOMNESS (ISC_RESULTCLASS_DST + 19) +#define DST_R_BADKEYTYPE (ISC_RESULTCLASS_DST + 20) -#define DST_R_NRESULTS 20 /* Number of results */ +#define DST_R_NRESULTS 21 /* Number of results */ ISC_LANG_BEGINDECLS diff --git a/dist/bind/lib/dns/time.c b/dist/bind/lib/dns/time.c index 7e1d13f343d..e216aeb41d9 100644 --- a/dist/bind/lib/dns/time.c +++ b/dist/bind/lib/dns/time.c @@ -1,4 +1,4 @@ -/* $NetBSD: time.c,v 1.1.1.1 2004/05/17 23:44:55 christos Exp $ */ +/* $NetBSD: time.c,v 1.1.1.2 2004/11/06 23:55:42 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -17,7 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* Id: time.c,v 1.18.2.4.2.7 2004/03/11 04:23:00 marka Exp */ +/* Id: time.c,v 1.18.2.4.2.8 2004/08/28 06:25:20 marka Exp */ #include <config.h> @@ -25,6 +25,7 @@ #include <isc/string.h> /* Required for HP/UX (and others?) */ #include <time.h> +#include <isc/print.h> #include <isc/region.h> #include <isc/stdtime.h> #include <isc/util.h> diff --git a/dist/bind/lib/dns/tkey.c b/dist/bind/lib/dns/tkey.c index d03b2fa5338..4648741e1ac 100644 --- a/dist/bind/lib/dns/tkey.c +++ b/dist/bind/lib/dns/tkey.c @@ -1,4 +1,4 @@ -/* $NetBSD: tkey.c,v 1.1.1.1 2004/05/17 23:44:55 christos Exp $ */ +/* $NetBSD: tkey.c,v 1.1.1.2 2004/11/06 23:55:42 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -18,7 +18,7 @@ */ /* - * Id: tkey.c,v 1.71.2.1.10.4 2004/03/08 02:07:58 marka Exp + * Id: tkey.c,v 1.71.2.1.10.5 2004/06/11 00:30:54 marka Exp */ #include <config.h> @@ -287,7 +287,7 @@ process_dhtkey(dns_message_t *msg, dns_name_t *signer, dns_name_t *name, keyname = NULL; dns_message_currentname(msg, DNS_SECTION_ADDITIONAL, &keyname); keyset = NULL; - result = dns_message_findtype(keyname, dns_rdatatype_dnskey, 0, + result = dns_message_findtype(keyname, dns_rdatatype_key, 0, &keyset); if (result != ISC_R_SUCCESS) continue; @@ -335,7 +335,7 @@ process_dhtkey(dns_message_t *msg, dns_name_t *signer, dns_name_t *name, RETERR(dst_key_todns(tctx->dhkey, &ourkeybuf)); isc_buffer_usedregion(&ourkeybuf, &ourkeyr); dns_rdata_fromregion(&ourkeyrdata, dns_rdataclass_any, - dns_rdatatype_dnskey, &ourkeyr); + dns_rdatatype_key, &ourkeyr); dns_name_init(&ourname, NULL); dns_name_clone(dst_key_name(tctx->dhkey), &ourname); @@ -879,7 +879,7 @@ dns_tkey_builddhquery(dns_message_t *msg, dst_key_t *key, dns_name_t *name, RETERR(dst_key_todns(key, dynbuf)); isc_buffer_usedregion(dynbuf, &r); dns_rdata_fromregion(rdata, dns_rdataclass_any, - dns_rdatatype_dnskey, &r); + dns_rdatatype_key, &r); dns_message_takebuffer(msg, &dynbuf); dns_name_init(&keyname, NULL); @@ -1051,7 +1051,7 @@ dns_tkey_processdhresponse(dns_message_t *qmsg, dns_message_t *rmsg, ourkeyname = NULL; ourkeyset = NULL; RETERR(dns_message_findname(rmsg, DNS_SECTION_ANSWER, &keyname, - dns_rdatatype_dnskey, 0, &ourkeyname, + dns_rdatatype_key, 0, &ourkeyname, &ourkeyset)); result = dns_message_firstname(rmsg, DNS_SECTION_ANSWER); @@ -1062,7 +1062,7 @@ dns_tkey_processdhresponse(dns_message_t *qmsg, dns_message_t *rmsg, if (dns_name_equal(theirkeyname, ourkeyname)) goto next; theirkeyset = NULL; - result = dns_message_findtype(theirkeyname, dns_rdatatype_dnskey, + result = dns_message_findtype(theirkeyname, dns_rdatatype_key, 0, &theirkeyset); if (result == ISC_R_SUCCESS) { RETERR(dns_rdataset_first(theirkeyset)); diff --git a/dist/bind/lib/dns/validator.c b/dist/bind/lib/dns/validator.c index f5ae6f87430..cbba995a3c9 100644 --- a/dist/bind/lib/dns/validator.c +++ b/dist/bind/lib/dns/validator.c @@ -1,4 +1,4 @@ -/* $NetBSD: validator.c,v 1.1.1.1 2004/05/17 23:44:53 christos Exp $ */ +/* $NetBSD: validator.c,v 1.1.1.2 2004/11/06 23:55:40 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -17,7 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* Id: validator.c,v 1.91.2.5.8.10 2004/04/15 23:56:30 marka Exp */ +/* Id: validator.c,v 1.91.2.5.8.12 2004/06/11 01:17:36 marka Exp */ #include <config.h> @@ -55,6 +55,7 @@ #define VALATTR_INSECURITY 0x0010 #define VALATTR_DLV 0x0020 #define VALATTR_DLVTRIED 0x0040 +#define VALATTR_DLVSEPTRIED 0x0080 #define VALATTR_NEEDNOQNAME 0x0100 #define VALATTR_NEEDNOWILDCARD 0x0200 @@ -70,6 +71,7 @@ #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) @@ -109,6 +111,9 @@ validator_logcreate(dns_validator_t *val, static isc_result_t dlv_validatezonekey(dns_validator_t *val); +static isc_result_t +finddlvsep(dns_validator_t *val, isc_boolean_t resume); + static void validator_done(dns_validator_t *val, isc_result_t result) { isc_task_t *task; @@ -737,6 +742,16 @@ negauthvalidated(isc_task_t *task, isc_event_t *event) { static inline isc_result_t view_find(dns_validator_t *val, dns_name_t *name, dns_rdatatype_t type) { + dns_fixedname_t fixedname; + dns_name_t *foundname; + dns_rdata_nsec_t nsec; + dns_rdata_t rdata = DNS_RDATA_INIT; + isc_result_t result; + unsigned int options; + char buf1[DNS_NAME_FORMATSIZE]; + char buf2[DNS_NAME_FORMATSIZE]; + char buf3[DNS_NAME_FORMATSIZE]; + if (dns_rdataset_isassociated(&val->frdataset)) dns_rdataset_disassociate(&val->frdataset); if (dns_rdataset_isassociated(&val->fsigrdataset)) @@ -744,9 +759,106 @@ view_find(dns_validator_t *val, dns_name_t *name, dns_rdatatype_t type) { if (val->view->zonetable == NULL) return (ISC_R_CANCELED); - return (dns_view_simplefind(val->view, name, type, 0, - DNS_DBFIND_PENDINGOK, ISC_FALSE, - &val->frdataset, &val->fsigrdataset)); + + options = DNS_DBFIND_PENDINGOK; + if (type == dns_rdatatype_dlv) + options |= DNS_DBFIND_COVERINGNSEC; + dns_fixedname_init(&fixedname); + foundname = dns_fixedname_name(&fixedname); + result = dns_view_find(val->view, name, type, 0, options, + ISC_FALSE, NULL, NULL, foundname, + &val->frdataset, &val->fsigrdataset); + if (result == DNS_R_NXDOMAIN) { + if (dns_rdataset_isassociated(&val->frdataset)) + dns_rdataset_disassociate(&val->frdataset); + if (dns_rdataset_isassociated(&val->fsigrdataset)) + dns_rdataset_disassociate(&val->fsigrdataset); + } else if (result == DNS_R_COVERINGNSEC) { + validator_log(val, ISC_LOG_DEBUG(3), "DNS_R_COVERINGNSEC"); + /* + * Check if the returned NSEC covers the name. + */ + INSIST(type == dns_rdatatype_dlv); + if (val->frdataset.trust != dns_trust_secure) { + validator_log(val, ISC_LOG_DEBUG(3), + "covering nsec: trust %u", + val->frdataset.trust); + goto notfound; + } + result = dns_rdataset_first(&val->frdataset); + if (result != ISC_R_SUCCESS) + goto notfound; + dns_rdataset_current(&val->frdataset, &rdata); + if (dns_nsec_typepresent(&rdata, dns_rdatatype_ns) && + !dns_nsec_typepresent(&rdata, dns_rdatatype_soa)) { + /* Parent NSEC record. */ + if (dns_name_issubdomain(name, foundname)) { + validator_log(val, ISC_LOG_DEBUG(3), + "covering nsec: for parent"); + goto notfound; + } + } + result = dns_rdata_tostruct(&rdata, &nsec, NULL); + if (result != ISC_R_SUCCESS) + goto notfound; + if (dns_name_compare(foundname, &nsec.next) >= 0) { + /* End of zone chain. */ + if (!dns_name_issubdomain(name, &nsec.next)) { + /* + * XXXMPA We could look for a parent NSEC + * at nsec.next and if found retest with + * this NSEC. + */ + dns_rdata_freestruct(&nsec); + validator_log(val, ISC_LOG_DEBUG(3), + "covering nsec: not in zone"); + goto notfound; + } + } else if (dns_name_compare(name, &nsec.next) >= 0) { + /* + * XXXMPA We could check if this NSEC is at a zone + * apex and if the qname is not below it and look for + * a parent NSEC with the same name. This requires + * that we can cache both NSEC records which we + * currently don't support. + */ + dns_rdata_freestruct(&nsec); + validator_log(val, ISC_LOG_DEBUG(3), + "covering nsec: not in range"); + goto notfound; + } + if (isc_log_wouldlog(dns_lctx,ISC_LOG_DEBUG(3))) { + dns_name_format(name, buf1, sizeof buf1); + dns_name_format(foundname, buf2, sizeof buf2); + dns_name_format(&nsec.next, buf3, sizeof buf3); + validator_log(val, ISC_LOG_DEBUG(3), + "covering nsec found: '%s' '%s' '%s'", + buf1, buf2, buf3); + } + if (dns_rdataset_isassociated(&val->frdataset)) + dns_rdataset_disassociate(&val->frdataset); + if (dns_rdataset_isassociated(&val->fsigrdataset)) + dns_rdataset_disassociate(&val->fsigrdataset); + dns_rdata_freestruct(&nsec); + result = DNS_R_NCACHENXDOMAIN; + } else if (result != ISC_R_SUCCESS && + result != DNS_R_GLUE && + result != DNS_R_HINT && + result != DNS_R_NCACHENXDOMAIN && + result != DNS_R_NCACHENXRRSET && + result != DNS_R_NXRRSET && + result != DNS_R_HINTNXRRSET && + result != ISC_R_NOTFOUND) { + goto notfound; + } + return (result); + + notfound: + if (dns_rdataset_isassociated(&val->frdataset)) + dns_rdataset_disassociate(&val->frdataset); + if (dns_rdataset_isassociated(&val->fsigrdataset)) + dns_rdataset_disassociate(&val->fsigrdataset); + return (ISC_R_NOTFOUND); } static inline isc_boolean_t @@ -1483,7 +1595,7 @@ dlv_validatezonekey(dns_validator_t *val) { } if (result != ISC_R_SUCCESS) { validator_log(val, ISC_LOG_DEBUG(3), - "no KEY matching DLV"); + "no DNSKEY matching DLV"); continue; } @@ -1518,7 +1630,8 @@ dlv_validatezonekey(dns_validator_t *val) { dns_rdataset_disassociate(&trdataset); if (result == ISC_R_SUCCESS) break; - validator_log(val, ISC_LOG_DEBUG(3), "no SIG matching DLV key"); + validator_log(val, ISC_LOG_DEBUG(3), + "no RRSIG matching DLV key"); } if (result == ISC_R_SUCCESS) { val->event->rdataset->trust = dns_trust_secure; @@ -1767,7 +1880,7 @@ validatezonekey(dns_validator_t *val) { } if (result != ISC_R_SUCCESS) { validator_log(val, ISC_LOG_DEBUG(3), - "no KEY matching DS"); + "no DNSKEY matching DS"); continue; } @@ -1802,7 +1915,8 @@ validatezonekey(dns_validator_t *val) { dns_rdataset_disassociate(&trdataset); if (result == ISC_R_SUCCESS) break; - validator_log(val, ISC_LOG_DEBUG(3), "no SIG matching DS key"); + validator_log(val, ISC_LOG_DEBUG(3), + "no RRSIG matching DS key"); } if (result == ISC_R_SUCCESS) { event->rdataset->trust = dns_trust_secure; @@ -1982,8 +2096,8 @@ nsecvalidate(dns_validator_t *val, isc_boolean_t resume) { * would lead to a query for the zone key, which * would return a negative answer, which would contain * an SOA and an NSEC signed by the missing key, which - * would trigger another query for the KEY (since the - * first one is still in progress), and go into an + * would trigger another query for the DNSKEY (since + * the first one is still in progress), and go into an * infinite loop. Avoid that. */ if (val->event->type == dns_rdatatype_dnskey && @@ -2099,9 +2213,127 @@ check_ds_algorithm(dns_validator_t *val, dns_name_t *name, return (ISC_FALSE); } +static void +dlv_fetched2(isc_task_t *task, isc_event_t *event) { + dns_fetchevent_t *devent; + dns_validator_t *val; + isc_boolean_t want_destroy; + isc_result_t eresult; + isc_result_t result; + + UNUSED(task); + INSIST(event->ev_type == DNS_EVENT_FETCHDONE); + 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", + dns_result_totext(eresult)); + + LOCK(&val->lock); + if (eresult == ISC_R_SUCCESS) { + val->havedlvsep = ISC_TRUE; + result = proveunsecure(val, ISC_FALSE); + if (result != DNS_R_WAIT) + validator_done(val, result); + } else if (eresult == DNS_R_NXRRSET || + eresult == DNS_R_NXDOMAIN || + eresult == DNS_R_NCACHENXRRSET || + eresult == DNS_R_NCACHENXDOMAIN) { + result = finddlvsep(val, ISC_TRUE); + if (result == ISC_R_SUCCESS) { + result = proveunsecure(val, ISC_FALSE); + if (result != DNS_R_WAIT) + validator_done(val, result); + } else if (result == ISC_R_NOTFOUND) { + validator_done(val, ISC_R_SUCCESS); + } else if (result != DNS_R_WAIT) + validator_done(val, result); + } + want_destroy = exit_check(val); + UNLOCK(&val->lock); + if (want_destroy) + destroy(val); +} + +static isc_result_t +finddlvsep(dns_validator_t *val, isc_boolean_t resume) { + dns_fixedname_t dlvfixed; + dns_name_t *dlvname; + dns_name_t *dlvsep; + dns_name_t noroot; + isc_result_t result; + unsigned int labels; + + if (!resume) { + dns_fixedname_init(&val->dlvsep); + dlvsep = dns_fixedname_name(&val->dlvsep); + dns_name_copy(val->event->name, dlvsep, NULL); + val->attributes |= VALATTR_DLVSEPTRIED; + } else { + dlvsep = dns_fixedname_name(&val->dlvsep); + labels = dns_name_countlabels(dlvsep); + dns_name_getlabelsequence(dlvsep, 1, labels - 1, dlvsep); + } + dns_name_init(&noroot, NULL); + dns_fixedname_init(&dlvfixed); + dlvname = dns_fixedname_name(&dlvfixed); + labels = dns_name_countlabels(dlvsep); + dns_name_getlabelsequence(dlvsep, 0, labels - 1, &noroot); + result = dns_name_concatenate(&noroot, val->view->dlv, dlvname, NULL); + while (result == ISC_R_NOSPACE) { + labels = dns_name_countlabels(dlvsep); + dns_name_getlabelsequence(dlvsep, 1, labels - 1, dlvsep); + dns_name_getlabelsequence(dlvsep, 0, labels - 2, &noroot); + result = dns_name_concatenate(&noroot, val->view->dlv, + dlvname, NULL); + } + if (result != ISC_R_SUCCESS) { + validator_log(val, ISC_LOG_DEBUG(2), "DLV concatenate failed"); + return (DNS_R_NOVALIDSIG); + } + + while (dns_name_countlabels(dlvname) > + dns_name_countlabels(val->view->dlv)) + { + 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; + 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); + } + if (result != DNS_R_NXRRSET && + result != DNS_R_NXDOMAIN && + result != DNS_R_NCACHENXRRSET && + result != DNS_R_NCACHENXDOMAIN) + return (result); + /* + * Strip first labels from both dlvsep and dlvname. + */ + labels = dns_name_countlabels(dlvsep); + dns_name_getlabelsequence(dlvsep, 1, labels - 1, dlvsep); + labels = dns_name_countlabels(dlvname); + dns_name_getlabelsequence(dlvname, 1, labels - 1, dlvname); + } + return (ISC_R_NOTFOUND); +} + 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_name_t *tname; @@ -2112,11 +2344,30 @@ proveunsecure(dns_validator_t *val, isc_boolean_t resume) { /* * If the name is not under a security root, it must be insecure. */ - if (result == ISC_R_NOTFOUND) - return (ISC_R_SUCCESS); + 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); + } + } - else if (result != ISC_R_SUCCESS) + if (result == ISC_R_NOTFOUND) { + if (!val->havedlvsep) + 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 (!resume) { val->labels = @@ -2429,6 +2680,7 @@ dns_validator_create(dns_view_t *view, dns_name_t *name, dns_rdatatype_t type, val->nsecset = NULL; val->soaname = NULL; val->seensig = ISC_FALSE; + val->havedlvsep = ISC_FALSE; val->mustbesecure = dns_resolver_getmustbesecure(view->resolver, name); dns_rdataset_init(&val->frdataset); dns_rdataset_init(&val->fsigrdataset); diff --git a/dist/bind/lib/dns/zone.c b/dist/bind/lib/dns/zone.c index 9c94dc4ce9c..9e18270455b 100644 --- a/dist/bind/lib/dns/zone.c +++ b/dist/bind/lib/dns/zone.c @@ -1,4 +1,4 @@ -/* $NetBSD: zone.c,v 1.1.1.1 2004/05/17 23:44:56 christos Exp $ */ +/* $NetBSD: zone.c,v 1.1.1.2 2004/11/06 23:55:43 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -17,7 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* Id: zone.c,v 1.333.2.23.2.45 2004/04/29 01:45:23 marka Exp */ +/* Id: zone.c,v 1.333.2.23.2.50 2004/08/28 05:53:37 marka Exp */ #include <config.h> @@ -2351,8 +2351,10 @@ dump_done(void *arg, isc_result_t result) { tresult = dns_db_getsoaserial(db, version, &serial); if (tresult == ISC_R_SUCCESS) { - tresult = dns_journal_compact(zone->mctx, zone->journal, - serial, zone->journalsize); + tresult = dns_journal_compact(zone->mctx, + zone->journal, + serial, + zone->journalsize); switch (tresult) { case ISC_R_SUCCESS: case ISC_R_NOSPACE: @@ -3620,7 +3622,12 @@ refresh_callback(isc_task_t *task, isc_event_t *event) { dns_message_destroy(&msg); } else if (isc_serial_eq(soa.serial, zone->serial)) { if (zone->masterfile != NULL) { - result = isc_file_settime(zone->masterfile, &now); + result = ISC_R_FAILURE; + if (zone->journal != NULL) + result = isc_file_settime(zone->journal, &now); + if (result != ISC_R_SUCCESS) + result = isc_file_settime(zone->masterfile, + &now); /* Someone removed the file from underneath us! */ if (result == ISC_R_FILENOTFOUND) { LOCK_ZONE(zone); @@ -3988,6 +3995,8 @@ soa_query(isc_task_t *task, isc_event_t *event) { return; skip_master: + if (key != NULL) + dns_tsigkey_detach(&key); zone->curmaster++; if (zone->curmaster < zone->masterscnt) goto again; @@ -4251,14 +4260,17 @@ zone_shutdown(isc_task_t *task, isc_event_t *event) { if (zone->readio != NULL) zonemgr_cancelio(zone->readio); - if (zone->writeio != NULL) - zonemgr_cancelio(zone->writeio); - if (zone->lctx != NULL) dns_loadctx_cancel(zone->lctx); - if (zone->dctx != NULL) - dns_dumpctx_cancel(zone->dctx); + if (!DNS_ZONE_FLAG(zone, DNS_ZONEFLG_FLUSH) || + !DNS_ZONE_FLAG(zone, DNS_ZONEFLG_DUMPING)) { + if (zone->writeio != NULL) + zonemgr_cancelio(zone->writeio); + + if (zone->dctx != NULL) + dns_dumpctx_cancel(zone->dctx); + } notify_cancel(zone); @@ -5166,9 +5178,8 @@ notify_done(isc_task_t *task, isc_event_t *event) { * the soa if we see a formerr and had sent a SOA. */ isc_event_free(&event); - if ((result == ISC_R_TIMEDOUT || - (message != NULL && message->rcode == dns_rcode_formerr && - (notify->flags & DNS_NOTIFY_NOSOA) == 0))) { + if (message != NULL && message->rcode == dns_rcode_formerr && + (notify->flags & DNS_NOTIFY_NOSOA) == 0) { notify->flags |= DNS_NOTIFY_NOSOA; dns_request_destroy(¬ify->request); result = notify_send_queue(notify); @@ -5226,6 +5237,31 @@ zone_replacedb(dns_zone_t *zone, dns_db_t *db, isc_boolean_t dump) { 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, + "dns_journal_compact failed: %s", + dns_result_totext(result)); + break; + } + } + } } else { if (dump && zone->masterfile != NULL) { isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, diff --git a/dist/bind/lib/isc/Makefile.in b/dist/bind/lib/isc/Makefile.in index 0c0c65df60c..c7bb871674d 100644 --- a/dist/bind/lib/isc/Makefile.in +++ b/dist/bind/lib/isc/Makefile.in @@ -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.71.2.2.2.7 2004/03/08 09:04:48 marka Exp +# Id: Makefile.in,v 1.71.2.2.2.8 2004/07/20 07:01:58 marka Exp srcdir = @srcdir@ VPATH = @srcdir@ @@ -94,7 +94,7 @@ libisc.@SA@: ${OBJS} libisc.la: ${OBJS} ${LIBTOOL_MODE_LINK} \ - ${CC} ${ALL_CFLAGS} -o libisc.la -rpath ${libdir} \ + ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o libisc.la -rpath ${libdir} \ -version-info ${LIBINTERFACE}:${LIBREVISION}:${LIBAGE} \ ${OBJS} ${LIBS} diff --git a/dist/bind/lib/isc/api b/dist/bind/lib/isc/api index 75a502768ef..9d7fc51c828 100644 --- a/dist/bind/lib/isc/api +++ b/dist/bind/lib/isc/api @@ -1,3 +1,3 @@ LIBINTERFACE = 10 -LIBREVISION = 0 +LIBREVISION = 4 LIBAGE = 1 diff --git a/dist/bind/lib/isc/include/isc/result.h b/dist/bind/lib/isc/include/isc/result.h index 431c57e643e..33e4ef70309 100644 --- a/dist/bind/lib/isc/include/isc/result.h +++ b/dist/bind/lib/isc/include/isc/result.h @@ -1,4 +1,4 @@ -/* $NetBSD: result.h,v 1.1.1.1 2004/05/17 23:45:04 christos Exp $ */ +/* $NetBSD: result.h,v 1.1.1.2 2004/11/06 23:55:51 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -17,7 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* Id: result.h,v 1.57.2.2.8.4 2004/03/08 09:04:53 marka Exp */ +/* Id: result.h,v 1.57.2.2.8.5 2004/05/15 03:46:13 jinmei Exp */ #ifndef ISC_RESULT_H #define ISC_RESULT_H 1 @@ -84,11 +84,12 @@ #define ISC_R_BADNUMBER 56 /* not a valid number */ #define ISC_R_DISABLED 57 /* disabled */ #define ISC_R_MAXSIZE 58 /* max size */ +#define ISC_R_BADADDRESSFORM 59 /* invalid address format */ /* * Not a result code: the number of results. */ -#define ISC_R_NRESULTS 59 +#define ISC_R_NRESULTS 60 ISC_LANG_BEGINDECLS diff --git a/dist/bind/lib/isc/inet_ntop.c b/dist/bind/lib/isc/inet_ntop.c index af350d36992..85f3d5eb000 100644 --- a/dist/bind/lib/isc/inet_ntop.c +++ b/dist/bind/lib/isc/inet_ntop.c @@ -1,4 +1,4 @@ -/* $NetBSD: inet_ntop.c,v 1.1.1.1 2004/05/17 23:45:02 christos Exp $ */ +/* $NetBSD: inet_ntop.c,v 1.1.1.2 2004/11/06 23:55:49 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -19,7 +19,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char rcsid[] = - "Id: inet_ntop.c,v 1.12.12.3 2004/03/08 09:04:49 marka Exp"; + "Id: inet_ntop.c,v 1.12.12.4 2004/08/28 06:25:21 marka Exp"; #endif /* LIBC_SCCS and not lint */ #include <config.h> @@ -29,6 +29,7 @@ static char rcsid[] = #include <string.h> #include <isc/net.h> +#include <isc/print.h> #define NS_INT16SZ 2 #define NS_IN6ADDRSZ 16 diff --git a/dist/bind/lib/isc/lex.c b/dist/bind/lib/isc/lex.c index 2d9072c39e1..53f5d21ffda 100644 --- a/dist/bind/lib/isc/lex.c +++ b/dist/bind/lib/isc/lex.c @@ -1,4 +1,4 @@ -/* $NetBSD: lex.c,v 1.1.1.1 2004/05/17 23:45:02 christos Exp $ */ +/* $NetBSD: lex.c,v 1.1.1.2 2004/11/06 23:55:49 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -17,7 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* Id: lex.c,v 1.66.2.6.2.7 2004/03/06 08:14:31 marka Exp */ +/* Id: lex.c,v 1.66.2.6.2.8 2004/08/28 06:25:21 marka Exp */ #include <config.h> @@ -31,6 +31,7 @@ #include <isc/mem.h> #include <isc/msgs.h> #include <isc/parseint.h> +#include <isc/print.h> #include <isc/stdio.h> #include <isc/string.h> #include <isc/util.h> diff --git a/dist/bind/lib/isc/log.c b/dist/bind/lib/isc/log.c index 9192bac76f0..777532810c1 100644 --- a/dist/bind/lib/isc/log.c +++ b/dist/bind/lib/isc/log.c @@ -1,4 +1,4 @@ -/* $NetBSD: log.c,v 1.1.1.1 2004/05/17 23:45:02 christos Exp $ */ +/* $NetBSD: log.c,v 1.1.1.2 2004/11/06 23:55:49 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -17,7 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* Id: log.c,v 1.70.2.8.2.10 2004/04/10 04:31:40 marka Exp */ +/* Id: log.c,v 1.70.2.8.2.12 2004/06/11 00:35:38 marka Exp */ /* Principal Authors: DCL */ @@ -1142,6 +1142,10 @@ greatest_version(isc_logchannel_t *channel, int *greatestp) { unsigned int basenamelen; isc_dir_t dir; isc_result_t result; + char sep = '/'; +#ifdef _WIN32 + char *basename2; +#endif REQUIRE(channel->type == ISC_LOG_TOFILE); @@ -1149,7 +1153,15 @@ greatest_version(isc_logchannel_t *channel, int *greatestp) { * It is safe to DE_CONST the file.name because it was copied * with isc_mem_strdup in isc_log_createchannel. */ - basename = strrchr(FILE_NAME(channel), '/'); + basename = strrchr(FILE_NAME(channel), sep); +#ifdef _WIN32 + basename2 = strrchr(FILE_NAME(channel), '\\'); + if ((basename != NULL && basename2 != NULL && basename2 > basename) || + (basename == NULL && basename2 != NULL)) { + basename = basename2; + sep = '\\'; + } +#endif if (basename != NULL) { *basename++ = '\0'; dirname = FILE_NAME(channel); @@ -1166,7 +1178,7 @@ greatest_version(isc_logchannel_t *channel, int *greatestp) { * Replace the file separator if it was taken out. */ if (basename != FILE_NAME(channel)) - *(basename - 1) = '/'; + *(basename - 1) = sep; /* * Return if the directory open failed. @@ -1319,8 +1331,11 @@ isc_log_open(isc_logchannel_t *channel) { if (stat(path, &statbuf) == 0) { regular_file = S_ISREG(statbuf.st_mode) ? ISC_TRUE : ISC_FALSE; /* XXXDCL if not regular_file complain? */ - roll = ISC_TF(regular_file && FILE_MAXSIZE(channel) > 0 && - statbuf.st_size >= FILE_MAXSIZE(channel)); + if ((FILE_MAXSIZE(channel) == 0 && + FILE_VERSIONS(channel) != ISC_LOG_ROLLNEVER) || + (FILE_MAXSIZE(channel) > 0 && + statbuf.st_size >= FILE_MAXSIZE(channel))) + roll = regular_file; } else if (errno == ENOENT) regular_file = ISC_TRUE; else diff --git a/dist/bind/lib/isc/netaddr.c b/dist/bind/lib/isc/netaddr.c index f19890d1166..9d318f0676a 100644 --- a/dist/bind/lib/isc/netaddr.c +++ b/dist/bind/lib/isc/netaddr.c @@ -1,4 +1,4 @@ -/* $NetBSD: netaddr.c,v 1.1.1.1 2004/05/17 23:45:02 christos Exp $ */ +/* $NetBSD: netaddr.c,v 1.1.1.2 2004/11/06 23:55:49 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -17,7 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* Id: netaddr.c,v 1.18.12.8 2004/03/08 09:04:49 marka Exp */ +/* Id: netaddr.c,v 1.18.12.9 2004/05/15 03:46:12 jinmei Exp */ #include <config.h> @@ -49,7 +49,8 @@ isc_netaddr_equal(const isc_netaddr_t *a, const isc_netaddr_t *b) { break; case AF_INET6: if (memcmp(&a->type.in6, &b->type.in6, - sizeof(a->type.in6)) != 0) + sizeof(a->type.in6)) != 0 || + a->zone != b->zone) return (ISC_FALSE); break; default: diff --git a/dist/bind/lib/isc/result.c b/dist/bind/lib/isc/result.c index dc9c17af9b8..18127be04ce 100644 --- a/dist/bind/lib/isc/result.c +++ b/dist/bind/lib/isc/result.c @@ -1,4 +1,4 @@ -/* $NetBSD: result.c,v 1.1.1.1 2004/05/17 23:45:03 christos Exp $ */ +/* $NetBSD: result.c,v 1.1.1.2 2004/11/06 23:55:50 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -17,7 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* Id: result.c,v 1.56.2.2.8.5 2004/03/08 09:04:50 marka Exp */ +/* Id: result.c,v 1.56.2.2.8.7 2004/06/11 00:31:01 marka Exp */ #include <config.h> @@ -98,7 +98,8 @@ static const char *text[ISC_R_NRESULTS] = { "soft quota reached", /* 55 */ "not a valid number", /* 56 */ "disabled", /* 57 */ - "max size" /* 58 */ + "max size", /* 58 */ + "invalid address format" /* 59 */ }; #define ISC_RESULT_RESULTSET 2 @@ -126,7 +127,7 @@ register_table(unsigned int base, unsigned int nresults, const char **text, if (table == NULL) return (ISC_R_NOMEMORY); table->base = base; - table->last = base + nresults; + table->last = base + nresults - 1; table->text = text; table->msgcat = msgcat; table->set = set; diff --git a/dist/bind/lib/isc/sockaddr.c b/dist/bind/lib/isc/sockaddr.c index b34e261749f..66ee4cabc12 100644 --- a/dist/bind/lib/isc/sockaddr.c +++ b/dist/bind/lib/isc/sockaddr.c @@ -1,4 +1,4 @@ -/* $NetBSD: sockaddr.c,v 1.1.1.1 2004/05/17 23:45:02 christos Exp $ */ +/* $NetBSD: sockaddr.c,v 1.1.1.2 2004/11/06 23:55:50 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -17,7 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* Id: sockaddr.c,v 1.48.2.1.2.9 2004/03/08 09:04:50 marka Exp */ +/* Id: sockaddr.c,v 1.48.2.1.2.10 2004/05/15 03:46:12 jinmei Exp */ #include <config.h> @@ -59,6 +59,10 @@ isc_sockaddr_equal(const isc_sockaddr_t *a, const isc_sockaddr_t *b) { if (memcmp(&a->type.sin6.sin6_addr, &b->type.sin6.sin6_addr, sizeof(a->type.sin6.sin6_addr)) != 0) return (ISC_FALSE); +#ifdef ISC_PLATFORM_HAVESCOPEID + if (a->type.sin6.sin6_scope_id != b->type.sin6.sin6_scope_id) + return (ISC_FALSE); +#endif if (a->type.sin6.sin6_port != b->type.sin6.sin6_port) return (ISC_FALSE); break; @@ -88,6 +92,10 @@ isc_sockaddr_eqaddr(const isc_sockaddr_t *a, const isc_sockaddr_t *b) { if (memcmp(&a->type.sin6.sin6_addr, &b->type.sin6.sin6_addr, sizeof(a->type.sin6.sin6_addr)) != 0) return (ISC_FALSE); +#ifdef ISC_PLATFORM_HAVESCOPEID + if (a->type.sin6.sin6_scope_id != b->type.sin6.sin6_scope_id) + return (ISC_FALSE); +#endif break; default: if (memcmp(&a->type, &b->type, a->length) != 0) diff --git a/dist/bind/lib/isc/unix/Makefile.in b/dist/bind/lib/isc/unix/Makefile.in index 84eaa8cfc9e..d0c6c4b6c2a 100644 --- a/dist/bind/lib/isc/unix/Makefile.in +++ b/dist/bind/lib/isc/unix/Makefile.in @@ -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.35.2.1.10.1 2004/03/06 08:14:57 marka Exp +# Id: Makefile.in,v 1.35.2.1.10.2 2004/06/22 02:48:36 marka Exp srcdir = @srcdir@ VPATH = @srcdir@ @@ -46,3 +46,6 @@ SUBDIRS = include TARGETS = ${OBJS} @BIND9_MAKE_RULES@ + +interfaceiter.@O@: interfaceiter.c ifiter_ioctl.c ifiter_sysctl.c ifiter_getifaddrs.c + diff --git a/dist/bind/lib/isc/unix/ifiter_ioctl.c b/dist/bind/lib/isc/unix/ifiter_ioctl.c index 2f4c958b0bc..6ef96fbb387 100644 --- a/dist/bind/lib/isc/unix/ifiter_ioctl.c +++ b/dist/bind/lib/isc/unix/ifiter_ioctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: ifiter_ioctl.c,v 1.1.1.1 2004/05/17 23:45:05 christos Exp $ */ +/* $NetBSD: ifiter_ioctl.c,v 1.1.1.2 2004/11/06 23:55:52 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -17,7 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* Id: ifiter_ioctl.c,v 1.19.2.5.2.10 2004/04/15 07:03:50 marka Exp */ +/* Id: ifiter_ioctl.c,v 1.19.2.5.2.14 2004/06/22 04:40:23 marka Exp */ /* * Obtain the list of network interfaces using the SIOCGLIFCONF ioctl. @@ -52,7 +52,7 @@ #define VALID_IFITER(t) ISC_MAGIC_VALID(t, IFITER_MAGIC) #define ISC_IF_INET6_SZ \ - sizeof("00000000000000000000000000000001 01 80 10 80 lo\n") + sizeof("00000000000000000000000000000001 01 80 10 80 XXXXXXloXXXXXXXX\n") struct isc_interfaceiter { unsigned int magic; /* Magic number. */ @@ -102,6 +102,16 @@ struct isc_interfaceiter { #define IFCONF_BUFSIZE_INITIAL 4096 #define IFCONF_BUFSIZE_MAX 1048576 +#ifdef __linux +#ifndef IF_NAMESIZE +# ifdef IFNAMSIZ +# define IF_NAMESIZE IFNAMSIZ +# else +# define IF_NAMESIZE 16 +# endif +#endif +#endif + static isc_result_t getbuf4(isc_interfaceiter_t *iter) { char strbuf[ISC_STRERRORSIZE]; @@ -446,15 +456,28 @@ linux_if_inet6_current(isc_interfaceiter_t *iter) { if (iter->valid != ISC_R_SUCCESS) return (iter->valid); - if (iter->proc == NULL) + if (iter->proc == NULL) { + isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, + ISC_LOGMODULE_INTERFACE, ISC_LOG_ERROR, + "/proc/net/if_inet6:iter->proc == NULL"); return (ISC_R_FAILURE); + } res = sscanf(iter->entry, "%32[a-f0-9] %x %x %x %x %16s\n", address, &ifindex, &prefix, &flag3, &flag4, name); - if (res != 6) + if (res != 6) { + isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, + ISC_LOGMODULE_INTERFACE, ISC_LOG_ERROR, + "/proc/net/if_inet6:sscanf() -> %d (expected 6)", + res); return (ISC_R_FAILURE); - if (strlen(address) != 32) + } + if (strlen(address) != 32) { + isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, + ISC_LOGMODULE_INTERFACE, ISC_LOG_ERROR, + "/proc/net/if_inet6:strlen(%s) != 32", address); return (ISC_R_FAILURE); + } for (i = 0; i < 16; i++) { unsigned char byte; static const char hex[] = "0123456789abcdef"; @@ -945,7 +968,7 @@ internal_next(isc_interfaceiter_t *iter) { #endif #ifdef HAVE_TRUCLUSTER if (!iter->clua_done) { - clua_result = clua_getaliasaddress(&intr->clua_sa, + clua_result = clua_getaliasaddress(&iter->clua_sa, &iter->clua_context); if (clua_result != CLUA_SUCCESS) iter->clua_done = ISC_TRUE; @@ -985,7 +1008,7 @@ void internal_first(isc_interfaceiter_t *iter) { #endif #ifdef HAVE_TRUCLUSTER iter->clua_context = 0; - clua_result = clua_getaliasaddress(&intr->clua_sa, + clua_result = clua_getaliasaddress(&iter->clua_sa, &iter->clua_context); iter->clua_done = ISC_TF(clua_result != CLUA_SUCCESS); #endif diff --git a/dist/bind/lib/isc/unix/interfaceiter.c b/dist/bind/lib/isc/unix/interfaceiter.c index a8427bfeaff..db8ec2ed0d5 100644 --- a/dist/bind/lib/isc/unix/interfaceiter.c +++ b/dist/bind/lib/isc/unix/interfaceiter.c @@ -1,4 +1,4 @@ -/* $NetBSD: interfaceiter.c,v 1.1.1.1 2004/05/17 23:45:05 christos Exp $ */ +/* $NetBSD: interfaceiter.c,v 1.1.1.2 2004/11/06 23:55:52 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -17,7 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* Id: interfaceiter.c,v 1.22.2.1.10.12 2004/04/20 06:46:53 marka Exp */ +/* Id: interfaceiter.c,v 1.22.2.1.10.14 2004/08/28 06:25:22 marka Exp */ #include <config.h> @@ -38,6 +38,7 @@ #include <isc/mem.h> #include <isc/msgs.h> #include <isc/net.h> +#include <isc/print.h> #include <isc/result.h> #include <isc/strerror.h> #include <isc/string.h> @@ -67,6 +68,11 @@ get_addr(unsigned int family, isc_netaddr_t *dst, struct sockaddr *src, { struct sockaddr_in6 *sa6; +#if !defined(ISC_PLATFORM_HAVEIFNAMETOINDEX) || \ + !defined(ISC_PLATFORM_HAVESCOPEID) + UNUSED(ifname); +#endif + /* clear any remaining value for safety */ memset(dst, 0, sizeof(*dst)); diff --git a/dist/bind/lib/isc/unix/socket.c b/dist/bind/lib/isc/unix/socket.c index a75a4b2d69d..c5ff6c293b8 100644 --- a/dist/bind/lib/isc/unix/socket.c +++ b/dist/bind/lib/isc/unix/socket.c @@ -1,4 +1,4 @@ -/* $NetBSD: socket.c,v 1.1.1.1 2004/05/17 23:45:06 christos Exp $ */ +/* $NetBSD: socket.c,v 1.1.1.2 2004/11/06 23:55:53 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -17,7 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* Id: socket.c,v 1.207.2.19.2.11 2004/04/19 03:05:22 marka Exp */ +/* Id: socket.c,v 1.207.2.19.2.13 2004/07/01 04:51:15 marka Exp */ #include <config.h> @@ -2861,7 +2861,11 @@ isc_socket_bind(isc_socket_t *sock, isc_sockaddr_t *sockaddr) { UNLOCK(&sock->lock); return (ISC_R_FAMILYMISMATCH); } - if (setsockopt(sock->fd, SOL_SOCKET, SO_REUSEADDR, (void *)&on, + /* + * Only set SO_REUSEADDR when we want a specific port. + */ + if (isc_sockaddr_getport(sockaddr) != (in_port_t)0 && + setsockopt(sock->fd, SOL_SOCKET, SO_REUSEADDR, (void *)&on, sizeof(on)) < 0) { UNEXPECTED_ERROR(__FILE__, __LINE__, "setsockopt(%d) %s", sock->fd, diff --git a/dist/bind/lib/isc/win32/socket.c b/dist/bind/lib/isc/win32/socket.c index d8ed9e78bef..980f11ad7f5 100644 --- a/dist/bind/lib/isc/win32/socket.c +++ b/dist/bind/lib/isc/win32/socket.c @@ -1,4 +1,4 @@ -/* $NetBSD: socket.c,v 1.1.1.1 2004/05/17 23:45:07 christos Exp $ */ +/* $NetBSD: socket.c,v 1.1.1.2 2004/11/06 23:55:58 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -17,7 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* Id: socket.c,v 1.5.2.13.2.8 2004/03/06 08:15:10 marka Exp */ +/* Id: socket.c,v 1.5.2.13.2.13 2004/09/01 04:32:18 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 @@ -241,8 +241,10 @@ struct isc_socket { listener : 1, /* listener socket */ connected : 1, connecting : 1, /* connect pending */ - bound : 1; /* bound to local addr */ - + bound : 1, /* bound to local addr */ + pending_free: 1; + unsigned int pending_recv; + unsigned int pending_send; }; /* @@ -348,11 +350,8 @@ static isc_threadresult_t WINAPI SocketIoThread(LPVOID ThreadContext); static void free_socket(isc_socket_t **); enum { - SOCKET_CANCEL, - SOCKET_SHUTDOWN, SOCKET_RECV, SOCKET_SEND, - SOCK_ACCEPT }; enum { @@ -360,9 +359,6 @@ enum { EVENT_DELETE }; -#define SOCK_DEAD(s) ((s)->references == 0) - - #if defined(ISC_SOCKET_DEBUG) /* * This is used to dump the contents of the sock structure @@ -456,7 +452,7 @@ iocompletionport_createthreads(int total_threads, isc_socketmgr_t *manager) { * We need at least one */ for (i = 0; i < total_threads; i++) { - manager->hIOCPThreads[i] = CreateThread( NULL, 0, SocketIoThread, + manager->hIOCPThreads[i] = CreateThread(NULL, 0, SocketIoThread, manager, 0, &manager->dwIOCPThreadIds[i]); if(manager->hIOCPThreads[i] == NULL) { @@ -523,7 +519,8 @@ iocompletionport_exit(isc_socketmgr_t *manager) { } /* - * Add sockets in here and pass the sock data in as part of the information needed + * Add sockets in here and pass the sock data in as part of the + * information needed. */ void iocompletionport_update(isc_socket_t *sock) { @@ -654,9 +651,10 @@ socket_eventlist_add(event_change_t *evchange, sock_event_list *evlist, sock->evthread_id = GetCurrentThreadId(); return (ISC_TRUE); } + /* - * Note that the eventLock is locked before calling this function - * All Events and associated sockes are closed here + * Note that the eventLock is locked before calling this function. + * All Events and associated sockets are closed here. */ isc_boolean_t socket_eventlist_delete(event_change_t *evchange, sock_event_list *evlist) { @@ -666,7 +664,7 @@ socket_eventlist_delete(event_change_t *evchange, sock_event_list *evlist) { REQUIRE(evchange != NULL); /* Make sure this is the right thread from which to delete the event */ - if(evchange->evthread_id != GetCurrentThreadId()) + if (evchange->evthread_id != GetCurrentThreadId()) return (ISC_FALSE); REQUIRE(evlist != NULL); @@ -680,6 +678,7 @@ socket_eventlist_delete(event_change_t *evchange, sock_event_list *evlist) { break; } } + /* Actual event start at 1 */ if (iEvent < 1) return (ISC_FALSE); @@ -688,6 +687,7 @@ socket_eventlist_delete(event_change_t *evchange, sock_event_list *evlist) { evlist->aEventList[i] = evlist->aEventList[i + 1]; evlist->aSockList[i] = evlist->aSockList[i + 1]; } + evlist->aEventList[evlist->max_event - 1] = 0; evlist->aSockList[evlist->max_event - 1] = NULL; @@ -700,6 +700,7 @@ socket_eventlist_delete(event_change_t *evchange, sock_event_list *evlist) { return (ISC_TRUE); } + /* * Get the event changes off of the list and apply the * requested changes. The manager lock is taken out at @@ -724,15 +725,20 @@ process_eventlist(sock_event_list *evlist, isc_socketmgr_t *manager) { LOCK(&manager->lock); - /* First the deletes */ + /* + * First the deletes. + */ evchange = ISC_LIST_HEAD(manager->event_updates); while (evchange != NULL) { next = ISC_LIST_NEXT(evchange, link); del = ISC_FALSE; - if(evchange->action == EVENT_DELETE) { + if (evchange->action == EVENT_DELETE) { del = socket_eventlist_delete(evchange, evlist); - /* Delete only if this thread's socket list was updated */ + /* + * Delete only if this thread's socket list was + * updated. + */ if (del) { ISC_LIST_DEQUEUE(manager->event_updates, evchange, link); @@ -742,15 +748,21 @@ process_eventlist(sock_event_list *evlist, isc_socketmgr_t *manager) { } evchange = next; } - /* Now the adds */ + + /* + * Now the adds. + */ evchange = ISC_LIST_HEAD(manager->event_updates); while (evchange != NULL) { next = ISC_LIST_NEXT(evchange, link); del = ISC_FALSE; - if(evchange->action == EVENT_ADD) { + if (evchange->action == EVENT_ADD) { del = socket_eventlist_add(evchange, evlist, manager); - /* Delete only if this thread's socket list was updated */ + /* + * Delete only if this thread's socket list was + * updated. + */ if (del) { ISC_LIST_DEQUEUE(manager->event_updates, evchange, link); @@ -763,13 +775,15 @@ process_eventlist(sock_event_list *evlist, isc_socketmgr_t *manager) { UNLOCK(&manager->lock); return (ISC_R_SUCCESS); } + /* * Add the event list changes to the queue and notify the * event loop */ static void notify_eventlist(isc_socket_t *sock, isc_socketmgr_t *manager, - unsigned int action) { + unsigned int action) +{ event_change_t *evchange; @@ -795,6 +809,7 @@ notify_eventlist(isc_socket_t *sock, isc_socketmgr_t *manager, else WSASetEvent(manager->prime_alert); } + /* * Note that the socket is already locked before calling this function */ @@ -832,6 +847,7 @@ socket_event_add(isc_socket_t *sock, long type) { notify_eventlist(sock, sock->manager, EVENT_ADD); return (ISC_R_SUCCESS); } + /* * Note that the socket is not locked before calling this function */ @@ -849,8 +865,8 @@ socket_event_delete(isc_socket_t *sock) { sock->hAlert = NULL; sock->evthread_id = 0; } - } + /* * Routine to cleanup and then close the socket. * Only close the socket here if it is NOT associated @@ -874,6 +890,7 @@ socket_close(isc_socket_t *sock) { } } + /* * Initialize socket services */ @@ -895,7 +912,8 @@ BOOL InitSockets() { int internal_sendmsg(isc_socket_t *sock, IoCompletionInfo *lpo, - struct msghdr *messagehdr, int flags, int *Error) { + struct msghdr *messagehdr, int flags, int *Error) +{ int Result; DWORD BytesSent; DWORD Flags = flags; @@ -920,19 +938,20 @@ internal_sendmsg(isc_socket_t *sock, IoCompletionInfo *lpo, *Error = WSAGetLastError(); switch (*Error) { + case WSA_IO_INCOMPLETE : + case WSA_WAIT_IO_COMPLETION : + case WSA_IO_PENDING : + sock->pending_send++; + case NO_ERROR : + break; - case NO_ERROR : - case WSA_IO_INCOMPLETE : - case WSA_WAIT_IO_COMPLETION : - case WSA_IO_PENDING : - break; - - default : - return (-1); - break; - } - } - if(lpo != NULL) + default : + return (-1); + break; + } + } else + sock->pending_send++; + if (lpo != NULL) return (0); else return (total_sent); @@ -940,7 +959,8 @@ internal_sendmsg(isc_socket_t *sock, IoCompletionInfo *lpo, int internal_recvmsg(isc_socket_t *sock, IoCompletionInfo *lpo, - struct msghdr *messagehdr, int flags, int *Error) { + struct msghdr *messagehdr, int flags, int *Error) +{ DWORD Flags = 0; DWORD NumBytes = 0; int total_bytes = 0; @@ -948,14 +968,14 @@ internal_recvmsg(isc_socket_t *sock, IoCompletionInfo *lpo, *Error = 0; Result = WSARecvFrom((SOCKET) sock->fd, - messagehdr->msg_iov, - messagehdr->msg_iovlen, - &NumBytes, - &Flags, - messagehdr->msg_name, - (int *)&(messagehdr->msg_namelen), - (LPOVERLAPPED) lpo, - NULL); + messagehdr->msg_iov, + messagehdr->msg_iovlen, + &NumBytes, + &Flags, + messagehdr->msg_name, + (int *)&(messagehdr->msg_namelen), + (LPOVERLAPPED) lpo, + NULL); total_bytes = (int) NumBytes; @@ -965,31 +985,32 @@ internal_recvmsg(isc_socket_t *sock, IoCompletionInfo *lpo, *Error = WSAGetLastError(); switch (*Error) { + case WSA_IO_INCOMPLETE: + case WSA_WAIT_IO_COMPLETION: + case WSA_IO_PENDING: + sock->pending_recv++; + case NO_ERROR: + break; - case NO_ERROR : - case WSA_IO_INCOMPLETE : - case WSA_WAIT_IO_COMPLETION : - case WSA_IO_PENDING : - break; + default : + return (-1); + break; + } + } else + sock->pending_recv++; - default : - return (-1); - break; - } - } /* Return the flags received in header */ messagehdr->msg_flags = Flags; - if(lpo != NULL) + if (lpo != NULL) return (-1); else return (total_bytes); - } static void -manager_log(isc_socketmgr_t *sockmgr, - isc_logcategory_t *category, isc_logmodule_t *module, int level, - const char *fmt, ...) { +manager_log(isc_socketmgr_t *sockmgr, isc_logcategory_t *category, + isc_logmodule_t *module, int level, const char *fmt, ...) +{ char msgbuf[2048]; va_list ap; @@ -1009,11 +1030,13 @@ socket_log(isc_socket_t *sock, isc_sockaddr_t *address, isc_logcategory_t *category, isc_logmodule_t *module, int level, isc_msgcat_t *msgcat, int msgset, int message, const char *fmt, ...) ISC_FORMAT_PRINTF(9, 10); + static void socket_log(isc_socket_t *sock, isc_sockaddr_t *address, isc_logcategory_t *category, isc_logmodule_t *module, int level, isc_msgcat_t *msgcat, int msgset, int message, - const char *fmt, ...) { + const char *fmt, ...) +{ char msgbuf[2048]; char peerbuf[256]; va_list ap; @@ -1060,6 +1083,7 @@ make_nonblock(SOCKET fd) { return (ISC_R_SUCCESS); } + /* * Windows 2000 systems incorrectly cause UDP sockets using WASRecvFrom * to not work correctly, returning a WSACONNRESET error when a WSASendTo @@ -1109,7 +1133,8 @@ connection_reset_fix(SOCKET fd) { static void build_msghdr_send(isc_socket_t *sock, isc_socketevent_t *dev, struct msghdr *msg, char *cmsg, - WSABUF *iov, size_t *write_countp) { + WSABUF *iov, size_t *write_countp) +{ unsigned int iovcount; isc_buffer_t *buffer; isc_region_t used; @@ -1196,7 +1221,8 @@ build_msghdr_send(isc_socket_t *sock, isc_socketevent_t *dev, static void build_msghdr_recv(isc_socket_t *sock, isc_socketevent_t *dev, struct msghdr *msg, char *cmsg, - WSABUF *iov, size_t *read_countp) { + WSABUF *iov, size_t *read_countp) +{ unsigned int iovcount; isc_buffer_t *buffer; isc_region_t available; @@ -1226,10 +1252,10 @@ build_msghdr_recv(isc_socket_t *sock, isc_socketevent_t *dev, iov[0].len = read_count; iovcount = 1; } else { - /* - * Multibuffer I/O. - * Skip empty buffers. - */ + /* + * Multibuffer I/O. + * Skip empty buffers. + */ while (buffer != NULL) { REQUIRE(ISC_BUFFER_VALID(buffer)); if (isc_buffer_availablelength(buffer) != 0) @@ -1268,7 +1294,8 @@ build_msghdr_recv(isc_socket_t *sock, isc_socketevent_t *dev, static void set_dev_address(isc_sockaddr_t *address, isc_socket_t *sock, - isc_socketevent_t *dev) { + isc_socketevent_t *dev) +{ if (sock->type == isc_sockettype_udp) { if (address != NULL) dev->address = *address; @@ -1282,14 +1309,14 @@ set_dev_address(isc_sockaddr_t *address, isc_socket_t *sock, static isc_socketevent_t * allocate_socketevent(isc_socket_t *sock, isc_eventtype_t eventtype, - isc_taskaction_t action, const void *arg) { + isc_taskaction_t action, const void *arg) +{ isc_socketevent_t *ev; ev = (isc_socketevent_t *)isc_event_allocate(sock->manager->mctx, sock, eventtype, action, arg, sizeof(*ev)); - if (ev == NULL) return (NULL); @@ -1326,7 +1353,8 @@ dump_msg(struct msghdr *msg, isc_socket_t *sock) { static int completeio_recv(isc_socket_t *sock, isc_socketevent_t *dev, - struct msghdr *messagehdr, int cc, int recv_errno) { + struct msghdr *messagehdr, int cc, int recv_errno) +{ size_t actual_count; isc_buffer_t *buffer; @@ -1444,31 +1472,27 @@ completeio_recv(isc_socket_t *sock, isc_socketevent_t *dev, dev->result = ISC_R_SUCCESS; return (DOIO_SUCCESS); } + static int startio_recv(isc_socket_t *sock, isc_socketevent_t *dev, int *nbytes, - BOOL bwait, int *recv_errno) { + int *recv_errno) +{ char *cmsg = NULL; char strbuf[ISC_STRERRORSIZE]; IoCompletionInfo *lpo; int status; - struct msghdr messagehdr; struct msghdr *msghdr; - if (!bwait) { - lpo = (IoCompletionInfo *) HeapAlloc(hHeapHandle, - HEAP_ZERO_MEMORY, sizeof(IoCompletionInfo)); - lpo->request_type = SOCKET_RECV; - lpo->dev = dev; - msghdr = &lpo->messagehdr; - } else { /* Wait for recv to complete */ - lpo = NULL; - msghdr = &messagehdr; - } - sock->references++; + lpo = (IoCompletionInfo *) HeapAlloc(hHeapHandle, + HEAP_ZERO_MEMORY, + sizeof(IoCompletionInfo)); + lpo->request_type = SOCKET_RECV; + lpo->dev = dev; + msghdr = &lpo->messagehdr; memset(msghdr, 0, sizeof(struct msghdr)); build_msghdr_recv(sock, dev, msghdr, cmsg, sock->iov, - &(sock->totalBytes)); + &(sock->totalBytes)); #if defined(ISC_SOCKET_DEBUG) dump_msg(msghdr, sock); @@ -1487,13 +1511,12 @@ startio_recv(isc_socket_t *sock, isc_socketevent_t *dev, int *nbytes, socket_log(sock, NULL, IOEVENT, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_DOIORECV, - "startio_recv: recvmsg(%d) %d bytes, err %d/%s", + "startio_recv: recvmsg(%d) %d bytes, " + "err %d/%s", sock->fd, *nbytes, *recv_errno, strbuf); } - status = completeio_recv(sock, dev, msghdr, *nbytes, *recv_errno); - if(status != DOIO_SOFT) { - sock->references--; - } + status = completeio_recv(sock, dev, msghdr, + *nbytes, *recv_errno); goto done; } dev->result = ISC_R_SUCCESS; @@ -1501,6 +1524,7 @@ startio_recv(isc_socket_t *sock, isc_socketevent_t *dev, int *nbytes, done: return (status); } + /* * Returns: * DOIO_SUCCESS The operation succeeded. dev->result contains @@ -1515,8 +1539,9 @@ done: * No other return values are possible. */ static int -completeio_send(isc_socket_t *sock, isc_socketevent_t *dev, struct msghdr *messagehdr, int cc, - int send_errno) { +completeio_send(isc_socket_t *sock, isc_socketevent_t *dev, + struct msghdr *messagehdr, int cc, int send_errno) +{ char addrbuf[ISC_SOCKADDR_FORMATSIZE]; char strbuf[ISC_STRERRORSIZE]; @@ -1594,28 +1619,24 @@ completeio_send(isc_socket_t *sock, isc_socketevent_t *dev, struct msghdr *messa dev->result = ISC_R_SUCCESS; return (DOIO_SUCCESS); } + static int startio_send(isc_socket_t *sock, isc_socketevent_t *dev, int *nbytes, - BOOL bwait, int *send_errno) { + int *send_errno) +{ char *cmsg = NULL; char strbuf[ISC_STRERRORSIZE]; IoCompletionInfo *lpo; int status; - struct msghdr messagehdr; struct msghdr *msghdr; - if (!bwait) { - lpo = (IoCompletionInfo *) HeapAlloc(hHeapHandle, - HEAP_ZERO_MEMORY, sizeof(IoCompletionInfo)); - lpo->request_type = SOCKET_SEND; - lpo->dev = dev; - msghdr = &lpo->messagehdr; - } else { /* Wait for send to complete */ - lpo = NULL; - msghdr = &messagehdr; - } + lpo = (IoCompletionInfo *) HeapAlloc(hHeapHandle, + HEAP_ZERO_MEMORY, + sizeof(IoCompletionInfo)); + lpo->request_type = SOCKET_SEND; + lpo->dev = dev; + msghdr = &lpo->messagehdr; memset(msghdr, 0, sizeof(struct msghdr)); - sock->references++; build_msghdr_send(sock, dev, msghdr, cmsg, sock->iov, &(sock->totalBytes)); @@ -1633,13 +1654,12 @@ startio_send(isc_socket_t *sock, isc_socketevent_t *dev, int *nbytes, socket_log(sock, NULL, IOEVENT, isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_INTERNALSEND, - "startio_send: internal_sendmsg(%d) %d bytes, err %d/%s", + "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); - if(status != DOIO_SOFT) { - sock->references--; - } + status = completeio_send(sock, dev, msghdr, + *nbytes, *send_errno); goto done; } dev->result = ISC_R_SUCCESS; @@ -1647,6 +1667,7 @@ startio_send(isc_socket_t *sock, isc_socketevent_t *dev, int *nbytes, done: return (status); } + /* * Kill. * @@ -1657,6 +1678,7 @@ static void destroy_socket(isc_socket_t **sockp) { isc_socket_t *sock = *sockp; isc_socketmgr_t *manager = sock->manager; + isc_boolean_t dofree = ISC_TRUE; REQUIRE(sock != NULL); @@ -1670,15 +1692,14 @@ destroy_socket(isc_socket_t **sockp) { LOCK(&manager->lock); - /* - * No one has this socket open and the socket doesn't have to be - * locked. The socket_close function makes sure that if needed - * the event_wait loop removes any associated event from the list - * of events being waited on. - */ + LOCK(&sock->lock); socket_close(sock); - + if (sock->pending_recv != 0 || sock->pending_send != 0) { + dofree = ISC_FALSE; + sock->pending_free = 1; + } ISC_LIST_UNLINK(manager->socklist, sock, link); + UNLOCK(&sock->lock); if (ISC_LIST_EMPTY(manager->socklist)) SIGNAL(&manager->shutdown_ok); @@ -1686,10 +1707,10 @@ destroy_socket(isc_socket_t **sockp) { /* * XXX should reset manager->maxfd here */ - UNLOCK(&manager->lock); - free_socket(sockp); + if (dofree) + free_socket(sockp); } static isc_result_t @@ -1723,6 +1744,9 @@ allocate_socket(isc_socketmgr_t *manager, isc_sockettype_t type, sock->connect_ev = NULL; sock->pending_accept = 0; sock->pending_close = 0; + sock->pending_recv = 0; + sock->pending_send = 0; + sock->pending_free = 0; sock->iocp = 0; sock->listener = 0; sock->connected = 0; @@ -1824,11 +1848,13 @@ isc_socket_create(isc_socketmgr_t *manager, int pf, isc_sockettype_t type, switch (type) { case isc_sockettype_udp: sock->fd = socket(pf, SOCK_DGRAM, IPPROTO_UDP); - result = connection_reset_fix(sock->fd); - if (result != ISC_R_SUCCESS) { - closesocket(sock->fd); - free_socket(&sock); - return (result); + if (sock->fd != INVALID_SOCKET) { + result = connection_reset_fix(sock->fd); + if (result != ISC_R_SUCCESS) { + closesocket(sock->fd); + free_socket(&sock); + return (result); + } } break; case isc_sockettype_tcp: @@ -1894,7 +1920,7 @@ isc_socket_create(isc_socketmgr_t *manager, int pf, isc_sockettype_t type, if ((pf == AF_INET6) && (setsockopt(sock->fd, IPPROTO_IPV6, IPV6_PKTINFO, (void *)&on, sizeof(on)) < 0)) { - isc__strerror(WSAGetLaastError(), strbuf, sizeof(strbuf)); + isc__strerror(WSAGetLastError(), strbuf, sizeof(strbuf)); UNEXPECTED_ERROR(__FILE__, __LINE__, "setsockopt(%d, IPV6_PKTINFO) %s: %s", sock->fd, @@ -2068,14 +2094,6 @@ internal_accept(isc_socket_t *sock, int accept_errno) { INSIST(sock->pending_accept == 1); sock->pending_accept = 0; - INSIST(sock->references > 0); - sock->references--; /* the internal event is done with this socket */ - if (sock->references == 0) { - UNLOCK(&sock->lock); - destroy_socket(&sock); - return; - } - /* * Check any possible error status from the event notification here. * Note that we don't take any action since it was only @@ -2287,18 +2305,6 @@ internal_connect(isc_socket_t *sock, int connect_errno) { LOCK(&sock->lock); /* - * When the internal event was sent the reference count was bumped - * to keep the socket around for us. Decrement the count here. - */ - INSIST(sock->references > 0); - sock->references--; - if (sock->references == 0) { - UNLOCK(&sock->lock); - destroy_socket(&sock); - return; - } - - /* * Has this event been canceled? */ dev = sock->connect_ev; @@ -2368,7 +2374,9 @@ internal_connect(isc_socket_t *sock, int connect_errno) { } static void -internal_recv(isc_socket_t *sock, isc_socketevent_t *dev, struct msghdr *messagehdr, int nbytes, int recv_errno) { +internal_recv(isc_socket_t *sock, isc_socketevent_t *dev, + struct msghdr *messagehdr, int nbytes, int recv_errno) +{ isc_socketevent_t *ldev; int io_state; int cc; @@ -2380,14 +2388,8 @@ internal_recv(isc_socket_t *sock, isc_socketevent_t *dev, struct msghdr *message isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_INTERNALRECV, "internal_recv: task got socket event %p", dev); - INSIST(sock->references > 0); - sock->references--; /* the internal event is done with this socket */ - if (sock->references == 0) { - UNLOCK(&sock->lock); - destroy_socket(&sock); - return; - } - + INSIST(sock->pending_recv > 0); + sock->pending_recv--; /* If the event is no longer in the list we can just return */ ldev = ISC_LIST_HEAD(sock->recv_list); while (ldev != NULL && ldev != dev) { @@ -2400,34 +2402,36 @@ internal_recv(isc_socket_t *sock, isc_socketevent_t *dev, struct msghdr *message * Try to do as much I/O as possible on this socket. There are no * limits here, currently. */ - switch (completeio_recv(sock, dev, messagehdr, nbytes, recv_errno)) { - case DOIO_SOFT: - cc = 0; - recv_errno = 0; - io_state = startio_recv(sock, dev, &cc, FALSE, &recv_errno); - goto done; + switch (completeio_recv(sock, dev, messagehdr, nbytes, recv_errno)) { + case DOIO_SOFT: + cc = 0; + recv_errno = 0; + io_state = startio_recv(sock, dev, &cc, &recv_errno); + goto done; - case DOIO_EOF: - /* - * read of 0 means the remote end was closed. - * Run through the event queue and dispatch all - * the events with an EOF result code. - */ - dev->result = ISC_R_EOF; - send_recvdone_event(sock, &dev); - goto done; + case DOIO_EOF: + /* + * read of 0 means the remote end was closed. + * Run through the event queue and dispatch all + * the events with an EOF result code. + */ + dev->result = ISC_R_EOF; + send_recvdone_event(sock, &dev); + goto done; - case DOIO_SUCCESS: - case DOIO_HARD: - send_recvdone_event(sock, &dev); - break; - } + case DOIO_SUCCESS: + case DOIO_HARD: + send_recvdone_event(sock, &dev); + break; + } done: UNLOCK(&sock->lock); } static void -internal_send(isc_socket_t *sock, isc_socketevent_t *dev, struct msghdr *messagehdr, int nbytes, int send_errno) { +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; @@ -2442,13 +2446,8 @@ internal_send(isc_socket_t *sock, isc_socketevent_t *dev, struct msghdr *message isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_INTERNALSEND, "internal_send: task got socket event %p", dev); - INSIST(sock->references > 0); - sock->references--; /* the internal event is done with this socket */ - if (sock->references == 0) { - UNLOCK(&sock->lock); - destroy_socket(&sock); - return; - } + INSIST(sock->pending_send > 0); + sock->pending_send--; /* If the event is no longer in the list we can just return */ ldev = ISC_LIST_HEAD(sock->send_list); @@ -2465,7 +2464,7 @@ internal_send(isc_socket_t *sock, isc_socketevent_t *dev, struct msghdr *message case DOIO_SOFT: cc = 0; send_errno = 0; - io_state = startio_send(sock, dev, &cc, FALSE, &send_errno); + io_state = startio_send(sock, dev, &cc, &send_errno); goto done; case DOIO_HARD: @@ -2489,8 +2488,6 @@ SocketIoThread(LPVOID ThreadContext) { isc_socketmgr_t *manager = ThreadContext; BOOL bSuccess = FALSE; DWORD nbytes; - DWORD tbytes; - DWORD tflags; IoCompletionInfo *lpo = NULL; isc_socket_t *sock = NULL; int request; @@ -2506,7 +2503,9 @@ SocketIoThread(LPVOID ThreadContext) { * preempt normal recv packet processing, but not * higher than the timer sync thread. */ - if (!SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL)) { + if (!SetThreadPriority(GetCurrentThread(), + THREAD_PRIORITY_ABOVE_NORMAL)) + { errval = GetLastError(); isc__strerror(errval, strbuf, sizeof(strbuf)); FATAL_ERROR(__FILE__, __LINE__, @@ -2516,33 +2515,53 @@ SocketIoThread(LPVOID ThreadContext) { strbuf); } - /* * Loop forever waiting on I/O Completions and then processing them */ - while(TRUE) { + while (TRUE) { bSuccess = GetQueuedCompletionStatus ( manager->hIoCompletionPort, &nbytes, (LPDWORD) &sock, (LPOVERLAPPED *)&lpo, - INFINITE - ); - if(lpo == NULL ) { + INFINITE); + if (lpo == NULL) { /* * Received request to exit */ break; } errstatus = 0; - if(!bSuccess) { + if (!bSuccess) { + isc_boolean_t dofree = ISC_FALSE; + REQUIRE(VALID_SOCKET(sock)); /* - * I/O Failure - * Find out why + * Was this the socket closed under us? */ - WSAGetOverlappedResult(sock->fd, (LPWSAOVERLAPPED) &lpo, - &tbytes, FALSE, &tflags); - dev = lpo->dev; + errstatus = WSAGetLastError(); + if (nbytes == 0 && errstatus == WSA_OPERATION_ABORTED) { + LOCK(&sock->lock); + switch (lpo->request_type) { + case SOCKET_RECV: + INSIST(sock->pending_recv > 0); + sock->pending_recv--; + break; + case SOCKET_SEND: + INSIST(sock->pending_send > 0); + sock->pending_send--; + break; + } + if (sock->pending_recv == 0 && + sock->pending_send == 0 && + sock->pending_free) + dofree = ISC_TRUE; + UNLOCK(&sock->lock); + if (dofree) + free_socket(&sock); + if (lpo != NULL) + HeapFree(hHeapHandle, 0, lpo); + continue; + } } request = lpo->request_type; @@ -2550,20 +2569,17 @@ SocketIoThread(LPVOID ThreadContext) { messagehdr = &lpo->messagehdr; switch (request) { - case SOCKET_CANCEL: - break; case SOCKET_RECV: internal_recv(sock, dev, messagehdr, nbytes, errstatus); break; case SOCKET_SEND: internal_send(sock, dev, messagehdr, nbytes, errstatus); break; - default: - break; /* Unknown: Just ignore it */ } if (lpo != NULL) HeapFree(hHeapHandle, 0, lpo); } + /* * Exit Completion Port Thread */ @@ -2572,6 +2588,7 @@ SocketIoThread(LPVOID ThreadContext) { ISC_MSG_EXITING, "SocketIoThread exiting")); return ((isc_threadresult_t)0); } + /* * This is the thread that will loop forever, waiting for an event to * happen. @@ -2633,7 +2650,6 @@ event_wait(void *uap) { } while (cc < 0 && !manager->bShutdown && manager->event_written == 0); - if (manager->bShutdown) break; @@ -2692,11 +2708,9 @@ event_wait(void *uap) { if (wsock->listener == 1 && wsock->pending_accept == 0) { wsock->pending_accept = 1; - wsock->references++; internal_accept(wsock, event_errno); } else { - wsock->references++; internal_connect(wsock, event_errno); } } @@ -2708,6 +2722,7 @@ event_wait(void *uap) { return ((isc_threadresult_t)0); } + /* * Create a new socket manager. */ @@ -2863,7 +2878,8 @@ isc_socketmgr_destroy(isc_socketmgr_t **managerp) { static isc_result_t socket_recv(isc_socket_t *sock, isc_socketevent_t *dev, isc_task_t *task, - unsigned int flags) { + unsigned int flags) +{ int io_state; int cc = 0; isc_task_t *ntask = NULL; @@ -2874,7 +2890,7 @@ socket_recv(isc_socket_t *sock, isc_socketevent_t *dev, isc_task_t *task, LOCK(&sock->lock); iocompletionport_update(sock); - io_state = startio_recv(sock, dev, &cc, FALSE, &recv_errno); + io_state = startio_recv(sock, dev, &cc, &recv_errno); switch (io_state) { case DOIO_SOFT: @@ -3052,7 +3068,7 @@ socket_send(isc_socket_t *sock, isc_socketevent_t *dev, isc_task_t *task, LOCK(&sock->lock); have_lock = ISC_TRUE; iocompletionport_update(sock); - io_state = startio_send(sock, dev, &cc, FALSE, &send_errno); + io_state = startio_send(sock, dev, &cc, &send_errno); switch (io_state) { case DOIO_SOFT: @@ -3211,7 +3227,11 @@ isc_socket_bind(isc_socket_t *sock, isc_sockaddr_t *sockaddr) { UNLOCK(&sock->lock); return (ISC_R_FAMILYMISMATCH); } - if (setsockopt(sock->fd, SOL_SOCKET, SO_REUSEADDR, (void *)&on, + /* + * Only set SO_REUSEADDR when we want a specific port. + */ + if (isc_sockaddr_getport(sockaddr) != (in_port_t)0 && + setsockopt(sock->fd, SOL_SOCKET, SO_REUSEADDR, (void *)&on, sizeof(on)) < 0) { UNEXPECTED_ERROR(__FILE__, __LINE__, "setsockopt(%d) %s", sock->fd, @@ -3645,7 +3665,6 @@ isc_socket_cancel(isc_socket_t *sock, isc_task_t *task, unsigned int how) { isc_task_t *current_task; dev = ISC_LIST_HEAD(sock->accept_list); - socket_event_delete(sock); while (dev != NULL) { current_task = dev->ev_sender; diff --git a/dist/bind/lib/isccc/Makefile.in b/dist/bind/lib/isccc/Makefile.in index 2bee902664e..bab86d43523 100644 --- a/dist/bind/lib/isccc/Makefile.in +++ b/dist/bind/lib/isccc/Makefile.in @@ -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.12.4 2004/03/06 08:15:18 marka Exp +# Id: Makefile.in,v 1.2.12.5 2004/07/20 07:01:58 marka Exp srcdir = @srcdir@ VPATH = @srcdir@ @@ -69,7 +69,7 @@ libisccc.@SA@: ${OBJS} libisccc.la: ${OBJS} ${LIBTOOL_MODE_LINK} \ - ${CC} ${ALL_CFLAGS} -o libisccc.la -rpath ${libdir} \ + ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o libisccc.la -rpath ${libdir} \ -version-info ${LIBINTERFACE}:${LIBREVISION}:${LIBAGE} \ ${OBJS} ${LIBS} ${ISCLIBS} diff --git a/dist/bind/lib/isccc/api b/dist/bind/lib/isccc/api index 8cf13ed487b..4f115e73f2d 100644 --- a/dist/bind/lib/isccc/api +++ b/dist/bind/lib/isccc/api @@ -1,3 +1,3 @@ LIBINTERFACE = 2 -LIBREVISION = 0 +LIBREVISION = 1 LIBAGE = 2 diff --git a/dist/bind/lib/isccc/cc.c b/dist/bind/lib/isccc/cc.c index 993db6bafcb..0bde13bf8a1 100644 --- a/dist/bind/lib/isccc/cc.c +++ b/dist/bind/lib/isccc/cc.c @@ -1,4 +1,4 @@ -/* $NetBSD: cc.c,v 1.1.1.1 2004/05/17 23:45:08 christos Exp $ */ +/* $NetBSD: cc.c,v 1.1.1.2 2004/11/06 23:55:59 christos Exp $ */ /* * Portions Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -18,7 +18,7 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* Id: cc.c,v 1.4.2.3.2.4 2004/03/06 08:15:19 marka Exp */ +/* Id: cc.c,v 1.4.2.3.2.5 2004/08/28 06:25:23 marka Exp */ #include <config.h> @@ -28,6 +28,7 @@ #include <isc/assertions.h> #include <isc/hmacmd5.h> +#include <isc/print.h> #include <isc/stdlib.h> #include <isccc/alist.h> diff --git a/dist/bind/lib/isccfg/Makefile.in b/dist/bind/lib/isccfg/Makefile.in index 80fb0d7891c..61c38b07de7 100644 --- a/dist/bind/lib/isccfg/Makefile.in +++ b/dist/bind/lib/isccfg/Makefile.in @@ -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.6.12.7 2004/03/09 05:21:09 marka Exp +# Id: Makefile.in,v 1.6.12.8 2004/07/20 07:01:58 marka Exp srcdir = @srcdir@ VPATH = @srcdir@ @@ -66,7 +66,7 @@ libisccfg.@SA@: ${OBJS} libisccfg.la: ${OBJS} ${LIBTOOL_MODE_LINK} \ - ${CC} ${ALL_CFLAGS} -o libisccfg.la -rpath ${libdir} \ + ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o libisccfg.la -rpath ${libdir} \ -version-info ${LIBINTERFACE}:${LIBREVISION}:${LIBAGE} \ ${OBJS} ${LIBS} ${DNSLIBS} ${ISCCCLIBS} ${ISCLIBS} diff --git a/dist/bind/lib/isccfg/api b/dist/bind/lib/isccfg/api index 7f2166bec3a..7c378e6ef95 100644 --- a/dist/bind/lib/isccfg/api +++ b/dist/bind/lib/isccfg/api @@ -1,3 +1,3 @@ LIBINTERFACE = 1 -LIBREVISION = 2 +LIBREVISION = 4 LIBAGE = 0 diff --git a/dist/bind/lib/isccfg/namedconf.c b/dist/bind/lib/isccfg/namedconf.c index ba1c21a8634..8e0a7624170 100644 --- a/dist/bind/lib/isccfg/namedconf.c +++ b/dist/bind/lib/isccfg/namedconf.c @@ -1,4 +1,4 @@ -/* $NetBSD: namedconf.c,v 1.1.1.1 2004/05/17 23:45:09 christos Exp $ */ +/* $NetBSD: namedconf.c,v 1.1.1.2 2004/11/06 23:55:59 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -17,7 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* Id: namedconf.c,v 1.21.44.27 2004/04/15 23:56:34 marka Exp */ +/* Id: namedconf.c,v 1.21.44.28 2004/06/04 02:33:01 marka Exp */ #include <config.h> @@ -661,6 +661,28 @@ static cfg_type_t cfg_type_mustbesecure = { }; /* + * dnssec-lookaside + */ + +static keyword_type_t trustanchor_kw = { "trust-anchor", &cfg_type_astring }; + +static cfg_type_t cfg_type_trustanchor = { + "trust-anchor", parse_keyvalue, print_keyvalue, doc_keyvalue, + &cfg_rep_string, &trustanchor_kw +}; + +static cfg_tuplefielddef_t lookaside_fields[] = { + { "domain", &cfg_type_astring, 0 }, + { "trust-anchor", &cfg_type_trustanchor, 0 }, + { NULL, NULL, 0 } +}; + +static cfg_type_t cfg_type_lookaside = { + "lookaside", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple, + &cfg_rep_tuple, lookaside_fields +}; + +/* * Clauses that can be found within the 'view' statement, * with defaults in the 'options' statement. */ @@ -705,7 +727,7 @@ view_clauses[] = { { "disable-algorithms", &cfg_type_disablealgorithm, CFG_CLAUSEFLAG_MULTI }, { "dnssec-enable", &cfg_type_boolean, 0 }, - { "dnssec-lookaside", &cfg_type_astring, 0 }, + { "dnssec-lookaside", &cfg_type_lookaside, CFG_CLAUSEFLAG_MULTI }, { "dnssec-must-be-secure", &cfg_type_mustbesecure, CFG_CLAUSEFLAG_MULTI }, { NULL, NULL, 0 } @@ -1203,6 +1225,7 @@ controls_clauses[] = { CFG_CLAUSEFLAG_MULTI|CFG_CLAUSEFLAG_NOTIMP }, { NULL, NULL, 0 } }; + static cfg_clausedef_t * controls_clausesets[] = { controls_clauses, diff --git a/dist/bind/lib/isccfg/parser.c b/dist/bind/lib/isccfg/parser.c index 8ad5956eb78..698f8c202f9 100644 --- a/dist/bind/lib/isccfg/parser.c +++ b/dist/bind/lib/isccfg/parser.c @@ -1,4 +1,4 @@ -/* $NetBSD: parser.c,v 1.1.1.1 2004/05/17 23:45:09 christos Exp $ */ +/* $NetBSD: parser.c,v 1.1.1.2 2004/11/06 23:56:00 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -17,7 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* Id: parser.c,v 1.70.2.20.2.17 2004/03/16 12:38:15 marka Exp */ +/* Id: parser.c,v 1.70.2.20.2.18 2004/05/15 03:46:13 jinmei Exp */ #include <config.h> @@ -1673,7 +1673,7 @@ token_addr(cfg_parser_t *pctx, unsigned int flags, isc_netaddr_t *na) { } if ((flags & CFG_ADDR_V6OK) != 0 && strlen(s) <= 127U) { - char buf[128]; + char buf[128]; /* see lib/bind9/getaddresses.c */ char *d; /* zone delimiter */ isc_uint32_t zone = 0; /* scope zone ID */ @@ -1684,6 +1684,7 @@ token_addr(cfg_parser_t *pctx, unsigned int flags, isc_netaddr_t *na) { if (inet_pton(AF_INET6, buf, &in6a) == 1) { if (d != NULL) { +#ifdef ISC_PLATFORM_HAVESCOPEID isc_result_t result; result = isc_netscope_pton(AF_INET6, @@ -1692,6 +1693,9 @@ token_addr(cfg_parser_t *pctx, unsigned int flags, isc_netaddr_t *na) { &zone); if (result != ISC_R_SUCCESS) return (result); +#else + return (ISC_R_BADADDRESSFORM); +#endif } isc_netaddr_fromin6(na, &in6a); diff --git a/dist/bind/lib/lwres/Makefile.in b/dist/bind/lib/lwres/Makefile.in index 1dc36718b9d..a74bb8e099c 100644 --- a/dist/bind/lib/lwres/Makefile.in +++ b/dist/bind/lib/lwres/Makefile.in @@ -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.4 2004/03/08 09:05:09 marka Exp +# Id: Makefile.in,v 1.25.12.6 2004/08/28 06:25:23 marka Exp srcdir = @srcdir@ VPATH = @srcdir@ @@ -35,14 +35,14 @@ 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@ + lwinetaton.@O@ lwinetpton.@O@ lwinetntop.@O@ print.@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 + lwinetaton.c lwinetpton.c lwinetntop.c print.c LIBS = @LIBS@ @@ -65,7 +65,7 @@ liblwres.@SA@: ${OBJS} version.@O@ liblwres.la: ${OBJS} version.@O@ ${LIBTOOL_MODE_LINK} \ - ${CC} ${ALL_CFLAGS} -o liblwres.la -rpath ${libdir} \ + ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o liblwres.la -rpath ${libdir} \ -version-info ${LIBINTERFACE}:${LIBREVISION}:${LIBAGE} \ ${OBJS} version.@O@ ${LIBS} diff --git a/dist/bind/lib/lwres/api b/dist/bind/lib/lwres/api index 44e7ba41c0a..1da8b023146 100644 --- a/dist/bind/lib/lwres/api +++ b/dist/bind/lib/lwres/api @@ -1,3 +1,3 @@ LIBINTERFACE = 3 -LIBREVISION = 0 +LIBREVISION = 1 LIBAGE = 2 diff --git a/dist/bind/lib/lwres/include/lwres/platform.h.in b/dist/bind/lib/lwres/include/lwres/platform.h.in index 7357836b657..ed9f9679837 100644 --- a/dist/bind/lib/lwres/include/lwres/platform.h.in +++ b/dist/bind/lib/lwres/include/lwres/platform.h.in @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* Id: platform.h.in,v 1.12.2.1.10.1 2004/03/06 08:15:36 marka Exp */ +/* Id: platform.h.in,v 1.12.2.1.10.2 2004/08/28 06:25:26 marka Exp */ #ifndef LWRES_PLATFORM_H #define LWRES_PLATFORM_H 1 @@ -78,6 +78,16 @@ */ @LWRES_PLATFORM_USEDECLSPEC@ +/* + * Defined this system needs vsnprintf() and snprintf(). + */ +@LWRES_PLATFORM_NEEDVSNPRINTF@ + +/* + * If this system need a modern sprintf() that returns (int) not (char*). + */ +@LWRES_PLATFORM_NEEDSPRINTF@ + #ifndef LWRES_PLATFORM_USEDECLSPEC #define LIBLWRES_EXTERNAL_DATA #else diff --git a/dist/bind/lib/lwres/lwinetntop.c b/dist/bind/lib/lwres/lwinetntop.c index a3f5071708b..4b0c0740d97 100644 --- a/dist/bind/lib/lwres/lwinetntop.c +++ b/dist/bind/lib/lwres/lwinetntop.c @@ -1,4 +1,4 @@ -/* $NetBSD: lwinetntop.c,v 1.1.1.1 2004/05/17 23:45:10 christos Exp $ */ +/* $NetBSD: lwinetntop.c,v 1.1.1.2 2004/11/06 23:56:00 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -19,7 +19,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char rcsid[] = - "Id: lwinetntop.c,v 1.9.12.2 2004/03/06 08:15:32 marka Exp"; + "Id: lwinetntop.c,v 1.9.12.3 2004/08/28 06:25:24 marka Exp"; #endif /* LIBC_SCCS and not lint */ #include <config.h> @@ -29,6 +29,7 @@ static char rcsid[] = #include <string.h> #include <lwres/net.h> +#include "print_p.h" #define NS_INT16SZ 2 #define NS_IN6ADDRSZ 16 diff --git a/dist/bind/lib/lwres/man/lwres.html b/dist/bind/lib/lwres/man/lwres.html index e300bf3e50b..7981017d2d5 100644 --- a/dist/bind/lib/lwres/man/lwres.html +++ b/dist/bind/lib/lwres/man/lwres.html @@ -15,16 +15,16 @@ - PERFORMANCE OF THIS SOFTWARE. --> -<!-- Id: lwres.html,v 1.4.2.1.4.1 2004/03/06 08:15:37 marka Exp --> +<!-- 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.73 -"></HEAD +CONTENT="Modular DocBook HTML Stylesheet Version 1.7"></HEAD ><BODY CLASS="REFENTRY" BGCOLOR="#FFFFFF" @@ -35,8 +35,8 @@ ALINK="#0000FF" ><H1 ><A NAME="AEN1" ->lwres</A -></H1 +></A +>lwres</H1 ><DIV CLASS="REFNAMEDIV" ><A @@ -54,11 +54,11 @@ NAME="AEN11" >Synopsis</H2 ><DIV CLASS="FUNCSYNOPSIS" +><P +></P ><A NAME="AEN12" ></A -><P -></P ><PRE CLASS="FUNCSYNOPSISINFO" >#include <lwres/lwres.h></PRE @@ -98,41 +98,41 @@ NAME="AEN18" ><P >The lwresd library implements multiple name service APIs. The standard -<TT +<CODE CLASS="FUNCTION" ->gethostbyname()</TT +>gethostbyname()</CODE >, -<TT +<CODE CLASS="FUNCTION" ->gethostbyaddr()</TT +>gethostbyaddr()</CODE >, -<TT +<CODE CLASS="FUNCTION" ->gethostbyname_r()</TT +>gethostbyname_r()</CODE >, -<TT +<CODE CLASS="FUNCTION" ->gethostbyaddr_r()</TT +>gethostbyaddr_r()</CODE >, -<TT +<CODE CLASS="FUNCTION" ->getaddrinfo()</TT +>getaddrinfo()</CODE >, -<TT +<CODE CLASS="FUNCTION" ->getipnodebyname()</TT +>getipnodebyname()</CODE >, and -<TT +<CODE CLASS="FUNCTION" ->getipnodebyaddr()</TT +>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 -<TT +<VAR CLASS="LITERAL" ->lwres_</TT +>lwres_</VAR >. To define the standard names, applications must include the header file @@ -142,23 +142,23 @@ CLASS="FILENAME" > which contains macro definitions mapping the standard function names into -<TT +<VAR CLASS="LITERAL" ->lwres_</TT +>lwres_</VAR > 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 -<TT +<CODE CLASS="FUNCTION" ->lwres_getaddrsbyname()</TT +>lwres_getaddrsbyname()</CODE > and -<TT +<CODE CLASS="FUNCTION" ->lwres_getnamebyaddr()</TT +>lwres_getnamebyaddr()</CODE >. These may be called by applications that require more detailed control over the lookup process than the standard functions @@ -167,9 +167,9 @@ provide.</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 -<TT +<CODE CLASS="FUNCTION" ->lwres_getaddrsbyname()</TT +>lwres_getaddrsbyname()</CODE > function.</P ><P @@ -201,66 +201,58 @@ sequence of actions.</P CLASS="TYPE" >lwres_packet_t</SPAN >, -called <TT +called <VAR CLASS="VARNAME" ->pkt</TT +>pkt</VAR > below.</P ><P ->(2) Set <TT +>(2) Set <CODE CLASS="STRUCTFIELD" -><I ->pkt.recvlength</I -></TT +>pkt.recvlength</CODE > 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 ->: <TT +>: <CODE CLASS="CONSTANT" ->LWRES_RECVLENGTH = 4096</TT +>LWRES_RECVLENGTH = 4096</CODE >.</P ><P ->(3) Set <TT +>(3) Set <CODE CLASS="STRUCTFIELD" -><I ->pkt.serial</I -></TT +>pkt.serial</CODE > to a unique serial number. This value is echoed back to the application by the remote server.</P ><P ->(4) Set <TT +>(4) Set <CODE CLASS="STRUCTFIELD" -><I ->pkt.pktflags</I -></TT +>pkt.pktflags</CODE >. Usually this is set to 0.</P ><P ->(5) Set <TT +>(5) Set <CODE CLASS="STRUCTFIELD" -><I ->pkt.result</I -></TT +>pkt.result</CODE > to 0.</P ><P ->(6) Call <TT +>(6) Call <CODE CLASS="FUNCTION" ->lwres_*request_render()</TT +>lwres_*request_render()</CODE >, or marshall in the data using the primitives -such as <TT +such as <CODE CLASS="FUNCTION" ->lwres_packet_render()</TT +>lwres_packet_render()</CODE > and storing the packet data.</P ><P >(7) Transmit the resulting buffer.</P ><P ->(8) Call <TT +>(8) Call <CODE CLASS="FUNCTION" ->lwres_*response_parse()</TT +>lwres_*response_parse()</CODE > to parse any packets received.</P ><P @@ -283,27 +275,27 @@ following is typically involved in processing each request packet.</P CLASS="TYPE" >lwres_packet_t</SPAN > is used -in both the <TT +in both the <CODE CLASS="FUNCTION" ->_parse()</TT -> and <TT +>_parse()</CODE +> and <CODE CLASS="FUNCTION" ->_render()</TT +>_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 <TT +>(1) When a packet is received, call <CODE CLASS="FUNCTION" ->lwres_*request_parse()</TT +>lwres_*request_parse()</CODE > to unmarshall it. This returns a <SPAN CLASS="TYPE" >lwres_packet_t</SPAN -> (also called <TT +> (also called <VAR CLASS="VARNAME" ->pkt</TT +>pkt</VAR >, below) as well as a data specific type, such as <SPAN CLASS="TYPE" @@ -312,42 +304,36 @@ CLASS="TYPE" ><P >(2) Process the request in the data specific type.</P ><P ->(3) Set the <TT +>(3) Set the <CODE CLASS="STRUCTFIELD" -><I ->pkt.result</I -></TT +>pkt.result</CODE >, -<TT +<CODE CLASS="STRUCTFIELD" -><I ->pkt.recvlength</I -></TT +>pkt.recvlength</CODE > as above. All other fields can -be left untouched since they were filled in by the <TT +be left untouched since they were filled in by the <CODE CLASS="FUNCTION" ->*_parse()</TT +>*_parse()</CODE > call -above. If using <TT +above. If using <CODE CLASS="FUNCTION" ->lwres_*response_render()</TT +>lwres_*response_render()</CODE >, -<TT +<CODE CLASS="STRUCTFIELD" -><I ->pkt.pktflags</I -></TT +>pkt.pktflags</CODE > will be set up -properly. Otherwise, the <TT +properly. Otherwise, the <CODE CLASS="CONSTANT" ->LWRES_LWPACKETFLAG_RESPONSE</TT +>LWRES_LWPACKETFLAG_RESPONSE</CODE > bit should be set.</P ><P >(4) Call the data specific rendering function, such as -<TT +<CODE CLASS="FUNCTION" ->lwres_gabnresponse_render()</TT +>lwres_gabnresponse_render()</CODE >.</P ><P >(5) Send the resulting packet to the client.</P diff --git a/dist/bind/lib/lwres/man/lwres_buffer.html b/dist/bind/lib/lwres/man/lwres_buffer.html index df2edd18b10..1e8efc95ce0 100644 --- a/dist/bind/lib/lwres/man/lwres_buffer.html +++ b/dist/bind/lib/lwres/man/lwres_buffer.html @@ -15,16 +15,16 @@ - PERFORMANCE OF THIS SOFTWARE. --> -<!-- Id: lwres_buffer.html,v 1.4.2.1.4.1 2004/03/06 08:15:37 marka Exp --> +<!-- 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.73 -"></HEAD +CONTENT="Modular DocBook HTML Stylesheet Version 1.7"></HEAD ><BODY CLASS="REFENTRY" BGCOLOR="#FFFFFF" @@ -35,8 +35,8 @@ ALINK="#0000FF" ><H1 ><A NAME="AEN1" ->lwres_buffer</A -></H1 +></A +>lwres_buffer</H1 ><DIV CLASS="REFNAMEDIV" ><A @@ -54,11 +54,11 @@ NAME="AEN26" >Synopsis</H2 ><DIV CLASS="FUNCSYNOPSIS" +><P +></P ><A NAME="AEN27" ></A -><P -></P ><PRE CLASS="FUNCSYNOPSISINFO" >#include <lwres/lwbuffer.h></PRE @@ -205,9 +205,9 @@ NAME="AEN106" >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 -<TT +<VAR CLASS="LITERAL" ->isc_buffer_</TT +>isc_buffer_</VAR > functions in the ISC library.</P ><P @@ -308,323 +308,267 @@ CLASS="PROGRAMLISTING" b-c == optional active region.</PRE ></P ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_buffer_init()</TT +>lwres_buffer_init()</CODE > initializes the <SPAN CLASS="TYPE" >lwres_buffer_t</SPAN > -<TT +<VAR CLASS="PARAMETER" -><I ->*b</I -></TT +>*b</VAR > and assocates it with the memory region of size -<TT +<VAR CLASS="PARAMETER" -><I ->length</I -></TT +>length</VAR > bytes starting at location -<TT +<VAR CLASS="PARAMETER" -><I ->base.</I -></TT +>base.</VAR ></P ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_buffer_invalidate()</TT +>lwres_buffer_invalidate()</CODE > marks the buffer -<TT +<VAR CLASS="PARAMETER" -><I ->*b</I -></TT +>*b</VAR > as invalid. Invalidating a buffer after use is not required, but makes it possible to catch its possible accidental use.</P ><P >The functions -<TT +<CODE CLASS="FUNCTION" ->lwres_buffer_add()</TT +>lwres_buffer_add()</CODE > and -<TT +<CODE CLASS="FUNCTION" ->lwres_buffer_subtract()</TT +>lwres_buffer_subtract()</CODE > respectively increase and decrease the used space in buffer -<TT +<VAR CLASS="PARAMETER" -><I ->*b</I -></TT +>*b</VAR > by -<TT +<VAR CLASS="PARAMETER" -><I ->n</I -></TT +>n</VAR > bytes. -<TT +<CODE CLASS="FUNCTION" ->lwres_buffer_add()</TT +>lwres_buffer_add()</CODE > checks for buffer overflow and -<TT +<CODE CLASS="FUNCTION" ->lwres_buffer_subtract()</TT +>lwres_buffer_subtract()</CODE > checks for underflow. These functions do not allocate or deallocate memory. They just change the value of -<TT +<CODE CLASS="STRUCTFIELD" -><I ->used</I -></TT +>used</CODE >.</P ><P >A buffer is re-initialised by -<TT +<CODE CLASS="FUNCTION" ->lwres_buffer_clear()</TT +>lwres_buffer_clear()</CODE >. The function sets -<TT +<CODE CLASS="STRUCTFIELD" -><I ->used</I -></TT +>used</CODE > , -<TT +<CODE CLASS="STRUCTFIELD" -><I ->current</I -></TT +>current</CODE > and -<TT +<CODE CLASS="STRUCTFIELD" -><I ->active</I -></TT +>active</CODE > to zero.</P ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_buffer_first</TT +>lwres_buffer_first</CODE > makes the consumed region of buffer -<TT +<VAR CLASS="PARAMETER" -><I ->*p</I -></TT +>*p</VAR > empty by setting -<TT +<CODE CLASS="STRUCTFIELD" -><I ->current</I -></TT +>current</CODE > to zero (the start of the buffer).</P ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_buffer_forward()</TT +>lwres_buffer_forward()</CODE > increases the consumed region of buffer -<TT +<VAR CLASS="PARAMETER" -><I ->*b</I -></TT +>*b</VAR > by -<TT +<VAR CLASS="PARAMETER" -><I ->n</I -></TT +>n</VAR > bytes, checking for overflow. Similarly, -<TT +<CODE CLASS="FUNCTION" ->lwres_buffer_back()</TT +>lwres_buffer_back()</CODE > decreases buffer -<TT +<VAR CLASS="PARAMETER" -><I ->b</I -></TT +>b</VAR >'s consumed region by -<TT +<VAR CLASS="PARAMETER" -><I ->n</I -></TT +>n</VAR > bytes and checks for underflow.</P ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_buffer_getuint8()</TT +>lwres_buffer_getuint8()</CODE > reads an unsigned 8-bit integer from -<TT +<VAR CLASS="PARAMETER" -><I ->*b</I -></TT +>*b</VAR > and returns it. -<TT +<CODE CLASS="FUNCTION" ->lwres_buffer_putuint8()</TT +>lwres_buffer_putuint8()</CODE > writes the unsigned 8-bit integer -<TT +<VAR CLASS="PARAMETER" -><I ->val</I -></TT +>val</VAR > to buffer -<TT +<VAR CLASS="PARAMETER" -><I ->*b</I -></TT +>*b</VAR >.</P ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_buffer_getuint16()</TT +>lwres_buffer_getuint16()</CODE > and -<TT +<CODE CLASS="FUNCTION" ->lwres_buffer_getuint32()</TT +>lwres_buffer_getuint32()</CODE > are identical to -<TT +<CODE CLASS="FUNCTION" ->lwres_buffer_putuint8()</TT +>lwres_buffer_putuint8()</CODE > except that they respectively read an unsigned 16-bit or 32-bit integer in network byte order from -<TT +<VAR CLASS="PARAMETER" -><I ->b</I -></TT +>b</VAR >. Similarly, -<TT +<CODE CLASS="FUNCTION" ->lwres_buffer_putuint16()</TT +>lwres_buffer_putuint16()</CODE > and -<TT +<CODE CLASS="FUNCTION" ->lwres_buffer_putuint32()</TT +>lwres_buffer_putuint32()</CODE > writes the unsigned 16-bit or 32-bit integer -<TT +<VAR CLASS="PARAMETER" -><I ->val</I -></TT +>val</VAR > to buffer -<TT +<VAR CLASS="PARAMETER" -><I ->b</I -></TT +>b</VAR >, in network byte order.</P ><P >Arbitrary amounts of data are read or written from a lightweight resolver buffer with -<TT +<CODE CLASS="FUNCTION" ->lwres_buffer_getmem()</TT +>lwres_buffer_getmem()</CODE > and -<TT +<CODE CLASS="FUNCTION" ->lwres_buffer_putmem()</TT +>lwres_buffer_putmem()</CODE > respectively. -<TT +<CODE CLASS="FUNCTION" ->lwres_buffer_putmem()</TT +>lwres_buffer_putmem()</CODE > copies -<TT +<VAR CLASS="PARAMETER" -><I ->length</I -></TT +>length</VAR > bytes of memory at -<TT +<VAR CLASS="PARAMETER" -><I ->base</I -></TT +>base</VAR > to -<TT +<VAR CLASS="PARAMETER" -><I ->b</I -></TT +>b</VAR >. Conversely, -<TT +<CODE CLASS="FUNCTION" ->lwres_buffer_getmem()</TT +>lwres_buffer_getmem()</CODE > copies -<TT +<VAR CLASS="PARAMETER" -><I ->length</I -></TT +>length</VAR > bytes of memory from -<TT +<VAR CLASS="PARAMETER" -><I ->b</I -></TT +>b</VAR > to -<TT +<VAR CLASS="PARAMETER" -><I ->base</I -></TT +>base</VAR >.</P ></DIV ></BODY diff --git a/dist/bind/lib/lwres/man/lwres_config.html b/dist/bind/lib/lwres/man/lwres_config.html index 2c6a27a621a..42a73447cf0 100644 --- a/dist/bind/lib/lwres/man/lwres_config.html +++ b/dist/bind/lib/lwres/man/lwres_config.html @@ -15,16 +15,16 @@ - PERFORMANCE OF THIS SOFTWARE. --> -<!-- Id: lwres_config.html,v 1.4.2.1.4.1 2004/03/06 08:15:38 marka Exp --> +<!-- 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.73 -"></HEAD +CONTENT="Modular DocBook HTML Stylesheet Version 1.7"></HEAD ><BODY CLASS="REFENTRY" BGCOLOR="#FFFFFF" @@ -35,8 +35,8 @@ ALINK="#0000FF" ><H1 ><A NAME="AEN1" ->lwres_config</A -></H1 +></A +>lwres_config</H1 ><DIV CLASS="REFNAMEDIV" ><A @@ -54,11 +54,11 @@ NAME="AEN15" >Synopsis</H2 ><DIV CLASS="FUNCSYNOPSIS" +><P +></P ><A NAME="AEN16" ></A -><P -></P ><PRE CLASS="FUNCSYNOPSISINFO" >#include <lwres/lwres.h></PRE @@ -114,9 +114,9 @@ NAME="AEN40" ><H2 >DESCRIPTION</H2 ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_conf_init()</TT +>lwres_conf_init()</CODE > creates an empty <SPAN @@ -124,16 +124,14 @@ CLASS="TYPE" >lwres_conf_t</SPAN > structure for lightweight resolver context -<TT +<VAR CLASS="PARAMETER" -><I ->ctx</I -></TT +>ctx</VAR >.</P ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_conf_clear()</TT +>lwres_conf_clear()</CODE > frees up all the internal memory used by that @@ -142,30 +140,24 @@ CLASS="TYPE" >lwres_conf_t</SPAN > structure in resolver context -<TT +<VAR CLASS="PARAMETER" -><I ->ctx</I -></TT +>ctx</VAR >.</P ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_conf_parse()</TT +>lwres_conf_parse()</CODE > opens the file -<TT +<VAR CLASS="PARAMETER" -><I ->filename</I -></TT +>filename</VAR > and parses it to initialise the resolver context -<TT +<VAR CLASS="PARAMETER" -><I ->ctx</I -></TT +>ctx</VAR >'s <SPAN CLASS="TYPE" @@ -173,9 +165,9 @@ CLASS="TYPE" > structure.</P ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_conf_print()</TT +>lwres_conf_print()</CODE > prints the <SPAN @@ -183,22 +175,18 @@ CLASS="TYPE" >lwres_conf_t</SPAN > structure for resolver context -<TT +<VAR CLASS="PARAMETER" -><I ->ctx</I -></TT +>ctx</VAR > to the <SPAN CLASS="TYPE" >FILE</SPAN > -<TT +<VAR CLASS="PARAMETER" -><I ->fp</I -></TT +>fp</VAR >.</P ></DIV ><DIV @@ -209,9 +197,9 @@ NAME="AEN61" ><H2 >RETURN VALUES</H2 ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_conf_parse()</TT +>lwres_conf_parse()</CODE > returns <SPAN @@ -219,11 +207,9 @@ CLASS="ERRORCODE" >LWRES_R_SUCCESS</SPAN > if it successfully read and parsed -<TT +<VAR CLASS="PARAMETER" -><I ->filename</I -></TT +>filename</VAR >. It returns <SPAN @@ -231,18 +217,16 @@ CLASS="ERRORCODE" >LWRES_R_FAILURE</SPAN > if -<TT +<VAR CLASS="PARAMETER" -><I ->filename</I -></TT +>filename</VAR > could not be opened or contained incorrect resolver statements.</P ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_conf_print()</TT +>lwres_conf_print()</CODE > returns <SPAN diff --git a/dist/bind/lib/lwres/man/lwres_context.html b/dist/bind/lib/lwres/man/lwres_context.html index cde04fed1f4..cafd261efe4 100644 --- a/dist/bind/lib/lwres/man/lwres_context.html +++ b/dist/bind/lib/lwres/man/lwres_context.html @@ -15,16 +15,16 @@ - PERFORMANCE OF THIS SOFTWARE. --> -<!-- Id: lwres_context.html,v 1.5.2.2.2.2 2004/03/08 09:05:12 marka Exp --> +<!-- 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.73 -"></HEAD +CONTENT="Modular DocBook HTML Stylesheet Version 1.7"></HEAD ><BODY CLASS="REFENTRY" BGCOLOR="#FFFFFF" @@ -35,8 +35,8 @@ ALINK="#0000FF" ><H1 ><A NAME="AEN1" ->lwres_context</A -></H1 +></A +>lwres_context</H1 ><DIV CLASS="REFNAMEDIV" ><A @@ -54,11 +54,11 @@ NAME="AEN17" >Synopsis</H2 ><DIV CLASS="FUNCSYNOPSIS" +><P +></P ><A NAME="AEN18" ></A -><P -></P ><PRE CLASS="FUNCSYNOPSISINFO" >#include <lwres/lwres.h></PRE @@ -130,9 +130,9 @@ NAME="AEN60" ><H2 >DESCRIPTION</H2 ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_context_create()</TT +>lwres_context_create()</CODE > creates a <SPAN @@ -148,11 +148,9 @@ CLASS="TYPE" >lwres_context_t</SPAN > is returned through -<TT +<VAR CLASS="PARAMETER" -><I ->contextp</I -></TT +>contextp</VAR >, a pointer to a @@ -174,33 +172,25 @@ CLASS="TYPE" ><P >When the lightweight resolver needs to perform dynamic memory allocation, it will call -<TT +<VAR CLASS="PARAMETER" -><I ->malloc_function</I -></TT +>malloc_function</VAR > to allocate memory and -<TT +<VAR CLASS="PARAMETER" -><I ->free_function</I -></TT +>free_function</VAR > to free it. If -<TT +<VAR CLASS="PARAMETER" -><I ->malloc_function</I -></TT +>malloc_function</VAR > and -<TT +<VAR CLASS="PARAMETER" -><I ->free_function</I -></TT +>free_function</VAR > are NULL, memory is allocated using @@ -215,48 +205,36 @@ CLASS="REFENTRYTITLE" >. It is not permitted to have a NULL -<TT +<VAR CLASS="PARAMETER" -><I ->malloc_function</I -></TT +>malloc_function</VAR > and a non-NULL -<TT +<VAR CLASS="PARAMETER" -><I ->free_function</I -></TT +>free_function</VAR > or vice versa. -<TT +<VAR CLASS="PARAMETER" -><I ->arg</I -></TT +>arg</VAR > is passed as the first parameter to the memory allocation functions. If -<TT +<VAR CLASS="PARAMETER" -><I ->malloc_function</I -></TT +>malloc_function</VAR > and -<TT +<VAR CLASS="PARAMETER" -><I ->free_function</I -></TT +>free_function</VAR > are NULL, -<TT +<VAR CLASS="PARAMETER" -><I ->arg</I -></TT +>arg</VAR > is unused and should be passed as NULL.</P @@ -272,16 +250,14 @@ CLASS="REFENTRYTITLE" > and returned via -<TT +<VAR CLASS="PARAMETER" -><I ->*contextp</I -></TT +>*contextp</VAR >. </P ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_context_destroy()</TT +>lwres_context_destroy()</CODE > destroys a <SPAN @@ -290,11 +266,9 @@ CLASS="TYPE" >, closing its socket. -<TT +<VAR CLASS="PARAMETER" -><I ->contextp</I -></TT +>contextp</VAR > 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 @@ -302,124 +276,106 @@ The pointer will be set to NULL when the context has been destroyed.</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 -<TT +<CODE CLASS="FUNCTION" ->lwres_context_initserial()</TT +>lwres_context_initserial()</CODE > and -<TT +<CODE CLASS="FUNCTION" ->lwres_context_nextserial()</TT +>lwres_context_nextserial()</CODE >. -<TT +<CODE CLASS="FUNCTION" ->lwres_context_initserial()</TT +>lwres_context_initserial()</CODE > sets the serial number for context -<TT +<VAR CLASS="PARAMETER" -><I ->*ctx</I -></TT +>*ctx</VAR > to -<TT +<VAR CLASS="PARAMETER" -><I ->serial</I -></TT +>serial</VAR >. -<TT +<CODE CLASS="FUNCTION" ->lwres_context_nextserial()</TT +>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 -<TT +<CODE CLASS="FUNCTION" ->lwres_context_allocmem()</TT +>lwres_context_allocmem()</CODE > and -<TT +<CODE CLASS="FUNCTION" ->lwres_context_freemem()</TT +>lwres_context_freemem()</CODE >. These use whatever allocations were defined when the context was created with -<TT +<CODE CLASS="FUNCTION" ->lwres_context_create()</TT +>lwres_context_create()</CODE >. -<TT +<CODE CLASS="FUNCTION" ->lwres_context_allocmem()</TT +>lwres_context_allocmem()</CODE > allocates -<TT +<VAR CLASS="PARAMETER" -><I ->len</I -></TT +>len</VAR > bytes of memory and if successful returns a pointer to the allocated storage. -<TT +<CODE CLASS="FUNCTION" ->lwres_context_freemem()</TT +>lwres_context_freemem()</CODE > frees -<TT +<VAR CLASS="PARAMETER" -><I ->len</I -></TT +>len</VAR > bytes of space starting at location -<TT +<VAR CLASS="PARAMETER" -><I ->mem</I -></TT +>mem</VAR >. </P ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_context_sendrecv()</TT +>lwres_context_sendrecv()</CODE > performs I/O for the context -<TT +<VAR CLASS="PARAMETER" -><I ->ctx</I -></TT +>ctx</VAR >. Data are read and written from the context's socket. It writes data from -<TT +<VAR CLASS="PARAMETER" -><I ->sendbase</I -></TT +>sendbase</VAR > — typically a lightweight resolver query packet — and waits for a reply which is copied to the receive buffer at -<TT +<VAR CLASS="PARAMETER" -><I ->recvbase</I -></TT +>recvbase</VAR >. The number of bytes that were written to this receive buffer is returned in -<TT +<VAR CLASS="PARAMETER" -><I ->*recvd_len</I -></TT +>*recvd_len</VAR >. </P ></DIV ><DIV @@ -430,9 +386,9 @@ NAME="AEN115" ><H2 >RETURN VALUES</H2 ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_context_create()</TT +>lwres_context_create()</CODE > returns <SPAN @@ -452,9 +408,9 @@ CLASS="ERRORCODE" otherwise.</P ><P >Successful calls to the memory allocator -<TT +<CODE CLASS="FUNCTION" ->lwres_context_allocmem()</TT +>lwres_context_allocmem()</CODE > return a pointer to the start of the allocated space. It returns NULL if memory could not be allocated.</P @@ -464,9 +420,9 @@ CLASS="ERRORCODE" >LWRES_R_SUCCESS</SPAN > is returned when -<TT +<CODE CLASS="FUNCTION" ->lwres_context_sendrecv()</TT +>lwres_context_sendrecv()</CODE > completes successfully. <SPAN @@ -479,9 +435,9 @@ CLASS="ERRORCODE" >LWRES_R_TIMEOUT</SPAN > is returned if -<TT +<CODE CLASS="FUNCTION" ->lwres_context_sendrecv()</TT +>lwres_context_sendrecv()</CODE > times out waiting for a response.</P ></DIV diff --git a/dist/bind/lib/lwres/man/lwres_gabn.html b/dist/bind/lib/lwres/man/lwres_gabn.html index 8d3d7b39940..fed9a252744 100644 --- a/dist/bind/lib/lwres/man/lwres_gabn.html +++ b/dist/bind/lib/lwres/man/lwres_gabn.html @@ -15,16 +15,16 @@ - PERFORMANCE OF THIS SOFTWARE. --> -<!-- Id: lwres_gabn.html,v 1.6.2.1.4.1 2004/03/06 08:15:38 marka Exp --> +<!-- 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.73 -"></HEAD +CONTENT="Modular DocBook HTML Stylesheet Version 1.7"></HEAD ><BODY CLASS="REFENTRY" BGCOLOR="#FFFFFF" @@ -35,8 +35,8 @@ ALINK="#0000FF" ><H1 ><A NAME="AEN1" ->lwres_gabn</A -></H1 +></A +>lwres_gabn</H1 ><DIV CLASS="REFNAMEDIV" ><A @@ -54,11 +54,11 @@ NAME="AEN16" >Synopsis</H2 ><DIV CLASS="FUNCSYNOPSIS" +><P +></P ><A NAME="AEN17" ></A -><P -></P ><PRE CLASS="FUNCSYNOPSISINFO" >#include <lwres/lwres.h></PRE @@ -178,52 +178,42 @@ typedef struct { } lwres_gabnresponse_t;</PRE ></P ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_gabnrequest_render()</TT +>lwres_gabnrequest_render()</CODE > uses resolver context -<TT +<VAR CLASS="PARAMETER" -><I ->ctx</I -></TT +>ctx</VAR > to convert getaddrbyname request structure -<TT +<VAR CLASS="PARAMETER" -><I ->req</I -></TT +>req</VAR > to canonical format. The packet header structure -<TT +<VAR CLASS="PARAMETER" -><I ->pkt</I -></TT +>pkt</VAR > is initialised and transferred to buffer -<TT +<VAR CLASS="PARAMETER" -><I ->b</I -></TT +>b</VAR >. The contents of -<TT +<VAR CLASS="PARAMETER" -><I ->*req</I -></TT +>*req</VAR > are then appended to the buffer in canonical format. -<TT +<CODE CLASS="FUNCTION" ->lwres_gabnresponse_render()</TT +>lwres_gabnresponse_render()</CODE > performs the same task, except it converts a getaddrbyname response structure <SPAN @@ -232,23 +222,19 @@ CLASS="TYPE" > to the lightweight resolver's canonical format.</P ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_gabnrequest_parse()</TT +>lwres_gabnrequest_parse()</CODE > uses context -<TT +<VAR CLASS="PARAMETER" -><I ->ctx</I -></TT +>ctx</VAR > to convert the contents of packet -<TT +<VAR CLASS="PARAMETER" -><I ->pkt</I -></TT +>pkt</VAR > to a <SPAN @@ -257,11 +243,9 @@ CLASS="TYPE" > structure. Buffer -<TT +<VAR CLASS="PARAMETER" -><I ->b</I -></TT +>b</VAR > provides space to be used for storing this structure. When the function succeeds, the resulting @@ -270,21 +254,19 @@ CLASS="TYPE" >lwres_gabnrequest_t</SPAN > is made available through -<TT +<VAR CLASS="PARAMETER" -><I ->*structp</I -></TT +>*structp</VAR >. -<TT +<CODE CLASS="FUNCTION" ->lwres_gabnresponse_parse()</TT +>lwres_gabnresponse_parse()</CODE > offers the same semantics as -<TT +<CODE CLASS="FUNCTION" ->lwres_gabnrequest_parse()</TT +>lwres_gabnrequest_parse()</CODE > except it yields a <SPAN @@ -293,21 +275,19 @@ CLASS="TYPE" > structure.</P ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_gabnresponse_free()</TT +>lwres_gabnresponse_free()</CODE > and -<TT +<CODE CLASS="FUNCTION" ->lwres_gabnrequest_free()</TT +>lwres_gabnrequest_free()</CODE > release the memory in resolver context -<TT +<VAR CLASS="PARAMETER" -><I ->ctx</I -></TT +>ctx</VAR > that was allocated to the <SPAN @@ -320,11 +300,9 @@ CLASS="TYPE" >lwres_gabnrequest_t</SPAN > structures referenced via -<TT +<VAR CLASS="PARAMETER" -><I ->structp</I -></TT +>structp</VAR >. Any memory associated with ancillary buffers and strings for those @@ -339,22 +317,22 @@ NAME="AEN93" >RETURN VALUES</H2 ><P >The getaddrbyname opcode functions -<TT +<CODE CLASS="FUNCTION" ->lwres_gabnrequest_render()</TT +>lwres_gabnrequest_render()</CODE >, -<TT +<CODE CLASS="FUNCTION" ->lwres_gabnresponse_render()</TT +>lwres_gabnresponse_render()</CODE > -<TT +<CODE CLASS="FUNCTION" ->lwres_gabnrequest_parse()</TT +>lwres_gabnrequest_parse()</CODE > and -<TT +<CODE CLASS="FUNCTION" ->lwres_gabnresponse_parse()</TT +>lwres_gabnresponse_parse()</CODE > all return <SPAN @@ -373,11 +351,9 @@ CLASS="ERRORCODE" >LWRES_R_UNEXPECTEDEND</SPAN > is returned if the available space in the buffer -<TT +<VAR CLASS="PARAMETER" -><I ->b</I -></TT +>b</VAR > is too small to accommodate the packet header or the <SPAN @@ -390,14 +366,14 @@ CLASS="TYPE" >lwres_gabnresponse_t</SPAN > structures. -<TT +<CODE CLASS="FUNCTION" ->lwres_gabnrequest_parse()</TT +>lwres_gabnrequest_parse()</CODE > and -<TT +<CODE CLASS="FUNCTION" ->lwres_gabnresponse_parse()</TT +>lwres_gabnresponse_parse()</CODE > will return <SPAN @@ -411,11 +387,9 @@ CLASS="ERRORCODE" >LWRES_R_FAILURE</SPAN > if -<TT +<CODE CLASS="STRUCTFIELD" -><I ->pktflags</I -></TT +>pktflags</CODE > in the packet header structure <SPAN diff --git a/dist/bind/lib/lwres/man/lwres_gai_strerror.html b/dist/bind/lib/lwres/man/lwres_gai_strerror.html index 6e596d67c7f..1031acda23d 100644 --- a/dist/bind/lib/lwres/man/lwres_gai_strerror.html +++ b/dist/bind/lib/lwres/man/lwres_gai_strerror.html @@ -15,16 +15,16 @@ - PERFORMANCE OF THIS SOFTWARE. --> -<!-- Id: lwres_gai_strerror.html,v 1.5.2.1.4.1 2004/03/06 08:15:39 marka Exp --> +<!-- 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.73 -"></HEAD +CONTENT="Modular DocBook HTML Stylesheet Version 1.7"></HEAD ><BODY CLASS="REFENTRY" BGCOLOR="#FFFFFF" @@ -35,8 +35,8 @@ ALINK="#0000FF" ><H1 ><A NAME="AEN1" ->lwres_gai_strerror</A -></H1 +></A +>lwres_gai_strerror</H1 ><DIV CLASS="REFNAMEDIV" ><A @@ -54,11 +54,11 @@ NAME="AEN11" >Synopsis</H2 ><DIV CLASS="FUNCSYNOPSIS" +><P +></P ><A NAME="AEN12" ></A -><P -></P ><PRE CLASS="FUNCSYNOPSISINFO" >#include <lwres/netdb.h></PRE @@ -82,14 +82,14 @@ NAME="AEN18" ><H2 >DESCRIPTION</H2 ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_gai_strerror()</TT +>lwres_gai_strerror()</CODE > returns an error message corresponding to an error code returned by -<TT +<CODE CLASS="FUNCTION" ->getaddrinfo()</TT +>getaddrinfo()</CODE >. The following error codes and their meaning are defined in <TT @@ -127,9 +127,9 @@ CLASS="ERRORCODE" ><DD ><P >invalid value for -<TT +<CODE CLASS="CONSTANT" ->ai_flags</TT +>ai_flags</CODE ></P ></DD ><DT @@ -148,9 +148,9 @@ CLASS="ERRORCODE" ></DT ><DD ><P -><TT +><CODE CLASS="CONSTANT" ->ai_family</TT +>ai_family</CODE > not supported</P ></DD ><DT @@ -187,9 +187,9 @@ CLASS="ERRORCODE" ></DT ><DD ><P ->servname not supported for <TT +>servname not supported for <CODE CLASS="CONSTANT" ->ai_socktype</TT +>ai_socktype</CODE ></P ></DD ><DT @@ -199,9 +199,9 @@ CLASS="ERRORCODE" ></DT ><DD ><P -><TT +><CODE CLASS="CONSTANT" ->ai_socktype</TT +>ai_socktype</CODE > not supported</P ></DD ><DT @@ -220,26 +220,24 @@ The message <SPAN CLASS="ERRORNAME" >invalid error code</SPAN > is returned if -<TT +<VAR CLASS="PARAMETER" -><I ->ecode</I -></TT +>ecode</VAR > is out of range.</P ><P -><TT +><CODE CLASS="CONSTANT" ->ai_flags</TT +>ai_flags</CODE >, -<TT +<CODE CLASS="CONSTANT" ->ai_family</TT +>ai_family</CODE > and -<TT +<CODE CLASS="CONSTANT" ->ai_socktype</TT +>ai_socktype</CODE > are elements of the <SPAN @@ -247,9 +245,9 @@ CLASS="TYPE" >struct addrinfo</SPAN > used by -<TT +<CODE CLASS="FUNCTION" ->lwres_getaddrinfo()</TT +>lwres_getaddrinfo()</CODE >.</P ></DIV ><DIV diff --git a/dist/bind/lib/lwres/man/lwres_getaddrinfo.html b/dist/bind/lib/lwres/man/lwres_getaddrinfo.html index 933d0e8ab83..1ffe1ccd5bd 100644 --- a/dist/bind/lib/lwres/man/lwres_getaddrinfo.html +++ b/dist/bind/lib/lwres/man/lwres_getaddrinfo.html @@ -15,16 +15,16 @@ - PERFORMANCE OF THIS SOFTWARE. --> -<!-- Id: lwres_getaddrinfo.html,v 1.8.2.1.4.2 2004/03/06 08:15:39 marka Exp --> +<!-- 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.73 -"></HEAD +CONTENT="Modular DocBook HTML Stylesheet Version 1.7"></HEAD ><BODY CLASS="REFENTRY" BGCOLOR="#FFFFFF" @@ -35,8 +35,8 @@ ALINK="#0000FF" ><H1 ><A NAME="AEN1" ->lwres_getaddrinfo</A -></H1 +></A +>lwres_getaddrinfo</H1 ><DIV CLASS="REFNAMEDIV" ><A @@ -54,11 +54,11 @@ NAME="AEN12" >Synopsis</H2 ><DIV CLASS="FUNCSYNOPSIS" +><P +></P ><A NAME="AEN13" ></A -><P -></P ><PRE CLASS="FUNCSYNOPSISINFO" >#include <lwres/netdb.h></PRE @@ -111,43 +111,35 @@ NAME="AEN29" ><H2 >DESCRIPTION</H2 ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_getaddrinfo()</TT +>lwres_getaddrinfo()</CODE > is used to get a list of IP addresses and port numbers for host -<TT +<VAR CLASS="PARAMETER" -><I ->hostname</I -></TT +>hostname</VAR > and service -<TT +<VAR CLASS="PARAMETER" -><I ->servname</I -></TT +>servname</VAR >. The function is the lightweight resolver's implementation of -<TT +<CODE CLASS="FUNCTION" ->getaddrinfo()</TT +>getaddrinfo()</CODE > as defined in RFC2133. -<TT +<VAR CLASS="PARAMETER" -><I ->hostname</I -></TT +>hostname</VAR > and -<TT +<VAR CLASS="PARAMETER" -><I ->servname</I -></TT +>servname</VAR > are pointers to null-terminated strings or @@ -156,19 +148,15 @@ CLASS="TYPE" >NULL</SPAN >. -<TT +<VAR CLASS="PARAMETER" -><I ->hostname</I -></TT +>hostname</VAR > is either a host name or a numeric host address string: a dotted decimal IPv4 address or an IPv6 address. -<TT +<VAR CLASS="PARAMETER" -><I ->servname</I -></TT +>servname</VAR > is either a decimal port number or a service name as listed in <TT @@ -176,11 +164,9 @@ CLASS="FILENAME" >/etc/services</TT >.</P ><P -><TT +><VAR CLASS="PARAMETER" -><I ->hints</I -></TT +>hints</VAR > is an optional pointer to a <SPAN @@ -190,11 +176,9 @@ CLASS="TYPE" 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 -<TT +<VAR CLASS="PARAMETER" -><I ->*hints</I -></TT +>*hints</VAR >: <P @@ -203,17 +187,17 @@ CLASS="PARAMETER" CLASS="VARIABLELIST" ><DL ><DT -><TT +><CODE CLASS="CONSTANT" ->ai_family</TT +>ai_family</CODE ></DT ><DD ><P >The protocol family that should be used. When -<TT +<CODE CLASS="CONSTANT" ->ai_family</TT +>ai_family</CODE > is set to <SPAN @@ -224,9 +208,9 @@ it means the caller will accept any protocol family supported by the operating system.</P ></DD ><DT -><TT +><CODE CLASS="CONSTANT" ->ai_socktype</TT +>ai_socktype</CODE ></DT ><DD ><P @@ -246,32 +230,32 @@ CLASS="TYPE" > — that is wanted. When -<TT +<CODE CLASS="CONSTANT" ->ai_socktype</TT +>ai_socktype</CODE > is zero the caller will accept any socket type.</P ></DD ><DT -><TT +><CODE CLASS="CONSTANT" ->ai_protocol</TT +>ai_protocol</CODE ></DT ><DD ><P >indicates which transport protocol is wanted: IPPROTO_UDP or IPPROTO_TCP. If -<TT +<CODE CLASS="CONSTANT" ->ai_protocol</TT +>ai_protocol</CODE > is zero the caller will accept any protocol.</P ></DD ><DT -><TT +><CODE CLASS="CONSTANT" ->ai_flags</TT +>ai_flags</CODE ></DT ><DD ><P @@ -282,15 +266,15 @@ CLASS="TYPE" >AI_CANONNAME</SPAN > bit is set, a successful call to -<TT +<CODE CLASS="FUNCTION" ->lwres_getaddrinfo()</TT +>lwres_getaddrinfo()</CODE > will return a null-terminated string containing the canonical name of the specified hostname in -<TT +<CODE CLASS="CONSTANT" ->ai_canonname</TT +>ai_canonname</CODE > of the first <SPAN @@ -332,9 +316,9 @@ CLASS="TYPE" for an IPv6 address.</P ><P >When -<TT +<CODE CLASS="CONSTANT" ->ai_flags</TT +>ai_flags</CODE > does not set the <SPAN @@ -378,11 +362,9 @@ CLASS="REFENTRYTITLE" if a connectionless protocol was chosen. The IP address portion of the socket address structure will be set to the loopback address if -<TT +<VAR CLASS="PARAMETER" -><I ->hostname</I -></TT +>hostname</VAR > is a <SPAN @@ -395,15 +377,15 @@ CLASS="TYPE" >AI_PASSIVE</SPAN > is not set in -<TT +<CODE CLASS="CONSTANT" ->ai_flags</TT +>ai_flags</CODE >.</P ><P >If -<TT +<CODE CLASS="CONSTANT" ->ai_flags</TT +>ai_flags</CODE > is set to <SPAN @@ -411,11 +393,9 @@ CLASS="TYPE" >AI_NUMERICHOST</SPAN > it indicates that -<TT +<VAR CLASS="PARAMETER" -><I ->hostname</I -></TT +>hostname</VAR > should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted.</P @@ -428,18 +408,14 @@ and no name resolution should be attempted.</P CLASS="TYPE" >struct addrinfo</SPAN > passed -via <TT +via <VAR CLASS="PARAMETER" -><I ->hints</I -></TT +>hints</VAR > must be zero.</P ><P ->A <TT +>A <VAR CLASS="PARAMETER" -><I ->hints</I -></TT +>hints</VAR > of <SPAN CLASS="TYPE" >NULL</SPAN @@ -448,25 +424,23 @@ the caller provided a <SPAN CLASS="TYPE" >struct addrinfo</SPAN > initialized to zero -with <TT +with <CODE CLASS="CONSTANT" ->ai_family</TT +>ai_family</CODE >set to -<TT +<CODE CLASS="CONSTANT" ->PF_UNSPEC</TT +>PF_UNSPEC</CODE >.</P ><P >After a successful call to -<TT +<CODE CLASS="FUNCTION" ->lwres_getaddrinfo()</TT +>lwres_getaddrinfo()</CODE >, -<TT +<VAR CLASS="PARAMETER" -><I ->*res</I -></TT +>*res</VAR > is a pointer to a linked list of one or more <SPAN @@ -481,9 +455,9 @@ CLASS="TYPE" > in this list cn be processed by following the -<TT +<CODE CLASS="CONSTANT" ->ai_next</TT +>ai_next</CODE > pointer, until a <SPAN @@ -492,18 +466,18 @@ CLASS="TYPE" > pointer is encountered. The three members -<TT +<CODE CLASS="CONSTANT" ->ai_family</TT +>ai_family</CODE >, -<TT +<CODE CLASS="CONSTANT" ->ai_socktype</TT +>ai_socktype</CODE >, and -<TT +<CODE CLASS="CONSTANT" ->ai_protocol</TT +>ai_protocol</CODE > in each returned @@ -525,43 +499,41 @@ CLASS="TYPE" >addrinfo</SPAN > structure in the list, the -<TT +<CODE CLASS="CONSTANT" ->ai_addr</TT +>ai_addr</CODE > member points to a filled-in socket address structure of length -<TT +<CODE CLASS="CONSTANT" ->ai_addrlen</TT +>ai_addrlen</CODE >.</P ><P >All of the information returned by -<TT +<CODE CLASS="FUNCTION" ->lwres_getaddrinfo()</TT +>lwres_getaddrinfo()</CODE > is dynamically allocated: the addrinfo structures, and the socket address structures and canonical host name strings pointed to by the -<TT +<CODE CLASS="CONSTANT" ->addrinfo</TT +>addrinfo</CODE >structures. Memory allocated for the dynamically allocated structures created by a successful call to -<TT +<CODE CLASS="FUNCTION" ->lwres_getaddrinfo()</TT +>lwres_getaddrinfo()</CODE > is released by -<TT +<CODE CLASS="FUNCTION" ->lwres_freeaddrinfo()</TT +>lwres_freeaddrinfo()</CODE >. -<TT +<VAR CLASS="PARAMETER" -><I ->ai</I -></TT +>ai</VAR > is a pointer to a <SPAN @@ -569,9 +541,9 @@ CLASS="TYPE" >struct addrinfo</SPAN > created by a call to -<TT +<CODE CLASS="FUNCTION" ->lwres_getaddrinfo()</TT +>lwres_getaddrinfo()</CODE >.</P ></DIV ><DIV @@ -582,9 +554,9 @@ NAME="AEN142" ><H2 >RETURN VALUES</H2 ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_getaddrinfo()</TT +>lwres_getaddrinfo()</CODE > returns zero on success or one of the error codes listed in <SPAN @@ -596,27 +568,23 @@ CLASS="REFENTRYTITLE" > if an error occurs. If both -<TT +<VAR CLASS="PARAMETER" -><I ->hostname</I -></TT +>hostname</VAR > and -<TT +<VAR CLASS="PARAMETER" -><I ->servname</I -></TT +>servname</VAR > are <SPAN CLASS="TYPE" >NULL</SPAN > -<TT +<CODE CLASS="FUNCTION" ->lwres_getaddrinfo()</TT +>lwres_getaddrinfo()</CODE > returns <SPAN diff --git a/dist/bind/lib/lwres/man/lwres_gethostent.html b/dist/bind/lib/lwres/man/lwres_gethostent.html index c7cdaa87cca..22b68bd58ab 100644 --- a/dist/bind/lib/lwres/man/lwres_gethostent.html +++ b/dist/bind/lib/lwres/man/lwres_gethostent.html @@ -15,16 +15,16 @@ - PERFORMANCE OF THIS SOFTWARE. --> -<!-- Id: lwres_gethostent.html,v 1.8.2.1.4.1 2004/03/06 08:15:39 marka Exp --> +<!-- 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.73 -"></HEAD +CONTENT="Modular DocBook HTML Stylesheet Version 1.7"></HEAD ><BODY CLASS="REFENTRY" BGCOLOR="#FFFFFF" @@ -35,8 +35,8 @@ ALINK="#0000FF" ><H1 ><A NAME="AEN1" ->lwres_gethostent</A -></H1 +></A +>lwres_gethostent</H1 ><DIV CLASS="REFNAMEDIV" ><A @@ -54,11 +54,11 @@ NAME="AEN21" >Synopsis</H2 ><DIV CLASS="FUNCSYNOPSIS" +><P +></P ><A NAME="AEN22" ></A -><P -></P ><PRE CLASS="FUNCSYNOPSISINFO" >#include <lwres/netdb.h></PRE @@ -203,27 +203,27 @@ CLASS="PROGRAMLISTING" CLASS="VARIABLELIST" ><DL ><DT -><TT +><CODE CLASS="CONSTANT" ->h_name</TT +>h_name</CODE ></DT ><DD ><P >The official (canonical) name of the host.</P ></DD ><DT -><TT +><CODE CLASS="CONSTANT" ->h_aliases</TT +>h_aliases</CODE ></DT ><DD ><P >A NULL-terminated array of alternate names (nicknames) for the host.</P ></DD ><DT -><TT +><CODE CLASS="CONSTANT" ->h_addrtype</TT +>h_addrtype</CODE ></DT ><DD ><P @@ -239,18 +239,18 @@ CLASS="TYPE" >.</P ></DD ><DT -><TT +><CODE CLASS="CONSTANT" ->h_length</TT +>h_length</CODE ></DT ><DD ><P >The length of the address in bytes.</P ></DD ><DT -><TT +><CODE CLASS="CONSTANT" ->h_addr_list</TT +>h_addr_list</CODE ></DT ><DD ><P @@ -266,40 +266,40 @@ Host addresses are returned in network byte order.</P ></P ><P >For backward compatibility with very old software, -<TT +<CODE CLASS="CONSTANT" ->h_addr</TT +>h_addr</CODE > is the first address in -<TT +<CODE CLASS="CONSTANT" ->h_addr_list.</TT +>h_addr_list.</CODE ></P ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_gethostent()</TT +>lwres_gethostent()</CODE >, -<TT +<CODE CLASS="FUNCTION" ->lwres_sethostent()</TT +>lwres_sethostent()</CODE >, -<TT +<CODE CLASS="FUNCTION" ->lwres_endhostent()</TT +>lwres_endhostent()</CODE >, -<TT +<CODE CLASS="FUNCTION" ->lwres_gethostent_r()</TT +>lwres_gethostent_r()</CODE >, -<TT +<CODE CLASS="FUNCTION" ->lwres_sethostent_r()</TT +>lwres_sethostent_r()</CODE > and -<TT +<CODE CLASS="FUNCTION" ->lwres_endhostent_r()</TT +>lwres_endhostent_r()</CODE > provide iteration over the known host entries on systems that provide such functionality through facilities like @@ -311,33 +311,29 @@ or NIS. The lightweight resolver does not currently implement these functions; it only provides them as stub functions that always return failure.</P ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_gethostbyname()</TT +>lwres_gethostbyname()</CODE > and -<TT +<CODE CLASS="FUNCTION" ->lwres_gethostbyname2()</TT +>lwres_gethostbyname2()</CODE > look up the hostname -<TT +<VAR CLASS="PARAMETER" -><I ->name</I -></TT +>name</VAR >. -<TT +<CODE CLASS="FUNCTION" ->lwres_gethostbyname()</TT +>lwres_gethostbyname()</CODE > always looks for an IPv4 -address while <TT +address while <CODE CLASS="FUNCTION" ->lwres_gethostbyname2()</TT +>lwres_gethostbyname2()</CODE > looks for an -address of protocol family <TT +address of protocol family <VAR CLASS="PARAMETER" -><I ->af</I -></TT +>af</VAR >: either <SPAN CLASS="TYPE" @@ -355,37 +351,31 @@ CLASS="TYPE" CLASS="TYPE" >NULL</SPAN > is returned if the lookups by -<TT +<CODE CLASS="FUNCTION" ->lwres_gethostbyname()</TT +>lwres_gethostbyname()</CODE > or -<TT +<CODE CLASS="FUNCTION" ->lwres_gethostbyname2()</TT +>lwres_gethostbyname2()</CODE > fail.</P ><P >Reverse lookups of addresses are performed by -<TT +<CODE CLASS="FUNCTION" ->lwres_gethostbyaddr()</TT +>lwres_gethostbyaddr()</CODE >. -<TT +<VAR CLASS="PARAMETER" -><I ->addr</I -></TT +>addr</VAR > is an address of length -<TT +<VAR CLASS="PARAMETER" -><I ->len</I -></TT +>len</VAR > bytes and protocol family -<TT +<VAR CLASS="PARAMETER" -><I ->type</I -></TT +>type</VAR > — <SPAN CLASS="TYPE" >PF_INET</SPAN @@ -394,99 +384,81 @@ CLASS="TYPE" CLASS="TYPE" >PF_INET6</SPAN >. -<TT +<CODE CLASS="FUNCTION" ->lwres_gethostbyname_r()</TT +>lwres_gethostbyname_r()</CODE > is a thread-safe function for forward lookups. If an error occurs, an error code is returned in -<TT +<VAR CLASS="PARAMETER" -><I ->*error</I -></TT +>*error</VAR >. -<TT +<VAR CLASS="PARAMETER" -><I ->resbuf</I -></TT +>resbuf</VAR > is a pointer to a <SPAN CLASS="TYPE" >struct hostent</SPAN > which is initialised by a successful call to -<TT +<CODE CLASS="FUNCTION" ->lwres_gethostbyname_r()</TT +>lwres_gethostbyname_r()</CODE > . -<TT +<VAR CLASS="PARAMETER" -><I ->buf</I -></TT +>buf</VAR > is a buffer of length -<TT +<VAR CLASS="PARAMETER" -><I ->len</I -></TT +>len</VAR > bytes which is used to store the -<TT +<CODE CLASS="CONSTANT" ->h_name</TT ->, <TT +>h_name</CODE +>, <CODE CLASS="CONSTANT" ->h_aliases</TT +>h_aliases</CODE >, and -<TT +<CODE CLASS="CONSTANT" ->h_addr_list</TT +>h_addr_list</CODE > elements of the <SPAN CLASS="TYPE" >struct hostent</SPAN -> returned in <TT +> returned in <VAR CLASS="PARAMETER" -><I ->resbuf</I -></TT +>resbuf</VAR >. -Successful calls to <TT +Successful calls to <CODE CLASS="FUNCTION" ->lwres_gethostbyname_r()</TT +>lwres_gethostbyname_r()</CODE > -return <TT +return <VAR CLASS="PARAMETER" -><I ->resbuf</I -></TT +>resbuf</VAR >, which is a pointer to the <SPAN CLASS="TYPE" >struct hostent</SPAN > it created.</P ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_gethostbyaddr_r()</TT +>lwres_gethostbyaddr_r()</CODE > is a thread-safe function -that performs a reverse lookup of address <TT +that performs a reverse lookup of address <VAR CLASS="PARAMETER" -><I ->addr</I -></TT +>addr</VAR > -which is <TT +which is <VAR CLASS="PARAMETER" -><I ->len</I -></TT +>len</VAR > bytes long and is of protocol -family <TT +family <VAR CLASS="PARAMETER" -><I ->type</I -></TT +>type</VAR > — <SPAN CLASS="TYPE" >PF_INET</SPAN @@ -495,75 +467,63 @@ CLASS="TYPE" CLASS="TYPE" >PF_INET6</SPAN >. If an error occurs, the error code is returned -in <TT +in <VAR CLASS="PARAMETER" -><I ->*error</I -></TT +>*error</VAR >. The other function parameters are -identical to those in <TT +identical to those in <CODE CLASS="FUNCTION" ->lwres_gethostbyname_r()</TT +>lwres_gethostbyname_r()</CODE >. -<TT +<VAR CLASS="PARAMETER" -><I ->resbuf</I -></TT +>resbuf</VAR > is a pointer to a <SPAN CLASS="TYPE" >struct hostent</SPAN > which is initialised by a successful call to -<TT +<CODE CLASS="FUNCTION" ->lwres_gethostbyaddr_r()</TT +>lwres_gethostbyaddr_r()</CODE >. -<TT +<VAR CLASS="PARAMETER" -><I ->buf</I -></TT +>buf</VAR > is a buffer of length -<TT +<VAR CLASS="PARAMETER" -><I ->len</I -></TT +>len</VAR > bytes which is used to store the -<TT +<CODE CLASS="CONSTANT" ->h_name</TT ->, <TT +>h_name</CODE +>, <CODE CLASS="CONSTANT" ->h_aliases</TT +>h_aliases</CODE >, and -<TT +<CODE CLASS="CONSTANT" ->h_addr_list</TT +>h_addr_list</CODE > elements of the <SPAN CLASS="TYPE" >struct hostent</SPAN -> returned in <TT +> returned in <VAR CLASS="PARAMETER" -><I ->resbuf</I -></TT +>resbuf</VAR >. Successful -calls to <TT +calls to <CODE CLASS="FUNCTION" ->lwres_gethostbyaddr_r()</TT +>lwres_gethostbyaddr_r()</CODE > return -<TT +<VAR CLASS="PARAMETER" -><I ->resbuf</I -></TT +>resbuf</VAR >, which is a pointer to the -<TT +<CODE CLASS="FUNCTION" ->struct hostent()</TT +>struct hostent()</CODE > it created.</P ></DIV ><DIV @@ -575,22 +535,22 @@ NAME="AEN191" >RETURN VALUES</H2 ><P >The functions -<TT +<CODE CLASS="FUNCTION" ->lwres_gethostbyname()</TT +>lwres_gethostbyname()</CODE >, -<TT +<CODE CLASS="FUNCTION" ->lwres_gethostbyname2()</TT +>lwres_gethostbyname2()</CODE >, -<TT +<CODE CLASS="FUNCTION" ->lwres_gethostbyaddr()</TT +>lwres_gethostbyaddr()</CODE >, and -<TT +<CODE CLASS="FUNCTION" ->lwres_gethostent()</TT +>lwres_gethostent()</CODE > return NULL to indicate an error. In this case the global variable <SPAN @@ -609,18 +569,18 @@ CLASS="FILENAME" CLASS="VARIABLELIST" ><DL ><DT -><TT +><CODE CLASS="CONSTANT" ->HOST_NOT_FOUND</TT +>HOST_NOT_FOUND</CODE ></DT ><DD ><P >The host or address was not found.</P ></DD ><DT -><TT +><CODE CLASS="CONSTANT" ->TRY_AGAIN</TT +>TRY_AGAIN</CODE ></DT ><DD ><P @@ -628,18 +588,18 @@ CLASS="CONSTANT" Retrying the lookup may succeed.</P ></DD ><DT -><TT +><CODE CLASS="CONSTANT" ->NO_RECOVERY</TT +>NO_RECOVERY</CODE ></DT ><DD ><P >A non-recoverable error occurred.</P ></DD ><DT -><TT +><CODE CLASS="CONSTANT" ->NO_DATA</TT +>NO_DATA</CODE ></DT ><DD ><P @@ -662,14 +622,14 @@ CLASS="REFENTRYTITLE" > translates these error codes to suitable error messages.</P ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_gethostent()</TT +>lwres_gethostent()</CODE > and -<TT +<CODE CLASS="FUNCTION" ->lwres_gethostent_r()</TT +>lwres_gethostent_r()</CODE > always return <SPAN @@ -677,19 +637,17 @@ CLASS="TYPE" >NULL</SPAN >.</P ><P ->Successful calls to <TT +>Successful calls to <CODE CLASS="FUNCTION" ->lwres_gethostbyname_r()</TT +>lwres_gethostbyname_r()</CODE > and -<TT +<CODE CLASS="FUNCTION" ->lwres_gethostbyaddr_r()</TT +>lwres_gethostbyaddr_r()</CODE > return -<TT +<VAR CLASS="PARAMETER" -><I ->resbuf</I -></TT +>resbuf</VAR >, a pointer to the <SPAN CLASS="TYPE" >struct @@ -698,40 +656,36 @@ hostent</SPAN <SPAN CLASS="TYPE" >NULL</SPAN -> if the lookups fail or if <TT +> if the lookups fail or if <VAR CLASS="PARAMETER" -><I ->buf</I -></TT +>buf</VAR > was too small to hold the list of addresses and names referenced by -the <TT +the <CODE CLASS="CONSTANT" ->h_name</TT ->, <TT +>h_name</CODE +>, <CODE CLASS="CONSTANT" ->h_aliases</TT +>h_aliases</CODE >, and -<TT +<CODE CLASS="CONSTANT" ->h_addr_list</TT +>h_addr_list</CODE > elements of the <SPAN CLASS="TYPE" >struct hostent</SPAN ->. If <TT +>. If <VAR CLASS="PARAMETER" -><I ->buf</I -></TT +>buf</VAR > was too small, both -<TT +<CODE CLASS="FUNCTION" ->lwres_gethostbyname_r()</TT +>lwres_gethostbyname_r()</CODE > and -<TT +<CODE CLASS="FUNCTION" ->lwres_gethostbyaddr_r()</TT +>lwres_gethostbyaddr_r()</CODE > set the global variable <SPAN CLASS="TYPE" @@ -781,34 +735,34 @@ NAME="AEN257" ><H2 >BUGS</H2 ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_gethostbyname()</TT +>lwres_gethostbyname()</CODE >, -<TT +<CODE CLASS="FUNCTION" ->lwres_gethostbyname2()</TT +>lwres_gethostbyname2()</CODE >, -<TT +<CODE CLASS="FUNCTION" ->lwres_gethostbyaddr()</TT +>lwres_gethostbyaddr()</CODE > and -<TT +<CODE CLASS="FUNCTION" ->lwres_endhostent()</TT +>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 -<TT +<CODE CLASS="FUNCTION" ->lwres_gethostbyname_r()</TT +>lwres_gethostbyname_r()</CODE >, and -<TT +<CODE CLASS="FUNCTION" ->lwres_gethostbyaddr_r()</TT +>lwres_gethostbyaddr_r()</CODE > respectively.</P ><P diff --git a/dist/bind/lib/lwres/man/lwres_getipnode.html b/dist/bind/lib/lwres/man/lwres_getipnode.html index 044f1b27cba..4cf87bc6c41 100644 --- a/dist/bind/lib/lwres/man/lwres_getipnode.html +++ b/dist/bind/lib/lwres/man/lwres_getipnode.html @@ -15,16 +15,16 @@ - PERFORMANCE OF THIS SOFTWARE. --> -<!-- Id: lwres_getipnode.html,v 1.7.2.1.4.1 2004/03/06 08:15:40 marka Exp --> +<!-- 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.73 -"></HEAD +CONTENT="Modular DocBook HTML Stylesheet Version 1.7"></HEAD ><BODY CLASS="REFENTRY" BGCOLOR="#FFFFFF" @@ -35,8 +35,8 @@ ALINK="#0000FF" ><H1 ><A NAME="AEN1" ->lwres_getipnode</A -></H1 +></A +>lwres_getipnode</H1 ><DIV CLASS="REFNAMEDIV" ><A @@ -54,11 +54,11 @@ NAME="AEN13" >Synopsis</H2 ><DIV CLASS="FUNCSYNOPSIS" +><P +></P ><A NAME="AEN14" ></A -><P -></P ><PRE CLASS="FUNCSYNOPSISINFO" >#include <lwres/netdb.h></PRE @@ -131,27 +131,27 @@ CLASS="PROGRAMLISTING" CLASS="VARIABLELIST" ><DL ><DT -><TT +><CODE CLASS="CONSTANT" ->h_name</TT +>h_name</CODE ></DT ><DD ><P >The official (canonical) name of the host.</P ></DD ><DT -><TT +><CODE CLASS="CONSTANT" ->h_aliases</TT +>h_aliases</CODE ></DT ><DD ><P >A NULL-terminated array of alternate names (nicknames) for the host.</P ></DD ><DT -><TT +><CODE CLASS="CONSTANT" ->h_addrtype</TT +>h_addrtype</CODE ></DT ><DD ><P @@ -167,18 +167,18 @@ CLASS="TYPE" >. </P ></DD ><DT -><TT +><CODE CLASS="CONSTANT" ->h_length</TT +>h_length</CODE ></DT ><DD ><P >The length of the address in bytes.</P ></DD ><DT -><TT +><CODE CLASS="CONSTANT" ->h_addr_list</TT +>h_addr_list</CODE ></DT ><DD ><P @@ -194,32 +194,26 @@ Host addresses are returned in network byte order.</P ></DIV ></P ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_getipnodebyname()</TT +>lwres_getipnodebyname()</CODE > looks up addresses of protocol family -<TT +<VAR CLASS="PARAMETER" -><I ->af</I -></TT +>af</VAR > for the hostname -<TT +<VAR CLASS="PARAMETER" -><I ->name</I -></TT +>name</VAR >. The -<TT +<VAR CLASS="PARAMETER" -><I ->flags</I -></TT +>flags</VAR > parameter contains ORed flag bits to specify the types of addresses that are searched @@ -231,44 +225,40 @@ The flag bits are: CLASS="VARIABLELIST" ><DL ><DT -><TT +><CODE CLASS="CONSTANT" ->AI_V4MAPPED</TT +>AI_V4MAPPED</CODE ></DT ><DD ><P >This is used with an -<TT +<VAR CLASS="PARAMETER" -><I ->af</I -></TT +>af</VAR > of AF_INET6, and causes IPv4 addresses to be returned as IPv4-mapped IPv6 addresses.</P ></DD ><DT -><TT +><CODE CLASS="CONSTANT" ->AI_ALL</TT +>AI_ALL</CODE ></DT ><DD ><P >This is used with an -<TT +<VAR CLASS="PARAMETER" -><I ->af</I -></TT +>af</VAR > 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 -><TT +><CODE CLASS="CONSTANT" ->AI_ADDRCONFIG</TT +>AI_ADDRCONFIG</CODE ></DT ><DD ><P @@ -277,21 +267,21 @@ interface of that type. This is not currently implemented in the BIND 9 lightweight resolver, and the flag is ignored.</P ></DD ><DT -><TT +><CODE CLASS="CONSTANT" ->AI_DEFAULT</TT +>AI_DEFAULT</CODE ></DT ><DD ><P >This default sets the -<TT +<CODE CLASS="CONSTANT" ->AI_V4MAPPED</TT +>AI_V4MAPPED</CODE > and -<TT +<CODE CLASS="CONSTANT" ->AI_ADDRCONFIG</TT +>AI_ADDRCONFIG</CODE > flag bits.</P ></DD @@ -299,31 +289,25 @@ flag bits.</P ></DIV ></P ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_getipnodebyaddr()</TT +>lwres_getipnodebyaddr()</CODE > performs a reverse lookup of address -<TT +<VAR CLASS="PARAMETER" -><I ->src</I -></TT +>src</VAR > which is -<TT +<VAR CLASS="PARAMETER" -><I ->len</I -></TT +>len</VAR > bytes long. -<TT +<VAR CLASS="PARAMETER" -><I ->af</I -></TT +>af</VAR > denotes the protocol family, typically <SPAN @@ -336,9 +320,9 @@ CLASS="TYPE" >PF_INET6</SPAN >. </P ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_freehostent()</TT +>lwres_freehostent()</CODE > releases all the memory associated with the @@ -347,27 +331,25 @@ CLASS="TYPE" >struct hostent</SPAN > pointer -<TT +<VAR CLASS="PARAMETER" -><I ->he</I -></TT +>he</VAR >. Any memory allocated for the -<TT +<CODE CLASS="CONSTANT" ->h_name</TT +>h_name</CODE >, -<TT +<CODE CLASS="CONSTANT" ->h_addr_list</TT +>h_addr_list</CODE > and -<TT +<CODE CLASS="CONSTANT" ->h_aliases</TT +>h_aliases</CODE > is freed, as is the memory for the <SPAN @@ -385,21 +367,19 @@ NAME="AEN116" >RETURN VALUES</H2 ><P >If an error occurs, -<TT +<CODE CLASS="FUNCTION" ->lwres_getipnodebyname()</TT +>lwres_getipnodebyname()</CODE > and -<TT +<CODE CLASS="FUNCTION" ->lwres_getipnodebyaddr()</TT +>lwres_getipnodebyaddr()</CODE > set -<TT +<VAR CLASS="PARAMETER" -><I ->*error_num</I -></TT +>*error_num</VAR > to an appropriate error code and the function returns a <SPAN @@ -418,18 +398,18 @@ CLASS="FILENAME" CLASS="VARIABLELIST" ><DL ><DT -><TT +><CODE CLASS="CONSTANT" ->HOST_NOT_FOUND</TT +>HOST_NOT_FOUND</CODE ></DT ><DD ><P >No such host is known.</P ></DD ><DT -><TT +><CODE CLASS="CONSTANT" ->NO_ADDRESS</TT +>NO_ADDRESS</CODE ></DT ><DD ><P @@ -438,9 +418,9 @@ available. Another type of request to the name server for the domain might return an answer.</P ></DD ><DT -><TT +><CODE CLASS="CONSTANT" ->TRY_AGAIN</TT +>TRY_AGAIN</CODE ></DT ><DD ><P @@ -449,9 +429,9 @@ failure of a server to respond. The request may succeed if retried.</P ></DD ><DT -><TT +><CODE CLASS="CONSTANT" ->NO_RECOVERY</TT +>NO_RECOVERY</CODE ></DT ><DD ><P diff --git a/dist/bind/lib/lwres/man/lwres_getnameinfo.html b/dist/bind/lib/lwres/man/lwres_getnameinfo.html index 5ba59923cdd..5bc528fe4c9 100644 --- a/dist/bind/lib/lwres/man/lwres_getnameinfo.html +++ b/dist/bind/lib/lwres/man/lwres_getnameinfo.html @@ -15,16 +15,16 @@ - PERFORMANCE OF THIS SOFTWARE. --> -<!-- Id: lwres_getnameinfo.html,v 1.5.2.1.4.1 2004/03/06 08:15:40 marka Exp --> +<!-- 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.73 -"></HEAD +CONTENT="Modular DocBook HTML Stylesheet Version 1.7"></HEAD ><BODY CLASS="REFENTRY" BGCOLOR="#FFFFFF" @@ -35,8 +35,8 @@ ALINK="#0000FF" ><H1 ><A NAME="AEN1" ->lwres_getnameinfo</A -></H1 +></A +>lwres_getnameinfo</H1 ><DIV CLASS="REFNAMEDIV" ><A @@ -54,11 +54,11 @@ NAME="AEN11" >Synopsis</H2 ><DIV CLASS="FUNCSYNOPSIS" +><P +></P ><A NAME="AEN12" ></A -><P -></P ><PRE CLASS="FUNCSYNOPSISINFO" >#include <lwres/netdb.h></PRE @@ -89,70 +89,54 @@ CLASS="REFENTRYTITLE" >getnameinfo</SPAN >(3)</SPAN > function defined in RFC2133. -<TT +<CODE CLASS="FUNCTION" ->lwres_getnameinfo()</TT +>lwres_getnameinfo()</CODE > returns the hostname for the <SPAN CLASS="TYPE" >struct sockaddr</SPAN -> <TT +> <VAR CLASS="PARAMETER" -><I ->sa</I -></TT +>sa</VAR > which is -<TT +<VAR CLASS="PARAMETER" -><I ->salen</I -></TT +>salen</VAR > bytes long. The hostname is of length -<TT +<VAR CLASS="PARAMETER" -><I ->hostlen</I -></TT +>hostlen</VAR > and is returned via -<TT +<VAR CLASS="PARAMETER" -><I ->*host.</I -></TT +>*host.</VAR > The maximum length of the hostname is -1025 bytes: <TT +1025 bytes: <CODE CLASS="CONSTANT" ->NI_MAXHOST</TT +>NI_MAXHOST</CODE >.</P ><P > The name of the service associated with the port number in -<TT +<VAR CLASS="PARAMETER" -><I ->sa</I -></TT -> is returned in <TT +>sa</VAR +> is returned in <VAR CLASS="PARAMETER" -><I ->*serv.</I -></TT +>*serv.</VAR > -It is <TT +It is <VAR CLASS="PARAMETER" -><I ->servlen</I -></TT +>servlen</VAR > bytes long. The maximum length -of the service name is <TT +of the service name is <CODE CLASS="CONSTANT" ->NI_MAXSERV</TT +>NI_MAXSERV</CODE > - 32 bytes.</P ><P -> The <TT +> The <VAR CLASS="PARAMETER" -><I ->flags</I -></TT +>flags</VAR > argument sets the following bits: <P @@ -161,9 +145,9 @@ bits: CLASS="VARIABLELIST" ><DL ><DT -><TT +><CODE CLASS="CONSTANT" ->NI_NOFQDN</TT +>NI_NOFQDN</CODE ></DT ><DD ><P @@ -171,9 +155,9 @@ CLASS="CONSTANT" The local part of the fully qualified domain name is returned instead.</P ></DD ><DT -><TT +><CODE CLASS="CONSTANT" ->NI_NUMERICHOST</TT +>NI_NUMERICHOST</CODE ></DT ><DD ><P @@ -181,9 +165,9 @@ CLASS="CONSTANT" instead of a host name.</P ></DD ><DT -><TT +><CODE CLASS="CONSTANT" ->NI_NAMEREQD</TT +>NI_NAMEREQD</CODE ></DT ><DD ><P @@ -193,18 +177,18 @@ If the hostname is not found and the flag is not set, the address is returned in numeric form.</P ></DD ><DT -><TT +><CODE CLASS="CONSTANT" ->NI_NUMERICSERV</TT +>NI_NUMERICSERV</CODE ></DT ><DD ><P >The service name is returned as a digit string representing the port number.</P ></DD ><DT -><TT +><CODE CLASS="CONSTANT" ->NI_DGRAM</TT +>NI_DGRAM</CODE ></DT ><DD ><P @@ -226,9 +210,9 @@ NAME="AEN70" ><H2 >RETURN VALUES</H2 ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_getnameinfo()</TT +>lwres_getnameinfo()</CODE > returns 0 on success or a non-zero error code if an error occurs.</P ></DIV diff --git a/dist/bind/lib/lwres/man/lwres_getrrsetbyname.html b/dist/bind/lib/lwres/man/lwres_getrrsetbyname.html index 1a54243090e..db2b344ef2a 100644 --- a/dist/bind/lib/lwres/man/lwres_getrrsetbyname.html +++ b/dist/bind/lib/lwres/man/lwres_getrrsetbyname.html @@ -15,16 +15,16 @@ - PERFORMANCE OF THIS SOFTWARE. --> -<!-- Id: lwres_getrrsetbyname.html,v 1.5.2.1.4.1 2004/03/06 08:15:40 marka Exp --> +<!-- 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.73 -"></HEAD +CONTENT="Modular DocBook HTML Stylesheet Version 1.7"></HEAD ><BODY CLASS="REFENTRY" BGCOLOR="#FFFFFF" @@ -35,8 +35,8 @@ ALINK="#0000FF" ><H1 ><A NAME="AEN1" ->lwres_getrrsetbyname</A -></H1 +></A +>lwres_getrrsetbyname</H1 ><DIV CLASS="REFNAMEDIV" ><A @@ -54,11 +54,11 @@ NAME="AEN12" >Synopsis</H2 ><DIV CLASS="FUNCSYNOPSIS" +><P +></P ><A NAME="AEN13" ></A -><P -></P ><PRE CLASS="FUNCSYNOPSISINFO" >#include <lwres/netdb.h></PRE @@ -111,60 +111,48 @@ NAME="AEN29" ><H2 >DESCRIPTION</H2 ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_getrrsetbyname()</TT +>lwres_getrrsetbyname()</CODE > gets a set of resource records associated with a -<TT +<VAR CLASS="PARAMETER" -><I ->hostname</I -></TT +>hostname</VAR >, -<TT +<VAR CLASS="PARAMETER" -><I ->class</I -></TT +>class</VAR >, and -<TT +<VAR CLASS="PARAMETER" -><I ->type</I -></TT +>type</VAR >. -<TT +<VAR CLASS="PARAMETER" -><I ->hostname</I -></TT +>hostname</VAR > is a pointer a to null-terminated string. The -<TT +<VAR CLASS="PARAMETER" -><I ->flags</I -></TT +>flags</VAR > field is currently unused and must be zero.</P ><P >After a successful call to -<TT +<CODE CLASS="FUNCTION" ->lwres_getrrsetbyname()</TT +>lwres_getrrsetbyname()</CODE >, -<TT +<VAR CLASS="PARAMETER" -><I ->*res</I -></TT +>*res</VAR > is a pointer to an <SPAN @@ -184,84 +172,82 @@ CLASS="TYPE" structures containing SIG resource records associated with those records. The members -<TT +<CODE CLASS="CONSTANT" ->rri_rdclass</TT +>rri_rdclass</CODE > and -<TT +<CODE CLASS="CONSTANT" ->rri_rdtype</TT +>rri_rdtype</CODE > are copied from the parameters. -<TT +<CODE CLASS="CONSTANT" ->rri_ttl</TT +>rri_ttl</CODE > and -<TT +<CODE CLASS="CONSTANT" ->rri_name</TT +>rri_name</CODE > are properties of the obtained rrset. The resource records contained in -<TT +<CODE CLASS="CONSTANT" ->rri_rdatas</TT +>rri_rdatas</CODE > and -<TT +<CODE CLASS="CONSTANT" ->rri_sigs</TT +>rri_sigs</CODE > are in uncompressed DNS wire format. Properties of the rdataset are represented in the -<TT +<CODE CLASS="CONSTANT" ->rri_flags</TT +>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 -<TT +<CODE CLASS="FUNCTION" ->lwres_getrrsetbyname()</TT +>lwres_getrrsetbyname()</CODE > is dynamically allocated: the -<TT +<CODE CLASS="CONSTANT" ->rrsetinfo</TT +>rrsetinfo</CODE > and -<TT +<CODE CLASS="CONSTANT" ->rdatainfo</TT +>rdatainfo</CODE > structures, and the canonical host name strings pointed to by the -<TT +<CODE CLASS="CONSTANT" ->rrsetinfo</TT +>rrsetinfo</CODE >structure. Memory allocated for the dynamically allocated structures created by a successful call to -<TT +<CODE CLASS="FUNCTION" ->lwres_getrrsetbyname()</TT +>lwres_getrrsetbyname()</CODE > is released by -<TT +<CODE CLASS="FUNCTION" ->lwres_freerrset()</TT +>lwres_freerrset()</CODE >. -<TT +<VAR CLASS="PARAMETER" -><I ->rrset</I -></TT +>rrset</VAR > is a pointer to a <SPAN @@ -269,9 +255,9 @@ CLASS="TYPE" >struct rrset</SPAN > created by a call to -<TT +<CODE CLASS="FUNCTION" ->lwres_getrrsetbyname()</TT +>lwres_getrrsetbyname()</CODE >. </P ><P ></P @@ -284,9 +270,9 @@ NAME="AEN62" ><H2 >RETURN VALUES</H2 ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_getrrsetbyname()</TT +>lwres_getrrsetbyname()</CODE > returns zero on success, and one of the following error codes if an error occurred: @@ -296,54 +282,54 @@ codes if an error occurred: CLASS="VARIABLELIST" ><DL ><DT -><TT +><CODE CLASS="CONSTANT" ->ERRSET_NONAME</TT +>ERRSET_NONAME</CODE ></DT ><DD ><P >the name does not exist</P ></DD ><DT -><TT +><CODE CLASS="CONSTANT" ->ERRSET_NODATA</TT +>ERRSET_NODATA</CODE ></DT ><DD ><P >the name exists, but does not have data of the desired type</P ></DD ><DT -><TT +><CODE CLASS="CONSTANT" ->ERRSET_NOMEMORY</TT +>ERRSET_NOMEMORY</CODE ></DT ><DD ><P >memory could not be allocated</P ></DD ><DT -><TT +><CODE CLASS="CONSTANT" ->ERRSET_INVAL</TT +>ERRSET_INVAL</CODE ></DT ><DD ><P >a parameter is invalid</P ></DD ><DT -><TT +><CODE CLASS="CONSTANT" ->ERRSET_FAIL</TT +>ERRSET_FAIL</CODE ></DT ><DD ><P >other failure</P ></DD ><DT -><TT +><CODE CLASS="CONSTANT" -></TT +></CODE ></DT ><DD ><P diff --git a/dist/bind/lib/lwres/man/lwres_gnba.html b/dist/bind/lib/lwres/man/lwres_gnba.html index bd24797ded3..e1f15358578 100644 --- a/dist/bind/lib/lwres/man/lwres_gnba.html +++ b/dist/bind/lib/lwres/man/lwres_gnba.html @@ -15,16 +15,16 @@ - PERFORMANCE OF THIS SOFTWARE. --> -<!-- Id: lwres_gnba.html,v 1.6.2.1.4.1 2004/03/06 08:15:40 marka Exp --> +<!-- 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.73 -"></HEAD +CONTENT="Modular DocBook HTML Stylesheet Version 1.7"></HEAD ><BODY CLASS="REFENTRY" BGCOLOR="#FFFFFF" @@ -35,8 +35,8 @@ ALINK="#0000FF" ><H1 ><A NAME="AEN1" ->lwres_gnba</A -></H1 +></A +>lwres_gnba</H1 ><DIV CLASS="REFNAMEDIV" ><A @@ -54,11 +54,11 @@ NAME="AEN16" >Synopsis</H2 ><DIV CLASS="FUNCSYNOPSIS" +><P +></P ><A NAME="AEN17" ></A -><P -></P ><PRE CLASS="FUNCSYNOPSISINFO" >#include <lwres/lwres.h></PRE @@ -171,41 +171,41 @@ typedef struct { } lwres_gnbaresponse_t;</PRE ></P ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_gnbarequest_render()</TT +>lwres_gnbarequest_render()</CODE > uses resolver context -<TT +<VAR CLASS="VARNAME" ->ctx</TT +>ctx</VAR > to convert getnamebyaddr request structure -<TT +<VAR CLASS="VARNAME" ->req</TT +>req</VAR > to canonical format. The packet header structure -<TT +<VAR CLASS="VARNAME" ->pkt</TT +>pkt</VAR > is initialised and transferred to buffer -<TT +<VAR CLASS="VARNAME" ->b</TT +>b</VAR >. The contents of -<TT +<VAR CLASS="VARNAME" ->*req</TT +>*req</VAR > are then appended to the buffer in canonical format. -<TT +<CODE CLASS="FUNCTION" ->lwres_gnbaresponse_render()</TT +>lwres_gnbaresponse_render()</CODE > performs the same task, except it converts a getnamebyaddr response structure <SPAN @@ -214,19 +214,19 @@ CLASS="TYPE" > to the lightweight resolver's canonical format.</P ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_gnbarequest_parse()</TT +>lwres_gnbarequest_parse()</CODE > uses context -<TT +<VAR CLASS="VARNAME" ->ctx</TT +>ctx</VAR > to convert the contents of packet -<TT +<VAR CLASS="VARNAME" ->pkt</TT +>pkt</VAR > to a <SPAN @@ -235,9 +235,9 @@ CLASS="TYPE" > structure. Buffer -<TT +<VAR CLASS="VARNAME" ->b</TT +>b</VAR > provides space to be used for storing this structure. When the function succeeds, the resulting @@ -246,18 +246,18 @@ CLASS="TYPE" >lwres_gnbarequest_t</SPAN > is made available through -<TT +<VAR CLASS="VARNAME" ->*structp</TT +>*structp</VAR >. -<TT +<CODE CLASS="FUNCTION" ->lwres_gnbaresponse_parse()</TT +>lwres_gnbaresponse_parse()</CODE > offers the same semantics as -<TT +<CODE CLASS="FUNCTION" ->lwres_gnbarequest_parse()</TT +>lwres_gnbarequest_parse()</CODE > except it yields a <SPAN @@ -266,19 +266,19 @@ CLASS="TYPE" > structure.</P ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_gnbaresponse_free()</TT +>lwres_gnbaresponse_free()</CODE > and -<TT +<CODE CLASS="FUNCTION" ->lwres_gnbarequest_free()</TT +>lwres_gnbarequest_free()</CODE > release the memory in resolver context -<TT +<VAR CLASS="VARNAME" ->ctx</TT +>ctx</VAR > that was allocated to the <SPAN @@ -291,9 +291,9 @@ CLASS="TYPE" >lwres_gnbarequest_t</SPAN > structures referenced via -<TT +<VAR CLASS="VARNAME" ->structp</TT +>structp</VAR >. Any memory associated with ancillary buffers and strings for those structures is also discarded.</P @@ -307,22 +307,22 @@ NAME="AEN97" >RETURN VALUES</H2 ><P >The getnamebyaddr opcode functions -<TT +<CODE CLASS="FUNCTION" ->lwres_gnbarequest_render()</TT +>lwres_gnbarequest_render()</CODE >, -<TT +<CODE CLASS="FUNCTION" ->lwres_gnbaresponse_render()</TT +>lwres_gnbaresponse_render()</CODE > -<TT +<CODE CLASS="FUNCTION" ->lwres_gnbarequest_parse()</TT +>lwres_gnbarequest_parse()</CODE > and -<TT +<CODE CLASS="FUNCTION" ->lwres_gnbaresponse_parse()</TT +>lwres_gnbaresponse_parse()</CODE > all return <SPAN @@ -341,9 +341,9 @@ CLASS="ERRORCODE" >LWRES_R_UNEXPECTEDEND</SPAN > is returned if the available space in the buffer -<TT +<VAR CLASS="VARNAME" ->b</TT +>b</VAR > is too small to accommodate the packet header or the <SPAN @@ -356,14 +356,14 @@ CLASS="TYPE" >lwres_gnbaresponse_t</SPAN > structures. -<TT +<CODE CLASS="FUNCTION" ->lwres_gnbarequest_parse()</TT +>lwres_gnbarequest_parse()</CODE > and -<TT +<CODE CLASS="FUNCTION" ->lwres_gnbaresponse_parse()</TT +>lwres_gnbaresponse_parse()</CODE > will return <SPAN @@ -377,11 +377,9 @@ CLASS="ERRORCODE" >LWRES_R_FAILURE</SPAN > if -<TT +<CODE CLASS="STRUCTFIELD" -><I ->pktflags</I -></TT +>pktflags</CODE > in the packet header structure <SPAN diff --git a/dist/bind/lib/lwres/man/lwres_hstrerror.html b/dist/bind/lib/lwres/man/lwres_hstrerror.html index 3de9591a566..df3dd3f2561 100644 --- a/dist/bind/lib/lwres/man/lwres_hstrerror.html +++ b/dist/bind/lib/lwres/man/lwres_hstrerror.html @@ -15,16 +15,16 @@ - PERFORMANCE OF THIS SOFTWARE. --> -<!-- Id: lwres_hstrerror.html,v 1.5.2.1.4.1 2004/03/06 08:15:41 marka Exp --> +<!-- 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.73 -"></HEAD +CONTENT="Modular DocBook HTML Stylesheet Version 1.7"></HEAD ><BODY CLASS="REFENTRY" BGCOLOR="#FFFFFF" @@ -35,8 +35,8 @@ ALINK="#0000FF" ><H1 ><A NAME="AEN1" ->lwres_hstrerror</A -></H1 +></A +>lwres_hstrerror</H1 ><DIV CLASS="REFNAMEDIV" ><A @@ -54,11 +54,11 @@ NAME="AEN12" >Synopsis</H2 ><DIV CLASS="FUNCSYNOPSIS" +><P +></P ><A NAME="AEN13" ></A -><P -></P ><PRE CLASS="FUNCSYNOPSISINFO" >#include <lwres/netdb.h></PRE @@ -90,37 +90,33 @@ NAME="AEN23" ><H2 >DESCRIPTION</H2 ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_herror()</TT +>lwres_herror()</CODE > prints the string -<TT +<VAR CLASS="PARAMETER" -><I ->s</I -></TT +>s</VAR > on <SPAN CLASS="TYPE" >stderr</SPAN > followed by the string -generated by <TT +generated by <CODE CLASS="FUNCTION" ->lwres_hstrerror()</TT +>lwres_hstrerror()</CODE > for the error code -stored in the global variable <TT +stored in the global variable <CODE CLASS="CONSTANT" ->lwres_h_errno</TT +>lwres_h_errno</CODE >.</P ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_hstrerror()</TT +>lwres_hstrerror()</CODE > returns an appropriate string -for the error code gievn by <TT +for the error code gievn by <VAR CLASS="PARAMETER" -><I ->err</I -></TT +>err</VAR >. The values of the error codes and messages are as follows: @@ -205,14 +201,14 @@ NAME="AEN65" CLASS="ERRORNAME" >Unknown resolver error</SPAN > is returned by -<TT +<CODE CLASS="FUNCTION" ->lwres_hstrerror()</TT +>lwres_hstrerror()</CODE > when the value of -<TT +<CODE CLASS="CONSTANT" ->lwres_h_errno</TT +>lwres_h_errno</CODE > is not a valid error code.</P ></DIV diff --git a/dist/bind/lib/lwres/man/lwres_inetntop.html b/dist/bind/lib/lwres/man/lwres_inetntop.html index defddb0a9a4..196d87dffd1 100644 --- a/dist/bind/lib/lwres/man/lwres_inetntop.html +++ b/dist/bind/lib/lwres/man/lwres_inetntop.html @@ -15,16 +15,16 @@ - PERFORMANCE OF THIS SOFTWARE. --> -<!-- Id: lwres_inetntop.html,v 1.5.2.1.4.1 2004/03/06 08:15:41 marka Exp --> +<!-- 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.73 -"></HEAD +CONTENT="Modular DocBook HTML Stylesheet Version 1.7"></HEAD ><BODY CLASS="REFENTRY" BGCOLOR="#FFFFFF" @@ -35,8 +35,8 @@ ALINK="#0000FF" ><H1 ><A NAME="AEN1" ->lwres_inetntop</A -></H1 +></A +>lwres_inetntop</H1 ><DIV CLASS="REFNAMEDIV" ><A @@ -54,11 +54,11 @@ NAME="AEN11" >Synopsis</H2 ><DIV CLASS="FUNCSYNOPSIS" +><P +></P ><A NAME="AEN12" ></A -><P -></P ><PRE CLASS="FUNCSYNOPSISINFO" >#include <lwres/net.h></PRE @@ -82,37 +82,29 @@ NAME="AEN21" ><H2 >DESCRIPTION</H2 ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_net_ntop()</TT +>lwres_net_ntop()</CODE > converts an IP address of -protocol family <TT +protocol family <VAR CLASS="PARAMETER" -><I ->af</I -></TT +>af</VAR > — IPv4 or IPv6 — -at location <TT +at location <VAR CLASS="PARAMETER" -><I ->src</I -></TT +>src</VAR > 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 <TT +>The generated string is copied to <VAR CLASS="PARAMETER" -><I ->dst</I -></TT +>dst</VAR > provided -<TT +<VAR CLASS="PARAMETER" -><I ->size</I -></TT +>size</VAR > indicates it is long enough to store the ASCII representation of the address.</P ></DIV @@ -124,33 +116,29 @@ NAME="AEN30" ><H2 >RETURN VALUES</H2 ><P ->If successful, the function returns <TT +>If successful, the function returns <VAR CLASS="PARAMETER" -><I ->dst</I -></TT +>dst</VAR >: a pointer to a string containing the presentation format of the -address. <TT +address. <CODE CLASS="FUNCTION" ->lwres_net_ntop()</TT +>lwres_net_ntop()</CODE > returns <SPAN CLASS="TYPE" >NULL</SPAN > and sets the global variable -<TT +<CODE CLASS="CONSTANT" ->errno</TT +>errno</CODE > to <SPAN CLASS="ERRORCODE" >EAFNOSUPPORT</SPAN > if -the protocol family given in <TT +the protocol family given in <VAR CLASS="PARAMETER" -><I ->af</I -></TT +>af</VAR > is not supported.</P ></DIV diff --git a/dist/bind/lib/lwres/man/lwres_noop.html b/dist/bind/lib/lwres/man/lwres_noop.html index cb1eca822a3..0c239e7ce1b 100644 --- a/dist/bind/lib/lwres/man/lwres_noop.html +++ b/dist/bind/lib/lwres/man/lwres_noop.html @@ -15,16 +15,16 @@ - PERFORMANCE OF THIS SOFTWARE. --> -<!-- Id: lwres_noop.html,v 1.7.2.1.4.1 2004/03/06 08:15:41 marka Exp --> +<!-- 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.73 -"></HEAD +CONTENT="Modular DocBook HTML Stylesheet Version 1.7"></HEAD ><BODY CLASS="REFENTRY" BGCOLOR="#FFFFFF" @@ -35,8 +35,8 @@ ALINK="#0000FF" ><H1 ><A NAME="AEN1" ->lwres_noop</A -></H1 +></A +>lwres_noop</H1 ><DIV CLASS="REFNAMEDIV" ><A @@ -54,11 +54,11 @@ NAME="AEN16" >Synopsis</H2 ><DIV CLASS="FUNCSYNOPSIS" +><P +></P ><A NAME="AEN17" ></A -><P -></P ><PRE CLASS="FUNCSYNOPSISINFO" >#include <lwres/lwres.h></PRE @@ -176,43 +176,33 @@ 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 -><TT +><CODE CLASS="FUNCTION" ->lwres_nooprequest_render()</TT +>lwres_nooprequest_render()</CODE > uses resolver -context <TT +context <VAR CLASS="PARAMETER" -><I ->ctx</I -></TT +>ctx</VAR > to convert no-op request structure -<TT +<VAR CLASS="PARAMETER" -><I ->req</I -></TT +>req</VAR > to canonical format. The packet header -structure <TT +structure <VAR CLASS="PARAMETER" -><I ->pkt</I -></TT +>pkt</VAR > is initialised and transferred to -buffer <TT +buffer <VAR CLASS="PARAMETER" -><I ->b</I -></TT +>b</VAR >. The contents of -<TT +<VAR CLASS="PARAMETER" -><I ->*req</I -></TT +>*req</VAR > are then appended to the buffer in -canonical format. <TT +canonical format. <CODE CLASS="FUNCTION" ->lwres_noopresponse_render()</TT +>lwres_noopresponse_render()</CODE > performs the same task, except it converts a no-op response structure <SPAN @@ -221,68 +211,58 @@ CLASS="TYPE" > to the lightweight resolver's canonical format.</P ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_nooprequest_parse()</TT +>lwres_nooprequest_parse()</CODE > uses context -<TT +<VAR CLASS="PARAMETER" -><I ->ctx</I -></TT +>ctx</VAR > to convert the contents of packet -<TT +<VAR CLASS="PARAMETER" -><I ->pkt</I -></TT +>pkt</VAR > to a <SPAN CLASS="TYPE" >lwres_nooprequest_t</SPAN > -structure. Buffer <TT +structure. Buffer <VAR CLASS="PARAMETER" -><I ->b</I -></TT +>b</VAR > 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 -<TT +<VAR CLASS="PARAMETER" -><I ->*structp</I -></TT +>*structp</VAR >. -<TT +<CODE CLASS="FUNCTION" ->lwres_noopresponse_parse()</TT +>lwres_noopresponse_parse()</CODE > offers the same -semantics as <TT +semantics as <CODE CLASS="FUNCTION" ->lwres_nooprequest_parse()</TT +>lwres_nooprequest_parse()</CODE > except it yields a <SPAN CLASS="TYPE" >lwres_noopresponse_t</SPAN > structure.</P ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_noopresponse_free()</TT +>lwres_noopresponse_free()</CODE > and -<TT +<CODE CLASS="FUNCTION" ->lwres_nooprequest_free()</TT +>lwres_nooprequest_free()</CODE > release the memory in -resolver context <TT +resolver context <VAR CLASS="PARAMETER" -><I ->ctx</I -></TT +>ctx</VAR > that was allocated to the <SPAN CLASS="TYPE" @@ -291,11 +271,9 @@ CLASS="TYPE" CLASS="TYPE" >lwres_nooprequest_t</SPAN > -structures referenced via <TT +structures referenced via <VAR CLASS="PARAMETER" -><I ->structp</I -></TT +>structp</VAR >.</P ></DIV ><DIV @@ -307,23 +285,23 @@ NAME="AEN95" >RETURN VALUES</H2 ><P >The no-op opcode functions -<TT +<CODE CLASS="FUNCTION" ->lwres_nooprequest_render()</TT +>lwres_nooprequest_render()</CODE >, -<TT +<CODE CLASS="FUNCTION" ->lwres_noopresponse_render()</TT +>lwres_noopresponse_render()</CODE > -<TT +<CODE CLASS="FUNCTION" ->lwres_nooprequest_parse()</TT +>lwres_nooprequest_parse()</CODE > and -<TT +<CODE CLASS="FUNCTION" ->lwres_noopresponse_parse()</TT +>lwres_noopresponse_parse()</CODE > all return <SPAN @@ -342,11 +320,9 @@ CLASS="ERRORCODE" >LWRES_R_UNEXPECTEDEND</SPAN > is returned if the available space in the buffer -<TT +<VAR CLASS="PARAMETER" -><I ->b</I -></TT +>b</VAR > is too small to accommodate the packet header or the <SPAN @@ -359,14 +335,14 @@ CLASS="TYPE" >lwres_noopresponse_t</SPAN > structures. -<TT +<CODE CLASS="FUNCTION" ->lwres_nooprequest_parse()</TT +>lwres_nooprequest_parse()</CODE > and -<TT +<CODE CLASS="FUNCTION" ->lwres_noopresponse_parse()</TT +>lwres_noopresponse_parse()</CODE > will return <SPAN @@ -380,9 +356,9 @@ CLASS="ERRORCODE" >LWRES_R_FAILURE</SPAN > if -<TT +<CODE CLASS="CONSTANT" ->pktflags</TT +>pktflags</CODE > in the packet header structure <SPAN diff --git a/dist/bind/lib/lwres/man/lwres_packet.html b/dist/bind/lib/lwres/man/lwres_packet.html index 42c633cf6fb..73511ea31f9 100644 --- a/dist/bind/lib/lwres/man/lwres_packet.html +++ b/dist/bind/lib/lwres/man/lwres_packet.html @@ -15,16 +15,16 @@ - PERFORMANCE OF THIS SOFTWARE. --> -<!-- Id: lwres_packet.html,v 1.8.2.1.4.1 2004/03/06 08:15:42 marka Exp --> +<!-- 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.73 -"></HEAD +CONTENT="Modular DocBook HTML Stylesheet Version 1.7"></HEAD ><BODY CLASS="REFENTRY" BGCOLOR="#FFFFFF" @@ -35,8 +35,8 @@ ALINK="#0000FF" ><H1 ><A NAME="AEN1" ->lwres_packet</A -></H1 +></A +>lwres_packet</H1 ><DIV CLASS="REFNAMEDIV" ><A @@ -54,11 +54,11 @@ NAME="AEN12" >Synopsis</H2 ><DIV CLASS="FUNCSYNOPSIS" +><P +></P ><A NAME="AEN13" ></A -><P -></P ><PRE CLASS="FUNCSYNOPSISINFO" >#include <lwres/lwpacket.h></PRE @@ -125,9 +125,9 @@ struct lwres_lwpacket { CLASS="VARIABLELIST" ><DL ><DT -><TT +><CODE CLASS="CONSTANT" ->length</TT +>length</CODE ></DT ><DD ><P @@ -136,9 +136,9 @@ This field is filled in by the lwres_gabn_*() and lwres_gnba_*() calls.</P ></DD ><DT -><TT +><CODE CLASS="CONSTANT" ->version</TT +>version</CODE ></DT ><DD ><P @@ -152,9 +152,9 @@ This field is filled in by the lwres_gabn_*() and lwres_gnba_*() calls.</P ></DD ><DT -><TT +><CODE CLASS="CONSTANT" ->pktflags</TT +>pktflags</CODE ></DT ><DD ><P @@ -166,9 +166,9 @@ LWRES_LWPACKETFLAG_RESPONSE bit, which is set by the library in the lwres_gabn_*() and lwres_gnba_*() calls.</P ></DD ><DT -><TT +><CODE CLASS="CONSTANT" ->serial</TT +>serial</CODE ></DT ><DD ><P @@ -179,9 +179,9 @@ may be dropped. This field must be set by the application.</P ></DD ><DT -><TT +><CODE CLASS="CONSTANT" ->opcode</TT +>opcode</CODE ></DT ><DD ><P @@ -193,9 +193,9 @@ This field is filled in by the lwres_gabn_*() and lwres_gnba_*() calls.</P ></DD ><DT -><TT +><CODE CLASS="CONSTANT" ->result</TT +>result</CODE ></DT ><DD ><P @@ -206,9 +206,9 @@ This field is filled in by the lwres_gabn_*() and lwres_gnba_*() calls.</P ></DD ><DT -><TT +><CODE CLASS="CONSTANT" ->recvlength</TT +>recvlength</CODE ></DT ><DD ><P @@ -218,9 +218,9 @@ is too large for replies. This field is supplied by the application.</P ></DD ><DT -><TT +><CODE CLASS="CONSTANT" ->authtype</TT +>authtype</CODE ></DT ><DD ><P @@ -230,9 +230,9 @@ and types between 0x0000 and 0x0fff are reserved for library use. Currently these are not used and must be zero.</P ></DD ><DT -><TT +><CODE CLASS="CONSTANT" ->authlen</TT +>authlen</CODE ></DT ><DD ><P @@ -250,9 +250,9 @@ Since packet authentication is currently not used, this must be zero.</P CLASS="VARIABLELIST" ><DL ><DT -><TT +><CODE CLASS="CONSTANT" ->NOOP</TT +>NOOP</CODE ></DT ><DD ><P @@ -260,9 +260,9 @@ CLASS="CONSTANT" The lwres_noop_*() functions should be used for this type.</P ></DD ><DT -><TT +><CODE CLASS="CONSTANT" ->GETADDRSBYNAME</TT +>GETADDRSBYNAME</CODE ></DT ><DD ><P @@ -270,9 +270,9 @@ CLASS="CONSTANT" The lwres_gabn_*() functions should be used for this type.</P ></DD ><DT -><TT +><CODE CLASS="CONSTANT" ->GETNAMEBYADDR</TT +>GETNAMEBYADDR</CODE ></DT ><DD ><P @@ -283,50 +283,40 @@ The lwres_gnba_*() functions should be used for this type.</P ></DIV ></P ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_lwpacket_renderheader()</TT +>lwres_lwpacket_renderheader()</CODE > transfers the contents of lightweight resolver packet structure <SPAN CLASS="TYPE" >lwres_lwpacket_t</SPAN -> <TT +> <VAR CLASS="PARAMETER" -><I ->*pkt</I -></TT +>*pkt</VAR > in network byte order to the lightweight resolver buffer, -<TT +<VAR CLASS="PARAMETER" -><I ->*b</I -></TT +>*b</VAR >.</P ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_lwpacket_parseheader()</TT +>lwres_lwpacket_parseheader()</CODE > performs the converse operation. It transfers data in network byte order from -buffer <TT +buffer <VAR CLASS="PARAMETER" -><I ->*b</I -></TT +>*b</VAR > to resolver packet -<TT +<VAR CLASS="PARAMETER" -><I ->*pkt</I -></TT +>*pkt</VAR >. The contents of the buffer -<TT +<VAR CLASS="PARAMETER" -><I ->b</I -></TT +>b</VAR > should correspond to a <SPAN CLASS="TYPE" @@ -342,29 +332,25 @@ NAME="AEN107" >RETURN VALUES</H2 ><P > Successful calls to -<TT +<CODE CLASS="FUNCTION" ->lwres_lwpacket_renderheader()</TT +>lwres_lwpacket_renderheader()</CODE > and -<TT +<CODE CLASS="FUNCTION" ->lwres_lwpacket_parseheader()</TT +>lwres_lwpacket_parseheader()</CODE > return <SPAN CLASS="ERRORCODE" >LWRES_R_SUCCESS</SPAN >. If there is insufficient -space to copy data between the buffer <TT +space to copy data between the buffer <VAR CLASS="PARAMETER" -><I ->*b</I -></TT +>*b</VAR > and -lightweight resolver packet <TT +lightweight resolver packet <VAR CLASS="PARAMETER" -><I ->*pkt</I -></TT +>*pkt</VAR > both functions return <SPAN CLASS="ERRORCODE" diff --git a/dist/bind/lib/lwres/man/lwres_resutil.html b/dist/bind/lib/lwres/man/lwres_resutil.html index ce23f90f63c..f6bf3b1c903 100644 --- a/dist/bind/lib/lwres/man/lwres_resutil.html +++ b/dist/bind/lib/lwres/man/lwres_resutil.html @@ -15,16 +15,16 @@ - PERFORMANCE OF THIS SOFTWARE. --> -<!-- Id: lwres_resutil.html,v 1.8.2.1.4.1 2004/03/06 08:15:42 marka Exp --> +<!-- 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.73 -"></HEAD +CONTENT="Modular DocBook HTML Stylesheet Version 1.7"></HEAD ><BODY CLASS="REFENTRY" BGCOLOR="#FFFFFF" @@ -35,8 +35,8 @@ ALINK="#0000FF" ><H1 ><A NAME="AEN1" ->lwres_resutil</A -></H1 +></A +>lwres_resutil</H1 ><DIV CLASS="REFNAMEDIV" ><A @@ -54,11 +54,11 @@ NAME="AEN14" >Synopsis</H2 ><DIV CLASS="FUNCSYNOPSIS" +><P +></P ><A NAME="AEN15" ></A -><P -></P ><PRE CLASS="FUNCSYNOPSISINFO" >#include <lwres/lwres.h></PRE @@ -106,32 +106,26 @@ NAME="AEN43" ><H2 >DESCRIPTION</H2 ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_string_parse()</TT +>lwres_string_parse()</CODE > retrieves a DNS-encoded string starting the current pointer of lightweight resolver buffer -<TT +<VAR CLASS="PARAMETER" -><I ->b</I -></TT ->: i.e. <TT +>b</VAR +>: i.e. <CODE CLASS="CONSTANT" ->b->current</TT +>b->current</CODE >. When the function returns, the address of the first byte of the -encoded string is returned via <TT +encoded string is returned via <VAR CLASS="PARAMETER" -><I ->*c</I -></TT +>*c</VAR > and the -length of that string is given by <TT +length of that string is given by <VAR CLASS="PARAMETER" -><I ->*len</I -></TT +>*len</VAR >. The buffer's current pointer is advanced to point at the character following the string length, the encoded string, and the trailing @@ -140,45 +134,43 @@ CLASS="TYPE" >NULL</SPAN > character.</P ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_addr_parse()</TT +>lwres_addr_parse()</CODE > extracts an address from the -buffer <TT +buffer <VAR CLASS="PARAMETER" -><I ->b</I -></TT +>b</VAR >. The buffer's current pointer -<TT +<CODE CLASS="CONSTANT" ->b->current</TT +>b->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 -<TT +<CODE CLASS="CONSTANT" ->addr->address</TT +>addr->address</CODE > and -<TT +<CODE CLASS="CONSTANT" ->addr->length</TT +>addr->length</CODE > indicates the size in bytes of -the address that was copied. <TT +the address that was copied. <CODE CLASS="CONSTANT" ->b->current</TT +>b->current</CODE > is advanced to point at the next byte of available data in the buffer following the encoded address.</P ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_getaddrsbyname()</TT +>lwres_getaddrsbyname()</CODE > and -<TT +<CODE CLASS="FUNCTION" ->lwres_getnamebyaddr()</TT +>lwres_getnamebyaddr()</CODE > use the <SPAN @@ -213,27 +205,21 @@ CLASS="REFENTRYTITLE" functions.</P ><P >The lightweight resolver uses -<TT +<CODE CLASS="FUNCTION" ->lwres_getaddrsbyname()</TT +>lwres_getaddrsbyname()</CODE > to perform foward lookups. -Hostname <TT +Hostname <VAR CLASS="PARAMETER" -><I ->name</I -></TT +>name</VAR > is looked up using the resolver -context <TT +context <VAR CLASS="PARAMETER" -><I ->ctx</I -></TT +>ctx</VAR > for memory allocation. -<TT +<VAR CLASS="PARAMETER" -><I ->addrtypes</I -></TT +>addrtypes</VAR > is a bitmask indicating which type of addresses are to be looked up. Current values for this bitmask are <SPAN @@ -244,29 +230,23 @@ CLASS="TYPE" CLASS="TYPE" >LWRES_ADDRTYPE_V6</SPAN > for IPv6 addresses. Results of the -lookup are returned in <TT +lookup are returned in <VAR CLASS="PARAMETER" -><I ->*structp</I -></TT +>*structp</VAR >.</P ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_getnamebyaddr()</TT +>lwres_getnamebyaddr()</CODE > performs reverse lookups. -Resolver context <TT +Resolver context <VAR CLASS="PARAMETER" -><I ->ctx</I -></TT +>ctx</VAR > is used for memory allocation. The address type is indicated by -<TT +<VAR CLASS="PARAMETER" -><I ->addrtype</I -></TT +>addrtype</VAR >: <SPAN CLASS="TYPE" >LWRES_ADDRTYPE_V4</SPAN @@ -275,23 +255,17 @@ CLASS="TYPE" CLASS="TYPE" >LWRES_ADDRTYPE_V6</SPAN >. The address to be looked up is given -by <TT +by <VAR CLASS="PARAMETER" -><I ->addr</I -></TT +>addr</VAR > and its length is -<TT +<VAR CLASS="PARAMETER" -><I ->addrlen</I -></TT +>addrlen</VAR > bytes. The result of the function call -is made available through <TT +is made available through <VAR CLASS="PARAMETER" -><I ->*structp</I -></TT +>*structp</VAR >.</P ></DIV ><DIV @@ -303,14 +277,14 @@ NAME="AEN84" >RETURN VALUES</H2 ><P >Successful calls to -<TT +<CODE CLASS="FUNCTION" ->lwres_string_parse()</TT +>lwres_string_parse()</CODE > and -<TT +<CODE CLASS="FUNCTION" ->lwres_addr_parse()</TT +>lwres_addr_parse()</CODE > return <SPAN @@ -330,9 +304,9 @@ CLASS="ERRORCODE" if the buffer has less space than expected for the components of the encoded string or address.</P ><P -><TT +><CODE CLASS="FUNCTION" ->lwres_getaddrsbyname()</TT +>lwres_getaddrsbyname()</CODE > returns <SPAN @@ -345,11 +319,9 @@ CLASS="ERRORCODE" >LWRES_R_NOTFOUND</SPAN > if the hostname -<TT +<VAR CLASS="PARAMETER" -><I ->name</I -></TT +>name</VAR > could not be found.</P ><P @@ -358,20 +330,20 @@ CLASS="ERRORCODE" >LWRES_R_SUCCESS</SPAN > is returned by a successful call to -<TT +<CODE CLASS="FUNCTION" ->lwres_getnamebyaddr()</TT +>lwres_getnamebyaddr()</CODE >.</P ><P >Both -<TT +<CODE CLASS="FUNCTION" ->lwres_getaddrsbyname()</TT +>lwres_getaddrsbyname()</CODE > and -<TT +<CODE CLASS="FUNCTION" ->lwres_getnamebyaddr()</TT +>lwres_getnamebyaddr()</CODE > return <SPAN diff --git a/dist/bind/lib/lwres/print.c b/dist/bind/lib/lwres/print.c new file mode 100644 index 00000000000..f5efdc195d1 --- /dev/null +++ b/dist/bind/lib/lwres/print.c @@ -0,0 +1,555 @@ +/* $NetBSD: print.c,v 1.1.1.1 2004/11/06 23:56:01 christos Exp $ */ + +/* + * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 1999-2001, 2003 Internet Software Consortium. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +/* Id: print.c,v 1.2.4.1 2004/08/28 06:25:25 marka Exp */ + +#include <config.h> + +#include <ctype.h> +#include <stdio.h> /* for sprintf */ + +#define LWRES__PRINT_SOURCE /* Used to get the lwres_print_* prototypes. */ + +#include <stdlib.h> + +#include "assert_p.h" +#include "print_p.h" + +int +lwres__print_sprintf(char *str, const char *format, ...) { + va_list ap; + + va_start(ap, format); + vsprintf(str, format, ap); + va_end(ap); + return (strlen(str)); +} + +/* + * Return length of string that would have been written if not truncated. + */ + +int +lwres__print_snprintf(char *str, size_t size, const char *format, ...) { + va_list ap; + int ret; + + va_start(ap, format); + ret = vsnprintf(str, size, format, ap); + va_end(ap); + return (ret); + +} + +/* + * Return length of string that would have been written if not truncated. + */ + +int +lwres__print_vsnprintf(char *str, size_t size, const char *format, va_list ap) { + int h; + int l; + int q; + int alt; + int zero; + int left; + int plus; + int space; + int neg; + long long tmpi; + unsigned long long tmpui; + unsigned long width; + unsigned long precision; + unsigned int length; + char buf[1024]; + char c; + void *v; + char *save = str; + const char *cp; + const char *head; + int count = 0; + int pad; + int zeropad; + int dot; + double dbl; +#ifdef HAVE_LONG_DOUBLE + long double ldbl; +#endif + char fmt[32]; + + INSIST(str != NULL); + INSIST(format != NULL); + + while (*format != '\0') { + if (*format != '%') { + if (size > 1) { + *str++ = *format; + size--; + } + count++; + format++; + continue; + } + format++; + + /* + * Reset flags. + */ + dot = neg = space = plus = left = zero = alt = h = l = q = 0; + width = precision = 0; + head = ""; + length = pad = zeropad = 0; + + do { + if (*format == '#') { + alt = 1; + format++; + } else if (*format == '-') { + left = 1; + zero = 0; + format++; + } else if (*format == ' ') { + if (!plus) + space = 1; + format++; + } else if (*format == '+') { + plus = 1; + space = 0; + format++; + } else if (*format == '0') { + if (!left) + zero = 1; + format++; + } else + break; + } while (1); + + /* + * Width. + */ + if (*format == '*') { + width = va_arg(ap, int); + format++; + } else if (isdigit((unsigned char)*format)) { + char *e; + width = strtoul(format, &e, 10); + format = e; + } + + /* + * Precision. + */ + if (*format == '.') { + format++; + dot = 1; + if (*format == '*') { + precision = va_arg(ap, int); + format++; + } else if (isdigit((unsigned char)*format)) { + char *e; + precision = strtoul(format, &e, 10); + format = e; + } + } + + switch (*format) { + case '\0': + continue; + case '%': + if (size > 1) { + *str++ = *format; + size--; + } + count++; + break; + case 'q': + q = 1; + format++; + goto doint; + case 'h': + h = 1; + format++; + goto doint; + case 'l': + l = 1; + format++; + if (*format == 'l') { + q = 1; + format++; + } + goto doint; + case 'n': + case 'i': + case 'd': + case 'o': + case 'u': + case 'x': + case 'X': + doint: + if (precision != 0) + zero = 0; + switch (*format) { + case 'n': + if (h) { + short int *p; + p = va_arg(ap, short *); + REQUIRE(p != NULL); + *p = str - save; + } else if (l) { + long int *p; + p = va_arg(ap, long *); + REQUIRE(p != NULL); + *p = str - save; + } else { + int *p; + p = va_arg(ap, int *); + REQUIRE(p != NULL); + *p = str - save; + } + break; + case 'i': + case 'd': + if (q) + tmpi = va_arg(ap, long long int); + else if (l) + tmpi = va_arg(ap, long int); + else + tmpi = va_arg(ap, int); + if (tmpi < 0) { + head = "-"; + tmpui = -tmpi; + } else { + if (plus) + head = "+"; + else if (space) + head = " "; + else + head = ""; + tmpui = tmpi; + } + sprintf(buf, "%llu", + tmpui); + goto printint; + case 'o': + if (q) + tmpui = va_arg(ap, + unsigned long long int); + else if (l) + tmpui = va_arg(ap, long int); + else + tmpui = va_arg(ap, int); + sprintf(buf, + alt ? "%#llo" : "%llo", tmpui); + goto printint; + case 'u': + if (q) + tmpui = va_arg(ap, + unsigned long long int); + else if (l) + tmpui = va_arg(ap, unsigned long int); + else + tmpui = va_arg(ap, unsigned int); + sprintf(buf, "%llu", tmpui); + goto printint; + case 'x': + if (q) + tmpui = va_arg(ap, + unsigned long long int); + else if (l) + tmpui = va_arg(ap, unsigned long int); + else + tmpui = va_arg(ap, unsigned int); + if (alt) { + head = "0x"; + if (precision > 2) + precision -= 2; + } + sprintf(buf, "%llx", tmpui); + goto printint; + case 'X': + if (q) + tmpui = va_arg(ap, + unsigned long long int); + else if (l) + tmpui = va_arg(ap, unsigned long int); + else + tmpui = va_arg(ap, unsigned int); + if (alt) { + head = "0X"; + if (precision > 2) + precision -= 2; + } + sprintf(buf, "%llX", tmpui); + goto printint; + printint: + if (precision != 0 || width != 0) { + length = strlen(buf); + if (length < precision) + zeropad = precision - length; + else if (length < width && zero) + zeropad = width - length; + if (width != 0) { + pad = width - length - + zeropad - strlen(head); + if (pad < 0) + pad = 0; + } + } + count += strlen(head) + strlen(buf) + pad + + zeropad; + if (!left) { + while (pad > 0 && size > 1) { + *str++ = ' '; + size--; + pad--; + } + } + cp = head; + while (*cp != '\0' && size > 1) { + *str++ = *cp++; + size--; + } + while (zeropad > 0 && size > 1) { + *str++ = '0'; + size--; + zeropad--; + } + cp = buf; + while (*cp != '\0' && size > 1) { + *str++ = *cp++; + size--; + } + while (pad > 0 && size > 1) { + *str++ = ' '; + size--; + pad--; + } + break; + default: + break; + } + break; + case 's': + cp = va_arg(ap, char *); + REQUIRE(cp != NULL); + + if (precision != 0) { + /* + * cp need not be NULL terminated. + */ + const char *tp; + unsigned long n; + + n = precision; + tp = cp; + while (n != 0 && *tp != '\0') + n--, tp++; + length = precision - n; + } else { + length = strlen(cp); + } + if (width != 0) { + pad = width - length; + if (pad < 0) + pad = 0; + } + count += pad + length; + if (!left) + while (pad > 0 && size > 1) { + *str++ = ' '; + size--; + pad--; + } + if (precision != 0) + while (precision > 0 && *cp != '\0' && + size > 1) { + *str++ = *cp++; + size--; + precision--; + } + else + while (*cp != '\0' && size > 1) { + *str++ = *cp++; + size--; + } + while (pad > 0 && size > 1) { + *str++ = ' '; + size--; + pad--; + } + break; + case 'c': + c = va_arg(ap, int); + if (width > 0) { + count += width; + width--; + if (left) { + *str++ = c; + size--; + } + while (width-- > 0 && size > 1) { + *str++ = ' '; + size--; + } + if (!left && size > 1) { + *str++ = c; + size--; + } + } else { + count++; + if (size > 1) { + *str++ = c; + size--; + } + } + break; + case 'p': + v = va_arg(ap, void *); + sprintf(buf, "%p", v); + length = strlen(buf); + if (precision > length) + zeropad = precision - length; + if (width > 0) { + pad = width - length - zeropad; + if (pad < 0) + pad = 0; + } + count += length + pad + zeropad; + if (!left) + while (pad > 0 && size > 1) { + *str++ = ' '; + size--; + pad--; + } + cp = buf; + if (zeropad > 0 && buf[0] == '0' && + (buf[1] == 'x' || buf[1] == 'X')) { + if (size > 1) { + *str++ = *cp++; + size--; + } + if (size > 1) { + *str++ = *cp++; + size--; + } + while (zeropad > 0 && size > 1) { + *str++ = '0'; + size--; + zeropad--; + } + } + while (*cp != '\0' && size > 1) { + *str++ = *cp++; + size--; + } + while (pad > 0 && size > 1) { + *str++ = ' '; + size--; + pad--; + } + break; + case 'D': /*deprecated*/ + INSIST("use %ld instead of %D" == NULL); + case 'O': /*deprecated*/ + INSIST("use %lo instead of %O" == NULL); + case 'U': /*deprecated*/ + INSIST("use %lu instead of %U" == NULL); + + case 'L': +#ifdef HAVE_LONG_DOUBLE + l = 1; +#else + INSIST("long doubles are not supported" == NULL); +#endif + /*FALLTHROUGH*/ + case 'e': + case 'E': + case 'f': + case 'g': + case 'G': + if (!dot) + precision = 6; + /* + * IEEE floating point. + * MIN 2.2250738585072014E-308 + * MAX 1.7976931348623157E+308 + * VAX floating point has a smaller range than IEEE. + * + * precisions > 324 don't make much sense. + * if we cap the precision at 512 we will not + * overflow buf. + */ + if (precision > 512) + precision = 512; + sprintf(fmt, "%%%s%s.%lu%s%c", alt ? "#" : "", + plus ? "+" : space ? " " : "", + precision, l ? "L" : "", *format); + switch (*format) { + case 'e': + case 'E': + case 'f': + case 'g': + case 'G': +#ifdef HAVE_LONG_DOUBLE + if (l) { + ldbl = va_arg(ap, long double); + sprintf(buf, fmt, ldbl); + } else +#endif + { + dbl = va_arg(ap, double); + sprintf(buf, fmt, dbl); + } + length = strlen(buf); + if (width > 0) { + pad = width - length; + if (pad < 0) + pad = 0; + } + count += length + pad; + if (!left) + while (pad > 0 && size > 1) { + *str++ = ' '; + size--; + pad--; + } + cp = buf; + while (*cp != ' ' && size > 1) { + *str++ = *cp++; + size--; + } + while (pad > 0 && size > 1) { + *str++ = ' '; + size--; + pad--; + } + break; + default: + continue; + } + break; + default: + continue; + } + format++; + } + if (size > 0) + *str = '\0'; + return (count); +} diff --git a/dist/bind/lib/lwres/print_p.h b/dist/bind/lib/lwres/print_p.h new file mode 100644 index 00000000000..d43b72034e6 --- /dev/null +++ b/dist/bind/lib/lwres/print_p.h @@ -0,0 +1,88 @@ +/* $NetBSD: print_p.h,v 1.1.1.1 2004/11/06 23:56:01 christos Exp $ */ + +/* + * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 1999-2001, 2003 Internet Software Consortium. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +/* Id: print_p.h,v 1.2.4.1 2004/08/28 06:25:25 marka Exp */ + +#ifndef LWRES_PRINT_P_H +#define LWRES_PRINT_P_H 1 + +/*** + *** Imports + ***/ + +#include <lwres/lang.h> +#include <lwres/platform.h> + +/* + * This block allows lib/lwres/print.c to be cleanly compiled even if + * the platform does not need it. The standard Makefile will still + * not compile print.c or archive print.o, so this is just to make test + * compilation ("make print.o") easier. + */ +#if !defined(LWRES_PLATFORM_NEEDVSNPRINTF) && defined(LWRES__PRINT_SOURCE) +#define LWRES_PLATFORM_NEEDVSNPRINTF +#endif + +#if !defined(LWRES_PLATFORM_NEEDSPRINTF) && defined(LWRES__PRINT_SOURCE) +#define LWRES_PLATFORM_NEEDSPRINTF +#endif + +/*** + *** Macros. + ***/ + +#ifdef __GNUC__ +#define LWRES_FORMAT_PRINTF(fmt, args) \ + __attribute__((__format__(__printf__, fmt, args))) +#else +#define LWRES_FORMAT_PRINTF(fmt, args) +#endif + +/*** + *** Functions + ***/ + +#ifdef LWRES_PLATFORM_NEEDVSNPRINTF +#include <stdarg.h> +#include <stddef.h> +#endif + +LWRES_LANG_BEGINDECLS + +#ifdef LWRES_PLATFORM_NEEDVSNPRINTF +int +lwres__print_vsnprintf(char *str, size_t size, const char *format, va_list ap) + LWRES_FORMAT_PRINTF(3, 0); +#define vsnprintf lwres__print_vsnprintf + +int +lwres__print_snprintf(char *str, size_t size, const char *format, ...) + LWRES_FORMAT_PRINTF(3, 4); +#define snprintf lwres__print_snprintf +#endif /* LWRES_PLATFORM_NEEDVSNPRINTF */ + +#ifdef LWRES_PLATFORM_NEEDSPRINTF +int +lwres__print_sprintf(char *str, const char *format, ...) LWRES_FORMAT_PRINTF(2, 3); +#define sprintf lwres__print_sprintf +#endif + +LWRES_LANG_ENDDECLS + +#endif /* LWRES_PRINT_P_H */ diff --git a/dist/bind/lib/tests/Makefile.in b/dist/bind/lib/tests/Makefile.in index e8d8b96824f..0a17d0e77e5 100644 --- a/dist/bind/lib/tests/Makefile.in +++ b/dist/bind/lib/tests/Makefile.in @@ -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.14.12.6 2004/03/06 08:15:46 marka Exp +# Id: Makefile.in,v 1.14.12.7 2004/07/20 07:01:59 marka Exp srcdir = @srcdir@ VPATH = @srcdir@ @@ -46,7 +46,7 @@ libt_api.@SA@: ${OBJS} libt_api.la: ${OBJS} ${LIBTOOL_MODE_LINK} \ - ${CC} ${ALL_CFLAGS} -o libt_api.la -rpath ${libdir} \ + ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o libt_api.la -rpath ${libdir} \ ${OBJS} ${ISCLIBS} ${LIBS} -allow-undefined timestamp: libt_api.@A@ diff --git a/dist/bind/lib/tests/include/tests/t_api.h b/dist/bind/lib/tests/include/tests/t_api.h index d6c28352266..7b8f1004703 100644 --- a/dist/bind/lib/tests/include/tests/t_api.h +++ b/dist/bind/lib/tests/include/tests/t_api.h @@ -1,4 +1,4 @@ -/* $NetBSD: t_api.h,v 1.1.1.1 2004/05/17 23:45:12 christos Exp $ */ +/* $NetBSD: t_api.h,v 1.1.1.2 2004/11/06 23:56:02 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -17,7 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* Id: t_api.h,v 1.14.206.1 2004/03/06 08:15:47 marka Exp */ +/* Id: t_api.h,v 1.14.206.2 2004/06/21 06:58:02 marka Exp */ #ifndef TESTS_T_API_H #define TESTS_T_API_H 1 @@ -39,6 +39,7 @@ #define T_UNRESOLVED 0x3 #define T_UNSUPPORTED 0x4 #define T_UNTESTED 0x5 +#define T_THREADONLY 0x6 /* * diff --git a/dist/bind/lib/tests/t_api.c b/dist/bind/lib/tests/t_api.c index 1401f655cd5..ac1ff43933d 100644 --- a/dist/bind/lib/tests/t_api.c +++ b/dist/bind/lib/tests/t_api.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_api.c,v 1.1.1.1 2004/05/17 23:45:12 christos Exp $ */ +/* $NetBSD: t_api.c,v 1.1.1.2 2004/11/06 23:56:02 christos Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -17,7 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* Id: t_api.c,v 1.48.2.1.2.4 2004/03/08 09:05:13 marka Exp */ +/* Id: t_api.c,v 1.48.2.1.2.6 2004/08/28 06:25:27 marka Exp */ #include <config.h> @@ -35,6 +35,7 @@ #include <isc/boolean.h> #include <isc/commandline.h> +#include <isc/print.h> #include <isc/string.h> #include <dns/compress.h> @@ -392,6 +393,9 @@ t_result(int result) { case T_UNTESTED: p = "UNTESTED"; break; + case T_THREADONLY: + p = "THREADONLY"; + break; default: p = "UNKNOWN"; break; |
