dnsval-2.0/ 0000775 0002372 0002372 00000000000 12111172621 012764 5 ustar hardaker hardaker dnsval-2.0/.cvsignore 0000664 0002372 0002372 00000000117 10560656624 015003 0 ustar hardaker hardaker Makefile
autom4te.cache
config.log
config.status
libtool
stamp-h
libval-config
dnsval-2.0/libval-config.in 0000664 0002372 0002372 00000010352 10672531415 016043 0 ustar hardaker hardaker #!/bin/sh
#
srcdir=@srcdir@
prefix=@prefix@
exec_prefix=@exec_prefix@
bindir=@bindir@
sbindir=@sbindir@
libdir=@libdir@
datadir=@datadir@
includedir=@includedir@/validator
mandir=@mandir@
lvc_PREFIX=$prefix
lvc_EXEC_PREFIX=$exec_prefix
lvc_INCLUDEDIR=$includedir
lvc_DEVCFLAGS="@DEVFLAGS@"
lvc_CFLAGS="@CFLAGS@"
lvc_CPPFLAGS="@CPPFLAGS@"
lvc_LDFLAGS="@LDFLAGS@"
lvc_LIBS="@LIBS@"
lvc_LIBDIR="-L${libdir}"
LIBVAL_SUFFIX=@LIBVAL_SUFFIX@
lvc_RESOLV_CONF="@VAL_RESOLV_CONF@"
lvc_ROOT_HINTS="@VAL_ROOT_HINTS@"
lvc_DNSVAL="@VAL_CONFIGURATION_FILE@"
if test "x$1" = "x"; then
usage="yes"
else
while test "x$done" = "x" -a "x$1" != "x" -a "x$usage" != "xyes"; do
case "$1" in
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac
case $1 in
--prefix=*)
prefix=$optarg
lvc_PREFIX=${prefix}
lvc_INCLUDEDIR=${prefix}/include
lvc_LIBDIR=-L${prefix}/lib
;;
--exec-prefix=*)
exec_prefix=$optarg
lvc_EXEC_PREFIX=${exec_prefix}
lvc_LIBDIR=-L${exec_prefix}/lib
;;
--configure-options|--con*)
echo @CONFIGURE_OPTIONS@
;;
#################################################### compile
--base-cflags)
echo ${lvc_CFLAGS} ${lvc_CPPFLAGS} -I${lvc_INCLUDEDIR}
;;
--cflags|--cf*)
echo ${lvc_CFLAGS} ${lvc_DEVFLAGS} ${lvc_CPPFLAGS} -I. -I${lvc_INCLUDEDIR}
;;
--srcdir)
echo $lvc_SRCDIR
;;
#################################################### linking
--libdir|--lib-dir)
echo $lvc_LIBDIR
;;
--ldflags|--ld*)
echo $lvc_LDFLAGS
;;
#################################################### client lib
--libs)
# use this one == --libval-libs + --external-libs
echo $lvc_LDFLAGS $lvc_LIBDIR -lsres -lval${LIBVAL_SUFFIX} $lvc_LIBS
;;
--libval-libs)
echo $lvc_LIBDIR -lsres -lval${LIBVAL_SUFFIX}
;;
--external-libs)
echo $lvc_LDFLAGS $lvc_LIBS
;;
####################################################
--resolver-config|--res*)
echo $lvc_RESOLV_CONF
;;
--root-hints|--roo*)
echo $lvc_ROOT_HINTS
;;
--dnsval-config|--dns*)
echo $lvc_DNSVAL
;;
####################################################
--version|--ver*)
echo @PACKAGE_VERSION@
;;
--help)
usage="yes"
;;
--prefix|--pre*)
echo $lvc_PREFIX
;;
--exec-prefix)
echo $lvc_EXEC_PREFIX
;;
*)
echo "unknown option $1"
usage="yes"
;;
esac
shift
done
fi
if test "x$usage" = "xyes"; then
echo ""
echo "Usage:"
echo " libval-config [--cflags] [--agent-libs] [--libs] [--version]"
echo " ... [see below for complete flag list]"
echo ""
echo " --version displays the libval version number"
echo ""
echo " These options produce the various compilation flags needed when"
echo " building external SNMP applications:"
echo ""
echo " --base-cflags lists additional compilation flags needed"
echo " --cflags lists additional compilation flags needed"
echo " (includes -I. and extra developer warning flags)"
echo ""
echo " These options produce the various link flags needed when"
echo " building external SNMP applications:"
echo ""
echo " --libs lists libraries needed for building applications"
echo ""
echo " These options produce various link flags broken down into parts."
echo " (Most of the time the simple options above should be used.)"
echo ""
echo " --libdir path to libval"
echo ""
echo " --libval-libs libval (with path)"
echo ""
echo " --ldflags link flags for external libraries"
echo " --external-libs external libraries needed by libval"
echo ""
echo " Details on how the libval package was compiled:"
echo ""
echo " --configure-options display original configure arguments"
echo " --prefix display the installation prefix"
echo ""
echo " --resolver-config display path to resolver configuration"
echo " --root-hints display path to root hints file"
echo " --dnsval-config display path to dnsval configuration"
exit
fi
dnsval-2.0/windows.mak 0000775 0002372 0002372 00000010233 11732164725 015170 0 ustar hardaker hardaker # compiler options
PERL=perl
CC=cl
CFLAG= /Zi /nologo /W3 /WX- /Od /Gm /RTC1 /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TC /MDd
CDEFS= /D "i386" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_WINDLL" /D "_UNICODE" /D "UNICODE"
INC=/I include
INC=/I \usr\include /I include
SHLIB_CFLAGS=$(CFLAG) $(INC) $(CDEFS)
MKDIR=mkdir
SRC_D=.
LINK=link
LFLAGS64=/INCREMENTAL /NOLOGO /opt:ref /debug /DLL /MANIFEST /SUBSYSTEM:WINDOWS /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X64
LFLAGS32=/INCREMENTAL /NOLOGO /opt:ref /debug /DLL /MANIFEST /SUBSYSTEM:WINDOWS /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86
EX_LIBS=ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
LIB_SSL=/libpath:\usr\lib libeay32.lib ssleay32.lib
OUT_D=Debug
SRC_LIBSRES_D=libsres
TMP_LIBSRES_D=libsres\$(OUT_D)
SRC_LIBVAL_D=libval
TMP_LIBVAL_D=libval\$(OUT_D)
LIBSRES_OBJS = $(TMP_LIBSRES_D)\base64.obj \
$(TMP_LIBSRES_D)\dllmain.obj \
$(TMP_LIBSRES_D)\ns_name.obj \
$(TMP_LIBSRES_D)\ns_netint.obj \
$(TMP_LIBSRES_D)\ns_parse.obj \
$(TMP_LIBSRES_D)\ns_print.obj \
$(TMP_LIBSRES_D)\ns_samedomain.obj \
$(TMP_LIBSRES_D)\ns_ttl.obj \
$(TMP_LIBSRES_D)\nsap_addr.obj \
$(TMP_LIBSRES_D)\res_comp.obj \
$(TMP_LIBSRES_D)\res_debug.obj \
$(TMP_LIBSRES_D)\res_io_manager.obj \
$(TMP_LIBSRES_D)\res_mkquery.obj \
$(TMP_LIBSRES_D)\res_query.obj \
$(TMP_LIBSRES_D)\res_support.obj \
$(TMP_LIBSRES_D)\res_tsig.obj
LIBSRES_DLL = $(OUT_D)\libsres.dll
LIBVAL_OBJS = $(TMP_LIBVAL_D)\dllmain.obj \
$(TMP_LIBVAL_D)\val_assertion.obj \
$(TMP_LIBVAL_D)\val_cache.obj \
$(TMP_LIBVAL_D)\val_context.obj \
$(TMP_LIBVAL_D)\val_crypto.obj \
$(TMP_LIBVAL_D)\val_get_rrset.obj \
$(TMP_LIBVAL_D)\val_getaddrinfo.obj \
$(TMP_LIBVAL_D)\val_gethostbyname.obj \
$(TMP_LIBVAL_D)\val_log.obj \
$(TMP_LIBVAL_D)\val_parse.obj \
$(TMP_LIBVAL_D)\val_policy.obj \
$(TMP_LIBVAL_D)\val_resquery.obj \
$(TMP_LIBVAL_D)\val_support.obj \
$(TMP_LIBVAL_D)\val_verify.obj \
$(TMP_LIBVAL_D)\val_x_query.obj
LIBVAL_DLL = $(OUT_D)\libval.dll
all: win64
win32: $(OUT_D) libsres libval dll32
win64: $(OUT_D) libsres libval dll64
libsres: $(TMP_LIBSRES_D) $(LIBSRES_OBJS)
libval: $(TMP_LIBVAL_D) $(LIBVAL_OBJS)
dll32: libsres32 libval32
dll64: libsres64 libval64
clean:
IF EXIST $(OUT_D) rmdir /S /Q $(OUT_D)
IF EXIST libsres\$(OUT_D) rmdir /S /Q libsres\$(OUT_D)
IF EXIST libval\$(OUT_D) rmdir /S /Q libval\$(OUT_D)
banner:
@echo building libraries
$(OUT_D):
$(MKDIR) "$(OUT_D)"
$(TMP_LIBSRES_D):
$(MKDIR) "$(TMP_LIBSRES_D)"
$(TMP_LIBVAL_D):
$(MKDIR) "$(TMP_LIBVAL_D)"
{$(SRC_LIBSRES_D)}.c{$(TMP_LIBSRES_D)}.obj:
$(CC) $(SHLIB_CFLAGS) /Fo$(*R).obj -c $<
{$(SRC_LIBVAL_D)}.c{$(TMP_LIBVAL_D)}.obj:
$(CC) $(SHLIB_CFLAGS) /EHsc /GS /Fo$(*R).obj -c $<
libsres64: $(LIBSRES_OBJS)
$(LINK) $(LFLAGS64) /out:$(OUT_D)\libsres.dll @<< $(LIBSRES_OBJS) $(SHLIB_EX_OBJS) $(EX_LIBS) $(LIB_SSL) /DEF:$(SRC_LIBSRES_D)\libsres.def /ManifestFile:"$(TMP_LIBSRES_D)\libsres.dll.intermediate.manifest"
<<
IF EXIST $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;2
libval64: $(LIBVAL_OBJS)
$(LINK) $(LFLAGS64) /out:$(OUT_D)\libval.dll @<< $(LIBVAL_OBJS) $(SHLIB_EX_OBJS) $(EX_LIBS) $(LIB_SSL) $(OUT_D)\libsres.lib /DEF:$(SRC_LIBVAL_D)\libval.def /ManifestFile:"$(TMP_LIBVAL_D)\libval.dll.intermediate.manifest"
<<
IF EXIST $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;2
libsres32: $(LIBSRES_OBJS)
$(LINK) $(LFLAGS32) /out:$(OUT_D)\libsres.dll @<< $(LIBSRES_OBJS) $(SHLIB_EX_OBJS) $(EX_LIBS) $(LIB_SSL) /DEF:$(SRC_LIBSRES_D)\libsres.def /ManifestFile:"$(TMP_LIBSRES_D)\libsres.dll.intermediate.manifest"
<<
IF EXIST $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;2
libval32: $(LIBVAL_OBJS)
$(LINK) $(LFLAGS32) /out:$(OUT_D)\libval.dll @<< $(LIBVAL_OBJS) $(SHLIB_EX_OBJS) $(EX_LIBS) $(LIB_SSL) $(OUT_D)\libsres.lib /DEF:$(SRC_LIBVAL_D)\libval.def /ManifestFile:"$(TMP_LIBVAL_D)\libval.dll.intermediate.manifest"
<<
IF EXIST $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;2
dnsval-2.0/mkinstalldirs 0000775 0002372 0002372 00000001320 10437603413 015575 0 ustar hardaker hardaker #! /bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman
# Created: 1993-05-16
# Public domain
# $Id: mkinstalldirs 1664 2006-06-01 15:26:03Z rstory $
errstatus=0
for file
do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
for d
do
pathcomp="$pathcomp$d"
case "$pathcomp" in
-* ) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp"
mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
errstatus=$lasterr
fi
fi
pathcomp="$pathcomp/"
done
done
exit $errstatus
# mkinstalldirs ends here
dnsval-2.0/libsres/ 0000775 0002372 0002372 00000000000 12111172615 014432 5 ustar hardaker hardaker dnsval-2.0/libsres/nsap_addr.c 0000664 0002372 0002372 00000005253 11732713653 016551 0 ustar hardaker hardaker /*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-1999 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "validator-internal.h"
#ifndef HAVE_INET_NSAP_NTOA
static char
xtob(int c)
{
return (c - (((c >= '0') && (c <= '9')) ? '0' : '7'));
}
u_int
inet_nsap_addr(const char *ascii, u_char * binary, int maxlen)
{
u_char c, nib;
u_int len = 0;
if (ascii[0] != '0' || (ascii[1] != 'x' && ascii[1] != 'X'))
return (0);
ascii += 2;
while ((c = *ascii++) != '\0' && len < (u_int) maxlen) {
if (c == '.' || c == '+' || c == '/')
continue;
if (!isascii(c))
return (0);
if (islower(c))
c = toupper(c);
if (isxdigit(c)) {
nib = xtob(c);
c = *ascii++;
if (c != '\0') {
c = toupper(c);
if (isxdigit(c)) {
*binary++ = (nib << 4) | xtob(c);
len++;
} else
return (0);
} else
return (0);
} else
return (0);
}
return (len);
}
char *
inet_nsap_ntoa(int binlen, const u_char * binary, char *ascii)
{
int nib;
int i;
char inet_nsap_ntoa_tmpbuf[255 * 3];
char *tmpbuf = inet_nsap_ntoa_tmpbuf;
char *start;
if (ascii)
start = ascii;
else {
ascii = tmpbuf;
start = tmpbuf;
}
*ascii++ = '0';
*ascii++ = 'x';
if (binlen > 255)
binlen = 255;
for (i = 0; i < binlen; i++) {
nib = *binary >> 4;
*ascii++ = nib + (nib < 10 ? '0' : '7');
nib = *binary++ & 0x0f;
*ascii++ = nib + (nib < 10 ? '0' : '7');
if (((i % 2) == 0 && (i + 1) < binlen))
*ascii++ = '.';
}
*ascii = '\0';
return (start);
}
#endif /*HAVE_INET_NSAP_NTOA */
/*
* ! \file
*/
dnsval-2.0/libsres/ns_parse.c 0000664 0002372 0002372 00000014736 11732713653 016436 0 ustar hardaker hardaker /*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996,1999 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "validator-internal.h"
#include "res_support.h"
#include "res_comp.h"
#if HAVE_ARPA_NAMESER_H && !defined(__OpenBSD__) && !defined(eabi)
#ifndef STRUCT___NS_MSG_HAS__MSG_PTR
# ifdef STRUCT___NS_MSG_HAS__PTR
# define _msg_ptr _ptr
# else
# error "unknown msg ptr member in struct __ns_msg"
# endif
#endif
#endif
/*
* Forward.
*/
static void setsection(ns_msg * msg, ns_sect sect);
/*
* Macros.
*/
#define RETERR(err) do { errno = (err); return (-1); } while (0)
/*
* Public.
*/
/*
* These need to be in the same order as the nres.h:ns_flag enum.
*/
struct _ns_flagdata _ns_flagdata_flags[16] = {
{0x8000, 15}, /* qr. */
{0x7800, 11}, /* opcode. */
{0x0400, 10}, /* aa. */
{0x0200, 9}, /* tc. */
{0x0100, 8}, /* rd. */
{0x0080, 7}, /* ra. */
{0x0040, 6}, /* z. */
{0x0020, 5}, /* ad. */
{0x0010, 4}, /* cd. */
{0x000f, 0}, /* rcode. */
{0x0000, 0}, /* expansion (1/6). */
{0x0000, 0}, /* expansion (2/6). */
{0x0000, 0}, /* expansion (3/6). */
{0x0000, 0}, /* expansion (4/6). */
{0x0000, 0}, /* expansion (5/6). */
{0x0000, 0}, /* expansion (6/6). */
};
/*
* ns_msg_getflag is a macro on linux, but Solaris and Darwin
* both use defines of the function to map to other function
* names.
*
* We rename this function for internal usage
*/
int
libsres_msg_getflag(ns_msg han, int flag)
{
return (((han)._flags & _ns_flagdata_flags[flag].mask) >> _ns_flagdata_flags[flag].
shift);
}
int
ns_skiprr(const u_char * ptr, const u_char * eom, ns_sect section,
int count)
{
const u_char *optr = ptr;
for ((void) NULL; count > 0; count--) {
int b, rdlength;
b = dn_skipname(ptr, eom);
if (b < 0)
RETERR(EMSGSIZE);
ptr +=
b /*Name */ + NS_INT16SZ /*Type */ + NS_INT16SZ /*Class */ ;
if (section != ns_s_qd) {
if (ptr + NS_INT32SZ + NS_INT16SZ > eom)
RETERR(EMSGSIZE);
ptr += NS_INT32SZ /*TTL*/;
RES_GET16(rdlength, ptr);
ptr += rdlength /*RData */ ;
}
}
if (ptr > eom)
RETERR(EMSGSIZE);
return (ptr - optr);
}
int
ns_initparse(const u_char * msg, int msglen, ns_msg * handle)
{
const u_char *eom = msg + msglen;
int i;
if ((NULL == msg) || (0 == msglen))
#ifdef ENODATA
RETERR(ENODATA);
#else
RETERR(EINVAL);
#endif
memset(handle, 0x5e, sizeof(*handle));
handle->_msg = msg;
handle->_eom = eom;
if (msg + NS_INT16SZ > eom)
RETERR(EMSGSIZE);
RES_GET16(handle->_id, msg);
if (msg + NS_INT16SZ > eom)
RETERR(EMSGSIZE);
RES_GET16(handle->_flags, msg);
for (i = 0; i < ns_s_max; i++) {
if (msg + NS_INT16SZ > eom)
RETERR(EMSGSIZE);
RES_GET16(handle->_counts[i], msg);
}
for (i = 0; i < ns_s_max; i++)
if (handle->_counts[i] == 0)
handle->_sections[i] = NULL;
else {
int b = ns_skiprr(msg, eom, (ns_sect) i,
handle->_counts[i]);
if (b < 0)
return (-1);
handle->_sections[i] = msg;
msg += b;
}
if (msg != eom)
RETERR(EMSGSIZE);
setsection(handle, ns_s_max);
return (0);
}
int
ns_parserr(ns_msg * handle, ns_sect section, int rrnum, ns_rr * rr)
{
int b;
int tmp;
/*
* Make section right.
*/
if ((tmp = section) < 0 || section >= ns_s_max)
RETERR(ENODEV);
if (section != handle->_sect)
setsection(handle, section);
/*
* Make rrnum right.
*/
if (rrnum == -1)
rrnum = handle->_rrnum;
if (rrnum < 0 || rrnum >= handle->_counts[(int) section])
RETERR(ENODEV);
if (rrnum < handle->_rrnum)
setsection(handle, section);
if (rrnum > handle->_rrnum) {
b = ns_skiprr(handle->_msg_ptr, handle->_eom, section,
rrnum - handle->_rrnum);
if (b < 0)
return (-1);
handle->_msg_ptr += b;
handle->_rrnum = rrnum;
}
/*
* Do the parse.
*/
b = dn_expand(handle->_msg, handle->_eom,
handle->_msg_ptr, rr->name, NS_MAXDNAME);
if (b < 0)
return (-1);
handle->_msg_ptr += b;
if (handle->_msg_ptr + NS_INT16SZ + NS_INT16SZ > handle->_eom)
RETERR(EMSGSIZE);
RES_GET16(rr->type, handle->_msg_ptr);
RES_GET16(rr->rr_class, handle->_msg_ptr);
if (section == ns_s_qd) {
rr->ttl = 0;
rr->rdlength = 0;
rr->rdata = NULL;
} else {
if (handle->_msg_ptr + NS_INT32SZ + NS_INT16SZ > handle->_eom)
RETERR(EMSGSIZE);
RES_GET32(rr->ttl, handle->_msg_ptr);
RES_GET16(rr->rdlength, handle->_msg_ptr);
if (handle->_msg_ptr + rr->rdlength > handle->_eom)
RETERR(EMSGSIZE);
rr->rdata = handle->_msg_ptr;
handle->_msg_ptr += rr->rdlength;
}
if (++handle->_rrnum > handle->_counts[(int) section])
setsection(handle, (ns_sect) ((int) section + 1));
/*
* All done.
*/
return (0);
}
/*
* Private.
*/
static void
setsection(ns_msg * msg, ns_sect sect)
{
msg->_sect = sect;
if (sect == ns_s_max) {
msg->_rrnum = -1;
msg->_msg_ptr = NULL;
} else {
msg->_rrnum = 0;
msg->_msg_ptr = msg->_sections[(int) sect];
}
}
dnsval-2.0/libsres/res_tsig.h 0000664 0002372 0002372 00000002635 11560322751 016435 0 ustar hardaker hardaker /*
* Copyright (c) 1995, 1996, 1997 by Trusted Information Systems, Inc.
*
* Permission to use, copy modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND TRUSTED INFORMATION SYSTEMS
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
* TRUSTED INFORMATION SYSTEMS BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THE SOFTWARE.
*/
#ifndef __RES_TSIG_H__
#define __RES_TSIG_H__
#define SR_TS_UNSET 0
#define SR_TS_OK 1
#define SR_TS_FAIL -2
#define SR_TS_CALL_ERROR -3
int res_tsig_sign(u_char * query,
size_t query_length,
struct name_server *ns,
u_char ** signed_query,
size_t *signed_length);
int res_tsig_verifies(struct name_server *respondent,
u_char * answer, size_t answer_length);
#endif
dnsval-2.0/libsres/ns_name.c 0000664 0002372 0002372 00000065300 11732713653 016235 0 ustar hardaker hardaker /*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996,1999 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "validator-internal.h"
#define NS_TYPE_ELT 0x40 /* EDNS0 extended label type */
#define DNS_LABELTYPE_BITSTRING 0x41
/*
* Data.
*/
static const char digits[] = "0123456789";
static const char digitvalue[256] = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*16 */
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*32 */
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*48 */
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, /*64 */
-1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*80 */
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*96 */
-1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*112 */
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*128 */
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*256 */
};
/*
* Forward.
*/
static int special(int);
static int printable(int);
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 *);
static int labellen(const u_char *);
static int decode_bitstring(const char **, char *, const char *);
/*
* Public.
*/
/*
* ns_name_ntop(src, dst, dstsiz)
* Convert an encoded domain name to printable ascii as per RFC1035.
* return:
* Number of bytes written to buffer, or -1 (with errno set)
* notes:
* The root is returned as "."
* All other domains are returned in non absolute form
*/
int
ns_name_ntop(const u_char * src, char *dst, size_t dstsiz)
{
const u_char *cp;
char *dn, *eom;
u_char c;
u_int n;
int l;
cp = src;
dn = dst;
eom = dst + dstsiz;
while ((n = *cp++) != 0) {
if ((n & NS_CMPRSFLGS) == NS_CMPRSFLGS) {
/*
* Some kind of compression pointer.
*/
errno = EMSGSIZE;
return (-1);
}
if (dn != dst) {
if (dn >= eom) {
errno = EMSGSIZE;
return (-1);
}
*dn++ = '.';
}
if ((l = labellen(cp - 1)) < 0) {
errno = EMSGSIZE; /* XXX */
return (-1);
}
if (dn + l >= eom) {
errno = EMSGSIZE;
return (-1);
}
if ((n & NS_CMPRSFLGS) == NS_TYPE_ELT) {
int m;
if (n != DNS_LABELTYPE_BITSTRING) {
/*
* XXX: labellen should reject this case
*/
errno = EINVAL;
return (-1);
}
if ((m = decode_bitstring((const char **) &cp, dn, eom)) < 0) {
errno = EMSGSIZE;
return (-1);
}
dn += m;
continue;
}
for ((void) NULL; l > 0; l--) {
c = *cp++;
if (special(c)) {
if (dn + 1 >= eom) {
errno = EMSGSIZE;
return (-1);
}
*dn++ = '\\';
*dn++ = (char) c;
} else if (!printable(c)) {
if (dn + 3 >= eom) {
errno = EMSGSIZE;
return (-1);
}
*dn++ = '\\';
*dn++ = digits[c / 100];
*dn++ = digits[(c % 100) / 10];
*dn++ = digits[c % 10];
} else {
if (dn >= eom) {
errno = EMSGSIZE;
return (-1);
}
*dn++ = (char) c;
}
}
}
if (dn == dst) {
if (dn >= eom) {
errno = EMSGSIZE;
return (-1);
}
*dn++ = '.';
}
if (dn >= eom) {
errno = EMSGSIZE;
return (-1);
}
*dn++ = '\0';
return (dn - dst);
}
/*
* ns_name_pton(src, dst, dstsiz)
* Convert a ascii string into an encoded domain name as per RFC1035.
* return:
* -1 if it fails
* 1 if string was fully qualified
* 0 is string was not fully qualified
* notes:
* Enforces label and domain length limits.
*/
int
ns_name_pton(const char *src, u_char * dst, size_t dstsiz)
{
u_char *label, *bp, *eom;
int c, n, escaped, e = 0;
const char *cp;
escaped = 0;
bp = dst;
eom = dst + dstsiz;
label = bp++;
while ((c = *src++) != 0) {
if (escaped) {
if (c == '[') { /* start a bit string label */
if ((cp = strchr(src, ']')) == NULL) {
errno = EINVAL; /* ??? */
return (-1);
}
if ((e = encode_bitsring(&src,
cp + 2,
(char **) &label,
(char **) &bp,
(const char *) eom))
!= 0) {
errno = e;
return (-1);
}
escaped = 0;
label = bp++;
if ((c = *src++) == 0)
goto done;
else if (c != '.') {
errno = EINVAL;
return (-1);
}
continue;
} else if ((cp = strchr(digits, c)) != NULL) {
n = (cp - digits) * 100;
if ((c = *src++) == 0 || (cp = strchr(digits, c)) == NULL) {
errno = EMSGSIZE;
return (-1);
}
n += (cp - digits) * 10;
if ((c = *src++) == 0 || (cp = strchr(digits, c)) == NULL) {
errno = EMSGSIZE;
return (-1);
}
n += (cp - digits);
if (n > 255) {
errno = EMSGSIZE;
return (-1);
}
c = n;
}
escaped = 0;
} else if (c == '\\') {
escaped = 1;
continue;
} else if (c == '.') {
c = (bp - label - 1);
if ((c & NS_CMPRSFLGS) != 0) { /* Label too big. */
errno = EMSGSIZE;
return (-1);
}
if (label >= eom) {
errno = EMSGSIZE;
return (-1);
}
*label = c;
/*
* Fully qualified ?
*/
if (*src == '\0') {
if (c != 0) {
if (bp >= eom) {
errno = EMSGSIZE;
return (-1);
}
*bp++ = '\0';
}
if ((bp - dst) > NS_MAXCDNAME) {
errno = EMSGSIZE;
return (-1);
}
return (1);
}
if (c == 0 || *src == '.') {
errno = EMSGSIZE;
return (-1);
}
label = bp++;
continue;
}
if (bp >= eom) {
errno = EMSGSIZE;
return (-1);
}
*bp++ = (u_char) c;
}
c = (bp - label - 1);
if ((c & NS_CMPRSFLGS) != 0) { /* Label too big. */
errno = EMSGSIZE;
return (-1);
}
done:
if (label >= eom) {
errno = EMSGSIZE;
return (-1);
}
*label = c;
if (c != 0) {
if (bp >= eom) {
errno = EMSGSIZE;
return (-1);
}
*bp++ = 0;
}
if ((bp - dst) > NS_MAXCDNAME) { /* src too big */
errno = EMSGSIZE;
return (-1);
}
return (0);
}
/*
* ns_name_ntol(src, dst, dstsiz)
* Convert a network strings labels into all lowercase.
* return:
* Number of bytes written to buffer, or -1 (with errno set)
* notes:
* Enforces label and domain length limits.
*/
int
ns_name_ntol(const u_char * src, u_char * dst, size_t dstsiz)
{
const u_char *cp;
u_char *dn, *eom;
u_char c;
u_int n;
int l;
cp = src;
dn = dst;
eom = dst + dstsiz;
if (dn >= eom) {
errno = EMSGSIZE;
return (-1);
}
while ((n = *cp++) != 0) {
if ((n & NS_CMPRSFLGS) == NS_CMPRSFLGS) {
/*
* Some kind of compression pointer.
*/
errno = EMSGSIZE;
return (-1);
}
*dn++ = n;
if ((l = labellen(cp - 1)) < 0) {
errno = EMSGSIZE;
return (-1);
}
if (dn + l >= eom) {
errno = EMSGSIZE;
return (-1);
}
for ((void) NULL; l > 0; l--) {
c = *cp++;
if (isupper(c))
*dn++ = tolower(c);
else
*dn++ = c;
}
}
*dn++ = '\0';
return (dn - dst);
}
/*
* ns_name_unpack(msg, eom, src, dst, dstsiz)
* Unpack a domain name from a message, source may be compressed.
* return:
* -1 if it fails, or consumed octets if it succeeds.
*/
int
ns_name_unpack(const u_char * msg, const u_char * eom, const u_char * src,
u_char * dst, size_t dstsiz)
{
const u_char *srcp, *dstlim;
u_char *dstp;
int n, len, checked, l;
len = -1;
checked = 0;
dstp = dst;
srcp = src;
dstlim = dst + dstsiz;
if (srcp < msg || srcp >= eom) {
errno = EMSGSIZE;
return (-1);
}
/*
* Fetch next label in domain name.
*/
while ((n = *srcp++) != 0) {
/*
* Check for indirection.
*/
switch (n & NS_CMPRSFLGS) {
case 0:
case NS_TYPE_ELT:
/*
* Limit checks.
*/
if ((l = labellen(srcp - 1)) < 0) {
errno = EMSGSIZE;
return (-1);
}
if (dstp + l + 1 >= dstlim || srcp + l >= eom) {
errno = EMSGSIZE;
return (-1);
}
checked += l + 1;
*dstp++ = n;
memcpy(dstp, srcp, l);
dstp += l;
srcp += l;
break;
case NS_CMPRSFLGS:
if (srcp >= eom) {
errno = EMSGSIZE;
return (-1);
}
if (len < 0)
len = srcp - src + 1;
srcp = msg + (((n & 0x3f) << 8) | (*srcp & 0xff));
if (srcp < msg || srcp >= eom) { /* Out of range. */
errno = EMSGSIZE;
return (-1);
}
checked += 2;
/*
* Check for loops in the compressed name;
* if we've looked at the whole message,
* there must be a loop.
*/
if (checked >= eom - msg) {
errno = EMSGSIZE;
return (-1);
}
break;
default:
errno = EMSGSIZE;
return (-1); /* flag error */
}
}
*dstp = '\0';
if (len < 0)
len = srcp - src;
return (len);
}
/*
* ns_name_pack(src, dst, dstsiz, dnptrs, lastdnptr)
* Pack domain name 'domain' into 'comp_dn'.
* return:
* Size of the compressed name, or -1.
* notes:
* 'dnptrs' is an array of pointers to previous compressed names.
* dnptrs[0] is a pointer to the beginning of the message. The array
* ends with NULL.
* 'lastdnptr' is a pointer to the end of the array pointed to
* by 'dnptrs'.
* Side effects:
* The list of pointers in dnptrs is updated for labels inserted into
* the message as we compress the name. If 'dnptr' is NULL, we don't
* try to compress names. If 'lastdnptr' is NULL, we don't update the
* list.
*/
int
ns_name_pack(const u_char * src, u_char * dst, int dstsiz,
const u_char ** dnptrs, const u_char ** lastdnptr)
{
u_char *dstp;
const u_char **cpp, **lpp, *eob, *msg;
const u_char *srcp;
int n, l, first = 1;
srcp = src;
dstp = dst;
eob = dstp + dstsiz;
lpp = cpp = NULL;
if (dnptrs != NULL) {
if ((msg = *dnptrs++) != NULL) {
for (cpp = dnptrs; *cpp != NULL; cpp++)
(void) NULL;
lpp = cpp; /* end of list to search */
}
} else
msg = NULL;
/*
* make sure the domain we are about to add is legal
*/
l = 0;
do {
int tmp_l;
n = *srcp;
if ((n & NS_CMPRSFLGS) == NS_CMPRSFLGS) {
errno = EMSGSIZE;
return (-1);
}
if ((tmp_l = labellen(srcp)) < 0) {
errno = EINVAL;
return (-1);
}
l += tmp_l + 1;
if (l > NS_MAXCDNAME) {
errno = EMSGSIZE;
return (-1);
}
srcp += tmp_l + 1;
} while (n != 0);
/*
* from here on we need to reset compression pointer array on error
*/
srcp = src;
do {
/*
* Look to see if we can use pointers.
*/
n = *srcp;
if (n != 0 && msg != NULL) {
l = dn_find(srcp, msg, (const u_char * const *) dnptrs,
(const u_char * const *) lpp);
if (l >= 0) {
if (dstp + 1 >= eob) {
goto cleanup;
}
*dstp++ = (l >> 8) | NS_CMPRSFLGS;
*dstp++ = l % 256;
return (dstp - dst);
}
/*
* Not found, save it.
*/
if (lastdnptr != NULL && cpp < lastdnptr - 1 &&
(dstp - msg) < 0x4000 && first) {
*cpp++ = dstp;
*cpp = NULL;
first = 0;
}
}
/*
* copy label to buffer
*/
if ((n & NS_CMPRSFLGS) == NS_CMPRSFLGS) {
/*
* Should not happen.
*/
goto cleanup;
}
n = labellen(srcp);
if (dstp + 1 + n >= eob) {
goto cleanup;
}
memcpy(dstp, srcp, n + 1);
srcp += n + 1;
dstp += n + 1;
} while (n != 0);
if (dstp > eob) {
cleanup:
if (msg != NULL)
*lpp = NULL;
errno = EMSGSIZE;
return (-1);
}
return (dstp - dst);
}
/*
* ns_name_uncompress(msg, eom, src, dst, dstsiz)
* Expand compressed domain name to presentation format.
* return:
* Number of bytes read out of `src', or -1 (with errno set).
* note:
* Root domain returns as "." not "".
*/
int
ns_name_uncompress(const u_char * msg, const u_char * eom,
const u_char * src, char *dst, size_t dstsiz)
{
u_char tmp[NS_MAXCDNAME];
int n;
if ((n = ns_name_unpack(msg, eom, src, tmp, sizeof(tmp))) == -1)
return (-1);
if (ns_name_ntop(tmp, dst, dstsiz) == -1)
return (-1);
return (n);
}
/*
* ns_name_compress(src, dst, dstsiz, dnptrs, lastdnptr)
* Compress a domain name into wire format, using compression pointers.
* return:
* Number of bytes consumed in `dst' or -1 (with errno set).
* notes:
* 'dnptrs' is an array of pointers to previous compressed names.
* dnptrs[0] is a pointer to the beginning of the message.
* The list ends with NULL. 'lastdnptr' is a pointer to the end of the
* array pointed to by 'dnptrs'. Side effect is to update the list of
* pointers for labels inserted into the message as we compress the name.
* If 'dnptr' is NULL, we don't try to compress names. If 'lastdnptr'
* is NULL, we don't update the list.
*/
int
ns_name_compress(const char *src, u_char * dst, size_t dstsiz,
const u_char ** dnptrs, const u_char ** lastdnptr)
{
u_char tmp[NS_MAXCDNAME];
if (ns_name_pton(src, tmp, sizeof(tmp)) == -1)
return (-1);
return (ns_name_pack(tmp, dst, dstsiz, dnptrs, lastdnptr));
}
/*
* Reset dnptrs so that there are no active references to pointers at or
* after src.
*/
void
ns_name_rollback(const u_char * src, const u_char ** dnptrs,
const u_char ** lastdnptr)
{
while (dnptrs < lastdnptr && *dnptrs != NULL) {
if (*dnptrs >= src) {
*dnptrs = NULL;
break;
}
dnptrs++;
}
}
/*
* ns_name_skip(ptrptr, eom)
* Advance *ptrptr to skip over the compressed name it points at.
* return:
* 0 on success, -1 (with errno set) on failure.
*/
int
ns_name_skip(const u_char ** ptrptr, const u_char * eom)
{
const u_char *cp;
u_int n;
int l;
cp = *ptrptr;
while (cp < eom && (n = *cp++) != 0) {
/*
* Check for indirection.
*/
switch (n & NS_CMPRSFLGS) {
case 0: /* normal case, n == len */
cp += n;
continue;
case NS_TYPE_ELT: /* EDNS0 extended label */
if ((l = labellen(cp - 1)) < 0) {
errno = EMSGSIZE; /* XXX */
return (-1);
}
cp += l;
continue;
case NS_CMPRSFLGS: /* indirection */
cp++;
break;
default: /* illegal type */
errno = EMSGSIZE;
return (-1);
}
break;
}
if (cp > eom) {
errno = EMSGSIZE;
return (-1);
}
*ptrptr = cp;
return (0);
}
/*
* Private.
*/
/*
* special(ch)
* Thinking in noninternationalized USASCII (per the DNS spec),
* is this characted special ("in need of quoting") ?
* return:
* boolean.
*/
static int
special(int ch)
{
switch (ch) {
case 0x22: /* '"' */
case 0x2E: /* '.' */
case 0x3B: /* ';' */
case 0x5C: /* '\\' */
case 0x28: /* '(' */
case 0x29: /* ')' */
/*
* Special modifiers in zone files.
*/
case 0x40: /* '@' */
case 0x24: /* '$' */
return (1);
default:
return (0);
}
}
/*
* printable(ch)
* Thinking in noninternationalized USASCII (per the DNS spec),
* is this character visible and not a space when printed ?
* return:
* boolean.
*/
static int
printable(int ch)
{
return (ch > 0x20 && ch < 0x7f);
}
/*
* Thinking in noninternationalized USASCII (per the DNS spec),
* convert this character to lower case if it's upper case.
*/
static int
mklower(int ch)
{
if (ch >= 0x41 && ch <= 0x5A)
return (ch + 0x20);
return (ch);
}
/*
* dn_find(domain, msg, dnptrs, lastdnptr)
* Search for the counted-label name in an array of compressed names.
* return:
* offset from msg if found, or -1.
* notes:
* dnptrs is the pointer to the first name on the list,
* not the pointer to the start of the message.
*/
static int
dn_find(const u_char * domain, const u_char * msg,
const u_char * const *dnptrs, const u_char * const *lastdnptr)
{
const u_char *dn, *cp, *sp;
const u_char *const *cpp;
u_int n;
for (cpp = dnptrs; cpp < lastdnptr; cpp++) {
sp = *cpp;
/*
* terminate search on:
* root label
* compression pointer
* unusable offset
*/
while (*sp != 0 && (*sp & NS_CMPRSFLGS) == 0 &&
(sp - msg) < 0x4000) {
dn = domain;
cp = sp;
while ((n = *cp++) != 0) {
/*
* check for indirection
*/
switch (n & NS_CMPRSFLGS) {
case 0: /* normal case, n == len */
n = labellen(cp - 1); /* XXX */
if (n != *dn++)
goto next;
for ((void) NULL; n > 0; n--)
if (mklower(*dn++) != mklower(*cp++))
goto next;
/*
* Is next root for both ?
*/
if (*dn == '\0' && *cp == '\0')
return (sp - msg);
if (*dn)
continue;
goto next;
case NS_CMPRSFLGS: /* indirection */
cp = msg + (((n & 0x3f) << 8) | *cp);
break;
default: /* illegal type */
errno = EMSGSIZE;
return (-1);
}
}
next:;
sp += *sp + 1;
}
}
errno = ENOENT;
return (-1);
}
static int
decode_bitstring(const char **cpp, char *dn, const char *eom)
{
const char *cp = *cpp;
char *beg = dn, tc;
int b, blen, plen, i;
if ((blen = (*cp & 0xff)) == 0)
blen = 256;
plen = (blen + 3) / 4;
plen += sizeof("\\[x/]") + (blen > 99 ? 3 : (blen > 9) ? 2 : 1);
if (dn + plen >= eom)
return (-1);
cp++;
i = SPRINTF((dn, "\\[x"));
if (i < 0)
return (-1);
dn += i;
for (b = blen; b > 7; b -= 8, cp++) {
i = SPRINTF((dn, "%02x", *cp & 0xff));
if (i < 0)
return (-1);
dn += i;
}
if (b > 4) {
tc = *cp++;
i = SPRINTF((dn, "%02x", tc & (0xff << (8 - b))));
if (i < 0)
return (-1);
dn += i;
} else if (b > 0) {
tc = *cp++;
i = SPRINTF((dn, "%1x", ((tc >> 4) & 0x0f) & (0x0f << (4 - b))));
if (i < 0)
return (-1);
dn += i;
}
i = SPRINTF((dn, "/%d]", blen));
if (i < 0)
return (-1);
dn += i;
*cpp = cp;
return (dn - beg);
}
static int
encode_bitsring(const char **bp, const char *end, char **labelp,
char **dst, const char *eom)
{
int afterslash = 0;
const char *cp = *bp;
char *tp, c;
const char *beg_blen;
char *end_blen = NULL;
int value = 0, count = 0, tbcount = 0, blen = 0;
beg_blen = end_blen = NULL;
/*
* a bitstring must contain at least 2 characters
*/
if (end - cp < 2)
return (EINVAL);
/*
* XXX: currently, only hex strings are supported
*/
if (*cp++ != 'x')
return (EINVAL);
if (!isxdigit((*cp) & 0xff)) /* reject '\[x/BLEN]' */
return (EINVAL);
for (tp = *dst + 1; cp < end && tp < eom; cp++) {
switch ((c = *cp)) {
case ']': /* end of the bitstring */
if (afterslash) {
if (beg_blen == NULL)
return (EINVAL);
blen = (int) strtol(beg_blen, &end_blen, 10);
if (*end_blen != ']')
return (EINVAL);
}
if (count)
*tp++ = ((value << 4) & 0xff);
cp++; /* skip ']' */
goto done;
case '/':
afterslash = 1;
break;
default:
if (afterslash) {
if (!isdigit(c & 0xff))
return (EINVAL);
if (beg_blen == NULL) {
if (c == '0') {
/*
* blen never begings with 0
*/
return (EINVAL);
}
beg_blen = cp;
}
} else {
if (!isxdigit(c & 0xff))
return (EINVAL);
value <<= 4;
value += digitvalue[(int) c];
count += 4;
tbcount += 4;
if (tbcount > 256)
return (EINVAL);
if (count == 8) {
*tp++ = value;
count = 0;
}
}
break;
}
}
done:
if (cp >= end || tp >= eom)
return (EMSGSIZE);
/*
* bit length validation:
* If a is present, the number of digits in the
* MUST be just sufficient to contain the number of bits specified
* by the . If there are insignificant bits in a final
* hexadecimal or octal digit, they MUST be zero.
* RFC 2673, Section 3.2.
*/
if (blen > 0) {
int traillen;
if (((blen + 3) & ~3) != tbcount)
return (EINVAL);
traillen = tbcount - blen; /* between 0 and 3 */
if (((value << (8 - traillen)) & 0xff) != 0)
return (EINVAL);
} else
blen = tbcount;
if (blen == 256)
blen = 0;
/*
* encode the type and the significant bit fields
*/
**labelp = DNS_LABELTYPE_BITSTRING;
**dst = blen;
*bp = cp;
*dst = tp;
return (0);
}
static int
labellen(const u_char * lp)
{
int bitlen;
u_char l = *lp;
if ((l & NS_CMPRSFLGS) == NS_CMPRSFLGS) {
/*
* should be avoided by the caller
*/
return (-1);
}
if ((l & NS_CMPRSFLGS) == NS_TYPE_ELT) {
if (l == DNS_LABELTYPE_BITSTRING) {
if ((bitlen = *(lp + 1)) == 0)
bitlen = 256;
return ((bitlen + 7) / 8 + 1);
}
return (-1); /* unknwon ELT */
}
return (l);
}
dnsval-2.0/libsres/dllmain.c 0000775 0002372 0002372 00000001024 11732136442 016224 0 ustar hardaker hardaker // dllmain.cpp : Defines the entry point for the DLL application.
#include
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
dnsval-2.0/libsres/.cvsignore 0000664 0002372 0002372 00000000044 10424167717 016444 0 ustar hardaker hardaker Makefile
*.lo
*.la
.libs
cscope.out
dnsval-2.0/libsres/ns_samedomain.c 0000664 0002372 0002372 00000012542 11732713653 017432 0 ustar hardaker hardaker /*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1995,1999 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "validator-internal.h"
/*
* int
* ns_samedomain(a, b)
* Check whether a name belongs to a domain.
* Inputs:
* a - the domain whose ancestory is being verified
* b - the potential ancestor we're checking against
* Return:
* boolean - is a at or below b?
* Notes:
* Trailing dots are first removed from name and domain.
* Always compare complete subdomains, not only whether the
* domain name is the trailing string of the given name.
*
* "host.foobar.top" lies in "foobar.top" and in "top" and in ""
* but NOT in "bar.top"
*/
int
ns_samedomain(const char *a, const char *b)
{
size_t la, lb;
int diff, i, escaped;
const char *cp;
la = strlen(a);
lb = strlen(b);
/*
* Ignore a trailing label separator (i.e. an unescaped dot) in 'a'.
*/
if (la != 0U && a[la - 1] == '.') {
escaped = 0;
/** Note this loop doesn't get executed if la==1. */
for (i = la - 2; i >= 0; i--)
if (a[i] == '\\') {
if (escaped)
escaped = 0;
else
escaped = 1;
} else
break;
if (!escaped)
la--;
}
/*
* Ignore a trailing label separator (i.e. an unescaped dot) in 'b'.
*/
if (lb != 0U && b[lb - 1] == '.') {
escaped = 0;
/** note this loop doesn't get executed if lb==1 */
for (i = lb - 2; i >= 0; i--)
if (b[i] == '\\') {
if (escaped)
escaped = 0;
else
escaped = 1;
} else
break;
if (!escaped)
lb--;
}
/*
* lb == 0 means 'b' is the root domain, so 'a' must be in 'b'.
*/
if (lb == 0U)
return (1);
/*
* 'b' longer than 'a' means 'a' can't be in 'b'.
*/
if (lb > la)
return (0);
/*
* 'a' and 'b' being equal at this point indicates sameness.
*/
if (lb == la)
return (strncasecmp(a, b, lb) == 0);
/*
* Ok, we know la > lb.
*/
diff = la - lb;
/*
* If 'a' is only 1 character longer than 'b', then it can't be
* a subdomain of 'b' (because of the need for the '.' label
* separator).
*/
if (diff < 2)
return (0);
/*
* If the character before the last 'lb' characters of 'b'
* isn't '.', then it can't be a match (this lets us avoid
* having "foobar.com" match "bar.com").
*/
if (a[diff - 1] != '.')
return (0);
/*
* We're not sure about that '.', however. It could be escaped
* and thus not a really a label separator.
*/
escaped = 0;
for (i = diff - 2; i >= 0; i--)
if (a[i] == '\\') {
if (escaped)
escaped = 0;
else
escaped = 1;
} else
break;
if (escaped)
return (0);
/*
* Now compare aligned trailing substring.
*/
cp = a + diff;
return (strncasecmp(cp, b, lb) == 0);
}
/*
* int
* ns_makecanon(src, dst, dstsize)
* make a canonical copy of domain name "src"
* notes:
* foo -> foo.
* foo. -> foo.
* foo.. -> foo.
* foo\. -> foo\..
* foo\\. -> foo\\.
*/
int
ns_makecanon(const char *src, char *dst, size_t dstsize)
{
size_t n = strlen(src);
if (n + sizeof(".") > dstsize) { /* Note: sizeof == 2 */
errno = EMSGSIZE;
return (-1);
}
strcpy(dst, src);
while (n >= 1U && dst[n - 1] == '.') /* Ends in "." */
if (n >= 2U && dst[n - 2] == '\\' && /* Ends in "\." */
(n < 3U || dst[n - 3] != '\\')) /* But not "\\." */
break;
else
dst[--n] = '\0';
dst[n++] = '.';
dst[n] = '\0';
return (0);
}
/*
* int
* ns_samename(a, b)
* determine whether domain name "a" is the same as domain name "b"
* return:
* -1 on error
* 0 if names differ
* 1 if names are the same
*/
int
ns_samename(const char *a, const char *b)
{
char ta[NS_MAXDNAME], tb[NS_MAXDNAME];
if (ns_makecanon(a, ta, sizeof(ta)) < 0 ||
ns_makecanon(b, tb, sizeof(tb)) < 0)
return (-1);
if (strncasecmp(ta, tb, NS_MAXDNAME) == 0)
return (1);
else
return (0);
}
/*
* int
* ns_subdomain(a, b)
* is "a" a subdomain of "b"?
*/
int
ns_subdomain(const char *a, const char *b)
{
return (ns_samename(a, b) != 1 && ns_samedomain(a, b));
}
dnsval-2.0/libsres/res_comp.c 0000664 0002372 0002372 00000017161 11732713653 016426 0 ustar hardaker hardaker /*
* Copyright (c) 1985, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Portions Copyright (c) 1993 by Digital Equipment Corporation.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies, and that
* the name of Digital Equipment Corporation not be used in advertising or
* publicity pertaining to distribution of the document or software without
* specific, written prior permission.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
* CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
/*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Portions Copyright (c) 1996-1999 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "validator-internal.h"
/*
* Expand compressed domain name 'src' to full domain name.
* 'msg' is a pointer to the begining of the message,
* 'eom' points to the first location after the message,
* 'dst' is a pointer to a buffer of size 'dstsiz' for the result.
* Return size of compressed name or -1 if there was an error.
*/
int
dn_expand(const u_char * msg, const u_char * eom, const u_char * src,
char *dst, int dstsiz)
{
int n =
ns_name_uncompress(msg, eom, src, dst, (size_t) dstsiz);
if (n > 0 && dst[0] == '.')
dst[0] = '\0';
return (n);
}
/*
* Pack domain name 'exp_dn' in presentation form into 'comp_dn'.
* Return the size of the compressed name or -1.
* 'length' is the size of the array pointed to by 'comp_dn'.
*/
int
dn_comp(const char *src, u_char * dst, int dstsiz,
u_char ** dnptrs, u_char ** lastdnptr)
{
return (ns_name_compress(src, dst, (size_t) dstsiz,
(const u_char **) dnptrs,
(const u_char **) lastdnptr));
}
/*
* Skip over a compressed domain name. Return the size or -1.
*/
int
dn_skipname(const u_char * ptr, const u_char * eom)
{
const u_char *saveptr = ptr;
if (ns_name_skip(&ptr, eom) == -1)
return (-1);
return (ptr - saveptr);
}
/*
* Verify that a domain name uses an acceptable character set.
*/
/*
* Note the conspicuous absence of ctype macros in these definitions. On
* non-ASCII hosts, we can't depend on string literals or ctype macros to
* tell us anything about network-format data. The rest of the BIND system
* is not careful about this, but for some reason, we're doing it right here.
*/
#define PERIOD 0x2e
#define hyphenchar(c) ((c) == 0x2d)
#define bslashchar(c) ((c) == 0x5c)
#define periodchar(c) ((c) == PERIOD)
#define asterchar(c) ((c) == 0x2a)
#define alphachar(c) (((c) >= 0x41 && (c) <= 0x5a) \
|| ((c) >= 0x61 && (c) <= 0x7a))
#define digitchar(c) ((c) >= 0x30 && (c) <= 0x39)
#define borderchar(c) (alphachar(c) || digitchar(c))
#define middlechar(c) (borderchar(c) || hyphenchar(c))
#define domainchar(c) ((c) > 0x20 && (c) < 0x7f)
int
res_hnok(const char *dn)
{
int pch = PERIOD, ch = *dn++;
while (ch != '\0') {
int nch = *dn++;
if (periodchar(ch)) {
(void) NULL;
} else if (periodchar(pch)) {
if (!borderchar(ch))
return (0);
} else if (periodchar(nch) || nch == '\0') {
if (!borderchar(ch))
return (0);
} else {
if (!middlechar(ch))
return (0);
}
pch = ch, ch = nch;
}
return (1);
}
/*
* hostname-like (A, MX, WKS) owners can have "*" as their first label
* but must otherwise be as a host name.
*/
int
res_ownok(const char *dn)
{
if (asterchar(dn[0])) {
if (periodchar(dn[1]))
return (res_hnok(dn + 2));
if (dn[1] == '\0')
return (1);
}
return (res_hnok(dn));
}
/*
* SOA RNAMEs and RP RNAMEs can have any printable character in their first
* label, but the rest of the name has to look like a host name.
*/
int
res_mailok(const char *dn)
{
int ch, escaped = 0;
/*
* "." is a valid missing representation
*/
if (*dn == '\0')
return (1);
/*
* otherwise .
*/
while ((ch = *dn++) != '\0') {
if (!domainchar(ch))
return (0);
if (!escaped && periodchar(ch))
break;
if (escaped)
escaped = 0;
else if (bslashchar(ch))
escaped = 1;
}
if (periodchar(ch))
return (res_hnok(dn));
return (0);
}
/*
* This function is quite liberal, since RFC 1034's character sets are only
* recommendations.
*/
int
res_dnok(const char *dn)
{
int ch;
while ((ch = *dn++) != '\0')
if (!domainchar(ch))
return (0);
return (1);
}
dnsval-2.0/libsres/ns_ttl.c 0000664 0002372 0002372 00000006547 11732713653 016130 0 ustar hardaker hardaker /*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996,1999 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "validator-internal.h"
/*
* Forward.
*/
static int fmt1(int t, char s, char **buf, size_t * buflen);
/*
* Macros.
*/
#define T(x) if ((x) < 0) return (-1); else (void)NULL
/*
* Public.
*/
int
ns_format_ttl(u_long src, char *dst, size_t dstlen)
{
char *odst = dst;
int secs, mins, hours, days, weeks, x;
char *p;
secs = src % 60;
src /= 60;
mins = src % 60;
src /= 60;
hours = src % 24;
src /= 24;
days = src % 7;
src /= 7;
weeks = src;
src = 0;
x = 0;
if (weeks) {
T(fmt1(weeks, 'W', &dst, &dstlen));
x++;
}
if (days) {
T(fmt1(days, 'D', &dst, &dstlen));
x++;
}
if (hours) {
T(fmt1(hours, 'H', &dst, &dstlen));
x++;
}
if (mins) {
T(fmt1(mins, 'M', &dst, &dstlen));
x++;
}
if (secs || !(weeks || days || hours || mins)) {
T(fmt1(secs, 'S', &dst, &dstlen));
x++;
}
if (x > 1) {
int ch;
for (p = odst; (ch = *p) != '\0'; p++)
if (isascii(ch) && isupper(ch))
*p = tolower(ch);
}
return (dst - odst);
}
int
ns_parse_ttl(const char *src, u_long * dst)
{
u_long ttl, tmp;
int ch, digits, dirty;
ttl = 0;
tmp = 0;
digits = 0;
dirty = 0;
while ((ch = *src++) != '\0') {
if (!isascii(ch) || !isprint(ch))
goto einval;
if (isdigit(ch)) {
tmp *= 10;
tmp += (ch - '0');
digits++;
continue;
}
if (digits == 0)
goto einval;
if (islower(ch))
ch = toupper(ch);
switch (ch) {
case 'W':
tmp *= 7;
case 'D':
tmp *= 24;
case 'H':
tmp *= 60;
case 'M':
tmp *= 60;
case 'S':
break;
default:
goto einval;
}
ttl += tmp;
tmp = 0;
digits = 0;
dirty = 1;
}
if (digits > 0) {
if (dirty)
goto einval;
else
ttl += tmp;
}
*dst = ttl;
return (0);
einval:
errno = EINVAL;
return (-1);
}
/*
* Private.
*/
static int
fmt1(int t, char s, char **buf, size_t * buflen)
{
char tmp[50];
size_t len;
len = SPRINTF((tmp, "%d%c", t, s));
if (len + 1 > *buflen)
return (-1);
strcpy(*buf, tmp);
*buf += len;
*buflen -= len;
return (0);
}
dnsval-2.0/libsres/base64.h 0000664 0002372 0002372 00000000212 11560322751 015667 0 ustar hardaker hardaker #ifndef _BASE64_H_
#define _BASE64_H_
int
b64_ntop(u_char const *src, size_t srclength, char *target,
size_t targsize);
#endif
dnsval-2.0/libsres/libsres.def 0000775 0002372 0002372 00000002263 11732365556 016603 0 ustar hardaker hardaker LIBRARY libsres
EXPORTS
wire_name_length
query_send
query_queue
response_recv
res_response_checks
res_cancel
res_nsfallback
wait_for_res_data
get_tcp
print_response
res_gettimeofday_buf
create_nsaddr_array
create_name_server
parse_name_server
clone_ns
clone_ns_list
free_name_server
free_name_servers
res_set_debug_level
res_get_debug_level
res_io_view
label_bytes_cmp
labelcmp
namecmp
res_map_srio_to_sr
res_nametoclass
res_nametotype
res_io_view
res_io_check_one
res_nsfallback_ea
res_async_query_create
res_async_query_send
res_async_query_select_info
res_async_query_handle
res_async_query_free
res_io_check_one
res_io_check_ea_list
res_io_get_a_response
res_io_cancel_remaining_attempts
res_io_cancel_all_remaining_attempts
res_io_is_finished
res_io_are_all_finished
res_io_count_ready
res_async_ea_is_using_stream
res_async_ea_isset
ns_name_ntop
ns_name_pton
p_class
p_sres_type
ns_name_unpack
ns_parse_ttl
p_section
gettimeofday
dnsval-2.0/libsres/ns_netint.c 0000664 0002372 0002372 00000002726 11732713653 016621 0 ustar hardaker hardaker /*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996,1999 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "validator-internal.h"
#include "res_support.h"
/*
* Public.
*/
#ifdef __NetBSD__
#define NS_GETPUT16_TYPE u_int16_t
#define NS_GETPUT32_TYPE u_int32_t
#else
#define NS_GETPUT16_TYPE u_int
#define NS_GETPUT32_TYPE u_long
#endif
NS_GETPUT16_TYPE
ns_get16(const u_char * src)
{
NS_GETPUT16_TYPE dst;
RES_GET16(dst, src);
return (dst);
}
NS_GETPUT32_TYPE
ns_get32(const u_char * src)
{
NS_GETPUT32_TYPE dst;
RES_GET32(dst, src);
return (dst);
}
void
ns_put16(NS_GETPUT16_TYPE src, u_char * dst)
{
RES_PUT16(src, dst);
}
void
ns_put32(NS_GETPUT32_TYPE src, u_char * dst)
{
RES_PUT32(src, dst);
}
dnsval-2.0/libsres/Makefile.in 0000664 0002372 0002372 00000002452 11733111275 016506 0 ustar hardaker hardaker # the resulting Makefile is built from TOPSRCDIR/Makefile.top and Makefile.in
SRC= ns_name.c \
ns_netint.c \
res_support.c \
res_debug.c \
nsap_addr.c \
ns_print.c \
base64.c \
ns_samedomain.c \
ns_parse.c \
ns_ttl.c \
res_comp.c \
res_mkquery.c \
res_io_manager.c \
res_tsig.c \
res_query.c
# can't use gmake conventions to translate SRC -> OBJ for portability
OBJ= ns_name.o \
ns_netint.o \
res_support.o \
res_debug.o \
nsap_addr.o \
ns_print.o \
base64.o \
ns_samedomain.o \
ns_parse.o \
ns_ttl.o \
res_comp.o \
res_mkquery.o \
res_io_manager.o \
res_tsig.o \
res_query.o
LOBJ= ns_name.lo \
ns_netint.lo \
res_support.lo \
res_debug.lo \
nsap_addr.lo \
ns_print.lo \
base64.lo \
ns_samedomain.lo \
ns_parse.lo \
ns_ttl.lo \
res_comp.lo \
res_mkquery.lo \
res_io_manager.lo \
res_tsig.lo \
res_query.lo
LIBRES= libsres.la
INCLUDE= ../include
CFLAGS_EX=-I$(INCLUDE)
LT_DIR= .libs
all: $(LIBRES)
clean:
$(RM) -f $(OBJ) $(LOBJ) $(LIBRES) $(LIBSRESSO)
$(RM) -rf $(LT_DIR)
$(LIBRES): $(LOBJ)
$(LIBTOOLLD) -o $@ $(LOBJ)
install:
$(MKPATH) $(DESTDIR)$(libdir)
$(LIBTOOLIN) $(LIBRES) $(DESTDIR)$(libdir)
$(LIBTOOLFN) $(DESTDIR)$(libdir)
$(MKPATH) $(DESTDIR)$(includedir)
$(INSTALL) -m 644 ../include/validator/resolver.h \
$(DESTDIR)$(includedir)
dnsval-2.0/libsres/res_debug.h 0000664 0002372 0002372 00000000765 12110743567 016563 0 ustar hardaker hardaker #ifndef _RES_DEBUG_H_
#define _RES_DEBUG_H_
/*
* some system prototypes don't match up
*/
#ifdef sun
#define P_OPTION_ARG_TYPE uint_t
#define P_SECSTODATE_ARG_TYPE uint_t
#else
#define P_OPTION_ARG_TYPE u_long
#define P_SECSTODATE_ARG_TYPE u_long
#endif
#if defined(__OpenBSD__)
int
dn_count_labels(char *name);
#else
int
dn_count_labels(const char *name);
#endif
const char *
loc_ntoa(const u_char *binary, char *ascii);
char *
p_secstodate(P_SECSTODATE_ARG_TYPE secs);
#endif
dnsval-2.0/libsres/res_debug.c 0000664 0002372 0002372 00000110413 12110751473 016541 0 ustar hardaker hardaker /*
* Copyright (c) 1985
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Portions Copyright (c) 1993 by Digital Equipment Corporation.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies, and that
* the name of Digital Equipment Corporation not be used in advertising or
* publicity pertaining to distribution of the document or software without
* specific, written prior permission.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
* CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
/*
* Portions Copyright (c) 1995 by International Business Machines, Inc.
*
* International Business Machines, Inc. (hereinafter called IBM) grants
* permission under its copyrights to use, copy, modify, and distribute this
* Software with or without fee, provided that the above copyright notice and
* all paragraphs of this notice appear in all copies, and that the name of IBM
* not be used in connection with the marketing of any product incorporating
* the Software or modifications thereof, without specific, written prior
* permission.
*
* To the extent it has a right to do so, IBM grants an immunity from suit
* under its patents, if any, for the use, sale or manufacture of products to
* the extent that such products are used for performing Domain Name System
* dynamic updates in TCP/IP networks by means of the Software. No immunity is
* granted for any product per se or for any other function of any product.
*
* THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL,
* DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN
* IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
/*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Portions Copyright (c) 1996-1999 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "validator-internal.h"
#include "res_support.h"
#include "res_comp.h"
#include "res_debug.h"
const char *_libsres_opcodes[] = {
"QUERY",
"IQUERY",
"CQUERYM",
"CQUERYU", /* experimental */
"NOTIFY", /* experimental */
"UPDATE",
"6",
"7",
"8",
"9",
"10",
"11",
"12",
"13",
"ZONEINIT",
"ZONEREF",
};
/*
* some system headers are outdated
*/
#ifndef NS_ALG_DH
#define NS_ALG_DH 2 /* Diffie Hellman KEY */
#define NS_ALG_DSA 3 /* DSA KEY */
#define NS_ALG_DSS NS_ALG_DSA
#endif
#ifndef HAVE_NS_CERT_TYPES
typedef enum __ns_cert_types {
cert_t_pkix = 1, /* PKIX (X.509v3) */
cert_t_spki = 2, /* SPKI */
cert_t_pgp = 3, /* PGP */
cert_t_url = 253, /* URL private type */
cert_t_oid = 254 /* OID private type */
} ns_cert_types;
#endif
/*
* some system prototypes are missing
*/
#if defined HAVE_DECL_P_RCODE && !HAVE_DECL_P_RCODE
const char *p_rcode(int);
#endif
extern const char *_res_sectioncodes[];
#define ERRBUFLEN 80
static void
_print_or_log(void *file, int level, const char *template, ...)
{
va_list ap;
va_start(ap, template);
if (NULL == file)
res_log_ap((val_context_t*)NULL, level, template, ap);
else
vfprintf(file, template, ap);
va_end(ap);
}
static void
do_section(ns_msg * handle, ns_sect section, int pflag, FILE * file)
{
int n, rrnum;
const static int buflen = 2048;
char *buf;
ns_opcode opcode;
ns_rr rr;
#ifdef HAVE_STRERROR_R
char err_buf[ERRBUFLEN + 1];
#endif
buf = (char *)MALLOC(buflen);
if (buf == NULL) {
res_log(NULL,LOG_DEBUG, ";; memory allocation failure\n");
return;
}
opcode = (ns_opcode) libsres_msg_getflag(*handle, ns_f_opcode);
rrnum = 0;
for (;;) {
if (ns_parserr(handle, section, rrnum, &rr)) {
if (errno != ENODEV) {
#ifdef HAVE_STRERROR_R
if (!strerror_r(errno, err_buf, ERRBUFLEN))
_print_or_log(file, LOG_DEBUG, ";; ns_parserr: %s\n", err_buf);
else
_print_or_log(file, LOG_DEBUG, ";; ns_parserr: Error\n");
#else
_print_or_log(file, LOG_DEBUG, ";; ns_parserr: %s\n", strerror(errno));
#endif
}
goto cleanup;
}
if (section == ns_s_qd)
_print_or_log(file, LOG_DEBUG, ";;\t%s, type = %s, class = %s\n",
ns_rr_name(rr),
p_type(ns_rr_type(rr)), p_class(ns_rr_class(rr)));
else if (section == ns_s_ar && ns_rr_type(rr) == ns_t_opt) {
u_int32_t ttl = ns_rr_ttl(rr);
_print_or_log(file, LOG_DEBUG,
"; EDNS: version: %u, udp=%u, flags=%04x\n",
(ttl >> 16) & 0xff, ns_rr_class(rr), ttl & 0xffff);
} else {
n = ns_sprintrr(handle, &rr, NULL, NULL, buf, buflen);
if (n < 0) {
if (errno == ENOSPC) {
FREE(buf);
buf = NULL;
#if 0
if (buflen < 131072)
buf = MALLOC(buflen += 1024);
#endif
if (buf == NULL) {
_print_or_log(file, LOG_DEBUG, ";; memory allocation failure\n");
return;
}
continue;
}
#ifdef HAVE_STRERROR_R
if (!strerror_r(errno, err_buf, ERRBUFLEN))
_print_or_log(file, LOG_DEBUG, ";; ns_sprintrr: %s\n", err_buf);
else
_print_or_log(file, LOG_DEBUG, ";; ns_sprintrr: Error\n");
#else
_print_or_log(file, LOG_DEBUG, ";; ns_sprintrr: %s\n", strerror(errno));
#endif
goto cleanup;
}
_print_or_log(file, LOG_DEBUG, "%s\n", buf);
}
rrnum++;
}
cleanup:
if (buf != NULL)
FREE(buf);
}
const u_char *
p_cdnname(const u_char * cp, const u_char * msg, int len, FILE * file)
{
char name[NS_MAXDNAME];
int n;
if ((n = dn_expand(msg, msg + len, cp, name, sizeof(name))) < 0)
return (NULL);
if (name[0] == '\0')
_print_or_log(file, LOG_DEBUG, "%c", '.');
else
_print_or_log(file, LOG_DEBUG, "%s", name);
return (cp + n);
}
const u_char *
p_cdname(const u_char * cp, const u_char * msg, FILE * file)
{
return (p_cdnname(cp, msg, NS_PACKETSZ, file));
}
/*
* Return a fully-qualified domain name from a compressed name (with
* length supplied).
*/
const u_char *
p_fqnname(const u_char *cp, const u_char *msg, int msglen, char *name, int namelen)
{
int n, newlen;
if ((n = dn_expand(msg, cp + msglen, cp, name, namelen)) < 0)
return (NULL);
newlen = strlen(name);
if (newlen == 0 || name[newlen - 1] != '.') {
if (newlen + 1 >= namelen) /* Lack space for final dot */
return (NULL);
else
strcpy(name + newlen, ".");
}
return (cp + n);
}
/*
* XXX: the rest of these functions need to become length-limited, too.
*/
const u_char *
p_fqname(const u_char * cp, const u_char * msg, FILE * file)
{
char name[NS_MAXDNAME];
const u_char *n;
n = p_fqnname(cp, msg, NS_MAXCDNAME, name, sizeof(name));
if (n == NULL)
return (NULL);
_print_or_log(file, LOG_DEBUG, "%s", name);
return (n);
}
/*
* the original res_sym struct used regular, non-const, char* pointers.
* this causes a slew of warning about initialization discarding qualifiers,
* so this is the same structure but with const char* pointers.
* On BSD, the definition from resolv.h cannot be included safely with the current
* configure script, so we use this internal type.
*
* Unfortuantely, on OS X, __p_class_sym is a macro, and exported with the
* original res_sym type. So in this case, we don't use this hack.
*
* And, for once, solaris has a better header than the rest, and has const
* char ptrs in res_sym.
*/
#if (defined(__APPLE__) || defined(sun) || defined(__CYGWIN__) || defined(linux)) && !defined(ANDROID)
#define RES_SYM_TYPE res_sym
#else
struct res_sym_const {
int number; /* Identifying number, like T_MX */
const char *name; /* Its symbolic name, like "MX" */
const char *humanname; /* Its fun name, like "mail exchanger" */
};
#define RES_SYM_TYPE res_sym_const
#endif
/*
* Names of RR classes and qclasses. Classes and qclasses are the same, except
* that ns_c_any is a qclass but not a class. (You can ask for records of class
* ns_c_any, but you can't have any records of that class in the database.)
*/
const struct RES_SYM_TYPE __p_res_class_syms[] = {
{ns_c_in, "IN", (char *) 0},
{ns_c_chaos, "CH", (char *) 0},
{ns_c_chaos, "CHAOS", (char *) 0},
{ns_c_hs, "HS", (char *) 0},
{ns_c_hs, "HESIOD", (char *) 0},
{ns_c_any, "ANY", (char *) 0},
{ns_c_none, "NONE", (char *) 0},
{ns_c_in, (char *) 0, (char *) 0}
};
/*
* Names of message sections.
*/
const struct RES_SYM_TYPE __p_default_section_syms[] = {
{ns_s_qd, "QUERY", (char *) 0},
{ns_s_an, "ANSWER", (char *) 0},
{ns_s_ns, "AUTHORITY", (char *) 0},
{ns_s_ar, "ADDITIONAL", (char *) 0},
{0, (char *) 0, (char *) 0}
};
const struct RES_SYM_TYPE __p_update_section_syms[] = {
{ns_s_zn, "ZONE", (char *) 0},
{ns_s_pr, "PREREQUISITE", (char *) 0},
{ns_s_ud, "UPDATE", (char *) 0},
{ns_s_ar, "ADDITIONAL", (char *) 0},
{0, (char *) 0, (char *) 0}
};
const struct RES_SYM_TYPE __p_key_syms[] = {
{NS_ALG_MD5RSA, "RSA", "RSA KEY with MD5 hash"},
{NS_ALG_DH, "DH", "Diffie Hellman"},
{NS_ALG_DSA, "DSA", "Digital Signature Algorithm"},
{NS_ALG_EXPIRE_ONLY, "EXPIREONLY", "No algorithm"},
{NS_ALG_PRIVATE_OID, "PRIVATE", "Algorithm obtained from OID"},
{0, NULL, NULL}
};
const struct RES_SYM_TYPE __p_cert_syms[] = {
{cert_t_pkix, "PKIX", "PKIX (X.509v3) Certificate"},
{cert_t_spki, "SPKI", "SPKI certificate"},
{cert_t_pgp, "PGP", "PGP certificate"},
{cert_t_url, "URL", "URL Private"},
{cert_t_oid, "OID", "OID Private"},
{0, NULL, NULL}
};
/*
* Names of RR types and qtypes. Types and qtypes are the same, except
* that T_ANY is a qtype but not a type. (You can ask for records of type
* T_ANY, but you can't have any records of that type in the database.)
*/
const struct RES_SYM_TYPE __p_type_sres_syms[] = {
{ns_t_a, "A", "address"},
{ns_t_ns, "NS", "name server"},
{ns_t_md, "MD", "mail destination (deprecated)"},
{ns_t_mf, "MF", "mail forwarder (deprecated)"},
{ns_t_cname, "CNAME", "canonical name"},
{ns_t_soa, "SOA", "start of authority"},
{ns_t_mb, "MB", "mailbox"},
{ns_t_mg, "MG", "mail group member"},
{ns_t_mr, "MR", "mail rename"},
{ns_t_null, "NULL", "null"},
{ns_t_wks, "WKS", "well-known service (deprecated)"},
{ns_t_ptr, "PTR", "domain name pointer"},
{ns_t_hinfo, "HINFO", "host information"},
{ns_t_minfo, "MINFO", "mailbox information"},
{ns_t_mx, "MX", "mail exchanger"},
{ns_t_txt, "TXT", "text"},
{ns_t_rp, "RP", "responsible person"},
{ns_t_afsdb, "AFSDB", "DCE or AFS server"},
{ns_t_x25, "X25", "X25 address"},
{ns_t_isdn, "ISDN", "ISDN address"},
{ns_t_rt, "RT", "router"},
{ns_t_nsap, "NSAP", "nsap address"},
{ns_t_nsap_ptr, "NSAP_PTR", "domain name pointer"},
{ns_t_sig, "SIG", "signature"},
{ns_t_key, "KEY", "key"},
{ns_t_px, "PX", "mapping information"},
{ns_t_gpos, "GPOS", "geographical position (withdrawn)"},
{ns_t_aaaa, "AAAA", "IPv6 address"},
{ns_t_loc, "LOC", "location"},
{ns_t_nxt, "NXT", "next valid name (unimplemented)"},
{ns_t_eid, "EID", "endpoint identifier (unimplemented)"},
{ns_t_nimloc, "NIMLOC", "NIMROD locator (unimplemented)"},
{ns_t_srv, "SRV", "server selection"},
{ns_t_atma, "ATMA", "ATM address (unimplemented)"},
{ns_t_naptr, "NAPTR", "URN Naming Authority"},
{ns_t_kx, "KX", "Key Exchange"},
{ns_t_cert, "CERT", "Certificate"},
{ns_t_a6, "A6", "IPv6 Address"},
{ns_t_dname, "DNAME", "dname"},
{ns_t_sink, "SINK", "Kitchen Sink (experimental)"},
{ns_t_opt, "OPT", "EDNS Options"},
// {ns_t_tkey, "TKEY", "tkey"},
{ns_t_tsig, "TSIG", "transaction signature"},
{ns_t_ixfr, "IXFR", "incremental zone transfer"},
{ns_t_axfr, "AXFR", "zone transfer"},
{ns_t_mailb, "MAILB", "mailbox-related data (deprecated)"},
{ns_t_maila, "MAILA", "mail agent (deprecated)"},
{ns_t_any, "ANY", "\"any\""},
{ns_t_zxfr, "ZXFR", "compressed zone transfer"},
{ns_t_dnskey, "DNSKEY", "DNS keys"},
{ns_t_rrsig, "RRSIG", "signatures"},
{ns_t_nsec, "NSEC", "next record"},
#ifdef LIBVAL_NSEC3
{ns_t_nsec3, "NSEC3", "NSEC3 next record"},
#endif
#ifdef LIBVAL_DLV
{ns_t_dlv, "DLV", "DLV record"},
#endif
{ns_t_ds, "DS", "delegation signer"},
{ns_t_tlsa, "TLSA", "DANE TLSA"},
{0, NULL, NULL}
};
/*
* Names of DNS rcodes.
*/
const struct RES_SYM_TYPE __p_rcode_syms[] = {
{ns_r_noerror, "NOERROR", "no error"},
{ns_r_formerr, "FORMERR", "format error"},
{ns_r_servfail, "SERVFAIL", "server failed"},
{ns_r_nxdomain, "NXDOMAIN", "no such domain name"},
{ns_r_notimpl, "NOTIMP", "not implemented"},
{ns_r_refused, "REFUSED", "refused"},
{ns_r_yxdomain, "YXDOMAIN", "domain name exists"},
{ns_r_yxrrset, "YXRRSET", "rrset exists"},
{ns_r_nxrrset, "NXRRSET", "rrset doesn't exist"},
{ns_r_notauth, "NOTAUTH", "not authoritative"},
{ns_r_notzone, "NOTZONE", "Not in zone"},
{ns_r_max, "", ""},
{ns_r_badsig, "BADSIG", "bad signature"},
{ns_r_badkey, "BADKEY", "bad key"},
{ns_r_badtime, "BADTIME", "bad time"},
{0, NULL, NULL}
};
#if defined(__OpenBSD__)
int
sym_ston(const struct RES_SYM_TYPE *syms, char *name, int *success)
#else
int
sym_ston(const struct RES_SYM_TYPE *syms, const char *name, int *success)
#endif
{
size_t namelen = 0;
if (name)
namelen = strlen(name);
for ((void) NULL; syms->name != 0; syms++) {
if ((namelen == strlen(syms->name)) &&
strncasecmp(name, syms->name, namelen) == 0) {
if (success)
*success = 1;
return (syms->number);
}
}
if (success)
*success = 0;
return (syms->number); /* The default value. */
}
const char *
sym_ntos(const struct RES_SYM_TYPE *syms, int number, int *success)
{
static char unname[20];
if (success)
*success = 0;
for ((void) NULL; syms->name != 0; syms++) {
if (number == syms->number) {
if (success)
*success = 1;
return (syms->name);
}
}
snprintf(unname, sizeof(unname), "%d", number); /* XXX nonreentrant */
if (success)
*success = 0;
return (unname);
}
const char *
sym_ntop(const struct RES_SYM_TYPE *syms, int number, int *success)
{
static char unname[20];
for ((void) NULL; syms->name != 0; syms++) {
if (number == syms->number) {
if (success)
*success = 1;
return (syms->humanname);
}
}
snprintf(unname, sizeof(unname), "%d", number); /* XXX nonreentrant */
if (success)
*success = 0;
return (unname);
}
/*
* Return a string for the type.
*/
const char *
p_sres_type(int type)
{
int success;
const char *result;
static char typebuf[20];
result =
sym_ntos((const struct RES_SYM_TYPE *) __p_type_sres_syms, type, &success);
if (success)
return (result);
if (type < 0 || type > 0xfff)
return ("BADTYPE");
snprintf(typebuf, sizeof(typebuf), "TYPE%d", type);
return (typebuf);
}
/*
* Return a string for the type.
*/
const char *
p_section(int section, int opcode)
{
const struct RES_SYM_TYPE *symbols;
switch (opcode) {
case ns_o_update:
symbols = (const struct RES_SYM_TYPE *) __p_update_section_syms;
break;
default:
symbols = (const struct RES_SYM_TYPE *) __p_default_section_syms;
break;
}
return (sym_ntos(symbols, section, (int *) 0));
}
/*
* Return a mnemonic for class.
*/
const char *
p_class(int class_h)
{
int success;
const char *result;
static char classbuf[20];
result =
sym_ntos((const struct RES_SYM_TYPE *) __p_res_class_syms, class_h, &success);
if (success)
return (result);
if (class_h < 0 || class_h > 0xfff)
return ("BADCLASS");
snprintf(classbuf, sizeof(classbuf), "CLASS%d", class_h);
return (classbuf);
}
/*
* Return a mnemonic for an option
*/
const char *
p_option(P_OPTION_ARG_TYPE option)
{
static char nbuf[40];
switch (option) {
case SR_QUERY_SET_DO:
return "DO-bit";
case SR_QUERY_SET_CD:
return "CD-bit";
case SR_QUERY_RECURSE:
return "recurs";
case SR_QUERY_DEBUG:
return "debug";
/*
* XXX nonreentrant
*/
default:
snprintf(nbuf, sizeof(nbuf), "?0x%lx?", (u_long) option);
return (nbuf);
}
}
/*
* Return a mnemonic for a time to live.
*/
const char *
p_time(u_int32_t value)
{
static char nbuf[40]; /* XXX nonreentrant */
if (ns_format_ttl(value, nbuf, sizeof(nbuf)) < 0)
snprintf(nbuf, sizeof(nbuf), "%u", value);
return (nbuf);
}
/*
* Return a string for the rcode.
*/
const char *
p_rcode(int rcode)
{
return (sym_ntos
((const struct RES_SYM_TYPE *) __p_rcode_syms, rcode, (int *) 0));
}
/*
* Return a string for a res_sockaddr_union.
*/
/*
* const char *
* p_sockun(union res_sockaddr_union u, char *buf, size_t size) {
* char ret[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:123.123.123.123")];
*
* switch (u.sin.sin_family) {
* case AF_INET:
* inet_ntop(AF_INET, &u.sin.sin_addr, ret, sizeof(ret));
* break;
* #ifdef HAS_INET6_STRUCTS
* case AF_INET6:
* inet_ntop(AF_INET6, &u.sin6.sin6_addr, ret, sizeof(ret));
* break;
* #endif
* default:
* snprintf(ret, sizeof(ret), "[af%d]", u.sin.sin_family);
* break;
* }
* if (size > 0U) {
* strncpy(buf, ret, size - 1);
* buf[size - 1] = '0';
* }
* return (buf);
* }
*/
/*
* routines to convert between on-the-wire RR format and zone file format.
* Does not contain conversion to/from decimal degrees; divide or multiply
* by 60*60*1000 for that.
*/
static const unsigned int poweroften[10] =
{ 1, 10, 100, 1000, 10000, 100000,
1000000, 10000000, 100000000, 1000000000
};
/*
* takes an XeY precision/size value, returns a string representation.
*/
static const char *
precsize_ntoa(u_char prec)
{
static char retbuf[sizeof("90000000.00")]; /* XXX nonreentrant */
unsigned long val;
int mantissa, exponent;
mantissa = (int) ((prec >> 4) & 0x0f) % 10;
exponent = (int) ((prec >> 0) & 0x0f) % 10;
val = mantissa * poweroften[exponent];
(void) snprintf(retbuf, sizeof(retbuf), "%lu.%.2lu", val / 100,
val % 100);
return (retbuf);
}
/*
* converts ascii size/precision X * 10**Y(cm) to 0xXY. moves pointer.
*/
static u_char
precsize_aton(const char **strptr)
{
unsigned int mval = 0, cmval = 0;
u_char retval = 0;
const char *cp;
int exponent;
int mantissa;
cp = *strptr;
while (isdigit((unsigned char) *cp))
mval = mval * 10 + (*cp++ - '0');
if (*cp == '.') { /* centimeters */
cp++;
if (isdigit((unsigned char) *cp)) {
cmval = (*cp++ - '0') * 10;
if (isdigit((unsigned char) *cp)) {
cmval += (*cp++ - '0');
}
}
}
cmval = (mval * 100) + cmval;
for (exponent = 0; exponent < 9; exponent++)
if (cmval < poweroften[exponent + 1])
break;
mantissa = cmval / poweroften[exponent];
if (mantissa > 9)
mantissa = 9;
retval = (mantissa << 4) | exponent;
*strptr = cp;
return (retval);
}
/*
* converts ascii lat/lon to unsigned encoded 32-bit number. moves pointer.
*/
static u_int32_t
latlon2ul(const char **latlonstrptr, int *which)
{
const char *cp;
u_int32_t retval;
int deg = 0, min = 0, secs = 0, secsfrac = 0;
cp = *latlonstrptr;
while (isdigit((unsigned char) *cp))
deg = deg * 10 + (*cp++ - '0');
while (isspace((unsigned char) *cp))
cp++;
if (!(isdigit((unsigned char) *cp)))
goto fndhemi;
while (isdigit((unsigned char) *cp))
min = min * 10 + (*cp++ - '0');
while (isspace((unsigned char) *cp))
cp++;
if (!(isdigit((unsigned char) *cp)))
goto fndhemi;
while (isdigit((unsigned char) *cp))
secs = secs * 10 + (*cp++ - '0');
if (*cp == '.') { /* decimal seconds */
cp++;
if (isdigit((unsigned char) *cp)) {
secsfrac = (*cp++ - '0') * 100;
if (isdigit((unsigned char) *cp)) {
secsfrac += (*cp++ - '0') * 10;
if (isdigit((unsigned char) *cp)) {
secsfrac += (*cp++ - '0');
}
}
}
}
while (!isspace((unsigned char) *cp)) /* if any trailing garbage */
cp++;
while (isspace((unsigned char) *cp))
cp++;
fndhemi:
switch (*cp) {
case 'N':
case 'n':
case 'E':
case 'e':
retval = ((unsigned) 1 << 31)
+ (((((deg * 60) + min) * 60) + secs) * 1000)
+ secsfrac;
break;
case 'S':
case 's':
case 'W':
case 'w':
retval = ((unsigned) 1 << 31)
- (((((deg * 60) + min) * 60) + secs) * 1000)
- secsfrac;
break;
default:
retval = 0; /* invalid value -- indicates error */
break;
}
switch (*cp) {
case 'N':
case 'n':
case 'S':
case 's':
*which = 1; /* latitude */
break;
case 'E':
case 'e':
case 'W':
case 'w':
*which = 2; /* longitude */
break;
default:
*which = 0; /* error */
break;
}
cp++; /* skip the hemisphere */
while (!isspace((unsigned char) *cp)) /* if any trailing garbage */
cp++;
while (isspace((unsigned char) *cp)) /* move to next field */
cp++;
*latlonstrptr = cp;
return (retval);
}
/*
* converts a zone file representation in a string to an RDATA on-the-wire
* * representation.
*/
int
loc_aton(const char *ascii, u_char *binary)
{
const char *cp, *maxcp;
u_char *bcp;
u_int32_t latit = 0, longit = 0, alt = 0;
u_int32_t lltemp1 = 0, lltemp2 = 0;
int altmeters = 0, altfrac = 0, altsign = 1;
u_char hp = 0x16; /* default = 1e6 cm = 10000.00m = 10km */
u_char vp = 0x13; /* default = 1e3 cm = 10.00m */
u_char siz = 0x12; /* default = 1e2 cm = 1.00m */
int which1 = 0, which2 = 0;
cp = ascii;
maxcp = cp + strlen(ascii);
lltemp1 = latlon2ul(&cp, &which1);
lltemp2 = latlon2ul(&cp, &which2);
switch (which1 + which2) {
case 3: /* 1 + 2, the only valid combination */
if ((which1 == 1) && (which2 == 2)) { /* normal case */
latit = lltemp1;
longit = lltemp2;
} else if ((which1 == 2) && (which2 == 1)) { /* reversed */
longit = lltemp1;
latit = lltemp2;
} else { /* some kind of brokenness */
return (0);
}
break;
default: /* we didn't get one of each */
return (0);
}
/*
* altitude
*/
if (*cp == '-') {
altsign = -1;
cp++;
}
if (*cp == '+')
cp++;
while (isdigit((unsigned char) *cp))
altmeters = altmeters * 10 + (*cp++ - '0');
if (*cp == '.') { /* decimal meters */
cp++;
if (isdigit((unsigned char) *cp)) {
altfrac = (*cp++ - '0') * 10;
if (isdigit((unsigned char) *cp)) {
altfrac += (*cp++ - '0');
}
}
}
alt = (10000000 + (altsign * (altmeters * 100 + altfrac)));
while (!isspace((unsigned char) *cp) && (cp < maxcp)) /* if trailing garbage or m */
cp++;
while (isspace((unsigned char) *cp) && (cp < maxcp))
cp++;
if (cp >= maxcp)
goto defaults;
siz = precsize_aton(&cp);
while (!isspace((unsigned char) *cp) && (cp < maxcp)) /* if trailing garbage or m */
cp++;
while (isspace((unsigned char) *cp) && (cp < maxcp))
cp++;
if (cp >= maxcp)
goto defaults;
hp = precsize_aton(&cp);
while (!isspace((unsigned char) *cp) && (cp < maxcp)) /* if trailing garbage or m */
cp++;
while (isspace((unsigned char) *cp) && (cp < maxcp))
cp++;
if (cp >= maxcp)
goto defaults;
vp = precsize_aton(&cp);
defaults:
bcp = binary;
*bcp++ = (u_char) 0; /* version byte */
*bcp++ = siz;
*bcp++ = hp;
*bcp++ = vp;
NS_PUT32(latit, bcp);
NS_PUT32(longit, bcp);
NS_PUT32(alt, bcp);
return (16); /* size of RR in octets */
}
/*
* takes an on-the-wire LOC RR and formats it in a human readable format.
*/
const char *
loc_ntoa(const u_char *binary, char *ascii)
{
static const char *error = "?";
static char tmpbuf[sizeof
"1000 60 60.000 N 1000 60 60.000 W -12345678.00m 90000000.00m 90000000.00m 90000000.00m"];
const u_char *cp = binary;
int latdeg, latmin, latsec, latsecfrac;
int longdeg, longmin, longsec, longsecfrac;
char northsouth, eastwest;
const char *altsign;
int altmeters, altfrac;
const u_int32_t referencealt = 100000 * 100;
u_int32_t latval, longval, altval;
u_int32_t templ;
u_char sizeval, hpval, vpval, versionval;
char *sizestr, *hpstr, *vpstr;
versionval = *cp++;
if (ascii == NULL)
ascii = tmpbuf;
if (versionval) {
(void) SPRINTF((ascii, "; error: unknown LOC RR version"));
return (ascii);
}
sizeval = *cp++;
hpval = *cp++;
vpval = *cp++;
RES_GET32(templ, cp);
latval = (templ - ((unsigned) 1 << 31));
RES_GET32(templ, cp);
longval = (templ - ((unsigned) 1 << 31));
RES_GET32(templ, cp);
if (templ < referencealt) { /* below WGS 84 spheroid */
altval = referencealt - templ;
altsign = "-";
} else {
altval = templ - referencealt;
altsign = "";
}
if (latval < 0) {
northsouth = 'S';
latval = -latval;
} else
northsouth = 'N';
latsecfrac = latval % 1000;
latval = latval / 1000;
latsec = latval % 60;
latval = latval / 60;
latmin = latval % 60;
latval = latval / 60;
latdeg = latval;
if (longval < 0) {
eastwest = 'W';
longval = -longval;
} else
eastwest = 'E';
longsecfrac = longval % 1000;
longval = longval / 1000;
longsec = longval % 60;
longval = longval / 60;
longmin = longval % 60;
longval = longval / 60;
longdeg = longval;
altfrac = altval % 100;
altmeters = (altval / 100);
sizestr = strdup(precsize_ntoa(sizeval));
hpstr = strdup(precsize_ntoa(hpval));
vpstr = strdup(precsize_ntoa(vpval));
SPRINTF((ascii,
"%d %.2d %.2d.%.3d %c %d %.2d %.2d.%.3d %c %s%d.%.2dm %sm %sm %sm",
latdeg, latmin, latsec, latsecfrac, northsouth,
longdeg, longmin, longsec, longsecfrac, eastwest,
altsign, altmeters, altfrac,
(sizestr != NULL) ? sizestr : error,
(hpstr != NULL) ? hpstr : error,
(vpstr != NULL) ? vpstr : error));
if (sizestr != NULL)
FREE(sizestr);
if (hpstr != NULL)
FREE(hpstr);
if (vpstr != NULL)
FREE(vpstr);
return (ascii);
}
/*
* Return the number of DNS hierarchy levels in the name.
*/
#if defined(__OpenBSD__)
int
dn_count_labels(char *name)
#else
int
dn_count_labels(const char *name)
#endif
{
int i, len, count;
len = strlen(name);
for (i = 0, count = 0; i < len; i++) {
/*
* XXX need to check for \. or use named's nlabels().
*/
if (name[i] == '.')
count++;
}
/*
* don't count initial wildcard
*/
if (name[0] == '*')
if (count)
count--;
/*
* don't count the null label for root.
* if terminating '.' not found, must adjust
* count to include last label
*/
if (len > 0 && name[len - 1] != '.')
count++;
return (count);
}
/*
* Make dates expressed in seconds-since-Jan-1-1970 easy to read.
* SIG records are required to be printed like this, by the Secure DNS RFC.
*/
char *
p_secstodate(P_SECSTODATE_ARG_TYPE secs)
{
/*
* XXX nonreentrant
*/
static char output[15]; /* YYYYMMDDHHMMSS and null */
time_t clock = secs;
struct tm *time;
#ifdef HAVE_GMTIME_R
struct tm res;
time = gmtime_r(&clock, &res);
#else
time = gmtime(&clock);
#endif
time->tm_year += 1900;
time->tm_mon += 1;
snprintf(output, sizeof(output), "%04d%02d%02d%02d%02d%02d",
time->tm_year, time->tm_mon, time->tm_mday,
time->tm_hour, time->tm_min, time->tm_sec);
return (output);
}
u_int16_t
res_nametoclass(const char *buf, int *successp)
{
unsigned long result;
char *endptr;
int success;
result =
sym_ston((const struct RES_SYM_TYPE *) __p_res_class_syms, buf, &success);
if (success)
goto done;
if (strncasecmp(buf, "CLASS", 5) != 0 ||
!isdigit((unsigned char) buf[5]))
goto done;
errno = 0;
result = strtoul(buf + 5, &endptr, 10);
if (errno == 0 && *endptr == '\0' && result <= 0xffffU)
success = 1;
done:
if (successp)
*successp = success;
return (result);
}
u_int16_t
res_nametotype(const char *buf, int *successp)
{
unsigned long result;
char *endptr;
int success;
result =
sym_ston((const struct RES_SYM_TYPE *) __p_type_sres_syms, buf, &success);
if (success)
goto done;
if (strncasecmp(buf, "type", 4) != 0 ||
!isdigit((unsigned char) buf[4]))
goto done;
errno = 0;
result = strtoul(buf + 4, &endptr, 10);
if (errno == 0 && *endptr == '\0' && result <= 0xffffU)
success = 1;
done:
if (successp)
*successp = success;
return (result);
}
/*
* Print the contents of a query.
* This is intended to be primarily a debugging routine.
*/
void
libsres_pquery(const u_char * msg, size_t len, FILE * file)
{
ns_msg handle;
int qdcount, ancount, nscount, arcount;
u_int opcode, rcode, id;
#ifdef HAVE_STRERROR_R
char err_buf[ERRBUFLEN + 1];
#endif
char buf[128];
if (ns_initparse(msg, len, &handle) < 0) {
#ifdef HAVE_STRERROR_R
if (!strerror_r(errno, err_buf, ERRBUFLEN))
_print_or_log(file, LOG_DEBUG, ";; ns_initparse: %s\n", err_buf);
else
_print_or_log(file, LOG_DEBUG, ";; ns_initparse: Error\n");
#else
_print_or_log(file, LOG_DEBUG, ";; ns_initparse: %s\n", strerror(errno));
#endif
return;
}
opcode = libsres_msg_getflag(handle, ns_f_opcode);
rcode = libsres_msg_getflag(handle, ns_f_rcode);
id = ns_msg_id(handle);
qdcount = ns_msg_count(handle, ns_s_qd);
ancount = ns_msg_count(handle, ns_s_an);
nscount = ns_msg_count(handle, ns_s_ns);
arcount = ns_msg_count(handle, ns_s_ar);
/*
* Print header fields.
*/
_print_or_log(file, LOG_DEBUG,
";; ->>HEADER<<- opcode: %s, status: %s, id: %d\n",
_libsres_opcodes[opcode], p_rcode(rcode), id);
strcpy(buf, ";; flags:");
if (libsres_msg_getflag(handle, ns_f_qr))
strcat(buf, " qr");
if (libsres_msg_getflag(handle, ns_f_aa))
strcat(buf, " aa");
if (libsres_msg_getflag(handle, ns_f_tc))
strcat(buf, " tc");
if (libsres_msg_getflag(handle, ns_f_rd))
strcat(buf, " rd");
if (libsres_msg_getflag(handle, ns_f_ra))
strcat(buf, " ra");
if (libsres_msg_getflag(handle, ns_f_z))
strcat(buf, " ??");
if (libsres_msg_getflag(handle, ns_f_ad))
strcat(buf, " ad");
if (libsres_msg_getflag(handle, ns_f_cd))
strcat(buf, " cd");
_print_or_log(file, LOG_DEBUG, "%s", buf);
_print_or_log(file, LOG_DEBUG, "; %s: %d", p_section(ns_s_qd, opcode),
qdcount);
_print_or_log(file, LOG_DEBUG, ", %s: %d", p_section(ns_s_an, opcode),
ancount);
_print_or_log(file, LOG_DEBUG, ", %s: %d", p_section(ns_s_ns, opcode),
nscount);
_print_or_log(file, LOG_DEBUG, ", %s: %d\n", p_section(ns_s_ar, opcode),
arcount);
do_section(&handle, ns_s_qd, RES_PRF_QUES, file);
do_section(&handle, ns_s_an, RES_PRF_ANS, file);
do_section(&handle, ns_s_ns, RES_PRF_AUTH, file);
do_section(&handle, ns_s_ar, RES_PRF_ADD, file);
}
dnsval-2.0/libsres/README 0000664 0002372 0002372 00000001117 11016551230 015307 0 ustar hardaker hardaker # Copyright 2004-2008 SPARTA, Inc. All rights reserved.
# See the COPYING file included with the dnssec-tools package for details.
DNSSEC-Tools
Is your domain secure?
DNSSEC-aware Resolver library
-----------------------------
A library that is capable of sending queries to, and receiving answers
from a DNSSEC-aware name server.
Additional information about this library can be found in the ../doc
directory.
Building the library
---------------------
In the parent (../) directory first run:
./configure
To compile:
make clean; make
To install:
make install
dnsval-2.0/libsres/.indent.pro 0000664 0002372 0002372 00000000033 10502532677 016521 0 ustar hardaker hardaker -orig -nbc -bap -nut -nfca
dnsval-2.0/libsres/res_io_manager.h 0000664 0002372 0002372 00000026463 11700372404 017571 0 ustar hardaker hardaker /*
* Copyright (c) 1995, 1996, 1997 by Trusted Information Systems, Inc.
*
* Permission to use, copy modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND TRUSTED INFORMATION SYSTEMS
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
* TRUSTED INFORMATION SYSTEMS BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THE SOFTWARE.
*/
#ifndef __RES_IO_MANAGER_H__
#define __RES_IO_MANAGER_H__
#define SR_IO_GOT_ANSWER 1
#define SR_IO_UNSET 0
#define SR_IO_NO_ANSWER_YET -1
#define SR_IO_MEMORY_ERROR -2
#define SR_IO_TOO_MANY_TRANS -3
#define SR_IO_SOCKET_ERROR -4
#define SR_IO_NO_ANSWER -5
#define SR_IO_INTERNAL_ERROR -10
/*
* res_io_deliver
*
* Enters a query for submission. After entering the query,
* a routine is called to check the outgoing data needs which
* may result in some network traffic being generated.
*
* See Also res_io_queue
*
* Parameters
*
* transaction_id is either the id for an existing transaction to which the
* query should be added, or -1 to begin a new transaction. The new
* transaction id will be set before returning.
*
* signed_query is a pointer to a query which becomes "owned" by the
* io manger. signed_length is the length of the query. The
* query is sent as it is passed, i.e., it should be TSIG'd
* before hand.
*
* ns is a structure indicating which name server(s) to use.
*
* Return values
*
* >= 0 Number of remaining sources pending
* SR_IO_MEMORY_ERROR Not enough memory
* SR_IO_TOO_MANY_TRANS Too many current requests
*/
int res_io_deliver(int *transaction_id,
u_char * signed_query, size_t signed_length,
struct name_server *ns, long delay);
/*
* res_io_queue
*
* Enters a query for submission, like res_io_deliver, but does not
* immediately send them. After queueing queries, call res_io_check
* to send them.
*
* Parameters
*
* transaction_id is either the id for an existing transaction to which the
* query should be added, or -1 to begin a new transaction. The new
* transaction id will be set before returning.
*
* signed_query is a pointer to a query which becomes "owned" by the
* io manger. signed_length is the length of the query. The
* query is sent as it is passed, i.e., it should be TSIG'd
* before hand.
*
* ns is a structure indicating which name server(s) to use.
*
* Return values
*
* >= 0 Number of remaining sources pending
* SR_IO_MEMORY_ERROR Not enough memory
* SR_IO_TOO_MANY_TRANS Too many current requests
*/
int res_io_queue(int *transaction_id, u_char * signed_query,
size_t signed_length, struct name_server *ns,
long delay);
/*
* res_io_queue_ea
*
* Enters an existing query for submission
*
* Parameters
*
* transaction_id is either the id for an existing transaction to which the
* query should be added, or -1 to begin a new transaction. The new
* transaction id will be set before returning.
*
* new_ea is a pointer to an existing query which becomes "owned" by the
* io manger.
*
* Return values
*
* >= 0 Number of remaining sources pending
* SR_IO_MEMORY_ERROR Not enough memory
* SR_IO_TOO_MANY_TRANS Too many current requests
*/
int res_io_queue_ea(int *transaction_id,
struct expected_arrival *new_ea);
/*
* res_io_accept
*
* Requests a response for the indicated transaction. If there
* is a response for the transaction, then the first one found is
* returned. Responses for other transactions are also handled, as
* well as a check of the outgoing needs. Only responses for the
* indicated transaction are returned though.
*
* Parameters
*
* transaction_id is the number assigned in the first delivery call.
*
* answer and answer length refer to the response, answer is malloced
* memory given to the caller for management, answer_length is the
* response length in bytes
*
* respondent is a pointer to the nameserver from which the answer came
*
* Return values
*
* SR_IO_GOT_ANSWER An answer is being returned
* SR_IO_NO_ANSWER No answer is returned, and there are no more
* sources (the caller may be adding more)
* SR_IO_NO_ANSWER_YET No answer, but there are sources still pending
* SR_IO_SOCKET_ERROR An unrecoverable (socket()) error in the
* communications interface. This should be
* treated as an internal error, it should not
* happen after success full porting and testing.
* SR_IO_INTERNAL_ERROR A null pointer happened where it should not
* after success porting and compilation.
*/
int res_io_accept(int transaction_id,
fd_set *pending_desc,
struct timeval *closest_event,
u_char ** answer,
size_t * answer_length,
struct name_server **respondent);
/*
* res_io_check
*
* Checks all transactions for sends, resends, timeouts and cancellations.
*
* Parameters
*
* transaction_id is checked last, and the return code specifies whether
* or not this transaction has any queries with remaining attempts.
*
* next_evt is cleared and then set to the earliest retry/cancellation time.
*
* Return value
*
* 1 if there are still queries with remaining attempts for transaction_id
* 0 if all queries have timed out or been canceled for transaction_id
*/
int res_io_check(int transaction_id, struct timeval *next_evt);
/*
* res_io_check_one
*
* Checks one expected arrival for sends, resends, timeouts and cancellations.
*
* Parameters
*
* ea is the expected arrival list for the query.
*
* next_evt is updated with any event time that is earlier than the current
* value. Caller is responsible for setting an appropriate value for
* next_evt, as this function does not clear it as some other functions do.
*
* now is an (optional) pointer to the current time. If not supplied,
* gettimeofday will be used as needed. If you are calling this function
* in a loop, you should probably pass a now pointer.
*
* Return value
*
* returns the change in the number of active sockets. A negative value means
* more sockets were closed than opened. A zero value can mean no change, or
* an equal number of sockets were opened as were closed.
*/
int res_io_check_one(struct expected_arrival *ea,
struct timeval *next_evt,
struct timeval *now);
/*
* res_io_check_ea_list
*
* Checks one transaction for sends, resends, timeouts and cancellations.
*
* Parameters
*
* ea is the expected arrival list for the query.
*
* next_evt is updated with any event time that is earlier than the current
* value. Caller is responsible for setting an appropriate value for
* next_evt, as this function does not clear it as some other functions do.
*
* now is an (optional) pointer to the current time. If not supplied,
* gettimeofday will be used as needed. If you are calling this function
* in a loop, you should probably pass a now pointer.
*
* net_change, if provided, will be set to the change in the number of
* active entries. A negative number means that more were closed than
* opened, a positive number means more were opened than closed and 0
* means there was no change or and equal number were open as closed.
*
* active, if provided, will be set to the number of active expected
* arrivals in the list.
*
* Return value
*
* returns 1 if there are still queries with remaining attempts.
* returns 0 if all queries have timed out or been canceled.
*/
int res_io_check_ea_list(struct expected_arrival *ea,
struct timeval *next_evt,
struct timeval *now, int *net_change,
int *active);
/*
* res_io_check_one_tid
*
* Checks one transaction for sends, resends, timeouts and cancellations.
*
* Parameters
*
* see res_io_check_one()
*
* Return value
*
* returns 1 if there are still queries with remaining attempts.
* returns 0 if all queries have timed out or been canceled.
*/
int res_io_check_one_tid(int tid, struct timeval *next_evt,
struct timeval *now);
/*
* switch a newly created/queued es chain to default to TCP
*/
void res_switch_all_to_tcp(struct expected_arrival *ea);
void res_switch_all_to_tcp_tid(int tid);
/*
* res_cancel
*
* Cancels all outstanding requests remaining for a transaction.
*
* Parameters
*
* transaction_id is the number of the transaction to be deleted, as
* assigned in the first delivery call. On exit it is set to -1 to
* remind the caller that the transaction is dead.
*/
void res_cancel(int *transaction_id);
/*
* res_io_cancel_all
*
* Cancels all outstanding requests remaining for all transactions.
*/
void res_io_cancel_all(void);
/*
* Debugging routines
*/
/*
* res_io_view
*
* Prints the status of the res_io_mamager
*/
void res_io_view(void);
/*
* res_io_stall
*
* Stalls the test so it begins on a second since epoch divisible by
* zero. Helpfull for tracing the action of the IO manager (time is
* printed in res_io_view). This is an obtuse function, but when used
* in debugging, its value is obvious.
*/
void res_io_stall(void);
/*
* res_timeout
*/
long res_timeout(struct name_server *ns);
/*
* Early abort of a query attempt. Perform additional retries if desired
*/
int res_nsfallback(int transaction_id,
struct timeval *closest_event,
struct name_server *server,
const char *name, const u_int16_t class_h,
const u_int16_t type_h);
int res_nsfallback_ea(struct expected_arrival *,
struct timeval *closest_event,
struct name_server *server,
const char *name, const u_int16_t class_h,
const u_int16_t type_h);
/*
* for a given ea, update data structures needed by select
*/
void
res_io_select_info(struct expected_arrival *ea_list, int *nfds,
fd_set * read_descriptors, struct timeval *timeout);
/*
* count the number of descriptors set in the given fdset.
*
* the max_fd argument is optional and specifies the highest number fd that
* may be set (i.e. like the nfds param to select()). If it is less than or
* equal to zero, every fd is checked.
*/
int
res_io_count_ready(fd_set *read_desc, int max_fd);
#endif
dnsval-2.0/libsres/ns_print.c 0000664 0002372 0002372 00000075104 12106241050 016433 0 ustar hardaker hardaker /*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-1999 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "validator-internal.h"
#include "nsap_addr.h"
#include "res_support.h"
#include "res_comp.h"
#include "ns_samedomain.h"
#include "base64.h"
#include "res_debug.h"
#ifndef MIN
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#endif
#define ADD_BYTES(sptr, eptr) do { \
int n, m;\
char *p;\
const u_char *teptr = eptr;\
while (sptr < teptr) {\
p = tmp;\
n = MIN(32, teptr - sptr);\
for (m = 0; m < n; m++)\
p += SPRINTF((p, "%02x", sptr[m]));\
T(addstr(tmp, p - tmp, &buf, &buflen));\
p = tmp;\
sptr += n;\
}\
} while (0);
/*
* Forward.
*/
static size_t prune_origin(const char *name, const char *origin);
static int charstr(const u_char * rdata, const u_char * edata,
char **buf, size_t * buflen);
static int addname(const u_char * msg, size_t msglen,
const u_char ** p, const char *origin,
char **buf, size_t * buflen);
static void addlen(size_t len, char **buf, size_t * buflen);
static int addstr(const char *src, size_t len,
char **buf, size_t * buflen);
static int addtab(size_t len, size_t target, int spaced,
char **buf, size_t * buflen);
/*
* Macros.
*/
#define T(x) \
do { \
if ((x) < 0) \
return (-1); \
} while (0)
/*
* Public.
*/
/*
* calculates the key id.
* takes an array of bytes and a length.
* returns a 16 bit checksum.
*/
u_int16_t
id_calc(const u_char * key, const int keysize)
{
u_int32_t ac;
const u_char *kp = key;
int size = keysize;
if (!key || (keysize <= 0))
return (-1);
for (ac = 0; size > 1; size -= 2, kp += 2)
ac += ((*kp) << 8) + *(kp + 1);
if (size > 0)
ac += ((*kp) << 8);
ac += (ac >> 16) & 0xffff;
return (ac & 0xffff);
}
/*
* int
* ns_sprintrr(handle, rr, name_ctx, origin, buf, buflen)
* Convert an RR to presentation format.
* return:
* Number of characters written to buf, or -1 (check errno).
*/
int
ns_sprintrr(const ns_msg * handle, const ns_rr * rr,
const char *name_ctx, const char *origin,
char *buf, size_t buflen)
{
int n;
n = ns_sprintrrf(ns_msg_base(*handle), ns_msg_size(*handle),
ns_rr_name(*rr), ns_rr_class(*rr), ns_rr_type(*rr),
ns_rr_ttl(*rr), ns_rr_rdata(*rr), ns_rr_rdlen(*rr),
name_ctx, origin, buf, buflen);
return (n);
}
/*
* int
* ns_sprintrrf(msg, msglen, name, class, type, ttl, rdata, rdlen,
* name_ctx, origin, buf, buflen)
* Convert the fields of an RR into presentation format.
* return:
* Number of characters written to buf, or -1 (check errno).
*/
int
ns_sprintrrf(const u_char * msg, size_t msglen,
const char *name, ns_class class_h, ns_type type_h,
u_long ttl, const u_char * rdata, size_t rdlen,
const char *name_ctx, const char *origin,
char *buf, size_t buflen)
{
const char *obuf = buf;
int spaced = 0;
const char *comment;
char tmp[100];
int len, x;
/*
* Owner.
*/
if (name_ctx != NULL && ns_samename(name_ctx, name) == 1) {
T(addstr("\t\t\t", 3, &buf, &buflen));
} else {
len = prune_origin(name, origin);
if (*name == '\0') {
goto root;
} else if (len == 0) {
T(addstr("@\t\t\t", 4, &buf, &buflen));
} else {
T(addstr(name, len, &buf, &buflen));
/*
* Origin not used or not root, and no trailing dot?
*/
if (((origin == NULL || origin[0] == '\0') ||
(origin[0] != '.' && origin[1] != '\0' &&
name[len] == '\0')) && name[len - 1] != '.') {
root:
T(addstr(".", 1, &buf, &buflen));
len++;
}
T(spaced = addtab(len, 24, spaced, &buf, &buflen));
}
}
/*
* TTL, Class, Type.
*/
T(x = ns_format_ttl(ttl, buf, buflen));
addlen(x, &buf, &buflen);
len = SPRINTF((tmp, " %s %s", p_class(class_h), p_type(type_h)));
T(addstr(tmp, len, &buf, &buflen));
if (rdlen == 0U)
return (buf - obuf);
T(spaced = addtab(x + len, 16, spaced, &buf, &buflen));
return ns_sprintrrf_data(msg, msglen, name, class_h, type_h,
ttl, rdata, rdlen, origin,
buf, buflen);
}
int
ns_sprintrrf_data(const u_char * msg, size_t msglen,
const char *name, ns_class class_h, ns_type type_h,
u_long ttl, const u_char * rdata, size_t rdlen,
const char *origin,
char *buf, size_t buflen)
{
struct sockaddr_in sa;
#ifdef VAL_IPV6
struct sockaddr_in6 sa6;
#endif
const char *addr = NULL;
int len;
const u_char *edata = rdata + rdlen;
int spaced = 0;
char tmp[100];
const char *obuf = buf;
const char *comment;
memset(&sa, 0, sizeof(sa));
#ifdef VAL_IPV6
memset(&sa6, 0, sizeof(sa6));
#endif
/*
* RData.
*/
switch (type_h) {
case ns_t_a:
if (rdlen != (size_t) NS_INADDRSZ)
goto formerr;
memcpy(&sa.sin_addr, rdata, NS_INADDRSZ);
INET_NTOP(AF_INET, ((struct sockaddr *)&sa), sizeof(sa), buf, buflen, addr);
addlen(strlen(buf), &buf, &buflen);
break;
case ns_t_cname:
case ns_t_mb:
case ns_t_mg:
case ns_t_mr:
case ns_t_ns:
case ns_t_ptr:
case ns_t_dname:
T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
break;
case ns_t_hinfo:
case ns_t_isdn:
/*
* First word.
*/
T(len = charstr(rdata, edata, &buf, &buflen));
if (len == 0)
goto formerr;
rdata += len;
T(addstr(" ", 1, &buf, &buflen));
/*
* Second word, optional in ISDN records.
*/
if (type_h == ns_t_isdn && rdata == edata)
break;
T(len = charstr(rdata, edata, &buf, &buflen));
if (len == 0)
goto formerr;
rdata += len;
break;
case ns_t_soa:{
u_long t;
/** Server name. */
T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
T(addstr(" ", 1, &buf, &buflen));
/** Administrator name. */
T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
T(addstr(" (\n", 3, &buf, &buflen));
spaced = 0;
if ((edata - rdata) != 5 * NS_INT32SZ)
goto formerr;
/** Serial number. */
RES_GET32(t, rdata);
T(addstr("\t\t\t\t\t", 5, &buf, &buflen));
len = SPRINTF((tmp, "%lu", t));
T(addstr(tmp, len, &buf, &buflen));
T(spaced = addtab(len, 16, spaced, &buf, &buflen));
T(addstr("; serial\n", 9, &buf, &buflen));
spaced = 0;
/** Refresh interval. */
RES_GET32(t, rdata);
T(addstr("\t\t\t\t\t", 5, &buf, &buflen));
T(len = ns_format_ttl(t, buf, buflen));
addlen(len, &buf, &buflen);
T(spaced = addtab(len, 16, spaced, &buf, &buflen));
T(addstr("; refresh\n", 10, &buf, &buflen));
spaced = 0;
/** Retry interval. */
RES_GET32(t, rdata);
T(addstr("\t\t\t\t\t", 5, &buf, &buflen));
T(len = ns_format_ttl(t, buf, buflen));
addlen(len, &buf, &buflen);
T(spaced = addtab(len, 16, spaced, &buf, &buflen));
T(addstr("; retry\n", 8, &buf, &buflen));
spaced = 0;
/** Expiry. */
RES_GET32(t, rdata);
T(addstr("\t\t\t\t\t", 5, &buf, &buflen));
T(len = ns_format_ttl(t, buf, buflen));
addlen(len, &buf, &buflen);
T(spaced = addtab(len, 16, spaced, &buf, &buflen));
T(addstr("; expiry\n", 9, &buf, &buflen));
spaced = 0;
/** Minimum TTL. */
RES_GET32(t, rdata);
T(addstr("\t\t\t\t\t", 5, &buf, &buflen));
T(len = ns_format_ttl(t, buf, buflen));
addlen(len, &buf, &buflen);
T(addstr(" )", 2, &buf, &buflen));
T(spaced = addtab(len, 16, spaced, &buf, &buflen));
T(addstr("; minimum\n", 10, &buf, &buflen));
break;
}
case ns_t_mx:
case ns_t_afsdb:
case ns_t_rt:{
u_int t;
if (rdlen < (size_t) NS_INT16SZ)
goto formerr;
/** Priority. */
RES_GET16(t, rdata);
len = SPRINTF((tmp, "%u ", t));
T(addstr(tmp, len, &buf, &buflen));
/** Target. */
T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
break;
}
case ns_t_px:{
u_int t;
if (rdlen < (size_t) NS_INT16SZ)
goto formerr;
/** Priority. */
RES_GET16(t, rdata);
len = SPRINTF((tmp, "%u ", t));
T(addstr(tmp, len, &buf, &buflen));
/** Name1. */
T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
T(addstr(" ", 1, &buf, &buflen));
/** Name2. */
T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
break;
}
case ns_t_x25:
T(len = charstr(rdata, edata, &buf, &buflen));
if (len == 0)
goto formerr;
rdata += len;
break;
case ns_t_txt:
while (rdata < edata) {
T(len = charstr(rdata, edata, &buf, &buflen));
if (len == 0)
goto formerr;
rdata += len;
if (rdata < edata)
T(addstr(" ", 1, &buf, &buflen));
}
break;
case ns_t_nsap:{
char t[2 + 255 * 3];
(void) inet_nsap_ntoa(rdlen, rdata, t);
T(addstr(t, strlen(t), &buf, &buflen));
break;
}
#ifdef VAL_IPV6
case ns_t_aaaa:
if (rdlen != (size_t) NS_IN6ADDRSZ)
goto formerr;
memcpy(&sa6.sin6_addr, rdata, NS_IN6ADDRSZ);
INET_NTOP(AF_INET6, ((struct sockaddr *)&sa6), sizeof(sa6), buf, buflen, addr);
addlen(strlen(buf), &buf, &buflen);
break;
#endif
case ns_t_loc:{
char t[255];
/** XXX protocol format checking? */
(void) loc_ntoa(rdata, t);
T(addstr(t, strlen(t), &buf, &buflen));
break;
}
case ns_t_naptr:{
u_int order, preference;
char t[50];
if (rdlen < 2U * NS_INT16SZ)
goto formerr;
/** Order, Precedence. */
RES_GET16(order, rdata);
RES_GET16(preference, rdata);
len = SPRINTF((t, "%u %u ", order, preference));
T(addstr(t, len, &buf, &buflen));
/** Flags. */
T(len = charstr(rdata, edata, &buf, &buflen));
if (len == 0)
goto formerr;
rdata += len;
T(addstr(" ", 1, &buf, &buflen));
/** Service. */
T(len = charstr(rdata, edata, &buf, &buflen));
if (len == 0)
goto formerr;
rdata += len;
T(addstr(" ", 1, &buf, &buflen));
/** Regexp. */
T(len = charstr(rdata, edata, &buf, &buflen));
if (len < 0)
return (-1);
if (len == 0)
goto formerr;
rdata += len;
T(addstr(" ", 1, &buf, &buflen));
/** Server. */
T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
break;
}
case ns_t_srv:{
u_int priority, weight, port;
char t[50];
if (rdlen < 3U * NS_INT16SZ)
goto formerr;
/** Priority, Weight, Port. */
RES_GET16(priority, rdata);
RES_GET16(weight, rdata);
RES_GET16(port, rdata);
len = SPRINTF((t, "%u %u %u ", priority, weight, port));
T(addstr(t, len, &buf, &buflen));
/** Server. */
T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
break;
}
case ns_t_minfo:
case ns_t_rp:
/** Name1. */
T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
T(addstr(" ", 1, &buf, &buflen));
/** Name2. */
T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
break;
case ns_t_wks:{
int n, lcnt;
if (rdlen < 1U + NS_INT32SZ)
goto formerr;
if (rdlen != (size_t) NS_INADDRSZ)
goto formerr;
/** Address. */
memcpy(&sa.sin_addr, rdata, NS_INADDRSZ);
INET_NTOP(AF_INET, ((struct sockaddr *)&sa), sizeof(sa), buf, buflen, addr);
addlen(strlen(buf), &buf, &buflen);
rdata += NS_INADDRSZ;
/** Protocol. */
len = SPRINTF((tmp, " %u ( ", *rdata));
T(addstr(tmp, len, &buf, &buflen));
rdata += NS_INT8SZ;
/** Bit map. */
n = 0;
lcnt = 0;
while (rdata < edata) {
u_int c = *rdata++;
do {
if (c & 0200) {
if (lcnt == 0) {
T(addstr("\n\t\t\t\t", 5, &buf, &buflen));
lcnt = 10;
spaced = 0;
}
len = SPRINTF((tmp, "%d ", n));
T(addstr(tmp, len, &buf, &buflen));
lcnt--;
}
c <<= 1;
} while (++n & 07);
}
T(addstr(")", 1, &buf, &buflen));
break;
}
case ns_t_ds:{
u_int key_id;
u_int algo;
u_int digest_type;
u_int hashlen = 0;
RES_GET16(key_id, rdata);
algo = *rdata++ & 0xF;
digest_type = *rdata++ & 0xF;
len = SPRINTF((tmp, "%u %u",
algo, digest_type));
T(addstr(tmp, len, &buf, &buflen));
/* check if length of remaining data matches hash length */
len = edata - rdata;
if(digest_type == ALG_DS_HASH_SHA1)
hashlen = SHA_DIGEST_LENGTH;
else if(digest_type == ALG_DS_HASH_SHA256)
hashlen = SHA256_DIGEST_LENGTH;
else
goto formerr;
if (len != hashlen)
goto formerr;
len = SPRINTF((tmp, "\n\t\t"));
T(addstr(tmp, len, &buf, &buflen));
ADD_BYTES(rdata, edata);
break;
}
case ns_t_dnskey:{
char base64_key[NS_MD5RSA_MAX_BASE64];
u_int keyflags, protocol, algorithm, key_id;
const char *leader;
int n;
if (rdlen < 0U + NS_INT16SZ + NS_INT8SZ + NS_INT8SZ)
goto formerr;
/*
* Key flags, Protocol, Algorithm.
*/
if (!rdata) {
key_id = 0;
} else {
/** compute a checksum on the key part of the key rr */
key_id = id_calc(rdata, edata - rdata);
}
RES_GET16(keyflags, rdata);
protocol = *rdata++;
algorithm = *rdata++;
len = SPRINTF((tmp, "0x%04x %u %u",
keyflags, protocol, algorithm));
T(addstr(tmp, len, &buf, &buflen));
/*
* Public key data.
*/
len = b64_ntop(rdata, edata - rdata,
base64_key, sizeof(base64_key));
if (len < 0)
goto formerr;
if (len > 15) {
T(addstr(" (", 2, &buf, &buflen));
leader = "\n\t\t";
spaced = 0;
} else
leader = " ";
for (n = 0; n < len; n += 48) {
T(addstr(leader, strlen(leader), &buf, &buflen));
T(addstr(base64_key + n, MIN(len - n, 48), &buf, &buflen));
}
if (len > 15)
T(addstr(" )", 2, &buf, &buflen));
n = SPRINTF((tmp, " ; key_tag= %u", key_id));
T(addstr(tmp, n, &buf, &buflen));
break;
}
case ns_t_rrsig:{
char base64_key[NS_MD5RSA_MAX_BASE64];
u_int type_h, algorithm, labels, footprint;
const char *leader;
u_long t;
int n;
if (rdlen < 22U)
goto formerr;
/** Type covered, Algorithm, Label count, Original TTL. */
RES_GET16(type_h, rdata);
algorithm = *rdata++;
labels = *rdata++;
RES_GET32(t, rdata);
len = SPRINTF((tmp, "%s %d %d %lu ",
p_type(type_h), algorithm, labels, t));
T(addstr(tmp, len, &buf, &buflen));
if (labels > (u_int) dn_count_labels(name))
goto formerr;
/** Signature expiry. */
RES_GET32(t, rdata);
len = SPRINTF((tmp, "%s ", p_secstodate(t)));
T(addstr(tmp, len, &buf, &buflen));
/** Time signed. */
RES_GET32(t, rdata);
len = SPRINTF((tmp, "%s ", p_secstodate(t)));
T(addstr(tmp, len, &buf, &buflen));
/** Signature Footprint. */
RES_GET16(footprint, rdata);
len = SPRINTF((tmp, "%u ", footprint));
T(addstr(tmp, len, &buf, &buflen));
/** Signer's name. */
T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
/** Signature. */
len = b64_ntop(rdata, edata - rdata,
base64_key, sizeof(base64_key));
if (len > 15) {
T(addstr(" (", 2, &buf, &buflen));
leader = "\n\t\t";
spaced = 0;
} else
leader = " ";
if (len < 0)
goto formerr;
for (n = 0; n < len; n += 48) {
T(addstr(leader, strlen(leader), &buf, &buflen));
T(addstr(base64_key + n, MIN(len - n, 48), &buf, &buflen));
}
if (len > 15)
T(addstr(" )", 2, &buf, &buflen));
break;
}
#ifdef LIBVAL_NSEC3
case ns_t_nsec3: {
u_int algo;
u_int flags;
u_int iterations;
u_int saltlen;
u_int hashlen;
if (rdlen < 0U + NS_INT8SZ + NS_INT8SZ + NS_INT16SZ + NS_INT8SZ)
goto formerr;
/* algorithm flags iterations saltlen */
algo = *rdata++ & 0xF;
flags = *rdata++ & 0xF;
RES_GET16(iterations, rdata);
len = SPRINTF((tmp, "%u %u %u ",
algo, flags, iterations));
T(addstr(tmp, len, &buf, &buflen));
saltlen = *rdata++ & 0xF;
if (edata - rdata < saltlen)
goto formerr;
if (saltlen > 0) {
ADD_BYTES(rdata, (rdata + saltlen));
len = SPRINTF((tmp, " "));
T(addstr(tmp, len, &buf, &buflen));
}
hashlen = *rdata++;
if (hashlen > edata - rdata)
goto formerr;
len = SPRINTF((tmp, "\n\t\t"));
T(addstr(tmp, len, &buf, &buflen));
ADD_BYTES(rdata, (rdata + hashlen));
goto nxtbitmaps;
}
#endif /* LIBVAL_NSEC3 */
case ns_t_nsec: {
int c, n;
u_char b, l;
/** Next domain name. */
T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
#ifdef LIBVAL_NSEC3
nxtbitmaps:
#endif /* LIBVAL_NSEC3 */
/** Type bit map. */
while (edata - rdata > 0) {
b = *rdata;
rdata += NS_INT8SZ;
l = *rdata;
rdata += NS_INT8SZ;
n = l * 8;
for (c = 0; c < n; c++)
if (NS_NXT_BIT_ISSET(c, rdata)) {
len =
SPRINTF((tmp, " %s", p_type(b * (2 ^ 8) + c)));
T(addstr(tmp, len, &buf, &buflen));
}
rdata += n;
}
break;
}
case ns_t_cert:{
u_int c_type, key_tag, alg;
int n;
unsigned int siz;
char base64_cert[8192], tmp[40];
const char *leader;
RES_GET16(c_type, rdata);
RES_GET16(key_tag, rdata);
alg = (u_int) * rdata++;
len = SPRINTF((tmp, "%d %d %d ", c_type, key_tag, alg));
T(addstr(tmp, len, &buf, &buflen));
siz = (edata - rdata) * 4 / 3 + 4; /* "+4" accounts for trailing \0 */
if (siz > sizeof(base64_cert) * 3 / 4) {
const char *str = "record too long to print";
T(addstr(str, strlen(str), &buf, &buflen));
} else {
len = b64_ntop(rdata, edata - rdata, base64_cert, siz);
if (len < 0)
goto formerr;
else if (len > 15) {
T(addstr(" (", 2, &buf, &buflen));
leader = "\n\t\t";
spaced = 0;
} else
leader = " ";
for (n = 0; n < len; n += 48) {
T(addstr(leader, strlen(leader), &buf, &buflen));
T(addstr(base64_cert + n, MIN(len - n, 48),
&buf, &buflen));
}
if (len > 15)
T(addstr(" )", 2, &buf, &buflen));
}
break;
}
case ns_t_tsig:{
/*
* BEW - need to complete this
*/
int n;
T(len = addname(msg, msglen, &rdata, origin, &buf, &buflen));
T(addstr(" ", 1, &buf, &buflen));
rdata += 8; /* time */
RES_GET16(n, rdata);
rdata += n; /* sig */
RES_GET16(n, rdata);
RES_GET16(n, rdata);
SPRINTF((buf, "%d", n));
addlen(strlen(buf), &buf, &buflen);
break;
}
#ifdef VAL_IPV6
case ns_t_a6:{
struct in6_addr a;
int pbyte, pbit;
/** prefix length */
if (rdlen == 0U)
goto formerr;
len = SPRINTF((tmp, "%d ", *rdata));
T(addstr(tmp, len, &buf, &buflen));
pbit = *rdata;
if (pbit > 128)
goto formerr;
pbyte = (pbit & ~7) / 8;
rdata++;
/** address suffix: provided only when prefix len != 128 */
if (pbit < 128) {
if (rdata + pbyte >= edata)
goto formerr;
memset(&a, 0, sizeof(a));
memcpy(&a.s6_addr[pbyte], rdata, sizeof(a) - pbyte);
memcpy(&sa6.sin6_addr, &a, NS_IN6ADDRSZ);
INET_NTOP(AF_INET6, ((struct sockaddr *)&sa6), sizeof(sa6), buf, buflen, addr);
addlen(strlen(buf), &buf, &buflen);
rdata += sizeof(a) - pbyte;
}
/** prefix name: provided only when prefix len > 0 */
if (pbit == 0)
break;
if (rdata >= edata)
goto formerr;
T(addstr(" ", 1, &buf, &buflen));
T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
break;
}
#endif
case ns_t_opt:{
len = SPRINTF((tmp, "%u bytes", class_h));
T(addstr(tmp, len, &buf, &buflen));
break;
}
default:
comment = "unknown RR type";
goto hexify;
}
return (buf - obuf);
formerr:
comment = "RR format error";
hexify:{
int n, m;
char *p;
len = SPRINTF((tmp, "\\# %u (\t; %s", (unsigned)(edata - rdata), comment));
T(addstr(tmp, len, &buf, &buflen));
while (rdata < edata) {
p = tmp;
p += SPRINTF((p, "\n\t"));
spaced = 0;
n = MIN(16, edata - rdata);
for (m = 0; m < n; m++)
p += SPRINTF((p, "%02x ", rdata[m]));
T(addstr(tmp, p - tmp, &buf, &buflen));
if (n < 16) {
T(addstr(")", 1, &buf, &buflen));
T(addtab(p - tmp + 1, 48, spaced, &buf, &buflen));
}
p = tmp;
p += SPRINTF((p, "; "));
for (m = 0; m < n; m++)
*p++ = (isascii(rdata[m]) && isprint(rdata[m]))
? rdata[m]
: '.';
T(addstr(tmp, p - tmp, &buf, &buflen));
rdata += n;
}
return (buf - obuf);
}
}
/*
* Private.
*/
/*
* size_t
* prune_origin(name, origin)
* Find out if the name is at or under the current origin.
* return:
* Number of characters in name before start of origin,
* or length of name if origin does not match.
* notes:
* This function should share code with samedomain().
*/
static size_t
prune_origin(const char *name, const char *origin)
{
const char *oname = name;
while (*name != '\0') {
if (origin != NULL && ns_samename(name, origin) == 1)
return (name - oname - (name > oname));
while (*name != '\0') {
if (*name == '\\') {
name++;
/*
* XXX need to handle \nnn form.
*/
if (*name == '\0')
break;
} else if (*name == '.') {
name++;
break;
}
name++;
}
}
return (name - oname);
}
/*
* int
* charstr(rdata, edata, buf, buflen)
* Format a into the presentation buffer.
* return:
* Number of rdata octets consumed
* 0 for protocol format error
* -1 for output buffer error
* side effects:
* buffer is advanced on success.
*/
static int
charstr(const u_char * rdata, const u_char * edata, char **buf,
size_t * buflen)
{
const u_char *odata = rdata;
size_t save_buflen = *buflen;
char *save_buf = *buf;
if (addstr("\"", 1, buf, buflen) < 0)
goto enospc;
if (rdata < edata) {
int n = *rdata;
if (rdata + 1 + n <= edata) {
rdata++;
while (n-- > 0) {
if (strchr("\n\"\\", *rdata) != NULL)
if (addstr("\\", 1, buf, buflen) < 0)
goto enospc;
if (addstr((const char *) rdata, 1, buf, buflen) < 0)
goto enospc;
rdata++;
}
}
}
if (addstr("\"", 1, buf, buflen) < 0)
goto enospc;
return (rdata - odata);
enospc:
errno = ENOSPC;
*buf = save_buf;
*buflen = save_buflen;
return (-1);
}
static int
addname(const u_char * msg, size_t msglen,
const u_char ** pp, const char *origin,
char **buf, size_t * buflen)
{
size_t newlen, save_buflen = *buflen;
char *save_buf = *buf;
int n;
n = dn_expand(msg, msg + msglen, *pp, *buf, *buflen);
if (n < 0)
goto enospc; /* Guess. */
newlen = prune_origin(*buf, origin);
if (**buf == '\0') {
goto root;
} else if (newlen == 0U) {
/*
* Use "@" instead of name.
*/
if (newlen + 2 > *buflen)
goto enospc; /* No room for "@\0". */
(*buf)[newlen++] = '@';
(*buf)[newlen] = '\0';
} else {
if (((origin == NULL || origin[0] == '\0') ||
(origin[0] != '.' && origin[1] != '\0' &&
(*buf)[newlen] == '\0')) && (*buf)[newlen - 1] != '.') {
/*
* No trailing dot.
*/
root:
if (newlen + 2 > *buflen)
goto enospc; /* No room for ".\0". */
(*buf)[newlen++] = '.';
(*buf)[newlen] = '\0';
}
}
*pp += n;
addlen(newlen, buf, buflen);
**buf = '\0';
return (newlen);
enospc:
errno = ENOSPC;
*buf = save_buf;
*buflen = save_buflen;
return (-1);
}
static void
addlen(size_t len, char **buf, size_t * buflen)
{
if (len <= *buflen) {
//INSIST(len <= *buflen);
*buf += len;
*buflen -= len;
}
}
static int
addstr(const char *src, size_t len, char **buf, size_t * buflen)
{
if (len >= *buflen) {
errno = ENOSPC;
return (-1);
}
memcpy(*buf, src, len);
addlen(len, buf, buflen);
**buf = '\0';
return (0);
}
static int
addtab(size_t len, size_t target, int spaced, char **buf, size_t * buflen)
{
size_t save_buflen = *buflen;
char *save_buf = *buf;
int t;
if (spaced || len >= target - 1) {
T(addstr(" ", 2, buf, buflen));
spaced = 1;
} else {
for (t = (target - len - 1) / 8; t >= 0; t--)
if (addstr("\t", 1, buf, buflen) < 0) {
*buflen = save_buflen;
*buf = save_buf;
return (-1);
}
spaced = 0;
}
return (spaced);
}
dnsval-2.0/libsres/res_support.h 0000664 0002372 0002372 00000005773 12071065274 017213 0 ustar hardaker hardaker /*
* Portions Copyright (c) 1995, 1996, 1997 by Trusted Information Systems, Inc.
*
* Permission to use, copy modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND TRUSTED INFORMATION SYSTEMS
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
* TRUSTED INFORMATION SYSTEMS BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THE SOFTWARE.
*/
/*
* Copyright 2005-2013 SPARTA, Inc. All rights reserved.
* See the COPYING file distributed with this software for details.
*/
#ifndef RES_SUPPORT_H
#define RES_SUPPORT_H
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#define RES_GET16(s, cp) do { \
register const u_char *t_cp = (const u_char *)(cp); \
(s) = ((u_int16_t)t_cp[0] << 8) \
| ((u_int16_t)t_cp[1]) \
; \
(cp) += NS_INT16SZ; \
} while (0)
#define RES_GET32(l, cp) do { \
register const u_char *t_cp = (const u_char *)(cp); \
(l) = ((u_int32_t)t_cp[0] << 24) \
| ((u_int32_t)t_cp[1] << 16) \
| ((u_int32_t)t_cp[2] << 8) \
| ((u_int32_t)t_cp[3]) \
; \
(cp) += NS_INT32SZ; \
} while (0)
#define RES_PUT16(s, cp) do { \
register u_int16_t t_s = (u_int16_t)(s); \
register u_char *t_cp = (u_char *)(cp); \
*t_cp++ = t_s >> 8; \
*t_cp = t_s; \
(cp) += NS_INT16SZ; \
} while (0)
#define RES_PUT32(l, cp) do { \
register u_int32_t t_l = (u_int32_t)(l); \
register u_char *t_cp = (u_char *)(cp); \
*t_cp++ = t_l >> 24; \
*t_cp++ = t_l >> 16; \
*t_cp++ = t_l >> 8; \
*t_cp = t_l; \
(cp) += NS_INT32SZ; \
} while (0)
void my_free(void *p, char *filename, int lineno);
void *my_malloc(size_t t, char *filename, int lineno);
char *my_strdup(const char *str, char *filename, int lineno);
void print_response(u_char * ans, size_t resplen);
void log_response(u_char * ans, size_t resplen);
void print_hex_field(u_char field[], size_t length, size_t width,
char *pref);
void print_hex(u_char field[], size_t length);
void dump_response(const u_char * ans, size_t resplen);
u_int16_t retrieve_type(const u_char * rr);
u_int16_t libsres_random(void);
int libsres_msg_getflag(ns_msg han, int flag);
void res_log(void *dont_care, int level, const char *template, ...);
void res_log_ap(void *dont_care, int level, const char *template,
va_list ap);
#endif /* RES_SUPPORT_H */
dnsval-2.0/libsres/res_query.c 0000664 0002372 0002372 00000036370 12107523105 016624 0 ustar hardaker hardaker
/*
* Portions Copyright (c) 1995, 1996, 1997 by Trusted Information Systems, Inc.
*
* Permission to use, copy modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND TRUSTED INFORMATION SYSTEMS
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
* TRUSTED INFORMATION SYSTEMS BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THE SOFTWARE.
*/
/*
* Copyright 2005-2013 SPARTA, Inc. All rights reserved.
* See the COPYING file distributed with this software for details.
*/
#include "validator-internal.h"
#include "res_mkquery.h"
#include "res_support.h"
#include "res_tsig.h"
#include "res_io_manager.h"
#ifndef NULL
#define NULL (void*)0
#endif
#define ENVELOPE 10
#define EMSG_MAX 2048
size_t
wire_name_length(const u_char * field)
{
/*
* Calculates the number of bytes in a DNS wire format name
*/
size_t j;
if (field == NULL)
return 0;
for (j = 0; field[j] && !(0xc0 & field[j]) && j < NS_MAXCDNAME;
j += field[j] + 1);
if (field[j])
j++;
j++;
if (j > NS_MAXCDNAME)
return 0;
else
return j;
}
static size_t
skip_questions(const u_char * buf)
{
return 12 + wire_name_length(&buf[12]) + 4;
}
void
dump_response(const u_char * ans, size_t resplen)
{
/*
* Prints the "raw" response from DNS
*/
size_t i, j, k;
printf("Message length is %d\n", (int)resplen);
for (i = 0; i < 12; i++)
printf("%02x ", (u_char) ans[i]);
printf("\n");
k = 12;
while (ans[k])
k += ans[k] + 1;
for (i = 12; i < k + 1; i++)
printf("%02x ", (u_char) ans[i]);
printf(": ");
for (i = k + 1; i < k + 5; i++)
printf("%02x ", (u_char) ans[i]);
printf("\n");
k += 5;
if (k < resplen)
do {
j = wire_name_length(&ans[k]) + 10; /* j = envelope length */
j += ntohs(*(const u_short *) (&ans[k + j - 2])); /* adds rdata length to j */
for (i = k; i < k + j; i++)
printf("%02x ", (u_char) ans[i]);
printf("\n");
k += j;
} while (k < resplen);
}
u_int16_t
retrieve_type(const u_char * rr)
{
u_int16_t type_n;
size_t name_length = wire_name_length(rr);
memcpy(&type_n, &rr[name_length], sizeof(u_int16_t));
return ntohs(type_n);
}
int
res_quecmp(u_char * query, u_char * response)
{
size_t length;
if (query == NULL || response == NULL)
return 1;
return namecmp(&query[12], &response[12]);
}
int
right_sized(u_char * response, size_t response_length)
{
HEADER *header = (HEADER *) response;
size_t index = skip_questions(response);
size_t records =
ntohs(header->ancount) + ntohs(header->nscount)
+ ntohs(header->arcount);
size_t i;
u_int16_t rdata_len_n;
if (index > response_length)
return TRUE;
for (i = 0; i < records; i++) {
index += wire_name_length(&response[index]) + ENVELOPE;
if (index > response_length)
return TRUE;
memcpy(&rdata_len_n, &response[index - 2], sizeof(u_int16_t));
index += ntohs(rdata_len_n);
if (index > response_length)
return TRUE;
}
return index == response_length;
}
int
theres_something_wrong_with_header(u_char * response,
size_t response_length)
{
HEADER *header = (HEADER *) response;
/*
* Check to see if this is supposed to be a real response
*/
if (header->qr == 1 && header->opcode != ns_o_query) {
res_log(NULL, LOG_DEBUG, "libsres: ""header: not a query!");
return SR_HEADER_ERROR;
}
/*
* Check the length and count of the records
*/
if (right_sized(response, response_length) == FALSE) {
res_log(NULL, LOG_DEBUG, "libsres: ""header: not right sized!");
return SR_HEADER_ERROR;
}
/*
* Check the RCODE value.
* RCODE of no error is always welcome
*/
if (header->rcode == ns_r_noerror)
return SR_UNSET;
/*
* RCODE of NXDOMAIN (no such domain) is welcome in some circumtances:
* With no other records present
* With an SOA or NXT in the authority (ns) section
*/
if (header->rcode == ns_r_nxdomain) {
if (header->ancount == 0 && header->nscount == 0
&& header->arcount == 0)
return SR_UNSET;
/** if (ntohs(header->nscount) > 1) */
{
size_t i;
size_t auth_index = skip_questions(response);
u_int16_t type_h;
u_int16_t rdata_len_n;
for (i = 0; i < ntohs(header->ancount); i++) {
auth_index +=
wire_name_length(&response[auth_index]) + ENVELOPE;
memcpy(&rdata_len_n, &response[auth_index - 2],
sizeof(u_int16_t));
auth_index += ntohs(rdata_len_n);
}
for (i = 0; i < ntohs(header->nscount); i++) {
type_h = retrieve_type(&response[auth_index]);
if (type_h == ns_t_soa ||
#ifdef LIBVAL_NSEC3
type_h == ns_t_nsec3 ||
#endif
type_h == ns_t_nsec)
return SR_UNSET;
auth_index +=
wire_name_length(&response[auth_index]) + ENVELOPE;
memcpy(&rdata_len_n, &response[auth_index - 2],
sizeof(u_int16_t));
auth_index += ntohs(rdata_len_n);
}
}
res_log(NULL, LOG_DEBUG, "libsres: ""header: nxdomain!");
return SR_NXDOMAIN;
}
switch (header->rcode) {
case ns_r_formerr:
res_log(NULL, LOG_DEBUG, "libsres: ""header: formerr!");
return SR_FORMERR;
case ns_r_servfail:
res_log(NULL, LOG_DEBUG, "libsres: ""header: servfail!");
return SR_SERVFAIL;
case ns_r_notimpl:
res_log(NULL, LOG_DEBUG, "libsres: ""header: notimpl!");
return SR_NOTIMPL;
case ns_r_refused:
res_log(NULL, LOG_DEBUG, "libsres: ""header: refused!");
return SR_REFUSED;
default:
res_log(NULL, LOG_DEBUG, "libsres: ""header: genericerr!");
return SR_DNS_GENERIC_ERROR;
}
return SR_UNSET;
}
int
clone_ns(struct name_server **cloned_ns, struct name_server *ns)
{
int i, j;
int name_len;
if (ns == NULL) {
*cloned_ns = NULL;
return SR_UNSET;
}
/*
* Create the structure for the name server
*/
*cloned_ns = (struct name_server *)
MALLOC(sizeof(struct name_server));
if (*cloned_ns == NULL)
return SR_MEMORY_ERROR;
/*
* Make room for the name and insert the name
*/
name_len = wire_name_length(ns->ns_name_n);
memcpy((*cloned_ns)->ns_name_n, ns->ns_name_n, name_len);
/*
* Initialize the rest of the fields
*/
(*cloned_ns)->ns_tsig = NULL; //XXX Still not doing anything with TSIG
(*cloned_ns)->ns_security_options = ns->ns_security_options;
(*cloned_ns)->ns_status = ns->ns_status;
(*cloned_ns)->ns_options = ns->ns_options;
(*cloned_ns)->ns_edns0_size = ns->ns_edns0_size;
(*cloned_ns)->ns_retrans = ns->ns_retrans;
(*cloned_ns)->ns_retry = ns->ns_retry;
(*cloned_ns)->ns_address = (struct sockaddr_storage **)
MALLOC(ns->ns_number_of_addresses *
sizeof(struct sockaddr_storage *));
if ((*cloned_ns)->ns_address == NULL) {
return SR_MEMORY_ERROR;
}
for (i = 0; i < ns->ns_number_of_addresses; i++) {
(*cloned_ns)->ns_address[i] =
(struct sockaddr_storage *)
MALLOC(sizeof(struct sockaddr_storage));
if ((*cloned_ns)->ns_address[i] == NULL) {
for (j = 0; j < i; j++) {
FREE((*cloned_ns)->ns_address[i]);
}
FREE((*cloned_ns)->ns_address);
(*cloned_ns)->ns_address = NULL;
} else {
memset((*cloned_ns)->ns_address[i], 0,
sizeof(struct sockaddr_storage));
}
}
if ((ns->ns_number_of_addresses > 0)
&& (*cloned_ns)->ns_address == NULL) {
FREE(*cloned_ns);
*cloned_ns = NULL;
return SR_MEMORY_ERROR;
}
(*cloned_ns)->ns_number_of_addresses = ns->ns_number_of_addresses;
(*cloned_ns)->ns_next = NULL;
for (i = 0; i < ns->ns_number_of_addresses; i++) {
memcpy((*cloned_ns)->ns_address[i], (ns)->ns_address[i],
sizeof(struct sockaddr_storage));
}
return SR_UNSET;
}
int
clone_ns_list(struct name_server **ns_list,
struct name_server *orig_ns_list)
{
struct name_server *ns, *tail_ns;
int ret_val;
*ns_list = NULL;
for (ns = orig_ns_list; ns != NULL; ns = ns->ns_next) {
struct name_server *temp_ns;
if ((ret_val = clone_ns(&temp_ns, ns)) != SR_UNSET)
return ret_val;
/*
* Add the name server record to the list
*/
if (*ns_list == NULL)
*ns_list = temp_ns;
else {
/*
* Preserving order in case of round robin
*/
tail_ns = *ns_list;
while (tail_ns->ns_next != NULL)
tail_ns = tail_ns->ns_next;
tail_ns->ns_next = temp_ns;
}
}
return SR_UNSET;
}
int
query_send(const char *name,
const u_int16_t type_h,
const u_int16_t class_h,
struct name_server *pref_ns,
int *trans_id)
{
int ret_val;
struct timeval dummy;
ret_val = query_queue(name, type_h, class_h, pref_ns, trans_id);
if (SR_UNSET != ret_val)
return ret_val;
timerclear(&dummy);
res_io_check_one_tid(*trans_id, &dummy, NULL);
return SR_UNSET;
}
/*
* create payloads and queue them in the transaction array, but do not
* start sending them.
*
* this is usefull if you want to change something about the transaction
* first (e.g. set it to default to tcp instead of udp). To start
* transaction processing, call res_io_check_one_tid(), and then
* response_recv() in a loop.
*/
int
query_queue(const char *name, const u_int16_t type_h, const u_int16_t class_h,
struct name_server *pref_ns, int *trans_id)
{
struct expected_arrival *ea;
int ret_val;
if (pref_ns == NULL || name == NULL || trans_id == NULL)
return SR_CALL_ERROR;
*trans_id = -1;
ea = res_async_query_create(name, type_h, class_h, pref_ns, 0);
if (NULL == ea)
return SR_MEMORY_ERROR;
ret_val = res_io_queue_ea(trans_id, ea);
if (ret_val != SR_IO_UNSET)
return SR_INTERNAL_ERROR;
return SR_UNSET;
}
int
res_response_checks(u_char ** answer, size_t * answer_length,
struct name_server **respondent)
{
int retval;
if (NULL == answer || NULL == answer_length)
return SR_INTERNAL_ERROR;
log_response(*answer, *answer_length);
if ((*respondent != NULL) &&
(res_tsig_verifies(*respondent,
*answer, *answer_length) != SR_TS_OK))
retval = SR_TSIG_ERROR;
else
retval = theres_something_wrong_with_header(*answer, *answer_length);
if (SR_UNSET == retval)
return retval;
res_log(NULL,LOG_DEBUG,"libsres: ""error in response; dropping; rc %d",
retval);
FREE(*answer);
*answer = NULL;
*answer_length = 0;
return SR_NO_ANSWER;
}
/*
* Returns:
* SR_INTERNAL_ERROR
* SR_NO_ANSWER_YET
* SR_NO_ANSWER
* SR_GOT_ANSWER
* SR_UNSET
*
* caller is responsible for releasing respondent, even when SR_NO_ANSWER
* is returned.
*/
int
response_recv(int *trans_id,
fd_set *pending_desc,
struct timeval *closest_event,
struct name_server **respondent,
u_char ** answer, size_t * answer_length)
{
int ret_val;
if ((NULL == trans_id) || (NULL == pending_desc) || (NULL == closest_event) ||
(NULL == respondent) || (NULL == answer) || (NULL == answer_length))
return SR_INTERNAL_ERROR;
res_log(NULL, LOG_DEBUG, "libsres: ""response_recv tid %d", *trans_id);
/*
* Prepare the default response
*/
*answer = NULL;
*answer_length = 0;
*respondent = NULL;
ret_val = res_io_accept(*trans_id, pending_desc, closest_event,
answer, answer_length, respondent);
ret_val = res_map_srio_to_sr(ret_val);
return ret_val;
}
int
get(const char *name,
const u_int16_t type_h,
const u_int16_t class_h,
struct name_server *nslist,
struct name_server **server,
u_char ** response, size_t * response_length)
{
int ret_val;
int trans_id;
struct timeval closest_event;
fd_set pending_desc;
if (SR_UNSET == (ret_val = query_send(name, type_h, class_h, nslist, &trans_id))) {
if (server)
*server = NULL;
res_log(NULL,LOG_DEBUG,"libsres: ""get %s", name);
do {
FD_ZERO(&pending_desc);
timerclear(&closest_event);
if (server && NULL != *server) {
free_name_server(server);
*server = NULL;
}
ret_val = response_recv(&trans_id, &pending_desc, &closest_event, server, response,
response_length);
if (ret_val == SR_NO_ANSWER_YET) {
/* wait for some data to become available */
wait_for_res_data(&pending_desc, &closest_event);
}
} while (ret_val == SR_NO_ANSWER_YET);
res_cancel(&trans_id); /* cleanup transaction */
}
return ret_val;
}
int
get_tcp(const char *name, u_int16_t type_h, u_int16_t class_h,
struct name_server *nslist,
struct name_server **server,
u_char ** response, size_t * response_length)
{
int ret_val;
int trans_id;
struct timeval closest_event;
fd_set pending_desc;
ret_val = query_queue(name, type_h, class_h, nslist, &trans_id);
if (SR_UNSET != ret_val)
return ret_val;
res_switch_all_to_tcp_tid(trans_id);
if (server)
*server = NULL;
res_log(NULL,LOG_DEBUG,"libsres: ""get_tcp %s", name);
do {
FD_ZERO(&pending_desc);
timerclear(&closest_event);
if (server && NULL != *server) {
free_name_server(server);
*server = NULL;
}
ret_val = response_recv(&trans_id, &pending_desc, &closest_event,
server, response, response_length);
if (ret_val == SR_NO_ANSWER_YET) {
/* wait for some data to become available */
wait_for_res_data(&pending_desc, &closest_event);
}
} while (ret_val == SR_NO_ANSWER_YET);
res_cancel(&trans_id); /* cleanup transaction */
return ret_val;
}
dnsval-2.0/libsres/base64.c 0000664 0002372 0002372 00000026166 11732713653 015710 0 ustar hardaker hardaker /*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-1999 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/*
* Portions Copyright (c) 1995 by International Business Machines, Inc.
*
* International Business Machines, Inc. (hereinafter called IBM) grants
* permission under its copyrights to use, copy, modify, and distribute this
* Software with or without fee, provided that the above copyright notice and
* all paragraphs of this notice appear in all copies, and that the name of IBM
* not be used in connection with the marketing of any product incorporating
* the Software or modifications thereof, without specific, written prior
* permission.
*
* To the extent it has a right to do so, IBM grants an immunity from suit
* under its patents, if any, for the use, sale or manufacture of products to
* the extent that such products are used for performing Domain Name System
* dynamic updates in TCP/IP networks by means of the Software. No immunity is
* granted for any product per se or for any other function of any product.
*
* THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL,
* DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN
* IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
#include "validator-internal.h"
#define Assert(Cond) if (!(Cond)) abort()
static const char Base64[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
static const char Pad64 = '=';
/*
* (From RFC1521 and draft-ietf-dnssec-secext-03.txt)
* The following encoding technique is taken from RFC 1521 by Borenstein
* and Freed. It is reproduced here in a slightly edited form for
* convenience.
*
* A 65-character subset of US-ASCII is used, enabling 6 bits to be
* represented per printable character. (The extra 65th character, "=",
* is used to signify a special processing function.)
*
* The encoding process represents 24-bit groups of input bits as output
* strings of 4 encoded characters. Proceeding from left to right, a
* 24-bit input group is formed by concatenating 3 8-bit input groups.
* These 24 bits are then treated as 4 concatenated 6-bit groups, each
* of which is translated into a single digit in the base64 alphabet.
*
* Each 6-bit group is used as an index into an array of 64 printable
* characters. The character referenced by the index is placed in the
* output string.
*
* Table 1: The Base64 Alphabet
*
* Value Encoding Value Encoding Value Encoding Value Encoding
* 0 A 17 R 34 i 51 z
* 1 B 18 S 35 j 52 0
* 2 C 19 T 36 k 53 1
* 3 D 20 U 37 l 54 2
* 4 E 21 V 38 m 55 3
* 5 F 22 W 39 n 56 4
* 6 G 23 X 40 o 57 5
* 7 H 24 Y 41 p 58 6
* 8 I 25 Z 42 q 59 7
* 9 J 26 a 43 r 60 8
* 10 K 27 b 44 s 61 9
* 11 L 28 c 45 t 62 +
* 12 M 29 d 46 u 63 /
* 13 N 30 e 47 v
* 14 O 31 f 48 w (pad) =
* 15 P 32 g 49 x
* 16 Q 33 h 50 y
*
* Special processing is performed if fewer than 24 bits are available
* at the end of the data being encoded. A full encoding quantum is
* always completed at the end of a quantity. When fewer than 24 input
* bits are available in an input group, zero bits are added (on the
* right) to form an integral number of 6-bit groups. Padding at the
* end of the data is performed using the '=' character.
*
* Since all base64 input is an integral number of octets, only the
* -------------------------------------------------
* following cases can arise:
*
* (1) the final quantum of encoding input is an integral
* multiple of 24 bits; here, the final unit of encoded
* output will be an integral multiple of 4 characters
* with no "=" padding,
* (2) the final quantum of encoding input is exactly 8 bits;
* here, the final unit of encoded output will be two
* characters followed by two "=" padding characters, or
* (3) the final quantum of encoding input is exactly 16 bits;
* here, the final unit of encoded output will be three
* characters followed by one "=" padding character.
*/
int
b64_ntop(u_char const *src, size_t srclength, char *target,
size_t targsize)
{
size_t datalength = 0;
u_char input[3];
u_char output[4];
size_t i;
while (2U < srclength) {
input[0] = *src++;
input[1] = *src++;
input[2] = *src++;
srclength -= 3;
output[0] = input[0] >> 2;
output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4);
output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6);
output[3] = input[2] & 0x3f;
Assert(output[0] < 64);
Assert(output[1] < 64);
Assert(output[2] < 64);
Assert(output[3] < 64);
if (datalength + 4 > targsize)
return (-1);
target[datalength++] = Base64[output[0]];
target[datalength++] = Base64[output[1]];
target[datalength++] = Base64[output[2]];
target[datalength++] = Base64[output[3]];
}
/*
* Now we worry about padding.
*/
if (0U != srclength) {
/*
* Get what's left.
*/
input[0] = input[1] = input[2] = '\0';
for (i = 0; i < srclength; i++)
input[i] = *src++;
output[0] = input[0] >> 2;
output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4);
output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6);
Assert(output[0] < 64);
Assert(output[1] < 64);
Assert(output[2] < 64);
if (datalength + 4 > targsize)
return (-1);
target[datalength++] = Base64[output[0]];
target[datalength++] = Base64[output[1]];
if (srclength == 1U)
target[datalength++] = Pad64;
else
target[datalength++] = Base64[output[2]];
target[datalength++] = Pad64;
}
if (datalength >= targsize)
return (-1);
target[datalength] = '\0'; /* Returned value doesn't count \0. */
return (datalength);
}
/*
* skips all whitespace anywhere.
* converts characters, four at a time, starting at (or after)
* src from base - 64 numbers into three 8 bit bytes in the target area.
* it returns the number of data bytes stored at the target, or -1 on error.
*/
int
b64_pton(const char *src, u_char *target, size_t targsize)
{
int tarindex, state, ch;
const char *pos;
state = 0;
tarindex = 0;
while ((ch = *src++) != '\0') {
if (isspace(ch)) /* Skip whitespace anywhere. */
continue;
if (ch == Pad64)
break;
pos = strchr(Base64, ch);
if (pos == 0) /* A non-base64 character. */
return (-1);
switch (state) {
case 0:
if (target) {
if ((size_t) tarindex >= targsize)
return (-1);
target[tarindex] = (pos - Base64) << 2;
}
state = 1;
break;
case 1:
if (target) {
if ((size_t) tarindex + 1 >= targsize)
return (-1);
target[tarindex] |= (pos - Base64) >> 4;
target[tarindex + 1] = ((pos - Base64) & 0x0f)
<< 4;
}
tarindex++;
state = 2;
break;
case 2:
if (target) {
if ((size_t) tarindex + 1 >= targsize)
return (-1);
target[tarindex] |= (pos - Base64) >> 2;
target[tarindex + 1] = ((pos - Base64) & 0x03)
<< 6;
}
tarindex++;
state = 3;
break;
case 3:
if (target) {
if ((size_t) tarindex >= targsize)
return (-1);
target[tarindex] |= (pos - Base64);
}
tarindex++;
state = 0;
break;
default:
abort();
}
}
/*
* We are done decoding Base-64 chars. Let's see if we ended
* on a byte boundary, and/or with erroneous trailing characters.
*/
if (ch == Pad64) { /* We got a pad char. */
ch = *src++; /* Skip it, get next. */
switch (state) {
case 0: /* Invalid = in first position */
case 1: /* Invalid = in second position */
return (-1);
case 2: /* Valid, means one byte of info */
/*
* Skip any number of spaces.
*/
for ((void) NULL; ch != '\0'; ch = *src++)
if (!isspace(ch))
break;
/*
* Make sure there is another trailing = sign.
*/
if (ch != Pad64)
return (-1);
ch = *src++; /* Skip the = */
/*
* Fall through to "single trailing =" case.
*/
/** FALLTHROUGH */
case 3: /* Valid, means two bytes of info */
/*
* We know this char is an =. Is there anything but
* whitespace after it?
*/
for ((void) NULL; ch != '\0'; ch = *src++)
if (!isspace(ch))
return (-1);
/*
* Now make sure for cases 2 and 3 that the "extra"
* bits that slopped past the last full byte were
* zeros. If we don't check them, they become a
* subliminal channel.
*/
if (target && target[tarindex] != 0)
return (-1);
}
} else {
/*
* We ended by seeing the end of the string. Make sure we
* have no partial bytes lying around.
*/
if (state != 0)
return (-1);
}
return (tarindex);
}
dnsval-2.0/libsres/res_support.c 0000664 0002372 0002372 00000037723 12107523105 017176 0 ustar hardaker hardaker
/*
* Portions Copyright (c) 1995, 1996, 1997 by Trusted Information Systems, Inc.
*
* Permission to use, copy modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND TRUSTED INFORMATION SYSTEMS
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
* TRUSTED INFORMATION SYSTEMS BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THE SOFTWARE.
*/
/*
* Copyright 2005-2013 SPARTA, Inc. All rights reserved.
* See the COPYING file distributed with this software for details.
*/
#include "validator-internal.h"
#include
#include "res_support.h"
#include "res_io_manager.h"
extern void libsres_pquery(const u_char * msg, size_t len, FILE * file);
static int seq_number = 0;
FILE *logfile = NULL;
#define MEM_LOGFILE "memory_logfile"
#ifdef WIN32
/*
Implementation as per:
The Open Group Base Specifications, Issue 6
IEEE Std 1003.1, 2004 Edition
The timezone pointer arg is ignored. Errors are ignored.
*/
int gettimeofday(struct timeval* p, void* tz /* IGNORED */)
{
union {
long long ns100; /*time since 1 Jan 1601 in 100ns units */
FILETIME ft;
} now;
GetSystemTimeAsFileTime( &(now.ft) );
p->tv_usec=(long)((now.ns100 / 10LL) % 1000000LL );
p->tv_sec= (long)((now.ns100-(116444736000000000LL))/10000000LL);
return 0;
}
#endif
int
res_gettimeofday_buf(char *buf, size_t bufsize) {
struct timeval tv;
struct tm *tp;
struct tm tm;
tp = NULL;
#ifdef WIN32
time(&tv.tv_sec);
#else
gettimeofday(&tv, NULL);
#endif
#ifdef HAVE_LOCALTIME_R
localtime_r(&tv.tv_sec, &tm);
tp = &tm;
#else
tp = localtime(&tv.tv_sec);
#endif
if (tp) {
snprintf(buf, bufsize, "%04d%02d%02d::%02d:%02d:%02d ",
tp->tm_year+1900, tp->tm_mon+1, tp->tm_mday,
tp->tm_hour, tp->tm_min, tp->tm_sec);
} else {
snprintf(buf, bufsize, "0000:00:00::00:00:00 ");
}
return 0;
}
void
my_free(void *p, char *filename, int lineno)
{
if (logfile == NULL)
logfile = fopen(MEM_LOGFILE, "w");
fprintf(logfile, "0x%08lx %5d bFREE %-20s %5d\n", (u_long) p,
seq_number++, filename, lineno);
fflush(logfile);
free(p);
}
void *
my_malloc(size_t t, char *filename, int lineno)
{
void *p;
if (logfile == NULL)
logfile = fopen(MEM_LOGFILE, "w");
if (t == 0) {
res_log(NULL,LOG_DEBUG, "0 byte alloc from %-20s %5d", filename, lineno);
p = NULL;
}
else
p = malloc(t);
fprintf(logfile, "0x%08lx %5d aMALL %-20s %5d size=%6d\n", (u_long) p,
seq_number++, filename, lineno, (u_int) t);
fflush(logfile);
return p;
}
char *
my_strdup(const char *str, char *filename, int lineno)
{
char *p = strdup(str);
if (logfile == NULL)
logfile = fopen(MEM_LOGFILE, "w");
fprintf(logfile, "0x%08lx %5d aSTRD %-20s %5d\n", (u_long) p,
seq_number++, filename, lineno);
fflush(logfile);
return p;
}
void
print_response(u_char * ans, size_t resplen)
{
if (ans && (resplen > 0))
libsres_pquery(ans, resplen, stdout);
}
void
log_response(u_char * ans, size_t resplen)
{
if (ans && (resplen > 0))
libsres_pquery(ans, resplen, NULL);
}
void
print_hex_field(u_char field[], size_t length, size_t width, char *pref)
{
/*
* Prints an arbitrary bit field, from one address for some number of
* bytes. Output is formatted via the width, and includes the raw
* hex value and (if printable) the printed value underneath. "pref"
* is a string used to start each line, e.g., " " to indent.
*
* This is very useful in gdb to see what's in a memory field.
*/
size_t i, start, stop;
start = 0;
do {
stop = (start + width) < length ? (start + width) : length;
printf("%s", pref);
for (i = start; i < stop; i++)
printf("%02x ", (u_char) field[i]);
printf("\n");
printf("%s", pref);
for (i = start; i < stop; i++)
if (isprint(field[i]))
printf(" %c ", (u_char) field[i]);
else
printf(" ");
printf("\n");
start = stop;
} while (start < length);
}
void
print_hex(u_char field[], size_t length)
{
/*
* Prints the hex values of a field...not as pretty as the print_hex_field.
*/
size_t i, start, stop;
start = 0;
do {
stop = length;
for (i = start; i < stop; i++)
printf("%02x ", (u_char) field[i]);
start = stop;
if (start < length)
printf("\n");
} while (start < length);
}
struct sockaddr_storage **
create_nsaddr_array(int num_addrs)
{
int i, j;
struct sockaddr_storage **ns_address = (struct sockaddr_storage **)
MALLOC (num_addrs * sizeof(struct sockaddr_storage *));
if(ns_address == NULL)
return NULL;
for(i=0; i< num_addrs; i++) {
ns_address[i] = (struct sockaddr_storage *)
MALLOC (sizeof(struct sockaddr_storage));
if (ns_address[i] == NULL) {
for(j=0; jns_tsig = NULL;
ns->ns_security_options = ZONE_USE_NOTHING;
ns->ns_status = 0;
ns->ns_retrans = RES_TIMEOUT;
ns->ns_retry = RES_RETRY;
ns->ns_options = SR_QUERY_DEFAULT | SR_QUERY_DEBUG;
ns->ns_edns0_size = RES_EDNS0_DEFAULT;
ns->ns_next = NULL;
ns->ns_address = NULL;
ns->ns_number_of_addresses = 0;
return ns;
}
struct name_server *
parse_name_server(const char *cp, const char *name_n)
{
short port_num = NS_DEFAULTPORT;
const char *cpt;
char addr[IPADDR_STRING_MAX];
struct name_server *ns;
struct sockaddr_storage serv_addr;
struct sockaddr_in *sin = (struct sockaddr_in *)&serv_addr;
#ifdef VAL_IPV6
struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)&serv_addr;
#if defined( WIN32 )
size_t addrlen6 = sizeof(struct sockaddr_in6);
#endif
#endif
#if defined( WIN32 )
size_t addrlen4 = sizeof(struct sockaddr_in);
#endif
if (cp == NULL)
return NULL;
ns = create_name_server();
if (ns == NULL)
return NULL;
if (NULL == name_n)
name_n = "."; /* root zone */
if (ns_name_pton(name_n, ns->ns_name_n,
sizeof(ns->ns_name_n)) == -1) {
FREE(ns);
return NULL;
}
/*
* Look for port number in address string
* syntax of '[address]:port'
*/
cpt = cp;
if ( (*cpt == '[') && (cpt = strchr(cpt,']')) ) {
if ( sizeof(addr) < (cpt - cp) )
goto err;
memset(addr, 0, sizeof(addr));
strncpy(addr, (cp + 1), (cpt - cp - 1));
cp = addr;
if ( (*(++cpt) == ':') && (0 == (port_num = atoi(++cpt))) )
goto err;
}
/*
* convert address string
*/
memset(&serv_addr, 0, sizeof(serv_addr));
if (INET_PTON(AF_INET, cp, ((struct sockaddr *)sin), &addrlen4) > 0) {
sin->sin_family = AF_INET; // host byte order
sin->sin_port = htons(port_num); // short, network byte order
}
else {
#ifdef VAL_IPV6
if (INET_PTON(AF_INET6, cp, ((struct sockaddr *)sin6), &addrlen6) != 1)
goto err;
sin6->sin6_family = AF_INET6; // host byte order
sin6->sin6_port = htons(port_num); // short, network byte order
#else
goto err;
#endif
}
ns->ns_address = create_nsaddr_array(1);
if(ns->ns_address == NULL)
goto err;
memcpy(ns->ns_address[0], &serv_addr,
sizeof(serv_addr));
ns->ns_number_of_addresses = 1;
return ns;
err:
FREE(ns);
return NULL;
}
void
free_name_server(struct name_server **ns)
{
int i;
if (ns && *ns) {
if ((*ns)->ns_tsig)
FREE((*ns)->ns_tsig);
for (i = 0; i < (*ns)->ns_number_of_addresses; i++) {
FREE((*ns)->ns_address[i]);
}
if ((*ns)->ns_address)
FREE((*ns)->ns_address);
FREE(*ns);
*ns = NULL;
}
}
void
free_name_servers(struct name_server **ns)
{
if (ns && *ns) {
if ((*ns)->ns_next)
free_name_servers(&((*ns)->ns_next));
free_name_server(ns);
}
}
u_int16_t libsres_random(void)
{
u_int16_t rnd;
if (!RAND_bytes((unsigned char *)&rnd, sizeof(rnd))) {
RAND_pseudo_bytes((unsigned char *)&rnd, sizeof(rnd));
}
#if 0
if (!RAND_pseudo_bytes((unsigned char *)&rnd, sizeof(rnd))) {
/* bytes generated are not cryptographically strong */
u_int16_t seed;
seed = random() & 0xffff;
RAND_seed(&seed, sizeof(seed));
RAND_pseudo_bytes((unsigned char *)&rnd, sizeof(rnd));
}
#endif
return rnd;
}
int
label_bytes_cmp(const u_char * field1, size_t length1,
const u_char * field2, size_t length2)
{
u_char buffer1[NS_MAXCDNAME];
u_char buffer2[NS_MAXCDNAME];
size_t i;
size_t min_len;
int ret_val;
/*
* If the first n bytes are the same, then the length determines
* the difference - if any
*/
if (length1 == 0 || length2 == 0)
return length1 - length2;
min_len = (length1 < length2) ? length1 : length2;
/*
* Compare this label's first min_len bytes
*/
/*
* Convert to lower case first
*/
memcpy(buffer1, field1, min_len);
for (i = 0; i < min_len; i++)
if (isupper(buffer1[i]))
buffer1[i] = tolower(buffer1[i]);
memcpy(buffer2, field2, min_len);
for (i = 0; i < min_len; i++)
if (isupper(buffer2[i]))
buffer2[i] = tolower(buffer2[i]);
ret_val = memcmp(buffer1, buffer2, min_len);
/*
* If they differ, propgate that
*/
if (ret_val != 0)
return ret_val;
/*
* If the first n bytes are the same, then the length determines
* the difference - if any
*/
return length1 - length2;
}
int
labelcmp(const u_char * name1, const u_char * name2, size_t label_cnt)
{
/*
* Compare two names, assuming same number of labels in each
*/
size_t length1;
size_t length2;
const u_char *ptr1[256];
const u_char *ptr2[256];
size_t offset1 = 0;
size_t offset2 = 0;
size_t i;
length1 = (int) (name1 ? name1[0] : 0);
length2 = (int) (name2 ? name2[0] : 0);
if (length1 == 0 || length2 == 0)
return length1 - length2;
if (label_cnt > 256) {
return -1;
}
/* mark all the label start points */
for(i=0; i 0) {
int retval;
length1 = *ptr1[label_cnt-1];
length2 = *ptr2[label_cnt-1];
if (length1 == 0 || length2 == 0) {
retval = length1 - length2;
} else {
retval = label_bytes_cmp(&ptr1[label_cnt-1][1],
length1,
&ptr2[label_cnt-1][1],
length2);
}
if (retval != 0)
return retval;
label_cnt--;
}
/* all labels are identical */
return 0;
}
/*
* compare DNS wire format names
*
* returns
* <0 if name1 is before name2
* 0 if equal
* >0 if name1 is after name2
*/
int
namecmp(const u_char * name1, const u_char * name2)
{
size_t labels1 = 1;
size_t labels2 = 1;
size_t index1 = 0;
size_t index2 = 0;
size_t i;
size_t label_cnt;
size_t ldiff;
int ret_val;
/*
* deal w/any null ptrs
*/
if (name1 == NULL) {
if (name2 == NULL)
return 0;
else
return -1;
} else {
if (name2 == NULL)
return 1;
}
/*
* count labels
*/
for (; name1[index1]; index1 += (int) name1[index1] + 1)
labels1++;
for (; name2[index2]; index2 += (int) name2[index2] + 1)
labels2++;
index1 = 0;
index2 = 0;
/*
* find index in longer name where the number of labels is equal
*/
if (labels1 > labels2) {
label_cnt = labels2;
ldiff = labels1 - labels2;
for (i = 0; i < ldiff; i++)
index1 += name1[index1] + 1;
}
else {
label_cnt = labels1;
ldiff = labels2 - labels1;
for (i = 0; i < ldiff; i++)
index2 += name2[index2] + 1;
}
/*
* compare last N labels
*/
ret_val = labelcmp(&name1[index1], &name2[index2], label_cnt);
if (ret_val != 0)
return ret_val;
/*
* If one dname is a "proper suffix" of the other,
* the shorter comes first
*/
return labels1 - labels2;
}
int
res_map_srio_to_sr(int val)
{
switch(val) {
case SR_IO_UNSET:
case SR_IO_GOT_ANSWER:
val = SR_UNSET;
break;
case SR_IO_NO_ANSWER_YET:
val = SR_NO_ANSWER_YET;
break;
case SR_IO_NO_ANSWER:
val = SR_NO_ANSWER;
break;
case SR_IO_MEMORY_ERROR:
case SR_IO_TOO_MANY_TRANS:
case SR_IO_SOCKET_ERROR:
case SR_IO_INTERNAL_ERROR:
default:
val = SR_INTERNAL_ERROR;
}
return val;
}
/*
* using val_log for logging introduces a circular dependency. Default to
* using stderr for logging unless USE_LIBVAL_LOGGING is defined.
*/
static int sres_level = LOG_WARNING;
void
res_set_debug_level(int level)
{
sres_level = level;
}
int
res_get_debug_level(void)
{
return sres_level;
}
#ifndef USE_LIBVAL_LOGGING
void
res_log(void *dont_care, int level, const char *template, ...)
{
char buf[1028];
va_list ap;
if (NULL == template || level > sres_level)
return;
res_gettimeofday_buf(buf, sizeof(buf) - 2);
va_start(ap, template);
vsnprintf(&buf[19], sizeof(buf) - 21, template, ap);
va_end(ap);
fprintf(stderr, "%s\n", buf);
fflush(stderr);
}
void
res_log_ap(void *dont_care, int level, const char *template, va_list ap)
{
char buf[1028];
if (NULL == template || level > sres_level)
return;
res_gettimeofday_buf(buf, sizeof(buf) - 2);
vsnprintf(&buf[19], sizeof(buf) - 21, template, ap);
fprintf(stderr, "%s\n", buf);
fflush(stderr);
}
#else /* ifdef USE_LIBVAL_LOGGING */
/** pass messages on to val_log... */
void
res_log_ap(void *dont_care, int level, const char *template, va_list ap)
{
if (NULL == template || level > sres_level)
return;
val_log_ap((val_context_t*)dont_care, LOG_ERR, template, ap);
}
/** pass messages on to val_log... */
void
res_log(void *dont_care, int level, const char *template, ...)
{
va_list ap;
if (NULL == template || level > sres_level)
return;
va_start(ap, template);
val_log_ap((val_context_t*)dont_care, LOG_ERR, template, ap);
va_end(ap);
}
#endif /* ifdef USE_LIBVAL_LOGGING */
dnsval-2.0/libsres/res_comp.h 0000664 0002372 0002372 00000000502 11560322751 016414 0 ustar hardaker hardaker
#ifndef _RES_COMP_H_
#define _RES_COMP_H_
int
dn_comp(const char *src, u_char * dst, int dstsiz,
u_char ** dnptrs, u_char ** lastdnptr);
int
dn_skipname(const u_char * ptr, const u_char * eom);
int
dn_expand(const u_char * msg, const u_char * eom, const u_char * src,
char *dst, int dstsiz);
#endif
dnsval-2.0/libsres/res_mkquery.h 0000664 0002372 0002372 00000003210 12071065274 017154 0 ustar hardaker hardaker /*
* Copyright 2005-2013 SPARTA, Inc. All rights reserved.
* See the COPYING file distributed with this software for details.
*/
#ifndef RES_MKQUERY_H
#define RES_MKQUERY_H
#ifndef T_OPT
#define T_OPT 41
#endif
#ifndef NS_OPT_DNSSEC_OK
#define NS_OPT_DNSSEC_OK 0x8000U
#endif
int
res_val_nmkquery(struct name_server *pref_ns, int op, /* opcode of query */
const char *dname, /* domain name */
u_int16_t class_h, u_int16_t type_h, /* class and type of query */
const u_char * data, /* resource record data */
size_t datalen, /* length of data */
const u_char * newrr_in, /* new rr for modify or append */
u_char * buf, /* buffer to put query */
size_t buflen,
size_t *query_length); /* size of buffer */
int res_create_query_payload(struct name_server *ns,
const char *name,
const u_int16_t class_h,
const u_int16_t type_h,
u_char **signed_query,
size_t *signed_length);
int
res_val_nopt(struct name_server *pref_ns,
u_char * buf, /* buffer to put query */
size_t buflen, /* size of buffer */
size_t * query_length); /* UDP answer buffer size */
#endif /* RES_MKQUERY_H */
dnsval-2.0/libsres/res_tsig.c 0000664 0002372 0002372 00000003627 11732713653 016440 0 ustar hardaker hardaker /*
* Copyright (c) 1995, 1996, 1997 by Trusted Information Systems, Inc.
*
* Permission to use, copy modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND TRUSTED INFORMATION SYSTEMS
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
* TRUSTED INFORMATION SYSTEMS BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THE SOFTWARE.
*/
#include "validator-internal.h"
#include "res_tsig.h"
#include "res_support.h"
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
int
res_tsig_sign(u_char * query,
size_t query_length,
struct name_server *ns,
u_char ** signed_query,
size_t *signed_length)
{
if (query && query_length) {
if (!(ns->ns_security_options & ZONE_USE_TSIG)) {
*signed_query = (u_char *) MALLOC(query_length * sizeof(u_char));
if (*signed_query == NULL)
return SR_TS_FAIL;
memcpy(*signed_query, query, query_length);
*signed_length = query_length;
return SR_TS_OK;
}
return SR_TS_FAIL;
} else
return SR_TS_CALL_ERROR;
}
int
res_tsig_verifies(struct name_server *respondent,
u_char * answer, size_t answer_length)
{
if (!(respondent->ns_security_options & ZONE_USE_TSIG))
return SR_TS_OK;
else {
res_log(NULL, LOG_ERR, "libsres: ""tsig failure!");
return SR_TS_FAIL;
}
}
dnsval-2.0/libsres/nsap_addr.h 0000664 0002372 0002372 00000002120 10534115617 016537 0 ustar hardaker hardaker #ifndef NSAP_ADDR_H
/*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-1999 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
u_int inet_nsap_addr(const char *ascii, u_char * binary, int maxlen);
char *inet_nsap_ntoa(int binlen, const u_char * binary,
char *ascii);
#endif /*NSAP_ADDR_H */
dnsval-2.0/libsres/res_io_manager.c 0000664 0002372 0002372 00000167531 12107550150 017564 0 ustar hardaker hardaker
/*
* Copyright (c) 1995, 1996, 1997 by Trusted Information Systems, Inc.
*
* Permission to use, copy modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND TRUSTED INFORMATION SYSTEMS
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
* TRUSTED INFORMATION SYSTEMS BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THE SOFTWARE.
*/
#include "validator-internal.h"
#include "res_support.h"
#include "res_mkquery.h"
#include "res_io_manager.h"
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
/*
* Less than or equal comparison for timeval structures
* note: timercmp doesn't handle <= or >=
* For reference:
* # define timercmp(a, b, CMP) \
* (((a)->tv_sec == (b)->tv_sec) ? \
* ((a)->tv_usec CMP (b)->tv_usec) : \
* ((a)->tv_sec CMP (b)->tv_sec))
*/
#define LTEQ(a,b) ( \
((a.tv_sec == b.tv_sec) ? \
((a.tv_usec < b.tv_usec) || (a.tv_usec == b.tv_usec)) : \
(a.tv_sec < b.tv_sec)) )
#define UPDATE(a,b) do { \
if (!timerisset(a) || timercmp(a, &b, > )) \
memcpy (a, &b, sizeof(struct timeval)); \
} while(0)
#define MAX_TRANSACTIONS 128
static struct expected_arrival *transactions[MAX_TRANSACTIONS] = {
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
};
static int next_transaction = 0;
#ifdef VAL_NO_THREADS
#define pthread_mutex_lock(x)
#define pthread_mutex_unlock(x)
#else
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
#endif
/*
* Find a port in the range 1024 - 65535
*/
static int
bind_to_random_source(int af, SOCKET s)
{
struct sockaddr_storage ea_source;
struct sockaddr_in *sa4 = (struct sockaddr_in *) &ea_source;
#ifdef VAL_IPV6
struct sockaddr_in6 *sa6 = (struct sockaddr_in6 *) &ea_source;
#endif
struct sockaddr *sa;
size_t sock_size;
u_int16_t next_port, start_port;
memset(&ea_source, 0, sizeof(struct sockaddr_storage));
if (af == AF_INET) {
sa4->sin_family = AF_INET;
sa4->sin_addr.s_addr = htonl(INADDR_ANY);
#ifdef VAL_IPV6
} else if (af == AF_INET6) {
sa6->sin6_family = AF_INET6;
/*struct in6_addr anyaddr = IN6ADDR_ANY_INIT*/
/*sa6->sin6_addr = IN6ADDR_ANY_INIT*/
sa6->sin6_addr = in6addr_any;
#endif
} else {
res_log(NULL,LOG_ERR,"libsres: could not bind to random port for unsupported address family %d", af);
return 1; /* failure */
}
start_port = (libsres_random() % 64512) + 1024;
next_port = start_port;
do {
memset(&ea_source, 0, sizeof(ea_source));
if (af == AF_INET) {
sa4->sin_port = htons(next_port);
sa = (struct sockaddr *) sa4;
sock_size = sizeof(struct sockaddr_in);
#ifdef VAL_IPV6
} else { /* AF_INET6 */
sa6->sin6_port = htons(next_port);
sa = (struct sockaddr *) sa6;
sock_size = sizeof(struct sockaddr_in6);
#endif
}
if (0 == bind(s, (const struct sockaddr *)sa, sock_size)) {
//res_log(NULL,LOG_ERR,"libsres: bound to random port %d", next_port);
return 0; /* success */
} else {
/* error */
if (next_port == 65535)
next_port = 1024;
else
next_port++;
}
} while (next_port != start_port);
/* wrapped around and still no ports found */
res_log(NULL,LOG_ERR,"libsres: could not bind to random port above %d", start_port);
return 1; /* failure */
}
long
res_get_timeout(struct name_server *ns)
{
int i;
long cancel_delay = 0;
for (i = 0; i <= ns->ns_retry; i++)
cancel_delay += ns->ns_retrans << i;
return cancel_delay;
}
void res_print_ea(struct expected_arrival *ea);
int res_quecmp(u_char * query, u_char * response);
void
res_sq_free_expected_arrival(struct expected_arrival **ea)
{
if ((ea == NULL) || (*ea == NULL))
return;
if ((*ea)->ea_socket != INVALID_SOCKET)
res_log(NULL, LOG_DEBUG, "libsres: ""ea %p, fd %d free",
*ea, (*ea)->ea_socket);
else
res_log(NULL, LOG_DEBUG+1, "libsres: ""ea %p, fd %d free",
*ea, (*ea)->ea_socket);
if ((*ea)->ea_ns != NULL)
free_name_server(&((*ea)->ea_ns));
#ifdef EA_EXTRA_DEBUG
if ((*ea)->name != NULL)
free((*ea)->name);
#endif
if ((*ea)->ea_socket != INVALID_SOCKET)
CLOSESOCK((*ea)->ea_socket);
if ((*ea)->ea_signed)
FREE((*ea)->ea_signed);
if ((*ea)->ea_response)
FREE((*ea)->ea_response);
#ifdef DEBUG_DONT_RELEASE_ANYTHING
{
static struct expected_arrival *holding = NULL;
(*ea)->ea_next = holding;
holding = *ea;
}
#else
FREE(*ea);
#endif
*ea = NULL;
}
void
res_free_ea_list(struct expected_arrival *head)
{
struct expected_arrival *ea;
res_log(NULL, LOG_DEBUG, "libsres: ""ea %p free list", head);
while (head) {
ea = head;
head = head->ea_next;
res_sq_free_expected_arrival(&ea);
}
}
void
set_alarm(struct timeval *tv, long delay)
{
gettimeofday(tv, NULL);
tv->tv_sec += delay;
}
void
set_alarms(struct expected_arrival *ea, long next, long cancel)
{
gettimeofday(&ea->ea_next_try, NULL);
ea->ea_next_try.tv_sec += next;
ea->ea_cancel_time.tv_sec = ea->ea_next_try.tv_sec + cancel;
ea->ea_cancel_time.tv_usec = ea->ea_next_try.tv_usec;
}
struct expected_arrival *
res_ea_init(u_char * signed_query, size_t signed_length,
struct name_server *ns, long delay)
{
struct expected_arrival *temp;
temp = (struct expected_arrival *)
MALLOC(sizeof(struct expected_arrival));
if (temp == NULL)
/** We're out of memory */
return NULL;
memset(temp, 0x0, sizeof(struct expected_arrival));
temp->ea_socket = INVALID_SOCKET;
temp->ea_ns = ns;
temp->ea_which_address = 0;
temp->ea_using_stream = FALSE;
temp->ea_signed = signed_query;
temp->ea_signed_length = signed_length;
temp->ea_response = NULL;
temp->ea_response_length = 0;
temp->ea_remaining_attempts = ns->ns_retry+1;
set_alarms(temp, delay, res_get_timeout(ns));
temp->ea_next = NULL;
return temp;
}
/*
* give up on current response for this address.
* set up next try to try address again.
*/
void
res_io_retry_source(struct expected_arrival *ea)
{
res_log(NULL, LOG_DEBUG, "libsres: ""retry source ea %p", ea);
res_print_ea(ea);
/* close socket */
if (ea->ea_socket != INVALID_SOCKET) {
CLOSESOCK(ea->ea_socket);
ea->ea_socket = INVALID_SOCKET;
}
/* bump retry time to current time */
gettimeofday(&ea->ea_next_try, NULL);
}
/*
* give up on current address for this nameserver.
* set cancel time, which will trigger move to next address.
*/
void
res_io_reset_source(struct expected_arrival *ea)
{
res_log(NULL, LOG_DEBUG, "libsres: ""reset source ea %p", ea);
res_print_ea(ea);
/* close socket */
if (ea->ea_socket != INVALID_SOCKET) {
CLOSESOCK(ea->ea_socket);
ea->ea_socket = INVALID_SOCKET;
}
/* bump cancel time to current time */
gettimeofday(&ea->ea_cancel_time, NULL);
}
/*
* give up on all addresses for this nameserver
* set remaining retries to -1; no more addresses will be tried
*/
void
res_io_cancel_source(struct expected_arrival *ea)
{
res_log(NULL, LOG_DEBUG, "libsres: ""canceling source ea %p", ea);
res_print_ea(ea);
/* close socket */
if (ea->ea_socket != INVALID_SOCKET) {
CLOSESOCK(ea->ea_socket);
ea->ea_socket = INVALID_SOCKET;
}
/* bump cancel time to current time */
gettimeofday(&ea->ea_cancel_time, NULL);
/* no more retries */
ea->ea_remaining_attempts = -1;
}
void
res_io_cancel_all_remaining_attempts(struct expected_arrival *ea)
{
for ( ; ea; ea = ea->ea_next)
res_io_cancel_source(ea);
}
int
res_io_is_finished(struct expected_arrival *ea)
{
return ea->ea_remaining_attempts == -1;
}
int
res_io_are_all_finished(struct expected_arrival *ea)
{
for ( ; ea; ea = ea->ea_next)
if (ea->ea_remaining_attempts != -1)
return FALSE;
return TRUE;
}
int
res_io_send(struct expected_arrival *shipit)
{
/*
* Choose between TCP and UDP, only differences are the type of
* socket and whether or not the length of the query is sent first.
*/
int socket_type;
int socket_proto;
size_t socket_size;
size_t bytes_sent;
long delay;
if (shipit == NULL)
return SR_IO_INTERNAL_ERROR;
socket_type = (shipit->ea_using_stream == 1) ? SOCK_STREAM : SOCK_DGRAM;
socket_proto = (socket_type == SOCK_STREAM) ? IPPROTO_TCP : IPPROTO_UDP;
res_log(NULL, LOG_DEBUG, "libsres: ""ea %p SENDING type %d %s", shipit,
shipit->ea_ns->ns_address[shipit->ea_which_address]->ss_family,
shipit->ea_using_stream ? "stream" : "dgram");
/*
* If no socket exists for the transfer, create and connect it (TCP
* or UDP). If for some reason this fails, return a INVALID_SOCKET
* which causes the source to be cancelled next go-round.
*/
if (shipit->ea_socket == INVALID_SOCKET) {
int i = shipit->ea_which_address;
int af = shipit->ea_ns->ns_address[i]->ss_family;
shipit->ea_socket = socket(af, socket_type, 0);
if (shipit->ea_socket == INVALID_SOCKET) {
res_log(NULL,LOG_ERR,"libsres: ""socket() failed, errno = %d %s",
errno, strerror(errno));
return SR_IO_SOCKET_ERROR;
}
/* Set the source port */
if (0 != bind_to_random_source(af, shipit->ea_socket)) {
/* error */
res_io_retry_source(shipit);
return SR_IO_SOCKET_ERROR;
}
/*
* OS X wants the socket size to be sockaddr_in for INET,
* while Linux is happy with sockaddr_storage.
*/
if (af == AF_INET) {
socket_size = sizeof(struct sockaddr_in);
#ifdef VAL_IPV6
} else if (af == AF_INET6) {
socket_size = sizeof(struct sockaddr_in6);
#endif
} else {
socket_size = sizeof(struct sockaddr_storage);
}
if (connect
(shipit->ea_socket,
(struct sockaddr *) shipit->ea_ns->ns_address[i],
socket_size) == SOCKET_ERROR) {
res_log(NULL, LOG_ERR,
"libsres: ""Closing socket %d, connect errno = %d",
shipit->ea_socket, errno);
res_io_reset_source(shipit);
return SR_IO_SOCKET_ERROR;
}
}
/*
* We must have a valid socket to use now, so we just need to send the
* query (but first the length if via TCP). Again, errors return -1,
* cause the source to be cancelled.
*/
if (shipit->ea_using_stream) {
u_int16_t length_n;
length_n = htons(shipit->ea_signed_length);
if ((bytes_sent =
send(shipit->ea_socket, (const char *)&length_n, sizeof(length_n), 0))
== SOCKET_ERROR) {
res_io_reset_source(shipit);
return SR_IO_SOCKET_ERROR;
}
if (bytes_sent != sizeof(length_n)) {
res_io_reset_source(shipit);
return SR_IO_SOCKET_ERROR;
}
}
bytes_sent = send(shipit->ea_socket, (const char*)shipit->ea_signed,
shipit->ea_signed_length, 0);
if (bytes_sent != shipit->ea_signed_length) {
res_log(NULL, LOG_ERR, "libsres: "
"Closing socket %d, sending %d bytes failed (rc %d)",
shipit->ea_socket, shipit->ea_signed_length, bytes_sent);
res_io_reset_source(shipit);
return SR_IO_SOCKET_ERROR;
}
delay = shipit->ea_ns->ns_retrans
<< (shipit->ea_ns->ns_retry + 1 - shipit->ea_remaining_attempts--);
res_log(NULL, LOG_DEBUG, "libsres: ""next try delay %d", delay);
set_alarms(shipit, delay, res_get_timeout(shipit->ea_ns));
res_print_ea(shipit);
return SR_IO_UNSET;
}
/*
* 1 : edns0 fallback succeeded, ready for retry.
* 0 : edns0 fallback failed, no more retries for server
* -1: unknown error
* NOTE: val_res_nsfallback will cancel an entire request if -1 returned
*/
int
res_nsfallback(int transaction_id, struct timeval *closest_event,
struct name_server *server, const char *name,
const u_int16_t class_h, const u_int16_t type_h)
{
struct expected_arrival *temp;
int ret_val = -1;
if (transaction_id < 0)
return -1;
pthread_mutex_lock(&mutex);
temp = transactions[transaction_id];
if (temp != NULL)
ret_val = res_nsfallback_ea(temp, closest_event, server, name, class_h,
type_h);
pthread_mutex_unlock(&mutex);
return ret_val;
}
static void
_reset_timeouts(struct expected_arrival *temp)
{
res_log(NULL, LOG_INFO, "libsres: ""reset timeout for %p", temp);
set_alarms(temp, 0, res_get_timeout(temp->ea_ns));
/*
* if next event is in the future, make sure we
* offset it to the current time IF it's not already active.
*/
if (temp->ea_next) {
struct expected_arrival *t;
long offset = temp->ea_next->ea_next_try.tv_sec -
temp->ea_next_try.tv_sec;
if (offset > 0) {
for (t=temp->ea_next; t; t=t->ea_next) {
if (INVALID_SOCKET != t->ea_socket)
continue;
res_log(NULL, LOG_INFO, "libsres: ""timeout offset %ld for %p",
offset, t);
t->ea_next_try.tv_sec -= offset;
t->ea_cancel_time.tv_sec -= offset;
}
}
}
}
/*
* 1 : edns0 fallback succeeded, ready for retry.
* 0 : edns0 fallback failed, no more retries for server
* -1: unknown error
* NOTE: val_res_nsfallback will cancel an entire request if -1 returned
*/
int
res_nsfallback_ea(struct expected_arrival *ea, struct timeval *closest_event,
struct name_server *server, const char *name,
const u_int16_t class_h, const u_int16_t type_h)
{
const static int edns0_fallback[] = { 4096, 1492, 512, 0 };
long i, old_size;
struct expected_arrival *temp = ea;
if (!temp || !name)
return -1;
if (!server && ea->ea_next) {
res_log(NULL, LOG_DEBUG,
"libsres: ""no server specified and more than one ea");
return -1;
}
if (server) {
for(;temp && temp->ea_ns;temp=temp->ea_next) {
//res_print_ea(temp);
/** match name, then look for address */
if (namecmp(server->ns_name_n, temp->ea_ns->ns_name_n) != 0)
continue;
if (memcmp(server->ns_address[0],
temp->ea_ns->ns_address[temp->ea_which_address],
sizeof(*server->ns_address[0])) == 0)
break;
}
if (!temp) {
res_log(NULL, LOG_DEBUG, "libsres: "
"no matching server found for fallback");
return -1;
}
}
/** even if there is a smaller size to fall back to, no attempts left */
if (temp->ea_remaining_attempts < 0) {
res_log(NULL, LOG_DEBUG, "libsres: "
"ea %p no remaining attempts for fallback", temp);
if (res_io_are_all_finished(ea))
return -1;
return 0;
}
res_log(NULL, LOG_DEBUG, "libsres: ""ea %p attempting ns fallback", temp);
old_size = temp->ea_ns->ns_edns0_size;
if ((temp->ea_ns->ns_options & SR_QUERY_VALIDATING_STUB_FLAGS) &&
(temp->ea_ns->ns_edns0_size > 0)) {
for (i = 0; i < sizeof(edns0_fallback); i++) {
if (temp->ea_ns->ns_edns0_size > edns0_fallback[i]) {
/* try using a lower edns0 value */
temp->ea_ns->ns_edns0_size = edns0_fallback[i];
if (edns0_fallback[i] == 0) {
/* try without EDNS0 */
res_log(NULL, LOG_DEBUG, "libsres: "
"fallback disabling edns0");
temp->ea_ns->ns_options ^= SR_QUERY_VALIDATING_STUB_FLAGS;
}
temp->ea_remaining_attempts++;
break;
}
}
}
/** didn't find a smaller size to try and were already on last attempt */
if (temp->ea_remaining_attempts == 0) {
res_log(NULL, LOG_DEBUG, "libsres: "
"fallback already exhausted edns retries");
res_io_reset_source(temp);
if (res_io_are_all_finished(ea))
return -1;
return 0;
}
/** reset timeouts for immediate retries */
_reset_timeouts(temp);
UPDATE(closest_event, temp->ea_next_try);
if (0 == old_size) {
res_log(NULL, LOG_DEBUG, "libsres: ""fallback already disabled edns");
return 0;
}
if (temp->ea_signed)
FREE(temp->ea_signed);
temp->ea_signed = NULL;
temp->ea_signed_length = 0;
if (res_create_query_payload(temp->ea_ns,
name, class_h, type_h,
&temp->ea_signed,
&temp->ea_signed_length) < 0) {
res_log(NULL, LOG_DEBUG, "libsres: ""could not create query payload");
return -1;
}
/** close socket so retry uses different port */
if (temp->ea_socket != INVALID_SOCKET)
CLOSESOCK(temp->ea_socket);
temp->ea_socket = INVALID_SOCKET;
res_log(NULL, LOG_INFO, "libsres: "
"ns fallback for {%s %s(%d) %s(%d)}, edns0 size %d > %d",
name, p_class(class_h), class_h, p_type(type_h), type_h,
old_size, temp->ea_ns->ns_edns0_size);
return 1;
}
static void
res_io_next_address(struct expected_arrival *ea,
const char *more_prefix, const char *no_more_str)
{
/*
* If there is another address, move to it else cancel it
*/
if (ea->ea_which_address < (ea->ea_ns->ns_number_of_addresses-1)) {
/*
* Start over with new address
*/
if (ea->ea_socket != INVALID_SOCKET) {
CLOSESOCK (ea->ea_socket);
ea->ea_socket = INVALID_SOCKET;
}
ea->ea_which_address++;
ea->ea_remaining_attempts = ea->ea_ns->ns_retry+1;
set_alarms(ea, 0, res_get_timeout(ea->ea_ns));
res_log(NULL, LOG_INFO,
"libsres: ""%s - SWITCHING TO NEW ADDRESS", more_prefix);
} else {
struct expected_arrival *next_server = ea->ea_next;
/*
* tried all addresses, cancel this source
*/
res_io_cancel_source(ea);
res_log(NULL, LOG_INFO, "libsres: ""%s", no_more_str);
if (next_server && next_server->ea_remaining_attempts &&
INVALID_SOCKET == next_server->ea_socket) {
res_log(NULL, LOG_INFO, "libsres: ""jump-starting next server %p",
next_server);
_reset_timeouts(next_server);
}
}
res_print_ea(ea);
}
/*
* net_change : optional pointer for returning the next change in the
* number of open/active sockets.
*
* active : optional pointer for returning number of active queries.
* this includes any query with remaining retries, regardless
* of whether or not it has a current open/active socket.
*/
int
res_io_check_ea_list(struct expected_arrival *ea, struct timeval *next_evt,
struct timeval *now, int *net_change, int *active)
{
struct timeval local_now;
int remaining = 0, no_sock = 0, no_att = 0, open = 0;
/*
* if caller didn't pass us current time, get it
*/
if (NULL == now) {
now = &local_now;
gettimeofday(&local_now, NULL);
}
if (net_change)
*net_change = 0;
if (active)
*active = 0;
res_log(NULL, LOG_DEBUG, __FUNCTION__);
if (next_evt)
res_log(NULL, LOG_DEBUG, "libsres: "" Initial next event %ld.%ld",
next_evt->tv_sec, next_evt->tv_usec);
for ( ; ea; ea = ea->ea_next ) {
if (ea->ea_remaining_attempts == -1) {
res_log(NULL, LOG_DEBUG, "libsres: "
" skipping %p (sock %d, rem %d)",
ea, ea->ea_socket, ea->ea_remaining_attempts);
++no_att;
continue;
}
if (ea->ea_socket != INVALID_SOCKET )
res_print_ea(ea);
else
++no_sock;
/*
* check for timeouts. If there is another address, move to it
*/
if ( LTEQ(ea->ea_cancel_time, (*now)) ||
((0 == ea->ea_remaining_attempts) && LTEQ(ea->ea_next_try, (*now)))) {
if (net_change && ea->ea_socket != INVALID_SOCKET)
--(*net_change);
res_io_next_address(ea, "TIMEOUTS", "TIMEOUT - CANCELING");
}
/*
* send next try. on error, if there is another address, move to it
*/
else if (LTEQ(ea->ea_next_try, (*now))) {
int needed_new_socket = (ea->ea_socket == INVALID_SOCKET);
res_log(NULL, LOG_DEBUG, "libsres: "" retry");
while (ea->ea_remaining_attempts != -1) {
if (res_io_send(ea) == SR_IO_SOCKET_ERROR) {
res_io_next_address(ea, "ERROR",
"CANCELING DUE TO SENDING ERROR");
}
else {
if (needed_new_socket) {
if (net_change)
++(*net_change);
}
break; /* from while remaining attempts */
}
} /* while */
}
/*
* update next event
*/
if (ea->ea_remaining_attempts != -1) {
++remaining;
if (next_evt) {
UPDATE(next_evt, ea->ea_cancel_time);
UPDATE(next_evt, ea->ea_next_try);
}
if (ea->ea_socket != INVALID_SOCKET)
++open;
}
}
if (next_evt) {
struct timeval now,when;
gettimeofday(&now, NULL);
timersub(next_evt, &now, &when);
if (when.tv_sec < 0) {
when.tv_sec = when.tv_usec = 0;
}
res_log(NULL, LOG_DEBUG, "libsres: "
" Next event %ld.%ld (%ld.%ld) remaining %d (%d active)",
next_evt->tv_sec, next_evt->tv_usec, when.tv_sec, when.tv_usec,
remaining, open);
} else
res_log(NULL, LOG_DEBUG, "libsres: "" remaining %d (%d active)",
remaining, open);
if (no_sock || no_att)
res_log(NULL, LOG_DEBUG, "libsres: "
" skipped %d closed sockets, %d no attempts", no_sock, no_att);
if (active)
*active = remaining;
if (remaining)
return SR_IO_UNSET;
else
return SR_IO_NO_ANSWER;
}
int
res_io_check_one(struct expected_arrival *ea, struct timeval *next_evt,
struct timeval *now)
{
res_log(NULL, LOG_INFO,
"res_io_check_one deprecated, use res_io_check_ea_list instead");
return res_io_check_ea_list(ea, next_evt, now, NULL, NULL);
}
/** static version that assume caller has mutex lock... */
static int
_check_one_tid(int tid, struct timeval *next_evt, struct timeval *now)
{
int active = 0;
struct expected_arrival *ea;
/** assume caller has mutex lock */
ea = transactions[tid];
if (ea)
res_io_check_ea_list(ea, next_evt, now, NULL, &active);
return (active > 0); /* have active queries */
}
/*
* this version does not clear next_evt. now parameter is optional but
* suggested if calling this function in a loop.
*/
int
res_io_check_one_tid(int tid, struct timeval *next_evt, struct timeval *now)
{
int ret_val;
if ((NULL == next_evt) || (tid < 0) || (tid >= MAX_TRANSACTIONS))
return 0; /* i.e. no transactions for this tid */
pthread_mutex_lock(&mutex);
ret_val = _check_one_tid(tid, next_evt, now);
pthread_mutex_unlock(&mutex);
res_log(NULL, LOG_DEBUG, "libsres: "" tid %d next event is at %ld.%ld",
tid, next_evt->tv_sec, next_evt->tv_usec);
return ret_val;
}
/*
* for backwards compatability, this checks all transactions.
* I'd like to have it call res_io_check_one_tid, but that'd
* involve a mutex lock/unlock for each active transaction, which
* seems wasteful...
*/
int
res_io_check(int transaction_id, struct timeval *next_evt)
{
int i, ret_val;
struct timeval tv;
if ((NULL == next_evt) || (transaction_id < 0) ||
(transaction_id >= MAX_TRANSACTIONS))
return 0;
gettimeofday(&tv, NULL);
res_log(NULL, LOG_DEBUG, "libsres: ""Checking tids at %ld.%ld", tv.tv_sec,
tv.tv_usec);
/*
* Start "next event" at 0.0 seconds
*/
memset(next_evt, 0, sizeof(struct timeval));
ret_val = 0; /* no active queries */
pthread_mutex_lock(&mutex);
/** check all except specified transaction_id, ignore return */
for (i = 0; i < MAX_TRANSACTIONS; i++)
if ((i != transaction_id) && transactions[i])
_check_one_tid(i, next_evt, &tv);
/** check for remaining attempts for specified transaction */
ret_val = _check_one_tid(transaction_id, next_evt, &tv);
pthread_mutex_unlock(&mutex);
res_log(NULL, LOG_DEBUG, "libsres: "" next global event is at %ld.%ld",
next_evt->tv_sec, next_evt->tv_usec);
return ret_val;
}
int
res_io_deliver(int *transaction_id, u_char * signed_query,
size_t signed_length, struct name_server *ns, long delay)
{
struct timeval next_event;
int rc;
rc = res_io_queue(transaction_id, signed_query, signed_length, ns, delay);
/*
* Call the res_io_check routine
*/
return res_io_check(*transaction_id, &next_event);
}
int
res_io_queue_ea(int *transaction_id, struct expected_arrival *new_ea)
{
int try_index;
struct expected_arrival *temp;
/*
* Determine (new) transaction location
*/
pthread_mutex_lock(&mutex);
if (*transaction_id == -1) {
/*
* Find a place to hold this transaction
*/
try_index = next_transaction;
do {
if (transactions[try_index] == NULL)
break;
try_index = (try_index + 1) % MAX_TRANSACTIONS;
} while (try_index != next_transaction);
if (try_index == next_transaction
&& transactions[try_index] != NULL) {
/*
* We've run out of places to hold transactions
*/
pthread_mutex_unlock(&mutex);
return SR_IO_TOO_MANY_TRANS;
}
*transaction_id = try_index;
next_transaction = (try_index + 1) % MAX_TRANSACTIONS;
}
/*
* Register this request
*/
if (transactions[*transaction_id] == NULL) {
/*
* Add this as the first request
*/
transactions[*transaction_id] = new_ea;
} else {
/*
* Retaining order is important
*/
temp = transactions[*transaction_id];
while (temp->ea_next)
temp = temp->ea_next;
temp->ea_next = new_ea;
}
pthread_mutex_unlock(&mutex);
return SR_IO_UNSET;
}
int
res_io_queue(int *transaction_id, u_char * signed_query,
size_t signed_length, struct name_server *ns, long delay)
{
struct expected_arrival *new_ea;
int ret_val;
new_ea = res_ea_init(signed_query, signed_length, ns, delay);
if (new_ea == NULL)
return SR_IO_MEMORY_ERROR;
ret_val = res_io_queue_ea(transaction_id, new_ea);
if (ret_val != SR_IO_UNSET) {
res_free_ea_list(new_ea);
return ret_val;
}
return SR_IO_UNSET;
}
void
res_io_set_timeout(struct timeval *timeout, struct timeval *next_event)
{
gettimeofday(timeout, NULL);
if (LTEQ((*timeout), (*next_event)))
timersub(next_event, timeout, timeout);
else
memset(timeout, 0, sizeof(struct timeval));
}
void
res_io_select_info_tid(int tid, int *nfds,
fd_set * read_descriptors,struct timeval *next_evt)
{
struct expected_arrival *ea;
if ((tid < 0) || (tid >= MAX_TRANSACTIONS))
return;
pthread_mutex_lock(&mutex);
ea = transactions[tid];
if (ea)
res_io_select_info(ea, nfds, read_descriptors, next_evt);
pthread_mutex_unlock(&mutex);
}
void
res_io_collect_sockets(fd_set * read_descriptors,
struct expected_arrival *ea_list)
{
res_io_select_info(ea_list, NULL, read_descriptors, NULL);
}
void
res_io_select_info(struct expected_arrival *ea_list, int *nfds,
fd_set * read_descriptors, struct timeval *timeout)
{
struct timeval now, orig;
int count = 0, skipped = 0;
if (timeout) {
res_log(NULL, LOG_DEBUG,
"libsres: "" ea %p select/timeout info", ea_list);
res_log(NULL, LOG_DEBUG+1, "libsres: "" orig timeout %ld,%ld",
timeout->tv_sec, timeout->tv_usec);
memcpy(&orig, timeout, sizeof(orig));
gettimeofday(&now, NULL);
}
else
res_log(NULL, LOG_DEBUG, "libsres: "" ea %p select info",
ea_list);
/*
* Find all sockets in use for a particular transaction chain of
* expected arrivals
*/
for ( ; ea_list; ea_list = ea_list->ea_next) {
if ((ea_list->ea_remaining_attempts == -1) ||
(ea_list->ea_socket == INVALID_SOCKET)) {
if (ea_list->ea_remaining_attempts > 0) {
if (timeout) {
UPDATE(timeout, ea_list->ea_cancel_time);
UPDATE(timeout, ea_list->ea_next_try);
}
++skipped;
}
res_log(NULL,LOG_DEBUG+1, "libsres:"" fd %d, rem %d",
ea_list->ea_socket, ea_list->ea_remaining_attempts);
continue;
}
if (read_descriptors &&
FD_ISSET(ea_list->ea_socket, read_descriptors)) {
++skipped;
res_log(NULL,LOG_DEBUG+1, "libsres:"" fd %d already set",
ea_list->ea_socket);
continue;
}
++count;
res_log(NULL,LOG_DEBUG, "libsres:"" fd %d added, rem %d",
ea_list->ea_socket, ea_list->ea_remaining_attempts);
if (read_descriptors)
FD_SET(ea_list->ea_socket, read_descriptors);
if (nfds && (ea_list->ea_socket >= *nfds))
*nfds = ea_list->ea_socket + 1;
if (timeout) {
UPDATE(timeout, ea_list->ea_cancel_time);
UPDATE(timeout, ea_list->ea_next_try);
}
}
if (timeout && (orig.tv_sec != timeout->tv_sec ||
orig.tv_usec != timeout->tv_usec)) {
res_log(NULL, LOG_DEBUG,
"libsres: "" new timeout %ld.%ld, %d fds added, %d inactive",
timeout->tv_sec, timeout->tv_usec, count, skipped);
}
else
res_log(NULL, LOG_DEBUG,
"libsres: "" %d fds added, %d inactive", count, skipped);
}
static int
res_io_select_sockets(fd_set * read_descriptors, struct timeval *timeout)
{
/*
* Perform the select call
*/
int i, max_sock, count, ready;
struct timeval in,out;
res_log(NULL,LOG_DEBUG,"libsres: "" res_io_select_sockets");
max_sock = -1;
#ifndef WIN32
i = getdtablesize();
if (i > FD_SETSIZE)
i = FD_SETSIZE;
for (--i; i >= 0; --i)
if (FD_ISSET(i, read_descriptors)) {
max_sock = i;
break;
}
if (max_sock < 0) {
res_log(NULL,LOG_DEBUG,"libsres: "" no fds set");
return 0; /* nothing to read */
}
if (max_sock > FD_SETSIZE)
max_sock = FD_SETSIZE;
#endif
count = res_io_count_ready(read_descriptors, max_sock + 1);
gettimeofday(&in, NULL);
res_log(NULL, LOG_DEBUG,
"libsres: ""SELECT on %d fds, max %d, timeout %ld.%ld @ %ld.%ld",
count, max_sock+1,timeout->tv_sec,timeout->tv_usec,
in.tv_sec,in.tv_usec);
#ifdef HAVE_PSELECT
struct timespec timeout_ts;
timeout_ts.tv_sec = timeout->tv_sec;
timeout_ts.tv_nsec = timeout->tv_usec * 1000;
ready = pselect(max_sock + 1, read_descriptors, NULL, NULL, &timeout_ts, NULL);
#else
ready = select(max_sock + 1, read_descriptors, NULL, NULL, timeout);
#endif
gettimeofday(&out, NULL);
res_log(NULL, LOG_DEBUG, "libsres: "" %d ready fds @ %ld.%ld",
ready,out.tv_sec,out.tv_usec);
if (ready > 0)
res_io_count_ready(read_descriptors, max_sock + 1);
return ready;
}
void
wait_for_res_data(fd_set * pending_desc, struct timeval *closest_event)
{
struct timeval timeout;
int ready;
res_log(NULL,LOG_DEBUG,"libsres: ""wait_for_res_data");
/*
* Set the timeout in case nothing arrives. The timeout will expire
* prior to the next event that res_io_check needs to initiate. If
* something arrives before that time, fine, we handle it. Otherwise,
* return and the check routine will be called again when the next
* level up decides it is time.
*
* next_event.tv_sec is always set to something (ie, not left at the
* default) if res_io_check returns a non-0 number.
*/
res_log(NULL, LOG_DEBUG, "libsres: "" wait for closest event %ld,%ld",
closest_event->tv_sec, closest_event->tv_usec);
res_io_set_timeout(&timeout, closest_event);
ready = res_io_select_sockets(pending_desc, &timeout);
// ignore return value from previous function,
// will catch this condition when we actually read data
}
static int
_clone_respondent(struct expected_arrival *ea,
struct name_server **respondent)
{
int save_count = -1, retval;
/*
* don't clone all when we just need one. temporarily set
* number of nameservers to 1 before cloning.
*/
if (ea->ea_ns->ns_number_of_addresses > 1) {
save_count = ea->ea_ns->ns_number_of_addresses;
ea->ea_ns->ns_number_of_addresses = 1;
}
if (SR_UNSET != (retval = clone_ns(respondent, ea->ea_ns)))
return retval;
if (save_count > 0) /* restore original count */
ea->ea_ns->ns_number_of_addresses = save_count;
/** if response wasn't from first address, fixup respondent */
if (ea->ea_which_address != 0) {
memcpy(((*respondent)->ns_address[0]),
ea->ea_ns->ns_address[ea->ea_which_address],
sizeof(struct sockaddr_storage));
}
return SR_UNSET;
}
int
res_io_get_a_response(struct expected_arrival *ea_list, u_char ** answer,
size_t * answer_length,
struct name_server **respondent)
{
int retval = SR_IO_UNSET, retries = 0;
struct expected_arrival *orig = ea_list;
res_log(NULL,LOG_DEBUG,"libsres: "" checking for response for ea %p list",
ea_list);
for( ; ea_list; ea_list = ea_list->ea_next) {
if (ea_list->ea_remaining_attempts != -1)
++retries;
if (!ea_list->ea_response)
continue;
if (ea_list->ea_remaining_attempts == -1) {
res_log(NULL, LOG_DEBUG, "libsres: "
" *** ANSWER with no remaining attempts");
//continue;
}
/** basic format checks; NOTE: returns SR_*, *NOT* SR_IO_* */
retval = res_response_checks(&ea_list->ea_response,
&ea_list->ea_response_length, respondent);
if (SR_UNSET != retval) { /* cleared response */
res_log(NULL, LOG_DEBUG, "libsres: "
"*** dropped response for ea %p rc %d", ea_list, retval);
/** close socket so retry uses different port */
if (ea_list->ea_socket != INVALID_SOCKET) {
CLOSESOCK (ea_list->ea_socket);
ea_list->ea_socket = INVALID_SOCKET;
}
res_print_ea(ea_list);
_clone_respondent(ea_list, respondent);
set_alarms(ea_list, 0, res_get_timeout(ea_list->ea_ns));
retval = SR_IO_NO_ANSWER;
continue; /* in case another ea has a response */
}
{ /** dummy block to preserve indentation; reformat later */
if (ea_list != orig)
res_log(NULL,LOG_DEBUG,"libsres: "" found response in ea %p",
ea_list);
*answer = ea_list->ea_response;
*answer_length = ea_list->ea_response_length;
res_log(NULL, LOG_DEBUG,
"libsres: ""get_response got %zd bytes on socket %d",
*answer_length, ea_list->ea_socket);
retval = _clone_respondent(ea_list, respondent);
if (SR_UNSET != retval)
return retval;
ea_list->ea_response = NULL;
ea_list->ea_response_length = 0;
return SR_IO_GOT_ANSWER;
}
}
if (0 == retries) {
res_log(NULL, LOG_DEBUG, "libsres: ""*** no answer and no retries!");
retval = SR_IO_NO_ANSWER;
}
return retval;
}
size_t
complete_read(SOCKET sock, u_char *field, size_t length)
{
ssize_t bytes;
size_t bytes_read = 0;
#if 0
#ifdef MSG_DONTWAIT
int flags = MSG_DONTWAIT;
#else
int flags =0;
#endif
#endif
int flags =0;/* XXX For now don't enable MSG_DONTWAIT */
memset(field, '\0', length);
do {
bytes = recv(sock, field + bytes_read, length - bytes_read, flags);
if (bytes < 0) {
break;
}
bytes_read += bytes;
} while (bytes_read < length && bytes > 0);
if (0 == bytes)
res_log(NULL, LOG_INFO, "libsres: ""socket shutdown.", socket);
if (bytes_read != length) {
res_log(NULL, LOG_INFO,
"libsres: ""incomplete read on socket %d; read %d of %d\n",
sock, bytes_read, length);
if (bytes == SOCKET_ERROR) {
res_log(NULL, LOG_INFO, "libsres: "" errno %d %s.", errno,
strerror(errno));
return -1;
}
}
return bytes_read;
}
static int
res_io_read_tcp(struct expected_arrival *arrival)
{
u_int16_t len_n;
size_t len_h;
/*
* Read length
*/
if (complete_read(arrival->ea_socket, (u_char *)&len_n, sizeof(len_n))
!= sizeof(len_n)) {
/*
* reset this source
*/
res_io_reset_source(arrival);
return SR_IO_SOCKET_ERROR;
}
len_h = ntohs(len_n);
/*
* read() message
*/
arrival->ea_response = (u_char *) MALLOC(len_h * sizeof(u_char));
if (arrival->ea_response == NULL) {
/*
* retry this source
*/
res_io_retry_source(arrival);
return SR_IO_MEMORY_ERROR;
}
arrival->ea_response_length = len_h;
if (complete_read(arrival->ea_socket, (u_char *)arrival->ea_response, len_h) !=
len_h) {
FREE(arrival->ea_response);
arrival->ea_response = NULL;
arrival->ea_response_length = 0;
/*
* reset this source
*/
res_io_reset_source(arrival);
return SR_IO_SOCKET_ERROR;
}
return SR_IO_UNSET;
}
static int
res_io_read_udp(struct expected_arrival *arrival)
{
size_t bytes_waiting = 8192;
struct sockaddr_storage from;
socklen_t from_length = sizeof(from);
int ret_val, arr_family;
int flags = 0;
if (NULL == arrival)
return SR_IO_INTERNAL_ERROR;
if (NULL != arrival->ea_response) {
res_log(NULL, LOG_INFO,
"libsres: ""**** already have response for ea 0x%x socket %d.",
arrival, arrival->ea_socket);
return SR_IO_UNSET;
}
arrival->ea_response = (u_char *) MALLOC(bytes_waiting * sizeof(u_char));
if (NULL == arrival->ea_response)
return SR_IO_MEMORY_ERROR;
memset(arrival->ea_response, 0, bytes_waiting * sizeof(u_char));
memset(&from, 0, sizeof(from));
#ifdef MSG_DONTWAIT
flags = MSG_DONTWAIT;
#endif
ret_val =
recvfrom(arrival->ea_socket, (char *)arrival->ea_response, bytes_waiting,
flags, (struct sockaddr*)&from, &from_length);
if (0 == ret_val) {
res_log(NULL, LOG_INFO,
"libsres: ""0 bytes on socket %d, socket shutdown.",
arrival->ea_socket);
goto error;
}
else if (-1 == ret_val && (EAGAIN == errno || EWOULDBLOCK == errno)) {
res_log(NULL, LOG_INFO,
"libsres: ""**** no data on socket %d.", arrival->ea_socket);
goto allow_retry;
}
arr_family = arrival->ea_ns->ns_address[arrival->ea_which_address]->ss_family;
if ((ret_val < 0) || (from.ss_family != arr_family))
goto error;
if (AF_INET == from.ss_family) {
struct sockaddr_in *arr_in = (struct sockaddr_in *)
arrival->ea_ns->ns_address[arrival->ea_which_address];
struct sockaddr_in *from_in = (struct sockaddr_in *) &from;
if ((from_in->sin_port != arr_in->sin_port) ||
memcmp(&from_in->sin_addr, &arr_in->sin_addr,
sizeof(struct in_addr)))
goto error;
/* XXX Wait for actual response */
}
#ifdef VAL_IPV6
else if (AF_INET6 == from.ss_family) {
struct sockaddr_in6 *arr_in = (struct sockaddr_in6 *)
arrival->ea_ns->ns_address[arrival->ea_which_address];
struct sockaddr_in6 *from_in = (struct sockaddr_in6 *) &from;
if ((from_in->sin6_port != arr_in->sin6_port) ||
(memcmp(&from_in->sin6_addr, &arr_in->sin6_addr,
sizeof(struct in6_addr))))
goto error;
/* XXX Wait for actual response */
}
#endif
else
goto error; /* unknown family */
/* ret_val is greater than zero here */
arrival->ea_response_length = ret_val;
return SR_IO_UNSET;
error:
/*
* reset this source
*/
res_io_reset_source(arrival);
allow_retry:
FREE(arrival->ea_response);
arrival->ea_response = NULL;
arrival->ea_response_length = 0;
return SR_IO_SOCKET_ERROR;
}
void
res_switch_to_tcp(struct expected_arrival *ea)
{
res_log(NULL, LOG_INFO, "libsres: ""Switching to TCP");
if (NULL == ea)
return;
if (ea->ea_response != NULL) {
FREE(ea->ea_response);
}
ea->ea_response = NULL;
ea->ea_response_length = 0;
/*
* Use the same "ea_which_address," since it already got a rise.
*/
ea->ea_using_stream = TRUE;
if (ea->ea_socket != INVALID_SOCKET) {
CLOSESOCK(ea->ea_socket);
ea->ea_socket = INVALID_SOCKET;
}
ea->ea_remaining_attempts = ea->ea_ns->ns_retry+1;
set_alarms(ea, 0, res_get_timeout(ea->ea_ns));
}
/*
* switch all ea entries in the chain to tcp.
*
* unlike res_switch_to_tcp, which is used during processing, this
* function is intended to be called BEFORE processing starts. Thus
* the retry count and next/cancel timers are not touched.
*/
void
res_switch_all_to_tcp(struct expected_arrival *ea)
{
res_log(NULL, LOG_INFO, "libsres: ""Switching all to TCP");
for (; ea; ea = ea->ea_next) {
if (ea->ea_response != NULL) {
FREE(ea->ea_response);
}
ea->ea_response = NULL;
ea->ea_response_length = 0;
ea->ea_using_stream = TRUE;
if (ea->ea_socket != INVALID_SOCKET) {
CLOSESOCK(ea->ea_socket);
ea->ea_socket = INVALID_SOCKET;
}
}
}
void
res_switch_all_to_tcp_tid(int tid)
{
struct expected_arrival *ea;
if ((tid < 0) || (tid >= MAX_TRANSACTIONS))
return;
ea = transactions[tid];
if (ea)
res_switch_all_to_tcp(ea);
}
int
res_io_read(fd_set * read_descriptors, struct expected_arrival *ea_list)
{
int handled = 0, rc;
struct expected_arrival *arrival;
res_log(NULL,LOG_DEBUG,"libsres: "" res_io_read ea %p", ea_list);
for (; ea_list; ea_list = ea_list->ea_next) {
/*
* skip canceled/expired attempts, or sockets without data
*/
if ((ea_list->ea_remaining_attempts == -1) ||
(ea_list->ea_socket == INVALID_SOCKET) ||
! FD_ISSET(ea_list->ea_socket, read_descriptors))
continue;
{ /* dummy block to preserve indentation; remove later */
res_log(NULL, LOG_DEBUG, "libsres: ""ACTIVITY on %d",
ea_list->ea_socket);
++handled;
FD_CLR(ea_list->ea_socket, read_descriptors);
arrival = ea_list;
res_print_ea(arrival);
if (arrival->ea_using_stream) {
/** Use TCP */
rc = res_io_read_tcp(arrival);
} else {
/** Use UDP */
rc = res_io_read_udp(arrival);
}
res_log(NULL, LOG_DEBUG, "libsres: ""Read %zd bytes via %s",
arrival->ea_response_length,
arrival->ea_using_stream ? "TCP" : "UDP");
if (SR_IO_UNSET != rc)
continue;
/*
* Make sure this is the query we want (buffer id's match).
* Check the query line to make sure it's right.
*
* I'm not sure this should be done at this level - but
* res_send does it. It could be a sign of an attack,
* but I'll leave it to a network sniffer to figure it
* out for the time being.
*/
if (memcmp
(arrival->ea_signed, arrival->ea_response,
sizeof(u_int16_t))
|| res_quecmp(arrival->ea_signed, arrival->ea_response)) {
/*
* The the query and response ID's/query lines don't match
*/
res_log(NULL, LOG_WARNING, "libsres: ""dropping response: "
"query and response ID's or q_fields don't match");
FREE(arrival->ea_response);
arrival->ea_response = NULL;
arrival->ea_response_length = 0;
continue;
}
/*
* See if the message was truncated
* switch to TCP
* reinitialize source (just like we're beginning UDP)
*/
if (!arrival->ea_using_stream
&& ((HEADER *) arrival->ea_response)->tc)
res_switch_to_tcp(arrival);
}
}
res_log(NULL,LOG_DEBUG,"libsres: "" handled %d", handled);
return handled;
}
int
res_io_accept(int transaction_id, fd_set *pending_desc,
struct timeval *closest_event,
u_char ** answer,
size_t * answer_length,
struct name_server **respondent)
{
int ret_val;
struct timeval next_event;
struct timeval zero_time;
fd_set read_descriptors;
timerclear(&zero_time);
FD_ZERO(&read_descriptors);
res_log(NULL, LOG_DEBUG, "libsres: ""Calling io_accept");
/*
* See what needs to be sent. A return code of 0 means that there
* is nothing more to be sent and there is also nothing to wait for.
*
* All is not hopeless though - more sources may still waiting to be
* added via res_io_deliver().
*/
if (res_io_check(transaction_id, &next_event) == 0) {
res_log(NULL, LOG_DEBUG, "libsres: "" tid %d: no active queries",
transaction_id);
return SR_IO_NO_ANSWER;
}
/*
* See if there is a response waiting that we simply need to pluck.
*/
pthread_mutex_lock(&mutex);
if (res_io_get_a_response(transactions[transaction_id],
answer, answer_length,
respondent) == SR_IO_GOT_ANSWER) {
pthread_mutex_unlock(&mutex);
return SR_IO_GOT_ANSWER;
}
/*
* Decision time: does this call only look at the sockets used by
* its transaction id, or does it look at all?
*
* Answer for now -> just the sockets we are interested in.
*/
res_io_collect_sockets(&read_descriptors,
transactions[transaction_id]);
pthread_mutex_unlock(&mutex);
ret_val = res_io_select_sockets(&read_descriptors, &zero_time);
if (ret_val == SOCKET_ERROR)
/** select call failed */
return SR_IO_SOCKET_ERROR;
pthread_mutex_lock(&mutex);
/** make sure transaction didn't get cancelled */
if (transactions[transaction_id] == NULL) {
pthread_mutex_unlock(&mutex);
return SR_IO_NO_ANSWER;
}
if (ret_val == 0) {
/** There are sources, but none are talking (yet) */
/* save descriptors that we are waiting on */
res_io_collect_sockets(pending_desc,
transactions[transaction_id]);
/* check if next_event is closer than closest_event */
UPDATE(closest_event, next_event);
pthread_mutex_unlock(&mutex);
return SR_IO_NO_ANSWER_YET;
}
/*
* React to the active desciptors.
*/
res_io_read(&read_descriptors, transactions[transaction_id]);
/*
* Pluck the answer and return it to the caller.
*/
ret_val = res_io_get_a_response(transactions[transaction_id],
answer, answer_length, respondent);
pthread_mutex_unlock(&mutex);
if (ret_val == SR_IO_UNSET)
return SR_IO_NO_ANSWER_YET;
else if (ret_val == SR_IO_NO_ANSWER)
return SR_IO_NO_ANSWER;
else
return SR_IO_GOT_ANSWER;
}
void
res_cancel(int *transaction_id)
{
struct expected_arrival *ea;
if ((NULL == transaction_id) || (*transaction_id == -1))
return;
res_log(NULL, LOG_DEBUG, "libsres: ""tid %d cancel", *transaction_id);
pthread_mutex_lock(&mutex);
ea = transactions[*transaction_id];
transactions[*transaction_id] = NULL;
pthread_mutex_unlock(&mutex);
res_free_ea_list(ea);
*transaction_id = -1;
}
void
res_io_cancel_all(void)
{
int i, j;
for (i = 0; i < MAX_TRANSACTIONS; i++) {
j = i;
res_cancel(&j);
}
}
void
res_print_server(struct name_server *ea_ns, int i)
{
struct sockaddr_in *s =
(struct sockaddr_in *) ((ea_ns->ns_address[i]));
char buf[INET6_ADDRSTRLEN + 1];
const char *addr = NULL;
size_t buflen = sizeof(buf);
if (AF_INET == ea_ns->ns_address[i]->ss_family)
INET_NTOP(AF_INET, (struct sockaddr *)s, sizeof(s), buf, buflen,
addr);
res_log(NULL, LOG_DEBUG, "libsres: "" Nameserver: %s",
addr ? addr : "");
}
void
res_print_ea(struct expected_arrival *ea)
{
int i = ea->ea_which_address, port = 0;
char buf[INET6_ADDRSTRLEN + 1];
const char *addr = NULL;
size_t buflen = sizeof(buf);
struct timeval now,when_next, when_cancel;
struct sockaddr_in *s =
(struct sockaddr_in *) ((ea->ea_ns->ns_address[i]));
#ifdef VAL_IPV6
struct sockaddr_in6 *s6 =
(struct sockaddr_in6 *) ((ea->ea_ns->ns_address[i]));
if (AF_INET6 == ea->ea_ns->ns_address[i]->ss_family) {
INET_NTOP(AF_INET6, (struct sockaddr *)s6, sizeof(s6), buf, buflen, addr);
port = s6->sin6_port;
}
#endif
if (AF_INET == ea->ea_ns->ns_address[i]->ss_family) {
INET_NTOP(AF_INET, (struct sockaddr *)s, sizeof(s), buf, buflen, addr);
port = s->sin_port;
}
gettimeofday(&now, NULL);
timersub(&ea->ea_next_try, &now, &when_next);
timersub(&ea->ea_cancel_time, &now, &when_cancel);
if (ea->ea_remaining_attempts < 0) {
res_log(NULL, LOG_DEBUG, "libsres: "" ea %p "
#ifdef EA_EXTRA_DEBUG
"%s "
#endif
"Socket: %d, Nameserver: %s:%d, no more retries", ea,
#ifdef EA_EXTRA_DEBUG
ea->name,
#endif
ea->ea_socket, addr ? addr : "", ntohs(port));
} else {
res_log(NULL, LOG_DEBUG, "libsres: " " ea %p "
#ifdef EA_EXTRA_DEBUG
"{%s %s(%d) %s(%d)} "
#endif
"Socket: %d, Stream: %d, Nameserver: %s:%d", ea,
#ifdef EA_EXTRA_DEBUG
ea->name, p_class(ea->ea_class_h), ea->ea_class_h,
p_type(ea->ea_type_h), ea->ea_type_h,
#endif
ea->ea_socket, ea->ea_using_stream, addr ? addr : "",
ntohs(port));
res_log(NULL, LOG_DEBUG, "libsres: "
" Remaining retries: %d, "
"Next try %ld.%ld (%ld.%ld), Cancel at %ld.%ld (%ld.%ld)",
ea->ea_remaining_attempts, ea->ea_next_try.tv_sec,
ea->ea_next_try.tv_usec, when_next.tv_sec,
when_next.tv_usec, ea->ea_cancel_time.tv_sec,
ea->ea_cancel_time.tv_usec, when_cancel.tv_sec,
when_cancel.tv_usec);
}
}
void
res_io_view(void)
{
int i;
int j;
struct expected_arrival *ea;
struct timeval tv;
gettimeofday(&tv, NULL);
res_log(NULL, LOG_DEBUG, "libsres: ""Current time is %ld", tv.tv_sec);
pthread_mutex_lock(&mutex);
for (i = 0; i < MAX_TRANSACTIONS; i++)
if (transactions[i]) {
res_log(NULL, LOG_DEBUG, "libsres: ""Transaction id: %3d", i);
for (ea = transactions[i], j = 0; ea; ea = ea->ea_next, j++) {
res_log(NULL, LOG_DEBUG, "libsres: ""Source #%d", j);
res_print_ea(ea);
}
}
pthread_mutex_unlock(&mutex);
}
void
res_io_stall(void)
{
/*
* Used to cause pretty printing in debug mode
*/
struct timeval tv;
gettimeofday(&tv, NULL);
sleep(100 - (tv.tv_sec % 100));
}
#ifndef WIN32
int
res_io_count_ready(fd_set *read_desc, int num_fds)
{
int i, count, max;
if (NULL == read_desc) {
res_log(NULL,LOG_DEBUG, "libsres: "" count: no fds set (NULL fd_set)");
return 0;
}
if (num_fds > 0)
max = num_fds;
else
max = getdtablesize();
if (max > FD_SETSIZE)
max = FD_SETSIZE;
for (count=i=0; i < max; ++i)
if (FD_ISSET(i, read_desc)) {
res_log(NULL,LOG_DEBUG, "libsres: "" count: fd %d set", i);
++count;
}
if (0 == count)
res_log(NULL,LOG_DEBUG, "libsres: "" count: no fds set");
return count;
}
#else
int
res_io_count_ready(fd_set *read_desc, int num_fds)
{
return 0;
}
#endif /* ! WIN32 */
struct expected_arrival *
res_async_query_send(const char *name, const u_int16_t type_h,
const u_int16_t class_h, struct name_server *pref_ns)
{
int ret_val;
struct expected_arrival *head =
res_async_query_create(name, type_h, class_h, pref_ns, 0);
if (NULL != head)
ret_val = res_io_check_ea_list(head,NULL,NULL,NULL,NULL);
return head;
}
struct expected_arrival *
res_async_query_create(const char *name, const u_int16_t type_h,
const u_int16_t class_h, struct name_server *pref_ns,
u_int flags)
{
int ret_val = SR_UNSET;
u_char *signed_query = NULL;
size_t signed_length = 0;
struct name_server *ns_list = NULL;
struct name_server *ns;
struct expected_arrival *head = NULL, *new_ea, *temp_ea;
long delay = 0;
if ((name == NULL) || (pref_ns == NULL))
return NULL;
/*
* clone nameservers and store to ns_list
*/
if ((ret_val = clone_ns_list(&ns_list, pref_ns)) != SR_UNSET)
return NULL;
/*
* Loop through the list of destinations, form the query and send it
*/
for (ns = ns_list; ns; ns = ns->ns_next) {
/** create payload */
ret_val = res_create_query_payload(ns, name, class_h, type_h,
&signed_query, &signed_length);
if (ret_val < 0)
break; /* fatal, bail */
/** create expected arrival struct */
new_ea = res_ea_init(signed_query, signed_length, ns, delay);
if (NULL == new_ea) {
FREE(signed_query);
ret_val = SR_IO_MEMORY_ERROR;
break; /* fatal, bail */
}
#ifdef EA_EXTRA_DEBUG
new_ea->name = strdup(name);
new_ea->ea_type_h = type_h;
new_ea->ea_class_h = class_h;
#endif
/** add to list */
if (NULL != head) {
temp_ea = head;
while(temp_ea->ea_next)
temp_ea = temp_ea->ea_next;
temp_ea->ea_next = new_ea;
} else
head = new_ea;
delay += LIBSRES_NS_STAGGER;
}
/** if bad ret_val, clear list, else send query */
if (ret_val != SR_UNSET) {
res_free_ea_list(head);
head = NULL;
}
return head;
}
void
res_async_query_select_info(struct expected_arrival *ea, int *nfds,
fd_set *fds, struct timeval *timeout)
{
if (!ea || (!nfds && !fds && !timeout))
return;
res_io_select_info(ea, nfds, fds, timeout);
}
int
res_async_query_handle(struct expected_arrival *ea, int *handled, fd_set *fds)
{
int ret_val = SR_NO_ANSWER;
if (!ea || !handled || !fds)
return SR_INTERNAL_ERROR;
/*
* React to any active desciptors and see if we got a response, or
* if we at least still have an open socket (i.e. potential response).
*/
*handled = res_io_read(fds, ea);
for( ; ea; ea = ea->ea_next) {
if (ea->ea_remaining_attempts == -1)
continue;
else if (ea->ea_response) {
ret_val = SR_UNSET;
break;
}
else if (ea->ea_socket != INVALID_SOCKET)
ret_val = SR_NO_ANSWER_YET;
}
return ret_val;
}
void
res_async_query_free(struct expected_arrival *ea)
{
res_free_ea_list(ea);
}
void
res_async_query_cancel(struct expected_arrival *ea)
{
}
int
res_async_ea_is_using_stream(struct expected_arrival *ea)
{
if (NULL == ea)
return 0;
return ea->ea_using_stream;
}
int
res_async_ea_isset(struct expected_arrival *ea, fd_set *fds)
{
if (NULL == ea || NULL == fds)
return 0;
for (; ea; ea = ea->ea_next) {
if (ea->ea_socket != INVALID_SOCKET &&
FD_ISSET(ea->ea_socket, fds))
return 1;
}
return 0;
}
int
res_async_tid_isset(int tid, fd_set *fds)
{
int retval = 0;
if (tid < 0 || tid >= MAX_TRANSACTIONS || NULL == fds)
return 0;
pthread_mutex_lock(&mutex);
if (transactions[tid])
retval = res_async_ea_isset(transactions[tid],fds);
pthread_mutex_unlock(&mutex);
return retval;
}
int
res_async_ea_count_active(struct expected_arrival *ea)
{
int count = 0;
for ( ; ea; ea = ea->ea_next ) {
if ((ea->ea_remaining_attempts == -1) || (ea->ea_socket == INVALID_SOCKET))
continue;
++count;
}
return count;
}
dnsval-2.0/libsres/res_mkquery.c 0000664 0002372 0002372 00000024242 11732713653 017163 0 ustar hardaker hardaker /*
* Copyright (c) 1985, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Portions Copyright (c) 1993 by Digital Equipment Corporation.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies, and that
* the name of Digital Equipment Corporation not be used in advertising or
* publicity pertaining to distribution of the document or software without
* specific, written prior permission.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
* CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
/*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Portions Copyright (c) 1996-1999 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "validator-internal.h"
#include "res_mkquery.h"
#include "res_tsig.h"
#include "res_support.h"
#include "res_comp.h"
/*
* Uncomment the following line to turn on debugging for this file
*/
/*
* #define DEBUG
*/
#if ! defined( NS_HFIXEDSZ ) && defined (HFIXEDSZ)
#define NS_HFIXEDSZ HFIXEDSZ
#define NS_QFIXEDSZ QFIXEDSZ
#define NS_RRFIXEDSZ RRFIXEDSZ
#endif
extern const char *_libsres_opcodes[];
/*
* Form all types of queries.
* Returns the size of the result or -1.
*/
int
res_val_nmkquery(struct name_server *pref_ns, int op, /* opcode of query */
const char *dname, /* domain name */
u_int16_t class_h, u_int16_t type_h, /* class and type of query */
const u_char * data, /* resource record data */
size_t datalen, /* length of data */
const u_char * newrr_in, /* new rr for modify or append */
u_char * buf, /* buffer to put query */
size_t buflen,
size_t *query_length)
{ /* size of buffer */
register HEADER *hp;
register u_char *cp, *ep;
register int n;
u_char *dnptrs[20], **dpp, **lastdnptr;
u_int16_t datalen_16 = (u_int16_t)datalen;
// UNUSED(newrr_in);
#ifdef DEBUG
if (pref_ns->ns_options & SR_QUERY_DEBUG)
printf(";; res_val_nmkquery(%s, %s, %s, %s)\n",
_libsres_opcodes[op], dname, p_class(class_h), p_type(type_h));
#endif
/*
* Initialize header fields.
*/
if ((buf == NULL) || (buflen < NS_HFIXEDSZ) || query_length == NULL
|| datalen > datalen_16)
return (-1);
*query_length = 0;
memset(buf, 0, NS_HFIXEDSZ);
hp = (HEADER *) buf;
hp->id = libsres_random();
hp->opcode = op;
hp->rd = (pref_ns->ns_options & SR_QUERY_RECURSE) != 0U;
hp->rcode = ns_r_noerror;
cp = buf + NS_HFIXEDSZ;
ep = buf + buflen;
dpp = dnptrs;
*dpp++ = buf;
*dpp++ = NULL;
lastdnptr = dnptrs + sizeof(dnptrs) / sizeof(dnptrs[0]);
/*
* perform opcode specific processing
*/
switch (op) {
case ns_o_query:
/** FALLTHROUGH */
case ns_o_notify:
if (ep - cp < NS_QFIXEDSZ)
return (-1);
if ((n = dn_comp(dname, cp, ep - cp - NS_QFIXEDSZ, dnptrs,
lastdnptr)) < 0)
return (-1);
cp += n;
RES_PUT16(type_h, cp);
RES_PUT16(class_h, cp);
hp->qdcount = htons(1);
if (op == ns_o_query || data == NULL)
break;
/*
* Make an additional record for completion domain.
*/
if ((ep - cp) < NS_RRFIXEDSZ)
return (-1);
n = dn_comp((const char *) data, cp, ep - cp - NS_RRFIXEDSZ,
dnptrs, lastdnptr);
if (n < 0)
return (-1);
cp += n;
RES_PUT16(ns_t_null, cp);
RES_PUT16(class_h, cp);
RES_PUT32(0, cp);
RES_PUT16(0, cp);
hp->arcount = htons(1);
break;
case ns_o_iquery:
/*
* Initialize answer section
*/
if (ep - cp < 1 + NS_RRFIXEDSZ + datalen_16)
return (-1);
*cp++ = '\0'; /* no domain name */
RES_PUT16(type_h, cp);
RES_PUT16(class_h, cp);
RES_PUT32(0, cp);
RES_PUT16(datalen_16, cp);
if (datalen_16) {
memcpy(cp, data, datalen_16);
cp += datalen_16;
}
hp->ancount = htons(1);
break;
default:
return (-1);
}
if (cp > buf)
*query_length = (cp - buf);
return 0;
}
int
res_create_query_payload(struct name_server *ns,
const char *name,
const u_int16_t class_h,
const u_int16_t type_h,
u_char **signed_query,
size_t *signed_length)
{
u_char query[12 + NS_MAXDNAME + 4];
size_t query_limit = 12 + NS_MAXDNAME + 4;
size_t query_length = 0;
int ret_val;
ret_val = res_val_nmkquery(ns, ns_o_query, name, class_h, type_h, NULL,
0, NULL, query, query_limit, &query_length);
if (ret_val== -1)
return SR_MKQUERY_INTERNAL_ERROR;
if (ns->ns_options & SR_QUERY_SET_DO) {
/** Enable EDNS0 and set the DO flag */
ret_val = res_val_nopt(ns, query, query_limit,
&query_length);
}
if (ns->ns_options & SR_QUERY_SET_CD) {
/** Set the CD flag */
if (!(ns->ns_options & SR_QUERY_SET_DO)) {
res_log(NULL, LOG_NOTICE,
"libsres: ""CD bit set without EDNS0/DO enabled");
}
((HEADER *) query)->cd = 1;
}
if (ret_val == -1)
return SR_MKQUERY_INTERNAL_ERROR;
if (ns->ns_options & SR_QUERY_RECURSE) {
((HEADER *)query)->rd = 1;
} else {
/* don't ask for recursion */
((HEADER *)query)->rd = 0;
}
if ((ret_val = res_tsig_sign(query, query_length, ns,
signed_query,
signed_length)) != SR_TS_OK) {
return SR_MKQUERY_INTERNAL_ERROR;
}
return 0;
}
/*
* attach OPT pseudo-RR, as documented in RFC2671 (EDNS0).
*/
int
res_val_nopt(struct name_server *pref_ns,
u_char * buf, /* buffer to put query */
size_t buflen, /* size of buffer */
size_t *query_length)
{ /* UDP answer buffer size */
register HEADER *hp;
register u_char *cp, *ep;
u_int16_t flags = 0;
#ifdef DEBUG
if ((pref_ns->ns_options & SR_QUERY_DEBUG) != 0U)
printf(";; res_nopt()\n");
#endif
if (query_length == NULL)
return -1;
hp = (HEADER *) buf;
cp = buf + *query_length;
ep = buf + buflen;
if ((ep - cp) < 1 + NS_RRFIXEDSZ)
return (-1);
*cp++ = 0; /* "." */
RES_PUT16(ns_t_opt, cp); /* TYPE */
RES_PUT16(pref_ns->ns_edns0_size & 0xffff, cp); /* CLASS = UDP payload size */
*cp++ = ns_r_noerror; /* extended RCODE */
*cp++ = 0; /* EDNS version */
#ifdef DEBUG
if (pref_ns->ns_options & SR_QUERY_DEBUG)
printf(";; res_opt()... ENDS0 DNSSEC\n");
#endif
flags |= NS_OPT_DNSSEC_OK;
RES_PUT16(flags, cp);
RES_PUT16(0, cp); /* RDLEN */
hp->arcount = htons(ntohs(hp->arcount) + 1);
if (cp > buf)
*query_length = cp - buf;
return 0;
}
dnsval-2.0/libsres/ns_samedomain.h 0000664 0002372 0002372 00000000155 11560322751 017426 0 ustar hardaker hardaker
#ifndef _NS_SAMEDOMAIN_H_
#define _NS_SAMEDOMAIN_H_
int
ns_samename(const char *a, const char *b);
#endif
dnsval-2.0/config.sub 0000775 0002372 0002372 00000073055 10670362421 014770 0 ustar hardaker hardaker #! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
timestamp='2003-06-18'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
# can handle that machine. It does not imply ALL GNU software can.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Please send patches to . Submit a context
# diff and a properly formatted ChangeLog entry.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
# If it is invalid, we print an error message on stderr and exit with code 1.
# Otherwise, we print the canonical config type on stdout and succeed.
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
# that are meaningful with *any* GNU software.
# Each package is responsible for reporting which valid configurations
# it does not support. The user should be able to distinguish
# a failure to support a valid configuration from a meaningless
# configuration.
# The goal of this file is to map all the various variations of a given
# machine specification into a single specification in the form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# or in some cases, the newer four-part form:
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# It is wrong to echo any other type of specification.
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
Usage: $0 [OPTION] CPU-MFR-OPSYS
$0 [OPTION] ALIAS
Canonicalize a configuration name.
Operation modes:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
Report bugs and patches to ."
version="\
GNU config.sub ($timestamp)
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit 0 ;;
--version | -v )
echo "$version" ; exit 0 ;;
--help | --h* | -h )
echo "$usage"; exit 0 ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
echo "$me: invalid option $1$help"
exit 1 ;;
*local*)
# First pass through any local machine types.
echo $1
exit 0;;
* )
break ;;
esac
done
case $# in
0) echo "$me: missing argument$help" >&2
exit 1;;
1) ;;
*) echo "$me: too many arguments$help" >&2
exit 1;;
esac
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
*)
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
if [ $basic_machine != $1 ]
then os=`echo $1 | sed 's/.*-/-/'`
else os=; fi
;;
esac
### Let's recognize common machines as not being operating systems so
### that things like config.sub decstation-3100 work. We also
### recognize some manufacturers as not being operating systems, so we
### can provide default operating systems below.
case $os in
-sun*os*)
# Prevent following clause from handling this invalid input.
;;
-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-apple | -axis)
os=
basic_machine=$1
;;
-sim | -cisco | -oki | -wec | -winbond)
os=
basic_machine=$1
;;
-scout)
;;
-wrs)
os=-vxworks
basic_machine=$1
;;
-chorusos*)
os=-chorusos
basic_machine=$1
;;
-chorusrdb)
os=-chorusrdb
basic_machine=$1
;;
-hiux*)
os=-hiuxwe2
;;
-sco5)
os=-sco3.2v5
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco4)
os=-sco3.2v4
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco3.2.[4-9]*)
os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco3.2v[4-9]*)
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco*)
os=-sco3.2v2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-udk*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-isc)
os=-isc2.2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-clix*)
basic_machine=clipper-intergraph
;;
-isc*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-lynx*)
os=-lynxos
;;
-ptx*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
;;
-windowsnt*)
os=`echo $os | sed -e 's/windowsnt/winnt/'`
;;
-psos*)
os=-psos
;;
-mint | -mint[0-9]*)
basic_machine=m68k-atari
os=-mint
;;
esac
# Decode aliases for certain CPU-COMPANY combinations.
case $basic_machine in
# Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below.
1750a | 580 \
| a29k \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx \
| fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \
| ip2k \
| m32r | m68000 | m68k | m88k | mcore \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
| mips64vr | mips64vrel \
| mips64orion | mips64orionel \
| mips64vr4100 | mips64vr4100el \
| mips64vr4300 | mips64vr4300el \
| mips64vr5000 | mips64vr5000el \
| mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \
| mipsisa64 | mipsisa64el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
| msp430 \
| ns16k | ns32k \
| openrisc | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| pyramid \
| s390 | s390x \
| sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \
| strongarm \
| tahoe | thumb | tic4x | tic80 | tron \
| v850 | v850e \
| we32k \
| x86 | xscale | xstormy16 | xtensa \
| z8k)
basic_machine=$basic_machine-unknown
;;
m6811 | m68hc11 | m6812 | m68hc12)
# Motorola 68HC11/12.
basic_machine=$basic_machine-unknown
os=-none
;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
i*86 | x86_64)
basic_machine=$basic_machine-pc
;;
# Object if more than one company name word.
*-*-*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
;;
# Recognize the basic CPU types with company name.
580-* \
| a29k-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* \
| bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
| clipper-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* \
| m32r-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
| m88110-* | m88k-* | mcore-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
| mips64vr-* | mips64vrel-* \
| mips64orion-* | mips64orionel-* \
| mips64vr4100-* | mips64vr4100el-* \
| mips64vr4300-* | mips64vr4300el-* \
| mips64vr5000-* | mips64vr5000el-* \
| mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \
| mipsisa64-* | mipsisa64el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipstx39-* | mipstx39el-* \
| msp430-* \
| none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| pyramid-* \
| romp-* | rs6000-* \
| s390-* | s390x-* \
| sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
| tahoe-* | thumb-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tron-* \
| v850-* | v850e-* | vax-* \
| we32k-* \
| x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
| xtensa-* \
| ymp-* \
| z8k-*)
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
386bsd)
basic_machine=i386-unknown
os=-bsd
;;
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
basic_machine=m68000-att
;;
3b*)
basic_machine=we32k-att
;;
a29khif)
basic_machine=a29k-amd
os=-udi
;;
adobe68k)
basic_machine=m68010-adobe
os=-scout
;;
alliant | fx80)
basic_machine=fx80-alliant
;;
altos | altos3068)
basic_machine=m68k-altos
;;
am29k)
basic_machine=a29k-none
os=-bsd
;;
amd64)
basic_machine=x86_64-pc
;;
amdahl)
basic_machine=580-amdahl
os=-sysv
;;
amiga | amiga-*)
basic_machine=m68k-unknown
;;
amigaos | amigados)
basic_machine=m68k-unknown
os=-amigaos
;;
amigaunix | amix)
basic_machine=m68k-unknown
os=-sysv4
;;
apollo68)
basic_machine=m68k-apollo
os=-sysv
;;
apollo68bsd)
basic_machine=m68k-apollo
os=-bsd
;;
aux)
basic_machine=m68k-apple
os=-aux
;;
balance)
basic_machine=ns32k-sequent
os=-dynix
;;
c90)
basic_machine=c90-cray
os=-unicos
;;
convex-c1)
basic_machine=c1-convex
os=-bsd
;;
convex-c2)
basic_machine=c2-convex
os=-bsd
;;
convex-c32)
basic_machine=c32-convex
os=-bsd
;;
convex-c34)
basic_machine=c34-convex
os=-bsd
;;
convex-c38)
basic_machine=c38-convex
os=-bsd
;;
cray | j90)
basic_machine=j90-cray
os=-unicos
;;
crds | unos)
basic_machine=m68k-crds
;;
cris | cris-* | etrax*)
basic_machine=cris-axis
;;
da30 | da30-*)
basic_machine=m68k-da30
;;
decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
basic_machine=mips-dec
;;
decsystem10* | dec10*)
basic_machine=pdp10-dec
os=-tops10
;;
decsystem20* | dec20*)
basic_machine=pdp10-dec
os=-tops20
;;
delta | 3300 | motorola-3300 | motorola-delta \
| 3300-motorola | delta-motorola)
basic_machine=m68k-motorola
;;
delta88)
basic_machine=m88k-motorola
os=-sysv3
;;
dpx20 | dpx20-*)
basic_machine=rs6000-bull
os=-bosx
;;
dpx2* | dpx2*-bull)
basic_machine=m68k-bull
os=-sysv3
;;
ebmon29k)
basic_machine=a29k-amd
os=-ebmon
;;
elxsi)
basic_machine=elxsi-elxsi
os=-bsd
;;
encore | umax | mmax)
basic_machine=ns32k-encore
;;
es1800 | OSE68k | ose68k | ose | OSE)
basic_machine=m68k-ericsson
os=-ose
;;
fx2800)
basic_machine=i860-alliant
;;
genix)
basic_machine=ns32k-ns
;;
gmicro)
basic_machine=tron-gmicro
os=-sysv
;;
go32)
basic_machine=i386-pc
os=-go32
;;
h3050r* | hiux*)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
;;
h8300hms)
basic_machine=h8300-hitachi
os=-hms
;;
h8300xray)
basic_machine=h8300-hitachi
os=-xray
;;
h8500hms)
basic_machine=h8500-hitachi
os=-hms
;;
harris)
basic_machine=m88k-harris
os=-sysv3
;;
hp300-*)
basic_machine=m68k-hp
;;
hp300bsd)
basic_machine=m68k-hp
os=-bsd
;;
hp300hpux)
basic_machine=m68k-hp
os=-hpux
;;
hp3k9[0-9][0-9] | hp9[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hp9k2[0-9][0-9] | hp9k31[0-9])
basic_machine=m68000-hp
;;
hp9k3[2-9][0-9])
basic_machine=m68k-hp
;;
hp9k6[0-9][0-9] | hp6[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hp9k7[0-79][0-9] | hp7[0-79][0-9])
basic_machine=hppa1.1-hp
;;
hp9k78[0-9] | hp78[0-9])
# FIXME: really hppa2.0-hp
basic_machine=hppa1.1-hp
;;
hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
# FIXME: really hppa2.0-hp
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][13679] | hp8[0-9][13679])
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][0-9] | hp8[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hppa-next)
os=-nextstep3
;;
hppaosf)
basic_machine=hppa1.1-hp
os=-osf
;;
hppro)
basic_machine=hppa1.1-hp
os=-proelf
;;
i370-ibm* | ibm*)
basic_machine=i370-ibm
;;
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
i*86v32)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv32
;;
i*86v4*)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv4
;;
i*86v)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv
;;
i*86sol2)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-solaris2
;;
i386mach)
basic_machine=i386-mach
os=-mach
;;
i386-vsta | vsta)
basic_machine=i386-unknown
os=-vsta
;;
iris | iris4d)
basic_machine=mips-sgi
case $os in
-irix*)
;;
*)
os=-irix4
;;
esac
;;
isi68 | isi)
basic_machine=m68k-isi
os=-sysv
;;
m88k-omron*)
basic_machine=m88k-omron
;;
magnum | m3230)
basic_machine=mips-mips
os=-sysv
;;
merlin)
basic_machine=ns32k-utek
os=-sysv
;;
mingw32)
basic_machine=i386-pc
os=-mingw32
;;
miniframe)
basic_machine=m68000-convergent
;;
*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
basic_machine=m68k-atari
os=-mint
;;
mips3*-*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
;;
mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;;
mmix*)
basic_machine=mmix-knuth
os=-mmixware
;;
monitor)
basic_machine=m68k-rom68k
os=-coff
;;
morphos)
basic_machine=powerpc-unknown
os=-morphos
;;
msdos)
basic_machine=i386-pc
os=-msdos
;;
mvs)
basic_machine=i370-ibm
os=-mvs
;;
ncr3000)
basic_machine=i486-ncr
os=-sysv4
;;
netbsd386)
basic_machine=i386-unknown
os=-netbsd
;;
netwinder)
basic_machine=armv4l-rebel
os=-linux
;;
news | news700 | news800 | news900)
basic_machine=m68k-sony
os=-newsos
;;
news1000)
basic_machine=m68030-sony
os=-newsos
;;
news-3600 | risc-news)
basic_machine=mips-sony
os=-newsos
;;
necv70)
basic_machine=v70-nec
os=-sysv
;;
next | m*-next )
basic_machine=m68k-next
case $os in
-nextstep* )
;;
-ns2*)
os=-nextstep2
;;
*)
os=-nextstep3
;;
esac
;;
nh3000)
basic_machine=m68k-harris
os=-cxux
;;
nh[45]000)
basic_machine=m88k-harris
os=-cxux
;;
nindy960)
basic_machine=i960-intel
os=-nindy
;;
mon960)
basic_machine=i960-intel
os=-mon960
;;
nonstopux)
basic_machine=mips-compaq
os=-nonstopux
;;
np1)
basic_machine=np1-gould
;;
nv1)
basic_machine=nv1-cray
os=-unicosmp
;;
nsr-tandem)
basic_machine=nsr-tandem
;;
op50n-* | op60c-*)
basic_machine=hppa1.1-oki
os=-proelf
;;
or32 | or32-*)
basic_machine=or32-unknown
os=-coff
;;
OSE68000 | ose68000)
basic_machine=m68000-ericsson
os=-ose
;;
os68k)
basic_machine=m68k-none
os=-os68k
;;
pa-hitachi)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
;;
paragon)
basic_machine=i860-intel
os=-osf
;;
pbd)
basic_machine=sparc-tti
;;
pbb)
basic_machine=m68k-tti
;;
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
pentium | p5 | k5 | k6 | nexgen | viac3)
basic_machine=i586-pc
;;
pentiumpro | p6 | 6x86 | athlon | athlon_*)
basic_machine=i686-pc
;;
pentiumii | pentium2 | pentiumiii | pentium3)
basic_machine=i686-pc
;;
pentium4)
basic_machine=i786-pc
;;
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumpro-* | p6-* | 6x86-* | athlon-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentium4-*)
basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pn)
basic_machine=pn-gould
;;
power) basic_machine=power-ibm
;;
ppc) basic_machine=powerpc-unknown
;;
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppcle | powerpclittle | ppc-le | powerpc-little)
basic_machine=powerpcle-unknown
;;
ppcle-* | powerpclittle-*)
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppc64) basic_machine=powerpc64-unknown
;;
ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppc64le | powerpc64little | ppc64-le | powerpc64-little)
basic_machine=powerpc64le-unknown
;;
ppc64le-* | powerpc64little-*)
basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ps2)
basic_machine=i386-ibm
;;
pw32)
basic_machine=i586-unknown
os=-pw32
;;
rom68k)
basic_machine=m68k-rom68k
os=-coff
;;
rm[46]00)
basic_machine=mips-siemens
;;
rtpc | rtpc-*)
basic_machine=romp-ibm
;;
sa29200)
basic_machine=a29k-amd
os=-udi
;;
sb1)
basic_machine=mipsisa64sb1-unknown
;;
sb1el)
basic_machine=mipsisa64sb1el-unknown
;;
sei)
basic_machine=mips-sei
os=-seiux
;;
sequent)
basic_machine=i386-sequent
;;
sh)
basic_machine=sh-hitachi
os=-hms
;;
sh64)
basic_machine=sh64-unknown
;;
sparclite-wrs | simso-wrs)
basic_machine=sparclite-wrs
os=-vxworks
;;
sps7)
basic_machine=m68k-bull
os=-sysv2
;;
spur)
basic_machine=spur-unknown
;;
st2000)
basic_machine=m68k-tandem
;;
stratus)
basic_machine=i860-stratus
os=-sysv4
;;
sun2)
basic_machine=m68000-sun
;;
sun2os3)
basic_machine=m68000-sun
os=-sunos3
;;
sun2os4)
basic_machine=m68000-sun
os=-sunos4
;;
sun3os3)
basic_machine=m68k-sun
os=-sunos3
;;
sun3os4)
basic_machine=m68k-sun
os=-sunos4
;;
sun4os3)
basic_machine=sparc-sun
os=-sunos3
;;
sun4os4)
basic_machine=sparc-sun
os=-sunos4
;;
sun4sol2)
basic_machine=sparc-sun
os=-solaris2
;;
sun3 | sun3-*)
basic_machine=m68k-sun
;;
sun4)
basic_machine=sparc-sun
;;
sun386 | sun386i | roadrunner)
basic_machine=i386-sun
;;
sv1)
basic_machine=sv1-cray
os=-unicos
;;
symmetry)
basic_machine=i386-sequent
os=-dynix
;;
t3e)
basic_machine=alphaev5-cray
os=-unicos
;;
t90)
basic_machine=t90-cray
os=-unicos
;;
tic54x | c54x*)
basic_machine=tic54x-unknown
os=-coff
;;
tic55x | c55x*)
basic_machine=tic55x-unknown
os=-coff
;;
tic6x | c6x*)
basic_machine=tic6x-unknown
os=-coff
;;
tx39)
basic_machine=mipstx39-unknown
;;
tx39el)
basic_machine=mipstx39el-unknown
;;
toad1)
basic_machine=pdp10-xkl
os=-tops20
;;
tower | tower-32)
basic_machine=m68k-ncr
;;
udi29k)
basic_machine=a29k-amd
os=-udi
;;
ultra3)
basic_machine=a29k-nyu
os=-sym1
;;
v810 | necv810)
basic_machine=v810-nec
os=-none
;;
vaxv)
basic_machine=vax-dec
os=-sysv
;;
vms)
basic_machine=vax-dec
os=-vms
;;
vpp*|vx|vx-*)
basic_machine=f301-fujitsu
;;
vxworks960)
basic_machine=i960-wrs
os=-vxworks
;;
vxworks68)
basic_machine=m68k-wrs
os=-vxworks
;;
vxworks29k)
basic_machine=a29k-wrs
os=-vxworks
;;
w65*)
basic_machine=w65-wdc
os=-none
;;
w89k-*)
basic_machine=hppa1.1-winbond
os=-proelf
;;
xps | xps100)
basic_machine=xps100-honeywell
;;
ymp)
basic_machine=ymp-cray
os=-unicos
;;
z8k-*-coff)
basic_machine=z8k-unknown
os=-sim
;;
none)
basic_machine=none-none
os=-none
;;
# Here we handle the default manufacturer of certain CPU types. It is in
# some cases the only manufacturer, in others, it is the most popular.
w89k)
basic_machine=hppa1.1-winbond
;;
op50n)
basic_machine=hppa1.1-oki
;;
op60c)
basic_machine=hppa1.1-oki
;;
romp)
basic_machine=romp-ibm
;;
rs6000)
basic_machine=rs6000-ibm
;;
vax)
basic_machine=vax-dec
;;
pdp10)
# there are many clones, so DEC is not a safe bet
basic_machine=pdp10-unknown
;;
pdp11)
basic_machine=pdp11-dec
;;
we32k)
basic_machine=we32k-att
;;
sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
basic_machine=sh-unknown
;;
sh64)
basic_machine=sh64-unknown
;;
sparc | sparcv8 | sparcv9 | sparcv9b)
basic_machine=sparc-sun
;;
cydra)
basic_machine=cydra-cydrome
;;
orion)
basic_machine=orion-highlevel
;;
orion105)
basic_machine=clipper-highlevel
;;
mac | mpw | mac-mpw)
basic_machine=m68k-apple
;;
pmac | pmac-mpw)
basic_machine=powerpc-apple
;;
*-unknown)
# Make sure to match an already-canonicalized machine name.
;;
*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
;;
esac
# Here we canonicalize certain aliases for manufacturers.
case $basic_machine in
*-digital*)
basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
;;
*-commodore*)
basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
;;
*)
;;
esac
# Decode manufacturer-specific aliases for certain operating systems.
if [ x"$os" != x"" ]
then
case $os in
# First match some system type aliases
# that might get confused with valid system types.
# -solaris* is a basic system type, with this one exception.
-solaris1 | -solaris1.*)
os=`echo $os | sed -e 's|solaris1|sunos4|'`
;;
-solaris)
os=-solaris2
;;
-svr4*)
os=-sysv4
;;
-unixware*)
os=-sysv4.2uw
;;
-gnu/linux*)
os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
;;
# First accept the basic system types.
# The portable systems comes first.
# Each alternative MUST END IN A *, to match a version number.
# -sysv* is not here because it comes later, after sysvr4.
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
case $basic_machine in
x86-* | i*86-*)
;;
*)
os=-nto$os
;;
esac
;;
-nto-qnx*)
;;
-nto*)
os=`echo $os | sed -e 's|nto|nto-qnx|'`
;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
| -windows* | -osx | -abug | -netware* | -os9* | -beos* \
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
;;
-mac*)
os=`echo $os | sed -e 's|mac|macos|'`
;;
-linux*)
os=`echo $os | sed -e 's|linux|linux-gnu|'`
;;
-sunos5*)
os=`echo $os | sed -e 's|sunos5|solaris2|'`
;;
-sunos6*)
os=`echo $os | sed -e 's|sunos6|solaris3|'`
;;
-opened*)
os=-openedition
;;
-wince*)
os=-wince
;;
-osfrose*)
os=-osfrose
;;
-osf*)
os=-osf
;;
-utek*)
os=-bsd
;;
-dynix*)
os=-bsd
;;
-acis*)
os=-aos
;;
-atheos*)
os=-atheos
;;
-386bsd)
os=-bsd
;;
-ctix* | -uts*)
os=-sysv
;;
-nova*)
os=-rtmk-nova
;;
-ns2 )
os=-nextstep2
;;
-nsk*)
os=-nsk
;;
# Preserve the version number of sinix5.
-sinix5.*)
os=`echo $os | sed -e 's|sinix|sysv|'`
;;
-sinix*)
os=-sysv4
;;
-triton*)
os=-sysv3
;;
-oss*)
os=-sysv3
;;
-svr4)
os=-sysv4
;;
-svr3)
os=-sysv3
;;
-sysvr4)
os=-sysv4
;;
# This must come after -sysvr4.
-sysv*)
;;
-ose*)
os=-ose
;;
-es1800*)
os=-ose
;;
-xenix)
os=-xenix
;;
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
os=-mint
;;
-aros*)
os=-aros
;;
-kaos*)
os=-kaos
;;
-none)
;;
*)
# Get rid of the `-' at the beginning of $os.
os=`echo $os | sed 's/[^-]*-//'`
echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
exit 1
;;
esac
else
# Here we handle the default operating systems that come with various machines.
# The value should be what the vendor currently ships out the door with their
# machine or put another way, the most popular os provided with the machine.
# Note that if you're going to try to match "-MANUFACTURER" here (say,
# "-sun"), then you have to tell the case statement up towards the top
# that MANUFACTURER isn't an operating system. Otherwise, code above
# will signal an error saying that MANUFACTURER isn't an operating
# system, and we'll never get to this point.
case $basic_machine in
*-acorn)
os=-riscix1.2
;;
arm*-rebel)
os=-linux
;;
arm*-semi)
os=-aout
;;
c4x-* | tic4x-*)
os=-coff
;;
# This must come before the *-dec entry.
pdp10-*)
os=-tops20
;;
pdp11-*)
os=-none
;;
*-dec | vax-*)
os=-ultrix4.2
;;
m68*-apollo)
os=-domain
;;
i386-sun)
os=-sunos4.0.2
;;
m68000-sun)
os=-sunos3
# This also exists in the configure program, but was not the
# default.
# os=-sunos4
;;
m68*-cisco)
os=-aout
;;
mips*-cisco)
os=-elf
;;
mips*-*)
os=-elf
;;
or32-*)
os=-coff
;;
*-tti) # must be before sparc entry or we get the wrong os.
os=-sysv3
;;
sparc-* | *-sun)
os=-sunos4.1.1
;;
*-be)
os=-beos
;;
*-ibm)
os=-aix
;;
*-wec)
os=-proelf
;;
*-winbond)
os=-proelf
;;
*-oki)
os=-proelf
;;
*-hp)
os=-hpux
;;
*-hitachi)
os=-hiux
;;
i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
os=-sysv
;;
*-cbm)
os=-amigaos
;;
*-dg)
os=-dgux
;;
*-dolphin)
os=-sysv3
;;
m68k-ccur)
os=-rtu
;;
m88k-omron*)
os=-luna
;;
*-next )
os=-nextstep
;;
*-sequent)
os=-ptx
;;
*-crds)
os=-unos
;;
*-ns)
os=-genix
;;
i370-*)
os=-mvs
;;
*-next)
os=-nextstep3
;;
*-gould)
os=-sysv
;;
*-highlevel)
os=-bsd
;;
*-encore)
os=-bsd
;;
*-sgi)
os=-irix
;;
*-siemens)
os=-sysv4
;;
*-masscomp)
os=-rtu
;;
f30[01]-fujitsu | f700-fujitsu)
os=-uxpv
;;
*-rom68k)
os=-coff
;;
*-*bug)
os=-coff
;;
*-apple)
os=-macos
;;
*-atari*)
os=-mint
;;
*)
os=-none
;;
esac
fi
# Here we handle the case where we know the os, and the CPU type, but not the
# manufacturer. We pick the logical manufacturer.
vendor=unknown
case $basic_machine in
*-unknown)
case $os in
-riscix*)
vendor=acorn
;;
-sunos*)
vendor=sun
;;
-aix*)
vendor=ibm
;;
-beos*)
vendor=be
;;
-hpux*)
vendor=hp
;;
-mpeix*)
vendor=hp
;;
-hiux*)
vendor=hitachi
;;
-unos*)
vendor=crds
;;
-dgux*)
vendor=dg
;;
-luna*)
vendor=omron
;;
-genix*)
vendor=ns
;;
-mvs* | -opened*)
vendor=ibm
;;
-ptx*)
vendor=sequent
;;
-vxsim* | -vxworks* | -windiss*)
vendor=wrs
;;
-aux*)
vendor=apple
;;
-hms*)
vendor=hitachi
;;
-mpw* | -macos*)
vendor=apple
;;
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
vendor=atari
;;
-vos*)
vendor=stratus
;;
esac
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;
esac
echo $basic_machine$os
exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:
dnsval-2.0/acinclude.m4 0000664 0002372 0002372 00000007000 10566634654 015177 0 ustar hardaker hardaker dnl @synopsis AC_PROMPT_USER_NO_DEFINE(VARIABLENAME,QUESTION,[DEFAULT])
dnl
dnl Asks a QUESTION and puts the results in VARIABLENAME with an optional
dnl DEFAULT value if the user merely hits return.
dnl
dnl @version 1.15
dnl @author Wes Hardaker
dnl
AC_DEFUN([AC_PROMPT_USER_NO_DEFINE],
dnl changequote(<<, >>) dnl
dnl <<
[
if test "x$defaults" = "xno"; then
echo $ECHO_N "$2 ($3): $ECHO_C"
read tmpinput
if test "$tmpinput" = "" -a "$3" != ""; then
tmpinput="$3"
fi
eval $1=\"$tmpinput\"
else
tmpinput="$3"
eval $1=\"$tmpinput\"
fi
]
dnl >>
dnl changequote([, ])
) dnl done AC_PROMPT_USER
dnl @synopsis AC_PROMPT_USER(VARIABLENAME,QUESTION,[DEFAULT],QUOTED)
dnl
dnl Asks a QUESTION and puts the results in VARIABLENAME with an optional
dnl DEFAULT value if the user merely hits return. Also calls
dnl AC_DEFINE_UNQUOTED() on the VARIABLENAME for VARIABLENAMEs that should
dnl be entered into the config.h file as well. If QUOTED is "quoted" then
dnl the result will be defined within quotes.
dnl
dnl @version 1.15
dnl @author Wes Hardaker
dnl
AC_DEFUN([AC_PROMPT_USER],
[
MSG_CHECK=`echo "$2" | tail -1`
AC_CACHE_CHECK($MSG_CHECK, ac_cv_user_prompt_$1,
[echo "" >&AC_FD_MSG
AC_PROMPT_USER_NO_DEFINE($1,[$2],$3)
eval ac_cv_user_prompt_$1=\$$1
echo $ECHO_N "setting $MSG_CHECK to... $ECHO_C" >&AC_FD_MSG
])
if test "$ac_cv_user_prompt_$1" != "none"; then
if test "x$4" = "xquoted" -o "x$4" = "xQUOTED"; then
AC_DEFINE_UNQUOTED($1,"$ac_cv_user_prompt_$1")
else
AC_DEFINE_UNQUOTED($1,$ac_cv_user_prompt_$1)
fi
fi
]) dnl
dnl @synopsis AC_CHECK_STRUCT_FOR(INCLUDES,STRUCT,MEMBER,DEFINE,[no])
dnl
dnl Checks STRUCT for MEMBER and defines DEFINE if found.
dnl
dnl @version 1.15
dnl @author Wes Hardaker
dnl
AC_DEFUN([AC_CHECK_STRUCT_FOR],[
ac_safe_struct=`echo "$2" | sed 'y%./+-%__p_%'`
ac_safe_member=`echo "$3" | sed 'y%./+-%__p_%'`
ac_safe_all="ac_cv_struct_${ac_safe_struct}_has_${ac_safe_member}"
changequote(, )dnl
ac_uc_define=STRUCT_`echo "${ac_safe_struct}_HAS_${ac_safe_member}" | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
changequote([, ])dnl
AC_MSG_CHECKING([for $2.$3])
AC_CACHE_VAL($ac_safe_all,
[
if test "x$4" = "x"; then
defineit="= 0"
elif test "x$4" = "xno"; then
defineit=""
else
defineit="$4"
fi
AC_TRY_COMPILE([
$1
],[
struct $2 testit;
testit.$3 $defineit;
], eval "${ac_safe_all}=yes", eval "${ac_safe_all}=no" )
])
if eval "test \"x$`echo ${ac_safe_all}`\" = \"xyes\""; then
AC_MSG_RESULT(yes)
AC_DEFINE_UNQUOTED($ac_uc_define)
else
AC_MSG_RESULT(no)
fi
])
dnl
dnl Add a search path to the LIBS and CFLAGS variables
dnl
AC_DEFUN([AC_ADD_SEARCH_PATH],[
if test "x$1" != x -a -d $1; then
if test -d $1/lib; then
LDFLAGS="-L$1/lib $LDFLAGS"
fi
if test -d $1/include; then
CPPFLAGS="-I$1/include $CPPFLAGS"
fi
fi
])
dnl
dnl Store information for displaying later.
dnl
AC_DEFUN([AC_MSG_CACHE_INIT],[
rm -f configure-summary
])
AC_DEFUN([AC_MSG_CACHE_ADD],[
cat >> configure-summary << EOF
$1
EOF
])
AC_DEFUN([AC_MSG_CACHE_DISPLAY],[
echo ""
echo "---------------------------------------------------------"
echo " DNSSEC-Tool Validator configuration summary:"
echo "---------------------------------------------------------"
echo ""
cat configure-summary
echo ""
echo "---------------------------------------------------------"
echo ""
])
AC_DEFUN([AC_MSG_MODULE_DBG],
[
if test $module_debug = 1; then
echo $1 $2 $3 $4
fi
]
)
dnsval-2.0/Makefile.top 0000664 0002372 0002372 00000003751 12111211455 015232 0 ustar hardaker hardaker #
# Minimum environment and virtual path setup
#
SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = @top_builddir@
@SET_MAKE@
#
# Paths
#
prefix = @prefix@
exec_prefix = @exec_prefix@
sysconfdir = @sysconfdir@
bindir = @bindir@
sbindir = @sbindir@
libdir = @libdir@
datarootdir = @datarootdir@
datadir = @datadir@
includedir = @includedir@/validator
mandir = @mandir@
man1dir = $(mandir)/man1
man3dir = $(mandir)/man3
man5dir = $(mandir)/man5
man8dir = $(mandir)/man8
CONFIG_CACHE_FILE = @CONFIG_CACHE_FILE@
#
# compilation parameters
#
CC=@CC@
DEVCFLAGS=@DEVFLAGS@
CFLAGS_EX=
CFLAGS=@CFLAGS@ $(DEVCFLAGS) $(CFLAGS_EX)
CPPFLAGS=@CPPFLAGS@
LDFLAGS_EX=
LDFLAGS=@LDFLAGS@ $(LDFLAGS_EX)
AR=@AR@
RANLIB=@RANLIB@
RM=@RM@
CP=@CP@
INSTALL=@INSTALL@
DOCINSTALL=$(INSTALL) -m 644
MKPATH=$(top_srcdir)/mkinstalldirs
EXEEXT=@EXEEXT@
VAL_RESOLV_CONF=@VAL_RESOLV_CONF@
VAL_ROOT_HINTS=@VAL_ROOT_HINTS@
VAL_CONFIGURATION_FILE=@VAL_CONFIGURATION_FILE@
# suffix, if any (eg '-threads')
LIBVAL_SUFFIX=@LIBVAL_SUFFIX@
# use libtool versioning the way they recommend.
# The (slightly clarified) rules stolen from Net-SNMP:
#
# - If any interfaces/structures have been removed or changed since the
# last update, increment current, and set age and revision to 0. Stop.
#
# - If any interfaces have been added since the last public release, then
# increment current and age, and set revision to 0. Stop.
#
# - If the source code has changed at all since the last update,
# then increment revision (c:r:a becomes c:r+1:a).
#
# Note: When bumping these numbers, please update the following comments, so
# it doesn't get double-bumped.
#
LIBCURRENT = 14
LIBAGE = 0
LIBREVISION = 0
LIBTOOL=@LIBTOOL@
LIBTOOLCC=$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(CPPFLAGS)
LIBTOOLLD=$(LIBTOOL) --mode=link $(CC) $(CFLAGS) -rpath $(libdir) -version-info $(LIBCURRENT):$(LIBREVISION):$(LIBAGE)
LIBTOOLIN=$(LIBTOOL) --mode=install $(INSTALL)
LIBTOOLFN=$(LIBTOOL) --mode=finish
dnsval-2.0/Makefile.in 0000664 0002372 0002372 00000005652 12061255072 015047 0 ustar hardaker hardaker TEST_VERBOSITY=4
SUBDIRS=libsres libval apps doc libval_shim
LIBSUBDIRS=libsres libval libval_shim
WINSUBDIRS=libsres libval apps
BUILD_ARCH = build
INSTALLDIRS=$(prefix) $(exec_prefix) $(sysconfdir)/dnssec-tools $(bindir) $(sbindir) $(libdir) $(datadir) $(includedir) $(mandir) $(man1dir) $(man3dir) $(man5dir) $(man8dir)
all: subdirmake
libs: libsubdirmake
help:
@echo ""
@echo "make (all|libs|test|leakchecks|install|clean)"
test: subdirmake
@(cd apps; make test)
leakchecks: subdirmake
@(cd apps; make leakchecks)
makeit: subdirmake
nextstepinstructions:
@echo ""
@echo "**********************************************************************"
@echo "** Not automatically installing dnsval.conf"
@echo "** Please copy this file from validator/etc to $(VAL_CONFIGURATION_FILE)"
@echo "**********************************************************************"
@echo "** Not automatically installing resolv.conf"
@echo "** If needed, please copy this file from validator/etc to $(VAL_RESOLV_CONF)"
@echo "**********************************************************************"
@echo "** Not automatically installing root.hints"
@echo "** If needed, please copy this file from validator/etc to $(VAL_ROOT_HINTS)"
@echo "**********************************************************************"
@echo ""
install: makedirectories localinstall subdirinstall nextstepinstructions
clean: subdirclean
distclean: clean configclean
makedirectories:
@for i in $(INSTALLDIRS) ; do \
if test ! -d $(DESTDIR)$$i ; then \
echo "creating directory $(DESTDIR)$$i/" ; \
$(MKPATH) $(DESTDIR)$$i ; \
fi \
done
#
# Subdir build rules
#
subdirmake:
@for i in $(SUBDIRS) ; do \
(cd $$i ; make ) ; \
if test $$? != 0 ; then \
exit 1 ; \
fi \
done
libsubdirmake:
@for i in $(LIBSUBDIRS) ; do \
(cd $$i ; make ) ; \
if test $$? != 0 ; then \
exit 1 ; \
fi \
done
subdirinstall:
@for i in $(SUBDIRS) ; do \
(cd $$i ; make install DESTDIR=$(DESTDIR) ) ; \
if test $$? != 0 ; then \
exit 1 ; \
fi \
done
localinstall:
$(INSTALL) libval-config $(DESTDIR)$(bindir)
$(INSTALL) include/validator/validator-config.h $(DESTDIR)$(includedir)
$(INSTALL) include/validator/validator-compat.h $(DESTDIR)$(includedir)
subdirclean:
@for i in $(SUBDIRS) ; do \
(cd $$i ; make clean ) ; \
done
#
# Config system rules
#
configclean:
$(RM) -f $(CONFIG_CACHE_FILE) config.status config.log \
Makefile stamp-h *.core
universal: clean
make "CC=$(CC) -mmacosx-version-min=10.5 -arch x86_64 -arch i386 -arch ppc -bundle -undefined dynamic_lookup"
windows:
@for i in $(WINSUBDIRS) ; do \
(cd $$i ; make ) ; \
if test $$? != 0 ; then \
exit 1 ; \
fi \
done
windows-install:
@for i in $(WINSUBDIRS) ; do \
(cd $$i ; make install DESTDIR=$(DESTDIR) ) ; \
if test $$? != 0 ; then \
exit 1 ; \
fi \
done
TAGS:
find . -name '*.[ch]' -print | etags -
dnsval-2.0/config.guess 0000775 0002372 0002372 00000122065 10437603413 015321 0 ustar hardaker hardaker #! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
timestamp='2003-06-17'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Per Bothner .
# Please send patches to . Submit a context
# diff and a properly formatted ChangeLog entry.
#
# This script attempts to guess a canonical system name similar to
# config.sub. If it succeeds, it prints the system name on stdout, and
# exits with 0. Otherwise, it exits with 1.
#
# The plan is that this can be called by configure scripts if you
# don't specify an explicit build system type.
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
Usage: $0 [OPTION]
Output the configuration name of the system \`$me' is run on.
Operation modes:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
Report bugs and patches to ."
version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit 0 ;;
--version | -v )
echo "$version" ; exit 0 ;;
--help | --h* | -h )
echo "$usage"; exit 0 ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
echo "$me: invalid option $1$help" >&2
exit 1 ;;
* )
break ;;
esac
done
if test $# != 0; then
echo "$me: too many arguments$help" >&2
exit 1
fi
trap 'exit 1' 1 2 15
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
# compiler to aid in system detection is discouraged as it requires
# temporary files to be created and, as you can see below, it is a
# headache to deal with in a portable fashion.
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
# use `HOST_CC' if defined, but it is deprecated.
# Portable tmp directory creation inspired by the Autoconf team.
set_cc_for_build='
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
: ${TMPDIR=/tmp} ;
{ tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
dummy=$tmp/dummy ;
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
case $CC_FOR_BUILD,$HOST_CC,$CC in
,,) echo "int x;" > $dummy.c ;
for c in cc gcc c89 c99 ; do
if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
CC_FOR_BUILD="$c"; break ;
fi ;
done ;
if test x"$CC_FOR_BUILD" = x ; then
CC_FOR_BUILD=no_compiler_found ;
fi
;;
,,*) CC_FOR_BUILD=$CC ;;
,*,*) CC_FOR_BUILD=$HOST_CC ;;
esac ;'
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24)
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
PATH=$PATH:/.attbin ; export PATH
fi
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
## for Red Hat Linux
if test -f /etc/redhat-release ; then
VENDOR=redhat ;
else
VENDOR= ;
fi
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:NetBSD:*:*)
# NetBSD (nbsd) targets should (where applicable) match one or
# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
# switched to ELF, *-*-netbsd* would select the old
# object file format. This provides both forward
# compatibility and a consistent mechanism for selecting the
# object file format.
#
# Note: NetBSD doesn't particularly care about the vendor
# portion of the name. We always set it to "unknown".
sysctl="sysctl -n hw.machine_arch"
UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
/usr/sbin/$sysctl 2>/dev/null || echo unknown)`
case "${UNAME_MACHINE_ARCH}" in
armeb) machine=armeb-unknown ;;
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
esac
# The Operating System including object format, if it has switched
# to ELF recently, or will in the future.
case "${UNAME_MACHINE_ARCH}" in
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
eval $set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep __ELF__ >/dev/null
then
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
# Return netbsd for either. FIX?
os=netbsd
else
os=netbsdelf
fi
;;
*)
os=netbsd
;;
esac
# The OS release
# Debian GNU/NetBSD machines have a different userland, and
# thus, need a distinct triplet. However, they do not need
# kernel version information, so it can be replaced with a
# suitable tag, in the style of linux-gnu.
case "${UNAME_VERSION}" in
Debian*)
release='-gnu'
;;
*)
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
;;
esac
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}"
exit 0 ;;
amiga:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
arc:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
hp300:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
mac68k:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
macppc:OpenBSD:*:*)
echo powerpc-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
mvme68k:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
mvme88k:OpenBSD:*:*)
echo m88k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
mvmeppc:OpenBSD:*:*)
echo powerpc-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
pmax:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
sgi:OpenBSD:*:*)
echo mipseb-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
sun3:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
wgrisc:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
*:OpenBSD:*:*)
echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
alpha:OSF1:*:*)
if test $UNAME_RELEASE = "V4.0"; then
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
fi
# According to Compaq, /usr/sbin/psrinfo has been available on
# OSF/1 and Tru64 systems produced since 1995. I hope that
# covers most systems running today. This code pipes the CPU
# types through head -n 1, so we only detect the type of CPU 0.
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
case "$ALPHA_CPU_TYPE" in
"EV4 (21064)")
UNAME_MACHINE="alpha" ;;
"EV4.5 (21064)")
UNAME_MACHINE="alpha" ;;
"LCA4 (21066/21068)")
UNAME_MACHINE="alpha" ;;
"EV5 (21164)")
UNAME_MACHINE="alphaev5" ;;
"EV5.6 (21164A)")
UNAME_MACHINE="alphaev56" ;;
"EV5.6 (21164PC)")
UNAME_MACHINE="alphapca56" ;;
"EV5.7 (21164PC)")
UNAME_MACHINE="alphapca57" ;;
"EV6 (21264)")
UNAME_MACHINE="alphaev6" ;;
"EV6.7 (21264A)")
UNAME_MACHINE="alphaev67" ;;
"EV6.8CB (21264C)")
UNAME_MACHINE="alphaev68" ;;
"EV6.8AL (21264B)")
UNAME_MACHINE="alphaev68" ;;
"EV6.8CX (21264D)")
UNAME_MACHINE="alphaev68" ;;
"EV6.9A (21264/EV69A)")
UNAME_MACHINE="alphaev69" ;;
"EV7 (21364)")
UNAME_MACHINE="alphaev7" ;;
"EV7.9 (21364A)")
UNAME_MACHINE="alphaev79" ;;
esac
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
exit 0 ;;
Alpha*:OpenVMS:*:*)
echo alpha-hp-vms
exit 0 ;;
Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead
# of the specific Alpha model?
echo alpha-pc-interix
exit 0 ;;
21064:Windows_NT:50:3)
echo alpha-dec-winnt3.5
exit 0 ;;
Amiga*:UNIX_System_V:4.0:*)
echo m68k-unknown-sysv4
exit 0;;
*:[Aa]miga[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-amigaos
exit 0 ;;
*:[Mm]orph[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-morphos
exit 0 ;;
*:OS/390:*:*)
echo i370-ibm-openedition
exit 0 ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit 0;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
exit 0;;
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
if test "`(/bin/universe) 2>/dev/null`" = att ; then
echo pyramid-pyramid-sysv3
else
echo pyramid-pyramid-bsd
fi
exit 0 ;;
NILE*:*:*:dcosx)
echo pyramid-pyramid-svr4
exit 0 ;;
DRS?6000:unix:4.0:6*)
echo sparc-icl-nx6
exit 0 ;;
DRS?6000:UNIX_SV:4.2*:7*)
case `/usr/bin/uname -p` in
sparc) echo sparc-icl-nx7 && exit 0 ;;
esac ;;
sun4H:SunOS:5.*:*)
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
i86pc:SunOS:5.*:*)
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
sun4*:SunOS:*:*)
case "`/usr/bin/arch -k`" in
Series*|S4*)
UNAME_RELEASE=`uname -v`
;;
esac
# Japanese Language versions have a version number like `4.1.3-JL'.
echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
exit 0 ;;
sun3*:SunOS:*:*)
echo m68k-sun-sunos${UNAME_RELEASE}
exit 0 ;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
case "`/bin/arch`" in
sun3)
echo m68k-sun-sunos${UNAME_RELEASE}
;;
sun4)
echo sparc-sun-sunos${UNAME_RELEASE}
;;
esac
exit 0 ;;
aushp:SunOS:*:*)
echo sparc-auspex-sunos${UNAME_RELEASE}
exit 0 ;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
# "atarist" or "atariste" at least should have a processor
# > m68000). The system name ranges from "MiNT" over "FreeMiNT"
# to the lowercase version "mint" (or "freemint"). Finally
# the system name "TOS" denotes a system which is actually not
# MiNT. But MiNT is downward compatible to TOS, so this should
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit 0 ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit 0 ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit 0 ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
echo m68k-milan-mint${UNAME_RELEASE}
exit 0 ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
echo m68k-hades-mint${UNAME_RELEASE}
exit 0 ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
echo m68k-unknown-mint${UNAME_RELEASE}
exit 0 ;;
powerpc:machten:*:*)
echo powerpc-apple-machten${UNAME_RELEASE}
exit 0 ;;
RISC*:Mach:*:*)
echo mips-dec-mach_bsd4.3
exit 0 ;;
RISC*:ULTRIX:*:*)
echo mips-dec-ultrix${UNAME_RELEASE}
exit 0 ;;
VAX*:ULTRIX*:*:*)
echo vax-dec-ultrix${UNAME_RELEASE}
exit 0 ;;
2020:CLIX:*:* | 2430:CLIX:*:*)
echo clipper-intergraph-clix${UNAME_RELEASE}
exit 0 ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#ifdef __cplusplus
#include /* for printf() prototype */
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
#endif
#if defined (host_mips) && defined (MIPSEB)
#if defined (SYSTYPE_SYSV)
printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_SVR4)
printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
#endif
#endif
exit (-1);
}
EOF
$CC_FOR_BUILD -o $dummy $dummy.c \
&& $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
&& exit 0
echo mips-mips-riscos${UNAME_RELEASE}
exit 0 ;;
Motorola:PowerMAX_OS:*:*)
echo powerpc-motorola-powermax
exit 0 ;;
Motorola:*:4.3:PL8-*)
echo powerpc-harris-powermax
exit 0 ;;
Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
echo powerpc-harris-powermax
exit 0 ;;
Night_Hawk:Power_UNIX:*:*)
echo powerpc-harris-powerunix
exit 0 ;;
m88k:CX/UX:7*:*)
echo m88k-harris-cxux7
exit 0 ;;
m88k:*:4*:R4*)
echo m88k-motorola-sysv4
exit 0 ;;
m88k:*:3*:R3*)
echo m88k-motorola-sysv3
exit 0 ;;
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
then
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
[ ${TARGET_BINARY_INTERFACE}x = x ]
then
echo m88k-dg-dgux${UNAME_RELEASE}
else
echo m88k-dg-dguxbcs${UNAME_RELEASE}
fi
else
echo i586-dg-dgux${UNAME_RELEASE}
fi
exit 0 ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
exit 0 ;;
M88*:*:R3*:*)
# Delta 88k system running SVR3
echo m88k-motorola-sysv3
exit 0 ;;
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
echo m88k-tektronix-sysv3
exit 0 ;;
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
echo m68k-tektronix-bsd
exit 0 ;;
*:IRIX*:*:*)
echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
exit 0 ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
i*86:AIX:*:*)
echo i386-ibm-aix
exit 0 ;;
ia64:AIX:*:*)
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
exit 0 ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include
main()
{
if (!__power_pc())
exit(1);
puts("powerpc-ibm-aix3.2.5");
exit(0);
}
EOF
$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
echo rs6000-ibm-aix3.2.5
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
echo rs6000-ibm-aix3.2.4
else
echo rs6000-ibm-aix3.2
fi
exit 0 ;;
*:AIX:*:[45])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
fi
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${IBM_ARCH}-ibm-aix${IBM_REV}
exit 0 ;;
*:AIX:*:*)
echo rs6000-ibm-aix
exit 0 ;;
ibmrt:4.4BSD:*|romp-ibm:BSD:*)
echo romp-ibm-bsd4.4
exit 0 ;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
exit 0 ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
echo rs6000-bull-bosx
exit 0 ;;
DPX/2?00:B.O.S.:*:*)
echo m68k-bull-sysv3
exit 0 ;;
9000/[34]??:4.3bsd:1.*:*)
echo m68k-hp-bsd
exit 0 ;;
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
echo m68k-hp-bsd4.4
exit 0 ;;
9000/[34678]??:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
case "${UNAME_MACHINE}" in
9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
if [ -x /usr/bin/getconf ]; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case "${sc_cpu_version}" in
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0
case "${sc_kernel_bits}" in
32) HP_ARCH="hppa2.0n" ;;
64) HP_ARCH="hppa2.0w" ;;
'') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
esac ;;
esac
fi
if [ "${HP_ARCH}" = "" ]; then
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#define _HPUX_SOURCE
#include
#include
int main ()
{
#if defined(_SC_KERNEL_BITS)
long bits = sysconf(_SC_KERNEL_BITS);
#endif
long cpu = sysconf (_SC_CPU_VERSION);
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
case CPU_PA_RISC2_0:
#if defined(_SC_KERNEL_BITS)
switch (bits)
{
case 64: puts ("hppa2.0w"); break;
case 32: puts ("hppa2.0n"); break;
default: puts ("hppa2.0"); break;
} break;
#else /* !defined(_SC_KERNEL_BITS) */
puts ("hppa2.0"); break;
#endif
default: puts ("hppa1.0"); break;
}
exit (0);
}
EOF
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
test -z "$HP_ARCH" && HP_ARCH=hppa
fi ;;
esac
if [ ${HP_ARCH} = "hppa2.0w" ]
then
# avoid double evaluation of $set_cc_for_build
test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
then
HP_ARCH="hppa2.0w"
else
HP_ARCH="hppa64"
fi
fi
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit 0 ;;
ia64:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ia64-hp-hpux${HPUX_REV}
exit 0 ;;
3050*:HI-UX:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include
int
main ()
{
long cpu = sysconf (_SC_CPU_VERSION);
/* The order matters, because CPU_IS_HP_MC68K erroneously returns
true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
results, however. */
if (CPU_IS_PA_RISC (cpu))
{
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
default: puts ("hppa-hitachi-hiuxwe2"); break;
}
}
else if (CPU_IS_HP_MC68K (cpu))
puts ("m68k-hitachi-hiuxwe2");
else puts ("unknown-hitachi-hiuxwe2");
exit (0);
}
EOF
$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
echo unknown-hitachi-hiuxwe2
exit 0 ;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
echo hppa1.1-hp-bsd
exit 0 ;;
9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd
exit 0 ;;
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
echo hppa1.0-hp-mpeix
exit 0 ;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
echo hppa1.1-hp-osf
exit 0 ;;
hp8??:OSF1:*:*)
echo hppa1.0-hp-osf
exit 0 ;;
i*86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then
echo ${UNAME_MACHINE}-unknown-osf1mk
else
echo ${UNAME_MACHINE}-unknown-osf1
fi
exit 0 ;;
parisc*:Lites*:*:*)
echo hppa1.1-hp-lites
exit 0 ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
exit 0 ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit 0 ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
echo c34-convex-bsd
exit 0 ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
echo c38-convex-bsd
exit 0 ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd
exit 0 ;;
CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*[A-Z]90:*:*:*)
echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*T3E:*:*:*)
echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*SV1:*:*:*)
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
*:UNICOS/mp:*:*)
echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit 0 ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit 0 ;;
sparc*:BSD/OS:*:*)
echo sparc-unknown-bsdi${UNAME_RELEASE}
exit 0 ;;
*:BSD/OS:*:*)
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit 0 ;;
*:FreeBSD:*:*|*:GNU/FreeBSD:*:*)
# Determine whether the default compiler uses glibc.
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include
#if __GLIBC__ >= 2
LIBC=gnu
#else
LIBC=
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
exit 0 ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
exit 0 ;;
i*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit 0 ;;
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit 0 ;;
x86:Interix*:[34]*)
echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
exit 0 ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
exit 0 ;;
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
# UNAME_MACHINE based on the output of uname instead of i386?
echo i586-pc-interix
exit 0 ;;
i*:UWIN*:*)
echo ${UNAME_MACHINE}-pc-uwin
exit 0 ;;
p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin
exit 0 ;;
prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
*:GNU:*:*)
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit 0 ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit 0 ;;
arm*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
cris:Linux:*:*)
echo cris-axis-linux-gnu
exit 0 ;;
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-${VENDOR:-unknown}-linux-gnu
exit 0 ;;
m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
mips:Linux:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#undef CPU
#undef mips
#undef mipsel
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
CPU=mipsel
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
CPU=mips
#else
CPU=
#endif
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
;;
mips64:Linux:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#undef CPU
#undef mips64
#undef mips64el
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
CPU=mips64el
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
CPU=mips64
#else
CPU=
#endif
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
;;
ppc:Linux:*:*)
echo powerpc-${VENDOR:-unknown}-linux-gnu
exit 0 ;;
ppc64:Linux:*:*)
echo powerpc64-${VENDOR:-unknown}-linux-gnu
exit 0 ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
EV5) UNAME_MACHINE=alphaev5 ;;
EV56) UNAME_MACHINE=alphaev56 ;;
PCA56) UNAME_MACHINE=alphapca56 ;;
PCA57) UNAME_MACHINE=alphapca56 ;;
EV6) UNAME_MACHINE=alphaev6 ;;
EV67) UNAME_MACHINE=alphaev67 ;;
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
exit 0 ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
PA7*) echo hppa1.1-unknown-linux-gnu ;;
PA8*) echo hppa2.0-unknown-linux-gnu ;;
*) echo hppa-unknown-linux-gnu ;;
esac
exit 0 ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
echo hppa64-unknown-linux-gnu
exit 0 ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-${VENDOR:-ibm}-linux-gnu
exit 0 ;;
sh64*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
sh*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
x86_64:Linux:*:*)
echo x86_64-${VENDOR:-unknown}-linux-gnu
exit 0 ;;
i*86:Linux:*:*)
# The BFD linker knows what the default object file format is, so
# first see if it will tell us. cd to the root directory to prevent
# problems with other programs or directories called `ld' in the path.
# Set LC_ALL=C to ensure ld outputs messages in English.
ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
| sed -ne '/supported targets:/!d
s/[ ][ ]*/ /g
s/.*supported targets: *//
s/ .*//
p'`
case "$ld_supported_targets" in
elf32-i386)
TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
;;
a.out-i386-linux)
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
exit 0 ;;
coff-i386)
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
exit 0 ;;
"")
# Either a pre-BFD a.out linker (linux-gnuoldld) or
# one that does not give us useful --help.
echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
exit 0 ;;
esac
# Determine whether the default compiler is a.out or elf
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include
#ifdef __ELF__
# ifdef __GLIBC__
# if __GLIBC__ >= 2
LIBC=gnu
# else
LIBC=gnulibc1
# endif
# else
LIBC=gnulibc1
# endif
#else
#ifdef __INTEL_COMPILER
LIBC=gnu
#else
LIBC=gnuaout
#endif
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
test x"${LIBC}" != x && echo "${UNAME_MACHINE}-${VENDOR:-pc}-linux-${LIBC}" && exit 0
test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
# earlier versions are messed up and put the nodename in both
# sysname and nodename.
echo i386-sequent-sysv4
exit 0 ;;
i*86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
# I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit 0 ;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
echo ${UNAME_MACHINE}-pc-os2-emx
exit 0 ;;
i*86:XTS-300:*:STOP)
echo ${UNAME_MACHINE}-unknown-stop
exit 0 ;;
i*86:atheos:*:*)
echo ${UNAME_MACHINE}-unknown-atheos
exit 0 ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
i*86:*DOS:*:*)
echo ${UNAME_MACHINE}-pc-msdosdjgpp
exit 0 ;;
i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
else
echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
fi
exit 0 ;;
i*86:*:5:[78]*)
case `/bin/uname -X | grep "^Machine"` in
*486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac
echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
exit 0 ;;
i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then
UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586
(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
&& UNAME_MACHINE=i686
(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
&& UNAME_MACHINE=i686
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
else
echo ${UNAME_MACHINE}-pc-sysv32
fi
exit 0 ;;
pc:*:*:*)
# Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i386.
echo i386-pc-msdosdjgpp
exit 0 ;;
Intel:Mach:3*:*)
echo i386-pc-mach3
exit 0 ;;
paragon:*:*:*)
echo i860-intel-osf1
exit 0 ;;
i860:*:4.*:*) # i860-SVR4
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered.
echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
fi
exit 0 ;;
mini*:CTIX:SYS*5:*)
# "miniframe"
echo m68010-convergent-sysv
exit 0 ;;
mc68k:UNIX:SYSTEM5:3.51m)
echo m68k-convergent-sysv
exit 0 ;;
M680?0:D-NIX:5.3:*)
echo m68k-diab-dnix
exit 0 ;;
M68*:*:R3V[567]*:*)
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& echo i486-ncr-sysv4.3${OS_REL} && exit 0
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& echo i486-ncr-sysv4 && exit 0 ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
echo m68k-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit 0 ;;
TSUNAMI:LynxOS:2.*:*)
echo sparc-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
rs6000:LynxOS:2.*:*)
echo rs6000-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
echo powerpc-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
SM[BE]S:UNIX_SV:*:*)
echo mips-dde-sysv${UNAME_RELEASE}
exit 0 ;;
RM*:ReliantUNIX-*:*:*)
echo mips-sni-sysv4
exit 0 ;;
RM*:SINIX-*:*:*)
echo mips-sni-sysv4
exit 0 ;;
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
UNAME_MACHINE=`(uname -p) 2>/dev/null`
echo ${UNAME_MACHINE}-sni-sysv4
else
echo ns32k-sni-sysv
fi
exit 0 ;;
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says
echo i586-unisys-sysv4
exit 0 ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes .
# How about differentiating between stratus architectures? -djm
echo hppa1.1-stratus-sysv4
exit 0 ;;
*:*:*:FTX*)
# From seanf@swdc.stratus.com.
echo i860-stratus-sysv4
exit 0 ;;
*:VOS:*:*)
# From Paul.Green@stratus.com.
echo hppa1.1-stratus-vos
exit 0 ;;
mc68*:A/UX:*:*)
echo m68k-apple-aux${UNAME_RELEASE}
exit 0 ;;
news*:NEWS-OS:6*:*)
echo mips-sony-newsos6
exit 0 ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}
else
echo mips-unknown-sysv${UNAME_RELEASE}
fi
exit 0 ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
echo powerpc-be-beos
exit 0 ;;
BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
echo powerpc-apple-beos
exit 0 ;;
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
echo i586-pc-beos
exit 0 ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
exit 0 ;;
SX-5:SUPER-UX:*:*)
echo sx5-nec-superux${UNAME_RELEASE}
exit 0 ;;
SX-6:SUPER-UX:*:*)
echo sx6-nec-superux${UNAME_RELEASE}
exit 0 ;;
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
*:Rhapsody:*:*)
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
*:Darwin:*:*)
case `uname -p` in
*86) UNAME_PROCESSOR=i686 ;;
powerpc) UNAME_PROCESSOR=powerpc ;;
esac
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
exit 0 ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
if test "$UNAME_PROCESSOR" = "x86"; then
UNAME_PROCESSOR=i386
UNAME_MACHINE=pc
fi
echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
exit 0 ;;
*:QNX:*:4*)
echo i386-pc-qnx
exit 0 ;;
NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE}
exit 0 ;;
*:NonStop-UX:*:*)
echo mips-compaq-nonstopux
exit 0 ;;
BS2000:POSIX*:*:*)
echo bs2000-siemens-sysv
exit 0 ;;
DS/*:UNIX_System_V:*:*)
echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
exit 0 ;;
*:Plan9:*:*)
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
# operating systems.
if test "$cputype" = "386"; then
UNAME_MACHINE=i386
else
UNAME_MACHINE="$cputype"
fi
echo ${UNAME_MACHINE}-unknown-plan9
exit 0 ;;
*:TOPS-10:*:*)
echo pdp10-unknown-tops10
exit 0 ;;
*:TENEX:*:*)
echo pdp10-unknown-tenex
exit 0 ;;
KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
echo pdp10-dec-tops20
exit 0 ;;
XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
echo pdp10-xkl-tops20
exit 0 ;;
*:TOPS-20:*:*)
echo pdp10-unknown-tops20
exit 0 ;;
*:ITS:*:*)
echo pdp10-unknown-its
exit 0 ;;
SEI:*:*:SEIUX)
echo mips-sei-seiux${UNAME_RELEASE}
exit 0 ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
eval $set_cc_for_build
cat >$dummy.c <
# include
#endif
main ()
{
#if defined (sony)
#if defined (MIPSEB)
/* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
I don't know.... */
printf ("mips-sony-bsd\n"); exit (0);
#else
#include
printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
"4"
#else
""
#endif
); exit (0);
#endif
#endif
#if defined (__arm) && defined (__acorn) && defined (__unix)
printf ("arm-acorn-riscix"); exit (0);
#endif
#if defined (hp300) && !defined (hpux)
printf ("m68k-hp-bsd\n"); exit (0);
#endif
#if defined (NeXT)
#if !defined (__ARCHITECTURE__)
#define __ARCHITECTURE__ "m68k"
#endif
int version;
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
if (version < 4)
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
else
printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
exit (0);
#endif
#if defined (MULTIMAX) || defined (n16)
#if defined (UMAXV)
printf ("ns32k-encore-sysv\n"); exit (0);
#else
#if defined (CMU)
printf ("ns32k-encore-mach\n"); exit (0);
#else
printf ("ns32k-encore-bsd\n"); exit (0);
#endif
#endif
#endif
#if defined (__386BSD__)
printf ("i386-pc-bsd\n"); exit (0);
#endif
#if defined (sequent)
#if defined (i386)
printf ("i386-sequent-dynix\n"); exit (0);
#endif
#if defined (ns32000)
printf ("ns32k-sequent-dynix\n"); exit (0);
#endif
#endif
#if defined (_SEQUENT_)
struct utsname un;
uname(&un);
if (strncmp(un.version, "V2", 2) == 0) {
printf ("i386-sequent-ptx2\n"); exit (0);
}
if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
printf ("i386-sequent-ptx1\n"); exit (0);
}
printf ("i386-sequent-ptx\n"); exit (0);
#endif
#if defined (vax)
# if !defined (ultrix)
# include
# if defined (BSD)
# if BSD == 43
printf ("vax-dec-bsd4.3\n"); exit (0);
# else
# if BSD == 199006
printf ("vax-dec-bsd4.3reno\n"); exit (0);
# else
printf ("vax-dec-bsd\n"); exit (0);
# endif
# endif
# else
printf ("vax-dec-bsd\n"); exit (0);
# endif
# else
printf ("vax-dec-ultrix\n"); exit (0);
# endif
#endif
#if defined (alliant) && defined (i860)
printf ("i860-alliant-bsd\n"); exit (0);
#endif
exit (1);
}
EOF
$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
# Apollos put the system type in the environment.
test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
# Convex versions that predate uname can use getsysinfo(1)
if [ -x /usr/convex/getsysinfo ]
then
case `getsysinfo -f cpu_type` in
c1*)
echo c1-convex-bsd
exit 0 ;;
c2*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit 0 ;;
c34*)
echo c34-convex-bsd
exit 0 ;;
c38*)
echo c38-convex-bsd
exit 0 ;;
c4*)
echo c4-convex-bsd
exit 0 ;;
esac
fi
cat >&2 < in order to provide the needed
information to handle your system.
config.guess timestamp = $timestamp
uname -m = `(uname -m) 2>/dev/null || echo unknown`
uname -r = `(uname -r) 2>/dev/null || echo unknown`
uname -s = `(uname -s) 2>/dev/null || echo unknown`
uname -v = `(uname -v) 2>/dev/null || echo unknown`
/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
hostinfo = `(hostinfo) 2>/dev/null`
/bin/universe = `(/bin/universe) 2>/dev/null`
/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
/bin/arch = `(/bin/arch) 2>/dev/null`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
UNAME_MACHINE = ${UNAME_MACHINE}
UNAME_RELEASE = ${UNAME_RELEASE}
UNAME_SYSTEM = ${UNAME_SYSTEM}
UNAME_VERSION = ${UNAME_VERSION}
EOF
exit 1
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:
dnsval-2.0/configure.in 0000664 0002372 0002372 00000061046 12110747121 015306 0 ustar hardaker hardaker dnl Process this file with autoconf to produce a configure script.
dnl
dnl provide it a file to simply check for its existence.
AC_INIT([dnssec-tools-validator], [0.3], [dnssec-tools-users@dnssec-tools.org])
AC_PREREQ([2.59])
AC_CONFIG_HEADER(include/validator/validator-config.h)
AC_MSG_CACHE_INIT()
if test "x$cache_file" = "x/dev/null" ; then
CONFIG_CACHE_FILE=""
else
CONFIG_CACHE_FILE=$cache_file
fi
AC_SUBST(CONFIG_CACHE_FILE)
AC_PATH_PROG([PERLPROG],perl)
AC_PATH_PROG(AR, ar)
AC_PATH_PROG(RM, rm)
AC_PATH_PROG(CP, cp)
# libtool info
# AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
# useful stuff for installation
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
# system check
AC_CANONICAL_TARGET
#
# save the configure arguments
#
AC_DEFINE_UNQUOTED(LIBVAL_CONFIGURE_OPTIONS,"$ac_configure_args", [Configure options])
CONFIGURE_OPTIONS="\"$ac_configure_args\""
AC_SUBST(CONFIGURE_OPTIONS)
########################################
# add in -Dsolaris2, -Dlinux, etc as needed
changequote(, )
PARTIALTARGETOS=`echo $target_os | sed 's/[-._].*//'`
changequote([, ])
#
# Check whether we can use -Ux -Dx=x with the expected behaviour
#
AC_MSG_CHECKING([whether to un-define target system token (before redefining)])
OLD_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="-U$PARTIALTARGETOS -D$PARTIALTARGETOS=$PARTIALTARGETOS"
AC_EGREP_CPP(yes,[[
#ifdef $PARTIALTARGETOS
yes
#endif
]],
[PARTIALTARGETFLAGS="-U$PARTIALTARGETOS -D$PARTIALTARGETOS=$PARTIALTARGETOS"
AC_MSG_RESULT([yes])],
[PARTIALTARGETFLAGS="-D$PARTIALTARGETOS=$PARTIALTARGETOS"
AC_MSG_RESULT([no])])
CFLAGS="$CFLAGS $PARTIALTARGETFLAGS"
CPPFLAGS="$OLD_CPPFLAGS"
CFLAGS="$CFLAGS $PARTIALTARGETFLAGS"
dnl ----------------------------------------------------------------------
AC_MSG_CHECKING([for developer gcc flags])
DEVFLAGS=""
if test -d $srcdir/.svn; then
# disable --enable-shared by default in cvs/developer cases.
# don't do anything if option set via cmdline
if test "${enable_shared+set}" != set; then
enable_shared=no
fi
if test "x$GCC" = "xyes"; then
DEVFLAGS="-Wall -Winline -Wstrict-prototypes -Wwrite-strings -Wcast-qual -Wno-char-subscripts"
fi
fi
AC_MSG_RESULT($DEVFLAGS)AC_SUBST(DEVFLAGS)
AC_MSG_CACHE_ADD(Developer flags : $DEVFLAGS)
dnl ----------------------------------------------------------------------
# for some reason $prefix is NONE until much later in the script, so
# fix up val_sysconfdir if no prefix or sysconfdir was specified
val_sysconfdir=`eval echo $sysconfdir`
if test "x$val_sysconfdir" = "xNONE/etc" ; then
val_sysconfdir="${ac_default_prefix}/etc"
fi
val_sysconfdir=`eval echo $sysconfdir`
if test "x$val_sysconfdir" = "xNONE/etc" ; then
val_sysconfdir="${ac_default_prefix}/etc"
fi
AC_MSG_CACHE_ADD(system configuration directory : $val_sysconfdir)
AH_TEMPLATE([VAL_RESOLV_CONF], [Path to resolver configuration])
AC_ARG_WITH(resolv-conf,
[ --with-resolv-conf=FILE resolver config file (SYSCONFDIR/resolv.conf).],
[ac_cv_user_prompt_VAL_RESOLV_CONF=$with_resolv_conf])
AH_TEMPLATE([VAL_ROOT_HINTS], [Path to root hints config file])
AC_ARG_WITH(root-hints,
[ --with-root-hints=FILE root.hints config file.],
[ac_cv_user_prompt_VAL_ROOT_HINTS=$with_root_hints])
VAL_CONFIGURATION_FILE=$val_sysconfdir/dnssec-tools/dnsval.conf
AC_ARG_WITH(dnsval-conf,
[ --with-dnsval-conf=FILE dnsval config file (SYSCONFDIR/dnssec-tools/dnsval.conf).],
[VAL_CONFIGURATION_FILE=$with_dnsval_conf])
AC_DEFINE_UNQUOTED(VAL_CONFIGURATION_FILE,"$VAL_CONFIGURATION_FILE", [dnsval configuration file])
AC_SUBST(VAL_CONFIGURATION_FILE)
AC_MSG_CACHE_ADD(Validator configuration file : $VAL_CONFIGURATION_FILE)
VALIDATOR_TESTCASES=$val_sysconfdir/dnssec-tools/validator-testcases
AC_ARG_WITH(validator-testcases-file,
[ --with-validator-testcases-file=FILE dnsval config file (SYSCONFDIR/dnssec-tools/dnsval.conf).],
[VALIDATOR_TESTCASES=$with_validator_testcases_file])
AC_DEFINE_UNQUOTED(VALIDATOR_TESTCASES,"$VALIDATOR_TESTCASES", [validator testcases configuration file])
AC_SUBST(VALIDATOR_TESTCASES)
dnl ----------------------------------------------------------------------
dnl
#
# otherwise prompted information
#
AC_ARG_WITH(defaults,
[
Miscellaneous:
--with-defaults Use defaults for prompted values.],
defaults="yes",defaults="no")
AC_ARG_ENABLE(defaults,,
AC_MSG_ERROR([ Invalid option. Use --with-defaults/--without-defaults instead ]) )
if test "$defaults" = "yes" ; then
if test "${with_resolv_conf+set}" != set; then
unset ac_cv_user_prompt_VAL_RESOLV_CONF
fi
if test "${with_root_hints+set}" != set; then
unset ac_cv_user_prompt_VAL_ROOT_HINTS
fi
fi
dnl ----------------------------------------------------------------------
dnl
AC_ARG_WITH(cflags,
[ --with-cflags=CFLAGS use CFLAGS as compile time arguments.],
[CFLAGS=$with_cflags; export CFLAGS])
CFLAGS="$CFLAGS -DLIBVAL_CONFIGURED=1"
case $target_os in
solaris*)
AC_MSG_CHECKING([whether we need _REENTRANT for str*_r])
AC_MSG_RESULT([yes])
CFLAGS="$CFLAGS -D_REENTRANT"
;;
mingw32*)
_WIN32_MSVC=1
SKIP_SYSTEM_CHECKS=1
LDFLAGS="$LDFLAGS -Wl,--enable-stdcall-fixup"
;;
*)
;;
esac
dnl ----------------------------------------------------------------------
dnl
AH_TEMPLATE([LIBVAL_NSEC3], [Define if NSEC3 is required.])
AC_ARG_WITH(nsec3,
[ --without-nsec3 Disable nsec3 support.],
nsec3="$withval", nsec3="yes")
AC_ARG_ENABLE(nsec3,,
AC_MSG_ERROR([ Invalid option. Use --with-nsec3/--without-nsec3 instead ]) )
if test "$nsec3" != "no"; then
AC_DEFINE(LIBVAL_NSEC3, 1)
AC_MSG_CACHE_ADD(NSEC3 support : Yes)
else
AC_MSG_CACHE_ADD(NSEC3 support : No)
fi
dnl ----------------------------------------------------------------------
dnl
AH_TEMPLATE([LIBVAL_DLV], [Define if DLV is required.])
AC_ARG_WITH(dlv,
[ --without-dlv Disable DLV support.],
dlv="$withval", dlv="yes")
AC_ARG_ENABLE(dlv,,
AC_MSG_ERROR([ Invalid option. Use --with-dlv/--without-dlv instead ]) )
if test "$dlv" != "no"; then
AC_DEFINE(LIBVAL_DLV, 1)
AC_MSG_CACHE_ADD(DLV support : Yes)
else
AC_MSG_CACHE_ADD(DLV support : No)
fi
dnl ----------------------------------------------------------------------
dnl
AH_TEMPLATE([VAL_IPV6], [Define if IPV6 is required.])
AC_ARG_WITH(ipv6,
[ --without-ipv6 Disable IPv6 support.],
ipv6="$withval", ipv6="yes")
AC_ARG_ENABLE(ipv6,,
AC_MSG_ERROR([ Invalid option. Use --with-ipv6/--without-ipv6 instead ]) )
if test "$ipv6" != "no"; then
AC_DEFINE(VAL_IPV6, 1)
AC_MSG_CACHE_ADD(IPv6 support : Yes)
else
AC_MSG_CACHE_ADD(IPv6 support : No)
fi
dnl ----------------------------------------------------------------------
dnl openssl
dnl
AC_ARG_WITH(openssl,
[ --with-openssl=PATH Look for openssl in PATH/{lib,include}.],
if test "x$withval" != "xyes"; then
opensslpathset=1
AC_ADD_SEARCH_PATH($withval)
fi
)
dnl openssl defaults to /usr/local/ssl, so add it to the search path.
if test "x$opensslpathset" != "x1"; then
case $build_os in
mingw32*)
AC_ADD_SEARCH_PATH(/c/OpenSSL-Win32)
;;
*)
AC_ADD_SEARCH_PATH(/usr/local/ssl)
;;
esac
fi
AC_ARG_ENABLE(openssl,,
AC_MSG_ERROR([ Invalid option. Use --with-openssl/--without-openssl instead ]) )
AC_ARG_WITH(ssl,,
AC_MSG_ERROR([ Invalid option. Use --with-openssl/--without-openssl instead ]) )
AC_ARG_ENABLE(ssl,,
AC_MSG_ERROR([ Invalid option. Use --with-openssl/--without-openssl instead ]) )
AC_SEARCH_LIBS(SSL_get_SSL_CTX, [ssl],,
AC_MSG_ERROR("OpenSSL ssl library not found. get it from http://www.openssl.org."),
[-lcrypto])
AC_SUBST(LIBS)
AC_SEARCH_LIBS(EVP_md5, [crypto eay32 libeay32 crypt32],,
AC_MSG_ERROR("OpenSSL crypto library not found. get it from http://www.openssl.org."))
AH_TEMPLATE([HAVE_SHA_2],
[Define if libcrypto implements the SHA-2 suite of algorithms.])
AC_ARG_ENABLE([sha2-check],
AS_HELP_STRING([--disable-sha2-check],
[Make missing SHA-2 support a warning instead of an error.]))
AC_SEARCH_LIBS(SHA384_Init, [crypto eay32 libeay32 crypt32], AC_DEFINE(HAVE_SHA_2),
AS_IF([test "x$enable_sha2_check" != "xno"],
[AC_MSG_ERROR(Need openssl version > 0.9.8 for SHA-2 support. Use --disable-sha2-check to bypass this error.)],
[AC_MSG_WARN(Need openssl version > 0.9.8 for SHA-2 support.)]))
AC_SUBST(LIBS)
AC_CHECK_HEADERS(crypto/sha2.h openssl/ecdsa.h)
dnl ----------------------------------------------------------------------
AC_ARG_WITH(threads,
[ --without-threads Don't use threads.])
LIBVAL_SUFFIX=""
AH_TEMPLATE([VAL_NO_THREADS],
[Define if you do not want to use threads.])
if test "x$with_threads" = "xno"; then
AC_DEFINE(VAL_NO_THREADS, 1)
AC_MSG_CACHE_ADD(Thread support : No)
else
AC_CHECK_LIB(pthread, pthread_rwlock_init,
[LIBS="$LIBS -lpthread"
LIBVAL_SUFFIX="-threads"
AC_MSG_CACHE_ADD(Thread support : Yes)],
[AC_DEFINE(VAL_NO_THREADS, 1)
AC_MSG_CACHE_ADD(Thread support : No)])
fi
AC_SUBST(LIBS)
AC_SUBST(LIBVAL_SUFFIX)
dnl ----------------------------------------------------------------------
dnl
if test ! -z "$_WIN32_MSVC"; then
LIBS="$LIBS -lgdi32 -lws2_32"
AC_SUBST(LIBS)
fi
dnl ----------------------------------------------------------------------
AC_CHECK_HEADERS(sys/param.h sys/types.h sys/ioctl.h sys/socket.h sys/filio.h sys/file.h sys/fcntl.h netinet/in.h sys/time.h ctype.h getopt.h libgen.h limits.h pthread.h syslog.h)
AC_CHECK_HEADERS(net/if.h ifaddrs.h,,, [
#ifdef HAVE_SYS_TYPES_H
#include
#endif
#ifdef HAVE_SYS_SOCKET_H
#include
#endif])
AC_CHECK_DECLS([getopt_long_only, getopt_long],,,[
#ifdef HAVE_UNISTD_H
#include
#endif
#ifdef HAVE_GETOPT_H
#include
#endif
])
dnl ----------------------------------------------------------------------
AC_CHECK_HEADERS(arpa/nameser.h arpa/nameser_compat.h arpa/inet.h endian.h resolv.h netdb.h errno.h)
AC_CACHE_CHECK(for struct HEADER in arpa/nameser.h and arpa/nameser_compat.h,
ac_cv_nameser_has_header,
[AC_EGREP_CPP(HEADER, [
#ifdef HAVE_ARPA_NAMESER_H
#include
#endif
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
#include
#endif
], ac_cv_nameser_has_header="yes", ac_cv_nameser_has_header="no")])
if test "x$ac_cv_nameser_has_header" = "xyes" ; then
AC_DEFINE([NAMESER_HAS_HEADER], 1, [Define if has HEADER. ])
fi
AC_CHECK_STRUCT_FOR([
#ifdef HAVE_SYS_TYPES_H
#include
#endif
#ifdef HAVE_ARPA_NAMESER_H
#include
#endif
], __ns_msg, _msg_ptr, no)
AH_TEMPLATE([STRUCT___NS_MSG_HAS__MSG_PTR],
[Define if struct __ns_msg had _msg_ptr.])
AC_CHECK_STRUCT_FOR([
#ifdef HAVE_SYS_TYPES_H
#include
#endif
#ifdef HAVE_ARPA_NAMESER_H
#include
#endif
], __ns_msg, _ptr, no)
AH_TEMPLATE([STRUCT___NS_MSG_HAS__PTR],
[Define if struct __ns_msg had _ptr.])
AC_CHECK_TYPES([ns_cert_types],,,[
#ifdef HAVE_SYS_TYPES_H
#include
#endif
#ifdef HAVE_ARPA_NAMESER_H
#include
#endif
])
dnl check for varios ns_* decls (record types or functions)
AC_CHECK_DECLS([ns_t_a,ns_t_kx,ns_r_badsig,ns_parse_ttl,ns_name_pton,ns_name_unpack,ns_name_ntop,ns_samename,ns_t_aaaa,ns_t_dnskey,ns_t_rrsig,ns_t_nsec,ns_t_nsec3,ns_t_dlv,ns_t_ds,ns_t_tlsa],,,[
#ifdef HAVE_SYS_TYPES_H
#include
#endif
#ifdef HAVE_ARPA_NAMESER_H
#include
#endif
])
AC_CHECK_DECLS([p_rcode,p_section],,,[
#ifdef HAVE_SYS_TYPES_H
#include
#endif
#if HAVE_NETINET_IN_H
#include
#endif
#ifdef HAVE_RESOLV_H
#include
#endif
])
AC_CHECK_DECLS([struct addrinfo])
dnl ---------------------------------------------------------------------
found_gethostbyaddr=0
AH_TEMPLATE([GETHOSTBYADDR_USES_CHAR_INT], [Define if gethostbyaddr expects a char, int, int])
AC_MSG_CHECKING([for the proper gethostbyaddr prototype])
AC_TRY_LINK([
#ifdef HAVE_NETDB_H
#include
#endif
#ifdef HAVE_SYS_SOCKET_H
#include
#endif
],
[
struct hostent *gethostbyaddr(const char *addr, int len, int type);
/* or: gethostbyaddr(__const void *addr, socklen_t len, int type) */
int i = 1;
/* struct hostent *testit = gethostbyaddr("127.0.0.1", int len, int type) */
],[
AC_MSG_RESULT([char and int])
AC_DEFINE(GETHOSTBYADDR_USES_CHAR_INT, 1)
found_gethostbyaddr=1
], [
AC_MSG_RESULT([unknown])
]
)
if test $found_gethostbyaddr = 0 ; then
dnl ---------------------------------------------------------------------
AH_TEMPLATE([GETHOSTBYADDR_USES_VOID_SOCKLEN], [Define if gethostbyaddr expects void, socklen_t, int]
)
AC_MSG_CHECKING([for the proper gethostbyaddr prototype])
AC_TRY_LINK([
#ifdef HAVE_NETDB_H
#include
#endif
#ifdef HAVE_SYS_SOCKET_H
#include
#endif
],
[
struct hostent *gethostbyaddr(const void *addr, socklen_t len, int type);
int i = 1;
/* struct hostent *testit = gethostbyaddr("127.0.0.1", int len, int type) */
],[
AC_MSG_RESULT([void and socklen_t])
AC_DEFINE(GETHOSTBYADDR_USES_VOID_SOCKLEN, 1)
found_gethostbyaddr=1
], [
AC_MSG_RESULT([unknown])
]
)
fi
if test $found_gethostbyaddr = 0 ; then
dnl ---------------------------------------------------------------------
AH_TEMPLATE([GETHOSTBYADDR_USES_VOID_INT], [Define if gethostbyaddr expects void, int, int])
AC_MSG_CHECKING([for the proper gethostbyaddr prototype])
AC_TRY_LINK([
#ifdef HAVE_NETDB_H
#include
#endif
#ifdef HAVE_SYS_SOCKET_H
#include
#endif
],
[
struct hostent *gethostbyaddr(const void *addr, int len, int type);
int i = 1;
/* struct hostent *testit = gethostbyaddr("127.0.0.1", int len, int type) */
],[
AC_MSG_RESULT([void and int])
AC_DEFINE(GETHOSTBYADDR_USES_VOID_INT, 1)
found_gethostbyaddr=1
], [
AC_MSG_RESULT([unknown])
]
)
fi
dnl ---------------------------------------------------------------------
found_getnameinfo=0
AH_TEMPLATE([GETNAMEINFO_USES_SOCKLEN_AND_UINT], [Define if getnameinfo expects a socklen_t and a unsigned int])
AC_MSG_CHECKING([for the proper getnameinfo prototype])
AC_TRY_LINK([
#ifdef HAVE_NETDB_H
#include
#endif
#ifdef HAVE_SYS_SOCKET_H
#include
#endif
],
[
int getnameinfo(const struct sockaddr *sa,
socklen_t len, char *host,
socklen_t hostlen, char *serv, socklen_t servlen,
unsigned int flags);
int i = 1;
],[
AC_MSG_RESULT([socklen_t and uint])
AC_DEFINE(GETNAMEINFO_USES_SOCKLEN_AND_UINT, 1)
found_getnameinfo=1
], [
AC_MSG_RESULT([unknown])
]
)
if test $found_getnameinfo = 0 ; then
AH_TEMPLATE([GETNAMEINFO_USES_SOCKLEN_AND_INT], [Define if getnameinfo expects a socklen_t and an int])
AC_MSG_CHECKING([for the proper getnameinfo prototype])
AC_TRY_LINK([
#ifdef HAVE_NETDB_H
#include
#endif
#ifdef HAVE_SYS_SOCKET_H
#include
#endif
],
[
int getnameinfo(const struct sockaddr *sa, socklen_t len, char *host,
socklen_t hostlen, char *serv, socklen_t servlen,
int flags);
int i = 1;
],[
AC_MSG_RESULT([socklen_t and int])
AC_DEFINE(GETNAMEINFO_USES_SOCKLEN_AND_INT, 1)
found_getnameinfo=1
], [
AC_MSG_RESULT([unknown])
]
)
fi
if test $found_getnameinfo = 0 ; then
AH_TEMPLATE([GETNAMEINFO_USES_SIZET_AND_INT], [Define if getnameinfo expects a size_t and an int])
AC_MSG_CHECKING([for the proper getnameinfo prototype])
AC_TRY_LINK([
#ifdef HAVE_NETDB_H
#include
#endif
#ifdef HAVE_SYS_SOCKET_H
#include
#endif
],
[
int getnameinfo(const struct sockaddr *sa, socklen_t len, char *host,
size_t hostlen, char *serv, size_t servlen,
int flags);
int i = 1;
],[
AC_MSG_RESULT([size_t and int])
AC_DEFINE(GETNAMEINFO_USES_SIZET_AND_INT, 1)
found_getnameinfo=1
], [
AC_MSG_RESULT([unknown])
]
)
fi
AH_TEMPLATE([R_FUNCS_RETURN_STRUCT],
[Define if gethostbyname_r returns a struct hostent])
AC_MSG_CHECKING([whether gethostbyaddr_r returns an int or a struct hostent])
AC_TRY_LINK([
#ifdef HAVE_NETDB_H
#include
#endif
#ifdef HAVE_SYS_SOCKET_H
#include
#endif
],
[
struct hostent *
gethostbyname_r(const char * name,struct hostent * result_buf, char * buf,
int buflen, int * h_errnop);
int i = 1;
],[
AC_MSG_RESULT([hostent])
AC_DEFINE(R_FUNCS_RETURN_STRUCT, 1)
], [
AC_MSG_RESULT([int])
]
)
dnl ----------------------------------------------------------------------
dnl check for missing functions
dnl
AC_CHECK_FUNCS(strerror_r)
AC_CHECK_FUNCS(pselect)
AC_CHECK_FUNCS(gmtime_r)
AC_CHECK_FUNCS(strtok_r)
AC_CHECK_FUNCS(localtime_r)
AC_CHECK_FUNCS(flock)
AC_CHECK_FUNCS(inet_nsap_ntoa)
AC_CHECK_FUNCS(gethostbyname2)
AC_CHECK_FUNCS(hstrerror)
AC_CHECK_FUNCS(freeaddrinfo)
dnl ----------------------------------------------------------------------
case "$host" in
*-*-sunos4*)
AC_DEFINE(SPRINTF_CHAR, 1, [*s*printf() functions are char*]) ;;
esac
dnl ----------------------------------------------------------------------
dnl add any libraries that may be dependencies
AC_CHECK_LIB(nsl, inet_ntop)
dnl check for the socket library
AC_CHECK_LIB(socket, gai_strerror)
AC_SEARCH_LIBS(socket, socket)
dnl ----------------------------------------------------------------------
# Don't test following on windows
if test -z "$SKIP_SYSTEM_CHECKS"; then
AC_CHECK_FUNCS(snprintf)
AC_CHECK_FUNCS(strncasecmp)
AC_CHECK_FUNCS(gettimeofday)
fi # SKIP_SYSTEM_CHECKS
dnl ----------------------------------------------------------------------
AC_SUBST(LIBS)
dnl ----------------------------------------------------------------------
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_TYPES([int8_t, uint8_t, u_int8_t])
AC_CHECK_TYPES([int16_t, uint16_t, u_int16_t])
AC_CHECK_TYPES([int32_t, uint32_t, u_int32_t])
AC_CHECK_TYPES([u_char, u_short, u_long])
AC_CHECK_TYPES([size_t, ssize_t])
dnl ----------------------------------------------------------------------
AH_BOTTOM([
#include "validator/validator-compat.h"
])
dnl ----------------------------------------------------------------------
if test "x$ac_cv_user_prompt_VAL_RESOLV_CONF" = "x" -o "x$ac_cv_user_prompt_VAL_ROOT_HINTS" = "x" ; then
AC_CACHE_CHECK(if you have run configure before, ac_cv_have_warned,
[
if test "x$defaults" = "xno"; then
cat << EOF
************** Configuration Section **************
You are about to be prompted with a series of questions. Answer
them carefully, as they determine how the validator library and related
applications are to function.
After the configure script finishes, you can browse the newly
created include/validator/validator-config.h file for further - less
important - parameters to modify. Be careful if you re-run configure
though, since the file will be overwritten.
-Press return to continue-
EOF
read tmpinput
ac_cv_have_warned="yes"
echo $ECHO_N "disabling above prompt for future runs... $ECHO_C"
else
ac_cv_have_warned="no"
fi
])
else
ac_cv_have_warned="yes"
fi
AC_PROMPT_USER(VAL_RESOLV_CONF,[
*** Resolver configuration location:
Enter the location for the resolver configuration file. If your
existing resolver configuration (typically /etc/resolv.conf) contains
DNSSEC-aware resolvers, you may specify that file. This has the benefit
of only having to remember to update a single file if your resolver
configuration changes.
If you do not wish to modify your default resolver configuration
for any reason (e.g. you are using fast/close non-dnssec aware resolvers
and don't want to impact existing applications), you may use the default,
DNSSEC-Tools specific, location.
Providing a file via the --with-resolv-conf argument to configure will
avoid this prompt.
Location to read resolver configuration],$val_sysconfdir/dnssec-tools/resolv.conf,quoted)
VAL_RESOLV_CONF=$ac_cv_user_prompt_VAL_RESOLV_CONF
AC_SUBST(VAL_RESOLV_CONF)
AC_MSG_CACHE_ADD(libval resolver configuration : $VAL_RESOLV_CONF)
default_hints="$val_sysconfdir/dnssec-tools/root.hints"
if test "x$defaults" != "xyes" ; then
search_dirs="$val_sysconfdir/dnssec-tools $prefix/var/named $prefix/var/named/etc/named $val_sysconfdir/named $val_sysconfdir"
if test "x$prefix" != "x" ; then
search_dirs="$search_dirs /var/named /var/named/etc/named /etc/named /etc"
fi
for dir in $search_dirs ;
do
for file in named.ca named.root named.cache db.cache root.hints ;
do
if test -r "$dir/$file" ; then
default_hints="$dir/$file"
break 2
fi
done
done
fi
AC_PROMPT_USER(VAL_ROOT_HINTS,[
*** Root hints location:
Enter the location of the root hints file, or 'none' to install
and use the copy provided with DNSSEC-Tool (see validator/etc/root.hints).
Providing a file via the --with-root-hints argument to configure will
avoid this prompt.
Location to read root hints configuration],$val_sysconfdir/dnssec-tools/root.hints,quoted)
VAL_ROOT_HINTS=$ac_cv_user_prompt_VAL_ROOT_HINTS
#AC_DEFINE_UNQUOTED(VAL_ROOT_HINTS,"$VAL_ROOT_HINTS")
AC_SUBST(VAL_ROOT_HINTS)
AC_MSG_CACHE_ADD(libval root hints : $VAL_ROOT_HINTS)
AH_TEMPLATE([LIBVAL_INLINE_POLICY], [Define if inline configuration files are to be used.])
dnl inline_val_conf_file=$VAL_CONFIGURATION_FILE
AC_ARG_WITH(inline-dnsval-conf,
[ --with-inline-dnsval-conf=FILE dnsval config file.],
[inline_val_conf_file=$with_inline_dnsval_conf],
[inline_val_conf_file=etc/dnsval.conf])
dnl inline_root_conf_file=$VAL_ROOT_HINTS
AC_ARG_WITH(inline-root-hints,
[ --with-inline-root-hints=FILE root.hints file.],
[inline_root_conf_file=$with_inline_root_hints],
[inline_root_conf_file=etc/root.hints])
dnl inline_resolv_conf_file=$VAL_RESOLV_CONF
AC_ARG_WITH(inline-resolv-conf,
[ --with-inline-resolv-conf=FILE resolv.conf file.],
[inline_resolv_conf_file=$with_inline_resolv_conf],
[inline_resolv_conf_file=etc/resolv.conf])
AC_ARG_WITH(inline-confs,
[ --without-inline-confs Disable use of inline (pre-configured) configuration data.],
[inline_confs=$with_inline_confs],
[inline_confs="yes"])
if test "$inline_confs" = "yes"; then
AC_DEFINE(LIBVAL_INLINE_POLICY, 1)
else
inline_val_conf_file=
inline_root_conf_file=
inline_resolv_conf_file=
fi
VAL_CONF_INLINE_DATA=
if test "$cross_compiling" = yes ; then
# ac_check_file dosn't work when cross compiling, so assume it's there
AC_MSG_CACHE_ADD(Validator inline configuration : $inline_val_conf_file)
else
AC_CHECK_FILE($inline_val_conf_file,
[VAL_CONF_INLINE_DATA=`sed -e 's/"/\\\"/g ; s/^/"/ ; s/$/\\\n"/;' $inline_val_conf_file`
AC_MSG_CACHE_ADD(Validator inline configuration : $inline_val_conf_file)])
fi
AC_SUBST(VAL_CONF_INLINE_DATA)
ROOT_HINTS_INLINE_DATA=
if test "$cross_compiling" = yes ; then
# ac_check_file dosn't work when cross compiling, so assume it's there
AC_MSG_CACHE_ADD(Root hints inline file : $inline_root_conf_file)
else
AC_CHECK_FILE($inline_root_conf_file,
[ ROOT_HINTS_INLINE_DATA=`sed -e 's/"/\\\"/g ; s/^/"/ ; s/$/\\\n"/;' $inline_root_conf_file`
AC_MSG_CACHE_ADD(Root hints inline file : $inline_root_conf_file)])
fi
AC_SUBST(ROOT_HINTS_INLINE_DATA)
RESOLV_CONF_INLINE_DATA=
if test "$cross_compiling" = yes ; then
# ac_check_file dosn't work when cross compiling, so assume it's there
AC_MSG_CACHE_ADD(Resolver inline configuration : $inline_resolv_conf_file)
else
AC_CHECK_FILE($inline_resolv_conf_file,
[ RESOLV_CONF_INLINE_DATA=`sed -e 's/"/\\\"/g ; s/^/"/ ; s/$/\\\n"/;' $inline_resolv_conf_file`
AC_MSG_CACHE_ADD(Resolver inline configuration : $inline_resolv_conf_file)])
fi
AC_SUBST(RESOLV_CONF_INLINE_DATA)
dnl ----------------------------------------------------------------------
AC_CONFIG_FILES([
Makefile:Makefile.top:Makefile.in
libsres/Makefile:Makefile.top:libsres/Makefile.in:Makefile.bot
libval/Makefile:Makefile.top:libval/Makefile.in:Makefile.bot
libval_shim/Makefile:Makefile.top:libval_shim/Makefile.in:Makefile.bot
doc/Makefile:Makefile.top:doc/Makefile.in:Makefile.bot
apps/Makefile:Makefile.top:apps/Makefile.in:Makefile.bot
])
AC_CONFIG_FILES([libval-config:libval-config.in], [chmod +x libval-config])
AC_CONFIG_FILES([libval/val_inline_conf.h:libval/val_inline_conf.h.in])
AC_CONFIG_COMMANDS([default], echo timestamp > stamp-h)
AC_OUTPUT
AC_MSG_CACHE_DISPLAY()
dnsval-2.0/ChangeLog 0000664 0002372 0002372 00001172607 11542733751 014572 0 ustar hardaker hardaker ------------------------------------------------------------------------
r5527 | hardaker | 2011-03-24 14:23:43 -0700 (Thu, 24 Mar 2011) | 1 line
added a makerelease script for libval
------------------------------------------------------------------------
r5518 | hserus | 2011-03-24 06:24:03 -0700 (Thu, 24 Mar 2011) | 4 lines
change root.hints location specified from AC_PROMPT_USER_NO_DEFINE to
AC_PROMPT_USER, since the defaults root.hints value is apparently set to
NULL if this is not done
------------------------------------------------------------------------
r5502 | hardaker | 2011-03-23 13:14:27 -0700 (Wed, 23 Mar 2011) | 1 line
include arpa/nameserv.h ahead of resolver.h
------------------------------------------------------------------------
r5501 | hardaker | 2011-03-23 13:14:02 -0700 (Wed, 23 Mar 2011) | 1 line
install the validator-config.h file
------------------------------------------------------------------------
r5500 | hardaker | 2011-03-23 13:13:40 -0700 (Wed, 23 Mar 2011) | 1 line
define USE_EDNS0 and libsres_msg_getflag
------------------------------------------------------------------------
r5499 | hardaker | 2011-03-23 13:13:24 -0700 (Wed, 23 Mar 2011) | 1 line
make the nameser.h and arpa header inclusions work.
------------------------------------------------------------------------
r5498 | hardaker | 2011-03-23 13:13:06 -0700 (Wed, 23 Mar 2011) | 1 line
reinclude arpa/nameser.h
------------------------------------------------------------------------
r5497 | hardaker | 2011-03-23 13:12:47 -0700 (Wed, 23 Mar 2011) | 2 lines
- return error strings with failures
- fix tests to correct them
------------------------------------------------------------------------
r5496 | hardaker | 2011-03-23 13:12:26 -0700 (Wed, 23 Mar 2011) | 1 line
rev 1 of beginning framework
------------------------------------------------------------------------
r5495 | hardaker | 2011-03-23 13:12:10 -0700 (Wed, 23 Mar 2011) | 1 line
recent pod2man update
------------------------------------------------------------------------
r5493 | hardaker | 2011-03-23 13:11:24 -0700 (Wed, 23 Mar 2011) | 1 line
install the config.h file
------------------------------------------------------------------------
r5492 | hardaker | 2011-03-23 13:11:08 -0700 (Wed, 23 Mar 2011) | 1 line
use correct current bit value for the DO bit if the system doesn't define it
------------------------------------------------------------------------
r5491 | hardaker | 2011-03-23 13:10:53 -0700 (Wed, 23 Mar 2011) | 1 line
libsres' get() does *not* have a edns0 arg
------------------------------------------------------------------------
r5490 | hardaker | 2011-03-23 13:10:42 -0700 (Wed, 23 Mar 2011) | 1 line
print IP addresses tested on a big screen
------------------------------------------------------------------------
r5489 | hardaker | 2011-03-23 13:10:30 -0700 (Wed, 23 Mar 2011) | 1 line
return a successful description of what was achieved
------------------------------------------------------------------------
r5488 | hardaker | 2011-03-23 13:10:19 -0700 (Wed, 23 Mar 2011) | 2 lines
- return error strings with failures
- fix tests to correct them
------------------------------------------------------------------------
r5487 | hardaker | 2011-03-23 13:10:08 -0700 (Wed, 23 Mar 2011) | 1 line
compile dnssec_checks
------------------------------------------------------------------------
r5486 | hardaker | 2011-03-23 13:09:57 -0700 (Wed, 23 Mar 2011) | 1 line
rev 1 of beginning framework
------------------------------------------------------------------------
r5485 | hardaker | 2011-03-23 13:09:41 -0700 (Wed, 23 Mar 2011) | 1 line
enable nsec3 by default
------------------------------------------------------------------------
r5484 | rstory | 2011-03-23 10:26:34 -0700 (Wed, 23 Mar 2011) | 1 line
fix partially checked in fix
------------------------------------------------------------------------
r5483 | rstory | 2011-03-23 10:26:25 -0700 (Wed, 23 Mar 2011) | 1 line
revert accidental checking of debug message
------------------------------------------------------------------------
r5482 | rstory | 2011-03-23 10:26:12 -0700 (Wed, 23 Mar 2011) | 1 line
add top_q to async_status to more closely mimic async flow
------------------------------------------------------------------------
r5481 | rstory | 2011-03-23 10:26:02 -0700 (Wed, 23 Mar 2011) | 15 lines
fix access to freed memory; various cleanup
consolidate free functions
- add free_val_rrset, val_free_authentication_chain_structure,
clear_query_chain_structure
- make free_query_chain_structure actually do free
add log message when async query completes
free incomplete results to prevent leak
use printable name in log message instead of compressed name
fix async check loop to handle current item being removed from list
add various error checks
clear copied ptrs before calling structure free
clear next ptrs before calling structure free
cancel outstanding queries when freeing query chain
------------------------------------------------------------------------
r5480 | rstory | 2011-03-23 10:25:50 -0700 (Wed, 23 Mar 2011) | 1 line
fix in_flight count test, bump level of log msg
------------------------------------------------------------------------
r5479 | rstory | 2011-03-23 10:25:37 -0700 (Wed, 23 Mar 2011) | 1 line
don't loop over queries, _free_qfq_chain does it recursively
------------------------------------------------------------------------
r5478 | rstory | 2011-03-23 10:25:28 -0700 (Wed, 23 Mar 2011) | 1 line
don't decompress/alloc 0 byte rdata
------------------------------------------------------------------------
r5477 | rstory | 2011-03-23 10:25:19 -0700 (Wed, 23 Mar 2011) | 1 line
fix reversed logic test
------------------------------------------------------------------------
r5476 | rstory | 2011-03-23 10:25:06 -0700 (Wed, 23 Mar 2011) | 1 line
don't try to read empty file
------------------------------------------------------------------------
r5475 | rstory | 2011-03-23 10:24:56 -0700 (Wed, 23 Mar 2011) | 1 line
clear whole structure (not that it should matter)
------------------------------------------------------------------------
r5458 | tewok | 2011-03-21 13:44:48 -0700 (Mon, 21 Mar 2011) | 2 lines
Added -Version code.
------------------------------------------------------------------------
r5457 | tewok | 2011-03-21 13:17:26 -0700 (Mon, 21 Mar 2011) | 2 lines
Added -Version code.
------------------------------------------------------------------------
r5455 | hserus | 2011-03-21 08:27:44 -0700 (Mon, 21 Mar 2011) | 2 lines
Use namecmp instead of memcmp for comparing names
------------------------------------------------------------------------
r5454 | hserus | 2011-03-21 08:27:13 -0700 (Mon, 21 Mar 2011) | 2 lines
Minor change to a log message
------------------------------------------------------------------------
r5445 | rstory | 2011-03-17 21:07:54 -0700 (Thu, 17 Mar 2011) | 1 line
fix level of debug log messages
------------------------------------------------------------------------
r5444 | rstory | 2011-03-17 21:07:45 -0700 (Thu, 17 Mar 2011) | 1 line
count printf doesn't make sense for async
------------------------------------------------------------------------
r5443 | rstory | 2011-03-17 21:07:38 -0700 (Thu, 17 Mar 2011) | 1 line
turn on res_io debug when debug_level is 8 or higher
------------------------------------------------------------------------
r5442 | rstory | 2011-03-17 21:07:30 -0700 (Thu, 17 Mar 2011) | 3 lines
add val_log_highest_debug_level
returns the highest debug_level of all log targets
------------------------------------------------------------------------
r5441 | rstory | 2011-03-17 21:07:21 -0700 (Thu, 17 Mar 2011) | 1 line
fix typo in help text
------------------------------------------------------------------------
r5440 | rstory | 2011-03-17 21:07:13 -0700 (Thu, 17 Mar 2011) | 6 lines
support for asynchronous queries for testsuites
- add in_flight/remaining counts to testsuite
- add async_status / val_response to testcase struct
- add -I/--inflight option to validate
- add run_suite_async (only used when --inflight > 1 specified)
------------------------------------------------------------------------
r5439 | rstory | 2011-03-17 21:07:05 -0700 (Thu, 17 Mar 2011) | 8 lines
add asynchronous val functions
- set VAL_QUERY_ASYNC flag when chasing query if set on top query
- add val_async_status_free
- add val_async_submit
- add val_async_async_check
- cleanup pending async queries when releasing context
- return error if non-async function called for async query
------------------------------------------------------------------------
r5438 | rstory | 2011-03-17 21:06:56 -0700 (Thu, 17 Mar 2011) | 1 line
use async query routines if VAL_QUERY_ASYNC set
------------------------------------------------------------------------
r5437 | rstory | 2011-03-17 21:06:47 -0700 (Thu, 17 Mar 2011) | 1 line
move duplicated code to new func _free_w_results()
------------------------------------------------------------------------
r5436 | rstory | 2011-03-17 21:06:39 -0700 (Thu, 17 Mar 2011) | 3 lines
extract context refresh code to val_context.c
new: val_refresh_context() and val_create_or_refresh_context()
------------------------------------------------------------------------
r5435 | rstory | 2011-03-17 21:06:30 -0700 (Thu, 17 Mar 2011) | 4 lines
break ask_resolver into 3 pieces
_resolver_submit, _resolver_submit_one
_resolver_rcv_one
------------------------------------------------------------------------
r5434 | rstory | 2011-03-17 21:06:22 -0700 (Thu, 17 Mar 2011) | 1 line
move most of ask_cache into new ask_cache_one
------------------------------------------------------------------------
r5433 | rstory | 2011-03-17 21:06:13 -0700 (Thu, 17 Mar 2011) | 1 line
init/cleanup qc_ea in queries; add query/qfq chain remove/free funcs
------------------------------------------------------------------------
r5432 | rstory | 2011-03-17 21:06:02 -0700 (Thu, 17 Mar 2011) | 1 line
add async send/rcv functions for libval
------------------------------------------------------------------------
r5431 | hserus | 2011-03-16 19:35:00 -0700 (Wed, 16 Mar 2011) | 2 lines
Properly initialize rrset variable when trying to identify zonecuts
------------------------------------------------------------------------
r5430 | hserus | 2011-03-16 13:38:28 -0700 (Wed, 16 Mar 2011) | 2 lines
Fix improper check of soa bitfield in NSEC3 proofs,
------------------------------------------------------------------------
r5424 | hserus | 2011-03-10 17:50:36 -0800 (Thu, 10 Mar 2011) | 2 lines
Look for correct alias target when returning an answer that does not contain any answers
------------------------------------------------------------------------
r5420 | hserus | 2011-03-07 10:30:25 -0800 (Mon, 07 Mar 2011) | 2 lines
Enable nsec3, dlv and ipv6 by default
------------------------------------------------------------------------
r5418 | hardaker | 2011-02-28 10:08:13 -0800 (Mon, 28 Feb 2011) | 1 line
added a log message when an RRSIG was verified
------------------------------------------------------------------------
r5417 | hardaker | 2011-02-28 10:00:45 -0800 (Mon, 28 Feb 2011) | 1 line
enable nsec3 by default
------------------------------------------------------------------------
r5415 | hserus | 2011-02-28 09:34:14 -0800 (Mon, 28 Feb 2011) | 2 lines
Grab correct lock while reading negative answer cache
------------------------------------------------------------------------
r5414 | hserus | 2011-02-25 10:30:35 -0800 (Fri, 25 Feb 2011) | 3 lines
When looking for zonecuts move up the delegation chain when we get an
out-of-bailiwick answer for an soa record.
------------------------------------------------------------------------
r5413 | hserus | 2011-02-25 10:28:25 -0800 (Fri, 25 Feb 2011) | 2 lines
When searching for soa records look in the negative cache also.
------------------------------------------------------------------------
r5412 | rstory | 2011-02-22 20:47:53 -0800 (Tue, 22 Feb 2011) | 7 lines
res_io_read_udp updates:
- don't use FIONREAD to figure out how much to read. I was getting
0 bytes for FIONREAD even though select was reporting fd was
ready to read.
- always allocate fixed buffer of max size. 8k isn't that much, and
the memory isn't around that long
------------------------------------------------------------------------
r5411 | rstory | 2011-02-22 20:47:46 -0800 (Tue, 22 Feb 2011) | 1 line
add debugging to res_io_select_sockets
------------------------------------------------------------------------
r5410 | rstory | 2011-02-22 20:47:36 -0800 (Tue, 22 Feb 2011) | 1 line
add res_nsfallback_ea; fix potential fd leak
------------------------------------------------------------------------
r5409 | rstory | 2011-02-22 20:47:28 -0800 (Tue, 22 Feb 2011) | 1 line
add missing return to non-void functions
------------------------------------------------------------------------
r5408 | rstory | 2011-02-22 20:47:21 -0800 (Tue, 22 Feb 2011) | 4 lines
update res_io cancle/finished functionality
- add 'all' versions which follow ea_next chain
- add missing prototype for cancel function
------------------------------------------------------------------------
r5407 | rstory | 2011-02-22 20:47:13 -0800 (Tue, 22 Feb 2011) | 4 lines
add functions to check expected_arrival internals
- is using a stream transport
- has a file descriptor that is active in given fdser
------------------------------------------------------------------------
r5406 | hardaker | 2011-02-21 14:22:11 -0800 (Mon, 21 Feb 2011) | 1 line
Added a rule for creating a TAGS file
------------------------------------------------------------------------
r5391 | hardaker | 2011-01-25 15:50:21 -0800 (Tue, 25 Jan 2011) | 1 line
Made log_insert default to the default log_head if NULL is specified
------------------------------------------------------------------------
r5374 | hardaker | 2011-01-04 10:36:36 -0800 (Tue, 04 Jan 2011) | 1 line
2011 copyright update
------------------------------------------------------------------------
r5364 | hserus | 2010-11-15 10:50:24 -0800 (Mon, 15 Nov 2010) | 2 lines
Fix logic for checking if a bit is set in the NSEC bitmap
------------------------------------------------------------------------
r5363 | hserus | 2010-11-15 10:47:58 -0800 (Mon, 15 Nov 2010) | 6 lines
Define a macro for filtering types that cannot be followed using
CNAMEs/DNAMEs. Use this macro while reading data from cache, while identifying
the answer kind, and while digesting the OTW response.
Ensure that we properly consume saved referral information when we are
returning a hand-crafted error response.
------------------------------------------------------------------------
r5360 | hserus | 2010-11-05 12:04:11 -0700 (Fri, 05 Nov 2010) | 2 lines
Don't match cnames/dnames in cache with queries for records that should not exist with cnames/dnames
------------------------------------------------------------------------
r5359 | rstory | 2010-11-05 11:28:25 -0700 (Fri, 05 Nov 2010) | 1 line
move debug outside conditional
------------------------------------------------------------------------
r5358 | rstory | 2010-11-05 11:28:18 -0700 (Fri, 05 Nov 2010) | 1 line
add prototype for res_async_query_free, use instead of res_free_ea_list
------------------------------------------------------------------------
r5357 | rstory | 2010-11-05 11:28:09 -0700 (Fri, 05 Nov 2010) | 1 line
check for bad fd before using FD_* macros; fix compiler warnings
------------------------------------------------------------------------
r5356 | hserus | 2010-11-05 10:30:10 -0700 (Fri, 05 Nov 2010) | 2 lines
Include arpa/inet.h for inet_pton()
------------------------------------------------------------------------
r5355 | rstory | 2010-11-05 08:22:51 -0700 (Fri, 05 Nov 2010) | 6 lines
misc cleanup
- wrap macro in do while(0)
- add res_free_ea_list
- minimize time lock held during cleanup
- don't free lock if we immediately try to reaquire it
------------------------------------------------------------------------
r5354 | rstory | 2010-11-05 08:22:39 -0700 (Fri, 05 Nov 2010) | 1 line
free transaction resources before returning from get()
------------------------------------------------------------------------
r5353 | rstory | 2010-11-05 08:22:26 -0700 (Fri, 05 Nov 2010) | 1 line
add functions to query/set res_io_debug
------------------------------------------------------------------------
r5352 | rstory | 2010-11-05 08:22:10 -0700 (Fri, 05 Nov 2010) | 1 line
add asynchronous api and test app
------------------------------------------------------------------------
r5351 | rstory | 2010-11-05 08:20:09 -0700 (Fri, 05 Nov 2010) | 5 lines
move parse_name_server from libval to libsres
- change prototype; return ptr to nameserver, instead
of having a pointer to a pointer as a parameter
- make create_nsaddr_array a function
------------------------------------------------------------------------
r5350 | rstory | 2010-11-05 08:19:52 -0700 (Fri, 05 Nov 2010) | 5 lines
update select related functions
- add handling of timeout and nfds in new res_io_select_info
- call res_io_select_info from res_io_collect_sockets
- flush debug before calling select
------------------------------------------------------------------------
r5349 | hserus | 2010-11-05 08:02:07 -0700 (Fri, 05 Nov 2010) | 2 lines
Decrement the rrset TTL to reflect the actual outstanding time within the cache
------------------------------------------------------------------------
r5348 | rstory | 2010-11-05 08:01:02 -0700 (Fri, 05 Nov 2010) | 4 lines
update res_io_get_a_response
- only allocate space for one nameserver for response
- skip cancelled/expired attempts
------------------------------------------------------------------------
r5347 | rstory | 2010-11-05 08:00:49 -0700 (Fri, 05 Nov 2010) | 6 lines
overhaul res_io_read
- loop over ea_list instead of all possible file descriptors
- change prototype from returning void to integer count of the
number of sockets that were read from
- close socket when switching to tcp
------------------------------------------------------------------------
r5346 | rstory | 2010-11-05 08:00:35 -0700 (Fri, 05 Nov 2010) | 9 lines
overhaul transaction queue handling
- use ea_remaining_time of -1 to indicate cancel/expired attempt,
do not remove from the transaction list
- break up res_io_check
- new function res_io_next_address to move to new name server
(reduces redundant/copied code)
- res_io_check_one, called by res_io_check in a loop, handles
one transaction at a time (prep for async patches)
------------------------------------------------------------------------
r5345 | rstory | 2010-11-05 08:00:20 -0700 (Fri, 05 Nov 2010) | 1 line
check for bad transaction id before getting lock
------------------------------------------------------------------------
r5344 | rstory | 2010-11-05 08:00:07 -0700 (Fri, 05 Nov 2010) | 1 line
rename res_timeout() -> res_get_timeout()
------------------------------------------------------------------------
r5343 | rstory | 2010-11-05 07:59:53 -0700 (Fri, 05 Nov 2010) | 1 line
move send specific code into res_io_send
------------------------------------------------------------------------
r5342 | rstory | 2010-11-05 07:59:36 -0700 (Fri, 05 Nov 2010) | 1 line
merge two node creation calls into one earlier call
------------------------------------------------------------------------
r5340 | hserus | 2010-11-04 07:54:10 -0700 (Thu, 04 Nov 2010) | 2 lines
Changed copyright date
------------------------------------------------------------------------
r5332 | hserus | 2010-10-28 23:02:24 -0700 (Thu, 28 Oct 2010) | 2 lines
In is_trusted_key() look for multiple matching trust anchors within the keyset.
------------------------------------------------------------------------
r5331 | hserus | 2010-10-28 22:56:55 -0700 (Thu, 28 Oct 2010) | 3 lines
For a keyset containing a locally configured TA, set the assertion status to
VAL_AC_TRUST only if the assertion was verified by the TA.
------------------------------------------------------------------------
r5329 | hserus | 2010-10-22 11:16:51 -0700 (Fri, 22 Oct 2010) | 2 lines
Perform more sanity check of SOA record returned for DS request.
------------------------------------------------------------------------
r5328 | hserus | 2010-10-22 07:31:26 -0700 (Fri, 22 Oct 2010) | 2 lines
Set domain name string size to NS_MAXDNAME instead of arbitrarily limiting it to 100 bytes.
------------------------------------------------------------------------
r5327 | hserus | 2010-10-22 07:28:02 -0700 (Fri, 22 Oct 2010) | 2 lines
Don't return EAI_FAIL if getservbyport() fails since we may still have an address to work with.
------------------------------------------------------------------------
r5326 | hserus | 2010-10-21 13:31:05 -0700 (Thu, 21 Oct 2010) | 2 lines
Try validating through dlv if our local TA is broken and we only prefer the closest TA.
------------------------------------------------------------------------
r5325 | hserus | 2010-10-21 10:18:08 -0700 (Thu, 21 Oct 2010) | 2 lines
In val_getnameinfo() use different port type based on address family
------------------------------------------------------------------------
r5324 | hserus | 2010-10-21 07:52:25 -0700 (Thu, 21 Oct 2010) | 2 lines
Slight modification to getnameinfo() to ensure that we don't use an uninitialized variable.
------------------------------------------------------------------------
r5323 | hserus | 2010-10-21 07:46:43 -0700 (Thu, 21 Oct 2010) | 2 lines
Replace inet_ntoa with inet_ntop
------------------------------------------------------------------------
r5320 | hserus | 2010-10-20 07:49:25 -0700 (Wed, 20 Oct 2010) | 5 lines
Fixed memory leak when re-reading policy files (e.g. if app_policy is set)
Renamed dnsval_list variable to dlist to keep it distinct from struct
dnsval_list
------------------------------------------------------------------------
r5319 | rstory | 2010-10-19 18:16:33 -0700 (Tue, 19 Oct 2010) | 1 line
rearrange conditional to performal local checks before function call
------------------------------------------------------------------------
r5314 | hserus | 2010-10-19 14:16:00 -0700 (Tue, 19 Oct 2010) | 2 lines
Fix memory leak when checking for provably insecure condition.
------------------------------------------------------------------------
r5313 | hserus | 2010-10-19 13:43:45 -0700 (Tue, 19 Oct 2010) | 2 lines
Use zonecut information from rrsig whenever available.
------------------------------------------------------------------------
r5312 | hserus | 2010-10-19 13:41:33 -0700 (Tue, 19 Oct 2010) | 2 lines
Initialize response structure to zeros.
------------------------------------------------------------------------
r5311 | hserus | 2010-10-19 13:40:58 -0700 (Tue, 19 Oct 2010) | 2 lines
Fix memory leak while copying respondent server information.
------------------------------------------------------------------------
r5301 | hserus | 2010-10-14 06:59:55 -0700 (Thu, 14 Oct 2010) | 4 lines
- fix potential memleak while freeing up val_result_chain structure
- check for DLV ANC proof in the queries_for_query chain as apposed to the query chain
------------------------------------------------------------------------
r5299 | hserus | 2010-10-12 11:37:44 -0700 (Tue, 12 Oct 2010) | 2 lines
Check proper message size bounds when parsing response data
------------------------------------------------------------------------
r5298 | hserus | 2010-10-12 11:20:03 -0700 (Tue, 12 Oct 2010) | 2 lines
Initialize response structure prior to running test case
------------------------------------------------------------------------
r5291 | hserus | 2010-10-08 22:11:33 -0700 (Fri, 08 Oct 2010) | 3 lines
Add support to free the complete val_query_chain since we no longer have the
free_query_chain() function
------------------------------------------------------------------------
r5290 | hserus | 2010-10-08 22:10:09 -0700 (Fri, 08 Oct 2010) | 6 lines
Do away with the free_query_chain() function
Removed locks on query structure. Locks on the assertion chain should be
sufficient to ensure that no two threads modify the query element at the same
time.
------------------------------------------------------------------------
r5289 | hserus | 2010-10-08 22:09:21 -0700 (Fri, 08 Oct 2010) | 6 lines
Fix a memory leak. Properly initialize the soa TTL value.
Do away with the free_query_structure
Removed locks on query structure. Locks on the assertion chain should be
sufficient to ensure that no two threads modify the query element at the same
time.
------------------------------------------------------------------------
r5288 | hserus | 2010-10-08 22:07:41 -0700 (Fri, 08 Oct 2010) | 7 lines
When resetting a query do not free the query chain, just free the internal
structure.
Removed locks on query structure. Locks on the assertion chain should be
sufficient to ensure that no two threads modify the query element at the same
time.
Fix a memory leak.
------------------------------------------------------------------------
r5286 | hserus | 2010-10-08 10:04:58 -0700 (Fri, 08 Oct 2010) | 2 lines
Fix couple of memory leaks
------------------------------------------------------------------------
r5285 | hserus | 2010-10-07 07:36:41 -0700 (Thu, 07 Oct 2010) | 2 lines
Acuire the transaction array mutex before reading from the array.
------------------------------------------------------------------------
r5284 | hserus | 2010-10-07 07:34:36 -0700 (Thu, 07 Oct 2010) | 2 lines
Set default valuse for certain variables.
------------------------------------------------------------------------
r5283 | hserus | 2010-10-07 07:33:48 -0700 (Thu, 07 Oct 2010) | 4 lines
Don't modify the cache when we don't hold an exclusive lock (i.e. during a
catch fetch operation). The cache is only updated during a stow()
operation, when we actually hold the exclusive lock.
------------------------------------------------------------------------
r5276 | hserus | 2010-09-30 06:28:45 -0700 (Thu, 30 Sep 2010) | 2 lines
Set qc_flags as opposed to qfq_flags
------------------------------------------------------------------------
r5275 | hserus | 2010-09-29 10:38:43 -0700 (Wed, 29 Sep 2010) | 2 lines
Set the correct flag to re-enable EDNS0 when previously disabled
------------------------------------------------------------------------
r5273 | hserus | 2010-09-29 07:49:33 -0700 (Wed, 29 Sep 2010) | 2 lines
Use the global policy knob "closest-ta-only yes/no" to control if validation should continue above a broken TA.
------------------------------------------------------------------------
r5270 | hserus | 2010-09-29 06:34:13 -0700 (Wed, 29 Sep 2010) | 5 lines
- Add support to force re-querying of records using the VAL_QUERY_REFRESH_QCACHE flag
- Do DLV validation only if the ZSE for that zone is validate
- Add VAL_IGNORE_VALIDATION as another case where DLV will be attempted
- Allow validation to work for delegations whose ZSE are marked "validate" for a parent zone whose ZSE is marked "ignored" if we have the TA configured for the parent.
------------------------------------------------------------------------
r5269 | hserus | 2010-09-29 06:27:44 -0700 (Wed, 29 Sep 2010) | 3 lines
Rename VAL_QUERY_REFRESH_CACHE to VAL_QUERY_REFRESH_QCACHE so that it is 24
chars long (helps in Net::DNS::SEC::Validator)
------------------------------------------------------------------------
r5268 | hserus | 2010-09-29 06:01:30 -0700 (Wed, 29 Sep 2010) | 2 lines
More restructuring of VAL_QUERY_ flags
------------------------------------------------------------------------
r5245 | hserus | 2010-09-23 20:50:59 -0700 (Thu, 23 Sep 2010) | 2 lines
Don't treat a CNAME/DNAME response for an SOA query as a valid alias chain.
------------------------------------------------------------------------
r5243 | hserus | 2010-09-23 13:51:08 -0700 (Thu, 23 Sep 2010) | 2 lines
Don't retrieve the zonecut information for a name from its DS proof of non-existance.
------------------------------------------------------------------------
r5242 | hserus | 2010-09-23 13:49:24 -0700 (Thu, 23 Sep 2010) | 2 lines
Fix parsing of nsec3 records
------------------------------------------------------------------------
r5240 | hserus | 2010-09-23 10:43:38 -0700 (Thu, 23 Sep 2010) | 2 lines
Treat responses with only addition section data (e.g. EDNS0 opt records) as empty responses
------------------------------------------------------------------------
r5239 | hardaker | 2010-09-21 21:43:23 -0700 (Tue, 21 Sep 2010) | 1 line
update the library version number since there has been a lot of changes
------------------------------------------------------------------------
r5230 | hserus | 2010-09-20 22:28:35 -0700 (Mon, 20 Sep 2010) | 5 lines
Try to clean up passing of pointers by value and reference in various cases.
Use the edns0 size from the name server structure. Set the initial value from
the dnsval.conf policy and fallback to smaller values when the query returns
with a failure condition.
------------------------------------------------------------------------
r5229 | hserus | 2010-09-20 22:28:15 -0700 (Mon, 20 Sep 2010) | 8 lines
Try to be more liberal in what we receive when we query zones that are not
capable of handling EDNS0. When querying for SOA records be prepared to handle
empty non-existence responses in the PNE checks.
Try to be more consistent in the definition and use of VAL_QUERY_ flags.
Specifically, use qc_flags for user-level flags and qfq_flags for maintainting
internal state.
Use the correct DLV break-off condition. DLV does not work quite right yet.
------------------------------------------------------------------------
r5228 | hserus | 2010-09-20 22:27:50 -0700 (Mon, 20 Sep 2010) | 2 lines
Added #ifdefs for IPV6-specific code
------------------------------------------------------------------------
r5227 | hserus | 2010-09-20 22:27:22 -0700 (Mon, 20 Sep 2010) | 4 lines
Restructured stow_ functions(). This will undergo further changes in
the near future such that the cache also keeps track of query flags and EDNS0
information while matching queries.
------------------------------------------------------------------------
r5226 | hserus | 2010-09-20 22:27:05 -0700 (Mon, 20 Sep 2010) | 2 lines
Set EDNS0 size in the name server structure.
------------------------------------------------------------------------
r5225 | hserus | 2010-09-20 22:26:42 -0700 (Mon, 20 Sep 2010) | 4 lines
Store the edns0 size within the the name server structure instead of passing
this value explicitly to different functions.
Use res_create_query_payload() as the means to create the query payload
------------------------------------------------------------------------
r5224 | hserus | 2010-09-20 22:26:21 -0700 (Mon, 20 Sep 2010) | 2 lines
Define new function to try different EDNS0 sizes when a query fails.
------------------------------------------------------------------------
r5223 | hserus | 2010-09-20 22:25:42 -0700 (Mon, 20 Sep 2010) | 3 lines
Create a new function to create a query payload on demand. We need this when
we're falling back from EDNS0 to non-EDNS0 queries.
------------------------------------------------------------------------
r5222 | hserus | 2010-09-20 22:25:04 -0700 (Mon, 20 Sep 2010) | 3 lines
Restructured query flag definitions. Tried to separate user-defined flags from
purely internal state flags.
------------------------------------------------------------------------
r5221 | hserus | 2010-09-20 22:24:48 -0700 (Mon, 20 Sep 2010) | 3 lines
Store the edns0 size within the the name server structure instead of passing
this value explicitly to different functions.
------------------------------------------------------------------------
r5220 | hserus | 2010-09-20 21:38:18 -0700 (Mon, 20 Sep 2010) | 3 lines
Replace the dnssec-tools.org TAs with the root TA. Set the zone security
expectation accordingly.
------------------------------------------------------------------------
r5183 | rstory | 2010-08-26 21:38:47 -0700 (Thu, 26 Aug 2010) | 3 lines
fix bug#83; don't DEFINE VAL_ROOT_HINTS until after we're done
modifying it.
------------------------------------------------------------------------
r5178 | hserus | 2010-08-19 06:35:25 -0700 (Thu, 19 Aug 2010) | 3 lines
Proofs in the delegation_info structure need to be handled differently for
referrals and for alias chains.
------------------------------------------------------------------------
r5177 | hserus | 2010-08-18 21:12:10 -0700 (Wed, 18 Aug 2010) | 2 lines
Add better support for proofs accompanying wildcard responses
------------------------------------------------------------------------
r5170 | hserus | 2010-08-06 07:46:00 -0700 (Fri, 06 Aug 2010) | 2 lines
Fix DSA signature verification (thanks tom.fowler).
------------------------------------------------------------------------
r5169 | hserus | 2010-08-04 10:57:53 -0700 (Wed, 04 Aug 2010) | 2 lines
Set the proper array size while computing and comparing SHA hashes
------------------------------------------------------------------------
r5164 | hserus | 2010-07-22 11:34:20 -0700 (Thu, 22 Jul 2010) | 2 lines
s/global-policy/global-options
------------------------------------------------------------------------
r5163 | hserus | 2010-07-20 09:30:29 -0700 (Tue, 20 Jul 2010) | 3 lines
s/Unsecure/Insecure
------------------------------------------------------------------------
r5162 | hserus | 2010-07-16 09:38:11 -0700 (Fri, 16 Jul 2010) | 2 lines
Fix logic for determining when VAL_QUERY_NO_EDNS0 needs to be reset
------------------------------------------------------------------------
r5161 | hserus | 2010-07-16 08:50:40 -0700 (Fri, 16 Jul 2010) | 2 lines
If we're at a trust point, ensure that EDNS0 is not disabled because we previously encountered a DS pne
------------------------------------------------------------------------
r5160 | hserus | 2010-07-16 08:21:56 -0700 (Fri, 16 Jul 2010) | 2 lines
Define a new flag for disabling EDNS0 in a query: VAL_QUERY_NO_EDNS0
------------------------------------------------------------------------
r5159 | hserus | 2010-07-16 08:21:00 -0700 (Fri, 16 Jul 2010) | 2 lines
Use a pne while following referrals as a hint that DNSSEC may be off below this level (pinsecure zones). Disable EDNS0 in such cases.
------------------------------------------------------------------------
r5158 | hserus | 2010-07-16 08:16:22 -0700 (Fri, 16 Jul 2010) | 2 lines
Disable asking specifically for rrsigs when validating a response
------------------------------------------------------------------------
r5156 | hserus | 2010-07-07 05:31:32 -0700 (Wed, 07 Jul 2010) | 2 lines
regenerated configure using configure.in from r5155
------------------------------------------------------------------------
r5155 | rstory | 2010-07-06 20:50:38 -0700 (Tue, 06 Jul 2010) | 1 line
make lack of sha-256 support an error; add --disable-sha256-check to turn it into a warning
------------------------------------------------------------------------
r5154 | hserus | 2010-07-06 13:24:13 -0700 (Tue, 06 Jul 2010) | 2 lines
Add SHA1 hash for dnssec-tools TA
------------------------------------------------------------------------
r5144 | hserus | 2010-06-30 08:51:14 -0700 (Wed, 30 Jun 2010) | 2 lines
Keep the api document in sync with current changes. The -08 version is still unpublished.
------------------------------------------------------------------------
r5136 | hardaker | 2010-06-30 07:25:58 -0700 (Wed, 30 Jun 2010) | 1 line
updated root.hints from a recent pull
------------------------------------------------------------------------
r5125 | hserus | 2010-06-29 09:51:45 -0700 (Tue, 29 Jun 2010) | 2 lines
Log entry into val_getaddrinfo() and val_getnameinfo() functions
------------------------------------------------------------------------
r5123 | hserus | 2010-06-29 09:46:11 -0700 (Tue, 29 Jun 2010) | 2 lines
Increment libval revision number
------------------------------------------------------------------------
r5121 | hserus | 2010-06-29 08:59:27 -0700 (Tue, 29 Jun 2010) | 3 lines
Set default ends0 size to a lower value till such time that we have EDNS0 size
fallback implemented
------------------------------------------------------------------------
r5120 | hserus | 2010-06-29 08:53:44 -0700 (Tue, 29 Jun 2010) | 2 lines
Rename free_validator_state as val_free_validator_state
------------------------------------------------------------------------
r5093 | hserus | 2010-06-23 05:47:12 -0700 (Wed, 23 Jun 2010) | 2 lines
Return EAI_FAIL in cases of DNS errors, not EAI_NONAME
------------------------------------------------------------------------
r5092 | hserus | 2010-06-23 05:43:02 -0700 (Wed, 23 Jun 2010) | 2 lines
Don't set the recursive bit when we are iteratively resolving
------------------------------------------------------------------------
r5076 | hserus | 2010-06-16 09:52:22 -0700 (Wed, 16 Jun 2010) | 2 lines
Merge cached responses into answer even when we traverse multiple CNAME/DNAME links
------------------------------------------------------------------------
r5073 | hserus | 2010-06-09 13:08:24 -0700 (Wed, 09 Jun 2010) | 2 lines
Add support for RSASHA256/512 validation (untested)
------------------------------------------------------------------------
r5068 | hserus | 2010-06-02 08:57:05 -0700 (Wed, 02 Jun 2010) | 2 lines
Fetch proper proof assertion when the answer is provably insecure
------------------------------------------------------------------------
r5055 | hserus | 2010-04-20 10:10:00 -0700 (Tue, 20 Apr 2010) | 1 line
------------------------------------------------------------------------
r5050 | hserus | 2010-04-13 13:39:38 -0700 (Tue, 13 Apr 2010) | 2 lines
Add a target for universal build
------------------------------------------------------------------------
r5044 | hserus | 2010-04-09 09:42:42 -0700 (Fri, 09 Apr 2010) | 3 lines
Add backwards compatibility support for the (now deprecated)
trust-local-answers policy in dnsval.conf
------------------------------------------------------------------------
r5043 | hserus | 2010-04-09 08:53:51 -0700 (Fri, 09 Apr 2010) | 2 lines
Implement couple of fixes for DLV support
------------------------------------------------------------------------
r5041 | hserus | 2010-04-05 11:05:26 -0700 (Mon, 05 Apr 2010) | 2 lines
Removed newline
------------------------------------------------------------------------
r5040 | hserus | 2010-04-05 10:42:19 -0700 (Mon, 05 Apr 2010) | 2 lines
reverted
------------------------------------------------------------------------
r5039 | hserus | 2010-04-05 10:40:38 -0700 (Mon, 05 Apr 2010) | 2 lines
testing commit
------------------------------------------------------------------------
r5032 | hserus | 2010-03-15 07:09:29 -0700 (Mon, 15 Mar 2010) | 2 lines
Updated list of test cases
------------------------------------------------------------------------
r5031 | hserus | 2010-03-15 07:07:18 -0700 (Mon, 15 Mar 2010) | 3 lines
Add another special case for PI checks, so that we won't go into a loop trying to prove the non-existence of RRSIGs for an existing
DS record.
------------------------------------------------------------------------
r5026 | hserus | 2010-03-01 08:06:57 -0800 (Mon, 01 Mar 2010) | 4 lines
- ignore wildcard check for DS non-existence only for NOERROR responses
- when checking for provably insecure names check trustworthiness of names
using val_istrusted instead of val_isvalidated, to account for optout zones
------------------------------------------------------------------------
r5024 | hserus | 2010-02-28 19:49:35 -0800 (Sun, 28 Feb 2010) | 8 lines
Fix following issues:
- find trust anchors that are at the level of the top-query
- fix some of the error messages
- don't check wildcard proofs while verifying DS non-existence in opt-out zones
- check correct pointer value when NCN proof is missing
- Fix another instance of using a cached zonecut when availabile
- Use VAL_NOTRUST in place of VAL_VERIFIED_CHAIN
------------------------------------------------------------------------
r5023 | hserus | 2010-02-28 19:42:42 -0800 (Sun, 28 Feb 2010) | 2 lines
Try to correctly distinguish between referral and a no data response with NS records
------------------------------------------------------------------------
r5022 | hserus | 2010-02-28 19:39:13 -0800 (Sun, 28 Feb 2010) | 2 lines
Remove unnecessary (and misleading) error code VAL_VERIFIED_CHAIN
------------------------------------------------------------------------
r5021 | hserus | 2010-02-28 19:38:29 -0800 (Sun, 28 Feb 2010) | 2 lines
lower all domain names while verifying signatures
------------------------------------------------------------------------
r5017 | hardaker | 2010-02-12 10:57:41 -0800 (Fri, 12 Feb 2010) | 1 line
change parameter from class to pclass to not conflict with C++ terms
------------------------------------------------------------------------
r5014 | baerm | 2010-02-11 09:57:50 -0800 (Thu, 11 Feb 2010) | 4 lines
Fixed 64-bit segfault issue.
------------------------------------------------------------------------
r4963 | hserus | 2010-01-11 06:28:02 -0800 (Mon, 11 Jan 2010) | 2 lines
Check for proper return value from DSA_verfiy and RSA_verify functions
------------------------------------------------------------------------
r4962 | hserus | 2010-01-08 12:49:45 -0800 (Fri, 08 Jan 2010) | 2 lines
If we already have a DNSKEY we can use to validate, don't try to look for one again
------------------------------------------------------------------------
r4954 | rstory | 2009-12-30 19:09:02 -0800 (Wed, 30 Dec 2009) | 1 line
use libsres_msg_getflag iff ns_msg_getflag is not defined
------------------------------------------------------------------------
r4951 | hardaker | 2009-12-24 10:09:38 -0800 (Thu, 24 Dec 2009) | 1 line
remove the apps/.libs directory on make clean
------------------------------------------------------------------------
r4932 | hserus | 2009-12-11 10:08:50 -0800 (Fri, 11 Dec 2009) | 2 lines
In get_ac_trust check for trust anchors before trying to query for DS or DNSKEY records
------------------------------------------------------------------------
r4931 | hserus | 2009-12-11 09:02:53 -0800 (Fri, 11 Dec 2009) | 2 lines
Supply better fix for breaking out of loop around trust anchor with expired sigs
------------------------------------------------------------------------
r4930 | hserus | 2009-12-11 08:48:02 -0800 (Fri, 11 Dec 2009) | 2 lines
Revert previous change - breaks other tests
------------------------------------------------------------------------
r4929 | hserus | 2009-12-11 08:43:44 -0800 (Fri, 11 Dec 2009) | 4 lines
Set the correct status if the unchecked trust anchor fails to validate. Still
need to fix the extra DS query generation when there is clearly no trust anchor
above.
------------------------------------------------------------------------
r4897 | rstory | 2009-11-18 13:35:25 -0800 (Wed, 18 Nov 2009) | 2 lines
check for EAI_NODATA before using it
------------------------------------------------------------------------
r4883 | rstory | 2009-11-13 09:25:42 -0800 (Fri, 13 Nov 2009) | 2 lines
don't unwrap ipv4 addrs if NI_NUMERICHOST set; strip leading 0s in ipv6 addrs
------------------------------------------------------------------------
r4882 | rstory | 2009-11-13 07:23:17 -0800 (Fri, 13 Nov 2009) | 3 lines
bugfixes: do ipv4 lookup for ipv6 mapped ipv4 addrs; use u_char for addrs;
code cleanup: use sizeof instead of calculating size of array
------------------------------------------------------------------------
r4881 | rstory | 2009-11-12 08:40:11 -0800 (Thu, 12 Nov 2009) | 1 line
fixes for getname ipv6 support
------------------------------------------------------------------------
r4880 | rstory | 2009-11-11 13:34:30 -0800 (Wed, 11 Nov 2009) | 1 line
add ipv6 support to getname app
------------------------------------------------------------------------
r4879 | rstory | 2009-11-11 09:08:21 -0800 (Wed, 11 Nov 2009) | 1 line
tabs to spaces
------------------------------------------------------------------------
r4877 | baerm | 2009-11-10 16:49:46 -0800 (Tue, 10 Nov 2009) | 5 lines
adjusted flags and some length checks,
NUMERICHOST and NAMEREQD flags should work correctly
------------------------------------------------------------------------
r4876 | rstory | 2009-11-10 13:57:04 -0800 (Tue, 10 Nov 2009) | 1 line
fix another typo in new macro
------------------------------------------------------------------------
r4868 | rstory | 2009-11-09 11:53:54 -0800 (Mon, 09 Nov 2009) | 1 line
fix typo in macro
------------------------------------------------------------------------
r4857 | rstory | 2009-11-05 13:22:19 -0800 (Thu, 05 Nov 2009) | 1 line
add VAL_GET*INFO_HAS_STATUS macros; dont use C++ keywords as agruments/struct members
------------------------------------------------------------------------
r4856 | rstory | 2009-11-05 13:20:12 -0800 (Thu, 05 Nov 2009) | 1 line
add extern C wrapper so header can be included in C++ fiels
------------------------------------------------------------------------
r4842 | hserus | 2009-10-30 11:04:52 -0700 (Fri, 30 Oct 2009) | 2 lines
Add current DS record for dnssec-tools.org as a trust anchor
------------------------------------------------------------------------
r4834 | hserus | 2009-10-26 14:56:56 -0700 (Mon, 26 Oct 2009) | 2 lines
Do away with the assertion cache within val_context_t
------------------------------------------------------------------------
r4832 | hserus | 2009-10-26 14:39:28 -0700 (Mon, 26 Oct 2009) | 2 lines
Fixed wrong pointer increment
------------------------------------------------------------------------
r4831 | hserus | 2009-10-26 14:38:39 -0700 (Mon, 26 Oct 2009) | 3 lines
Fixed source of compilation warnings - const correctness and checking for
always true conditions.
------------------------------------------------------------------------
r4830 | hserus | 2009-10-26 14:36:23 -0700 (Mon, 26 Oct 2009) | 2 lines
Fixed const correctness
------------------------------------------------------------------------
r4829 | hserus | 2009-10-26 14:34:34 -0700 (Mon, 26 Oct 2009) | 2 lines
Ifdef NSEC3-specific label
------------------------------------------------------------------------
r4828 | hardaker | 2009-10-26 11:14:04 -0700 (Mon, 26 Oct 2009) | 1 line
ifdef out the nsec3 printing case if not building with nsec3 support
------------------------------------------------------------------------
r4776 | hserus | 2009-10-13 14:55:05 -0700 (Tue, 13 Oct 2009) | 2 lines
Don't display zonecut in log message since this can be null
------------------------------------------------------------------------
r4775 | hserus | 2009-10-13 14:49:57 -0700 (Tue, 13 Oct 2009) | 2 lines
Add couple of log statements
------------------------------------------------------------------------
r4774 | hserus | 2009-10-13 14:41:59 -0700 (Tue, 13 Oct 2009) | 2 lines
Don't fetch glue if we're already fetching glue -- do this properly.
------------------------------------------------------------------------
r4762 | hserus | 2009-10-13 08:23:32 -0700 (Tue, 13 Oct 2009) | 2 lines
Use correct stagger value when querying different name servers
------------------------------------------------------------------------
r4761 | hserus | 2009-10-13 08:21:30 -0700 (Tue, 13 Oct 2009) | 2 lines
Log the name of the correct function being invoked
------------------------------------------------------------------------
r4749 | hserus | 2009-09-30 07:31:20 -0700 (Wed, 30 Sep 2009) | 2 lines
Fix nsec bitmap type checking
------------------------------------------------------------------------
r4744 | hserus | 2009-09-24 13:59:36 -0700 (Thu, 24 Sep 2009) | 2 lines
Fix potential issue with IPv6 glue
------------------------------------------------------------------------
r4742 | hserus | 2009-09-23 09:36:41 -0700 (Wed, 23 Sep 2009) | 2 lines
Q_LAME_SERVER is not a very useful code since other Q_REFERRAL_ERROR may also indicate that we have a lame nameserver.
------------------------------------------------------------------------
r4741 | hserus | 2009-09-23 09:36:10 -0700 (Wed, 23 Sep 2009) | 2 lines
Q_LAME_SERVER is not a very useful code since other Q_REFERRAL_ERROR may also indicate that we have a lame nameserver.
------------------------------------------------------------------------
r4739 | hserus | 2009-09-23 09:13:40 -0700 (Wed, 23 Sep 2009) | 3 lines
Check for referral loops before we bootstrap the new referral. Don't free up the referral structure if we have errors, since we want to be
able to detect referral errors for responses returned from other nameservers too.
------------------------------------------------------------------------
r4738 | hserus | 2009-09-23 07:13:58 -0700 (Wed, 23 Sep 2009) | 2 lines
Return correct type of buffer
------------------------------------------------------------------------
r4736 | hserus | 2009-09-23 06:55:09 -0700 (Wed, 23 Sep 2009) | 3 lines
When verifying proof for wildcard expansion don't rely on trusted but
non-validated proof components
------------------------------------------------------------------------
r4735 | hserus | 2009-09-23 06:52:21 -0700 (Wed, 23 Sep 2009) | 2 lines
Remove unused constant
------------------------------------------------------------------------
r4734 | hserus | 2009-09-22 21:32:49 -0700 (Tue, 22 Sep 2009) | 3 lines
Add initial suport for NSEC3. Also rewrote much of the prove_nonexistence logic
so that it was consistent between nsec and nsec3 proof checking.
------------------------------------------------------------------------
r4733 | hserus | 2009-09-22 21:30:07 -0700 (Tue, 22 Sep 2009) | 2 lines
Allow for 0 length NSEC3 bitfields
------------------------------------------------------------------------
r4732 | hserus | 2009-09-22 21:28:53 -0700 (Tue, 22 Sep 2009) | 2 lines
Minor formatting fixes
------------------------------------------------------------------------
r4731 | hserus | 2009-09-22 21:27:49 -0700 (Tue, 22 Sep 2009) | 2 lines
Support printing of NSEC3 and DS/SHA256 esource records
------------------------------------------------------------------------
r4730 | hserus | 2009-09-22 21:26:10 -0700 (Tue, 22 Sep 2009) | 3 lines
define identifiers for SHA1 and SHA256. Although validator.h contains these
definitions, we don't want libsres to have to depend on validator.h
------------------------------------------------------------------------
r4721 | hserus | 2009-09-14 06:16:34 -0700 (Mon, 14 Sep 2009) | 2 lines
Don't recurse from root if we have a local nameserver listed in resolv.conf
------------------------------------------------------------------------
r4719 | hserus | 2009-09-11 12:57:24 -0700 (Fri, 11 Sep 2009) | 2 lines
Remove DLV and NSEC3 related config params for now
------------------------------------------------------------------------
r4718 | hserus | 2009-09-11 12:29:15 -0700 (Fri, 11 Sep 2009) | 2 lines
remove snip zones
------------------------------------------------------------------------
r4717 | hserus | 2009-09-11 12:25:38 -0700 (Fri, 11 Sep 2009) | 15 lines
Changed the glue fetching logic -- now only fetch glue if none of our existing
name servers are useful. This means that we now keep pending glue around and
have a separate pointer referencing the current glue being fetched.
bootstrap_referral() may return partial glue, never expect complete sets. Use
new functions in libsres to control when we want to skip the current ns and
when we want to cancel the query entirely.
Misc fixes associated with this change:
- set zonecut where appropriate
- fix find_next_zonecut()
- in verify_provably_insecure() try to use existing zonecut information before
attempting to find one using find_next_zonecut()
- dont fetch DNSKEYs too early in a referral chain
------------------------------------------------------------------------
r4716 | hserus | 2009-09-11 12:06:07 -0700 (Fri, 11 Sep 2009) | 2 lines
Define new query error state denoting a lame server
------------------------------------------------------------------------
r4715 | hserus | 2009-09-11 12:03:52 -0700 (Fri, 11 Sep 2009) | 2 lines
Rely on libval to control query transactions
------------------------------------------------------------------------
r4714 | hserus | 2009-09-11 12:03:09 -0700 (Fri, 11 Sep 2009) | 3 lines
Define new functions that allow libval to control libsres query transactions to
some extent
------------------------------------------------------------------------
r4713 | hserus | 2009-09-11 12:01:39 -0700 (Fri, 11 Sep 2009) | 4 lines
Define functions that enables validator to control libsres query transactions to some extent.
Define new parameter that sets how far apart we should stagger queries to
different authoritative name servers
------------------------------------------------------------------------
r4691 | hserus | 2009-09-04 22:10:48 -0700 (Fri, 04 Sep 2009) | 5 lines
Force query to nameserver listed in validator context before trying other options.
Fix zonecut information only if we receive answer with aa bit set.
Cache name server information returned in response only if we did not ask for recursion.
Force RD off when we are not sending to the name server listed in the validator context
------------------------------------------------------------------------
r4690 | hserus | 2009-09-04 19:47:50 -0700 (Fri, 04 Sep 2009) | 3 lines
Fix validation of authentication chains that contain DS records with an
incorrect keytag but with a correct hash of the child key
------------------------------------------------------------------------
r4689 | hserus | 2009-09-04 19:43:12 -0700 (Fri, 04 Sep 2009) | 2 lines
In CREATE_NSADDR_ARRAY break as soon as we run out of memory
------------------------------------------------------------------------
r4688 | hserus | 2009-09-04 19:40:14 -0700 (Fri, 04 Sep 2009) | 2 lines
Change return code from val_parse_ds_rdata if hash algorithm is unknown
------------------------------------------------------------------------
r4687 | hserus | 2009-09-04 19:29:34 -0700 (Fri, 04 Sep 2009) | 2 lines
Add resolver.h to be consistent with other files
------------------------------------------------------------------------
r4686 | hserus | 2009-09-04 19:28:08 -0700 (Fri, 04 Sep 2009) | 2 lines
Include validator-internal.h to get certain structure definitions
------------------------------------------------------------------------
r4685 | hserus | 2009-09-04 19:13:18 -0700 (Fri, 04 Sep 2009) | 2 lines
Add log support for VAL_AC_NO_LINK and VAL_AC_INVALID_DS error codes
------------------------------------------------------------------------
r4684 | hserus | 2009-09-04 19:12:30 -0700 (Fri, 04 Sep 2009) | 3 lines
Break out of potential infinite loop when recursive name server gives bad name
server hints for DS record
------------------------------------------------------------------------
r4683 | hserus | 2009-09-04 19:11:33 -0700 (Fri, 04 Sep 2009) | 2 lines
Fix signed/unsigned mismatch
------------------------------------------------------------------------
r4682 | hserus | 2009-09-04 19:11:05 -0700 (Fri, 04 Sep 2009) | 2 lines
Rename VAL_AC_NO_TRUST_ANCHOR to VAL_AC_NO_LINK
------------------------------------------------------------------------
r4681 | hserus | 2009-09-04 19:10:02 -0700 (Fri, 04 Sep 2009) | 3 lines
Rename VAL_AC_NO_TRUST_ANCHOR to VAL_AC_NO_LINK; add description for
VAL_AC_INVALID_DS
------------------------------------------------------------------------
r4680 | hserus | 2009-09-04 19:08:14 -0700 (Fri, 04 Sep 2009) | 3 lines
Rename VAL_AC_NO_TRUST_ANCHOR to VAL_AC_NO_LINK; update possible error codes
for DS record sets
------------------------------------------------------------------------
r4679 | hserus | 2009-09-04 19:04:30 -0700 (Fri, 04 Sep 2009) | 3 lines
Add error code for VAL_AC_INVALID_DS. Also rename VAL_AC_TRUST_ANCHOR to
VAL_AC_NO_LINK
------------------------------------------------------------------------
r4642 | baerm | 2009-08-20 08:52:55 -0700 (Thu, 20 Aug 2009) | 5 lines
Added to parsing of resolv.conf nameserver token
'[address]:port' format can now be used
------------------------------------------------------------------------
r4541 | hserus | 2009-06-05 09:03:44 -0700 (Fri, 05 Jun 2009) | 2 lines
Changed copyright date to 2009
------------------------------------------------------------------------
r4517 | hardaker | 2009-05-05 06:57:03 -0700 (Tue, 05 May 2009) | 1 line
check for socket() in -lsocket if needed
------------------------------------------------------------------------
r4462 | hardaker | 2009-04-17 08:51:25 -0700 (Fri, 17 Apr 2009) | 1 line
------------------------------------------------------------------------
r4461 | hardaker | 2009-04-17 08:49:27 -0700 (Fri, 17 Apr 2009) | 1 line
------------------------------------------------------------------------
r4453 | hardaker | 2009-04-17 08:38:24 -0700 (Fri, 17 Apr 2009) | 1 line
------------------------------------------------------------------------
r4452 | hardaker | 2009-04-17 08:37:37 -0700 (Fri, 17 Apr 2009) | 1 line
------------------------------------------------------------------------
r4451 | hardaker | 2009-04-17 08:36:56 -0700 (Fri, 17 Apr 2009) | 1 line
------------------------------------------------------------------------
r4450 | hardaker | 2009-04-17 08:36:24 -0700 (Fri, 17 Apr 2009) | 1 line
------------------------------------------------------------------------
r4449 | hardaker | 2009-04-17 08:36:00 -0700 (Fri, 17 Apr 2009) | 1 line
------------------------------------------------------------------------
r4432 | hardaker | 2009-03-20 12:06:13 -0700 (Fri, 20 Mar 2009) | 1 line
update to add sys/types inclusion ahead of arpa/nameser.h
------------------------------------------------------------------------
r4431 | hardaker | 2009-03-20 12:04:42 -0700 (Fri, 20 Mar 2009) | 1 line
update libtool version
------------------------------------------------------------------------
r4423 | marz | 2009-03-17 08:04:45 -0700 (Tue, 17 Mar 2009) | 1 line
fix make clean to clean up old libs
------------------------------------------------------------------------
r4422 | hserus | 2009-03-13 16:00:27 -0700 (Fri, 13 Mar 2009) | 2 lines
Don't try and free val_result_chain when val_resolve_and_check returns an error
------------------------------------------------------------------------
r4421 | hserus | 2009-03-13 14:42:59 -0700 (Fri, 13 Mar 2009) | 2 lines
Fix nsec_sig_match check
------------------------------------------------------------------------
r4420 | hserus | 2009-03-13 14:42:36 -0700 (Fri, 13 Mar 2009) | 2 lines
Add couple of checks for NULL
------------------------------------------------------------------------
r4411 | hserus | 2009-03-04 06:28:55 -0800 (Wed, 04 Mar 2009) | 2 lines
Ensure that rr_next points to NULL.
------------------------------------------------------------------------
r4410 | hserus | 2009-03-04 06:28:15 -0800 (Wed, 04 Mar 2009) | 2 lines
Use appropriate routine for freeing up val_rr_rec structure
------------------------------------------------------------------------
r4409 | hserus | 2009-03-04 06:27:30 -0800 (Wed, 04 Mar 2009) | 2 lines
Reorder some params in structure
------------------------------------------------------------------------
r4403 | hserus | 2009-02-28 02:05:30 -0800 (Sat, 28 Feb 2009) | 4 lines
Add flag to specify if spaces are to be used as delimiters in val_get_token
Make the quote in the trust-anchor dnsval.conf statement optional. This allows us to use the trust
anchor format specified for BIND
------------------------------------------------------------------------
r4399 | hserus | 2009-02-27 06:48:13 -0800 (Fri, 27 Feb 2009) | 3 lines
Trigger DLV logic only when security expectation is set to validate and
we don't have a trust anchor available
------------------------------------------------------------------------
r4398 | hserus | 2009-02-27 06:46:37 -0800 (Fri, 27 Feb 2009) | 4 lines
Fetch DNSSEC meta-data when security-expectation is set to validate _and_ we
have a (possible) trust point available
Don't free the respondent server when we create an empty nonexitence proof
------------------------------------------------------------------------
r4383 | hardaker | 2009-02-16 14:17:19 -0800 (Mon, 16 Feb 2009) | 1 line
copyright year update
------------------------------------------------------------------------
r4346 | hardaker | 2009-02-05 14:22:05 -0800 (Thu, 05 Feb 2009) | 1 line
consistent wording in the configure output
------------------------------------------------------------------------
r4345 | hardaker | 2009-02-05 14:20:14 -0800 (Thu, 05 Feb 2009) | 1 line
attempt to carefully define gethostbyname: take 3
------------------------------------------------------------------------
r4344 | hardaker | 2009-02-05 14:18:41 -0800 (Thu, 05 Feb 2009) | 1 line
attempt to carefully define gethostbyname: take 2
------------------------------------------------------------------------
r4343 | hardaker | 2009-02-05 14:16:44 -0800 (Thu, 05 Feb 2009) | 1 line
attempt to carefully define gethostbyname: take 1
------------------------------------------------------------------------
r4342 | hardaker | 2009-02-05 14:03:12 -0800 (Thu, 05 Feb 2009) | 1 line
attempt to carefully define getnameinfo: take 3
------------------------------------------------------------------------
r4341 | hardaker | 2009-02-05 14:00:37 -0800 (Thu, 05 Feb 2009) | 1 line
attempt to carefully define getnameinfo: take 2
------------------------------------------------------------------------
r4340 | hardaker | 2009-02-05 13:56:17 -0800 (Thu, 05 Feb 2009) | 1 line
attempt to carefully define getnameinfo
------------------------------------------------------------------------
r4330 | hserus | 2009-02-05 08:48:53 -0800 (Thu, 05 Feb 2009) | 2 lines
Set the value of the addrinfo return param
------------------------------------------------------------------------
r4329 | hserus | 2009-02-05 08:48:21 -0800 (Thu, 05 Feb 2009) | 2 lines
Fix logic in removal of first element of the zoneinfo linked list
------------------------------------------------------------------------
r4324 | hserus | 2009-01-30 09:28:10 -0800 (Fri, 30 Jan 2009) | 2 lines
Version submitted as -07
------------------------------------------------------------------------
r4323 | hserus | 2009-01-29 12:36:39 -0800 (Thu, 29 Jan 2009) | 2 lines
reorder rr_next element to be last in the val_rr_rec structure
------------------------------------------------------------------------
r4322 | hserus | 2009-01-29 12:07:04 -0800 (Thu, 29 Jan 2009) | 2 lines
Add reference to new IPR text
------------------------------------------------------------------------
r4320 | hserus | 2009-01-29 11:38:37 -0800 (Thu, 29 Jan 2009) | 2 lines
Set zonecut when restarting query from root
------------------------------------------------------------------------
r4319 | hserus | 2009-01-29 10:53:49 -0800 (Thu, 29 Jan 2009) | 2 lines
Make DS query less dependent on zonecut information (DNSKEY name is sufficient)
------------------------------------------------------------------------
r4318 | hserus | 2009-01-29 10:40:37 -0800 (Thu, 29 Jan 2009) | 2 lines
restructure code for digest_response
------------------------------------------------------------------------
r4317 | hserus | 2009-01-29 10:37:00 -0800 (Thu, 29 Jan 2009) | 2 lines
No longer keep separate caches for key and DS records
------------------------------------------------------------------------
r4316 | hserus | 2009-01-29 10:36:11 -0800 (Thu, 29 Jan 2009) | 2 lines
Set the RD bit only if the RES_RECURSE option is specified
------------------------------------------------------------------------
r4315 | hserus | 2009-01-29 10:31:53 -0800 (Thu, 29 Jan 2009) | 2 lines
Display the query state in error response log message
------------------------------------------------------------------------
r4314 | hserus | 2009-01-29 10:11:46 -0800 (Thu, 29 Jan 2009) | 2 lines
Retry queries at least once
------------------------------------------------------------------------
r4311 | hserus | 2009-01-28 12:28:48 -0800 (Wed, 28 Jan 2009) | 2 lines
Keep documentation in sync with API
------------------------------------------------------------------------
r4310 | hserus | 2009-01-28 12:27:10 -0800 (Wed, 28 Jan 2009) | 2 lines
Current version of validator API to be submitted as -07
------------------------------------------------------------------------
r4305 | hserus | 2009-01-28 11:49:13 -0800 (Wed, 28 Jan 2009) | 24 lines
* Changes to status codes
- removed the VAL_AC_TRUSTED_ZONE and VAL_TRUSTED_ZONE codes
- renamed *PROVABLY_INSECURE* to *PINSECURE*
- renamed VAL_LOCAL_ANSWER to VAL_OOB_ANSWER
* Changes to types
- using u_char in place of u_int8_t to represent character buffers
- using size_t where appropriate
- Decoupled val_rrset_rec from other internal structures. Moved members
from older val_rrset_digested structure to rrset_rec structure
- No longer store complete header information in val_rrset_rec; only keep
rcode information
* Changes to function prototypes
- using higher order types instead of u_int* variants for exported
functions
- val_add_valpolicy() now takes a void * as the second argument
- No longer pass OTW format domain names for val_resolve_and_check()
* policy-related
- No longer define a "trusted" zone security expectation since there is no
way to give it special treatment in the high-level API; the "ignore"
condition subsumes the "trusted" condition.
- Define new libval_policy_definition_t structure to encapsulate the
libval-specific policy definition parameters in val_add_valpolicy()
------------------------------------------------------------------------
r4293 | hardaker | 2009-01-22 15:45:13 -0800 (Thu, 22 Jan 2009) | 1 line
move arpa/nameserv include higher since it's needed before the validator headers
------------------------------------------------------------------------
r4282 | hardaker | 2009-01-07 09:53:42 -0800 (Wed, 07 Jan 2009) | 1 line
rename ns_msg_getflag to libsres_msg_getflag to avoid tricky compiling issues
------------------------------------------------------------------------
r4263 | hardaker | 2008-12-09 16:24:40 -0800 (Tue, 09 Dec 2008) | 1 line
rename a variable so it doesn't conflict with the structure name with stricter compilers
------------------------------------------------------------------------
r4239 | hserus | 2008-09-26 11:22:45 -0700 (Fri, 26 Sep 2008) | 3 lines
Fix buffer overflow problem. Still need to figure out how RSAMD5 keys need to be parsed.
------------------------------------------------------------------------
r4238 | hserus | 2008-09-26 08:06:18 -0700 (Fri, 26 Sep 2008) | 2 lines
Do some more sanity checking of input values
------------------------------------------------------------------------
r4225 | hardaker | 2008-08-14 10:53:40 -0700 (Thu, 14 Aug 2008) | 1 line
Add configure checks to test for gethostby* function conformance
------------------------------------------------------------------------
r4214 | hserus | 2008-07-22 07:01:21 -0700 (Tue, 22 Jul 2008) | 2 lines
Don't use random()
------------------------------------------------------------------------
r4213 | hserus | 2008-07-22 06:16:19 -0700 (Tue, 22 Jul 2008) | 2 lines
Use random source port and transaction ids
------------------------------------------------------------------------
r4212 | hserus | 2008-07-09 14:08:06 -0700 (Wed, 09 Jul 2008) | 2 lines
Revert previous change. Code not ready for prime time.
------------------------------------------------------------------------
r4211 | hserus | 2008-07-09 12:52:17 -0700 (Wed, 09 Jul 2008) | 2 lines
Randomize the source port. Code is still not IPv6 safe.
------------------------------------------------------------------------
r4210 | hserus | 2008-07-09 12:46:56 -0700 (Wed, 09 Jul 2008) | 2 lines
Add correct type code for nsec3
------------------------------------------------------------------------
r4161 | hserus | 2008-06-18 14:12:03 -0700 (Wed, 18 Jun 2008) | 2 lines
Add getname objects to the list of files to be cleaned up
------------------------------------------------------------------------
r4160 | hserus | 2008-06-18 13:42:28 -0700 (Wed, 18 Jun 2008) | 2 lines
Initialize retval to NO_ERROR to keep compiler happy
------------------------------------------------------------------------
r4158 | hardaker | 2008-06-18 13:28:08 -0700 (Wed, 18 Jun 2008) | 1 line
use 2.59 and remove double target check
------------------------------------------------------------------------
r4157 | hserus | 2008-06-18 13:25:48 -0700 (Wed, 18 Jun 2008) | 2 lines
Use autoconf 2.59 to create configure script
------------------------------------------------------------------------
r4155 | hardaker | 2008-06-18 13:18:10 -0700 (Wed, 18 Jun 2008) | 1 line
honor datarootdir
------------------------------------------------------------------------
r4148 | hardaker | 2008-06-11 15:02:18 -0700 (Wed, 11 Jun 2008) | 1 line
define getprogname for solaris
------------------------------------------------------------------------
r4147 | hardaker | 2008-06-11 14:06:50 -0700 (Wed, 11 Jun 2008) | 1 line
allow for other types of _r functions to be overridden depending on the system type
------------------------------------------------------------------------
r4146 | hardaker | 2008-06-11 14:05:50 -0700 (Wed, 11 Jun 2008) | 1 line
include LDFLAGS in the shim compilation
------------------------------------------------------------------------
r4145 | hardaker | 2008-06-11 14:05:05 -0700 (Wed, 11 Jun 2008) | 1 line
define a -D flag for setting the operating system type we're compiling for
------------------------------------------------------------------------
r4144 | hardaker | 2008-06-06 16:58:50 -0700 (Fri, 06 Jun 2008) | 1 line
include the validator config file so it picks up the typedefs being used
------------------------------------------------------------------------
r4143 | hserus | 2008-06-04 05:36:24 -0700 (Wed, 04 Jun 2008) | 2 lines
Continue to operate if included file does not exist
------------------------------------------------------------------------
r4142 | hserus | 2008-06-03 16:42:59 -0700 (Tue, 03 Jun 2008) | 2 lines
create a default context if function argument is NULL
------------------------------------------------------------------------
r4141 | hserus | 2008-06-03 16:39:40 -0700 (Tue, 03 Jun 2008) | 2 lines
create a default context if function argument is NULL
------------------------------------------------------------------------
r4140 | hserus | 2008-06-03 16:37:11 -0700 (Tue, 03 Jun 2008) | 2 lines
- create a default context if function argument is NULL
------------------------------------------------------------------------
r4139 | hserus | 2008-06-03 16:31:45 -0700 (Tue, 03 Jun 2008) | 2 lines
NULL check
------------------------------------------------------------------------
r4128 | hserus | 2008-05-30 07:54:44 -0700 (Fri, 30 May 2008) | 2 lines
Set correct defaults for val_astatus_t and val_status_t
------------------------------------------------------------------------
r4127 | hserus | 2008-05-30 07:54:13 -0700 (Fri, 30 May 2008) | 2 lines
Add man files corresponding to the changed pod
------------------------------------------------------------------------
r4126 | hserus | 2008-05-29 12:24:40 -0700 (Thu, 29 May 2008) | 2 lines
Reorder values for VAL_QUERY_DONT_VALIDATE and VAL_QUERY_NO_AC_DETAIL
------------------------------------------------------------------------
r4122 | hardaker | 2008-05-27 15:29:18 -0700 (Tue, 27 May 2008) | 1 line
clean up whitespace
------------------------------------------------------------------------
r4117 | hserus | 2008-05-27 09:57:18 -0700 (Tue, 27 May 2008) | 2 lines
version submitted as draft-hayatnagarkar-dnsext-validator-api-06
------------------------------------------------------------------------
r4116 | hserus | 2008-05-26 15:15:18 -0700 (Mon, 26 May 2008) | 2 lines
More tweaks to API
------------------------------------------------------------------------
r4108 | hardaker | 2008-05-26 08:17:03 -0700 (Mon, 26 May 2008) | 1 line
version number update
------------------------------------------------------------------------
r4107 | hardaker | 2008-05-26 08:14:28 -0700 (Mon, 26 May 2008) | 1 line
update libtool version
------------------------------------------------------------------------
r4106 | hardaker | 2008-05-26 08:09:12 -0700 (Mon, 26 May 2008) | 1 line
copyright updates
------------------------------------------------------------------------
r4100 | hserus | 2008-05-22 19:13:41 -0700 (Thu, 22 May 2008) | 10 lines
* Create function for resetting query params so that it will use EDNS0
the next time it sends out the query
* Set EDNS0 in find_nslist_for_query() in ask_resolver(). Set EDNS0 when we are
looking for some DNSSEC meta-data or if the zone expection is validation.
* Reissue query with EDNS0 if a negative response was returned by a zone
that was authoritative for both parent and child, but only child had a
zone security expectation of validate
* Do not reissue query for positive answers, since this can mess up cname
chains
------------------------------------------------------------------------
r4099 | hserus | 2008-05-22 19:00:50 -0700 (Thu, 22 May 2008) | 2 lines
Add macro to identify DNSSEC meta-data query types
------------------------------------------------------------------------
r4085 | hserus | 2008-05-20 09:53:29 -0700 (Tue, 20 May 2008) | 2 lines
Add a note that, for DLV, zones should not be marked trusted or untrusted
------------------------------------------------------------------------
r4084 | hserus | 2008-05-20 09:48:51 -0700 (Tue, 20 May 2008) | 2 lines
Don't do DLV validation if we've explicitly marked a zone as trusted or untrusted
------------------------------------------------------------------------
r4079 | hserus | 2008-05-19 11:31:36 -0700 (Mon, 19 May 2008) | 2 lines
Expand environment variables in the dnsval.conf "include" line
------------------------------------------------------------------------
r4069 | hardaker | 2008-05-14 16:19:51 -0700 (Wed, 14 May 2008) | 1 line
changed failure wording to use succeeded instead
------------------------------------------------------------------------
r4061 | hserus | 2008-05-12 11:32:04 -0700 (Mon, 12 May 2008) | 2 lines
Return non-existence status codes when available
------------------------------------------------------------------------
r4060 | hserus | 2008-05-12 11:29:01 -0700 (Mon, 12 May 2008) | 2 lines
Print validation status value
------------------------------------------------------------------------
r4059 | hserus | 2008-05-12 10:31:01 -0700 (Mon, 12 May 2008) | 2 lines
Use val_does_not_exist() instead of checking for proof count (which may be 0 when no authentication chain details are returned)
------------------------------------------------------------------------
r4056 | hserus | 2008-05-12 08:36:08 -0700 (Mon, 12 May 2008) | 2 lines
Set correct default return value
------------------------------------------------------------------------
r4050 | hserus | 2008-05-09 06:02:09 -0700 (Fri, 09 May 2008) | 2 lines
Reset the cache head when the current head element times out.
------------------------------------------------------------------------
r4026 | hserus | 2008-05-01 07:23:22 -0700 (Thu, 01 May 2008) | 2 lines
Define freeaddrinfo() if it does not exist
------------------------------------------------------------------------
r4015 | hserus | 2008-04-30 12:23:03 -0700 (Wed, 30 Apr 2008) | 2 lines
Don't increment number of proofs in result structure if we're not going to be storing details about them
------------------------------------------------------------------------
r4014 | hserus | 2008-04-30 12:22:39 -0700 (Wed, 30 Apr 2008) | 2 lines
Specify the VAL_QUERY_NO_AC_DETAIL flag to val_resolve_and_check
------------------------------------------------------------------------
r4013 | hserus | 2008-04-30 12:22:02 -0700 (Wed, 30 Apr 2008) | 2 lines
The -m option is no longer defined.
------------------------------------------------------------------------
r4012 | hserus | 2008-04-30 12:21:26 -0700 (Wed, 30 Apr 2008) | 2 lines
Obsolete val_query/val_free_response and the VAL_QUERY_MERGE_RRSETS flag
------------------------------------------------------------------------
r4009 | hserus | 2008-04-23 10:04:55 -0700 (Wed, 23 Apr 2008) | 2 lines
Change flag size to u_int32_t
------------------------------------------------------------------------
r4008 | hserus | 2008-04-23 10:03:50 -0700 (Wed, 23 Apr 2008) | 2 lines
Change flag size to u_int32_t
------------------------------------------------------------------------
r4007 | hserus | 2008-04-23 10:02:49 -0700 (Wed, 23 Apr 2008) | 2 lines
Change flag size to u_int32_t
------------------------------------------------------------------------
r4006 | hserus | 2008-04-23 10:01:56 -0700 (Wed, 23 Apr 2008) | 2 lines
Change flag size to u_int32_t
------------------------------------------------------------------------
r4005 | hserus | 2008-04-23 08:19:50 -0700 (Wed, 23 Apr 2008) | 2 lines
Make error list ordering consistent with API draft
------------------------------------------------------------------------
r4004 | hserus | 2008-04-23 08:19:30 -0700 (Wed, 23 Apr 2008) | 7 lines
Use single error codes VAL_AC_DNS_ERROR and VAL_DNS_ERROR instead of all the
possible variants
Rename unsecure to insecure
Rename VAL_DONT_GO_FURTHER to VAL_BARE_TRUST_KEY
Use single VAL_BOGUS state instead of differentiating between
VAL_BOGUS_PROVABLE and VAL_BOGUS_UNPROVABLE
------------------------------------------------------------------------
r4003 | hserus | 2008-04-23 08:18:57 -0700 (Wed, 23 Apr 2008) | 2 lines
Rename unsecure to insecure
------------------------------------------------------------------------
r4002 | hserus | 2008-04-23 08:18:35 -0700 (Wed, 23 Apr 2008) | 4 lines
rename unsecure to insecure
Print config file information as LOG_NOTICE
Check for NULL before using global options
------------------------------------------------------------------------
r4001 | hserus | 2008-04-23 08:18:17 -0700 (Wed, 23 Apr 2008) | 2 lines
Use single VAL_DNS_ERROR condition instead of a bunch of types
------------------------------------------------------------------------
r4000 | hserus | 2008-04-23 08:17:55 -0700 (Wed, 23 Apr 2008) | 2 lines
bring doc in sync with current code
------------------------------------------------------------------------
r3999 | hserus | 2008-04-23 08:16:53 -0700 (Wed, 23 Apr 2008) | 4 lines
Document val_get_rrset()
Change size of flags to 32 bits
Change UNSECURE to INSECURE
------------------------------------------------------------------------
r3998 | hserus | 2008-04-23 08:16:10 -0700 (Wed, 23 Apr 2008) | 2 lines
Document val_get_rrset()
------------------------------------------------------------------------
r3997 | hserus | 2008-04-23 08:15:34 -0700 (Wed, 23 Apr 2008) | 2 lines
Add documentation for various command line programs
------------------------------------------------------------------------
r3996 | hserus | 2008-04-23 08:14:38 -0700 (Wed, 23 Apr 2008) | 2 lines
Rename unsecure to insecure
------------------------------------------------------------------------
r3995 | hserus | 2008-04-23 08:14:14 -0700 (Wed, 23 Apr 2008) | 3 lines
Use the dnsval.conf file given with the -d option, else use the system
dnsval.conf file
------------------------------------------------------------------------
r3994 | hserus | 2008-04-23 08:13:45 -0700 (Wed, 23 Apr 2008) | 2 lines
Add usage for -o option
------------------------------------------------------------------------
r3993 | hserus | 2008-04-23 08:13:05 -0700 (Wed, 23 Apr 2008) | 2 lines
Use latest set of error codes from val_errors.h
------------------------------------------------------------------------
r3992 | hserus | 2008-04-23 08:11:44 -0700 (Wed, 23 Apr 2008) | 2 lines
Renamed unsecure to insecure
------------------------------------------------------------------------
r3991 | hserus | 2008-04-23 08:11:18 -0700 (Wed, 23 Apr 2008) | 5 lines
Remove all out of date comments
Replace all DNS error codes with a single error code
Make error list ordering consistent with API draft
Renamed UNSECURE to INSECURE
------------------------------------------------------------------------
r3985 | hserus | 2008-04-21 11:24:27 -0700 (Mon, 21 Apr 2008) | 2 lines
Remande val_query to val_res_query
------------------------------------------------------------------------
r3984 | hserus | 2008-04-21 11:22:49 -0700 (Mon, 21 Apr 2008) | 2 lines
Remove reference to val_query
------------------------------------------------------------------------
r3983 | hserus | 2008-04-17 09:21:55 -0700 (Thu, 17 Apr 2008) | 4 lines
Add documentation on val_log_add_optarg()
Remove description for functions that allow users to manipulate locations for
various configuration files
------------------------------------------------------------------------
r3982 | hserus | 2008-04-16 10:28:59 -0700 (Wed, 16 Apr 2008) | 2 lines
Document some of the new policy hooks
------------------------------------------------------------------------
r3981 | hserus | 2008-04-15 13:38:09 -0700 (Tue, 15 Apr 2008) | 2 lines
Incremental fix for EDNS0; still have to figure out best way to handle EDNS0 queries
------------------------------------------------------------------------
r3980 | hserus | 2008-04-15 13:29:28 -0700 (Tue, 15 Apr 2008) | 3 lines
changes to make dlv logic work a little better. EDNS0 logic in dlv still needs
to be fine-tuned
------------------------------------------------------------------------
r3979 | hserus | 2008-04-15 13:23:34 -0700 (Tue, 15 Apr 2008) | 2 lines
Move code for reading VAL_LOG_TARGET to val_policy
------------------------------------------------------------------------
r3978 | hserus | 2008-04-15 13:22:38 -0700 (Tue, 15 Apr 2008) | 3 lines
Remove existing log targets before adding new ones during a conf file
re-read
------------------------------------------------------------------------
r3977 | hserus | 2008-04-15 13:21:29 -0700 (Tue, 15 Apr 2008) | 4 lines
change val_log_add_* functions so that we add log target to the given list
instead of a static object
Add new funtion val_log_add_optarg_to_list() to add a log target to given list
------------------------------------------------------------------------
r3976 | hserus | 2008-04-15 13:20:25 -0700 (Tue, 15 Apr 2008) | 2 lines
Add log target to context
------------------------------------------------------------------------
r3965 | hserus | 2008-04-10 08:06:58 -0700 (Thu, 10 Apr 2008) | 2 lines
read VAL_LOG_TARGET only after context is created
------------------------------------------------------------------------
r3964 | hserus | 2008-04-10 08:03:50 -0700 (Thu, 10 Apr 2008) | 3 lines
check for in-bailiwick condition before attempting to store name server
information to cache
------------------------------------------------------------------------
r3963 | hserus | 2008-04-10 08:02:44 -0700 (Thu, 10 Apr 2008) | 2 lines
Ensure that log target from environment is specified at the correct time.
------------------------------------------------------------------------
r3960 | marz | 2008-03-27 16:07:39 -0700 (Thu, 27 Mar 2008) | 1 line
fix for linux progname
------------------------------------------------------------------------
r3959 | marz | 2008-03-26 07:23:19 -0700 (Wed, 26 Mar 2008) | 1 line
libval_shim changes related to logging env. var. support in libval
------------------------------------------------------------------------
r3958 | hserus | 2008-03-19 12:28:23 -0700 (Wed, 19 Mar 2008) | 2 lines
Check for non-existence
------------------------------------------------------------------------
r3957 | hserus | 2008-03-19 11:13:55 -0700 (Wed, 19 Mar 2008) | 1 line
rename gopt to g_opt
------------------------------------------------------------------------
r3956 | hserus | 2008-03-19 11:08:07 -0700 (Wed, 19 Mar 2008) | 2 lines
Save current log channel to context
------------------------------------------------------------------------
r3955 | hserus | 2008-03-19 10:28:36 -0700 (Wed, 19 Mar 2008) | 2 lines
Add support for reading logging preference from the VAL_LOG_TARGET env variable and from a "log" global option
------------------------------------------------------------------------
r3954 | hserus | 2008-03-19 10:26:14 -0700 (Wed, 19 Mar 2008) | 2 lines
Add definition for log_target
------------------------------------------------------------------------
r3953 | marz | 2008-03-19 10:23:51 -0700 (Wed, 19 Mar 2008) | 1 line
related changes to support moving policy context label enviroment variable app name logic to libval itself
------------------------------------------------------------------------
r3952 | hserus | 2008-03-18 12:51:06 -0700 (Tue, 18 Mar 2008) | 2 lines
Add default for env-policy and app-policy
------------------------------------------------------------------------
r3951 | hserus | 2008-03-18 12:49:40 -0700 (Tue, 18 Mar 2008) | 4 lines
* rename the_null_context to the_default_context
* the default context is not necessarily the "null" context, since labels may be overriden by global
options. In such cases, the default policy is the overriding policy.
------------------------------------------------------------------------
r3950 | hserus | 2008-03-18 12:49:17 -0700 (Tue, 18 Mar 2008) | 2 lines
Modify prototype for read_val_config_file() function
------------------------------------------------------------------------
r3949 | hserus | 2008-03-18 12:49:05 -0700 (Tue, 18 Mar 2008) | 6 lines
* Add logic to parse new fields in global options
* if there is duplication in policy, use the first definition and ignore later
(instead of doing the reverse)
* Change the dnsval.conf file parsing logic -- allow the app-policy and
env-policy options to control how the files get (re-)read with the correct label.
------------------------------------------------------------------------
r3948 | hserus | 2008-03-18 12:48:16 -0700 (Tue, 18 Mar 2008) | 2 lines
add definitions for app-policy and env-policy global options
------------------------------------------------------------------------
r3947 | hserus | 2008-03-18 08:30:35 -0700 (Tue, 18 Mar 2008) | 2 lines
Check in modified man page
------------------------------------------------------------------------
r3946 | hserus | 2008-03-18 08:04:52 -0700 (Tue, 18 Mar 2008) | 2 lines
Add test program from val_res_query()
------------------------------------------------------------------------
r3945 | hserus | 2008-03-17 08:23:47 -0700 (Mon, 17 Mar 2008) | 2 lines
Remove policy bits that are no longer pertinent
------------------------------------------------------------------------
r3944 | hserus | 2008-03-17 06:41:10 -0700 (Mon, 17 Mar 2008) | 2 lines
Remove keys that had grown stale
------------------------------------------------------------------------
r3941 | hserus | 2008-03-12 07:24:19 -0700 (Wed, 12 Mar 2008) | 2 lines
Change value for VAL_QUERY_MERGE_RRSETS flag
------------------------------------------------------------------------
r3940 | marz | 2008-03-08 11:24:19 -0800 (Sat, 08 Mar 2008) | 1 line
changes relsated to recent API update
------------------------------------------------------------------------
r3939 | hserus | 2008-03-07 07:22:00 -0800 (Fri, 07 Mar 2008) | 3 lines
Use addrinfo instead of val_addrinfo
Use val_get_rrset() instead of val_resolve_and_check()
------------------------------------------------------------------------
r3938 | hserus | 2008-03-07 07:21:44 -0800 (Fri, 07 Mar 2008) | 3 lines
Add new flag to bootstrap_referral() to allow the calling function to specify
that it does not want any partial name server information returned
------------------------------------------------------------------------
r3937 | hserus | 2008-03-07 07:21:23 -0800 (Fri, 07 Mar 2008) | 7 lines
* Rename struct val_rrset to struct val_rrset_rec
* Populate new values of val_result_chain structure: val_rc_rrset and
val_rc_alias
* Rename VAL_QFLAGS_AFFECTS_CACHING to VAL_Q_ONLY_MATCHING_FLAGS
* Do not return complete authentication chain(s) if VAL_QUERY_NO_AC_DETAIL was
specified
------------------------------------------------------------------------
r3936 | hserus | 2008-03-07 07:21:02 -0800 (Fri, 07 Mar 2008) | 3 lines
remove elements in cache that have reached their expiry time
Ensure that nameservers returned from cache are not incomplete
------------------------------------------------------------------------
r3935 | hserus | 2008-03-07 07:20:49 -0800 (Fri, 07 Mar 2008) | 2 lines
Rename struct val_rrset to struct val_rrset_rec
------------------------------------------------------------------------
r3934 | hserus | 2008-03-07 07:20:11 -0800 (Fri, 07 Mar 2008) | 2 lines
Add definition for val_get_rrset() and val_free_answer_chain() functions
------------------------------------------------------------------------
r3933 | hserus | 2008-03-07 07:19:04 -0800 (Fri, 07 Mar 2008) | 2 lines
Use addrinfo instead of val_addrinfo
------------------------------------------------------------------------
r3932 | hserus | 2008-03-07 07:18:38 -0800 (Fri, 07 Mar 2008) | 2 lines
Add new utility for testing the val_get_rrset() function
------------------------------------------------------------------------
r3931 | hserus | 2008-03-07 07:16:17 -0800 (Fri, 07 Mar 2008) | 3 lines
Add description for VAL_QUERY_NO_AC_DETAIL and changes in structure
definitions.
------------------------------------------------------------------------
r3930 | hserus | 2008-03-07 07:15:45 -0800 (Fri, 07 Mar 2008) | 2 lines
Use addrinfo instead of val_addrinfo
------------------------------------------------------------------------
r3929 | hserus | 2008-03-07 07:15:01 -0800 (Fri, 07 Mar 2008) | 3 lines
Remove help for val_query() and val_free_response(). These functions will soon
be obsoleted; only val_res_query() will remain.
------------------------------------------------------------------------
r3928 | hserus | 2008-03-07 07:14:08 -0800 (Fri, 07 Mar 2008) | 19 lines
* Add new flag VAL_QUERY_NO_AC_DETAIL to prevent authentication chain details
from being returned
* Rename VAL_QFLAGS_AFFECTS_CACHING to VAL_Q_ONLY_MATCHING_FLAGS
* Define new struct rr_rec, containing only rr information
* Reorder elements of struct val_rr_rec so that it can be directly typecast to
struct rr_rec
* Rename struct val_rrset to struct val_rrset_rec
* Add two new members to the val_result_chain structure:
- val_rc_alias points to name referenced by the cname/dname alias in result
(if any)
- val_rc_rrset points to the val_rrset_rec structure for the answer
returned in val_rc_answer
* Define new structure val_answer_chain that contains only rrset
information (without details) and validation status for a given
name/class/type
* Add prototypes for new val_get_rrset() and val_free_answer_chain()
functions
------------------------------------------------------------------------
r3927 | hserus | 2008-03-07 07:12:46 -0800 (Fri, 07 Mar 2008) | 2 lines
Rename struct val_rrset to struct val_rrset_rec
------------------------------------------------------------------------
r3925 | marz | 2008-02-25 12:45:04 -0800 (Mon, 25 Feb 2008) | 1 line
libval-shim doc makefile change
------------------------------------------------------------------------
r3924 | marz | 2008-02-25 12:41:48 -0800 (Mon, 25 Feb 2008) | 1 line
libval_shim docs
------------------------------------------------------------------------
r3919 | hserus | 2008-02-22 08:31:27 -0800 (Fri, 22 Feb 2008) | 2 lines
Global search and replace rr_rec to val_rr_rec
------------------------------------------------------------------------
r3918 | hserus | 2008-02-22 08:21:51 -0800 (Fri, 22 Feb 2008) | 2 lines
Dont use the policy label from the enviroment. Delegate this to libval_shim
------------------------------------------------------------------------
r3917 | hserus | 2008-02-22 06:45:18 -0800 (Fri, 22 Feb 2008) | 3 lines
Look for a label specified in the environment VAL_CONTEXT_LABEL if one is not
specified by the application
------------------------------------------------------------------------
r3916 | hserus | 2008-02-22 06:43:10 -0800 (Fri, 22 Feb 2008) | 4 lines
Don't fail if one of the included dnsval.conf files is missing.
Fix order for included dnsval.conf files
Use default /etc/resolv.conf file if user-specified file is missing
------------------------------------------------------------------------
r3915 | hserus | 2008-02-22 06:39:41 -0800 (Fri, 22 Feb 2008) | 3 lines
Define VAL_CONTEXT_LABEL and VAL_DEFAULT_RESOLV_CONF. Also fix algorithm
identifiers for NSEC3
------------------------------------------------------------------------
r3914 | hserus | 2008-02-21 13:16:43 -0800 (Thu, 21 Feb 2008) | 2 lines
Try to operate even if root.hints was missing
------------------------------------------------------------------------
r3913 | hserus | 2008-02-21 10:26:01 -0800 (Thu, 21 Feb 2008) | 2 lines
Don't lose the value of matched_q->qc_ns_list during cname lookup
------------------------------------------------------------------------
r3912 | hserus | 2008-02-21 10:24:50 -0800 (Thu, 21 Feb 2008) | 2 lines
Swap big and little arguments to namename
------------------------------------------------------------------------
r3911 | hserus | 2008-02-21 10:24:23 -0800 (Thu, 21 Feb 2008) | 2 lines
Properly read the "forward" line
------------------------------------------------------------------------
r3910 | hserus | 2008-02-20 11:16:00 -0800 (Wed, 20 Feb 2008) | 2 lines
Updated root.hints
------------------------------------------------------------------------
r3909 | hserus | 2008-02-20 09:46:22 -0800 (Wed, 20 Feb 2008) | 2 lines
Minor fixes
------------------------------------------------------------------------
r3908 | hserus | 2008-02-19 17:29:47 -0800 (Tue, 19 Feb 2008) | 2 lines
Support DS record trust anchors
------------------------------------------------------------------------
r3907 | hserus | 2008-02-18 12:57:20 -0800 (Mon, 18 Feb 2008) | 2 lines
Changes to the API based on comments received
------------------------------------------------------------------------
r3906 | marz | 2008-02-18 08:16:59 -0800 (Mon, 18 Feb 2008) | 1 line
handle val_addrinfo platform specific structure definition
------------------------------------------------------------------------
r3905 | marz | 2008-02-18 08:05:43 -0800 (Mon, 18 Feb 2008) | 1 line
macosx compile
------------------------------------------------------------------------
r3904 | marz | 2008-02-18 08:02:51 -0800 (Mon, 18 Feb 2008) | 1 line
macosx compile
------------------------------------------------------------------------
r3903 | marz | 2008-02-18 07:59:26 -0800 (Mon, 18 Feb 2008) | 1 line
macosx compile
------------------------------------------------------------------------
r3902 | marz | 2008-02-18 07:53:39 -0800 (Mon, 18 Feb 2008) | 1 line
handle getprogname() vs program_invocation_shortname
------------------------------------------------------------------------
r3901 | hserus | 2008-02-18 07:09:42 -0800 (Mon, 18 Feb 2008) | 2 lines
Use autoconf version 2.59
------------------------------------------------------------------------
r3900 | marz | 2008-02-17 10:59:43 -0800 (Sun, 17 Feb 2008) | 1 line
Makefile fixes
------------------------------------------------------------------------
r3899 | marz | 2008-02-17 10:58:55 -0800 (Sun, 17 Feb 2008) | 1 line
add libval_shim suport to validator makefile
------------------------------------------------------------------------
r3898 | marz | 2008-02-17 10:57:54 -0800 (Sun, 17 Feb 2008) | 1 line
add libval_shim support to configure
------------------------------------------------------------------------
r3875 | hserus | 2008-02-14 13:16:48 -0800 (Thu, 14 Feb 2008) | 2 lines
Add another log message during glue fetch operation
------------------------------------------------------------------------
r3874 | hserus | 2008-02-14 13:11:54 -0800 (Thu, 14 Feb 2008) | 2 lines
revert previous change
------------------------------------------------------------------------
r3873 | hserus | 2008-02-14 13:04:28 -0800 (Thu, 14 Feb 2008) | 3 lines
Return EINVAL if address family is neither AF_INET6 nor AF_INET.
------------------------------------------------------------------------
r3872 | hserus | 2008-02-14 12:51:28 -0800 (Thu, 14 Feb 2008) | 2 lines
Fix ciritical bug in validation algorithm: the chain was being marked valid without checking if the key marked as the trust anchor has a signature over the apex DNSKEY RRset.
------------------------------------------------------------------------
r3871 | hserus | 2008-02-14 12:30:03 -0800 (Thu, 14 Feb 2008) | 2 lines
Allow clock skew policy to contain negative values
------------------------------------------------------------------------
r3870 | hserus | 2008-02-14 11:56:36 -0800 (Thu, 14 Feb 2008) | 2 lines
Change order of VAL_FROM_* definitions so that API reads better
------------------------------------------------------------------------
r3864 | marz | 2008-02-13 08:37:54 -0800 (Wed, 13 Feb 2008) | 1 line
doc fixes, fail on unimplemented wrapper
------------------------------------------------------------------------
r3862 | marz | 2008-02-12 17:27:46 -0800 (Tue, 12 Feb 2008) | 1 line
libval shim README
------------------------------------------------------------------------
r3861 | marz | 2008-02-12 15:45:27 -0800 (Tue, 12 Feb 2008) | 1 line
handle context creation based on app name or env var LIBVAL_SHIM_CONTEXT
------------------------------------------------------------------------
r3857 | marz | 2008-02-11 16:00:12 -0800 (Mon, 11 Feb 2008) | 1 line
set logging only once
------------------------------------------------------------------------
r3856 | marz | 2008-02-11 13:54:22 -0800 (Mon, 11 Feb 2008) | 1 line
fixes to val_getnameinfo() and val_getaddrinfo() flag handling
------------------------------------------------------------------------
r3850 | marz | 2008-02-08 10:39:40 -0800 (Fri, 08 Feb 2008) | 1 line
libval_shim fixes
------------------------------------------------------------------------
r3849 | marz | 2008-02-07 08:32:19 -0800 (Thu, 07 Feb 2008) | 1 line
fix port and service handling in getnameinfo
------------------------------------------------------------------------
r3848 | marz | 2008-02-07 08:30:30 -0800 (Thu, 07 Feb 2008) | 1 line
fix port passing
------------------------------------------------------------------------
r3847 | marz | 2008-02-06 14:02:02 -0800 (Wed, 06 Feb 2008) | 1 line
make support
------------------------------------------------------------------------
r3846 | marz | 2008-02-06 12:32:50 -0800 (Wed, 06 Feb 2008) | 1 line
make support
------------------------------------------------------------------------
r3845 | marz | 2008-02-06 09:32:53 -0800 (Wed, 06 Feb 2008) | 1 line
fix getaddrinfo for locally trusted answer
------------------------------------------------------------------------
r3844 | marz | 2008-02-04 15:29:42 -0800 (Mon, 04 Feb 2008) | 1 line
fixed return of trusted result
------------------------------------------------------------------------
r3843 | marz | 2008-02-04 13:38:36 -0800 (Mon, 04 Feb 2008) | 1 line
wrappers for key functions
------------------------------------------------------------------------
r3842 | marz | 2008-02-04 12:47:02 -0800 (Mon, 04 Feb 2008) | 1 line
testprogram for getnameinfo
------------------------------------------------------------------------
r3826 | marz | 2008-01-24 12:09:48 -0800 (Thu, 24 Jan 2008) | 1 line
libval_shim infrastructure
------------------------------------------------------------------------
r3825 | marz | 2008-01-24 11:47:20 -0800 (Thu, 24 Jan 2008) | 1 line
libval_shim infrastructure
------------------------------------------------------------------------
r3812 | rstory | 2008-01-08 15:44:48 -0800 (Tue, 08 Jan 2008) | 1 line
ignore generated files
------------------------------------------------------------------------
r3811 | rstory | 2008-01-08 15:42:42 -0800 (Tue, 08 Jan 2008) | 1 line
ignore generated files
------------------------------------------------------------------------
r3810 | rstory | 2008-01-08 15:29:58 -0800 (Tue, 08 Jan 2008) | 1 line
use $(RM) instead of rm
------------------------------------------------------------------------
r3767 | hserus | 2007-10-29 13:14:40 -0700 (Mon, 29 Oct 2007) | 2 lines
Add new key for dnssec-tools.org
------------------------------------------------------------------------
r3766 | hserus | 2007-10-29 13:03:23 -0700 (Mon, 29 Oct 2007) | 2 lines
Add SNIP zones to dnsval.conf file
------------------------------------------------------------------------
r3762 | rstory | 2007-10-09 08:18:25 -0700 (Tue, 09 Oct 2007) | 1 line
add OpenBSD to list of systems w/non const res_sym
------------------------------------------------------------------------
r3761 | rstory | 2007-10-09 08:15:04 -0700 (Tue, 09 Oct 2007) | 3 lines
do not include local arpa/header.h if system one exists
define NS_ versions of (H|Q|RR)FIXEDSZ if needed
------------------------------------------------------------------------
r3760 | rstory | 2007-10-09 08:12:38 -0700 (Tue, 09 Oct 2007) | 1 line
do not include local arpa/header.h if system one exists
------------------------------------------------------------------------
r3759 | rstory | 2007-10-09 06:47:35 -0700 (Tue, 09 Oct 2007) | 1 line
define various constants if not found in any system header
------------------------------------------------------------------------
r3758 | rstory | 2007-10-09 06:46:19 -0700 (Tue, 09 Oct 2007) | 1 line
do not include local arpa/header.h if system one exists
------------------------------------------------------------------------
r3757 | rstory | 2007-10-09 06:44:24 -0700 (Tue, 09 Oct 2007) | 1 line
use EINVAL instead of EBADMSG
------------------------------------------------------------------------
r3756 | rstory | 2007-10-09 06:43:43 -0700 (Tue, 09 Oct 2007) | 1 line
include pthreads if needed
------------------------------------------------------------------------
r3754 | hserus | 2007-10-05 06:48:49 -0700 (Fri, 05 Oct 2007) | 3 lines
Define the EAI_NODATA code if it is not defined by the system (FreeBSD for
example)
------------------------------------------------------------------------
r3753 | hserus | 2007-10-05 06:17:25 -0700 (Fri, 05 Oct 2007) | 2 lines
Use the predefined __NetBSD__ instead of defining a new macro
------------------------------------------------------------------------
r3752 | hserus | 2007-10-05 06:06:50 -0700 (Fri, 05 Oct 2007) | 2 lines
Export ns_get(put)16(32) symbols from libsres
------------------------------------------------------------------------
r3751 | hserus | 2007-10-05 06:01:23 -0700 (Fri, 05 Oct 2007) | 2 lines
Hack to declare different prototypes for ns_(get/put)(16/32)
------------------------------------------------------------------------
r3750 | hserus | 2007-10-04 12:29:53 -0700 (Thu, 04 Oct 2007) | 2 lines
Use select if pselect is not available
------------------------------------------------------------------------
r3749 | hserus | 2007-10-04 08:31:18 -0700 (Thu, 04 Oct 2007) | 2 lines
Use exact sizes for ttl and clock skew
------------------------------------------------------------------------
r3748 | hserus | 2007-10-04 08:08:45 -0700 (Thu, 04 Oct 2007) | 2 lines
Be precise about sizes
------------------------------------------------------------------------
r3746 | hserus | 2007-09-28 06:50:27 -0700 (Fri, 28 Sep 2007) | 2 lines
Add closing bracket if nsec3 is not defined
------------------------------------------------------------------------
r3745 | hserus | 2007-09-26 13:13:51 -0700 (Wed, 26 Sep 2007) | 3 lines
Set the default resolv.conf file to be empty, so that validate has a better chance of succeeding.
------------------------------------------------------------------------
r3744 | hserus | 2007-09-25 20:28:49 -0700 (Tue, 25 Sep 2007) | 2 lines
Revert previous change. Better to check for portability before commiting this change in.
------------------------------------------------------------------------
r3743 | hserus | 2007-09-25 20:26:12 -0700 (Tue, 25 Sep 2007) | 2 lines
Export symbols for ns_getxx and ns_putxx. This will probabaly have some portability issues, so it will need to be tested.
------------------------------------------------------------------------
r3732 | hserus | 2007-09-25 07:32:40 -0700 (Tue, 25 Sep 2007) | 2 lines
Re-introduce the ns_netint.c file
------------------------------------------------------------------------
r3731 | hserus | 2007-09-25 07:31:39 -0700 (Tue, 25 Sep 2007) | 4 lines
Use label_bytes_cmp in place of nsec3_order_cmp.
Changed log levels for certain log messages
Perform sanity check of zonecut seen on RRSIGs for DS records
------------------------------------------------------------------------
r3730 | hserus | 2007-09-25 07:28:21 -0700 (Tue, 25 Sep 2007) | 5 lines
No longer using recursive logic for labelcmp. Instead, break this function into
two sub-functions: label_bytes_cmp and labelcmp. No longer using
nsec3_order_cmp since this is exactly the same as label_bytes_cmp.
------------------------------------------------------------------------
r3729 | hserus | 2007-09-25 07:16:47 -0700 (Tue, 25 Sep 2007) | 2 lines
Do not bypass zonecut saving logic when current zonecut is NULL
------------------------------------------------------------------------
r3728 | hserus | 2007-09-25 07:14:33 -0700 (Tue, 25 Sep 2007) | 2 lines
Change log level for an informational message
------------------------------------------------------------------------
r3727 | hserus | 2007-09-25 07:12:12 -0700 (Tue, 25 Sep 2007) | 2 lines
flush log data once we write to the file
------------------------------------------------------------------------
r3724 | rstory | 2007-09-18 12:45:42 -0700 (Tue, 18 Sep 2007) | 1 line
include netinet/in.h (FreeBSD needs it)
------------------------------------------------------------------------
r3707 | rstory | 2007-09-14 12:44:54 -0700 (Fri, 14 Sep 2007) | 1 line
usr DESTDIR when removing old man files
------------------------------------------------------------------------
r3706 | rstory | 2007-09-14 12:37:40 -0700 (Fri, 14 Sep 2007) | 1 line
use DESTDIR when creating directories
------------------------------------------------------------------------
r3702 | hardaker | 2007-09-14 09:13:01 -0700 (Fri, 14 Sep 2007) | 1 line
make libval-config use the proper PACKAGE_VERSION autoconf variable
------------------------------------------------------------------------
r3694 | tewok | 2007-09-13 20:58:21 -0700 (Thu, 13 Sep 2007) | 3 lines
Typo fix.
------------------------------------------------------------------------
r3673 | hserus | 2007-09-12 07:34:31 -0700 (Wed, 12 Sep 2007) | 2 lines
Fix info message
------------------------------------------------------------------------
r3670 | tewok | 2007-09-11 09:53:19 -0700 (Tue, 11 Sep 2007) | 3 lines
Pod mods.
------------------------------------------------------------------------
r3668 | tewok | 2007-09-11 08:52:32 -0700 (Tue, 11 Sep 2007) | 3 lines
Pod mods.
------------------------------------------------------------------------
r3664 | hserus | 2007-09-11 07:14:50 -0700 (Tue, 11 Sep 2007) | 2 lines
Initialize global option members to correct values
------------------------------------------------------------------------
r3659 | tewok | 2007-09-10 19:03:47 -0700 (Mon, 10 Sep 2007) | 3 lines
Pod mods.
------------------------------------------------------------------------
r3658 | tewok | 2007-09-10 13:25:35 -0700 (Mon, 10 Sep 2007) | 3 lines
Pod mods.
------------------------------------------------------------------------
r3657 | tewok | 2007-09-10 11:59:22 -0700 (Mon, 10 Sep 2007) | 3 lines
Pod mods.
------------------------------------------------------------------------
r3647 | hardaker | 2007-09-07 16:56:01 -0700 (Fri, 07 Sep 2007) | 1 line
update libtool components to matching versions
------------------------------------------------------------------------
r3645 | hardaker | 2007-09-07 16:06:48 -0700 (Fri, 07 Sep 2007) | 1 line
make full validator test cases path to include DESTDIR
------------------------------------------------------------------------
r3644 | hardaker | 2007-09-07 16:02:34 -0700 (Fri, 07 Sep 2007) | 1 line
PROPERLY escape a dollar sign
------------------------------------------------------------------------
r3643 | hardaker | 2007-09-07 15:58:14 -0700 (Fri, 07 Sep 2007) | 1 line
escape a non-make dollar sign
------------------------------------------------------------------------
r3638 | hserus | 2007-09-07 08:00:48 -0700 (Fri, 07 Sep 2007) | 2 lines
Use the configure script generated by autoconf version 2.59
------------------------------------------------------------------------
r3637 | rstory | 2007-09-06 11:50:33 -0700 (Thu, 06 Sep 2007) | 1 line
use crypto/sha2.h if available
------------------------------------------------------------------------
r3636 | rstory | 2007-09-06 11:50:08 -0700 (Thu, 06 Sep 2007) | 1 line
check for crypto/sha2.h header
------------------------------------------------------------------------
r3635 | rstory | 2007-09-06 11:46:24 -0700 (Thu, 06 Sep 2007) | 1 line
use ifdefs around defines that might be missing
------------------------------------------------------------------------
r3634 | rstory | 2007-09-06 10:49:49 -0700 (Thu, 06 Sep 2007) | 1 line
move unlock a little earlier to prevent deadlock
------------------------------------------------------------------------
r3606 | rstory | 2007-08-24 07:32:31 -0700 (Fri, 24 Aug 2007) | 1 line
add ifdef for testing multi-threaded default ctx creation
------------------------------------------------------------------------
r3605 | rstory | 2007-08-24 07:28:28 -0700 (Fri, 24 Aug 2007) | 1 line
fix deadlock when freeing default context
------------------------------------------------------------------------
r3604 | rstory | 2007-08-24 07:12:33 -0700 (Fri, 24 Aug 2007) | 3 lines
- use PTHREAD_MUTEX_INITIALIZER to eliminate race condition initializing mutex
- when creating default context, hold lock until done creating context
------------------------------------------------------------------------
r3603 | hserus | 2007-08-23 14:18:31 -0700 (Thu, 23 Aug 2007) | 4 lines
Use RES_GET/PUT in place of NS_GET/PUT. These macros automatically increment the buf pointer as it reads or
stores data.
Also use u_int16_t class, u_int16_t type in the res_val_nmkquery prototype
------------------------------------------------------------------------
r3602 | hserus | 2007-08-23 14:15:18 -0700 (Thu, 23 Aug 2007) | 2 lines
Add macros for RES_PUT16 and RES_PUT32
------------------------------------------------------------------------
r3601 | rstory | 2007-08-22 10:26:40 -0700 (Wed, 22 Aug 2007) | 1 line
use new internal header
------------------------------------------------------------------------
r3600 | rstory | 2007-08-22 10:25:22 -0700 (Wed, 22 Aug 2007) | 1 line
dont define RES_USE_EDNS0 if it's already defined
------------------------------------------------------------------------
r3599 | rstory | 2007-08-22 10:24:27 -0700 (Wed, 22 Aug 2007) | 2 lines
move some structures to an internal, non-installed header
------------------------------------------------------------------------
r3597 | hserus | 2007-08-21 14:01:20 -0700 (Tue, 21 Aug 2007) | 2 lines
Removed ns_netint.c. Used NS_PUT/GET in place of ns_put/get
------------------------------------------------------------------------
r3593 | hserus | 2007-08-20 14:17:01 -0700 (Mon, 20 Aug 2007) | 2 lines
Account for NULL trust anchors when zone security expectation is validate
------------------------------------------------------------------------
r3592 | hserus | 2007-08-20 13:24:59 -0700 (Mon, 20 Aug 2007) | 2 lines
hack for res_sym_const should not be used on NetBSD systems
------------------------------------------------------------------------
r3591 | hserus | 2007-08-20 10:58:56 -0700 (Mon, 20 Aug 2007) | 2 lines
Add target for libval_check_conf
------------------------------------------------------------------------
r3590 | hserus | 2007-08-20 10:57:19 -0700 (Mon, 20 Aug 2007) | 2 lines
Added -D_GNU_SOURCE compile flag
------------------------------------------------------------------------
r3586 | hserus | 2007-08-02 09:17:42 -0700 (Thu, 02 Aug 2007) | 2 lines
Add documentation for the libval_check_conf utility.
------------------------------------------------------------------------
r3585 | hserus | 2007-07-31 11:12:44 -0700 (Tue, 31 Jul 2007) | 2 lines
Give detailed log message when duplicate policy labels are detected
------------------------------------------------------------------------
r3584 | hserus | 2007-07-31 11:09:51 -0700 (Tue, 31 Jul 2007) | 2 lines
Set default debug level to 5
------------------------------------------------------------------------
r3583 | hserus | 2007-07-31 11:04:59 -0700 (Tue, 31 Jul 2007) | 2 lines
remove stray newline character
------------------------------------------------------------------------
r3582 | hserus | 2007-07-31 10:54:54 -0700 (Tue, 31 Jul 2007) | 2 lines
Add sample global-options policy and a placeholder for other included files
------------------------------------------------------------------------
r3581 | hserus | 2007-07-31 10:48:12 -0700 (Tue, 31 Jul 2007) | 4 lines
Moved definition for "global-policy" string to val_policy.h
Define a new structure for specifying a list of dnsval.conf files. Each file has its own last-modified
timstamp. Add this structure in place of the dnsval_conf member in val_context_t
------------------------------------------------------------------------
r3580 | hserus | 2007-07-31 10:47:39 -0700 (Tue, 31 Jul 2007) | 3 lines
val_refresh_resolver_policy, val_refresh_root_hints and val_refresh_validator_policy now return an error
code instead of void.
------------------------------------------------------------------------
r3579 | hserus | 2007-07-31 10:47:24 -0700 (Tue, 31 Jul 2007) | 4 lines
val_refresh_resolver_policy, val_refresh_root_hints and val_refresh_validator_policy now return an error
code based on the locking status instead of void.
Initialize dnsval.conf list instead of single element
------------------------------------------------------------------------
r3578 | hserus | 2007-07-31 10:47:03 -0700 (Tue, 31 Jul 2007) | 5 lines
val_refresh_resolver_policy, val_refresh_root_hints and val_refresh_validator_policy now return an error
code instead of void.
When checking if conf files have changed, look at all dnsval.conf files in the list maintained within
val_context_t
------------------------------------------------------------------------
r3577 | hserus | 2007-07-31 10:46:47 -0700 (Tue, 31 Jul 2007) | 2 lines
Add definitions for "global-policy" and "include" strings
------------------------------------------------------------------------
r3576 | hserus | 2007-07-31 10:46:27 -0700 (Tue, 31 Jul 2007) | 4 lines
Recognize the "include" policy fragment in the dnsval.conf file
Free up dnsval list structure in destroy_valpol()
Parse all dnsval.conf files included using the "include" clause
------------------------------------------------------------------------
r3575 | hserus | 2007-07-31 09:48:20 -0700 (Tue, 31 Jul 2007) | 2 lines
initialize clock_skew to 0
------------------------------------------------------------------------
r3574 | hserus | 2007-07-31 09:45:56 -0700 (Tue, 31 Jul 2007) | 2 lines
include for struct timeval definition
------------------------------------------------------------------------
r3573 | hserus | 2007-07-31 09:37:54 -0700 (Tue, 31 Jul 2007) | 2 lines
Add dnsval.conf check program
------------------------------------------------------------------------
r3548 | hardaker | 2007-07-11 15:55:12 -0700 (Wed, 11 Jul 2007) | 1 line
add sys/fcntl.h which is required at least on solaris
------------------------------------------------------------------------
r3546 | hserus | 2007-07-11 08:57:30 -0700 (Wed, 11 Jul 2007) | 2 lines
No longer treating VAL_LOCAL_ANSWER as trusted by default.
------------------------------------------------------------------------
r3545 | hserus | 2007-07-11 08:57:12 -0700 (Wed, 11 Jul 2007) | 3 lines
Set the validation status for local answers to one of either VAL_TRUSTED_ANSWER or VAL_LOCAL_ANSWER
depending on the "trust-local-answers" global option.
------------------------------------------------------------------------
r3544 | hserus | 2007-07-11 08:56:45 -0700 (Wed, 11 Jul 2007) | 4 lines
Removed policies that we're not implementing.
Add parse routines for dnsval.conf global options
Add function to test if dnsval.conf defines local answers as trusted
------------------------------------------------------------------------
r3543 | hserus | 2007-07-11 08:56:19 -0700 (Wed, 11 Jul 2007) | 6 lines
Moved EDNS_UDP_SIZE from resolver.h to validator.h
Removed policy definitions that we're not implementing.
Added policy definitions for global options.
Define new structure for global options; add it as a member of val_context_t.
Added definitions for SHA-256 DS algorithm
------------------------------------------------------------------------
r3542 | hserus | 2007-07-11 08:56:06 -0700 (Wed, 11 Jul 2007) | 3 lines
Moved EDNS_UDP_SIZE from resolver.h to validator.h
Allow edns0 buf size to be specified as an argument to query_send()
------------------------------------------------------------------------
r3541 | hserus | 2007-07-11 08:55:41 -0700 (Wed, 11 Jul 2007) | 2 lines
Allow edns0 buf size to be specified as an argument to query_send()
------------------------------------------------------------------------
r3540 | hserus | 2007-07-11 08:54:14 -0700 (Wed, 11 Jul 2007) | 2 lines
Add support for SHA-256 DS algorithm
------------------------------------------------------------------------
r3539 | hserus | 2007-07-11 08:44:08 -0700 (Wed, 11 Jul 2007) | 2 lines
Replace atoi() with strtol()
------------------------------------------------------------------------
r3538 | hserus | 2007-07-11 08:28:20 -0700 (Wed, 11 Jul 2007) | 2 lines
Removed the VAL_AC_LOCAL_ANSWER state
------------------------------------------------------------------------
r3537 | hserus | 2007-07-11 07:54:14 -0700 (Wed, 11 Jul 2007) | 2 lines
Fixed typo
------------------------------------------------------------------------
r3532 | hserus | 2007-07-06 12:18:55 -0700 (Fri, 06 Jul 2007) | 2 lines
Use VAL_DNS_RESPONSE_ERROR in place of VAL_ERROR
------------------------------------------------------------------------
r3531 | hserus | 2007-07-06 12:17:45 -0700 (Fri, 06 Jul 2007) | 4 lines
Use new status values from validator-api-04
Add new "proof" param to get_ac_trust, which controls the type of assertion (answer or proof) that is
returned; use the proof to identify loops in DS nonexistence answers
------------------------------------------------------------------------
r3530 | hserus | 2007-07-06 12:09:59 -0700 (Fri, 06 Jul 2007) | 2 lines
USE new Q_ERROR status values instead of storing offsets to resolver errors
------------------------------------------------------------------------
r3529 | hserus | 2007-07-06 12:08:44 -0700 (Fri, 06 Jul 2007) | 2 lines
Handled newly defined types from validator-api-04
------------------------------------------------------------------------
r3528 | hserus | 2007-07-06 12:07:15 -0700 (Fri, 06 Jul 2007) | 2 lines
Return servfail as the rcode on error responses created in val_res_query()
------------------------------------------------------------------------
r3527 | hserus | 2007-07-06 12:06:20 -0700 (Fri, 06 Jul 2007) | 2 lines
Use SR_HEADER_ERROR for all header errors in libsres
------------------------------------------------------------------------
r3526 | hserus | 2007-07-06 12:05:35 -0700 (Fri, 06 Jul 2007) | 2 lines
Use new validator status code definitions
------------------------------------------------------------------------
r3525 | hserus | 2007-07-06 12:04:35 -0700 (Fri, 06 Jul 2007) | 2 lines
Renaming and re-arranging status codes. Sync'd up with latest validator API draft.
------------------------------------------------------------------------
r3524 | hserus | 2007-07-06 11:29:08 -0700 (Fri, 06 Jul 2007) | 2 lines
Don't set qc_state if there was a parse error in cached data; simply pretend that data was not available.
------------------------------------------------------------------------
r3523 | hserus | 2007-07-06 11:13:55 -0700 (Fri, 06 Jul 2007) | 2 lines
Use VAL_LOCAL_ANSWER status if answer was obtained locally
------------------------------------------------------------------------
r3522 | hserus | 2007-07-06 11:11:08 -0700 (Fri, 06 Jul 2007) | 2 lines
Use VAL_AC_ALGORITHM_NOT_SUPPORTED in plac eof VAL_AC_UNKNOWN_ALGORITHM
------------------------------------------------------------------------
r3521 | hserus | 2007-07-06 11:09:06 -0700 (Fri, 06 Jul 2007) | 2 lines
Bring pod in sync with draft-hayatnagarkar-dnsext-validator-api-04
------------------------------------------------------------------------
r3520 | hserus | 2007-07-06 11:07:58 -0700 (Fri, 06 Jul 2007) | 2 lines
Version that was submitted as draft-hayatnagarkar-dnsext-validator-api-04
------------------------------------------------------------------------
r3517 | hserus | 2007-07-05 06:19:47 -0700 (Thu, 05 Jul 2007) | 2 lines
Create the default NULL context in val_context.c
------------------------------------------------------------------------
r3514 | hserus | 2007-07-04 09:02:58 -0700 (Wed, 04 Jul 2007) | 2 lines
Do a better job of identifying the wildcard proof
------------------------------------------------------------------------
r3513 | hserus | 2007-07-04 09:02:35 -0700 (Wed, 04 Jul 2007) | 2 lines
Don't erase key status when we use a cached assertion
------------------------------------------------------------------------
r3510 | hserus | 2007-07-03 11:42:26 -0700 (Tue, 03 Jul 2007) | 2 lines
Add separator between different proof components
------------------------------------------------------------------------
r3501 | hserus | 2007-06-28 19:10:36 -0700 (Thu, 28 Jun 2007) | 2 lines
Change timestamp format
------------------------------------------------------------------------
r3500 | hserus | 2007-06-28 18:31:37 -0700 (Thu, 28 Jun 2007) | 3 lines
Check return values for val_parse_...() functions
Display timestamps on log messages
------------------------------------------------------------------------
r3499 | hserus | 2007-06-28 18:31:25 -0700 (Thu, 28 Jun 2007) | 2 lines
Removing trailing newline characters in log messages
------------------------------------------------------------------------
r3498 | hserus | 2007-06-28 18:31:06 -0700 (Thu, 28 Jun 2007) | 3 lines
Check return values for val_parse_...() functions
Use both ends of the NSEC span while determining the closest enclosure
------------------------------------------------------------------------
r3497 | hserus | 2007-06-28 18:30:53 -0700 (Thu, 28 Jun 2007) | 2 lines
Check return values for val_parse_...() functions
------------------------------------------------------------------------
r3496 | hserus | 2007-06-28 18:30:33 -0700 (Thu, 28 Jun 2007) | 3 lines
perform proper clean-up of query when we have a valid answer
Perform early timeout when DNS errors occur
------------------------------------------------------------------------
r3495 | hserus | 2007-06-28 18:30:11 -0700 (Thu, 28 Jun 2007) | 2 lines
Add new function for performing early timeouts DNS errors occur
------------------------------------------------------------------------
r3494 | hserus | 2007-06-28 18:29:50 -0700 (Thu, 28 Jun 2007) | 3 lines
Adjust code for zero retry value
Add new function for performing early timeouts DNS errors occur
------------------------------------------------------------------------
r3493 | hserus | 2007-06-28 18:29:19 -0700 (Thu, 28 Jun 2007) | 2 lines
changed default number of retries to 0
------------------------------------------------------------------------
r3487 | hserus | 2007-06-26 13:34:50 -0700 (Tue, 26 Jun 2007) | 2 lines
Add new check_wildcard param to check_anc_proof() prototype
------------------------------------------------------------------------
r3486 | hserus | 2007-06-26 13:34:01 -0700 (Tue, 26 Jun 2007) | 5 lines
Try verifying more of the proof-of-nonexistence before claiming that it matches via ANC
Correctly differentiate between missing proofs and proofs containing both NSEC and NSEC3 recs
Display appropriate message when ask_resolver() or ask_cache() get a error response
Properly identify timeouts of trust data so that assertion status can change back to VAL_AC_WAIT_FOR_TRUST
------------------------------------------------------------------------
r3485 | hserus | 2007-06-26 13:20:47 -0700 (Tue, 26 Jun 2007) | 2 lines
Don't match a CNAME/DNAME for an RRSIG query
------------------------------------------------------------------------
r3484 | hserus | 2007-06-26 13:19:32 -0700 (Tue, 26 Jun 2007) | 2 lines
Continue to ask other name servers if we see some error rcode in the response
------------------------------------------------------------------------
r3464 | hserus | 2007-06-20 09:04:17 -0700 (Wed, 20 Jun 2007) | 2 lines
Authentication chain information is now being logged in val_resolve_and_check()
------------------------------------------------------------------------
r3463 | hserus | 2007-06-20 09:02:09 -0700 (Wed, 20 Jun 2007) | 3 lines
Log authentication chain information before we return from val_resolve_and_check() instead of outside this
function.
------------------------------------------------------------------------
r3461 | hserus | 2007-06-18 08:28:05 -0700 (Mon, 18 Jun 2007) | 2 lines
Add a log message
------------------------------------------------------------------------
r3458 | hserus | 2007-06-14 15:33:59 -0700 (Thu, 14 Jun 2007) | 2 lines
Set correct label value during context creation
------------------------------------------------------------------------
r3424 | hserus | 2007-06-07 07:23:50 -0700 (Thu, 07 Jun 2007) | 2 lines
Move thread-specific debug messages into #ifndef VAL_NO_THREADS block
------------------------------------------------------------------------
r3420 | hserus | 2007-06-06 12:42:33 -0700 (Wed, 06 Jun 2007) | 2 lines
Fix bug in check if type exists in bitmap
------------------------------------------------------------------------
r3415 | hserus | 2007-06-05 12:35:20 -0700 (Tue, 05 Jun 2007) | 2 lines
Display actual thread identifier in debug messages
------------------------------------------------------------------------
r3414 | hserus | 2007-06-05 12:29:33 -0700 (Tue, 05 Jun 2007) | 2 lines
Instead of continuously polling libsres for data, block using the pselect() call
------------------------------------------------------------------------
r3411 | hserus | 2007-06-01 11:22:01 -0700 (Fri, 01 Jun 2007) | 3 lines
Revert change# 3410. The code is still not MT-safe
------------------------------------------------------------------------
r3410 | hserus | 2007-06-01 07:55:35 -0700 (Fri, 01 Jun 2007) | 2 lines
Instead of continuously polling libsres for data, block on a select() call
------------------------------------------------------------------------
r3409 | hserus | 2007-06-01 07:37:55 -0700 (Fri, 01 Jun 2007) | 3 lines
Perfom correct check for VAL_QFLAGS_ANY
Use available assertion status value when copying DLV to DS
------------------------------------------------------------------------
r3408 | hardaker | 2007-05-31 16:47:11 -0700 (Thu, 31 May 2007) | 1 line
use proper destdir prefix when making paths and installing
------------------------------------------------------------------------
r3405 | hserus | 2007-05-30 14:10:58 -0700 (Wed, 30 May 2007) | 2 lines
Display separate ASCII strings for the VAL_DONT_KNOW, VAL_BOGUS_PROVABLE and VAL_BAD_PROVABLY_UNSECURE conditions
------------------------------------------------------------------------
r3404 | hserus | 2007-05-30 14:10:41 -0700 (Wed, 30 May 2007) | 5 lines
- Extract relevant portions from add_to_qfq_chain() to create a new function check_in_qfq_chain()
- Rename find_next_soa() to find_next_zonecut(); rename old find_next_zonecut() to find_next_zonecut_old()
- In the new find_new_zonecut() function, don't issue SOA queries if we already have answers for the DNSKEY or DS records
- Continue to evaluate status for authentication chain elements even if some parent element is known to be provably insecure
------------------------------------------------------------------------
r3403 | hserus | 2007-05-30 14:09:51 -0700 (Wed, 30 May 2007) | 2 lines
Define new flag for all bits set
------------------------------------------------------------------------
r3402 | hserus | 2007-05-25 14:31:02 -0700 (Fri, 25 May 2007) | 2 lines
still more typos
------------------------------------------------------------------------
r3401 | hserus | 2007-05-25 14:15:41 -0700 (Fri, 25 May 2007) | 2 lines
Fix more typos
------------------------------------------------------------------------
r3400 | hserus | 2007-05-25 13:44:20 -0700 (Fri, 25 May 2007) | 2 lines
More updates to the validator api
------------------------------------------------------------------------
r3398 | hserus | 2007-05-24 08:01:46 -0700 (Thu, 24 May 2007) | 2 lines
First pass at trying to bring the validator API in sync with the latest set of changes to libval
------------------------------------------------------------------------
r3397 | hserus | 2007-05-24 08:01:10 -0700 (Thu, 24 May 2007) | 2 lines
Add description for val_add_valpolicy() and val_remove_valpolicy()
------------------------------------------------------------------------
r3396 | hserus | 2007-05-24 07:49:51 -0700 (Thu, 24 May 2007) | 2 lines
Slight tweaking of log messages
------------------------------------------------------------------------
r3395 | hserus | 2007-05-24 07:46:17 -0700 (Thu, 24 May 2007) | 3 lines
Update val_add_valpolicy() so that we return the policy handle
Add new val_remove_valpolicy() function
------------------------------------------------------------------------
r3394 | hserus | 2007-05-24 07:46:06 -0700 (Thu, 24 May 2007) | 3 lines
Update val_add_valpolicy() so that we return the policy handle
Add new val_remove_valpolicy() function
------------------------------------------------------------------------
r3393 | hserus | 2007-05-24 07:44:45 -0700 (Thu, 24 May 2007) | 2 lines
Properly align the end statement character in the policy definitions.
------------------------------------------------------------------------
r3392 | hserus | 2007-05-24 07:43:45 -0700 (Thu, 24 May 2007) | 2 lines
Added description for VAL_BOGUS_PROVABLE
------------------------------------------------------------------------
r3391 | hserus | 2007-05-24 07:42:54 -0700 (Thu, 24 May 2007) | 2 lines
Pretty up some of the ASCII art
------------------------------------------------------------------------
r3390 | hserus | 2007-05-24 07:41:56 -0700 (Thu, 24 May 2007) | 4 lines
Define new policy for val_policy_entry_t
Update prototype for val_add_valpolicy()
Add prototype for val_remove_valpolicy()
------------------------------------------------------------------------
r3380 | rstory | 2007-05-22 15:40:40 -0700 (Tue, 22 May 2007) | 1 line
change default test verbosity down another notch
------------------------------------------------------------------------
r3378 | rstory | 2007-05-22 15:27:41 -0700 (Tue, 22 May 2007) | 3 lines
- add ability to overrise debug verbosity for make test
- change default level from 6 to 5, to account for recent shuffling of verbosity levels
------------------------------------------------------------------------
r3375 | hardaker | 2007-05-22 15:16:44 -0700 (Tue, 22 May 2007) | 1 line
various fixes to allow validator-testcases to be installed in a user configurable place
------------------------------------------------------------------------
r3360 | hserus | 2007-05-18 11:34:38 -0700 (Fri, 18 May 2007) | 4 lines
Updated date on copyright notice.
Moved the fix_glue function from val_assertion.c to val_resquery.c
Removed definitions for some static functions
------------------------------------------------------------------------
r3359 | hserus | 2007-05-18 11:34:20 -0700 (Fri, 18 May 2007) | 4 lines
Updated date on copyright notice.
Moved check_label_count() to val_verfy.c
Moved prepare_empty_nxdomain() to val_resquery.c
------------------------------------------------------------------------
r3358 | hserus | 2007-05-18 11:33:59 -0700 (Fri, 18 May 2007) | 4 lines
Updated date on copyright notice.
Add some more comments and log messages
Moved the fix_glue function from val_assertion.c to val_resquery.c
------------------------------------------------------------------------
r3357 | hserus | 2007-05-18 11:33:35 -0700 (Fri, 18 May 2007) | 4 lines
Updated date on copyright notice.
Moved check_label_count() to val_verfy.c
Moved prepare_empty_nxdomain() to val_resquery.c
------------------------------------------------------------------------
r3356 | hserus | 2007-05-18 11:33:01 -0700 (Fri, 18 May 2007) | 5 lines
Updated date on copyright notice.
Add some more comments and log messages
In functions that use the val_internal_result structure, use the query flags from the result structure
Move the fix_glue function to val_resquery.c
------------------------------------------------------------------------
r3355 | hserus | 2007-05-18 11:32:35 -0700 (Fri, 18 May 2007) | 6 lines
Updated date on copyright notice.
Add some more comments and log messages
Remove unused functions
Moved check_label_count from val_support.c to val_verify.c and made it static
Correctly identify a delegation that does not link upward
------------------------------------------------------------------------
r3354 | hserus | 2007-05-18 11:31:59 -0700 (Fri, 18 May 2007) | 2 lines
Updated date on copyright notice.
------------------------------------------------------------------------
r3353 | hserus | 2007-05-18 11:30:41 -0700 (Fri, 18 May 2007) | 3 lines
Updated date on copyright notice.
Add some more comments and log messages
------------------------------------------------------------------------
r3352 | hserus | 2007-05-18 11:29:51 -0700 (Fri, 18 May 2007) | 5 lines
Updated date on copyright notice.
Add some more comments and log messages
Changed ordering of some functions in the file
Ensure that correct error value is returned from compose_answer()
------------------------------------------------------------------------
r3350 | hserus | 2007-05-18 09:33:26 -0700 (Fri, 18 May 2007) | 3 lines
Update date on copyright notice
Change logging level for authentication chain to LOG_NOTICE
------------------------------------------------------------------------
r3349 | hserus | 2007-05-18 09:32:08 -0700 (Fri, 18 May 2007) | 2 lines
Update date on copyright notice
------------------------------------------------------------------------
r3348 | hserus | 2007-05-18 09:24:05 -0700 (Fri, 18 May 2007) | 2 lines
Added info on p_val_err()
------------------------------------------------------------------------
r3347 | hserus | 2007-05-18 09:22:38 -0700 (Fri, 18 May 2007) | 2 lines
added: see also syslog
------------------------------------------------------------------------
r3346 | hserus | 2007-05-18 09:20:12 -0700 (Fri, 18 May 2007) | 2 lines
Update date on copyright notice
------------------------------------------------------------------------
r3331 | hardaker | 2007-05-15 12:35:00 -0700 (Tue, 15 May 2007) | 1 line
updated output text to match file being talked about
------------------------------------------------------------------------
r3329 | hardaker | 2007-05-15 12:34:11 -0700 (Tue, 15 May 2007) | 1 line
updated output text to match file being talked about
------------------------------------------------------------------------
r3325 | hardaker | 2007-05-15 12:12:00 -0700 (Tue, 15 May 2007) | 1 line
use sysconfdir for mkpath instead of prefix
------------------------------------------------------------------------
r3323 | rstory | 2007-05-15 08:33:50 -0700 (Tue, 15 May 2007) | 3 lines
- set VAL_LOCAL_ANSWER when NI_NUMERICHOST set for val_getnameinfo
- use unsigned char when printing ipaddr strings
------------------------------------------------------------------------
r3306 | hserus | 2007-05-07 09:01:08 -0700 (Mon, 07 May 2007) | 2 lines
Define new function for printing the return value from functions in an ASCII format
------------------------------------------------------------------------
r3305 | hserus | 2007-05-07 09:00:51 -0700 (Mon, 07 May 2007) | 2 lines
Set query status to Q_ANSWERED when an empty nxdomain/nodata answer is received
------------------------------------------------------------------------
r3304 | hserus | 2007-05-07 09:00:18 -0700 (Mon, 07 May 2007) | 2 lines
Store respondent_server information in empty nxdomain response
------------------------------------------------------------------------
r3303 | hserus | 2007-05-07 09:00:03 -0700 (Mon, 07 May 2007) | 3 lines
Store respondent_server information in empty nxdomain response
Check for NULL respondent_server in copy_rrset_rec()
------------------------------------------------------------------------
r3302 | hserus | 2007-05-07 08:59:45 -0700 (Mon, 07 May 2007) | 4 lines
Using a common SR_ANS_NACK answer "kind" instead of three separate values: SR_ANS_NACK_NSEC, SR_ANS_NACK_NSEC3 and SR_ANS_NACK_SOA
No data condition does not require the SOA record to be present.
Store proper flag status in error result
------------------------------------------------------------------------
r3301 | hserus | 2007-05-07 08:59:13 -0700 (Mon, 07 May 2007) | 3 lines
Using a common SR_ANS_NACK answer "kind" instead of three separate values: SR_ANS_NACK_NSEC, SR_ANS_NACK_NSEC3 and SR_ANS_NACK_SOA
Define prototype for p_val_err()
------------------------------------------------------------------------
r3271 | hserus | 2007-04-30 15:16:28 -0700 (Mon, 30 Apr 2007) | 2 lines
If no answers are returned from the DNS, the validation status is untrusted
------------------------------------------------------------------------
r3265 | hserus | 2007-04-27 10:25:28 -0700 (Fri, 27 Apr 2007) | 2 lines
Initialize provably unsecure status
------------------------------------------------------------------------
r3264 | hserus | 2007-04-27 08:56:54 -0700 (Fri, 27 Apr 2007) | 2 lines
Add some logging info for bogus proofs
------------------------------------------------------------------------
r3260 | hserus | 2007-04-26 13:42:26 -0700 (Thu, 26 Apr 2007) | 2 lines
Don't export the p_query_status and val_refresh_* functions
------------------------------------------------------------------------
r3259 | hserus | 2007-04-26 13:34:06 -0700 (Thu, 26 Apr 2007) | 6 lines
While looking for a validated result keep going up looking for trust anchors at a higher level if the trust
anchor at the current level does not match.
Allow unlimited TTL for nsec3 iterations policy
Add VAL_NONEXISTENT_NAME_NOCHAIN to the list of non-existence conditions
------------------------------------------------------------------------
r3258 | hserus | 2007-04-26 13:28:42 -0700 (Thu, 26 Apr 2007) | 2 lines
Update copyright date
------------------------------------------------------------------------
r3257 | hserus | 2007-04-26 13:28:13 -0700 (Thu, 26 Apr 2007) | 2 lines
Dont display (incorrect) query status
------------------------------------------------------------------------
r3256 | hserus | 2007-04-26 13:27:08 -0700 (Thu, 26 Apr 2007) | 2 lines
Update copyright date
------------------------------------------------------------------------
r3255 | hserus | 2007-04-26 13:25:33 -0700 (Thu, 26 Apr 2007) | 2 lines
Description of command-line tools is already available in the docs/ directory
------------------------------------------------------------------------
r3254 | hserus | 2007-04-26 13:23:44 -0700 (Thu, 26 Apr 2007) | 3 lines
Say which configure flags are supported.
------------------------------------------------------------------------
r3253 | hserus | 2007-04-26 13:22:52 -0700 (Thu, 26 Apr 2007) | 2 lines
Update pod for libval
------------------------------------------------------------------------
r3252 | hserus | 2007-04-26 13:14:38 -0700 (Thu, 26 Apr 2007) | 2 lines
Comment out NSEC3 tests
------------------------------------------------------------------------
r3251 | hserus | 2007-04-26 13:12:07 -0700 (Thu, 26 Apr 2007) | 2 lines
Move VAL_AC_DATA_MISSING to the list of "bad state" conditions
------------------------------------------------------------------------
r3249 | marz | 2007-04-26 06:26:01 -0700 (Thu, 26 Apr 2007) | 1 line
remove debug
------------------------------------------------------------------------
r3248 | marz | 2007-04-26 06:13:33 -0700 (Thu, 26 Apr 2007) | 1 line
fixes for perl resolve_and_check and docs
------------------------------------------------------------------------
r3245 | hserus | 2007-04-25 08:38:05 -0700 (Wed, 25 Apr 2007) | 2 lines
Handle negative proofs in DLV in a better manner.
------------------------------------------------------------------------
r3244 | hserus | 2007-04-24 14:09:42 -0700 (Tue, 24 Apr 2007) | 2 lines
Ignore signature expiration times for zones under fruits.netsec.tislabs.com instead of netsec.tislabs.com
------------------------------------------------------------------------
r3243 | hserus | 2007-04-24 14:06:32 -0700 (Tue, 24 Apr 2007) | 2 lines
Add sample dlv policy
------------------------------------------------------------------------
r3242 | hserus | 2007-04-24 14:03:26 -0700 (Tue, 24 Apr 2007) | 30 lines
- Always use query_for_query chain in order to access assertions, so that qfq_flags can be appropriately
honored
- Reset alias information in reset_query_chain_node()
- add_to_query_chain() directly adds element to list within context
- Added new function val_does_not_exist() that returns true if one of the nonexistence types is returned
- Handle root zone in find_trust_point()
- Handle root zone in is_trusted_key()
- Renamed check_conflicting_answers() as try_build_chain() because the function also calls
build_pending_query()
- Ifdef out find_next_zonecut()
- Invoke loop detection logic when trying to merge glue into referral
- bug fix in fetching cached rrset for cname owner
- Modify verify_provably_unsecure so that it proves non-existence for a name instead of the entire
authentication chain element
- DLV implementation:
- added new function find_dlv_trust_point() to identify trustpoint and target for a given query name
- added new function replace_name_in_name() to create name in DLV tree
- added new function check_anc_proof() to check aggressive negative cache
- added new function find_dlv_record() to do exactly that
- added new function set_dlv_branchoff() to create the link between the normal tree and the DLV tree
- defined new 'flags' member for val_internal_result. Flags may be different for each result chain (one
may use DLV while the other may not need to)
- modified get_zse() (and is_trusted_key also) to return correct zone security expectation while
building authentication chain
- move general sanity checking of results into a separate function, fix_validation_result, invoked from
verify_and_validate() to better assist in determining when to invoke the DLV logic
- re-wrote much of the negative proof checking logic in order to support ANC
- logic to kickstart DLV when val_isvalidated() returns false
- logic to check provably insecure condition chaining down from the DLV tree
------------------------------------------------------------------------
r3241 | hserus | 2007-04-24 14:02:42 -0700 (Tue, 24 Apr 2007) | 4 lines
- Always use query_for_query chain in order to access assertions, so that qfq_flags can be appropriately
honored
- Added prototypes for val_does_not_exist() and check_anc_proof()
------------------------------------------------------------------------
r3240 | hserus | 2007-04-24 14:02:30 -0700 (Tue, 24 Apr 2007) | 4 lines
- Add new structure for allowing detection of glue fetch loops
- Always use query_for_query chain in order to access assertions, so that qfq_flags can be appropriately
honored
------------------------------------------------------------------------
r3239 | hserus | 2007-04-24 14:01:44 -0700 (Tue, 24 Apr 2007) | 12 lines
- Always use query_for_query chain in order to access assertions, so that qfq_flags can be appropriately
honored
- Detect loops in the glue fetch operation
- Move logic of using root hints for a root referral from follow_referral_or_alias_link to
bootstrap_referral, since the second function is the common denominator
- When fetching glue for nameservers where other zone ns's are known, jumpstart the lookup process from the
known name server list
- register the query with the referral monitor only if the referral was actually sent, not if we are still
waiting for glue
- Now keeping track of learned zone information in the struct delegation_info. Save name server information
in the cache only when we have all information about it (including glue)
------------------------------------------------------------------------
r3238 | hserus | 2007-04-24 14:01:26 -0700 (Tue, 24 Apr 2007) | 2 lines
- Initialize the learned_zones member in ALLOCATE_REFERRAL_BLOCK
------------------------------------------------------------------------
r3237 | hserus | 2007-04-24 14:00:55 -0700 (Tue, 24 Apr 2007) | 5 lines
- Moved const string definitions from val_policy.h to validator.h
- Removed dlv-max-links policy definition
- Add data structure for DLV trust point maintenance
- In val_get_token() qualify the comment arg with "const"
------------------------------------------------------------------------
r3236 | hserus | 2007-04-24 14:00:40 -0700 (Tue, 24 Apr 2007) | 2 lines
- Intialize ttl only when the variable is created.
------------------------------------------------------------------------
r3235 | hserus | 2007-04-24 14:00:28 -0700 (Tue, 24 Apr 2007) | 3 lines
- change get_nslist_from_cache() prototype so that we can pass the query_for_query structure to
bootstrap_referral()
------------------------------------------------------------------------
r3234 | hserus | 2007-04-24 14:00:12 -0700 (Tue, 24 Apr 2007) | 4 lines
- Removed dlv-max-links policy handling
- Added parse function for DLV policy
- In val_get_token() qualify the comment arg with "const"
------------------------------------------------------------------------
r3233 | hserus | 2007-04-24 13:59:37 -0700 (Tue, 24 Apr 2007) | 2 lines
- Minor ifdef twiddle
------------------------------------------------------------------------
r3232 | hserus | 2007-04-24 13:59:23 -0700 (Tue, 24 Apr 2007) | 2 lines
- Recognize the DLV typecode
------------------------------------------------------------------------
r3231 | hserus | 2007-04-24 13:59:05 -0700 (Tue, 24 Apr 2007) | 2 lines
- In val_get_token(), qualify the comment arg with "const"
------------------------------------------------------------------------
r3230 | hserus | 2007-04-24 13:58:28 -0700 (Tue, 24 Apr 2007) | 10 lines
- Re-structured flags to val_resolve_and_check (query flags in the lower nibble, internal flags in the upper nibble)
- Defined new query flags for DLV
- Added new definition for glue dependency chain max length
- Removed definition for dlv-max-links policy
- Moved const string definitions from val_policy.h to validator.h
- Now keeping track of learned zone information in the struct delegation_info. Save name server information
in the cache only when we have all information about it (including glue)
- Define new flags member for val_internal_result. Flags may be different for each result chain (one may use DLV while the other may not need to)
- Added proto for val_does_not_exist()
------------------------------------------------------------------------
r3229 | hserus | 2007-04-24 13:57:48 -0700 (Tue, 24 Apr 2007) | 2 lines
- Defined typecode for DLV
------------------------------------------------------------------------
r3210 | hserus | 2007-04-17 12:26:43 -0700 (Tue, 17 Apr 2007) | 2 lines
Perform proper transformation of the wildcard proof into the result structure.
------------------------------------------------------------------------
r3207 | hserus | 2007-04-17 06:58:07 -0700 (Tue, 17 Apr 2007) | 3 lines
Support multiple comment characters for the same config file
resolv.conf can use either ; or # as the comment character
------------------------------------------------------------------------
r3201 | hserus | 2007-04-13 14:38:19 -0700 (Fri, 13 Apr 2007) | 2 lines
Some more fine-tuning of the wildcard proof checking logic
------------------------------------------------------------------------
r3199 | hserus | 2007-04-13 13:25:41 -0700 (Fri, 13 Apr 2007) | 8 lines
- set initial value of ttl only during variable creation
- set ttl type as u_int32_t instead of long
- split the provably unsecure check into two functions - one for span check and the other for wildcard
check. Make the test for wildcard optional through a param.
- ifdef out the prove_existence function
- When checking for wildcard sanity check for the non-existence of the name instead of the existence of the
wildcard
------------------------------------------------------------------------
r3198 | hserus | 2007-04-13 13:25:16 -0700 (Fri, 13 Apr 2007) | 2 lines
set ttl type as u_int32_t instead of long
------------------------------------------------------------------------
r3197 | hserus | 2007-04-13 13:24:43 -0700 (Fri, 13 Apr 2007) | 2 lines
In val_log_assertion_chain show NULL results
------------------------------------------------------------------------
r3189 | hserus | 2007-04-10 14:00:35 -0700 (Tue, 10 Apr 2007) | 2 lines
Add new qfq_flags member to the queries_for_query structure
------------------------------------------------------------------------
r3187 | hserus | 2007-04-10 11:24:37 -0700 (Tue, 10 Apr 2007) | 2 lines
Display return code and validation status code
------------------------------------------------------------------------
r3186 | hserus | 2007-04-10 11:16:19 -0700 (Tue, 10 Apr 2007) | 2 lines
Ensure that val_status gets set even when names do not exist
------------------------------------------------------------------------
r3184 | rstory | 2007-04-10 05:56:03 -0700 (Tue, 10 Apr 2007) | 4 lines
- support for val_res_search
- look for and parse 'search' in resolv.conf
- use search path for single label queries
------------------------------------------------------------------------
r3153 | hserus | 2007-04-03 13:04:53 -0700 (Tue, 03 Apr 2007) | 2 lines
Add rrsigs to the query response
------------------------------------------------------------------------
r3152 | hserus | 2007-04-03 11:54:10 -0700 (Tue, 03 Apr 2007) | 2 lines
run autoheader
------------------------------------------------------------------------
r3151 | hserus | 2007-04-03 11:27:54 -0700 (Tue, 03 Apr 2007) | 2 lines
Make sure that user-supplied flags are not lost
------------------------------------------------------------------------
r3150 | hserus | 2007-04-03 11:23:35 -0700 (Tue, 03 Apr 2007) | 2 lines
Made nsec3 and dlv configure logic similar to that of ipv6
------------------------------------------------------------------------
r3149 | rstory | 2007-04-03 09:19:50 -0700 (Tue, 03 Apr 2007) | 1 line
initialize uninitialized variables
------------------------------------------------------------------------
r3148 | rstory | 2007-04-03 09:19:09 -0700 (Tue, 03 Apr 2007) | 1 line
for test target, use local selftest config, and only run default suite
------------------------------------------------------------------------
r3147 | rstory | 2007-04-03 09:10:49 -0700 (Tue, 03 Apr 2007) | 5 lines
- fix socket size param in connect() call to keep OS X happy
- add more debugging outpu
- don't loop beyond FD_SETSIZE
- fix param to inet_ntop()
------------------------------------------------------------------------
r3143 | rstory | 2007-03-30 12:01:36 -0700 (Fri, 30 Mar 2007) | 4 lines
- fix prefix in val_sysconfdir
- use AH_TEMPATE instead of AC_DEFINE, since we don't have the real value yet
- fix with-ipv6 logic
------------------------------------------------------------------------
r3142 | hserus | 2007-03-30 07:37:11 -0700 (Fri, 30 Mar 2007) | 2 lines
Rename DLV to LIBVAL_DLV
------------------------------------------------------------------------
r3140 | hserus | 2007-03-30 07:20:46 -0700 (Fri, 30 Mar 2007) | 2 lines
Rename is_trusted_zone to get_zse
------------------------------------------------------------------------
r3139 | hserus | 2007-03-30 07:13:45 -0700 (Fri, 30 Mar 2007) | 2 lines
Use correct lock init var for the name server map
------------------------------------------------------------------------
r3137 | rstory | 2007-03-29 13:43:00 -0700 (Thu, 29 Mar 2007) | 2 lines
add --with-ipv6
------------------------------------------------------------------------
r3136 | rstory | 2007-03-29 13:36:43 -0700 (Thu, 29 Mar 2007) | 2 lines
IPv6 support
------------------------------------------------------------------------
r3133 | rstory | 2007-03-27 14:30:20 -0700 (Tue, 27 Mar 2007) | 1 line
bump libcurrent
------------------------------------------------------------------------
r3129 | hserus | 2007-03-27 06:43:32 -0700 (Tue, 27 Mar 2007) | 3 lines
Maintain a merged_glue_ns list that keeps track of all glue that was already available or fetched in the
past. Query state moves from Q_WAIT_FOR_GLUE to Q_INIT only if all outstanding glue was fetched.
------------------------------------------------------------------------
r3128 | hserus | 2007-03-27 06:43:07 -0700 (Tue, 27 Mar 2007) | 4 lines
- While finding zonecut for DS record, leading qname label must be removed
- VAL_QUERY_GLUE_REQUEST implies VAL_FLAGS_DONT_VALIDATE
- Q_WAIT_FOR_GLUE can only move to the Q_INIT state. Perform correct check in fix_glue
------------------------------------------------------------------------
r3127 | hserus | 2007-03-27 06:42:48 -0700 (Tue, 27 Mar 2007) | 2 lines
- Initialize merged glue list
------------------------------------------------------------------------
r3126 | hserus | 2007-03-27 06:42:15 -0700 (Tue, 27 Mar 2007) | 3 lines
- In the delegation_info structure, replace pointer to glue with a list of merged glue records
- VAL_QUERY_GLUE_REQUEST implies VAL_FLAGS_DONT_VALIDATE
------------------------------------------------------------------------
r3107 | hserus | 2007-03-23 12:03:27 -0700 (Fri, 23 Mar 2007) | 2 lines
Add prototype for free_validator_state()
------------------------------------------------------------------------
r3106 | hserus | 2007-03-23 12:03:17 -0700 (Fri, 23 Mar 2007) | 3 lines
Keep track of the context created for a NULL label. Return this object instead of creating fresh ones for
subsequent calls.
------------------------------------------------------------------------
r3105 | hserus | 2007-03-23 12:02:57 -0700 (Fri, 23 Mar 2007) | 2 lines
Create a temporary context if the one supplied by the user was NULL
------------------------------------------------------------------------
r3104 | hserus | 2007-03-23 12:02:07 -0700 (Fri, 23 Mar 2007) | 2 lines
Don't free the context internally created for a NULL label
------------------------------------------------------------------------
r3103 | hserus | 2007-03-23 12:01:17 -0700 (Fri, 23 Mar 2007) | 4 lines
free the null context in addition to the validator caches
removed the ONE_CTX logic. This will not work if NULL contexts internally refer to a common object
------------------------------------------------------------------------
r3102 | hserus | 2007-03-23 12:00:40 -0700 (Fri, 23 Mar 2007) | 2 lines
Export free_validator_state() instead of free_validator_cache()
------------------------------------------------------------------------
r3099 | hserus | 2007-03-23 07:26:05 -0700 (Fri, 23 Mar 2007) | 2 lines
Remove separate policy for expired sigs. The clock skew policy subsumes this functionality.
------------------------------------------------------------------------
r3098 | hserus | 2007-03-23 06:32:16 -0700 (Fri, 23 Mar 2007) | 3 lines
Moved string definitions for policies from val_policy.h to validator.h in order to allow functions such as
val_add_valpolicy() to be able to make use of it.
------------------------------------------------------------------------
r3094 | hserus | 2007-03-22 13:05:36 -0700 (Thu, 22 Mar 2007) | 2 lines
Add ability to test multi-threading situation
------------------------------------------------------------------------
r3093 | hserus | 2007-03-22 13:00:14 -0700 (Thu, 22 Mar 2007) | 2 lines
Since policy_entry_t is now a defined type, allocate memory for it
------------------------------------------------------------------------
r3092 | hserus | 2007-03-22 12:59:52 -0700 (Thu, 22 Mar 2007) | 2 lines
Add macro for setting ttl to the minimum reasonable value
------------------------------------------------------------------------
r3091 | hserus | 2007-03-22 12:59:37 -0700 (Thu, 22 Mar 2007) | 3 lines
Moved query locking macros from val_assertion.c
Added/modified prototypes
------------------------------------------------------------------------
r3090 | hserus | 2007-03-22 12:59:16 -0700 (Thu, 22 Mar 2007) | 7 lines
Moved query locking macros to val_assertion.h
Define new function for resetting a query to its initial state
Make sure we honor the ttl on the policy fragments when setting ttl on query and authentication chain
structres
Remove the older verify_provably_unsecure function
Fix bug in data_missing/data_received logic
------------------------------------------------------------------------
r3089 | hserus | 2007-03-22 12:59:00 -0700 (Thu, 22 Mar 2007) | 7 lines
In RETRIEVE_POLICY, remove expired policies from the list of returned policy_entry_t structures
Change prototypes for parse routines: they now accept buf pointers instead of FILE pointers and don't
expect the "end statement" character to be present.
Since policy_entry_t contains zone and next pointer information, remove these members from the
policy-specific data structures.
Add prototypes for functions.
------------------------------------------------------------------------
r3088 | hserus | 2007-03-22 12:58:48 -0700 (Thu, 22 Mar 2007) | 2 lines
Make sure we honor the ttl on the policy fragments
------------------------------------------------------------------------
r3087 | hserus | 2007-03-22 12:58:25 -0700 (Thu, 22 Mar 2007) | 11 lines
Add new function to add a validator policy to the context for a specific time duration
Modified val_get_token so that it read from a character buffer instead of a FILE *
Add logic to merge/free policies into the context's policy_entry_t* array
Modified the parse routines: they now accept buf pointers instead of FILE pointers and don't
expect the "end statement" character to be present. This is to allow a user supplied policy blob to also be
parsed.
The free routines for the policy structures are similarly modified so that they only look at what is inside
the policy, and not the policy_entry_t list itself.
Since zone information is common to all policies read it in a common place outside the parse routine; same
with adding the new policy in the policy_entry_t list
------------------------------------------------------------------------
r3086 | hserus | 2007-03-22 12:58:06 -0700 (Thu, 22 Mar 2007) | 2 lines
Modified read_val_testcase_file so that it made use of the new val_get_token function.
------------------------------------------------------------------------
r3085 | hserus | 2007-03-22 12:57:33 -0700 (Thu, 22 Mar 2007) | 4 lines
Re-defined policy_entry_t as a regular container structure
No longer maintain list of overrides; instead work off the policy_entry_t* array
Add prototype for val_add_valpolicy
------------------------------------------------------------------------
r3081 | hardaker | 2007-03-22 06:22:38 -0700 (Thu, 22 Mar 2007) | 1 line
properly honor DESTDIR in more locations
------------------------------------------------------------------------
r3067 | hardaker | 2007-03-19 16:23:19 -0700 (Mon, 19 Mar 2007) | 1 line
set modes properly on installed headers
------------------------------------------------------------------------
r3063 | hserus | 2007-03-16 07:12:34 -0700 (Fri, 16 Mar 2007) | 2 lines
Fix null pointer exception
------------------------------------------------------------------------
r3058 | hserus | 2007-03-15 08:01:35 -0700 (Thu, 15 Mar 2007) | 2 lines
Indentation
------------------------------------------------------------------------
r3057 | hserus | 2007-03-15 07:47:54 -0700 (Thu, 15 Mar 2007) | 2 lines
Add new policies
------------------------------------------------------------------------
r3056 | hserus | 2007-03-15 07:38:43 -0700 (Thu, 15 Mar 2007) | 2 lines
Apply the default policy by default. i.e. don't expect the user to specify a trailing : in the policy scope
------------------------------------------------------------------------
r3054 | baerm | 2007-03-14 14:46:11 -0700 (Wed, 14 Mar 2007) | 3 lines
stdio.h needed to be included for the use of file io
(i.e. 'FILE' type)
------------------------------------------------------------------------
r3050 | hserus | 2007-03-13 12:30:42 -0700 (Tue, 13 Mar 2007) | 3 lines
Ignore name compression and lowercasing for NSEC. Also handle other types defined by
RFC4033
------------------------------------------------------------------------
r3049 | hserus | 2007-03-13 11:16:53 -0700 (Tue, 13 Mar 2007) | 6 lines
Identify glue status through a query flag instead of maintaining a separate member within the query
structure
Be careful about not overwriting previous query states with new ones
While doing the parallel fetch for DS records, dont look at the value of RES_USE_DNSSEC, since glue
fetching logic can mess this up. Instead, explicitly look for the trust point and see if we are below it.
------------------------------------------------------------------------
r3048 | hserus | 2007-03-13 11:16:36 -0700 (Tue, 13 Mar 2007) | 2 lines
Exposing the find_trust_point() to other files in the library
------------------------------------------------------------------------
r3047 | hserus | 2007-03-13 11:16:23 -0700 (Tue, 13 Mar 2007) | 6 lines
Identify glue status through a query flag instead of maintaining a separate member within the query
structure
Be careful about not overwriting previous query states with new ones
Merge pending glue in a separate function. That way we can ensure that we haven't missed any query.
Now exposing the find_trust_point() to other files in the library
------------------------------------------------------------------------
r3046 | hserus | 2007-03-13 11:16:01 -0700 (Tue, 13 Mar 2007) | 3 lines
Identify glue status through a query flag instead of maintaining a separate member within the query
structure
------------------------------------------------------------------------
r3042 | hserus | 2007-03-12 12:02:48 -0700 (Mon, 12 Mar 2007) | 2 lines
Fetch DNSSEC meta-data in parallel while following referrals.
------------------------------------------------------------------------
r3041 | hserus | 2007-03-12 09:20:43 -0700 (Mon, 12 Mar 2007) | 2 lines
Handle _SKEW error codes. Also handle missing WCARD_VERIFIED code.
------------------------------------------------------------------------
r3040 | hserus | 2007-03-12 09:20:27 -0700 (Mon, 12 Mar 2007) | 2 lines
Recognize the _SKEW rrsig codes as success values.
------------------------------------------------------------------------
r3039 | hserus | 2007-03-12 09:20:16 -0700 (Mon, 12 Mar 2007) | 2 lines
use clock-skew policy while determining security status of zone
------------------------------------------------------------------------
r3038 | hserus | 2007-03-12 09:20:03 -0700 (Mon, 12 Mar 2007) | 2 lines
Define policy structure for clock-skew
------------------------------------------------------------------------
r3037 | hserus | 2007-03-12 09:19:52 -0700 (Mon, 12 Mar 2007) | 3 lines
Implement policy for per-zone clock-skew defintion
Perform proper free of the prov_unsecure_policy structure in free_prov_unsecure_status
------------------------------------------------------------------------
r3036 | hserus | 2007-03-12 09:19:20 -0700 (Mon, 12 Mar 2007) | 2 lines
Deleted definition for SIG_ACCEPT_WINDOW. We now use the clock-skew policy to define this.
------------------------------------------------------------------------
r3035 | hserus | 2007-03-12 09:19:09 -0700 (Mon, 12 Mar 2007) | 2 lines
Added definitions for the "rrsig verified with skew" condition
------------------------------------------------------------------------
r3034 | hserus | 2007-03-09 14:56:14 -0800 (Fri, 09 Mar 2007) | 2 lines
- Display validator status code for VAL_BAD_PROVABLY_UNSECURE
------------------------------------------------------------------------
r3033 | hserus | 2007-03-09 14:56:01 -0800 (Fri, 09 Mar 2007) | 3 lines
- Fix the logic where zonecut information was incorrectly getting overwritten
- Fix return type for is_trusted_zone() so that error codes can be propagated upward
------------------------------------------------------------------------
r3032 | hserus | 2007-03-09 14:55:43 -0800 (Fri, 09 Mar 2007) | 2 lines
- Fix return type for is_trusted_zone() so that error codes can be propagated upward
------------------------------------------------------------------------
r3031 | hserus | 2007-03-09 14:55:26 -0800 (Fri, 09 Mar 2007) | 4 lines
- Fix return type for is_trusted_zone() so that error codes can be propagated upward
- Implement function to check if provably insecure condition is trusted or no.
- If this state is not trusted set the result code to VAL_BAD_PROVABLY_UNSECURE
------------------------------------------------------------------------
r3030 | hserus | 2007-03-09 14:55:07 -0800 (Fri, 09 Mar 2007) | 2 lines
- Add definitions for provably insecure related policy
------------------------------------------------------------------------
r3029 | hserus | 2007-03-09 14:54:53 -0800 (Fri, 09 Mar 2007) | 3 lines
- Reorganize policy parse functions around the READ_ZONE_AND_VALUE and STORE_POLICY_FOR_ZONE macros
- Define new policy that allows us to specify if the provably insecure condition is trusted or no
------------------------------------------------------------------------
r3028 | hserus | 2007-03-09 14:54:35 -0800 (Fri, 09 Mar 2007) | 2 lines
- Add new validator status for the "bad" provably insecure condition
------------------------------------------------------------------------
r3022 | hserus | 2007-03-08 12:53:31 -0800 (Thu, 08 Mar 2007) | 2 lines
Use VAL_BOGUS_UNPROVABLE state instead of VAL_INDETERMINATE
------------------------------------------------------------------------
r3021 | hserus | 2007-03-08 12:52:24 -0800 (Thu, 08 Mar 2007) | 2 lines
Moved find_next_zonecut function to val_assertion.c
------------------------------------------------------------------------
r3020 | hserus | 2007-03-08 12:51:37 -0800 (Thu, 08 Mar 2007) | 2 lines
Perform top-down validation while verifying if a name is provably unsecure
------------------------------------------------------------------------
r3002 | hserus | 2007-03-02 13:00:35 -0800 (Fri, 02 Mar 2007) | 2 lines
Fixed some older test cases
------------------------------------------------------------------------
r3001 | hserus | 2007-03-02 12:58:31 -0800 (Fri, 02 Mar 2007) | 10 lines
- Implement timeout logic for validator cache
- Implement bad-cache logic
- No longer accessing the trust assertion using the
val_ac_trust pointer. Instead, look for the trust point
through the queries_for_query cache
- Modifiy prototype of various functions to allow access
to the queries_for_query cache
- Dont use the VAL_INDETERMINATE_PROOF status code, instead
use VAL_BOGUS_PROOF
------------------------------------------------------------------------
r3000 | hserus | 2007-03-02 12:58:14 -0800 (Fri, 02 Mar 2007) | 3 lines
- Correctly set the zonecut information for DS records
obtained while following referrals
------------------------------------------------------------------------
r2999 | hserus | 2007-03-02 12:58:02 -0800 (Fri, 02 Mar 2007) | 3 lines
- No longer accessing the trust assertion using the
val_ac_trust pointer
------------------------------------------------------------------------
r2998 | hserus | 2007-03-02 12:57:36 -0800 (Fri, 02 Mar 2007) | 10 lines
- Add definitions for bad cache TTL and threshold
- Removed pending query logic; we need to go and look
for our pending query from the queries_for_query cache
depending on the state of the assertion.
- No longer maintain a pointer to val_ac_trust.
If data in our cache times out the value will not
be trustworthy.
- Store TTL expiry and bad cache status in the
val_query_chain structure
------------------------------------------------------------------------
r2997 | hserus | 2007-03-02 12:24:19 -0800 (Fri, 02 Mar 2007) | 2 lines
Recognize the VAL_ERROR status code
------------------------------------------------------------------------
r2994 | hserus | 2007-03-02 07:38:54 -0800 (Fri, 02 Mar 2007) | 2 lines
Don't complain if the class is missing
------------------------------------------------------------------------
r2990 | hserus | 2007-03-01 13:30:58 -0800 (Thu, 01 Mar 2007) | 2 lines
Added some level of logging when conf files cannot be read
------------------------------------------------------------------------
r2986 | rstory | 2007-03-01 07:36:30 -0800 (Thu, 01 Mar 2007) | 1 line
bump 2 log messages from DEBUG to INFO
------------------------------------------------------------------------
r2985 | rstory | 2007-03-01 07:35:19 -0800 (Thu, 01 Mar 2007) | 7 lines
- remove unused 'const char *' ptr in val_log struct
- add 'void *' ptr in val_log struct
- new logging method: callback
- add new cb (callback) member to union in val_log struct
- prototype for val_log_add_cb
- add missing setup initialization in val_log_add_udp
------------------------------------------------------------------------
r2983 | hserus | 2007-03-01 06:45:47 -0800 (Thu, 01 Mar 2007) | 2 lines
Fix typo
------------------------------------------------------------------------
r2980 | hserus | 2007-02-28 11:23:22 -0800 (Wed, 28 Feb 2007) | 2 lines
Fix bad copy paste
------------------------------------------------------------------------
r2979 | hserus | 2007-02-28 11:16:07 -0800 (Wed, 28 Feb 2007) | 2 lines
Construct the chain of trust even if some other thread had fetched data for you.
------------------------------------------------------------------------
r2976 | hserus | 2007-02-28 08:47:21 -0800 (Wed, 28 Feb 2007) | 2 lines
Start from the correct testcase in the range specified by {tcs, tce}
------------------------------------------------------------------------
r2965 | rstory | 2007-02-27 12:57:30 -0800 (Tue, 27 Feb 2007) | 1 line
clean up memory on exit
------------------------------------------------------------------------
r2964 | rstory | 2007-02-27 12:57:06 -0800 (Tue, 27 Feb 2007) | 1 line
fix for running specific test range
------------------------------------------------------------------------
r2963 | hserus | 2007-02-27 09:55:30 -0800 (Tue, 27 Feb 2007) | 4 lines
- We no longer log query information, since the query chain
could easily have been modified by a different thread,
and hence the results may be un-predictable.
------------------------------------------------------------------------
r2962 | hserus | 2007-02-27 09:55:11 -0800 (Tue, 27 Feb 2007) | 4 lines
- Modified function prototypes: use the queries_for_query linked
list instead of the val_query_chain linked list while tracking
queries issued for val_resolve_and_check()
------------------------------------------------------------------------
r2961 | hserus | 2007-02-27 09:54:20 -0800 (Tue, 27 Feb 2007) | 3 lines
- Define macros for acquiring and releasing context-related
validator policy locks.
------------------------------------------------------------------------
r2960 | hserus | 2007-02-27 09:54:02 -0800 (Tue, 27 Feb 2007) | 4 lines
- Initialize context-related locks during context creation
- Perform proper cleanup of context upon error or when
it is released.
------------------------------------------------------------------------
r2959 | hserus | 2007-02-27 09:53:27 -0800 (Tue, 27 Feb 2007) | 8 lines
- Add any new queries to the queries_for_query linked list
being maintained for the current val_resolve_and_check()
function.
- Don't modify the name server cache in
res_zi_unverified_ns_list(). This is to allow us to use
a read-lock (as opposed to a write lock) while reading
from this cache.
------------------------------------------------------------------------
r2958 | hserus | 2007-02-27 09:52:20 -0800 (Tue, 27 Feb 2007) | 38 lines
- add_to_query_chain() now returns the added element
in the last parameter. This element is no longer brought
to the front of the list. Propagate this value to all
functions that were operating under this older assumption.
- Also match query flags when looking for a matching query
in the val_query_chain linked list
- Maintain a new linked list that tracks all queries issued
for a given query. Each element in the linked list points
to a separate element in the val_query_chain linked list
For each element added to the queries_for_query linked
list, we also acquire a read lock, so that the query does
not disappear underneath us. val_resolve_and_check() only
tries to answer these queries (instead of all outstanding
queries in val_query_chain)
- A proof of non-existence with a different owner name can
be returned when we ask for one of NSEC, SOA or NSEC3 types.
Don't treat this as a conflicting answer.
- For each newly created authentication chain element add a
"back pointer" to the query that was responsible for its
creation.
- Use flags from the val_query_chain structure where ever
this is available instead of passing the flags as a
separate argument.
- Since the authentication chain is always available from
within the context, don't pass it as a separate argument
to functions such as assimilate_answers
- Combine find_next_zonecut() and verify_provably_unsecure()
functions into the main query send/receive cycle. Also add
a "done" parameter for each of these functions to indicate
if the operation completed or was waiting for more data.
- Return result of verify_provably_unsecure() check as a
separate param and return the normal error codes from the
function.
- ask_cache() and ask_resolver() now try and fill in data
for all pending queries instead of just returning when the
first answer is found.
- Acquire proper locks before refreshing validator policy
------------------------------------------------------------------------
r2957 | hserus | 2007-02-27 09:49:11 -0800 (Tue, 27 Feb 2007) | 4 lines
- Use separate locks for each cache type
- Always grab an write lock when modifying the cache
instead of doing upgrade/downgrade operations
------------------------------------------------------------------------
r2956 | hserus | 2007-02-27 09:48:48 -0800 (Tue, 27 Feb 2007) | 2 lines
- Modify validator policy only after acquiring appropriate locks
------------------------------------------------------------------------
r2955 | hserus | 2007-02-27 09:48:25 -0800 (Tue, 27 Feb 2007) | 4 lines
- We no longer log query information, since the query chain
could easily have been modified by a different thread;
the results are un-predictable.
------------------------------------------------------------------------
r2954 | hserus | 2007-02-27 09:46:48 -0800 (Tue, 27 Feb 2007) | 2 lines
- Never block when reading data from the sockets
------------------------------------------------------------------------
r2953 | hserus | 2007-02-27 09:46:23 -0800 (Tue, 27 Feb 2007) | 16 lines
- Added VAL_MASK_AFFECTS_CACHING flag
- Define read-write and mutex locks for val_context_t
- Added a back pointer from the "internal" authentication
chain element to the query that was reponsible for its
creation
- Added a read-write lock for val_query_chain
- Made qc_flags type consistent with type being passed to
val_resolve_and_check()
- Added new structure queries_for_query that acts as a
container for all queries issued while verifying and
validating a given query.
- Changed the prototype for val_log_authentication_chain.
We no longer log query information, since the query chain
could easily have been modified by a different thread,
and hence the results may be un-predictable.
------------------------------------------------------------------------
r2952 | hserus | 2007-02-26 13:27:16 -0800 (Mon, 26 Feb 2007) | 3 lines
Make return code consistent with other command line apps for the validator: return 0 in success and -1 on
failure.
------------------------------------------------------------------------
r2951 | hserus | 2007-02-26 12:56:10 -0800 (Mon, 26 Feb 2007) | 2 lines
Update NSEC3 code to most recent spec
------------------------------------------------------------------------
r2943 | rstory | 2007-02-23 07:24:54 -0800 (Fri, 23 Feb 2007) | 2 lines
use $sysconfdir instead of $prefix/etc
------------------------------------------------------------------------
r2937 | rstory | 2007-02-20 10:23:50 -0800 (Tue, 20 Feb 2007) | 1 line
update to use etc/dnssec-tools
------------------------------------------------------------------------
r2934 | rstory | 2007-02-20 10:16:12 -0800 (Tue, 20 Feb 2007) | 4 lines
- fix much breakage in makedirectories target
- add PREFIX/etc/dnssec-tools to INSTALLDIRS
- update nextstepinstructions to use paths from configure
------------------------------------------------------------------------
r2933 | rstory | 2007-02-20 10:14:36 -0800 (Tue, 20 Feb 2007) | 6 lines
- display summary of options when configure finishes
- update default config prefixes to PREFIX/etc/dnssec-tools
- prompt for resolv.conf and root.hints locations if not specified
- search for existing root.hints file, and use it as the default
in prompt to user
------------------------------------------------------------------------
r2932 | rstory | 2007-02-20 10:10:52 -0800 (Tue, 20 Feb 2007) | 3 lines
- add acinclude.m4 (from net-snmp)
- run aclocal to upate aclocal.m4, and include acinclude.m4
------------------------------------------------------------------------
r2931 | rstory | 2007-02-20 10:00:34 -0800 (Tue, 20 Feb 2007) | 3 lines
- add -F | --testcase-conf to all testcase file to be specified on command line
- warn if -s and -S are combined, or -S used multiple times
------------------------------------------------------------------------
r2929 | rstory | 2007-02-16 15:27:01 -0800 (Fri, 16 Feb 2007) | 5 lines
- add '-S suite |--test-suite=suite'
- '-s | --selftest' now runs all suites
- prefix selftest runs with suite name
- prefix each test with index in test suite
------------------------------------------------------------------------
r2928 | hserus | 2007-02-16 15:20:37 -0800 (Fri, 16 Feb 2007) | 2 lines
Install getaddr and gethost applications
------------------------------------------------------------------------
r2927 | hserus | 2007-02-16 15:19:43 -0800 (Fri, 16 Feb 2007) | 2 lines
Return the validation status as the program status code
------------------------------------------------------------------------
r2926 | hserus | 2007-02-16 15:04:45 -0800 (Fri, 16 Feb 2007) | 2 lines
Don't complaint if root.hints is missing
------------------------------------------------------------------------
r2925 | rstory | 2007-02-16 13:46:57 -0800 (Fri, 16 Feb 2007) | 1 line
add sres to libs
------------------------------------------------------------------------
r2924 | rstory | 2007-02-16 10:40:39 -0800 (Fri, 16 Feb 2007) | 3 lines
- add the rest of the tests from validator, as suites
- Please feel free to re-organize and groupe the suites as needed!
------------------------------------------------------------------------
r2923 | rstory | 2007-02-16 10:38:35 -0800 (Fri, 16 Feb 2007) | 1 line
add support for suites of tests
------------------------------------------------------------------------
r2921 | rstory | 2007-02-13 11:59:13 -0800 (Tue, 13 Feb 2007) | 1 line
copy ptr after it is initialized
------------------------------------------------------------------------
r2920 | rstory | 2007-02-13 11:45:28 -0800 (Tue, 13 Feb 2007) | 1 line
deal with default prefix for testcase path
------------------------------------------------------------------------
r2919 | rstory | 2007-02-13 11:28:12 -0800 (Tue, 13 Feb 2007) | 1 line
add includes for os x
------------------------------------------------------------------------
r2918 | rstory | 2007-02-13 10:47:55 -0800 (Tue, 13 Feb 2007) | 1 line
add path to cp
------------------------------------------------------------------------
r2917 | rstory | 2007-02-13 10:47:03 -0800 (Tue, 13 Feb 2007) | 3 lines
- rename selftest dist file
- create $prefix/etc/dnssec during install
------------------------------------------------------------------------
r2916 | rstory | 2007-02-13 10:45:08 -0800 (Tue, 13 Feb 2007) | 1 line
rename file
------------------------------------------------------------------------
r2915 | rstory | 2007-02-13 10:12:14 -0800 (Tue, 13 Feb 2007) | 1 line
new header
------------------------------------------------------------------------
r2914 | rstory | 2007-02-13 10:11:12 -0800 (Tue, 13 Feb 2007) | 2 lines
update for getting testcases from config file
------------------------------------------------------------------------
r2913 | rstory | 2007-02-13 10:08:30 -0800 (Tue, 13 Feb 2007) | 2 lines
new files for getting testcases from a config file
------------------------------------------------------------------------
r2912 | rstory | 2007-02-13 10:06:49 -0800 (Tue, 13 Feb 2007) | 2 lines
add VALIDATOR_TESTCASES macro
------------------------------------------------------------------------
r2910 | rstory | 2007-02-13 06:52:24 -0800 (Tue, 13 Feb 2007) | 2 lines
- add define for MAX_TEST_RESULTS
------------------------------------------------------------------------
r2909 | rstory | 2007-02-13 06:33:23 -0800 (Tue, 13 Feb 2007) | 3 lines
- rename get_token to val_get_token and remove static qualifier
- new static destroy_valpolovr to reduce duplicated code
------------------------------------------------------------------------
r2908 | hserus | 2007-02-12 13:36:05 -0800 (Mon, 12 Feb 2007) | 2 lines
Save header information when constructing an empty nxdomain response
------------------------------------------------------------------------
r2906 | hserus | 2007-02-09 06:25:27 -0800 (Fri, 09 Feb 2007) | 3 lines
Make VAL_NONEXISTENT_TYPE_NOCHAIN a transient error code: it will settle to one of
VAL_NONEXISTENT_NAME_NOCHAIN or VAL_NONEXISTENT_TYPE_NOCHAIN
------------------------------------------------------------------------
r2905 | hserus | 2007-02-08 12:27:05 -0800 (Thu, 08 Feb 2007) | 2 lines
Correct improper #undef usage
------------------------------------------------------------------------
r2904 | marz | 2007-02-07 11:49:02 -0800 (Wed, 07 Feb 2007) | 1 line
install libval-config and use it from perlmod, fix test for mac compatibility
------------------------------------------------------------------------
r2901 | rstory | 2007-02-06 07:45:33 -0800 (Tue, 06 Feb 2007) | 1 line
add missing lvc_LIBDIR
------------------------------------------------------------------------
r2899 | rstory | 2007-02-06 07:41:26 -0800 (Tue, 06 Feb 2007) | 1 line
make libval-config executable
------------------------------------------------------------------------
r2898 | rstory | 2007-02-05 15:05:20 -0800 (Mon, 05 Feb 2007) | 1 line
help spacing tweaks
------------------------------------------------------------------------
r2896 | rstory | 2007-02-05 14:57:13 -0800 (Mon, 05 Feb 2007) | 6 lines
- add configurable config file paths
- remove VAL_CONFIGURATION_FILE, ROOT_HINTS and RESOLV_CONF from validator.h
- add configure options to specify paths for dnsval.conf, resolv.conf and root.hints
- update code for new defines for those paths
- update libval-config with options to report those paths
------------------------------------------------------------------------
r2883 | hserus | 2007-02-02 08:26:33 -0800 (Fri, 02 Feb 2007) | 2 lines
Use standard method of accessing stat timestamps
------------------------------------------------------------------------
r2882 | hserus | 2007-02-02 08:11:02 -0800 (Fri, 02 Feb 2007) | 2 lines
Remove reference to the_default_context
------------------------------------------------------------------------
r2881 | hserus | 2007-02-02 07:54:48 -0800 (Fri, 02 Feb 2007) | 2 lines
Define prototypes of new functions that allow refresh of configuration files to be possible
------------------------------------------------------------------------
r2880 | hserus | 2007-02-02 07:54:15 -0800 (Fri, 02 Feb 2007) | 6 lines
Define a new context-creation function that allows you to specify the resolver/validator/root-hints
configuration files
Perform initialization and destruction of new context members that implement config refresh functionality
Define new functions to refresh configuration files
------------------------------------------------------------------------
r2879 | hserus | 2007-02-02 07:53:58 -0800 (Fri, 02 Feb 2007) | 2 lines
Use the root hints information within context to bootstrap queries
------------------------------------------------------------------------
r2878 | hserus | 2007-02-02 07:53:39 -0800 (Fri, 02 Feb 2007) | 5 lines
Use the config files within the context to generate validator and resolver policy
On each execution of val_resolve_and_check() check the last modified time on the configuration files and
re-initialize configuration files if required
------------------------------------------------------------------------
r2877 | hserus | 2007-02-02 07:53:19 -0800 (Fri, 02 Feb 2007) | 3 lines
Store root_ns information inside context since this can be different for different contexts (theoretically)
------------------------------------------------------------------------
r2876 | hserus | 2007-02-02 07:53:00 -0800 (Fri, 02 Feb 2007) | 5 lines
Save last accessed timestamp each time the configuration files are read
Make modifications to the context only when the configuration files have been parsed properly. That way we
can ensure that the context is not corrupted when we want to refresh it with a new configuration file.
------------------------------------------------------------------------
r2875 | hserus | 2007-02-02 07:52:37 -0800 (Fri, 02 Feb 2007) | 2 lines
rename resolver_config_set/get to resolv_conf_set/get
------------------------------------------------------------------------
r2874 | hserus | 2007-02-02 07:51:46 -0800 (Fri, 02 Feb 2007) | 3 lines
Add a new option -w that allows test cases to be re-run in a loop
------------------------------------------------------------------------
r2873 | hserus | 2007-02-02 07:51:16 -0800 (Fri, 02 Feb 2007) | 5 lines
- Allow different validator/resolver/root configuration files for each context
- Keep track of last modifed times for each configuration file
- Add prototypes for new functions that allow above features to be accessed
------------------------------------------------------------------------
r2872 | rstory | 2007-02-02 07:49:40 -0800 (Fri, 02 Feb 2007) | 2 lines
add support for libval-config script
------------------------------------------------------------------------
r2870 | hserus | 2007-02-02 06:15:27 -0800 (Fri, 02 Feb 2007) | 3 lines
When checking for cached query, only compare against the "original" name and not the transformed name (for
example through a cname chain)
------------------------------------------------------------------------
r2868 | marz | 2007-02-01 13:06:42 -0800 (Thu, 01 Feb 2007) | 1 line
return alloc'd mem, rename conf funcs
------------------------------------------------------------------------
r2867 | hserus | 2007-02-01 11:33:50 -0800 (Thu, 01 Feb 2007) | 2 lines
Perform correct NULL check
------------------------------------------------------------------------
r2860 | hardaker | 2007-01-31 08:01:46 -0800 (Wed, 31 Jan 2007) | 1 line
update libtool library version
------------------------------------------------------------------------
r2859 | rstory | 2007-01-31 07:35:13 -0800 (Wed, 31 Jan 2007) | 2 lines
add discussion of val_resquery returning a value > anslen
------------------------------------------------------------------------
r2832 | rstory | 2007-01-26 14:08:58 -0800 (Fri, 26 Jan 2007) | 4 lines
- val_res_query()
- free internal response after data copied
- return full size of response on success
------------------------------------------------------------------------
r2811 | hserus | 2007-01-19 04:25:16 -0800 (Fri, 19 Jan 2007) | 2 lines
Separate out check for trusted condition from check for validated condition
------------------------------------------------------------------------
r2810 | hserus | 2007-01-18 18:51:52 -0800 (Thu, 18 Jan 2007) | 2 lines
Add log statements for VAL_TRUSTED_ANSWER, VAL_UNTRUSTED_ANSWER and VAL_VALIDATED_ANSWER
------------------------------------------------------------------------
r2809 | hserus | 2007-01-18 18:51:10 -0800 (Thu, 18 Jan 2007) | 2 lines
Fix logic for determining trusted status
------------------------------------------------------------------------
r2808 | hserus | 2007-01-18 18:50:29 -0800 (Thu, 18 Jan 2007) | 2 lines
Move variable outside #define construct
------------------------------------------------------------------------
r2804 | hserus | 2007-01-18 08:57:57 -0800 (Thu, 18 Jan 2007) | 2 lines
Attempt to fix memory leak
------------------------------------------------------------------------
r2802 | hserus | 2007-01-17 09:17:14 -0800 (Wed, 17 Jan 2007) | 2 lines
Return VAL_TRUSTED_ANSWER, VAL_UNTRUSTED_ANSWER or VAL_VALIDATED_ANSWER for merged validator status values.
------------------------------------------------------------------------
r2801 | hserus | 2007-01-17 09:16:37 -0800 (Wed, 17 Jan 2007) | 3 lines
Recognize VAL_VALIDATED_ANSWER as a trusted and validated answer
Recognize VAL_TRUSTED_ANSWER as a trusted answer
------------------------------------------------------------------------
r2800 | hserus | 2007-01-17 09:16:15 -0800 (Wed, 17 Jan 2007) | 4 lines
Remove part that says that merged status value can be a non-existence type. We actually infer non-existence
using the normal mechanisms used by the legacy functions. Additionally, val_status tells us if this is
trusted or no.
------------------------------------------------------------------------
r2799 | hserus | 2007-01-17 09:14:11 -0800 (Wed, 17 Jan 2007) | 2 lines
Supply new val_status param to val_getaddrinfo()
------------------------------------------------------------------------
r2798 | hserus | 2007-01-17 09:13:42 -0800 (Wed, 17 Jan 2007) | 2 lines
Add val_status parameter to val_getaddrinfo()
------------------------------------------------------------------------
r2797 | hserus | 2007-01-17 09:13:26 -0800 (Wed, 17 Jan 2007) | 2 lines
Add validator status codes for VAL_TRUSTED_ANSWER, VAL_UNTRUSTED_ANSWER and VAL_VALIDATED_ANSWER.
------------------------------------------------------------------------
r2776 | rstory | 2007-01-12 14:42:34 -0800 (Fri, 12 Jan 2007) | 1 line
add subdir to include dir path
------------------------------------------------------------------------
r2773 | hserus | 2007-01-11 20:03:59 -0800 (Thu, 11 Jan 2007) | 4 lines
For glue fetch operations set the DONT_VALIDATE flag
Ensure that names are not registered twice for alias chains
------------------------------------------------------------------------
r2772 | hserus | 2007-01-11 20:01:53 -0800 (Thu, 11 Jan 2007) | 2 lines
Make sure we break out of the resolve_and_check loop only if some result is available
------------------------------------------------------------------------
r2771 | hserus | 2007-01-11 16:14:02 -0800 (Thu, 11 Jan 2007) | 2 lines
Look for glue in cname/dname chain
------------------------------------------------------------------------
r2770 | hserus | 2007-01-11 14:33:28 -0800 (Thu, 11 Jan 2007) | 2 lines
Fix memory leak and null pointer exception
------------------------------------------------------------------------
r2769 | hserus | 2007-01-11 14:32:39 -0800 (Thu, 11 Jan 2007) | 2 lines
Fix memory leak
------------------------------------------------------------------------
r2768 | hserus | 2007-01-11 14:32:02 -0800 (Thu, 11 Jan 2007) | 2 lines
Use VAL_INDETERMINATE in place of VAL_ERROR
------------------------------------------------------------------------
r2763 | rstory | 2007-01-11 13:31:00 -0800 (Thu, 11 Jan 2007) | 1 line
use new validator path to resolver.h and validator.h
------------------------------------------------------------------------
r2762 | rstory | 2007-01-11 13:28:17 -0800 (Thu, 11 Jan 2007) | 1 line
use new validator path to resolver.h and validator.h
------------------------------------------------------------------------
r2761 | rstory | 2007-01-11 13:25:06 -0800 (Thu, 11 Jan 2007) | 1 line
use new validator path to resolver.h and validator.h
------------------------------------------------------------------------
r2759 | rstory | 2007-01-11 13:18:31 -0800 (Thu, 11 Jan 2007) | 1 line
use new validator path to resolver.h
------------------------------------------------------------------------
r2758 | rstory | 2007-01-11 13:15:34 -0800 (Thu, 11 Jan 2007) | 1 line
use new validator path to resolver.h
------------------------------------------------------------------------
r2757 | rstory | 2007-01-11 12:57:58 -0800 (Thu, 11 Jan 2007) | 1 line
update includes for new subdirectory
------------------------------------------------------------------------
r2756 | rstory | 2007-01-11 12:56:05 -0800 (Thu, 11 Jan 2007) | 1 line
move val_errors.h to new include directory
------------------------------------------------------------------------
r2755 | rstory | 2007-01-11 12:55:24 -0800 (Thu, 11 Jan 2007) | 1 line
remove wrong version
------------------------------------------------------------------------
r2754 | rstory | 2007-01-11 12:52:38 -0800 (Thu, 11 Jan 2007) | 1 line
move validator.h and val_errors.h to new include directory
------------------------------------------------------------------------
r2753 | rstory | 2007-01-11 12:47:18 -0800 (Thu, 11 Jan 2007) | 1 line
move resolver.h to new include directory
------------------------------------------------------------------------
r2752 | rstory | 2007-01-11 12:38:34 -0800 (Thu, 11 Jan 2007) | 1 line
new validator include dir
------------------------------------------------------------------------
r2750 | hserus | 2007-01-10 15:35:15 -0800 (Wed, 10 Jan 2007) | 2 lines
Use u_int8_t in place of char to represent on-the-wire names
------------------------------------------------------------------------
r2749 | hserus | 2007-01-10 15:35:02 -0800 (Wed, 10 Jan 2007) | 2 lines
Add aliases for error codes that have errno equivalents
------------------------------------------------------------------------
r2748 | hserus | 2007-01-10 15:34:47 -0800 (Wed, 10 Jan 2007) | 2 lines
Additional check before logging information about original query
------------------------------------------------------------------------
r2747 | hserus | 2007-01-10 15:34:31 -0800 (Wed, 10 Jan 2007) | 2 lines
Add prototype for process_cname_dname_responses()
------------------------------------------------------------------------
r2746 | hserus | 2007-01-10 15:34:18 -0800 (Wed, 10 Jan 2007) | 5 lines
Moved ALLOCATE_REFERRAL_BLOCK from this file to val_support.h
In find_nslist_for_query() look for a configured forwarder for the given zone first
Move cname/dname processing logic into separate function, process_cname_dname_responses()
Major clean-up of digest_response() logic
------------------------------------------------------------------------
r2745 | hserus | 2007-01-10 15:33:59 -0800 (Wed, 10 Jan 2007) | 10 lines
Change name_in_qnames() function so that we only pass the name as a parameter instead of the entire rrset
Check for systhesized cname case in fails_to_answer_query()
While building pending query, try harder to find the DNSKEY that created an RRSIG and check that the
signer is within the zone.
In check for conflicting answers allow chains of cnames and dnames to be possible
Allow ask_cache to read cached cnames and dnames
Stowing of answers only happens during digest_response() so that in-bailiwick condition cnan be checked
Use namename() while comparing two on-the-wire names
Implement other miscellaneous todos (portions marked XXX)
------------------------------------------------------------------------
r2744 | hserus | 2007-01-10 15:33:36 -0800 (Wed, 10 Jan 2007) | 4 lines
Add namename() function along the lines of strstr() to compare two on-the-wire domain names
Also add a new copy_rrset_rec_list() function
Moved ALLOCATE_REFERRAL_BLOCK from val_resquery.c to here so that other files may use it
------------------------------------------------------------------------
r2743 | hserus | 2007-01-10 15:33:15 -0800 (Wed, 10 Jan 2007) | 3 lines
Add namename() function along the lines of strstr() to compare two on-the-wire domain names
Also add a new copy_rrset_rec_list() function
------------------------------------------------------------------------
r2742 | hserus | 2007-01-10 15:33:02 -0800 (Wed, 10 Jan 2007) | 3 lines
Set couple of missing error states
------------------------------------------------------------------------
r2741 | hserus | 2007-01-10 15:32:46 -0800 (Wed, 10 Jan 2007) | 3 lines
Change prototypes for all the stow_ functions since we now do in-bailiwick checking
Change prototypes for get_cached_rrset and get_nslist_from_cache as well.
------------------------------------------------------------------------
r2740 | hserus | 2007-01-10 15:32:31 -0800 (Wed, 10 Jan 2007) | 7 lines
Check if answers being cached are in-bailiwick for the given query
Return a domain_info structure for get_cached_rrset. This is to allow cached
cname/dname records to be returned
Add preliminary support for negative answer cache
Add support for storing/returning entries to/from the forwarder cache
Use namename() while comparing two on-the-wire names
------------------------------------------------------------------------
r2739 | hserus | 2007-01-10 15:32:16 -0800 (Wed, 10 Jan 2007) | 4 lines
Separated name server parsing logic into a separate function
Add support for forwarding queries to specific name servers for specific zones.
------------------------------------------------------------------------
r2738 | rstory | 2007-01-09 14:14:22 -0800 (Tue, 09 Jan 2007) | 1 line
make args param to val_log_add_optarg const
------------------------------------------------------------------------
r2737 | rstory | 2007-01-09 12:23:31 -0800 (Tue, 09 Jan 2007) | 1 line
update for previous configure.in change
------------------------------------------------------------------------
r2730 | hserus | 2007-01-08 15:12:15 -0800 (Mon, 08 Jan 2007) | 2 lines
This version was submitted as draft-hayatnagarkar-dnsext-validator-api-03
------------------------------------------------------------------------
r2725 | rstory | 2007-01-06 09:07:35 -0800 (Sat, 06 Jan 2007) | 2 lines
- do not use pthreads if it is not available, or user configured without it
------------------------------------------------------------------------
r2724 | rstory | 2007-01-06 09:05:45 -0800 (Sat, 06 Jan 2007) | 3 lines
- add '-threads' suffix to libval iff using threads
- no explicit linking w/pthreads
------------------------------------------------------------------------
r2723 | rstory | 2007-01-06 08:18:59 -0800 (Sat, 06 Jan 2007) | 4 lines
- tweak indentation on some help
- test for libpthreads
- add --without-threads
------------------------------------------------------------------------
r2705 | hserus | 2007-01-03 09:05:53 -0800 (Wed, 03 Jan 2007) | 2 lines
Add missing tag
------------------------------------------------------------------------
r2667 | hserus | 2006-12-11 11:02:35 -0800 (Mon, 11 Dec 2006) | 2 lines
Use the first policy in the conf file as the default if none is specified.
------------------------------------------------------------------------
r2664 | rstory | 2006-12-08 06:48:32 -0800 (Fri, 08 Dec 2006) | 1 line
fix byteorder for ascii ports
------------------------------------------------------------------------
r2662 | hserus | 2006-12-07 10:07:54 -0800 (Thu, 07 Dec 2006) | 2 lines
Set the MERGE flag when composing an answer
------------------------------------------------------------------------
r2661 | hserus | 2006-12-07 08:24:13 -0800 (Thu, 07 Dec 2006) | 2 lines
Initialize rrs.val_rrset_server to NULL
------------------------------------------------------------------------
r2660 | hserus | 2006-12-07 08:23:45 -0800 (Thu, 07 Dec 2006) | 5 lines
Display message when zone cut cannot be identified
Avoid possible null pointer exception when query for SOA returns no data
Ensure that proper status is maintained in the authentication chain when proofs of non-existence are
returned from the wrong side of the zone cut
------------------------------------------------------------------------
r2652 | rstory | 2006-12-05 12:56:13 -0800 (Tue, 05 Dec 2006) | 1 line
add targets for help, test and leakchecks (requires valgrind)
------------------------------------------------------------------------
r2651 | hserus | 2006-12-05 12:22:09 -0800 (Tue, 05 Dec 2006) | 2 lines
Fix memory leaks
------------------------------------------------------------------------
r2632 | hserus | 2006-12-04 14:34:35 -0800 (Mon, 04 Dec 2006) | 2 lines
Fix bug in duplicate policy detection logic
------------------------------------------------------------------------
r2630 | hserus | 2006-12-04 12:31:32 -0800 (Mon, 04 Dec 2006) | 2 lines
Update expected result values for test cases
------------------------------------------------------------------------
r2629 | hardaker | 2006-12-04 11:55:01 -0800 (Mon, 04 Dec 2006) | 1 line
change future/pastdate name records
------------------------------------------------------------------------
r2620 | marz | 2006-12-02 07:11:59 -0800 (Sat, 02 Dec 2006) | 1 line
fix crash with VAL_QUERY_MERGE_RRSETS
------------------------------------------------------------------------
r2602 | rstory | 2006-12-01 13:22:34 -0800 (Fri, 01 Dec 2006) | 1 line
pre-release indent
------------------------------------------------------------------------
r2601 | rstory | 2006-12-01 13:15:59 -0800 (Fri, 01 Dec 2006) | 1 line
pre-release indent
------------------------------------------------------------------------
r2585 | hserus | 2006-12-01 09:44:52 -0800 (Fri, 01 Dec 2006) | 5 lines
Ensure that correct zonecut information information is stored for the nameserver that we obtained in
get_nslist_from_cache()
Dont assume that referrals seen with a CNAME response relate to the alias. They may be returned when the
parent does recursion for example.
------------------------------------------------------------------------
r2577 | hserus | 2006-11-30 13:14:49 -0800 (Thu, 30 Nov 2006) | 2 lines
Remove references to no longer defined functions
------------------------------------------------------------------------
r2568 | marz | 2006-11-30 09:58:07 -0800 (Thu, 30 Nov 2006) | 1 line
some error code fixes...pending discussion
------------------------------------------------------------------------
r2567 | hserus | 2006-11-29 23:16:04 -0800 (Wed, 29 Nov 2006) | 2 lines
Try and settle on wording for policy scopes and labels
------------------------------------------------------------------------
r2566 | hserus | 2006-11-29 23:04:40 -0800 (Wed, 29 Nov 2006) | 2 lines
More tweaking to the policy hierarchy construction logic
------------------------------------------------------------------------
r2565 | hserus | 2006-11-29 21:49:28 -0800 (Wed, 29 Nov 2006) | 2 lines
: characters are only allowed for the default policy label.
------------------------------------------------------------------------
r2564 | hserus | 2006-11-29 21:44:23 -0800 (Wed, 29 Nov 2006) | 2 lines
Change policy related APIs to make them look similar to -03. We no longer have val_switch_policy_scope(),etc
------------------------------------------------------------------------
r2563 | hserus | 2006-11-29 21:41:14 -0800 (Wed, 29 Nov 2006) | 2 lines
Change some of the semantics for the default policy. Its no longer always used implicitly.
------------------------------------------------------------------------
r2561 | hserus | 2006-11-29 14:06:29 -0800 (Wed, 29 Nov 2006) | 3 lines
Check for the case where an incorrect NS was returned as part of a positive response for a DS. This affects the zonecut detection
logic.
------------------------------------------------------------------------
r2560 | hserus | 2006-11-29 14:05:20 -0800 (Wed, 29 Nov 2006) | 2 lines
Changed a log message
------------------------------------------------------------------------
r2559 | hserus | 2006-11-29 13:19:49 -0800 (Wed, 29 Nov 2006) | 2 lines
Make sure response is properly initialized to NULL.
------------------------------------------------------------------------
r2558 | hserus | 2006-11-29 13:11:47 -0800 (Wed, 29 Nov 2006) | 2 lines
Check for data before printing response data
------------------------------------------------------------------------
r2557 | hserus | 2006-11-29 12:47:47 -0800 (Wed, 29 Nov 2006) | 2 lines
Remove unnecessary comment
------------------------------------------------------------------------
r2556 | hserus | 2006-11-29 12:47:34 -0800 (Wed, 29 Nov 2006) | 2 lines
Passing params by reference to address xxx-audit comments in a different file
------------------------------------------------------------------------
r2555 | hserus | 2006-11-29 12:47:14 -0800 (Wed, 29 Nov 2006) | 4 lines
Address xxx-audit comments
make sure that correct zonecut information is saved when parent zone recursively obtains answers for the
child zone (or the same ns is authoritative for the parent and the child)
------------------------------------------------------------------------
r2554 | hserus | 2006-11-29 12:46:53 -0800 (Wed, 29 Nov 2006) | 2 lines
remove xxx-audit comment since the issue of initializing rr_status was already addressed
------------------------------------------------------------------------
r2553 | hserus | 2006-11-29 12:46:36 -0800 (Wed, 29 Nov 2006) | 2 lines
Address xxx-audit comments
------------------------------------------------------------------------
r2552 | hserus | 2006-11-29 12:46:18 -0800 (Wed, 29 Nov 2006) | 5 lines
Address xxx-audit comments
In the check for provably insecure condition test for VAL_NONEXISTENT_TYPE_NOCHAIN
Save some information from the test for provably unsecure in the authentication chain
VAL_PROVABLY_UNSECURE is not an is_validated() status
------------------------------------------------------------------------
r2551 | hserus | 2006-11-29 12:45:46 -0800 (Wed, 29 Nov 2006) | 2 lines
Address xxx-audit comments
------------------------------------------------------------------------
r2550 | hserus | 2006-11-29 12:45:21 -0800 (Wed, 29 Nov 2006) | 2 lines
VAL_PROVABLY_UNSECURE is not an is_validated() status
------------------------------------------------------------------------
r2549 | hserus | 2006-11-29 12:44:53 -0800 (Wed, 29 Nov 2006) | 2 lines
Display a message that we are not installing the resolv.conf and dnsval.conf in standard locations.
------------------------------------------------------------------------
r2534 | rstory | 2006-11-28 14:59:53 -0800 (Tue, 28 Nov 2006) | 1 line
use EINVAL ifndef ENODATA
------------------------------------------------------------------------
r2531 | rstory | 2006-11-28 12:15:22 -0800 (Tue, 28 Nov 2006) | 1 line
add target test, so we can define _REENTRANT on solaris
------------------------------------------------------------------------
r2530 | rstory | 2006-11-28 12:13:53 -0800 (Tue, 28 Nov 2006) | 1 line
fix compiler const whining
------------------------------------------------------------------------
r2511 | tewok | 2006-11-27 12:07:25 -0800 (Mon, 27 Nov 2006) | 3 lines
A few formatting changes and added a missing squiggly.
------------------------------------------------------------------------
r2507 | hserus | 2006-11-27 10:08:10 -0800 (Mon, 27 Nov 2006) | 2 lines
Use a default "hints" value if one is not supplied.
------------------------------------------------------------------------
r2505 | tewok | 2006-11-27 09:41:00 -0800 (Mon, 27 Nov 2006) | 4 lines
Added a terminal serial comma.
Formatting fix I missed before.
------------------------------------------------------------------------
r2503 | marz | 2006-11-27 05:18:06 -0800 (Mon, 27 Nov 2006) | 1 line
declare global after struct
------------------------------------------------------------------------
r2502 | hserus | 2006-11-26 12:08:47 -0800 (Sun, 26 Nov 2006) | 2 lines
Add description for val_isvalidated(), VAL_NONEXISTENT_NAME_NOCHAIN and VAL_NONEXISTENT_TYPE_NOCHAIN
------------------------------------------------------------------------
r2501 | hserus | 2006-11-26 11:46:10 -0800 (Sun, 26 Nov 2006) | 6 lines
Modify transform_outstanding_results() so that error value for the proof can be passed as a parameter
While checking non-existence span, make sure that the bound is not closed.
Use the combination of val_istrusted and val_isvalidated to identify if the answer is locally trusted.
Set non-existence type of VAL_NONEXISTENT_NAME_NOCHAIN and VAL_NONEXISTENT_TYPE_NOCHAIN if the proof is
locally trusted.
------------------------------------------------------------------------
r2500 | hserus | 2006-11-26 11:45:55 -0800 (Sun, 26 Nov 2006) | 2 lines
Define types for VAL_NONEXISTENT_NAME_NOCHAIN and VAL_NONEXISTENT_TYPE_NOCHAIN
------------------------------------------------------------------------
r2499 | hserus | 2006-11-26 11:45:36 -0800 (Sun, 26 Nov 2006) | 2 lines
Handle case for VAL_NONEXISTENT_NAME_NOCHAIN and VAL_NONEXISTENT_TYPE_NOCHAIN
------------------------------------------------------------------------
r2498 | hserus | 2006-11-26 08:21:49 -0800 (Sun, 26 Nov 2006) | 2 lines
Fix indentation
------------------------------------------------------------------------
r2497 | hserus | 2006-11-25 18:00:44 -0800 (Sat, 25 Nov 2006) | 2 lines
Print a log message when we detect a duplicate policy definition
------------------------------------------------------------------------
r2496 | hserus | 2006-11-25 17:59:23 -0800 (Sat, 25 Nov 2006) | 2 lines
Fix in detection of policy match logic
------------------------------------------------------------------------
r2495 | hserus | 2006-11-25 13:50:53 -0800 (Sat, 25 Nov 2006) | 2 lines
Make it possible to verify the chain of trust even if there is a keytag collision
------------------------------------------------------------------------
r2494 | hserus | 2006-11-25 13:50:00 -0800 (Sat, 25 Nov 2006) | 2 lines
Add header for validator.h
------------------------------------------------------------------------
r2488 | rstory | 2006-11-25 11:15:16 -0800 (Sat, 25 Nov 2006) | 1 line
add val_isvalidated(val_status)
------------------------------------------------------------------------
r2470 | hserus | 2006-11-23 19:16:34 -0800 (Thu, 23 Nov 2006) | 2 lines
Formatting changes
------------------------------------------------------------------------
r2469 | hserus | 2006-11-23 18:19:29 -0800 (Thu, 23 Nov 2006) | 2 lines
Add some text on zone-security-expectation
------------------------------------------------------------------------
r2468 | hserus | 2006-11-23 17:10:58 -0800 (Thu, 23 Nov 2006) | 4 lines
Rename VAL_R_TRUST_FLAG and VAL_R_MASKED_TRUST_FLAG to VAL_FLAG_CHAIN_COMPLETE and
VAL_MASKED_FLAG_CHAIN_COMPLETE.
Rename SET_RESULT_TRUSTED macro to SET_CHAIN_COMPLETE
------------------------------------------------------------------------
r2467 | hserus | 2006-11-23 17:10:32 -0800 (Thu, 23 Nov 2006) | 8 lines
Do away with VAL_R_ status codes
Rename VAL_R_TRUST_FLAG and VAL_R_MASKED_TRUST_FLAG to VAL_FLAG_CHAIN_COMPLETE and
VAL_MASKED_FLAG_CHAIN_COMPLETE.
Rename SET_RESULT_TRUSTED macro to SET_CHAIN_COMPLETE
Define VAL_AC_DONT_GO_FURTHER status to represent status codes where we need not go
further up the chain of
trust
------------------------------------------------------------------------
r2466 | hserus | 2006-11-23 17:10:20 -0800 (Thu, 23 Nov 2006) | 3 lines
Do away with VAL_R_ status codes
Add case for VAL_UNTRUSTED_ZONE in p_val_status()
------------------------------------------------------------------------
r2465 | hserus | 2006-11-23 17:10:00 -0800 (Thu, 23 Nov 2006) | 2 lines
Register only aliases in the qname chain
------------------------------------------------------------------------
r2464 | hserus | 2006-11-23 17:09:39 -0800 (Thu, 23 Nov 2006) | 6 lines
Do away with VAL_R_ status codes
build a pending query and validate authentication chain only If initial status is less
than VAL_AC_DONT_GO_FURTHER
Reorganize code for indentifying validation status values
Fix DNAME alias construction logic
------------------------------------------------------------------------
r2463 | hserus | 2006-11-23 17:09:05 -0800 (Thu, 23 Nov 2006) | 2 lines
Use val_istrusted() instead of individual success error codes
------------------------------------------------------------------------
r2462 | hserus | 2006-11-23 17:08:29 -0800 (Thu, 23 Nov 2006) | 2 lines
Add description for the trusted zone-security-expection condition
------------------------------------------------------------------------
r2461 | hserus | 2006-11-23 17:07:46 -0800 (Thu, 23 Nov 2006) | 2 lines
Add description for VAL_UNTRUSTED_ZONE status
------------------------------------------------------------------------
r2460 | hserus | 2006-11-23 17:07:05 -0800 (Thu, 23 Nov 2006) | 2 lines
Do away with the VAL_R_ status codes
------------------------------------------------------------------------
r2459 | hserus | 2006-11-22 16:12:37 -0800 (Wed, 22 Nov 2006) | 2 lines
Set the NONEXISTENT status only if we know that the answer is complete
------------------------------------------------------------------------
r2458 | hserus | 2006-11-22 15:52:46 -0800 (Wed, 22 Nov 2006) | 2 lines
Add logic for VAL_AC_TRUSTED_ZONE and VAL_TRUSTED_ZONE along the lines of VAL_AC_IGNORE_VALIDATION and VAL_IGNORE_VALIDATION
------------------------------------------------------------------------
r2457 | hserus | 2006-11-22 15:50:44 -0800 (Wed, 22 Nov 2006) | 2 lines
Add descriptions for VAL_TRUSTED_ZONE and VAL_AC_TRUSTED_ZONE
------------------------------------------------------------------------
r2453 | hserus | 2006-11-22 15:05:47 -0800 (Wed, 22 Nov 2006) | 4 lines
Recognize VAL_NONEXISTENT_NAME_OPTOUT as a variant of VAL_NONEXISTENT_NAME
Instead of looking for specific status codes that indicate that the proof was locally trusted, use the
val_istrusted() function.
------------------------------------------------------------------------
r2452 | hserus | 2006-11-22 15:02:39 -0800 (Wed, 22 Nov 2006) | 2 lines
Recognize VAL_NONEXISTENT_NAME_OPTOUT as a variant of VAL_NONEXISTENT_NAME
------------------------------------------------------------------------
r2451 | hserus | 2006-11-22 14:53:55 -0800 (Wed, 22 Nov 2006) | 2 lines
State that the NONEXISTENT error codes are returned when the proofs are trustworthy, and even if they have not been validated specifically.
------------------------------------------------------------------------
r2450 | hserus | 2006-11-22 14:38:34 -0800 (Wed, 22 Nov 2006) | 2 lines
Remove statements that can be interpreted as an implicit policy directive.
------------------------------------------------------------------------
r2449 | hserus | 2006-11-22 13:15:30 -0800 (Wed, 22 Nov 2006) | 2 lines
Properly detect span checks in proofs of non-existence even when wildcard proof appears before it.
------------------------------------------------------------------------
r2448 | rstory | 2006-11-22 12:44:15 -0800 (Wed, 22 Nov 2006) | 1 line
whitespace changes to make columns line up properly
------------------------------------------------------------------------
r2445 | hserus | 2006-11-22 12:13:51 -0800 (Wed, 22 Nov 2006) | 2 lines
Change expected status value for cname/AAAA test cases. The alias pointed to by the cname must validate successfully.
------------------------------------------------------------------------
r2438 | hserus | 2006-11-22 09:58:32 -0800 (Wed, 22 Nov 2006) | 2 lines
Correct some inconsistencies.
------------------------------------------------------------------------
r2437 | hserus | 2006-11-22 09:41:26 -0800 (Wed, 22 Nov 2006) | 3 lines
Don't use the VAL_AC_DONT_VALIDATE state. We had already defined the VAL_AC_IGNORE_VALIDATION state;
continue to use this.
------------------------------------------------------------------------
r2434 | hserus | 2006-11-22 07:18:29 -0800 (Wed, 22 Nov 2006) | 2 lines
Remove full path in the .so statements for manfiles
------------------------------------------------------------------------
r2428 | baerm | 2006-11-21 15:18:47 -0800 (Tue, 21 Nov 2006) | 11 lines
Added val_getnameinfo, val_gethostbyaddr_r, val_gethostbyaddr procedures
to val_getaddrinfo.c.
Working in local tests and should be good to use.
Still to do: only doing validation, should add /etc/hosts check;
should be in separate .c files.
------------------------------------------------------------------------
r2423 | hserus | 2006-11-21 12:27:16 -0800 (Tue, 21 Nov 2006) | 2 lines
Add basic support for DNAME
------------------------------------------------------------------------
r2422 | hserus | 2006-11-21 12:26:38 -0800 (Tue, 21 Nov 2006) | 3 lines
Add basic support for DNAME
Keep ordering of results same as the ordering of rrsets in the response
------------------------------------------------------------------------
r2412 | tewok | 2006-11-21 08:37:44 -0800 (Tue, 21 Nov 2006) | 3 lines
Changes for pod updates.
------------------------------------------------------------------------
r2411 | tewok | 2006-11-21 08:34:44 -0800 (Tue, 21 Nov 2006) | 3 lines
Minor wording or formatting changes.
------------------------------------------------------------------------
r2410 | tewok | 2006-11-21 08:24:44 -0800 (Tue, 21 Nov 2006) | 3 lines
Slight rewording change.
------------------------------------------------------------------------
r2402 | tewok | 2006-11-21 07:48:41 -0800 (Tue, 21 Nov 2006) | 4 lines
Adding update versions.
------------------------------------------------------------------------
r2401 | tewok | 2006-11-21 07:42:48 -0800 (Tue, 21 Nov 2006) | 4 lines
A few minor fixes (mostly punctuation and formatting) that escaped
an earlier checkin.
------------------------------------------------------------------------
r2400 | hserus | 2006-11-21 07:08:09 -0800 (Tue, 21 Nov 2006) | 2 lines
update man for most recent pod
------------------------------------------------------------------------
r2398 | tewok | 2006-11-20 20:52:51 -0800 (Mon, 20 Nov 2006) | 3 lines
Formatting fixes.
------------------------------------------------------------------------
r2397 | tewok | 2006-11-20 19:23:17 -0800 (Mon, 20 Nov 2006) | 3 lines
Formatting fix.
------------------------------------------------------------------------
r2396 | tewok | 2006-11-20 19:17:27 -0800 (Mon, 20 Nov 2006) | 4 lines
Formatting changes.
Reworded a few sentences.
------------------------------------------------------------------------
r2395 | tewok | 2006-11-20 18:33:10 -0800 (Mon, 20 Nov 2006) | 3 lines
Clarify an error description.
------------------------------------------------------------------------
r2394 | tewok | 2006-11-20 18:13:24 -0800 (Mon, 20 Nov 2006) | 4 lines
Formatting fixes.
Wording changes.
------------------------------------------------------------------------
r2393 | tewok | 2006-11-20 17:39:02 -0800 (Mon, 20 Nov 2006) | 5 lines
Reworded some sentences.
Fixed formatting.
Fixed a couple of misspelled constants.
------------------------------------------------------------------------
r2390 | hserus | 2006-11-20 12:28:17 -0800 (Mon, 20 Nov 2006) | 2 lines
Perform proper detection of cname loops
------------------------------------------------------------------------
r2389 | hserus | 2006-11-20 11:35:01 -0800 (Mon, 20 Nov 2006) | 5 lines
disable SIG_ACCEPT_WINDOW by default
Add a new member to the delegation_info structure to keep track of partial answers (cnames) received
Add a new member qc_original_name to val_query_chain to keep track of the original query. The qc_name_n
member changes when cnames are followed
------------------------------------------------------------------------
r2388 | hserus | 2006-11-20 11:34:44 -0800 (Mon, 20 Nov 2006) | 2 lines
Add definition for find_nslist_for_query()
------------------------------------------------------------------------
r2387 | hserus | 2006-11-20 11:34:28 -0800 (Mon, 20 Nov 2006) | 6 lines
Move register_query() and deregister_query() functions from val_resquery.c to val_support.c
Move logic of identifying target nameservers for a query into a new function find_nslist_for_query()
Add a new member to the delegation_info structure to keep track of partial answers (cnames) received
Rename do_referral() to follow_referral_or_alias_link()
Add logic for fetching cname alias records
------------------------------------------------------------------------
r2386 | hserus | 2006-11-20 11:34:00 -0800 (Mon, 20 Nov 2006) | 4 lines
Move register_query() and deregister_query() functions from val_resquery.c to val_support.c
Add function for merging rrsets from one list to another. This is essentially the same as stow_info() but
without the locking portion
------------------------------------------------------------------------
r2385 | hserus | 2006-11-20 11:33:38 -0800 (Mon, 20 Nov 2006) | 3 lines
Identify the "top" query from the original query name; not the name that we came up with after following
alias chains
------------------------------------------------------------------------
r2384 | hserus | 2006-11-20 11:33:19 -0800 (Mon, 20 Nov 2006) | 7 lines
Rename qc_name_n to qname_n in places where it does not specifically relate to the query_chain structure
Rename qc_type_h to qtype_h in places where it does not specifically relate to the query_chain structure
Identify the "top" query from the original query name; not the name that we came up with after following
alias chains
Move logic of identifying target nameservers for a query into a new function find_nslist_for_query()
Add logic for loop-detection of cname chains
------------------------------------------------------------------------
r2383 | hserus | 2006-11-20 11:32:49 -0800 (Mon, 20 Nov 2006) | 5 lines
Maintain a separate cache for (zonename, server) mapping to account for the case where our default name
server is authoritative for a non-public zone (such as example.com). Look up this cache before we look for
other NS records.
Rename get_matching_nslist to get_nslist_from_cache
------------------------------------------------------------------------
r2382 | tewok | 2006-11-20 08:41:50 -0800 (Mon, 20 Nov 2006) | 3 lines
Formatting changes.
------------------------------------------------------------------------
r2381 | tewok | 2006-11-20 05:50:56 -0800 (Mon, 20 Nov 2006) | 3 lines
Added a missing word.
------------------------------------------------------------------------
r2380 | tewok | 2006-11-20 05:45:26 -0800 (Mon, 20 Nov 2006) | 4 lines
Formatting changes.
Rewording a couple sentences.
------------------------------------------------------------------------
r2342 | tewok | 2006-11-17 09:33:12 -0800 (Fri, 17 Nov 2006) | 3 lines
Changed a duplicated "resolv.conf" into the intended "root.hints".
------------------------------------------------------------------------
r2337 | hserus | 2006-11-17 07:34:30 -0800 (Fri, 17 Nov 2006) | 3 lines
Rename VAL_AC_TRUST_ZONE to VAL_AC_IGNORE_VALIDATION
Add a new final result status for VAL_IGNORE_VALIDATION
------------------------------------------------------------------------
r2336 | hserus | 2006-11-17 07:33:55 -0800 (Fri, 17 Nov 2006) | 2 lines
Fix bug in CHECK_MASKED_STATUS macro
------------------------------------------------------------------------
r2335 | hserus | 2006-11-17 07:33:39 -0800 (Fri, 17 Nov 2006) | 2 lines
Modified to recognize VAL_IGNORE_VALIDATION as another trust state.
------------------------------------------------------------------------
r2334 | hserus | 2006-11-17 07:33:23 -0800 (Fri, 17 Nov 2006) | 10 lines
Rename VAL_AC_TRUST_ZONE to VAL_AC_IGNORE_VALIDATION
Add a new final result status for VAL_IGNORE_VALIDATION
Don't perform validation and some proof-related sanity checks if the VAL_IGNORE_VALIDATION status is set
Recognize VAL_IGNORE_VALIDATION as a trusted state
In transform_single_result allow an empty result to also be created
Replace top_q argument in prove_nonexistence() with selected members from within it.
Add basic logic for cname sanity checking. We still need to implement logic for fetching aliases when these are not automatically returned and for detecting
loops.
------------------------------------------------------------------------
r2333 | hserus | 2006-11-17 07:17:53 -0800 (Fri, 17 Nov 2006) | 2 lines
Multiple bogus elements in the chain-of-trust reduces the final status to BOGUS_UNPROVABLE.
------------------------------------------------------------------------
r2329 | tewok | 2006-11-17 04:28:50 -0800 (Fri, 17 Nov 2006) | 3 lines
Fixed a typo.
------------------------------------------------------------------------
r2328 | hserus | 2006-11-16 16:01:15 -0800 (Thu, 16 Nov 2006) | 2 lines
Set h_errno to appropriate value for val_res_query()
------------------------------------------------------------------------
r2327 | tewok | 2006-11-16 12:26:38 -0800 (Thu, 16 Nov 2006) | 4 lines
Updated to match the other docs.
Added a missing =back.
------------------------------------------------------------------------
r2324 | hserus | 2006-11-15 14:11:26 -0800 (Wed, 15 Nov 2006) | 2 lines
Turns out that VAL_GET* need to be exported. Partially revert earlier change.
------------------------------------------------------------------------
r2323 | hserus | 2006-11-15 14:07:13 -0800 (Wed, 15 Nov 2006) | 2 lines
Move some of the libval-specific macros to val_support.h
------------------------------------------------------------------------
r2322 | hserus | 2006-11-15 14:02:46 -0800 (Wed, 15 Nov 2006) | 2 lines
Revert an earlier change. Move macros from ns_parse.h to res_support.h
------------------------------------------------------------------------
r2321 | hserus | 2006-11-15 13:46:07 -0800 (Wed, 15 Nov 2006) | 2 lines
Add prototypes for free_validator_cache() and wire_name_length()
------------------------------------------------------------------------
r2320 | hserus | 2006-11-15 13:45:19 -0800 (Wed, 15 Nov 2006) | 3 lines
Moved policy-specific definitions to val_policy.h. In order to do this we also need to remove dependency on
MAX_POLICY_TOKEN
------------------------------------------------------------------------
r2319 | hserus | 2006-11-15 12:53:22 -0800 (Wed, 15 Nov 2006) | 2 lines
Remove un-used files
------------------------------------------------------------------------
r2318 | hserus | 2006-11-15 12:52:21 -0800 (Wed, 15 Nov 2006) | 2 lines
Move relevant documentation of val_getaddrinfo from val_getaddrinfo.h to val_getaddrinfo.c
------------------------------------------------------------------------
r2317 | hserus | 2006-11-15 12:38:51 -0800 (Wed, 15 Nov 2006) | 2 lines
Prototypes in val_x_query.c are declared in validator.h
------------------------------------------------------------------------
r2316 | hserus | 2006-11-15 12:37:23 -0800 (Wed, 15 Nov 2006) | 2 lines
Add the compose_answer() prototype since this function is exported as well.
------------------------------------------------------------------------
r2315 | hserus | 2006-11-15 12:13:34 -0800 (Wed, 15 Nov 2006) | 2 lines
validator.h subsumes the role of val_debug.h
------------------------------------------------------------------------
r2314 | hserus | 2006-11-15 10:07:24 -0800 (Wed, 15 Nov 2006) | 2 lines
Remove include for res_debug.h; resolver.h subsumes the role of res_debug.h
------------------------------------------------------------------------
r2313 | hserus | 2006-11-15 09:58:08 -0800 (Wed, 15 Nov 2006) | 2 lines
Get rid of compilation warnings.
------------------------------------------------------------------------
r2312 | hserus | 2006-11-15 09:44:56 -0800 (Wed, 15 Nov 2006) | 3 lines
Move definitions for RES_GET16 and RES_GET32 from resolver.h to ns_parse.h since these are local to libsres
Add protottypes for p_class() and p_type() to resolver.h to indicate that these functions are exported.
------------------------------------------------------------------------
r2311 | hserus | 2006-11-15 09:27:14 -0800 (Wed, 15 Nov 2006) | 2 lines
Moved definitions from res_debug.h to resolver.h. This is to remove unnecessary dependencies on libsres.
------------------------------------------------------------------------
r2310 | hserus | 2006-11-15 09:04:26 -0800 (Wed, 15 Nov 2006) | 2 lines
Remove dependency on libsres for the CREATE_NSADDR_ARRAY macro
------------------------------------------------------------------------
r2308 | hserus | 2006-11-15 06:34:28 -0800 (Wed, 15 Nov 2006) | 2 lines
Insert missing white space
------------------------------------------------------------------------
r2302 | hserus | 2006-11-14 09:05:34 -0800 (Tue, 14 Nov 2006) | 2 lines
Keep validator documentation up-to-date
------------------------------------------------------------------------
r2283 | hserus | 2006-11-09 09:37:37 -0800 (Thu, 09 Nov 2006) | 3 lines
Add description for ns_name_ntop and ns_name_pton, since val_resolve_and_check uses DNS wire format for the
domain name.
------------------------------------------------------------------------
r2281 | hserus | 2006-11-08 12:37:52 -0800 (Wed, 08 Nov 2006) | 3 lines
Don't set EDNS0 when query is sent with VAL_FLAGS_DONT_VALIDATE
Continue to fetch glue for each of the NS records returned if answers are not returned for the ones earlier
------------------------------------------------------------------------
r2280 | hserus | 2006-11-08 12:36:03 -0800 (Wed, 08 Nov 2006) | 3 lines
Add a new flags field to the query structure; only value recognized is VAL_FLAGS_DONT_VALIDATE, which causes EDNS0 to be turned off
in queries.
------------------------------------------------------------------------
r2279 | hserus | 2006-11-08 12:33:58 -0800 (Wed, 08 Nov 2006) | 2 lines
Fix parameter mismatch in _sigverify() routines
------------------------------------------------------------------------
r2278 | hserus | 2006-11-08 11:57:14 -0800 (Wed, 08 Nov 2006) | 2 lines
Check for proper condition in provable insecure detection logic
------------------------------------------------------------------------
r2273 | hserus | 2006-11-08 09:04:06 -0800 (Wed, 08 Nov 2006) | 2 lines
Expand ALGO to ALGORITHM
------------------------------------------------------------------------
r2272 | hserus | 2006-11-08 09:03:01 -0800 (Wed, 08 Nov 2006) | 2 lines
Removed SR_SUSPICIOUS_BIT since this is never used
------------------------------------------------------------------------
r2271 | hserus | 2006-11-08 09:02:42 -0800 (Wed, 08 Nov 2006) | 8 lines
Removed VAL_A_TOO_MANY_LINKS
Removed VAL_A_FLOOD_ATTACK_DETECTED
Removed VAL_A_NO_PREFERRED_SEP
Renamed VAL_A_SECURITY_LAME to VAL_AC_BAD_DELEGATION
Renamed VAL_A_* to VAL_AC_*
Expand ALGO to ALGORITHM
Expand PROTO to PROTOCOL
------------------------------------------------------------------------
r2270 | hserus | 2006-11-08 09:02:31 -0800 (Wed, 08 Nov 2006) | 2 lines
Renamed VAL_A_* to VAL_AC_*
------------------------------------------------------------------------
r2269 | hserus | 2006-11-08 09:02:13 -0800 (Wed, 08 Nov 2006) | 2 lines
Some word-smithing
------------------------------------------------------------------------
r2268 | hserus | 2006-11-08 09:02:00 -0800 (Wed, 08 Nov 2006) | 3 lines
Renamed VAL_A_* to VAL_AC_*
Expand ALGO to ALGORITHM
------------------------------------------------------------------------
r2267 | hserus | 2006-11-08 09:00:44 -0800 (Wed, 08 Nov 2006) | 6 lines
Expand ALGO to ALGORITHM
Rename p_val_error to p_val_status
Rename p_val_error to p_val_status
Rename p_query_error to p_query_status
Also maintain older definitions for backwards compatibility
------------------------------------------------------------------------
r2266 | hserus | 2006-11-08 09:00:29 -0800 (Wed, 08 Nov 2006) | 2 lines
Rename p_val_error to p_val_status
------------------------------------------------------------------------
r2265 | hserus | 2006-11-08 09:00:16 -0800 (Wed, 08 Nov 2006) | 11 lines
Rename p_val_error to p_val_status
Rename p_val_error to p_val_status
Rename p_query_error to p_query_status
Removed SR_SUSPICIOUS_BIT since this is never used
Removed VAL_A_TOO_MANY_LINKS
Removed VAL_A_FLOOD_ATTACK_DETECTED
Removed VAL_A_NO_PREFERRED_SEP
Renamed VAL_A_SECURITY_LAME to VAL_AC_BAD_DELEGATION
Renamed VAL_A_* to VAL_AC_*
Expand ALGO to ALGORITHM
------------------------------------------------------------------------
r2264 | hserus | 2006-11-08 08:59:48 -0800 (Wed, 08 Nov 2006) | 4 lines
Rename p_val_error to p_val_status
Rename p_val_error to p_val_status
Rename p_query_error to p_query_status
------------------------------------------------------------------------
r2263 | hserus | 2006-11-08 08:59:35 -0800 (Wed, 08 Nov 2006) | 2 lines
Renamed VAL_A_* to VAL_AC_*
------------------------------------------------------------------------
r2262 | hserus | 2006-11-08 08:59:21 -0800 (Wed, 08 Nov 2006) | 5 lines
Expand ALGO to ALGORITHM
Expand PROTO to PROTOCOL
Renamed VAL_A_SECURITY_LAME to VAL_AC_BAD_DELEGATION
Renamed VAL_A_* to VAL_AC_*
------------------------------------------------------------------------
r2261 | hserus | 2006-11-08 08:58:54 -0800 (Wed, 08 Nov 2006) | 14 lines
Wording changes, updated error codes to reflect only those used by the library
Rename p_val_error to p_val_status
Rename p_val_error to p_val_status
Renamed VAL_A_SECURITY_LAME to VAL_AC_BAD_DELEGATION
Removed VAL_A_CLOCK_SKEW
Removed VAL_A_DUPLICATE_KEYTAG
Removed VAL_A_NO_PREFERRED_SEP
Removed VAL_A_WRONG_RRSIG_OWNER
Removed VAL_A_KEYTAG_MISMATCH
Removed VAL_A_TOO_MANY_LINKS
Expand ALGO to ALGORITHM
Expand PROTO to PROTOCOL
Renamed VAL_A_* to VAL_AC_*
------------------------------------------------------------------------
r2260 | hserus | 2006-11-08 08:58:28 -0800 (Wed, 08 Nov 2006) | 14 lines
Rename p_val_error to p_val_status
Rename p_val_error to p_val_status
Renamed VAL_A_SECURITY_LAME to VAL_AC_BAD_DELEGATION
Removed VAL_A_CLOCK_SKEW
Removed VAL_A_DUPLICATE_KEYTAG
Removed VAL_A_NO_PREFERRED_SEP
Removed VAL_A_WRONG_RRSIG_OWNER
Removed VAL_A_KEYTAG_MISMATCH
Removed VAL_A_TOO_MANY_LINKS
Removed VAL_AC_DNSSEC_VERSION_ERROR
Expand ALGO to ALGORITHM
Expand PROTO to PROTOCOL
Renamed VAL_A_* to VAL_AC_*
------------------------------------------------------------------------
r2259 | hserus | 2006-11-08 08:57:47 -0800 (Wed, 08 Nov 2006) | 2 lines
Rename p_val_error to p_val_status
------------------------------------------------------------------------
r2258 | hserus | 2006-11-08 08:56:31 -0800 (Wed, 08 Nov 2006) | 6 lines
Removed VAL_A_CLOCK_SKEW
Renamed VAL_A_SECURITY_LAME to VAL_AC_BAD_DELEGATION
Renamed VAL_A_* to VAL_AC_*
Removed VAL_A_KEYTAG_MISMATCH
Expanded ALGO to ALGORITHM
------------------------------------------------------------------------
r2257 | hserus | 2006-11-08 08:56:12 -0800 (Wed, 08 Nov 2006) | 3 lines
Rename p_as_error to p_ac_status
Rename p_val_error to p_val_status
------------------------------------------------------------------------
r2231 | hserus | 2006-11-01 19:54:15 -0800 (Wed, 01 Nov 2006) | 2 lines
Don't print contents for free'd response structures
------------------------------------------------------------------------
r2220 | rstory | 2006-10-27 13:37:18 -0700 (Fri, 27 Oct 2006) | 1 line
do not try to parse 0 length msg or NULL ptr
------------------------------------------------------------------------
r2218 | hserus | 2006-10-26 14:42:13 -0700 (Thu, 26 Oct 2006) | 3 lines
Initialize ref_ns_list to NULL so that random value is not picked up when we see some referral error
Don't follow referrals when CNAMEs are present. This case will be dealt with later
------------------------------------------------------------------------
r2217 | hserus | 2006-10-26 14:40:46 -0700 (Thu, 26 Oct 2006) | 2 lines
Don't fix the returned name server list if ns_number_of_addresses is 0
------------------------------------------------------------------------
r2213 | hserus | 2006-10-24 16:12:12 -0700 (Tue, 24 Oct 2006) | 3 lines
Try to determine if a DNSKEY or RRSIG is missing instead of blindly storing query status value into the
assertion.
------------------------------------------------------------------------
r2212 | rstory | 2006-10-24 14:31:12 -0700 (Tue, 24 Oct 2006) | 2 lines
print responses for test cases if -p specified
------------------------------------------------------------------------
r2211 | rstory | 2006-10-24 14:29:58 -0700 (Tue, 24 Oct 2006) | 5 lines
- remove special case prototypes for solaris. use -D_REENTRANT and system
headers instead
- add additional paramter to ctime_r on solaris
- indent output from val_log_assertion to help show nesting
------------------------------------------------------------------------
r2210 | rstory | 2006-10-24 14:27:33 -0700 (Tue, 24 Oct 2006) | 4 lines
- remove special case prototypes for *_r functions on solaris.
compile with -D_REENTRANT to get these prototypes from system headers.
- fix calls to ctime_r for solaris, which has an extra parameter
------------------------------------------------------------------------
r2209 | rstory | 2006-10-24 14:25:50 -0700 (Tue, 24 Oct 2006) | 1 line
expose compose_answer prototype
------------------------------------------------------------------------
r2208 | rstory | 2006-10-24 14:24:59 -0700 (Tue, 24 Oct 2006) | 2 lines
- exclude more cases where the res_sym hack doesn't work
------------------------------------------------------------------------
r2207 | rstory | 2006-10-23 14:43:57 -0700 (Mon, 23 Oct 2006) | 2 lines
- make ctx param const for val_log_rrset(), val_log_rrsig_rdata()
------------------------------------------------------------------------
r2206 | rstory | 2006-10-23 14:43:37 -0700 (Mon, 23 Oct 2006) | 4 lines
- new val_log_val_rrset()
- new val_log_assertion_pfx()
- make ctx param const for val_log_rrset(), val_log_rrsig_rdata()
------------------------------------------------------------------------
r2205 | rstory | 2006-10-23 14:40:40 -0700 (Mon, 23 Oct 2006) | 1 line
fix final result tallies
------------------------------------------------------------------------
r2199 | hserus | 2006-10-23 12:49:52 -0700 (Mon, 23 Oct 2006) | 2 lines
Bug fix: Make sure that ns_address in struct name_server is initialized to NULL
------------------------------------------------------------------------
r2198 | hserus | 2006-10-23 08:23:19 -0700 (Mon, 23 Oct 2006) | 6 lines
Add a new function find_trust_point() to find out which trust anchor applies to a given name
Maintain separation between key status and return value in is_trusted_key()
Break out early from the is check_provably_unsecure() logic if we see something amiss
Dont use val_isauthentic()
val_istrusted() encompasses val_isauthentication() behavior
------------------------------------------------------------------------
r2197 | hserus | 2006-10-23 08:22:57 -0700 (Mon, 23 Oct 2006) | 2 lines
Add VAL_A_INVALID_RRSIG error code
------------------------------------------------------------------------
r2196 | hserus | 2006-10-23 08:22:43 -0700 (Mon, 23 Oct 2006) | 2 lines
Use ns_address in struct name_server as sockaddr_storage**
------------------------------------------------------------------------
r2195 | hserus | 2006-10-23 08:22:22 -0700 (Mon, 23 Oct 2006) | 2 lines
Use VAL_ERROR instead of VAL_INDETERMINATE to indicate that some answer was not received.
------------------------------------------------------------------------
r2194 | hserus | 2006-10-23 08:22:10 -0700 (Mon, 23 Oct 2006) | 3 lines
return void for rsasha1_sigverify() and friends but make sure that the sig_status and dnksey_status
values indicate the correct error.
------------------------------------------------------------------------
r2193 | hserus | 2006-10-23 08:21:49 -0700 (Mon, 23 Oct 2006) | 4 lines
return void for val_sigverify() but make sure that the sig_status and dnksey_status values indicate the
correct error.
modify SET_STATUS so that it really matches what the API requires
------------------------------------------------------------------------
r2192 | hserus | 2006-10-23 08:21:28 -0700 (Mon, 23 Oct 2006) | 4 lines
Dont use val_isauthentic()
val_istrusted() encompasses val_isauthentication() behavior
------------------------------------------------------------------------
r2191 | hserus | 2006-10-23 08:20:59 -0700 (Mon, 23 Oct 2006) | 5 lines
Updates for the next revision of the API draft
- add val_istrusted()
- clarify that some "validated" error codes can be returned even if we didn't complete validation but we figured that the answer was trusted
------------------------------------------------------------------------
r2190 | hserus | 2006-10-23 08:20:19 -0700 (Mon, 23 Oct 2006) | 2 lines
Define ns_address as a sockaddr_storage** and use accordingly
------------------------------------------------------------------------
r2188 | hserus | 2006-10-21 18:49:36 -0700 (Sat, 21 Oct 2006) | 2 lines
Version submitted as -02
------------------------------------------------------------------------
r2180 | hserus | 2006-10-20 09:43:32 -0700 (Fri, 20 Oct 2006) | 5 lines
Rename VAL_A_DONT_KNOW to VAL_A_UNSET
Rename VAL_A_NOT_A_ZONE_KEY to VAL_A_INVALID_KEY
Define VAL_A_SIGNING_KEY to indicate that the key was used to verify a signature
Define VAL_A_UNKNOWN_ALGO_LINK to indicate that the key matched a DS but the algo was unknown
------------------------------------------------------------------------
r2179 | hserus | 2006-10-20 09:41:32 -0700 (Fri, 20 Oct 2006) | 2 lines
Using VAL_A_UNSET in place of VAL_A_DONT_KNOW
------------------------------------------------------------------------
r2178 | hserus | 2006-10-20 09:41:06 -0700 (Fri, 20 Oct 2006) | 3 lines
Since the assertion status on failure (even when all rrsigs fail for the same reason) is
VAL_A_NOT_VERIFIED, use correct logic for identifying provably unsecure.
------------------------------------------------------------------------
r2177 | hserus | 2006-10-20 09:37:08 -0700 (Fri, 20 Oct 2006) | 2 lines
Make clear separation between return values and assertion status values
------------------------------------------------------------------------
r2176 | hserus | 2006-10-20 09:36:39 -0700 (Fri, 20 Oct 2006) | 6 lines
val_log_assertion() takes a struct val_authentication_chain instead of the individual members of this
structure.
Using VAL_A_INVALID_KEY in place of VAL_A_NOT_A_ZONE_KEY
Using VAL_A_UNSET in place of VAL_A_DONT_KNOW
Display new status values VAL_A_UNKNOWN_ALGO_LINK and VAL_A_SIGNING_KEY
------------------------------------------------------------------------
r2175 | hserus | 2006-10-20 09:34:21 -0700 (Fri, 20 Oct 2006) | 2 lines
Make clear separation between return values and assertion status values
------------------------------------------------------------------------
r2174 | hserus | 2006-10-20 09:32:38 -0700 (Fri, 20 Oct 2006) | 8 lines
Ensure that error conditions in the DNSKEY are properly reflected in the assertion status
using VAL_A_UNSET in place of VAL_A_DONT_KNOW
using VAL_A_INVALID_KEY in place of VAL_A_NOT_A_ZONE_KEY
Make clear separation between return values and assertion status values
Set the assertion status to VAL_A_NOT_VERIFIED even when all rrsigs fail for the same reason; we must look
at the rrsig status for the actual reason of failure
Use the VAL_A_UNKNOWN_ALGO_LINK status to indicate a potential provably unsecure condition.
------------------------------------------------------------------------
r2173 | hserus | 2006-10-20 09:26:20 -0700 (Fri, 20 Oct 2006) | 5 lines
More edits:
- separated status values for DNSKEY and RRSIGS
- new error code for VAL_A_UNKOWN_ALGO_LINK
- renamed VAL_A_NOT_A_ZONE_KEY to VAL_A_INVALID_KEY
------------------------------------------------------------------------
r2172 | hserus | 2006-10-19 22:14:14 -0700 (Thu, 19 Oct 2006) | 2 lines
Use sockaddr_storage where appropriate
------------------------------------------------------------------------
r2171 | hserus | 2006-10-19 22:14:00 -0700 (Thu, 19 Oct 2006) | 3 lines
Added respondent server information to init_rr_set prototype
------------------------------------------------------------------------
r2170 | hserus | 2006-10-19 22:13:46 -0700 (Thu, 19 Oct 2006) | 3 lines
Save respondent server information in rrset and copy this value in cloned rrsets
------------------------------------------------------------------------
r2169 | hserus | 2006-10-19 22:13:27 -0700 (Thu, 19 Oct 2006) | 3 lines
Make changes to allow respondent server information to be reflected in the final authentication chain
------------------------------------------------------------------------
r2168 | hserus | 2006-10-19 22:13:11 -0700 (Thu, 19 Oct 2006) | 2 lines
set correct value for number of addresses read for a name server
------------------------------------------------------------------------
r2167 | hserus | 2006-10-19 22:12:53 -0700 (Thu, 19 Oct 2006) | 3 lines
Added field for respondent server in val_rrset
Changed MAX_PROOF value to 4
------------------------------------------------------------------------
r2166 | hserus | 2006-10-19 22:12:39 -0700 (Thu, 19 Oct 2006) | 3 lines
Use sockaddr_storage where appropriate
Allow proper logging of respondent server information
------------------------------------------------------------------------
r2165 | hserus | 2006-10-19 22:12:17 -0700 (Thu, 19 Oct 2006) | 4 lines
perform a proper clone of the name server addresses when we have multiple A records associated with a name
Perform clone of respondent nameserver inside res_io_accept instead of within response_recv
------------------------------------------------------------------------
r2164 | hserus | 2006-10-19 22:11:55 -0700 (Thu, 19 Oct 2006) | 5 lines
Perform clone of respondent nameserver inside res_io_accept instead of within response_recv
Ensure that the correct name server is returned as the respondent nameserver when we have multiple A
records associated with a name
Typecast sockaddr_storage* to sockaddr* where appropriate
------------------------------------------------------------------------
r2163 | hserus | 2006-10-19 22:11:32 -0700 (Thu, 19 Oct 2006) | 2 lines
Use sockaddr_storage in place of sockaddr
------------------------------------------------------------------------
r2162 | hserus | 2006-10-19 22:11:07 -0700 (Thu, 19 Oct 2006) | 3 lines
Added definition for default policy and MAX_PROOFS
Also added details on respondent server
------------------------------------------------------------------------
r2159 | hserus | 2006-10-18 14:54:32 -0700 (Wed, 18 Oct 2006) | 2 lines
Edits for -02 version
------------------------------------------------------------------------
r2158 | hserus | 2006-10-18 08:41:43 -0700 (Wed, 18 Oct 2006) | 2 lines
Make list of error codes compliant with validator API
------------------------------------------------------------------------
r2157 | hserus | 2006-10-18 08:40:42 -0700 (Wed, 18 Oct 2006) | 2 lines
No longer using the VAL_GENERIC_ERROR error code.
------------------------------------------------------------------------
r2156 | hserus | 2006-10-18 08:40:08 -0700 (Wed, 18 Oct 2006) | 5 lines
Some minor twiddles in check_wildcard_sanity() so that existing loop is made use of.
val_ac_status will never be VAL_A_VERIFIED_LINK (this value is only present in rr_status), so dont check for this condition
Use VAL_R_IRRELEVANT_PROOF in place VAL_R_BOGUS to represent extraneous proofs
No longer using the VAL_GENERIC_ERROR error code
------------------------------------------------------------------------
r2155 | hserus | 2006-10-18 08:36:25 -0700 (Wed, 18 Oct 2006) | 4 lines
Changed SIG_ACCEPT_WINDOW to 1 day
Renamed free_val_addrinfo to val_freeaddrinfo
Also for backwards compatibility create a define for free_val_addrinfo linking it to the new definition
------------------------------------------------------------------------
r2154 | hserus | 2006-10-18 08:34:24 -0700 (Wed, 18 Oct 2006) | 2 lines
Remove unnecessary and duplicate cases.
------------------------------------------------------------------------
r2153 | hserus | 2006-10-18 08:32:13 -0700 (Wed, 18 Oct 2006) | 2 lines
Removed unnecessary TODO markers
------------------------------------------------------------------------
r2152 | hserus | 2006-10-18 08:31:18 -0700 (Wed, 18 Oct 2006) | 2 lines
Use val_freeaddrinfo() in place of free_val_addrinfo()
------------------------------------------------------------------------
r2151 | hserus | 2006-10-18 08:25:34 -0700 (Wed, 18 Oct 2006) | 2 lines
Account for SERVFAILS with NSEC3 records in the authoritative section.
------------------------------------------------------------------------
r2150 | hserus | 2006-10-18 08:24:34 -0700 (Wed, 18 Oct 2006) | 2 lines
Define return codes for only those definitions present in the validator API draft.
------------------------------------------------------------------------
r2148 | hserus | 2006-10-17 06:18:41 -0700 (Tue, 17 Oct 2006) | 2 lines
Display a message when signature inception times are in the future or signatures have expired, if they are within the SIG_ACCEPT_WINDOW range.
------------------------------------------------------------------------
r2144 | hserus | 2006-10-16 11:53:58 -0700 (Mon, 16 Oct 2006) | 3 lines
Temporary hack to allow RRSIGs to be validated within a window before inception and after expiration to account for clock skew and sig expirations.
This window is currently defined to be 7 days. Since this has obvious security ramifications, the choice of this value and the approach to handle the general topic of handling expired sigs are topics worthy of further discussion.
------------------------------------------------------------------------
r2143 | hserus | 2006-10-16 11:21:13 -0700 (Mon, 16 Oct 2006) | 2 lines
in val_log_authentication_chain make a clear demarcation between results, answers and proofs
------------------------------------------------------------------------
r2142 | hserus | 2006-10-16 11:19:03 -0700 (Mon, 16 Oct 2006) | 3 lines
Check for single result status for proof of non-existence
------------------------------------------------------------------------
r2141 | hserus | 2006-10-16 10:31:20 -0700 (Mon, 16 Oct 2006) | 4 lines
Moved the definition of check_conflicting_answers() before assimilate_answers()
In prove_nsec_span_chk() set the result status tentatively to VAL_NONEXISTENT_NAME when a span is identified. This may change
if wildcard checks prove us wrong.
------------------------------------------------------------------------
r2140 | hserus | 2006-10-16 09:39:30 -0700 (Mon, 16 Oct 2006) | 2 lines
Perform proper cleanup of dnskey rdata structure
------------------------------------------------------------------------
r2139 | rstory | 2006-10-16 08:24:38 -0700 (Mon, 16 Oct 2006) | 1 line
add header for ctime_r
------------------------------------------------------------------------
r2138 | hserus | 2006-10-16 06:57:00 -0700 (Mon, 16 Oct 2006) | 25 lines
Move openssl-related code to val_crypto.c
Use new val_rc_answer and val_ac_trust members in val_free_result_chain in place of the older val_ac_rrset
Use new qc_ans and qc_proof members in val_query_chain in place of older qc_as
Use struct _val_authentication_chain in place of older struct val_digested_auth_chain
Use struct _val_result_chain in place of older struct val_internal_result
- In fails_to_answer_query(), look at rrsig in addition to answer information while checking if data_present
- Dont check the availability of an rrsig for a DNSKEY that is trusted.
- In assimilate_answers(), create authentication chain structures for the answers as well as proofs
- Separate out the portions in assimilate_answers() that deal with checking if answers are mutually consistent into a new function called check_conflicting_answers(). Since proofs are stored separately from other answers, we don't need to specifically check if SOA,NXT etc conflict with answers.
- If we received an answer for a glue fetch operation, don't claim that validation is possible.
- Link the chain of trust to either the qc_proof or qc_ans member for a pending query depending on if this answer was a proof of non-existence or no.
- Separate nsec and nsec3 processing into two different functions, nsec_proof_chk() and nsec3_proof_chk(), for readability reasons.
- Rename the older nsec_proof_check() function to prove_nsec_span_chk()
Revamp the process for creation of the val_result_chain structure.
- transform_single_result() changes a single val_internal_result_chain structure to val_result_chain. You can specifically give a "proof_result" structure to function as the container for proofs if the val_internal_result_chain structure is of the proof variety.
- val_internal_result_chain has the val_rc_is_proof member that says if it is a proof or no.
- As we process proofs of non-existence keep transforming them into the result structure. That way, we keep answers and any associated proofs in the same val_result_chain structure.
- Perform sanity checks for wildcards before returning from val_resolve_and_check(). sanity checks for cnames and dnames will also be made in the future.
- Add a new function prove_existence() that checks if the given type exists in the NSEC[3] for a given name
- In sanity checks for non-existence proofs, check if the CNAME or DNAME bit is set for NSEC[3] record that proves a non-existent type.
- Use transform_outstanding_results() to process all results that have not been stored in some val_result_chain structure after sanity checks have been performed.
------------------------------------------------------------------------
r2137 | hserus | 2006-10-16 06:54:16 -0700 (Mon, 16 Oct 2006) | 8 lines
Renamed qc_as in struct val_query_chain to qc_ans
Perform proper cleanup of learned_zones, learned_keys, learned_ds and the rrset in digest_response()
Add logic for identifying if the answer section contains a valid cname
Recognize the case where a proof of non-existence is returned with a positive answer
Modify digest_response() such that if we got a response for a zone where DNSSEC is enabled, but we had sent out our query without EDNS0, we perform a re-query.
In val_resquery_rcv() store answers and proofs in separate members of struct domain_info
In find_next_zonecut() look at the proofs in addition to the answers to see if we found the SOA record; also look at the rrsig (if we have one) to identify the zonecut information.
------------------------------------------------------------------------
r2136 | hserus | 2006-10-16 06:53:42 -0700 (Mon, 16 Oct 2006) | 3 lines
Move VAL_A_RRSIG_VERIFIED close to all the "success" conditions
Add a new VAL_A_WCARD_VERIFIED state for assertions that were wildcard expanded.
------------------------------------------------------------------------
r2135 | hserus | 2006-10-16 06:53:23 -0700 (Mon, 16 Oct 2006) | 3 lines
Free the new di_answers and di_proofs members within the domain_info structure
Ensure correct initial state of rr_rec structures created by copy_rr_rec(), add_to_set() and add_to_sig()
------------------------------------------------------------------------
r2134 | hserus | 2006-10-16 06:53:01 -0700 (Mon, 16 Oct 2006) | 3 lines
Use the new name for struct _val_authentication_chain (struct val_digested_auth_chain)
Add prototype for is_trusted_zone()
------------------------------------------------------------------------
r2133 | hserus | 2006-10-16 06:52:30 -0700 (Mon, 16 Oct 2006) | 10 lines
Use VAL_FLAGS_DONT_VALIDATE in place of F_DONT_VALIDATE
Re-define the value of VAL_QUERY_MERGE_RRSETS since this was clashing with VAL_FLAGS_DONT_VALIDATE
Renamed struct _val_authentication_chain to struct val_digested_auth_chain
Renamed struct _val_result_chain to struct val_internal_result
The DNS response domain_info structure now has separate members for the answers and the proofs (di_answers, di_proofs) instead of a single di_rrset member
*** Note API change ****
Change the val_result_chain structure - Instead of the val_rc_trust member we now have separate members for the answers and the proofs (val_rc_answer,val_rc_proofs). Also keep track of the number of proofs using the val_rc_proof_count member.
------------------------------------------------------------------------
r2132 | hserus | 2006-10-16 06:51:19 -0700 (Mon, 16 Oct 2006) | 2 lines
Use new name val_rc_answer instead of older val_rc_trust member in val_result_chain structure
------------------------------------------------------------------------
r2131 | hserus | 2006-10-16 06:51:04 -0700 (Mon, 16 Oct 2006) | 5 lines
Move openssl-related operations to val_crypto.c
Use new name val_rc_answer instead of older val_rc_trust member in val_result_chain structure
Proofs are stored in (struct val_result_chain)->val_rc_proofs, use this in order to display proof information for the
authentication chain.
------------------------------------------------------------------------
r2130 | hserus | 2006-10-16 06:50:28 -0700 (Mon, 16 Oct 2006) | 2 lines
Move openssl-related operations to val_crypto.c
------------------------------------------------------------------------
r2129 | hserus | 2006-10-16 06:50:08 -0700 (Mon, 16 Oct 2006) | 2 lines
Use the new name struct val_digested_auth_chain for older struct _val_authentication_chain
------------------------------------------------------------------------
r2128 | hserus | 2006-10-16 06:49:12 -0700 (Mon, 16 Oct 2006) | 3 lines
Use new name val_rc_trust instead of older val_rc_answer member in val_result_chain structure
Check for NULL result returned from get_hostent_from_response
------------------------------------------------------------------------
r2127 | hserus | 2006-10-16 06:48:54 -0700 (Mon, 16 Oct 2006) | 5 lines
Move openssl-related operations to val_crypto.c
Handle the case where the DNSKEY and DS records have been wildcard-expanded (these are prohibited)
Use the new name for _val_authentication_chain (val_digested_auth_chain)
Set the status for assertions that have been wildcard expanded as VAL_A_WCARD_VERIFIED. The proof of existence of the expanded type is verified later on.
------------------------------------------------------------------------
r2126 | hserus | 2006-10-16 06:47:39 -0700 (Mon, 16 Oct 2006) | 2 lines
Add a note on cache processing w.r.t CNAMEs
------------------------------------------------------------------------
r2125 | hserus | 2006-10-16 06:47:11 -0700 (Mon, 16 Oct 2006) | 4 lines
Remove the crypto directory
Add a new file called val_crypto.[ch] that contains all openssl-related operations.
------------------------------------------------------------------------
r2124 | hserus | 2006-10-16 06:44:53 -0700 (Mon, 16 Oct 2006) | 4 lines
- Remove unused parameter in find_rrset_len
- Combine compose_merged_answer() and compose_answer() into a single function.
------------------------------------------------------------------------
r2123 | hserus | 2006-10-16 06:44:05 -0700 (Mon, 16 Oct 2006) | 7 lines
- Use the VAL_QUERY_MERGE_RRSETS flag in val_resolve_and_check so that multiple responses are returned in a manner
similar to res_query
- When operatating in daemon mode use a validator context so that cache and policy are properly made use of
- Since a common status value is stored for multiple proofs of non-existence, we only check test case result against this
single value.
------------------------------------------------------------------------
r2119 | rstory | 2006-10-13 08:57:01 -0700 (Fri, 13 Oct 2006) | 1 line
don't use (internal) const aware version of res_sym if p_*_sym are macros
------------------------------------------------------------------------
r2106 | rstory | 2006-10-06 10:07:52 -0700 (Fri, 06 Oct 2006) | 5 lines
- daemon mode: it works!
- add signal handler for clean shutdown on sigterm/sigint
- clear cache before exit
- send responses
------------------------------------------------------------------------
r2105 | rstory | 2006-10-06 10:03:15 -0700 (Fri, 06 Oct 2006) | 4 lines
- transform_results()
- use new copy_rr_rec_list so responses with multiple answers works
- remove audit comment
------------------------------------------------------------------------
r2104 | rstory | 2006-10-06 10:01:28 -0700 (Fri, 06 Oct 2006) | 1 line
new copy_rr_rec_list() function
------------------------------------------------------------------------
r2103 | rstory | 2006-10-05 15:29:39 -0700 (Thu, 05 Oct 2006) | 1 line
export compose_answer
------------------------------------------------------------------------
r2101 | rstory | 2006-10-05 07:53:07 -0700 (Thu, 05 Oct 2006) | 6 lines
- clean up main
- move selftest code into function
- move selftest and error checks earlier
- allows 2 levels of indention to be removed
- run indent
------------------------------------------------------------------------
r2100 | rstory | 2006-10-05 07:24:14 -0700 (Thu, 05 Oct 2006) | 1 line
start support for daemon mode: listen, query & validate; no responses yet
------------------------------------------------------------------------
r2099 | rstory | 2006-10-05 06:33:20 -0700 (Thu, 05 Oct 2006) | 1 line
get rid of newline in time string
------------------------------------------------------------------------
r2098 | rstory | 2006-10-05 06:28:55 -0700 (Thu, 05 Oct 2006) | 1 line
convert wire name to ascii before logging
------------------------------------------------------------------------
r2097 | rstory | 2006-10-05 06:26:35 -0700 (Thu, 05 Oct 2006) | 1 line
remove unused variable
------------------------------------------------------------------------
r2096 | rstory | 2006-10-05 06:24:26 -0700 (Thu, 05 Oct 2006) | 1 line
get rid of newline in time string
------------------------------------------------------------------------
r2095 | rstory | 2006-10-05 04:51:55 -0700 (Thu, 05 Oct 2006) | 1 line
remove linefeeds from val_log messages
------------------------------------------------------------------------
r2091 | rstory | 2006-10-04 14:53:53 -0700 (Wed, 04 Oct 2006) | 1 line
fix typo
------------------------------------------------------------------------
r2087 | rstory | 2006-10-04 12:12:04 -0700 (Wed, 04 Oct 2006) | 3 lines
- add ttl expiration time field to rrset struct
- add simplistic ttl expiration checks when querying cache
------------------------------------------------------------------------
r2082 | baerm | 2006-10-03 14:22:20 -0700 (Tue, 03 Oct 2006) | 3 lines
update service handling by getaddrinfo (ports should
be set correctly now)
------------------------------------------------------------------------
r2081 | rstory | 2006-10-03 12:12:40 -0700 (Tue, 03 Oct 2006) | 1 line
remove bogus/test struct member
------------------------------------------------------------------------
r2080 | rstory | 2006-10-03 11:28:26 -0700 (Tue, 03 Oct 2006) | 1 line
remove tabs from macros
------------------------------------------------------------------------
r2074 | rstory | 2006-09-29 13:56:15 -0700 (Fri, 29 Sep 2006) | 1 line
define local res_sym lookalike w/const char*, to get rid of a slew of compiler complaints
------------------------------------------------------------------------
r2073 | rstory | 2006-09-29 13:54:56 -0700 (Fri, 29 Sep 2006) | 1 line
add prototype for ns_samename iff missing
------------------------------------------------------------------------
r2072 | rstory | 2006-09-29 13:54:18 -0700 (Fri, 29 Sep 2006) | 1 line
add decl check for ns_samename
------------------------------------------------------------------------
r2071 | rstory | 2006-09-29 13:19:05 -0700 (Fri, 29 Sep 2006) | 1 line
run autoconf
------------------------------------------------------------------------
r2070 | rstory | 2006-09-29 13:18:38 -0700 (Fri, 29 Sep 2006) | 1 line
remove double-print of result
------------------------------------------------------------------------
r2061 | rstory | 2006-09-28 14:13:40 -0700 (Thu, 28 Sep 2006) | 1 line
add headers for solaris
------------------------------------------------------------------------
r2060 | rstory | 2006-09-28 14:13:06 -0700 (Thu, 28 Sep 2006) | 1 line
add prototype/parameter cast for solaris
------------------------------------------------------------------------
r2059 | rstory | 2006-09-28 14:11:19 -0700 (Thu, 28 Sep 2006) | 1 line
add header/prototype for solairs
------------------------------------------------------------------------
r2057 | rstory | 2006-09-28 14:01:37 -0700 (Thu, 28 Sep 2006) | 1 line
add headers for solaris
------------------------------------------------------------------------
r2056 | rstory | 2006-09-27 13:33:36 -0700 (Wed, 27 Sep 2006) | 3 lines
- don't dereference NULL ptr
- add ability to run a range of tests
------------------------------------------------------------------------
r2055 | rstory | 2006-09-27 12:25:51 -0700 (Wed, 27 Sep 2006) | 2 lines
fix bad commit; this is r2040 + indent
------------------------------------------------------------------------
r2054 | rstory | 2006-09-27 12:06:21 -0700 (Wed, 27 Sep 2006) | 1 line
run indent
------------------------------------------------------------------------
r2053 | rstory | 2006-09-27 11:22:45 -0700 (Wed, 27 Sep 2006) | 7 lines
- is_trusted_key(): clear dnskey between iterations
- prove_nsec_wildcard_check()
- check for null parameter
- don't memcpy from null ptr
- update find_next_zonecut calls to pass context
- ask_cache(): make sure to do 'deep' release of resources
------------------------------------------------------------------------
r2052 | rstory | 2006-09-27 11:11:16 -0700 (Wed, 27 Sep 2006) | 5 lines
- get_addrinfo_from_result()
- use sizeof() instead of hardcoded size
- release unused memory before return
- strdup canonname
------------------------------------------------------------------------
r2051 | rstory | 2006-09-27 11:08:32 -0700 (Wed, 27 Sep 2006) | 5 lines
- minor optimizations to TOK_IN_STR macro
- val_parse_dnskey_string()
- cleanup memory for error cases
- clear passed ptr if we released the memory
------------------------------------------------------------------------
r2050 | rstory | 2006-09-27 11:06:13 -0700 (Wed, 27 Sep 2006) | 7 lines
- make_sigfield(): check for overflow before memcpy
- find_key_for_tag()
- check for null param
- check function rc and continue on error
- free allocated public_key if not used
- verify_next_assertion(): free allocated public_key if not used
------------------------------------------------------------------------
r2049 | rstory | 2006-09-27 11:04:00 -0700 (Wed, 27 Sep 2006) | 4 lines
- res_sq_free_rrset_recs(): free all name servers
- find_rr_set(): don't try to clone null ptr
- decompress(): use sizeof(var) instead of hardcoded size
------------------------------------------------------------------------
r2048 | rstory | 2006-09-27 11:00:17 -0700 (Wed, 27 Sep 2006) | 13 lines
- SAVE_RR_TO_LIST
- move from header to above function where used
- add appropriate cleanup on return cases
- digest_response()
- free learned_* rrsets before returning
- add 'else' to save unnecessary comparison
- val_resquery_send(): rename var to *_p to indicate ascii domain
- val_resquery_rcv()
- rename var to *_p to indicate ascii domain
- free response_data if not used
- free response domain info when done w/it
- find_next_zonecut(): add context param so no temporary needed
------------------------------------------------------------------------
r2047 | rstory | 2006-09-27 10:47:34 -0700 (Wed, 27 Sep 2006) | 11 lines
- add policy_cleanup() to release allocated memory
- use atexit to register policy_cleanup() when memory allocated
- use sizeof() instead of macro for size parameter
- destroy_valpol(): traverse plist to release all memory
- rename some vars to *_p to indicate they are ascii names, not wire format
- read_root_hints_file()
- use local static to return w/out action if already called
- don't use SAVE_RR_TO_LIST macro; instead copy code it and add appropriate
resource cleanup in error cases
- cleanup memory before return
------------------------------------------------------------------------
r2046 | rstory | 2006-09-27 10:27:32 -0700 (Wed, 27 Sep 2006) | 9 lines
- add/use new LOCK_DOWNGRADE macro
- stow_info(): fix memory leak
- get_cached_rrset(): get lock sooner
- stow_root_info()
- get lock sooner
- return w/no action if we already read root info
- make sure to release lock for all exit paths
- free_validator_cache(): free root_info
------------------------------------------------------------------------
r2045 | rstory | 2006-09-27 10:21:02 -0700 (Wed, 27 Sep 2006) | 1 line
free cache on exit
------------------------------------------------------------------------
r2044 | hserus | 2006-09-27 07:23:46 -0700 (Wed, 27 Sep 2006) | 2 lines
Add configure and header files generated after adding checks for gethostbyname2 and hstrerror
------------------------------------------------------------------------
r2043 | hserus | 2006-09-27 06:30:15 -0700 (Wed, 27 Sep 2006) | 4 lines
Don't expose the union within val_authentication_chain in the API. Instead, create internal versions
_val_authentication_chain and _val_result_chain to handle this data structure. This keeps the structures
in conformance with draft-hayatnagarkar-dnsext-validator-api
------------------------------------------------------------------------
r2042 | hserus | 2006-09-26 11:59:57 -0700 (Tue, 26 Sep 2006) | 2 lines
Return EAI_SERVICE from process_service_and_hints() instead of NULL
------------------------------------------------------------------------
r2041 | hserus | 2006-09-26 11:53:34 -0700 (Tue, 26 Sep 2006) | 2 lines
Add prototypes for inet_nsap_addr and inet_nsap_ntoa
------------------------------------------------------------------------
r2040 | hserus | 2006-09-26 11:51:58 -0700 (Tue, 26 Sep 2006) | 2 lines
Allow compilation on Solaris
------------------------------------------------------------------------
r2031 | baerm | 2006-09-25 16:20:06 -0700 (Mon, 25 Sep 2006) | 3 lines
changed val_getaddrinfo processing and process_service_and_hints
to handle service names and numbers
------------------------------------------------------------------------
r2030 | hserus | 2006-09-25 13:20:20 -0700 (Mon, 25 Sep 2006) | 2 lines
Save the response header bytes in rrset_rec; copy and free these fields where ever appropriate.
------------------------------------------------------------------------
r2029 | hserus | 2006-09-25 13:16:57 -0700 (Mon, 25 Sep 2006) | 2 lines
Remove redundant check
------------------------------------------------------------------------
r2028 | rstory | 2006-09-25 12:25:12 -0700 (Mon, 25 Sep 2006) | 1 line
restore null ptr check lost somehow during indent checkins
------------------------------------------------------------------------
r2027 | rstory | 2006-09-25 11:57:03 -0700 (Mon, 25 Sep 2006) | 2 lines
- second pass of indent
------------------------------------------------------------------------
r2026 | rstory | 2006-09-25 11:06:07 -0700 (Mon, 25 Sep 2006) | 1 line
run indent
------------------------------------------------------------------------
r2025 | hserus | 2006-09-25 08:15:24 -0700 (Mon, 25 Sep 2006) | 3 lines
Use the public "struct val_rrset" member in "struct val_authentication_chain" instead of the private "struct val_rrset_digested"
member while processing results from val_resolve_and_check()
------------------------------------------------------------------------
r2024 | rstory | 2006-09-25 07:59:38 -0700 (Mon, 25 Sep 2006) | 1 line
don't malloc 0 bytes
------------------------------------------------------------------------
r2023 | hserus | 2006-09-25 07:14:58 -0700 (Mon, 25 Sep 2006) | 2 lines
Add ability to enable NSEC3 using the "--with-nsec3" flag
------------------------------------------------------------------------
r2021 | hserus | 2006-09-22 14:34:42 -0700 (Fri, 22 Sep 2006) | 2 lines
Stop the compiler from complaining about uninitialized usage of a variable.
------------------------------------------------------------------------
r2020 | hserus | 2006-09-22 13:53:17 -0700 (Fri, 22 Sep 2006) | 2 lines
Add TA and zone-security-expection for ws.nsec3.org
------------------------------------------------------------------------
r2019 | hserus | 2006-09-22 13:52:55 -0700 (Fri, 22 Sep 2006) | 3 lines
Change SAVE_RR_TO_LIST macro so that it can be used for all different types of rrset types in digest_response()
------------------------------------------------------------------------
r2018 | hserus | 2006-09-22 13:52:36 -0700 (Fri, 22 Sep 2006) | 2 lines
Add prototypes for new nsec3-related functions.
------------------------------------------------------------------------
r2017 | hserus | 2006-09-22 13:52:21 -0700 (Fri, 22 Sep 2006) | 4 lines
Create two new categories of error codes for the "cannot do anything further" states: one where we should check proof of non existence, and the other where we should not.
Add definitions for VAL_R_PROVABLY_UNSECURE, VAL_PROVABLY_UNSECURE and VAL_NONEXISTENT_NAME_OPTOUT
------------------------------------------------------------------------
r2016 | hserus | 2006-09-22 13:52:01 -0700 (Fri, 22 Sep 2006) | 9 lines
Use correct bounds while constructing a presentation format domain name
Changes to reflect removal of non-useful members from struct delegation_info
Since (struct name_server *)->ns_name_n is now an array, don't allocate memory for it.
Make it possible for digest_response() to identify the header bytes in the reponse
Stow zone information only when we actually follow referrals
Removed the entire cname logic because it didn't seem to make any sense. This has to be reworked.
Fix the referral and glue-fetching logic.
------------------------------------------------------------------------
r2015 | hserus | 2006-09-22 13:51:42 -0700 (Fri, 22 Sep 2006) | 6 lines
Use correct array size for specifying on the wire domain name
Implement base32 encoding for NSEC3 hash names
Implement logic for comparison of hash values
In nsec_sig_match make it possible to add multiple RRSIGs to a record set.
------------------------------------------------------------------------
r2014 | hserus | 2006-09-22 13:51:22 -0700 (Fri, 22 Sep 2006) | 29 lines
Add support for nsec3:
- Properly detect when a given type is set for an NSEC or NSEC3 record.
- check hash span
- recognizing this record type to be a proof of non-existence
- checking if there are conflicting answers in general
- computing nsec3 hash with given params
- span check and wildcard check
- identification of VAL_NONEXISTENT_NAME_OPTOUT
Rearrange code for proving non-existence
- There is no initial check made to see if NSEC_is_wrong_answer
- add separate functions for span check and wildcard check
- branch to the correct check depending on nsec3 or nsec
- if we are not able to prove non-existence but the zone is
provable insecure then we extract the code from the response header
and return that to the user
Changed the logic for identifying next name server where the query should be directed to
- look into our cache first (we only cache name server info if we actually follwed referrals)
- if nothing matches, use the default name server
- else recurse from root
Fix glue fetching logic
Identify condition of DS signed by unknown algorithms as that of provably insecure
Set the authentication chain status to VAL_R_PROVABLY_UNSECURE when we detect this condition.
add_to_authentication_chain() now takes a rrset param instead of domain_info since that is really what is needed
verify_provably_unsecure() takes a new param for the query. We need to know this in order to break out of a potential infinite loop. verify_and_validate() also changes to accomodate this.
Identify two new categories of error codes for the "cannot do anything further" states: one where we should check proof of non existence, and the other where we should not.
Use correct bounds while constructing a presentation format domain name
Use correct array size for specifying on the wire domain name
------------------------------------------------------------------------
r2013 | hserus | 2006-09-22 13:49:56 -0700 (Fri, 22 Sep 2006) | 4 lines
Add policy definition for NSEC3 maximum allowable iterations
Add prototypes for NSEC3 functions.
------------------------------------------------------------------------
r2012 | hserus | 2006-09-22 13:49:39 -0700 (Fri, 22 Sep 2006) | 8 lines
Define a policy for specifying maximum allowable NSEC3 iterations
Use correct bounds while constructing on the wire domain name
Correctly break out of loop when checking for policy relevance
Since (struct name_server *)->ns_name_n is now an array, don't allocate memory for it.
Plug a memory leak for the name server list.
Since we're not stowing the root name server information in the cache, free-up this memory.
------------------------------------------------------------------------
r2011 | hserus | 2006-09-22 13:49:14 -0700 (Fri, 22 Sep 2006) | 10 lines
Moved definitions for NS_MAXDNAME and NS_MAXCDNAME to resolver
Define separate answer types for NSEC and NSEC3 instead of a single NXT type
Add definitions for different hash algorithm types including the ones used for signaling NSEC3
Remove the query section from val_rrset. This is not useful. (Note API change.)
Use correct array size for specifying on the wire domain name
Remove a bunch of non-useful members from struct delegation_info
Dont assume that DS hash will always be SHA1
Define the NSEC3 rdata structure
------------------------------------------------------------------------
r2010 | hserus | 2006-09-22 13:48:44 -0700 (Fri, 22 Sep 2006) | 2 lines
In val_switch_policy_scope() look at all policies in the file to see if they are relevant.
------------------------------------------------------------------------
r2009 | hserus | 2006-09-22 13:48:20 -0700 (Fri, 22 Sep 2006) | 4 lines
Use correct bounds while constructing a presentation format domain name
Add text string for displaying the VAL_PROVABLY_UNSECURE code.
------------------------------------------------------------------------
r2008 | hserus | 2006-09-22 13:47:58 -0700 (Fri, 22 Sep 2006) | 3 lines
Add prototypes for new NSEC3-related functions.
------------------------------------------------------------------------
r2007 | hserus | 2006-09-22 13:47:38 -0700 (Fri, 22 Sep 2006) | 4 lines
Use definitions for hash algorithms intead of their values.
Add logic for parsing an NSEC3 resource record
------------------------------------------------------------------------
r2006 | hserus | 2006-09-22 13:47:22 -0700 (Fri, 22 Sep 2006) | 3 lines
Use correct bounds while constructing a presentation format domain name
------------------------------------------------------------------------
r2005 | hserus | 2006-09-22 13:46:44 -0700 (Fri, 22 Sep 2006) | 6 lines
Use definitions for hash algorithms intead of their values.
Add support for NSEC3 signaling
Use correct bounds while constructing on the wire domain name
Implement hash comparison operation
------------------------------------------------------------------------
r2004 | hserus | 2006-09-22 13:46:16 -0700 (Fri, 22 Sep 2006) | 5 lines
Use correct bounds while constructing on the wire domain name
Don't store the root hints information in the name server cache. This is to prevent queries from always being sent to the root even when a default
name server is present.
------------------------------------------------------------------------
r2003 | hserus | 2006-09-22 13:45:42 -0700 (Fri, 22 Sep 2006) | 3 lines
Use correct bounds while constructing on the wire domain name
------------------------------------------------------------------------
r2002 | hserus | 2006-09-22 13:43:37 -0700 (Fri, 22 Sep 2006) | 6 lines
Added test cases for NSEC3
Print test case name and result of test case on the same line.
Modified expected value for test cases 67-72. Still need to think about how we're going to handle
proofs when answers are also returned.
------------------------------------------------------------------------
r2001 | hserus | 2006-09-22 13:43:06 -0700 (Fri, 22 Sep 2006) | 2 lines
Don't allocate memory for (struct name_server *)->ns_name_n since this is now an array
------------------------------------------------------------------------
r2000 | hserus | 2006-09-22 13:42:27 -0700 (Fri, 22 Sep 2006) | 5 lines
Added NSEC3 definitions
Moved definition of NS_MAXDNAME and NS_MAXCDNAME from validator.h to this file
Changed type of ns_name_n in struct name_server from pointer to array of fixed length.
------------------------------------------------------------------------
r1999 | hserus | 2006-09-22 13:41:50 -0700 (Fri, 22 Sep 2006) | 2 lines
Added NSEC3 definitions
------------------------------------------------------------------------
r1998 | rstory | 2006-09-22 10:51:08 -0700 (Fri, 22 Sep 2006) | 1 line
add support for new logging stuff
------------------------------------------------------------------------
r1997 | rstory | 2006-09-22 10:38:31 -0700 (Fri, 22 Sep 2006) | 4 lines
- removed unused VAL_LOG_MASK
- don't use LOG_PERROR w/syslog; users can use stderr log handler
- remove condition for network logging definitions
------------------------------------------------------------------------
r1996 | rstory | 2006-09-22 10:35:03 -0700 (Fri, 22 Sep 2006) | 2 lines
-use new logging mechanism
------------------------------------------------------------------------
r1995 | rstory | 2006-09-22 10:32:34 -0700 (Fri, 22 Sep 2006) | 5 lines
- rename name -> name_p (for consistency) in val_log_assertion
- include res_debug.h if needed
- completely rework logging to allow for multiple independent log destinations
with their own debug level. supports file, syslog, stderr, stdout, udp
------------------------------------------------------------------------
r1985 | rstory | 2006-09-19 15:21:54 -0700 (Tue, 19 Sep 2006) | 1 line
add include for solaris
------------------------------------------------------------------------
r1984 | rstory | 2006-09-19 12:44:11 -0700 (Tue, 19 Sep 2006) | 5 lines
- response_recv()
- minor readability tweak
- free recvd answer if caller won't expect answer (plug leak)
- return error if we don't have the return value we expect
------------------------------------------------------------------------
r1983 | rstory | 2006-09-19 12:40:54 -0700 (Tue, 19 Sep 2006) | 1 line
null pointer checks
------------------------------------------------------------------------
r1982 | rstory | 2006-09-19 12:39:42 -0700 (Tue, 19 Sep 2006) | 1 line
maintainability: rename l0 to l_tmp
------------------------------------------------------------------------
r1981 | rstory | 2006-09-16 08:12:41 -0700 (Sat, 16 Sep 2006) | 1 line
wire length must be < NS_MAXCDNAME, not NS_MAXDNAME
------------------------------------------------------------------------
r1980 | rstory | 2006-09-16 08:08:52 -0700 (Sat, 16 Sep 2006) | 2 lines
sizeof x -> sizeof(x)
------------------------------------------------------------------------
r1979 | rstory | 2006-09-15 11:02:35 -0700 (Fri, 15 Sep 2006) | 1 line
run indent
------------------------------------------------------------------------
r1978 | rstory | 2006-09-15 07:16:31 -0700 (Fri, 15 Sep 2006) | 2 lines
options file for indent
------------------------------------------------------------------------
r1977 | rstory | 2006-09-14 15:41:01 -0700 (Thu, 14 Sep 2006) | 1 line
add headers for (incomplete) OpenBSD port
------------------------------------------------------------------------
r1976 | rstory | 2006-09-14 15:40:28 -0700 (Thu, 14 Sep 2006) | 1 line
don't include nameser_compat.h or header.h if nameser defines dns header struct
------------------------------------------------------------------------
r1975 | rstory | 2006-09-14 15:38:18 -0700 (Thu, 14 Sep 2006) | 1 line
check for macros before using them
------------------------------------------------------------------------
r1974 | rstory | 2006-09-14 15:37:31 -0700 (Thu, 14 Sep 2006) | 1 line
defines and conditional prototypes for (incomplete) OpenBSD port
------------------------------------------------------------------------
r1973 | rstory | 2006-09-14 15:35:38 -0700 (Thu, 14 Sep 2006) | 1 line
add some checks for (incomplete) OpenBSD port
------------------------------------------------------------------------
r1937 | rstory | 2006-09-04 13:16:21 -0700 (Mon, 04 Sep 2006) | 3 lines
- add pass-fail return code to sendquery
- add summary after running all self tests
------------------------------------------------------------------------
r1934 | rstory | 2006-09-03 04:40:41 -0700 (Sun, 03 Sep 2006) | 1 line
restore use of tmp ptr for VAL_GET16
------------------------------------------------------------------------
r1932 | rstory | 2006-08-30 16:50:19 -0700 (Wed, 30 Aug 2006) | 1 line
run autoconf
------------------------------------------------------------------------
r1931 | rstory | 2006-08-30 16:49:13 -0700 (Wed, 30 Aug 2006) | 2 lines
add const where needed
------------------------------------------------------------------------
r1930 | rstory | 2006-08-30 16:47:17 -0700 (Wed, 30 Aug 2006) | 5 lines
more compiler warning cleanup
- proper prototypes
- new const friendly RES_GETnn macros to replace NS_GETnn
- add const where needed
------------------------------------------------------------------------
r1929 | rstory | 2006-08-30 16:28:06 -0700 (Wed, 30 Aug 2006) | 6 lines
more compiler warning cleanup
- adding/removing const as needed (mostly removing)
- ifdef extern errno, h_errno decls, as these may be macros
- new VAL_GETnn (const friendly replacements for NS_GETnn macros)
- don't use errno as param name (might be a macro)
------------------------------------------------------------------------
r1928 | rstory | 2006-08-30 15:11:08 -0700 (Wed, 30 Aug 2006) | 2 lines
more complier warning cleanup
------------------------------------------------------------------------
r1927 | rstory | 2006-08-30 14:39:01 -0700 (Wed, 30 Aug 2006) | 2 lines
add extra warning CFLAGS for developers (i.e. '-d .svn')
------------------------------------------------------------------------
r1926 | rstory | 2006-08-30 14:12:16 -0700 (Wed, 30 Aug 2006) | 8 lines
- remove unnecessary ';' from macro definitions
- add new LOCK_UPGRADE macro
stow_info()
- don't use C++ reserverd word for var name (new)
- don't lock/unlock: caller must have lock
------------------------------------------------------------------------
r1925 | rstory | 2006-08-28 14:46:28 -0700 (Mon, 28 Aug 2006) | 15 lines
general cleanup
- check for null parameters
- cleanup allocated memory on errors
- defer var init til after null checks
- move var decls to tops of code blocks
- rename vars using C++ reserver words (class)
compose_merged_answer()
- sanity checks for bugger overflows
- reduce indention
- free temporary allocations when done
compose_answer()
- sanity checks for bugger overflows
------------------------------------------------------------------------
r1924 | rstory | 2006-08-28 12:10:11 -0700 (Mon, 28 Aug 2006) | 4 lines
p_as_error()
- remove invalid (negative) cases
- add missing VAL_A_DONT_KNOW case
------------------------------------------------------------------------
r1923 | rstory | 2006-08-28 12:04:54 -0700 (Mon, 28 Aug 2006) | 1 line
revert val_astatus_t back to u_int16_t
------------------------------------------------------------------------
r1922 | hardaker | 2006-08-28 11:27:47 -0700 (Mon, 28 Aug 2006) | 3 lines
2 C++ portability things:
- don't use C++ reserved word "class" (changed to q_class)
- wrap contents in extern "C" for standard cpp protection
------------------------------------------------------------------------
r1920 | rstory | 2006-08-25 15:32:40 -0700 (Fri, 25 Aug 2006) | 6 lines
- change val_astatus_t from u_int16_t to int16_t,
(since some status macro values are negative)
- update obvious (compiler complained) prototype parameter types
- there are probably a lot more of these the compiler isn't complaining
about. An analysis of a grep for 'u_int16_t' is probably needed.
------------------------------------------------------------------------
r1919 | rstory | 2006-08-25 15:29:17 -0700 (Fri, 25 Aug 2006) | 3 lines
- remove unnecesary ';' in macro def
- remove redundant code in macro def
------------------------------------------------------------------------
r1918 | rstory | 2006-08-25 15:27:57 -0700 (Fri, 25 Aug 2006) | 1 line
remove unnecessary ';' in macro def
------------------------------------------------------------------------
r1917 | rstory | 2006-08-25 15:22:06 -0700 (Fri, 25 Aug 2006) | 12 lines
keep compiler happy
- add headers for missing prototypes
- remove unused vars
- match printf specifiers with types
- return a value from non-void functions
- explicity () and {} where suggested
- proper casts to match function prototypes
- remove redundant ';' in macro decl
find_rr_set()
- match returned value to prototype
------------------------------------------------------------------------
r1914 | rstory | 2006-08-24 10:31:25 -0700 (Thu, 24 Aug 2006) | 2 lines
read_res_config_file(): cleanup allocated memory on error
------------------------------------------------------------------------
r1913 | rstory | 2006-08-24 10:29:34 -0700 (Thu, 24 Aug 2006) | 1 line
fix saving of original quer name in verify_provably_unsecure
------------------------------------------------------------------------
r1912 | rstory | 2006-08-24 09:44:08 -0700 (Thu, 24 Aug 2006) | 1 line
reduce indention a level in parse_etc_hosts
------------------------------------------------------------------------
r1911 | hardaker | 2006-08-24 08:21:32 -0700 (Thu, 24 Aug 2006) | 1 line
fix completely broken etc host parsing loops with incorrect paren matching
------------------------------------------------------------------------
r1910 | hardaker | 2006-08-24 08:11:58 -0700 (Thu, 24 Aug 2006) | 1 line
variable typo
------------------------------------------------------------------------
r1907 | rstory | 2006-08-22 15:04:41 -0700 (Tue, 22 Aug 2006) | 1 line
fix minor compile errors from previous checkin
------------------------------------------------------------------------
r1906 | rstory | 2006-08-22 14:09:25 -0700 (Tue, 22 Aug 2006) | 1 line
move var decl up one devel
------------------------------------------------------------------------
r1905 | rstory | 2006-08-22 14:07:52 -0700 (Tue, 22 Aug 2006) | 1 line
fix cut-n-paste var name
------------------------------------------------------------------------
r1904 | rstory | 2006-08-22 14:03:07 -0700 (Tue, 22 Aug 2006) | 1 line
move var decls to top of correct code block
------------------------------------------------------------------------
r1903 | rstory | 2006-08-22 13:56:57 -0700 (Tue, 22 Aug 2006) | 1 line
fix check for minimum length
------------------------------------------------------------------------
r1902 | rstory | 2006-08-22 13:55:19 -0700 (Tue, 22 Aug 2006) | 12 lines
general cleanup
- check for null parameters
- check fo rnull ptr before dereference
- move var decls to tops of code blocks
make_sigfield()
- check for overflow of allocated memory
- cleanup memory on error
hash_is_equal()
- add (another) note that this function isn't implemented
------------------------------------------------------------------------
r1901 | rstory | 2006-08-21 15:16:05 -0700 (Mon, 21 Aug 2006) | 2 lines
fix typos/compiler warnings introduced by fixes in my previous checkin
------------------------------------------------------------------------
r1894 | rstory | 2006-08-18 13:16:40 -0700 (Fri, 18 Aug 2006) | 17 lines
general cleanup
- check for null params
- check for null ptr before dereference
- defer some var inits til after ptr checks
- cleanup allocated memory for error cases
- misc audit notes
init_rr_set()
- fix double-free of memory in error handling
find_rr_set()
- rename 'try' (C++ keyword) -> tryit
copy_rrset_rec()
- note unintended consequences shallow copy of struct w/ptrs.
fix left as exercise for author
------------------------------------------------------------------------
r1890 | rstory | 2006-08-17 16:09:09 -0700 (Thu, 17 Aug 2006) | 21 lines
general cleanup
- check for null parameters
- check for null ptr before dereference
- move var decls to tops of code blocks
- defer var initilization til after null param checks
register_query()
- change from TRUE/FALSE return to 1/0/-1 for error cases
- don't use callers ptr to walk list (i.e. dropping the head into the bit
bucket each iteration in the process)
- plug minor memory leaks
weird_al_realloc()
- don't memcpy from beyond end of old ptr
- don't realloc for new size < old size (but do clear end of buffer)
- rename 'new' var (C++ reserved word)
extract_glue_from_rdata()
- use temp ptr to expand ns list, so we have original in case of error
- add parens for explicit operator precedence
------------------------------------------------------------------------
r1889 | rstory | 2006-08-16 17:47:36 -0700 (Wed, 16 Aug 2006) | 22 lines
general cleanup
- check for null parameters
- check for null before ptr deref
- declare static struct w/fixed size so compiler will notice under/over-flow
- move var decls to tops of code blocks
parse_trust_anchor(), parse_zone_security_expectation()
- clean up memory on errors
free_zone_security_expectation()
- clear ptr that's just been freed
get_next_policy_fragment()
- plug small memory leak
read_root_hints_file()
- close file before returning
parse_etc_hosts()
- use strncpy instead of memcpy+strlen
- cleanup on memory errors, but return data gathered so far
------------------------------------------------------------------------
r1888 | rstory | 2006-08-16 15:50:49 -0700 (Wed, 16 Aug 2006) | 5 lines
general cleanup
- check for null parameters
- check for buffer overflows
- move var decls to top of code blocks
------------------------------------------------------------------------
r1887 | rstory | 2006-08-16 15:06:31 -0700 (Wed, 16 Aug 2006) | 15 lines
get_hex_string()
- null ptr checks
val_log_rrset(), val_log_rrsig_rdata()
- don't reuse buffer in single function call
val_log_assertion()
- move var decl to top of code block
send_log_message()
- close socket before returning
val_log()
- only print into buffer if necessary
------------------------------------------------------------------------
r1886 | rstory | 2006-08-16 14:34:44 -0700 (Wed, 16 Aug 2006) | 6 lines
general cleanup
- move var dcls to top of code blocks
get_hostent_from_etc_hosts()
- clean up host list memory before returning
------------------------------------------------------------------------
r1885 | rstory | 2006-08-16 07:18:04 -0700 (Wed, 16 Aug 2006) | 24 lines
general cleanup
- check for null parameters
- check ptrs for null before dereferences
- move var decls to tops of code blocks
- misc audit notes
val_free_result_chain()
- free data from correct ptr
free_query_chain()
- remove unnecessary assigments
is_trusted_zone()
- pass printable zone, not wire format, to val_log
verify_provably_unsecure(val_
- save original zone name for final log msg
clone_result_assertions()
- note potential memory leaks
val_resolve_and_check()
- rename parameter using C++ reserved word (class)
------------------------------------------------------------------------
r1883 | rstory | 2006-08-14 14:25:36 -0700 (Mon, 14 Aug 2006) | 11 lines
append_val_addr_info()
- optimization for null parameter
process_service_and_hints()
- 2 notes for review by code owner
general cleanup
- check/handle null parameter
- check for null returns when allocating memory
- check for null ptr before dereference
------------------------------------------------------------------------
r1882 | rstory | 2006-08-14 12:37:43 -0700 (Mon, 14 Aug 2006) | 4 lines
val_create_context()
- bail on null ptr addr
- clear ptr @ returned addr if freed
------------------------------------------------------------------------
r1863 | rstory | 2006-08-09 16:52:51 -0700 (Wed, 09 Aug 2006) | 2 lines
bump LIBCURRENT for next release (0.9.3?) due to name_server struct reorder
------------------------------------------------------------------------
r1862 | rstory | 2006-08-09 16:49:36 -0700 (Wed, 09 Aug 2006) | 4 lines
- move ns_address array to last item in name_server structure
- add big warning that ns_address MUST be the last item
- reorder other items, since binary compatiblity already broken
------------------------------------------------------------------------
r1861 | rstory | 2006-08-09 16:35:15 -0700 (Wed, 09 Aug 2006) | 2 lines
handle NULL context in RETRIEVE_POLICY macro
------------------------------------------------------------------------
r1850 | hserus | 2006-08-06 19:17:16 -0700 (Sun, 06 Aug 2006) | 3 lines
In bootstrap_referral() do not assume in that the referral element in val_query_chain will always exist.
While bootstrapping the referral from the name server cache we may end up having to fetch glue.
------------------------------------------------------------------------
r1844 | hserus | 2006-08-03 19:39:56 -0700 (Thu, 03 Aug 2006) | 2 lines
Use the zone cut information when ever possible for determining whether EDNS0 option must be used.
------------------------------------------------------------------------
r1843 | rstory | 2006-08-03 14:58:36 -0700 (Thu, 03 Aug 2006) | 2 lines
reformat to find on 80 char/line pages
------------------------------------------------------------------------
r1841 | hserus | 2006-08-03 13:59:41 -0700 (Thu, 03 Aug 2006) | 15 lines
- Return a copied authentication_chain in the val_result_chain structure instead of returning this from the
context. In that way, we can destroy the context independently of the result structure. We only copy the
public elements from this list, so the respondent server information is not copied over. We will eventually
have to figure out a way to export the respondent server information in the API.
- val_ac_rrset_next is now within the "digested" portion of the assertion.
- Store the zonecut information in the query when ever we are following a referral. Also store the zoncut
information for any resource records that are returned from this zone.
- Implement the F_DONT_VALIDATE flag for val_resolve_and_check(). This is used when we are trying to locate
the zone cut for a given name.
- Implement the VAL_A_PROVABLY_UNSECURE condition. This state is equivalent to the TRUST_FLAG being set.
- Implement logic for testing the "provably unsecure" condition.
- Send queries to name servers more intelligently. Try and find the closest matching delegation that is
available in the cache and direct queries at that instead of always trying to recurse from root.
------------------------------------------------------------------------
r1840 | hserus | 2006-08-03 13:59:18 -0700 (Thu, 03 Aug 2006) | 5 lines
- Added zonecut fields to rrset_rec, delegation_info and val_query_chain
- Defined the F_DONT_VALIDATE flag for val_resolve_and_check()
- Moved val_ac_rrset_next from the val_result_chain structure to the val_rrset_digested structure.
------------------------------------------------------------------------
r1839 | hserus | 2006-08-03 13:58:55 -0700 (Thu, 03 Aug 2006) | 7 lines
- Manage zonecut information in the query structure
- Create a common function bootstrap_referral to handle the creation of a referral-related query from name server resource records.
- Always use the name servers within the val_query_chain structure as the ones to direct the query to. This
value should already be constructed from context etc. in ask_resolver();
- Implement routine for finding the zonecut given a resource record.
------------------------------------------------------------------------
r1838 | hserus | 2006-08-03 13:58:26 -0700 (Thu, 03 Aug 2006) | 2 lines
- Recognize the VAL_A_PROVABLY_UNSECURE and VAL_A_DONT_VALIDATE status values.
------------------------------------------------------------------------
r1837 | hserus | 2006-08-03 13:58:13 -0700 (Thu, 03 Aug 2006) | 5 lines
- Use only public members from val_authentication_chain for logging data. Name server information will
always be NULL till such time that we figure out a way to export the respondent server information.
- Recognize the VAL_A_PROVABLY_UNSECURE and VAL_A_DONT_VALIDATE status values.
------------------------------------------------------------------------
r1836 | hserus | 2006-08-03 13:57:48 -0700 (Thu, 03 Aug 2006) | 2 lines
- Manage the zonecut information for a resource record
------------------------------------------------------------------------
r1835 | hserus | 2006-08-03 13:56:03 -0700 (Thu, 03 Aug 2006) | 4 lines
- Maintain separate cache for referral information
- Add routine get_matching_nslist() to retrieve matching nslist for a given query.
------------------------------------------------------------------------
r1834 | hserus | 2006-08-03 13:55:09 -0700 (Thu, 03 Aug 2006) | 5 lines
- Check for NULL name server list in destroy_respol
- Don't set the default name server for a context to root in read_res_config_file(). Look for the closest
matching name server from the cache instead while sending out a query.
------------------------------------------------------------------------
r1833 | hserus | 2006-08-03 12:09:32 -0700 (Thu, 03 Aug 2006) | 6 lines
The previous version was what was submitted to the IETF as draft-hayatnagarkar-dnsext-validator-api-01.
val_ac_rrset_next is no longer a member of the public val_authentication_chain structure.
Added note about the VAL_A_PROVABLY_UNSECURE authentication chain status value.
------------------------------------------------------------------------
r1832 | hserus | 2006-08-03 12:07:09 -0700 (Thu, 03 Aug 2006) | 4 lines
val_ac_rrset_next and val_ac_next and no longer members of the public val_authentication_chain structure.
They now appear in the "digested" portion.
Added note about the VAL_A_PROVABLY_UNSECURE authentication chain status value.
------------------------------------------------------------------------
r1821 | hserus | 2006-07-31 07:27:16 -0700 (Mon, 31 Jul 2006) | 2 lines
Move include for resolv.conf after include for validator.h to fix Darwin build error
------------------------------------------------------------------------
r1820 | hserus | 2006-07-31 07:25:35 -0700 (Mon, 31 Jul 2006) | 2 lines
Fix indentation
------------------------------------------------------------------------
r1819 | hserus | 2006-07-31 06:39:45 -0700 (Mon, 31 Jul 2006) | 2 lines
Keep track of which DNSKEY in the key set is part of the chain of trust
------------------------------------------------------------------------
r1818 | rstory | 2006-07-30 15:26:06 -0700 (Sun, 30 Jul 2006) | 3 lines
- convert rfc 1035 domain names to ascii before logging
- add ascii class/type to send query debug log msg
------------------------------------------------------------------------
r1817 | rstory | 2006-07-30 14:44:35 -0700 (Sun, 30 Jul 2006) | 2 lines
change log id from decimal ctx-id to libval(ctd-id)
------------------------------------------------------------------------
r1813 | hserus | 2006-07-25 10:32:53 -0700 (Tue, 25 Jul 2006) | 2 lines
Use VAL_GENERIC_ERROR in place of VAL_ERROR for generic internal errors
------------------------------------------------------------------------
r1812 | hserus | 2006-07-25 10:30:19 -0700 (Tue, 25 Jul 2006) | 2 lines
Use VAL_GENERIC_ERROR in place of VAL_ERROR for internal errors
------------------------------------------------------------------------
r1801 | baerm | 2006-07-18 09:33:13 -0700 (Tue, 18 Jul 2006) | 2 lines
fixed reverse lookup problem.
------------------------------------------------------------------------
r1800 | baerm | 2006-07-14 13:40:20 -0700 (Fri, 14 Jul 2006) | 3 lines
changed /etc/resolv.conf parsing to skip IPv6 nameserver
addresses and continue parsing the file.
------------------------------------------------------------------------
r1786 | hserus | 2006-06-23 11:06:08 -0700 (Fri, 23 Jun 2006) | 2 lines
More edits
------------------------------------------------------------------------
r1785 | hserus | 2006-06-23 09:38:48 -0700 (Fri, 23 Jun 2006) | 2 lines
Nits etc.
------------------------------------------------------------------------
r1784 | hserus | 2006-06-22 14:27:54 -0700 (Thu, 22 Jun 2006) | 2 lines
Global search and replace assertion_chain to authentication_chain
------------------------------------------------------------------------
r1783 | hserus | 2006-06-22 13:59:18 -0700 (Thu, 22 Jun 2006) | 3 lines
Removed pointer types for rrset_rec.rrs and val_assertion_chain._as
Also move val_ac_next from val_assertion_chain to val_rrset_digested
------------------------------------------------------------------------
r1782 | hserus | 2006-06-22 13:52:39 -0700 (Thu, 22 Jun 2006) | 2 lines
Add documentation for val_res_query()
------------------------------------------------------------------------
r1781 | hserus | 2006-06-21 13:23:07 -0700 (Wed, 21 Jun 2006) | 2 lines
Modify text for VAL_PROVABLY_UNSECURE. Also add new description for val_res_query().
------------------------------------------------------------------------
r1780 | hserus | 2006-06-21 12:02:07 -0700 (Wed, 21 Jun 2006) | 2 lines
#define VAL_OUT_OF_MEMORY to VAL_RESOURCE_UNAVAILABLE
------------------------------------------------------------------------
r1779 | hserus | 2006-06-21 11:59:55 -0700 (Wed, 21 Jun 2006) | 2 lines
Address some of Robert's comments from his mail dated 06/21
------------------------------------------------------------------------
r1778 | hserus | 2006-06-21 09:59:11 -0700 (Wed, 21 Jun 2006) | 2 lines
Add new interface for val_res_query()
------------------------------------------------------------------------
r1777 | hserus | 2006-06-21 09:54:21 -0700 (Wed, 21 Jun 2006) | 2 lines
Use EAI_FAIL instead of the validator error code when val_create_context() fails
------------------------------------------------------------------------
r1772 | hserus | 2006-06-21 06:02:14 -0700 (Wed, 21 Jun 2006) | 2 lines
New members for val_addrinfo and val_response. Also add definition for val_query() and val_free_response()
------------------------------------------------------------------------
r1771 | hserus | 2006-06-21 05:57:02 -0700 (Wed, 21 Jun 2006) | 2 lines
Use new struct addrinfo member ai_val_status in place of val_status
------------------------------------------------------------------------
r1770 | hserus | 2006-06-21 05:55:27 -0700 (Wed, 21 Jun 2006) | 2 lines
Remove unused error codes
------------------------------------------------------------------------
r1769 | hserus | 2006-06-21 05:54:30 -0700 (Wed, 21 Jun 2006) | 2 lines
Change definition for val_query()
------------------------------------------------------------------------
r1768 | hserus | 2006-06-21 05:52:10 -0700 (Wed, 21 Jun 2006) | 2 lines
Update description for val_query() following the API change
------------------------------------------------------------------------
r1767 | hserus | 2006-06-21 05:50:37 -0700 (Wed, 21 Jun 2006) | 2 lines
Use new val_query() interface and/or struct member names
------------------------------------------------------------------------
r1766 | hserus | 2006-06-20 05:44:37 -0700 (Tue, 20 Jun 2006) | 2 lines
Remove C-style comments from spec.
------------------------------------------------------------------------
r1757 | hardaker | 2006-06-19 16:58:00 -0700 (Mon, 19 Jun 2006) | 1 line
version number update (0.2)
------------------------------------------------------------------------
r1746 | hserus | 2006-06-19 12:09:33 -0700 (Mon, 19 Jun 2006) | 2 lines
Set results parameter initially to NULL in val_resolve_and_check()
------------------------------------------------------------------------
r1745 | hserus | 2006-06-19 10:34:48 -0700 (Mon, 19 Jun 2006) | 2 lines
Remove perror() statements.
------------------------------------------------------------------------
r1744 | hserus | 2006-06-16 14:34:03 -0700 (Fri, 16 Jun 2006) | 2 lines
Add check to ensure that context creation was successful.
------------------------------------------------------------------------
r1743 | hserus | 2006-06-16 14:32:25 -0700 (Fri, 16 Jun 2006) | 2 lines
Allow NULL values to be specified for ctx parameter in val_resolve_and_check()
------------------------------------------------------------------------
r1742 | hserus | 2006-06-16 13:41:59 -0700 (Fri, 16 Jun 2006) | 2 lines
More changes based on comments received earlier.
------------------------------------------------------------------------
r1741 | hserus | 2006-06-16 09:57:18 -0700 (Fri, 16 Jun 2006) | 2 lines
Add more sample policy statements
------------------------------------------------------------------------
r1740 | hserus | 2006-06-16 09:56:00 -0700 (Fri, 16 Jun 2006) | 2 lines
Set policy to the requested scope when creating a new context
------------------------------------------------------------------------
r1739 | hserus | 2006-06-16 09:55:06 -0700 (Fri, 16 Jun 2006) | 2 lines
Make sure that default policies are read; also fix bug in memory deallocation
------------------------------------------------------------------------
r1738 | hserus | 2006-06-16 09:52:24 -0700 (Fri, 16 Jun 2006) | 2 lines
Add new option to perform validation using a specific policy label
------------------------------------------------------------------------
r1737 | hserus | 2006-06-15 14:27:08 -0700 (Thu, 15 Jun 2006) | 2 lines
Make sure that custom defines are generated in the header file
------------------------------------------------------------------------
r1736 | hserus | 2006-06-15 12:19:07 -0700 (Thu, 15 Jun 2006) | 2 lines
Make changes to the High-level API section + other miscellaneous edits
------------------------------------------------------------------------
r1730 | hserus | 2006-06-14 14:56:58 -0700 (Wed, 14 Jun 2006) | 2 lines
Check for bad arguments
------------------------------------------------------------------------
r1729 | hserus | 2006-06-14 12:41:28 -0700 (Wed, 14 Jun 2006) | 2 lines
Add support for VAL_NOTRUST
------------------------------------------------------------------------
r1728 | hserus | 2006-06-14 12:39:23 -0700 (Wed, 14 Jun 2006) | 2 lines
Add description for VAL_NOTRUST
------------------------------------------------------------------------
r1725 | baerm | 2006-06-14 09:23:19 -0700 (Wed, 14 Jun 2006) | 2 lines
set a couple more AF family values I missed before
------------------------------------------------------------------------
r1724 | hserus | 2006-06-14 06:49:25 -0700 (Wed, 14 Jun 2006) | 2 lines
Remove reference to validator_api.xml
------------------------------------------------------------------------
r1720 | baerm | 2006-06-12 14:50:20 -0700 (Mon, 12 Jun 2006) | 2 lines
set sockaddr_in family values
------------------------------------------------------------------------
r1719 | baerm | 2006-06-12 14:45:24 -0700 (Mon, 12 Jun 2006) | 2 lines
fixed malloc problem
------------------------------------------------------------------------
r1716 | hserus | 2006-06-09 13:11:33 -0700 (Fri, 09 Jun 2006) | 2 lines
Create man pages for different functions within libval(3)
------------------------------------------------------------------------
r1713 | hserus | 2006-06-09 11:58:28 -0700 (Fri, 09 Jun 2006) | 2 lines
Added a new man page for dnsval.conf; man page for libval now references this other man page.
------------------------------------------------------------------------
r1712 | hserus | 2006-06-09 10:23:43 -0700 (Fri, 09 Jun 2006) | 2 lines
Added note about VAL_NOTRUST
------------------------------------------------------------------------
r1711 | hserus | 2006-06-09 07:56:43 -0700 (Fri, 09 Jun 2006) | 2 lines
Use ISC's implementation for inet_nsap_ntoa
------------------------------------------------------------------------
r1710 | hserus | 2006-06-09 07:53:58 -0700 (Fri, 09 Jun 2006) | 2 lines
Use inet_pton in place of inet_aton
------------------------------------------------------------------------
r1709 | hserus | 2006-06-09 07:53:03 -0700 (Fri, 09 Jun 2006) | 3 lines
Don't use strsep and inet_aton since these are not portable; implement code code differently for the former
and use inet_pton for the latter.
------------------------------------------------------------------------
r1708 | hserus | 2006-06-09 07:49:01 -0700 (Fri, 09 Jun 2006) | 2 lines
Add nsap_add.c to the list of files to be compiled.
------------------------------------------------------------------------
r1707 | hserus | 2006-06-09 07:39:51 -0700 (Fri, 09 Jun 2006) | 2 lines
Don't use non-portable functions when they are not defined
------------------------------------------------------------------------
r1706 | hserus | 2006-06-09 07:38:34 -0700 (Fri, 09 Jun 2006) | 2 lines
Check for availability of non-portable functions and specific symbols
------------------------------------------------------------------------
r1694 | hserus | 2006-06-08 10:44:50 -0700 (Thu, 08 Jun 2006) | 2 lines
Suppor the root zone in the zone-security-expectation policy construct
------------------------------------------------------------------------
r1692 | hserus | 2006-06-06 12:08:41 -0700 (Tue, 06 Jun 2006) | 2 lines
Update the documentation for libval to match with current implementation.
------------------------------------------------------------------------
r1687 | hserus | 2006-06-06 10:39:50 -0700 (Tue, 06 Jun 2006) | 2 lines
Use val_status_t and val_astatus_t types as parameters to p_val_error() and p_as_error() respectively.
------------------------------------------------------------------------
r1686 | hserus | 2006-06-06 09:54:13 -0700 (Tue, 06 Jun 2006) | 2 lines
Update documentation for libsres to keep current with implementation
------------------------------------------------------------------------
r1685 | hserus | 2006-06-06 09:48:19 -0700 (Tue, 06 Jun 2006) | 2 lines
Re-order struct member so that length and value are located next to each other
------------------------------------------------------------------------
r1684 | hserus | 2006-06-06 09:36:22 -0700 (Tue, 06 Jun 2006) | 2 lines
Only include prototypes that have to be exported from the library
------------------------------------------------------------------------
r1683 | hserus | 2006-06-06 09:33:02 -0700 (Tue, 06 Jun 2006) | 3 lines
Create new header files to store prototypes that were previously stored in validator.h and reference those in various C
files
------------------------------------------------------------------------
r1681 | hserus | 2006-06-06 07:35:13 -0700 (Tue, 06 Jun 2006) | 2 lines
Minor edit in comments
------------------------------------------------------------------------
r1680 | hserus | 2006-06-06 07:31:59 -0700 (Tue, 06 Jun 2006) | 2 lines
Update the implementation notes for libval
------------------------------------------------------------------------
r1679 | hserus | 2006-06-05 14:39:51 -0700 (Mon, 05 Jun 2006) | 2 lines
Update to make description more current with the implementation.
------------------------------------------------------------------------
r1678 | hserus | 2006-06-05 14:29:42 -0700 (Mon, 05 Jun 2006) | 2 lines
Update to use new error code definitions
------------------------------------------------------------------------
r1677 | hserus | 2006-06-05 13:39:28 -0700 (Mon, 05 Jun 2006) | 2 lines
Updated with current list of files in this directory
------------------------------------------------------------------------
r1676 | hserus | 2006-06-05 12:57:56 -0700 (Mon, 05 Jun 2006) | 2 lines
Add one-line descriptions for command-line utilities
------------------------------------------------------------------------
r1675 | hserus | 2006-06-05 12:46:42 -0700 (Mon, 05 Jun 2006) | 2 lines
Add one-line description for each configuration file needed by the validator
------------------------------------------------------------------------
r1674 | hserus | 2006-06-05 12:45:18 -0700 (Mon, 05 Jun 2006) | 2 lines
Updated new location for docs and apps
------------------------------------------------------------------------
r1673 | hserus | 2006-06-05 12:44:47 -0700 (Mon, 05 Jun 2006) | 2 lines
Updated new location for docs
------------------------------------------------------------------------
r1672 | hserus | 2006-06-05 12:42:56 -0700 (Mon, 05 Jun 2006) | 2 lines
Added a top-level README file that describes the structure of the validator portion of the tree.
------------------------------------------------------------------------
r1671 | hserus | 2006-06-05 12:38:16 -0700 (Mon, 05 Jun 2006) | 2 lines
Add a sample resolv.conf file
------------------------------------------------------------------------
r1670 | hserus | 2006-06-05 11:23:21 -0700 (Mon, 05 Jun 2006) | 2 lines
Use error codes prefixed with VAL_
------------------------------------------------------------------------
r1669 | hserus | 2006-06-05 11:19:49 -0700 (Mon, 05 Jun 2006) | 4 lines
First step towards bring code in sync with draft-hayatnagarkar-dnsext-validator-api-02
Prefix error codes with VAL_
reference rrset details from within struct val_rrset.
------------------------------------------------------------------------
r1668 | hserus | 2006-06-05 10:35:27 -0700 (Mon, 05 Jun 2006) | 2 lines
Moved validator configuration files to a separate etc/ directory
------------------------------------------------------------------------
r1667 | hserus | 2006-06-05 10:21:42 -0700 (Mon, 05 Jun 2006) | 9 lines
The previous version was draft-hayatnagarkar-dnsext-validator-api-00.
This version contains the first set of changes for -01
- made some changes to the terminology section
- used val_create_context() instead of val_get_context()
- changed some of the low-level interfaces
- Added definitions for assertion status values since this does not seem to be something that is going to come out as a
separate draft. Have to still change the acknowledgements section to include the work done in the dnssec-app forum.
------------------------------------------------------------------------
r1666 | rstory | 2006-06-01 08:28:21 -0700 (Thu, 01 Jun 2006) | 1 line
do not ignore aclocal.m4
------------------------------------------------------------------------
r1665 | rstory | 2006-06-01 08:27:19 -0700 (Thu, 01 Jun 2006) | 1 line
copy autoconf files from top dir (some slightly modified)
------------------------------------------------------------------------
r1664 | rstory | 2006-06-01 08:26:03 -0700 (Thu, 01 Jun 2006) | 1 line
copy autoconf files from top dir (some slightly modified)
------------------------------------------------------------------------
r1659 | rstory | 2006-05-31 16:17:22 -0700 (Wed, 31 May 2006) | 1 line
run autoheader and autoconf
------------------------------------------------------------------------
r1658 | rstory | 2006-05-31 16:16:38 -0700 (Wed, 31 May 2006) | 3 lines
- explict subst for LIBS
- fix paths for Makefile.(top|bot)
------------------------------------------------------------------------
r1653 | rstory | 2006-05-31 13:45:09 -0700 (Wed, 31 May 2006) | 1 line
run autoheader & autoconf
------------------------------------------------------------------------
r1652 | rstory | 2006-05-31 13:43:14 -0700 (Wed, 31 May 2006) | 1 line
update for validatory reorg
------------------------------------------------------------------------
r1651 | rstory | 2006-05-31 13:41:13 -0700 (Wed, 31 May 2006) | 1 line
remove reorg rename flub
------------------------------------------------------------------------
r1650 | rstory | 2006-05-31 13:39:11 -0700 (Wed, 31 May 2006) | 3 lines
- tweak include for reorg paths
- remove unused subdir logic
------------------------------------------------------------------------
r1649 | rstory | 2006-05-31 13:34:54 -0700 (Wed, 31 May 2006) | 1 line
ignore generated file
------------------------------------------------------------------------
r1648 | rstory | 2006-05-31 13:33:57 -0700 (Wed, 31 May 2006) | 1 line
fix reorg rename flub
------------------------------------------------------------------------
r1647 | rstory | 2006-05-31 13:32:20 -0700 (Wed, 31 May 2006) | 1 line
remove deleted file
------------------------------------------------------------------------
r1646 | rstory | 2006-05-31 13:24:16 -0700 (Wed, 31 May 2006) | 2 lines
dnssec-tools-config.h -> validator-config.h
------------------------------------------------------------------------
r1643 | rstory | 2006-05-31 12:39:05 -0700 (Wed, 31 May 2006) | 2 lines
move libsres
------------------------------------------------------------------------
r1642 | rstory | 2006-05-31 10:41:21 -0700 (Wed, 31 May 2006) | 2 lines
dnssec-tools-config.h -> validator-config.h
------------------------------------------------------------------------
r1641 | rstory | 2006-05-31 10:29:18 -0700 (Wed, 31 May 2006) | 2 lines
move lival to validator dir
------------------------------------------------------------------------
r1639 | rstory | 2006-05-31 09:59:38 -0700 (Wed, 31 May 2006) | 1 line
merge in libsres makefile
------------------------------------------------------------------------
r1638 | rstory | 2006-05-31 09:56:41 -0700 (Wed, 31 May 2006) | 2 lines
- directory reorg for validation libs/apps/docs/etc
------------------------------------------------------------------------
dnsval-2.0/install-sh 0000775 0002372 0002372 00000012562 10437603413 015005 0 ustar hardaker hardaker #! /bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5 (mit/util/scripts/install.sh).
#
# Copyright 1991 by the Massachusetts Institute of Technology
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of M.I.T. not be used in advertising or
# publicity pertaining to distribution of the software without specific,
# written prior permission. M.I.T. makes no representations about the
# suitability of this software for any purpose. It is provided "as is"
# without express or implied warranty.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
#
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
else
true
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d $dst ]; then
instcmd=:
else
instcmd=mkdir
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f $src -o -d $src ]
then
true
else
echo "install: $src does not exist"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
else
true
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
else
true
fi
fi
## this sed command emulates the dirname command
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
'
IFS="${IFS-${defaultIFS}}"
oIFS="${IFS}"
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS="${oIFS}"
pathcomp=''
while [ $# -ne 0 ] ; do
pathcomp="${pathcomp}${1}"
shift
if [ ! -d "${pathcomp}" ] ;
then
$mkdirprog "${pathcomp}"
else
true
fi
pathcomp="${pathcomp}/"
done
fi
if [ x"$dir_arg" != x ]
then
$doit $instcmd $dst &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
else
# If we're going to rename the final executable, determine the name now.
if [ x"$transformarg" = x ]
then
dstfile=`basename $dst`
else
dstfile=`basename $dst $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
if [ x"$dstfile" = x ]
then
dstfile=`basename $dst`
else
true
fi
# Make a temp file name in the proper directory.
dsttmp=$dstdir/#inst.$$#
# Move or copy the file name to the temp name
$doit $instcmd $src $dsttmp &&
trap "rm -f ${dsttmp}" 0 &&
# and set any options; do chmod last to preserve setuid bits
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
# Now rename the file to the real destination.
$doit $rmcmd -f $dstdir/$dstfile &&
$doit $mvcmd $dsttmp $dstdir/$dstfile
fi &&
exit 0
dnsval-2.0/aclocal.m4 0000664 0002372 0002372 00001121676 12032205517 014645 0 ustar hardaker hardaker # generated automatically by aclocal 1.11.6 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
# Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
#
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
# Inc.
# Written by Gordon Matzigkeit, 1996
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
m4_define([_LT_COPYING], [dnl
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
# Inc.
# Written by Gordon Matzigkeit, 1996
#
# This file is part of GNU Libtool.
#
# GNU Libtool is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
#
# As a special exception to the GNU General Public License,
# if you distribute this file as part of a program or library that
# is built using GNU Libtool, you may include this file under the
# same distribution terms that you use for the rest of that program.
#
# GNU Libtool is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Libtool; see the file COPYING. If not, a copy
# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
# obtained by writing to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
])
# serial 57 LT_INIT
# LT_PREREQ(VERSION)
# ------------------
# Complain and exit if this libtool version is less that VERSION.
m4_defun([LT_PREREQ],
[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
[m4_default([$3],
[m4_fatal([Libtool version $1 or higher is required],
63)])],
[$2])])
# _LT_CHECK_BUILDDIR
# ------------------
# Complain if the absolute build directory name contains unusual characters
m4_defun([_LT_CHECK_BUILDDIR],
[case `pwd` in
*\ * | *\ *)
AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
esac
])
# LT_INIT([OPTIONS])
# ------------------
AC_DEFUN([LT_INIT],
[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
AC_BEFORE([$0], [LT_LANG])dnl
AC_BEFORE([$0], [LT_OUTPUT])dnl
AC_BEFORE([$0], [LTDL_INIT])dnl
m4_require([_LT_CHECK_BUILDDIR])dnl
dnl Autoconf doesn't catch unexpanded LT_ macros by default:
m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
dnl unless we require an AC_DEFUNed macro:
AC_REQUIRE([LTOPTIONS_VERSION])dnl
AC_REQUIRE([LTSUGAR_VERSION])dnl
AC_REQUIRE([LTVERSION_VERSION])dnl
AC_REQUIRE([LTOBSOLETE_VERSION])dnl
m4_require([_LT_PROG_LTMAIN])dnl
_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
dnl Parse OPTIONS
_LT_SET_OPTIONS([$0], [$1])
# This can be used to rebuild libtool when needed
LIBTOOL_DEPS="$ltmain"
# Always use our own libtool.
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
AC_SUBST(LIBTOOL)dnl
_LT_SETUP
# Only expand once:
m4_define([LT_INIT])
])# LT_INIT
# Old names:
AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
# _LT_CC_BASENAME(CC)
# -------------------
# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
m4_defun([_LT_CC_BASENAME],
[for cc_temp in $1""; do
case $cc_temp in
compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
\-*) ;;
*) break;;
esac
done
cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
])
# _LT_FILEUTILS_DEFAULTS
# ----------------------
# It is okay to use these file commands and assume they have been set
# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
m4_defun([_LT_FILEUTILS_DEFAULTS],
[: ${CP="cp -f"}
: ${MV="mv -f"}
: ${RM="rm -f"}
])# _LT_FILEUTILS_DEFAULTS
# _LT_SETUP
# ---------
m4_defun([_LT_SETUP],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
_LT_DECL([], [host_alias], [0], [The host system])dnl
_LT_DECL([], [host], [0])dnl
_LT_DECL([], [host_os], [0])dnl
dnl
_LT_DECL([], [build_alias], [0], [The build system])dnl
_LT_DECL([], [build], [0])dnl
_LT_DECL([], [build_os], [0])dnl
dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([LT_PATH_LD])dnl
AC_REQUIRE([LT_PATH_NM])dnl
dnl
AC_REQUIRE([AC_PROG_LN_S])dnl
test -z "$LN_S" && LN_S="ln -s"
_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
dnl
AC_REQUIRE([LT_CMD_MAX_LEN])dnl
_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
dnl
m4_require([_LT_FILEUTILS_DEFAULTS])dnl
m4_require([_LT_CHECK_SHELL_FEATURES])dnl
m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
m4_require([_LT_CMD_RELOAD])dnl
m4_require([_LT_CHECK_MAGIC_METHOD])dnl
m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
m4_require([_LT_CMD_OLD_ARCHIVE])dnl
m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
m4_require([_LT_WITH_SYSROOT])dnl
_LT_CONFIG_LIBTOOL_INIT([
# See if we are running on zsh, and set the options which allow our
# commands through without removal of \ escapes INIT.
if test -n "\${ZSH_VERSION+set}" ; then
setopt NO_GLOB_SUBST
fi
])
if test -n "${ZSH_VERSION+set}" ; then
setopt NO_GLOB_SUBST
fi
_LT_CHECK_OBJDIR
m4_require([_LT_TAG_COMPILER])dnl
case $host_os in
aix3*)
# AIX sometimes has problems with the GCC collect2 program. For some
# reason, if we set the COLLECT_NAMES environment variable, the problems
# vanish in a puff of smoke.
if test "X${COLLECT_NAMES+set}" != Xset; then
COLLECT_NAMES=
export COLLECT_NAMES
fi
;;
esac
# Global variables:
ofile=libtool
can_build_shared=yes
# All known linkers require a `.a' archive for static linking (except MSVC,
# which needs '.lib').
libext=a
with_gnu_ld="$lt_cv_prog_gnu_ld"
old_CC="$CC"
old_CFLAGS="$CFLAGS"
# Set sane defaults for various variables
test -z "$CC" && CC=cc
test -z "$LTCC" && LTCC=$CC
test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
test -z "$LD" && LD=ld
test -z "$ac_objext" && ac_objext=o
_LT_CC_BASENAME([$compiler])
# Only perform the check for file, if the check method requires it
test -z "$MAGIC_CMD" && MAGIC_CMD=file
case $deplibs_check_method in
file_magic*)
if test "$file_magic_cmd" = '$MAGIC_CMD'; then
_LT_PATH_MAGIC
fi
;;
esac
# Use C for the default configuration in the libtool script
LT_SUPPORTED_TAG([CC])
_LT_LANG_C_CONFIG
_LT_LANG_DEFAULT_CONFIG
_LT_CONFIG_COMMANDS
])# _LT_SETUP
# _LT_PREPARE_SED_QUOTE_VARS
# --------------------------
# Define a few sed substitution that help us do robust quoting.
m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
[# Backslashify metacharacters that are still active within
# double-quoted strings.
sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
# Same as above, but do not quote variable references.
double_quote_subst='s/\([["`\\]]\)/\\\1/g'
# Sed substitution to delay expansion of an escaped shell variable in a
# double_quote_subst'ed string.
delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
# Sed substitution to delay expansion of an escaped single quote.
delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
# Sed substitution to avoid accidental globbing in evaled expressions
no_glob_subst='s/\*/\\\*/g'
])
# _LT_PROG_LTMAIN
# ---------------
# Note that this code is called both from `configure', and `config.status'
# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
# `config.status' has no value for ac_aux_dir unless we are using Automake,
# so we pass a copy along to make sure it has a sensible value anyway.
m4_defun([_LT_PROG_LTMAIN],
[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
ltmain="$ac_aux_dir/ltmain.sh"
])# _LT_PROG_LTMAIN
# So that we can recreate a full libtool script including additional
# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
# in macros and then make a single call at the end using the `libtool'
# label.
# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
# ----------------------------------------
# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
m4_define([_LT_CONFIG_LIBTOOL_INIT],
[m4_ifval([$1],
[m4_append([_LT_OUTPUT_LIBTOOL_INIT],
[$1
])])])
# Initialize.
m4_define([_LT_OUTPUT_LIBTOOL_INIT])
# _LT_CONFIG_LIBTOOL([COMMANDS])
# ------------------------------
# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
m4_define([_LT_CONFIG_LIBTOOL],
[m4_ifval([$1],
[m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
[$1
])])])
# Initialize.
m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
# -----------------------------------------------------
m4_defun([_LT_CONFIG_SAVE_COMMANDS],
[_LT_CONFIG_LIBTOOL([$1])
_LT_CONFIG_LIBTOOL_INIT([$2])
])
# _LT_FORMAT_COMMENT([COMMENT])
# -----------------------------
# Add leading comment marks to the start of each line, and a trailing
# full-stop to the whole comment if one is not present already.
m4_define([_LT_FORMAT_COMMENT],
[m4_ifval([$1], [
m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
[['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
)])
# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
# -------------------------------------------------------------------
# CONFIGNAME is the name given to the value in the libtool script.
# VARNAME is the (base) name used in the configure script.
# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
# VARNAME. Any other value will be used directly.
m4_define([_LT_DECL],
[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
[lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
[m4_ifval([$1], [$1], [$2])])
lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
m4_ifval([$4],
[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
lt_dict_add_subkey([lt_decl_dict], [$2],
[tagged?], [m4_ifval([$5], [yes], [no])])])
])
# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
# --------------------------------------------------------
m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
# ------------------------------------------------
m4_define([lt_decl_tag_varnames],
[_lt_decl_filter([tagged?], [yes], $@)])
# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
# ---------------------------------------------------------
m4_define([_lt_decl_filter],
[m4_case([$#],
[0], [m4_fatal([$0: too few arguments: $#])],
[1], [m4_fatal([$0: too few arguments: $#: $1])],
[2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
[3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
[lt_dict_filter([lt_decl_dict], $@)])[]dnl
])
# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
# --------------------------------------------------
m4_define([lt_decl_quote_varnames],
[_lt_decl_filter([value], [1], $@)])
# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
# ---------------------------------------------------
m4_define([lt_decl_dquote_varnames],
[_lt_decl_filter([value], [2], $@)])
# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
# ---------------------------------------------------
m4_define([lt_decl_varnames_tagged],
[m4_assert([$# <= 2])dnl
_$0(m4_quote(m4_default([$1], [[, ]])),
m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
m4_define([_lt_decl_varnames_tagged],
[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
# ------------------------------------------------
m4_define([lt_decl_all_varnames],
[_$0(m4_quote(m4_default([$1], [[, ]])),
m4_if([$2], [],
m4_quote(lt_decl_varnames),
m4_quote(m4_shift($@))))[]dnl
])
m4_define([_lt_decl_all_varnames],
[lt_join($@, lt_decl_varnames_tagged([$1],
lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
])
# _LT_CONFIG_STATUS_DECLARE([VARNAME])
# ------------------------------------
# Quote a variable value, and forward it to `config.status' so that its
# declaration there will have the same value as in `configure'. VARNAME
# must have a single quote delimited value for this to work.
m4_define([_LT_CONFIG_STATUS_DECLARE],
[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
# _LT_CONFIG_STATUS_DECLARATIONS
# ------------------------------
# We delimit libtool config variables with single quotes, so when
# we write them to config.status, we have to be sure to quote all
# embedded single quotes properly. In configure, this macro expands
# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
#
# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`'
m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
[m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
# _LT_LIBTOOL_TAGS
# ----------------
# Output comment and list of tags supported by the script
m4_defun([_LT_LIBTOOL_TAGS],
[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
available_tags="_LT_TAGS"dnl
])
# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
# -----------------------------------
# Extract the dictionary values for VARNAME (optionally with TAG) and
# expand to a commented shell variable setting:
#
# # Some comment about what VAR is for.
# visible_name=$lt_internal_name
m4_define([_LT_LIBTOOL_DECLARE],
[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
[description])))[]dnl
m4_pushdef([_libtool_name],
m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
[0], [_libtool_name=[$]$1],
[1], [_libtool_name=$lt_[]$1],
[2], [_libtool_name=$lt_[]$1],
[_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
])
# _LT_LIBTOOL_CONFIG_VARS
# -----------------------
# Produce commented declarations of non-tagged libtool config variables
# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
# script. Tagged libtool config variables (even for the LIBTOOL CONFIG
# section) are produced by _LT_LIBTOOL_TAG_VARS.
m4_defun([_LT_LIBTOOL_CONFIG_VARS],
[m4_foreach([_lt_var],
m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
[m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
# _LT_LIBTOOL_TAG_VARS(TAG)
# -------------------------
m4_define([_LT_LIBTOOL_TAG_VARS],
[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
[m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
# _LT_TAGVAR(VARNAME, [TAGNAME])
# ------------------------------
m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
# _LT_CONFIG_COMMANDS
# -------------------
# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
# variables for single and double quote escaping we saved from calls
# to _LT_DECL, we can put quote escaped variables declarations
# into `config.status', and then the shell code to quote escape them in
# for loops in `config.status'. Finally, any additional code accumulated
# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
m4_defun([_LT_CONFIG_COMMANDS],
[AC_PROVIDE_IFELSE([LT_OUTPUT],
dnl If the libtool generation code has been placed in $CONFIG_LT,
dnl instead of duplicating it all over again into config.status,
dnl then we will have config.status run $CONFIG_LT later, so it
dnl needs to know what name is stored there:
[AC_CONFIG_COMMANDS([libtool],
[$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
dnl If the libtool generation code is destined for config.status,
dnl expand the accumulated commands and init code now:
[AC_CONFIG_COMMANDS([libtool],
[_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
])#_LT_CONFIG_COMMANDS
# Initialize.
m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
[
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
sed_quote_subst='$sed_quote_subst'
double_quote_subst='$double_quote_subst'
delay_variable_subst='$delay_variable_subst'
_LT_CONFIG_STATUS_DECLARATIONS
LTCC='$LTCC'
LTCFLAGS='$LTCFLAGS'
compiler='$compiler_DEFAULT'
# A function that is used when there is no print builtin or printf.
func_fallback_echo ()
{
eval 'cat <<_LTECHO_EOF
\$[]1
_LTECHO_EOF'
}
# Quote evaled strings.
for var in lt_decl_all_varnames([[ \
]], lt_decl_quote_varnames); do
case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
*[[\\\\\\\`\\"\\\$]]*)
eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
;;
*)
eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
;;
esac
done
# Double-quote double-evaled strings.
for var in lt_decl_all_varnames([[ \
]], lt_decl_dquote_varnames); do
case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
*[[\\\\\\\`\\"\\\$]]*)
eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
;;
*)
eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
;;
esac
done
_LT_OUTPUT_LIBTOOL_INIT
])
# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
# ------------------------------------
# Generate a child script FILE with all initialization necessary to
# reuse the environment learned by the parent script, and make the
# file executable. If COMMENT is supplied, it is inserted after the
# `#!' sequence but before initialization text begins. After this
# macro, additional text can be appended to FILE to form the body of
# the child script. The macro ends with non-zero status if the
# file could not be fully written (such as if the disk is full).
m4_ifdef([AS_INIT_GENERATED],
[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
[m4_defun([_LT_GENERATED_FILE_INIT],
[m4_require([AS_PREPARE])]dnl
[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
[lt_write_fail=0
cat >$1 <<_ASEOF || lt_write_fail=1
#! $SHELL
# Generated by $as_me.
$2
SHELL=\${CONFIG_SHELL-$SHELL}
export SHELL
_ASEOF
cat >>$1 <<\_ASEOF || lt_write_fail=1
AS_SHELL_SANITIZE
_AS_PREPARE
exec AS_MESSAGE_FD>&1
_ASEOF
test $lt_write_fail = 0 && chmod +x $1[]dnl
m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
# LT_OUTPUT
# ---------
# This macro allows early generation of the libtool script (before
# AC_OUTPUT is called), incase it is used in configure for compilation
# tests.
AC_DEFUN([LT_OUTPUT],
[: ${CONFIG_LT=./config.lt}
AC_MSG_NOTICE([creating $CONFIG_LT])
_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
[# Run this file to recreate a libtool stub with the current configuration.])
cat >>"$CONFIG_LT" <<\_LTEOF
lt_cl_silent=false
exec AS_MESSAGE_LOG_FD>>config.log
{
echo
AS_BOX([Running $as_me.])
} >&AS_MESSAGE_LOG_FD
lt_cl_help="\
\`$as_me' creates a local libtool stub from the current configuration,
for use in further configure time tests before the real libtool is
generated.
Usage: $[0] [[OPTIONS]]
-h, --help print this help, then exit
-V, --version print version number, then exit
-q, --quiet do not print progress messages
-d, --debug don't remove temporary files
Report bugs to ."
lt_cl_version="\
m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
configured by $[0], generated by m4_PACKAGE_STRING.
Copyright (C) 2010 Free Software Foundation, Inc.
This config.lt script is free software; the Free Software Foundation
gives unlimited permision to copy, distribute and modify it."
while test $[#] != 0
do
case $[1] in
--version | --v* | -V )
echo "$lt_cl_version"; exit 0 ;;
--help | --h* | -h )
echo "$lt_cl_help"; exit 0 ;;
--debug | --d* | -d )
debug=: ;;
--quiet | --q* | --silent | --s* | -q )
lt_cl_silent=: ;;
-*) AC_MSG_ERROR([unrecognized option: $[1]
Try \`$[0] --help' for more information.]) ;;
*) AC_MSG_ERROR([unrecognized argument: $[1]
Try \`$[0] --help' for more information.]) ;;
esac
shift
done
if $lt_cl_silent; then
exec AS_MESSAGE_FD>/dev/null
fi
_LTEOF
cat >>"$CONFIG_LT" <<_LTEOF
_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
_LTEOF
cat >>"$CONFIG_LT" <<\_LTEOF
AC_MSG_NOTICE([creating $ofile])
_LT_OUTPUT_LIBTOOL_COMMANDS
AS_EXIT(0)
_LTEOF
chmod +x "$CONFIG_LT"
# configure is writing to config.log, but config.lt does its own redirection,
# appending to config.log, which fails on DOS, as config.log is still kept
# open by configure. Here we exec the FD to /dev/null, effectively closing
# config.log, so it can be properly (re)opened and appended to by config.lt.
lt_cl_success=:
test "$silent" = yes &&
lt_config_lt_args="$lt_config_lt_args --quiet"
exec AS_MESSAGE_LOG_FD>/dev/null
$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
exec AS_MESSAGE_LOG_FD>>config.log
$lt_cl_success || AS_EXIT(1)
])# LT_OUTPUT
# _LT_CONFIG(TAG)
# ---------------
# If TAG is the built-in tag, create an initial libtool script with a
# default configuration from the untagged config vars. Otherwise add code
# to config.status for appending the configuration named by TAG from the
# matching tagged config vars.
m4_defun([_LT_CONFIG],
[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
_LT_CONFIG_SAVE_COMMANDS([
m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
m4_if(_LT_TAG, [C], [
# See if we are running on zsh, and set the options which allow our
# commands through without removal of \ escapes.
if test -n "${ZSH_VERSION+set}" ; then
setopt NO_GLOB_SUBST
fi
cfgfile="${ofile}T"
trap "$RM \"$cfgfile\"; exit 1" 1 2 15
$RM "$cfgfile"
cat <<_LT_EOF >> "$cfgfile"
#! $SHELL
# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
#
_LT_COPYING
_LT_LIBTOOL_TAGS
# ### BEGIN LIBTOOL CONFIG
_LT_LIBTOOL_CONFIG_VARS
_LT_LIBTOOL_TAG_VARS
# ### END LIBTOOL CONFIG
_LT_EOF
case $host_os in
aix3*)
cat <<\_LT_EOF >> "$cfgfile"
# AIX sometimes has problems with the GCC collect2 program. For some
# reason, if we set the COLLECT_NAMES environment variable, the problems
# vanish in a puff of smoke.
if test "X${COLLECT_NAMES+set}" != Xset; then
COLLECT_NAMES=
export COLLECT_NAMES
fi
_LT_EOF
;;
esac
_LT_PROG_LTMAIN
# We use sed instead of cat because bash on DJGPP gets confused if
# if finds mixed CR/LF and LF-only lines. Since sed operates in
# text mode, it properly converts lines to CR/LF. This bash problem
# is reportedly fixed, but why not run on old versions too?
sed '$q' "$ltmain" >> "$cfgfile" \
|| (rm -f "$cfgfile"; exit 1)
_LT_PROG_REPLACE_SHELLFNS
mv -f "$cfgfile" "$ofile" ||
(rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
chmod +x "$ofile"
],
[cat <<_LT_EOF >> "$ofile"
dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
dnl in a comment (ie after a #).
# ### BEGIN LIBTOOL TAG CONFIG: $1
_LT_LIBTOOL_TAG_VARS(_LT_TAG)
# ### END LIBTOOL TAG CONFIG: $1
_LT_EOF
])dnl /m4_if
],
[m4_if([$1], [], [
PACKAGE='$PACKAGE'
VERSION='$VERSION'
TIMESTAMP='$TIMESTAMP'
RM='$RM'
ofile='$ofile'], [])
])dnl /_LT_CONFIG_SAVE_COMMANDS
])# _LT_CONFIG
# LT_SUPPORTED_TAG(TAG)
# ---------------------
# Trace this macro to discover what tags are supported by the libtool
# --tag option, using:
# autoconf --trace 'LT_SUPPORTED_TAG:$1'
AC_DEFUN([LT_SUPPORTED_TAG], [])
# C support is built-in for now
m4_define([_LT_LANG_C_enabled], [])
m4_define([_LT_TAGS], [])
# LT_LANG(LANG)
# -------------
# Enable libtool support for the given language if not already enabled.
AC_DEFUN([LT_LANG],
[AC_BEFORE([$0], [LT_OUTPUT])dnl
m4_case([$1],
[C], [_LT_LANG(C)],
[C++], [_LT_LANG(CXX)],
[Java], [_LT_LANG(GCJ)],
[Fortran 77], [_LT_LANG(F77)],
[Fortran], [_LT_LANG(FC)],
[Windows Resource], [_LT_LANG(RC)],
[m4_ifdef([_LT_LANG_]$1[_CONFIG],
[_LT_LANG($1)],
[m4_fatal([$0: unsupported language: "$1"])])])dnl
])# LT_LANG
# _LT_LANG(LANGNAME)
# ------------------
m4_defun([_LT_LANG],
[m4_ifdef([_LT_LANG_]$1[_enabled], [],
[LT_SUPPORTED_TAG([$1])dnl
m4_append([_LT_TAGS], [$1 ])dnl
m4_define([_LT_LANG_]$1[_enabled], [])dnl
_LT_LANG_$1_CONFIG($1)])dnl
])# _LT_LANG
# _LT_LANG_DEFAULT_CONFIG
# -----------------------
m4_defun([_LT_LANG_DEFAULT_CONFIG],
[AC_PROVIDE_IFELSE([AC_PROG_CXX],
[LT_LANG(CXX)],
[m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
AC_PROVIDE_IFELSE([AC_PROG_F77],
[LT_LANG(F77)],
[m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
AC_PROVIDE_IFELSE([AC_PROG_FC],
[LT_LANG(FC)],
[m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
dnl pulling things in needlessly.
AC_PROVIDE_IFELSE([AC_PROG_GCJ],
[LT_LANG(GCJ)],
[AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
[LT_LANG(GCJ)],
[AC_PROVIDE_IFELSE([LT_PROG_GCJ],
[LT_LANG(GCJ)],
[m4_ifdef([AC_PROG_GCJ],
[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
m4_ifdef([A][M_PROG_GCJ],
[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
m4_ifdef([LT_PROG_GCJ],
[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
AC_PROVIDE_IFELSE([LT_PROG_RC],
[LT_LANG(RC)],
[m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
])# _LT_LANG_DEFAULT_CONFIG
# Obsolete macros:
AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
dnl AC_DEFUN([AC_LIBTOOL_F77], [])
dnl AC_DEFUN([AC_LIBTOOL_FC], [])
dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
dnl AC_DEFUN([AC_LIBTOOL_RC], [])
# _LT_TAG_COMPILER
# ----------------
m4_defun([_LT_TAG_COMPILER],
[AC_REQUIRE([AC_PROG_CC])dnl
_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
# If no C compiler was specified, use CC.
LTCC=${LTCC-"$CC"}
# If no C compiler flags were specified, use CFLAGS.
LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
# Allow CC to be a program name with arguments.
compiler=$CC
])# _LT_TAG_COMPILER
# _LT_COMPILER_BOILERPLATE
# ------------------------
# Check for compiler boilerplate output or warnings with
# the simple compiler test code.
m4_defun([_LT_COMPILER_BOILERPLATE],
[m4_require([_LT_DECL_SED])dnl
ac_outfile=conftest.$ac_objext
echo "$lt_simple_compile_test_code" >conftest.$ac_ext
eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_compiler_boilerplate=`cat conftest.err`
$RM conftest*
])# _LT_COMPILER_BOILERPLATE
# _LT_LINKER_BOILERPLATE
# ----------------------
# Check for linker boilerplate output or warnings with
# the simple link test code.
m4_defun([_LT_LINKER_BOILERPLATE],
[m4_require([_LT_DECL_SED])dnl
ac_outfile=conftest.$ac_objext
echo "$lt_simple_link_test_code" >conftest.$ac_ext
eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_linker_boilerplate=`cat conftest.err`
$RM -r conftest*
])# _LT_LINKER_BOILERPLATE
# _LT_REQUIRED_DARWIN_CHECKS
# -------------------------
m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
case $host_os in
rhapsody* | darwin*)
AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
AC_CHECK_TOOL([LIPO], [lipo], [:])
AC_CHECK_TOOL([OTOOL], [otool], [:])
AC_CHECK_TOOL([OTOOL64], [otool64], [:])
_LT_DECL([], [DSYMUTIL], [1],
[Tool to manipulate archived DWARF debug symbol files on Mac OS X])
_LT_DECL([], [NMEDIT], [1],
[Tool to change global to local symbols on Mac OS X])
_LT_DECL([], [LIPO], [1],
[Tool to manipulate fat objects and archives on Mac OS X])
_LT_DECL([], [OTOOL], [1],
[ldd/readelf like tool for Mach-O binaries on Mac OS X])
_LT_DECL([], [OTOOL64], [1],
[ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
[lt_cv_apple_cc_single_mod=no
if test -z "${LT_MULTI_MODULE}"; then
# By default we will add the -single_module flag. You can override
# by either setting the environment variable LT_MULTI_MODULE
# non-empty at configure time, or by adding -multi_module to the
# link flags.
rm -rf libconftest.dylib*
echo "int foo(void){return 1;}" > conftest.c
echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
-dynamiclib -Wl,-single_module conftest.c 2>conftest.err
_lt_result=$?
if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
lt_cv_apple_cc_single_mod=yes
else
cat conftest.err >&AS_MESSAGE_LOG_FD
fi
rm -rf libconftest.dylib*
rm -f conftest.*
fi])
AC_CACHE_CHECK([for -exported_symbols_list linker flag],
[lt_cv_ld_exported_symbols_list],
[lt_cv_ld_exported_symbols_list=no
save_LDFLAGS=$LDFLAGS
echo "_main" > conftest.sym
LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
[lt_cv_ld_exported_symbols_list=yes],
[lt_cv_ld_exported_symbols_list=no])
LDFLAGS="$save_LDFLAGS"
])
AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
[lt_cv_ld_force_load=no
cat > conftest.c << _LT_EOF
int forced_loaded() { return 2;}
_LT_EOF
echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
$LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
$AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
$RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
cat > conftest.c << _LT_EOF
int main() { return 0;}
_LT_EOF
echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
_lt_result=$?
if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
lt_cv_ld_force_load=yes
else
cat conftest.err >&AS_MESSAGE_LOG_FD
fi
rm -f conftest.err libconftest.a conftest conftest.c
rm -rf conftest.dSYM
])
case $host_os in
rhapsody* | darwin1.[[012]])
_lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
darwin1.*)
_lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
darwin*) # darwin 5.x on
# if running on 10.5 or later, the deployment target defaults
# to the OS version, if on x86, and 10.4, the deployment
# target defaults to 10.4. Don't you love it?
case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
_lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
10.[[012]]*)
_lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
10.*)
_lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
esac
;;
esac
if test "$lt_cv_apple_cc_single_mod" = "yes"; then
_lt_dar_single_mod='$single_module'
fi
if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
_lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
else
_lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
fi
if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
_lt_dsymutil='~$DSYMUTIL $lib || :'
else
_lt_dsymutil=
fi
;;
esac
])
# _LT_DARWIN_LINKER_FEATURES
# --------------------------
# Checks for linker and compiler features on darwin
m4_defun([_LT_DARWIN_LINKER_FEATURES],
[
m4_require([_LT_REQUIRED_DARWIN_CHECKS])
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_automatic, $1)=yes
_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
if test "$lt_cv_ld_force_load" = "yes"; then
_LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
else
_LT_TAGVAR(whole_archive_flag_spec, $1)=''
fi
_LT_TAGVAR(link_all_deplibs, $1)=yes
_LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
case $cc_basename in
ifort*) _lt_dar_can_shared=yes ;;
*) _lt_dar_can_shared=$GCC ;;
esac
if test "$_lt_dar_can_shared" = "yes"; then
output_verbose_link_cmd=func_echo_all
_LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
_LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
_LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
_LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
m4_if([$1], [CXX],
[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
_LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
_LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
fi
],[])
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
])
# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
# ----------------------------------
# Links a minimal program and checks the executable
# for the system default hardcoded library path. In most cases,
# this is /usr/lib:/lib, but when the MPI compilers are used
# the location of the communication and MPI libs are included too.
# If we don't find anything, use the default library path according
# to the aix ld manual.
# Store the results from the different compilers for each TAGNAME.
# Allow to override them for all tags through lt_cv_aix_libpath.
m4_defun([_LT_SYS_MODULE_PATH_AIX],
[m4_require([_LT_DECL_SED])dnl
if test "${lt_cv_aix_libpath+set}" = set; then
aix_libpath=$lt_cv_aix_libpath
else
AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
[AC_LINK_IFELSE([AC_LANG_PROGRAM],[
lt_aix_libpath_sed='[
/Import File Strings/,/^$/ {
/^0/ {
s/^0 *\([^ ]*\) *$/\1/
p
}
}]'
_LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
# Check for a 64-bit object if we didn't find anything.
if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
_LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
fi],[])
if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
_LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
fi
])
aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
fi
])# _LT_SYS_MODULE_PATH_AIX
# _LT_SHELL_INIT(ARG)
# -------------------
m4_define([_LT_SHELL_INIT],
[m4_divert_text([M4SH-INIT], [$1
])])# _LT_SHELL_INIT
# _LT_PROG_ECHO_BACKSLASH
# -----------------------
# Find how we can fake an echo command that does not interpret backslash.
# In particular, with Autoconf 2.60 or later we add some code to the start
# of the generated configure script which will find a shell with a builtin
# printf (which we can use as an echo command).
m4_defun([_LT_PROG_ECHO_BACKSLASH],
[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
AC_MSG_CHECKING([how to print strings])
# Test print first, because it will be a builtin if present.
if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
ECHO='print -r --'
elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
ECHO='printf %s\n'
else
# Use this function as a fallback that always works.
func_fallback_echo ()
{
eval 'cat <<_LTECHO_EOF
$[]1
_LTECHO_EOF'
}
ECHO='func_fallback_echo'
fi
# func_echo_all arg...
# Invoke $ECHO with all args, space-separated.
func_echo_all ()
{
$ECHO "$*"
}
case "$ECHO" in
printf*) AC_MSG_RESULT([printf]) ;;
print*) AC_MSG_RESULT([print -r]) ;;
*) AC_MSG_RESULT([cat]) ;;
esac
m4_ifdef([_AS_DETECT_SUGGESTED],
[_AS_DETECT_SUGGESTED([
test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
PATH=/empty FPATH=/empty; export PATH FPATH
test "X`printf %s $ECHO`" = "X$ECHO" \
|| test "X`print -r -- $ECHO`" = "X$ECHO" )])])
_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
])# _LT_PROG_ECHO_BACKSLASH
# _LT_WITH_SYSROOT
# ----------------
AC_DEFUN([_LT_WITH_SYSROOT],
[AC_MSG_CHECKING([for sysroot])
AC_ARG_WITH([sysroot],
[ --with-sysroot[=DIR] Search for dependent libraries within DIR
(or the compiler's sysroot if not specified).],
[], [with_sysroot=no])
dnl lt_sysroot will always be passed unquoted. We quote it here
dnl in case the user passed a directory name.
lt_sysroot=
case ${with_sysroot} in #(
yes)
if test "$GCC" = yes; then
lt_sysroot=`$CC --print-sysroot 2>/dev/null`
fi
;; #(
/*)
lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
;; #(
no|'')
;; #(
*)
AC_MSG_RESULT([${with_sysroot}])
AC_MSG_ERROR([The sysroot must be an absolute path.])
;;
esac
AC_MSG_RESULT([${lt_sysroot:-no}])
_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
[dependent libraries, and in which our libraries should be installed.])])
# _LT_ENABLE_LOCK
# ---------------
m4_defun([_LT_ENABLE_LOCK],
[AC_ARG_ENABLE([libtool-lock],
[AS_HELP_STRING([--disable-libtool-lock],
[avoid locking (might break parallel builds)])])
test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
# Some flags need to be propagated to the compiler or linker for good
# libtool support.
case $host in
ia64-*-hpux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
case `/usr/bin/file conftest.$ac_objext` in
*ELF-32*)
HPUX_IA64_MODE="32"
;;
*ELF-64*)
HPUX_IA64_MODE="64"
;;
esac
fi
rm -rf conftest*
;;
*-*-irix6*)
# Find out which ABI we are using.
echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
if test "$lt_cv_prog_gnu_ld" = yes; then
case `/usr/bin/file conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -melf32bsmip"
;;
*N32*)
LD="${LD-ld} -melf32bmipn32"
;;
*64-bit*)
LD="${LD-ld} -melf64bmip"
;;
esac
else
case `/usr/bin/file conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -32"
;;
*N32*)
LD="${LD-ld} -n32"
;;
*64-bit*)
LD="${LD-ld} -64"
;;
esac
fi
fi
rm -rf conftest*
;;
x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
case `/usr/bin/file conftest.o` in
*32-bit*)
case $host in
x86_64-*kfreebsd*-gnu)
LD="${LD-ld} -m elf_i386_fbsd"
;;
x86_64-*linux*)
LD="${LD-ld} -m elf_i386"
;;
ppc64-*linux*|powerpc64-*linux*)
LD="${LD-ld} -m elf32ppclinux"
;;
s390x-*linux*)
LD="${LD-ld} -m elf_s390"
;;
sparc64-*linux*)
LD="${LD-ld} -m elf32_sparc"
;;
esac
;;
*64-bit*)
case $host in
x86_64-*kfreebsd*-gnu)
LD="${LD-ld} -m elf_x86_64_fbsd"
;;
x86_64-*linux*)
LD="${LD-ld} -m elf_x86_64"
;;
ppc*-*linux*|powerpc*-*linux*)
LD="${LD-ld} -m elf64ppc"
;;
s390*-*linux*|s390*-*tpf*)
LD="${LD-ld} -m elf64_s390"
;;
sparc*-*linux*)
LD="${LD-ld} -m elf64_sparc"
;;
esac
;;
esac
fi
rm -rf conftest*
;;
*-*-sco3.2v5*)
# On SCO OpenServer 5, we need -belf to get full-featured binaries.
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -belf"
AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
[AC_LANG_PUSH(C)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
AC_LANG_POP])
if test x"$lt_cv_cc_needs_belf" != x"yes"; then
# this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
CFLAGS="$SAVE_CFLAGS"
fi
;;
sparc*-*solaris*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
case `/usr/bin/file conftest.o` in
*64-bit*)
case $lt_cv_prog_gnu_ld in
yes*) LD="${LD-ld} -m elf64_sparc" ;;
*)
if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
LD="${LD-ld} -64"
fi
;;
esac
;;
esac
fi
rm -rf conftest*
;;
esac
need_locks="$enable_libtool_lock"
])# _LT_ENABLE_LOCK
# _LT_PROG_AR
# -----------
m4_defun([_LT_PROG_AR],
[AC_CHECK_TOOLS(AR, [ar], false)
: ${AR=ar}
: ${AR_FLAGS=cru}
_LT_DECL([], [AR], [1], [The archiver])
_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
[lt_cv_ar_at_file=no
AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
[echo conftest.$ac_objext > conftest.lst
lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
AC_TRY_EVAL([lt_ar_try])
if test "$ac_status" -eq 0; then
# Ensure the archiver fails upon bogus file names.
rm -f conftest.$ac_objext libconftest.a
AC_TRY_EVAL([lt_ar_try])
if test "$ac_status" -ne 0; then
lt_cv_ar_at_file=@
fi
fi
rm -f conftest.* libconftest.a
])
])
if test "x$lt_cv_ar_at_file" = xno; then
archiver_list_spec=
else
archiver_list_spec=$lt_cv_ar_at_file
fi
_LT_DECL([], [archiver_list_spec], [1],
[How to feed a file listing to the archiver])
])# _LT_PROG_AR
# _LT_CMD_OLD_ARCHIVE
# -------------------
m4_defun([_LT_CMD_OLD_ARCHIVE],
[_LT_PROG_AR
AC_CHECK_TOOL(STRIP, strip, :)
test -z "$STRIP" && STRIP=:
_LT_DECL([], [STRIP], [1], [A symbol stripping program])
AC_CHECK_TOOL(RANLIB, ranlib, :)
test -z "$RANLIB" && RANLIB=:
_LT_DECL([], [RANLIB], [1],
[Commands used to install an old-style archive])
# Determine commands to create old-style static archives.
old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
old_postinstall_cmds='chmod 644 $oldlib'
old_postuninstall_cmds=
if test -n "$RANLIB"; then
case $host_os in
openbsd*)
old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
;;
*)
old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
;;
esac
old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
fi
case $host_os in
darwin*)
lock_old_archive_extraction=yes ;;
*)
lock_old_archive_extraction=no ;;
esac
_LT_DECL([], [old_postinstall_cmds], [2])
_LT_DECL([], [old_postuninstall_cmds], [2])
_LT_TAGDECL([], [old_archive_cmds], [2],
[Commands used to build an old-style archive])
_LT_DECL([], [lock_old_archive_extraction], [0],
[Whether to use a lock for old archive extraction])
])# _LT_CMD_OLD_ARCHIVE
# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
# ----------------------------------------------------------------
# Check whether the given compiler option works
AC_DEFUN([_LT_COMPILER_OPTION],
[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
m4_require([_LT_DECL_SED])dnl
AC_CACHE_CHECK([$1], [$2],
[$2=no
m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="$3"
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
# Note that $ac_compile itself does not contain backslashes and begins
# with a dollar sign (not a hyphen), so the echo should work correctly.
# The option is referenced via a variable to avoid confusing sed.
lt_compile=`echo "$ac_compile" | $SED \
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&AS_MESSAGE_LOG_FD
echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
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 other than the usual output.
$ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
$2=yes
fi
fi
$RM conftest*
])
if test x"[$]$2" = xyes; then
m4_if([$5], , :, [$5])
else
m4_if([$6], , :, [$6])
fi
])# _LT_COMPILER_OPTION
# Old name:
AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
# [ACTION-SUCCESS], [ACTION-FAILURE])
# ----------------------------------------------------
# Check whether the given linker option works
AC_DEFUN([_LT_LINKER_OPTION],
[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
m4_require([_LT_DECL_SED])dnl
AC_CACHE_CHECK([$1], [$2],
[$2=no
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $3"
echo "$lt_simple_link_test_code" > conftest.$ac_ext
if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
# The linker can only warn and ignore the option if not recognized
# So say no if there are warnings
if test -s conftest.err; then
# Append any errors to the config.log.
cat conftest.err 1>&AS_MESSAGE_LOG_FD
$ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if diff conftest.exp conftest.er2 >/dev/null; then
$2=yes
fi
else
$2=yes
fi
fi
$RM -r conftest*
LDFLAGS="$save_LDFLAGS"
])
if test x"[$]$2" = xyes; then
m4_if([$4], , :, [$4])
else
m4_if([$5], , :, [$5])
fi
])# _LT_LINKER_OPTION
# Old name:
AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
# LT_CMD_MAX_LEN
#---------------
AC_DEFUN([LT_CMD_MAX_LEN],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
# find the maximum length of command line arguments
AC_MSG_CHECKING([the maximum length of command line arguments])
AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
i=0
teststring="ABCD"
case $build_os in
msdosdjgpp*)
# On DJGPP, this test can blow up pretty badly due to problems in libc
# (any single argument exceeding 2000 bytes causes a buffer overrun
# during glob expansion). Even if it were fixed, the result of this
# check would be larger than it should be.
lt_cv_sys_max_cmd_len=12288; # 12K is about right
;;
gnu*)
# Under GNU Hurd, this test is not required because there is
# no limit to the length of command line arguments.
# Libtool will interpret -1 as no limit whatsoever
lt_cv_sys_max_cmd_len=-1;
;;
cygwin* | mingw* | cegcc*)
# On Win9x/ME, this test blows up -- it succeeds, but takes
# about 5 minutes as the teststring grows exponentially.
# Worse, since 9x/ME are not pre-emptively multitasking,
# you end up with a "frozen" computer, even though with patience
# the test eventually succeeds (with a max line length of 256k).
# Instead, let's just punt: use the minimum linelength reported by
# all of the supported platforms: 8192 (on NT/2K/XP).
lt_cv_sys_max_cmd_len=8192;
;;
mint*)
# On MiNT this can take a long time and run out of memory.
lt_cv_sys_max_cmd_len=8192;
;;
amigaos*)
# On AmigaOS with pdksh, this test takes hours, literally.
# So we just punt and use a minimum line length of 8192.
lt_cv_sys_max_cmd_len=8192;
;;
netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
# This has been around since 386BSD, at least. Likely further.
if test -x /sbin/sysctl; then
lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
elif test -x /usr/sbin/sysctl; then
lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
else
lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
fi
# And add a safety zone
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
;;
interix*)
# We know the value 262144 and hardcode it with a safety zone (like BSD)
lt_cv_sys_max_cmd_len=196608
;;
osf*)
# Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
# due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
# nice to cause kernel panics so lets avoid the loop below.
# First set a reasonable default.
lt_cv_sys_max_cmd_len=16384
#
if test -x /sbin/sysconfig; then
case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
*1*) lt_cv_sys_max_cmd_len=-1 ;;
esac
fi
;;
sco3.2v5*)
lt_cv_sys_max_cmd_len=102400
;;
sysv5* | sco5v6* | sysv4.2uw2*)
kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
if test -n "$kargmax"; then
lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
else
lt_cv_sys_max_cmd_len=32768
fi
;;
*)
lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
if test -n "$lt_cv_sys_max_cmd_len"; then
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
else
# Make teststring a little bigger before we do anything with it.
# a 1K string should be a reasonable start.
for i in 1 2 3 4 5 6 7 8 ; do
teststring=$teststring$teststring
done
SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
# If test is not a shell built-in, we'll probably end up computing a
# maximum length that is only half of the actual maximum length, but
# we can't tell.
while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
= "X$teststring$teststring"; } >/dev/null 2>&1 &&
test $i != 17 # 1/2 MB should be enough
do
i=`expr $i + 1`
teststring=$teststring$teststring
done
# Only check the string length outside the loop.
lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
teststring=
# Add a significant safety factor because C++ compilers can tack on
# massive amounts of additional arguments before passing them to the
# linker. It appears as though 1/2 is a usable value.
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
fi
;;
esac
])
if test -n $lt_cv_sys_max_cmd_len ; then
AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
else
AC_MSG_RESULT(none)
fi
max_cmd_len=$lt_cv_sys_max_cmd_len
_LT_DECL([], [max_cmd_len], [0],
[What is the maximum length of a command?])
])# LT_CMD_MAX_LEN
# Old name:
AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
# _LT_HEADER_DLFCN
# ----------------
m4_defun([_LT_HEADER_DLFCN],
[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
])# _LT_HEADER_DLFCN
# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
# ----------------------------------------------------------------
m4_defun([_LT_TRY_DLOPEN_SELF],
[m4_require([_LT_HEADER_DLFCN])dnl
if test "$cross_compiling" = yes; then :
[$4]
else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
[#line $LINENO "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
#include
#endif
#include
#ifdef RTLD_GLOBAL
# define LT_DLGLOBAL RTLD_GLOBAL
#else
# ifdef DL_GLOBAL
# define LT_DLGLOBAL DL_GLOBAL
# else
# define LT_DLGLOBAL 0
# endif
#endif
/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
find out it does not work in some platform. */
#ifndef LT_DLLAZY_OR_NOW
# ifdef RTLD_LAZY
# define LT_DLLAZY_OR_NOW RTLD_LAZY
# else
# ifdef DL_LAZY
# define LT_DLLAZY_OR_NOW DL_LAZY
# else
# ifdef RTLD_NOW
# define LT_DLLAZY_OR_NOW RTLD_NOW
# else
# ifdef DL_NOW
# define LT_DLLAZY_OR_NOW DL_NOW
# else
# define LT_DLLAZY_OR_NOW 0
# endif
# endif
# endif
# endif
#endif
/* When -fvisbility=hidden is used, assume the code has been annotated
correspondingly for the symbols needed. */
#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
int fnord () __attribute__((visibility("default")));
#endif
int fnord () { return 42; }
int main ()
{
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
int status = $lt_dlunknown;
if (self)
{
if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
else
{
if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
else puts (dlerror ());
}
/* dlclose (self); */
}
else
puts (dlerror ());
return status;
}]
_LT_EOF
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
(./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
lt_status=$?
case x$lt_status in
x$lt_dlno_uscore) $1 ;;
x$lt_dlneed_uscore) $2 ;;
x$lt_dlunknown|x*) $3 ;;
esac
else :
# compilation failed
$3
fi
fi
rm -fr conftest*
])# _LT_TRY_DLOPEN_SELF
# LT_SYS_DLOPEN_SELF
# ------------------
AC_DEFUN([LT_SYS_DLOPEN_SELF],
[m4_require([_LT_HEADER_DLFCN])dnl
if test "x$enable_dlopen" != xyes; then
enable_dlopen=unknown
enable_dlopen_self=unknown
enable_dlopen_self_static=unknown
else
lt_cv_dlopen=no
lt_cv_dlopen_libs=
case $host_os in
beos*)
lt_cv_dlopen="load_add_on"
lt_cv_dlopen_libs=
lt_cv_dlopen_self=yes
;;
mingw* | pw32* | cegcc*)
lt_cv_dlopen="LoadLibrary"
lt_cv_dlopen_libs=
;;
cygwin*)
lt_cv_dlopen="dlopen"
lt_cv_dlopen_libs=
;;
darwin*)
# if libdl is installed we need to link against it
AC_CHECK_LIB([dl], [dlopen],
[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
lt_cv_dlopen="dyld"
lt_cv_dlopen_libs=
lt_cv_dlopen_self=yes
])
;;
*)
AC_CHECK_FUNC([shl_load],
[lt_cv_dlopen="shl_load"],
[AC_CHECK_LIB([dld], [shl_load],
[lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
[AC_CHECK_FUNC([dlopen],
[lt_cv_dlopen="dlopen"],
[AC_CHECK_LIB([dl], [dlopen],
[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
[AC_CHECK_LIB([svld], [dlopen],
[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
[AC_CHECK_LIB([dld], [dld_link],
[lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
])
])
])
])
])
;;
esac
if test "x$lt_cv_dlopen" != xno; then
enable_dlopen=yes
else
enable_dlopen=no
fi
case $lt_cv_dlopen in
dlopen)
save_CPPFLAGS="$CPPFLAGS"
test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
save_LDFLAGS="$LDFLAGS"
wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
save_LIBS="$LIBS"
LIBS="$lt_cv_dlopen_libs $LIBS"
AC_CACHE_CHECK([whether a program can dlopen itself],
lt_cv_dlopen_self, [dnl
_LT_TRY_DLOPEN_SELF(
lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
])
if test "x$lt_cv_dlopen_self" = xyes; then
wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
lt_cv_dlopen_self_static, [dnl
_LT_TRY_DLOPEN_SELF(
lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
])
fi
CPPFLAGS="$save_CPPFLAGS"
LDFLAGS="$save_LDFLAGS"
LIBS="$save_LIBS"
;;
esac
case $lt_cv_dlopen_self in
yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
*) enable_dlopen_self=unknown ;;
esac
case $lt_cv_dlopen_self_static in
yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
*) enable_dlopen_self_static=unknown ;;
esac
fi
_LT_DECL([dlopen_support], [enable_dlopen], [0],
[Whether dlopen is supported])
_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
[Whether dlopen of programs is supported])
_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
[Whether dlopen of statically linked programs is supported])
])# LT_SYS_DLOPEN_SELF
# Old name:
AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
# _LT_COMPILER_C_O([TAGNAME])
# ---------------------------
# Check to see if options -c and -o are simultaneously supported by compiler.
# This macro does not hard code the compiler like AC_PROG_CC_C_O.
m4_defun([_LT_COMPILER_C_O],
[m4_require([_LT_DECL_SED])dnl
m4_require([_LT_FILEUTILS_DEFAULTS])dnl
m4_require([_LT_TAG_COMPILER])dnl
AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
[_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
[_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
$RM -r conftest 2>/dev/null
mkdir conftest
cd conftest
mkdir out
echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="-o out/conftest2.$ac_objext"
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
# Note that $ac_compile itself does not contain backslashes and begins
# with a dollar sign (not a hyphen), so the echo should work correctly.
lt_compile=`echo "$ac_compile" | $SED \
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&AS_MESSAGE_LOG_FD
echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
$ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
$SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
fi
fi
chmod u+w . 2>&AS_MESSAGE_LOG_FD
$RM conftest*
# SGI C++ compiler will create directory out/ii_files/ for
# template instantiation
test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
$RM out/* && rmdir out
cd ..
$RM -r conftest
$RM conftest*
])
_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
[Does compiler simultaneously support -c and -o options?])
])# _LT_COMPILER_C_O
# _LT_COMPILER_FILE_LOCKS([TAGNAME])
# ----------------------------------
# Check to see if we can do hard links to lock some files if needed
m4_defun([_LT_COMPILER_FILE_LOCKS],
[m4_require([_LT_ENABLE_LOCK])dnl
m4_require([_LT_FILEUTILS_DEFAULTS])dnl
_LT_COMPILER_C_O([$1])
hard_links="nottested"
if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
# do not overwrite the value of need_locks provided by the user
AC_MSG_CHECKING([if we can lock with hard links])
hard_links=yes
$RM conftest*
ln conftest.a conftest.b 2>/dev/null && hard_links=no
touch conftest.a
ln conftest.a conftest.b 2>&5 || hard_links=no
ln conftest.a conftest.b 2>/dev/null && hard_links=no
AC_MSG_RESULT([$hard_links])
if test "$hard_links" = no; then
AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
need_locks=warn
fi
else
need_locks=no
fi
_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
])# _LT_COMPILER_FILE_LOCKS
# _LT_CHECK_OBJDIR
# ----------------
m4_defun([_LT_CHECK_OBJDIR],
[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
[rm -f .libs 2>/dev/null
mkdir .libs 2>/dev/null
if test -d .libs; then
lt_cv_objdir=.libs
else
# MS-DOS does not allow filenames that begin with a dot.
lt_cv_objdir=_libs
fi
rmdir .libs 2>/dev/null])
objdir=$lt_cv_objdir
_LT_DECL([], [objdir], [0],
[The name of the directory that contains temporary libtool files])dnl
m4_pattern_allow([LT_OBJDIR])dnl
AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
[Define to the sub-directory in which libtool stores uninstalled libraries.])
])# _LT_CHECK_OBJDIR
# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
# --------------------------------------
# Check hardcoding attributes.
m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
[AC_MSG_CHECKING([how to hardcode library paths into programs])
_LT_TAGVAR(hardcode_action, $1)=
if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
test -n "$_LT_TAGVAR(runpath_var, $1)" ||
test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
# We can hardcode non-existent directories.
if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
# If the only mechanism to avoid hardcoding is shlibpath_var, we
# have to relink, otherwise we might link with an installed library
# when we should be linking with a yet-to-be-installed one
## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
# Linking always hardcodes the temporary library directory.
_LT_TAGVAR(hardcode_action, $1)=relink
else
# We can link without hardcoding, and we can hardcode nonexisting dirs.
_LT_TAGVAR(hardcode_action, $1)=immediate
fi
else
# We cannot hardcode anything, or else we can only hardcode existing
# directories.
_LT_TAGVAR(hardcode_action, $1)=unsupported
fi
AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
# Fast installation is not supported
enable_fast_install=no
elif test "$shlibpath_overrides_runpath" = yes ||
test "$enable_shared" = no; then
# Fast installation is not necessary
enable_fast_install=needless
fi
_LT_TAGDECL([], [hardcode_action], [0],
[How to hardcode a shared library path into an executable])
])# _LT_LINKER_HARDCODE_LIBPATH
# _LT_CMD_STRIPLIB
# ----------------
m4_defun([_LT_CMD_STRIPLIB],
[m4_require([_LT_DECL_EGREP])
striplib=
old_striplib=
AC_MSG_CHECKING([whether stripping libraries is possible])
if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
test -z "$striplib" && striplib="$STRIP --strip-unneeded"
AC_MSG_RESULT([yes])
else
# FIXME - insert some real tests, host_os isn't really good enough
case $host_os in
darwin*)
if test -n "$STRIP" ; then
striplib="$STRIP -x"
old_striplib="$STRIP -S"
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
;;
*)
AC_MSG_RESULT([no])
;;
esac
fi
_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
_LT_DECL([], [striplib], [1])
])# _LT_CMD_STRIPLIB
# _LT_SYS_DYNAMIC_LINKER([TAG])
# -----------------------------
# PORTME Fill in your ld.so characteristics
m4_defun([_LT_SYS_DYNAMIC_LINKER],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
m4_require([_LT_DECL_EGREP])dnl
m4_require([_LT_FILEUTILS_DEFAULTS])dnl
m4_require([_LT_DECL_OBJDUMP])dnl
m4_require([_LT_DECL_SED])dnl
m4_require([_LT_CHECK_SHELL_FEATURES])dnl
AC_MSG_CHECKING([dynamic linker characteristics])
m4_if([$1],
[], [
if test "$GCC" = yes; then
case $host_os in
darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
*) lt_awk_arg="/^libraries:/" ;;
esac
case $host_os in
mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
*) lt_sed_strip_eq="s,=/,/,g" ;;
esac
lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
case $lt_search_path_spec in
*\;*)
# if the path contains ";" then we assume it to be the separator
# otherwise default to the standard path separator (i.e. ":") - it is
# assumed that no part of a normal pathname contains ";" but that should
# okay in the real world where ";" in dirpaths is itself problematic.
lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
;;
*)
lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
;;
esac
# Ok, now we have the path, separated by spaces, we can step through it
# and add multilib dir if necessary.
lt_tmp_lt_search_path_spec=
lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
for lt_sys_path in $lt_search_path_spec; do
if test -d "$lt_sys_path/$lt_multi_os_dir"; then
lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
else
test -d "$lt_sys_path" && \
lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
fi
done
lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
BEGIN {RS=" "; FS="/|\n";} {
lt_foo="";
lt_count=0;
for (lt_i = NF; lt_i > 0; lt_i--) {
if ($lt_i != "" && $lt_i != ".") {
if ($lt_i == "..") {
lt_count++;
} else {
if (lt_count == 0) {
lt_foo="/" $lt_i lt_foo;
} else {
lt_count--;
}
}
}
}
if (lt_foo != "") { lt_freq[[lt_foo]]++; }
if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
}'`
# AWK program above erroneously prepends '/' to C:/dos/paths
# for these hosts.
case $host_os in
mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
$SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
esac
sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
else
sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
fi])
library_names_spec=
libname_spec='lib$name'
soname_spec=
shrext_cmds=".so"
postinstall_cmds=
postuninstall_cmds=
finish_cmds=
finish_eval=
shlibpath_var=
shlibpath_overrides_runpath=unknown
version_type=none
dynamic_linker="$host_os ld.so"
sys_lib_dlsearch_path_spec="/lib /usr/lib"
need_lib_prefix=unknown
hardcode_into_libs=no
# when you set need_version to no, make sure it does not cause -set_version
# flags to be left without arguments
need_version=unknown
case $host_os in
aix3*)
version_type=linux
library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
shlibpath_var=LIBPATH
# AIX 3 has no versioning support, so we append a major version to the name.
soname_spec='${libname}${release}${shared_ext}$major'
;;
aix[[4-9]]*)
version_type=linux
need_lib_prefix=no
need_version=no
hardcode_into_libs=yes
if test "$host_cpu" = ia64; then
# AIX 5 supports IA64
library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
shlibpath_var=LD_LIBRARY_PATH
else
# With GCC up to 2.95.x, collect2 would create an import file
# for dependence libraries. The import file would start with
# the line `#! .'. This would cause the generated library to
# depend on `.', always an invalid library. This was fixed in
# development snapshots of GCC prior to 3.0.
case $host_os in
aix4 | aix4.[[01]] | aix4.[[01]].*)
if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
echo ' yes '
echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
:
else
can_build_shared=no
fi
;;
esac
# AIX (on Power*) has no versioning support, so currently we can not hardcode correct
# soname into executable. Probably we can add versioning support to
# collect2, so additional links can be useful in future.
if test "$aix_use_runtimelinking" = yes; then
# If using run time linking (on AIX 4.2 or later) use lib.so
# instead of lib.a to let people know that these are not
# typical AIX shared libraries.
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
else
# We preserve .a as extension for shared libraries through AIX4.2
# and later when we are not doing run time linking.
library_names_spec='${libname}${release}.a $libname.a'
soname_spec='${libname}${release}${shared_ext}$major'
fi
shlibpath_var=LIBPATH
fi
;;
amigaos*)
case $host_cpu in
powerpc)
# Since July 2007 AmigaOS4 officially supports .so libraries.
# When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
;;
m68k)
library_names_spec='$libname.ixlibrary $libname.a'
# Create ${libname}_ixlibrary.a entries in /sys/libs.
finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
;;
esac
;;
beos*)
library_names_spec='${libname}${shared_ext}'
dynamic_linker="$host_os ld.so"
shlibpath_var=LIBRARY_PATH
;;
bsdi[[45]]*)
version_type=linux
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
shlibpath_var=LD_LIBRARY_PATH
sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
# the default ld.so.conf also contains /usr/contrib/lib and
# /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
# libtool to hard-code these into programs
;;
cygwin* | mingw* | pw32* | cegcc*)
version_type=windows
shrext_cmds=".dll"
need_version=no
need_lib_prefix=no
case $GCC,$cc_basename in
yes,*)
# gcc
library_names_spec='$libname.dll.a'
# DLL is installed to $(libdir)/../bin by postinstall_cmds
postinstall_cmds='base_file=`basename \${file}`~
dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
dldir=$destdir/`dirname \$dlpath`~
test -d \$dldir || mkdir -p \$dldir~
$install_prog $dir/$dlname \$dldir/$dlname~
chmod a+x \$dldir/$dlname~
if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
fi'
postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
dlpath=$dir/\$dldll~
$RM \$dlpath'
shlibpath_overrides_runpath=yes
case $host_os in
cygwin*)
# Cygwin DLLs use 'cyg' prefix rather than 'lib'
soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
m4_if([$1], [],[
sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
;;
mingw* | cegcc*)
# MinGW DLLs use traditional 'lib' prefix
soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
;;
pw32*)
# pw32 DLLs use 'pw' prefix rather than 'lib'
library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
;;
esac
dynamic_linker='Win32 ld.exe'
;;
*,cl*)
# Native MSVC
libname_spec='$name'
soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
library_names_spec='${libname}.dll.lib'
case $build_os in
mingw*)
sys_lib_search_path_spec=
lt_save_ifs=$IFS
IFS=';'
for lt_path in $LIB
do
IFS=$lt_save_ifs
# Let DOS variable expansion print the short 8.3 style file name.
lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
done
IFS=$lt_save_ifs
# Convert to MSYS style.
sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
;;
cygwin*)
# Convert to unix form, then to dos form, then back to unix form
# but this time dos style (no spaces!) so that the unix form looks
# like /cygdrive/c/PROGRA~1:/cygdr...
sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
;;
*)
sys_lib_search_path_spec="$LIB"
if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
# It is most probably a Windows format PATH.
sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
else
sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
fi
# FIXME: find the short name or the path components, as spaces are
# common. (e.g. "Program Files" -> "PROGRA~1")
;;
esac
# DLL is installed to $(libdir)/../bin by postinstall_cmds
postinstall_cmds='base_file=`basename \${file}`~
dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
dldir=$destdir/`dirname \$dlpath`~
test -d \$dldir || mkdir -p \$dldir~
$install_prog $dir/$dlname \$dldir/$dlname'
postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
dlpath=$dir/\$dldll~
$RM \$dlpath'
shlibpath_overrides_runpath=yes
dynamic_linker='Win32 link.exe'
;;
*)
# Assume MSVC wrapper
library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
dynamic_linker='Win32 ld.exe'
;;
esac
# FIXME: first we should search . and the directory the executable is in
shlibpath_var=PATH
;;
darwin* | rhapsody*)
dynamic_linker="$host_os dyld"
version_type=darwin
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
soname_spec='${libname}${release}${major}$shared_ext'
shlibpath_overrides_runpath=yes
shlibpath_var=DYLD_LIBRARY_PATH
shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
m4_if([$1], [],[
sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
;;
dgux*)
version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
;;
freebsd1*)
dynamic_linker=no
;;
freebsd* | dragonfly*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
if test -x /usr/bin/objformat; then
objformat=`/usr/bin/objformat`
else
case $host_os in
freebsd[[123]]*) objformat=aout ;;
*) objformat=elf ;;
esac
fi
version_type=freebsd-$objformat
case $version_type in
freebsd-elf*)
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
need_version=no
need_lib_prefix=no
;;
freebsd-*)
library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
need_version=yes
;;
esac
shlibpath_var=LD_LIBRARY_PATH
case $host_os in
freebsd2*)
shlibpath_overrides_runpath=yes
;;
freebsd3.[[01]]* | freebsdelf3.[[01]]*)
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
;;
freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
*) # from 4.6 on, and DragonFly
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
;;
esac
;;
gnu*)
version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
hardcode_into_libs=yes
;;
haiku*)
version_type=linux
need_lib_prefix=no
need_version=no
dynamic_linker="$host_os runtime_loader"
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LIBRARY_PATH
shlibpath_overrides_runpath=yes
sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
hardcode_into_libs=yes
;;
hpux9* | hpux10* | hpux11*)
# Give a soname corresponding to the major version so that dld.sl refuses to
# link against other versions.
version_type=sunos
need_lib_prefix=no
need_version=no
case $host_cpu in
ia64*)
shrext_cmds='.so'
hardcode_into_libs=yes
dynamic_linker="$host_os dld.so"
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
if test "X$HPUX_IA64_MODE" = X32; then
sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
else
sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
fi
sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
;;
hppa*64*)
shrext_cmds='.sl'
hardcode_into_libs=yes
dynamic_linker="$host_os dld.sl"
shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
;;
*)
shrext_cmds='.sl'
dynamic_linker="$host_os dld.sl"
shlibpath_var=SHLIB_PATH
shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
;;
esac
# HP-UX runs *really* slowly unless shared libraries are mode 555, ...
postinstall_cmds='chmod 555 $lib'
# or fails outright, so override atomically:
install_override_mode=555
;;
interix[[3-9]]*)
version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
irix5* | irix6* | nonstopux*)
case $host_os in
nonstopux*) version_type=nonstopux ;;
*)
if test "$lt_cv_prog_gnu_ld" = yes; then
version_type=linux
else
version_type=irix
fi ;;
esac
need_lib_prefix=no
need_version=no
soname_spec='${libname}${release}${shared_ext}$major'
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
case $host_os in
irix5* | nonstopux*)
libsuff= shlibsuff=
;;
*)
case $LD in # libtool.m4 will add one of these switches to LD
*-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
libsuff= shlibsuff= libmagic=32-bit;;
*-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
libsuff=32 shlibsuff=N32 libmagic=N32;;
*-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
libsuff=64 shlibsuff=64 libmagic=64-bit;;
*) libsuff= shlibsuff= libmagic=never-match;;
esac
;;
esac
shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
shlibpath_overrides_runpath=no
sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
hardcode_into_libs=yes
;;
# No shared lib support for Linux oldld, aout, or coff.
linux*oldld* | linux*aout* | linux*coff*)
dynamic_linker=no
;;
# This must be Linux ELF.
linux* | k*bsd*-gnu | kopensolaris*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
# Some binutils ld are patched to set DT_RUNPATH
AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
[lt_cv_shlibpath_overrides_runpath=no
save_LDFLAGS=$LDFLAGS
save_libdir=$libdir
eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
[AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
[lt_cv_shlibpath_overrides_runpath=yes])])
LDFLAGS=$save_LDFLAGS
libdir=$save_libdir
])
shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
# This implies no fast_install, which is unacceptable.
# Some rework will be needed to allow for fast_install
# before this can be enabled.
hardcode_into_libs=yes
# Add ABI-specific directories to the system library path.
sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
fi
# We used to test for /lib/ld.so.1 and disable shared libraries on
# powerpc, because MkLinux only supported shared libraries with the
# GNU dynamic linker. Since this was broken with cross compilers,
# most powerpc-linux boxes support dynamic linking these days and
# people can always --disable-shared, the test was removed, and we
# assume the GNU/Linux dynamic linker is in use.
dynamic_linker='GNU/Linux ld.so'
;;
netbsd*)
version_type=sunos
need_lib_prefix=no
need_version=no
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
dynamic_linker='NetBSD (a.out) ld.so'
else
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
dynamic_linker='NetBSD ld.elf_so'
fi
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
;;
newsos6)
version_type=linux
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
;;
*nto* | *qnx*)
version_type=qnx
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
dynamic_linker='ldqnx.so'
;;
openbsd*)
version_type=sunos
sys_lib_dlsearch_path_spec="/usr/lib"
need_lib_prefix=no
# Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
case $host_os in
openbsd3.3 | openbsd3.3.*) need_version=yes ;;
*) need_version=no ;;
esac
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
shlibpath_var=LD_LIBRARY_PATH
if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
case $host_os in
openbsd2.[[89]] | openbsd2.[[89]].*)
shlibpath_overrides_runpath=no
;;
*)
shlibpath_overrides_runpath=yes
;;
esac
else
shlibpath_overrides_runpath=yes
fi
;;
os2*)
libname_spec='$name'
shrext_cmds=".dll"
need_lib_prefix=no
library_names_spec='$libname${shared_ext} $libname.a'
dynamic_linker='OS/2 ld.exe'
shlibpath_var=LIBPATH
;;
osf3* | osf4* | osf5*)
version_type=osf
need_lib_prefix=no
need_version=no
soname_spec='${libname}${release}${shared_ext}$major'
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
shlibpath_var=LD_LIBRARY_PATH
sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
;;
rdos*)
dynamic_linker=no
;;
solaris*)
version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
# ldd complains unless libraries are executable
postinstall_cmds='chmod +x $lib'
;;
sunos4*)
version_type=sunos
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
if test "$with_gnu_ld" = yes; then
need_lib_prefix=no
fi
need_version=yes
;;
sysv4 | sysv4.3*)
version_type=linux
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
case $host_vendor in
sni)
shlibpath_overrides_runpath=no
need_lib_prefix=no
runpath_var=LD_RUN_PATH
;;
siemens)
need_lib_prefix=no
;;
motorola)
need_lib_prefix=no
need_version=no
shlibpath_overrides_runpath=no
sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
;;
esac
;;
sysv4*MP*)
if test -d /usr/nec ;then
version_type=linux
library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
soname_spec='$libname${shared_ext}.$major'
shlibpath_var=LD_LIBRARY_PATH
fi
;;
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
version_type=freebsd-elf
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
if test "$with_gnu_ld" = yes; then
sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
else
sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
case $host_os in
sco3.2v5*)
sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
;;
esac
fi
sys_lib_dlsearch_path_spec='/usr/lib'
;;
tpf*)
# TPF is a cross-target only. Preferred cross-host = GNU/Linux.
version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
uts4*)
version_type=linux
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
;;
*)
dynamic_linker=no
;;
esac
AC_MSG_RESULT([$dynamic_linker])
test "$dynamic_linker" = no && can_build_shared=no
variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
if test "$GCC" = yes; then
variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
fi
if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
fi
if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
fi
_LT_DECL([], [variables_saved_for_relink], [1],
[Variables whose values should be saved in libtool wrapper scripts and
restored at link time])
_LT_DECL([], [need_lib_prefix], [0],
[Do we need the "lib" prefix for modules?])
_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
_LT_DECL([], [version_type], [0], [Library versioning type])
_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])
_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
_LT_DECL([], [shlibpath_overrides_runpath], [0],
[Is shlibpath searched before the hard-coded library search path?])
_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
_LT_DECL([], [library_names_spec], [1],
[[List of archive names. First name is the real one, the rest are links.
The last name is the one that the linker finds with -lNAME]])
_LT_DECL([], [soname_spec], [1],
[[The coded name of the library, if different from the real name]])
_LT_DECL([], [install_override_mode], [1],
[Permission mode override for installation of shared libraries])
_LT_DECL([], [postinstall_cmds], [2],
[Command to use after installation of a shared archive])
_LT_DECL([], [postuninstall_cmds], [2],
[Command to use after uninstallation of a shared archive])
_LT_DECL([], [finish_cmds], [2],
[Commands used to finish a libtool library installation in a directory])
_LT_DECL([], [finish_eval], [1],
[[As "finish_cmds", except a single script fragment to be evaled but
not shown]])
_LT_DECL([], [hardcode_into_libs], [0],
[Whether we should hardcode library paths into libraries])
_LT_DECL([], [sys_lib_search_path_spec], [2],
[Compile-time system search path for libraries])
_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
[Run-time system search path for libraries])
])# _LT_SYS_DYNAMIC_LINKER
# _LT_PATH_TOOL_PREFIX(TOOL)
# --------------------------
# find a file program which can recognize shared library
AC_DEFUN([_LT_PATH_TOOL_PREFIX],
[m4_require([_LT_DECL_EGREP])dnl
AC_MSG_CHECKING([for $1])
AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
[case $MAGIC_CMD in
[[\\/*] | ?:[\\/]*])
lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
;;
*)
lt_save_MAGIC_CMD="$MAGIC_CMD"
lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
dnl $ac_dummy forces splitting on constant user-supplied paths.
dnl POSIX.2 word splitting is done only on the output of word expansions,
dnl not every word. This closes a longstanding sh security hole.
ac_dummy="m4_if([$2], , $PATH, [$2])"
for ac_dir in $ac_dummy; do
IFS="$lt_save_ifs"
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$1; then
lt_cv_path_MAGIC_CMD="$ac_dir/$1"
if test -n "$file_magic_test_file"; then
case $deplibs_check_method in
"file_magic "*)
file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
$EGREP "$file_magic_regex" > /dev/null; then
:
else
cat <<_LT_EOF 1>&2
*** Warning: the command libtool uses to detect shared libraries,
*** $file_magic_cmd, produces output that libtool cannot recognize.
*** The result is that libtool may fail to recognize shared libraries
*** as such. This will affect the creation of libtool libraries that
*** depend on shared libraries, but programs linked with such libtool
*** libraries will work regardless of this problem. Nevertheless, you
*** may want to report the problem to your system manager and/or to
*** bug-libtool@gnu.org
_LT_EOF
fi ;;
esac
fi
break
fi
done
IFS="$lt_save_ifs"
MAGIC_CMD="$lt_save_MAGIC_CMD"
;;
esac])
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
if test -n "$MAGIC_CMD"; then
AC_MSG_RESULT($MAGIC_CMD)
else
AC_MSG_RESULT(no)
fi
_LT_DECL([], [MAGIC_CMD], [0],
[Used to examine libraries when file_magic_cmd begins with "file"])dnl
])# _LT_PATH_TOOL_PREFIX
# Old name:
AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
# _LT_PATH_MAGIC
# --------------
# find a file program which can recognize a shared library
m4_defun([_LT_PATH_MAGIC],
[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
if test -z "$lt_cv_path_MAGIC_CMD"; then
if test -n "$ac_tool_prefix"; then
_LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
else
MAGIC_CMD=:
fi
fi
])# _LT_PATH_MAGIC
# LT_PATH_LD
# ----------
# find the pathname to the GNU or non-GNU linker
AC_DEFUN([LT_PATH_LD],
[AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
m4_require([_LT_DECL_SED])dnl
m4_require([_LT_DECL_EGREP])dnl
m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
AC_ARG_WITH([gnu-ld],
[AS_HELP_STRING([--with-gnu-ld],
[assume the C compiler uses GNU ld @<:@default=no@:>@])],
[test "$withval" = no || with_gnu_ld=yes],
[with_gnu_ld=no])dnl
ac_prog=ld
if test "$GCC" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
AC_MSG_CHECKING([for ld used by $CC])
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
*)
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
esac
case $ac_prog in
# Accept absolute paths.
[[\\/]]* | ?:[[\\/]]*)
re_direlt='/[[^/]][[^/]]*/\.\./'
# Canonicalize the pathname of ld
ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
done
test -z "$LD" && LD="$ac_prog"
;;
"")
# If it fails, then pretend we aren't using GCC.
ac_prog=ld
;;
*)
# If it is relative, then search for the first ld in PATH.
with_gnu_ld=unknown
;;
esac
elif test "$with_gnu_ld" = yes; then
AC_MSG_CHECKING([for GNU ld])
else
AC_MSG_CHECKING([for non-GNU ld])
fi
AC_CACHE_VAL(lt_cv_path_LD,
[if test -z "$LD"; then
lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
for ac_dir in $PATH; do
IFS="$lt_save_ifs"
test -z "$ac_dir" && ac_dir=.
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
lt_cv_path_LD="$ac_dir/$ac_prog"
# Check to see if the program is GNU ld. I'd rather use --version,
# but apparently some variants of GNU ld only accept -v.
# Break only if it was the GNU/non-GNU ld that we prefer.
case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then
lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
lt_cv_file_magic_cmd='func_win32_libid'
else
# Keep this pattern in sync with the one in func_win32_libid.
lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
lt_cv_file_magic_cmd='$OBJDUMP -f'
fi
;;
cegcc*)
# use the weaker test based on 'objdump'. See mingw*.
lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
lt_cv_file_magic_cmd='$OBJDUMP -f'
;;
darwin* | rhapsody*)
lt_cv_deplibs_check_method=pass_all
;;
freebsd* | dragonfly*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
case $host_cpu in
i*86 )
# Not sure whether the presence of OpenBSD here was a mistake.
# Let's accept both of them until this is cleared up.
lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
lt_cv_file_magic_cmd=/usr/bin/file
lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
;;
esac
else
lt_cv_deplibs_check_method=pass_all
fi
;;
gnu*)
lt_cv_deplibs_check_method=pass_all
;;
haiku*)
lt_cv_deplibs_check_method=pass_all
;;
hpux10.20* | hpux11*)
lt_cv_file_magic_cmd=/usr/bin/file
case $host_cpu in
ia64*)
lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
;;
hppa*64*)
[lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
;;
*)
lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
lt_cv_file_magic_test_file=/usr/lib/libc.sl
;;
esac
;;
interix[[3-9]]*)
# PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
;;
irix5* | irix6* | nonstopux*)
case $LD in
*-32|*"-32 ") libmagic=32-bit;;
*-n32|*"-n32 ") libmagic=N32;;
*-64|*"-64 ") libmagic=64-bit;;
*) libmagic=never-match;;
esac
lt_cv_deplibs_check_method=pass_all
;;
# This must be Linux ELF.
linux* | k*bsd*-gnu | kopensolaris*-gnu)
lt_cv_deplibs_check_method=pass_all
;;
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
else
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
fi
;;
newos6*)
lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
lt_cv_file_magic_cmd=/usr/bin/file
lt_cv_file_magic_test_file=/usr/lib/libnls.so
;;
*nto* | *qnx*)
lt_cv_deplibs_check_method=pass_all
;;
openbsd*)
if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
else
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
fi
;;
osf3* | osf4* | osf5*)
lt_cv_deplibs_check_method=pass_all
;;
rdos*)
lt_cv_deplibs_check_method=pass_all
;;
solaris*)
lt_cv_deplibs_check_method=pass_all
;;
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
lt_cv_deplibs_check_method=pass_all
;;
sysv4 | sysv4.3*)
case $host_vendor in
motorola)
lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
;;
ncr)
lt_cv_deplibs_check_method=pass_all
;;
sequent)
lt_cv_file_magic_cmd='/bin/file'
lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
;;
sni)
lt_cv_file_magic_cmd='/bin/file'
lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
lt_cv_file_magic_test_file=/lib/libc.so
;;
siemens)
lt_cv_deplibs_check_method=pass_all
;;
pc)
lt_cv_deplibs_check_method=pass_all
;;
esac
;;
tpf*)
lt_cv_deplibs_check_method=pass_all
;;
esac
])
file_magic_glob=
want_nocaseglob=no
if test "$build" = "$host"; then
case $host_os in
mingw* | pw32*)
if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
want_nocaseglob=yes
else
file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
fi
;;
esac
fi
file_magic_cmd=$lt_cv_file_magic_cmd
deplibs_check_method=$lt_cv_deplibs_check_method
test -z "$deplibs_check_method" && deplibs_check_method=unknown
_LT_DECL([], [deplibs_check_method], [1],
[Method to check whether dependent libraries are shared objects])
_LT_DECL([], [file_magic_cmd], [1],
[Command to use when deplibs_check_method = "file_magic"])
_LT_DECL([], [file_magic_glob], [1],
[How to find potential files when deplibs_check_method = "file_magic"])
_LT_DECL([], [want_nocaseglob], [1],
[Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
])# _LT_CHECK_MAGIC_METHOD
# LT_PATH_NM
# ----------
# find the pathname to a BSD- or MS-compatible name lister
AC_DEFUN([LT_PATH_NM],
[AC_REQUIRE([AC_PROG_CC])dnl
AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
[if test -n "$NM"; then
# Let the user override the test.
lt_cv_path_NM="$NM"
else
lt_nm_to_check="${ac_tool_prefix}nm"
if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
lt_nm_to_check="$lt_nm_to_check nm"
fi
for lt_tmp_nm in $lt_nm_to_check; do
lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
IFS="$lt_save_ifs"
test -z "$ac_dir" && ac_dir=.
tmp_nm="$ac_dir/$lt_tmp_nm"
if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
# Check to see if the nm accepts a BSD-compat flag.
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
# nm: unknown option "B" ignored
# Tru64's nm complains that /dev/null is an invalid object file
case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
*/dev/null* | *'Invalid file or object type'*)
lt_cv_path_NM="$tmp_nm -B"
break
;;
*)
case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
*/dev/null*)
lt_cv_path_NM="$tmp_nm -p"
break
;;
*)
lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
continue # so that we can try to find one that supports BSD flags
;;
esac
;;
esac
fi
done
IFS="$lt_save_ifs"
done
: ${lt_cv_path_NM=no}
fi])
if test "$lt_cv_path_NM" != "no"; then
NM="$lt_cv_path_NM"
else
# Didn't find any BSD compatible name lister, look for dumpbin.
if test -n "$DUMPBIN"; then :
# Let the user override the test.
else
AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
*COFF*)
DUMPBIN="$DUMPBIN -symbols"
;;
*)
DUMPBIN=:
;;
esac
fi
AC_SUBST([DUMPBIN])
if test "$DUMPBIN" != ":"; then
NM="$DUMPBIN"
fi
fi
test -z "$NM" && NM=nm
AC_SUBST([NM])
_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
[lt_cv_nm_interface="BSD nm"
echo "int some_variable = 0;" > conftest.$ac_ext
(eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
(eval "$ac_compile" 2>conftest.err)
cat conftest.err >&AS_MESSAGE_LOG_FD
(eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
cat conftest.err >&AS_MESSAGE_LOG_FD
(eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
cat conftest.out >&AS_MESSAGE_LOG_FD
if $GREP 'External.*some_variable' conftest.out > /dev/null; then
lt_cv_nm_interface="MS dumpbin"
fi
rm -f conftest*])
])# LT_PATH_NM
# Old names:
AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AM_PROG_NM], [])
dnl AC_DEFUN([AC_PROG_NM], [])
# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
# --------------------------------
# how to determine the name of the shared library
# associated with a specific link library.
# -- PORTME fill in with the dynamic library characteristics
m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
[m4_require([_LT_DECL_EGREP])
m4_require([_LT_DECL_OBJDUMP])
m4_require([_LT_DECL_DLLTOOL])
AC_CACHE_CHECK([how to associate runtime and link libraries],
lt_cv_sharedlib_from_linklib_cmd,
[lt_cv_sharedlib_from_linklib_cmd='unknown'
case $host_os in
cygwin* | mingw* | pw32* | cegcc*)
# two different shell functions defined in ltmain.sh
# decide which to use based on capabilities of $DLLTOOL
case `$DLLTOOL --help 2>&1` in
*--identify-strict*)
lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
;;
*)
lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
;;
esac
;;
*)
# fallback: assume linklib IS sharedlib
lt_cv_sharedlib_from_linklib_cmd="$ECHO"
;;
esac
])
sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
[Command to associate shared and link libraries])
])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
# _LT_PATH_MANIFEST_TOOL
# ----------------------
# locate the manifest tool
m4_defun([_LT_PATH_MANIFEST_TOOL],
[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
[lt_cv_path_mainfest_tool=no
echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
$MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
cat conftest.err >&AS_MESSAGE_LOG_FD
if $GREP 'Manifest Tool' conftest.out > /dev/null; then
lt_cv_path_mainfest_tool=yes
fi
rm -f conftest*])
if test "x$lt_cv_path_mainfest_tool" != xyes; then
MANIFEST_TOOL=:
fi
_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
])# _LT_PATH_MANIFEST_TOOL
# LT_LIB_M
# --------
# check for math library
AC_DEFUN([LT_LIB_M],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
LIBM=
case $host in
*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
# These system don't have libm, or don't need it
;;
*-ncr-sysv4.3*)
AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
;;
*)
AC_CHECK_LIB(m, cos, LIBM="-lm")
;;
esac
AC_SUBST([LIBM])
])# LT_LIB_M
# Old name:
AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_CHECK_LIBM], [])
# _LT_COMPILER_NO_RTTI([TAGNAME])
# -------------------------------
m4_defun([_LT_COMPILER_NO_RTTI],
[m4_require([_LT_TAG_COMPILER])dnl
_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
if test "$GCC" = yes; then
case $cc_basename in
nvcc*)
_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
*)
_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
esac
_LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
lt_cv_prog_compiler_rtti_exceptions,
[-fno-rtti -fno-exceptions], [],
[_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
fi
_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
[Compiler flag to turn off builtin functions])
])# _LT_COMPILER_NO_RTTI
# _LT_CMD_GLOBAL_SYMBOLS
# ----------------------
m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([LT_PATH_NM])dnl
AC_REQUIRE([LT_PATH_LD])dnl
m4_require([_LT_DECL_SED])dnl
m4_require([_LT_DECL_EGREP])dnl
m4_require([_LT_TAG_COMPILER])dnl
# Check for command to grab the raw symbol name followed by C symbol from nm.
AC_MSG_CHECKING([command to parse $NM output from $compiler object])
AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
[
# These are sane defaults that work on at least a few old systems.
# [They come from Ultrix. What could be older than Ultrix?!! ;)]
# Character class describing NM global symbol codes.
symcode='[[BCDEGRST]]'
# Regexp to match symbols that can be accessed directly from C.
sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
# Define system-specific variables.
case $host_os in
aix*)
symcode='[[BCDT]]'
;;
cygwin* | mingw* | pw32* | cegcc*)
symcode='[[ABCDGISTW]]'
;;
hpux*)
if test "$host_cpu" = ia64; then
symcode='[[ABCDEGRST]]'
fi
;;
irix* | nonstopux*)
symcode='[[BCDEGRST]]'
;;
osf*)
symcode='[[BCDEGQRST]]'
;;
solaris*)
symcode='[[BDRT]]'
;;
sco3.2v5*)
symcode='[[DT]]'
;;
sysv4.2uw2*)
symcode='[[DT]]'
;;
sysv5* | sco5v6* | unixware* | OpenUNIX*)
symcode='[[ABDT]]'
;;
sysv4)
symcode='[[DFNSTU]]'
;;
esac
# If we're using GNU nm, then use its standard symbol codes.
case `$NM -V 2>&1` in
*GNU* | *'with BFD'*)
symcode='[[ABCDGIRSTW]]' ;;
esac
# Transform an extracted symbol line into a proper C declaration.
# Some systems (esp. on ia64) link data and code symbols differently,
# so use this general approach.
lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
# Transform an extracted symbol line into symbol name and symbol address
lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
# Handle CRLF in mingw tool chain
opt_cr=
case $build_os in
mingw*)
opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
;;
esac
# Try without a prefix underscore, then with it.
for ac_symprfx in "" "_"; do
# Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
symxfrm="\\1 $ac_symprfx\\2 \\2"
# Write the raw and C identifiers.
if test "$lt_cv_nm_interface" = "MS dumpbin"; then
# Fake it for dumpbin and say T for any non-static function
# and D for any global variable.
# Also find C++ and __fastcall symbols from MSVC++,
# which start with @ or ?.
lt_cv_sys_global_symbol_pipe="$AWK ['"\
" {last_section=section; section=\$ 3};"\
" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
" \$ 0!~/External *\|/{next};"\
" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
" {if(hide[section]) next};"\
" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
" s[1]~/^[@?]/{print s[1], s[1]; next};"\
" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
" ' prfx=^$ac_symprfx]"
else
lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
fi
lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
# Check to see that the pipe works correctly.
pipe_works=no
rm -f conftest*
cat > conftest.$ac_ext <<_LT_EOF
#ifdef __cplusplus
extern "C" {
#endif
char nm_test_var;
void nm_test_func(void);
void nm_test_func(void){}
#ifdef __cplusplus
}
#endif
int main(){nm_test_var='a';nm_test_func();return(0);}
_LT_EOF
if AC_TRY_EVAL(ac_compile); then
# Now try to grab the symbols.
nlist=conftest.nm
if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
# Try sorting and uniquifying the output.
if sort "$nlist" | uniq > "$nlist"T; then
mv -f "$nlist"T "$nlist"
else
rm -f "$nlist"T
fi
# Make sure that we snagged all the symbols we need.
if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
cat <<_LT_EOF > conftest.$ac_ext
/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
/* DATA imports from DLLs on WIN32 con't be const, because runtime
relocations are performed -- see ld's documentation on pseudo-relocs. */
# define LT@&t@_DLSYM_CONST
#elif defined(__osf__)
/* This system does not cope well with relocations in const data. */
# define LT@&t@_DLSYM_CONST
#else
# define LT@&t@_DLSYM_CONST const
#endif
#ifdef __cplusplus
extern "C" {
#endif
_LT_EOF
# Now generate the symbol file.
eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
cat <<_LT_EOF >> conftest.$ac_ext
/* The mapping between symbol names and symbols. */
LT@&t@_DLSYM_CONST struct {
const char *name;
void *address;
}
lt__PROGRAM__LTX_preloaded_symbols[[]] =
{
{ "@PROGRAM@", (void *) 0 },
_LT_EOF
$SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
cat <<\_LT_EOF >> conftest.$ac_ext
{0, (void *) 0}
};
/* This works around a problem in FreeBSD linker */
#ifdef FREEBSD_WORKAROUND
static const void *lt_preloaded_setup() {
return lt__PROGRAM__LTX_preloaded_symbols;
}
#endif
#ifdef __cplusplus
}
#endif
_LT_EOF
# Now try linking the two files.
mv conftest.$ac_objext conftstm.$ac_objext
lt_globsym_save_LIBS=$LIBS
lt_globsym_save_CFLAGS=$CFLAGS
LIBS="conftstm.$ac_objext"
CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
pipe_works=yes
fi
LIBS=$lt_globsym_save_LIBS
CFLAGS=$lt_globsym_save_CFLAGS
else
echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
fi
else
echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
fi
else
echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
fi
else
echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
cat conftest.$ac_ext >&5
fi
rm -rf conftest* conftst*
# Do not use the global_symbol_pipe unless it works.
if test "$pipe_works" = yes; then
break
else
lt_cv_sys_global_symbol_pipe=
fi
done
])
if test -z "$lt_cv_sys_global_symbol_pipe"; then
lt_cv_sys_global_symbol_to_cdecl=
fi
if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
AC_MSG_RESULT(failed)
else
AC_MSG_RESULT(ok)
fi
# Response file support.
if test "$lt_cv_nm_interface" = "MS dumpbin"; then
nm_file_list_spec='@'
elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
nm_file_list_spec='@'
fi
_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
[Take the output of nm and produce a listing of raw symbols and C names])
_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
[Transform the output of nm in a proper C declaration])
_LT_DECL([global_symbol_to_c_name_address],
[lt_cv_sys_global_symbol_to_c_name_address], [1],
[Transform the output of nm in a C name address pair])
_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
[lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
[Transform the output of nm in a C name address pair when lib prefix is needed])
_LT_DECL([], [nm_file_list_spec], [1],
[Specify filename containing input files for $NM])
]) # _LT_CMD_GLOBAL_SYMBOLS
# _LT_COMPILER_PIC([TAGNAME])
# ---------------------------
m4_defun([_LT_COMPILER_PIC],
[m4_require([_LT_TAG_COMPILER])dnl
_LT_TAGVAR(lt_prog_compiler_wl, $1)=
_LT_TAGVAR(lt_prog_compiler_pic, $1)=
_LT_TAGVAR(lt_prog_compiler_static, $1)=
m4_if([$1], [CXX], [
# C++ specific cases for pic, static, wl, etc.
if test "$GXX" = yes; then
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
case $host_os in
aix*)
# All AIX code is PIC.
if test "$host_cpu" = ia64; then
# AIX 5 now supports IA64 processor
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
fi
;;
amigaos*)
case $host_cpu in
powerpc)
# see comment about AmigaOS4 .so support
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
;;
m68k)
# FIXME: we need at least 68020 code to build shared libraries, but
# adding the `-m68020' flag to GCC prevents building anything better,
# like `-m68040'.
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
;;
esac
;;
beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
mingw* | cygwin* | os2* | pw32* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
# Although the cygwin gcc ignores -fPIC, still need this for old-style
# (--disable-auto-import) libraries
m4_if([$1], [GCJ], [],
[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
;;
darwin* | rhapsody*)
# PIC is the default on this platform
# Common symbols not allowed in MH_DYLIB files
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
;;
*djgpp*)
# DJGPP does not support shared libraries at all
_LT_TAGVAR(lt_prog_compiler_pic, $1)=
;;
haiku*)
# PIC is the default for Haiku.
# The "-static" flag exists, but is broken.
_LT_TAGVAR(lt_prog_compiler_static, $1)=
;;
interix[[3-9]]*)
# Interix 3.x gcc -fpic/-fPIC options generate broken code.
# Instead, we relocate shared libraries at runtime.
;;
sysv4*MP*)
if test -d /usr/nec; then
_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
fi
;;
hpux*)
# PIC is the default for 64-bit PA HP-UX, but not for 32-bit
# PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
# sets the default TLS model and affects inlining.
case $host_cpu in
hppa*64*)
;;
*)
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
;;
esac
;;
*qnx* | *nto*)
# QNX uses GNU C++, but need to define -shared option too, otherwise
# it will coredump.
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
;;
*)
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
;;
esac
else
case $host_os in
aix[[4-9]]*)
# All AIX code is PIC.
if test "$host_cpu" = ia64; then
# AIX 5 now supports IA64 processor
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
else
_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
fi
;;
chorus*)
case $cc_basename in
cxch68*)
# Green Hills C++ Compiler
# _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
;;
esac
;;
mingw* | cygwin* | os2* | pw32* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
m4_if([$1], [GCJ], [],
[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
;;
dgux*)
case $cc_basename in
ec++*)
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
;;
ghcx*)
# Green Hills C++ Compiler
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
;;
*)
;;
esac
;;
freebsd* | dragonfly*)
# FreeBSD uses GNU C++
;;
hpux9* | hpux10* | hpux11*)
case $cc_basename in
CC*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
if test "$host_cpu" != ia64; then
_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
fi
;;
aCC*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
case $host_cpu in
hppa*64*|ia64*)
# +Z the default
;;
*)
_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
;;
esac
;;
*)
;;
esac
;;
interix*)
# This is c89, which is MS Visual C++ (no shared libs)
# Anyone wants to do a port?
;;
irix5* | irix6* | nonstopux*)
case $cc_basename in
CC*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
# CC pic flag -KPIC is the default.
;;
*)
;;
esac
;;
linux* | k*bsd*-gnu | kopensolaris*-gnu)
case $cc_basename in
KCC*)
# KAI C++ Compiler
_LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
;;
ecpc* )
# old Intel C++ for x86_64 which still supported -KPIC.
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
;;
icpc* )
# Intel C++, used to be incompatible with GCC.
# ICC 10 doesn't accept -KPIC any more.
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
;;
pgCC* | pgcpp*)
# Portland Group C++ compiler
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;;
cxx*)
# Compaq C++
# Make sure the PIC flag is empty. It appears that all Alpha
# Linux and Compaq Tru64 Unix objects are PIC.
_LT_TAGVAR(lt_prog_compiler_pic, $1)=
_LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
# IBM XL 8.0, 9.0 on PPC and BlueGene
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
;;
*)
case `$CC -V 2>&1 | sed 5q` in
*Sun\ C*)
# Sun C++ 5.9
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
;;
esac
;;
esac
;;
lynxos*)
;;
m88k*)
;;
mvs*)
case $cc_basename in
cxx*)
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
;;
*)
;;
esac
;;
netbsd*)
;;
*qnx* | *nto*)
# QNX uses GNU C++, but need to define -shared option too, otherwise
# it will coredump.
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
;;
osf3* | osf4* | osf5*)
case $cc_basename in
KCC*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
;;
RCC*)
# Rational C++ 2.4.1
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
;;
cxx*)
# Digital/Compaq C++
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
# Make sure the PIC flag is empty. It appears that all Alpha
# Linux and Compaq Tru64 Unix objects are PIC.
_LT_TAGVAR(lt_prog_compiler_pic, $1)=
_LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
*)
;;
esac
;;
psos*)
;;
solaris*)
case $cc_basename in
CC* | sunCC*)
# Sun C++ 4.2, 5.x and Centerline C++
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
;;
gcx*)
# Green Hills C++ Compiler
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
;;
*)
;;
esac
;;
sunos4*)
case $cc_basename in
CC*)
# Sun C++ 4.x
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;;
lcc*)
# Lucid
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
;;
*)
;;
esac
;;
sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
case $cc_basename in
CC*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;;
esac
;;
tandem*)
case $cc_basename in
NCC*)
# NonStop-UX NCC 3.20
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
;;
*)
;;
esac
;;
vxworks*)
;;
*)
_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
;;
esac
fi
],
[
if test "$GCC" = yes; then
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
case $host_os in
aix*)
# All AIX code is PIC.
if test "$host_cpu" = ia64; then
# AIX 5 now supports IA64 processor
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
fi
;;
amigaos*)
case $host_cpu in
powerpc)
# see comment about AmigaOS4 .so support
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
;;
m68k)
# FIXME: we need at least 68020 code to build shared libraries, but
# adding the `-m68020' flag to GCC prevents building anything better,
# like `-m68040'.
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
;;
esac
;;
beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
mingw* | cygwin* | pw32* | os2* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
# Although the cygwin gcc ignores -fPIC, still need this for old-style
# (--disable-auto-import) libraries
m4_if([$1], [GCJ], [],
[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
;;
darwin* | rhapsody*)
# PIC is the default on this platform
# Common symbols not allowed in MH_DYLIB files
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
;;
haiku*)
# PIC is the default for Haiku.
# The "-static" flag exists, but is broken.
_LT_TAGVAR(lt_prog_compiler_static, $1)=
;;
hpux*)
# PIC is the default for 64-bit PA HP-UX, but not for 32-bit
# PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
# sets the default TLS model and affects inlining.
case $host_cpu in
hppa*64*)
# +Z the default
;;
*)
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
;;
esac
;;
interix[[3-9]]*)
# Interix 3.x gcc -fpic/-fPIC options generate broken code.
# Instead, we relocate shared libraries at runtime.
;;
msdosdjgpp*)
# Just because we use GCC doesn't mean we suddenly get shared libraries
# on systems that don't support them.
_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
enable_shared=no
;;
*nto* | *qnx*)
# QNX uses GNU C++, but need to define -shared option too, otherwise
# it will coredump.
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
;;
sysv4*MP*)
if test -d /usr/nec; then
_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
fi
;;
*)
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
;;
esac
case $cc_basename in
nvcc*) # Cuda Compiler Driver 2.2
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC'
;;
esac
else
# PORTME Check for flag to pass linker flags through the system compiler.
case $host_os in
aix*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
if test "$host_cpu" = ia64; then
# AIX 5 now supports IA64 processor
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
else
_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
fi
;;
mingw* | cygwin* | pw32* | os2* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
m4_if([$1], [GCJ], [],
[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
;;
hpux9* | hpux10* | hpux11*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
# PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
# not for PA HP-UX.
case $host_cpu in
hppa*64*|ia64*)
# +Z the default
;;
*)
_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
;;
esac
# Is there a better lt_prog_compiler_static that works with the bundled CC?
_LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
;;
irix5* | irix6* | nonstopux*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
# PIC (with -KPIC) is the default.
_LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
linux* | k*bsd*-gnu | kopensolaris*-gnu)
case $cc_basename in
# old Intel for x86_64 which still supported -KPIC.
ecc*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
;;
# icc used to be incompatible with GCC.
# ICC 10 doesn't accept -KPIC any more.
icc* | ifort*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
;;
# Lahey Fortran 8.1.
lf95*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
;;
nagfor*)
# NAG Fortran compiler
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;;
pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
# Portland Group compilers (*not* the Pentium gcc compiler,
# which looks to be a dead project)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;;
ccc*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
# All Alpha code is PIC.
_LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
xl* | bgxl* | bgf* | mpixl*)
# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
;;
*)
case `$CC -V 2>&1 | sed 5q` in
*Sun\ F* | *Sun*Fortran*)
# Sun Fortran 8.3 passes all unrecognized flags to the linker
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
_LT_TAGVAR(lt_prog_compiler_wl, $1)=''
;;
*Sun\ C*)
# Sun C 5.9
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
;;
esac
;;
esac
;;
newsos6)
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;;
*nto* | *qnx*)
# QNX uses GNU C++, but need to define -shared option too, otherwise
# it will coredump.
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
;;
osf3* | osf4* | osf5*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
# All OSF/1 code is PIC.
_LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
rdos*)
_LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
solaris*)
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
case $cc_basename in
f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
esac
;;
sunos4*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;;
sysv4 | sysv4.2uw2* | sysv4.3*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;;
sysv4*MP*)
if test -d /usr/nec ;then
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
fi
;;
sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;;
unicos*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
;;
uts4*)
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;;
*)
_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
;;
esac
fi
])
case $host_os in
# For platforms which do not support PIC, -DPIC is meaningless:
*djgpp*)
_LT_TAGVAR(lt_prog_compiler_pic, $1)=
;;
*)
_LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
;;
esac
AC_CACHE_CHECK([for $compiler option to produce PIC],
[_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
[_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
#
# Check to make sure the PIC flag actually works.
#
if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
_LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
[_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
[$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
[case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
"" | " "*) ;;
*) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
esac],
[_LT_TAGVAR(lt_prog_compiler_pic, $1)=
_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
fi
_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
[Additional compiler flags for building library objects])
_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
[How to pass a linker flag through the compiler])
#
# Check to make sure the static flag actually works.
#
wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
_LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
$lt_tmp_static_flag,
[],
[_LT_TAGVAR(lt_prog_compiler_static, $1)=])
_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
[Compiler flag to prevent dynamic linking])
])# _LT_COMPILER_PIC
# _LT_LINKER_SHLIBS([TAGNAME])
# ----------------------------
# See if the linker supports building shared libraries.
m4_defun([_LT_LINKER_SHLIBS],
[AC_REQUIRE([LT_PATH_LD])dnl
AC_REQUIRE([LT_PATH_NM])dnl
m4_require([_LT_PATH_MANIFEST_TOOL])dnl
m4_require([_LT_FILEUTILS_DEFAULTS])dnl
m4_require([_LT_DECL_EGREP])dnl
m4_require([_LT_DECL_SED])dnl
m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
m4_require([_LT_TAG_COMPILER])dnl
AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
m4_if([$1], [CXX], [
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
_LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
case $host_os in
aix[[4-9]]*)
# If we're using GNU nm, then we don't want the "-C" option.
# -C means demangle to AIX nm, but means don't demangle with GNU nm
# Also, AIX nm treats weak defined symbols like other global defined
# symbols, whereas GNU nm marks them as "W".
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
_LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
else
_LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
fi
;;
pw32*)
_LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
;;
cygwin* | mingw* | cegcc*)
case $cc_basename in
cl*) ;;
*)
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
_LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
;;
esac
;;
*)
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
;;
esac
], [
runpath_var=
_LT_TAGVAR(allow_undefined_flag, $1)=
_LT_TAGVAR(always_export_symbols, $1)=no
_LT_TAGVAR(archive_cmds, $1)=
_LT_TAGVAR(archive_expsym_cmds, $1)=
_LT_TAGVAR(compiler_needs_object, $1)=no
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
_LT_TAGVAR(export_dynamic_flag_spec, $1)=
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
_LT_TAGVAR(hardcode_automatic, $1)=no
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_direct_absolute, $1)=no
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
_LT_TAGVAR(hardcode_libdir_separator, $1)=
_LT_TAGVAR(hardcode_minus_L, $1)=no
_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
_LT_TAGVAR(inherit_rpath, $1)=no
_LT_TAGVAR(link_all_deplibs, $1)=unknown
_LT_TAGVAR(module_cmds, $1)=
_LT_TAGVAR(module_expsym_cmds, $1)=
_LT_TAGVAR(old_archive_from_new_cmds, $1)=
_LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
_LT_TAGVAR(thread_safe_flag_spec, $1)=
_LT_TAGVAR(whole_archive_flag_spec, $1)=
# include_expsyms should be a list of space-separated symbols to be *always*
# included in the symbol list
_LT_TAGVAR(include_expsyms, $1)=
# exclude_expsyms can be an extended regexp of symbols to exclude
# it will be wrapped by ` (' and `)$', so one must not match beginning or
# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
# as well as any symbol that contains `d'.
_LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
# platforms (ab)use it in PIC code, but their linkers get confused if
# the symbol is explicitly referenced. Since portable code cannot
# rely on this symbol name, it's probably fine to never include it in
# preloaded symbol tables.
# Exclude shared library initialization/finalization symbols.
dnl Note also adjust exclude_expsyms for C++ above.
extract_expsyms_cmds=
case $host_os in
cygwin* | mingw* | pw32* | cegcc*)
# FIXME: the MSVC++ port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
if test "$GCC" != yes; then
with_gnu_ld=no
fi
;;
interix*)
# we just hope/assume this is gcc and not c89 (= MSVC++)
with_gnu_ld=yes
;;
openbsd*)
with_gnu_ld=no
;;
esac
_LT_TAGVAR(ld_shlibs, $1)=yes
# On some targets, GNU ld is compatible enough with the native linker
# that we're better off using the native interface for both.
lt_use_gnu_ld_interface=no
if test "$with_gnu_ld" = yes; then
case $host_os in
aix*)
# The AIX port of GNU ld has always aspired to compatibility
# with the native linker. However, as the warning in the GNU ld
# block says, versions before 2.19.5* couldn't really create working
# shared libraries, regardless of the interface used.
case `$LD -v 2>&1` in
*\ \(GNU\ Binutils\)\ 2.19.5*) ;;
*\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
*\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
*)
lt_use_gnu_ld_interface=yes
;;
esac
;;
*)
lt_use_gnu_ld_interface=yes
;;
esac
fi
if test "$lt_use_gnu_ld_interface" = yes; then
# If archive_cmds runs LD, not CC, wlarc should be empty
wlarc='${wl}'
# Set some defaults for GNU ld with shared library support. These
# are reset later if shared libraries are not supported. Putting them
# here allows them to be overridden if necessary.
runpath_var=LD_RUN_PATH
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
# ancient GNU ld didn't support --whole-archive et. al.
if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
_LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
else
_LT_TAGVAR(whole_archive_flag_spec, $1)=
fi
supports_anon_versioning=no
case `$LD -v 2>&1` in
*GNU\ gold*) supports_anon_versioning=yes ;;
*\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
*\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
*\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
*\ 2.11.*) ;; # other 2.11 versions
*) supports_anon_versioning=yes ;;
esac
# See if GNU ld supports shared libraries.
case $host_os in
aix[[3-9]]*)
# On AIX/PPC, the GNU linker is very broken
if test "$host_cpu" != ia64; then
_LT_TAGVAR(ld_shlibs, $1)=no
cat <<_LT_EOF 1>&2
*** Warning: the GNU linker, at least up to release 2.19, is reported
*** to be unable to reliably create shared libraries on AIX.
*** Therefore, libtool is disabling shared libraries support. If you
*** really care for shared libraries, you may want to install binutils
*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
*** You will then need to restart the configuration process.
_LT_EOF
fi
;;
amigaos*)
case $host_cpu in
powerpc)
# see comment about AmigaOS4 .so support
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)=''
;;
m68k)
_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
_LT_TAGVAR(hardcode_minus_L, $1)=yes
;;
esac
;;
beos*)
if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
# Joseph Beckenbach says some releases of gcc
# support --undefined. This deserves some investigation. FIXME
_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
;;
cygwin* | mingw* | pw32* | cegcc*)
# _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
# as there is no search path for DLLs.
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
_LT_TAGVAR(always_export_symbols, $1)=no
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
_LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
# If the export-symbols file already is a .def file (1st line
# is EXPORTS), use it as is; otherwise, prepend...
_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
cp $export_symbols $output_objdir/$soname.def;
else
echo EXPORTS > $output_objdir/$soname.def;
cat $export_symbols >> $output_objdir/$soname.def;
fi~
$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
;;
haiku*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
_LT_TAGVAR(link_all_deplibs, $1)=yes
;;
interix[[3-9]]*)
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
# Instead, shared libraries are loaded at an image base (0x10000000 by
# default) and relocated if they conflict, which is a slow very memory
# consuming and fragmenting process. To avoid this, we pick a random,
# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
# time. Moving up from 0x10000000 also allows more sbrk(2) space.
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
tmp_diet=no
if test "$host_os" = linux-dietlibc; then
case $cc_basename in
diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
esac
fi
if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
&& test "$tmp_diet" = no
then
tmp_addflag=' $pic_flag'
tmp_sharedflag='-shared'
case $cc_basename,$host_cpu in
pgcc*) # Portland Group C compiler
_LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
tmp_addflag=' $pic_flag'
;;
pgf77* | pgf90* | pgf95* | pgfortran*)
# Portland Group f77 and f90 compilers
_LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
tmp_addflag=' $pic_flag -Mnomain' ;;
ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
tmp_addflag=' -i_dynamic' ;;
efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
tmp_addflag=' -i_dynamic -nofor_main' ;;
ifc* | ifort*) # Intel Fortran compiler
tmp_addflag=' -nofor_main' ;;
lf95*) # Lahey Fortran 8.1
_LT_TAGVAR(whole_archive_flag_spec, $1)=
tmp_sharedflag='--shared' ;;
xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
tmp_sharedflag='-qmkshrobj'
tmp_addflag= ;;
nvcc*) # Cuda Compiler Driver 2.2
_LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
_LT_TAGVAR(compiler_needs_object, $1)=yes
;;
esac
case `$CC -V 2>&1 | sed 5q` in
*Sun\ C*) # Sun C 5.9
_LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
_LT_TAGVAR(compiler_needs_object, $1)=yes
tmp_sharedflag='-G' ;;
*Sun\ F*) # Sun Fortran 8.3
tmp_sharedflag='-G' ;;
esac
_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
if test "x$supports_anon_versioning" = xyes; then
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
echo "local: *; };" >> $output_objdir/$libname.ver~
$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
fi
case $cc_basename in
xlf* | bgf* | bgxlf* | mpixlf*)
# IBM XL Fortran 10.1 on PPC cannot create shared libs itself
_LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
_LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
if test "x$supports_anon_versioning" = xyes; then
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
echo "local: *; };" >> $output_objdir/$libname.ver~
$LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
fi
;;
esac
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
;;
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
else
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
fi
;;
solaris*)
if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
_LT_TAGVAR(ld_shlibs, $1)=no
cat <<_LT_EOF 1>&2
*** Warning: The releases 2.8.* of the GNU linker cannot reliably
*** create shared libraries on Solaris systems. Therefore, libtool
*** is disabling shared libraries support. We urge you to upgrade GNU
*** binutils to release 2.9.1 or newer. Another option is to modify
*** your PATH or compiler configuration so that the native linker is
*** used, and then restart.
_LT_EOF
elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
;;
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
case `$LD -v 2>&1` in
*\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
_LT_TAGVAR(ld_shlibs, $1)=no
cat <<_LT_EOF 1>&2
*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
*** reliably create shared libraries on SCO systems. Therefore, libtool
*** is disabling shared libraries support. We urge you to upgrade GNU
*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
*** your PATH or compiler configuration so that the native linker is
*** used, and then restart.
_LT_EOF
;;
*)
# For security reasons, it is highly recommended that you always
# use absolute paths for naming shared libraries, and exclude the
# DT_RUNPATH tag from executables and libraries. But doing so
# requires that you compile everything twice, which is a pain.
if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
;;
esac
;;
sunos4*)
_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
wlarc=
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
*)
if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
;;
esac
if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
runpath_var=
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
_LT_TAGVAR(export_dynamic_flag_spec, $1)=
_LT_TAGVAR(whole_archive_flag_spec, $1)=
fi
else
# PORTME fill in a description of your system's linker (not GNU ld)
case $host_os in
aix3*)
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
_LT_TAGVAR(always_export_symbols, $1)=yes
_LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
# Note: this linker hardcodes the directories in LIBPATH if there
# are no directories specified by -L.
_LT_TAGVAR(hardcode_minus_L, $1)=yes
if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
# Neither direct hardcoding nor static linking is supported with a
# broken collect2.
_LT_TAGVAR(hardcode_direct, $1)=unsupported
fi
;;
aix[[4-9]]*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
aix_use_runtimelinking=no
exp_sym_flag='-Bexport'
no_entry_flag=""
else
# If we're using GNU nm, then we don't want the "-C" option.
# -C means demangle to AIX nm, but means don't demangle with GNU nm
# Also, AIX nm treats weak defined symbols like other global
# defined symbols, whereas GNU nm marks them as "W".
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
_LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
else
_LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
fi
aix_use_runtimelinking=no
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
for ld_flag in $LDFLAGS; do
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
aix_use_runtimelinking=yes
break
fi
done
;;
esac
exp_sym_flag='-bexport'
no_entry_flag='-bnoentry'
fi
# When large executables or shared objects are built, AIX ld can
# have problems creating the table of contents. If linking a library
# or program results in "error TOC overflow" add -mminimal-toc to
# CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
# enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
_LT_TAGVAR(archive_cmds, $1)=''
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
_LT_TAGVAR(link_all_deplibs, $1)=yes
_LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
if test "$GCC" = yes; then
case $host_os in aix4.[[012]]|aix4.[[012]].*)
# We only want to do this on AIX 4.2 and lower, the check
# below for broken collect2 doesn't work under 4.3+
collect2name=`${CC} -print-prog-name=collect2`
if test -f "$collect2name" &&
strings "$collect2name" | $GREP resolve_lib_name >/dev/null
then
# We have reworked collect2
:
else
# We have old collect2
_LT_TAGVAR(hardcode_direct, $1)=unsupported
# It fails to find uninstalled libraries when the uninstalled
# path is not listed in the libpath. Setting hardcode_minus_L
# to unsupported forces relinking
_LT_TAGVAR(hardcode_minus_L, $1)=yes
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=
fi
;;
esac
shared_flag='-shared'
if test "$aix_use_runtimelinking" = yes; then
shared_flag="$shared_flag "'${wl}-G'
fi
else
# not using gcc
if test "$host_cpu" = ia64; then
# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
# chokes on -Wl,-G. The following line is correct:
shared_flag='-G'
else
if test "$aix_use_runtimelinking" = yes; then
shared_flag='${wl}-G'
else
shared_flag='${wl}-bM:SRE'
fi
fi
fi
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
# It seems that -bexpall does not export symbols beginning with
# underscore (_), so it is better to generate a list of symbols to export.
_LT_TAGVAR(always_export_symbols, $1)=yes
if test "$aix_use_runtimelinking" = yes; then
# Warning - without using the other runtime loading flags (-brtl),
# -berok will link without error, but may produce a broken library.
_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
# Determine the default libpath from the value encoded in an
# empty executable.
_LT_SYS_MODULE_PATH_AIX([$1])
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
else
if test "$host_cpu" = ia64; then
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
_LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
_LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
else
# Determine the default libpath from the value encoded in an
# empty executable.
_LT_SYS_MODULE_PATH_AIX([$1])
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
# Warning - without using the other run time loading flags,
# -berok will link without error, but may produce a broken library.
_LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
if test "$with_gnu_ld" = yes; then
# We only use this code for GNU lds that support --whole-archive.
_LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
else
# Exported symbols can be pulled into shared objects from archives
_LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
fi
_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
# This is similar to how AIX traditionally builds its shared libraries.
_LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
fi
fi
;;
amigaos*)
case $host_cpu in
powerpc)
# see comment about AmigaOS4 .so support
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)=''
;;
m68k)
_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
_LT_TAGVAR(hardcode_minus_L, $1)=yes
;;
esac
;;
bsdi[[45]]*)
_LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
;;
cygwin* | mingw* | pw32* | cegcc*)
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
case $cc_basename in
cl*)
# Native MSVC
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
_LT_TAGVAR(always_export_symbols, $1)=yes
_LT_TAGVAR(file_list_spec, $1)='@'
# Tell ltmain to make .lib files, not .a files.
libext=lib
# Tell ltmain to make .dll files, not .so files.
shrext_cmds=".dll"
# FIXME: Setting linknames here is a bad hack.
_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
else
sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
fi~
$CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
linknames='
# The linker will not automatically build a static lib if we build a DLL.
# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
# Don't use ranlib
_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
lt_tool_outputfile="@TOOL_OUTPUT@"~
case $lt_outputfile in
*.exe|*.EXE) ;;
*)
lt_outputfile="$lt_outputfile.exe"
lt_tool_outputfile="$lt_tool_outputfile.exe"
;;
esac~
if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
$MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
$RM "$lt_outputfile.manifest";
fi'
;;
*)
# Assume MSVC wrapper
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
# Tell ltmain to make .lib files, not .a files.
libext=lib
# Tell ltmain to make .dll files, not .so files.
shrext_cmds=".dll"
# FIXME: Setting linknames here is a bad hack.
_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
# The linker will automatically build a .lib file if we build a DLL.
_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
# FIXME: Should let the user specify the lib program.
_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
;;
esac
;;
darwin* | rhapsody*)
_LT_DARWIN_LINKER_FEATURES($1)
;;
dgux*)
_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
freebsd1*)
_LT_TAGVAR(ld_shlibs, $1)=no
;;
# FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
# support. Future versions do this automatically, but an explicit c++rt0.o
# does not break anything, and helps significantly (at the cost of a little
# extra space).
freebsd2.2*)
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
# Unfortunately, older versions of FreeBSD 2 do not have this feature.
freebsd2*)
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_minus_L, $1)=yes
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
freebsd* | dragonfly*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
hpux9*)
if test "$GCC" = yes; then
_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
else
_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
fi
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
_LT_TAGVAR(hardcode_direct, $1)=yes
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
_LT_TAGVAR(hardcode_minus_L, $1)=yes
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
;;
hpux10*)
if test "$GCC" = yes && test "$with_gnu_ld" = no; then
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
else
_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
fi
if test "$with_gnu_ld" = no; then
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
_LT_TAGVAR(hardcode_minus_L, $1)=yes
fi
;;
hpux11*)
if test "$GCC" = yes && test "$with_gnu_ld" = no; then
case $host_cpu in
hppa*64*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
ia64*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
;;
*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
;;
esac
else
case $host_cpu in
hppa*64*)
_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
ia64*)
_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
;;
*)
m4_if($1, [], [
# Older versions of the 11.00 compiler do not understand -b yet
# (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
_LT_LINKER_OPTION([if $CC understands -b],
_LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
[_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
[_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
[_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
;;
esac
fi
if test "$with_gnu_ld" = no; then
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
case $host_cpu in
hppa*64*|ia64*)
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
*)
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
_LT_TAGVAR(hardcode_minus_L, $1)=yes
;;
esac
fi
;;
irix5* | irix6* | nonstopux*)
if test "$GCC" = yes; then
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
# Try to use the -exported_symbol ld option, if it does not
# work, assume that -exports_file does not work either and
# implicitly export all symbols.
# This should be the same for all languages, so no per-tag cache variable.
AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
[lt_cv_irix_exported_symbol],
[save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
AC_LINK_IFELSE(
[AC_LANG_SOURCE(
[AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
[C++], [[int foo (void) { return 0; }]],
[Fortran 77], [[
subroutine foo
end]],
[Fortran], [[
subroutine foo
end]])])],
[lt_cv_irix_exported_symbol=yes],
[lt_cv_irix_exported_symbol=no])
LDFLAGS="$save_LDFLAGS"])
if test "$lt_cv_irix_exported_symbol" = yes; then
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
fi
else
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
fi
_LT_TAGVAR(archive_cmds_need_lc, $1)='no'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
_LT_TAGVAR(inherit_rpath, $1)=yes
_LT_TAGVAR(link_all_deplibs, $1)=yes
;;
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
else
_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
fi
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
newsos6)
_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
*nto* | *qnx*)
;;
openbsd*)
if test -f /usr/libexec/ld.so; then
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
else
case $host_os in
openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
;;
*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
;;
esac
fi
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
;;
os2*)
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
_LT_TAGVAR(hardcode_minus_L, $1)=yes
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
_LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
_LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
;;
osf3*)
if test "$GCC" = yes; then
_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
else
_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
fi
_LT_TAGVAR(archive_cmds_need_lc, $1)='no'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
;;
osf4* | osf5*) # as osf3* with the addition of -msym flag
if test "$GCC" = yes; then
_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
else
_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
# Both c and cxx compiler support -rpath directly
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
fi
_LT_TAGVAR(archive_cmds_need_lc, $1)='no'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
;;
solaris*)
_LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
if test "$GCC" = yes; then
wlarc='${wl}'
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
else
case `$CC -V 2>&1` in
*"Compilers 5.0"*)
wlarc=''
_LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
;;
*)
wlarc='${wl}'
_LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
$CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
;;
esac
fi
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
case $host_os in
solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
*)
# The compiler driver will combine and reorder linker options,
# but understands `-z linker_flag'. GCC discards it without `$wl',
# but is careful enough not to reorder.
# Supported since Solaris 2.6 (maybe 2.5.1?)
if test "$GCC" = yes; then
_LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
else
_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
fi
;;
esac
_LT_TAGVAR(link_all_deplibs, $1)=yes
;;
sunos4*)
if test "x$host_vendor" = xsequent; then
# Use $CC to link under sequent, because it throws in some extra .o
# files that make .init and .fini sections work.
_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
else
_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
fi
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_minus_L, $1)=yes
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
sysv4)
case $host_vendor in
sni)
_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
_LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
;;
siemens)
## LD is ld it makes a PLAMLIB
## CC just makes a GrossModule.
_LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
_LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
_LT_TAGVAR(hardcode_direct, $1)=no
;;
motorola)
_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
_LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
;;
esac
runpath_var='LD_RUN_PATH'
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
sysv4.3*)
_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
_LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
;;
sysv4*MP*)
if test -d /usr/nec; then
_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
runpath_var=LD_RUN_PATH
hardcode_runpath_var=yes
_LT_TAGVAR(ld_shlibs, $1)=yes
fi
;;
sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
runpath_var='LD_RUN_PATH'
if test "$GCC" = yes; then
_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
else
_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
fi
;;
sysv5* | sco3.2v5* | sco5v6*)
# Note: We can NOT use -z defs as we might desire, because we do not
# link with -lc, and that would cause any symbols used from libc to
# always be unresolved, which means just about no library would
# ever link correctly. If we're not using GNU ld we use -z text
# though, which does catch some bad symbols but isn't as heavy-handed
# as -z defs.
_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
_LT_TAGVAR(link_all_deplibs, $1)=yes
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
runpath_var='LD_RUN_PATH'
if test "$GCC" = yes; then
_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
else
_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
fi
;;
uts4*)
_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
*)
_LT_TAGVAR(ld_shlibs, $1)=no
;;
esac
if test x$host_vendor = xsni; then
case $host in
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
;;
esac
fi
fi
])
AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
_LT_DECL([], [extract_expsyms_cmds], [2],
[The commands to extract the exported symbol list from a shared archive])
#
# Do we need to explicitly link libc?
#
case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
x|xyes)
# Assume -lc should be added
_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
if test "$enable_shared" = yes && test "$GCC" = yes; then
case $_LT_TAGVAR(archive_cmds, $1) in
*'~'*)
# FIXME: we may have to deal with multi-command sequences.
;;
'$CC '*)
# Test whether the compiler implicitly links with -lc since on some
# systems, -lgcc has to come before -lc. If gcc already passes -lc
# to ld, don't add -lc before -lgcc.
AC_CACHE_CHECK([whether -lc should be explicitly linked in],
[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
[$RM conftest*
echo "$lt_simple_compile_test_code" > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
soname=conftest
lib=conftest
libobjs=conftest.$ac_objext
deplibs=
wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
compiler_flags=-v
linker_flags=-v
verstring=
output_objdir=.
libname=conftest
lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
_LT_TAGVAR(allow_undefined_flag, $1)=
if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
then
lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
else
lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
fi
_LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
else
cat conftest.err 1>&5
fi
$RM conftest*
])
_LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
;;
esac
fi
;;
esac
_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
[Whether or not to add -lc for building shared libraries])
_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
[enable_shared_with_static_runtimes], [0],
[Whether or not to disallow shared libs when runtime libs are static])
_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
[Compiler flag to allow reflexive dlopens])
_LT_TAGDECL([], [whole_archive_flag_spec], [1],
[Compiler flag to generate shared objects directly from archives])
_LT_TAGDECL([], [compiler_needs_object], [1],
[Whether the compiler copes with passing no objects directly])
_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
[Create an old-style archive from a shared archive])
_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
[Create a temporary old-style archive to link instead of a shared archive])
_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
_LT_TAGDECL([], [archive_expsym_cmds], [2])
_LT_TAGDECL([], [module_cmds], [2],
[Commands used to build a loadable module if different from building
a shared archive.])
_LT_TAGDECL([], [module_expsym_cmds], [2])
_LT_TAGDECL([], [with_gnu_ld], [1],
[Whether we are building with GNU ld or not])
_LT_TAGDECL([], [allow_undefined_flag], [1],
[Flag that allows shared libraries with undefined symbols to be built])
_LT_TAGDECL([], [no_undefined_flag], [1],
[Flag that enforces no undefined symbols])
_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
[Flag to hardcode $libdir into a binary during linking.
This must work even if $libdir does not exist])
_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
[[If ld is used when linking, flag to hardcode $libdir into a binary
during linking. This must work even if $libdir does not exist]])
_LT_TAGDECL([], [hardcode_libdir_separator], [1],
[Whether we need a single "-rpath" flag with a separated argument])
_LT_TAGDECL([], [hardcode_direct], [0],
[Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
DIR into the resulting binary])
_LT_TAGDECL([], [hardcode_direct_absolute], [0],
[Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
DIR into the resulting binary and the resulting library dependency is
"absolute", i.e impossible to change by setting ${shlibpath_var} if the
library is relocated])
_LT_TAGDECL([], [hardcode_minus_L], [0],
[Set to "yes" if using the -LDIR flag during linking hardcodes DIR
into the resulting binary])
_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
[Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
into the resulting binary])
_LT_TAGDECL([], [hardcode_automatic], [0],
[Set to "yes" if building a shared library automatically hardcodes DIR
into the library and all subsequent libraries and executables linked
against it])
_LT_TAGDECL([], [inherit_rpath], [0],
[Set to yes if linker adds runtime paths of dependent libraries
to runtime path list])
_LT_TAGDECL([], [link_all_deplibs], [0],
[Whether libtool must link a program against all its dependency libraries])
_LT_TAGDECL([], [always_export_symbols], [0],
[Set to "yes" if exported symbols are required])
_LT_TAGDECL([], [export_symbols_cmds], [2],
[The commands to list exported symbols])
_LT_TAGDECL([], [exclude_expsyms], [1],
[Symbols that should not be listed in the preloaded symbols])
_LT_TAGDECL([], [include_expsyms], [1],
[Symbols that must always be exported])
_LT_TAGDECL([], [prelink_cmds], [2],
[Commands necessary for linking programs (against libraries) with templates])
_LT_TAGDECL([], [postlink_cmds], [2],
[Commands necessary for finishing linking programs])
_LT_TAGDECL([], [file_list_spec], [1],
[Specify filename containing input files])
dnl FIXME: Not yet implemented
dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
dnl [Compiler flag to generate thread safe objects])
])# _LT_LINKER_SHLIBS
# _LT_LANG_C_CONFIG([TAG])
# ------------------------
# Ensure that the configuration variables for a C compiler are suitably
# defined. These variables are subsequently used by _LT_CONFIG to write
# the compiler configuration to `libtool'.
m4_defun([_LT_LANG_C_CONFIG],
[m4_require([_LT_DECL_EGREP])dnl
lt_save_CC="$CC"
AC_LANG_PUSH(C)
# Source file extension for C test sources.
ac_ext=c
# Object file extension for compiled C test sources.
objext=o
_LT_TAGVAR(objext, $1)=$objext
# Code to be used in simple compile tests
lt_simple_compile_test_code="int some_variable = 0;"
# Code to be used in simple link tests
lt_simple_link_test_code='int main(){return(0);}'
_LT_TAG_COMPILER
# Save the default compiler, since it gets overwritten when the other
# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
compiler_DEFAULT=$CC
# save warnings/boilerplate of simple test code
_LT_COMPILER_BOILERPLATE
_LT_LINKER_BOILERPLATE
if test -n "$compiler"; then
_LT_COMPILER_NO_RTTI($1)
_LT_COMPILER_PIC($1)
_LT_COMPILER_C_O($1)
_LT_COMPILER_FILE_LOCKS($1)
_LT_LINKER_SHLIBS($1)
_LT_SYS_DYNAMIC_LINKER($1)
_LT_LINKER_HARDCODE_LIBPATH($1)
LT_SYS_DLOPEN_SELF
_LT_CMD_STRIPLIB
# Report which library types will actually be built
AC_MSG_CHECKING([if libtool supports shared libraries])
AC_MSG_RESULT([$can_build_shared])
AC_MSG_CHECKING([whether to build shared libraries])
test "$can_build_shared" = "no" && enable_shared=no
# On AIX, shared libraries and static libraries use the same namespace, and
# are all built from PIC.
case $host_os in
aix3*)
test "$enable_shared" = yes && enable_static=no
if test -n "$RANLIB"; then
archive_cmds="$archive_cmds~\$RANLIB \$lib"
postinstall_cmds='$RANLIB $lib'
fi
;;
aix[[4-9]]*)
if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
test "$enable_shared" = yes && enable_static=no
fi
;;
esac
AC_MSG_RESULT([$enable_shared])
AC_MSG_CHECKING([whether to build static libraries])
# Make sure either enable_shared or enable_static is yes.
test "$enable_shared" = yes || enable_static=yes
AC_MSG_RESULT([$enable_static])
_LT_CONFIG($1)
fi
AC_LANG_POP
CC="$lt_save_CC"
])# _LT_LANG_C_CONFIG
# _LT_LANG_CXX_CONFIG([TAG])
# --------------------------
# Ensure that the configuration variables for a C++ compiler are suitably
# defined. These variables are subsequently used by _LT_CONFIG to write
# the compiler configuration to `libtool'.
m4_defun([_LT_LANG_CXX_CONFIG],
[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
m4_require([_LT_DECL_EGREP])dnl
m4_require([_LT_PATH_MANIFEST_TOOL])dnl
if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
(test "X$CXX" != "Xg++"))) ; then
AC_PROG_CXXCPP
else
_lt_caught_CXX_error=yes
fi
AC_LANG_PUSH(C++)
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_TAGVAR(allow_undefined_flag, $1)=
_LT_TAGVAR(always_export_symbols, $1)=no
_LT_TAGVAR(archive_expsym_cmds, $1)=
_LT_TAGVAR(compiler_needs_object, $1)=no
_LT_TAGVAR(export_dynamic_flag_spec, $1)=
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_direct_absolute, $1)=no
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
_LT_TAGVAR(hardcode_libdir_separator, $1)=
_LT_TAGVAR(hardcode_minus_L, $1)=no
_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
_LT_TAGVAR(hardcode_automatic, $1)=no
_LT_TAGVAR(inherit_rpath, $1)=no
_LT_TAGVAR(module_cmds, $1)=
_LT_TAGVAR(module_expsym_cmds, $1)=
_LT_TAGVAR(link_all_deplibs, $1)=unknown
_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
_LT_TAGVAR(reload_flag, $1)=$reload_flag
_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
_LT_TAGVAR(no_undefined_flag, $1)=
_LT_TAGVAR(whole_archive_flag_spec, $1)=
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
# Source file extension for C++ test sources.
ac_ext=cpp
# Object file extension for compiled C++ test sources.
objext=o
_LT_TAGVAR(objext, $1)=$objext
# No sense in running all these tests if we already determined that
# the CXX compiler isn't working. Some variables (like enable_shared)
# are currently assumed to apply to all compilers on this platform,
# and will be corrupted by setting them based on a non-working compiler.
if test "$_lt_caught_CXX_error" != yes; then
# Code to be used in simple compile tests
lt_simple_compile_test_code="int some_variable = 0;"
# Code to be used in simple link tests
lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
_LT_TAG_COMPILER
# save warnings/boilerplate of simple test code
_LT_COMPILER_BOILERPLATE
_LT_LINKER_BOILERPLATE
# Allow CC to be a program name with arguments.
lt_save_CC=$CC
lt_save_CFLAGS=$CFLAGS
lt_save_LD=$LD
lt_save_GCC=$GCC
GCC=$GXX
lt_save_with_gnu_ld=$with_gnu_ld
lt_save_path_LD=$lt_cv_path_LD
if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
else
$as_unset lt_cv_prog_gnu_ld
fi
if test -n "${lt_cv_path_LDCXX+set}"; then
lt_cv_path_LD=$lt_cv_path_LDCXX
else
$as_unset lt_cv_path_LD
fi
test -z "${LDCXX+set}" || LD=$LDCXX
CC=${CXX-"c++"}
CFLAGS=$CXXFLAGS
compiler=$CC
_LT_TAGVAR(compiler, $1)=$CC
_LT_CC_BASENAME([$compiler])
if test -n "$compiler"; then
# We don't want -fno-exception when compiling C++ code, so set the
# no_builtin_flag separately
if test "$GXX" = yes; then
_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
else
_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
fi
if test "$GXX" = yes; then
# Set up default GNU C++ configuration
LT_PATH_LD
# Check if GNU C++ uses GNU ld as the underlying linker, since the
# archiving commands below assume that GNU ld is being used.
if test "$with_gnu_ld" = yes; then
_LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
# If archive_cmds runs LD, not CC, wlarc should be empty
# XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
# investigate it a little bit more. (MM)
wlarc='${wl}'
# ancient GNU ld didn't support --whole-archive et. al.
if eval "`$CC -print-prog-name=ld` --help 2>&1" |
$GREP 'no-whole-archive' > /dev/null; then
_LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
else
_LT_TAGVAR(whole_archive_flag_spec, $1)=
fi
else
with_gnu_ld=no
wlarc=
# A generic and very simple default shared library creation
# command for GNU C++ for the case where it uses the native
# linker, instead of GNU ld. If possible, this setting should
# overridden to take advantage of the native linker features on
# the platform it is being used on.
_LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
fi
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
else
GXX=no
with_gnu_ld=no
wlarc=
fi
# PORTME: fill in a description of your system's C++ link characteristics
AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
_LT_TAGVAR(ld_shlibs, $1)=yes
case $host_os in
aix3*)
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
aix[[4-9]]*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
aix_use_runtimelinking=no
exp_sym_flag='-Bexport'
no_entry_flag=""
else
aix_use_runtimelinking=no
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
for ld_flag in $LDFLAGS; do
case $ld_flag in
*-brtl*)
aix_use_runtimelinking=yes
break
;;
esac
done
;;
esac
exp_sym_flag='-bexport'
no_entry_flag='-bnoentry'
fi
# When large executables or shared objects are built, AIX ld can
# have problems creating the table of contents. If linking a library
# or program results in "error TOC overflow" add -mminimal-toc to
# CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
# enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
_LT_TAGVAR(archive_cmds, $1)=''
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
_LT_TAGVAR(link_all_deplibs, $1)=yes
_LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
if test "$GXX" = yes; then
case $host_os in aix4.[[012]]|aix4.[[012]].*)
# We only want to do this on AIX 4.2 and lower, the check
# below for broken collect2 doesn't work under 4.3+
collect2name=`${CC} -print-prog-name=collect2`
if test -f "$collect2name" &&
strings "$collect2name" | $GREP resolve_lib_name >/dev/null
then
# We have reworked collect2
:
else
# We have old collect2
_LT_TAGVAR(hardcode_direct, $1)=unsupported
# It fails to find uninstalled libraries when the uninstalled
# path is not listed in the libpath. Setting hardcode_minus_L
# to unsupported forces relinking
_LT_TAGVAR(hardcode_minus_L, $1)=yes
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=
fi
esac
shared_flag='-shared'
if test "$aix_use_runtimelinking" = yes; then
shared_flag="$shared_flag "'${wl}-G'
fi
else
# not using gcc
if test "$host_cpu" = ia64; then
# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
# chokes on -Wl,-G. The following line is correct:
shared_flag='-G'
else
if test "$aix_use_runtimelinking" = yes; then
shared_flag='${wl}-G'
else
shared_flag='${wl}-bM:SRE'
fi
fi
fi
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
# It seems that -bexpall does not export symbols beginning with
# underscore (_), so it is better to generate a list of symbols to
# export.
_LT_TAGVAR(always_export_symbols, $1)=yes
if test "$aix_use_runtimelinking" = yes; then
# Warning - without using the other runtime loading flags (-brtl),
# -berok will link without error, but may produce a broken library.
_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
# Determine the default libpath from the value encoded in an empty
# executable.
_LT_SYS_MODULE_PATH_AIX([$1])
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
else
if test "$host_cpu" = ia64; then
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
_LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
_LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
else
# Determine the default libpath from the value encoded in an
# empty executable.
_LT_SYS_MODULE_PATH_AIX([$1])
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
# Warning - without using the other run time loading flags,
# -berok will link without error, but may produce a broken library.
_LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
if test "$with_gnu_ld" = yes; then
# We only use this code for GNU lds that support --whole-archive.
_LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
else
# Exported symbols can be pulled into shared objects from archives
_LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
fi
_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
# This is similar to how AIX traditionally builds its shared
# libraries.
_LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
fi
fi
;;
beos*)
if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
# Joseph Beckenbach says some releases of gcc
# support --undefined. This deserves some investigation. FIXME
_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
;;
chorus*)
case $cc_basename in
*)
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
esac
;;
cygwin* | mingw* | pw32* | cegcc*)
case $GXX,$cc_basename in
,cl* | no,cl*)
# Native MSVC
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
_LT_TAGVAR(always_export_symbols, $1)=yes
_LT_TAGVAR(file_list_spec, $1)='@'
# Tell ltmain to make .lib files, not .a files.
libext=lib
# Tell ltmain to make .dll files, not .so files.
shrext_cmds=".dll"
# FIXME: Setting linknames here is a bad hack.
_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
$SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
else
$SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
fi~
$CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
linknames='
# The linker will not automatically build a static lib if we build a DLL.
# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
# Don't use ranlib
_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
lt_tool_outputfile="@TOOL_OUTPUT@"~
case $lt_outputfile in
*.exe|*.EXE) ;;
*)
lt_outputfile="$lt_outputfile.exe"
lt_tool_outputfile="$lt_tool_outputfile.exe"
;;
esac~
func_to_tool_file "$lt_outputfile"~
if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
$MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
$RM "$lt_outputfile.manifest";
fi'
;;
*)
# g++
# _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
# as there is no search path for DLLs.
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
_LT_TAGVAR(always_export_symbols, $1)=no
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
# If the export-symbols file already is a .def file (1st line
# is EXPORTS), use it as is; otherwise, prepend...
_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
cp $export_symbols $output_objdir/$soname.def;
else
echo EXPORTS > $output_objdir/$soname.def;
cat $export_symbols >> $output_objdir/$soname.def;
fi~
$CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
;;
esac
;;
darwin* | rhapsody*)
_LT_DARWIN_LINKER_FEATURES($1)
;;
dgux*)
case $cc_basename in
ec++*)
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
ghcx*)
# Green Hills C++ Compiler
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
*)
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
esac
;;
freebsd[[12]]*)
# C++ shared libraries reported to be fairly broken before
# switch to ELF
_LT_TAGVAR(ld_shlibs, $1)=no
;;
freebsd-elf*)
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
;;
freebsd* | dragonfly*)
# FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
# conventions
_LT_TAGVAR(ld_shlibs, $1)=yes
;;
gnu*)
;;
haiku*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
_LT_TAGVAR(link_all_deplibs, $1)=yes
;;
hpux9*)
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
# but as the default
# location of the library.
case $cc_basename in
CC*)
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
aCC*)
_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
#
# There doesn't appear to be a way to prevent this compiler from
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
;;
*)
if test "$GXX" = yes; then
_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
else
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
fi
;;
esac
;;
hpux10*|hpux11*)
if test $with_gnu_ld = no; then
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
case $host_cpu in
hppa*64*|ia64*)
;;
*)
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
;;
esac
fi
case $host_cpu in
hppa*64*|ia64*)
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
*)
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
_LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
# but as the default
# location of the library.
;;
esac
case $cc_basename in
CC*)
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
aCC*)
case $host_cpu in
hppa*64*)
_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
;;
ia64*)
_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
;;
*)
_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
;;
esac
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
#
# There doesn't appear to be a way to prevent this compiler from
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
;;
*)
if test "$GXX" = yes; then
if test $with_gnu_ld = no; then
case $host_cpu in
hppa*64*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
;;
ia64*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
;;
*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
;;
esac
fi
else
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
fi
;;
esac
;;
interix[[3-9]]*)
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
# Instead, shared libraries are loaded at an image base (0x10000000 by
# default) and relocated if they conflict, which is a slow very memory
# consuming and fragmenting process. To avoid this, we pick a random,
# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
# time. Moving up from 0x10000000 also allows more sbrk(2) space.
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
irix5* | irix6*)
case $cc_basename in
CC*)
# SGI C++
_LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
# Archives containing C++ object files must be created using
# "CC -ar", where "CC" is the IRIX C++ compiler. This is
# necessary to make sure instantiated templates are included
# in the archive.
_LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
;;
*)
if test "$GXX" = yes; then
if test "$with_gnu_ld" = no; then
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
else
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
fi
fi
_LT_TAGVAR(link_all_deplibs, $1)=yes
;;
esac
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
_LT_TAGVAR(inherit_rpath, $1)=yes
;;
linux* | k*bsd*-gnu | kopensolaris*-gnu)
case $cc_basename in
KCC*)
# Kuck and Associates, Inc. (KAI) C++ Compiler
# KCC will only create a shared library if the output file
# ends with ".so" (or ".sl" for HP-UX), so rename the library
# to its proper name (with version) after linking.
_LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
#
# There doesn't appear to be a way to prevent this compiler from
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
# Archives containing C++ object files must be created using
# "CC -Bstatic", where "CC" is the KAI C++ compiler.
_LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
;;
icpc* | ecpc* )
# Intel C++
with_gnu_ld=yes
# version 8.0 and above of icpc choke on multiply defined symbols
# if we add $predep_objects and $postdep_objects, however 7.1 and
# earlier do not add the objects themselves.
case `$CC -V 2>&1` in
*"Version 7."*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
;;
*) # Version 8.0 or newer
tmp_idyn=
case $host_cpu in
ia64*) tmp_idyn=' -i_dynamic';;
esac
_LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
;;
esac
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
_LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
;;
pgCC* | pgcpp*)
# Portland Group C++ compiler
case `$CC -V` in
*pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
_LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
rm -rf $tpldir~
$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
_LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
rm -rf $tpldir~
$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
$RANLIB $oldlib'
_LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
rm -rf $tpldir~
$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
rm -rf $tpldir~
$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
;;
*) # Version 6 and above use weak symbols
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
;;
esac
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
_LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
;;
cxx*)
# Compaq C++
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
runpath_var=LD_RUN_PATH
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
#
# There doesn't appear to be a way to prevent this compiler from
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
;;
xl* | mpixl* | bgxl*)
# IBM XL 8.0 on PPC, with GNU ld
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
_LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
if test "x$supports_anon_versioning" = xyes; then
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
echo "local: *; };" >> $output_objdir/$libname.ver~
$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
fi
;;
*)
case `$CC -V 2>&1 | sed 5q` in
*Sun\ C*)
# Sun C++ 5.9
_LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
_LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
_LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
_LT_TAGVAR(compiler_needs_object, $1)=yes
# Not sure whether something based on
# $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
# would be better.
output_verbose_link_cmd='func_echo_all'
# Archives containing C++ object files must be created using
# "CC -xar", where "CC" is the Sun C++ compiler. This is
# necessary to make sure instantiated templates are included
# in the archive.
_LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
;;
esac
;;
esac
;;
lynxos*)
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
m88k*)
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
mvs*)
case $cc_basename in
cxx*)
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
*)
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
esac
;;
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
wlarc=
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
fi
# Workaround some broken pre-1.5 toolchains
output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
;;
*nto* | *qnx*)
_LT_TAGVAR(ld_shlibs, $1)=yes
;;
openbsd2*)
# C++ shared libraries are fairly broken
_LT_TAGVAR(ld_shlibs, $1)=no
;;
openbsd*)
if test -f /usr/libexec/ld.so; then
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
_LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
fi
output_verbose_link_cmd=func_echo_all
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
;;
osf3* | osf4* | osf5*)
case $cc_basename in
KCC*)
# Kuck and Associates, Inc. (KAI) C++ Compiler
# KCC will only create a shared library if the output file
# ends with ".so" (or ".sl" for HP-UX), so rename the library
# to its proper name (with version) after linking.
_LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
# Archives containing C++ object files must be created using
# the KAI C++ compiler.
case $host in
osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
esac
;;
RCC*)
# Rational C++ 2.4.1
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
cxx*)
case $host in
osf3*)
_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
;;
*)
_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
echo "-hidden">> $lib.exp~
$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
$RM $lib.exp'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
;;
esac
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
#
# There doesn't appear to be a way to prevent this compiler from
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
;;
*)
if test "$GXX" = yes && test "$with_gnu_ld" = no; then
_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
case $host in
osf3*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
;;
*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
;;
esac
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
else
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
fi
;;
esac
;;
psos*)
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
sunos4*)
case $cc_basename in
CC*)
# Sun C++ 4.x
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
lcc*)
# Lucid
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
*)
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
esac
;;
solaris*)
case $cc_basename in
CC* | sunCC*)
# Sun C++ 4.2, 5.x and Centerline C++
_LT_TAGVAR(archive_cmds_need_lc,$1)=yes
_LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
_LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
$CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
case $host_os in
solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
*)
# The compiler driver will combine and reorder linker options,
# but understands `-z linker_flag'.
# Supported since Solaris 2.6 (maybe 2.5.1?)
_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
;;
esac
_LT_TAGVAR(link_all_deplibs, $1)=yes
output_verbose_link_cmd='func_echo_all'
# Archives containing C++ object files must be created using
# "CC -xar", where "CC" is the Sun C++ compiler. This is
# necessary to make sure instantiated templates are included
# in the archive.
_LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
;;
gcx*)
# Green Hills C++ Compiler
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
# The C++ compiler must be used to create the archive.
_LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
;;
*)
# GNU C++ compiler with Solaris linker
if test "$GXX" = yes && test "$with_gnu_ld" = no; then
_LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
if $CC --version | $GREP -v '^2\.7' > /dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
$CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
else
# g++ 2.7 appears to require `-G' NOT `-shared' on this
# platform.
_LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
$CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
fi
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
case $host_os in
solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
*)
_LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
;;
esac
fi
;;
esac
;;
sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
runpath_var='LD_RUN_PATH'
case $cc_basename in
CC*)
_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
esac
;;
sysv5* | sco3.2v5* | sco5v6*)
# Note: We can NOT use -z defs as we might desire, because we do not
# link with -lc, and that would cause any symbols used from libc to
# always be unresolved, which means just about no library would
# ever link correctly. If we're not using GNU ld we use -z text
# though, which does catch some bad symbols but isn't as heavy-handed
# as -z defs.
_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
_LT_TAGVAR(link_all_deplibs, $1)=yes
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
runpath_var='LD_RUN_PATH'
case $cc_basename in
CC*)
_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
'"$_LT_TAGVAR(old_archive_cmds, $1)"
_LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
'"$_LT_TAGVAR(reload_cmds, $1)"
;;
*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
esac
;;
tandem*)
case $cc_basename in
NCC*)
# NonStop-UX NCC 3.20
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
*)
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
esac
;;
vxworks*)
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
*)
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
;;
esac
AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
_LT_TAGVAR(GCC, $1)="$GXX"
_LT_TAGVAR(LD, $1)="$LD"
## CAVEAT EMPTOR:
## There is no encapsulation within the following macros, do not change
## the running order or otherwise move them around unless you know exactly
## what you are doing...
_LT_SYS_HIDDEN_LIBDEPS($1)
_LT_COMPILER_PIC($1)
_LT_COMPILER_C_O($1)
_LT_COMPILER_FILE_LOCKS($1)
_LT_LINKER_SHLIBS($1)
_LT_SYS_DYNAMIC_LINKER($1)
_LT_LINKER_HARDCODE_LIBPATH($1)
_LT_CONFIG($1)
fi # test -n "$compiler"
CC=$lt_save_CC
CFLAGS=$lt_save_CFLAGS
LDCXX=$LD
LD=$lt_save_LD
GCC=$lt_save_GCC
with_gnu_ld=$lt_save_with_gnu_ld
lt_cv_path_LDCXX=$lt_cv_path_LD
lt_cv_path_LD=$lt_save_path_LD
lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
fi # test "$_lt_caught_CXX_error" != yes
AC_LANG_POP
])# _LT_LANG_CXX_CONFIG
# _LT_FUNC_STRIPNAME_CNF
# ----------------------
# func_stripname_cnf prefix suffix name
# strip PREFIX and SUFFIX off of NAME.
# PREFIX and SUFFIX must not contain globbing or regex special
# characters, hashes, percent signs, but SUFFIX may contain a leading
# dot (in which case that matches only a dot).
#
# This function is identical to the (non-XSI) version of func_stripname,
# except this one can be used by m4 code that may be executed by configure,
# rather than the libtool script.
m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
AC_REQUIRE([_LT_DECL_SED])
AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
func_stripname_cnf ()
{
case ${2} in
.*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
esac
} # func_stripname_cnf
])# _LT_FUNC_STRIPNAME_CNF
# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
# ---------------------------------
# Figure out "hidden" library dependencies from verbose
# compiler output when linking a shared library.
# Parse the compiler output and extract the necessary
# objects, libraries and library flags.
m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
# Dependencies to place before and after the object being linked:
_LT_TAGVAR(predep_objects, $1)=
_LT_TAGVAR(postdep_objects, $1)=
_LT_TAGVAR(predeps, $1)=
_LT_TAGVAR(postdeps, $1)=
_LT_TAGVAR(compiler_lib_search_path, $1)=
dnl we can't use the lt_simple_compile_test_code here,
dnl because it contains code intended for an executable,
dnl not a library. It's possible we should let each
dnl tag define a new lt_????_link_test_code variable,
dnl but it's only used here...
m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
int a;
void foo (void) { a = 0; }
_LT_EOF
], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
class Foo
{
public:
Foo (void) { a = 0; }
private:
int a;
};
_LT_EOF
], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
subroutine foo
implicit none
integer*4 a
a=0
return
end
_LT_EOF
], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
subroutine foo
implicit none
integer a
a=0
return
end
_LT_EOF
], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
public class foo {
private int a;
public void bar (void) {
a = 0;
}
};
_LT_EOF
])
_lt_libdeps_save_CFLAGS=$CFLAGS
case "$CC $CFLAGS " in #(
*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
esac
dnl Parse the compiler output and extract the necessary
dnl objects, libraries and library flags.
if AC_TRY_EVAL(ac_compile); then
# Parse the compiler output and extract the necessary
# objects, libraries and library flags.
# Sentinel used to keep track of whether or not we are before
# the conftest object file.
pre_test_object_deps_done=no
for p in `eval "$output_verbose_link_cmd"`; do
case ${prev}${p} in
-L* | -R* | -l*)
# Some compilers place space between "-{L,R}" and the path.
# Remove the space.
if test $p = "-L" ||
test $p = "-R"; then
prev=$p
continue
fi
# Expand the sysroot to ease extracting the directories later.
if test -z "$prev"; then
case $p in
-L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
-R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
-l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
esac
fi
case $p in
=*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
esac
if test "$pre_test_object_deps_done" = no; then
case ${prev} in
-L | -R)
# Internal compiler library paths should come after those
# provided the user. The postdeps already come after the
# user supplied libs so there is no need to process them.
if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
_LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
else
_LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
fi
;;
# The "-l" case would never come before the object being
# linked, so don't bother handling this case.
esac
else
if test -z "$_LT_TAGVAR(postdeps, $1)"; then
_LT_TAGVAR(postdeps, $1)="${prev}${p}"
else
_LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
fi
fi
prev=
;;
*.lto.$objext) ;; # Ignore GCC LTO objects
*.$objext)
# This assumes that the test object file only shows up
# once in the compiler output.
if test "$p" = "conftest.$objext"; then
pre_test_object_deps_done=yes
continue
fi
if test "$pre_test_object_deps_done" = no; then
if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
_LT_TAGVAR(predep_objects, $1)="$p"
else
_LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
fi
else
if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
_LT_TAGVAR(postdep_objects, $1)="$p"
else
_LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
fi
fi
;;
*) ;; # Ignore the rest.
esac
done
# Clean up.
rm -f a.out a.exe
else
echo "libtool.m4: error: problem compiling $1 test program"
fi
$RM -f confest.$objext
CFLAGS=$_lt_libdeps_save_CFLAGS
# PORTME: override above test on systems where it is broken
m4_if([$1], [CXX],
[case $host_os in
interix[[3-9]]*)
# Interix 3.5 installs completely hosed .la files for C++, so rather than
# hack all around it, let's just trust "g++" to DTRT.
_LT_TAGVAR(predep_objects,$1)=
_LT_TAGVAR(postdep_objects,$1)=
_LT_TAGVAR(postdeps,$1)=
;;
linux*)
case `$CC -V 2>&1 | sed 5q` in
*Sun\ C*)
# Sun C++ 5.9
# The more standards-conforming stlport4 library is
# incompatible with the Cstd library. Avoid specifying
# it if it's in CXXFLAGS. Ignore libCrun as
# -library=stlport4 depends on it.
case " $CXX $CXXFLAGS " in
*" -library=stlport4 "*)
solaris_use_stlport4=yes
;;
esac
if test "$solaris_use_stlport4" != yes; then
_LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
fi
;;
esac
;;
solaris*)
case $cc_basename in
CC* | sunCC*)
# The more standards-conforming stlport4 library is
# incompatible with the Cstd library. Avoid specifying
# it if it's in CXXFLAGS. Ignore libCrun as
# -library=stlport4 depends on it.
case " $CXX $CXXFLAGS " in
*" -library=stlport4 "*)
solaris_use_stlport4=yes
;;
esac
# Adding this requires a known-good setup of shared libraries for
# Sun compiler versions before 5.6, else PIC objects from an old
# archive will be linked into the output, leading to subtle bugs.
if test "$solaris_use_stlport4" != yes; then
_LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
fi
;;
esac
;;
esac
])
case " $_LT_TAGVAR(postdeps, $1) " in
*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
esac
_LT_TAGVAR(compiler_lib_search_dirs, $1)=
if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
_LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
fi
_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
[The directories searched by this compiler when creating a shared library])
_LT_TAGDECL([], [predep_objects], [1],
[Dependencies to place before and after the objects being linked to
create a shared library])
_LT_TAGDECL([], [postdep_objects], [1])
_LT_TAGDECL([], [predeps], [1])
_LT_TAGDECL([], [postdeps], [1])
_LT_TAGDECL([], [compiler_lib_search_path], [1],
[The library search path used internally by the compiler when linking
a shared library])
])# _LT_SYS_HIDDEN_LIBDEPS
# _LT_LANG_F77_CONFIG([TAG])
# --------------------------
# Ensure that the configuration variables for a Fortran 77 compiler are
# suitably defined. These variables are subsequently used by _LT_CONFIG
# to write the compiler configuration to `libtool'.
m4_defun([_LT_LANG_F77_CONFIG],
[AC_LANG_PUSH(Fortran 77)
if test -z "$F77" || test "X$F77" = "Xno"; then
_lt_disable_F77=yes
fi
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_TAGVAR(allow_undefined_flag, $1)=
_LT_TAGVAR(always_export_symbols, $1)=no
_LT_TAGVAR(archive_expsym_cmds, $1)=
_LT_TAGVAR(export_dynamic_flag_spec, $1)=
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_direct_absolute, $1)=no
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
_LT_TAGVAR(hardcode_libdir_separator, $1)=
_LT_TAGVAR(hardcode_minus_L, $1)=no
_LT_TAGVAR(hardcode_automatic, $1)=no
_LT_TAGVAR(inherit_rpath, $1)=no
_LT_TAGVAR(module_cmds, $1)=
_LT_TAGVAR(module_expsym_cmds, $1)=
_LT_TAGVAR(link_all_deplibs, $1)=unknown
_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
_LT_TAGVAR(reload_flag, $1)=$reload_flag
_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
_LT_TAGVAR(no_undefined_flag, $1)=
_LT_TAGVAR(whole_archive_flag_spec, $1)=
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
# Source file extension for f77 test sources.
ac_ext=f
# Object file extension for compiled f77 test sources.
objext=o
_LT_TAGVAR(objext, $1)=$objext
# No sense in running all these tests if we already determined that
# the F77 compiler isn't working. Some variables (like enable_shared)
# are currently assumed to apply to all compilers on this platform,
# and will be corrupted by setting them based on a non-working compiler.
if test "$_lt_disable_F77" != yes; then
# Code to be used in simple compile tests
lt_simple_compile_test_code="\
subroutine t
return
end
"
# Code to be used in simple link tests
lt_simple_link_test_code="\
program t
end
"
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
_LT_TAG_COMPILER
# save warnings/boilerplate of simple test code
_LT_COMPILER_BOILERPLATE
_LT_LINKER_BOILERPLATE
# Allow CC to be a program name with arguments.
lt_save_CC="$CC"
lt_save_GCC=$GCC
lt_save_CFLAGS=$CFLAGS
CC=${F77-"f77"}
CFLAGS=$FFLAGS
compiler=$CC
_LT_TAGVAR(compiler, $1)=$CC
_LT_CC_BASENAME([$compiler])
GCC=$G77
if test -n "$compiler"; then
AC_MSG_CHECKING([if libtool supports shared libraries])
AC_MSG_RESULT([$can_build_shared])
AC_MSG_CHECKING([whether to build shared libraries])
test "$can_build_shared" = "no" && enable_shared=no
# On AIX, shared libraries and static libraries use the same namespace, and
# are all built from PIC.
case $host_os in
aix3*)
test "$enable_shared" = yes && enable_static=no
if test -n "$RANLIB"; then
archive_cmds="$archive_cmds~\$RANLIB \$lib"
postinstall_cmds='$RANLIB $lib'
fi
;;
aix[[4-9]]*)
if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
test "$enable_shared" = yes && enable_static=no
fi
;;
esac
AC_MSG_RESULT([$enable_shared])
AC_MSG_CHECKING([whether to build static libraries])
# Make sure either enable_shared or enable_static is yes.
test "$enable_shared" = yes || enable_static=yes
AC_MSG_RESULT([$enable_static])
_LT_TAGVAR(GCC, $1)="$G77"
_LT_TAGVAR(LD, $1)="$LD"
## CAVEAT EMPTOR:
## There is no encapsulation within the following macros, do not change
## the running order or otherwise move them around unless you know exactly
## what you are doing...
_LT_COMPILER_PIC($1)
_LT_COMPILER_C_O($1)
_LT_COMPILER_FILE_LOCKS($1)
_LT_LINKER_SHLIBS($1)
_LT_SYS_DYNAMIC_LINKER($1)
_LT_LINKER_HARDCODE_LIBPATH($1)
_LT_CONFIG($1)
fi # test -n "$compiler"
GCC=$lt_save_GCC
CC="$lt_save_CC"
CFLAGS="$lt_save_CFLAGS"
fi # test "$_lt_disable_F77" != yes
AC_LANG_POP
])# _LT_LANG_F77_CONFIG
# _LT_LANG_FC_CONFIG([TAG])
# -------------------------
# Ensure that the configuration variables for a Fortran compiler are
# suitably defined. These variables are subsequently used by _LT_CONFIG
# to write the compiler configuration to `libtool'.
m4_defun([_LT_LANG_FC_CONFIG],
[AC_LANG_PUSH(Fortran)
if test -z "$FC" || test "X$FC" = "Xno"; then
_lt_disable_FC=yes
fi
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_TAGVAR(allow_undefined_flag, $1)=
_LT_TAGVAR(always_export_symbols, $1)=no
_LT_TAGVAR(archive_expsym_cmds, $1)=
_LT_TAGVAR(export_dynamic_flag_spec, $1)=
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_direct_absolute, $1)=no
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
_LT_TAGVAR(hardcode_libdir_separator, $1)=
_LT_TAGVAR(hardcode_minus_L, $1)=no
_LT_TAGVAR(hardcode_automatic, $1)=no
_LT_TAGVAR(inherit_rpath, $1)=no
_LT_TAGVAR(module_cmds, $1)=
_LT_TAGVAR(module_expsym_cmds, $1)=
_LT_TAGVAR(link_all_deplibs, $1)=unknown
_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
_LT_TAGVAR(reload_flag, $1)=$reload_flag
_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
_LT_TAGVAR(no_undefined_flag, $1)=
_LT_TAGVAR(whole_archive_flag_spec, $1)=
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
# Source file extension for fc test sources.
ac_ext=${ac_fc_srcext-f}
# Object file extension for compiled fc test sources.
objext=o
_LT_TAGVAR(objext, $1)=$objext
# No sense in running all these tests if we already determined that
# the FC compiler isn't working. Some variables (like enable_shared)
# are currently assumed to apply to all compilers on this platform,
# and will be corrupted by setting them based on a non-working compiler.
if test "$_lt_disable_FC" != yes; then
# Code to be used in simple compile tests
lt_simple_compile_test_code="\
subroutine t
return
end
"
# Code to be used in simple link tests
lt_simple_link_test_code="\
program t
end
"
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
_LT_TAG_COMPILER
# save warnings/boilerplate of simple test code
_LT_COMPILER_BOILERPLATE
_LT_LINKER_BOILERPLATE
# Allow CC to be a program name with arguments.
lt_save_CC="$CC"
lt_save_GCC=$GCC
lt_save_CFLAGS=$CFLAGS
CC=${FC-"f95"}
CFLAGS=$FCFLAGS
compiler=$CC
GCC=$ac_cv_fc_compiler_gnu
_LT_TAGVAR(compiler, $1)=$CC
_LT_CC_BASENAME([$compiler])
if test -n "$compiler"; then
AC_MSG_CHECKING([if libtool supports shared libraries])
AC_MSG_RESULT([$can_build_shared])
AC_MSG_CHECKING([whether to build shared libraries])
test "$can_build_shared" = "no" && enable_shared=no
# On AIX, shared libraries and static libraries use the same namespace, and
# are all built from PIC.
case $host_os in
aix3*)
test "$enable_shared" = yes && enable_static=no
if test -n "$RANLIB"; then
archive_cmds="$archive_cmds~\$RANLIB \$lib"
postinstall_cmds='$RANLIB $lib'
fi
;;
aix[[4-9]]*)
if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
test "$enable_shared" = yes && enable_static=no
fi
;;
esac
AC_MSG_RESULT([$enable_shared])
AC_MSG_CHECKING([whether to build static libraries])
# Make sure either enable_shared or enable_static is yes.
test "$enable_shared" = yes || enable_static=yes
AC_MSG_RESULT([$enable_static])
_LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
_LT_TAGVAR(LD, $1)="$LD"
## CAVEAT EMPTOR:
## There is no encapsulation within the following macros, do not change
## the running order or otherwise move them around unless you know exactly
## what you are doing...
_LT_SYS_HIDDEN_LIBDEPS($1)
_LT_COMPILER_PIC($1)
_LT_COMPILER_C_O($1)
_LT_COMPILER_FILE_LOCKS($1)
_LT_LINKER_SHLIBS($1)
_LT_SYS_DYNAMIC_LINKER($1)
_LT_LINKER_HARDCODE_LIBPATH($1)
_LT_CONFIG($1)
fi # test -n "$compiler"
GCC=$lt_save_GCC
CC=$lt_save_CC
CFLAGS=$lt_save_CFLAGS
fi # test "$_lt_disable_FC" != yes
AC_LANG_POP
])# _LT_LANG_FC_CONFIG
# _LT_LANG_GCJ_CONFIG([TAG])
# --------------------------
# Ensure that the configuration variables for the GNU Java Compiler compiler
# are suitably defined. These variables are subsequently used by _LT_CONFIG
# to write the compiler configuration to `libtool'.
m4_defun([_LT_LANG_GCJ_CONFIG],
[AC_REQUIRE([LT_PROG_GCJ])dnl
AC_LANG_SAVE
# Source file extension for Java test sources.
ac_ext=java
# Object file extension for compiled Java test sources.
objext=o
_LT_TAGVAR(objext, $1)=$objext
# Code to be used in simple compile tests
lt_simple_compile_test_code="class foo {}"
# Code to be used in simple link tests
lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
_LT_TAG_COMPILER
# save warnings/boilerplate of simple test code
_LT_COMPILER_BOILERPLATE
_LT_LINKER_BOILERPLATE
# Allow CC to be a program name with arguments.
lt_save_CC=$CC
lt_save_CFLAGS=$CFLAGS
lt_save_GCC=$GCC
GCC=yes
CC=${GCJ-"gcj"}
CFLAGS=$GCJFLAGS
compiler=$CC
_LT_TAGVAR(compiler, $1)=$CC
_LT_TAGVAR(LD, $1)="$LD"
_LT_CC_BASENAME([$compiler])
# GCJ did not exist at the time GCC didn't implicitly link libc in.
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
_LT_TAGVAR(reload_flag, $1)=$reload_flag
_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
if test -n "$compiler"; then
_LT_COMPILER_NO_RTTI($1)
_LT_COMPILER_PIC($1)
_LT_COMPILER_C_O($1)
_LT_COMPILER_FILE_LOCKS($1)
_LT_LINKER_SHLIBS($1)
_LT_LINKER_HARDCODE_LIBPATH($1)
_LT_CONFIG($1)
fi
AC_LANG_RESTORE
GCC=$lt_save_GCC
CC=$lt_save_CC
CFLAGS=$lt_save_CFLAGS
])# _LT_LANG_GCJ_CONFIG
# _LT_LANG_RC_CONFIG([TAG])
# -------------------------
# Ensure that the configuration variables for the Windows resource compiler
# are suitably defined. These variables are subsequently used by _LT_CONFIG
# to write the compiler configuration to `libtool'.
m4_defun([_LT_LANG_RC_CONFIG],
[AC_REQUIRE([LT_PROG_RC])dnl
AC_LANG_SAVE
# Source file extension for RC test sources.
ac_ext=rc
# Object file extension for compiled RC test sources.
objext=o
_LT_TAGVAR(objext, $1)=$objext
# Code to be used in simple compile tests
lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
# Code to be used in simple link tests
lt_simple_link_test_code="$lt_simple_compile_test_code"
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
_LT_TAG_COMPILER
# save warnings/boilerplate of simple test code
_LT_COMPILER_BOILERPLATE
_LT_LINKER_BOILERPLATE
# Allow CC to be a program name with arguments.
lt_save_CC="$CC"
lt_save_CFLAGS=$CFLAGS
lt_save_GCC=$GCC
GCC=
CC=${RC-"windres"}
CFLAGS=
compiler=$CC
_LT_TAGVAR(compiler, $1)=$CC
_LT_CC_BASENAME([$compiler])
_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
if test -n "$compiler"; then
:
_LT_CONFIG($1)
fi
GCC=$lt_save_GCC
AC_LANG_RESTORE
CC=$lt_save_CC
CFLAGS=$lt_save_CFLAGS
])# _LT_LANG_RC_CONFIG
# LT_PROG_GCJ
# -----------
AC_DEFUN([LT_PROG_GCJ],
[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
[m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
[AC_CHECK_TOOL(GCJ, gcj,)
test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
AC_SUBST(GCJFLAGS)])])[]dnl
])
# Old name:
AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
# LT_PROG_RC
# ----------
AC_DEFUN([LT_PROG_RC],
[AC_CHECK_TOOL(RC, windres,)
])
# Old name:
AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([LT_AC_PROG_RC], [])
# _LT_DECL_EGREP
# --------------
# If we don't have a new enough Autoconf to choose the best grep
# available, choose the one first in the user's PATH.
m4_defun([_LT_DECL_EGREP],
[AC_REQUIRE([AC_PROG_EGREP])dnl
AC_REQUIRE([AC_PROG_FGREP])dnl
test -z "$GREP" && GREP=grep
_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
_LT_DECL([], [EGREP], [1], [An ERE matcher])
_LT_DECL([], [FGREP], [1], [A literal string matcher])
dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
AC_SUBST([GREP])
])
# _LT_DECL_OBJDUMP
# --------------
# If we don't have a new enough Autoconf to choose the best objdump
# available, choose the one first in the user's PATH.
m4_defun([_LT_DECL_OBJDUMP],
[AC_CHECK_TOOL(OBJDUMP, objdump, false)
test -z "$OBJDUMP" && OBJDUMP=objdump
_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
AC_SUBST([OBJDUMP])
])
# _LT_DECL_DLLTOOL
# ----------------
# Ensure DLLTOOL variable is set.
m4_defun([_LT_DECL_DLLTOOL],
[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
test -z "$DLLTOOL" && DLLTOOL=dlltool
_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
AC_SUBST([DLLTOOL])
])
# _LT_DECL_SED
# ------------
# Check for a fully-functional sed program, that truncates
# as few characters as possible. Prefer GNU sed if found.
m4_defun([_LT_DECL_SED],
[AC_PROG_SED
test -z "$SED" && SED=sed
Xsed="$SED -e 1s/^X//"
_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
[Sed that helps us avoid accidentally triggering echo(1) options like -n])
])# _LT_DECL_SED
m4_ifndef([AC_PROG_SED], [
# NOTE: This macro has been submitted for inclusion into #
# GNU Autoconf as AC_PROG_SED. When it is available in #
# a released version of Autoconf we should remove this #
# macro and use it instead. #
m4_defun([AC_PROG_SED],
[AC_MSG_CHECKING([for a sed that does not truncate output])
AC_CACHE_VAL(lt_cv_path_SED,
[# Loop through the user's path and test for sed and gsed.
# Then use that list of sed's as ones to test for truncation.
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for lt_ac_prog in sed gsed; do
for ac_exec_ext in '' $ac_executable_extensions; do
if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
fi
done
done
done
IFS=$as_save_IFS
lt_ac_max=0
lt_ac_count=0
# Add /usr/xpg4/bin/sed as it is typically found on Solaris
# along with /bin/sed that truncates output.
for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
test ! -f $lt_ac_sed && continue
cat /dev/null > conftest.in
lt_ac_count=0
echo $ECHO_N "0123456789$ECHO_C" >conftest.in
# Check for GNU sed and select it if it is found.
if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
lt_cv_path_SED=$lt_ac_sed
break
fi
while true; do
cat conftest.in conftest.in >conftest.tmp
mv conftest.tmp conftest.in
cp conftest.in conftest.nl
echo >>conftest.nl
$lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
cmp -s conftest.out conftest.nl || break
# 10000 chars as input seems more than enough
test $lt_ac_count -gt 10 && break
lt_ac_count=`expr $lt_ac_count + 1`
if test $lt_ac_count -gt $lt_ac_max; then
lt_ac_max=$lt_ac_count
lt_cv_path_SED=$lt_ac_sed
fi
done
done
])
SED=$lt_cv_path_SED
AC_SUBST([SED])
AC_MSG_RESULT([$SED])
])#AC_PROG_SED
])#m4_ifndef
# Old name:
AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([LT_AC_PROG_SED], [])
# _LT_CHECK_SHELL_FEATURES
# ------------------------
# Find out whether the shell is Bourne or XSI compatible,
# or has some other useful features.
m4_defun([_LT_CHECK_SHELL_FEATURES],
[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
# Try some XSI features
xsi_shell=no
( _lt_dummy="a/b/c"
test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
= c,a/b,b/c, \
&& eval 'test $(( 1 + 1 )) -eq 2 \
&& test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
&& xsi_shell=yes
AC_MSG_RESULT([$xsi_shell])
_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
AC_MSG_CHECKING([whether the shell understands "+="])
lt_shell_append=no
( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
>/dev/null 2>&1 \
&& lt_shell_append=yes
AC_MSG_RESULT([$lt_shell_append])
_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
lt_unset=unset
else
lt_unset=false
fi
_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
# test EBCDIC or ASCII
case `echo X|tr X '\101'` in
A) # ASCII based system
# \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
lt_SP2NL='tr \040 \012'
lt_NL2SP='tr \015\012 \040\040'
;;
*) # EBCDIC based system
lt_SP2NL='tr \100 \n'
lt_NL2SP='tr \r\n \100\100'
;;
esac
_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
])# _LT_CHECK_SHELL_FEATURES
# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
# ------------------------------------------------------
# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
m4_defun([_LT_PROG_FUNCTION_REPLACE],
[dnl {
sed -e '/^$1 ()$/,/^} # $1 /c\
$1 ()\
{\
m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1])
} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
&& mv -f "$cfgfile.tmp" "$cfgfile" \
|| (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
test 0 -eq $? || _lt_function_replace_fail=:
])
# _LT_PROG_REPLACE_SHELLFNS
# -------------------------
# Replace existing portable implementations of several shell functions with
# equivalent extended shell implementations where those features are available..
m4_defun([_LT_PROG_REPLACE_SHELLFNS],
[if test x"$xsi_shell" = xyes; then
_LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
case ${1} in
*/*) func_dirname_result="${1%/*}${2}" ;;
* ) func_dirname_result="${3}" ;;
esac])
_LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
func_basename_result="${1##*/}"])
_LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
case ${1} in
*/*) func_dirname_result="${1%/*}${2}" ;;
* ) func_dirname_result="${3}" ;;
esac
func_basename_result="${1##*/}"])
_LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
# pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
# positional parameters, so assign one to ordinary parameter first.
func_stripname_result=${3}
func_stripname_result=${func_stripname_result#"${1}"}
func_stripname_result=${func_stripname_result%"${2}"}])
_LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
func_split_long_opt_name=${1%%=*}
func_split_long_opt_arg=${1#*=}])
_LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
func_split_short_opt_arg=${1#??}
func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
_LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
case ${1} in
*.lo) func_lo2o_result=${1%.lo}.${objext} ;;
*) func_lo2o_result=${1} ;;
esac])
_LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo])
_LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))])
_LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}])
fi
if test x"$lt_shell_append" = xyes; then
_LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"])
_LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
func_quote_for_eval "${2}"
dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
# Save a `func_append' function call where possible by direct use of '+='
sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
&& mv -f "$cfgfile.tmp" "$cfgfile" \
|| (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
test 0 -eq $? || _lt_function_replace_fail=:
else
# Save a `func_append' function call even when '+=' is not available
sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
&& mv -f "$cfgfile.tmp" "$cfgfile" \
|| (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
test 0 -eq $? || _lt_function_replace_fail=:
fi
if test x"$_lt_function_replace_fail" = x":"; then
AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
fi
])
# _LT_PATH_CONVERSION_FUNCTIONS
# -----------------------------
# Determine which file name conversion functions should be used by
# func_to_host_file (and, implicitly, by func_to_host_path). These are needed
# for certain cross-compile configurations and native mingw.
m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
AC_MSG_CHECKING([how to convert $build file names to $host format])
AC_CACHE_VAL(lt_cv_to_host_file_cmd,
[case $host in
*-*-mingw* )
case $build in
*-*-mingw* ) # actually msys
lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
;;
*-*-cygwin* )
lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
;;
* ) # otherwise, assume *nix
lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
;;
esac
;;
*-*-cygwin* )
case $build in
*-*-mingw* ) # actually msys
lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
;;
*-*-cygwin* )
lt_cv_to_host_file_cmd=func_convert_file_noop
;;
* ) # otherwise, assume *nix
lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
;;
esac
;;
* ) # unhandled hosts (and "normal" native builds)
lt_cv_to_host_file_cmd=func_convert_file_noop
;;
esac
])
to_host_file_cmd=$lt_cv_to_host_file_cmd
AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
[0], [convert $build file names to $host format])dnl
AC_MSG_CHECKING([how to convert $build file names to toolchain format])
AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
[#assume ordinary cross tools, or native build.
lt_cv_to_tool_file_cmd=func_convert_file_noop
case $host in
*-*-mingw* )
case $build in
*-*-mingw* ) # actually msys
lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
;;
esac
;;
esac
])
to_tool_file_cmd=$lt_cv_to_tool_file_cmd
AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
[0], [convert $build files to toolchain format])dnl
])# _LT_PATH_CONVERSION_FUNCTIONS
# Helper functions for option handling. -*- Autoconf -*-
#
# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
# Inc.
# Written by Gary V. Vaughan, 2004
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# serial 7 ltoptions.m4
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
# ------------------------------------------
m4_define([_LT_MANGLE_OPTION],
[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
# ---------------------------------------
# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
# matching handler defined, dispatch to it. Other OPTION-NAMEs are
# saved as a flag.
m4_define([_LT_SET_OPTION],
[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
_LT_MANGLE_DEFUN([$1], [$2]),
[m4_warning([Unknown $1 option `$2'])])[]dnl
])
# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
# ------------------------------------------------------------
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
m4_define([_LT_IF_OPTION],
[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
# -------------------------------------------------------
# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
# are set.
m4_define([_LT_UNLESS_OPTIONS],
[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
[m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
[m4_define([$0_found])])])[]dnl
m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
])[]dnl
])
# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
# ----------------------------------------
# OPTION-LIST is a space-separated list of Libtool options associated
# with MACRO-NAME. If any OPTION has a matching handler declared with
# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
# the unknown option and exit.
m4_defun([_LT_SET_OPTIONS],
[# Set options
m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
[_LT_SET_OPTION([$1], _LT_Option)])
m4_if([$1],[LT_INIT],[
dnl
dnl Simply set some default values (i.e off) if boolean options were not
dnl specified:
_LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
])
_LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
])
dnl
dnl If no reference was made to various pairs of opposing options, then
dnl we run the default mode handler for the pair. For example, if neither
dnl `shared' nor `disable-shared' was passed, we enable building of shared
dnl archives by default:
_LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
_LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
_LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
_LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
[_LT_ENABLE_FAST_INSTALL])
])
])# _LT_SET_OPTIONS
# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
# -----------------------------------------
m4_define([_LT_MANGLE_DEFUN],
[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
# -----------------------------------------------
m4_define([LT_OPTION_DEFINE],
[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
])# LT_OPTION_DEFINE
# dlopen
# ------
LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
])
AU_DEFUN([AC_LIBTOOL_DLOPEN],
[_LT_SET_OPTION([LT_INIT], [dlopen])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the `dlopen' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
# win32-dll
# ---------
# Declare package support for building win32 dll's.
LT_OPTION_DEFINE([LT_INIT], [win32-dll],
[enable_win32_dll=yes
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
AC_CHECK_TOOL(AS, as, false)
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
AC_CHECK_TOOL(OBJDUMP, objdump, false)
;;
esac
test -z "$AS" && AS=as
_LT_DECL([], [AS], [1], [Assembler program])dnl
test -z "$DLLTOOL" && DLLTOOL=dlltool
_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
test -z "$OBJDUMP" && OBJDUMP=objdump
_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
])# win32-dll
AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
_LT_SET_OPTION([LT_INIT], [win32-dll])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the `win32-dll' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
# _LT_ENABLE_SHARED([DEFAULT])
# ----------------------------
# implement the --enable-shared flag, and supports the `shared' and
# `disable-shared' LT_INIT options.
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
m4_define([_LT_ENABLE_SHARED],
[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([shared],
[AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_shared=yes ;;
no) enable_shared=no ;;
*)
enable_shared=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_shared=yes
fi
done
IFS="$lt_save_ifs"
;;
esac],
[enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
_LT_DECL([build_libtool_libs], [enable_shared], [0],
[Whether or not to build shared libraries])
])# _LT_ENABLE_SHARED
LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
# Old names:
AC_DEFUN([AC_ENABLE_SHARED],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
])
AC_DEFUN([AC_DISABLE_SHARED],
[_LT_SET_OPTION([LT_INIT], [disable-shared])
])
AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AM_ENABLE_SHARED], [])
dnl AC_DEFUN([AM_DISABLE_SHARED], [])
# _LT_ENABLE_STATIC([DEFAULT])
# ----------------------------
# implement the --enable-static flag, and support the `static' and
# `disable-static' LT_INIT options.
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
m4_define([_LT_ENABLE_STATIC],
[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([static],
[AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_static=yes ;;
no) enable_static=no ;;
*)
enable_static=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_static=yes
fi
done
IFS="$lt_save_ifs"
;;
esac],
[enable_static=]_LT_ENABLE_STATIC_DEFAULT)
_LT_DECL([build_old_libs], [enable_static], [0],
[Whether or not to build static libraries])
])# _LT_ENABLE_STATIC
LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
# Old names:
AC_DEFUN([AC_ENABLE_STATIC],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
])
AC_DEFUN([AC_DISABLE_STATIC],
[_LT_SET_OPTION([LT_INIT], [disable-static])
])
AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AM_ENABLE_STATIC], [])
dnl AC_DEFUN([AM_DISABLE_STATIC], [])
# _LT_ENABLE_FAST_INSTALL([DEFAULT])
# ----------------------------------
# implement the --enable-fast-install flag, and support the `fast-install'
# and `disable-fast-install' LT_INIT options.
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
m4_define([_LT_ENABLE_FAST_INSTALL],
[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([fast-install],
[AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
[optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_fast_install=yes ;;
no) enable_fast_install=no ;;
*)
enable_fast_install=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_fast_install=yes
fi
done
IFS="$lt_save_ifs"
;;
esac],
[enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
_LT_DECL([fast_install], [enable_fast_install], [0],
[Whether or not to optimize for fast installation])dnl
])# _LT_ENABLE_FAST_INSTALL
LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
# Old names:
AU_DEFUN([AC_ENABLE_FAST_INSTALL],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
the `fast-install' option into LT_INIT's first parameter.])
])
AU_DEFUN([AC_DISABLE_FAST_INSTALL],
[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
the `disable-fast-install' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
# _LT_WITH_PIC([MODE])
# --------------------
# implement the --with-pic flag, and support the `pic-only' and `no-pic'
# LT_INIT options.
# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
m4_define([_LT_WITH_PIC],
[AC_ARG_WITH([pic],
[AS_HELP_STRING([--with-pic],
[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
[pic_mode="$withval"],
[pic_mode=default])
test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
])# _LT_WITH_PIC
LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
# Old name:
AU_DEFUN([AC_LIBTOOL_PICMODE],
[_LT_SET_OPTION([LT_INIT], [pic-only])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the `pic-only' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
m4_define([_LTDL_MODE], [])
LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
[m4_define([_LTDL_MODE], [nonrecursive])])
LT_OPTION_DEFINE([LTDL_INIT], [recursive],
[m4_define([_LTDL_MODE], [recursive])])
LT_OPTION_DEFINE([LTDL_INIT], [subproject],
[m4_define([_LTDL_MODE], [subproject])])
m4_define([_LTDL_TYPE], [])
LT_OPTION_DEFINE([LTDL_INIT], [installable],
[m4_define([_LTDL_TYPE], [installable])])
LT_OPTION_DEFINE([LTDL_INIT], [convenience],
[m4_define([_LTDL_TYPE], [convenience])])
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
#
# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# serial 6 ltsugar.m4
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
# lt_join(SEP, ARG1, [ARG2...])
# -----------------------------
# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
# associated separator.
# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
# versions in m4sugar had bugs.
m4_define([lt_join],
[m4_if([$#], [1], [],
[$#], [2], [[$2]],
[m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
m4_define([_lt_join],
[m4_if([$#$2], [2], [],
[m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
# lt_car(LIST)
# lt_cdr(LIST)
# ------------
# Manipulate m4 lists.
# These macros are necessary as long as will still need to support
# Autoconf-2.59 which quotes differently.
m4_define([lt_car], [[$1]])
m4_define([lt_cdr],
[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
[$#], 1, [],
[m4_dquote(m4_shift($@))])])
m4_define([lt_unquote], $1)
# lt_append(MACRO-NAME, STRING, [SEPARATOR])
# ------------------------------------------
# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
# Note that neither SEPARATOR nor STRING are expanded; they are appended
# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
# No SEPARATOR is output if MACRO-NAME was previously undefined (different
# than defined and empty).
#
# This macro is needed until we can rely on Autoconf 2.62, since earlier
# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
m4_define([lt_append],
[m4_define([$1],
m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
# ----------------------------------------------------------
# Produce a SEP delimited list of all paired combinations of elements of
# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
# has the form PREFIXmINFIXSUFFIXn.
# Needed until we can rely on m4_combine added in Autoconf 2.62.
m4_define([lt_combine],
[m4_if(m4_eval([$# > 3]), [1],
[m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
[[m4_foreach([_Lt_prefix], [$2],
[m4_foreach([_Lt_suffix],
]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
# -----------------------------------------------------------------------
# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
m4_define([lt_if_append_uniq],
[m4_ifdef([$1],
[m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
[lt_append([$1], [$2], [$3])$4],
[$5])],
[lt_append([$1], [$2], [$3])$4])])
# lt_dict_add(DICT, KEY, VALUE)
# -----------------------------
m4_define([lt_dict_add],
[m4_define([$1($2)], [$3])])
# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
# --------------------------------------------
m4_define([lt_dict_add_subkey],
[m4_define([$1($2:$3)], [$4])])
# lt_dict_fetch(DICT, KEY, [SUBKEY])
# ----------------------------------
m4_define([lt_dict_fetch],
[m4_ifval([$3],
m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
# -----------------------------------------------------------------
m4_define([lt_if_dict_fetch],
[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
[$5],
[$6])])
# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
# --------------------------------------------------------------
m4_define([lt_dict_filter],
[m4_if([$5], [], [],
[lt_join(m4_quote(m4_default([$4], [[, ]])),
lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
[lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
])
# ltversion.m4 -- version numbers -*- Autoconf -*-
#
# Copyright (C) 2004 Free Software Foundation, Inc.
# Written by Scott James Remnant, 2004
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# @configure_input@
# serial 3293 ltversion.m4
# This file is part of GNU Libtool
m4_define([LT_PACKAGE_VERSION], [2.4])
m4_define([LT_PACKAGE_REVISION], [1.3293])
AC_DEFUN([LTVERSION_VERSION],
[macro_version='2.4'
macro_revision='1.3293'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0)
])
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
#
# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
# Written by Scott James Remnant, 2004.
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# serial 5 lt~obsolete.m4
# These exist entirely to fool aclocal when bootstrapping libtool.
#
# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
# which have later been changed to m4_define as they aren't part of the
# exported API, or moved to Autoconf or Automake where they belong.
#
# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
# using a macro with the same name in our local m4/libtool.m4 it'll
# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
# and doesn't know about Autoconf macros at all.)
#
# So we provide this file, which has a silly filename so it's always
# included after everything else. This provides aclocal with the
# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
# because those macros already exist, or will be overwritten later.
# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
#
# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
# Yes, that means every name once taken will need to remain here until
# we give up compatibility with versions before 1.7, at which point
# we need to keep only those names which we still refer to.
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
m4_include([acinclude.m4])
dnsval-2.0/libval_shim/ 0000775 0002372 0002372 00000000000 12111172606 015260 5 ustar hardaker hardaker dnsval-2.0/libval_shim/gen_shim_code.pl 0000664 0002372 0002372 00000004047 10746170214 020412 0 ustar hardaker hardaker #!/usr/bin/perl
use Getopt::Std;
our $header_tmpl = <<'HTMPL';
#include
#define __USE_GNU // This is needed for the RTLD_NEXT definition
#include
#include
#include
#include
#include
#include
#include
#include
#include
HTMPL
our $func_tmpl = <<'FTMPL';
%ret%
%func%(%args%)
{
int (*lib_%func%)(%args%);
char *error;
lib_%func% = dlsym(RTLD_NEXT, "%func%");
if ((error = dlerror()) != NULL) {
fprintf(stderr, "unable to load %func%: %s\n", error);
exit(1);
}
fprintf(stderr, "libval_shim: %func% called: pass-thru\n");
return (%ret%)lib_%func%(%vals%);
}
FTMPL
our $nfunc_tmpl = <<'NFTMPL';
%ret%
%func%(%args%)
{
// int (*lib_%func%)(%args%);
// char *error;
// lib_%func% = dlsym(RTLD_NEXT, "%func%");
//
// if ((error = dlerror()) != NULL) {
// fprintf(stderr, "unable to load %func%: %s\n", error);
// exit(1);
// }
fprintf(stderr, "libval_shim: %func%: called: not-avail\n");
return (%ret%)NULL;
}
NFTMPL
getopts("Ff:o:");
our $infile = $opt_f || "./libval_shim.funcs";
our $outfile = $opt_o || "./libval_shim.c";
our $force = $opt_F;
open(IN,"<$infile") or die "unable to open \"$infile\" for input\n";
if (-f $outfile and not $force) {
die "\"$outfile\" exists and would be overwritten. aborting..\n";
}
open(OUT,">$outfile") or die "unable to open \"$outfile\" for output\n";
while () {
next if /^\s*\#/ or /^\s*$/;
my ($ret, $func, $args, $not_avail) = /^\s*(.*?)\s*(\w+)\s*\(\s*([^\)]+)\s*\)\s*\;\s*(\%not-avail\%)?\s*$/;
my $vals = join(', ', map(/^.*?(\w+)$/, split(/\s*,\s*/, $args)));
undef $vals if $vals =~ /^\s*void\s*$/;
push(@funcs, [$ret, $func, $args, $vals, $not_avail])
}
close(IN);
print OUT $header_tmpl;
foreach $func (@funcs) {
$out = ($func->[4] ? $nfunc_tmpl : $func_tmpl);
$out =~ s/\%ret\%/$func->[0]/g;
$out =~ s/\%func\%/$func->[1]/g;
$out =~ s/\%args\%/$func->[2]/g;
$out =~ s/\%vals\%/$func->[3]/g;
print OUT $out;
}
close(OUT);
dnsval-2.0/libval_shim/Makefile.in 0000664 0002372 0002372 00000001212 11733111275 017325 0 ustar hardaker hardaker
INCL= ../include
EXTRA_LIBS= -L../libsres/.libs -lsres -L../libval/.libs -lval$(LIBVAL_SUFFIX) -lpthread @LDFLAGS@ -lcrypto
CFLAGS_EX=-I$(INCL) -I. -I../libsres -I../libval -D_GNU_SOURCE
SRC= libval_shim.c
# can't use gmake conventions to translate SRC -> OBJ for portability
OBJ= libval_shim.o
LOBJ= libval_shim.lo
LIBVAL_SHIM=libval_shim.la
LT_DIR= .libs
all: $(LIBVAL_SHIM)
clean:
$(RM) -f $(LOBJ) $(OBJ) $(LIBVAL)
$(RM) -rf $(LT_DIR)
$(LIBVAL_SHIM): $(LOBJ)
$(LIBTOOLLD) -o $@ $(LOBJ) $(EXTRA_LIBS)
install:
$(MKPATH) $(DESTDIR)$(libdir)
$(LIBTOOLIN) $(LIBVAL_SHIM) $(DESTDIR)$(libdir)
$(LIBTOOLFN) $(DESTDIR)$(libdir)
dnsval-2.0/libval_shim/README.libval_shim 0000664 0002372 0002372 00000003303 10772456127 020445 0 ustar hardaker hardaker
# Copyright 2004-2008 SPARTA, Inc. All rights reserved.
# See the COPYING file included with the dnssec-tools package for details.
Validator Shim Library
The validator shim library ('libval_shim.so') is a shared library
designed to be dynamically loaded using the 'LD_PRELOAD' mechanism
supported on linux and various other unix-like platforms. The shim
library implements wrappers for a number of DNS related functions and
in turn calls equivalent DNSSEC-aware validating functions from
'libval', mapping the results to return codes recognized by the
original functions. In this way a wide variety of applications can be
made DNSSEC aware without code changes and recompilation.
The method of mapping return codes assumes that any 'untrusted' or
failure result from the 'libval' function is reflected as a failure to
the original calling function.
Usage:
To load the library set LD_PRELOAD variable within the environment
of the the target application prior to execution:
export LD_PRELOAD=libval_shim.so
Validation Policy:
The validator shim library will create a policy context and cache
it for all subsequent 'libval' calls. A "NULL" policy label will be
passed to create the context. The policy is chosen according to
rules defined for 'libval'.
See 'man dnsval.conf' for information on policy labels and definition.
Logging:
Logging for the 'libval' functions may be enabled in the shim
library by setting an environment variable
See 'man validate' for specifics.
Notes:
1) setuid and setgid root programs (e.g., ping) do not honor the
LD_PRELOAD setting. These application may still use the LD_PRELOAD
mechanism when run directly from a root shell. dnsval-2.0/libval_shim/libval_shim.funcs 0000664 0002372 0002372 00000003007 10746170214 020616 0 ustar hardaker hardaker struct hostent * gethostbyname(const char *name);
int gethostbyname_r(__const char * __name,struct hostent * __result_buf, char * __buf, size_t __buflen, struct hostent ** __result, int * __h_errnop);
struct hostent * gethostbyaddr(__const void *addr, __socklen_t len, int type);
struct hostent *gethostbyname2 (__const char *__name, int __af);
int gethostbyname2_r (__const char * __name, int __af, struct hostent * __result_buf, char * __buf, size_t __buflen, struct hostent ** __result, int * __h_errnop);
int getaddrinfo(const char *node, const char *service, const struct addrinfo *hints, struct addrinfo **res);
void freeaddrinfo (struct addrinfo *ai);
int getnameinfo(__const struct sockaddr * sa, socklen_t salen,char * host, socklen_t hostlen, char *serv, socklen_t servlen, unsigned int flags);
int res_init(void);
int res_query(const char *dname, int class, int type, unsigned char *answer, int anslen);
int res_querydomain(const char *name, const char *domain, int class, int type, u_char * answer, int anslen);
int res_search(const char *dname, int class, int type, unsigned char *answer, int anslen);
int res_send(const u_char * msg, int msglin, u_char *answer, int anslen);
struct hostent *getipnodebyname(const char *name, int af, int flags, int *error_num); %not-avail%
struct hostent *getipnodebyaddr(const void *addr, size_t len, int af, int *error_num); %not-avail%
int getrrsetbyname(const char *hostname, unsigned int rdclass, unsigned int rdtype, unsigned int flags, struct rrsetinfo **res); %not-avail%
dnsval-2.0/libval_shim/libval_shim.c 0000664 0002372 0002372 00000017307 11732377265 017745 0 ustar hardaker hardaker #include "validator/validator-config.h"
#include
#include
#include
#ifdef __linux__
#define getprogname() program_invocation_short_name
#endif
typedef struct libval_context ValContext;
static ValContext *libval_shim_ctx = NULL;
static int
libval_shim_context(void)
{
if (libval_shim_ctx == NULL) {
if (val_create_context(NULL, &libval_shim_ctx) != VAL_NO_ERROR)
return -1;
}
return 0;
}
static int
libval_shim_init(void)
{
return (libval_shim_context());
}
struct hostent *
gethostbyname(const char *name)
{
val_status_t val_status;
struct hostent * res;
if (libval_shim_init())
return NULL;
val_log(NULL, LOG_DEBUG, "libval_shim: gethostbyname(%s) called: wrapper\n", name);
res = val_gethostbyname(libval_shim_ctx, name, &val_status);
if (val_istrusted(val_status) && !val_does_not_exist(val_status)) {
return res;
}
return (NULL);
}
#ifdef R_FUNCS_RETURN_STRUCT
struct hostent *
gethostbyname_r(const char * name,struct hostent * result_buf, char * buf,
int buflen, int * h_errnop)
{
val_status_t val_status;
int ret;
struct hostent *result = NULL;
if (libval_shim_init())
return NULL;
val_log(NULL, LOG_DEBUG, "libval_shim: gethostbyname_r(%s) called: wrapper\n", name);
ret =
val_gethostbyname_r(libval_shim_ctx, name, result_buf, buf, buflen,
&result, h_errnop,
&val_status);
if (val_istrusted(val_status) && !val_does_not_exist(val_status)) {
return result;
}
return (NULL);
}
#endif
#ifndef R_FUNCS_RETURN_STRUCT
int
gethostbyname_r(__const char * name,struct hostent * result_buf, char * buf,
size_t buflen, struct hostent ** result, int * h_errnop)
{
val_status_t val_status;
int ret;
if (libval_shim_init())
return NO_RECOVERY;
val_log(NULL, LOG_DEBUG, "libval_shim: gethostbyname_r(%s) called: wrapper\n", name);
ret =
val_gethostbyname_r(libval_shim_ctx, name, result_buf, buf, buflen,
result, h_errnop,
&val_status);
if (val_istrusted(val_status) && !val_does_not_exist(val_status)) {
return ret;
}
return (HOST_NOT_FOUND);
}
#endif
struct hostent *
#if defined(GETHOSTBYADDR_USES_CHAR_INT)
gethostbyaddr(const char *addr, int len, int type)
#elif defined(GETHOSTBYADDR_USES_VOID_SOCKLEN)
gethostbyaddr(const void *addr, socklen_t len, int type)
#elif defined(GETHOSTBYADDR_USES_VOID_INT)
gethostbyaddr(const void *addr, int len, int type)
#else
/* GUESSSSSS */
gethostbyaddr(const char *addr, socklen_t len, int type)
#endif
{
if (libval_shim_init())
return NULL;
val_log(NULL, LOG_DEBUG, "libval_shim: gethostbyaddr called: not-available\n");
return NULL;
}
struct hostent *
gethostbyname2(__const char *__name, int __af)
{
if (libval_shim_init())
return NULL;
val_log(NULL, LOG_DEBUG, "libval_shim: gethostbyname2 called: not-available\n");
return NULL;
}
int
gethostbyname2_r(__const char * name, int af, struct hostent * result_buf,
char * buf, size_t buflen, struct hostent ** result,
int * h_errnop)
{
if (libval_shim_init())
return EAI_FAIL;
val_log(NULL, LOG_DEBUG, "libval_shim: gethostbyname2_r called: not-available\n");
return EAI_FAIL;
}
int
getaddrinfo(const char *node, const char *service, const struct addrinfo *hints,
struct addrinfo **res)
{
val_status_t val_status;
int ret;
if (libval_shim_init())
return EAI_FAIL;
val_log(NULL, LOG_DEBUG, "libval_shim: getaddrinfo(%s, %s) called: wrapper\n",
node, service);
ret = val_getaddrinfo(libval_shim_ctx, node, service, hints, res, &val_status);
if (val_istrusted(val_status) && !val_does_not_exist(val_status)) {
return ret;
}
return (EAI_NONAME);
}
#if defined(GETNAMEINFO_USES_SOCKLEN_AND_UINT)
int
getnameinfo(const struct sockaddr * sa, socklen_t salen, char * host,
socklen_t hostlen, char *serv, socklen_t servlen,
unsigned int flags)
#elif defined(GETNAMEINFO_USES_SOCKLEN_AND_INT)
int
getnameinfo(const struct sockaddr * sa, socklen_t salen, char * host,
socklen_t hostlen, char *serv, socklen_t servlen, int flags)
#elif defined(GETNAMEINFO_USES_SIZET_AND_INT)
int
getnameinfo(const struct sockaddr * sa, socklen_t salen, char * host,
size_t hostlen, char *serv, size_t servlen, int flags)
#else
/* GUESSSSSS */
int
getnameinfo(const struct sockaddr * sa, socklen_t salen, char * host,
socklen_t hostlen, char *serv, socklen_t servlen,
unsigned int flags)
#endif
{
val_status_t val_status;
char addrbuf[INET6_ADDRSTRLEN + 1];
const char *addr;
int ret;
if (libval_shim_init())
return EAI_FAIL;
if (sa->sa_family == AF_INET) {
addr = inet_ntop(AF_INET, &((const struct sockaddr_in*)sa)->sin_addr,
addrbuf, sizeof(addrbuf));
} else if (sa->sa_family == AF_INET6) {
addr = inet_ntop(AF_INET6, &((const struct sockaddr_in6*)sa)->sin6_addr,
addrbuf, sizeof(addrbuf));
} else {
return EAI_FAMILY;
}
val_log(NULL, LOG_DEBUG, "libval_shim: getnameinfo(%s) called: wrapper\n",
addr);
ret = val_getnameinfo(libval_shim_ctx, sa, salen, host, hostlen,
serv, servlen, flags,
&val_status);
val_log(NULL,LOG_DEBUG,"libval_shim: getnameinfo(%s) = (%s:%s) ret = %d\n",
addr, host, serv, ret);
if (val_istrusted(val_status) && !val_does_not_exist(val_status)) {
return ret;
}
return (EAI_NONAME);
}
int
res_init(void)
{
val_log(NULL, LOG_DEBUG, "libval_shim: res_init called: wrapper\n");
return (libval_shim_init());
}
int
res_query(const char *dname, int class_h, int type_h,
unsigned char *answer, int anslen)
{
val_status_t val_status;
int ret;
if (libval_shim_init())
return -1;
val_log(NULL, LOG_DEBUG, "libval_shim: res_query(%s,%d,%d) called: wrapper\n",
dname, class_h, type_h);
ret = val_res_query(libval_shim_ctx, dname, class_h, type_h, answer, anslen,
&val_status);
if (val_istrusted(val_status) && !val_does_not_exist(val_status)) {
return ret;
}
return (-1);
}
int
res_querydomain(const char *name, const char *domain, int class_h, int type_h,
u_char * answer, int anslen)
{
val_log(NULL, LOG_DEBUG, "libval_shim: res_querydomain called: not-available\n");
return -1;
}
int
res_search(const char *dname, int class_h, int type_h,
unsigned char *answer, int anslen)
{
val_log(NULL, LOG_DEBUG, "libval_shim: res_search called: not-available\n");
return -1;
}
int
res_send(const u_char * msg, int msglin, u_char *answer, int anslen)
{
val_log(NULL, LOG_DEBUG, "libval_shim: res_send called: not-available\n");
return -1;
}
struct hostent *
getipnodebyname(const char *name, int af, int flags, int *error_num)
{
val_log(NULL,LOG_DEBUG,"libval_shim: getipnodebyname: called: not-available\n");
return (struct hostent *)NULL;
}
struct hostent *
getipnodebyaddr(const void *addr, size_t len, int af, int *error_num)
{
val_log(NULL,LOG_DEBUG,"libval_shim: getipnodebyaddr: called: not-available\n");
return (struct hostent *)NULL;
}
/* int
getrrsetbyname(const char *hostname, unsigned int rdclass, unsigned int rdtype, unsigned int flags, struct rrsetinfo **res)
{
// int (*lib_getrrsetbyname)(const char *hostname, unsigned int rdclass, unsigned int rdtype, unsigned int flags, struct rrsetinfo **res);
// char *error;
// lib_getrrsetbyname = dlsym(RTLD_NEXT, "getrrsetbyname");
//
// if ((error = dlerror()) != NULL) {
// val_log(NULL, LOG_DEBUG, "unable to load getrrsetbyname: %s\n", error);
// exit(1);
// }
val_log(NULL, LOG_DEBUG, "libval_shim: getrrsetbyname: called: not-avail\n");
return (int)NULL;
}
*/
dnsval-2.0/README 0000664 0002372 0002372 00000012731 12071065274 013662 0 ustar hardaker hardaker # Copyright 2004-2013 SPARTA, Inc. All rights reserved.
# See the COPYING file included with the dnssec-tools package for details.
DNSSEC-Tools
Is your domain secure?
This directory contains the implementation for the DNSSEC validator library.
The contents are structured as follows:
doc:
Documentation for the libval and libsres libraries.
libval:
A library that provides DNSSEC resource-record validation functionality.
libsres:
A library that is capable of sending queries to, and receiving answers
from a DNSSEC-aware name server.
apps:
Utility programs for the validator.
etc:
Configuration files for the validator.
include:
Header files required to build the validator.
Building and installing
=======================
The validator library is normally configured, compiled and installed through
the normal build process for the DNSSEC-Tools suite. The validator library
can be optionally configured with/without support for the following modules:
--without-nsec3 : don't include support for NSEC3
--without-dlv : don't include support for Dynamic Lookaside Validation (DLV)
--without-ipv6 : don't include support for IPv6
Typical sequence is
$ ./configure
$ make
$ sudo make install
The validator module honors the --prefix option in that it will install
libraries and binaries in the expected locations and looks for configuration
files in the correct $prefix/dnssec-tools/etc directory; except for the
root.hints file, which the validator will try to locate in various standard
system directories. The validator module also allows the user to override the
default locations for these configuration files during the ./configure
process. However, in no case will 'make install' actually install any
configure files in the directory specified. The user must install these files
manually.
The validator module supports hard-coded default policies for its
validator policy, its root hints data and for its resolver policy. These can
be specified through the --with-inline-dnsval-conf, --with-inline-root-hints
and --with-inline-resolv-conf configure options respectively.
As an example:
$ ./configure --prefix=/usr/local/opt --with-openssl=/opt/local \
--with-inline-dnsval-conf=etc/dnsval.conf.default \
--with-inline-root-hints=etc/root.hints
Building on Windows
====================
The validator library supports three different ways of building for Windows
a) Building with MinGW/MSYS
- First build the openssl library using the following command line options
$ ./config -D__USE_MINGW_ANSI_STDIO=0 --prefix=/path/to/openssl
$ make install
- Configure the validator as follows:
$ CPPFLAGS='-D__USE_MINGW_ANSI_STDIO=0'\
CFLAGS='-g -mwindows -mconsole'\
./configure --with-openssl=/path/to/openssl\
--prefix=/install/path \
--with-resolv-conf=resolv.txt --with-root-hints=root.txt\
--with-dnsval-conf=dnsval.txt \
--with-inline-dnsval-conf=etc/dnsval.conf \
--with-inline-root-hints=etc/root.hints
- Build the library and command-line apps
$ make windows
$ make windows-install
b) Building DLLs using nmake
(This method is made available courtesy Bob Novas.)
- Download and install perl from http://www.activestate.com/activeperl/downloads
- Open a command window and setup the environment using one of the two scripts:
C:\> vcvars32 (for a 32-bit system)
C:\> vcvars64 (for a 64-bit system)
- Build openssl for 64-bit systems as follows
> perl Configure --prefix="C:\path\to\openssl" VC-WIN64A
> ms\do_win64a
> nmake -f ms\ntdll.mak
> nmake -f ms\ntdll.mak install
- Build openssl for 32-bit systems as follows
> perl Configure --prefix="C:\path\to\openssl" VC-WIN32
> ms\do_ms
> nmake -f ms\ntdll.mak
> nmake -f ms\ntdll.mak install
- Build the validator library for 32-bit systems as follows
> nmake -f windows.mak win32
- Build the validator library for 32-bit systems as follows
> nmake -f windows.mak win64
The DLLs are created in the validator\Debug directory.
c) Cross-compiling for Windows
This instructions were tested on OSX 10.6. The instructions for
other platforms are likely going to be quite similar.
- Install mingw pre-requisites
$ sudo port install i386-mingw32-binutils i386-mingw32-runtime \
i386-mingw32-w32api i386-mingw32-gcc
- Bild the openssl library using the following command line options
$ ./Configure -D__USE_MINGW_ANSI_STDIO=0 \
--cross-compile-prefix=i386-mingw32- \
mingw --prefix=/usr/local/opt/mingw-dnssec
$ sudo make install
- Build the validator library as follows
$ PATH="/opt/local/i386-mingw32/bin:$PATH" \
LDFLAGS="-L/opt/local/i386-mingw32/lib" \
CPPFLAGS="-D__USE_MINGW_ANSI_STDIO=0" \
CFLAGS='-mwindows -mconsole' \
./configure --disable-option-checking \
--with-openssl=/usr/local/opt/mingw-dnssec \
--with-resolv-conf=resolv.txt \
--with-root-hints=root.txt \
--with-dnsval-conf=dnsval.txt \
--with-inline-dnsval-conf=etc/dnsval.conf.default \
--with-inline-root-hints=etc/root.hints \
--host=i386-mingw32 \
--prefix=/usr/local/opt/mingw-dnssec
- Build and install the library and command-line apps
$ make windows
$ sudo make windows-install
dnsval-2.0/apps/ 0000775 0002372 0002372 00000000000 12111172614 013731 5 ustar hardaker hardaker dnsval-2.0/apps/dnssec-system-tray/ 0000775 0002372 0002372 00000000000 12111172614 017507 5 ustar hardaker hardaker dnsval-2.0/apps/dnssec-system-tray/DnssecSystemTrayPrefs.cpp 0000664 0002372 0002372 00000007102 11706334100 024476 0 ustar hardaker hardaker #include "DnssecSystemTrayPrefs.h"
#include
#include
#include
#include
#include
#include
DnssecSystemTrayPrefs::DnssecSystemTrayPrefs(QWidget *parent) :
QDialog(parent)
{
readLogFiles();
setupWindow();
}
void
DnssecSystemTrayPrefs::setupWindow() {
QSettings settings("DNSSEC-Tools", "dnssec-system-tray");
QLabel *label;
m_topLayout = new QVBoxLayout();
m_topLayout->addLayout(m_formLayout = new QFormLayout());
QHBoxLayout *hbox = new QHBoxLayout();
m_logFile = new QTextEdit();
hbox->addWidget(m_logFile);
QPushButton *browserButton = new QPushButton(tr("Browse..."));
hbox->addWidget(browserButton);
connect(browserButton, SIGNAL(clicked()), this, SLOT(openBrowseWindow()));
m_formLayout->addRow(tr("Log File(s) to Watch(either bind-named, unbound or libval logs)
"), hbox);
m_formLayout->addRow(new QLabel(""), label = new QLabel(""));
QFont font = label->font();
font.setItalic(true);
label->setFont(font);
m_logFile->setText(m_logFileList.join("\n"));
m_formLayout->addRow(tr("Number of Log Messages to Keep"), m_logNumber = new QSpinBox());
m_logNumber->setRange(1, 1000);
m_logNumber->setValue(settings.value("logNumber", 5).toInt());
m_formLayout->addRow(tr("Show still-running warning on close:"),
m_stillRunningWarning = new QCheckBox());
m_stillRunningWarning->setChecked(settings.value("stillRunningWarning", true).toBool());
QDialogButtonBox *buttonBox;
buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok |
QDialogButtonBox::Cancel,
Qt::Horizontal, this);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(savePrefs()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
m_topLayout->addWidget(buttonBox);
setLayout(m_topLayout);
setMinimumSize(640,400);
}
void
DnssecSystemTrayPrefs::readLogFiles()
{
QSettings settings("DNSSEC-Tools", "dnssec-system-tray");
int numFiles = settings.beginReadArray("logFileList");
for(int i = 0 ; i < numFiles; i++) {
settings.setArrayIndex(i);
m_logFileList.push_back(settings.value("logFile").toString());
}
settings.endArray();
}
void
DnssecSystemTrayPrefs::savePrefs() {
QSettings settings("DNSSEC-Tools", "dnssec-system-tray");
settings.setValue("logNumber", m_logNumber->value());
settings.setValue("stillRunningWarning", m_stillRunningWarning->isChecked());
// create the list of files
listFromString();
// save the list of log files
settings.beginWriteArray("logFileList");
int count = 0;
foreach(QString logFile, m_logFileList) {
settings.setArrayIndex(count);
settings.setValue("logFile", logFile);
count++;
}
settings.endArray();
accept();
}
void DnssecSystemTrayPrefs::openBrowseWindow()
{
QFileDialog dialog;
dialog.setAcceptMode(QFileDialog::AcceptOpen);
dialog.setFileMode(QFileDialog::ExistingFiles);
foreach(QString logFile, m_logFileList) {
dialog.selectFile(logFile);
}
if (!dialog.exec())
return;
m_logFile->setText(dialog.selectedFiles().join("\n"));
listFromString();
}
void DnssecSystemTrayPrefs::listFromString() {
m_logFileList.clear();
foreach(QString logFile, m_logFile->toPlainText().split("\n", QString::SkipEmptyParts)) {
if (!logFile.isEmpty()) {
m_logFileList.append(logFile);
}
}
}
dnsval-2.0/apps/dnssec-system-tray/COPYING 0000664 0002372 0002372 00000011145 12107536543 020556 0 ustar hardaker hardaker Copyright (c) 2013-2013, Parsons, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of SPARTA, Inc nor the names of its contributors may
be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Copyright (c) 2010-2012, SPARTA, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of SPARTA, Inc nor the names of its contributors may
be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Portions (timesub macro) use this license:
Copyright (c) 1982, 1986, 1993
The Regents of the University of California. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
dnsval-2.0/apps/dnssec-system-tray/dnssec-system-tray.pro 0000664 0002372 0002372 00000002035 11651617724 024025 0 ustar hardaker hardaker TARGET=dnssec-system-tray
HEADERS = dnssec-system-tray.h \
DnssecSystemTrayPrefs.h
SOURCES = main.cpp \
dnssec-system-tray.cpp \
DnssecSystemTrayPrefs.cpp
RESOURCES = dnssec-system-tray.qrc
QT += xml svg
include(deployment.pri)
qtcAddDeployment()
BINDIR = $$PREFIX/bin
DATADIR =$$PREFIX/share
INSTALLS += target
# install
target.path = $$BINDIR
INSTALLS += target
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
wince* {
CONFIG(debug, release|debug) {
addPlugins.sources = $$QT_BUILD_TREE/plugins/imageformats/qsvgd4.dll
}
CONFIG(release, release|debug) {
addPlugins.sources = $$QT_BUILD_TREE/plugins/imageformats/qsvg4.dll
}
addPlugins.path = imageformats
DEPLOYMENT += addPlugins
}
OTHER_FILES += \
qtc_packaging/debian_fremantle/rules \
qtc_packaging/debian_fremantle/README \
qtc_packaging/debian_fremantle/copyright \
qtc_packaging/debian_fremantle/control \
qtc_packaging/debian_fremantle/compat \
qtc_packaging/debian_fremantle/changelog
dnsval-2.0/apps/dnssec-system-tray/dnssec-system-tray.cpp 0000664 0002372 0002372 00000032117 12111167425 024001 0 ustar hardaker hardaker /****************************************************************************
**
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
** the names of its contributors may be used to endorse or promote
** products derived from this software without specific prior written
** permission.
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
** $QT_END_LICENSE$
**
****************************************************************************/
#include
#include
#include "dnssec-system-tray.h"
#include "DnssecSystemTrayPrefs.h"
Window::Window()
: m_icon(":/images/justlock.png"), m_logFiles(), m_logStreams(), m_fileWatcher(0),
m_maxRows(5), m_rowCount(0), m_warningIcon(":/images/trianglewarning.png")
{
loadPreferences(true);
createLogWidgets();
createActions();
createTrayIcon();
createMenus();
QWidget *widget = new QWidget();
widget->setLayout(m_topLayout);
setCentralWidget(widget);
createRegexps();
// setup the tray icon
trayIcon->setToolTip(tr("Shows the status of DNSSEC Requests on the system"));
trayIcon->setIcon(m_icon);
setWindowIcon(m_icon);
connect(trayIcon, SIGNAL(messageClicked()), this, SLOT(messageClicked()));
connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
trayIcon->show();
setWindowTitle(tr("DNSSEC Log Messages"));
}
void Window::loadPreferences(bool seekToEnd) {
if (m_fileWatcher) {
delete m_fileWatcher;
m_fileWatcher = 0;
}
QSettings settings("DNSSEC-Tools", "dnssec-system-tray");
m_maxRows = settings.value("logNumber", 5).toInt();
m_showStillRunningWarning = settings.value("stillRunningWarning", true).toBool();
readLogFileNames();
openLogFiles(seekToEnd);
}
void
Window::readLogFileNames()
{
m_fileNames.clear();
QSettings settings("DNSSEC-Tools", "dnssec-system-tray");
int numFiles = settings.beginReadArray("logFileList");
for(int i = 0 ; i < numFiles; i++) {
settings.setArrayIndex(i);
m_fileNames.push_back(settings.value("logFile").toString());
}
settings.endArray();
}
void Window::toggleVisibility() {
if (isVisible()) {
resetIsNew();
hide();
} else {
showNormal();
trayIcon->setIcon(m_icon); // remove the warning icon, if any
}
fillTable(); // updates the contents after resetting the isNew flag
}
void Window::setVisible(bool visible)
{
hideAction->setEnabled(visible);
showAction->setEnabled(isMaximized() || !visible);
QMainWindow::setVisible(visible);
}
void Window::closeEvent(QCloseEvent *event)
{
if (trayIcon->isVisible()) {
if (m_showStillRunningWarning)
QMessageBox::information(this, tr("Systray"),
tr("The program will keep running in the "
"system tray. To terminate the program, "
"choose Quit in the context menu "
"of the system tray entry."));
hide();
resetIsNew();
event->ignore();
}
}
void Window::iconActivated(QSystemTrayIcon::ActivationReason reason)
{
switch (reason) {
case QSystemTrayIcon::Trigger:
case QSystemTrayIcon::DoubleClick:
case QSystemTrayIcon::MiddleClick:
toggleVisibility();
break;
default:
;
}
}
void Window::showMessage(const QString &message)
{
trayIcon->showMessage("DNSSEC Validation", message, QSystemTrayIcon::Information, 5 * 1000);
}
void Window::messageClicked()
{
showNormal();
}
void Window::createLogWidgets()
{
m_topLayout = new QVBoxLayout();
m_topLayout->addWidget(m_topTitle = new QLabel("DNSSEC Log Messages"));
m_topLayout->addWidget(m_log = new QTableWidget(m_maxRows, 3));
m_log->setHorizontalHeaderItem(0, new QTableWidgetItem(""));
m_log->setHorizontalHeaderItem(1, new QTableWidgetItem("Count"));
m_log->setHorizontalHeaderItem(2, new QTableWidgetItem("Name"));
m_log->setHorizontalHeaderItem(3, new QTableWidgetItem("Last Failure Time"));
m_log->verticalHeader()->hide();
m_log->resizeRowsToContents();
m_log->resizeColumnsToContents();
m_log->setShowGrid(false);
}
void Window::createActions()
{
hideAction = new QAction(tr("&Hide"), this);
connect(hideAction, SIGNAL(triggered()), this, SLOT(hide()));
showAction = new QAction(tr("&Show Log"), this);
connect(showAction, SIGNAL(triggered()), this, SLOT(showNormal()));
quitAction = new QAction(tr("&Quit"), this);
connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
aboutAction = new QAction(tr("&About"), this);
connect(aboutAction, SIGNAL(triggered()), this, SLOT(about()));
prefsAction = new QAction(tr("&Preferences"), this);
connect(prefsAction, SIGNAL(triggered()), this, SLOT(showPreferences()));
}
void Window::showPreferences() {
DnssecSystemTrayPrefs prefs;
connect(&prefs, SIGNAL(accepted()), this, SLOT(loadPreferences()));
prefs.exec();
}
void Window::createTrayIcon()
{
trayIconMenu = new QMenu(this);
trayIconMenu->addAction(hideAction);
trayIconMenu->addAction(showAction);
trayIconMenu->addAction(prefsAction);
trayIconMenu->addSeparator();
trayIconMenu->addAction(aboutAction);
trayIconMenu->addAction(quitAction);
trayIcon = new QSystemTrayIcon(this);
trayIcon->setContextMenu(trayIconMenu);
}
// these were taken from dnssec-nodes list of matches
#define QUERY_MATCH "\\{([^, ]+).*[, ]([A-Z0-9]*)\\([0-9]+\\)\\}"
#define BIND_MATCH "@0x[0-9a-f]+: ([^ ]+) ([^:]+): "
#define UNBOUND_ANGLE_MATCH "<([^ ]+) ([A-Z0-9]+) IN>"
void Window::createRegexps() {
m_bogusRegexp = QRegExp("Validation result for " QUERY_MATCH ".*BOGUS");
m_bindBogusRegexp = QRegExp(BIND_MATCH "verify rdataset.*failed to verify");
m_unboundBogusRegexp = QRegExp("validation failure " UNBOUND_ANGLE_MATCH);
}
void Window::clearOldLogFiles()
{
foreach(QFile *logFile, m_logFiles) {
logFile->close();
delete logFile;
}
m_logFiles.clear();
foreach(QTextStream *logStream, m_logStreams) {
delete logStream;
}
m_logStreams.clear();
if (m_fileWatcher)
m_fileWatcher->removePaths(m_fileWatcher->files());
}
void Window::openLogFiles(bool seekToEnd)
{
clearOldLogFiles();
// first watch this file if need be for changes (including creation)
if (!m_fileWatcher) {
m_fileWatcher = new QFileSystemWatcher();
connect(m_fileWatcher, SIGNAL(fileChanged(QString)), this, SLOT(parseTillEnd()));
}
foreach(QString fileName, m_fileNames) {
QTextStream *logStream;
QFile *logFile;
m_fileWatcher->addPath(fileName);
// open the file if possible
logFile = new QFile(fileName);
if (!logFile->exists())
return;
if (!logFile->open(QIODevice::ReadOnly | QIODevice::Text)) {
delete logFile;
logFile = 0;
continue;
}
// jump to the end; we only look for new things.
if (seekToEnd)
logFile->seek(logFile->size());
// create the log stream
logStream = new QTextStream(logFile);
qDebug() << "succeeded in opening " << fileName;
m_logFiles.push_back(logFile);
m_logStreams.push_back(logStream);
}
}
void Window::parseTillEnd()
{
foreach(QTextStream *logStream, m_logStreams) {
while (!logStream->atEnd()) {
QString line = logStream->readLine();
parseLogMessage(line);
}
}
}
void Window::dropOldest() {
DNSTrayData &ref = *(m_trayData.begin());
bool haveOne = false;
foreach(DNSTrayData data, m_trayData) {
if (!haveOne || data.lastHit < ref.lastHit)
ref = data;
}
m_trayData.remove(ref.name);
}
QTableWidgetItem *Window::populateItem(const DNSTrayData &data, QTableWidgetItem *item) {
item->setFlags(Qt::ItemIsEnabled);
if (data.isNew) {
item->setBackgroundColor(Qt::yellow);
}
return item;
}
void Window::fillTable() {
m_log->clear();
int row = 0;
foreach (DNSTrayData data, m_trayData) {
qDebug() << "new: " << data.name << " = " << data.isNew;
m_log->setItem(row, 0, populateItem(data, new QTableWidgetItem(m_warningIcon, "")));
m_log->setItem(row, 1, populateItem(data, new QTableWidgetItem(QString().number(data.count))));
m_log->setItem(row, 2, populateItem(data, new QTableWidgetItem(data.name)));
m_log->setItem(row, 3, populateItem(data, new QTableWidgetItem(data.lastHit.toString())));
row++;
}
m_log->setColumnCount(4);
m_log->setRowCount(row);
m_log->setHorizontalHeaderItem(0, new QTableWidgetItem(""));
m_log->setHorizontalHeaderItem(1, new QTableWidgetItem("Count"));
m_log->setHorizontalHeaderItem(2, new QTableWidgetItem("Name"));
m_log->setHorizontalHeaderItem(3, new QTableWidgetItem("Last Failure Time"));
m_log->resizeColumnsToContents();
m_log->resizeRowsToContents();
}
void Window::parseLogMessage(const QString logMessage) {
QString name;
QString type;
if (m_bogusRegexp.indexIn(logMessage) > -1) {
name = m_bogusRegexp.cap(1);
type = m_bogusRegexp.cap(2);
} else if (m_bindBogusRegexp.indexIn(logMessage) > -1) {
name = m_bindBogusRegexp.cap(1);
type = m_bindBogusRegexp.cap(2);
} else if (m_unboundBogusRegexp.indexIn(logMessage) > -1) {
name = m_unboundBogusRegexp.cap(1);
type = m_unboundBogusRegexp.cap(2);
} else {
return;
}
showMessage(QString(tr("DNSSEC Validation Failure on %1")).arg(name));
if (isVisible()) {
// only the immediate new one is highlighted when the window is visible, which is updated below
resetIsNew();
} else {
trayIcon->setIcon(m_warningIcon);
}
if (!m_trayData.contains(name)) {
m_trayData.insert(name, DNSTrayData(name, QDateTime::currentDateTime()));
while (m_trayData.count() > m_maxRows)
dropOldest();
} else {
DNSTrayData &data = m_trayData[name];
data.count++;
data.lastHit = QDateTime::currentDateTime();
data.isNew = true;
}
fillTable();
}
void Window::resetIsNew() {
QMap::iterator i = m_trayData.begin();
QMap::iterator stopAt = m_trayData.end();
while (i != stopAt) {
i.value().isNew = false;
i++;
}
}
QSize Window::sizeHint() const {
return QSize(800, 420); // should fit most modern devices.
}
void Window::createMenus()
{
QMenuBar *menubar = menuBar();
QMenu *menu = menubar->addMenu("&File");
QAction *action = menu->addAction("&Quit");
connect(action, SIGNAL(triggered()), qApp, SLOT(quit()));
menu = menubar->addMenu("&Options");
action = menu->addAction("&Preferences");
connect(action, SIGNAL(triggered()), this, SLOT(showPreferences()));
menu = menubar->addMenu("&Help");
action = menu->addAction("&About");
connect(action, SIGNAL(triggered()), this, SLOT(about()));
}
void Window::about()
{
QMessageBox msgBox;
msgBox.setWindowTitle("About DNSSEC-System-Tray");
msgBox.setText(" "
"DNSSEC-System-Tray A component of the DNSSEC-Tools Project
For more information, please visit http://www.dnssec-tools.org/.
"
"DNSSEC-Tools Version: 2.0
");
msgBox.setStandardButtons(QMessageBox::Close);
msgBox.exec();
}
dnsval-2.0/apps/dnssec-system-tray/dnssec-system-tray.h 0000664 0002372 0002372 00000010466 11706334100 023444 0 ustar hardaker hardaker /****************************************************************************
**
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
** the names of its contributors may be used to endorse or promote
** products derived from this software without specific prior written
** permission.
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef WINDOW_H
#define WINDOW_H
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
class DNSTrayData {
public:
DNSTrayData(QString n = "", QDateTime d = QDateTime::currentDateTime(), bool i = true, int c = 0) : name(n), lastHit(d), count(c), isNew(i) { }
QString name;
QDateTime lastHit;
int count;
bool isNew;
};
class Window : public QMainWindow
{
Q_OBJECT
public:
Window();
void setVisible(bool visible);
void openLogFiles(bool seekToEnd = false);
QSize sizeHint() const;
void fillTable();
void dropOldest();
void readLogFileNames();
void clearOldLogFiles();
protected:
void closeEvent(QCloseEvent *event);
private slots:
void iconActivated(QSystemTrayIcon::ActivationReason reason);
void showMessage(const QString &message);
void messageClicked();
void parseTillEnd();
void showPreferences();
void loadPreferences(bool seekToEnd = true);
void toggleVisibility();
void resetIsNew();
void about();
private:
void createLogWidgets();
void createMessageGroupBox();
void createActions();
void createTrayIcon();
void createRegexps();
void createMenus();
void parseLogMessage(const QString logMessage);
QTableWidgetItem * populateItem(const DNSTrayData &data, QTableWidgetItem *item);
QVBoxLayout *m_topLayout;
QLabel *m_topTitle;
QTableWidget *m_log;
QIcon m_icon;
QAction *hideAction;
QAction *showAction;
QAction *quitAction;
QAction *prefsAction;
QAction *aboutAction;
QSystemTrayIcon *trayIcon;
QMenu *trayIconMenu;
QStringList m_fileNames;
QList m_logFiles;
QList m_logStreams;
QFileSystemWatcher *m_fileWatcher;
QRegExp m_bogusRegexp;
QRegExp m_bindBogusRegexp;
QRegExp m_unboundBogusRegexp;
int m_maxRows, m_rowCount;
bool m_showStillRunningWarning;
QIcon m_warningIcon;
QMap m_trayData;
};
#endif
dnsval-2.0/apps/dnssec-system-tray/qtc_packaging/ 0000775 0002372 0002372 00000000000 12111172614 022302 5 ustar hardaker hardaker dnsval-2.0/apps/dnssec-system-tray/qtc_packaging/debian_fremantle/ 0000775 0002372 0002372 00000000000 12111172614 025561 5 ustar hardaker hardaker dnsval-2.0/apps/dnssec-system-tray/qtc_packaging/debian_fremantle/compat 0000664 0002372 0002372 00000000002 11567026772 027000 0 ustar hardaker hardaker 7
dnsval-2.0/apps/dnssec-system-tray/qtc_packaging/debian_fremantle/rules 0000775 0002372 0002372 00000003611 11567026772 026663 0 ustar hardaker hardaker #!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
configure: configure-stamp
configure-stamp:
dh_testdir
# qmake PREFIX=/usr# Uncomment this line for use without Qt Creator
touch configure-stamp
build: build-stamp
build-stamp: configure-stamp
dh_testdir
# Add here commands to compile the package.
# $(MAKE) # Uncomment this line for use without Qt Creator
#docbook-to-man debian/systray.sgml > systray.1
touch $@
clean:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp
# Add here commands to clean up after the build process.
$(MAKE) clean
dh_clean
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
# Add here commands to install the package into debian/systray.
$(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/systray install
# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir
dh_testroot
dh_installchangelogs
dh_installdocs
dh_installexamples
# dh_install
# dh_installmenu
# dh_installdebconf
# dh_installlogrotate
# dh_installemacsen
# dh_installpam
# dh_installmime
# dh_python
# dh_installinit
# dh_installcron
# dh_installinfo
dh_installman
dh_link
dh_strip
dh_compress
dh_fixperms
# dh_perl
# dh_makeshlibs
dh_installdeb
# dh_shlibdeps # Uncomment this line for use without Qt Creator
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure
dnsval-2.0/apps/dnssec-system-tray/qtc_packaging/debian_fremantle/changelog 0000664 0002372 0002372 00000000210 11567026772 027445 0 ustar hardaker hardaker systray (0.0.1) unstable; urgency=low
* Initial Release.
-- Wes Hardaker Mon, 23 May 2011 14:41:17 -0700
dnsval-2.0/apps/dnssec-system-tray/qtc_packaging/debian_fremantle/README 0000664 0002372 0002372 00000000244 11567026772 026462 0 ustar hardaker hardaker The Debian Package systray
----------------------------
Comments regarding the Package
-- Wes Hardaker Mon, 23 May 2011 14:41:17 -0700
dnsval-2.0/apps/dnssec-system-tray/qtc_packaging/debian_fremantle/copyright 0000664 0002372 0002372 00000002621 11567026772 027536 0 ustar hardaker hardaker This package was debianized by Wes Hardaker on
Mon, 23 May 2011 14:41:17 -0700.
It was downloaded from
Upstream Author(s):
Copyright:
License:
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this package; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
On Debian systems, the complete text of the GNU General
Public License can be found in `/usr/share/common-licenses/GPL'.
The Debian packaging is (C) 2011, Wes Hardaker and
is licensed under the GPL, see above.
# Please also look if there are files or directories which have a
# different copyright/license attached and list them here.
dnsval-2.0/apps/dnssec-system-tray/qtc_packaging/debian_fremantle/control 0000664 0002372 0002372 00000000661 11567026772 027210 0 ustar hardaker hardaker Source: systray
Section: user/hidden
Priority: optional
Maintainer: Wes Hardaker
Build-Depends: debhelper (>= 5), libqt4-dev
Standards-Version: 3.7.3
Homepage:
Package: systray
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description:
XB-Maemo-Display-Name: systray
dnsval-2.0/apps/dnssec-system-tray/man/ 0000775 0002372 0002372 00000000000 12111172614 020262 5 ustar hardaker hardaker dnsval-2.0/apps/dnssec-system-tray/man/dnssec-system-tray.1 0000664 0002372 0002372 00000001422 11677176674 024153 0 ustar hardaker hardaker .TH DNSSEC_SYSTEM_TRAY 1 "26 Oct 2011" "User Commands"
.UC 5
.SH NAME
dnssec-system-tray \- System Tray for monitoring log files for DNSSEC errors
.SH DESCRIPTION
A simply system-tray application that monitors log files (eg libval,
or bind/named logfiles) for DNSSEC error messages that should be
displayed to the user.
.PP
Further information on this tool can be found on the DNSSEC-Tools wiki
page, of which this application is a component:
.IP
http://www.dnssec-tools.org/wiki/index.php/DNSSEC-System-Tray
.SH "SEE ALSO"
For more information on the DNSSEC-Tools project, see the project's
web page:
.IP
http://www.dnssec-tools.org/
.SH "LICENSE"
The DNSSEC-Tools are licensed under a BSD license, the details of
which can be found in the COPYING file found within the distribution.
dnsval-2.0/apps/dnssec-system-tray/main.cpp 0000664 0002372 0002372 00000005045 11567027327 021161 0 ustar hardaker hardaker /****************************************************************************
**
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
** the names of its contributors may be used to endorse or promote
** products derived from this software without specific prior written
** permission.
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
** $QT_END_LICENSE$
**
****************************************************************************/
#include
#include "dnssec-system-tray.h"
int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(dnssec_system_tray);
QApplication app(argc, argv);
if (!QSystemTrayIcon::isSystemTrayAvailable()) {
QMessageBox::critical(0, QObject::tr("Systray"),
QObject::tr("I couldn't detect any system tray "
"on this system."));
return 1;
}
QApplication::setQuitOnLastWindowClosed(false);
Window window;
window.show();
return app.exec();
}
dnsval-2.0/apps/dnssec-system-tray/dnssec-system-tray.qrc 0000664 0002372 0002372 00000000234 11567027505 024007 0 ustar hardaker hardaker
images/justlock.png
images/trianglewarning.png
dnsval-2.0/apps/dnssec-system-tray/DnssecSystemTrayPrefs.h 0000664 0002372 0002372 00000001426 11645106673 024164 0 ustar hardaker hardaker #ifndef DNSSECSYSTEMTRAYPREFS_H
#define DNSSECSYSTEMTRAYPREFS_H
#include
#include
#include
#include
#include
#include
#include
class DnssecSystemTrayPrefs : public QDialog
{
Q_OBJECT
public:
explicit DnssecSystemTrayPrefs(QWidget *parent = 0);
void setupWindow();
void readLogFiles();
void listFromString();
signals:
public slots:
void savePrefs();
void openBrowseWindow();
private:
QVBoxLayout *m_topLayout;
QFormLayout *m_formLayout;
QTextEdit *m_logFile;
QSpinBox *m_logNumber;
QCheckBox *m_stillRunningWarning;
QStringList m_logFileList;
};
#endif // DNSSECSYSTEMTRAYPREFS_H
dnsval-2.0/apps/dnssec-system-tray/.gitignore 0000664 0002372 0002372 00000000034 11567027344 021511 0 ustar hardaker hardaker dnssec-system-tray.pro.user
dnsval-2.0/apps/dnssec-system-tray/images/ 0000775 0002372 0002372 00000000000 12111172614 020754 5 ustar hardaker hardaker dnsval-2.0/apps/dnssec-system-tray/images/justlock.png 0000664 0002372 0002372 00000005610 11567027026 023334 0 ustar hardaker hardaker ‰PNG
IHDR ª ª =vÔ‚ sRGB ®Îé bKGD ÿ ÿ ÿ ½§“ pHYs šœ tIMEÛ72_+ž tEXtComment Created with GIMPW
ãIDATxÚíoˆåÇ?³Ù9¯!jŒLôE¡ÁƒJOC“ã"9*¬ B-£=lM›Z_ø2©ˆÒW,ÔZ{ýãŸk9°o5hLRS.ˆàa©Z&èɪzÜj7¾qÏ(Ûõl%½øtC²ªž#GLàF¬]žþN¢ŠV%ý!ð¨•t<^UÛ̸ Ühßwz~øË"ç½$õÎZÒ]Ë()Àóö Úc«¢Š¦’~˜²’Þ Ûî4kÂóÃßKTQOÒmÀa+éD$l€ïÏ›À}?þ·bÖãÀ¯r“ýL˜À޹ÝóÃ#U$%õ€÷\Û#a3P1dièVLhÖv» ÜèØë=?œ“¨"’´Ì [l|?ÃÇö›À½1ªÇìÏÖ¦US·bö76Ø÷z[™ß †=?¬¥/ÊÒ±!?¶Øíç2´ÐîžxUþœ"ÔðÄÜôÈSÀõQ55{£[1{êì?Ša‹ígª¨ª¦—ÿ´•îàá&¹ßî}QUnóüðxÆc
OFÕÔ˜ûûê4¿ÇnËž¾S„þÐã©ú