Commit 0611e530 authored by Ondrej Sury's avatar Ondrej Sury

Imported Upstream version 1.6.10

parent 534e4f00
1.6.10
* New example tool added: ldns-gen-zone.
* bugfix #359: Serial-arithmetic for the inception and expiration
fields of a RRSIG and correctly converting them to broken-out time
information.
* bugfix #364: Slight performance increase of ldns-verifyzone.
* bugfix #367: Fix to allow glue records with the same name as the
delegation.
* Fix ldns-verifyzone to allow NSEC3-less records for NS rrsets *and*
glue when the zone is opt-out.
* bugfix #376: Adapt ldns_nsec3_salt, ldns_nsec3_iterations,
ldns_nsec3_flags and ldns_nsec3_algorithm to work for NSEC3PARAMS too.
* pyldns memory leaks fixed by Bedrich Kosata (at the cost of a bit
performance)
* Better handling of reference variables in ldns_rr_new_frm_fp_l from
pyldns, with a very nice generator function by Bedrich Kosata.
* Decoupling of the rdfs in rrs in the python wrappers to enable
the python garbage collector by Bedrich Kosata.
* bugfix #380: Minimizing effect of discrepancies in sizeof(bool) at
build time and when used.
* bugfix #383: Fix detection of empty nonterminals of multiple labels.
* Fixed the ommission of rrsets in nsec(3)s and rrsigs to all occluded
names (in stead of just the ones that contain glue only) and all
occluded records on the delegation points (in stead of just the glue).
* Clarify the operation of ldns_dnssec_mark_glue and the usage of
ldns_dnssec_node_next_nonglue functions in the documentation.
* Added function ldns_dnssec_mark_and_get_glue as an real fast
alternative for ldns_zone_glue_rr_list.
* Fix parse buffer overflow for max length domain names.
* Fix Makefile for U in environment, since wrong U is more common than
deansification necessity.
1.6.9 2011-03-16 1.6.9 2011-03-16
* Fix creating NSEC(3) bitmaps: make array size 65536, * Fix creating NSEC(3) bitmaps: make array size 65536,
don't add doubles. don't add doubles.
......
...@@ -32,6 +32,10 @@ ifdef glibtool ...@@ -32,6 +32,10 @@ ifdef glibtool
libtool = $(glibtool) libtool = $(glibtool)
endif endif
# override $U variable which is used by autotools for deansification (for
# K&R C compilers), but causes problems if $U is defined in the env).
U=
CC = @CC@ CC = @CC@
ifeq "$(srcdir)" "." ifeq "$(srcdir)" "."
CPPFLAGS = $(strip -I. @CPPFLAGS@ @DEFS@) CPPFLAGS = $(strip -I. @CPPFLAGS@ @DEFS@)
...@@ -44,6 +48,7 @@ LIBS = @LIBS@ ...@@ -44,6 +48,7 @@ LIBS = @LIBS@
LIBOBJS = @LIBOBJS@ LIBOBJS = @LIBOBJS@
PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
PYTHON_X_CFLAGS = @PYTHON_X_CFLAGS@
LIBSSL_CPPFLAGS = @LIBSSL_CPPFLAGS@ LIBSSL_CPPFLAGS = @LIBSSL_CPPFLAGS@
LIBSSL_LDFLAGS = @LIBSSL_LDFLAGS@ LIBSSL_LDFLAGS = @LIBSSL_LDFLAGS@
LIBSSL_LIBS = @LIBSSL_LIBS@ LIBSSL_LIBS = @LIBSSL_LIBS@
...@@ -56,7 +61,7 @@ LINT = splint ...@@ -56,7 +61,7 @@ LINT = splint
LINTFLAGS=+quiet -weak -warnposix -unrecog -Din_addr_t=uint32_t -Du_int=unsigned -Du_char=uint8_t -preproc -Drlimit=rlimit64 -D__gnuc_va_list=va_list LINTFLAGS=+quiet -weak -warnposix -unrecog -Din_addr_t=uint32_t -Du_int=unsigned -Du_char=uint8_t -preproc -Drlimit=rlimit64 -D__gnuc_va_list=va_list
#-Dglob64=glob -Dglobfree64=globfree #-Dglob64=glob -Dglobfree64=globfree
# compat with openssl linux edition. # compat with openssl linux edition.
LINTFLAGS+="-DBN_ULONG=unsigned long" -Dkrb5_int32=int "-Dkrb5_ui_4=unsigned int" -DPQ_64BIT=uint64_t -DRC4_INT=unsigned -fixedformalarray -D"ENGINE=unsigned" -D"RSA=unsigned" -D"DSA=unsigned" -D"EVP_PKEY=unsigned" -D"EVP_MD=unsigned" -D"SSL=unsigned" -D"SSL_CTX=unsigned" -D"X509=unsigned" -D"RC4_KEY=unsigned" -D"EVP_MD_CTX=unsigned" -D"EC_KEY=unsigned" -D"EC_POINT=unsigned" -D"EC_GROUP=unsigned" LINTFLAGS+="-DBN_ULONG=unsigned long" -Dkrb5_int32=int "-Dkrb5_ui_4=unsigned int" -DPQ_64BIT=uint64_t -DRC4_INT=unsigned -fixedformalarray -D"ENGINE=unsigned" -D"RSA=unsigned" -D"DSA=unsigned" -D"EVP_PKEY=unsigned" -D"EVP_MD=unsigned" -D"SSL=unsigned" -D"SSL_CTX=unsigned" -D"X509=unsigned" -D"RC4_KEY=unsigned" -D"EVP_MD_CTX=unsigned" -D"EC_KEY=unsigned" -D"EC_POINT=unsigned" -D"EC_GROUP=unsigned" -D"EVP_PKEY_ASN1_METHOD=struct evp_pkey_asn1_method_st" -D"EVP_PKEY_CTX=struct evp_pkey_ctx_st"
# compat with NetBSD # compat with NetBSD
ifeq "$(shell uname)" "NetBSD" ifeq "$(shell uname)" "NetBSD"
LINTFLAGS+="-D__RENAME(x)=" -D_NETINET_IN_H_ LINTFLAGS+="-D__RENAME(x)=" -D_NETINET_IN_H_
...@@ -76,7 +81,6 @@ LIBDNS_SOURCES = rdata.c util.c rr.c packet.c wire2host.c \ ...@@ -76,7 +81,6 @@ LIBDNS_SOURCES = rdata.c util.c rr.c packet.c wire2host.c \
sha1.c sha2.c sha1.c sha2.c
LIBDNS_HEADERS = $(srcdir)/ldns/error.h \ LIBDNS_HEADERS = $(srcdir)/ldns/error.h \
$(srcdir)/ldns/packet.h \ $(srcdir)/ldns/packet.h \
$(srcdir)/ldns/common.h \
$(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rdata.h \
$(srcdir)/ldns/rr.h \ $(srcdir)/ldns/rr.h \
$(srcdir)/ldns/wire2host.h \ $(srcdir)/ldns/wire2host.h \
...@@ -111,7 +115,7 @@ COMP_LIB = $(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) ...@@ -111,7 +115,7 @@ COMP_LIB = $(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS)
LINK = $(CC) $(strip $(CFLAGS) $(LDFLAGS) $(LIBS)) LINK = $(CC) $(strip $(CFLAGS) $(LDFLAGS) $(LIBS))
LINK_LIB = $(LIBTOOL) --mode=link $(CC) $(strip $(CFLAGS) $(LDFLAGS) $(LIBS) -version-number $(version_info) -no-undefined) LINK_LIB = $(LIBTOOL) --mode=link $(CC) $(strip $(CFLAGS) $(LDFLAGS) $(LIBS) -version-number $(version_info) -no-undefined)
%.o: $(srcdir)/%.c $(LIBDNS_HEADERS) ldns/net.h ldns/util.h ldns/config.h %.o: $(srcdir)/%.c $(LIBDNS_HEADERS) ldns/common.h ldns/net.h ldns/util.h ldns/config.h
$(COMP_LIB) $(LIBSSL_CPPFLAGS) -c $< $(COMP_LIB) $(LIBSSL_CPPFLAGS) -c $<
.PHONY: clean realclean docclean manpages doc lint all lib pyldns test .PHONY: clean realclean docclean manpages doc lint all lib pyldns test
...@@ -120,7 +124,7 @@ LINK_LIB = $(LIBTOOL) --mode=link $(CC) $(strip $(CFLAGS) $(LDFLAGS) $(LIBS) -ve ...@@ -120,7 +124,7 @@ LINK_LIB = $(LIBTOOL) --mode=link $(CC) $(strip $(CFLAGS) $(LDFLAGS) $(LIBS) -ve
all: copy-headers lib linktest manpages @PYLDNS@ all: copy-headers lib linktest manpages @PYLDNS@
linktest: $(srcdir)/linktest.c $(LIBDNS_HEADERS) ldns/net.h ldns/util.h ldns/config.h libldns.la linktest: $(srcdir)/linktest.c $(LIBDNS_HEADERS) ldns/common.h ldns/net.h ldns/util.h ldns/config.h libldns.la
$(LIBTOOL) --mode=link $(CC) $(srcdir)/linktest.c $(CPPFLAGS) $(LIBSSL_CPPFLAGS) $(CFLAGS) -lldns $(LIBS) -o linktest $(LIBTOOL) --mode=link $(CC) $(srcdir)/linktest.c $(CPPFLAGS) $(LIBSSL_CPPFLAGS) $(CFLAGS) -lldns $(LIBS) -o linktest
lib: libldns.la lib: libldns.la
...@@ -140,12 +144,12 @@ $(addprefix include/ldns/, $(notdir $(LIBDNS_HEADERS))): include/ldns/%.h: $(src ...@@ -140,12 +144,12 @@ $(addprefix include/ldns/, $(notdir $(LIBDNS_HEADERS))): include/ldns/%.h: $(src
@if [ ! -d include/ldns ] ; then (cd include; ln -s ../ldns ./ldns || echo "include/ldns exists") ; fi ; @if [ ! -d include/ldns ] ; then (cd include; ln -s ../ldns ./ldns || echo "include/ldns exists") ; fi ;
$(INSTALL) -c -m 644 $< ./include/ldns/ $(INSTALL) -c -m 644 $< ./include/ldns/
include/ldns/util.h include/ldns/net.h include/ldns/config.h: include/ldns/%.h: ./ldns/%.h include/ldns/util.h include/ldns/common.h include/ldns/net.h include/ldns/config.h: include/ldns/%.h: ./ldns/%.h
@if [ ! -d include ] ; then ($(INSTALL) -d include || echo "include exists") ; fi ; @if [ ! -d include ] ; then ($(INSTALL) -d include || echo "include exists") ; fi ;
@if [ ! -d include/ldns ] ; then (cd include; ln -s ../ldns ./ldns || echo "include/ldns exists") ; fi ; @if [ ! -d include/ldns ] ; then (cd include; ln -s ../ldns ./ldns || echo "include/ldns exists") ; fi ;
$(INSTALL) -c -m 644 $< ./include/ldns/ $(INSTALL) -c -m 644 $< ./include/ldns/
copy-headers: $(addprefix include/ldns/, $(notdir $(LIBDNS_HEADERS))) include/ldns/util.h include/ldns/net.h include/ldns/config.h copy-headers: $(addprefix include/ldns/, $(notdir $(LIBDNS_HEADERS))) include/ldns/common.h include/ldns/util.h include/ldns/net.h include/ldns/config.h
mancheck: mancheck:
sh -c 'find . -name \*.\[13\] -exec troff -z {} \;' 2>&1 | sed "s/^\.\///" | sed "s/\(:[0\-9]\+:\)/\1 warning:/g" sh -c 'find . -name \*.\[13\] -exec troff -z {} \;' 2>&1 | sed "s/^\.\///" | sed "s/\(:[0\-9]\+:\)/\1 warning:/g"
...@@ -167,18 +171,18 @@ manpages: $(srcdir)/doc/function_manpages ...@@ -167,18 +171,18 @@ manpages: $(srcdir)/doc/function_manpages
pyldns: _ldns.la pyldns: _ldns.la
$(pywrapdir)/ldns_wrapper.c: $(pywrapdir)/ldns.i $(wildcard $(pywrapdir)/*.i) $(LIBDNS_HEADERS) ldns/util.h ldns/config.h $(pywrapdir)/ldns_wrapper.c: $(pywrapdir)/ldns.i $(wildcard $(pywrapdir)/*.i) $(LIBDNS_HEADERS) ldns/common.h ldns/util.h ldns/config.h
$(swig) -python -o $@ $(CPPFLAGS) $(PYTHON_CPPFLAGS) $< $(swig) -python -o $@ $(CPPFLAGS) $(PYTHON_CPPFLAGS) $<
ldns_wrapper.lo: $(pywrapdir)/ldns_wrapper.c $(LIBDNS_HEADERS) ldns/util.h ldns/config.h ldns_wrapper.lo: $(pywrapdir)/ldns_wrapper.c $(LIBDNS_HEADERS) ldns/common.h ldns/util.h ldns/config.h
$(COMP_LIB) -I./include/ldns $(PYTHON_CPPFLAGS) -c $< -o $@ $(COMP_LIB) -I./include/ldns $(PYTHON_CPPFLAGS) $(PYTHON_X_CFLAGS) -c $< -o $@
_ldns.la: ldns_wrapper.lo libldns.la _ldns.la: ldns_wrapper.lo libldns.la
$(LIBTOOL) --tag=CC --mode=link $(CC) $(strip $(CFLAGS) $(PYTHON_CFLAGS) $(LDFLAGS) $(PYTHON_LDFLAGS) -module -version-number $(version_info) -no-undefined -o $@ $< -rpath $(python_site) -L. -L.libs -lldns $(LIBS)) $(LIBTOOL) --tag=CC --mode=link $(CC) $(strip $(CFLAGS) $(PYTHON_CFLAGS) $(LDFLAGS) $(PYTHON_LDFLAGS) -module -version-number $(version_info) -no-undefined -o $@ $< -rpath $(python_site) -L. -L.libs -lldns $(LIBS))
install: install-h install-lib install-config install-manpages $(pyldns_inst) install: install-h install-lib install-config install-manpages $(pyldns_inst)
uninstall: uninstall-manpages uninstall-h uninstall-lib $(pyldns_uninst) uninstall: uninstall-manpages uninstall-config uninstall-h uninstall-lib $(pyldns_uninst)
destclean: uninstall destclean: uninstall
...@@ -188,6 +192,12 @@ install-config: ...@@ -188,6 +192,12 @@ install-config:
$(INSTALL) -c -m 755 packaging/ldns-config $(DESTDIR)$(bindir)/; \ $(INSTALL) -c -m 755 packaging/ldns-config $(DESTDIR)$(bindir)/; \
fi fi
uninstall-config:
if [ $(INSTALL_LDNS_CONFIG) = "yes" ] ; then \
rm -f $(DESTDIR)$(bindir)/ldns-config; \
[ ! -d $(DESTDIR)$(bindir) ] || rmdir -p $(DESTDIR)$(bindir) || echo "ok, dir already gone"; \
fi
install-manpages: manpages install-manpages: manpages
${INSTALL} -d $(DESTDIR)$(mandir)/man3 ${INSTALL} -d $(DESTDIR)$(mandir)/man3
for f in doc/man/man3/*; do \ for f in doc/man/man3/*; do \
...@@ -203,12 +213,16 @@ install-h: lib ...@@ -203,12 +213,16 @@ install-h: lib
$(INSTALL) -m 755 -d $(DESTDIR)$(includedir)/ldns $(INSTALL) -m 755 -d $(DESTDIR)$(includedir)/ldns
for i in $(LIBDNS_HEADERS); do \ for i in $(LIBDNS_HEADERS); do \
$(INSTALL) -c -m 644 $$i $(DESTDIR)$(includedir)/ldns/; done $(INSTALL) -c -m 644 $$i $(DESTDIR)$(includedir)/ldns/; done
$(INSTALL) -c -m 644 include/ldns/common.h $(DESTDIR)$(includedir)/ldns/
$(INSTALL) -c -m 644 include/ldns/util.h $(DESTDIR)$(includedir)/ldns/ $(INSTALL) -c -m 644 include/ldns/util.h $(DESTDIR)$(includedir)/ldns/
$(INSTALL) -c -m 644 include/ldns/net.h $(DESTDIR)$(includedir)/ldns/ $(INSTALL) -c -m 644 include/ldns/net.h $(DESTDIR)$(includedir)/ldns/
uninstall-h: uninstall-h:
for i in $(LIBDNS_HEADERS); do \ for i in $(LIBDNS_HEADERS); do \
rm -f $(DESTDIR)$(includedir)/$$i; done rm -f $(DESTDIR)$(includedir)/$$i; done
rm -f $(DESTDIR)$(includedir)/ldns/net.h
rm -f $(DESTDIR)$(includedir)/ldns/util.h
rm -f $(DESTDIR)$(includedir)/ldns/common.h
[ ! -d $(DESTDIR)$(includedir)/ldns ] || rmdir -p $(DESTDI)$(includedir)/ldns || echo "ok, dir already gone" [ ! -d $(DESTDIR)$(includedir)/ldns ] || rmdir -p $(DESTDI)$(includedir)/ldns || echo "ok, dir already gone"
exit 0 exit 0
...@@ -255,6 +269,7 @@ realclean: clean docclean libclean ...@@ -255,6 +269,7 @@ realclean: clean docclean libclean
rm -f ldns/config.h.in rm -f ldns/config.h.in
rm -f ldns/config.h rm -f ldns/config.h
rm -f ldns/util.h rm -f ldns/util.h
rm -f ldns/common.h
rm -f config.h.in rm -f config.h.in
rm -f configure rm -f configure
rm -f config.sub rm -f config.sub
...@@ -275,7 +290,7 @@ libclean: ...@@ -275,7 +290,7 @@ libclean:
$(LIBTOOL) --mode clean rm -f libldns.so $(LIBTOOL) --mode clean rm -f libldns.so
$(LIBTOOL) --mode clean rm -f libldns.so.* $(LIBTOOL) --mode clean rm -f libldns.so.*
$(LIBTOOL) --mode clean rm -f _ldns.la $(LIBTOOL) --mode clean rm -f _ldns.la
rm -rf ldns/net.h ldns/util.h ldns/config.h rm -rf ldns/net.h ldns/util.h ldns/config.h ldns/common.h
rm -rf *.lo rm -rf *.lo
rm -rf .libs rm -rf .libs
rm -rf libtool rm -rf libtool
......
...@@ -8,6 +8,8 @@ Contents: ...@@ -8,6 +8,8 @@ Contents:
INFORMATION FOR SPECIFIC OPERATING SYSTEMS INFORMATION FOR SPECIFIC OPERATING SYSTEMS
Mac OS X Mac OS X
Solaris Solaris
KNOWN ISSUES
pyldns
Your Support Your Support
Project page: Project page:
...@@ -65,6 +67,7 @@ commands may be a little bit different on your machine. Most notable, you'll nee ...@@ -65,6 +67,7 @@ commands may be a little bit different on your machine. Most notable, you'll nee
* Developers * Developers
ldns is developed by the ldns team at NLnet Labs. This team currently ldns is developed by the ldns team at NLnet Labs. This team currently
consists of: consists of:
o Willem Toorop
o Wouter Wijngaards o Wouter Wijngaards
o Matthijs Mekking o Matthijs Mekking
...@@ -74,6 +77,7 @@ Former main developers: ...@@ -74,6 +77,7 @@ Former main developers:
* Credits * Credits
We have received patches from the following people, thanks! We have received patches from the following people, thanks!
o Bedrich Kosata
o Erik Rozendaal o Erik Rozendaal
o Håkan Olsson o Håkan Olsson
o Jakob Schlyter o Jakob Schlyter
...@@ -82,7 +86,7 @@ We have received patches from the following people, thanks! ...@@ -82,7 +86,7 @@ We have received patches from the following people, thanks!
o Ondřej Surý o Ondřej Surý
IFORMATION FOR SPECIFIC OPERATING SYSTEMS INFORMATION FOR SPECIFIC OPERATING SYSTEMS
MAC OS X MAC OS X
...@@ -103,6 +107,17 @@ compile in 64-bit mode. Jakob Schlyter has kindly contributed a build ...@@ -103,6 +107,17 @@ compile in 64-bit mode. Jakob Schlyter has kindly contributed a build
script that sets the right build and link options. You can find it in script that sets the right build and link options. You can find it in
contrib/build-solaris.sh contrib/build-solaris.sh
KNOWN ISSUES
A complete list of currently known open issues can be found here:
http://www.nlnetlabs.nl/projects/ldns/bugs
* pyldns
Compiling pyldns produces many ``unused parameter'' warnings. Those are
harmless and may safely be ignored.
Also when building with Swig which version is before 2.0.4, compiling
pyldns produces many ``missing initializer'' warnings. Those are harmless
too.
Your Support Your Support
NLnet Labs offers all of its software products as open source, most are NLnet Labs offers all of its software products as open source, most are
......
/* Just a replacement, if the original malloc is not
GNU-compliant. See autoconf documentation. */
#if HAVE_CONFIG_H
#include <ldns/config.h>
#endif
void *calloc();
#if !HAVE_BZERO && HAVE_MEMSET
# define bzero(buf, bytes) ((void) memset (buf, 0, bytes))
#endif
void *
calloc(size_t num, size_t size)
{
void *new = malloc(num * size);
if (!new) {
return NULL;
}
bzero(new, num * size);
return new;
}
This diff is collapsed.
...@@ -6,7 +6,7 @@ sinclude(acx_nlnetlabs.m4) ...@@ -6,7 +6,7 @@ sinclude(acx_nlnetlabs.m4)
# must be numbers. ac_defun because of later processing. # must be numbers. ac_defun because of later processing.
m4_define([VERSION_MAJOR],[1]) m4_define([VERSION_MAJOR],[1])
m4_define([VERSION_MINOR],[6]) m4_define([VERSION_MINOR],[6])
m4_define([VERSION_MICRO],[9]) m4_define([VERSION_MICRO],[10])
AC_INIT(ldns, m4_defn([VERSION_MAJOR]).m4_defn([VERSION_MINOR]).m4_defn([VERSION_MICRO]), libdns@nlnetlabs.nl, libdns) AC_INIT(ldns, m4_defn([VERSION_MAJOR]).m4_defn([VERSION_MINOR]).m4_defn([VERSION_MICRO]), libdns@nlnetlabs.nl, libdns)
AC_CONFIG_SRCDIR([packet.c]) AC_CONFIG_SRCDIR([packet.c])
# needed to build correct soname # needed to build correct soname
...@@ -84,6 +84,7 @@ AC_SEARCH_LIBS([socket], [socket]) ...@@ -84,6 +84,7 @@ AC_SEARCH_LIBS([socket], [socket])
AC_SEARCH_LIBS([inet_pton], [nsl]) AC_SEARCH_LIBS([inet_pton], [nsl])
# check for python # check for python
PYTHON_X_CFLAGS=""
AC_ARG_WITH(pyldns, AC_HELP_STRING([--with-pyldns], AC_ARG_WITH(pyldns, AC_HELP_STRING([--with-pyldns],
[generate python library, or --without-pyldns to disable Python support.]), [generate python library, or --without-pyldns to disable Python support.]),
[],[ withval="no" ]) [],[ withval="no" ])
...@@ -113,9 +114,15 @@ if test x_$withval != x_no; then ...@@ -113,9 +114,15 @@ if test x_$withval != x_no; then
AC_SUBST(swig, "$SWIG") AC_SUBST(swig, "$SWIG")
fi fi
else else
AC_MSG_RESULT([*** don't have Python, skipping Swig, no pyldns ***]) AC_MSG_RESULT([*** don't have Python, skipping Swig, no pyldns ***]) # '
fi
# xtra cflags for pyldns
if test x_$ldns_have_python != x_no; then
ACX_CHECK_COMPILER_FLAG(fno-strict-aliasing, [PYTHON_X_CFLAGS="-fno-strict-aliasing"])
fi fi
fi fi
AC_SUBST(PYTHON_X_CFLAGS)
# Use libtool # Use libtool
ACX_LIBTOOL_C_ONLY ACX_LIBTOOL_C_ONLY
...@@ -177,6 +184,7 @@ case "$enable_ecdsa" in ...@@ -177,6 +184,7 @@ case "$enable_ecdsa" in
]) ])
# we now know we have ECDSA and the required curves. # we now know we have ECDSA and the required curves.
AC_DEFINE_UNQUOTED([USE_ECDSA], [1], [Define this to enable ECDSA support.]) AC_DEFINE_UNQUOTED([USE_ECDSA], [1], [Define this to enable ECDSA support.])
AC_SUBST(ldns_build_config_use_ecdsa, 1)
AC_WARN([ AC_WARN([
***************************************************************** *****************************************************************
*** YOU HAVE ENABLED ECDSA WHICH IS EXPERIMENTAL AT THIS TIME *** *** YOU HAVE ENABLED ECDSA WHICH IS EXPERIMENTAL AT THIS TIME ***
...@@ -184,8 +192,10 @@ case "$enable_ecdsa" in ...@@ -184,8 +192,10 @@ case "$enable_ecdsa" in
*****************************************************************]) *****************************************************************])
;; ;;
no) no)
AC_SUBST(ldns_build_config_use_ecdsa, 0)
;; ;;
*) *)
AC_SUBST(ldns_build_config_use_ecdsa, 0)
;; ;;
esac esac
...@@ -229,10 +239,11 @@ AC_C_BIGENDIAN ...@@ -229,10 +239,11 @@ AC_C_BIGENDIAN
# Checks for header files. # Checks for header files.
AC_HEADER_STDC AC_HEADER_STDC
AC_HEADER_STDBOOL
#AC_HEADER_SYS_WAIT #AC_HEADER_SYS_WAIT
#AC_CHECK_HEADERS([getopt.h fcntl.h stdlib.h string.h strings.h unistd.h]) #AC_CHECK_HEADERS([getopt.h fcntl.h stdlib.h string.h strings.h unistd.h])
# do the very minimum - we can always extend this # do the very minimum - we can always extend this
AC_CHECK_HEADERS([getopt.h stdarg.h stdbool.h openssl/ssl.h netinet/in.h time.h arpa/inet.h netdb.h],,, [AC_INCLUDES_DEFAULT]) AC_CHECK_HEADERS([getopt.h stdarg.h openssl/ssl.h netinet/in.h time.h arpa/inet.h netdb.h],,, [AC_INCLUDES_DEFAULT])
AC_CHECK_HEADERS(sys/param.h sys/mount.h,,, AC_CHECK_HEADERS(sys/param.h sys/mount.h,,,
[AC_INCLUDES_DEFAULT [AC_INCLUDES_DEFAULT
[ [
...@@ -259,8 +270,10 @@ AC_CHECK_HEADER(inttypes.h, ...@@ -259,8 +270,10 @@ AC_CHECK_HEADER(inttypes.h,
[ [
include_inttypes_h='#include <inttypes.h>' include_inttypes_h='#include <inttypes.h>'
AC_DEFINE(HAVE_INTTYPES_H, 1, [define if you have inttypes.h]) AC_DEFINE(HAVE_INTTYPES_H, 1, [define if you have inttypes.h])
AC_SUBST(ldns_build_config_have_inttypes_h, 1)
],[ ],[
include_inttypes_h='' include_inttypes_h=''
AC_SUBST(ldns_build_config_have_inttypes_h, 0)
],[AC_INCLUDES_DEFAULT ],[AC_INCLUDES_DEFAULT
]) ])
AC_SUBST(include_inttypes_h) AC_SUBST(include_inttypes_h)
...@@ -283,6 +296,20 @@ include_unistd_h='' ...@@ -283,6 +296,20 @@ include_unistd_h=''
]) ])
AC_SUBST(include_unistd_h) AC_SUBST(include_unistd_h)
AC_CHECK_SIZEOF(time_t,,[
AC_INCLUDES_DEFAULT
#ifdef TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <time.h>
# endif
#endif
])
ACX_TYPE_SOCKLEN_T ACX_TYPE_SOCKLEN_T
AC_CHECK_TYPE(ssize_t, int) AC_CHECK_TYPE(ssize_t, int)
AC_CHECK_TYPE(in_addr_t, [], [AC_DEFINE([in_addr_t], [uint32_t], [in_addr_t])], [ AC_CHECK_TYPE(in_addr_t, [], [AC_DEFINE([in_addr_t], [uint32_t], [in_addr_t])], [
...@@ -308,6 +335,7 @@ AC_REPLACE_FUNCS(b64_pton) ...@@ -308,6 +335,7 @@ AC_REPLACE_FUNCS(b64_pton)
AC_REPLACE_FUNCS(b64_ntop) AC_REPLACE_FUNCS(b64_ntop)
AC_REPLACE_FUNCS(b32_pton) AC_REPLACE_FUNCS(b32_pton)
AC_REPLACE_FUNCS(b32_ntop) AC_REPLACE_FUNCS(b32_ntop)
AC_REPLACE_FUNCS(calloc)
AC_REPLACE_FUNCS(timegm) AC_REPLACE_FUNCS(timegm)
AC_REPLACE_FUNCS(gmtime_r) AC_REPLACE_FUNCS(gmtime_r)
AC_REPLACE_FUNCS(ctime_r) AC_REPLACE_FUNCS(ctime_r)
...@@ -319,7 +347,7 @@ AC_REPLACE_FUNCS(inet_ntop) ...@@ -319,7 +347,7 @@ AC_REPLACE_FUNCS(inet_ntop)
AC_REPLACE_FUNCS(snprintf) AC_REPLACE_FUNCS(snprintf)
AC_REPLACE_FUNCS(strlcpy) AC_REPLACE_FUNCS(strlcpy)
AC_REPLACE_FUNCS(memmove) AC_REPLACE_FUNCS(memmove)
AC_CHECK_FUNCS([endprotoent endservent sleep random fcntl strtoul]) AC_CHECK_FUNCS([endprotoent endservent sleep random fcntl strtoul bzero memset])
ACX_CHECK_GETADDRINFO_WITH_INCLUDES ACX_CHECK_GETADDRINFO_WITH_INCLUDES
if test $ac_cv_func_getaddrinfo = no; then if test $ac_cv_func_getaddrinfo = no; then
...@@ -479,7 +507,23 @@ size_t strlcpy(char *dst, const char *src, size_t siz); ...@@ -479,7 +507,23 @@ size_t strlcpy(char *dst, const char *src, size_t siz);
#endif #endif
]) ])
AC_CONFIG_FILES([Makefile ldns/net.h ldns/util.h packaging/libldns.pc packaging/ldns-config]) if test "x$HAVE_SSL" = "xyes"; then
AC_SUBST(ldns_build_config_have_ssl, 1)
else
AC_SUBST(ldns_build_config_have_ssl, 0)
fi
if test "x$ac_cv_c_format_attribute" = "xyes"; then
AC_SUBST(ldns_build_config_have_attr_format, 1)
else
AC_SUBST(ldns_build_config_have_attr_format, 0)
fi
if test "x$ac_cv_c_unused_attribute" = "xyes"; then
AC_SUBST(ldns_build_config_have_attr_unused, 1)
else
AC_SUBST(ldns_build_config_have_attr_unused, 0)
fi
AC_CONFIG_FILES([Makefile ldns/common.h ldns/net.h ldns/util.h packaging/libldns.pc packaging/ldns-config])
AC_CONFIG_HEADER([ldns/config.h]) AC_CONFIG_HEADER([ldns/config.h])
AC_OUTPUT AC_OUTPUT
......
...@@ -62,6 +62,6 @@ doc: ../../.libs/ldns.so.1 _ldns.so ...@@ -62,6 +62,6 @@ doc: ../../.libs/ldns.so.1 _ldns.so
#for development only #for development only
swig: ldns.i swig: ldns.i
swig -python -o ldns_wrapper.c -I../.. ldns.i swig -python -o ldns_wrapper.c -I../.. ldns.i
gcc -c ldns_wrapper.c -O9 -fPIC -I../.. -I../../ldns -I/usr/include/python2.5 -I. -o ldns_wrapper.o gcc -c ldns_wrapper.c -O9 -fPIC -I../.. -I../../ldns -I/usr/local/include/python2.6 -I. -o ldns_wrapper.o
ld -shared ldns_wrapper.o -L../../.libs -lldns -o _ldns.so ld -shared ldns_wrapper.o -L../../.libs -lldns -o _ldns.so
import ldns
import sys
if len(sys.argv) <= 1:
print "Usage: %s zone_file" % sys.argv[0]
sys.exit()
inp = open(sys.argv[1],"r");
for rr in ldns.ldns_rr_iter_frm_fp_l(inp):
print rr
inp.close()
import ldns
import sys
if len(sys.argv) <= 1:
print "Usage: %s zone_file" % sys.argv[0]
sys.exit()
inp = open(sys.argv[1],"r");
# variables that preserve the parsers state
my_ttl = 3600;
my_origin = None
my_prev = None
# additional state variables
last_pos = 0
line_nr = 0
while True:
ret = ldns.ldns_rr_new_frm_fp_l_(inp, my_ttl, my_origin, my_prev)
s, rr, line_inc, new_ttl, new_origin, new_prev = ret # unpack the result
line_nr += line_inc # increase number of parsed lines
my_prev = new_prev # update ref to previous owner
if s == ldns.LDNS_STATUS_SYNTAX_TTL:
my_ttl = new_ttl # update default TTL
print "$TTL:", my_ttl
elif s == ldns.LDNS_STATUS_SYNTAX_ORIGIN:
my_origin = new_origin # update reference to origin
print "$ORIGIN:", my_origin
elif s == ldns.LDNS_STATUS_SYNTAX_EMPTY:
if last_pos == inp.tell():
break # no advance since last read - EOF
last_pos = inp.tell()
elif s != ldns.LDNS_STATUS_OK:
print "! parse error in line", line_nr
else:
# we are sure to have LDNS_STATUS_OK
print rr
inp.close()
print "--------------------"
print "Read %d lines" % line_nr
...@@ -95,6 +95,9 @@ uint32_t ldns_read_timeval_usec(struct timeval* t) { ...@@ -95,6 +95,9 @@ uint32_t ldns_read_timeval_usec(struct timeval* t) {
%apply int *OUTPUT { int *line_nr}; %apply int *OUTPUT { int *line_nr};
%apply uint32_t *OUTPUT { uint32_t *default_ttl}; %apply uint32_t *OUTPUT { uint32_t *default_ttl};
// wire2pkt
%apply (char *STRING, int LENGTH) { (const char *str, int len) };
%include "ldns_packet.i" %include "ldns_packet.i"
%include "ldns_resolver.i" %include "ldns_resolver.i"
%include "ldns_rr.i" %include "ldns_rr.i"
...@@ -144,6 +147,14 @@ typedef struct ldns_dnssec_zone { }; ...@@ -144,6 +147,14 @@ typedef struct ldns_dnssec_zone { };
{ {
PyObject* tuple; PyObject* tuple;
/* origin and prev have to be cloned in order to decouple the data
* from the python wrapper
*/
if (origin != NULL)
origin = ldns_rdf_clone(origin);
if (prev != NULL)
prev = ldns_rdf_clone(prev);
ldns_rdf *p_prev = prev; ldns_rdf *p_prev = prev;
ldns_rdf **pp_prev = &p_prev; ldns_rdf **pp_prev = &p_prev;
if (p_prev == 0) pp_prev = 0; if (p_prev == 0) pp_prev = 0;
...@@ -157,14 +168,14 @@ typedef struct ldns_dnssec_zone { }; ...@@ -157,14 +168,14 @@ typedef struct ldns_dnssec_zone { };
PyTuple_SetItem(tuple, 0, SWIG_From_int(st)); PyTuple_SetItem(tuple, 0, SWIG_From_int(st));
PyTuple_SetItem(tuple, 1, (st == LDNS_STATUS_OK) ? PyTuple_SetItem(tuple, 1, (st == LDNS_STATUS_OK) ?
SWIG_NewPointerObj(SWIG_as_voidptr(p_rr), SWIGTYPE_p_ldns_struct_rr, SWIG_POINTER_OWN | 0 ) : SWIG_NewPointerObj(SWIG_as_voidptr(p_rr), SWIGTYPE_p_ldns_struct_rr, SWIG_POINTER_OWN | 0 ) :
Py_None); (Py_INCREF(Py_None), Py_None));
PyTuple_SetItem(tuple, 2, (p_prev != prev) ? PyTuple_SetItem(tuple, 2, (p_prev != prev) ?
SWIG_NewPointerObj(SWIG_as_voidptr(p_prev), SWIGTYPE_p_ldns_struct_rdf, SWIG_POINTER_OWN | 0 ) : SWIG_NewPointerObj(SWIG_as_voidptr(p_prev), SWIGTYPE_p_ldns_struct_rdf, SWIG_POINTER_OWN | 0 ) :
Py_None); (Py_INCREF(Py_None), Py_None));
return tuple; return tuple;
} }
PyObject* ldns_rr_new_frm_fp_l_(FILE *fp, uint32_t default_ttl, ldns_rdf* origin, ldns_rdf* prev, int ret_linenr) PyObject* ldns_rr_new_frm_fp_l_(FILE *fp, uint32_t default_ttl, ldns_rdf* origin, ldns_rdf* prev)
//returns tuple (status, ldns_rr, [line if ret_linenr], ttl, origin, prev) //returns tuple (status, ldns_rr, [line if ret_linenr], ttl, origin, prev)
{ {
int linenr = 0; int linenr = 0;
...@@ -174,13 +185,21 @@ typedef struct ldns_dnssec_zone { }; ...@@ -174,13 +185,21 @@ typedef struct ldns_dnssec_zone { };
uint32_t *p_defttl = &defttl; uint32_t *p_defttl = &defttl;
if (defttl == 0) p_defttl = 0; if (defttl == 0) p_defttl = 0;
/* origin and prev have to be cloned in order to decouple the data
* from the python wrapper
*/
if (origin != NULL)
origin = ldns_rdf_clone(origin);
if (prev != NULL)
prev = ldns_rdf_clone(prev);
ldns_rdf *p_origin = origin; ldns_rdf *p_origin = origin;
ldns_rdf **pp_origin = &p_origin; ldns_rdf **pp_origin = &p_origin;
if (p_origin == 0) pp_origin = 0; //if (p_origin == 0) pp_origin = 0;
ldns_rdf *p_prev = prev; ldns_rdf *p_prev = prev;
ldns_rdf **pp_prev = &p_prev; ldns_rdf **pp_prev = &p_prev;
if (p_prev == 0) pp_prev = 0; //if (p_prev == 0) pp_prev = 0;
ldns_rr *p_rr = 0; ldns_rr *p_rr = 0;
ldns_rr **pp_rr = &p_rr; ldns_rr **pp_rr = &p_rr;
...@@ -188,35 +207,38 @@ typedef struct ldns_dnssec_zone { }; ...@@ -188,35 +207,38 @@ typedef struct ldns_dnssec_zone { };
ldns_status st = ldns_rr_new_frm_fp_l(pp_rr, fp, p_defttl, pp_origin, pp_prev, p_linenr); ldns_status st = ldns_rr_new_frm_fp_l(pp_rr, fp, p_defttl, pp_origin, pp_prev, p_linenr);
PyObject* tuple; PyObject* tuple;
tuple = PyTuple_New(ret_linenr ? 6 : 5); tuple = PyTuple_New(6);
int idx = 0; int idx = 0;
PyTuple_SetItem(tuple, idx, SWIG_From_int(st)); PyTuple_SetItem(tuple, idx, SWIG_From_int(st));
idx++; idx++;
PyTuple_SetItem(tuple, idx, (st == LDNS_STATUS_OK) ? PyTuple_SetItem(tuple, idx, (st == LDNS_STATUS_OK) ?
SWIG_NewPointerObj(SWIG_as_voidptr(p_rr), SWIGTYPE_p_ldns_struct_rr, SWIG_POINTER_OWN | 0 ) : SWIG_NewPointerObj(SWIG_as_voidptr(p_rr), SWIGTYPE_p_ldns_struct_rr, SWIG_POINTER_OWN | 0 ) :
Py_None); (Py_INCREF(Py_None), Py_None));
idx++; idx++;
if (ret_linenr) { PyTuple_SetItem(tuple, idx, SWIG_From_int(linenr));
PyTuple_SetItem(tuple, idx, SWIG_From_int(linenr));
idx++;
}
PyTuple_SetItem(tuple, idx, (defttl != default_ttl) ? SWIG_From_int(defttl) : Py_None);
idx++; idx++;
PyTuple_SetItem(tuple, idx, (p_origin != origin) ? PyTuple_SetItem(tuple, idx, SWIG_From_int(defttl));
SWIG_NewPointerObj(SWIG_as_voidptr(p_origin), SWIGTYPE_p_ldns_struct_rdf, SWIG_POINTER_OWN | 0 ) :
Py_None);
idx++; idx++;
PyTuple_SetItem(tuple, idx, (p_prev != prev) ? PyTuple_SetItem(tuple, idx, SWIG_NewPointerObj(SWIG_as_voidptr(p_origin), SWIGTYPE_p_ldns_struct_rdf, SWIG_POINTER_OWN | 0 ));
SWIG_NewPointerObj(SWIG_as_voidptr(p_prev), SWIGTYPE_p_ldns_struct_rdf, SWIG_POINTER_OWN | 0 ) : idx++;
Py_None); PyTuple_SetItem(tuple, idx, SWIG_NewPointerObj(SWIG_as_voidptr(p_prev), SWIGTYPE_p_ldns_struct_rdf, SWIG_POINTER_OWN | 0 ));
return tuple; return tuple;
} }