Merge branch 'develop' of github.com:verisign/getdns into develop

This commit is contained in:
Neel Goyal 2014-02-12 16:40:10 -05:00
commit ec7fc42ce0
23 changed files with 9346 additions and 397 deletions

8619
aclocal.m4 vendored

File diff suppressed because it is too large Load Diff

322
configure vendored
View File

@ -1,11 +1,13 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for getdns 0.1.0.
# Generated by GNU Autoconf 2.68 for getdns 0.1.0.
#
# Report bugs to <stub-resolver@verisignlabs.com>.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
# Foundation, Inc.
#
#
# This configure script is free software; the Free Software Foundation
@ -134,31 +136,6 @@ export LANGUAGE
# CDPATH.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
# Use a proper internal environment variable to ensure we don't fall
# into an infinite loop, continuously re-executing ourselves.
if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
_as_can_reexec=no; export _as_can_reexec;
# We cannot yet assume a decent shell, so we have to provide a
# neutralization value for shells without unset; and this also
# works around shells that cannot unset nonexistent variables.
# Preserve -v and -x to the replacement shell.
BASH_ENV=/dev/null
ENV=/dev/null
(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
case $- in # ((((
*v*x* | *x*v* ) as_opts=-vx ;;
*v* ) as_opts=-v ;;
*x* ) as_opts=-x ;;
* ) as_opts= ;;
esac
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
# Admittedly, this is quite paranoid, since all the known shells bail
# out after a failed `exec'.
$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
as_fn_exit 255
fi
# We don't want this to propagate to other subprocesses.
{ _as_can_reexec=; unset _as_can_reexec;}
if test "x$CONFIG_SHELL" = x; then
as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
emulate sh
@ -192,8 +169,7 @@ if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
else
exitcode=1; echo positional parameters were not saved.
fi
test x\$exitcode = x0 || exit 1
test -x / || exit 1"
test x\$exitcode = x0 || exit 1"
as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
@ -246,25 +222,21 @@ IFS=$as_save_IFS
if test "x$CONFIG_SHELL" != x; then :
export CONFIG_SHELL
# We cannot yet assume a decent shell, so we have to provide a
# neutralization value for shells without unset; and this also
# works around shells that cannot unset nonexistent variables.
# Preserve -v and -x to the replacement shell.
BASH_ENV=/dev/null
ENV=/dev/null
(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
case $- in # ((((
*v*x* | *x*v* ) as_opts=-vx ;;
*v* ) as_opts=-v ;;
*x* ) as_opts=-x ;;
* ) as_opts= ;;
esac
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
# Admittedly, this is quite paranoid, since all the known shells bail
# out after a failed `exec'.
$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
exit 255
# We cannot yet assume a decent shell, so we have to provide a
# neutralization value for shells without unset; and this also
# works around shells that cannot unset nonexistent variables.
# Preserve -v and -x to the replacement shell.
BASH_ENV=/dev/null
ENV=/dev/null
(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
export CONFIG_SHELL
case $- in # ((((
*v*x* | *x*v* ) as_opts=-vx ;;
*v* ) as_opts=-v ;;
*x* ) as_opts=-x ;;
* ) as_opts= ;;
esac
exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
fi
if test x$as_have_required = xno; then :
@ -367,14 +339,6 @@ $as_echo X"$as_dir" |
} # as_fn_mkdir_p
# as_fn_executable_p FILE
# -----------------------
# Test if FILE is an executable regular file.
as_fn_executable_p ()
{
test -f "$1" && test -x "$1"
} # as_fn_executable_p
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
@ -496,10 +460,6 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
chmod +x "$as_me.lineno" ||
{ $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
# If we had to re-execute with $CONFIG_SHELL, we're ensured to have
# already done that, so ensure we don't try to do so again and fall
# in an infinite loop. This has already happened in practice.
_as_can_reexec=no; export _as_can_reexec
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
# original and so on. Autoconf is especially sensitive to this).
@ -534,16 +494,16 @@ if (echo >conf$$.file) 2>/dev/null; then
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
# In both cases, we have to default to `cp -pR'.
# In both cases, we have to default to `cp -p'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
as_ln_s='cp -pR'
as_ln_s='cp -p'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
as_ln_s='cp -pR'
as_ln_s='cp -p'
fi
else
as_ln_s='cp -pR'
as_ln_s='cp -p'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
@ -555,8 +515,28 @@ else
as_mkdir_p=false
fi
as_test_x='test -x'
as_executable_p=as_fn_executable_p
if test -x / >/dev/null 2>&1; then
as_test_x='test -x'
else
if ls -dL / >/dev/null 2>&1; then
as_ls_L_option=L
else
as_ls_L_option=
fi
as_test_x='
eval sh -c '\''
if test -d "$1"; then
test -d "$1/.";
else
case $1 in #(
-*)set "./$1";;
esac;
case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
???[sx]*):;;*)false;;esac;fi
'\'' sh
'
fi
as_executable_p=$as_test_x
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@ -634,6 +614,7 @@ ac_includes_default="\
ac_subst_vars='LTLIBOBJS
LIBOBJS
TRUST_ANCHOR_FILE
EXTENSION_LIBEV_OBJ
have_libev
EXTENSION_LIBUV_OBJ
@ -736,6 +717,7 @@ enable_rpath
with_libidn
with_libldns
with_libunbound
with_trust_anchor
'
ac_precious_vars='build_alias
host_alias
@ -1201,6 +1183,8 @@ target=$target_alias
if test "x$host_alias" != x; then
if test "x$build_alias" = x; then
cross_compiling=maybe
$as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used" >&2
elif test "x$build_alias" != "x$host_alias"; then
cross_compiling=yes
fi
@ -1378,6 +1362,9 @@ Optional Packages:
--with-libldns=pathname path to libldns (default: search /usr/local ..)
--with-libunbound=pathname
path to libunbound (default: search /usr/local ..)
--with-trust-anchor=KEYFILE
Default location of the trust anchor file.
[default=SYSCONFDIR/unbound/root.key]
Some influential environment variables:
CC C compiler command
@ -1456,9 +1443,9 @@ test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
getdns configure 0.1.0
generated by GNU Autoconf 2.69
generated by GNU Autoconf 2.68
Copyright (C) 2012 Free Software Foundation, Inc.
Copyright (C) 2010 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
@ -1571,7 +1558,7 @@ $as_echo "$ac_try_echo"; } >&5
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
test -x conftest$ac_exeext
$as_test_x conftest$ac_exeext
}; then :
ac_retval=0
else
@ -1808,8 +1795,7 @@ int
main ()
{
static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)];
test_array [0] = 0;
return test_array [0];
test_array [0] = 0
;
return 0;
@ -1842,7 +1828,7 @@ This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by getdns $as_me 0.1.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
@ -2216,7 +2202,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_CC="${ac_tool_prefix}gcc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@ -2256,7 +2242,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_CC="gcc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@ -2309,7 +2295,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_CC="${ac_tool_prefix}cc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@ -2350,7 +2336,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
ac_prog_rejected=yes
continue
@ -2408,7 +2394,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@ -2452,7 +2438,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_CC="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@ -2898,7 +2884,8 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdarg.h>
#include <stdio.h>
struct stat;
#include <sys/types.h>
#include <sys/stat.h>
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
struct buf { int x; };
FILE * (*rcsopen) (struct buf *, struct stat *, int);
@ -3352,7 +3339,7 @@ do
for ac_prog in sed gsed; do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
as_fn_executable_p "$ac_path_SED" || continue
{ test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
# Check for GNU ac_path_SED and select it if it is found.
# Check for GNU $ac_path_SED
case `"$ac_path_SED" --version 2>&1` in
@ -3428,7 +3415,7 @@ do
for ac_prog in grep ggrep; do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
as_fn_executable_p "$ac_path_GREP" || continue
{ test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
# Check for GNU ac_path_GREP and select it if it is found.
# Check for GNU $ac_path_GREP
case `"$ac_path_GREP" --version 2>&1` in
@ -3494,7 +3481,7 @@ do
for ac_prog in egrep; do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
as_fn_executable_p "$ac_path_EGREP" || continue
{ test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
# Check for GNU ac_path_EGREP and select it if it is found.
# Check for GNU $ac_path_EGREP
case `"$ac_path_EGREP" --version 2>&1` in
@ -3561,7 +3548,7 @@ do
for ac_prog in fgrep; do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
as_fn_executable_p "$ac_path_FGREP" || continue
{ test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
# Check for GNU ac_path_FGREP and select it if it is found.
# Check for GNU $ac_path_FGREP
case `"$ac_path_FGREP" --version 2>&1` in
@ -3817,7 +3804,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@ -3861,7 +3848,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@ -4285,7 +4272,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@ -4325,7 +4312,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_OBJDUMP="objdump"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@ -4497,7 +4484,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu)
lt_cv_deplibs_check_method=pass_all
;;
netbsd*)
netbsd* | netbsdelf*-gnu)
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
@ -4631,7 +4618,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@ -4671,7 +4658,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_DLLTOOL="dlltool"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@ -4775,7 +4762,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@ -4819,7 +4806,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_AR="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@ -4944,7 +4931,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_STRIP="${ac_tool_prefix}strip"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@ -4984,7 +4971,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_STRIP="strip"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@ -5043,7 +5030,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@ -5083,7 +5070,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_RANLIB="ranlib"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@ -5187,7 +5174,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_AWK="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@ -5774,7 +5761,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@ -5814,7 +5801,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@ -5894,7 +5881,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@ -5934,7 +5921,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@ -5986,7 +5973,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@ -6026,7 +6013,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_NMEDIT="nmedit"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@ -6078,7 +6065,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@ -6118,7 +6105,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_LIPO="lipo"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@ -6170,7 +6157,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@ -6210,7 +6197,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_OTOOL="otool"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@ -6262,7 +6249,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@ -6302,7 +6289,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_OTOOL64="otool64"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@ -7109,10 +7096,6 @@ _lt_linker_boilerplate=`cat conftest.err`
$RM -r conftest*
## 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...
if test -n "$compiler"; then
lt_prog_compiler_no_builtin_flag=
@ -7803,6 +7786,9 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
openbsd*)
with_gnu_ld=no
;;
linux* | k*bsd*-gnu | gnu*)
link_all_deplibs=no
;;
esac
ld_shlibs=yes
@ -8024,7 +8010,7 @@ _LT_EOF
fi
;;
netbsd*)
netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
@ -8201,6 +8187,7 @@ _LT_EOF
if test "$aix_use_runtimelinking" = yes; then
shared_flag="$shared_flag "'${wl}-G'
fi
link_all_deplibs=no
else
# not using gcc
if test "$host_cpu" = ia64; then
@ -8654,7 +8641,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
link_all_deplibs=yes
;;
netbsd*)
netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
else
@ -9667,14 +9654,10 @@ fi
# 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"
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
fi
# We used to test for /lib/ld.so.1 and disable shared libraries on
@ -9686,6 +9669,18 @@ fi
dynamic_linker='GNU/Linux ld.so'
;;
netbsdelf*-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
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
dynamic_linker='NetBSD ld.elf_so'
;;
netbsd*)
version_type=sunos
need_lib_prefix=no
@ -10693,7 +10688,7 @@ case $as_dir/ in #((
# by default.
for ac_prog in ginstall scoinst install; do
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
if test $ac_prog = install &&
grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
@ -11038,7 +11033,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_DOXYGEN="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@ -11367,6 +11362,41 @@ fi
# --with-trust-anchor=
$as_echo "#define SYSCONFDIR sysconfdir" >>confdefs.h
# Check whether --with-trust-anchor was given.
if test "${with_trust_anchor+set}" = set; then :
withval=$with_trust_anchor;
TRUST_ANCHOR_FILE="$withval"
else
if test "x$TRUST_ANCHOR_FILE" = "x"; then
if test "x$sysconfdir" = 'x${prefix}/etc' ; then
if test "x$prefix" = 'xNONE' ; then
TRUST_ANCHOR_FILE="/etc/unbound/root.key"
else
TRUST_ANCHOR_FILE="${prefix}/etc/unbound/root.key"
fi
else
TRUST_ANCHOR_FILE="${sysconfdir}/unbound/root.key"
fi
fi
fi
cat >>confdefs.h <<_ACEOF
#define TRUST_ANCHOR_FILE "$TRUST_ANCHOR_FILE"
_ACEOF
{ $as_echo "$as_me:${as_lineno-$LINENO}: Default trust anchor: $TRUST_ANCHOR_FILE" >&5
$as_echo "$as_me: Default trust anchor: $TRUST_ANCHOR_FILE" >&6;}
ac_config_files="$ac_config_files Makefile src/Makefile src/getdns/Makefile src/example/Makefile src/test/Makefile doc/Makefile"
if test -n "$DOXYGEN"
@ -11782,16 +11812,16 @@ if (echo >conf$$.file) 2>/dev/null; then
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
# In both cases, we have to default to `cp -pR'.
# In both cases, we have to default to `cp -p'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
as_ln_s='cp -pR'
as_ln_s='cp -p'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
as_ln_s='cp -pR'
as_ln_s='cp -p'
fi
else
as_ln_s='cp -pR'
as_ln_s='cp -p'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
@ -11851,16 +11881,28 @@ else
as_mkdir_p=false
fi
# as_fn_executable_p FILE
# -----------------------
# Test if FILE is an executable regular file.
as_fn_executable_p ()
{
test -f "$1" && test -x "$1"
} # as_fn_executable_p
as_test_x='test -x'
as_executable_p=as_fn_executable_p
if test -x / >/dev/null 2>&1; then
as_test_x='test -x'
else
if ls -dL / >/dev/null 2>&1; then
as_ls_L_option=L
else
as_ls_L_option=
fi
as_test_x='
eval sh -c '\''
if test -d "$1"; then
test -d "$1/.";
else
case $1 in #(
-*)set "./$1";;
esac;
case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
???[sx]*):;;*)false;;esac;fi
'\'' sh
'
fi
as_executable_p=$as_test_x
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@ -11882,7 +11924,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# values after options handling.
ac_log="
This file was extended by getdns $as_me 0.1.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@ -11948,10 +11990,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
getdns config.status 0.1.0
configured by $0, generated by GNU Autoconf 2.69,
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
Copyright (C) 2012 Free Software Foundation, Inc.
Copyright (C) 2010 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
@ -12041,7 +12083,7 @@ fi
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
if \$ac_cs_recheck; then
set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
shift
\$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
CONFIG_SHELL='$SHELL'

View File

@ -208,6 +208,27 @@ AC_SEARCH_LIBS([ev_run],
AC_SUBST(have_libev)
AC_SUBST(EXTENSION_LIBEV_OBJ)
# --with-trust-anchor=
AC_DEFINE([SYSCONFDIR], [sysconfdir], [System configuration dir])
AC_ARG_WITH(trust-anchor, AC_HELP_STRING([--with-trust-anchor=KEYFILE], [Default location of the trust anchor file. [default=SYSCONFDIR/unbound/root.key]]), [
TRUST_ANCHOR_FILE="$withval"
],[
if test "x$TRUST_ANCHOR_FILE" = "x"; then
if test "x$sysconfdir" = 'x${prefix}/etc' ; then
if test "x$prefix" = 'xNONE' ; then
TRUST_ANCHOR_FILE="/etc/unbound/root.key"
else
TRUST_ANCHOR_FILE="${prefix}/etc/unbound/root.key"
fi
else
TRUST_ANCHOR_FILE="${sysconfdir}/unbound/root.key"
fi
fi
])
AC_DEFINE_UNQUOTED([TRUST_ANCHOR_FILE], ["$TRUST_ANCHOR_FILE"], [Default trust anchor file])
AC_SUBST(TRUST_ANCHOR_FILE)
AC_MSG_NOTICE([Default trust anchor: $TRUST_ANCHOR_FILE])
AC_CONFIG_FILES([Makefile src/Makefile src/getdns/Makefile src/example/Makefile src/test/Makefile doc/Makefile])
if [ test -n "$DOXYGEN" ]
then AC_CONFIG_FILES([src/Doxyfile])

View File

@ -40,6 +40,7 @@ EXTENSION_LIBEV_OBJ=@EXTENSION_LIBEV_OBJ@
GETDNS_OBJ=sync.lo context.lo list.lo dict.lo convert.lo general.lo \
hostname.lo service.lo request-internal.lo validate_dnssec.lo \
util-internal.lo getdns_error.lo rr-dict.lo validation-chain.lo \
const-info.lo \
$(EXTENSION_LIBEVENT_OBJ) $(EXTENSION_LIBUV_OBJ) $(EXTENSION_LIBEV_OBJ)
.SUFFIXES: .c .o .a .lo .h

View File

@ -85,6 +85,12 @@
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* System configuration dir */
#undef SYSCONFDIR
/* Default trust anchor file */
#undef TRUST_ANCHOR_FILE
/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
#define below would cause a syntax error. */

95
src/const-info.c Normal file
View File

@ -0,0 +1,95 @@
/* WARNING! This file is generated by the mk-const-info.c.sh program.
* Do not edit manually!
*/
#include <getdns/getdns.h>
#include <stdlib.h>
#include "const-info.h"
static struct const_info consts_info[] = {
{ -1, "/* <unknown const value> */", "/* <unknown const value> */" },
{ 0, "GETDNS_RETURN_GOOD", GETDNS_RETURN_GOOD_TEXT },
{ 1, "GETDNS_RETURN_GENERIC_ERROR", GETDNS_RETURN_GENERIC_ERROR_TEXT },
{ 300, "GETDNS_RETURN_BAD_DOMAIN_NAME", GETDNS_RETURN_BAD_DOMAIN_NAME_TEXT },
{ 301, "GETDNS_RETURN_BAD_CONTEXT", GETDNS_RETURN_BAD_CONTEXT_TEXT },
{ 302, "GETDNS_RETURN_CONTEXT_UPDATE_FAIL", GETDNS_RETURN_CONTEXT_UPDATE_FAIL_TEXT },
{ 303, "GETDNS_RETURN_UNKNOWN_TRANSACTION", GETDNS_RETURN_UNKNOWN_TRANSACTION_TEXT },
{ 304, "GETDNS_RETURN_NO_SUCH_LIST_ITEM", GETDNS_RETURN_NO_SUCH_LIST_ITEM_TEXT },
{ 305, "GETDNS_RETURN_NO_SUCH_DICT_NAME", GETDNS_RETURN_NO_SUCH_DICT_NAME_TEXT },
{ 306, "GETDNS_RETURN_WRONG_TYPE_REQUESTED", GETDNS_RETURN_WRONG_TYPE_REQUESTED_TEXT },
{ 307, "GETDNS_RETURN_NO_SUCH_EXTENSION", GETDNS_RETURN_NO_SUCH_EXTENSION_TEXT },
{ 308, "GETDNS_RETURN_EXTENSION_MISFORMAT", GETDNS_RETURN_EXTENSION_MISFORMAT_TEXT },
{ 309, "GETDNS_RETURN_DNSSEC_WITH_STUB_DISALLOWED", GETDNS_RETURN_DNSSEC_WITH_STUB_DISALLOWED_TEXT },
{ 310, "GETDNS_RETURN_MEMORY_ERROR", GETDNS_RETURN_MEMORY_ERROR_TEXT },
{ 311, "GETDNS_RETURN_INVALID_PARAMETER", GETDNS_RETURN_INVALID_PARAMETER_TEXT },
{ 400, "GETDNS_DNSSEC_SECURE", GETDNS_DNSSEC_SECURE_TEXT },
{ 401, "GETDNS_DNSSEC_BOGUS", GETDNS_DNSSEC_BOGUS_TEXT },
{ 402, "GETDNS_DNSSEC_INDETERMINATE", GETDNS_DNSSEC_INDETERMINATE_TEXT },
{ 403, "GETDNS_DNSSEC_INSECURE", GETDNS_DNSSEC_INSECURE_TEXT },
{ 404, "GETDNS_DNSSEC_NOT_PERFORMED", GETDNS_DNSSEC_NOT_PERFORMED_TEXT },
{ 500, "GETDNS_NAMESPACE_DNS", GETDNS_NAMESPACE_DNS_TEXT },
{ 501, "GETDNS_NAMESPACE_LOCALNAMES", GETDNS_NAMESPACE_LOCALNAMES_TEXT },
{ 502, "GETDNS_NAMESPACE_NETBIOS", GETDNS_NAMESPACE_NETBIOS_TEXT },
{ 503, "GETDNS_NAMESPACE_MDNS", GETDNS_NAMESPACE_MDNS_TEXT },
{ 504, "GETDNS_NAMESPACE_NIS", GETDNS_NAMESPACE_NIS_TEXT },
{ 520, "GETDNS_RESOLUTION_STUB", GETDNS_RESOLUTION_STUB_TEXT },
{ 521, "GETDNS_RESOLUTION_RECURSING", GETDNS_RESOLUTION_RECURSING_TEXT },
{ 530, "GETDNS_REDIRECTS_FOLLOW", GETDNS_REDIRECTS_FOLLOW_TEXT },
{ 531, "GETDNS_REDIRECTS_DO_NOT_FOLLOW", GETDNS_REDIRECTS_DO_NOT_FOLLOW_TEXT },
{ 540, "GETDNS_TRANSPORT_UDP_FIRST_AND_FALL_BACK_TO_TCP", GETDNS_TRANSPORT_UDP_FIRST_AND_FALL_BACK_TO_TCP_TEXT },
{ 541, "GETDNS_TRANSPORT_UDP_ONLY", GETDNS_TRANSPORT_UDP_ONLY_TEXT },
{ 542, "GETDNS_TRANSPORT_TCP_ONLY", GETDNS_TRANSPORT_TCP_ONLY_TEXT },
{ 543, "GETDNS_TRANSPORT_TCP_ONLY_KEEP_CONNECTIONS_OPEN", GETDNS_TRANSPORT_TCP_ONLY_KEEP_CONNECTIONS_OPEN_TEXT },
{ 550, "GETDNS_APPEND_NAME_ALWAYS", GETDNS_APPEND_NAME_ALWAYS_TEXT },
{ 551, "GETDNS_APPEND_NAME_ONLY_TO_SINGLE_LABEL_AFTER_FAILURE", GETDNS_APPEND_NAME_ONLY_TO_SINGLE_LABEL_AFTER_FAILURE_TEXT },
{ 552, "GETDNS_APPEND_NAME_ONLY_TO_MULTIPLE_LABEL_NAME_AFTER_FAILURE", GETDNS_APPEND_NAME_ONLY_TO_MULTIPLE_LABEL_NAME_AFTER_FAILURE_TEXT },
{ 553, "GETDNS_APPEND_NAME_NEVER", GETDNS_APPEND_NAME_NEVER_TEXT },
{ 600, "GETDNS_CONTEXT_CODE_NAMESPACES", GETDNS_CONTEXT_CODE_NAMESPACES_TEXT },
{ 601, "GETDNS_CONTEXT_CODE_RESOLUTION_TYPE", GETDNS_CONTEXT_CODE_RESOLUTION_TYPE_TEXT },
{ 602, "GETDNS_CONTEXT_CODE_FOLLOW_REDIRECTS", GETDNS_CONTEXT_CODE_FOLLOW_REDIRECTS_TEXT },
{ 603, "GETDNS_CONTEXT_CODE_UPSTREAM_RECURSIVE_SERVERS", GETDNS_CONTEXT_CODE_UPSTREAM_RECURSIVE_SERVERS_TEXT },
{ 604, "GETDNS_CONTEXT_CODE_DNS_ROOT_SERVERS", GETDNS_CONTEXT_CODE_DNS_ROOT_SERVERS_TEXT },
{ 605, "GETDNS_CONTEXT_CODE_DNS_TRANSPORT", GETDNS_CONTEXT_CODE_DNS_TRANSPORT_TEXT },
{ 606, "GETDNS_CONTEXT_CODE_LIMIT_OUTSTANDING_QUERIES", GETDNS_CONTEXT_CODE_LIMIT_OUTSTANDING_QUERIES_TEXT },
{ 607, "GETDNS_CONTEXT_CODE_APPEND_NAME", GETDNS_CONTEXT_CODE_APPEND_NAME_TEXT },
{ 608, "GETDNS_CONTEXT_CODE_SUFFIX", GETDNS_CONTEXT_CODE_SUFFIX_TEXT },
{ 609, "GETDNS_CONTEXT_CODE_DNSSEC_TRUST_ANCHORS", GETDNS_CONTEXT_CODE_DNSSEC_TRUST_ANCHORS_TEXT },
{ 610, "GETDNS_CONTEXT_CODE_EDNS_MAXIMUM_UDP_PAYLOAD_SIZE", GETDNS_CONTEXT_CODE_EDNS_MAXIMUM_UDP_PAYLOAD_SIZE_TEXT },
{ 611, "GETDNS_CONTEXT_CODE_EDNS_EXTENDED_RCODE", GETDNS_CONTEXT_CODE_EDNS_EXTENDED_RCODE_TEXT },
{ 612, "GETDNS_CONTEXT_CODE_EDNS_VERSION", GETDNS_CONTEXT_CODE_EDNS_VERSION_TEXT },
{ 613, "GETDNS_CONTEXT_CODE_EDNS_DO_BIT", GETDNS_CONTEXT_CODE_EDNS_DO_BIT_TEXT },
{ 614, "GETDNS_CONTEXT_CODE_DNSSEC_ALLOWED_SKEW", GETDNS_CONTEXT_CODE_DNSSEC_ALLOWED_SKEW_TEXT },
{ 615, "GETDNS_CONTEXT_CODE_MEMORY_FUNCTIONS", GETDNS_CONTEXT_CODE_MEMORY_FUNCTIONS_TEXT },
{ 616, "GETDNS_CONTEXT_CODE_TIMEOUT", GETDNS_CONTEXT_CODE_TIMEOUT_TEXT },
{ 700, "GETDNS_CALLBACK_COMPLETE", GETDNS_CALLBACK_COMPLETE_TEXT },
{ 701, "GETDNS_CALLBACK_CANCEL", GETDNS_CALLBACK_CANCEL_TEXT },
{ 702, "GETDNS_CALLBACK_TIMEOUT", GETDNS_CALLBACK_TIMEOUT_TEXT },
{ 703, "GETDNS_CALLBACK_ERROR", GETDNS_CALLBACK_ERROR_TEXT },
{ 800, "GETDNS_NAMETYPE_DNS", GETDNS_NAMETYPE_DNS_TEXT },
{ 801, "GETDNS_NAMETYPE_WINS", GETDNS_NAMETYPE_WINS_TEXT },
{ 900, "GETDNS_RESPSTATUS_GOOD", GETDNS_RESPSTATUS_GOOD_TEXT },
{ 901, "GETDNS_RESPSTATUS_NO_NAME", GETDNS_RESPSTATUS_NO_NAME_TEXT },
{ 902, "GETDNS_RESPSTATUS_ALL_TIMEOUT", GETDNS_RESPSTATUS_ALL_TIMEOUT_TEXT },
{ 903, "GETDNS_RESPSTATUS_NO_SECURE_ANSWERS", GETDNS_RESPSTATUS_NO_SECURE_ANSWERS_TEXT },
{ 1000, "GETDNS_EXTENSION_TRUE", GETDNS_EXTENSION_TRUE_TEXT },
{ 1001, "GETDNS_EXTENSION_FALSE", GETDNS_EXTENSION_FALSE_TEXT },
{ 1100, "GETDNS_BAD_DNS_CNAME_IN_TARGET", GETDNS_BAD_DNS_CNAME_IN_TARGET_TEXT },
{ 1101, "GETDNS_BAD_DNS_ALL_NUMERIC_LABEL", GETDNS_BAD_DNS_ALL_NUMERIC_LABEL_TEXT },
{ 1102, "GETDNS_BAD_DNS_CNAME_RETURNED_FOR_OTHER_TYPE", GETDNS_BAD_DNS_CNAME_RETURNED_FOR_OTHER_TYPE_TEXT },
};
static int const_info_cmp(const void *a, const void *b)
{
return ((struct const_info *) a)->code - ((struct const_info *) b)->code;
}
struct const_info *
priv_getdns_get_const_info(int value)
{
struct const_info key = { value, "", "" };
struct const_info *i = bsearch(&key, consts_info,
sizeof(consts_info) / sizeof(struct const_info),
sizeof(struct const_info), const_info_cmp);
if (i)
return i;
return consts_info;
}

52
src/const-info.h Normal file
View File

@ -0,0 +1,52 @@
/**
*
* /brief priv_getdns_consts table with values, names and descriptions of the
* constants in getdns
*
* The priv_getdns_get_validation_chain function is called after an answer
* has been fetched when the dnssec_return_validation_chain extension is set.
* It fetches DNSKEYs, DSes and their signatures for all RRSIGs found in the
* answer.
*/
/*
* Copyright (c) 2013, Versign, 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 the <organization> 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 Verisign, Inc. 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.
*/
#ifndef CONST_INFO_H_
#define CONST_INFO_H_
struct const_info {
int code;
const char *name;
const char *text;
};
struct const_info *priv_getdns_get_const_info(int value);
#endif
/* const-info.h */

View File

@ -366,6 +366,58 @@ timeout_cmp(const void *to1, const void *to2)
}
}
/*
* priv_getdns_check_and_add_ta_file
*
* Do not set trust anchor when it is unreadable or unparsable.
* Copied from (older) unbound anchor_read_file
*/
static void
priv_getdns_check_and_add_ta_file(struct getdns_context *context)
{
uint32_t ttl = 3600;
ldns_rdf* orig = NULL, *prev = NULL;
int line = 1;
ldns_status s;
ldns_rr *rr;
int nkeys;
FILE *in = fopen(TRUST_ANCHOR_FILE, "r");
context->has_ta = 0;
if (!in)
return;
nkeys = 0;
while (! feof(in)) {
rr = NULL;
s = ldns_rr_new_frm_fp_l(&rr, in, &ttl, &orig, &prev, &line);
if (s == LDNS_STATUS_SYNTAX_EMPTY /* empty line */
|| s == LDNS_STATUS_SYNTAX_TTL /* $TTL */
|| s == LDNS_STATUS_SYNTAX_ORIGIN /* $ORIGIN */)
continue;
if (s != LDNS_STATUS_OK) {
ldns_rr_free(rr);
nkeys = 0;
break;
}
if (ldns_rr_get_type(rr) == LDNS_RR_TYPE_DS ||
ldns_rr_get_type(rr) == LDNS_RR_TYPE_DNSKEY)
nkeys++;
ldns_rr_free(rr);
}
ldns_rdf_deep_free(orig);
ldns_rdf_deep_free(prev);
fclose(in);
if (nkeys) {
context->has_ta = nkeys;
(void) ub_ctx_add_ta_file(context->unbound_ctx,
TRUST_ANCHOR_FILE);
}
}
/*
* getdns_context_create
*
@ -452,6 +504,9 @@ getdns_context_create_with_extended_memory_functions(
getdns_context_set_dns_transport(result,
GETDNS_TRANSPORT_UDP_FIRST_AND_FALL_BACK_TO_TCP);
/* Set default trust anchor */
priv_getdns_check_and_add_ta_file(result);
return GETDNS_RETURN_GOOD;
} /* getdns_context_create_with_extended_memory_functions */
@ -1105,131 +1160,162 @@ getdns_cancel_callback(struct getdns_context *context,
{
RETURN_IF_NULL(context, GETDNS_RETURN_INVALID_PARAMETER);
return getdns_context_cancel_request(context, transaction_id, 1);
} /* getdns_cancel_callback */
} /* getdns_cancel_callback */
static void
ub_setup_stub(struct ub_ctx *ctx, struct getdns_list * upstreams, size_t count)
static getdns_return_t
ub_setup_stub(struct ub_ctx *ctx, struct getdns_list * upstreams)
{
size_t i;
/* reset forwarding servers */
ub_ctx_set_fwd(ctx, NULL);
for (i = 0; i < count; ++i) {
struct getdns_dict *dict = NULL;
char *ip_str = NULL;
getdns_list_get_dict(upstreams, i, &dict);
getdns_dict_util_get_string(dict, GETDNS_STR_ADDRESS_STRING,
&ip_str);
ub_ctx_set_fwd(ctx, ip_str);
}
/* Allow lookups of:
*/
/* - localhost */
(void)ub_ctx_zone_remove(ctx, "localhost.");
size_t i;
size_t count;
struct getdns_dict *dict;
struct getdns_bindata *address_string;
getdns_return_t r;
r = getdns_list_get_length(upstreams, &count);
if (r != GETDNS_RETURN_GOOD)
return r;
/* - reverse IPv4 loopback */
(void)ub_ctx_zone_remove(ctx, "127.in-addr.arpa.");
if (count == 0)
return GETDNS_RETURN_BAD_CONTEXT;
/* - reverse IPv6 loopback */
(void)ub_ctx_zone_remove(ctx, "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0."
"0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa.");
/* reset forwarding servers */
(void) ub_ctx_set_fwd(ctx, NULL);
for (i = 0; i < count; ++i) {
r = getdns_list_get_dict(upstreams, i, &dict);
if (r != GETDNS_RETURN_GOOD)
break;
/* - reverse RFC1918 local use zones */
(void)ub_ctx_zone_remove(ctx, "10.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "16.172.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "17.172.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "18.172.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "19.172.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "20.172.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "21.172.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "22.172.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "23.172.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "24.172.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "25.172.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "26.172.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "27.172.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "28.172.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "29.172.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "30.172.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "31.172.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "168.192.in-addr.arpa.");
r = getdns_dict_get_bindata(dict, GETDNS_STR_ADDRESS_STRING,
&address_string);
if (r != GETDNS_RETURN_GOOD)
break;
/* - reverse RFC3330 IP4 this, link-local, testnet and broadcast */
(void)ub_ctx_zone_remove(ctx, "0.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "254.169.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "2.0.192.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "100.51.198.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "113.0.203.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "255.255.255.255.in-addr.arpa.");
(void) ub_ctx_set_fwd(ctx, (char *)address_string->data);
}
/* Allow lookups of:
*/
/* - localhost */
(void)ub_ctx_zone_remove(ctx, "localhost.");
/* - reverse RFC4291 IP6 unspecified */
(void)ub_ctx_zone_remove(ctx, "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0."
"0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa.");
/* - reverse IPv4 loopback */
(void)ub_ctx_zone_remove(ctx, "127.in-addr.arpa.");
/* - reverse RFC4193 IPv6 Locally Assigned Local Addresses */
(void)ub_ctx_zone_remove(ctx, "D.F.ip6.arpa.");
/* - reverse IPv6 loopback */
(void)ub_ctx_zone_remove(ctx, "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0."
"0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa.");
/* - reverse RFC4291 IPv6 Link Local Addresses */
(void)ub_ctx_zone_remove(ctx, "8.E.F.ip6.arpa.");
(void)ub_ctx_zone_remove(ctx, "9.E.F.ip6.arpa.");
(void)ub_ctx_zone_remove(ctx, "A.E.F.ip6.arpa.");
(void)ub_ctx_zone_remove(ctx, "B.E.F.ip6.arpa.");
/* - reverse RFC1918 local use zones */
(void)ub_ctx_zone_remove(ctx, "10.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "16.172.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "17.172.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "18.172.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "19.172.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "20.172.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "21.172.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "22.172.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "23.172.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "24.172.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "25.172.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "26.172.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "27.172.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "28.172.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "29.172.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "30.172.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "31.172.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "168.192.in-addr.arpa.");
/* - reverse IPv6 Example Prefix */
(void)ub_ctx_zone_remove(ctx, "8.B.D.0.1.0.0.2.ip6.arpa.");
/* - reverse RFC3330 IP4 this, link-local, testnet and broadcast */
(void)ub_ctx_zone_remove(ctx, "0.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "254.169.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "2.0.192.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "100.51.198.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "113.0.203.in-addr.arpa.");
(void)ub_ctx_zone_remove(ctx, "255.255.255.255.in-addr.arpa.");
/* - reverse RFC4291 IP6 unspecified */
(void)ub_ctx_zone_remove(ctx, "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0."
"0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa.");
/* - reverse RFC4193 IPv6 Locally Assigned Local Addresses */
(void)ub_ctx_zone_remove(ctx, "D.F.ip6.arpa.");
/* - reverse RFC4291 IPv6 Link Local Addresses */
(void)ub_ctx_zone_remove(ctx, "8.E.F.ip6.arpa.");
(void)ub_ctx_zone_remove(ctx, "9.E.F.ip6.arpa.");
(void)ub_ctx_zone_remove(ctx, "A.E.F.ip6.arpa.");
(void)ub_ctx_zone_remove(ctx, "B.E.F.ip6.arpa.");
/* - reverse IPv6 Example Prefix */
(void)ub_ctx_zone_remove(ctx, "8.B.D.0.1.0.0.2.ip6.arpa.");
return r;
}
static getdns_return_t
priv_getdns_ns_dns_setup(struct getdns_context *context)
{
assert(context);
switch (context->resolution_type) {
case GETDNS_RESOLUTION_STUB:
return ub_setup_stub(context->unbound_ctx,
context->upstream_list);
case GETDNS_RESOLUTION_RECURSING:
/* TODO: use the root servers via root hints file */
(void) ub_ctx_set_fwd(context->unbound_ctx, NULL);
return GETDNS_RETURN_GOOD;
}
return GETDNS_RETURN_BAD_CONTEXT;
}
getdns_return_t
getdns_context_prepare_for_resolution(struct getdns_context *context, int usenamespaces)
getdns_context_prepare_for_resolution(struct getdns_context *context,
int usenamespaces)
{
int i;
size_t upstream_len = 0;
getdns_return_t r;
RETURN_IF_NULL(context, GETDNS_RETURN_INVALID_PARAMETER);
if (context->resolution_type_set == context->resolution_type)
{
/* already set and no config changes have caused this to be bad. */
return GETDNS_RETURN_BAD_CONTEXT;
}
RETURN_IF_NULL(context, GETDNS_RETURN_INVALID_PARAMETER);
if (context->resolution_type_set == context->resolution_type)
/* already set and no config changes
* have caused this to be bad.
*/
return GETDNS_RETURN_GOOD;
/* TODO: respect namespace order (unbound always uses local first if cfg
* the spec calls for us to treat the namespace list as ordered
* so we need to respect that order
*/
if(usenamespaces == 0)
{
ub_setup_stub(context->unbound_ctx, context->upstream_list,
upstream_len);
if (! usenamespaces) {
r = priv_getdns_ns_dns_setup(context);
if (r == GETDNS_RETURN_GOOD)
context->resolution_type_set = context->resolution_type;
return r;
}
else
{
for(i=0; i<context->namespace_count; i++)
{
if(context->namespaces[i] == GETDNS_NAMESPACE_LOCALNAMES)
{
ub_ctx_hosts(context->unbound_ctx, NULL);
}
else if(context->namespaces[i] == GETDNS_NAMESPACE_DNS)
{
if (context->resolution_type == GETDNS_RESOLUTION_STUB)
{
getdns_return_t r =
getdns_list_get_length(context->upstream_list, &upstream_len);
if (r != GETDNS_RETURN_GOOD || upstream_len == 0)
return GETDNS_RETURN_BAD_CONTEXT;
} else if (context->resolution_type == GETDNS_RESOLUTION_RECURSING)
{
/* TODO: use the root servers via root hints file */
ub_ctx_set_fwd(context->unbound_ctx, NULL);
} else
return GETDNS_RETURN_BAD_CONTEXT;
} /* DNS */
} /* for i */
} /* if usenamespaces = 0 else */
context->resolution_type_set = context->resolution_type;
r = GETDNS_RETURN_GOOD;
for (i = 0; i < context->namespace_count; i++) {
switch (context->namespaces[i]) {
case GETDNS_NAMESPACE_LOCALNAMES:
(void) ub_ctx_hosts(context->unbound_ctx, NULL);
break;
return GETDNS_RETURN_GOOD;
case GETDNS_NAMESPACE_DNS:
r = priv_getdns_ns_dns_setup(context);
break;
default:
r = GETDNS_RETURN_BAD_CONTEXT;
break;
}
if (r != GETDNS_RETURN_GOOD)
return r; /* try again later (resolution_type_set) */
}
context->resolution_type_set = context->resolution_type;
return r;
} /* getdns_context_prepare_for_resolution */
getdns_return_t

View File

@ -91,11 +91,12 @@ struct getdns_context {
/* The underlying unbound contexts that do
* the real work */
struct ub_ctx *unbound_ctx;
int has_ta; /* No DNSSEC without trust anchor */
/* which resolution type the contexts are configured for
* 0 means nothing set
*/
uint8_t resolution_type_set;
getdns_resolution_t resolution_type_set;
/*
* outbound requests -> transaction to getdns_dns_req

View File

@ -33,7 +33,6 @@
*/
#include <getdns/getdns.h>
#include <getdns/getdns_error.h>
#include <stdio.h>
#include <arpa/inet.h>
#include <util-internal.h>
@ -41,6 +40,7 @@
#include <stringprep.h>
#include <idna.h>
#include <ldns/ldns.h>
#include "getdns_error.h"
/* stuff to make it compile pedantically */
#define UNUSED_PARAM(x) ((void)(x))
@ -192,6 +192,7 @@ getdns_display_ip_address(const struct getdns_bindata
return NULL;
}
const char *getdns_get_errorstr_by_id(uint16_t err);
getdns_return_t
getdns_strerror(getdns_return_t err, char *buf, size_t buflen)
{

View File

@ -132,12 +132,7 @@ handle_network_request_error(getdns_network_req * netreq, int err)
static void
handle_dns_request_complete(getdns_dns_req * dns_req)
{
uint32_t ret_chain_ext = GETDNS_EXTENSION_FALSE;
getdns_return_t r = getdns_dict_get_int(dns_req->extensions,
"dnssec_return_validation_chain", &ret_chain_ext);
if (r == GETDNS_RETURN_GOOD && ret_chain_ext == GETDNS_EXTENSION_TRUE)
if (is_extension_set(dns_req->extensions, "dnssec_return_validation_chain"))
priv_getdns_get_validation_chain(dns_req);
else
priv_getdns_call_user_callback(

View File

@ -1,35 +0,0 @@
/**
* \file
* @brief defines and data structure for getdns_error_str_by_id()
*
* This source was taken from the original pseudo-implementation by
* Paul Hoffman.
*/
#ifndef GETDNS_ERROR_H
#define GETDNS_ERROR_H
#include <getdns/getdns.h>
struct getdns_struct_lookup_table
{ /* may or may not want to move this into */
int id; /* getdns.h if it's more generally useful */
const char *name;
};
typedef struct getdns_struct_lookup_table getdns_lookup_table;
/**
* \defgroup error_table error number to string mapping
* @{
*/
extern getdns_lookup_table getdns_error_str[];
typedef enum getdns_enum_status getdns_status;
const char *getdns_get_errorstr_by_id(uint16_t err);
/** @}
*/
#endif /* GETDNS_ERROR_H */

View File

@ -32,53 +32,11 @@
*/
#include <getdns/getdns.h>
#include <getdns/getdns_error.h>
getdns_lookup_table getdns_error_str[] = {
{GETDNS_RETURN_GOOD, "Good"}
,
{GETDNS_RETURN_GENERIC_ERROR, "Generic error"}
,
{GETDNS_RETURN_BAD_DOMAIN_NAME, "Badly-formed domain name in first argument"}
,
{GETDNS_RETURN_BAD_CONTEXT, "Bad value for a context type"}
,
{GETDNS_RETURN_CONTEXT_UPDATE_FAIL, "Did not update the context"}
,
{GETDNS_RETURN_UNKNOWN_TRANSACTION,
"An attempt was made to cancel a callback with a transaction_id that is not recognized"}
,
{GETDNS_RETURN_NO_SUCH_LIST_ITEM,
"A helper function for lists had an index argument that was too high."}
,
{GETDNS_RETURN_NO_SUCH_DICT_NAME,
"A helper function for dicts had a name argument that for a name that is not in the dict."}
,
{GETDNS_RETURN_WRONG_TYPE_REQUESTED,
"A helper function was supposed to return a certain type for an item, but the wrong type was given."}
,
{GETDNS_RETURN_NO_SUCH_EXTENSION,
"A name in the extensions dict is not a valid extension."}
,
{GETDNS_RETURN_EXTENSION_MISFORMAT,
"One or more of the extensions is has a bad format."}
,
{GETDNS_RETURN_DNSSEC_WITH_STUB_DISALLOWED,
"A query was made with a context that is using stub resolution and a DNSSEC extension specified."}
,
{GETDNS_RETURN_MEMORY_ERROR,
"Unable to allocate the memory required."}
,
{GETDNS_RETURN_INVALID_PARAMETER,
GETDNS_RETURN_INVALID_PARAMETER_TEXT }
,
{0, ""}
};
#include "const-info.h"
/*---------------------------------------- getdns_get_errorstr_by_id() */
/**
* return error string from getdns return
* heavily modeled on ldns ldns_get_errorstr_by_id
* @param err getdns_return_t
* @return string containing error message
*/
@ -86,15 +44,7 @@ getdns_lookup_table getdns_error_str[] = {
const char *
getdns_get_errorstr_by_id(uint16_t err)
{
getdns_lookup_table *lt;
lt = getdns_error_str;
while (lt->name != 0) {
if (lt->id == err)
return lt->name;
lt++;
}
return 0;
return priv_getdns_get_const_info(err)->text;
}
/* getdns_error.c */

19
src/getdns_error.h Normal file
View File

@ -0,0 +1,19 @@
/**
* \file
* @brief defines and data structure for getdns_error_str_by_id()
*
* This source was taken from the original pseudo-implementation by
* Paul Hoffman.
*/
#ifndef GETDNS_ERROR_H
#define GETDNS_ERROR_H
#include <getdns/getdns.h>
const char *getdns_get_errorstr_by_id(uint16_t err);
/** @}
*/
#endif /* GETDNS_ERROR_H */

36
src/mk-const-info.c.sh Executable file
View File

@ -0,0 +1,36 @@
#!/bin/sh
cat > const-info.c << END_OF_HEAD
/* WARNING! This file is generated by the mk-const-info.c.sh program.
* Do not edit manually!
*/
#include <getdns/getdns.h>
#include <stdlib.h>
#include "const-info.h"
static struct const_info consts_info[] = {
{ -1, "/* <unknown const value> */", "/* <unknown const value> */" },
END_OF_HEAD
awk '/^[ ]+GETDNS_[A-Z_]+[ ]+=[ ]+[0-9]+/{ print "\t{ "$3", \""$1"\", "$1"_TEXT }," }/^#define GETDNS_[A-Z_]+[ ]+[0-9]+/ && !/^#define GETDNS_RRTYPE/ && !/_TEXT/{ print "\t{ "$3", \""$2"\", "$2"_TEXT },"}' getdns/getdns.h | sed 's/,,/,/g' >> const-info.c
cat >> const-info.c << END_OF_TAIL
};
static int const_info_cmp(const void *a, const void *b)
{
return ((struct const_info *) a)->code - ((struct const_info *) b)->code;
}
struct const_info *
priv_getdns_get_const_info(int value)
{
struct const_info key = { value, "", "" };
struct const_info *i = bsearch(&key, consts_info,
sizeof(consts_info) / sizeof(struct const_info),
sizeof(struct const_info), const_info_cmp);
if (i)
return i;
return consts_info;
}
END_OF_TAIL

View File

@ -116,8 +116,6 @@ dns_req_new(struct getdns_context *context,
getdns_dns_req *result = NULL;
getdns_network_req *req = NULL;
getdns_return_t r;
uint32_t both = GETDNS_EXTENSION_FALSE;
result = GETDNS_MALLOC(context->mf, getdns_dns_req);
if (result == NULL) {
@ -150,12 +148,9 @@ dns_req_new(struct getdns_context *context,
result->first_req = req;
/* tack on A or AAAA if needed */
r = getdns_dict_get_int(extensions,
GETDNS_STR_EXTENSION_RETURN_BOTH_V4_AND_V6, &both);
if (r == GETDNS_RETURN_GOOD &&
both == GETDNS_EXTENSION_TRUE &&
(request_type == GETDNS_RRTYPE_A
|| request_type == GETDNS_RRTYPE_AAAA)) {
if (is_extension_set(extensions, "return_both_v4_and_v6") &&
(request_type == GETDNS_RRTYPE_A ||
request_type == GETDNS_RRTYPE_AAAA)) {
uint16_t next_req_type =
(request_type ==

View File

@ -77,33 +77,37 @@ getdns_general_sync(struct getdns_context *context,
struct getdns_dict *extensions,
struct getdns_dict **response)
{
getdns_dns_req *req;
getdns_return_t response_status;
RETURN_IF_NULL(context, GETDNS_RETURN_INVALID_PARAMETER);
RETURN_IF_NULL(response, GETDNS_RETURN_INVALID_PARAMETER);
RETURN_IF_NULL(name, GETDNS_RETURN_INVALID_PARAMETER);
response_status = validate_dname(name);
if (response_status != GETDNS_RETURN_GOOD) {
return response_status;
}
RETURN_IF_NULL(context, GETDNS_RETURN_INVALID_PARAMETER);
RETURN_IF_NULL(response, GETDNS_RETURN_INVALID_PARAMETER);
RETURN_IF_NULL(name, GETDNS_RETURN_INVALID_PARAMETER);
response_status = validate_dname(name);
if (response_status != GETDNS_RETURN_GOOD)
return response_status;
response_status = validate_extensions(extensions);
if (response_status == GETDNS_RETURN_GOOD) {
/* for each netreq we call ub_ctx_resolve */
/* request state */
getdns_dns_req *req = dns_req_new(context,
name,
request_type,
extensions);
if (!req) {
return GETDNS_RETURN_GENERIC_ERROR;
}
response_status = submit_request_sync(req);
if (response_status != GETDNS_RETURN_GOOD) {
dns_req_free(req);
return response_status;
}
*response = create_getdns_response(req);
dns_req_free(req);
}
if (response_status != GETDNS_RETURN_GOOD)
return response_status;
/* general, so without dns lookup (no namespaces) */;
response_status = getdns_context_prepare_for_resolution(context, 0);
if (response_status != GETDNS_RETURN_GOOD)
return response_status;
/* for each netreq we call ub_ctx_resolve */
/* request state */
req = dns_req_new(context, name, request_type, extensions);
if (!req)
return GETDNS_RETURN_MEMORY_ERROR;
response_status = submit_request_sync(req);
if (response_status == GETDNS_RETURN_GOOD)
*response = create_getdns_response(req);
dns_req_free(req);
return response_status;
}

View File

@ -85,6 +85,7 @@ main (int argc, char** argv)
Suite *getdns_context_set_upstream_recursive_servers_suite(void);
Suite *getdns_service_suite(void);
Suite *getdns_service_sync_suite(void);
Suite *getdns_context_set_timeout_suite(void);
sr = srunner_create(getdns_general_suite());
srunner_add_suite(sr, getdns_general_sync_suite());

View File

@ -114,9 +114,6 @@
}
END_TEST
//name is <non-existent domain name> (NXDOMAIN)
//no extensions
//expected: NXDOMAIN response (with SOA record)
START_TEST (getdns_service_7)
{

View File

@ -13,7 +13,7 @@
{
/*
* context = NULL
* expect: GETDNS_RETURN_BAD_CONTEXT
* expect: GETDNS_RETURN_INVALID_PARAMETER
*/
struct getdns_context *context = NULL;
struct getdns_dict *response = NULL;
@ -27,7 +27,7 @@
{
/*
* name = NULL
* expect: GETDNS_RETURN_BAD_CONTEXT
* expect: GETDNS_RETURN_INVALID_PARAMETER
*/
struct getdns_context *context = NULL;
struct getdns_dict *response = NULL;

View File

@ -138,6 +138,8 @@ typedef struct getdns_network_req
/* result */
ldns_pkt *result;
int secure;
int bogus;
/* next request to issue after this one */
struct getdns_network_req *next;

View File

@ -360,7 +360,7 @@ add_only_addresses(struct getdns_list * addrs, ldns_rr_list * rr_list)
static struct getdns_dict *
create_reply_dict(struct getdns_context *context, getdns_network_req * req,
struct getdns_list * just_addrs)
struct getdns_list * just_addrs, int *nanswers)
{
/* turn a packet into this glorious structure
*
@ -401,18 +401,45 @@ create_reply_dict(struct getdns_context *context, getdns_network_req * req,
* }
*
*/
int r = 0;
getdns_return_t r = 0;
ldns_pkt *reply = req->result;
ldns_rr_list *rr_list = NULL;
ldns_rr *question = NULL;
struct getdns_dict *subdict = NULL;
struct getdns_list *sublist = NULL;
char *name = NULL;
size_t i;
/* info (bools) about dns_req */
int dnssec_return_status;
int dnssec_return_only_secure;
int do_dnssec;
/* info (bool) about network_req */
int include_answers;
int rrsig_in_answer;
struct getdns_dict *result = getdns_dict_create_with_context(context);
if (!result) {
return NULL;
}
assert(nanswers);
dnssec_return_status = is_extension_set(req->owner->extensions,
"dnssec_return_status");
dnssec_return_only_secure = is_extension_set(req->owner->extensions,
"dnssec_return_only_secure");
do_dnssec = ( dnssec_return_status || dnssec_return_only_secure ) &&
context->has_ta;
dnssec_return_status = dnssec_return_status || dnssec_return_only_secure ||
is_extension_set(req->owner->extensions,
"dnssec_return_validation_chain");
include_answers = ! do_dnssec /* No DNSSEC, include answer.*/
|| req->secure /* Always include secure answers. */
|| (! dnssec_return_only_secure /* And insecure answers (ext.), */
&& ! req->bogus); /* unless it is bogus. */
/* header */
do {
subdict = create_reply_header_dict(context, reply);
@ -435,16 +462,29 @@ create_reply_dict(struct getdns_context *context, getdns_network_req * req,
/* answers */
rr_list = ldns_pkt_answer(reply);
sublist = create_list_from_rr_list(context, rr_list);
rrsig_in_answer = 0;
for (i = 0; i < ldns_rr_list_rr_count(rr_list); i++)
if (LDNS_RR_TYPE_RRSIG ==
ldns_rr_get_type(ldns_rr_list_rr(rr_list, i))) {
rrsig_in_answer = 1;
break;
}
if (include_answers) {
*nanswers += ldns_rr_list_rr_count(rr_list);
sublist = create_list_from_rr_list(context, rr_list);
}
else
sublist = getdns_list_create_with_context(context);
r = getdns_dict_set_list(result, GETDNS_STR_KEY_ANSWER, sublist);
getdns_list_destroy(sublist);
if (r != GETDNS_RETURN_GOOD) {
break;
}
if ((req->request_type == GETDNS_RRTYPE_A ||
req->request_type == GETDNS_RRTYPE_AAAA) &&
just_addrs != NULL) {
if (include_answers && just_addrs &&
(req->request_type == GETDNS_RRTYPE_A ||
req->request_type == GETDNS_RRTYPE_AAAA)) {
/* add to just addrs */
r = add_only_addresses(just_addrs, rr_list);
if (r != GETDNS_RETURN_GOOD) {
@ -488,6 +528,18 @@ create_reply_dict(struct getdns_context *context, getdns_network_req * req,
} else {
r = GETDNS_RETURN_MEMORY_ERROR;
}
if (r != GETDNS_RETURN_GOOD)
break;
if (! dnssec_return_status)
break;
r = getdns_dict_set_int(result, "dnssec_status",
( req->secure ? GETDNS_DNSSEC_SECURE
: req->bogus ? GETDNS_DNSSEC_BOGUS
: rrsig_in_answer &&
context->has_ta ? GETDNS_DNSSEC_INDETERMINATE
: GETDNS_DNSSEC_INSECURE ));
} while (0);
if (r != 0) {
@ -520,8 +572,8 @@ create_getdns_response(struct getdns_dns_req * completed_request)
completed_request->context);
getdns_network_req *netreq = completed_request->first_req;
char *canonical_name = NULL;
int r = 0;
getdns_return_t r = 0;
int nanswers = 0, all_secure = 1;
if (completed_request->first_req->request_class == GETDNS_RRTYPE_A ||
completed_request->first_req->request_class ==
@ -530,12 +582,6 @@ create_getdns_response(struct getdns_dns_req * completed_request)
completed_request->context);
}
do {
r = getdns_dict_set_int(result, GETDNS_STR_KEY_STATUS,
GETDNS_RESPSTATUS_GOOD);
if (r != GETDNS_RETURN_GOOD) {
break;
}
canonical_name = get_canonical_name(completed_request->name);
r = getdns_dict_util_set_string(result, GETDNS_STR_KEY_CANONICAL_NM,
canonical_name);
@ -551,6 +597,9 @@ create_getdns_response(struct getdns_dns_req * completed_request)
}
while (netreq && r == GETDNS_RETURN_GOOD) {
all_secure = all_secure && netreq->secure;
struct getdns_bindata full_data;
full_data.data = NULL;
full_data.size = 0;
@ -565,7 +614,7 @@ create_getdns_response(struct getdns_dns_req * completed_request)
size_t idx = 0;
/* reply tree */
struct getdns_dict *reply = create_reply_dict(
completed_request->context, netreq, just_addrs);
completed_request->context, netreq, just_addrs, &nanswers);
r = getdns_list_add_item(replies_tree, &idx);
if (r != GETDNS_RETURN_GOOD) {
getdns_dict_destroy(reply);
@ -614,6 +663,19 @@ create_getdns_response(struct getdns_dns_req * completed_request)
r = getdns_dict_set_list(result, GETDNS_STR_KEY_JUST_ADDRS,
just_addrs);
}
int dnssec_return_only_secure = is_extension_set(
completed_request->extensions, "dnssec_return_only_secure");
r = getdns_dict_set_int(result, GETDNS_STR_KEY_STATUS,
dnssec_return_only_secure
&& ! all_secure ? GETDNS_RESPSTATUS_NO_SECURE_ANSWERS
: nanswers == 0 ? GETDNS_RESPSTATUS_NO_NAME
: GETDNS_RESPSTATUS_GOOD);
if (r != GETDNS_RETURN_GOOD) {
break;
}
} while (0);
/* cleanup */
@ -703,6 +765,8 @@ getdns_apply_network_result(getdns_network_req* netreq,
if (r != LDNS_STATUS_OK) {
return GETDNS_RETURN_GENERIC_ERROR;
}
netreq->secure = ub_res->secure;
netreq->bogus = ub_res->bogus;
return GETDNS_RETURN_GOOD;
}
@ -773,4 +837,17 @@ validate_dname(const char* dname) {
return GETDNS_RETURN_GOOD;
} /* validate_dname */
int
is_extension_set(struct getdns_dict *extensions, const char *extension)
{
getdns_return_t r;
uint32_t value;
if (! extensions)
return 0;
r = getdns_dict_get_int(extensions, extension, &value);
return r == GETDNS_RETURN_GOOD && value == GETDNS_EXTENSION_TRUE;
}
/* util-internal.c */

View File

@ -134,4 +134,6 @@ getdns_return_t validate_extensions(struct getdns_dict * extensions);
struct getdns_list *
create_list_from_rr_list(struct getdns_context *context, ldns_rr_list * rr_list);
int is_extension_set(struct getdns_dict *extensions, const char *extension);
/* util-internal.h */