Loading ares/CHANGES 0 → 100644 +9 −0 Original line number Diff line number Diff line - James Bursa made it run on RISC OS - Dominick Meglio made it run fine on NT4 - Duncan Wilcox made it fine on Mac OS X - Daniel Stenberg adjusted the windows port - liren at vivisimo.com made the initial windows port ares/Makefile.in 0 → 100644 +87 −0 Original line number Diff line number Diff line # $Id$ SHELL=/bin/sh INSTALL=@INSTALL@ RANLIB=@RANLIB@ VPATH=@srcdir@ srcdir=@srcdir@ top_srcdir=@top_srcdir@ prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ mandir=@mandir@ CC=@CC@ CPPFLAGS=@CPPFLAGS@ CFLAGS=@CFLAGS@ ${WARN_CFLAGS} ${ERROR_CFLAGS} DEFS=@DEFS@ LDFLAGS=@LDFLAGS@ LIBS=@LIBS@ ALL_CFLAGS=${CPPFLAGS} ${CFLAGS} ${DEFS} OBJS= ares__close_sockets.o ares__get_hostent.o ares__read_line.o \ ares_destroy.o ares_expand_name.o ares_fds.o ares_free_errmem.o \ ares_free_hostent.o ares_free_string.o ares_gethostbyaddr.o \ ares_gethostbyname.o ares_init.o ares_mkquery.o ares_parse_a_reply.o \ ares_parse_ptr_reply.o ares_process.o ares_query.o ares_search.o \ ares_send.o ares_strerror.o ares_timeout.o all: libares.a adig ahost libares.a: ${OBJS} ar cru $@ ${OBJS} ${RANLIB} $@ adig: adig.o libares.a ${CC} ${LDFLAGS} -o $@ adig.o libares.a ${LIBS} ahost: ahost.o libares.a ${CC} ${LDFLAGS} -o $@ ahost.o libares.a ${LIBS} ${OBJS}: ares.h ares_dns.h ares_private.h .c.o: ${CC} -c ${ALL_CFLAGS} $< check: install: ${top_srcdir}/mkinstalldirs ${DESTDIR}${libdir} ${top_srcdir}/mkinstalldirs ${DESTDIR}${includedir} ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man3 ${INSTALL} -m 644 libares.a ${DESTDIR}${libdir} ${RANLIB} ${DESTDIR}${libdir}/libares.a chmod u-w ${DESTDIR}${libdir}/libares.a ${INSTALL} -m 444 ${srcdir}/ares.h ${DESTDIR}${includedir} ${INSTALL} -m 444 ${srcdir}/ares_destroy.3 ${DESTDIR}${mandir}/man3 ${INSTALL} -m 444 ${srcdir}/ares_expand_name.3 ${DESTDIR}${mandir}/man3 ${INSTALL} -m 444 ${srcdir}/ares_fds.3 ${DESTDIR}${mandir}/man3 ${INSTALL} -m 444 ${srcdir}/ares_free_errmem.3 ${DESTDIR}${mandir}/man3 ${INSTALL} -m 444 ${srcdir}/ares_free_hostent.3 \ ${DESTDIR}${mandir}/man3 ${INSTALL} -m 444 ${srcdir}/ares_free_string.3 \ ${DESTDIR}${mandir}/man3 ${INSTALL} -m 444 ${srcdir}/ares_gethostbyaddr.3 \ ${DESTDIR}${mandir}/man3 ${INSTALL} -m 444 ${srcdir}/ares_gethostbyname.3 \ ${DESTDIR}${mandir}/man3 ${INSTALL} -m 444 ${srcdir}/ares_init.3 ${DESTDIR}${mandir}/man3 ${INSTALL} -m 444 ${srcdir}/ares_init_options.3 \ ${DESTDIR}${mandir}/man3 ${INSTALL} -m 444 ${srcdir}/ares_mkquery.3 ${DESTDIR}${mandir}/man3 ${INSTALL} -m 444 ${srcdir}/ares_parse_a_reply.3 \ ${DESTDIR}${mandir}/man3 ${INSTALL} -m 444 ${srcdir}/ares_parse_ptr_reply.3 \ ${DESTDIR}${mandir}/man3 ${INSTALL} -m 444 ${srcdir}/ares_process.3 ${DESTDIR}${mandir}/man3 ${INSTALL} -m 444 ${srcdir}/ares_query.3 ${DESTDIR}${mandir}/man3 ${INSTALL} -m 444 ${srcdir}/ares_search.3 ${DESTDIR}${mandir}/man3 ${INSTALL} -m 444 ${srcdir}/ares_send.3 ${DESTDIR}${mandir}/man3 ${INSTALL} -m 444 ${srcdir}/ares_strerror.3 ${DESTDIR}${mandir}/man3 ${INSTALL} -m 444 ${srcdir}/ares_timeout.3 ${DESTDIR}${mandir}/man3 clean: rm -f ${OBJS} libares.a adig.o adig ahost.o ahost distclean: clean rm -f config.cache config.log config.status Makefile ares/NEWS 0 → 100644 +18 −0 Original line number Diff line number Diff line Major changes in release 1.1.1: * ares should now compile as C++ code (no longer uses reserved word "class"). * Added SRV support to adig test program. * Fixed a few error handling bugs in query processing. Major changes in release 1.1.0: * Added ares_free_string() function so that memory can be freed in the same layer as it is allocated, a desirable feature in some environments. * A few of the ares_dns.h macros are fixed to use the proper bitwise operator. * Fixed a couple of fenceposts fixed in ares_expand_name()'s bounds-checking. * In process_timeouts(), extract query->next before calling next_server() and possibly freeing the query structure. * Casted arguments to ctype macros casted to unsigned char, since not all char values are valid inputs to those macros according to ANSI. ares/README 0 → 100644 +41 −0 Original line number Diff line number Diff line This is ares, an asynchronous resolver library. It is intended for applications which need to perform DNS queries without blocking, or need to perform multiple DNS queries in parallel. The primary examples of such applications are servers which communicate with multiple clients and programs with graphical user interfaces. This library implementation is not especially portable to crufty old systems like SunOS 4. It assumes a compiler which can handle ANSI C syntax, a system malloc which properly handles realloc(NULL, foo) and free(NULL), and a reasonably up-to-date <arpa/nameser.h>. I have attempted to preserve the externally visible behavior of the BIND resolver in nearly all respects. The API of the library is, of course, very different from the synchronous BIND API; instead of invoking a function like res_send() and getting a return value back indicating the number of bytes in the response, you invoke a function like ares_send() and give it a callback function to invoke when the response arrives. You then have to select() on the file descriptors indicated by ares_fds(), with a timeout given by ares_timeout(). You call ares_process() when select() returns. Some features are missing from the current version of ares, relative to the BIND resolver: * There is no IPV6 support. * There is no hostname verification. * There is no logging of unexpected events. * There is no debugging-oriented logging. * There is no YP support. libares requires an ANSI compiler to compile and use. To build the library, just run "./configure" and "make". To install it, run "make install". Run "./configure --help" to see a list of options you can provide to configure to change how the library builds. libares has no data files, so you can move the include file and library around freely without leaving behind any dependencies on old paths. Building the library will also build the "adig" program, a little toy for trying out the library. It doesn't get installed. libares is distributed at athena-dist.mit.edu:pub/ATHENA/ares. Please send bug reports and comments to ghudson@mit.edu. ares/aclocal.m4 0 → 100644 +358 −0 Original line number Diff line number Diff line dnl $Id$ dnl Copyright 1996 by the Massachusetts Institute of Technology. dnl dnl Permission to use, copy, modify, and distribute this dnl software and its documentation for any purpose and without dnl fee is hereby granted, provided that the above copyright dnl notice appear in all copies and that both that copyright dnl notice and this permission notice appear in supporting dnl documentation, and that the name of M.I.T. not be used in dnl advertising or publicity pertaining to distribution of the dnl software without specific, written prior permission. dnl M.I.T. makes no representations about the suitability of dnl this software for any purpose. It is provided "as is" dnl without express or implied warranty. dnl This file provides local macros for packages which use specific dnl external libraries. The public macros are: dnl dnl ATHENA_UTIL_COM_ERR dnl Generates error if com_err not found. dnl ATHENA_UTIL_SS dnl Generates error if ss not found. dnl ATHENA_REGEXP dnl Sets REGEX_LIBS if rx library used; ensures POSIX dnl regexp support. dnl ATHENA_MOTIF dnl Sets MOTIF_LIBS and defines HAVE_MOTIF if Motif used. dnl ATHENA_MOTIF_REQUIRED dnl Generates error if Motif not found. dnl ATHENA_AFS dnl Sets AFS_LIBS and defines HAVE_AFS if AFS used. Pass dnl in an argument giving the desired AFS libraries; dnl AFS_LIBS will be set to that value if AFS is found. dnl AFS_DIR will be set to the prefix given. dnl ATHENA_AFS_REQUIRED dnl Generates error if AFS libraries not found. AFS_DIR dnl will be set to the prefix given. dnl ATHENA_KRB4 dnl Sets KRB4_LIBS and defines HAVE_KRB4 if krb4 used. dnl ATHENA_KRB4_REQUIRED dnl Generates error if krb4 not found. Sets KRB4_LIBS dnl otherwise. (Special behavior because krb4 libraries dnl may be different if using krb4 compatibility libraries dnl from krb5.) dnl ATHENA_KRB5 dnl Sets KRB5_LIBS and defines HAVE_KRB5 if krb5 used. dnl ATHENA_KRB5_REQUIRED dnl Generates error if krb5 not found. dnl ATHENA_HESIOD dnl Sets HESIOD_LIBS and defines HAVE_HESIOD if Hesiod dnl used. dnl ATHENA_HESIOD_REQUIRED dnl Generates error if Hesiod not found. dnl ATHENA_ARES dnl Sets ARES_LIBS and defines HAVE_ARES if libares dnl used. dnl ATHENA_ARES_REQUIRED dnl Generates error if libares not found. dnl ATHENA_ZEPHYR dnl Sets ZEPHYR_LIBS and defines HAVE_ZEPHYR if zephyr dnl used. dnl ATHENA_ZEPHYR_REQUIRED dnl Generates error if zephyr not found. dnl dnl All of the macros may extend CPPFLAGS and LDFLAGS to let the dnl compiler find the requested libraries. Put ATHENA_UTIL_COM_ERR dnl and ATHENA_UTIL_SS before ATHENA_AFS or ATHENA_AFS_REQUIRED; there dnl is a com_err library in the AFS libraries which requires -lutil. dnl ----- com_err ----- AC_DEFUN(ATHENA_UTIL_COM_ERR, [AC_ARG_WITH(com_err, [ --with-com_err=PREFIX Specify location of com_err], [com_err="$withval"], [com_err=yes]) if test "$com_err" != no; then if test "$com_err" != yes; then CPPFLAGS="$CPPFLAGS -I$com_err/include" LDFLAGS="$LDFLAGS -L$com_err/lib" fi AC_CHECK_LIB(com_err, com_err, :, [AC_MSG_ERROR(com_err library not found)]) else AC_MSG_ERROR(This package requires com_err.) fi]) dnl ----- ss ----- AC_DEFUN(ATHENA_UTIL_SS, [AC_ARG_WITH(ss, [ --with-ss=PREFIX Specify location of ss (requires com_err)], [ss="$withval"], [ss=yes]) if test "$ss" != no; then if test "$ss" != yes; then CPPFLAGS="$CPPFLAGS -I$ss/include" LDFLAGS="$LDFLAGS -L$ss/lib" fi AC_CHECK_LIB(ss, ss_perror, :, [AC_MSG_ERROR(ss library not found)], -lcom_err) else AC_MSG_ERROR(This package requires ss.) fi]) dnl ----- Regular expressions ----- AC_DEFUN(ATHENA_REGEXP, [AC_ARG_WITH(regex, [ --with-regex=PREFIX Use installed regex library], [regex="$withval"], [regex=no]) if test "$regex" != no; then if test "$regex" != yes; then CPPFLAGS="$CPPFLAGS -I$regex/include" LDFLAGS="$LDFLAGS -L$regex/lib" fi AC_CHECK_LIB(regex, regcomp, REGEX_LIBS=-lregex, [AC_MSG_ERROR(regex library not found)]) else AC_CHECK_FUNC(regcomp, :, [AC_MSG_ERROR(can't find POSIX regexp support)]) fi AC_SUBST(REGEX_LIBS)]) dnl ----- Motif ----- AC_DEFUN(ATHENA_MOTIF_CHECK, [if test "$motif" != yes; then CPPFLAGS="$CPPFLAGS -I$motif/include" LDFLAGS="$LDFLAGS -L$motif/lib" fi AC_CHECK_LIB(Xm, XmStringFree, :, [AC_MSG_ERROR(Motif library not found)])]) AC_DEFUN(ATHENA_MOTIF, [AC_ARG_WITH(motif, [ --with-motif=PREFIX Use Motif], [motif="$withval"], [motif=no]) if test "$motif" != no; then ATHENA_MOTIF_CHECK MOTIF_LIBS=-lXm AC_DEFINE(HAVE_MOTIF) fi AC_SUBST(MOTIF_LIBS)]) AC_DEFUN(ATHENA_MOTIF_REQUIRED, [AC_ARG_WITH(motif, [ --with-motif=PREFIX Specify location of Motif], [motif="$withval"], [motif=yes]) if test "$motif" != no; then ATHENA_MOTIF_CHECK else AC_MSG_ERROR(This package requires Motif.) fi]) dnl ----- AFS ----- AC_DEFUN(ATHENA_AFS_CHECK, [AC_CHECK_FUNC(insque, :, AC_CHECK_LIB(compat, insque)) AC_CHECK_FUNC(gethostbyname, :, AC_CHECK_LIB(nsl, gethostbyname)) AC_CHECK_FUNC(socket, :, AC_CHECK_LIB(socket, socket)) if test "$afs" != yes; then CPPFLAGS="$CPPFLAGS -I$afs/include" LDFLAGS="$LDFLAGS -L$afs/lib -L$afs/lib/afs" fi AC_CHECK_LIB(sys, pioctl, :, [AC_MSG_ERROR(AFS libraries not found)], -lrx -llwp -lsys) AFS_DIR=$afs AC_SUBST(AFS_DIR)]) dnl Specify desired AFS libraries as a parameter. AC_DEFUN(ATHENA_AFS, [AC_ARG_WITH(afs, [ --with-afs=PREFIX Use AFS libraries], [afs="$withval"], [afs=no]) if test "$afs" != no; then ATHENA_AFS_CHECK AFS_LIBS=$1 AC_DEFINE(HAVE_AFS) fi AC_SUBST(AFS_LIBS)]) AC_DEFUN(ATHENA_AFS_REQUIRED, [AC_ARG_WITH(afs, [ --with-afs=PREFIX Specify location of AFS libraries], [afs="$withval"], [afs=/usr/afsws]) if test "$afs" != no; then ATHENA_AFS_CHECK else AC_MSG_ERROR(This package requires AFS libraries.) fi]) dnl ----- Kerberos 4 ----- AC_DEFUN(ATHENA_KRB4_CHECK, [AC_CHECK_FUNC(gethostbyname, :, AC_CHECK_LIB(nsl, gethostbyname)) AC_CHECK_FUNC(socket, :, AC_CHECK_LIB(socket, socket)) AC_CHECK_LIB(gen, compile) if test "$krb4" != yes; then CPPFLAGS="$CPPFLAGS -I$krb4/include" if test -d "$krb4/include/kerberosIV"; then CPPFLAGS="$CPPFLAGS -I$krb4/include/kerberosIV" fi LDFLAGS="$LDFLAGS -L$krb4/lib" fi AC_CHECK_LIB(krb4, krb_rd_req, [KRB4_LIBS="-lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err"], [AC_CHECK_LIB(krb, krb_rd_req, [KRB4_LIBS="-lkrb -ldes"], [AC_MSG_ERROR(Kerberos 4 libraries not found)], -ldes)], -ldes425 -lkrb5 -lk5crypto -lcom_err)]) AC_DEFUN(ATHENA_KRB4, [AC_ARG_WITH(krb4, [ --with-krb4=PREFIX Use Kerberos 4], [krb4="$withval"], [krb4=no]) if test "$krb4" != no; then ATHENA_KRB4_CHECK AC_DEFINE(HAVE_KRB4) fi AC_SUBST(KRB4_LIBS)]) AC_DEFUN(ATHENA_KRB4_REQUIRED, [AC_ARG_WITH(krb4, [ --with-krb4=PREFIX Specify location of Kerberos 4], [krb4="$withval"], [krb4=yes]) if test "$krb4" != no; then ATHENA_KRB4_CHECK AC_SUBST(KRB4_LIBS) else AC_MSG_ERROR(This package requires Kerberos 4.) fi]) dnl ----- Kerberos 5 ----- AC_DEFUN(ATHENA_KRB5_CHECK, [AC_SEARCH_LIBS(gethostbyname, nsl) AC_SEARCH_LIBS(socket, socket) AC_CHECK_LIB(gen, compile) if test "$krb5" != yes; then CPPFLAGS="$CPPFLAGS -I$krb5/include" LDFLAGS="$LDFLAGS -L$krb5/lib" fi AC_CHECK_LIB(krb5, krb5_init_context, :, [AC_MSG_ERROR(Kerberos 5 libraries not found)], -lk5crypto -lcom_err)]) AC_DEFUN(ATHENA_KRB5, [AC_ARG_WITH(krb5, [ --with-krb5=PREFIX Use Kerberos 5], [krb5="$withval"], [krb5=no]) if test "$krb5" != no; then ATHENA_KRB5_CHECK KRB5_LIBS="-lkrb5 -lk5crypto -lcom_err" AC_DEFINE(HAVE_KRB5) fi AC_SUBST(KRB5_LIBS)]) AC_DEFUN(ATHENA_KRB5_REQUIRED, [AC_ARG_WITH(krb5, [ --with-krb5=PREFIX Specify location of Kerberos 5], [krb5="$withval"], [krb5=yes]) if test "$krb5" != no; then ATHENA_KRB5_CHECK else AC_MSG_ERROR(This package requires Kerberos 5.) fi]) dnl ----- Hesiod ----- AC_DEFUN(ATHENA_HESIOD_CHECK, [AC_CHECK_FUNC(res_send, :, AC_CHECK_LIB(resolv, res_send)) if test "$hesiod" != yes; then CPPFLAGS="$CPPFLAGS -I$hesiod/include" LDFLAGS="$LDFLAGS -L$hesiod/lib" fi AC_CHECK_LIB(hesiod, hes_resolve, :, [AC_MSG_ERROR(Hesiod library not found)])]) AC_DEFUN(ATHENA_HESIOD, [AC_ARG_WITH(hesiod, [ --with-hesiod=PREFIX Use Hesiod], [hesiod="$withval"], [hesiod=no]) if test "$hesiod" != no; then ATHENA_HESIOD_CHECK HESIOD_LIBS="-lhesiod" AC_DEFINE(HAVE_HESIOD) fi AC_SUBST(HESIOD_LIBS)]) AC_DEFUN(ATHENA_HESIOD_REQUIRED, [AC_ARG_WITH(hesiod, [ --with-hesiod=PREFIX Specify location of Hesiod], [hesiod="$withval"], [hesiod=yes]) if test "$hesiod" != no; then ATHENA_HESIOD_CHECK else AC_MSG_ERROR(This package requires Hesiod.) fi]) dnl ----- libares ----- AC_DEFUN(ATHENA_ARES_CHECK, [AC_CHECK_FUNC(res_send, :, AC_CHECK_LIB(resolv, res_send)) if test "$ares" != yes; then CPPFLAGS="$CPPFLAGS -I$ares/include" LDFLAGS="$LDFLAGS -L$ares/lib" fi AC_CHECK_LIB(ares, ares_init, :, [AC_MSG_ERROR(libares not found)])]) AC_DEFUN(ATHENA_ARES, [AC_ARG_WITH(ares, [ --with-ares=PREFIX Use libares], [ares="$withval"], [ares=no]) if test "$ares" != no; then ATHENA_ARES_CHECK ARES_LIBS="-lares" AC_DEFINE(HAVE_ARES) fi AC_SUBST(ARES_LIBS)]) AC_DEFUN(ATHENA_ARES_REQUIRED, [AC_ARG_WITH(ares, [ --with-ares=PREFIX Specify location of libares], [ares="$withval"], [ares=yes]) if test "$ares" != no; then ATHENA_ARES_CHECK else AC_MSG_ERROR(This package requires libares.) fi]) dnl ----- zephyr ----- AC_DEFUN(ATHENA_ZEPHYR_CHECK, [if test "$zephyr" != yes; then CPPFLAGS="$CPPFLAGS -I$zephyr/include" LDFLAGS="$LDFLAGS -L$zephyr/lib" fi AC_CHECK_LIB(zephyr, ZFreeNotice, :, [AC_MSG_ERROR(zephyr not found)])]) AC_DEFUN(ATHENA_ZEPHYR, [AC_ARG_WITH(zephyr, [ --with-zephyr=PREFIX Use zephyr], [zephyr="$withval"], [zephyr=no]) if test "$zephyr" != no; then ATHENA_ZEPHYR_CHECK ZEPHYR_LIBS="-lzephyr" AC_DEFINE(HAVE_ZEPHYR) fi AC_SUBST(ZEPHYR_LIBS)]) AC_DEFUN(ATHENA_ZEPHYR_REQUIRED, [AC_ARG_WITH(zephyr, [ --with-zephyr=PREFIX Specify location of zephyr], [zephyr="$withval"], [zephyr=yes]) if test "$zephyr" != no; then ATHENA_ZEPHYR_CHECK else AC_MSG_ERROR(This package requires zephyr.) fi]) Loading
ares/CHANGES 0 → 100644 +9 −0 Original line number Diff line number Diff line - James Bursa made it run on RISC OS - Dominick Meglio made it run fine on NT4 - Duncan Wilcox made it fine on Mac OS X - Daniel Stenberg adjusted the windows port - liren at vivisimo.com made the initial windows port
ares/Makefile.in 0 → 100644 +87 −0 Original line number Diff line number Diff line # $Id$ SHELL=/bin/sh INSTALL=@INSTALL@ RANLIB=@RANLIB@ VPATH=@srcdir@ srcdir=@srcdir@ top_srcdir=@top_srcdir@ prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ mandir=@mandir@ CC=@CC@ CPPFLAGS=@CPPFLAGS@ CFLAGS=@CFLAGS@ ${WARN_CFLAGS} ${ERROR_CFLAGS} DEFS=@DEFS@ LDFLAGS=@LDFLAGS@ LIBS=@LIBS@ ALL_CFLAGS=${CPPFLAGS} ${CFLAGS} ${DEFS} OBJS= ares__close_sockets.o ares__get_hostent.o ares__read_line.o \ ares_destroy.o ares_expand_name.o ares_fds.o ares_free_errmem.o \ ares_free_hostent.o ares_free_string.o ares_gethostbyaddr.o \ ares_gethostbyname.o ares_init.o ares_mkquery.o ares_parse_a_reply.o \ ares_parse_ptr_reply.o ares_process.o ares_query.o ares_search.o \ ares_send.o ares_strerror.o ares_timeout.o all: libares.a adig ahost libares.a: ${OBJS} ar cru $@ ${OBJS} ${RANLIB} $@ adig: adig.o libares.a ${CC} ${LDFLAGS} -o $@ adig.o libares.a ${LIBS} ahost: ahost.o libares.a ${CC} ${LDFLAGS} -o $@ ahost.o libares.a ${LIBS} ${OBJS}: ares.h ares_dns.h ares_private.h .c.o: ${CC} -c ${ALL_CFLAGS} $< check: install: ${top_srcdir}/mkinstalldirs ${DESTDIR}${libdir} ${top_srcdir}/mkinstalldirs ${DESTDIR}${includedir} ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man3 ${INSTALL} -m 644 libares.a ${DESTDIR}${libdir} ${RANLIB} ${DESTDIR}${libdir}/libares.a chmod u-w ${DESTDIR}${libdir}/libares.a ${INSTALL} -m 444 ${srcdir}/ares.h ${DESTDIR}${includedir} ${INSTALL} -m 444 ${srcdir}/ares_destroy.3 ${DESTDIR}${mandir}/man3 ${INSTALL} -m 444 ${srcdir}/ares_expand_name.3 ${DESTDIR}${mandir}/man3 ${INSTALL} -m 444 ${srcdir}/ares_fds.3 ${DESTDIR}${mandir}/man3 ${INSTALL} -m 444 ${srcdir}/ares_free_errmem.3 ${DESTDIR}${mandir}/man3 ${INSTALL} -m 444 ${srcdir}/ares_free_hostent.3 \ ${DESTDIR}${mandir}/man3 ${INSTALL} -m 444 ${srcdir}/ares_free_string.3 \ ${DESTDIR}${mandir}/man3 ${INSTALL} -m 444 ${srcdir}/ares_gethostbyaddr.3 \ ${DESTDIR}${mandir}/man3 ${INSTALL} -m 444 ${srcdir}/ares_gethostbyname.3 \ ${DESTDIR}${mandir}/man3 ${INSTALL} -m 444 ${srcdir}/ares_init.3 ${DESTDIR}${mandir}/man3 ${INSTALL} -m 444 ${srcdir}/ares_init_options.3 \ ${DESTDIR}${mandir}/man3 ${INSTALL} -m 444 ${srcdir}/ares_mkquery.3 ${DESTDIR}${mandir}/man3 ${INSTALL} -m 444 ${srcdir}/ares_parse_a_reply.3 \ ${DESTDIR}${mandir}/man3 ${INSTALL} -m 444 ${srcdir}/ares_parse_ptr_reply.3 \ ${DESTDIR}${mandir}/man3 ${INSTALL} -m 444 ${srcdir}/ares_process.3 ${DESTDIR}${mandir}/man3 ${INSTALL} -m 444 ${srcdir}/ares_query.3 ${DESTDIR}${mandir}/man3 ${INSTALL} -m 444 ${srcdir}/ares_search.3 ${DESTDIR}${mandir}/man3 ${INSTALL} -m 444 ${srcdir}/ares_send.3 ${DESTDIR}${mandir}/man3 ${INSTALL} -m 444 ${srcdir}/ares_strerror.3 ${DESTDIR}${mandir}/man3 ${INSTALL} -m 444 ${srcdir}/ares_timeout.3 ${DESTDIR}${mandir}/man3 clean: rm -f ${OBJS} libares.a adig.o adig ahost.o ahost distclean: clean rm -f config.cache config.log config.status Makefile
ares/NEWS 0 → 100644 +18 −0 Original line number Diff line number Diff line Major changes in release 1.1.1: * ares should now compile as C++ code (no longer uses reserved word "class"). * Added SRV support to adig test program. * Fixed a few error handling bugs in query processing. Major changes in release 1.1.0: * Added ares_free_string() function so that memory can be freed in the same layer as it is allocated, a desirable feature in some environments. * A few of the ares_dns.h macros are fixed to use the proper bitwise operator. * Fixed a couple of fenceposts fixed in ares_expand_name()'s bounds-checking. * In process_timeouts(), extract query->next before calling next_server() and possibly freeing the query structure. * Casted arguments to ctype macros casted to unsigned char, since not all char values are valid inputs to those macros according to ANSI.
ares/README 0 → 100644 +41 −0 Original line number Diff line number Diff line This is ares, an asynchronous resolver library. It is intended for applications which need to perform DNS queries without blocking, or need to perform multiple DNS queries in parallel. The primary examples of such applications are servers which communicate with multiple clients and programs with graphical user interfaces. This library implementation is not especially portable to crufty old systems like SunOS 4. It assumes a compiler which can handle ANSI C syntax, a system malloc which properly handles realloc(NULL, foo) and free(NULL), and a reasonably up-to-date <arpa/nameser.h>. I have attempted to preserve the externally visible behavior of the BIND resolver in nearly all respects. The API of the library is, of course, very different from the synchronous BIND API; instead of invoking a function like res_send() and getting a return value back indicating the number of bytes in the response, you invoke a function like ares_send() and give it a callback function to invoke when the response arrives. You then have to select() on the file descriptors indicated by ares_fds(), with a timeout given by ares_timeout(). You call ares_process() when select() returns. Some features are missing from the current version of ares, relative to the BIND resolver: * There is no IPV6 support. * There is no hostname verification. * There is no logging of unexpected events. * There is no debugging-oriented logging. * There is no YP support. libares requires an ANSI compiler to compile and use. To build the library, just run "./configure" and "make". To install it, run "make install". Run "./configure --help" to see a list of options you can provide to configure to change how the library builds. libares has no data files, so you can move the include file and library around freely without leaving behind any dependencies on old paths. Building the library will also build the "adig" program, a little toy for trying out the library. It doesn't get installed. libares is distributed at athena-dist.mit.edu:pub/ATHENA/ares. Please send bug reports and comments to ghudson@mit.edu.
ares/aclocal.m4 0 → 100644 +358 −0 Original line number Diff line number Diff line dnl $Id$ dnl Copyright 1996 by the Massachusetts Institute of Technology. dnl dnl Permission to use, copy, modify, and distribute this dnl software and its documentation for any purpose and without dnl fee is hereby granted, provided that the above copyright dnl notice appear in all copies and that both that copyright dnl notice and this permission notice appear in supporting dnl documentation, and that the name of M.I.T. not be used in dnl advertising or publicity pertaining to distribution of the dnl software without specific, written prior permission. dnl M.I.T. makes no representations about the suitability of dnl this software for any purpose. It is provided "as is" dnl without express or implied warranty. dnl This file provides local macros for packages which use specific dnl external libraries. The public macros are: dnl dnl ATHENA_UTIL_COM_ERR dnl Generates error if com_err not found. dnl ATHENA_UTIL_SS dnl Generates error if ss not found. dnl ATHENA_REGEXP dnl Sets REGEX_LIBS if rx library used; ensures POSIX dnl regexp support. dnl ATHENA_MOTIF dnl Sets MOTIF_LIBS and defines HAVE_MOTIF if Motif used. dnl ATHENA_MOTIF_REQUIRED dnl Generates error if Motif not found. dnl ATHENA_AFS dnl Sets AFS_LIBS and defines HAVE_AFS if AFS used. Pass dnl in an argument giving the desired AFS libraries; dnl AFS_LIBS will be set to that value if AFS is found. dnl AFS_DIR will be set to the prefix given. dnl ATHENA_AFS_REQUIRED dnl Generates error if AFS libraries not found. AFS_DIR dnl will be set to the prefix given. dnl ATHENA_KRB4 dnl Sets KRB4_LIBS and defines HAVE_KRB4 if krb4 used. dnl ATHENA_KRB4_REQUIRED dnl Generates error if krb4 not found. Sets KRB4_LIBS dnl otherwise. (Special behavior because krb4 libraries dnl may be different if using krb4 compatibility libraries dnl from krb5.) dnl ATHENA_KRB5 dnl Sets KRB5_LIBS and defines HAVE_KRB5 if krb5 used. dnl ATHENA_KRB5_REQUIRED dnl Generates error if krb5 not found. dnl ATHENA_HESIOD dnl Sets HESIOD_LIBS and defines HAVE_HESIOD if Hesiod dnl used. dnl ATHENA_HESIOD_REQUIRED dnl Generates error if Hesiod not found. dnl ATHENA_ARES dnl Sets ARES_LIBS and defines HAVE_ARES if libares dnl used. dnl ATHENA_ARES_REQUIRED dnl Generates error if libares not found. dnl ATHENA_ZEPHYR dnl Sets ZEPHYR_LIBS and defines HAVE_ZEPHYR if zephyr dnl used. dnl ATHENA_ZEPHYR_REQUIRED dnl Generates error if zephyr not found. dnl dnl All of the macros may extend CPPFLAGS and LDFLAGS to let the dnl compiler find the requested libraries. Put ATHENA_UTIL_COM_ERR dnl and ATHENA_UTIL_SS before ATHENA_AFS or ATHENA_AFS_REQUIRED; there dnl is a com_err library in the AFS libraries which requires -lutil. dnl ----- com_err ----- AC_DEFUN(ATHENA_UTIL_COM_ERR, [AC_ARG_WITH(com_err, [ --with-com_err=PREFIX Specify location of com_err], [com_err="$withval"], [com_err=yes]) if test "$com_err" != no; then if test "$com_err" != yes; then CPPFLAGS="$CPPFLAGS -I$com_err/include" LDFLAGS="$LDFLAGS -L$com_err/lib" fi AC_CHECK_LIB(com_err, com_err, :, [AC_MSG_ERROR(com_err library not found)]) else AC_MSG_ERROR(This package requires com_err.) fi]) dnl ----- ss ----- AC_DEFUN(ATHENA_UTIL_SS, [AC_ARG_WITH(ss, [ --with-ss=PREFIX Specify location of ss (requires com_err)], [ss="$withval"], [ss=yes]) if test "$ss" != no; then if test "$ss" != yes; then CPPFLAGS="$CPPFLAGS -I$ss/include" LDFLAGS="$LDFLAGS -L$ss/lib" fi AC_CHECK_LIB(ss, ss_perror, :, [AC_MSG_ERROR(ss library not found)], -lcom_err) else AC_MSG_ERROR(This package requires ss.) fi]) dnl ----- Regular expressions ----- AC_DEFUN(ATHENA_REGEXP, [AC_ARG_WITH(regex, [ --with-regex=PREFIX Use installed regex library], [regex="$withval"], [regex=no]) if test "$regex" != no; then if test "$regex" != yes; then CPPFLAGS="$CPPFLAGS -I$regex/include" LDFLAGS="$LDFLAGS -L$regex/lib" fi AC_CHECK_LIB(regex, regcomp, REGEX_LIBS=-lregex, [AC_MSG_ERROR(regex library not found)]) else AC_CHECK_FUNC(regcomp, :, [AC_MSG_ERROR(can't find POSIX regexp support)]) fi AC_SUBST(REGEX_LIBS)]) dnl ----- Motif ----- AC_DEFUN(ATHENA_MOTIF_CHECK, [if test "$motif" != yes; then CPPFLAGS="$CPPFLAGS -I$motif/include" LDFLAGS="$LDFLAGS -L$motif/lib" fi AC_CHECK_LIB(Xm, XmStringFree, :, [AC_MSG_ERROR(Motif library not found)])]) AC_DEFUN(ATHENA_MOTIF, [AC_ARG_WITH(motif, [ --with-motif=PREFIX Use Motif], [motif="$withval"], [motif=no]) if test "$motif" != no; then ATHENA_MOTIF_CHECK MOTIF_LIBS=-lXm AC_DEFINE(HAVE_MOTIF) fi AC_SUBST(MOTIF_LIBS)]) AC_DEFUN(ATHENA_MOTIF_REQUIRED, [AC_ARG_WITH(motif, [ --with-motif=PREFIX Specify location of Motif], [motif="$withval"], [motif=yes]) if test "$motif" != no; then ATHENA_MOTIF_CHECK else AC_MSG_ERROR(This package requires Motif.) fi]) dnl ----- AFS ----- AC_DEFUN(ATHENA_AFS_CHECK, [AC_CHECK_FUNC(insque, :, AC_CHECK_LIB(compat, insque)) AC_CHECK_FUNC(gethostbyname, :, AC_CHECK_LIB(nsl, gethostbyname)) AC_CHECK_FUNC(socket, :, AC_CHECK_LIB(socket, socket)) if test "$afs" != yes; then CPPFLAGS="$CPPFLAGS -I$afs/include" LDFLAGS="$LDFLAGS -L$afs/lib -L$afs/lib/afs" fi AC_CHECK_LIB(sys, pioctl, :, [AC_MSG_ERROR(AFS libraries not found)], -lrx -llwp -lsys) AFS_DIR=$afs AC_SUBST(AFS_DIR)]) dnl Specify desired AFS libraries as a parameter. AC_DEFUN(ATHENA_AFS, [AC_ARG_WITH(afs, [ --with-afs=PREFIX Use AFS libraries], [afs="$withval"], [afs=no]) if test "$afs" != no; then ATHENA_AFS_CHECK AFS_LIBS=$1 AC_DEFINE(HAVE_AFS) fi AC_SUBST(AFS_LIBS)]) AC_DEFUN(ATHENA_AFS_REQUIRED, [AC_ARG_WITH(afs, [ --with-afs=PREFIX Specify location of AFS libraries], [afs="$withval"], [afs=/usr/afsws]) if test "$afs" != no; then ATHENA_AFS_CHECK else AC_MSG_ERROR(This package requires AFS libraries.) fi]) dnl ----- Kerberos 4 ----- AC_DEFUN(ATHENA_KRB4_CHECK, [AC_CHECK_FUNC(gethostbyname, :, AC_CHECK_LIB(nsl, gethostbyname)) AC_CHECK_FUNC(socket, :, AC_CHECK_LIB(socket, socket)) AC_CHECK_LIB(gen, compile) if test "$krb4" != yes; then CPPFLAGS="$CPPFLAGS -I$krb4/include" if test -d "$krb4/include/kerberosIV"; then CPPFLAGS="$CPPFLAGS -I$krb4/include/kerberosIV" fi LDFLAGS="$LDFLAGS -L$krb4/lib" fi AC_CHECK_LIB(krb4, krb_rd_req, [KRB4_LIBS="-lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err"], [AC_CHECK_LIB(krb, krb_rd_req, [KRB4_LIBS="-lkrb -ldes"], [AC_MSG_ERROR(Kerberos 4 libraries not found)], -ldes)], -ldes425 -lkrb5 -lk5crypto -lcom_err)]) AC_DEFUN(ATHENA_KRB4, [AC_ARG_WITH(krb4, [ --with-krb4=PREFIX Use Kerberos 4], [krb4="$withval"], [krb4=no]) if test "$krb4" != no; then ATHENA_KRB4_CHECK AC_DEFINE(HAVE_KRB4) fi AC_SUBST(KRB4_LIBS)]) AC_DEFUN(ATHENA_KRB4_REQUIRED, [AC_ARG_WITH(krb4, [ --with-krb4=PREFIX Specify location of Kerberos 4], [krb4="$withval"], [krb4=yes]) if test "$krb4" != no; then ATHENA_KRB4_CHECK AC_SUBST(KRB4_LIBS) else AC_MSG_ERROR(This package requires Kerberos 4.) fi]) dnl ----- Kerberos 5 ----- AC_DEFUN(ATHENA_KRB5_CHECK, [AC_SEARCH_LIBS(gethostbyname, nsl) AC_SEARCH_LIBS(socket, socket) AC_CHECK_LIB(gen, compile) if test "$krb5" != yes; then CPPFLAGS="$CPPFLAGS -I$krb5/include" LDFLAGS="$LDFLAGS -L$krb5/lib" fi AC_CHECK_LIB(krb5, krb5_init_context, :, [AC_MSG_ERROR(Kerberos 5 libraries not found)], -lk5crypto -lcom_err)]) AC_DEFUN(ATHENA_KRB5, [AC_ARG_WITH(krb5, [ --with-krb5=PREFIX Use Kerberos 5], [krb5="$withval"], [krb5=no]) if test "$krb5" != no; then ATHENA_KRB5_CHECK KRB5_LIBS="-lkrb5 -lk5crypto -lcom_err" AC_DEFINE(HAVE_KRB5) fi AC_SUBST(KRB5_LIBS)]) AC_DEFUN(ATHENA_KRB5_REQUIRED, [AC_ARG_WITH(krb5, [ --with-krb5=PREFIX Specify location of Kerberos 5], [krb5="$withval"], [krb5=yes]) if test "$krb5" != no; then ATHENA_KRB5_CHECK else AC_MSG_ERROR(This package requires Kerberos 5.) fi]) dnl ----- Hesiod ----- AC_DEFUN(ATHENA_HESIOD_CHECK, [AC_CHECK_FUNC(res_send, :, AC_CHECK_LIB(resolv, res_send)) if test "$hesiod" != yes; then CPPFLAGS="$CPPFLAGS -I$hesiod/include" LDFLAGS="$LDFLAGS -L$hesiod/lib" fi AC_CHECK_LIB(hesiod, hes_resolve, :, [AC_MSG_ERROR(Hesiod library not found)])]) AC_DEFUN(ATHENA_HESIOD, [AC_ARG_WITH(hesiod, [ --with-hesiod=PREFIX Use Hesiod], [hesiod="$withval"], [hesiod=no]) if test "$hesiod" != no; then ATHENA_HESIOD_CHECK HESIOD_LIBS="-lhesiod" AC_DEFINE(HAVE_HESIOD) fi AC_SUBST(HESIOD_LIBS)]) AC_DEFUN(ATHENA_HESIOD_REQUIRED, [AC_ARG_WITH(hesiod, [ --with-hesiod=PREFIX Specify location of Hesiod], [hesiod="$withval"], [hesiod=yes]) if test "$hesiod" != no; then ATHENA_HESIOD_CHECK else AC_MSG_ERROR(This package requires Hesiod.) fi]) dnl ----- libares ----- AC_DEFUN(ATHENA_ARES_CHECK, [AC_CHECK_FUNC(res_send, :, AC_CHECK_LIB(resolv, res_send)) if test "$ares" != yes; then CPPFLAGS="$CPPFLAGS -I$ares/include" LDFLAGS="$LDFLAGS -L$ares/lib" fi AC_CHECK_LIB(ares, ares_init, :, [AC_MSG_ERROR(libares not found)])]) AC_DEFUN(ATHENA_ARES, [AC_ARG_WITH(ares, [ --with-ares=PREFIX Use libares], [ares="$withval"], [ares=no]) if test "$ares" != no; then ATHENA_ARES_CHECK ARES_LIBS="-lares" AC_DEFINE(HAVE_ARES) fi AC_SUBST(ARES_LIBS)]) AC_DEFUN(ATHENA_ARES_REQUIRED, [AC_ARG_WITH(ares, [ --with-ares=PREFIX Specify location of libares], [ares="$withval"], [ares=yes]) if test "$ares" != no; then ATHENA_ARES_CHECK else AC_MSG_ERROR(This package requires libares.) fi]) dnl ----- zephyr ----- AC_DEFUN(ATHENA_ZEPHYR_CHECK, [if test "$zephyr" != yes; then CPPFLAGS="$CPPFLAGS -I$zephyr/include" LDFLAGS="$LDFLAGS -L$zephyr/lib" fi AC_CHECK_LIB(zephyr, ZFreeNotice, :, [AC_MSG_ERROR(zephyr not found)])]) AC_DEFUN(ATHENA_ZEPHYR, [AC_ARG_WITH(zephyr, [ --with-zephyr=PREFIX Use zephyr], [zephyr="$withval"], [zephyr=no]) if test "$zephyr" != no; then ATHENA_ZEPHYR_CHECK ZEPHYR_LIBS="-lzephyr" AC_DEFINE(HAVE_ZEPHYR) fi AC_SUBST(ZEPHYR_LIBS)]) AC_DEFUN(ATHENA_ZEPHYR_REQUIRED, [AC_ARG_WITH(zephyr, [ --with-zephyr=PREFIX Specify location of zephyr], [zephyr="$withval"], [zephyr=yes]) if test "$zephyr" != no; then ATHENA_ZEPHYR_CHECK else AC_MSG_ERROR(This package requires zephyr.) fi])