aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2014-05-14 18:41:34 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2014-05-14 18:41:34 +0000
commit65be028f32ed37dce84f6328d4a7172132c8c224 (patch)
tree4edff3f361b23a13a9807a3a0906f9026c3a81a5
parent04f3ab9612d73d7516f230df46e860daf892dc71 (diff)
downloadsrc-65be028f32ed37dce84f6328d4a7172132c8c224.tar.gz
src-65be028f32ed37dce84f6328d4a7172132c8c224.zip
import ldns 1.6.17vendor/ldns/1.6.17
Notes
Notes: svn path=/vendor/ldns/dist/; revision=266072 svn path=/vendor/ldns/1.6.17/; revision=266073; tag=vendor/ldns/1.6.17
-rw-r--r--Changelog58
-rw-r--r--Makefile.in268
-rw-r--r--README4
-rw-r--r--README.git (renamed from README.svn)7
-rw-r--r--acx_nlnetlabs.m444
-rw-r--r--ax_python_devel.m461
-rw-r--r--compat/b32_ntop.c333
-rw-r--r--compat/b32_pton.c387
-rw-r--r--compat/b64_ntop.c31
-rw-r--r--compat/b64_pton.c17
-rw-r--r--compat/snprintf.c1750
-rwxr-xr-xconfigure6981
-rw-r--r--configure.ac135
-rw-r--r--contrib/DNS-LDNS/Changes23
-rw-r--r--contrib/DNS-LDNS/LDNS.xs3363
-rw-r--r--contrib/DNS-LDNS/MANIFEST41
-rwxr-xr-xcontrib/DNS-LDNS/Makefile.PL306
-rw-r--r--contrib/DNS-LDNS/README36
-rw-r--r--contrib/DNS-LDNS/const-c.inc2852
-rw-r--r--contrib/DNS-LDNS/const-xs.inc90
-rw-r--r--contrib/DNS-LDNS/fallback/const-c.inc2798
-rw-r--r--contrib/DNS-LDNS/fallback/const-xs.inc90
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS.pm1310
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecDataChain.pm87
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecName.pm110
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecRRSets.pm85
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecRRs.pm82
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecTrustTree.pm99
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecZone.pm176
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/GC.pm122
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/Key.pm122
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/KeyList.pm72
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/Packet.pm259
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/RBNode.pm71
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/RBTree.pm59
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/RData.pm91
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/RR.pm481
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/RRList.pm183
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/Resolver.pm355
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/Zone.pm137
-rw-r--r--contrib/DNS-LDNS/ppport.h7063
-rw-r--r--contrib/DNS-LDNS/t/DNS-LDNS.t136
-rw-r--r--contrib/DNS-LDNS/t/dnssec_datachain.t56
-rw-r--r--contrib/DNS-LDNS/t/dnssec_zone.t35
-rw-r--r--contrib/DNS-LDNS/t/key.t25
-rw-r--r--contrib/DNS-LDNS/t/rdata.t47
-rw-r--r--contrib/DNS-LDNS/t/resolver.t23
-rw-r--r--contrib/DNS-LDNS/t/rr.t47
-rw-r--r--contrib/DNS-LDNS/t/rrlist.t84
-rw-r--r--contrib/DNS-LDNS/t/testdata/key.private13
-rw-r--r--contrib/DNS-LDNS/t/testdata/myzone.org17
-rw-r--r--contrib/DNS-LDNS/t/testdata/resolv.conf3
-rw-r--r--contrib/DNS-LDNS/t/zone.t75
-rw-r--r--contrib/DNS-LDNS/typemap67
-rwxr-xr-xcontrib/build-solaris.sh2
-rw-r--r--contrib/ldnsx/ldnsx.py7
-rw-r--r--contrib/python/Changelog26
-rw-r--r--contrib/python/Makefile6
-rw-r--r--contrib/python/docs/source/conf.py4
-rw-r--r--contrib/python/docs/source/modules/ldns_rdf.rst2
-rwxr-xr-xcontrib/python/examples/test_buffer.py16
-rwxr-xr-xcontrib/python/examples/test_dname.py2
-rwxr-xr-xcontrib/python/examples/test_pkt.py1937
-rwxr-xr-xcontrib/python/examples/test_rdf.py23
-rwxr-xr-xcontrib/python/examples/test_resolver.py1751
-rw-r--r--contrib/python/examples/test_rr.py20
-rw-r--r--contrib/python/ldns_packet.i1348
-rw-r--r--contrib/python/ldns_rdf.i42
-rw-r--r--contrib/python/ldns_resolver.i1278
-rw-r--r--dane.c14
-rw-r--r--dnssec.c308
-rw-r--r--dnssec_sign.c79
-rw-r--r--dnssec_zone.c163
-rw-r--r--doc/API.xml2
-rw-r--r--drill/chasetrace.c2
-rwxr-xr-xdrill/configure37
-rw-r--r--drill/configure.ac2
-rw-r--r--drill/drill.1.in11
-rw-r--r--drill/drill.c55
-rw-r--r--drill/drill_util.c6
-rw-r--r--drill/securetrace.c28
-rw-r--r--drill/work.c1
-rw-r--r--error.c19
-rw-r--r--examples/config.h.in11
-rwxr-xr-xexamples/configure134
-rw-r--r--examples/configure.ac40
-rw-r--r--examples/ldns-compare-zones.c2
-rw-r--r--examples/ldns-dane.1.in3
-rw-r--r--examples/ldns-dane.c104
-rw-r--r--examples/ldns-dpa.c4
-rw-r--r--examples/ldns-key2ds.14
-rw-r--r--examples/ldns-key2ds.c3
-rw-r--r--examples/ldns-keyfetcher.c2
-rw-r--r--examples/ldns-keygen.c4
-rw-r--r--examples/ldns-read-zone.121
-rw-r--r--examples/ldns-read-zone.c126
-rw-r--r--examples/ldns-signzone.c22
-rw-r--r--examples/ldns-testns.c2
-rw-r--r--examples/ldns-testpkts.c61
-rw-r--r--examples/ldns-testpkts.h13
-rw-r--r--examples/ldns-update.c2
-rw-r--r--examples/ldns-verify-zone.c79
-rw-r--r--examples/ldns-walk.112
-rw-r--r--examples/ldns-zcat.14
-rw-r--r--examples/ldns-zcat.c4
-rw-r--r--examples/ldns-zsplit.14
-rw-r--r--examples/ldnsd.c10
-rw-r--r--higher.c48
-rw-r--r--host2str.c683
-rw-r--r--host2wire.c20
-rwxr-xr-xinstall-sh14
-rw-r--r--keys.c18
-rw-r--r--ldns/common.h.in3
-rw-r--r--ldns/config.h.in37
-rw-r--r--ldns/dane.h2
-rw-r--r--ldns/dnssec.h28
-rw-r--r--ldns/dnssec_sign.h4
-rw-r--r--ldns/dnssec_zone.h10
-rw-r--r--ldns/error.h11
-rw-r--r--ldns/host2str.h168
-rw-r--r--ldns/ldns.h7
-rw-r--r--ldns/net.h.in1
-rw-r--r--ldns/packet.h34
-rw-r--r--ldns/radix.h240
-rw-r--r--ldns/rdata.h62
-rw-r--r--ldns/resolver.h55
-rw-r--r--ldns/rr.h50
-rw-r--r--ldns/str2host.h60
-rw-r--r--ldns/util.h.in70
-rw-r--r--m4/libtool.m48001
-rw-r--r--m4/ltoptions.m4384
-rw-r--r--m4/ltsugar.m4123
-rw-r--r--m4/ltversion.m423
-rw-r--r--m4/lt~obsolete.m498
-rw-r--r--net.c796
-rw-r--r--packaging/ldns-config.16
-rwxr-xr-xpackaging/ldns-config.in5
-rw-r--r--packet.c110
-rw-r--r--parse.c4
-rw-r--r--radix.c1590
-rw-r--r--rdata.c91
-rw-r--r--resolver.c182
-rw-r--r--rr.c911
-rw-r--r--sha1.c2
-rw-r--r--sha2.c15
-rw-r--r--str2host.c382
-rw-r--r--tsig.c10
-rw-r--r--util.c311
-rw-r--r--wire2host.c55
149 files changed, 46282 insertions, 7571 deletions
diff --git a/Changelog b/Changelog
index 845d5b8a7388..48ea9bbda3a6 100644
--- a/Changelog
+++ b/Changelog
@@ -1,3 +1,61 @@
+1.6.17 2014-01-10
+ * Fix ldns_dnssec_zone_new_frm_fp_l to allow the last parsed line of a
+ zone to be an NSEC3 (or its RRSIG) covering an empty non terminal.
+ * Add --disable-dane option to configure and check availability of the
+ for dane needed X509_check_ca function in openssl.
+ * bugfix #490: Get rid of type-punned pointer warnings.
+ Thanks Adam Tkac.
+ * Make sure executables are linked against libcrypto with the
+ LIBSSL_LDFLAGS. Thanks Leo Baltus.
+ * Miscellaneous prototype fixes. Thanks Dag-Erling Smørgrav.
+ * README now shows preferred way to configure for examples and drill.
+ * Bind to source address for resolvers. drill binds to source with -I.
+ Thanks Bryan Duff.
+ * -T option for ldns-dane that has specific exit status for PKIX
+ validated connections without (secure) TLSA records.
+ * Fix b{32,64}_{ntop,pton} detection and handling.
+ * New RR type TKEY, but without operational practice.
+ * New RR types HIP, NINFO, RKEY, CDS, EUI48, EUI64, URI, CAA and TA.
+ * New output format flag (and accompanying functions) to print certain
+ RR's as unknown type
+ * -u and -U parameter for ldns-read-zone to mark/unmark a RR type
+ for printing as unknown type
+ * bugfix #504: GPOS RR has three rdata fields. Thanks Jelte Jansen.
+ * bugfix #497: Properly test for EOF when reading key files with drill.
+ * New functions: ldns_pkt_ixfr_request_new and
+ ldns_pkt_ixfr_request_new_frm_str.
+ * Use SNI with ldns-dane
+ * bugfix #507: ldnsx Fix use of non-existent variables and not
+ properly referring to instance variable. Patch from shussain.
+ * bugfix #508: ldnsx Adding NSEC3PARAM to known/allowable RR type
+ dictionary. Patch from shussain.
+ * bugfix #517: ldns_resolver_new_frm_fp error when invoked using a NULL
+ file pointer.
+ * Fix memory leak in contrib/python: ldns_pkt.new_query.
+ * Fix buffer overflow in fget_token and bget_token.
+ * ldns-verify-zone NSEC3 checking from quadratic to linear performance.
+ Thanks NIC MX (nicmexico.mx)
+ * ldns-dane setup new ssl session for each new connect to prevent hangs
+ * bugfix #521: drill trace continue on empty non-terminals with NSEC3
+ * bugfix #525: Fix documentation of ldns_resolver_set_retry
+ * Remove unused LDNS_RDF_TYPE_TSIG and associated functions.
+ * Fix ldns_nsec_covers_name for zones with an apex only. Thanks Miek.
+ * Configure option to build perl bindings: --with-p5-dns-ldns
+ (DNS::LDNS is a contribution from Erik Ostlyngen)
+ * bugfix #527: Move -lssl before -lcrypto when linking
+ * Optimize TSIG digest function name comparison (Thanks Marc Buijsman)
+ * Compare names case insensitive with ldns_pkt_rr_list_by_name and
+ ldns_pkt_rr_list_by_name_and_type (thanks Johannes Naab)
+ * A separate --enable for each draft RR type: --enable-rrtype-ninfo,
+ --enable-rrtype-rkey, --enable-rrtype-cds, --enable-rrtype-uri and
+ --enable-rrtype-ta
+ * bugfix #530: Don't sign and verify duplicate RRs (Thanks Jelte Jansen)
+ * bugfix #505: Manpage and usage output fixes (Thanks Tomas Hozza)
+ * Adjust ldns_sha1() so that the input data is not modified (Thanks
+ Marc Buijsman)
+ * Messages to stderr are now off by default and can be reenabled with
+ the --enable-stderr-msgs configure option.
+
1.6.16 2012-11-13
* Fix Makefile to build pyldns with BSD make
* Fix typo in exporting b32_* symbols to make pyldns load again
diff --git a/Makefile.in b/Makefile.in
index 68ee644b9272..7a1c2414a382 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -2,7 +2,7 @@
# See the file LICENSE for the license
SHELL = @SHELL@
VERSION = @PACKAGE_VERSION@
-version_info = @LIBTOOL_VERSION_INFO@
+version_info = @VERSION_INFO@
srcdir = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
@@ -13,8 +13,10 @@ datadir = @datadir@
libdir = @libdir@
includedir = @includedir@
doxygen = @doxygen@
-pywrapdir = ${srcdir}/contrib/python
-pyldnsxwrapdir = ${srcdir}/contrib/ldnsx
+pywrapdir = $(srcdir)/contrib/python
+pyldnsxwrapdir = $(srcdir)/contrib/ldnsx
+p5_dns_ldns_dir = $(srcdir)/contrib/DNS-LDNS
+PERL = @PERL@
swig = @swig@
swigpy_flags = -python @SWIGPY3@
python_site = @PYTHON_SITE_PKG@
@@ -57,17 +59,19 @@ LINTFLAGS += "-Dsigset_t=long"
LINTFLAGS += "-D__uint16_t=uint16_t" -D"__pure2=" -D"__wchar_t=wchar_t" -D"__packed=" -D"__aligned(x)="
# Ubuntu oneiric"
LINTFLAGS += -D"__BEGIN_DECLS=" -D"__ssize_t=ssize_t" -D"__intptr_t=intptr_t" -D"__nonnull(x)=" -D"__THROW=" -D"__wur=" -D"__off_t=unsigned" -D"__off64_t=unsigned" -D"__useconds_t=unsigned" -D"__uid_t=unsigned" -D"__gid_t=unsigned" -D"__attribute_deprecated__=" -D"__pid_t=unsigned" -D"__restrict=" -D"__END_DECLS=" -D"__BEGIN_NAMESPACE_STD=" -D"__END_NAMESPACE_STD=" -D"__BEGIN_NAMESPACE_C99=" -D"__END_NAMESPACE_C99=" -D"__socklen_t=unsigned" -D"sa_family_t=unsigned " -D"__mode_t=unsigned" -D"u_int16_t=uint16_t" -D"u_int32_t=uint32_t" -D"u_int8_t=uint8_t" -D"u_short=unsigned short" -D"__u16=uint16_t" -D"__u32=uint32_t" -D"__u64=uint64_t"
+# FreeBSD 9
+LINTFLAGS += -D"_RuneLocale=int"
DEPFLAG = @DEPFLAG@
INSTALL = $(srcdir)/install-sh
LIBLOBJS = $(LIBOBJS:.o=.lo)
-LDNS_LOBJS = buffer.lo dane.lo dname.lo dnssec.lo dnssec_sign.lo dnssec_verify.lo dnssec_zone.lo duration.lo error.lo higher.lo host2str.lo host2wire.lo keys.lo net.lo packet.lo parse.lo rbtree.lo rdata.lo resolver.lo rr.lo rr_functions.lo sha1.lo sha2.lo str2host.lo tsig.lo update.lo util.lo wire2host.lo zone.lo
+LDNS_LOBJS = buffer.lo dane.lo dname.lo dnssec.lo dnssec_sign.lo dnssec_verify.lo dnssec_zone.lo duration.lo error.lo higher.lo host2str.lo host2wire.lo keys.lo net.lo packet.lo parse.lo radix.lo rbtree.lo rdata.lo resolver.lo rr.lo rr_functions.lo sha1.lo sha2.lo str2host.lo tsig.lo update.lo util.lo wire2host.lo zone.lo
LDNS_LOBJS_EX = ^linktest\.c$$
LDNS_ALL_LOBJS = $(LDNS_LOBJS) $(LIBLOBJS)
LIB = libldns.la
-LDNS_HEADERS = buffer.h dane.h dname.h dnssec.h dnssec_sign.h dnssec_verify.h dnssec_zone.h duration.h error.h higher.h host2str.h host2wire.h keys.h ldns.h packet.h parse.h rbtree.h rdata.h resolver.h rr_functions.h rr.h sha1.h sha2.h str2host.h tsig.h update.h wire2host.h zone.h
+LDNS_HEADERS = buffer.h dane.h dname.h dnssec.h dnssec_sign.h dnssec_verify.h dnssec_zone.h duration.h error.h higher.h host2str.h host2wire.h keys.h ldns.h packet.h parse.h radix.h rbtree.h rdata.h resolver.h rr_functions.h rr.h sha1.h sha2.h str2host.h tsig.h update.h wire2host.h zone.h
LDNS_HEADERS_EX = ^config\.h|common\.h|util\.h|net\.h$$
LDNS_HEADERS_GEN= common.h util.h net.h
@@ -92,16 +96,14 @@ EX_SSL_LOBJS = examples/ldns-nsec3-hash.lo examples/ldns-revoke.lo examples/ldns
COMPILE = $(CC) $(CPPFLAGS) $(CFLAGS)
COMP_LIB = $(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS)
LINK = $(CC) $(CFLAGS) $(LDFLAGS) $(LIBS)
-LINK_LIB = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) \
- $(LIBS) -version-number $(version_info) -no-undefined
-LINK_EXE = $(LIBTOOL) --mode=link $(CC) $(CPPFLAGS) \
- $(LIBSSL_CPPFLAGS) $(CFLAGS) $(LDFLAGS)
+LINK_LIB = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) $(LIBS) -version-number $(version_info) -no-undefined
+LINK_EXE = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) $(LIBSSL_LDFLAGS)
.PHONY: clean realclean docclean manpages doc lint all lib pyldns test
.PHONY: install uninstall install-doc uninstall-doc uninstall-pyldns
.PHONY: install-h uninstall-h install-lib uninstall-lib install-pyldns
-all: setup-builddir lib linktest manpages @PYLDNS@ @DRILL@ @EXAMPLES@
+all: setup-builddir lib linktest manpages @P5_DNS_LDNS@ @PYLDNS@ @DRILL@ @EXAMPLES@
.SUFFIXES: .c .o .a .lo .h .i
@@ -205,7 +207,8 @@ clean-examples:
$(LIBTOOL) --mode clean rm -f $(EXAMPLE_LOBJS)
linktest: $(srcdir)/linktest.c libldns.la
- $(LIBTOOL) --mode=link $(CC) $(srcdir)/linktest.c $(CPPFLAGS) $(LIBSSL_CPPFLAGS) $(CFLAGS) -lldns $(LIBS) -o linktest
+ $(COMP_LIB) $(LIBSSL_CPPFLAGS) -c $(srcdir)/linktest.c -o linktest.lo
+ $(LINK_EXE) linktest.lo $(LIBS) $(LIBSSL_LIBS) -lldns -o linktest
lib: libldns.la
@@ -247,9 +250,29 @@ ldns_wrapper.lo: $(pywrapdir)/ldns_wrapper.c ldns/config.h
_ldns.la: ldns_wrapper.lo libldns.la
$(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) $(PYTHON_CFLAGS) $(LDFLAGS) $(PYTHON_LDFLAGS) -module -version-number $(version_info) -no-undefined -o $@ ldns_wrapper.lo -rpath $(python_site) -L. -L.libs -lldns $(LIBS)
-install: install-h install-lib @INSTALL_CONFIG@ install-manpages $(pyldns_inst) $(pyldnsx_inst) @INSTALL_DRILL@ @INSTALL_EXAMPLES@
+$(p5_dns_ldns_dir)/Makefile: $(p5_dns_ldns_dir)/Makefile.PL
+ BUILDDIR=`pwd`; cd $(p5_dns_ldns_dir); $(PERL) Makefile.PL PREFIX="$(prefix)" LIBS="-L$$BUILDDIR/.libs -lldns" INC="-I$$BUILDDIR"
-uninstall: uninstall-manpages @UNINSTALL_CONFIG@ uninstall-h uninstall-lib $(pyldns_uninst) $(pyldnsx_uninst) @UNINSTALL_DRILL@ @UNINSTALL_EXAMPLES@
+$(p5_dns_ldns_dir)/blib/arch/auto/DNS/LDNS/LDNS.so: $(p5_dns_ldns_dir)/Makefile
+ cd $(p5_dns_ldns_dir); $(MAKE)
+
+p5-dns-ldns: $(p5_dns_ldns_dir)/blib/arch/auto/DNS/LDNS/LDNS.so
+
+install-p5-dns-ldns: $(p5_dns_ldns_dir)/Makefile
+ cd $(p5_dns_ldns_dir); $(MAKE) install
+
+uninstall-p5-dns-ldns: $(p5_dns_ldns_dir)/Makefile
+ cd $(p5_dns_ldns_dir); $(MAKE) uninstall
+
+clean-p5-dns-ldns: $(p5_dns_ldns_dir)/Makefile
+ cd $(p5_dns_ldns_dir); $(MAKE) clean
+
+test-p5-dns-ldns: $(p5_dns_ldns_dir)/Makefile
+ cd $(p5_dns_ldns_dir); $(MAKE) test
+
+install: install-h install-lib @INSTALL_CONFIG@ install-manpages $(pyldns_inst) $(pyldnsx_inst) @INSTALL_P5_DNS_LDNS@ @INSTALL_DRILL@ @INSTALL_EXAMPLES@
+
+uninstall: uninstall-manpages @UNINSTALL_CONFIG@ uninstall-h uninstall-lib $(pyldns_uninst) $(pyldnsx_uninst) @UNINSTALL_P5_DNS_LDNS@ @UNINSTALL_DRILL@ @UNINSTALL_EXAMPLES@
destclean: uninstall
@@ -331,7 +354,7 @@ clean-lib:
$(LIBTOOL) --mode clean rm -f $(pywrapdir)/ldns_wrapper.c
$(LIBTOOL) --mode clean rm -f $(pywrapdir)/ldns.py
-clean: @CLEAN_DRILL@ @CLEAN_EXAMPLES@ clean-manpages clean-lib putdown-builddir
+clean: @CLEAN_DRILL@ @CLEAN_EXAMPLES@ @CLEAN_P5_DNS_LDNS@ clean-manpages clean-lib putdown-builddir
realclean: clean docclean
rm -f config.status
@@ -396,7 +419,7 @@ allclean: test-clean clean
test-clean:
tpkg -b test clean
-test:
+test: @TEST_P5_DNS_LDNS@
if test -x "`which bash`"; then bash test/test_all.sh; else sh test/test_all.sh; fi
@@ -481,56 +504,56 @@ buffer.lo buffer.o: $(srcdir)/buffer.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/
$(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
dane.lo dane.o: $(srcdir)/dane.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \
$(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \
$(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \
$(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
dname.lo dname.o: $(srcdir)/dname.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \
$(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \
$(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \
$(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
dnssec.lo dnssec.o: $(srcdir)/dnssec.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \
$(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \
$(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \
$(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
dnssec_sign.lo dnssec_sign.o: $(srcdir)/dnssec_sign.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \
ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \
$(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \
$(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
dnssec_verify.lo dnssec_verify.o: $(srcdir)/dnssec_verify.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \
ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \
$(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \
$(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
dnssec_zone.lo dnssec_zone.o: $(srcdir)/dnssec_zone.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \
ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \
$(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \
$(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
duration.lo duration.o: $(srcdir)/duration.c ldns/config.h $(srcdir)/ldns/duration.h
error.lo error.o: $(srcdir)/error.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \
$(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \
@@ -538,72 +561,74 @@ error.lo error.o: $(srcdir)/error.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/uti
$(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
higher.lo higher.o: $(srcdir)/higher.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \
$(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \
$(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \
$(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
host2str.lo host2str.o: $(srcdir)/host2str.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \
ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \
$(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \
$(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
host2wire.lo host2wire.o: $(srcdir)/host2wire.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \
ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \
$(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \
$(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
keys.lo keys.o: $(srcdir)/keys.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \
$(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \
$(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \
$(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
linktest.lo linktest.o: $(srcdir)/linktest.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \
ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \
$(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \
$(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
net.lo net.o: $(srcdir)/net.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \
$(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \
$(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \
$(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
packet.lo packet.o: $(srcdir)/packet.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \
$(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \
$(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \
$(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
parse.lo parse.o: $(srcdir)/parse.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \
$(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \
$(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \
$(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
+radix.lo radix.o: $(srcdir)/radix.c ldns/config.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/error.h ldns/util.h \
+ ldns/common.h
rbtree.lo rbtree.o: $(srcdir)/rbtree.c ldns/config.h $(srcdir)/ldns/rbtree.h ldns/util.h ldns/common.h
rdata.lo rdata.o: $(srcdir)/rdata.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \
$(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \
@@ -611,40 +636,40 @@ rdata.lo rdata.o: $(srcdir)/rdata.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/uti
$(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
resolver.lo resolver.o: $(srcdir)/resolver.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \
ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \
$(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \
$(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
rr.lo rr.o: $(srcdir)/rr.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \
$(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \
$(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \
$(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
rr_functions.lo rr_functions.o: $(srcdir)/rr_functions.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \
ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \
$(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \
$(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
sha1.lo sha1.o: $(srcdir)/sha1.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \
$(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \
$(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \
$(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
sha2.lo sha2.o: $(srcdir)/sha2.c ldns/config.h $(srcdir)/ldns/sha2.h
str2host.lo str2host.o: $(srcdir)/str2host.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \
ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \
@@ -652,24 +677,24 @@ str2host.lo str2host.o: $(srcdir)/str2host.c ldns/config.h $(srcdir)/ldns/ldns.h
$(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
tsig.lo tsig.o: $(srcdir)/tsig.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \
$(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \
$(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \
$(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
update.lo update.o: $(srcdir)/update.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \
$(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \
$(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \
$(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
util.lo util.o: $(srcdir)/util.c ldns/config.h $(srcdir)/ldns/rdata.h ldns/common.h $(srcdir)/ldns/error.h \
ldns/util.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/buffer.h
wire2host.lo wire2host.o: $(srcdir)/wire2host.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \
@@ -678,18 +703,16 @@ wire2host.lo wire2host.o: $(srcdir)/wire2host.c ldns/config.h $(srcdir)/ldns/ldn
$(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
zone.lo zone.o: $(srcdir)/zone.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \
$(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \
$(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \
$(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
-compat/b32_ntop.lo compat/b32_ntop.o: $(srcdir)/compat/b32_ntop.c ldns/config.h
-compat/b32_pton.lo compat/b32_pton.o: $(srcdir)/compat/b32_pton.c ldns/config.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
compat/b64_ntop.lo compat/b64_ntop.o: $(srcdir)/compat/b64_ntop.c ldns/config.h
compat/b64_pton.lo compat/b64_pton.o: $(srcdir)/compat/b64_pton.c ldns/config.h
compat/calloc.lo compat/calloc.o: $(srcdir)/compat/calloc.c ldns/config.h
@@ -715,8 +738,8 @@ examples/ldns-chaos.lo examples/ldns-chaos.o: $(srcdir)/examples/ldns-chaos.c ld
$(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
examples/ldns-compare-zones.lo examples/ldns-compare-zones.o: $(srcdir)/examples/ldns-compare-zones.c ldns/config.h $(srcdir)/ldns/ldns.h \
ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \
$(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \
@@ -724,31 +747,31 @@ examples/ldns-compare-zones.lo examples/ldns-compare-zones.o: $(srcdir)/examples
$(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \
$(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \
$(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \
- $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
examples/ldns-dane.lo examples/ldns-dane.o: $(srcdir)/examples/ldns-dane.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \
ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \
$(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \
$(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
examples/ldnsd.lo examples/ldnsd.o: $(srcdir)/examples/ldnsd.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \
$(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \
$(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \
$(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
examples/ldns-dpa.lo examples/ldns-dpa.o: $(srcdir)/examples/ldns-dpa.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \
ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \
$(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \
$(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h $(srcdir)/examples/ldns-dpa.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h $(srcdir)/examples/ldns-dpa.h
examples/ldns-gen-zone.lo examples/ldns-gen-zone.o: $(srcdir)/examples/ldns-gen-zone.c ldns/config.h $(srcdir)/ldns/ldns.h \
ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \
$(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \
@@ -756,15 +779,15 @@ examples/ldns-gen-zone.lo examples/ldns-gen-zone.o: $(srcdir)/examples/ldns-gen-
$(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \
$(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \
$(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \
- $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
examples/ldns-key2ds.lo examples/ldns-key2ds.o: $(srcdir)/examples/ldns-key2ds.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \
ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \
$(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \
$(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
examples/ldns-keyfetcher.lo examples/ldns-keyfetcher.o: $(srcdir)/examples/ldns-keyfetcher.c ldns/config.h $(srcdir)/ldns/ldns.h \
ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \
$(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \
@@ -772,31 +795,31 @@ examples/ldns-keyfetcher.lo examples/ldns-keyfetcher.o: $(srcdir)/examples/ldns-
$(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \
$(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \
$(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \
- $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
examples/ldns-keygen.lo examples/ldns-keygen.o: $(srcdir)/examples/ldns-keygen.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \
ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \
$(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \
$(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
examples/ldns-mx.lo examples/ldns-mx.o: $(srcdir)/examples/ldns-mx.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \
ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \
$(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \
$(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
examples/ldns-notify.lo examples/ldns-notify.o: $(srcdir)/examples/ldns-notify.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \
ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \
$(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \
$(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
examples/ldns-nsec3-hash.lo examples/ldns-nsec3-hash.o: $(srcdir)/examples/ldns-nsec3-hash.c ldns/config.h $(srcdir)/ldns/ldns.h \
ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \
$(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \
@@ -804,7 +827,7 @@ examples/ldns-nsec3-hash.lo examples/ldns-nsec3-hash.o: $(srcdir)/examples/ldns-
$(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \
$(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \
$(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \
- $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
examples/ldns-read-zone.lo examples/ldns-read-zone.o: $(srcdir)/examples/ldns-read-zone.c ldns/config.h $(srcdir)/ldns/ldns.h \
ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \
$(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \
@@ -812,7 +835,7 @@ examples/ldns-read-zone.lo examples/ldns-read-zone.o: $(srcdir)/examples/ldns-re
$(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \
$(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \
$(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \
- $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
examples/ldns-resolver.lo examples/ldns-resolver.o: $(srcdir)/examples/ldns-resolver.c ldns/config.h $(srcdir)/ldns/ldns.h \
ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \
$(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \
@@ -820,23 +843,23 @@ examples/ldns-resolver.lo examples/ldns-resolver.o: $(srcdir)/examples/ldns-reso
$(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \
$(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \
$(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \
- $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
examples/ldns-revoke.lo examples/ldns-revoke.o: $(srcdir)/examples/ldns-revoke.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \
ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \
$(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \
$(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
examples/ldns-rrsig.lo examples/ldns-rrsig.o: $(srcdir)/examples/ldns-rrsig.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \
ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \
$(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \
$(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
examples/ldns-signzone.lo examples/ldns-signzone.o: $(srcdir)/examples/ldns-signzone.c ldns/config.h $(srcdir)/ldns/ldns.h \
ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \
$(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \
@@ -844,7 +867,7 @@ examples/ldns-signzone.lo examples/ldns-signzone.o: $(srcdir)/examples/ldns-sign
$(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \
$(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \
$(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \
- $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
examples/ldns-test-edns.lo examples/ldns-test-edns.o: $(srcdir)/examples/ldns-test-edns.c ldns/config.h $(srcdir)/ldns/ldns.h \
ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \
$(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \
@@ -852,15 +875,15 @@ examples/ldns-test-edns.lo examples/ldns-test-edns.o: $(srcdir)/examples/ldns-te
$(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \
$(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \
$(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \
- $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
examples/ldns-testns.lo examples/ldns-testns.o: $(srcdir)/examples/ldns-testns.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \
ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \
$(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \
$(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h $(srcdir)/examples/ldns-testpkts.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h $(srcdir)/examples/ldns-testpkts.h
examples/ldns-testpkts.lo examples/ldns-testpkts.o: $(srcdir)/examples/ldns-testpkts.c ldns/config.h $(srcdir)/ldns/ldns.h \
ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \
$(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \
@@ -868,15 +891,16 @@ examples/ldns-testpkts.lo examples/ldns-testpkts.o: $(srcdir)/examples/ldns-test
$(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \
$(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \
$(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \
- $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h $(srcdir)/examples/ldns-testpkts.h
+ $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h \
+ $(srcdir)/examples/ldns-testpkts.h
examples/ldns-update.lo examples/ldns-update.o: $(srcdir)/examples/ldns-update.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \
ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \
$(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \
$(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
examples/ldns-verify-zone.lo examples/ldns-verify-zone.o: $(srcdir)/examples/ldns-verify-zone.c ldns/config.h $(srcdir)/ldns/ldns.h \
ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \
$(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \
@@ -884,39 +908,39 @@ examples/ldns-verify-zone.lo examples/ldns-verify-zone.o: $(srcdir)/examples/ldn
$(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \
$(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \
$(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \
- $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
examples/ldns-version.lo examples/ldns-version.o: $(srcdir)/examples/ldns-version.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \
ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \
$(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \
$(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
examples/ldns-walk.lo examples/ldns-walk.o: $(srcdir)/examples/ldns-walk.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \
ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \
$(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \
$(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
examples/ldns-zcat.lo examples/ldns-zcat.o: $(srcdir)/examples/ldns-zcat.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \
ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \
$(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \
$(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
examples/ldns-zsplit.lo examples/ldns-zsplit.o: $(srcdir)/examples/ldns-zsplit.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \
ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \
$(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \
$(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \
$(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \
$(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
drill/chasetrace.lo drill/chasetrace.o: $(srcdir)/drill/chasetrace.c $(srcdir)/drill/drill.h ldns/config.h \
$(srcdir)/drill/drill_util.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h \
$(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h \
@@ -924,8 +948,8 @@ drill/chasetrace.lo drill/chasetrace.o: $(srcdir)/drill/chasetrace.c $(srcdir)/d
$(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h \
$(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h \
$(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
drill/dnssec.lo drill/dnssec.o: $(srcdir)/drill/dnssec.c $(srcdir)/drill/drill.h ldns/config.h $(srcdir)/drill/drill_util.h \
$(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h \
$(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h \
@@ -933,7 +957,7 @@ drill/dnssec.lo drill/dnssec.o: $(srcdir)/drill/dnssec.c $(srcdir)/drill/drill.h
$(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h \
$(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h \
ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h \
- $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
drill/drill.lo drill/drill.o: $(srcdir)/drill/drill.c $(srcdir)/drill/drill.h ldns/config.h $(srcdir)/drill/drill_util.h \
$(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h \
$(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h \
@@ -941,7 +965,7 @@ drill/drill.lo drill/drill.o: $(srcdir)/drill/drill.c $(srcdir)/drill/drill.h ld
$(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h \
$(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h \
ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h \
- $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
drill/drill_util.lo drill/drill_util.o: $(srcdir)/drill/drill_util.c $(srcdir)/drill/drill.h ldns/config.h \
$(srcdir)/drill/drill_util.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h \
$(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h \
@@ -949,8 +973,8 @@ drill/drill_util.lo drill/drill_util.o: $(srcdir)/drill/drill_util.c $(srcdir)/d
$(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h \
$(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h \
$(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
drill/error.lo drill/error.o: $(srcdir)/drill/error.c $(srcdir)/drill/drill.h ldns/config.h $(srcdir)/drill/drill_util.h \
$(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h \
$(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h \
@@ -958,7 +982,7 @@ drill/error.lo drill/error.o: $(srcdir)/drill/error.c $(srcdir)/drill/drill.h ld
$(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h \
$(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h \
ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h \
- $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
drill/root.lo drill/root.o: $(srcdir)/drill/root.c $(srcdir)/drill/drill.h ldns/config.h $(srcdir)/drill/drill_util.h \
$(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h \
$(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h \
@@ -966,7 +990,7 @@ drill/root.lo drill/root.o: $(srcdir)/drill/root.c $(srcdir)/drill/drill.h ldns/
$(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h \
$(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h \
ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h \
- $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
drill/securetrace.lo drill/securetrace.o: $(srcdir)/drill/securetrace.c $(srcdir)/drill/drill.h ldns/config.h \
$(srcdir)/drill/drill_util.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h \
$(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h \
@@ -974,8 +998,8 @@ drill/securetrace.lo drill/securetrace.o: $(srcdir)/drill/securetrace.c $(srcdir
$(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h \
$(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h \
$(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \
- $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \
- $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \
+ $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
drill/work.lo drill/work.o: $(srcdir)/drill/work.c $(srcdir)/drill/drill.h ldns/config.h $(srcdir)/drill/drill_util.h \
$(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h \
$(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h \
@@ -983,7 +1007,7 @@ drill/work.lo drill/work.o: $(srcdir)/drill/work.c $(srcdir)/drill/drill.h ldns/
$(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h \
$(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h \
ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h \
- $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
+ $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h
examples/ldns-chaos: examples/ldns-chaos.lo examples/ldns-chaos.o $(LIB)
examples/ldns-compare-zones: examples/ldns-compare-zones.lo examples/ldns-compare-zones.o $(LIB)
examples/ldnsd: examples/ldnsd.lo examples/ldnsd.o $(LIB)
diff --git a/README b/README
index 0c21e6551cde..6319c6f52553 100644
--- a/README
+++ b/README
@@ -37,11 +37,11 @@ INSTALLATION
5. make install
-* Building from subversion repository
+* Building from repository
If you are building from the repository you will need to have (gnu)
autotools like libtool and autoreconf installed. A list of all the commands
-needed to build everything can be found in README.svn. Note that the actual
+needed to build everything can be found in README.git. Note that the actual
commands may be a little bit different on your machine. Most notable, you'll need to run libtoolize (or glibtoolize), if you skip this step, you'll get an error about missing config.sub.
* Developers
diff --git a/README.svn b/README.git
index cd402d49c1b0..34c9ae54f5e4 100644
--- a/README.svn
+++ b/README.git
@@ -1,6 +1,5 @@
-
-# The ldns subversion repository can found at:
-# www.nlnetlabs.nl/ldns/svn/
+# The ldns git repository can found at:
+# git.nlnetlabs.nl/ldns/
# small list of commands to build all on a linux system
# libtoolize is needed for most other targets
@@ -16,7 +15,7 @@
# it is needed)
libtoolize -c --install
autoreconf --install
-./configure --with-examples --with-drill # --with-pyldns
+./configure --with-examples --with-drill # --with-pyldns --with-p5-dns-ldns
make
make doc # needs doxygen for the html pages
(cd pcat && autoreconf && ./configure && make)
diff --git a/acx_nlnetlabs.m4 b/acx_nlnetlabs.m4
index e90c81ea02ab..a4047332ff22 100644
--- a/acx_nlnetlabs.m4
+++ b/acx_nlnetlabs.m4
@@ -2,7 +2,12 @@
# Copyright 2009, Wouter Wijngaards, NLnet Labs.
# BSD licensed.
#
-# Version 21
+# Version 26
+# 2013-09-19 FLTO help text improved.
+# 2013-07-18 Enable ACX_CHECK_COMPILER_FLAG to test for -Wstrict-prototypes
+# 2013-06-25 FLTO has --disable-flto option.
+# 2013-05-03 Update W32_SLEEP for newer mingw that links but not defines it.
+# 2013-03-22 Fix ACX_RSRC_VERSION for long version numbers.
# 2012-02-09 Fix AHX_MEMCMP_BROKEN with undef in compat/memcmp.h.
# 2012-01-20 Fix COMPILER_FLAGS_UNBOUND for gcc 4.6.2 assigned-not-used-warns.
# 2011-12-05 Fix getaddrinfowithincludes on windows with fedora16 mingw32-gcc.
@@ -17,7 +22,7 @@
# 2010-07-02 Add check for ss_family (for minix).
# 2010-04-26 Fix to use CPPFLAGS for CHECK_COMPILER_FLAGS.
# 2010-03-01 Fix RPATH using CONFIG_COMMANDS to run at the very end.
-# 2010-02-18 WITH_SSL outputs the LIBSSL_LDFLAGS, LIBS, CPPFLAGS seperate, -ldl
+# 2010-02-18 WITH_SSL outputs the LIBSSL_LDFLAGS, LIBS, CPPFLAGS separate, -ldl
# 2010-02-01 added ACX_CHECK_MEMCMP_SIGNED, AHX_MEMCMP_BROKEN
# 2010-01-20 added AHX_COONFIG_STRLCAT
# 2009-07-14 U_CHAR detection improved for windows crosscompile.
@@ -101,7 +106,7 @@ dnl Calculate comma separated windows-resource numbers from package version.
dnl Picks the first three(,0) or four numbers out of the name.
dnl $1: variable for the result
AC_DEFUN([ACX_RSRC_VERSION],
-[$1=[`echo $PACKAGE_VERSION | sed -e 's/^[^0-9]*\([0-9]\)[^0-9]*\([0-9]\)[^0-9]*\([0-9]\)[^0-9]*\([0-9]\).*$/\1,\2,\3,\4/' -e 's/^[^0-9]*\([0-9]\)[^0-9]*\([0-9]\)[^0-9]*\([0-9]\)[^0-9]*$/\1,\2,\3,0/' `]
+[$1=[`echo $PACKAGE_VERSION | sed -e 's/^[^0-9]*\([0-9][0-9]*\)[^0-9][^0-9]*\([0-9][0-9]*\)[^0-9][^0-9]*\([0-9][0-9]*\)[^0-9][^0-9]*\([0-9][0-9]*\).*$/\1,\2,\3,\4/' -e 's/^[^0-9]*\([0-9][0-9]*\)[^0-9][^0-9]*\([0-9][0-9]*\)[^0-9][^0-9]*\([0-9][0-9]*\)[^0-9]*$/\1,\2,\3,0/' `]
])
dnl Routine to help check for compiler flags.
@@ -116,7 +121,7 @@ AC_MSG_CHECKING(whether $CC supports -$1)
cache=`echo $1 | sed 'y%.=/+-%___p_%'`
AC_CACHE_VAL(cv_prog_cc_flag_$cache,
[
-echo 'void f(){}' >conftest.c
+echo 'void f(void){}' >conftest.c
if test -z "`$CC $CPPFLAGS $CFLAGS -$1 -c conftest.c 2>&1`"; then
eval "cv_prog_cc_flag_$cache=yes"
else
@@ -405,19 +410,22 @@ int test() {
dnl Check if CC supports -flto.
dnl in a way that supports clang and suncc (that flag does something else,
dnl but fails to link). It sets it in CFLAGS if it works.
-AC_DEFUN([ACX_CHECK_FLTO],
-[AC_MSG_CHECKING([if $CC supports -flto])
-BAKCFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -flto"
-AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [
- if $CC $CFLAGS -o conftest conftest.c 2>&1 | grep "warning: no debug symbols in executable" >/dev/null; then
- CFLAGS="$BAKCFLAGS"
- AC_MSG_RESULT(no)
- else
- AC_MSG_RESULT(yes)
- fi
- rm -f conftest conftest.c conftest.o
-], [CFLAGS="$BAKCFLAGS" ; AC_MSG_RESULT(no)])
+AC_DEFUN([ACX_CHECK_FLTO], [
+ AC_ARG_ENABLE([flto], AS_HELP_STRING([--disable-flto], [Disable link-time optimization (gcc specific option)]))
+ AS_IF([test "x$enable_flto" != "xno"], [
+ AC_MSG_CHECKING([if $CC supports -flto])
+ BAKCFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -flto"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [
+ if $CC $CFLAGS -o conftest conftest.c 2>&1 | grep "warning: no debug symbols in executable" >/dev/null; then
+ CFLAGS="$BAKCFLAGS"
+ AC_MSG_RESULT(no)
+ else
+ AC_MSG_RESULT(yes)
+ fi
+ rm -f conftest conftest.c conftest.o
+ ], [CFLAGS="$BAKCFLAGS" ; AC_MSG_RESULT(no)])
+ ])
])
dnl Check the printf-format attribute (if any)
@@ -1208,7 +1216,7 @@ struct tm *gmtime_r(const time_t *timep, struct tm *result);
dnl provide w32 compat definition for sleep
AC_DEFUN([AHX_CONFIG_W32_SLEEP],
[
-#ifndef HAVE_SLEEP
+#if !defined(HAVE_SLEEP) || defined(HAVE_WINDOWS_H)
#define sleep(x) Sleep((x)*1000) /* on win32 */
#endif /* HAVE_SLEEP */
])
diff --git a/ax_python_devel.m4 b/ax_python_devel.m4
index 2ce6afe83509..87e7c8c253bb 100644
--- a/ax_python_devel.m4
+++ b/ax_python_devel.m4
@@ -34,11 +34,12 @@
# LICENSE
#
# Copyright (c) 2009 Sebastian Huber <sebastian-huber@web.de>
-# Copyright (c) 2009 Alan W. Irwin <irwin@beluga.phys.uvic.ca>
+# Copyright (c) 2009 Alan W. Irwin
# Copyright (c) 2009 Rafael Laboissiere <rafael@laboissiere.net>
-# Copyright (c) 2009 Andrew Collier <colliera@ukzn.ac.za>
+# Copyright (c) 2009 Andrew Collier
# Copyright (c) 2009 Matteo Settenvini <matteo@member.fsf.org>
# Copyright (c) 2009 Horst Knorr <hk_classes@knoda.org>
+# Copyright (c) 2013 Daniel Mullner <muellner@math.stanford.edu>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
@@ -66,7 +67,7 @@
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
-#serial 8
+#serial 16
AU_ALIAS([AC_PYTHON_DEVEL], [AX_PYTHON_DEVEL])
AC_DEFUN([AX_PYTHON_DEVEL],[
@@ -153,8 +154,14 @@ $ac_distutils_result])
if test -z "$PYTHON_CPPFLAGS"; then
python_path=`$PYTHON -c "import distutils.sysconfig; \
print (distutils.sysconfig.get_python_inc ());"`
+ plat_python_path=`$PYTHON -c "import distutils.sysconfig; \
+ print (distutils.sysconfig.get_python_inc (plat_specific=1));"`
if test -n "${python_path}"; then
- python_path="-I$python_path"
+ if test "${plat_python_path}" != "${python_path}"; then
+ python_path="-I$python_path -I$plat_python_path"
+ else
+ python_path="-I$python_path"
+ fi
fi
PYTHON_CPPFLAGS=$python_path
fi
@@ -173,13 +180,10 @@ $ac_distutils_result])
# join all versioning strings, on some systems
# major/minor numbers could be in different list elements
from distutils.sysconfig import *
-ret = ''
-for e in get_config_vars ('VERSION'):
- if (e != None):
- ret += e
-print (ret)
-EOD
-`
+e = get_config_var('VERSION')
+if e is not None:
+ print(e)
+EOD`
if test -z "$ac_python_version"; then
if test -n "$PYTHON_VERSION"; then
@@ -199,34 +203,27 @@ EOD
# There should be only one
import distutils.sysconfig
-for e in distutils.sysconfig.get_config_vars ('LIBDIR'):
- if e != None:
- print (e)
- break
-EOD
-`
-
- # Before checking for libpythonX.Y, we need to know
- # the extension the OS we're on uses for libraries
- # (we take the first one, if there's more than one fix me!):
- ac_python_soext=`$PYTHON -c \
- "import distutils.sysconfig; \
- print (distutils.sysconfig.get_config_vars('SO')[[0]])"`
+e = distutils.sysconfig.get_config_var('LIBDIR')
+if e is not None:
+ print (e)
+EOD`
# Now, for the library:
- ac_python_soname=`$PYTHON -c \
- "import distutils.sysconfig; \
- print (distutils.sysconfig.get_config_vars('LDLIBRARY')[[0]])"`
+ ac_python_library=`cat<<EOD | $PYTHON -
- # Strip away extension from the end to canonicalize its name:
- ac_python_library=`echo "$ac_python_soname" | sed "s/${ac_python_soext}$//"`
+import distutils.sysconfig
+c = distutils.sysconfig.get_config_vars()
+if 'LDVERSION' in c:
+ print ('python'+c[['LDVERSION']])
+else:
+ print ('python'+c[['VERSION']])
+EOD`
# This small piece shamelessly adapted from PostgreSQL python macro;
# credits goes to momjian, I think. I'd like to put the right name
# in the credits, if someone can point me in the right direction... ?
#
- if test -n "$ac_python_libdir" -a -n "$ac_python_library" \
- -a x"$ac_python_library" != x"$ac_python_soname"
+ if test -n "$ac_python_libdir" -a -n "$ac_python_library"
then
# use the official shared library
ac_python_library=`echo "$ac_python_library" | sed "s/^lib//"`
@@ -268,7 +265,7 @@ EOD
if test -z "$PYTHON_EXTRA_LIBS"; then
PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \
conf = distutils.sysconfig.get_config_var; \
- print (conf('LOCALMODLIBS') + ' ' + conf('LIBS'))"`
+ print (conf('LIBS'))"`
fi
AC_MSG_RESULT([$PYTHON_EXTRA_LIBS])
AC_SUBST(PYTHON_EXTRA_LIBS)
diff --git a/compat/b32_ntop.c b/compat/b32_ntop.c
deleted file mode 100644
index 038ebdc95806..000000000000
--- a/compat/b32_ntop.c
+++ /dev/null
@@ -1,333 +0,0 @@
-/*
- * Copyright (c) 1996, 1998 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Portions Copyright (c) 1995 by International Business Machines, Inc.
- *
- * International Business Machines, Inc. (hereinafter called IBM) grants
- * permission under its copyrights to use, copy, modify, and distribute this
- * Software with or without fee, provided that the above copyright notice and
- * all paragraphs of this notice appear in all copies, and that the name of IBM
- * not be used in connection with the marketing of any product incorporating
- * the Software or modifications thereof, without specific, written prior
- * permission.
- *
- * To the extent it has a right to do so, IBM grants an immunity from suit
- * under its patents, if any, for the use, sale or manufacture of products to
- * the extent that such products are used for performing Domain Name System
- * dynamic updates in TCP/IP networks by means of the Software. No immunity is
- * granted for any product per se or for any other function of any product.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- * PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL,
- * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN
- * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
- */
-#include <ldns/config.h>
-
-#include <sys/types.h>
-#include <sys/param.h>
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-
-#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <assert.h>
-
-static const char Base32[] =
- "abcdefghijklmnopqrstuvwxyz234567";
-/* "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";*/
-/* 00000000001111111111222222222233
- 01234567890123456789012345678901*/
-static const char Base32_extended_hex[] =
-/* "0123456789ABCDEFGHIJKLMNOPQRSTUV";*/
- "0123456789abcdefghijklmnopqrstuv";
-static const char Pad32 = '=';
-
-/* (From RFC3548 and draft-josefsson-rfc3548bis-00.txt)
-5. Base 32 Encoding
-
- The Base 32 encoding is designed to represent arbitrary sequences of
- octets in a form that needs to be case insensitive but need not be
- humanly readable.
-
- A 33-character subset of US-ASCII is used, enabling 5 bits to be
- represented per printable character. (The extra 33rd character, "=",
- is used to signify a special processing function.)
-
- The encoding process represents 40-bit groups of input bits as output
- strings of 8 encoded characters. Proceeding from left to right, a
- 40-bit input group is formed by concatenating 5 8bit input groups.
- These 40 bits are then treated as 8 concatenated 5-bit groups, each
- of which is translated into a single digit in the base 32 alphabet.
- When encoding a bit stream via the base 32 encoding, the bit stream
- must be presumed to be ordered with the most-significant-bit first.
- That is, the first bit in the stream will be the high-order bit in
- the first 8bit byte, and the eighth bit will be the low-order bit in
- the first 8bit byte, and so on.
-
- Each 5-bit group is used as an index into an array of 32 printable
- characters. The character referenced by the index is placed in the
- output string. These characters, identified in Table 3, below, are
- selected from US-ASCII digits and uppercase letters.
-
- Table 3: The Base 32 Alphabet
-
- Value Encoding Value Encoding Value Encoding Value Encoding
- 0 A 9 J 18 S 27 3
- 1 B 10 K 19 T 28 4
- 2 C 11 L 20 U 29 5
- 3 D 12 M 21 V 30 6
- 4 E 13 N 22 W 31 7
- 5 F 14 O 23 X
- 6 G 15 P 24 Y (pad) =
- 7 H 16 Q 25 Z
- 8 I 17 R 26 2
-
-
- Special processing is performed if fewer than 40 bits are available
- at the end of the data being encoded. A full encoding quantum is
- always completed at the end of a body. When fewer than 40 input bits
- are available in an input group, zero bits are added (on the right)
- to form an integral number of 5-bit groups. Padding at the end of
- the data is performed using the "=" character. Since all base 32
- input is an integral number of octets, only the following cases can
- arise:
-
- (1) the final quantum of encoding input is an integral multiple of 40
- bits; here, the final unit of encoded output will be an integral
- multiple of 8 characters with no "=" padding,
-
- (2) the final quantum of encoding input is exactly 8 bits; here, the
- final unit of encoded output will be two characters followed by six
- "=" padding characters,
-
- (3) the final quantum of encoding input is exactly 16 bits; here, the
- final unit of encoded output will be four characters followed by four
- "=" padding characters,
-
- (4) the final quantum of encoding input is exactly 24 bits; here, the
- final unit of encoded output will be five characters followed by
- three "=" padding characters, or
-
- (5) the final quantum of encoding input is exactly 32 bits; here, the
- final unit of encoded output will be seven characters followed by one
- "=" padding character.
-
-
-6. Base 32 Encoding with Extended Hex Alphabet
-
- The following description of base 32 is due to [7]. This encoding
- should not be regarded as the same as the "base32" encoding, and
- should not be referred to as only "base32".
-
- One property with this alphabet, that the base64 and base32 alphabet
- lack, is that encoded data maintain its sort order when the encoded
- data is compared bit-wise.
-
- This encoding is identical to the previous one, except for the
- alphabet. The new alphabet is found in table 4.
-
- Table 4: The "Extended Hex" Base 32 Alphabet
-
- Value Encoding Value Encoding Value Encoding Value Encoding
- 0 0 9 9 18 I 27 R
- 1 1 10 A 19 J 28 S
- 2 2 11 B 20 K 29 T
- 3 3 12 C 21 L 30 U
- 4 4 13 D 22 M 31 V
- 5 5 14 E 23 N
- 6 6 15 F 24 O (pad) =
- 7 7 16 G 25 P
- 8 8 17 H 26 Q
-
-*/
-
-
-int
-ldns_b32_ntop_ar(uint8_t const *src, size_t srclength, char *target, size_t targsize, const char B32_ar[]) {
- size_t datalength = 0;
- uint8_t input[5];
- uint8_t output[8];
- size_t i;
- memset(output, 0, 8);
-
- while (4 < srclength) {
- input[0] = *src++;
- input[1] = *src++;
- input[2] = *src++;
- input[3] = *src++;
- input[4] = *src++;
- srclength -= 5;
-
- output[0] = (input[0] & 0xf8) >> 3;
- output[1] = ((input[0] & 0x07) << 2) + ((input[1] & 0xc0) >> 6);
- output[2] = (input[1] & 0x3e) >> 1;
- output[3] = ((input[1] & 0x01) << 4) + ((input[2] & 0xf0) >> 4);
- output[4] = ((input[2] & 0x0f) << 1) + ((input[3] & 0x80) >> 7);
- output[5] = (input[3] & 0x7c) >> 2;
- output[6] = ((input[3] & 0x03) << 3) + ((input[4] & 0xe0) >> 5);
- output[7] = (input[4] & 0x1f);
-
- assert(output[0] < 32);
- assert(output[1] < 32);
- assert(output[2] < 32);
- assert(output[3] < 32);
- assert(output[4] < 32);
- assert(output[5] < 32);
- assert(output[6] < 32);
- assert(output[7] < 32);
-
- if (datalength + 8 > targsize) {
- return (-1);
- }
- target[datalength++] = B32_ar[output[0]];
- target[datalength++] = B32_ar[output[1]];
- target[datalength++] = B32_ar[output[2]];
- target[datalength++] = B32_ar[output[3]];
- target[datalength++] = B32_ar[output[4]];
- target[datalength++] = B32_ar[output[5]];
- target[datalength++] = B32_ar[output[6]];
- target[datalength++] = B32_ar[output[7]];
- }
-
- /* Now we worry about padding. */
- if (0 != srclength) {
- /* Get what's left. */
- input[0] = input[1] = input[2] = input[3] = input[4] = (uint8_t) '\0';
- for (i = 0; i < srclength; i++)
- input[i] = *src++;
-
- output[0] = (input[0] & 0xf8) >> 3;
- assert(output[0] < 32);
- if (srclength >= 1) {
- output[1] = ((input[0] & 0x07) << 2) + ((input[1] & 0xc0) >> 6);
- assert(output[1] < 32);
- output[2] = (input[1] & 0x3e) >> 1;
- assert(output[2] < 32);
- }
- if (srclength >= 2) {
- output[3] = ((input[1] & 0x01) << 4) + ((input[2] & 0xf0) >> 4);
- assert(output[3] < 32);
- }
- if (srclength >= 3) {
- output[4] = ((input[2] & 0x0f) << 1) + ((input[3] & 0x80) >> 7);
- assert(output[4] < 32);
- output[5] = (input[3] & 0x7c) >> 2;
- assert(output[5] < 32);
- }
- if (srclength >= 4) {
- output[6] = ((input[3] & 0x03) << 3) + ((input[4] & 0xe0) >> 5);
- assert(output[6] < 32);
- }
-
-
- if (datalength + 1 > targsize) {
- return (-2);
- }
- target[datalength++] = B32_ar[output[0]];
- if (srclength >= 1) {
- if (datalength + 1 > targsize) { return (-2); }
- target[datalength++] = B32_ar[output[1]];
- if (srclength == 1 && output[2] == 0) {
- if (datalength + 1 > targsize) { return (-2); }
- target[datalength++] = Pad32;
- } else {
- if (datalength + 1 > targsize) { return (-2); }
- target[datalength++] = B32_ar[output[2]];
- }
- } else {
- if (datalength + 1 > targsize) { return (-2); }
- target[datalength++] = Pad32;
- if (datalength + 1 > targsize) { return (-2); }
- target[datalength++] = Pad32;
- }
- if (srclength >= 2) {
- if (datalength + 1 > targsize) { return (-2); }
- target[datalength++] = B32_ar[output[3]];
- } else {
- if (datalength + 1 > targsize) { return (-2); }
- target[datalength++] = Pad32;
- }
- if (srclength >= 3) {
- if (datalength + 1 > targsize) { return (-2); }
- target[datalength++] = B32_ar[output[4]];
- if (srclength == 3 && output[5] == 0) {
- if (datalength + 1 > targsize) { return (-2); }
- target[datalength++] = Pad32;
- } else {
- if (datalength + 1 > targsize) { return (-2); }
- target[datalength++] = B32_ar[output[5]];
- }
- } else {
- if (datalength + 1 > targsize) { return (-2); }
- target[datalength++] = Pad32;
- if (datalength + 1 > targsize) { return (-2); }
- target[datalength++] = Pad32;
- }
- if (srclength >= 4) {
- if (datalength + 1 > targsize) { return (-2); }
- target[datalength++] = B32_ar[output[6]];
- } else {
- if (datalength + 1 > targsize) { return (-2); }
- target[datalength++] = Pad32;
- }
- if (datalength + 1 > targsize) { return (-2); }
- target[datalength++] = Pad32;
- }
- if (datalength+1 > targsize) {
- return (int) (datalength);
- }
- target[datalength] = '\0'; /* Returned value doesn't count \0. */
- return (int) (datalength);
-}
-
-int
-ldns_b32_ntop(uint8_t const *src, size_t srclength, char *target, size_t targsize) {
- return ldns_b32_ntop_ar(src, srclength, target, targsize, Base32);
-}
-
-/* deprecated, here for backwards compatibility */
-int
-b32_ntop(uint8_t const *src, size_t srclength, char *target, size_t targsize) {
- return ldns_b32_ntop_ar(src, srclength, target, targsize, Base32);
-}
-
-int
-ldns_b32_ntop_extended_hex(uint8_t const *src, size_t srclength, char *target, size_t targsize) {
- return ldns_b32_ntop_ar(src, srclength, target, targsize, Base32_extended_hex);
-}
-
-/* deprecated, here for backwards compatibility */
-int
-b32_ntop_extended_hex(uint8_t const *src, size_t srclength, char *target, size_t targsize) {
- return ldns_b32_ntop_ar(src, srclength, target, targsize, Base32_extended_hex);
-}
-
diff --git a/compat/b32_pton.c b/compat/b32_pton.c
deleted file mode 100644
index 9c261e615b98..000000000000
--- a/compat/b32_pton.c
+++ /dev/null
@@ -1,387 +0,0 @@
-/*
- * Copyright (c) 1996, 1998 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Portions Copyright (c) 1995 by International Business Machines, Inc.
- *
- * International Business Machines, Inc. (hereinafter called IBM) grants
- * permission under its copyrights to use, copy, modify, and distribute this
- * Software with or without fee, provided that the above copyright notice and
- * all paragraphs of this notice appear in all copies, and that the name of IBM
- * not be used in connection with the marketing of any product incorporating
- * the Software or modifications thereof, without specific, written prior
- * permission.
- *
- * To the extent it has a right to do so, IBM grants an immunity from suit
- * under its patents, if any, for the use, sale or manufacture of products to
- * the extent that such products are used for performing Domain Name System
- * dynamic updates in TCP/IP networks by means of the Software. No immunity is
- * granted for any product per se or for any other function of any product.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- * PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL,
- * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN
- * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
- */
-#include <ldns/config.h>
-
-#include <sys/types.h>
-#include <sys/param.h>
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-
-#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-/* "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";*/
-static const char Base32[] =
- "abcdefghijklmnopqrstuvwxyz234567";
-/* "0123456789ABCDEFGHIJKLMNOPQRSTUV";*/
-static const char Base32_extended_hex[] =
- "0123456789abcdefghijklmnopqrstuv";
-static const char Pad32 = '=';
-
-/* (From RFC1521 and draft-ietf-dnssec-secext-03.txt)
-5. Base 32 Encoding
-
- The Base 32 encoding is designed to represent arbitrary sequences of
- octets in a form that needs to be case insensitive but need not be
- humanly readable.
-
- A 33-character subset of US-ASCII is used, enabling 5 bits to be
- represented per printable character. (The extra 33rd character, "=",
- is used to signify a special processing function.)
-
- The encoding process represents 40-bit groups of input bits as output
- strings of 8 encoded characters. Proceeding from left to right, a
- 40-bit input group is formed by concatenating 5 8bit input groups.
- These 40 bits are then treated as 8 concatenated 5-bit groups, each
- of which is translated into a single digit in the base 32 alphabet.
- When encoding a bit stream via the base 32 encoding, the bit stream
- must be presumed to be ordered with the most-significant-bit first.
- That is, the first bit in the stream will be the high-order bit in
- the first 8bit byte, and the eighth bit will be the low-order bit in
- the first 8bit byte, and so on.
-
- Each 5-bit group is used as an index into an array of 32 printable
- characters. The character referenced by the index is placed in the
- output string. These characters, identified in Table 3, below, are
- selected from US-ASCII digits and uppercase letters.
-
- Table 3: The Base 32 Alphabet
-
- Value Encoding Value Encoding Value Encoding Value Encoding
- 0 A 9 J 18 S 27 3
- 1 B 10 K 19 T 28 4
- 2 C 11 L 20 U 29 5
- 3 D 12 M 21 V 30 6
- 4 E 13 N 22 W 31 7
- 5 F 14 O 23 X
- 6 G 15 P 24 Y (pad) =
- 7 H 16 Q 25 Z
- 8 I 17 R 26 2
-
-
- Special processing is performed if fewer than 40 bits are available
- at the end of the data being encoded. A full encoding quantum is
- always completed at the end of a body. When fewer than 40 input bits
- are available in an input group, zero bits are added (on the right)
- to form an integral number of 5-bit groups. Padding at the end of
- the data is performed using the "=" character. Since all base 32
- input is an integral number of octets, only the following cases can
- arise:
-
- (1) the final quantum of encoding input is an integral multiple of 40
- bits; here, the final unit of encoded output will be an integral
- multiple of 8 characters with no "=" padding,
-
- (2) the final quantum of encoding input is exactly 8 bits; here, the
- final unit of encoded output will be two characters followed by six
- "=" padding characters,
-
- (3) the final quantum of encoding input is exactly 16 bits; here, the
- final unit of encoded output will be four characters followed by four
- "=" padding characters,
-
- (4) the final quantum of encoding input is exactly 24 bits; here, the
- final unit of encoded output will be five characters followed by
- three "=" padding characters, or
-
- (5) the final quantum of encoding input is exactly 32 bits; here, the
- final unit of encoded output will be seven characters followed by one
- "=" padding character.
-
-
-6. Base 32 Encoding with Extended Hex Alphabet
-
- The following description of base 32 is due to [7]. This encoding
- should not be regarded as the same as the "base32" encoding, and
- should not be referred to as only "base32".
-
- One property with this alphabet, that the base32 and base32 alphabet
- lack, is that encoded data maintain its sort order when the encoded
- data is compared bit-wise.
-
- This encoding is identical to the previous one, except for the
- alphabet. The new alphabet is found in table 4.
-
- Table 4: The "Extended Hex" Base 32 Alphabet
-
- Value Encoding Value Encoding Value Encoding Value Encoding
- 0 0 9 9 18 I 27 R
- 1 1 10 A 19 J 28 S
- 2 2 11 B 20 K 29 T
- 3 3 12 C 21 L 30 U
- 4 4 13 D 22 M 31 V
- 5 5 14 E 23 N
- 6 6 15 F 24 O (pad) =
- 7 7 16 G 25 P
- 8 8 17 H 26 Q
-
-
-
-
-*/
-/* skips all whitespace anywhere.
- converts characters, four at a time, starting at (or after)
- src from base - 32 numbers into three 8 bit bytes in the target area.
- it returns the number of data bytes stored at the target, or -1 on error.
- */
-
-int
-ldns_b32_pton_ar(char const *src, size_t hashed_owner_str_len, uint8_t *target, size_t targsize, const char B32_ar[])
-{
- int tarindex, state, ch;
- char *pos;
- int i = 0;
-
- state = 0;
- tarindex = 0;
-
- while ((ch = *src++) != '\0' && (i == 0 || i < (int) hashed_owner_str_len)) {
- i++;
- ch = tolower(ch);
- if (isspace((unsigned char)ch)) /* Skip whitespace anywhere. */
- continue;
-
- if (ch == Pad32)
- break;
-
- pos = strchr(B32_ar, ch);
- if (pos == 0) {
- /* A non-base32 character. */
- return (-ch);
- }
-
- switch (state) {
- case 0:
- if (target) {
- if ((size_t)tarindex >= targsize) {
- return (-2);
- }
- target[tarindex] = (pos - B32_ar) << 3;
- }
- state = 1;
- break;
- case 1:
- if (target) {
- if ((size_t)tarindex + 1 >= targsize) {
- return (-3);
- }
- target[tarindex] |= (pos - B32_ar) >> 2;
- target[tarindex+1] = ((pos - B32_ar) & 0x03)
- << 6 ;
- }
- tarindex++;
- state = 2;
- break;
- case 2:
- if (target) {
- if ((size_t)tarindex + 1 >= targsize) {
- return (-4);
- }
- target[tarindex] |= (pos - B32_ar) << 1;
- }
- /*tarindex++;*/
- state = 3;
- break;
- case 3:
- if (target) {
- if ((size_t)tarindex + 1 >= targsize) {
- return (-5);
- }
- target[tarindex] |= (pos - B32_ar) >> 4;
- target[tarindex+1] = ((pos - B32_ar) & 0x0f) << 4 ;
- }
- tarindex++;
- state = 4;
- break;
- case 4:
- if (target) {
- if ((size_t)tarindex + 1 >= targsize) {
- return (-6);
- }
- target[tarindex] |= (pos - B32_ar) >> 1;
- target[tarindex+1] = ((pos - B32_ar) & 0x01)
- << 7 ;
- }
- tarindex++;
- state = 5;
- break;
- case 5:
- if (target) {
- if ((size_t)tarindex + 1 >= targsize) {
- return (-7);
- }
- target[tarindex] |= (pos - B32_ar) << 2;
- }
- state = 6;
- break;
- case 6:
- if (target) {
- if ((size_t)tarindex + 1 >= targsize) {
- return (-8);
- }
- target[tarindex] |= (pos - B32_ar) >> 3;
- target[tarindex+1] = ((pos - B32_ar) & 0x07)
- << 5 ;
- }
- tarindex++;
- state = 7;
- break;
- case 7:
- if (target) {
- if ((size_t)tarindex + 1 >= targsize) {
- return (-9);
- }
- target[tarindex] |= (pos - B32_ar);
- }
- tarindex++;
- state = 0;
- break;
- default:
- abort();
- }
- }
-
- /*
- * We are done decoding Base-32 chars. Let's see if we ended
- * on a byte boundary, and/or with erroneous trailing characters.
- */
-
- if (ch == Pad32) { /* We got a pad char. */
- ch = *src++; /* Skip it, get next. */
- switch (state) {
- case 0: /* Invalid = in first position */
- case 1: /* Invalid = in second position */
- return (-10);
-
- case 2: /* Valid, means one byte of info */
- case 3:
- /* Skip any number of spaces. */
- for ((void)NULL; ch != '\0'; ch = *src++)
- if (!isspace((unsigned char)ch))
- break;
- /* Make sure there is another trailing = sign. */
- if (ch != Pad32) {
- return (-11);
- }
- ch = *src++; /* Skip the = */
- /* Fall through to "single trailing =" case. */
- /* FALLTHROUGH */
-
- case 4: /* Valid, means two bytes of info */
- case 5:
- case 6:
- /*
- * We know this char is an =. Is there anything but
- * whitespace after it?
- */
- for ((void)NULL; ch != '\0'; ch = *src++)
- if (!(isspace((unsigned char)ch) || ch == '=')) {
- return (-12);
- }
-
- case 7: /* Valid, means three bytes of info */
- /*
- * We know this char is an =. Is there anything but
- * whitespace after it?
- */
- for ((void)NULL; ch != '\0'; ch = *src++)
- if (!isspace((unsigned char)ch)) {
- return (-13);
- }
-
- /*
- * Now make sure for cases 2 and 3 that the "extra"
- * bits that slopped past the last full byte were
- * zeros. If we don't check them, they become a
- * subliminal channel.
- */
- if (target && target[tarindex] != 0) {
- return (-14);
- }
- }
- } else {
- /*
- * We ended by seeing the end of the string. Make sure we
- * have no partial bytes lying around.
- */
- if (state != 0)
- return (-15);
- }
-
- return (tarindex);
-}
-
-int
-ldns_b32_pton(char const *src, size_t hashed_owner_str_len, uint8_t *target, size_t targsize)
-{
- return ldns_b32_pton_ar(src, hashed_owner_str_len, target, targsize, Base32);
-}
-
-/* deprecated, here for backwards compatibility */
-int
-b32_pton(char const *src, size_t hashed_owner_str_len, uint8_t *target, size_t targsize)
-{
- return ldns_b32_pton_ar(src, hashed_owner_str_len, target, targsize, Base32);
-}
-
-int
-ldns_b32_pton_extended_hex(char const *src, size_t hashed_owner_str_len, uint8_t *target, size_t targsize)
-{
- return ldns_b32_pton_ar(src, hashed_owner_str_len, target, targsize, Base32_extended_hex);
-}
-
-/* deprecated, here for backwards compatibility */
-int
-b32_pton_extended_hex(char const *src, size_t hashed_owner_str_len, uint8_t *target, size_t targsize)
-{
- return ldns_b32_pton_ar(src, hashed_owner_str_len, target, targsize, Base32_extended_hex);
-}
diff --git a/compat/b64_ntop.c b/compat/b64_ntop.c
index d0b52b514bdf..6895acafd37c 100644
--- a/compat/b64_ntop.c
+++ b/compat/b64_ntop.c
@@ -40,27 +40,10 @@
* IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
#include <ldns/config.h>
-
-#include <sys/types.h>
-#include <sys/param.h>
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-
#include <ctype.h>
-#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#define Assert(Cond) if (!(Cond)) abort()
-
static const char Base64[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
static const char Pad64 = '=';
@@ -154,10 +137,10 @@ ldns_b64_ntop(uint8_t const *src, size_t srclength, char *target, size_t targsiz
output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4);
output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6);
output[3] = input[2] & 0x3f;
- Assert(output[0] < 64);
- Assert(output[1] < 64);
- Assert(output[2] < 64);
- Assert(output[3] < 64);
+ assert(output[0] < 64);
+ assert(output[1] < 64);
+ assert(output[2] < 64);
+ assert(output[3] < 64);
if (datalength + 4 > targsize) {
return (-1);
@@ -178,9 +161,9 @@ ldns_b64_ntop(uint8_t const *src, size_t srclength, char *target, size_t targsiz
output[0] = input[0] >> 2;
output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4);
output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6);
- Assert(output[0] < 64);
- Assert(output[1] < 64);
- Assert(output[2] < 64);
+ assert(output[0] < 64);
+ assert(output[1] < 64);
+ assert(output[2] < 64);
if (datalength + 4 > targsize) {
return (-2);
diff --git a/compat/b64_pton.c b/compat/b64_pton.c
index aa637d227549..abe32819e92d 100644
--- a/compat/b64_pton.c
+++ b/compat/b64_pton.c
@@ -40,27 +40,10 @@
* IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
#include <ldns/config.h>
-
-#include <sys/types.h>
-#include <sys/param.h>
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-
#include <ctype.h>
-#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#define Assert(Cond) if (!(Cond)) abort()
-
static const char Base64[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
static const char Pad64 = '=';
diff --git a/compat/snprintf.c b/compat/snprintf.c
index b7445111cb3f..d869ba5e7d05 100644
--- a/compat/snprintf.c
+++ b/compat/snprintf.c
@@ -1,770 +1,1036 @@
-#include <ldns/config.h>
-
-#ifndef HAVE_SNPRINTF
+/* snprintf - compatibility implementation of snprintf, vsnprintf
+ *
+ * Copyright (c) 2013, NLnet Labs. All rights reserved.
+ *
+ * This software is open source.
+ *
+ * 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 NLNET LABS nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <ldns/config.h>
+#include <stdio.h>
#include <ctype.h>
-#include <sys/types.h>
+#include <string.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <errno.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
-/* Define this as a fall through, HAVE_STDARG_H is probably already set */
+/* for test */
+/* #define SNPRINTF_TEST 1 */
+#ifdef SNPRINTF_TEST
+#define snprintf my_snprintf
+#define vsnprintf my_vsnprintf
+#endif /* SNPRINTF_TEST */
-#define HAVE_VARARGS_H
+int snprintf(char* str, size_t size, const char* format, ...);
+int vsnprintf(char* str, size_t size, const char* format, va_list arg);
-/**************************************************************
- * Original:
- * Patrick Powell Tue Apr 11 09:48:21 PDT 1995
- * A bombproof version of doprnt (dopr) included.
- * Sigh. This sort of thing is always nasty do deal with. Note that
- * the version here does not include floating point...
- *
- * snprintf() is used instead of sprintf() as it does limit checks
- * for string length. This covers a nasty loophole.
- *
- * The other functions are there to prevent NULL pointers from
- * causing nast effects.
+/**
+ * Very portable snprintf implementation, limited in functionality,
+ * esp. for %[capital] %[nonportable] and so on. Reduced float functionality,
+ * mostly in formatting and range (e+-16), for %f and %g.
*
- * More Recently:
- * Brandon Long (blong@fiction.net) 9/15/96 for mutt 0.43
- * This was ugly. It is still ugly. I opted out of floating point
- * numbers, but the formatter understands just about everything
- * from the normal C string format, at least as far as I can tell from
- * the Solaris 2.5 printf(3S) man page.
- *
- * Brandon Long (blong@fiction.net) 10/22/97 for mutt 0.87.1
- * Ok, added some minimal floating point support, which means this
- * probably requires libm on most operating systems. Don't yet
- * support the exponent (e,E) and sigfig (g,G). Also, fmtint()
- * was pretty badly broken, it just wasn't being exercised in ways
- * which showed it, so that's been fixed. Also, formated the code
- * to mutt conventions, and removed dead code left over from the
- * original. Also, there is now a builtin-test, just compile with:
- * gcc -DTEST_SNPRINTF -o snprintf snprintf.c -lm
- * and run snprintf for results.
- *
- **************************************************************/
+ * %s, %d, %u, %i, %x, %c, %n and %% are fully supported.
+ * This includes width, precision, flags 0- +, and *(arg for wid,prec).
+ * %f, %g, %m, %p have reduced support, support for wid,prec,flags,*, but
+ * less floating point range, no %e formatting for %g.
+ */
+int snprintf(char* str, size_t size, const char* format, ...)
+{
+ int r;
+ va_list args;
+ va_start(args, format);
+ r = vsnprintf(str, size, format, args);
+ va_end(args);
+ return r;
+}
+/** add padding to string */
+static void
+print_pad(char** at, size_t* left, int* ret, char p, int num)
+{
+ while(num--) {
+ if(*left > 1) {
+ *(*at)++ = p;
+ (*left)--;
+ }
+ (*ret)++;
+ }
+}
-/* varargs declarations: */
+/** get negative symbol, 0 if none */
+static char
+get_negsign(int negative, int plus, int space)
+{
+ if(negative)
+ return '-';
+ if(plus)
+ return '+';
+ if(space)
+ return ' ';
+ return 0;
+}
-#if defined(HAVE_STDARG_H)
-# include <stdarg.h>
-# define HAVE_STDARGS /* let's hope that works everywhere (mj) */
-# define VA_LOCAL_DECL va_list ap
-# define VA_START(f) va_start(ap, f)
-# define VA_SHIFT(v,t) ; /* no-op for ANSI */
-# define VA_END va_end(ap)
-#else
-# if defined(HAVE_VARARGS_H)
-# include <varargs.h>
-# undef HAVE_STDARGS
-# define VA_LOCAL_DECL va_list ap
-# define VA_START(f) va_start(ap) /* f is ignored! */
-# define VA_SHIFT(v,t) v = va_arg(ap,t)
-# define VA_END va_end(ap)
-# else
-/*XX ** NO VARARGS ** XX*/
-# endif
-#endif
+#define PRINT_DEC_BUFSZ 32 /* 20 is enough for 64 bit decimals */
+/** print decimal into buffer, returns length */
+static int
+print_dec(char* buf, int max, unsigned int value)
+{
+ int i = 0;
+ if(value == 0) {
+ if(max > 0) {
+ buf[0] = '0';
+ i = 1;
+ }
+ } else while(value && i < max) {
+ buf[i++] = '0' + value % 10;
+ value /= 10;
+ }
+ return i;
+}
+
+/** print long decimal into buffer, returns length */
+static int
+print_dec_l(char* buf, int max, unsigned long value)
+{
+ int i = 0;
+ if(value == 0) {
+ if(max > 0) {
+ buf[0] = '0';
+ i = 1;
+ }
+ } else while(value && i < max) {
+ buf[i++] = '0' + value % 10;
+ value /= 10;
+ }
+ return i;
+}
+
+/** print long decimal into buffer, returns length */
+static int
+print_dec_ll(char* buf, int max, unsigned long long value)
+{
+ int i = 0;
+ if(value == 0) {
+ if(max > 0) {
+ buf[0] = '0';
+ i = 1;
+ }
+ } else while(value && i < max) {
+ buf[i++] = '0' + value % 10;
+ value /= 10;
+ }
+ return i;
+}
+
+/** print hex into buffer, returns length */
+static int
+print_hex(char* buf, int max, unsigned int value)
+{
+ const char* h = "0123456789abcdef";
+ int i = 0;
+ if(value == 0) {
+ if(max > 0) {
+ buf[0] = '0';
+ i = 1;
+ }
+ } else while(value && i < max) {
+ buf[i++] = h[value & 0x0f];
+ value >>= 4;
+ }
+ return i;
+}
+
+/** print long hex into buffer, returns length */
+static int
+print_hex_l(char* buf, int max, unsigned long value)
+{
+ const char* h = "0123456789abcdef";
+ int i = 0;
+ if(value == 0) {
+ if(max > 0) {
+ buf[0] = '0';
+ i = 1;
+ }
+ } else while(value && i < max) {
+ buf[i++] = h[value & 0x0f];
+ value >>= 4;
+ }
+ return i;
+}
+
+/** print long long hex into buffer, returns length */
+static int
+print_hex_ll(char* buf, int max, unsigned long long value)
+{
+ const char* h = "0123456789abcdef";
+ int i = 0;
+ if(value == 0) {
+ if(max > 0) {
+ buf[0] = '0';
+ i = 1;
+ }
+ } else while(value && i < max) {
+ buf[i++] = h[value & 0x0f];
+ value >>= 4;
+ }
+ return i;
+}
+
+/** copy string into result, reversed */
+static void
+spool_str_rev(char** at, size_t* left, int* ret, const char* buf, int len)
+{
+ int i = len;
+ while(i) {
+ if(*left > 1) {
+ *(*at)++ = buf[--i];
+ (*left)--;
+ } else --i;
+ (*ret)++;
+ }
+}
+
+/** copy string into result */
+static void
+spool_str(char** at, size_t* left, int* ret, const char* buf, int len)
+{
+ int i;
+ for(i=0; i<len; i++) {
+ if(*left > 1) {
+ *(*at)++ = buf[i];
+ (*left)--;
+ }
+ (*ret)++;
+ }
+}
+
+/** print number formatted */
+static void
+print_num(char** at, size_t* left, int* ret, int minw, int precision,
+ int prgiven, int zeropad, int minus, int plus, int space,
+ int zero, int negative, char* buf, int len)
+{
+ int w = len; /* excludes minus sign */
+ char s = get_negsign(negative, plus, space);
+ if(minus) {
+ /* left adjust the number into the field, space padding */
+ /* calc numw = [sign][zeroes][number] */
+ int numw = w;
+ if(precision == 0 && zero) numw = 0;
+ if(numw < precision) numw = precision;
+ if(s) numw++;
+
+ /* sign */
+ if(s) print_pad(at, left, ret, s, 1);
+
+ /* number */
+ if(precision == 0 && zero) {
+ /* "" for the number */
+ } else {
+ if(w < precision)
+ print_pad(at, left, ret, '0', precision - w);
+ spool_str_rev(at, left, ret, buf, len);
+ }
+ /* spaces */
+ if(numw < minw)
+ print_pad(at, left, ret, ' ', minw - numw);
+ } else {
+ /* pad on the left of the number */
+ /* calculate numw has width of [sign][zeroes][number] */
+ int numw = w;
+ if(precision == 0 && zero) numw = 0;
+ if(numw < precision) numw = precision;
+ if(!prgiven && zeropad && numw < minw) numw = minw;
+ else if(s) numw++;
+
+ /* pad with spaces */
+ if(numw < minw)
+ print_pad(at, left, ret, ' ', minw - numw);
+ /* print sign (and one less zeropad if so) */
+ if(s) {
+ print_pad(at, left, ret, s, 1);
+ numw--;
+ }
+ /* pad with zeroes */
+ if(w < numw)
+ print_pad(at, left, ret, '0', numw - w);
+ if(precision == 0 && zero)
+ return;
+ /* print the characters for the value */
+ spool_str_rev(at, left, ret, buf, len);
+ }
+}
+
+/** print %d and %i */
+static void
+print_num_d(char** at, size_t* left, int* ret, int value,
+ int minw, int precision, int prgiven, int zeropad, int minus,
+ int plus, int space)
+{
+ char buf[PRINT_DEC_BUFSZ];
+ int negative = (value < 0);
+ int zero = (value == 0);
+ int len = print_dec(buf, (int)sizeof(buf),
+ (unsigned int)(negative?-value:value));
+ print_num(at, left, ret, minw, precision, prgiven, zeropad, minus,
+ plus, space, zero, negative, buf, len);
+}
+
+/** print %ld and %li */
+static void
+print_num_ld(char** at, size_t* left, int* ret, long value,
+ int minw, int precision, int prgiven, int zeropad, int minus,
+ int plus, int space)
+{
+ char buf[PRINT_DEC_BUFSZ];
+ int negative = (value < 0);
+ int zero = (value == 0);
+ int len = print_dec_l(buf, (int)sizeof(buf),
+ (unsigned long)(negative?-value:value));
+ print_num(at, left, ret, minw, precision, prgiven, zeropad, minus,
+ plus, space, zero, negative, buf, len);
+}
+
+/** print %lld and %lli */
+static void
+print_num_lld(char** at, size_t* left, int* ret, long long value,
+ int minw, int precision, int prgiven, int zeropad, int minus,
+ int plus, int space)
+{
+ char buf[PRINT_DEC_BUFSZ];
+ int negative = (value < 0);
+ int zero = (value == 0);
+ int len = print_dec_ll(buf, (int)sizeof(buf),
+ (unsigned long long)(negative?-value:value));
+ print_num(at, left, ret, minw, precision, prgiven, zeropad, minus,
+ plus, space, zero, negative, buf, len);
+}
+
+/** print %u */
+static void
+print_num_u(char** at, size_t* left, int* ret, unsigned int value,
+ int minw, int precision, int prgiven, int zeropad, int minus,
+ int plus, int space)
+{
+ char buf[PRINT_DEC_BUFSZ];
+ int negative = 0;
+ int zero = (value == 0);
+ int len = print_dec(buf, (int)sizeof(buf), value);
+ print_num(at, left, ret, minw, precision, prgiven, zeropad, minus,
+ plus, space, zero, negative, buf, len);
+}
+
+/** print %lu */
+static void
+print_num_lu(char** at, size_t* left, int* ret, unsigned long value,
+ int minw, int precision, int prgiven, int zeropad, int minus,
+ int plus, int space)
+{
+ char buf[PRINT_DEC_BUFSZ];
+ int negative = 0;
+ int zero = (value == 0);
+ int len = print_dec_l(buf, (int)sizeof(buf), value);
+ print_num(at, left, ret, minw, precision, prgiven, zeropad, minus,
+ plus, space, zero, negative, buf, len);
+}
+
+/** print %llu */
+static void
+print_num_llu(char** at, size_t* left, int* ret, unsigned long long value,
+ int minw, int precision, int prgiven, int zeropad, int minus,
+ int plus, int space)
+{
+ char buf[PRINT_DEC_BUFSZ];
+ int negative = 0;
+ int zero = (value == 0);
+ int len = print_dec_ll(buf, (int)sizeof(buf), value);
+ print_num(at, left, ret, minw, precision, prgiven, zeropad, minus,
+ plus, space, zero, negative, buf, len);
+}
-int snprintf (char *str, size_t count, const char *fmt, ...);
-int vsnprintf (char *str, size_t count, const char *fmt, va_list arg);
+/** print %x */
+static void
+print_num_x(char** at, size_t* left, int* ret, unsigned int value,
+ int minw, int precision, int prgiven, int zeropad, int minus,
+ int plus, int space)
+{
+ char buf[PRINT_DEC_BUFSZ];
+ int negative = 0;
+ int zero = (value == 0);
+ int len = print_hex(buf, (int)sizeof(buf), value);
+ print_num(at, left, ret, minw, precision, prgiven, zeropad, minus,
+ plus, space, zero, negative, buf, len);
+}
-static void dopr (char *buffer, size_t maxlen, const char *format,
- va_list args);
-static void fmtstr (char *buffer, size_t *currlen, size_t maxlen,
- char *value, int flags, int min, int max);
-static void fmtint (char *buffer, size_t *currlen, size_t maxlen,
- long value, int base, int min, int max, int flags);
-static void fmtfp (char *buffer, size_t *currlen, size_t maxlen,
- long double fvalue, int min, int max, int flags);
-static void dopr_outch (char *buffer, size_t *currlen, size_t maxlen, char c );
+/** print %lx */
+static void
+print_num_lx(char** at, size_t* left, int* ret, unsigned long value,
+ int minw, int precision, int prgiven, int zeropad, int minus,
+ int plus, int space)
+{
+ char buf[PRINT_DEC_BUFSZ];
+ int negative = 0;
+ int zero = (value == 0);
+ int len = print_hex_l(buf, (int)sizeof(buf), value);
+ print_num(at, left, ret, minw, precision, prgiven, zeropad, minus,
+ plus, space, zero, negative, buf, len);
+}
-int vsnprintf (char *str, size_t count, const char *fmt, va_list args)
+/** print %llx */
+static void
+print_num_llx(char** at, size_t* left, int* ret, unsigned long long value,
+ int minw, int precision, int prgiven, int zeropad, int minus,
+ int plus, int space)
{
- str[0] = 0;
- dopr(str, count, fmt, args);
- return(strlen(str));
+ char buf[PRINT_DEC_BUFSZ];
+ int negative = 0;
+ int zero = (value == 0);
+ int len = print_hex_ll(buf, (int)sizeof(buf), value);
+ print_num(at, left, ret, minw, precision, prgiven, zeropad, minus,
+ plus, space, zero, negative, buf, len);
}
-/* VARARGS3 */
-#ifdef HAVE_STDARGS
-int snprintf (char *str,size_t count,const char *fmt,...)
+/** print %llp */
+static void
+print_num_llp(char** at, size_t* left, int* ret, void* value,
+ int minw, int precision, int prgiven, int zeropad, int minus,
+ int plus, int space)
+{
+ char buf[PRINT_DEC_BUFSZ];
+ int negative = 0;
+ int zero = (value == 0);
+#if defined(UINTPTR_MAX) && defined(UINT32_MAX) && (UINTPTR_MAX == UINT32_MAX)
+ /* avoid warning about upcast on 32bit systems */
+ unsigned long long llvalue = (unsigned long)value;
#else
-int snprintf (va_alist) va_dcl
+ unsigned long long llvalue = (unsigned long long)value;
#endif
+ int len = print_hex_ll(buf, (int)sizeof(buf), llvalue);
+ if(zero) {
+ buf[0]=')';
+ buf[1]='l';
+ buf[2]='i';
+ buf[3]='n';
+ buf[4]='(';
+ len = 5;
+ } else {
+ /* put '0x' in front of the (reversed) buffer result */
+ if(len < PRINT_DEC_BUFSZ)
+ buf[len++] = 'x';
+ if(len < PRINT_DEC_BUFSZ)
+ buf[len++] = '0';
+ }
+ print_num(at, left, ret, minw, precision, prgiven, zeropad, minus,
+ plus, space, zero, negative, buf, len);
+}
+
+#define PRINT_FLOAT_BUFSZ 64 /* xx.yy with 20.20 about the max */
+/** spool remainder after the decimal point to buffer, in reverse */
+static int
+print_remainder(char* buf, int max, double r, int prec)
{
-#ifndef HAVE_STDARGS
- char *str;
- size_t count;
- char *fmt;
-#endif
- VA_LOCAL_DECL;
-
- VA_START (fmt);
- VA_SHIFT (str, char *);
- VA_SHIFT (count, size_t );
- VA_SHIFT (fmt, char *);
- (void) vsnprintf(str, count, fmt, ap);
- VA_END;
- return(strlen(str));
-}
-
-/*
- * dopr(): poor man's version of doprintf
- */
+ unsigned long long cap = 1;
+ unsigned long long value;
+ int len, i;
+ if(prec > 19) prec = 19; /* max we can do */
+ if(max < prec) return 0;
+ for(i=0; i<prec; i++) {
+ cap *= 10;
+ }
+ r *= (double)cap;
+ value = (unsigned long long)r;
+ /* see if we need to round up */
+ if(((unsigned long long)((r - (double)value)*10.0)) >= 5) {
+ value++;
+ /* that might carry to numbers before the comma, if so,
+ * just ignore that rounding. failure because 64bitprintout */
+ if(value >= cap)
+ value = cap-1;
+ }
+ len = print_dec_ll(buf, max, value);
+ while(len < prec) { /* pad with zeroes, e.g. if 0.0012 */
+ buf[len++] = '0';
+ }
+ if(len < max)
+ buf[len++] = '.';
+ return len;
+}
-/* format read states */
-#define DP_S_DEFAULT 0
-#define DP_S_FLAGS 1
-#define DP_S_MIN 2
-#define DP_S_DOT 3
-#define DP_S_MAX 4
-#define DP_S_MOD 5
-#define DP_S_CONV 6
-#define DP_S_DONE 7
-
-/* format flags - Bits */
-#define DP_F_MINUS 1
-#define DP_F_PLUS 2
-#define DP_F_SPACE 4
-#define DP_F_NUM 8
-#define DP_F_ZERO 16
-#define DP_F_UP 32
-
-/* Conversion Flags */
-#define DP_C_SHORT 1
-#define DP_C_LONG 2
-#define DP_C_LDOUBLE 3
-
-#define char_to_int(p) (p - '0')
-#define MAX(p,q) ((p >= q) ? p : q)
-
-static void dopr (char *buffer, size_t maxlen, const char *format, va_list args)
-{
- char ch;
- long value;
- long double fvalue;
- char *strvalue;
- int min;
- int max;
- int state;
- int flags;
- int cflags;
- size_t currlen;
-
- state = DP_S_DEFAULT;
- currlen = flags = cflags = min = 0;
- max = -1;
- ch = *format++;
-
- while (state != DP_S_DONE)
- {
- if ((ch == '\0') || (currlen >= maxlen))
- state = DP_S_DONE;
-
- switch(state)
- {
- case DP_S_DEFAULT:
- if (ch == '%')
- state = DP_S_FLAGS;
- else
- dopr_outch (buffer, &currlen, maxlen, ch);
- ch = *format++;
- break;
- case DP_S_FLAGS:
- switch (ch)
- {
- case '-':
- flags |= DP_F_MINUS;
- ch = *format++;
- break;
- case '+':
- flags |= DP_F_PLUS;
- ch = *format++;
- break;
- case ' ':
- flags |= DP_F_SPACE;
- ch = *format++;
- break;
- case '#':
- flags |= DP_F_NUM;
- ch = *format++;
- break;
- case '0':
- flags |= DP_F_ZERO;
- ch = *format++;
- break;
- default:
- state = DP_S_MIN;
- break;
- }
- break;
- case DP_S_MIN:
- if (isdigit((int) ch))
- {
- min = 10*min + char_to_int (ch);
- ch = *format++;
- }
- else if (ch == '*')
- {
- min = va_arg (args, int);
- ch = *format++;
- state = DP_S_DOT;
- }
- else
- state = DP_S_DOT;
- break;
- case DP_S_DOT:
- if (ch == '.')
- {
- state = DP_S_MAX;
- ch = *format++;
- }
- else
- state = DP_S_MOD;
- break;
- case DP_S_MAX:
- if (isdigit((int) ch))
- {
- if (max < 0)
- max = 0;
- max = 10*max + char_to_int (ch);
- ch = *format++;
- }
- else if (ch == '*')
- {
- max = va_arg (args, int);
- ch = *format++;
- state = DP_S_MOD;
- }
- else
- state = DP_S_MOD;
- break;
- case DP_S_MOD:
- /* Currently, we don't support Long Long, bummer */
- switch (ch)
- {
- case 'h':
- cflags = DP_C_SHORT;
- ch = *format++;
- break;
- case 'l':
- cflags = DP_C_LONG;
- ch = *format++;
- break;
- case 'L':
- cflags = DP_C_LDOUBLE;
- ch = *format++;
- break;
- default:
- break;
- }
- state = DP_S_CONV;
- break;
- case DP_S_CONV:
- switch (ch)
- {
- case 'd':
- case 'i':
- if (cflags == DP_C_SHORT)
- value = va_arg (args, int);
- else if (cflags == DP_C_LONG)
- value = va_arg (args, long int);
- else
- value = va_arg (args, int);
- fmtint (buffer, &currlen, maxlen, value, 10, min, max, flags);
- break;
- case 'o':
- flags &= ~DP_F_PLUS;
- if (cflags == DP_C_SHORT)
- value = va_arg (args, unsigned int);
- else if (cflags == DP_C_LONG)
- value = va_arg (args, unsigned long int);
- else
- value = va_arg (args, unsigned int);
- fmtint (buffer, &currlen, maxlen, value, 8, min, max, flags);
- break;
- case 'u':
- flags &= ~DP_F_PLUS;
- if (cflags == DP_C_SHORT)
- value = va_arg (args, unsigned int);
- else if (cflags == DP_C_LONG)
- value = va_arg (args, unsigned long int);
- else
- value = va_arg (args, unsigned int);
- fmtint (buffer, &currlen, maxlen, value, 10, min, max, flags);
- break;
- case 'X':
- flags |= DP_F_UP;
- case 'x':
- flags &= ~DP_F_PLUS;
- if (cflags == DP_C_SHORT)
- value = va_arg (args, unsigned int);
- else if (cflags == DP_C_LONG)
- value = va_arg (args, unsigned long int);
- else
- value = va_arg (args, unsigned int);
- fmtint (buffer, &currlen, maxlen, value, 16, min, max, flags);
- break;
- case 'f':
- if (cflags == DP_C_LDOUBLE)
- fvalue = va_arg (args, long double);
- else
- fvalue = va_arg (args, double);
- /* um, floating point? */
- fmtfp (buffer, &currlen, maxlen, fvalue, min, max, flags);
- break;
- case 'E':
- flags |= DP_F_UP;
- case 'e':
- if (cflags == DP_C_LDOUBLE)
- fvalue = va_arg (args, long double);
- else
- fvalue = va_arg (args, double);
- break;
- case 'G':
- flags |= DP_F_UP;
- case 'g':
- if (cflags == DP_C_LDOUBLE)
- fvalue = va_arg (args, long double);
- else
- fvalue = va_arg (args, double);
- break;
- case 'c':
- dopr_outch (buffer, &currlen, maxlen, va_arg (args, int));
- break;
- case 's':
- strvalue = va_arg (args, char *);
- if (max < 0)
- max = maxlen; /* ie, no max */
- fmtstr (buffer, &currlen, maxlen, strvalue, flags, min, max);
- break;
- case 'p':
- strvalue = va_arg (args, void *);
- fmtint (buffer, &currlen, maxlen, (long) strvalue, 16, min, max, flags);
- break;
- case 'n':
- if (cflags == DP_C_SHORT)
- {
- short int *num;
- num = va_arg (args, short int *);
- *num = currlen;
- }
- else if (cflags == DP_C_LONG)
- {
- long int *num;
- num = va_arg (args, long int *);
- *num = currlen;
- }
- else
- {
- int *num;
- num = va_arg (args, int *);
- *num = currlen;
- }
- break;
- case '%':
- dopr_outch (buffer, &currlen, maxlen, ch);
- break;
- case 'w':
- /* not supported yet, treat as next char */
- ch = *format++;
- break;
- default:
- /* Unknown, skip */
- break;
- }
- ch = *format++;
- state = DP_S_DEFAULT;
- flags = cflags = min = 0;
- max = -1;
- break;
- case DP_S_DONE:
- break;
- default:
- /* hmm? */
- break; /* some picky compilers need this */
- }
- }
- if (currlen < maxlen - 1)
- buffer[currlen] = '\0';
- else
- buffer[maxlen - 1] = '\0';
-}
-
-static void fmtstr (char *buffer, size_t *currlen, size_t maxlen,
- char *value, int flags, int min, int max)
-{
- int padlen, strln; /* amount to pad */
- int cnt = 0;
-
- if (value == 0)
- {
- value = (char *) "<NULL>";
- }
-
- for (strln = 0; value[strln]; ++strln); /* strlen */
- padlen = min - strln;
- if (padlen < 0)
- padlen = 0;
- if (flags & DP_F_MINUS)
- padlen = -padlen; /* Left Justify */
-
- while ((padlen > 0) && (cnt < max))
- {
- dopr_outch (buffer, currlen, maxlen, ' ');
- --padlen;
- ++cnt;
- }
- while (*value && (cnt < max))
- {
- dopr_outch (buffer, currlen, maxlen, *value++);
- ++cnt;
- }
- while ((padlen < 0) && (cnt < max))
- {
- dopr_outch (buffer, currlen, maxlen, ' ');
- ++padlen;
- ++cnt;
- }
-}
-
-/* Have to handle DP_F_NUM (ie 0x and 0 alternates) */
-
-static void fmtint (char *buffer, size_t *currlen, size_t maxlen,
- long value, int base, int min, int max, int flags)
-{
- int signvalue = 0;
- unsigned long uvalue;
- char convert[20];
- int place = 0;
- int spadlen = 0; /* amount to space pad */
- int zpadlen = 0; /* amount to zero pad */
- int caps = 0;
-
- if (max < 0)
- max = 0;
-
- uvalue = value;
- if( value < 0 ) {
- signvalue = '-';
- uvalue = -value;
- }
- else
- if (flags & DP_F_PLUS) /* Do a sign (+/i) */
- signvalue = '+';
- else
- if (flags & DP_F_SPACE)
- signvalue = ' ';
-
- if (flags & DP_F_UP) caps = 1; /* Should characters be upper case? */
-
- do {
- convert[place++] =
- (caps? "0123456789ABCDEF":"0123456789abcdef")
- [uvalue % (unsigned)base ];
- uvalue = (uvalue / (unsigned)base );
- } while(uvalue && (place < 20));
- if (place == 20) place--;
- convert[place] = 0;
-
- zpadlen = max - place;
- spadlen = min - MAX (max, place) - (signvalue ? 1 : 0);
- if (zpadlen < 0) zpadlen = 0;
- if (spadlen < 0) spadlen = 0;
- if (flags & DP_F_ZERO)
- {
- zpadlen = MAX(zpadlen, spadlen);
- spadlen = 0;
- }
- if (flags & DP_F_MINUS)
- spadlen = -spadlen; /* Left Justifty */
-
-#ifdef DEBUG_SNPRINTF
- dprint (1, (debugfile, "zpad: %d, spad: %d, min: %d, max: %d, place: %d\n",
- zpadlen, spadlen, min, max, place));
-#endif
+/** spool floating point to buffer */
+static int
+print_float(char* buf, int max, double value, int prec)
+{
+ /* as xxx.xxx if prec==0, no '.', with prec decimals after . */
+ /* no conversion for NAN and INF, because we do not want to require
+ linking with -lm. */
+ /* Thus, the conversions use 64bit integers to convert the numbers,
+ * which makes 19 digits before and after the decimal point the max */
+ unsigned long long whole = (unsigned long long)value;
+ double remain = value - (double)whole;
+ int len = 0;
+ if(prec != 0)
+ len = print_remainder(buf, max, remain, prec);
+ len += print_dec_ll(buf+len, max-len, whole);
+ return len;
+}
- /* Spaces */
- while (spadlen > 0)
- {
- dopr_outch (buffer, currlen, maxlen, ' ');
- --spadlen;
- }
-
- /* Sign */
- if (signvalue)
- dopr_outch (buffer, currlen, maxlen, signvalue);
-
- /* Zeros */
- if (zpadlen > 0)
- {
- while (zpadlen > 0)
- {
- dopr_outch (buffer, currlen, maxlen, '0');
- --zpadlen;
- }
- }
-
- /* Digits */
- while (place > 0)
- dopr_outch (buffer, currlen, maxlen, convert[--place]);
-
- /* Left Justified spaces */
- while (spadlen < 0) {
- dopr_outch (buffer, currlen, maxlen, ' ');
- ++spadlen;
- }
-}
-
-static long double abs_val (long double value)
-{
- long double result = value;
-
- if (value < 0)
- result = -value;
-
- return result;
-}
-
-static double pow10 (double exp)
-{
- long double result = 1;
-
- while (exp)
- {
- result *= 10;
- exp--;
- }
-
- return result;
-}
-
-static double round (double value)
-{
- long intpart;
-
- intpart = value;
- value = value - intpart;
- if (value >= 0.5)
- intpart++;
-
- return intpart;
-}
-
-static void fmtfp (char *buffer, size_t *currlen, size_t maxlen,
- long double fvalue, int min, int max, int flags)
-{
- int signvalue = 0;
- long double ufvalue;
- char iconvert[20];
- char fconvert[20];
- int iplace = 0;
- int fplace = 0;
- int padlen = 0; /* amount to pad */
- int zpadlen = 0;
- int caps = 0;
- long intpart;
- long fracpart;
-
- /*
- * AIX manpage says the default is 0, but Solaris says the default
- * is 6, and sprintf on AIX defaults to 6
- */
- if (max < 0)
- max = 6;
-
- ufvalue = abs_val (fvalue);
-
- if (fvalue < 0)
- signvalue = '-';
- else
- if (flags & DP_F_PLUS) /* Do a sign (+/i) */
- signvalue = '+';
- else
- if (flags & DP_F_SPACE)
- signvalue = ' ';
-
-#if 0
- if (flags & DP_F_UP) caps = 1; /* Should characters be upper case? */
-#endif
+/** print %f */
+static void
+print_num_f(char** at, size_t* left, int* ret, double value,
+ int minw, int precision, int prgiven, int zeropad, int minus,
+ int plus, int space)
+{
+ char buf[PRINT_FLOAT_BUFSZ];
+ int negative = (value < 0);
+ int zero = 0;
+ int len;
+ if(!prgiven) precision = 6;
+ len = print_float(buf, (int)sizeof(buf), negative?-value:value,
+ precision);
+ print_num(at, left, ret, minw, 1, 0, zeropad, minus,
+ plus, space, zero, negative, buf, len);
+}
- intpart = ufvalue;
+/* rudimentary %g support */
+static int
+print_float_g(char* buf, int max, double value, int prec)
+{
+ unsigned long long whole = (unsigned long long)value;
+ double remain = value - (double)whole;
+ int before = 0;
+ int len = 0;
+
+ /* number of digits before the decimal point */
+ while(whole > 0) {
+ before++;
+ whole /= 10;
+ }
+ whole = (unsigned long long)value;
+
+ if(prec > before && remain != 0.0) {
+ /* see if the last decimals are zero, if so, skip them */
+ len = print_remainder(buf, max, remain, prec-before);
+ while(len > 0 && buf[0]=='0') {
+ memmove(buf, buf+1, --len);
+ }
+ }
+ len += print_dec_ll(buf+len, max-len, whole);
+ return len;
+}
- /*
- * Sorry, we only support 9 digits past the decimal because of our
- * conversion method
- */
- if (max > 9)
- max = 9;
- /* We "cheat" by converting the fractional part to integer by
- * multiplying by a factor of 10
- */
- fracpart = round ((pow10 (max)) * (ufvalue - intpart));
+/** print %g */
+static void
+print_num_g(char** at, size_t* left, int* ret, double value,
+ int minw, int precision, int prgiven, int zeropad, int minus,
+ int plus, int space)
+{
+ char buf[PRINT_FLOAT_BUFSZ];
+ int negative = (value < 0);
+ int zero = 0;
+ int len;
+ if(!prgiven) precision = 6;
+ if(precision == 0) precision = 1;
+ len = print_float_g(buf, (int)sizeof(buf), negative?-value:value,
+ precision);
+ print_num(at, left, ret, minw, 1, 0, zeropad, minus,
+ plus, space, zero, negative, buf, len);
+}
- if (fracpart >= pow10 (max))
- {
- intpart++;
- fracpart -= pow10 (max);
- }
-#ifdef DEBUG_SNPRINTF
- dprint (1, (debugfile, "fmtfp: %f =? %d.%d\n", fvalue, intpart, fracpart));
-#endif
+/** strnlen (compat implementation) */
+static int
+my_strnlen(const char* s, int max)
+{
+ int i;
+ for(i=0; i<max; i++)
+ if(s[i]==0)
+ return i;
+ return max;
+}
- /* Convert integer part */
- do {
- iconvert[iplace++] =
- (caps? "0123456789ABCDEF":"0123456789abcdef")[intpart % 10];
- intpart = (intpart / 10);
- } while(intpart && (iplace < 20));
- if (iplace == 20) iplace--;
- iconvert[iplace] = 0;
-
- /* Convert fractional part */
- do {
- fconvert[fplace++] =
- (caps? "0123456789ABCDEF":"0123456789abcdef")[fracpart % 10];
- fracpart = (fracpart / 10);
- } while(fracpart && (fplace < 20));
- if (fplace == 20) fplace--;
- fconvert[fplace] = 0;
-
- /* -1 for decimal point, another -1 if we are printing a sign */
- padlen = min - iplace - max - 1 - ((signvalue) ? 1 : 0);
- zpadlen = max - fplace;
- if (zpadlen < 0)
- zpadlen = 0;
- if (padlen < 0)
- padlen = 0;
- if (flags & DP_F_MINUS)
- padlen = -padlen; /* Left Justifty */
-
- if ((flags & DP_F_ZERO) && (padlen > 0))
- {
- if (signvalue)
- {
- dopr_outch (buffer, currlen, maxlen, signvalue);
- --padlen;
- signvalue = 0;
- }
- while (padlen > 0)
- {
- dopr_outch (buffer, currlen, maxlen, '0');
- --padlen;
- }
- }
- while (padlen > 0)
- {
- dopr_outch (buffer, currlen, maxlen, ' ');
- --padlen;
- }
- if (signvalue)
- dopr_outch (buffer, currlen, maxlen, signvalue);
-
- while (iplace > 0)
- dopr_outch (buffer, currlen, maxlen, iconvert[--iplace]);
-
- /*
- * Decimal point. This should probably use locale to find the correct
- * char to print out.
- */
- dopr_outch (buffer, currlen, maxlen, '.');
-
- while (zpadlen > 0)
- {
- dopr_outch (buffer, currlen, maxlen, '0');
- --zpadlen;
- }
-
- while (fplace > 0)
- dopr_outch (buffer, currlen, maxlen, fconvert[--fplace]);
-
- while (padlen < 0)
- {
- dopr_outch (buffer, currlen, maxlen, ' ');
- ++padlen;
- }
-}
-
-static void dopr_outch (char *buffer, size_t *currlen, size_t maxlen, char c)
-{
- if (*currlen < maxlen)
- buffer[(*currlen)++] = c;
-}
-
-#ifdef TEST_SNPRINTF
-#ifndef LONG_STRING
-#define LONG_STRING 1024
-#endif
-int main (void)
-{
- char buf1[LONG_STRING];
- char buf2[LONG_STRING];
- char *fp_fmt[] = {
- "%-1.5f",
- "%1.5f",
- "%123.9f",
- "%10.5f",
- "% 10.5f",
- "%+22.9f",
- "%+4.9f",
- "%01.3f",
- "%4f",
- "%3.1f",
- "%3.2f",
- NULL
- };
- double fp_nums[] = { -1.5, 134.21, 91340.2, 341.1234, 0203.9, 0.96, 0.996,
- 0.9996, 1.996, 4.136, 0};
- char *int_fmt[] = {
- "%-1.5d",
- "%1.5d",
- "%123.9d",
- "%5.5d",
- "%10.5d",
- "% 10.5d",
- "%+22.33d",
- "%01.3d",
- "%4d",
- NULL
- };
- long int_nums[] = { -1, 134, 91340, 341, 0203, 0};
- int x, y;
- int fail = 0;
- int num = 0;
-
- printf ("Testing snprintf format codes against system sprintf...\n");
-
- for (x = 0; fp_fmt[x] != NULL ; x++)
- for (y = 0; fp_nums[y] != 0 ; y++)
- {
- snprintf (buf1, sizeof (buf1), fp_fmt[x], fp_nums[y]);
- sprintf (buf2, fp_fmt[x], fp_nums[y]);
- if (strcmp (buf1, buf2))
- {
- printf("snprintf doesn't match Format: %s\n\tsnprintf = %s\n\tsprintf = %s\n",
- fp_fmt[x], buf1, buf2);
- fail++;
- }
- num++;
- }
-
- for (x = 0; int_fmt[x] != NULL ; x++)
- for (y = 0; int_nums[y] != 0 ; y++)
- {
- snprintf (buf1, sizeof (buf1), int_fmt[x], int_nums[y]);
- sprintf (buf2, int_fmt[x], int_nums[y]);
- if (strcmp (buf1, buf2))
- {
- printf("snprintf doesn't match Format: %s\n\tsnprintf = %s\n\tsprintf = %s\n",
- int_fmt[x], buf1, buf2);
- fail++;
- }
- num++;
- }
- printf ("%d tests failed out of %d.\n", fail, num);
+/** print %s */
+static void
+print_str(char** at, size_t* left, int* ret, char* s,
+ int minw, int precision, int prgiven, int minus)
+{
+ int w;
+ /* with prec: no more than x characters from this string, stop at 0 */
+ if(prgiven)
+ w = my_strnlen(s, precision);
+ else w = (int)strlen(s); /* up to the nul */
+ if(w < minw && !minus)
+ print_pad(at, left, ret, ' ', minw - w);
+ spool_str(at, left, ret, s, w);
+ if(w < minw && minus)
+ print_pad(at, left, ret, ' ', minw - w);
+}
+
+/** print %c */
+static void
+print_char(char** at, size_t* left, int* ret, int c,
+ int minw, int minus)
+{
+ if(1 < minw && !minus)
+ print_pad(at, left, ret, ' ', minw - 1);
+ print_pad(at, left, ret, c, 1);
+ if(1 < minw && minus)
+ print_pad(at, left, ret, ' ', minw - 1);
+}
+
+
+/**
+ * Print to string.
+ * str: string buffer for result. result will be null terminated.
+ * size: size of the buffer. null is put inside buffer.
+ * format: printf format string.
+ * arg: '...' arguments to print.
+ * returns number of characters. a null is printed after this.
+ * return number of bytes that would have been written
+ * if the buffer had been large enough.
+ *
+ * supported format specifiers:
+ * %s, %u, %d, %x, %i, %f, %g, %c, %p, %n.
+ * length: l, ll (for d, u, x).
+ * precision: 6.6d (for d, u, x)
+ * %f, %g precisions, 0.3f
+ * %20s, '.*s'
+ * and %%.
+ */
+int vsnprintf(char* str, size_t size, const char* format, va_list arg)
+{
+ char* at = str;
+ size_t left = size;
+ int ret = 0;
+ const char* fmt = format;
+ int conv, minw, precision, prgiven, zeropad, minus, plus, space, length;
+ while(*fmt) {
+ /* copy string before % */
+ while(*fmt && *fmt!='%') {
+ if(left > 1) {
+ *at++ = *fmt++;
+ left--;
+ } else fmt++;
+ ret++;
+ }
+
+ /* see if we are at end */
+ if(!*fmt) break;
+
+ /* fetch next argument % designation from format string */
+ fmt++; /* skip the '%' */
+
+ /********************************/
+ /* get the argument designation */
+ /********************************/
+ /* we must do this vararg stuff inside this function for
+ * portability. Hence, get_designation, and print_designation
+ * are not their own functions. */
+
+ /* printout designation:
+ * conversion specifier: x, d, u, s, c, n, m, p
+ * flags: # not supported
+ * 0 zeropad (on the left)
+ * - left adjust (right by default)
+ * ' ' printspace for positive number (in - position).
+ * + alwayssign
+ * fieldwidth: [1-9][0-9]* minimum field width.
+ * if this is * then type int next argument specifies the minwidth.
+ * if this is negative, the - flag is set (with positive width).
+ * precision: period[digits]*, %.2x.
+ * if this is * then type int next argument specifies the precision.
+ * just '.' or negative value means precision=0.
+ * this is mindigits to print for d, i, u, x
+ * this is aftercomma digits for f
+ * this is max number significant digits for g
+ * maxnumber characters to be printed for s
+ * length: 0-none (int), 1-l (long), 2-ll (long long)
+ * notsupported: hh (char), h (short), L (long double), q, j, z, t
+ * Does not support %m$ and *m$ argument designation as array indices.
+ * Does not support %#x
+ *
+ */
+ minw = 0;
+ precision = 1;
+ prgiven = 0;
+ zeropad = 0;
+ minus = 0;
+ plus = 0;
+ space = 0;
+ length = 0;
+
+ /* get flags in any order */
+ for(;;) {
+ if(*fmt == '0')
+ zeropad = 1;
+ else if(*fmt == '-')
+ minus = 1;
+ else if(*fmt == '+')
+ plus = 1;
+ else if(*fmt == ' ')
+ space = 1;
+ else break;
+ fmt++;
+ }
+
+ /* field width */
+ if(*fmt == '*') {
+ fmt++; /* skip char */
+ minw = va_arg(arg, int);
+ if(minw < 0) {
+ minus = 1;
+ minw = -minw;
+ }
+ } else while(*fmt >= '0' && *fmt <= '9') {
+ minw = minw*10 + (*fmt++)-'0';
+ }
+
+ /* precision */
+ if(*fmt == '.') {
+ fmt++; /* skip period */
+ prgiven = 1;
+ precision = 0;
+ if(*fmt == '*') {
+ fmt++; /* skip char */
+ precision = va_arg(arg, int);
+ if(precision < 0)
+ precision = 0;
+ } else while(*fmt >= '0' && *fmt <= '9') {
+ precision = precision*10 + (*fmt++)-'0';
+ }
+ }
+
+ /* length */
+ if(*fmt == 'l') {
+ fmt++; /* skip char */
+ length = 1;
+ if(*fmt == 'l') {
+ fmt++; /* skip char */
+ length = 2;
+ }
+ }
+
+ /* get the conversion */
+ if(!*fmt) conv = 0;
+ else conv = *fmt++;
+
+ /***********************************/
+ /* print that argument designation */
+ /***********************************/
+ switch(conv) {
+ case 'i':
+ case 'd':
+ if(length == 0)
+ print_num_d(&at, &left, &ret, va_arg(arg, int),
+ minw, precision, prgiven, zeropad, minus, plus, space);
+ else if(length == 1)
+ print_num_ld(&at, &left, &ret, va_arg(arg, long),
+ minw, precision, prgiven, zeropad, minus, plus, space);
+ else if(length == 2)
+ print_num_lld(&at, &left, &ret,
+ va_arg(arg, long long),
+ minw, precision, prgiven, zeropad, minus, plus, space);
+ break;
+ case 'u':
+ if(length == 0)
+ print_num_u(&at, &left, &ret,
+ va_arg(arg, unsigned int),
+ minw, precision, prgiven, zeropad, minus, plus, space);
+ else if(length == 1)
+ print_num_lu(&at, &left, &ret,
+ va_arg(arg, unsigned long),
+ minw, precision, prgiven, zeropad, minus, plus, space);
+ else if(length == 2)
+ print_num_llu(&at, &left, &ret,
+ va_arg(arg, unsigned long long),
+ minw, precision, prgiven, zeropad, minus, plus, space);
+ break;
+ case 'x':
+ if(length == 0)
+ print_num_x(&at, &left, &ret,
+ va_arg(arg, unsigned int),
+ minw, precision, prgiven, zeropad, minus, plus, space);
+ else if(length == 1)
+ print_num_lx(&at, &left, &ret,
+ va_arg(arg, unsigned long),
+ minw, precision, prgiven, zeropad, minus, plus, space);
+ else if(length == 2)
+ print_num_llx(&at, &left, &ret,
+ va_arg(arg, unsigned long long),
+ minw, precision, prgiven, zeropad, minus, plus, space);
+ break;
+ case 's':
+ print_str(&at, &left, &ret, va_arg(arg, char*),
+ minw, precision, prgiven, minus);
+ break;
+ case 'c':
+ print_char(&at, &left, &ret, va_arg(arg, int),
+ minw, minus);
+ break;
+ case 'n':
+ *va_arg(arg, int*) = ret;
+ break;
+ case 'm':
+ print_str(&at, &left, &ret, strerror(errno),
+ minw, precision, prgiven, minus);
+ break;
+ case 'p':
+ print_num_llp(&at, &left, &ret, va_arg(arg, void*),
+ minw, precision, prgiven, zeropad, minus, plus, space);
+ break;
+ case '%':
+ print_pad(&at, &left, &ret, '%', 1);
+ break;
+ case 'f':
+ print_num_f(&at, &left, &ret, va_arg(arg, double),
+ minw, precision, prgiven, zeropad, minus, plus, space);
+ break;
+ case 'g':
+ print_num_g(&at, &left, &ret, va_arg(arg, double),
+ minw, precision, prgiven, zeropad, minus, plus, space);
+ break;
+ /* unknown */
+ default:
+ case 0: break;
+ }
+ }
+
+ /* zero terminate */
+ if(left > 0)
+ *at = 0;
+ return ret;
}
-#endif /* SNPRINTF_TEST */
-#endif /* !HAVE_SNPRINTF */
+#ifdef SNPRINTF_TEST
+
+/** do tests */
+#undef snprintf
+#define DOTEST(bufsz, result, retval, ...) do { \
+ char buf[bufsz]; \
+ printf("now test %s\n", #__VA_ARGS__); \
+ int r=my_snprintf(buf, sizeof(buf), __VA_ARGS__); \
+ if(r != retval || strcmp(buf, result) != 0) { \
+ printf("error test(%s) was \"%s\":%d\n", \
+ ""#bufsz", "#result", "#retval", "#__VA_ARGS__, \
+ buf, r); \
+ exit(1); \
+ } \
+ r=snprintf(buf, sizeof(buf), __VA_ARGS__); \
+ if(r != retval || strcmp(buf, result) != 0) { \
+ printf("error test(%s) differs with system, \"%s\":%d\n", \
+ ""#bufsz", "#result", "#retval", "#__VA_ARGS__, \
+ buf, r); \
+ exit(1); \
+ } \
+ printf("test(\"%s\":%d) passed\n", buf, r); \
+ } while(0);
+
+/** test program */
+int main(void)
+{
+ int x = 0;
+
+ /* bufsize, expectedstring, expectedretval, snprintf arguments */
+ DOTEST(1024, "hello", 5, "hello");
+ DOTEST(1024, "h", 1, "h");
+ /* warning from gcc for format string, but it does work
+ * DOTEST(1024, "", 0, ""); */
+
+ DOTEST(3, "he", 5, "hello");
+ DOTEST(1, "", 7, "%d", 7823089);
+
+ /* test positive numbers */
+ DOTEST(1024, "0", 1, "%d", 0);
+ DOTEST(1024, "1", 1, "%d", 1);
+ DOTEST(1024, "9", 1, "%d", 9);
+ DOTEST(1024, "15", 2, "%d", 15);
+ DOTEST(1024, "ab15cd", 6, "ab%dcd", 15);
+ DOTEST(1024, "167", 3, "%d", 167);
+ DOTEST(1024, "7823089", 7, "%d", 7823089);
+ DOTEST(1024, " 12", 3, "%3d", 12);
+ DOTEST(1024, "012", 3, "%.3d", 12);
+ DOTEST(1024, "012", 3, "%3.3d", 12);
+ DOTEST(1024, "012", 3, "%03d", 12);
+ DOTEST(1024, " 012", 4, "%4.3d", 12);
+ DOTEST(1024, "", 0, "%.0d", 0);
+
+ /* test negative numbers */
+ DOTEST(1024, "-1", 2, "%d", -1);
+ DOTEST(1024, "-12", 3, "%3d", -12);
+ DOTEST(1024, " -2", 3, "%3d", -2);
+ DOTEST(1024, "-012", 4, "%.3d", -12);
+ DOTEST(1024, "-012", 4, "%3.3d", -12);
+ DOTEST(1024, "-012", 4, "%4.3d", -12);
+ DOTEST(1024, " -012", 5, "%5.3d", -12);
+ DOTEST(1024, "-12", 3, "%03d", -12);
+ DOTEST(1024, "-02", 3, "%03d", -2);
+ DOTEST(1024, "-15", 3, "%d", -15);
+ DOTEST(1024, "-7307", 5, "%d", -7307);
+ DOTEST(1024, "-12 ", 5, "%-5d", -12);
+ DOTEST(1024, "-00012", 6, "%-.5d", -12);
+
+ /* test + and space flags */
+ DOTEST(1024, "+12", 3, "%+d", 12);
+ DOTEST(1024, " 12", 3, "% d", 12);
+
+ /* test %u */
+ DOTEST(1024, "12", 2, "%u", 12);
+ DOTEST(1024, "0", 1, "%u", 0);
+ DOTEST(1024, "4294967295", 10, "%u", 0xffffffff);
+
+ /* test %x */
+ DOTEST(1024, "0", 1, "%x", 0);
+ DOTEST(1024, "c", 1, "%x", 12);
+ DOTEST(1024, "12ab34cd", 8, "%x", 0x12ab34cd);
+
+ /* test %llu, %lld */
+ DOTEST(1024, "18446744073709551615", 20, "%llu",
+ (long long)0xffffffffffffffff);
+ DOTEST(1024, "-9223372036854775808", 20, "%lld",
+ (long long)0x8000000000000000);
+ DOTEST(1024, "9223372036854775808", 19, "%llu",
+ (long long)0x8000000000000000);
+
+ /* test %s */
+ DOTEST(1024, "hello", 5, "%s", "hello");
+ DOTEST(1024, " hello", 10, "%10s", "hello");
+ DOTEST(1024, "hello ", 10, "%-10s", "hello");
+ DOTEST(1024, "he", 2, "%.2s", "hello");
+ DOTEST(1024, " he", 4, "%4.2s", "hello");
+ DOTEST(1024, " h", 4, "%4.2s", "h");
+
+ /* test %c */
+ DOTEST(1024, "a", 1, "%c", 'a');
+ /* warning from gcc for format string, but it does work
+ DOTEST(1024, " a", 5, "%5c", 'a');
+ DOTEST(1024, "a", 1, "%.0c", 'a'); */
+
+ /* test %n */
+ DOTEST(1024, "hello", 5, "hello%n", &x);
+ if(x != 5) { printf("the %%n failed\n"); exit(1); }
+
+ /* test %m */
+ errno = 0;
+ DOTEST(1024, "Success", 7, "%m");
+
+ /* test %p */
+ DOTEST(1024, "0x10", 4, "%p", (void*)0x10);
+ DOTEST(1024, "(nil)", 5, "%p", (void*)0x0);
+
+ /* test %% */
+ DOTEST(1024, "%", 1, "%%");
+
+ /* test %f */
+ DOTEST(1024, "0.000000", 8, "%f", 0.0);
+ DOTEST(1024, "0.00", 4, "%.2f", 0.0);
+ /* differs, "-0.00" DOTEST(1024, "0.00", 4, "%.2f", -0.0); */
+ DOTEST(1024, "234.00", 6, "%.2f", 234.005);
+ DOTEST(1024, "8973497.1246", 12, "%.4f", 8973497.12456);
+ DOTEST(1024, "-12.000000", 10, "%f", -12.0);
+ DOTEST(1024, "6", 1, "%.0f", 6.0);
+
+ DOTEST(1024, "6", 1, "%g", 6.0);
+ DOTEST(1024, "6.1", 3, "%g", 6.1);
+ DOTEST(1024, "6.15", 4, "%g", 6.15);
+
+ /* These format strings are from the code of NSD, Unbound, ldns */
+
+ DOTEST(1024, "abcdef", 6, "%s", "abcdef");
+ DOTEST(1024, "005", 3, "%03u", 5);
+ DOTEST(1024, "12345", 5, "%03u", 12345);
+ DOTEST(1024, "5", 1, "%d", 5);
+ DOTEST(1024, "(nil)", 5, "%p", NULL);
+ DOTEST(1024, "12345", 5, "%ld", (long)12345);
+ DOTEST(1024, "12345", 5, "%lu", (long)12345);
+ DOTEST(1024, " 12345", 12, "%12u", (unsigned)12345);
+ DOTEST(1024, "12345", 5, "%u", (unsigned)12345);
+ DOTEST(1024, "12345", 5, "%llu", (unsigned long long)12345);
+ DOTEST(1024, "12345", 5, "%x", 0x12345);
+ DOTEST(1024, "12345", 5, "%llx", (long long)0x12345);
+ DOTEST(1024, "012345", 6, "%6.6d", 12345);
+ DOTEST(1024, "012345", 6, "%6.6u", 12345);
+ DOTEST(1024, "1234.54", 7, "%g", 1234.54);
+ DOTEST(1024, "123456789.54", 12, "%.12g", 123456789.54);
+ DOTEST(1024, "3456789123456.54", 16, "%.16g", 3456789123456.54);
+ /* %24g does not work with 24 digits, not enough accuracy,
+ * the first 16 digits are correct */
+ DOTEST(1024, "12345", 5, "%3.3d", 12345);
+ DOTEST(1024, "000", 3, "%3.3d", 0);
+ DOTEST(1024, "001", 3, "%3.3d", 1);
+ DOTEST(1024, "012", 3, "%3.3d", 12);
+ DOTEST(1024, "-012", 4, "%3.3d", -12);
+ DOTEST(1024, "he", 2, "%.2s", "hello");
+ DOTEST(1024, "helloworld", 10, "%s%s", "hello", "world");
+ DOTEST(1024, "he", 2, "%.*s", 2, "hello");
+ DOTEST(1024, " hello", 7, "%*s", 7, "hello");
+ DOTEST(1024, "hello ", 7, "%*s", -7, "hello");
+ DOTEST(1024, "0", 1, "%c", '0');
+ DOTEST(1024, "A", 1, "%c", 'A');
+ DOTEST(1024, "", 1, "%c", 0);
+ DOTEST(1024, "\010", 1, "%c", 8);
+ DOTEST(1024, "%", 1, "%%");
+ DOTEST(1024, "0a", 2, "%02x", 0x0a);
+ DOTEST(1024, "bd", 2, "%02x", 0xbd);
+ DOTEST(1024, "12", 2, "%02ld", (long)12);
+ DOTEST(1024, "02", 2, "%02ld", (long)2);
+ DOTEST(1024, "02", 2, "%02u", (unsigned)2);
+ DOTEST(1024, "765432", 6, "%05u", (unsigned)765432);
+ DOTEST(1024, "10.234", 6, "%0.3f", 10.23421);
+ DOTEST(1024, "123456.234", 10, "%0.3f", 123456.23421);
+ DOTEST(1024, "123456789.234", 13, "%0.3f", 123456789.23421);
+ DOTEST(1024, "123456.23", 9, "%.2f", 123456.23421);
+ DOTEST(1024, "123456", 6, "%.0f", 123456.23421);
+ DOTEST(1024, "0123", 4, "%.4x", 0x0123);
+ DOTEST(1024, "00000123", 8, "%.8x", 0x0123);
+ DOTEST(1024, "ffeb0cde", 8, "%.8x", 0xffeb0cde);
+ DOTEST(1024, " 987654321", 10, "%10lu", (unsigned long)987654321);
+ DOTEST(1024, " 987654321", 12, "%12lu", (unsigned long)987654321);
+ DOTEST(1024, "987654321", 9, "%i", 987654321);
+ DOTEST(1024, "-87654321", 9, "%i", -87654321);
+ DOTEST(1024, "hello ", 16, "%-16s", "hello");
+ DOTEST(1024, " ", 16, "%-16s", "");
+ DOTEST(1024, "a ", 16, "%-16s", "a");
+ DOTEST(1024, "foobarfoobar ", 16, "%-16s", "foobarfoobar");
+ DOTEST(1024, "foobarfoobarfoobar", 18, "%-16s", "foobarfoobarfoobar");
+
+ /* combined expressions */
+ DOTEST(1024, "foo 1.0 size 512 edns", 21,
+ "foo %s size %d %s%s", "1.0", 512, "", "edns");
+ DOTEST(15, "foo 1.0 size 5", 21,
+ "foo %s size %d %s%s", "1.0", 512, "", "edns");
+ DOTEST(1024, "packet 1203ceff id", 18,
+ "packet %2.2x%2.2x%2.2x%2.2x id", 0x12, 0x03, 0xce, 0xff);
+ DOTEST(1024, "/tmp/testbound_123abcd.tmp", 26, "/tmp/testbound_%u%s%s.tmp", 123, "ab", "cd");
+
+ return 0;
+}
+#endif /* SNPRINTF_TEST */
diff --git a/configure b/configure
index be312d1e3f16..8bc7462cf02c 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for ldns 1.6.16.
+# Generated by GNU Autoconf 2.68 for ldns 1.6.17.
#
# Report bugs to <libdns@nlnetlabs.nl>.
#
@@ -570,8 +570,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='ldns'
PACKAGE_TARNAME='libdns'
-PACKAGE_VERSION='1.6.16'
-PACKAGE_STRING='ldns 1.6.16'
+PACKAGE_VERSION='1.6.17'
+PACKAGE_STRING='ldns 1.6.17'
PACKAGE_BUGREPORT='libdns@nlnetlabs.nl'
PACKAGE_URL=''
@@ -621,6 +621,8 @@ DEFAULT_CAPATH
DEFAULT_CAFILE
LDNS_TRUST_ANCHOR_FILE
WINDRES
+ldns_build_config_have_b32_pton
+ldns_build_config_have_b32_ntop
LIBOBJS
ldns_build_config_have_socklen_t
LIBPCAP_LIBS
@@ -633,30 +635,16 @@ LIBSSL_SSL_LIBS
LIBSSL_LIBS
LIBSSL_LDFLAGS
LIBSSL_CPPFLAGS
+ldns_build_config_use_dane
RUNTIME_PATH
HAVE_SSL
-OTOOL64
-OTOOL
-LIPO
-NMEDIT
-DSYMUTIL
-MANIFEST_TOOL
-AWK
-RANLIB
-STRIP
-ac_ct_AR
-DLLTOOL
-OBJDUMP
-LN_S
-NM
-ac_ct_DUMPBIN
-DUMPBIN
-LD
-FGREP
-SED
-LIBTOOL
-AR
libtool
+CLEAN_P5_DNS_LDNS
+UNINSTALL_P5_DNS_LDNS
+INSTALL_P5_DNS_LDNS
+TEST_P5_DNS_LDNS
+P5_DNS_LDNS
+PERL
PYLDNSXUNINST
PYLDNSXINST
PYLDNSUNINST
@@ -691,6 +679,28 @@ INSTALL_DRILL
DRILL
doxygen
LINTFLAGS
+SET_MAKE
+DEPFLAG
+OTOOL64
+OTOOL
+LIPO
+NMEDIT
+DSYMUTIL
+MANIFEST_TOOL
+AWK
+RANLIB
+STRIP
+ac_ct_AR
+AR
+DLLTOOL
+OBJDUMP
+LN_S
+NM
+ac_ct_DUMPBIN
+DUMPBIN
+LD
+FGREP
+SED
host_os
host_vendor
host_cpu
@@ -699,8 +709,7 @@ build_os
build_vendor
build_cpu
build
-SET_MAKE
-DEPFLAG
+LIBTOOL
EGREP
GREP
CPP
@@ -711,10 +720,10 @@ CPPFLAGS
LDFLAGS
CFLAGS
CC
+VERSION_INFO
LDNS_VERSION_MICRO
LDNS_VERSION_MINOR
LDNS_VERSION_MAJOR
-LIBTOOL_VERSION_INFO
target_alias
host_alias
build_alias
@@ -756,11 +765,6 @@ SHELL'
ac_subst_files=''
ac_user_opts='
enable_option_checking
-with_drill
-with_examples
-enable_ldns_config
-with_pyldns
-with_pyldnsx
enable_shared
enable_static
with_pic
@@ -768,10 +772,23 @@ enable_fast_install
with_gnu_ld
with_sysroot
enable_libtool_lock
+with_drill
+with_examples
+enable_ldns_config
+enable_stderr_msgs
+with_pyldns
+with_pyldnsx
+with_p5_dns_ldns
with_ssl
enable_sha2
enable_gost
enable_ecdsa
+enable_dane
+enable_rrtype_ninfo
+enable_rrtype_rkey
+enable_rrtype_cds
+enable_rrtype_uri
+enable_rrtype_ta
enable_rpath
with_trust_anchor
with_ca_file
@@ -1329,7 +1346,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures ldns 1.6.16 to adapt to many kinds of systems.
+\`configure' configures ldns 1.6.17 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1394,7 +1411,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of ldns 1.6.16:";;
+ short | recursive ) echo "Configuration of ldns 1.6.17:";;
esac
cat <<\_ACEOF
@@ -1402,31 +1419,40 @@ Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --disable-ldns-config disable installation of ldns-config (default=enabled)
--enable-shared[=PKGS] build shared libraries [default=yes]
--enable-static[=PKGS] build static libraries [default=yes]
--enable-fast-install[=PKGS]
optimize for fast installation [default=yes]
--disable-libtool-lock avoid locking (might break parallel builds)
+ --disable-ldns-config disable installation of ldns-config
+ (default=enabled)
+ --enable-stderr-msgs Enable printing to stderr (default=disabled)
--disable-sha2 Disable SHA256 and SHA512 RRSIG support
--disable-gost Disable GOST support
--disable-ecdsa Disable ECDSA support
+ --disable-dane Disable DANE support
+ --enable-rrtype-ninfo Enable draft RR type ninfo.
+ --enable-rrtype-rkey Enable draft RR type rkey.
+ --enable-rrtype-cds Enable draft RR type cds.
+ --enable-rrtype-uri Enable draft RR type uri.
+ --enable-rrtype-ta Enable draft RR type ta.
--disable-rpath disable hardcoded rpath (default=enabled)
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+ --with-sysroot=DIR Search for dependent libraries within DIR
+ (or the compiler's sysroot if not specified).
--with-drill Also build drill.
--with-examples Also build examples.
--with-pyldns generate python library, or --without-pyldns to
disable Python support.
--without-pyldnsx Do not install the ldnsx python module, or
--with-pyldnsx to install it.
- --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
- both]
- --with-gnu-ld assume the C compiler uses GNU ld [default=no]
- --with-sysroot=DIR Search for dependent libraries within DIR
- (or the compiler's sysroot if not specified).
+ --with-p5-dns-ldns generate DNS::LDNS perl bindings
--with-ssl=pathname enable SSL (will check /usr/local/ssl /usr/lib/ssl
/usr/ssl /usr/pkg /usr/local /opt/local /usr/sfw
/usr)
@@ -1517,7 +1543,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-ldns configure 1.6.16
+ldns configure 1.6.17
generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
@@ -1770,60 +1796,6 @@ $as_echo "$ac_res" >&6; }
} # ac_fn_c_check_header_compile
-# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
-# -------------------------------------------
-# Tests whether TYPE exists after having included INCLUDES, setting cache
-# variable VAR accordingly.
-ac_fn_c_check_type ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- eval "$3=no"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-int
-main ()
-{
-if (sizeof ($2))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-int
-main ()
-{
-if (sizeof (($2)))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
- eval "$3=yes"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_type
-
# ac_fn_c_try_link LINENO
# -----------------------
# Try to link conftest.$ac_ext, and return whether this succeeded.
@@ -1937,6 +1909,60 @@ $as_echo "$ac_res" >&6; }
} # ac_fn_c_check_func
+# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
+# -------------------------------------------
+# Tests whether TYPE exists after having included INCLUDES, setting cache
+# variable VAR accordingly.
+ac_fn_c_check_type ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=no"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+if (sizeof ($2))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+if (sizeof (($2)))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ eval "$3=yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_type
+
# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
# ---------------------------------------------
# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
@@ -2221,7 +2247,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by ldns $as_me 1.6.16, which was
+It was created by ldns $as_me 1.6.17, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
@@ -2571,18 +2597,14 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
# needed to build correct soname
-LIBTOOL_VERSION_INFO=1:6:16
-
LDNS_VERSION_MAJOR=1
LDNS_VERSION_MINOR=6
-LDNS_VERSION_MICRO=16
+LDNS_VERSION_MICRO=17
+VERSION_INFO=1:6:17
-OURCPPFLAGS=''
-CPPFLAGS=${CPPFLAGS:-${OURCPPFLAGS}}
-CFLAGS="$CFLAGS"
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
@@ -3834,598 +3856,6 @@ $as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
-# Checks for programs.
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- 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
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_CC"; then
- ac_ct_CC=$CC
- # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- 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
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
-else
- CC="$ac_cv_prog_CC"
-fi
-
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- 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
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- fi
-fi
-if test -z "$CC"; then
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- 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
- fi
- ac_cv_prog_CC="cc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-if test $ac_prog_rejected = yes; then
- # We found a bogon in the path, so make sure we never use it.
- set dummy $ac_cv_prog_CC
- shift
- if test $# != 0; then
- # We chose a different compiler from the bogus one.
- # However, it has the same basename, so the bogon will be chosen
- # first if we set CC to just the basename; use the full file name.
- shift
- ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
- fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- for ac_prog in cl.exe
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- 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
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$CC" && break
- done
-fi
-if test -z "$CC"; then
- ac_ct_CC=$CC
- for ac_prog in cl.exe
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- 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
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$ac_ct_CC" && break
-done
-
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
-fi
-
-fi
-
-
-test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5; }
-
-# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
-set X $ac_compile
-ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
- { { ac_try="$ac_compiler $ac_option >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compiler $ac_option >&5") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- sed '10a\
-... rest of stderr output deleted ...
- 10q' conftest.err >conftest.er1
- cat conftest.er1 >&5
- fi
- rm -f conftest.er1 conftest.err
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
-done
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
-$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if ${ac_cv_c_compiler_gnu+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-#ifndef __GNUC__
- choke me
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_compiler_gnu=yes
-else
- ac_compiler_gnu=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
-$as_echo "$ac_cv_c_compiler_gnu" >&6; }
-if test $ac_compiler_gnu = yes; then
- GCC=yes
-else
- GCC=
-fi
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
-$as_echo_n "checking whether $CC accepts -g... " >&6; }
-if ${ac_cv_prog_cc_g+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_save_c_werror_flag=$ac_c_werror_flag
- ac_c_werror_flag=yes
- ac_cv_prog_cc_g=no
- CFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_g=yes
-else
- CFLAGS=""
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
- ac_c_werror_flag=$ac_save_c_werror_flag
- CFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_g=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_c_werror_flag=$ac_save_c_werror_flag
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
-$as_echo "$ac_cv_prog_cc_g" >&6; }
-if test "$ac_test_CFLAGS" = set; then
- CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-g"
- fi
-else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
- else
- CFLAGS=
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
-$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if ${ac_cv_prog_cc_c89+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_prog_cc_c89=no
-ac_save_CC=$CC
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdarg.h>
-#include <stdio.h>
-#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);
-static char *e (p, i)
- char **p;
- int i;
-{
- return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
- char *s;
- va_list v;
- va_start (v,p);
- s = g (p, va_arg (v,int));
- va_end (v);
- return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
- function prototypes and stuff, but not '\xHH' hex character constants.
- These don't provoke an error unfortunately, instead are silently treated
- as 'x'. The following induces an error, until -std is added to get
- proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
- array size at least. It's necessary to write '\x00'==0 to get something
- that's true only with -std. */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
- inside strings and character constants. */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
- ;
- return 0;
-}
-_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
- -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
- CC="$ac_save_CC $ac_arg"
- if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_c89=$ac_arg
-fi
-rm -f core conftest.err conftest.$ac_objext
- test "x$ac_cv_prog_cc_c89" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC
-
-fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
- x)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; } ;;
- xno)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;;
- *)
- CC="$CC $ac_cv_prog_cc_c89"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
-$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
-esac
-if test "x$ac_cv_prog_cc_c89" != xno; then :
-
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $CC dependency flag" >&5
-$as_echo_n "checking $CC dependency flag... " >&6; }
-echo 'void f(){}' >conftest.c
-if test "`$CC -MM conftest.c 2>&1`" = "conftest.o: conftest.c"; then
- DEPFLAG="-MM"
-else
- if test "`$CC -xM1 conftest.c 2>&1`" = "conftest.o: conftest.c"; then
- DEPFLAG="-xM1"
- else
- DEPFLAG="-MM" # dunno do something
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DEPFLAG" >&5
-$as_echo "$DEPFLAG" >&6; }
-rm -f conftest.c
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
-set x ${MAKE-make}
-ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat >conftest.make <<\_ACEOF
-SHELL = /bin/sh
-all:
- @echo '@@@%%%=$(MAKE)=@@@%%%'
-_ACEOF
-# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
-case `${MAKE-make} -f conftest.make 2>/dev/null` in
- *@@@%%%=?*=@@@%%%*)
- eval ac_cv_prog_make_${ac_make}_set=yes;;
- *)
- eval ac_cv_prog_make_${ac_make}_set=no;;
-esac
-rm -f conftest.make
-fi
-if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- SET_MAKE=
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-
-# Extra (sp)lint flags for NetBSD
ac_aux_dir=
for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
if test -f "$ac_dir/install-sh"; then
@@ -4455,6 +3885,31 @@ ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+case `pwd` in
+ *\ * | *\ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
+$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
+esac
+
+
+
+macro_version='2.4.2'
+macro_revision='1.3337'
+
+
+
+
+
+
+
+
+
+
+
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
# Make sure we can run config.sub.
$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
@@ -4526,2630 +3981,6 @@ IFS=$ac_save_IFS
case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-case "$host_os" in
- netbsd*) LINTFLAGS="'-D__RENAME(x)=' -D_NETINET_IN_H_ $LINTFLAGS"
- ;;
- *) LINTFLAGS="$LINTFLAGS"
- ;;
-esac
-
-
-
-$as_echo "#define WINVER 0x0502" >>confdefs.h
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -std=c99" >&5
-$as_echo_n "checking whether $CC supports -std=c99... " >&6; }
-cache=`echo std=c99 | sed 'y%.=/+-%___p_%'`
-if eval \${cv_prog_cc_flag_$cache+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
-echo 'void f(){}' >conftest.c
-if test -z "`$CC $CPPFLAGS $CFLAGS -std=c99 -c conftest.c 2>&1`"; then
-eval "cv_prog_cc_flag_$cache=yes"
-else
-eval "cv_prog_cc_flag_$cache=no"
-fi
-rm -f conftest conftest.o conftest.c
-
-fi
-
-if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-:
-C99FLAG="-std=c99"
-else
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-:
-
-fi
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -xc99" >&5
-$as_echo_n "checking whether $CC supports -xc99... " >&6; }
-cache=`echo xc99 | sed 'y%.=/+-%___p_%'`
-if eval \${cv_prog_cc_flag_$cache+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
-echo 'void f(){}' >conftest.c
-if test -z "`$CC $CPPFLAGS $CFLAGS -xc99 -c conftest.c 2>&1`"; then
-eval "cv_prog_cc_flag_$cache=yes"
-else
-eval "cv_prog_cc_flag_$cache=no"
-fi
-rm -f conftest conftest.o conftest.c
-
-fi
-
-if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-:
-C99FLAG="-xc99"
-else
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-:
-
-fi
-
-
-# routine to copy files
-# argument 1 is a list of files (relative to the source dir)
-# argument 2 is a destination directory (relative to the current
-# working directory
-
-
-# copy all .h files in the dir at argument 1
-# (relative to source) to the dir at argument 2
-# (relative to current dir)
-
-
-# Checks for typedefs, structures, and compiler characteristics.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
-$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
-if ${ac_cv_c_const+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-/* FIXME: Include the comments suggested by Paul. */
-#ifndef __cplusplus
- /* Ultrix mips cc rejects this. */
- typedef int charset[2];
- const charset cs;
- /* SunOS 4.1.1 cc rejects this. */
- char const *const *pcpcc;
- char **ppc;
- /* NEC SVR4.0.2 mips cc rejects this. */
- struct point {int x, y;};
- static struct point const zero = {0,0};
- /* AIX XL C 1.02.0.0 rejects this.
- It does not let you subtract one const X* pointer from another in
- an arm of an if-expression whose if-part is not a constant
- expression */
- const char *g = "string";
- pcpcc = &g + (g ? g-g : 0);
- /* HPUX 7.0 cc rejects these. */
- ++pcpcc;
- ppc = (char**) pcpcc;
- pcpcc = (char const *const *) ppc;
- { /* SCO 3.2v4 cc rejects this. */
- char *t;
- char const *s = 0 ? (char *) 0 : (char const *) 0;
-
- *t++ = 0;
- if (s) return 0;
- }
- { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
- int x[] = {25, 17};
- const int *foo = &x[0];
- ++foo;
- }
- { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
- typedef const int *iptr;
- iptr p = 0;
- ++p;
- }
- { /* AIX XL C 1.02.0.0 rejects this saying
- "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
- struct s { int j; const int *ap[3]; };
- struct s *b; b->j = 5;
- }
- { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
- const int foo = 10;
- if (!foo) return 0;
- }
- return !cs[0] && !zero.x;
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_c_const=yes
-else
- ac_cv_c_const=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
-$as_echo "$ac_cv_c_const" >&6; }
-if test $ac_cv_c_const = no; then
-
-$as_echo "#define const /**/" >>confdefs.h
-
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-if test "x$CFLAGS" = "x" ; then
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -g" >&5
-$as_echo_n "checking whether $CC supports -g... " >&6; }
-cache=`echo g | sed 'y%.=/+-%___p_%'`
-if eval \${cv_prog_cc_flag_$cache+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
-echo 'void f(){}' >conftest.c
-if test -z "`$CC $CPPFLAGS $CFLAGS -g -c conftest.c 2>&1`"; then
-eval "cv_prog_cc_flag_$cache=yes"
-else
-eval "cv_prog_cc_flag_$cache=no"
-fi
-rm -f conftest conftest.o conftest.c
-
-fi
-
-if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-:
-CFLAGS="-g"
-else
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-:
-
-fi
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -O2" >&5
-$as_echo_n "checking whether $CC supports -O2... " >&6; }
-cache=`echo O2 | sed 'y%.=/+-%___p_%'`
-if eval \${cv_prog_cc_flag_$cache+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
-echo 'void f(){}' >conftest.c
-if test -z "`$CC $CPPFLAGS $CFLAGS -O2 -c conftest.c 2>&1`"; then
-eval "cv_prog_cc_flag_$cache=yes"
-else
-eval "cv_prog_cc_flag_$cache=no"
-fi
-rm -f conftest conftest.o conftest.c
-
-fi
-
-if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-:
-CFLAGS="-O2 $CFLAGS"
-else
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-:
-
-fi
-
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wall" >&5
-$as_echo_n "checking whether $CC supports -Wall... " >&6; }
-cache=`echo Wall | sed 'y%.=/+-%___p_%'`
-if eval \${cv_prog_cc_flag_$cache+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
-echo 'void f(){}' >conftest.c
-if test -z "`$CC $CPPFLAGS $CFLAGS -Wall -c conftest.c 2>&1`"; then
-eval "cv_prog_cc_flag_$cache=yes"
-else
-eval "cv_prog_cc_flag_$cache=no"
-fi
-rm -f conftest conftest.o conftest.c
-
-fi
-
-if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-:
-CFLAGS="-Wall $CFLAGS"
-else
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-:
-
-fi
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -W" >&5
-$as_echo_n "checking whether $CC supports -W... " >&6; }
-cache=`echo W | sed 'y%.=/+-%___p_%'`
-if eval \${cv_prog_cc_flag_$cache+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
-echo 'void f(){}' >conftest.c
-if test -z "`$CC $CPPFLAGS $CFLAGS -W -c conftest.c 2>&1`"; then
-eval "cv_prog_cc_flag_$cache=yes"
-else
-eval "cv_prog_cc_flag_$cache=no"
-fi
-rm -f conftest conftest.o conftest.c
-
-fi
-
-if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-:
-CFLAGS="-W $CFLAGS"
-else
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-:
-
-fi
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wwrite-strings" >&5
-$as_echo_n "checking whether $CC supports -Wwrite-strings... " >&6; }
-cache=`echo Wwrite-strings | sed 'y%.=/+-%___p_%'`
-if eval \${cv_prog_cc_flag_$cache+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
-echo 'void f(){}' >conftest.c
-if test -z "`$CC $CPPFLAGS $CFLAGS -Wwrite-strings -c conftest.c 2>&1`"; then
-eval "cv_prog_cc_flag_$cache=yes"
-else
-eval "cv_prog_cc_flag_$cache=no"
-fi
-rm -f conftest conftest.o conftest.c
-
-fi
-
-if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-:
-CFLAGS="-Wwrite-strings $CFLAGS"
-else
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-:
-
-fi
-
-
-
-for ac_header in getopt.h time.h
-do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-# MinGW32 tests
-for ac_header in winsock2.h ws2tcpip.h
-do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-# end mingw32 tests
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Werror" >&5
-$as_echo_n "checking whether $CC supports -Werror... " >&6; }
-cache=`echo Werror | sed 'y%.=/+-%___p_%'`
-if eval \${cv_prog_cc_flag_$cache+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
-echo 'void f(){}' >conftest.c
-if test -z "`$CC $CPPFLAGS $CFLAGS -Werror -c conftest.c 2>&1`"; then
-eval "cv_prog_cc_flag_$cache=yes"
-else
-eval "cv_prog_cc_flag_$cache=no"
-fi
-rm -f conftest conftest.o conftest.c
-
-fi
-
-if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-:
-ERRFLAG="-Werror"
-else
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-:
-ERRFLAG="-errwarn"
-fi
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wall" >&5
-$as_echo_n "checking whether $CC supports -Wall... " >&6; }
-cache=`echo Wall | sed 'y%.=/+-%___p_%'`
-if eval \${cv_prog_cc_flag_$cache+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
-echo 'void f(){}' >conftest.c
-if test -z "`$CC $CPPFLAGS $CFLAGS -Wall -c conftest.c 2>&1`"; then
-eval "cv_prog_cc_flag_$cache=yes"
-else
-eval "cv_prog_cc_flag_$cache=no"
-fi
-rm -f conftest conftest.o conftest.c
-
-fi
-
-if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-:
-ERRFLAG="$ERRFLAG -Wall"
-else
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-:
-ERRFLAG="$ERRFLAG -errfmt"
-fi
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -std=c99" >&5
-$as_echo_n "checking whether $CC supports -std=c99... " >&6; }
-cache=`echo std=c99 | sed 'y%.=/+-%___p_%'`
-if eval \${cv_prog_cc_flag_$cache+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
-echo 'void f(){}' >conftest.c
-if test -z "`$CC $CPPFLAGS $CFLAGS -std=c99 -c conftest.c 2>&1`"; then
-eval "cv_prog_cc_flag_$cache=yes"
-else
-eval "cv_prog_cc_flag_$cache=no"
-fi
-rm -f conftest conftest.o conftest.c
-
-fi
-
-if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-:
-C99FLAG="-std=c99"
-else
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-:
-
-fi
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -xc99" >&5
-$as_echo_n "checking whether $CC supports -xc99... " >&6; }
-cache=`echo xc99 | sed 'y%.=/+-%___p_%'`
-if eval \${cv_prog_cc_flag_$cache+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
-echo 'void f(){}' >conftest.c
-if test -z "`$CC $CPPFLAGS $CFLAGS -xc99 -c conftest.c 2>&1`"; then
-eval "cv_prog_cc_flag_$cache=yes"
-else
-eval "cv_prog_cc_flag_$cache=no"
-fi
-rm -f conftest conftest.o conftest.c
-
-fi
-
-if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-:
-C99FLAG="-xc99"
-else
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-:
-
-fi
-
-
-for ac_header in getopt.h time.h
-do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE as a flag for $CC" >&5
-$as_echo_n "checking whether we need $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE as a flag for $CC... " >&6; }
-cache=`$as_echo "$C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE" | $as_tr_sh`
-if eval \${cv_prog_cc_flag_needed_$cache+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
-echo '
-#include "confdefs.h"
-#include <stdlib.h>
-#include <ctype.h>
-#include <sys/time.h>
-#ifdef HAVE_TIME_H
-#include <time.h>
-#endif
-#include <unistd.h>
-#include <netdb.h>
-#ifdef HAVE_GETOPT_H
-#include <getopt.h>
-#endif
-
-int test() {
- int a;
- char **opts = NULL;
- struct timeval tv;
- char *t;
- time_t time = 0;
- char *buf = NULL;
- const char* str = NULL;
- struct msghdr msg;
- msg.msg_control = 0;
- t = ctime_r(&time, buf);
- tv.tv_usec = 10;
- srandom(32);
- a = getopt(2, opts, "a");
- a = isascii(32);
- str = gai_strerror(0);
- if(str && t && tv.tv_usec && msg.msg_control)
- a = 0;
- return a;
-}
-' > conftest.c
-echo 'void f(){}' >>conftest.c
-if test -z "`$CC $CPPFLAGS $CFLAGS $ERRFLAG -c conftest.c 2>&1`"; then
-eval "cv_prog_cc_flag_needed_$cache=no"
-else
-
-if test -z "`$CC $CPPFLAGS $CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE $ERRFLAG -c conftest.c 2>&1`"; then
-eval "cv_prog_cc_flag_needed_$cache=yes"
-else
-eval "cv_prog_cc_flag_needed_$cache=fail"
-#echo 'Test with flag fails too!'
-#cat conftest.c
-#echo "$CC $CPPFLAGS $CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE $ERRFLAG -c conftest.c 2>&1"
-#echo `$CC $CPPFLAGS $CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE $ERRFLAG -c conftest.c 2>&1`
-#exit 1
-fi
-
-fi
-rm -f conftest conftest.c conftest.o
-
-fi
-
-if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = yes"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-:
-CFLAGS="$CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE"
-else
-if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = no"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-#echo 'Test with flag is no!'
-#cat conftest.c
-#echo "$CC $CPPFLAGS $CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE $ERRFLAG -c conftest.c 2>&1"
-#echo `$CC $CPPFLAGS $CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE $ERRFLAG -c conftest.c 2>&1`
-#exit 1
-:
-
-else
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
-$as_echo "failed" >&6; }
-:
-
-fi
-fi
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE as a flag for $CC" >&5
-$as_echo_n "checking whether we need $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE as a flag for $CC... " >&6; }
-cache=`$as_echo "$C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE" | $as_tr_sh`
-if eval \${cv_prog_cc_flag_needed_$cache+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
-echo '
-#include "confdefs.h"
-#include <stdlib.h>
-#include <ctype.h>
-#include <sys/time.h>
-#ifdef HAVE_TIME_H
-#include <time.h>
-#endif
-#include <unistd.h>
-#include <netdb.h>
-#ifdef HAVE_GETOPT_H
-#include <getopt.h>
-#endif
-
-int test() {
- int a;
- char **opts = NULL;
- struct timeval tv;
- char *t;
- time_t time = 0;
- char *buf = NULL;
- const char* str = NULL;
- struct msghdr msg;
- msg.msg_control = 0;
- t = ctime_r(&time, buf);
- tv.tv_usec = 10;
- srandom(32);
- a = getopt(2, opts, "a");
- a = isascii(32);
- str = gai_strerror(0);
- if(str && t && tv.tv_usec && msg.msg_control)
- a = 0;
- return a;
-}
-' > conftest.c
-echo 'void f(){}' >>conftest.c
-if test -z "`$CC $CPPFLAGS $CFLAGS $ERRFLAG -c conftest.c 2>&1`"; then
-eval "cv_prog_cc_flag_needed_$cache=no"
-else
-
-if test -z "`$CC $CPPFLAGS $CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE $ERRFLAG -c conftest.c 2>&1`"; then
-eval "cv_prog_cc_flag_needed_$cache=yes"
-else
-eval "cv_prog_cc_flag_needed_$cache=fail"
-#echo 'Test with flag fails too!'
-#cat conftest.c
-#echo "$CC $CPPFLAGS $CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE $ERRFLAG -c conftest.c 2>&1"
-#echo `$CC $CPPFLAGS $CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE $ERRFLAG -c conftest.c 2>&1`
-#exit 1
-fi
-
-fi
-rm -f conftest conftest.c conftest.o
-
-fi
-
-if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = yes"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-:
-CFLAGS="$CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE"
-else
-if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = no"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-#echo 'Test with flag is no!'
-#cat conftest.c
-#echo "$CC $CPPFLAGS $CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE $ERRFLAG -c conftest.c 2>&1"
-#echo `$CC $CPPFLAGS $CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE $ERRFLAG -c conftest.c 2>&1`
-#exit 1
-:
-
-else
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
-$as_echo "failed" >&6; }
-:
-
-fi
-fi
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need $C99FLAG as a flag for $CC" >&5
-$as_echo_n "checking whether we need $C99FLAG as a flag for $CC... " >&6; }
-cache=`$as_echo "$C99FLAG" | $as_tr_sh`
-if eval \${cv_prog_cc_flag_needed_$cache+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
-echo '
-#include <stdbool.h>
-#include <ctype.h>
-int test() {
- int a = 0;
- return a;
-}
-' > conftest.c
-echo 'void f(){}' >>conftest.c
-if test -z "`$CC $CPPFLAGS $CFLAGS $ERRFLAG -c conftest.c 2>&1`"; then
-eval "cv_prog_cc_flag_needed_$cache=no"
-else
-
-if test -z "`$CC $CPPFLAGS $CFLAGS $C99FLAG $ERRFLAG -c conftest.c 2>&1`"; then
-eval "cv_prog_cc_flag_needed_$cache=yes"
-else
-eval "cv_prog_cc_flag_needed_$cache=fail"
-#echo 'Test with flag fails too!'
-#cat conftest.c
-#echo "$CC $CPPFLAGS $CFLAGS $C99FLAG $ERRFLAG -c conftest.c 2>&1"
-#echo `$CC $CPPFLAGS $CFLAGS $C99FLAG $ERRFLAG -c conftest.c 2>&1`
-#exit 1
-fi
-
-fi
-rm -f conftest conftest.c conftest.o
-
-fi
-
-if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = yes"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-:
-CFLAGS="$CFLAGS $C99FLAG"
-else
-if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = no"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-#echo 'Test with flag is no!'
-#cat conftest.c
-#echo "$CC $CPPFLAGS $CFLAGS $C99FLAG $ERRFLAG -c conftest.c 2>&1"
-#echo `$CC $CPPFLAGS $CFLAGS $C99FLAG $ERRFLAG -c conftest.c 2>&1`
-#exit 1
-:
-
-else
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
-$as_echo "failed" >&6; }
-:
-
-fi
-fi
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need -D_BSD_SOURCE as a flag for $CC" >&5
-$as_echo_n "checking whether we need -D_BSD_SOURCE as a flag for $CC... " >&6; }
-cache=_D_BSD_SOURCE
-if eval \${cv_prog_cc_flag_needed_$cache+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
-echo '
-#include <ctype.h>
-
-int test() {
- int a;
- a = isascii(32);
- return a;
-}
-' > conftest.c
-echo 'void f(){}' >>conftest.c
-if test -z "`$CC $CPPFLAGS $CFLAGS $ERRFLAG -c conftest.c 2>&1`"; then
-eval "cv_prog_cc_flag_needed_$cache=no"
-else
-
-if test -z "`$CC $CPPFLAGS $CFLAGS -D_BSD_SOURCE $ERRFLAG -c conftest.c 2>&1`"; then
-eval "cv_prog_cc_flag_needed_$cache=yes"
-else
-eval "cv_prog_cc_flag_needed_$cache=fail"
-#echo 'Test with flag fails too!'
-#cat conftest.c
-#echo "$CC $CPPFLAGS $CFLAGS -D_BSD_SOURCE $ERRFLAG -c conftest.c 2>&1"
-#echo `$CC $CPPFLAGS $CFLAGS -D_BSD_SOURCE $ERRFLAG -c conftest.c 2>&1`
-#exit 1
-fi
-
-fi
-rm -f conftest conftest.c conftest.o
-
-fi
-
-if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = yes"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-:
-CFLAGS="$CFLAGS -D_BSD_SOURCE"
-else
-if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = no"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-#echo 'Test with flag is no!'
-#cat conftest.c
-#echo "$CC $CPPFLAGS $CFLAGS -D_BSD_SOURCE $ERRFLAG -c conftest.c 2>&1"
-#echo `$CC $CPPFLAGS $CFLAGS -D_BSD_SOURCE $ERRFLAG -c conftest.c 2>&1`
-#exit 1
-:
-
-else
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
-$as_echo "failed" >&6; }
-:
-
-fi
-fi
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need -D_GNU_SOURCE as a flag for $CC" >&5
-$as_echo_n "checking whether we need -D_GNU_SOURCE as a flag for $CC... " >&6; }
-cache=_D_GNU_SOURCE
-if eval \${cv_prog_cc_flag_needed_$cache+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
-echo '
-#include <netinet/in.h>
-
-int test() {
- struct in6_pktinfo inf;
- int a = (int)sizeof(inf);
- return a;
-}
-' > conftest.c
-echo 'void f(){}' >>conftest.c
-if test -z "`$CC $CPPFLAGS $CFLAGS $ERRFLAG -c conftest.c 2>&1`"; then
-eval "cv_prog_cc_flag_needed_$cache=no"
-else
-
-if test -z "`$CC $CPPFLAGS $CFLAGS -D_GNU_SOURCE $ERRFLAG -c conftest.c 2>&1`"; then
-eval "cv_prog_cc_flag_needed_$cache=yes"
-else
-eval "cv_prog_cc_flag_needed_$cache=fail"
-#echo 'Test with flag fails too!'
-#cat conftest.c
-#echo "$CC $CPPFLAGS $CFLAGS -D_GNU_SOURCE $ERRFLAG -c conftest.c 2>&1"
-#echo `$CC $CPPFLAGS $CFLAGS -D_GNU_SOURCE $ERRFLAG -c conftest.c 2>&1`
-#exit 1
-fi
-
-fi
-rm -f conftest conftest.c conftest.o
-
-fi
-
-if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = yes"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-:
-CFLAGS="$CFLAGS -D_GNU_SOURCE"
-else
-if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = no"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-#echo 'Test with flag is no!'
-#cat conftest.c
-#echo "$CC $CPPFLAGS $CFLAGS -D_GNU_SOURCE $ERRFLAG -c conftest.c 2>&1"
-#echo `$CC $CPPFLAGS $CFLAGS -D_GNU_SOURCE $ERRFLAG -c conftest.c 2>&1`
-#exit 1
-:
-
-else
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
-$as_echo "failed" >&6; }
-:
-
-fi
-fi
-
-
-# check again for GNU_SOURCE for setresgid. May fail if setresgid
-# is not available at all. -D_FRSRESGID is to make this check unique.
-# otherwise we would get the previous cached result.
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need -D_GNU_SOURCE -D_FRSRESGID as a flag for $CC" >&5
-$as_echo_n "checking whether we need -D_GNU_SOURCE -D_FRSRESGID as a flag for $CC... " >&6; }
-cache=_D_GNU_SOURCE__D_FRSRESGID
-if eval \${cv_prog_cc_flag_needed_$cache+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
-echo '
-#include <unistd.h>
-
-int test() {
- int a = setresgid(0,0,0);
- a = setresuid(0,0,0);
- return a;
-}
-' > conftest.c
-echo 'void f(){}' >>conftest.c
-if test -z "`$CC $CPPFLAGS $CFLAGS $ERRFLAG -c conftest.c 2>&1`"; then
-eval "cv_prog_cc_flag_needed_$cache=no"
-else
-
-if test -z "`$CC $CPPFLAGS $CFLAGS -D_GNU_SOURCE -D_FRSRESGID $ERRFLAG -c conftest.c 2>&1`"; then
-eval "cv_prog_cc_flag_needed_$cache=yes"
-else
-eval "cv_prog_cc_flag_needed_$cache=fail"
-#echo 'Test with flag fails too!'
-#cat conftest.c
-#echo "$CC $CPPFLAGS $CFLAGS -D_GNU_SOURCE -D_FRSRESGID $ERRFLAG -c conftest.c 2>&1"
-#echo `$CC $CPPFLAGS $CFLAGS -D_GNU_SOURCE -D_FRSRESGID $ERRFLAG -c conftest.c 2>&1`
-#exit 1
-fi
-
-fi
-rm -f conftest conftest.c conftest.o
-
-fi
-
-if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = yes"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-:
-CFLAGS="$CFLAGS -D_GNU_SOURCE"
-else
-if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = no"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-#echo 'Test with flag is no!'
-#cat conftest.c
-#echo "$CC $CPPFLAGS $CFLAGS -D_GNU_SOURCE -D_FRSRESGID $ERRFLAG -c conftest.c 2>&1"
-#echo `$CC $CPPFLAGS $CFLAGS -D_GNU_SOURCE -D_FRSRESGID $ERRFLAG -c conftest.c 2>&1`
-#exit 1
-:
-
-else
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
-$as_echo "failed" >&6; }
-:
-
-fi
-fi
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need -D_POSIX_C_SOURCE=200112 as a flag for $CC" >&5
-$as_echo_n "checking whether we need -D_POSIX_C_SOURCE=200112 as a flag for $CC... " >&6; }
-cache=`$as_echo "-D_POSIX_C_SOURCE=200112" | $as_tr_sh`
-if eval \${cv_prog_cc_flag_needed_$cache+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
-echo '
-#include "confdefs.h"
-#ifdef HAVE_TIME_H
-#include <time.h>
-#endif
-#include <netdb.h>
-
-int test() {
- int a = 0;
- char *t;
- time_t time = 0;
- char *buf = NULL;
- const char* str = NULL;
- t = ctime_r(&time, buf);
- str = gai_strerror(0);
- if(t && str)
- a = 0;
- return a;
-}
-' > conftest.c
-echo 'void f(){}' >>conftest.c
-if test -z "`$CC $CPPFLAGS $CFLAGS $ERRFLAG -c conftest.c 2>&1`"; then
-eval "cv_prog_cc_flag_needed_$cache=no"
-else
-
-if test -z "`$CC $CPPFLAGS $CFLAGS -D_POSIX_C_SOURCE=200112 $ERRFLAG -c conftest.c 2>&1`"; then
-eval "cv_prog_cc_flag_needed_$cache=yes"
-else
-eval "cv_prog_cc_flag_needed_$cache=fail"
-#echo 'Test with flag fails too!'
-#cat conftest.c
-#echo "$CC $CPPFLAGS $CFLAGS -D_POSIX_C_SOURCE=200112 $ERRFLAG -c conftest.c 2>&1"
-#echo `$CC $CPPFLAGS $CFLAGS -D_POSIX_C_SOURCE=200112 $ERRFLAG -c conftest.c 2>&1`
-#exit 1
-fi
-
-fi
-rm -f conftest conftest.c conftest.o
-
-fi
-
-if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = yes"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-:
-CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=200112"
-else
-if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = no"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-#echo 'Test with flag is no!'
-#cat conftest.c
-#echo "$CC $CPPFLAGS $CFLAGS -D_POSIX_C_SOURCE=200112 $ERRFLAG -c conftest.c 2>&1"
-#echo `$CC $CPPFLAGS $CFLAGS -D_POSIX_C_SOURCE=200112 $ERRFLAG -c conftest.c 2>&1`
-#exit 1
-:
-
-else
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
-$as_echo "failed" >&6; }
-:
-
-fi
-fi
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need -D__EXTENSIONS__ as a flag for $CC" >&5
-$as_echo_n "checking whether we need -D__EXTENSIONS__ as a flag for $CC... " >&6; }
-cache=_D__EXTENSIONS__
-if eval \${cv_prog_cc_flag_needed_$cache+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
-echo '
-#include "confdefs.h"
-#include <stdlib.h>
-#include <ctype.h>
-#include <sys/time.h>
-#ifdef HAVE_TIME_H
-#include <time.h>
-#endif
-#include <unistd.h>
-#ifdef HAVE_GETOPT_H
-#include <getopt.h>
-#endif
-
-int test() {
- int a;
- char **opts = NULL;
- struct timeval tv;
- tv.tv_usec = 10;
- srandom(32);
- a = getopt(2, opts, "a");
- a = isascii(32);
- if(tv.tv_usec)
- a = 0;
- return a;
-}
-' > conftest.c
-echo 'void f(){}' >>conftest.c
-if test -z "`$CC $CPPFLAGS $CFLAGS $ERRFLAG -c conftest.c 2>&1`"; then
-eval "cv_prog_cc_flag_needed_$cache=no"
-else
-
-if test -z "`$CC $CPPFLAGS $CFLAGS -D__EXTENSIONS__ $ERRFLAG -c conftest.c 2>&1`"; then
-eval "cv_prog_cc_flag_needed_$cache=yes"
-else
-eval "cv_prog_cc_flag_needed_$cache=fail"
-#echo 'Test with flag fails too!'
-#cat conftest.c
-#echo "$CC $CPPFLAGS $CFLAGS -D__EXTENSIONS__ $ERRFLAG -c conftest.c 2>&1"
-#echo `$CC $CPPFLAGS $CFLAGS -D__EXTENSIONS__ $ERRFLAG -c conftest.c 2>&1`
-#exit 1
-fi
-
-fi
-rm -f conftest conftest.c conftest.o
-
-fi
-
-if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = yes"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-:
-CFLAGS="$CFLAGS -D__EXTENSIONS__"
-else
-if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = no"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-#echo 'Test with flag is no!'
-#cat conftest.c
-#echo "$CC $CPPFLAGS $CFLAGS -D__EXTENSIONS__ $ERRFLAG -c conftest.c 2>&1"
-#echo `$CC $CPPFLAGS $CFLAGS -D__EXTENSIONS__ $ERRFLAG -c conftest.c 2>&1`
-#exit 1
-:
-
-else
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
-$as_echo "failed" >&6; }
-:
-
-fi
-fi
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
-$as_echo_n "checking for inline... " >&6; }
-if ${ac_cv_c_inline+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_c_inline=no
-for ac_kw in inline __inline__ __inline; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifndef __cplusplus
-typedef int foo_t;
-static $ac_kw foo_t static_foo () {return 0; }
-$ac_kw foo_t foo () {return 0; }
-#endif
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_c_inline=$ac_kw
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- test "$ac_cv_c_inline" != no && break
-done
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
-$as_echo "$ac_cv_c_inline" >&6; }
-
-case $ac_cv_c_inline in
- inline | yes) ;;
- *)
- case $ac_cv_c_inline in
- no) ac_val=;;
- *) ac_val=$ac_cv_c_inline;;
- esac
- cat >>confdefs.h <<_ACEOF
-#ifndef __cplusplus
-#define inline $ac_val
-#endif
-_ACEOF
- ;;
-esac
-
-ac_fn_c_check_type "$LINENO" "int8_t" "ac_cv_type_int8_t" "$ac_includes_default"
-if test "x$ac_cv_type_int8_t" = xyes; then :
-
-else
-
-cat >>confdefs.h <<_ACEOF
-#define int8_t char
-_ACEOF
-
-fi
-
-ac_fn_c_check_type "$LINENO" "int16_t" "ac_cv_type_int16_t" "$ac_includes_default"
-if test "x$ac_cv_type_int16_t" = xyes; then :
-
-else
-
-cat >>confdefs.h <<_ACEOF
-#define int16_t short
-_ACEOF
-
-fi
-
-ac_fn_c_check_type "$LINENO" "int32_t" "ac_cv_type_int32_t" "$ac_includes_default"
-if test "x$ac_cv_type_int32_t" = xyes; then :
-
-else
-
-cat >>confdefs.h <<_ACEOF
-#define int32_t int
-_ACEOF
-
-fi
-
-ac_fn_c_check_type "$LINENO" "int64_t" "ac_cv_type_int64_t" "$ac_includes_default"
-if test "x$ac_cv_type_int64_t" = xyes; then :
-
-else
-
-cat >>confdefs.h <<_ACEOF
-#define int64_t long long
-_ACEOF
-
-fi
-
-ac_fn_c_check_type "$LINENO" "uint8_t" "ac_cv_type_uint8_t" "$ac_includes_default"
-if test "x$ac_cv_type_uint8_t" = xyes; then :
-
-else
-
-cat >>confdefs.h <<_ACEOF
-#define uint8_t unsigned char
-_ACEOF
-
-fi
-
-ac_fn_c_check_type "$LINENO" "uint16_t" "ac_cv_type_uint16_t" "$ac_includes_default"
-if test "x$ac_cv_type_uint16_t" = xyes; then :
-
-else
-
-cat >>confdefs.h <<_ACEOF
-#define uint16_t unsigned short
-_ACEOF
-
-fi
-
-ac_fn_c_check_type "$LINENO" "uint32_t" "ac_cv_type_uint32_t" "$ac_includes_default"
-if test "x$ac_cv_type_uint32_t" = xyes; then :
-
-else
-
-cat >>confdefs.h <<_ACEOF
-#define uint32_t unsigned int
-_ACEOF
-
-fi
-
-ac_fn_c_check_type "$LINENO" "uint64_t" "ac_cv_type_uint64_t" "$ac_includes_default"
-if test "x$ac_cv_type_uint64_t" = xyes; then :
-
-else
-
-cat >>confdefs.h <<_ACEOF
-#define uint64_t unsigned long long
-_ACEOF
-
-fi
-
-
-# my own checks
-# Extract the first word of "doxygen", so it can be a program name with args.
-set dummy doxygen; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_doxygen+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$doxygen"; then
- ac_cv_prog_doxygen="$doxygen" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- 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="doxygen"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-doxygen=$ac_cv_prog_doxygen
-if test -n "$doxygen"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $doxygen" >&5
-$as_echo "$doxygen" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-
-# check to see if libraries are needed for these functions.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5
-$as_echo_n "checking for library containing socket... " >&6; }
-if ${ac_cv_search_socket+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char socket ();
-int
-main ()
-{
-return socket ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' socket; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_socket=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_socket+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_socket+:} false; then :
-
-else
- ac_cv_search_socket=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5
-$as_echo "$ac_cv_search_socket" >&6; }
-ac_res=$ac_cv_search_socket
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_pton" >&5
-$as_echo_n "checking for library containing inet_pton... " >&6; }
-if ${ac_cv_search_inet_pton+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char inet_pton ();
-int
-main ()
-{
-return inet_pton ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' nsl; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_inet_pton=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_inet_pton+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_inet_pton+:} false; then :
-
-else
- ac_cv_search_inet_pton=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_pton" >&5
-$as_echo "$ac_cv_search_inet_pton" >&6; }
-ac_res=$ac_cv_search_inet_pton
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-fi
-
-
-
-
-# Check whether --with-drill was given.
-if test "${with_drill+set}" = set; then :
- withval=$with_drill;
-else
- with_drill="no"
-fi
-
-if test x_$with_drill != x_no ; then
- DRILL=drill
-
- INSTALL_DRILL=install-drill
-
- UNINSTALL_DRILL=uninstall-drill
-
- CLEAN_DRILL=clean-drill
-
- LINT_DRILL=lint-drill
-
- if test -e $srcdir/drill/config.h -o -e drill/config.h ; then
- as_fn_error $? "
-A config.h was detected in the drill subdirectory.
-This does not work with the --with-drill option.
-Please remove the config.h from the drill subdirectory
-or do not use the --with-drill option." "$LINENO" 5
- fi
- DRILL_CONFIG=" drill/drill.1"
-else
- DRILL=""
-
- INSTALL_DRILL=""
-
- UNINSTALL_DRILL=""
-
- CLEAN_DRILL=""
-
- LINT_DRILL=""
-
- DRILL_CONFIG=""
-fi
-
-
-
-# Check whether --with-examples was given.
-if test "${with_examples+set}" = set; then :
- withval=$with_examples;
-else
- with_examples="no"
-fi
-
-if test x_$with_examples != x_no ; then
- EXAMPLES=examples
-
- INSTALL_EXAMPLES=install-examples
-
- UNINSTALL_EXAMPLES=uninstall-examples
-
- CLEAN_EXAMPLES=clean-examples
-
- LINT_EXAMPLES=lint-examples
-
- if test -e $srcdir/examples/config.h -o -e examples/config.h ; then
- as_fn_error $? "
-A config.h was detected in the examples subdirectory.
-This does not work with the --with-examples option.
-Please remove the config.h from the examples subdirectory
-or do not use the --with-examples option." "$LINENO" 5
- fi
- EXAMPLES_CONFIG=" examples/ldns-dane.1 examples/ldns-verify-zone.1"
-else
- EXAMPLES=""
-
- INSTALL_EXAMPLES=""
-
- UNINSTALL_EXAMPLES=""
-
- CLEAN_EXAMPLES=""
-
- LINT_EXAMPLES=""
-
- EXAMPLES_CONFIG=""
-fi
-
-# add option to disable installation of ldns-config script
-# Check whether --enable-ldns-config was given.
-if test "${enable_ldns_config+set}" = set; then :
- enableval=$enable_ldns_config; enable_ldns_config=$enableval
-else
- enable_ldns_config=yes
-fi
-
-if test "x$enable_ldns_config" = xyes; then
- INSTALL_CONFIG=install-config
-
- INSTALL_CONFIG_MANPAGE=install-config-manpage
-
- UNINSTALL_CONFIG=uninstall-config
-
- UNINSTALL_CONFIG_MANPAGE=uninstall-config-manpage
-
-else
- INSTALL_CONFIG=""
-
- INSTALL_CONFIG_MANPAGE=""
-
- UNINSTALL_CONFIG=""
-
- UNINSTALL_CONFIG_MANPAGE=""
-
-fi
-
-# check for python
-PYTHON_X_CFLAGS=""
-ldns_with_pyldns=no
-ldns_with_pyldnsx=no
-
-# Check whether --with-pyldns was given.
-if test "${with_pyldns+set}" = set; then :
- withval=$with_pyldns;
-else
- withval="no"
-fi
-
-ldns_have_python=no
-if test x_$withval != x_no; then
- # ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_python_devel.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_PYTHON_DEVEL([version])
-#
-# DESCRIPTION
-#
-# Note: Defines as a precious variable "PYTHON_VERSION". Don't override it
-# in your configure.ac.
-#
-# This macro checks for Python and tries to get the include path to
-# 'Python.h'. It provides the $(PYTHON_CPPFLAGS) and $(PYTHON_LDFLAGS)
-# output variables. It also exports $(PYTHON_EXTRA_LIBS) and
-# $(PYTHON_EXTRA_LDFLAGS) for embedding Python in your code.
-#
-# You can search for some particular version of Python by passing a
-# parameter to this macro, for example ">= '2.3.1'", or "== '2.4'". Please
-# note that you *have* to pass also an operator along with the version to
-# match, and pay special attention to the single quotes surrounding the
-# version number. Don't use "PYTHON_VERSION" for this: that environment
-# variable is declared as precious and thus reserved for the end-user.
-#
-# This macro should work for all versions of Python >= 2.1.0. As an end
-# user, you can disable the check for the python version by setting the
-# PYTHON_NOVERSIONCHECK environment variable to something else than the
-# empty string.
-#
-# If you need to use this macro for an older Python version, please
-# contact the authors. We're always open for feedback.
-#
-# LICENSE
-#
-# Copyright (c) 2009 Sebastian Huber <sebastian-huber@web.de>
-# Copyright (c) 2009 Alan W. Irwin <irwin@beluga.phys.uvic.ca>
-# Copyright (c) 2009 Rafael Laboissiere <rafael@laboissiere.net>
-# Copyright (c) 2009 Andrew Collier <colliera@ukzn.ac.za>
-# Copyright (c) 2009 Matteo Settenvini <matteo@member.fsf.org>
-# Copyright (c) 2009 Horst Knorr <hk_classes@knoda.org>
-#
-# This program is free software: you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation, either version 3 of the License, or (at your
-# option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
-# Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception, the respective Autoconf Macro's copyright owner
-# gives unlimited permission to copy, distribute and modify the configure
-# scripts that are the output of Autoconf when processing the Macro. You
-# need not follow the terms of the GNU General Public License when using
-# or distributing such scripts, even though portions of the text of the
-# Macro appear in them. The GNU General Public License (GPL) does govern
-# all other use of the material that constitutes the Autoconf Macro.
-#
-# This special exception to the GPL applies to versions of the Autoconf
-# Macro released by the Autoconf Archive. When you make and distribute a
-# modified version of the Autoconf Macro, you may extend this special
-# exception to the GPL to apply to your modified version as well.
-
-#serial 8
-
-# This is what autoupdate's m4 run will expand. It fires
-# the warning (with _au_warn_XXX), outputs it into the
-# updated configure.ac (with AC_DIAGNOSE), and then outputs
-# the replacement expansion.
-
-
-# This is an auxiliary macro that is also run when
-# autoupdate runs m4. It simply calls m4_warning, but
-# we need a wrapper so that each warning is emitted only
-# once. We break the quoting in m4_warning's argument in
-# order to expand this macro's arguments, not AU_DEFUN's.
-
-
-# Finally, this is the expansion that is picked up by
-# autoconf. It tells the user to run autoupdate, and
-# then outputs the replacement expansion. We do not care
-# about autoupdate's warning because that contains
-# information on what to do *after* running autoupdate.
-
-
-
- ac_save_LIBS="$LIBS"
-
- #
- # Allow the use of a (user set) custom python version
- #
-
-
- # Extract the first word of "python[$PYTHON_VERSION]", so it can be a program name with args.
-set dummy python$PYTHON_VERSION; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_PYTHON+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $PYTHON in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-PYTHON=$ac_cv_path_PYTHON
-if test -n "$PYTHON"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5
-$as_echo "$PYTHON" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- if test -z "$PYTHON"; then
- as_fn_error $? "Cannot find python$PYTHON_VERSION in your system path" "$LINENO" 5
- PYTHON_VERSION=""
- fi
-
- #
- # Check for a version of Python >= 2.1.0
- #
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a version of Python >= '2.1.0'" >&5
-$as_echo_n "checking for a version of Python >= '2.1.0'... " >&6; }
- ac_supports_python_ver=`$PYTHON -c "import sys; \
- ver = sys.version.split ()[0]; \
- print (ver >= '2.1.0')"`
- if test "$ac_supports_python_ver" != "True"; then
- if test -z "$PYTHON_NOVERSIONCHECK"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "
-This version of the AC_PYTHON_DEVEL macro
-doesn't work properly with versions of Python before
-2.1.0. You may need to re-run configure, setting the
-variables PYTHON_CPPFLAGS, PYTHON_LDFLAGS, PYTHON_SITE_PKG,
-PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand.
-Moreover, to disable this check, set PYTHON_NOVERSIONCHECK
-to something else than an empty string.
-
-See \`config.log' for more details" "$LINENO" 5; }
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: skip at user request" >&5
-$as_echo "skip at user request" >&6; }
- fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- fi
-
- #
- # if the macro parameter ``version'' is set, honour it
- #
- if test -n ">= '2.4.0'"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a version of Python >= '2.4.0'" >&5
-$as_echo_n "checking for a version of Python >= '2.4.0'... " >&6; }
- ac_supports_python_ver=`$PYTHON -c "import sys; \
- ver = sys.version.split ()[0]; \
- print (ver >= '2.4.0')"`
- if test "$ac_supports_python_ver" = "True"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- as_fn_error $? "this package requires Python >= '2.4.0'.
-If you have it installed, but it isn't the default Python
-interpreter in your system path, please pass the PYTHON_VERSION
-variable to configure. See \`\`configure --help'' for reference.
-" "$LINENO" 5
- PYTHON_VERSION=""
- fi
- fi
-
- #
- # Check if you have distutils, else fail
- #
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the distutils Python package" >&5
-$as_echo_n "checking for the distutils Python package... " >&6; }
- ac_distutils_result=`$PYTHON -c "import distutils" 2>&1`
- if test -z "$ac_distutils_result"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- as_fn_error $? "cannot import Python module \"distutils\".
-Please check your Python installation. The error was:
-$ac_distutils_result" "$LINENO" 5
- PYTHON_VERSION=""
- fi
-
- #
- # Check for Python include path
- #
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python include path" >&5
-$as_echo_n "checking for Python include path... " >&6; }
- if test -z "$PYTHON_CPPFLAGS"; then
- python_path=`$PYTHON -c "import distutils.sysconfig; \
- print (distutils.sysconfig.get_python_inc ());"`
- if test -n "${python_path}"; then
- python_path="-I$python_path"
- fi
- PYTHON_CPPFLAGS=$python_path
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_CPPFLAGS" >&5
-$as_echo "$PYTHON_CPPFLAGS" >&6; }
-
-
- #
- # Check for Python library path
- #
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python library path" >&5
-$as_echo_n "checking for Python library path... " >&6; }
- if test -z "$PYTHON_LDFLAGS"; then
- # (makes two attempts to ensure we've got a version number
- # from the interpreter)
- ac_python_version=`cat<<EOD | $PYTHON -
-
-# join all versioning strings, on some systems
-# major/minor numbers could be in different list elements
-from distutils.sysconfig import *
-ret = ''
-for e in get_config_vars ('VERSION'):
- if (e != None):
- ret += e
-print (ret)
-EOD
-`
-
- if test -z "$ac_python_version"; then
- if test -n "$PYTHON_VERSION"; then
- ac_python_version=$PYTHON_VERSION
- else
- ac_python_version=`$PYTHON -c "import sys; \
- print (sys.version[:3])"`
- fi
- fi
-
- # Make the versioning information available to the compiler
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_PYTHON "$ac_python_version"
-_ACEOF
-
-
- # First, the library directory:
- ac_python_libdir=`cat<<EOD | $PYTHON -
-
-# There should be only one
-import distutils.sysconfig
-for e in distutils.sysconfig.get_config_vars ('LIBDIR'):
- if e != None:
- print (e)
- break
-EOD
-`
-
- # Before checking for libpythonX.Y, we need to know
- # the extension the OS we're on uses for libraries
- # (we take the first one, if there's more than one fix me!):
- ac_python_soext=`$PYTHON -c \
- "import distutils.sysconfig; \
- print (distutils.sysconfig.get_config_vars('SO')[0])"`
-
- # Now, for the library:
- ac_python_soname=`$PYTHON -c \
- "import distutils.sysconfig; \
- print (distutils.sysconfig.get_config_vars('LDLIBRARY')[0])"`
-
- # Strip away extension from the end to canonicalize its name:
- ac_python_library=`echo "$ac_python_soname" | sed "s/${ac_python_soext}$//"`
-
- # This small piece shamelessly adapted from PostgreSQL python macro;
- # credits goes to momjian, I think. I'd like to put the right name
- # in the credits, if someone can point me in the right direction... ?
- #
- if test -n "$ac_python_libdir" -a -n "$ac_python_library" \
- -a x"$ac_python_library" != x"$ac_python_soname"
- then
- # use the official shared library
- ac_python_library=`echo "$ac_python_library" | sed "s/^lib//"`
- PYTHON_LDFLAGS="-L$ac_python_libdir -l$ac_python_library"
- else
- # old way: use libpython from python_configdir
- ac_python_libdir=`$PYTHON -c \
- "from distutils.sysconfig import get_python_lib as f; \
- import os; \
- print (os.path.join(f(plat_specific=1, standard_lib=1), 'config'));"`
- PYTHON_LDFLAGS="-L$ac_python_libdir -lpython$ac_python_version"
- fi
-
- if test -z "PYTHON_LDFLAGS"; then
- as_fn_error $? "
- Cannot determine location of your Python DSO. Please check it was installed with
- dynamic libraries enabled, or try setting PYTHON_LDFLAGS by hand.
- " "$LINENO" 5
- fi
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_LDFLAGS" >&5
-$as_echo "$PYTHON_LDFLAGS" >&6; }
-
-
- #
- # Check for site packages
- #
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python site-packages path" >&5
-$as_echo_n "checking for Python site-packages path... " >&6; }
- if test -z "$PYTHON_SITE_PKG"; then
- PYTHON_SITE_PKG=`$PYTHON -c "import distutils.sysconfig; \
- print (distutils.sysconfig.get_python_lib(1,0));"`
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_SITE_PKG" >&5
-$as_echo "$PYTHON_SITE_PKG" >&6; }
-
-
- #
- # libraries which must be linked in when embedding
- #
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking python extra libraries" >&5
-$as_echo_n "checking python extra libraries... " >&6; }
- if test -z "$PYTHON_EXTRA_LIBS"; then
- PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \
- conf = distutils.sysconfig.get_config_var; \
- print (conf('LOCALMODLIBS') + ' ' + conf('LIBS'))"`
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_EXTRA_LIBS" >&5
-$as_echo "$PYTHON_EXTRA_LIBS" >&6; }
-
-
- #
- # linking flags needed when embedding
- #
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking python extra linking flags" >&5
-$as_echo_n "checking python extra linking flags... " >&6; }
- if test -z "$PYTHON_EXTRA_LDFLAGS"; then
- PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import distutils.sysconfig; \
- conf = distutils.sysconfig.get_config_var; \
- print (conf('LINKFORSHARED'))"`
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_EXTRA_LDFLAGS" >&5
-$as_echo "$PYTHON_EXTRA_LDFLAGS" >&6; }
-
-
- #
- # final check to see if everything compiles alright
- #
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking consistency of all components of python development environment" >&5
-$as_echo_n "checking consistency of all components of python development environment... " >&6; }
- # save current global flags
- ac_save_LIBS="$LIBS"
- ac_save_CPPFLAGS="$CPPFLAGS"
- LIBS="$ac_save_LIBS $PYTHON_LDFLAGS $PYTHON_EXTRA_LDFLAGS $PYTHON_EXTRA_LIBS"
- CPPFLAGS="$ac_save_CPPFLAGS $PYTHON_CPPFLAGS"
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
- #include <Python.h>
-int
-main ()
-{
-Py_Initialize();
- ;
- return 0;
-}
-
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- pythonexists=yes
-else
- pythonexists=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
- # turn back to default flags
- CPPFLAGS="$ac_save_CPPFLAGS"
- LIBS="$ac_save_LIBS"
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pythonexists" >&5
-$as_echo "$pythonexists" >&6; }
-
- if test ! "x$pythonexists" = "xyes"; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "
- Could not link test program to Python. Maybe the main Python library has been
- installed in some non-standard library path. If so, pass it to configure,
- via the LDFLAGS environment variable.
- Example: ./configure LDFLAGS=\"-L/usr/non-standard-path/python/lib\"
- ============================================================================
- ERROR!
- You probably have to install the development version of the Python package
- for your distribution. The exact name of this package varies among them.
- ============================================================================
-
-See \`config.log' for more details" "$LINENO" 5; }
- PYTHON_VERSION=""
- fi
-
- #
- # all done!
- #
-
- if test ! -z "$ac_python_version"; then
- ldns_have_python=yes
- fi
-
- # pass additional Python 3 option to SWIG
- if test `$PYTHON -c "import sys; \
- ver = sys.version.split()[0]; \
- print(ver >= '3')"` = "True"; then
- SWIGPY3="-py3 -DPY3"
-
- fi
-
- # check for SWIG
- if test x_$ldns_have_python != x_no; then
- # ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_pkg_swig.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_PKG_SWIG([major.minor.micro], [action-if-found], [action-if-not-found])
-#
-# DESCRIPTION
-#
-# This macro searches for a SWIG installation on your system. If found,
-# then SWIG is AC_SUBST'd; if not found, then $SWIG is empty. If SWIG is
-# found, then SWIG_LIB is set to the SWIG library path, and AC_SUBST'd.
-#
-# You can use the optional first argument to check if the version of the
-# available SWIG is greater than or equal to the value of the argument. It
-# should have the format: N[.N[.N]] (N is a number between 0 and 999. Only
-# the first N is mandatory.) If the version argument is given (e.g.
-# 1.3.17), AX_PKG_SWIG checks that the swig package is this version number
-# or higher.
-#
-# As usual, action-if-found is executed if SWIG is found, otherwise
-# action-if-not-found is executed.
-#
-# In configure.in, use as:
-#
-# AX_PKG_SWIG(1.3.17, [], [ AC_MSG_ERROR([SWIG is required to build..]) ])
-# AX_SWIG_ENABLE_CXX
-# AX_SWIG_MULTI_MODULE_SUPPORT
-# AX_SWIG_PYTHON
-#
-# LICENSE
-#
-# Copyright (c) 2008 Sebastian Huber <sebastian-huber@web.de>
-# Copyright (c) 2008 Alan W. Irwin <irwin@beluga.phys.uvic.ca>
-# Copyright (c) 2008 Rafael Laboissiere <rafael@laboissiere.net>
-# Copyright (c) 2008 Andrew Collier <colliera@ukzn.ac.za>
-# Copyright (c) 2011 Murray Cumming <murrayc@openismus.com>
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2 of the License, or (at your
-# option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
-# Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception, the respective Autoconf Macro's copyright owner
-# gives unlimited permission to copy, distribute and modify the configure
-# scripts that are the output of Autoconf when processing the Macro. You
-# need not follow the terms of the GNU General Public License when using
-# or distributing such scripts, even though portions of the text of the
-# Macro appear in them. The GNU General Public License (GPL) does govern
-# all other use of the material that constitutes the Autoconf Macro.
-#
-# This special exception to the GPL applies to versions of the Autoconf
-# Macro released by the Autoconf Archive. When you make and distribute a
-# modified version of the Autoconf Macro, you may extend this special
-# exception to the GPL to apply to your modified version as well.
-
-#serial 8
-
-
-
-
- # check for >=SWIG-2.0.4 if Python 3.2 used
- if test `$PYTHON -c "import sys; \
- ver = sys.version.split()[0]; \
- print(ver >= '3.2')"` = "True"; then
-
- # Ubuntu has swig 2.0 as /usr/bin/swig2.0
- for ac_prog in swig2.0 swig
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_SWIG+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $SWIG in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_SWIG="$SWIG" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_SWIG="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-SWIG=$ac_cv_path_SWIG
-if test -n "$SWIG"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SWIG" >&5
-$as_echo "$SWIG" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$SWIG" && break
-done
-
- if test -z "$SWIG" ; then
- as_fn_error $? "SWIG-2.0.4 is required to build pyldns for Python 3.2 and greater." "$LINENO" 5
- elif test -n "2.0.4" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking SWIG version" >&5
-$as_echo_n "checking SWIG version... " >&6; }
- swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $swig_version" >&5
-$as_echo "$swig_version" >&6; }
- if test -n "$swig_version" ; then
- # Calculate the required version number components
- required=2.0.4
- required_major=`echo $required | sed 's/[^0-9].*//'`
- if test -z "$required_major" ; then
- required_major=0
- fi
- required=`echo $required | sed 's/[0-9]*[^0-9]//'`
- required_minor=`echo $required | sed 's/[^0-9].*//'`
- if test -z "$required_minor" ; then
- required_minor=0
- fi
- required=`echo $required | sed 's/[0-9]*[^0-9]//'`
- required_patch=`echo $required | sed 's/[^0-9].*//'`
- if test -z "$required_patch" ; then
- required_patch=0
- fi
- # Calculate the available version number components
- available=$swig_version
- available_major=`echo $available | sed 's/[^0-9].*//'`
- if test -z "$available_major" ; then
- available_major=0
- fi
- available=`echo $available | sed 's/[0-9]*[^0-9]//'`
- available_minor=`echo $available | sed 's/[^0-9].*//'`
- if test -z "$available_minor" ; then
- available_minor=0
- fi
- available=`echo $available | sed 's/[0-9]*[^0-9]//'`
- available_patch=`echo $available | sed 's/[^0-9].*//'`
- if test -z "$available_patch" ; then
- available_patch=0
- fi
- # Convert the version tuple into a single number for easier comparison.
- # Using base 100 should be safe since SWIG internally uses BCD values
- # to encode its version number.
- required_swig_vernum=`expr $required_major \* 10000 \
- \+ $required_minor \* 100 \+ $required_patch`
- available_swig_vernum=`expr $available_major \* 10000 \
- \+ $available_minor \* 100 \+ $available_patch`
-
- if test $available_swig_vernum -lt $required_swig_vernum; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: SWIG version >= 2.0.4 is required. You have $swig_version." >&5
-$as_echo "$as_me: WARNING: SWIG version >= 2.0.4 is required. You have $swig_version." >&2;}
- SWIG=''
- as_fn_error $? "SWIG-2.0.4 is required to build pyldns for Python 3.2 and greater." "$LINENO" 5
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SWIG library" >&5
-$as_echo_n "checking for SWIG library... " >&6; }
- SWIG_LIB=`$SWIG -swiglib`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SWIG_LIB" >&5
-$as_echo "$SWIG_LIB" >&6; }
-
- fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot determine SWIG version" >&5
-$as_echo "$as_me: WARNING: cannot determine SWIG version" >&2;}
- SWIG=''
- as_fn_error $? "SWIG-2.0.4 is required to build pyldns for Python 3.2 and greater." "$LINENO" 5
- fi
- fi
-
-
- else
-
- # Ubuntu has swig 2.0 as /usr/bin/swig2.0
- for ac_prog in swig2.0 swig
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_SWIG+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $SWIG in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_SWIG="$SWIG" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_SWIG="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-SWIG=$ac_cv_path_SWIG
-if test -n "$SWIG"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SWIG" >&5
-$as_echo "$SWIG" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$SWIG" && break
-done
-
- if test -z "$SWIG" ; then
- :
- elif test -n "" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking SWIG version" >&5
-$as_echo_n "checking SWIG version... " >&6; }
- swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $swig_version" >&5
-$as_echo "$swig_version" >&6; }
- if test -n "$swig_version" ; then
- # Calculate the required version number components
- required=
- required_major=`echo $required | sed 's/[^0-9].*//'`
- if test -z "$required_major" ; then
- required_major=0
- fi
- required=`echo $required | sed 's/[0-9]*[^0-9]//'`
- required_minor=`echo $required | sed 's/[^0-9].*//'`
- if test -z "$required_minor" ; then
- required_minor=0
- fi
- required=`echo $required | sed 's/[0-9]*[^0-9]//'`
- required_patch=`echo $required | sed 's/[^0-9].*//'`
- if test -z "$required_patch" ; then
- required_patch=0
- fi
- # Calculate the available version number components
- available=$swig_version
- available_major=`echo $available | sed 's/[^0-9].*//'`
- if test -z "$available_major" ; then
- available_major=0
- fi
- available=`echo $available | sed 's/[0-9]*[^0-9]//'`
- available_minor=`echo $available | sed 's/[^0-9].*//'`
- if test -z "$available_minor" ; then
- available_minor=0
- fi
- available=`echo $available | sed 's/[0-9]*[^0-9]//'`
- available_patch=`echo $available | sed 's/[^0-9].*//'`
- if test -z "$available_patch" ; then
- available_patch=0
- fi
- # Convert the version tuple into a single number for easier comparison.
- # Using base 100 should be safe since SWIG internally uses BCD values
- # to encode its version number.
- required_swig_vernum=`expr $required_major \* 10000 \
- \+ $required_minor \* 100 \+ $required_patch`
- available_swig_vernum=`expr $available_major \* 10000 \
- \+ $available_minor \* 100 \+ $available_patch`
-
- if test $available_swig_vernum -lt $required_swig_vernum; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: SWIG version >= is required. You have $swig_version." >&5
-$as_echo "$as_me: WARNING: SWIG version >= is required. You have $swig_version." >&2;}
- SWIG=''
-
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SWIG library" >&5
-$as_echo_n "checking for SWIG library... " >&6; }
- SWIG_LIB=`$SWIG -swiglib`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SWIG_LIB" >&5
-$as_echo "$SWIG_LIB" >&6; }
-
- fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot determine SWIG version" >&5
-$as_echo "$as_me: WARNING: cannot determine SWIG version" >&2;}
- SWIG=''
-
- fi
- fi
-
-
- fi
-
- if test ! -x "$SWIG"; then
- as_fn_error $? "failed to find SWIG tool, install it, or do not build pyldns" "$LINENO" 5
- else
-
-$as_echo "#define HAVE_SWIG 1" >>confdefs.h
-
- PYLDNS="pyldns"
-
- swig="$SWIG"
-
- ldns_with_pyldns=yes
- fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: *** don't have Python, skipping SWIG, no pyldns ***" >&5
-$as_echo "*** don't have Python, skipping SWIG, no pyldns ***" >&6; } # '
- fi
-
- # xtra cflags for pyldns
- if test x_$ldns_have_python != x_no; then
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -fno-strict-aliasing" >&5
-$as_echo_n "checking whether $CC supports -fno-strict-aliasing... " >&6; }
-cache=`echo fno-strict-aliasing | sed 'y%.=/+-%___p_%'`
-if eval \${cv_prog_cc_flag_$cache+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
-echo 'void f(){}' >conftest.c
-if test -z "`$CC $CPPFLAGS $CFLAGS -fno-strict-aliasing -c conftest.c 2>&1`"; then
-eval "cv_prog_cc_flag_$cache=yes"
-else
-eval "cv_prog_cc_flag_$cache=no"
-fi
-rm -f conftest conftest.o conftest.c
-
-fi
-
-if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-:
-PYTHON_X_CFLAGS="-fno-strict-aliasing"
-else
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-:
-
-fi
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wno-missing-field-initializers" >&5
-$as_echo_n "checking whether $CC supports -Wno-missing-field-initializers... " >&6; }
-cache=`echo Wno-missing-field-initializers | sed 'y%.=/+-%___p_%'`
-if eval \${cv_prog_cc_flag_$cache+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
-echo 'void f(){}' >conftest.c
-if test -z "`$CC $CPPFLAGS $CFLAGS -Wno-missing-field-initializers -c conftest.c 2>&1`"; then
-eval "cv_prog_cc_flag_$cache=yes"
-else
-eval "cv_prog_cc_flag_$cache=no"
-fi
-rm -f conftest conftest.o conftest.c
-
-fi
-
-if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-:
-PYTHON_X_CFLAGS="-Wno-missing-field-initializers $PYTHON_X_CFLAGS"
-else
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-:
-
-fi
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wno-unused-parameter" >&5
-$as_echo_n "checking whether $CC supports -Wno-unused-parameter... " >&6; }
-cache=`echo Wno-unused-parameter | sed 'y%.=/+-%___p_%'`
-if eval \${cv_prog_cc_flag_$cache+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
-echo 'void f(){}' >conftest.c
-if test -z "`$CC $CPPFLAGS $CFLAGS -Wno-unused-parameter -c conftest.c 2>&1`"; then
-eval "cv_prog_cc_flag_$cache=yes"
-else
-eval "cv_prog_cc_flag_$cache=no"
-fi
-rm -f conftest conftest.o conftest.c
-
-fi
-
-if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-:
-PYTHON_X_CFLAGS="-Wno-unused-parameter $PYTHON_X_CFLAGS"
-else
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-:
-
-fi
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wno-unused-variable" >&5
-$as_echo_n "checking whether $CC supports -Wno-unused-variable... " >&6; }
-cache=`echo Wno-unused-variable | sed 'y%.=/+-%___p_%'`
-if eval \${cv_prog_cc_flag_$cache+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
-echo 'void f(){}' >conftest.c
-if test -z "`$CC $CPPFLAGS $CFLAGS -Wno-unused-variable -c conftest.c 2>&1`"; then
-eval "cv_prog_cc_flag_$cache=yes"
-else
-eval "cv_prog_cc_flag_$cache=no"
-fi
-rm -f conftest conftest.o conftest.c
-
-fi
-
-if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-:
-PYTHON_X_CFLAGS="-Wno-unused-variable $PYTHON_X_CFLAGS"
-else
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-:
-
-fi
-
- fi
-fi
-
-
-# Check for pyldnsx
-
-# Check whether --with-pyldnsx was given.
-if test "${with_pyldnsx+set}" = set; then :
- withval=$with_pyldnsx;
-else
- withval="with_pyldns"
-fi
-
-if test x_$withval != x_no; then
- if test x_$ldns_with_pyldns != x_no; then
- PYLDNSX="pyldnsx"
-
- ldns_with_pyldnsx=yes
- else
- if test x_$withval != x_with_pyldns; then
- as_fn_error $? "--with-pyldns is needed for the ldnsx python module" "$LINENO" 5
- fi
- fi
-fi
-
-if test x_$ldns_with_pyldns != x_no; then
- PYLDNSINST="install-pyldns"
- PYLDNSUNINST="uninstall-pyldns"
-
-else
- PYLDNSINST=""
- PYLDNSUNINST=""
-
-fi
-if test x_$ldns_with_pyldnsx != x_no; then
- PYLDNSXINST="install-pyldnsx"
- PYLDNSXUNINST="uninstall-pyldnsx"
-
-else
- PYLDNSXINST=""
- PYLDNSXUNINST=""
-
-fi
-
-# Use libtool
-
-# skip these tests, we do not need them.
-
-
-
-
-
-
-
-
-# always use ./libtool unless override from commandline (libtool=mylibtool)
-if test -z "$libtool"; then
- libtool="./libtool"
-fi
-
-# avoid libtool max commandline length test on systems that fork slowly.
-
-if echo "$host_os" | grep "sunos4" >/dev/null; then
- lt_cv_sys_max_cmd_len=32750;
-fi
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ar; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_AR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $AR in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_AR="$AR" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_AR="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-AR=$ac_cv_path_AR
-if test -n "$AR"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
-$as_echo "$AR" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_path_AR"; then
- ac_pt_AR=$AR
- # Extract the first word of "ar", so it can be a program name with args.
-set dummy ar; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_ac_pt_AR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $ac_pt_AR in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_ac_pt_AR="$ac_pt_AR" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_ac_pt_AR="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-ac_pt_AR=$ac_cv_path_ac_pt_AR
-if test -n "$ac_pt_AR"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_AR" >&5
-$as_echo "$ac_pt_AR" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_pt_AR" = x; then
- AR="false"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- AR=$ac_pt_AR
- fi
-else
- AR="$ac_cv_path_AR"
-fi
-
-if test $AR = false; then
- as_fn_error $? "Cannot find 'ar', please extend PATH to include it" "$LINENO" 5
-fi
-
-case `pwd` in
- *\ * | *\ *)
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
-$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
-esac
-
-
-
-macro_version='2.4.2'
-macro_revision='1.3337'
-
-
-
-
-
-
-
-
-
-
-
-
-
-ltmain="$ac_aux_dir/ltmain.sh"
-
# Backslashify metacharacters that are still active within
# double-quoted strings.
sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
@@ -10276,8 +7107,6 @@ done
-
-
# Set options
@@ -14296,6 +11125,3324 @@ CC="$lt_save_CC"
+OURCPPFLAGS=''
+CPPFLAGS=${CPPFLAGS:-${OURCPPFLAGS}}
+CFLAGS="$CFLAGS"
+
+# Checks for programs.
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ 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
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ 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
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ 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
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ 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
+ fi
+ ac_cv_prog_CC="cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ 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
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ 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
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+else
+ CFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#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);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $CC dependency flag" >&5
+$as_echo_n "checking $CC dependency flag... " >&6; }
+echo 'void f(){}' >conftest.c
+if test "`$CC -MM conftest.c 2>&1`" = "conftest.o: conftest.c"; then
+ DEPFLAG="-MM"
+else
+ if test "`$CC -xM1 conftest.c 2>&1`" = "conftest.o: conftest.c"; then
+ DEPFLAG="-xM1"
+ else
+ DEPFLAG="-MM" # dunno do something
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DEPFLAG" >&5
+$as_echo "$DEPFLAG" >&6; }
+rm -f conftest.c
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ SET_MAKE=
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+
+# Extra (sp)lint flags for NetBSD
+
+case "$host_os" in
+ netbsd*) LINTFLAGS="'-D__RENAME(x)=' -D_NETINET_IN_H_ $LINTFLAGS"
+ ;;
+ *) LINTFLAGS="$LINTFLAGS"
+ ;;
+esac
+
+
+
+$as_echo "#define WINVER 0x0502" >>confdefs.h
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -std=c99" >&5
+$as_echo_n "checking whether $CC supports -std=c99... " >&6; }
+cache=`echo std=c99 | sed 'y%.=/+-%___p_%'`
+if eval \${cv_prog_cc_flag_$cache+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+echo 'void f(void){}' >conftest.c
+if test -z "`$CC $CPPFLAGS $CFLAGS -std=c99 -c conftest.c 2>&1`"; then
+eval "cv_prog_cc_flag_$cache=yes"
+else
+eval "cv_prog_cc_flag_$cache=no"
+fi
+rm -f conftest conftest.o conftest.c
+
+fi
+
+if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+:
+C99FLAG="-std=c99"
+else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+:
+
+fi
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -xc99" >&5
+$as_echo_n "checking whether $CC supports -xc99... " >&6; }
+cache=`echo xc99 | sed 'y%.=/+-%___p_%'`
+if eval \${cv_prog_cc_flag_$cache+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+echo 'void f(void){}' >conftest.c
+if test -z "`$CC $CPPFLAGS $CFLAGS -xc99 -c conftest.c 2>&1`"; then
+eval "cv_prog_cc_flag_$cache=yes"
+else
+eval "cv_prog_cc_flag_$cache=no"
+fi
+rm -f conftest conftest.o conftest.c
+
+fi
+
+if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+:
+C99FLAG="-xc99"
+else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+:
+
+fi
+
+
+# routine to copy files
+# argument 1 is a list of files (relative to the source dir)
+# argument 2 is a destination directory (relative to the current
+# working directory
+
+
+# copy all .h files in the dir at argument 1
+# (relative to source) to the dir at argument 2
+# (relative to current dir)
+
+
+# Checks for typedefs, structures, and compiler characteristics.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
+$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
+if ${ac_cv_c_const+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+/* FIXME: Include the comments suggested by Paul. */
+#ifndef __cplusplus
+ /* Ultrix mips cc rejects this. */
+ typedef int charset[2];
+ const charset cs;
+ /* SunOS 4.1.1 cc rejects this. */
+ char const *const *pcpcc;
+ char **ppc;
+ /* NEC SVR4.0.2 mips cc rejects this. */
+ struct point {int x, y;};
+ static struct point const zero = {0,0};
+ /* AIX XL C 1.02.0.0 rejects this.
+ It does not let you subtract one const X* pointer from another in
+ an arm of an if-expression whose if-part is not a constant
+ expression */
+ const char *g = "string";
+ pcpcc = &g + (g ? g-g : 0);
+ /* HPUX 7.0 cc rejects these. */
+ ++pcpcc;
+ ppc = (char**) pcpcc;
+ pcpcc = (char const *const *) ppc;
+ { /* SCO 3.2v4 cc rejects this. */
+ char *t;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 0;
+ if (s) return 0;
+ }
+ { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+ int x[] = {25, 17};
+ const int *foo = &x[0];
+ ++foo;
+ }
+ { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+ typedef const int *iptr;
+ iptr p = 0;
+ ++p;
+ }
+ { /* AIX XL C 1.02.0.0 rejects this saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; };
+ struct s *b; b->j = 5;
+ }
+ { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+ if (!foo) return 0;
+ }
+ return !cs[0] && !zero.x;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_const=yes
+else
+ ac_cv_c_const=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
+$as_echo "$ac_cv_c_const" >&6; }
+if test $ac_cv_c_const = no; then
+
+$as_echo "#define const /**/" >>confdefs.h
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+if test "x$CFLAGS" = "x" ; then
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -g" >&5
+$as_echo_n "checking whether $CC supports -g... " >&6; }
+cache=`echo g | sed 'y%.=/+-%___p_%'`
+if eval \${cv_prog_cc_flag_$cache+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+echo 'void f(void){}' >conftest.c
+if test -z "`$CC $CPPFLAGS $CFLAGS -g -c conftest.c 2>&1`"; then
+eval "cv_prog_cc_flag_$cache=yes"
+else
+eval "cv_prog_cc_flag_$cache=no"
+fi
+rm -f conftest conftest.o conftest.c
+
+fi
+
+if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+:
+CFLAGS="-g"
+else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+:
+
+fi
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -O2" >&5
+$as_echo_n "checking whether $CC supports -O2... " >&6; }
+cache=`echo O2 | sed 'y%.=/+-%___p_%'`
+if eval \${cv_prog_cc_flag_$cache+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+echo 'void f(void){}' >conftest.c
+if test -z "`$CC $CPPFLAGS $CFLAGS -O2 -c conftest.c 2>&1`"; then
+eval "cv_prog_cc_flag_$cache=yes"
+else
+eval "cv_prog_cc_flag_$cache=no"
+fi
+rm -f conftest conftest.o conftest.c
+
+fi
+
+if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+:
+CFLAGS="-O2 $CFLAGS"
+else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+:
+
+fi
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wall" >&5
+$as_echo_n "checking whether $CC supports -Wall... " >&6; }
+cache=`echo Wall | sed 'y%.=/+-%___p_%'`
+if eval \${cv_prog_cc_flag_$cache+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+echo 'void f(void){}' >conftest.c
+if test -z "`$CC $CPPFLAGS $CFLAGS -Wall -c conftest.c 2>&1`"; then
+eval "cv_prog_cc_flag_$cache=yes"
+else
+eval "cv_prog_cc_flag_$cache=no"
+fi
+rm -f conftest conftest.o conftest.c
+
+fi
+
+if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+:
+CFLAGS="-Wall $CFLAGS"
+else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+:
+
+fi
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -W" >&5
+$as_echo_n "checking whether $CC supports -W... " >&6; }
+cache=`echo W | sed 'y%.=/+-%___p_%'`
+if eval \${cv_prog_cc_flag_$cache+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+echo 'void f(void){}' >conftest.c
+if test -z "`$CC $CPPFLAGS $CFLAGS -W -c conftest.c 2>&1`"; then
+eval "cv_prog_cc_flag_$cache=yes"
+else
+eval "cv_prog_cc_flag_$cache=no"
+fi
+rm -f conftest conftest.o conftest.c
+
+fi
+
+if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+:
+CFLAGS="-W $CFLAGS"
+else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+:
+
+fi
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wwrite-strings" >&5
+$as_echo_n "checking whether $CC supports -Wwrite-strings... " >&6; }
+cache=`echo Wwrite-strings | sed 'y%.=/+-%___p_%'`
+if eval \${cv_prog_cc_flag_$cache+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+echo 'void f(void){}' >conftest.c
+if test -z "`$CC $CPPFLAGS $CFLAGS -Wwrite-strings -c conftest.c 2>&1`"; then
+eval "cv_prog_cc_flag_$cache=yes"
+else
+eval "cv_prog_cc_flag_$cache=no"
+fi
+rm -f conftest conftest.o conftest.c
+
+fi
+
+if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+:
+CFLAGS="-Wwrite-strings $CFLAGS"
+else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+:
+
+fi
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wstrict-prototypes" >&5
+$as_echo_n "checking whether $CC supports -Wstrict-prototypes... " >&6; }
+cache=`echo Wstrict-prototypes | sed 'y%.=/+-%___p_%'`
+if eval \${cv_prog_cc_flag_$cache+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+echo 'void f(void){}' >conftest.c
+if test -z "`$CC $CPPFLAGS $CFLAGS -Wstrict-prototypes -c conftest.c 2>&1`"; then
+eval "cv_prog_cc_flag_$cache=yes"
+else
+eval "cv_prog_cc_flag_$cache=no"
+fi
+rm -f conftest conftest.o conftest.c
+
+fi
+
+if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+:
+CFLAGS="-Wstrict-prototypes $CFLAGS"
+else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+:
+
+fi
+
+
+
+for ac_header in getopt.h time.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+# MinGW32 tests
+for ac_header in winsock2.h ws2tcpip.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+# end mingw32 tests
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Werror" >&5
+$as_echo_n "checking whether $CC supports -Werror... " >&6; }
+cache=`echo Werror | sed 'y%.=/+-%___p_%'`
+if eval \${cv_prog_cc_flag_$cache+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+echo 'void f(void){}' >conftest.c
+if test -z "`$CC $CPPFLAGS $CFLAGS -Werror -c conftest.c 2>&1`"; then
+eval "cv_prog_cc_flag_$cache=yes"
+else
+eval "cv_prog_cc_flag_$cache=no"
+fi
+rm -f conftest conftest.o conftest.c
+
+fi
+
+if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+:
+ERRFLAG="-Werror"
+else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+:
+ERRFLAG="-errwarn"
+fi
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wall" >&5
+$as_echo_n "checking whether $CC supports -Wall... " >&6; }
+cache=`echo Wall | sed 'y%.=/+-%___p_%'`
+if eval \${cv_prog_cc_flag_$cache+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+echo 'void f(void){}' >conftest.c
+if test -z "`$CC $CPPFLAGS $CFLAGS -Wall -c conftest.c 2>&1`"; then
+eval "cv_prog_cc_flag_$cache=yes"
+else
+eval "cv_prog_cc_flag_$cache=no"
+fi
+rm -f conftest conftest.o conftest.c
+
+fi
+
+if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+:
+ERRFLAG="$ERRFLAG -Wall"
+else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+:
+ERRFLAG="$ERRFLAG -errfmt"
+fi
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -std=c99" >&5
+$as_echo_n "checking whether $CC supports -std=c99... " >&6; }
+cache=`echo std=c99 | sed 'y%.=/+-%___p_%'`
+if eval \${cv_prog_cc_flag_$cache+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+echo 'void f(void){}' >conftest.c
+if test -z "`$CC $CPPFLAGS $CFLAGS -std=c99 -c conftest.c 2>&1`"; then
+eval "cv_prog_cc_flag_$cache=yes"
+else
+eval "cv_prog_cc_flag_$cache=no"
+fi
+rm -f conftest conftest.o conftest.c
+
+fi
+
+if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+:
+C99FLAG="-std=c99"
+else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+:
+
+fi
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -xc99" >&5
+$as_echo_n "checking whether $CC supports -xc99... " >&6; }
+cache=`echo xc99 | sed 'y%.=/+-%___p_%'`
+if eval \${cv_prog_cc_flag_$cache+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+echo 'void f(void){}' >conftest.c
+if test -z "`$CC $CPPFLAGS $CFLAGS -xc99 -c conftest.c 2>&1`"; then
+eval "cv_prog_cc_flag_$cache=yes"
+else
+eval "cv_prog_cc_flag_$cache=no"
+fi
+rm -f conftest conftest.o conftest.c
+
+fi
+
+if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+:
+C99FLAG="-xc99"
+else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+:
+
+fi
+
+
+for ac_header in getopt.h time.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE as a flag for $CC" >&5
+$as_echo_n "checking whether we need $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE as a flag for $CC... " >&6; }
+cache=`$as_echo "$C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE" | $as_tr_sh`
+if eval \${cv_prog_cc_flag_needed_$cache+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+echo '
+#include "confdefs.h"
+#include <stdlib.h>
+#include <ctype.h>
+#include <sys/time.h>
+#ifdef HAVE_TIME_H
+#include <time.h>
+#endif
+#include <unistd.h>
+#include <netdb.h>
+#ifdef HAVE_GETOPT_H
+#include <getopt.h>
+#endif
+
+int test() {
+ int a;
+ char **opts = NULL;
+ struct timeval tv;
+ char *t;
+ time_t time = 0;
+ char *buf = NULL;
+ const char* str = NULL;
+ struct msghdr msg;
+ msg.msg_control = 0;
+ t = ctime_r(&time, buf);
+ tv.tv_usec = 10;
+ srandom(32);
+ a = getopt(2, opts, "a");
+ a = isascii(32);
+ str = gai_strerror(0);
+ if(str && t && tv.tv_usec && msg.msg_control)
+ a = 0;
+ return a;
+}
+' > conftest.c
+echo 'void f(){}' >>conftest.c
+if test -z "`$CC $CPPFLAGS $CFLAGS $ERRFLAG -c conftest.c 2>&1`"; then
+eval "cv_prog_cc_flag_needed_$cache=no"
+else
+
+if test -z "`$CC $CPPFLAGS $CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE $ERRFLAG -c conftest.c 2>&1`"; then
+eval "cv_prog_cc_flag_needed_$cache=yes"
+else
+eval "cv_prog_cc_flag_needed_$cache=fail"
+#echo 'Test with flag fails too!'
+#cat conftest.c
+#echo "$CC $CPPFLAGS $CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE $ERRFLAG -c conftest.c 2>&1"
+#echo `$CC $CPPFLAGS $CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE $ERRFLAG -c conftest.c 2>&1`
+#exit 1
+fi
+
+fi
+rm -f conftest conftest.c conftest.o
+
+fi
+
+if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = yes"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+:
+CFLAGS="$CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE"
+else
+if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = no"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+#echo 'Test with flag is no!'
+#cat conftest.c
+#echo "$CC $CPPFLAGS $CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE $ERRFLAG -c conftest.c 2>&1"
+#echo `$CC $CPPFLAGS $CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE $ERRFLAG -c conftest.c 2>&1`
+#exit 1
+:
+
+else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
+$as_echo "failed" >&6; }
+:
+
+fi
+fi
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE as a flag for $CC" >&5
+$as_echo_n "checking whether we need $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE as a flag for $CC... " >&6; }
+cache=`$as_echo "$C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE" | $as_tr_sh`
+if eval \${cv_prog_cc_flag_needed_$cache+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+echo '
+#include "confdefs.h"
+#include <stdlib.h>
+#include <ctype.h>
+#include <sys/time.h>
+#ifdef HAVE_TIME_H
+#include <time.h>
+#endif
+#include <unistd.h>
+#include <netdb.h>
+#ifdef HAVE_GETOPT_H
+#include <getopt.h>
+#endif
+
+int test() {
+ int a;
+ char **opts = NULL;
+ struct timeval tv;
+ char *t;
+ time_t time = 0;
+ char *buf = NULL;
+ const char* str = NULL;
+ struct msghdr msg;
+ msg.msg_control = 0;
+ t = ctime_r(&time, buf);
+ tv.tv_usec = 10;
+ srandom(32);
+ a = getopt(2, opts, "a");
+ a = isascii(32);
+ str = gai_strerror(0);
+ if(str && t && tv.tv_usec && msg.msg_control)
+ a = 0;
+ return a;
+}
+' > conftest.c
+echo 'void f(){}' >>conftest.c
+if test -z "`$CC $CPPFLAGS $CFLAGS $ERRFLAG -c conftest.c 2>&1`"; then
+eval "cv_prog_cc_flag_needed_$cache=no"
+else
+
+if test -z "`$CC $CPPFLAGS $CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE $ERRFLAG -c conftest.c 2>&1`"; then
+eval "cv_prog_cc_flag_needed_$cache=yes"
+else
+eval "cv_prog_cc_flag_needed_$cache=fail"
+#echo 'Test with flag fails too!'
+#cat conftest.c
+#echo "$CC $CPPFLAGS $CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE $ERRFLAG -c conftest.c 2>&1"
+#echo `$CC $CPPFLAGS $CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE $ERRFLAG -c conftest.c 2>&1`
+#exit 1
+fi
+
+fi
+rm -f conftest conftest.c conftest.o
+
+fi
+
+if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = yes"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+:
+CFLAGS="$CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE"
+else
+if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = no"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+#echo 'Test with flag is no!'
+#cat conftest.c
+#echo "$CC $CPPFLAGS $CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE $ERRFLAG -c conftest.c 2>&1"
+#echo `$CC $CPPFLAGS $CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE $ERRFLAG -c conftest.c 2>&1`
+#exit 1
+:
+
+else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
+$as_echo "failed" >&6; }
+:
+
+fi
+fi
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need $C99FLAG as a flag for $CC" >&5
+$as_echo_n "checking whether we need $C99FLAG as a flag for $CC... " >&6; }
+cache=`$as_echo "$C99FLAG" | $as_tr_sh`
+if eval \${cv_prog_cc_flag_needed_$cache+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+echo '
+#include <stdbool.h>
+#include <ctype.h>
+int test() {
+ int a = 0;
+ return a;
+}
+' > conftest.c
+echo 'void f(){}' >>conftest.c
+if test -z "`$CC $CPPFLAGS $CFLAGS $ERRFLAG -c conftest.c 2>&1`"; then
+eval "cv_prog_cc_flag_needed_$cache=no"
+else
+
+if test -z "`$CC $CPPFLAGS $CFLAGS $C99FLAG $ERRFLAG -c conftest.c 2>&1`"; then
+eval "cv_prog_cc_flag_needed_$cache=yes"
+else
+eval "cv_prog_cc_flag_needed_$cache=fail"
+#echo 'Test with flag fails too!'
+#cat conftest.c
+#echo "$CC $CPPFLAGS $CFLAGS $C99FLAG $ERRFLAG -c conftest.c 2>&1"
+#echo `$CC $CPPFLAGS $CFLAGS $C99FLAG $ERRFLAG -c conftest.c 2>&1`
+#exit 1
+fi
+
+fi
+rm -f conftest conftest.c conftest.o
+
+fi
+
+if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = yes"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+:
+CFLAGS="$CFLAGS $C99FLAG"
+else
+if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = no"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+#echo 'Test with flag is no!'
+#cat conftest.c
+#echo "$CC $CPPFLAGS $CFLAGS $C99FLAG $ERRFLAG -c conftest.c 2>&1"
+#echo `$CC $CPPFLAGS $CFLAGS $C99FLAG $ERRFLAG -c conftest.c 2>&1`
+#exit 1
+:
+
+else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
+$as_echo "failed" >&6; }
+:
+
+fi
+fi
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need -D_BSD_SOURCE as a flag for $CC" >&5
+$as_echo_n "checking whether we need -D_BSD_SOURCE as a flag for $CC... " >&6; }
+cache=_D_BSD_SOURCE
+if eval \${cv_prog_cc_flag_needed_$cache+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+echo '
+#include <ctype.h>
+
+int test() {
+ int a;
+ a = isascii(32);
+ return a;
+}
+' > conftest.c
+echo 'void f(){}' >>conftest.c
+if test -z "`$CC $CPPFLAGS $CFLAGS $ERRFLAG -c conftest.c 2>&1`"; then
+eval "cv_prog_cc_flag_needed_$cache=no"
+else
+
+if test -z "`$CC $CPPFLAGS $CFLAGS -D_BSD_SOURCE $ERRFLAG -c conftest.c 2>&1`"; then
+eval "cv_prog_cc_flag_needed_$cache=yes"
+else
+eval "cv_prog_cc_flag_needed_$cache=fail"
+#echo 'Test with flag fails too!'
+#cat conftest.c
+#echo "$CC $CPPFLAGS $CFLAGS -D_BSD_SOURCE $ERRFLAG -c conftest.c 2>&1"
+#echo `$CC $CPPFLAGS $CFLAGS -D_BSD_SOURCE $ERRFLAG -c conftest.c 2>&1`
+#exit 1
+fi
+
+fi
+rm -f conftest conftest.c conftest.o
+
+fi
+
+if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = yes"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+:
+CFLAGS="$CFLAGS -D_BSD_SOURCE"
+else
+if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = no"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+#echo 'Test with flag is no!'
+#cat conftest.c
+#echo "$CC $CPPFLAGS $CFLAGS -D_BSD_SOURCE $ERRFLAG -c conftest.c 2>&1"
+#echo `$CC $CPPFLAGS $CFLAGS -D_BSD_SOURCE $ERRFLAG -c conftest.c 2>&1`
+#exit 1
+:
+
+else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
+$as_echo "failed" >&6; }
+:
+
+fi
+fi
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need -D_GNU_SOURCE as a flag for $CC" >&5
+$as_echo_n "checking whether we need -D_GNU_SOURCE as a flag for $CC... " >&6; }
+cache=_D_GNU_SOURCE
+if eval \${cv_prog_cc_flag_needed_$cache+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+echo '
+#include <netinet/in.h>
+
+int test() {
+ struct in6_pktinfo inf;
+ int a = (int)sizeof(inf);
+ return a;
+}
+' > conftest.c
+echo 'void f(){}' >>conftest.c
+if test -z "`$CC $CPPFLAGS $CFLAGS $ERRFLAG -c conftest.c 2>&1`"; then
+eval "cv_prog_cc_flag_needed_$cache=no"
+else
+
+if test -z "`$CC $CPPFLAGS $CFLAGS -D_GNU_SOURCE $ERRFLAG -c conftest.c 2>&1`"; then
+eval "cv_prog_cc_flag_needed_$cache=yes"
+else
+eval "cv_prog_cc_flag_needed_$cache=fail"
+#echo 'Test with flag fails too!'
+#cat conftest.c
+#echo "$CC $CPPFLAGS $CFLAGS -D_GNU_SOURCE $ERRFLAG -c conftest.c 2>&1"
+#echo `$CC $CPPFLAGS $CFLAGS -D_GNU_SOURCE $ERRFLAG -c conftest.c 2>&1`
+#exit 1
+fi
+
+fi
+rm -f conftest conftest.c conftest.o
+
+fi
+
+if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = yes"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+:
+CFLAGS="$CFLAGS -D_GNU_SOURCE"
+else
+if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = no"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+#echo 'Test with flag is no!'
+#cat conftest.c
+#echo "$CC $CPPFLAGS $CFLAGS -D_GNU_SOURCE $ERRFLAG -c conftest.c 2>&1"
+#echo `$CC $CPPFLAGS $CFLAGS -D_GNU_SOURCE $ERRFLAG -c conftest.c 2>&1`
+#exit 1
+:
+
+else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
+$as_echo "failed" >&6; }
+:
+
+fi
+fi
+
+
+# check again for GNU_SOURCE for setresgid. May fail if setresgid
+# is not available at all. -D_FRSRESGID is to make this check unique.
+# otherwise we would get the previous cached result.
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need -D_GNU_SOURCE -D_FRSRESGID as a flag for $CC" >&5
+$as_echo_n "checking whether we need -D_GNU_SOURCE -D_FRSRESGID as a flag for $CC... " >&6; }
+cache=_D_GNU_SOURCE__D_FRSRESGID
+if eval \${cv_prog_cc_flag_needed_$cache+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+echo '
+#include <unistd.h>
+
+int test() {
+ int a = setresgid(0,0,0);
+ a = setresuid(0,0,0);
+ return a;
+}
+' > conftest.c
+echo 'void f(){}' >>conftest.c
+if test -z "`$CC $CPPFLAGS $CFLAGS $ERRFLAG -c conftest.c 2>&1`"; then
+eval "cv_prog_cc_flag_needed_$cache=no"
+else
+
+if test -z "`$CC $CPPFLAGS $CFLAGS -D_GNU_SOURCE -D_FRSRESGID $ERRFLAG -c conftest.c 2>&1`"; then
+eval "cv_prog_cc_flag_needed_$cache=yes"
+else
+eval "cv_prog_cc_flag_needed_$cache=fail"
+#echo 'Test with flag fails too!'
+#cat conftest.c
+#echo "$CC $CPPFLAGS $CFLAGS -D_GNU_SOURCE -D_FRSRESGID $ERRFLAG -c conftest.c 2>&1"
+#echo `$CC $CPPFLAGS $CFLAGS -D_GNU_SOURCE -D_FRSRESGID $ERRFLAG -c conftest.c 2>&1`
+#exit 1
+fi
+
+fi
+rm -f conftest conftest.c conftest.o
+
+fi
+
+if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = yes"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+:
+CFLAGS="$CFLAGS -D_GNU_SOURCE"
+else
+if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = no"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+#echo 'Test with flag is no!'
+#cat conftest.c
+#echo "$CC $CPPFLAGS $CFLAGS -D_GNU_SOURCE -D_FRSRESGID $ERRFLAG -c conftest.c 2>&1"
+#echo `$CC $CPPFLAGS $CFLAGS -D_GNU_SOURCE -D_FRSRESGID $ERRFLAG -c conftest.c 2>&1`
+#exit 1
+:
+
+else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
+$as_echo "failed" >&6; }
+:
+
+fi
+fi
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need -D_POSIX_C_SOURCE=200112 as a flag for $CC" >&5
+$as_echo_n "checking whether we need -D_POSIX_C_SOURCE=200112 as a flag for $CC... " >&6; }
+cache=`$as_echo "-D_POSIX_C_SOURCE=200112" | $as_tr_sh`
+if eval \${cv_prog_cc_flag_needed_$cache+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+echo '
+#include "confdefs.h"
+#ifdef HAVE_TIME_H
+#include <time.h>
+#endif
+#include <netdb.h>
+
+int test() {
+ int a = 0;
+ char *t;
+ time_t time = 0;
+ char *buf = NULL;
+ const char* str = NULL;
+ t = ctime_r(&time, buf);
+ str = gai_strerror(0);
+ if(t && str)
+ a = 0;
+ return a;
+}
+' > conftest.c
+echo 'void f(){}' >>conftest.c
+if test -z "`$CC $CPPFLAGS $CFLAGS $ERRFLAG -c conftest.c 2>&1`"; then
+eval "cv_prog_cc_flag_needed_$cache=no"
+else
+
+if test -z "`$CC $CPPFLAGS $CFLAGS -D_POSIX_C_SOURCE=200112 $ERRFLAG -c conftest.c 2>&1`"; then
+eval "cv_prog_cc_flag_needed_$cache=yes"
+else
+eval "cv_prog_cc_flag_needed_$cache=fail"
+#echo 'Test with flag fails too!'
+#cat conftest.c
+#echo "$CC $CPPFLAGS $CFLAGS -D_POSIX_C_SOURCE=200112 $ERRFLAG -c conftest.c 2>&1"
+#echo `$CC $CPPFLAGS $CFLAGS -D_POSIX_C_SOURCE=200112 $ERRFLAG -c conftest.c 2>&1`
+#exit 1
+fi
+
+fi
+rm -f conftest conftest.c conftest.o
+
+fi
+
+if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = yes"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+:
+CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=200112"
+else
+if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = no"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+#echo 'Test with flag is no!'
+#cat conftest.c
+#echo "$CC $CPPFLAGS $CFLAGS -D_POSIX_C_SOURCE=200112 $ERRFLAG -c conftest.c 2>&1"
+#echo `$CC $CPPFLAGS $CFLAGS -D_POSIX_C_SOURCE=200112 $ERRFLAG -c conftest.c 2>&1`
+#exit 1
+:
+
+else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
+$as_echo "failed" >&6; }
+:
+
+fi
+fi
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need -D__EXTENSIONS__ as a flag for $CC" >&5
+$as_echo_n "checking whether we need -D__EXTENSIONS__ as a flag for $CC... " >&6; }
+cache=_D__EXTENSIONS__
+if eval \${cv_prog_cc_flag_needed_$cache+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+echo '
+#include "confdefs.h"
+#include <stdlib.h>
+#include <ctype.h>
+#include <sys/time.h>
+#ifdef HAVE_TIME_H
+#include <time.h>
+#endif
+#include <unistd.h>
+#ifdef HAVE_GETOPT_H
+#include <getopt.h>
+#endif
+
+int test() {
+ int a;
+ char **opts = NULL;
+ struct timeval tv;
+ tv.tv_usec = 10;
+ srandom(32);
+ a = getopt(2, opts, "a");
+ a = isascii(32);
+ if(tv.tv_usec)
+ a = 0;
+ return a;
+}
+' > conftest.c
+echo 'void f(){}' >>conftest.c
+if test -z "`$CC $CPPFLAGS $CFLAGS $ERRFLAG -c conftest.c 2>&1`"; then
+eval "cv_prog_cc_flag_needed_$cache=no"
+else
+
+if test -z "`$CC $CPPFLAGS $CFLAGS -D__EXTENSIONS__ $ERRFLAG -c conftest.c 2>&1`"; then
+eval "cv_prog_cc_flag_needed_$cache=yes"
+else
+eval "cv_prog_cc_flag_needed_$cache=fail"
+#echo 'Test with flag fails too!'
+#cat conftest.c
+#echo "$CC $CPPFLAGS $CFLAGS -D__EXTENSIONS__ $ERRFLAG -c conftest.c 2>&1"
+#echo `$CC $CPPFLAGS $CFLAGS -D__EXTENSIONS__ $ERRFLAG -c conftest.c 2>&1`
+#exit 1
+fi
+
+fi
+rm -f conftest conftest.c conftest.o
+
+fi
+
+if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = yes"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+:
+CFLAGS="$CFLAGS -D__EXTENSIONS__"
+else
+if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = no"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+#echo 'Test with flag is no!'
+#cat conftest.c
+#echo "$CC $CPPFLAGS $CFLAGS -D__EXTENSIONS__ $ERRFLAG -c conftest.c 2>&1"
+#echo `$CC $CPPFLAGS $CFLAGS -D__EXTENSIONS__ $ERRFLAG -c conftest.c 2>&1`
+#exit 1
+:
+
+else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
+$as_echo "failed" >&6; }
+:
+
+fi
+fi
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
+$as_echo_n "checking for inline... " >&6; }
+if ${ac_cv_c_inline+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
+#endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_inline=$ac_kw
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ test "$ac_cv_c_inline" != no && break
+done
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
+$as_echo "$ac_cv_c_inline" >&6; }
+
+case $ac_cv_c_inline in
+ inline | yes) ;;
+ *)
+ case $ac_cv_c_inline in
+ no) ac_val=;;
+ *) ac_val=$ac_cv_c_inline;;
+ esac
+ cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define inline $ac_val
+#endif
+_ACEOF
+ ;;
+esac
+
+ac_fn_c_check_type "$LINENO" "int8_t" "ac_cv_type_int8_t" "$ac_includes_default"
+if test "x$ac_cv_type_int8_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define int8_t char
+_ACEOF
+
+fi
+
+ac_fn_c_check_type "$LINENO" "int16_t" "ac_cv_type_int16_t" "$ac_includes_default"
+if test "x$ac_cv_type_int16_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define int16_t short
+_ACEOF
+
+fi
+
+ac_fn_c_check_type "$LINENO" "int32_t" "ac_cv_type_int32_t" "$ac_includes_default"
+if test "x$ac_cv_type_int32_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define int32_t int
+_ACEOF
+
+fi
+
+ac_fn_c_check_type "$LINENO" "int64_t" "ac_cv_type_int64_t" "$ac_includes_default"
+if test "x$ac_cv_type_int64_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define int64_t long long
+_ACEOF
+
+fi
+
+ac_fn_c_check_type "$LINENO" "uint8_t" "ac_cv_type_uint8_t" "$ac_includes_default"
+if test "x$ac_cv_type_uint8_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define uint8_t unsigned char
+_ACEOF
+
+fi
+
+ac_fn_c_check_type "$LINENO" "uint16_t" "ac_cv_type_uint16_t" "$ac_includes_default"
+if test "x$ac_cv_type_uint16_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define uint16_t unsigned short
+_ACEOF
+
+fi
+
+ac_fn_c_check_type "$LINENO" "uint32_t" "ac_cv_type_uint32_t" "$ac_includes_default"
+if test "x$ac_cv_type_uint32_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define uint32_t unsigned int
+_ACEOF
+
+fi
+
+ac_fn_c_check_type "$LINENO" "uint64_t" "ac_cv_type_uint64_t" "$ac_includes_default"
+if test "x$ac_cv_type_uint64_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define uint64_t unsigned long long
+_ACEOF
+
+fi
+
+
+# my own checks
+# Extract the first word of "doxygen", so it can be a program name with args.
+set dummy doxygen; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_doxygen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$doxygen"; then
+ ac_cv_prog_doxygen="$doxygen" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ 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="doxygen"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+doxygen=$ac_cv_prog_doxygen
+if test -n "$doxygen"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $doxygen" >&5
+$as_echo "$doxygen" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+# check to see if libraries are needed for these functions.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5
+$as_echo_n "checking for library containing socket... " >&6; }
+if ${ac_cv_search_socket+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char socket ();
+int
+main ()
+{
+return socket ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' socket; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_socket=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_socket+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_socket+:} false; then :
+
+else
+ ac_cv_search_socket=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5
+$as_echo "$ac_cv_search_socket" >&6; }
+ac_res=$ac_cv_search_socket
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_pton" >&5
+$as_echo_n "checking for library containing inet_pton... " >&6; }
+if ${ac_cv_search_inet_pton+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char inet_pton ();
+int
+main ()
+{
+return inet_pton ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' nsl; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_inet_pton=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_inet_pton+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_inet_pton+:} false; then :
+
+else
+ ac_cv_search_inet_pton=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_pton" >&5
+$as_echo "$ac_cv_search_inet_pton" >&6; }
+ac_res=$ac_cv_search_inet_pton
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+
+
+
+# Check whether --with-drill was given.
+if test "${with_drill+set}" = set; then :
+ withval=$with_drill;
+else
+ with_drill="no"
+fi
+
+if test x_$with_drill != x_no ; then
+ DRILL=drill
+
+ INSTALL_DRILL=install-drill
+
+ UNINSTALL_DRILL=uninstall-drill
+
+ CLEAN_DRILL=clean-drill
+
+ LINT_DRILL=lint-drill
+
+ if test -e $srcdir/drill/config.h -o -e drill/config.h ; then
+ as_fn_error $? "
+A config.h was detected in the drill subdirectory.
+This does not work with the --with-drill option.
+Please remove the config.h from the drill subdirectory
+or do not use the --with-drill option." "$LINENO" 5
+ fi
+ DRILL_CONFIG=" drill/drill.1"
+else
+ DRILL=""
+
+ INSTALL_DRILL=""
+
+ UNINSTALL_DRILL=""
+
+ CLEAN_DRILL=""
+
+ LINT_DRILL=""
+
+ DRILL_CONFIG=""
+fi
+
+
+
+# Check whether --with-examples was given.
+if test "${with_examples+set}" = set; then :
+ withval=$with_examples;
+else
+ with_examples="no"
+fi
+
+if test x_$with_examples != x_no ; then
+ EXAMPLES=examples
+
+ INSTALL_EXAMPLES=install-examples
+
+ UNINSTALL_EXAMPLES=uninstall-examples
+
+ CLEAN_EXAMPLES=clean-examples
+
+ LINT_EXAMPLES=lint-examples
+
+ if test -e $srcdir/examples/config.h -o -e examples/config.h ; then
+ as_fn_error $? "
+A config.h was detected in the examples subdirectory.
+This does not work with the --with-examples option.
+Please remove the config.h from the examples subdirectory
+or do not use the --with-examples option." "$LINENO" 5
+ fi
+ EXAMPLES_CONFIG=" examples/ldns-dane.1 examples/ldns-verify-zone.1"
+else
+ EXAMPLES=""
+
+ INSTALL_EXAMPLES=""
+
+ UNINSTALL_EXAMPLES=""
+
+ CLEAN_EXAMPLES=""
+
+ LINT_EXAMPLES=""
+
+ EXAMPLES_CONFIG=""
+fi
+
+# add option to disable installation of ldns-config script
+# Check whether --enable-ldns-config was given.
+if test "${enable_ldns_config+set}" = set; then :
+ enableval=$enable_ldns_config; enable_ldns_config=$enableval
+else
+ enable_ldns_config=yes
+fi
+
+if test "x$enable_ldns_config" = xyes; then
+ INSTALL_CONFIG=install-config
+
+ INSTALL_CONFIG_MANPAGE=install-config-manpage
+
+ UNINSTALL_CONFIG=uninstall-config
+
+ UNINSTALL_CONFIG_MANPAGE=uninstall-config-manpage
+
+else
+ INSTALL_CONFIG=""
+
+ INSTALL_CONFIG_MANPAGE=""
+
+ UNINSTALL_CONFIG=""
+
+ UNINSTALL_CONFIG_MANPAGE=""
+
+fi
+
+# add option to disable library printing to stderr
+# Check whether --enable-stderr-msgs was given.
+if test "${enable_stderr_msgs+set}" = set; then :
+ enableval=$enable_stderr_msgs; enable_stderr_msgs=$enableval
+else
+ enable_stderr_msgs=no
+fi
+
+case "$enable_stderr_msgs" in
+ no) ;;
+ *)
+
+cat >>confdefs.h <<_ACEOF
+#define STDERR_MSGS 1
+_ACEOF
+
+ ;;
+esac
+
+# check for python
+PYTHON_X_CFLAGS=""
+ldns_with_pyldns=no
+ldns_with_pyldnsx=no
+
+# Check whether --with-pyldns was given.
+if test "${with_pyldns+set}" = set; then :
+ withval=$with_pyldns;
+else
+ withval="no"
+fi
+
+ldns_have_python=no
+if test x_$withval != x_no; then
+ # ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_python_devel.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PYTHON_DEVEL([version])
+#
+# DESCRIPTION
+#
+# Note: Defines as a precious variable "PYTHON_VERSION". Don't override it
+# in your configure.ac.
+#
+# This macro checks for Python and tries to get the include path to
+# 'Python.h'. It provides the $(PYTHON_CPPFLAGS) and $(PYTHON_LDFLAGS)
+# output variables. It also exports $(PYTHON_EXTRA_LIBS) and
+# $(PYTHON_EXTRA_LDFLAGS) for embedding Python in your code.
+#
+# You can search for some particular version of Python by passing a
+# parameter to this macro, for example ">= '2.3.1'", or "== '2.4'". Please
+# note that you *have* to pass also an operator along with the version to
+# match, and pay special attention to the single quotes surrounding the
+# version number. Don't use "PYTHON_VERSION" for this: that environment
+# variable is declared as precious and thus reserved for the end-user.
+#
+# This macro should work for all versions of Python >= 2.1.0. As an end
+# user, you can disable the check for the python version by setting the
+# PYTHON_NOVERSIONCHECK environment variable to something else than the
+# empty string.
+#
+# If you need to use this macro for an older Python version, please
+# contact the authors. We're always open for feedback.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Sebastian Huber <sebastian-huber@web.de>
+# Copyright (c) 2009 Alan W. Irwin
+# Copyright (c) 2009 Rafael Laboissiere <rafael@laboissiere.net>
+# Copyright (c) 2009 Andrew Collier
+# Copyright (c) 2009 Matteo Settenvini <matteo@member.fsf.org>
+# Copyright (c) 2009 Horst Knorr <hk_classes@knoda.org>
+# Copyright (c) 2013 Daniel Mullner <muellner@math.stanford.edu>
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation, either version 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. You
+# need not follow the terms of the GNU General Public License when using
+# or distributing such scripts, even though portions of the text of the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+#serial 16
+
+# This is what autoupdate's m4 run will expand. It fires
+# the warning (with _au_warn_XXX), outputs it into the
+# updated configure.ac (with AC_DIAGNOSE), and then outputs
+# the replacement expansion.
+
+
+# This is an auxiliary macro that is also run when
+# autoupdate runs m4. It simply calls m4_warning, but
+# we need a wrapper so that each warning is emitted only
+# once. We break the quoting in m4_warning's argument in
+# order to expand this macro's arguments, not AU_DEFUN's.
+
+
+# Finally, this is the expansion that is picked up by
+# autoconf. It tells the user to run autoupdate, and
+# then outputs the replacement expansion. We do not care
+# about autoupdate's warning because that contains
+# information on what to do *after* running autoupdate.
+
+
+
+ ac_save_LIBS="$LIBS"
+
+ #
+ # Allow the use of a (user set) custom python version
+ #
+
+
+ # Extract the first word of "python[$PYTHON_VERSION]", so it can be a program name with args.
+set dummy python$PYTHON_VERSION; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PYTHON+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PYTHON in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PYTHON=$ac_cv_path_PYTHON
+if test -n "$PYTHON"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5
+$as_echo "$PYTHON" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ if test -z "$PYTHON"; then
+ as_fn_error $? "Cannot find python$PYTHON_VERSION in your system path" "$LINENO" 5
+ PYTHON_VERSION=""
+ fi
+
+ #
+ # Check for a version of Python >= 2.1.0
+ #
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a version of Python >= '2.1.0'" >&5
+$as_echo_n "checking for a version of Python >= '2.1.0'... " >&6; }
+ ac_supports_python_ver=`$PYTHON -c "import sys; \
+ ver = sys.version.split ()[0]; \
+ print (ver >= '2.1.0')"`
+ if test "$ac_supports_python_ver" != "True"; then
+ if test -z "$PYTHON_NOVERSIONCHECK"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "
+This version of the AC_PYTHON_DEVEL macro
+doesn't work properly with versions of Python before
+2.1.0. You may need to re-run configure, setting the
+variables PYTHON_CPPFLAGS, PYTHON_LDFLAGS, PYTHON_SITE_PKG,
+PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand.
+Moreover, to disable this check, set PYTHON_NOVERSIONCHECK
+to something else than an empty string.
+
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: skip at user request" >&5
+$as_echo "skip at user request" >&6; }
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ fi
+
+ #
+ # if the macro parameter ``version'' is set, honour it
+ #
+ if test -n ">= '2.4.0'"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a version of Python >= '2.4.0'" >&5
+$as_echo_n "checking for a version of Python >= '2.4.0'... " >&6; }
+ ac_supports_python_ver=`$PYTHON -c "import sys; \
+ ver = sys.version.split ()[0]; \
+ print (ver >= '2.4.0')"`
+ if test "$ac_supports_python_ver" = "True"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ as_fn_error $? "this package requires Python >= '2.4.0'.
+If you have it installed, but it isn't the default Python
+interpreter in your system path, please pass the PYTHON_VERSION
+variable to configure. See \`\`configure --help'' for reference.
+" "$LINENO" 5
+ PYTHON_VERSION=""
+ fi
+ fi
+
+ #
+ # Check if you have distutils, else fail
+ #
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the distutils Python package" >&5
+$as_echo_n "checking for the distutils Python package... " >&6; }
+ ac_distutils_result=`$PYTHON -c "import distutils" 2>&1`
+ if test -z "$ac_distutils_result"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ as_fn_error $? "cannot import Python module \"distutils\".
+Please check your Python installation. The error was:
+$ac_distutils_result" "$LINENO" 5
+ PYTHON_VERSION=""
+ fi
+
+ #
+ # Check for Python include path
+ #
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python include path" >&5
+$as_echo_n "checking for Python include path... " >&6; }
+ if test -z "$PYTHON_CPPFLAGS"; then
+ python_path=`$PYTHON -c "import distutils.sysconfig; \
+ print (distutils.sysconfig.get_python_inc ());"`
+ plat_python_path=`$PYTHON -c "import distutils.sysconfig; \
+ print (distutils.sysconfig.get_python_inc (plat_specific=1));"`
+ if test -n "${python_path}"; then
+ if test "${plat_python_path}" != "${python_path}"; then
+ python_path="-I$python_path -I$plat_python_path"
+ else
+ python_path="-I$python_path"
+ fi
+ fi
+ PYTHON_CPPFLAGS=$python_path
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_CPPFLAGS" >&5
+$as_echo "$PYTHON_CPPFLAGS" >&6; }
+
+
+ #
+ # Check for Python library path
+ #
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python library path" >&5
+$as_echo_n "checking for Python library path... " >&6; }
+ if test -z "$PYTHON_LDFLAGS"; then
+ # (makes two attempts to ensure we've got a version number
+ # from the interpreter)
+ ac_python_version=`cat<<EOD | $PYTHON -
+
+# join all versioning strings, on some systems
+# major/minor numbers could be in different list elements
+from distutils.sysconfig import *
+e = get_config_var('VERSION')
+if e is not None:
+ print(e)
+EOD`
+
+ if test -z "$ac_python_version"; then
+ if test -n "$PYTHON_VERSION"; then
+ ac_python_version=$PYTHON_VERSION
+ else
+ ac_python_version=`$PYTHON -c "import sys; \
+ print (sys.version[:3])"`
+ fi
+ fi
+
+ # Make the versioning information available to the compiler
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_PYTHON "$ac_python_version"
+_ACEOF
+
+
+ # First, the library directory:
+ ac_python_libdir=`cat<<EOD | $PYTHON -
+
+# There should be only one
+import distutils.sysconfig
+e = distutils.sysconfig.get_config_var('LIBDIR')
+if e is not None:
+ print (e)
+EOD`
+
+ # Now, for the library:
+ ac_python_library=`cat<<EOD | $PYTHON -
+
+import distutils.sysconfig
+c = distutils.sysconfig.get_config_vars()
+if 'LDVERSION' in c:
+ print ('python'+c['LDVERSION'])
+else:
+ print ('python'+c['VERSION'])
+EOD`
+
+ # This small piece shamelessly adapted from PostgreSQL python macro;
+ # credits goes to momjian, I think. I'd like to put the right name
+ # in the credits, if someone can point me in the right direction... ?
+ #
+ if test -n "$ac_python_libdir" -a -n "$ac_python_library"
+ then
+ # use the official shared library
+ ac_python_library=`echo "$ac_python_library" | sed "s/^lib//"`
+ PYTHON_LDFLAGS="-L$ac_python_libdir -l$ac_python_library"
+ else
+ # old way: use libpython from python_configdir
+ ac_python_libdir=`$PYTHON -c \
+ "from distutils.sysconfig import get_python_lib as f; \
+ import os; \
+ print (os.path.join(f(plat_specific=1, standard_lib=1), 'config'));"`
+ PYTHON_LDFLAGS="-L$ac_python_libdir -lpython$ac_python_version"
+ fi
+
+ if test -z "PYTHON_LDFLAGS"; then
+ as_fn_error $? "
+ Cannot determine location of your Python DSO. Please check it was installed with
+ dynamic libraries enabled, or try setting PYTHON_LDFLAGS by hand.
+ " "$LINENO" 5
+ fi
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_LDFLAGS" >&5
+$as_echo "$PYTHON_LDFLAGS" >&6; }
+
+
+ #
+ # Check for site packages
+ #
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python site-packages path" >&5
+$as_echo_n "checking for Python site-packages path... " >&6; }
+ if test -z "$PYTHON_SITE_PKG"; then
+ PYTHON_SITE_PKG=`$PYTHON -c "import distutils.sysconfig; \
+ print (distutils.sysconfig.get_python_lib(1,0));"`
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_SITE_PKG" >&5
+$as_echo "$PYTHON_SITE_PKG" >&6; }
+
+
+ #
+ # libraries which must be linked in when embedding
+ #
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking python extra libraries" >&5
+$as_echo_n "checking python extra libraries... " >&6; }
+ if test -z "$PYTHON_EXTRA_LIBS"; then
+ PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \
+ conf = distutils.sysconfig.get_config_var; \
+ print (conf('LIBS'))"`
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_EXTRA_LIBS" >&5
+$as_echo "$PYTHON_EXTRA_LIBS" >&6; }
+
+
+ #
+ # linking flags needed when embedding
+ #
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking python extra linking flags" >&5
+$as_echo_n "checking python extra linking flags... " >&6; }
+ if test -z "$PYTHON_EXTRA_LDFLAGS"; then
+ PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import distutils.sysconfig; \
+ conf = distutils.sysconfig.get_config_var; \
+ print (conf('LINKFORSHARED'))"`
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_EXTRA_LDFLAGS" >&5
+$as_echo "$PYTHON_EXTRA_LDFLAGS" >&6; }
+
+
+ #
+ # final check to see if everything compiles alright
+ #
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking consistency of all components of python development environment" >&5
+$as_echo_n "checking consistency of all components of python development environment... " >&6; }
+ # save current global flags
+ ac_save_LIBS="$LIBS"
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ LIBS="$ac_save_LIBS $PYTHON_LDFLAGS $PYTHON_EXTRA_LDFLAGS $PYTHON_EXTRA_LIBS"
+ CPPFLAGS="$ac_save_CPPFLAGS $PYTHON_CPPFLAGS"
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <Python.h>
+int
+main ()
+{
+Py_Initialize();
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ pythonexists=yes
+else
+ pythonexists=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ # turn back to default flags
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ LIBS="$ac_save_LIBS"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pythonexists" >&5
+$as_echo "$pythonexists" >&6; }
+
+ if test ! "x$pythonexists" = "xyes"; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "
+ Could not link test program to Python. Maybe the main Python library has been
+ installed in some non-standard library path. If so, pass it to configure,
+ via the LDFLAGS environment variable.
+ Example: ./configure LDFLAGS=\"-L/usr/non-standard-path/python/lib\"
+ ============================================================================
+ ERROR!
+ You probably have to install the development version of the Python package
+ for your distribution. The exact name of this package varies among them.
+ ============================================================================
+
+See \`config.log' for more details" "$LINENO" 5; }
+ PYTHON_VERSION=""
+ fi
+
+ #
+ # all done!
+ #
+
+ if test ! -z "$ac_python_version"; then
+ ldns_have_python=yes
+ fi
+
+ # pass additional Python 3 option to SWIG
+ if test `$PYTHON -c "import sys; \
+ ver = sys.version.split()[0]; \
+ print(ver >= '3')"` = "True"; then
+ SWIGPY3="-py3 -DPY3"
+
+ fi
+
+ # check for SWIG
+ if test x_$ldns_have_python != x_no; then
+ # ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_pkg_swig.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PKG_SWIG([major.minor.micro], [action-if-found], [action-if-not-found])
+#
+# DESCRIPTION
+#
+# This macro searches for a SWIG installation on your system. If found,
+# then SWIG is AC_SUBST'd; if not found, then $SWIG is empty. If SWIG is
+# found, then SWIG_LIB is set to the SWIG library path, and AC_SUBST'd.
+#
+# You can use the optional first argument to check if the version of the
+# available SWIG is greater than or equal to the value of the argument. It
+# should have the format: N[.N[.N]] (N is a number between 0 and 999. Only
+# the first N is mandatory.) If the version argument is given (e.g.
+# 1.3.17), AX_PKG_SWIG checks that the swig package is this version number
+# or higher.
+#
+# As usual, action-if-found is executed if SWIG is found, otherwise
+# action-if-not-found is executed.
+#
+# In configure.in, use as:
+#
+# AX_PKG_SWIG(1.3.17, [], [ AC_MSG_ERROR([SWIG is required to build..]) ])
+# AX_SWIG_ENABLE_CXX
+# AX_SWIG_MULTI_MODULE_SUPPORT
+# AX_SWIG_PYTHON
+#
+# LICENSE
+#
+# Copyright (c) 2008 Sebastian Huber <sebastian-huber@web.de>
+# Copyright (c) 2008 Alan W. Irwin <irwin@beluga.phys.uvic.ca>
+# Copyright (c) 2008 Rafael Laboissiere <rafael@laboissiere.net>
+# Copyright (c) 2008 Andrew Collier <colliera@ukzn.ac.za>
+# Copyright (c) 2011 Murray Cumming <murrayc@openismus.com>
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 2 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. You
+# need not follow the terms of the GNU General Public License when using
+# or distributing such scripts, even though portions of the text of the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+#serial 8
+
+
+
+
+ # check for >=SWIG-2.0.4 if Python 3.2 used
+ if test `$PYTHON -c "import sys; \
+ ver = sys.version.split()[0]; \
+ print(ver >= '3.2')"` = "True"; then
+
+ # Ubuntu has swig 2.0 as /usr/bin/swig2.0
+ for ac_prog in swig2.0 swig
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_SWIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $SWIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_SWIG="$SWIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_SWIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+SWIG=$ac_cv_path_SWIG
+if test -n "$SWIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SWIG" >&5
+$as_echo "$SWIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$SWIG" && break
+done
+
+ if test -z "$SWIG" ; then
+ as_fn_error $? "SWIG-2.0.4 is required to build pyldns for Python 3.2 and greater." "$LINENO" 5
+ elif test -n "2.0.4" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking SWIG version" >&5
+$as_echo_n "checking SWIG version... " >&6; }
+ swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $swig_version" >&5
+$as_echo "$swig_version" >&6; }
+ if test -n "$swig_version" ; then
+ # Calculate the required version number components
+ required=2.0.4
+ required_major=`echo $required | sed 's/[^0-9].*//'`
+ if test -z "$required_major" ; then
+ required_major=0
+ fi
+ required=`echo $required | sed 's/[0-9]*[^0-9]//'`
+ required_minor=`echo $required | sed 's/[^0-9].*//'`
+ if test -z "$required_minor" ; then
+ required_minor=0
+ fi
+ required=`echo $required | sed 's/[0-9]*[^0-9]//'`
+ required_patch=`echo $required | sed 's/[^0-9].*//'`
+ if test -z "$required_patch" ; then
+ required_patch=0
+ fi
+ # Calculate the available version number components
+ available=$swig_version
+ available_major=`echo $available | sed 's/[^0-9].*//'`
+ if test -z "$available_major" ; then
+ available_major=0
+ fi
+ available=`echo $available | sed 's/[0-9]*[^0-9]//'`
+ available_minor=`echo $available | sed 's/[^0-9].*//'`
+ if test -z "$available_minor" ; then
+ available_minor=0
+ fi
+ available=`echo $available | sed 's/[0-9]*[^0-9]//'`
+ available_patch=`echo $available | sed 's/[^0-9].*//'`
+ if test -z "$available_patch" ; then
+ available_patch=0
+ fi
+ # Convert the version tuple into a single number for easier comparison.
+ # Using base 100 should be safe since SWIG internally uses BCD values
+ # to encode its version number.
+ required_swig_vernum=`expr $required_major \* 10000 \
+ \+ $required_minor \* 100 \+ $required_patch`
+ available_swig_vernum=`expr $available_major \* 10000 \
+ \+ $available_minor \* 100 \+ $available_patch`
+
+ if test $available_swig_vernum -lt $required_swig_vernum; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: SWIG version >= 2.0.4 is required. You have $swig_version." >&5
+$as_echo "$as_me: WARNING: SWIG version >= 2.0.4 is required. You have $swig_version." >&2;}
+ SWIG=''
+ as_fn_error $? "SWIG-2.0.4 is required to build pyldns for Python 3.2 and greater." "$LINENO" 5
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SWIG library" >&5
+$as_echo_n "checking for SWIG library... " >&6; }
+ SWIG_LIB=`$SWIG -swiglib`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SWIG_LIB" >&5
+$as_echo "$SWIG_LIB" >&6; }
+
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot determine SWIG version" >&5
+$as_echo "$as_me: WARNING: cannot determine SWIG version" >&2;}
+ SWIG=''
+ as_fn_error $? "SWIG-2.0.4 is required to build pyldns for Python 3.2 and greater." "$LINENO" 5
+ fi
+ fi
+
+
+ else
+
+ # Ubuntu has swig 2.0 as /usr/bin/swig2.0
+ for ac_prog in swig2.0 swig
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_SWIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $SWIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_SWIG="$SWIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_SWIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+SWIG=$ac_cv_path_SWIG
+if test -n "$SWIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SWIG" >&5
+$as_echo "$SWIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$SWIG" && break
+done
+
+ if test -z "$SWIG" ; then
+ :
+ elif test -n "" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking SWIG version" >&5
+$as_echo_n "checking SWIG version... " >&6; }
+ swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $swig_version" >&5
+$as_echo "$swig_version" >&6; }
+ if test -n "$swig_version" ; then
+ # Calculate the required version number components
+ required=
+ required_major=`echo $required | sed 's/[^0-9].*//'`
+ if test -z "$required_major" ; then
+ required_major=0
+ fi
+ required=`echo $required | sed 's/[0-9]*[^0-9]//'`
+ required_minor=`echo $required | sed 's/[^0-9].*//'`
+ if test -z "$required_minor" ; then
+ required_minor=0
+ fi
+ required=`echo $required | sed 's/[0-9]*[^0-9]//'`
+ required_patch=`echo $required | sed 's/[^0-9].*//'`
+ if test -z "$required_patch" ; then
+ required_patch=0
+ fi
+ # Calculate the available version number components
+ available=$swig_version
+ available_major=`echo $available | sed 's/[^0-9].*//'`
+ if test -z "$available_major" ; then
+ available_major=0
+ fi
+ available=`echo $available | sed 's/[0-9]*[^0-9]//'`
+ available_minor=`echo $available | sed 's/[^0-9].*//'`
+ if test -z "$available_minor" ; then
+ available_minor=0
+ fi
+ available=`echo $available | sed 's/[0-9]*[^0-9]//'`
+ available_patch=`echo $available | sed 's/[^0-9].*//'`
+ if test -z "$available_patch" ; then
+ available_patch=0
+ fi
+ # Convert the version tuple into a single number for easier comparison.
+ # Using base 100 should be safe since SWIG internally uses BCD values
+ # to encode its version number.
+ required_swig_vernum=`expr $required_major \* 10000 \
+ \+ $required_minor \* 100 \+ $required_patch`
+ available_swig_vernum=`expr $available_major \* 10000 \
+ \+ $available_minor \* 100 \+ $available_patch`
+
+ if test $available_swig_vernum -lt $required_swig_vernum; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: SWIG version >= is required. You have $swig_version." >&5
+$as_echo "$as_me: WARNING: SWIG version >= is required. You have $swig_version." >&2;}
+ SWIG=''
+
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SWIG library" >&5
+$as_echo_n "checking for SWIG library... " >&6; }
+ SWIG_LIB=`$SWIG -swiglib`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SWIG_LIB" >&5
+$as_echo "$SWIG_LIB" >&6; }
+
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot determine SWIG version" >&5
+$as_echo "$as_me: WARNING: cannot determine SWIG version" >&2;}
+ SWIG=''
+
+ fi
+ fi
+
+
+ fi
+
+ if test ! -x "$SWIG"; then
+ as_fn_error $? "failed to find SWIG tool, install it, or do not build pyldns" "$LINENO" 5
+ else
+
+$as_echo "#define HAVE_SWIG 1" >>confdefs.h
+
+ PYLDNS="pyldns"
+
+ swig="$SWIG"
+
+ ldns_with_pyldns=yes
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: *** don't have Python, skipping SWIG, no pyldns ***" >&5
+$as_echo "*** don't have Python, skipping SWIG, no pyldns ***" >&6; } # '
+ fi
+
+ # xtra cflags for pyldns
+ if test x_$ldns_have_python != x_no; then
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -fno-strict-aliasing" >&5
+$as_echo_n "checking whether $CC supports -fno-strict-aliasing... " >&6; }
+cache=`echo fno-strict-aliasing | sed 'y%.=/+-%___p_%'`
+if eval \${cv_prog_cc_flag_$cache+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+echo 'void f(void){}' >conftest.c
+if test -z "`$CC $CPPFLAGS $CFLAGS -fno-strict-aliasing -c conftest.c 2>&1`"; then
+eval "cv_prog_cc_flag_$cache=yes"
+else
+eval "cv_prog_cc_flag_$cache=no"
+fi
+rm -f conftest conftest.o conftest.c
+
+fi
+
+if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+:
+PYTHON_X_CFLAGS="-fno-strict-aliasing"
+else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+:
+
+fi
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wno-missing-field-initializers" >&5
+$as_echo_n "checking whether $CC supports -Wno-missing-field-initializers... " >&6; }
+cache=`echo Wno-missing-field-initializers | sed 'y%.=/+-%___p_%'`
+if eval \${cv_prog_cc_flag_$cache+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+echo 'void f(void){}' >conftest.c
+if test -z "`$CC $CPPFLAGS $CFLAGS -Wno-missing-field-initializers -c conftest.c 2>&1`"; then
+eval "cv_prog_cc_flag_$cache=yes"
+else
+eval "cv_prog_cc_flag_$cache=no"
+fi
+rm -f conftest conftest.o conftest.c
+
+fi
+
+if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+:
+PYTHON_X_CFLAGS="-Wno-missing-field-initializers $PYTHON_X_CFLAGS"
+else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+:
+
+fi
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wno-unused-parameter" >&5
+$as_echo_n "checking whether $CC supports -Wno-unused-parameter... " >&6; }
+cache=`echo Wno-unused-parameter | sed 'y%.=/+-%___p_%'`
+if eval \${cv_prog_cc_flag_$cache+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+echo 'void f(void){}' >conftest.c
+if test -z "`$CC $CPPFLAGS $CFLAGS -Wno-unused-parameter -c conftest.c 2>&1`"; then
+eval "cv_prog_cc_flag_$cache=yes"
+else
+eval "cv_prog_cc_flag_$cache=no"
+fi
+rm -f conftest conftest.o conftest.c
+
+fi
+
+if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+:
+PYTHON_X_CFLAGS="-Wno-unused-parameter $PYTHON_X_CFLAGS"
+else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+:
+
+fi
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wno-unused-variable" >&5
+$as_echo_n "checking whether $CC supports -Wno-unused-variable... " >&6; }
+cache=`echo Wno-unused-variable | sed 'y%.=/+-%___p_%'`
+if eval \${cv_prog_cc_flag_$cache+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+echo 'void f(void){}' >conftest.c
+if test -z "`$CC $CPPFLAGS $CFLAGS -Wno-unused-variable -c conftest.c 2>&1`"; then
+eval "cv_prog_cc_flag_$cache=yes"
+else
+eval "cv_prog_cc_flag_$cache=no"
+fi
+rm -f conftest conftest.o conftest.c
+
+fi
+
+if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+:
+PYTHON_X_CFLAGS="-Wno-unused-variable $PYTHON_X_CFLAGS"
+else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+:
+
+fi
+
+ fi
+fi
+
+
+# Check for pyldnsx
+
+# Check whether --with-pyldnsx was given.
+if test "${with_pyldnsx+set}" = set; then :
+ withval=$with_pyldnsx;
+else
+ withval="with_pyldns"
+fi
+
+if test x_$withval != x_no; then
+ if test x_$ldns_with_pyldns != x_no; then
+ PYLDNSX="pyldnsx"
+
+ ldns_with_pyldnsx=yes
+ else
+ if test x_$withval != x_with_pyldns; then
+ as_fn_error $? "--with-pyldns is needed for the ldnsx python module" "$LINENO" 5
+ fi
+ fi
+fi
+
+if test x_$ldns_with_pyldns != x_no; then
+ PYLDNSINST="install-pyldns"
+ PYLDNSUNINST="uninstall-pyldns"
+
+else
+ PYLDNSINST=""
+ PYLDNSUNINST=""
+
+fi
+if test x_$ldns_with_pyldnsx != x_no; then
+ PYLDNSXINST="install-pyldnsx"
+ PYLDNSXUNINST="uninstall-pyldnsx"
+
+else
+ PYLDNSXINST=""
+ PYLDNSXUNINST=""
+
+fi
+
+# check for perl
+ldns_with_p5_dns_ldns=no
+
+# Check whether --with-p5-dns-ldns was given.
+if test "${with_p5_dns_ldns+set}" = set; then :
+ withval=$with_p5_dns_ldns;
+else
+ withval="no"
+fi
+
+ldns_have_perl=no
+if test x_$withval != x_no; then
+ # Extract the first word of "perl", so it can be a program name with args.
+set dummy perl; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PERL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PERL in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PERL=$ac_cv_path_PERL
+if test -n "$PERL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5
+$as_echo "$PERL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ if test -z "$PERL"; then
+ as_fn_error $? "Cannot find perl in your system path" "$LINENO" 5
+ fi
+ P5_DNS_LDNS="p5-dns-ldns"
+ TEST_P5_DNS_LDNS="test-p5-dns-ldns"
+ INSTALL_P5_DNS_LDNS="install-p5-dns-ldns"
+ UNINSTALL_P5_DNS_LDNS="uninstall-p5-dns-ldns"
+ CLEAN_P5_DNS_LDNS="clean-p5-dns-ldns"
+
+else
+ P5_DNS_LDNS=""
+ TEST_P5_DNS_LDNS=""
+ INSTALL_P5_DNS_LDNS=""
+ UNINSTALL_P5_DNS_LDNS=""
+ CLEAN_P5_DNS_LDNS=""
+
+fi
+
+# Use libtool
+
+# skip these tests, we do not need them.
+
+
+
+
+
+
+
+
+# always use ./libtool unless override from commandline (libtool=mylibtool)
+if test -z "$libtool"; then
+ libtool="./libtool"
+fi
+
+# avoid libtool max commandline length test on systems that fork slowly.
+
+if echo "$host_os" | grep "sunos4" >/dev/null; then
+ lt_cv_sys_max_cmd_len=32750;
+fi
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $AR in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_AR="$AR" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_AR="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+AR=$ac_cv_path_AR
+if test -n "$AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_AR"; then
+ ac_pt_AR=$AR
+ # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $ac_pt_AR in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_ac_pt_AR="$ac_pt_AR" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_ac_pt_AR="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+ac_pt_AR=$ac_cv_path_ac_pt_AR
+if test -n "$ac_pt_AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_AR" >&5
+$as_echo "$ac_pt_AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_pt_AR" = x; then
+ AR="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ AR=$ac_pt_AR
+ fi
+else
+ AR="$ac_cv_path_AR"
+fi
+
+if test $AR = false; then
+ as_fn_error $? "Cannot find 'ar', please extend PATH to include it" "$LINENO" 5
+fi
+
+
+
+
+
+
tmp_CPPFLAGS=$CPPFLAGS
tmp_LDFLAGS=$LDFLAGS
tmp_LIBS=$LIBS
@@ -14723,11 +14870,122 @@ _ACEOF
;;
esac
+# Check whether --enable-dane was given.
+if test "${enable_dane+set}" = set; then :
+ enableval=$enable_dane;
+fi
+
+case "$enable_dane" in
+ no)
+ ldns_build_config_use_dane=0
+
+ ;;
+ *) if test "x$HAVE_SSL" != "xyes"; then
+ as_fn_error $? "DANE enabled, but no SSL support" "$LINENO" 5
+ fi
+ ac_fn_c_check_func "$LINENO" "X509_check_ca" "ac_cv_func_X509_check_ca"
+if test "x$ac_cv_func_X509_check_ca" = xyes; then :
+
+else
+ as_fn_error $? "OpenSSL does not support DANE: please upgrade OpenSSL or rerun with --disable-dane" "$LINENO" 5
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define USE_DANE 1
+_ACEOF
+
+ ldns_build_config_use_dane=1
+
+ ;;
+esac
+
+# Check whether --enable-rrtype-ninfo was given.
+if test "${enable_rrtype_ninfo+set}" = set; then :
+ enableval=$enable_rrtype_ninfo;
+fi
+
+case "$enable_rrtype_ninfo" in
+ yes)
+
+cat >>confdefs.h <<_ACEOF
+#define RRTYPE_NINFO /**/
+_ACEOF
+
+ ;;
+ no|*)
+ ;;
+esac
+# Check whether --enable-rrtype-rkey was given.
+if test "${enable_rrtype_rkey+set}" = set; then :
+ enableval=$enable_rrtype_rkey;
+fi
+
+case "$enable_rrtype_rkey" in
+ yes)
+
+cat >>confdefs.h <<_ACEOF
+#define RRTYPE_RKEY /**/
+_ACEOF
+
+ ;;
+ no|*)
+ ;;
+esac
+# Check whether --enable-rrtype-cds was given.
+if test "${enable_rrtype_cds+set}" = set; then :
+ enableval=$enable_rrtype_cds;
+fi
+
+case "$enable_rrtype_cds" in
+ yes)
+
+cat >>confdefs.h <<_ACEOF
+#define RRTYPE_CDS /**/
+_ACEOF
+
+ ;;
+ no|*)
+ ;;
+esac
+# Check whether --enable-rrtype-uri was given.
+if test "${enable_rrtype_uri+set}" = set; then :
+ enableval=$enable_rrtype_uri;
+fi
+
+case "$enable_rrtype_uri" in
+ yes)
+
+cat >>confdefs.h <<_ACEOF
+#define RRTYPE_URI /**/
+_ACEOF
+
+ ;;
+ no|*)
+ ;;
+esac
+# Check whether --enable-rrtype-ta was given.
+if test "${enable_rrtype_ta+set}" = set; then :
+ enableval=$enable_rrtype_ta;
+fi
+
+case "$enable_rrtype_ta" in
+ yes)
+
+cat >>confdefs.h <<_ACEOF
+#define RRTYPE_TA /**/
+_ACEOF
+
+ ;;
+ no|*)
+ ;;
+esac
+
if test "x$HAVE_SSL" = "xyes"; then
-LIBSSL_SSL_LIBS="$LIBSSL_LIBS -lssl"
+LIBSSL_SSL_LIBS="-lssl $LIBSSL_LIBS"
fi
CPPFLAGS=$tmp_CPPFLAGS
@@ -15365,14 +15623,13 @@ _ACEOF
if test x_$with_examples != x_no; then
for ac_header in pcap.h
do :
- ac_fn_c_check_header_mongrel "$LINENO" "pcap.h" "ac_cv_header_pcap_h" "$ac_includes_default"
+ ac_fn_c_check_header_compile "$LINENO" "pcap.h" "ac_cv_header_pcap_h" "$ac_includes_default
+"
if test "x$ac_cv_header_pcap_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_PCAP_H 1
_ACEOF
-else
- $ac_includes_default
fi
done
@@ -15505,41 +15762,17 @@ _ACEOF
fi
-
- ac_fn_c_check_type "$LINENO" "intptr_t" "ac_cv_type_intptr_t" "$ac_includes_default"
+ac_fn_c_check_type "$LINENO" "intptr_t" "ac_cv_type_intptr_t" "$ac_includes_default"
if test "x$ac_cv_type_intptr_t" = xyes; then :
-$as_echo "#define HAVE_INTPTR_T 1" >>confdefs.h
-
else
- for ac_type in 'int' 'long int' 'long long int'; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
cat >>confdefs.h <<_ACEOF
-#define intptr_t $ac_type
+#define intptr_t size_t
_ACEOF
- ac_type=
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- test -z "$ac_type" && break
- done
fi
-
ac_fn_c_check_type "$LINENO" "in_addr_t" "ac_cv_type_in_addr_t" "
#if HAVE_SYS_TYPES_H
# include <sys/types.h>
@@ -15781,34 +16014,6 @@ esac
fi
-ac_fn_c_check_func "$LINENO" "b32_pton" "ac_cv_func_b32_pton"
-if test "x$ac_cv_func_b32_pton" = xyes; then :
- $as_echo "#define HAVE_B32_PTON 1" >>confdefs.h
-
-else
- case " $LIBOBJS " in
- *" b32_pton.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS b32_pton.$ac_objext"
- ;;
-esac
-
-fi
-
-
-ac_fn_c_check_func "$LINENO" "b32_ntop" "ac_cv_func_b32_ntop"
-if test "x$ac_cv_func_b32_ntop" = xyes; then :
- $as_echo "#define HAVE_B32_NTOP 1" >>confdefs.h
-
-else
- case " $LIBOBJS " in
- *" b32_ntop.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS b32_ntop.$ac_objext"
- ;;
-esac
-
-fi
-
-
ac_fn_c_check_func "$LINENO" "calloc" "ac_cv_func_calloc"
if test "x$ac_cv_func_calloc" = xyes; then :
$as_echo "#define HAVE_CALLOC 1" >>confdefs.h
@@ -16215,7 +16420,7 @@ $as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h
fi
-for ac_func in endprotoent endservent sleep random fcntl strtoul bzero memset
+for ac_func in endprotoent endservent sleep random fcntl strtoul bzero memset b32_ntop b32_pton
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -16227,6 +16432,20 @@ _ACEOF
fi
done
+if test "x$HAVE_B32_NTOP" = "xyes"; then
+ ldns_build_config_have_b32_ntop=1
+
+else
+ ldns_build_config_have_b32_ntop=0
+
+fi
+if test "x$HAVE_B32_PTON" = "xyes"; then
+ ldns_build_config_have_b32_pton=1
+
+else
+ ldns_build_config_have_b32_pton=0
+
+fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo" >&5
@@ -17181,7 +17400,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by ldns $as_me 1.6.16, which was
+This file was extended by ldns $as_me 1.6.17, which was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -17247,7 +17466,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-ldns config.status 1.6.16
+ldns config.status 1.6.17
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index fae43271960a..5f25c7dc4236 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6,20 +6,23 @@ sinclude(acx_nlnetlabs.m4)
# must be numbers. ac_defun because of later processing.
m4_define([VERSION_MAJOR],[1])
m4_define([VERSION_MINOR],[6])
-m4_define([VERSION_MICRO],[16])
+m4_define([VERSION_MICRO],[17])
AC_INIT(ldns, m4_defn([VERSION_MAJOR]).m4_defn([VERSION_MINOR]).m4_defn([VERSION_MICRO]), libdns@nlnetlabs.nl, libdns)
AC_CONFIG_SRCDIR([packet.c])
# needed to build correct soname
-AC_SUBST(LIBTOOL_VERSION_INFO, VERSION_MAJOR:VERSION_MINOR:VERSION_MICRO)
AC_SUBST(LDNS_VERSION_MAJOR, [VERSION_MAJOR])
AC_SUBST(LDNS_VERSION_MINOR, [VERSION_MINOR])
AC_SUBST(LDNS_VERSION_MICRO, [VERSION_MICRO])
+AC_SUBST(VERSION_INFO, [VERSION_MAJOR:VERSION_MINOR:VERSION_MICRO])
+
+AC_AIX
+LT_INIT
+AC_CONFIG_MACRO_DIR([m4])
OURCPPFLAGS=''
CPPFLAGS=${CPPFLAGS:-${OURCPPFLAGS}}
CFLAGS="$CFLAGS"
-AC_AIX
# Checks for programs.
AC_PROG_CC
ACX_DEPFLAG
@@ -70,6 +73,7 @@ fi
ACX_CHECK_COMPILER_FLAG(Wall, [CFLAGS="-Wall $CFLAGS"])
ACX_CHECK_COMPILER_FLAG(W, [CFLAGS="-W $CFLAGS"])
ACX_CHECK_COMPILER_FLAG(Wwrite-strings, [CFLAGS="-Wwrite-strings $CFLAGS"])
+ACX_CHECK_COMPILER_FLAG(Wstrict-prototypes, [CFLAGS="-Wstrict-prototypes $CFLAGS"])
AC_CHECK_HEADERS([getopt.h time.h],,, [AC_INCLUDES_DEFAULT])
@@ -152,7 +156,7 @@ else
fi
# add option to disable installation of ldns-config script
-AC_ARG_ENABLE(ldns-config, [ --disable-ldns-config disable installation of ldns-config (default=enabled)],
+AC_ARG_ENABLE(ldns-config, AC_HELP_STRING([--disable-ldns-config], [disable installation of ldns-config (default=enabled)]),
enable_ldns_config=$enableval, enable_ldns_config=yes)
if test "x$enable_ldns_config" = xyes; then
AC_SUBST(INSTALL_CONFIG, [install-config])
@@ -166,6 +170,16 @@ else
AC_SUBST(UNINSTALL_CONFIG_MANPAGE, [""])
fi
+# add option to disable library printing to stderr
+AC_ARG_ENABLE(stderr-msgs, AC_HELP_STRING([--enable-stderr-msgs], [Enable printing to stderr (default=disabled)]), enable_stderr_msgs=$enableval, enable_stderr_msgs=no)
+case "$enable_stderr_msgs" in
+ no) dnl default
+ ;;
+ *)
+ AC_DEFINE_UNQUOTED([STDERR_MSGS], [1], [Define this to enable messages to stderr.])
+ ;;
+esac
+
# check for python
PYTHON_X_CFLAGS=""
ldns_with_pyldns=no
@@ -255,6 +269,30 @@ else
AC_SUBST(PYLDNSXUNINST, "")
fi
+# check for perl
+ldns_with_p5_dns_ldns=no
+AC_ARG_WITH(p5-dns-ldns, AC_HELP_STRING([--with-p5-dns-ldns],
+ [generate DNS::LDNS perl bindings]),
+ [],[ withval="no" ])
+ldns_have_perl=no
+if test x_$withval != x_no; then
+ AC_PATH_PROG([PERL], [perl])
+ if test -z "$PERL"; then
+ AC_MSG_ERROR([Cannot find perl in your system path])
+ fi
+ AC_SUBST(P5_DNS_LDNS, "p5-dns-ldns")dnl
+ AC_SUBST(TEST_P5_DNS_LDNS, "test-p5-dns-ldns")dnl
+ AC_SUBST(INSTALL_P5_DNS_LDNS, "install-p5-dns-ldns")dnl
+ AC_SUBST(UNINSTALL_P5_DNS_LDNS, "uninstall-p5-dns-ldns")dnl
+ AC_SUBST(CLEAN_P5_DNS_LDNS, "clean-p5-dns-ldns")
+else
+ AC_SUBST(P5_DNS_LDNS, "")dnl
+ AC_SUBST(TEST_P5_DNS_LDNS, "")dnl
+ AC_SUBST(INSTALL_P5_DNS_LDNS, "")dnl
+ AC_SUBST(UNINSTALL_P5_DNS_LDNS, "")dnl
+ AC_SUBST(CLEAN_P5_DNS_LDNS, "")
+fi
+
# Use libtool
ACX_LIBTOOL_C_ONLY
@@ -320,11 +358,67 @@ case "$enable_ecdsa" in
;;
esac
+AC_ARG_ENABLE(dane, AC_HELP_STRING([--disable-dane], [Disable DANE support]))
+case "$enable_dane" in
+ no)
+ AC_SUBST(ldns_build_config_use_dane, 0)
+ ;;
+ *) dnl default
+ if test "x$HAVE_SSL" != "xyes"; then
+ AC_MSG_ERROR([DANE enabled, but no SSL support])
+ fi
+ AC_CHECK_FUNC(X509_check_ca, [], [AC_MSG_ERROR([OpenSSL does not support DANE: please upgrade OpenSSL or rerun with --disable-dane])])
+ AC_DEFINE_UNQUOTED([USE_DANE], [1], [Define this to enable DANE support.])
+ AC_SUBST(ldns_build_config_use_dane, 1)
+ ;;
+esac
+
+AC_ARG_ENABLE(rrtype-ninfo, AC_HELP_STRING([--enable-rrtype-ninfo], [Enable draft RR type ninfo.]))
+case "$enable_rrtype_ninfo" in
+ yes)
+ AC_DEFINE_UNQUOTED([RRTYPE_NINFO], [], [Define this to enable RR type NINFO.])
+ ;;
+ no|*)
+ ;;
+esac
+AC_ARG_ENABLE(rrtype-rkey, AC_HELP_STRING([--enable-rrtype-rkey], [Enable draft RR type rkey.]))
+case "$enable_rrtype_rkey" in
+ yes)
+ AC_DEFINE_UNQUOTED([RRTYPE_RKEY], [], [Define this to enable RR type RKEY.])
+ ;;
+ no|*)
+ ;;
+esac
+AC_ARG_ENABLE(rrtype-cds, AC_HELP_STRING([--enable-rrtype-cds], [Enable draft RR type cds.]))
+case "$enable_rrtype_cds" in
+ yes)
+ AC_DEFINE_UNQUOTED([RRTYPE_CDS], [], [Define this to enable RR type CDS.])
+ ;;
+ no|*)
+ ;;
+esac
+AC_ARG_ENABLE(rrtype-uri, AC_HELP_STRING([--enable-rrtype-uri], [Enable draft RR type uri.]))
+case "$enable_rrtype_uri" in
+ yes)
+ AC_DEFINE_UNQUOTED([RRTYPE_URI], [], [Define this to enable RR type URI.])
+ ;;
+ no|*)
+ ;;
+esac
+AC_ARG_ENABLE(rrtype-ta, AC_HELP_STRING([--enable-rrtype-ta], [Enable draft RR type ta.]))
+case "$enable_rrtype_ta" in
+ yes)
+ AC_DEFINE_UNQUOTED([RRTYPE_TA], [], [Define this to enable RR type TA.])
+ ;;
+ no|*)
+ ;;
+esac
+
AC_SUBST(LIBSSL_CPPFLAGS)
AC_SUBST(LIBSSL_LDFLAGS)
AC_SUBST(LIBSSL_LIBS)
if test "x$HAVE_SSL" = "xyes"; then
-AC_SUBST(LIBSSL_SSL_LIBS, ["$LIBSSL_LIBS -lssl"])
+AC_SUBST(LIBSSL_SSL_LIBS, ["-lssl $LIBSSL_LIBS"])
fi
CPPFLAGS=$tmp_CPPFLAGS
LDFLAGS=$tmp_LDFLAGS
@@ -426,7 +520,7 @@ AC_INCLUDES_DEFAULT
])
if test x_$with_examples != x_no; then
-AC_CHECK_HEADERS([pcap.h],, [AC_INCLUDES_DEFAULT])
+AC_CHECK_HEADERS([pcap.h],,, [AC_INCLUDES_DEFAULT])
AC_CHECK_LIB(pcap, pcap_open_offline, [
AC_DEFINE([HAVE_LIBPCAP], [1], [Define to 1 if you have the `pcap' library (-lpcap).])dnl`
AC_SUBST([LIBPCAP_LIBS], [-lpcap])
@@ -458,8 +552,9 @@ else
AC_SUBST(ldns_build_config_have_socklen_t, 0)
fi
AC_TYPE_SIZE_T
-AC_TYPE_SSIZE_T
-AC_TYPE_INTPTR_T
+AC_CHECK_TYPE(ssize_t, int)
+dnl AC_TYPE_INTPTR_T does not work on all platforms (autoconf)
+AC_CHECK_TYPE(intptr_t, size_t)
AC_CHECK_TYPE(in_addr_t, [], [AC_DEFINE([in_addr_t], [uint32_t], [in_addr_t])], [
#if HAVE_SYS_TYPES_H
# include <sys/types.h>
@@ -481,8 +576,6 @@ AC_FUNC_REALLOC
AC_REPLACE_FUNCS(b64_pton)
AC_REPLACE_FUNCS(b64_ntop)
-AC_REPLACE_FUNCS(b32_pton)
-AC_REPLACE_FUNCS(b32_ntop)
AC_REPLACE_FUNCS(calloc)
AC_REPLACE_FUNCS(timegm)
AC_REPLACE_FUNCS(gmtime_r)
@@ -497,7 +590,17 @@ AC_REPLACE_FUNCS(snprintf)
AC_REPLACE_FUNCS(strlcpy)
AC_REPLACE_FUNCS(memmove)
AC_FUNC_FORK
-AC_CHECK_FUNCS([endprotoent endservent sleep random fcntl strtoul bzero memset])
+AC_CHECK_FUNCS([endprotoent endservent sleep random fcntl strtoul bzero memset b32_ntop b32_pton])
+if test "x$HAVE_B32_NTOP" = "xyes"; then
+ AC_SUBST(ldns_build_config_have_b32_ntop, 1)
+else
+ AC_SUBST(ldns_build_config_have_b32_ntop, 0)
+fi
+if test "x$HAVE_B32_PTON" = "xyes"; then
+ AC_SUBST(ldns_build_config_have_b32_pton, 1)
+else
+ AC_SUBST(ldns_build_config_have_b32_pton, 0)
+fi
ACX_CHECK_GETADDRINFO_WITH_INCLUDES
if test $ac_cv_func_getaddrinfo = no; then
@@ -618,7 +721,6 @@ AH_BOTTOM([
extern "C" {
#endif
-#ifndef B64_PTON
int ldns_b64_ntop(uint8_t const *src, size_t srclength,
char *target, size_t targsize);
/**
@@ -629,8 +731,6 @@ static inline size_t ldns_b64_ntop_calculate_size(size_t srcsize)
{
return ((((srcsize + 2) / 3) * 4) + 1);
}
-#endif /* !B64_PTON */
-#ifndef B64_NTOP
int ldns_b64_pton(char const *src, uint8_t *target, size_t targsize);
/**
* calculates the size needed to store the result of ldns_b64_pton
@@ -640,7 +740,12 @@ static inline size_t ldns_b64_pton_calculate_size(size_t srcsize)
{
return (((((srcsize + 3) / 4) * 3)) + 1);
}
-#endif /* !B64_NTOP */
+
+/**
+ * Given in dnssec_zone.c, also used in dnssec_sign.c:w
+
+ */
+int ldns_dname_compare_v(const void *a, const void *b);
#ifndef HAVE_SLEEP
/* use windows sleep, in millisecs, instead */
diff --git a/contrib/DNS-LDNS/Changes b/contrib/DNS-LDNS/Changes
new file mode 100644
index 000000000000..b718c30222e6
--- /dev/null
+++ b/contrib/DNS-LDNS/Changes
@@ -0,0 +1,23 @@
+Revision history for Perl extension DNS::LDNS.
+
+0.01 Thu Nov 22 12:48:29 2012
+ - original version; created by h2xs 1.23 with options
+ -A -n LDNS
+
+0.02 Fri Jan 18 09:47:57 2013
+ - Support for DNSSec and Resolver. Added some more constants from
+ the header files; created by h2xs 1.23 with options
+ -n LDNS /usr/include/ldns/ldns.h /usr/include/ldns/error.h /usr/include/ldns/rr.h /usr/include/ldns/keys.h /usr/include/ldns/packet.h /usr/include/ldns/resolver.h /usr/include/ldns/rdata.h /usr/include/ldns/dnssec.h
+
+0.03 Fri Apr 19 13:40:57 2013
+ - Renamed module to Net::LDNS
+
+0.04 Fri Dec 13 14:15:26 2013
+ - Renamed module to DNS::LDNS
+
+0.05 Mon Dec 30 10:14:00 2013
+ - Corrected versioning variable in all classes.
+ - Cleaned up the base class documentation.
+
+0.06 Tue Dec 31 12:17:00 2013
+ - Corrected pod syntax
diff --git a/contrib/DNS-LDNS/LDNS.xs b/contrib/DNS-LDNS/LDNS.xs
new file mode 100644
index 000000000000..83f09ddee777
--- /dev/null
+++ b/contrib/DNS-LDNS/LDNS.xs
@@ -0,0 +1,3363 @@
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+#include "ppport.h"
+
+#include "ldns/ldns.h"
+#include "ldns/error.h"
+#include "ldns/rr.h"
+#include "ldns/keys.h"
+#include "ldns/dname.h"
+#include "ldns/host2str.h"
+#include "ldns/rdata.h"
+#include "ldns/rbtree.h"
+#include "ldns/resolver.h"
+#include "ldns/packet.h"
+#include "ldns/dnssec.h"
+
+#include "ldns/dnssec_zone.h"
+#include "ldns/dnssec_verify.h"
+#include "ldns/dnssec_sign.h"
+#include "ldns/rr_functions.h"
+
+#if LDNS_REVISION < ((1<<16)|(6<<8)|(17))
+ #define LDNS_RDF_TYPE_HIP LDNS_RDF_TYPE_TSIG
+#endif
+
+#include "const-c.inc"
+
+typedef ldns_zone * DNS__LDNS__Zone;
+typedef ldns_rr_list * DNS__LDNS__RRList;
+typedef ldns_rr * DNS__LDNS__RR;
+typedef ldns_rr * DNS__LDNS__RR__Opt;
+typedef ldns_rdf * DNS__LDNS__RData;
+typedef ldns_rdf * DNS__LDNS__RData__Opt;
+typedef ldns_dnssec_zone * DNS__LDNS__DNSSecZone;
+typedef ldns_dnssec_rrsets * DNS__LDNS__DNSSecRRSets;
+typedef ldns_dnssec_rrs * DNS__LDNS__DNSSecRRs;
+typedef ldns_dnssec_name * DNS__LDNS__DNSSecName;
+typedef ldns_rbtree_t * DNS__LDNS__RBTree;
+typedef ldns_rbnode_t * DNS__LDNS__RBNode;
+typedef ldns_resolver * DNS__LDNS__Resolver;
+typedef ldns_pkt * DNS__LDNS__Packet;
+typedef ldns_key * DNS__LDNS__Key;
+typedef ldns_key_list * DNS__LDNS__KeyList;
+typedef ldns_dnssec_data_chain * DNS__LDNS__DNSSecDataChain;
+typedef ldns_dnssec_trust_tree * DNS__LDNS__DNSSecTrustTree;
+typedef const char * Mortal_PV;
+
+typedef ldns_pkt_opcode LDNS_Pkt_Opcode;
+typedef ldns_pkt_rcode LDNS_Pkt_Rcode;
+typedef ldns_pkt_section LDNS_Pkt_Section;
+typedef ldns_pkt_type LDNS_Pkt_Type;
+typedef ldns_rr_type LDNS_RR_Type;
+typedef ldns_rr_class LDNS_RR_Class;
+typedef ldns_rdf_type LDNS_RDF_Type;
+typedef ldns_hash LDNS_Hash;
+typedef ldns_status LDNS_Status;
+typedef ldns_signing_algorithm LDNS_Signing_Algorithm;
+
+/* callback function used by the signing methods */
+int sign_policy(ldns_rr *sig, void *n) {
+ return *(uint16_t*)n;
+}
+
+/* utility methods */
+void add_cloned_rrs_to_list(ldns_rr_list * list, ldns_rr_list * add) {
+ size_t count;
+ size_t i;
+
+ count = ldns_rr_list_rr_count(add);
+
+ for(i = 0; i < count; i++) {
+ ldns_rr_list_push_rr(list, ldns_rr_clone(ldns_rr_list_rr(add, i)));
+ }
+}
+
+
+#if LDNS_REVISION < ((1<<16)|(6<<8)|(12))
+ldns_dnssec_trust_tree *ldns_dnssec_derive_trust_tree_time(
+ ldns_dnssec_data_chain *data_chain,
+ ldns_rr *rr, time_t check_time);
+ldns_rr_list *ldns_fetch_valid_domain_keys_time(const ldns_resolver * res,
+ const ldns_rdf * domain, const ldns_rr_list * keys,
+ time_t check_time, ldns_status *status);
+ldns_rr_list *ldns_validate_domain_dnskey_time(
+ const ldns_resolver *res, const ldns_rdf *domain,
+ const ldns_rr_list *keys, time_t check_time);
+ldns_rr_list *ldns_validate_domain_ds_time(
+ const ldns_resolver *res, const ldns_rdf *domain,
+ const ldns_rr_list * keys, time_t check_time);
+
+ldns_dnssec_trust_tree *ldns_dnssec_derive_trust_tree_time(
+ ldns_dnssec_data_chain *data_chain,
+ ldns_rr *rr, time_t check_time) {
+ Perl_croak(aTHX_ "function ldns_dnssec_derive_trust_tree_time is not implemented in this version of ldns");
+}
+
+ldns_rr_list *ldns_fetch_valid_domain_keys_time(const ldns_resolver * res,
+ const ldns_rdf * domain, const ldns_rr_list * keys,
+ time_t check_time, ldns_status *status) {
+ Perl_croak(aTHX_ "function ldns_fetch_valid_domain_keys_time is not implemented in this version of ldns");
+}
+
+ldns_rr_list *ldns_validate_domain_dnskey_time(
+ const ldns_resolver *res, const ldns_rdf *domain,
+ const ldns_rr_list *keys, time_t check_time) {
+ Perl_croak(aTHX_ "function ldns_validate_domain_dnskey_time is not implemented in this version of ldns");
+}
+
+ldns_rr_list *ldns_validate_domain_ds_time(
+ const ldns_resolver *res, const ldns_rdf *domain,
+ const ldns_rr_list * keys, time_t check_time) {
+ Perl_croak(aTHX_ "function ldns_validate_domain_ds_time is not implemented in this version of ldns");
+}
+
+
+#endif
+
+
+MODULE = DNS::LDNS PACKAGE = DNS::LDNS
+
+INCLUDE: const-xs.inc
+
+const char *
+ldns_get_errorstr_by_id(s)
+ LDNS_Status s
+ ALIAS:
+ errorstr_by_id = 1
+
+Mortal_PV
+ldns_rr_type2str(type)
+ LDNS_RR_Type type;
+ ALIAS:
+ rr_type2str = 1
+
+Mortal_PV
+ldns_rr_class2str(class)
+ LDNS_RR_Class class;
+ ALIAS:
+ rr_class2str = 1
+
+Mortal_PV
+ldns_pkt_opcode2str(opcode)
+ LDNS_Pkt_Opcode opcode;
+ ALIAS:
+ pkt_opcode2str = 1
+
+Mortal_PV
+ldns_pkt_rcode2str(rcode)
+ LDNS_Pkt_Rcode rcode;
+ ALIAS:
+ pkt_rcode2str = 1
+
+LDNS_RR_Type
+ldns_get_rr_type_by_name(name)
+ char * name;
+ ALIAS:
+ rr_type_by_name = 1
+
+LDNS_RR_Class
+ldns_get_rr_class_by_name(name)
+ char * name;
+ ALIAS:
+ rr_class_by_name = 1
+
+DNS__LDNS__RR
+ldns_dnssec_create_nsec(from, to, nsec_type)
+ DNS__LDNS__DNSSecName from;
+ DNS__LDNS__DNSSecName to;
+ LDNS_RR_Type nsec_type;
+ ALIAS:
+ dnssec_create_nsec = 1
+
+DNS__LDNS__RR
+dnssec_create_nsec3(from, to, zone_name, algorithm, flags, iterations, salt)
+ DNS__LDNS__DNSSecName from;
+ DNS__LDNS__DNSSecName to;
+ DNS__LDNS__RData zone_name;
+ uint8_t algorithm;
+ uint8_t flags;
+ uint16_t iterations;
+ char * salt;
+ CODE:
+ RETVAL = ldns_dnssec_create_nsec3(from, to, zone_name, algorithm, flags, iterations, strlen(salt), (uint8_t*)salt);
+ OUTPUT:
+ RETVAL
+
+DNS__LDNS__RR
+ldns_create_nsec(current, next, rrs)
+ DNS__LDNS__RData current;
+ DNS__LDNS__RData next;
+ DNS__LDNS__RRList rrs;
+ ALIAS:
+ create_nsec = 1
+
+DNS__LDNS__RR
+create_nsec3(cur_owner, cur_zone, rrs, algorithm, flags, iterations, salt, emptynonterminal)
+ DNS__LDNS__RData cur_owner;
+ DNS__LDNS__RData cur_zone;
+ DNS__LDNS__RRList rrs;
+ uint8_t algorithm;
+ uint8_t flags;
+ uint16_t iterations;
+ char * salt;
+ bool emptynonterminal;
+ CODE:
+ RETVAL = ldns_create_nsec3(cur_owner, cur_zone, rrs, algorithm,
+ flags, iterations, strlen(salt), (uint8_t*)salt, emptynonterminal);
+ OUTPUT:
+ RETVAL
+
+LDNS_Signing_Algorithm
+ldns_get_signing_algorithm_by_name(name)
+ const char * name;
+ ALIAS:
+ signing_algorithm_by_name = 1
+
+int
+ldns_key_algo_supported(algorithm)
+ int algorithm;
+ ALIAS:
+ key_algorithm_supported = 1
+
+DNS__LDNS__RR
+ldns_read_anchor_file(filename)
+ char * filename;
+ ALIAS:
+ read_anchor_file = 1
+
+MODULE = DNS::LDNS PACKAGE = DNS::LDNS::GC
+
+void
+ldns_zone_deep_free(zone)
+ DNS__LDNS__Zone zone;
+ ALIAS:
+ _zone_deep_free = 1
+
+void
+ldns_rr_list_deep_free(list)
+ DNS__LDNS__RRList list;
+ ALIAS:
+ _rrlist_deep_free = 1
+
+void
+ldns_rr_free(rr)
+ DNS__LDNS__RR rr;
+ ALIAS:
+ _rr_free = 1
+
+void
+ldns_rdf_deep_free(rdf)
+ DNS__LDNS__RData rdf;
+ ALIAS:
+ _rdata_deep_free = 1
+
+void
+ldns_dnssec_zone_deep_free(zone)
+ DNS__LDNS__DNSSecZone zone;
+ ALIAS:
+ _dnssec_zone_deep_free = 1
+
+void
+ldns_dnssec_name_deep_free(name)
+ DNS__LDNS__DNSSecName name;
+ ALIAS:
+ _dnssec_name_deep_free = 1
+
+void
+ldns_resolver_deep_free(resolver)
+ DNS__LDNS__Resolver resolver;
+ ALIAS:
+ _resolver_deep_free = 1
+
+void
+ldns_pkt_free(pkt)
+ DNS__LDNS__Packet pkt;
+ ALIAS:
+ _packet_free = 1
+
+void
+ldns_key_deep_free(key)
+ DNS__LDNS__Key key;
+ ALIAS:
+ _key_deep_free = 1
+
+void
+ldns_key_list_free(keylist)
+ DNS__LDNS__KeyList keylist;
+ ALIAS:
+ _keylist_free = 1
+
+void
+ldns_dnssec_data_chain_deep_free(chain)
+ DNS__LDNS__DNSSecDataChain chain;
+ ALIAS:
+ _dnssec_datachain_deep_free = 1
+
+void
+ldns_dnssec_trust_tree_free(tree)
+ DNS__LDNS__DNSSecTrustTree tree;
+ ALIAS:
+ _dnssec_trusttree_free = 1
+
+MODULE = DNS::LDNS PACKAGE = DNS::LDNS::Zone
+
+PROTOTYPES: ENABLE
+
+DNS__LDNS__Zone
+ldns_zone_new()
+ ALIAS:
+ _new = 1
+
+DNS__LDNS__Zone
+_new_from_file(fp, origin, ttl, c, s, line_nr)
+ FILE* fp;
+ DNS__LDNS__RData__Opt origin;
+ uint32_t ttl;
+ LDNS_RR_Class c;
+ LDNS_Status s;
+ int line_nr;
+ PREINIT:
+ ldns_zone *z;
+ CODE:
+ if (ttl == 0) { ttl = 0; }
+ RETVAL = NULL;
+ s = ldns_zone_new_frm_fp_l(&z, fp, origin, ttl, c, &line_nr);
+
+ if (s == LDNS_STATUS_OK) {
+ RETVAL = z;
+ }
+
+ OUTPUT:
+ RETVAL
+ s
+ line_nr
+
+void
+print(zone, fp)
+ DNS__LDNS__Zone zone;
+ FILE* fp;
+ CODE:
+ ldns_zone_print(fp, zone);
+
+void
+canonicalize(zone)
+ DNS__LDNS__Zone zone;
+ PREINIT:
+ ldns_rr_list *list;
+ size_t count;
+ size_t i;
+ CODE:
+ list = ldns_zone_rrs(zone);
+ count = ldns_rr_list_rr_count(list);
+
+ ldns_rr2canonical(ldns_zone_soa(zone));
+ for (i = 0; i < ldns_rr_list_rr_count(ldns_zone_rrs(zone)); i++) {
+ ldns_rr2canonical(ldns_rr_list_rr(ldns_zone_rrs(zone), i));
+ }
+
+void
+ldns_zone_sort(zone)
+ DNS__LDNS__Zone zone;
+ ALIAS:
+ sort = 1
+
+DNS__LDNS__RR
+ldns_zone_soa(zone)
+ DNS__LDNS__Zone zone;
+ ALIAS:
+ _soa = 1
+
+void
+ldns_zone_set_soa(zone, soa)
+ DNS__LDNS__Zone zone;
+ DNS__LDNS__RR soa;
+ ALIAS:
+ _set_soa = 1
+
+DNS__LDNS__RRList
+ldns_zone_rrs(zone)
+ DNS__LDNS__Zone zone;
+ ALIAS:
+ _rrs = 1
+
+void
+ldns_zone_set_rrs(zone, list)
+ DNS__LDNS__Zone zone;
+ DNS__LDNS__RRList list;
+ ALIAS:
+ _set_rrs = 1
+
+DNS__LDNS__Zone
+ldns_zone_sign(zone, keylist)
+ DNS__LDNS__Zone zone;
+ DNS__LDNS__KeyList keylist;
+ ALIAS:
+ sign = 1
+
+DNS__LDNS__Zone
+sign_nsec3(zone, keylist, algorithm, flags, iterations, salt)
+ DNS__LDNS__Zone zone;
+ DNS__LDNS__KeyList keylist;
+ uint8_t algorithm;
+ uint8_t flags;
+ uint16_t iterations;
+ unsigned char * salt;
+ CODE:
+ RETVAL = ldns_zone_sign_nsec3(zone, keylist, algorithm, flags, iterations, strlen(salt), (uint8_t*)salt);
+ OUTPUT:
+ RETVAL
+
+
+MODULE = DNS::LDNS PACKAGE = DNS::LDNS::RRList
+
+PROTOTYPES: ENABLE
+
+DNS__LDNS__RRList
+ldns_rr_list_new()
+ ALIAS:
+ _new = 1
+
+DNS__LDNS__RRList
+_new_hosts_from_file(fp, line_nr)
+ FILE * fp;
+ int line_nr;
+ CODE:
+ RETVAL = ldns_get_rr_list_hosts_frm_fp_l(fp, &line_nr);
+ OUTPUT:
+ RETVAL
+
+DNS__LDNS__RRList
+ldns_rr_list_clone(list)
+ DNS__LDNS__RRList list;
+ ALIAS:
+ clone = 1
+
+void
+print(list, fp)
+ DNS__LDNS__RRList list;
+ FILE* fp;
+ CODE:
+ ldns_rr_list_print(fp, list);
+
+Mortal_PV
+ldns_rr_list2str(list)
+ DNS__LDNS__RRList list;
+ ALIAS:
+ to_string = 1
+
+DNS__LDNS__RR
+ldns_rr_list_rr(list, i)
+ DNS__LDNS__RRList list;
+ size_t i;
+ ALIAS:
+ _rr = 1
+
+DNS__LDNS__RR
+ldns_rr_list_pop_rr(list)
+ DNS__LDNS__RRList list;
+ ALIAS:
+ pop = 1
+
+bool
+ldns_rr_list_push_rr(list, rr)
+ DNS__LDNS__RRList list;
+ DNS__LDNS__RR rr;
+ ALIAS:
+ _push = 1
+
+size_t
+ldns_rr_list_rr_count(list)
+ DNS__LDNS__RRList list;
+ ALIAS:
+ rr_count = 1
+
+int
+ldns_rr_list_compare(list, otherlist)
+ DNS__LDNS__RRList list;
+ DNS__LDNS__RRList otherlist;
+ ALIAS:
+ compare = 1
+
+DNS__LDNS__RRList
+ldns_rr_list_subtype_by_rdf(list, rdf, pos)
+ DNS__LDNS__RRList list;
+ DNS__LDNS__RData rdf;
+ size_t pos;
+ ALIAS:
+ subtype_by_rdata = 1
+
+DNS__LDNS__RRList
+ldns_rr_list_pop_rrset(list)
+ DNS__LDNS__RRList list;
+ ALIAS:
+ pop_rrset = 1
+
+bool
+ldns_is_rrset(list)
+ DNS__LDNS__RRList list;
+ ALIAS:
+ is_rrset = 1
+
+bool
+ldns_rr_list_contains_rr(list, rr)
+ DNS__LDNS__RRList list;
+ DNS__LDNS__RR rr;
+ ALIAS:
+ contains_rr = 1
+
+DNS__LDNS__RRList
+ldns_rr_list_pop_rr_list(list, count)
+ DNS__LDNS__RRList list;
+ size_t count;
+ ALIAS:
+ pop_list = 1
+
+bool
+_push_list(list, otherlist)
+ DNS__LDNS__RRList list;
+ DNS__LDNS__RRList otherlist;
+ PREINIT:
+ bool ret;
+ CODE:
+ ret = ldns_rr_list_push_rr_list(list, otherlist);
+ if (ret) {
+ ldns_rr_list_free(otherlist);
+ }
+ OUTPUT:
+ RETVAL
+
+LDNS_Status
+_verify_rrsig_keylist(rrset, rrsig, keys, good_keys)
+ DNS__LDNS__RRList rrset;
+ DNS__LDNS__RR rrsig;
+ DNS__LDNS__RRList keys;
+ DNS__LDNS__RRList good_keys;
+ PREINIT:
+ DNS__LDNS__RRList gk;
+ CODE:
+ gk = ldns_rr_list_new();
+ RETVAL = ldns_verify_rrsig_keylist(rrset, rrsig, keys, good_keys);
+ add_cloned_rrs_to_list(good_keys, gk);
+ ldns_rr_list_free(gk);
+ OUTPUT:
+ RETVAL
+
+LDNS_Status
+_verify_rrsig_keylist_time(rrset, rrsig, keys, check_time, good_keys)
+ DNS__LDNS__RRList rrset;
+ DNS__LDNS__RR rrsig;
+ DNS__LDNS__RRList keys;
+ time_t check_time;
+ DNS__LDNS__RRList good_keys;
+ PREINIT:
+ DNS__LDNS__RRList gk;
+ CODE:
+ gk = ldns_rr_list_new();
+ RETVAL = ldns_verify_rrsig_keylist_time(
+ rrset, rrsig, keys, check_time, good_keys);
+ add_cloned_rrs_to_list(good_keys, gk);
+ ldns_rr_list_free(gk);
+ OUTPUT:
+ RETVAL
+
+LDNS_Status
+_verify_rrsig_keylist_notime(rrset, rrsig, keys, good_keys)
+ DNS__LDNS__RRList rrset;
+ DNS__LDNS__RR rrsig;
+ DNS__LDNS__RRList keys;
+ DNS__LDNS__RRList good_keys;
+ PREINIT:
+ DNS__LDNS__RRList gk;
+ CODE:
+ gk = ldns_rr_list_new();
+ RETVAL = ldns_verify_rrsig_keylist_notime(rrset, rrsig, keys, NULL);
+ add_cloned_rrs_to_list(good_keys, gk);
+ ldns_rr_list_free(gk);
+ OUTPUT:
+ RETVAL
+
+LDNS_Status
+ldns_verify_rrsig(rrset, rrsig, key)
+ DNS__LDNS__RRList rrset;
+ DNS__LDNS__RR rrsig;
+ DNS__LDNS__RR key;
+ ALIAS:
+ _verify_rrsig = 1
+
+LDNS_Status
+ldns_verify_rrsig_time(rrset, rrsig, key, check_time)
+ DNS__LDNS__RRList rrset;
+ DNS__LDNS__RR rrsig;
+ DNS__LDNS__RR key;
+ time_t check_time;
+ ALIAS:
+ _verify_rrsig_time = 1
+
+LDNS_Status
+_verify(rrset, rrsig, keys, good_keys)
+ DNS__LDNS__RRList rrset;
+ DNS__LDNS__RRList rrsig;
+ DNS__LDNS__RRList keys;
+ DNS__LDNS__RRList good_keys;
+ PREINIT:
+ DNS__LDNS__RRList gk;
+ CODE:
+ gk = ldns_rr_list_new();
+ RETVAL = ldns_verify(rrset, rrsig, keys, gk);
+ add_cloned_rrs_to_list(good_keys, gk);
+ ldns_rr_list_free(gk);
+ OUTPUT:
+ RETVAL
+
+LDNS_Status
+_verify_time(rrset, rrsig, keys, check_time, good_keys)
+ DNS__LDNS__RRList rrset;
+ DNS__LDNS__RRList rrsig;
+ DNS__LDNS__RRList keys;
+ time_t check_time;
+ DNS__LDNS__RRList good_keys;
+ PREINIT:
+ DNS__LDNS__RRList gk;
+ CODE:
+ gk = ldns_rr_list_new();
+ RETVAL = ldns_verify_time(rrset, rrsig, keys, check_time, gk);
+ add_cloned_rrs_to_list(good_keys, gk);
+ ldns_rr_list_free(gk);
+ OUTPUT:
+ RETVAL
+
+LDNS_Status
+_verify_notime(rrset, rrsig, keys, good_keys)
+ DNS__LDNS__RRList rrset;
+ DNS__LDNS__RRList rrsig;
+ DNS__LDNS__RRList keys;
+ DNS__LDNS__RRList good_keys;
+ PREINIT:
+ DNS__LDNS__RRList gk;
+ CODE:
+ gk = ldns_rr_list_new();
+ RETVAL = ldns_verify_notime(rrset, rrsig, keys, gk);
+ add_cloned_rrs_to_list(good_keys, gk);
+ ldns_rr_list_free(gk);
+ OUTPUT:
+ RETVAL
+
+DNS__LDNS__RR
+ldns_create_empty_rrsig(rrset, current_key)
+ DNS__LDNS__RRList rrset;
+ DNS__LDNS__Key current_key;
+ ALIAS:
+ create_empty_rrsig = 1
+
+DNS__LDNS__RRList
+ldns_sign_public(rrset, keys)
+ DNS__LDNS__RRList rrset;
+ DNS__LDNS__KeyList keys;
+ ALIAS:
+ sign_public = 1
+
+void
+ldns_rr_list_sort(list)
+ DNS__LDNS__RRList list;
+ ALIAS:
+ sort = 1
+
+void
+ldns_rr_list_sort_nsec3(list)
+ DNS__LDNS__RRList list;
+ ALIAS:
+ sort_nsec3 = 1
+
+void
+ldns_rr_list2canonical(list)
+ DNS__LDNS__RRList list;
+ ALIAS:
+ canonicalize = 1
+
+DNS__LDNS__RR
+ldns_dnssec_get_dnskey_for_rrsig(rr, rrlist)
+ DNS__LDNS__RR rr;
+ DNS__LDNS__RRList rrlist;
+ ALIAS:
+ _get_dnskey_for_rrsig = 1
+
+DNS__LDNS__RR
+ldns_dnssec_get_rrsig_for_name_and_type(name, type, rrsigs)
+ DNS__LDNS__RData name;
+ LDNS_RR_Type type;
+ DNS__LDNS__RRList rrsigs;
+ ALIAS:
+ _get_rrsig_for_name_and_type = 1
+
+
+MODULE = DNS::LDNS PACKAGE = DNS::LDNS::RR
+
+PROTOTYPES: ENABLE
+
+DNS__LDNS__RR
+ldns_rr_new()
+ ALIAS:
+ _new = 1
+
+DNS__LDNS__RR
+ldns_rr_new_frm_type(t)
+ LDNS_RR_Type t;
+ ALIAS:
+ _new_from_type = 1
+
+DNS__LDNS__RR
+_new_from_str(str, default_ttl, origin, s)
+ const char* str;
+ uint32_t default_ttl;
+ DNS__LDNS__RData__Opt origin;
+ LDNS_Status s;
+ PREINIT:
+ DNS__LDNS__RR rr = NULL;
+ CODE:
+ s = ldns_rr_new_frm_str(&rr, str, default_ttl, origin, NULL);
+ if (s == LDNS_STATUS_OK) {
+ RETVAL = rr;
+ }
+ OUTPUT:
+ RETVAL
+ s
+
+DNS__LDNS__RR
+_new_from_file(fp, origin, default_ttl, s, line_nr)
+ FILE* fp;
+ DNS__LDNS__RData__Opt origin;
+ uint32_t default_ttl;
+ LDNS_Status s;
+ int line_nr;
+ PREINIT:
+ ldns_rr *rr;
+ ldns_rdf *oclone = NULL;
+ CODE:
+ RETVAL = NULL;
+ /* Clone the origin object because the call may change/replace it and
+ then it must be freed */
+ if (origin) {
+ oclone = ldns_rdf_clone(origin);
+ }
+ s = ldns_rr_new_frm_fp_l(&rr, fp, &default_ttl, &oclone, NULL,
+ &line_nr);
+
+ if (oclone) {
+ ldns_rdf_deep_free(oclone);
+ }
+
+ if (s == LDNS_STATUS_OK) {
+ RETVAL = rr;
+ }
+
+ OUTPUT:
+ RETVAL
+ s
+ line_nr
+
+DNS__LDNS__RR
+ldns_rr_clone(rr)
+ DNS__LDNS__RR rr;
+ ALIAS:
+ clone = 1
+
+void
+ldns_rr_set_owner(rr, owner)
+ DNS__LDNS__RR rr;
+ DNS__LDNS__RData owner;
+ ALIAS:
+ _set_owner = 1
+
+void
+ldns_rr_set_ttl(rr, ttl)
+ DNS__LDNS__RR rr;
+ uint32_t ttl;
+ ALIAS:
+ set_ttl = 1
+
+void
+ldns_rr_set_type(rr, type)
+ DNS__LDNS__RR rr;
+ LDNS_RR_Type type;
+ ALIAS:
+ set_type = 1
+
+void
+ldns_rr_set_class(rr, class)
+ DNS__LDNS__RR rr;
+ LDNS_RR_Class class;
+ ALIAS:
+ set_class = 1
+
+void
+print(rr, fp)
+ DNS__LDNS__RR rr;
+ FILE* fp;
+ CODE:
+ ldns_rr_print(fp, rr);
+
+Mortal_PV
+ldns_rr2str(rr)
+ DNS__LDNS__RR rr;
+ ALIAS:
+ to_string = 1
+
+int
+ldns_rr_compare(rr, otherrr)
+ DNS__LDNS__RR rr;
+ DNS__LDNS__RR otherrr;
+ ALIAS:
+ compare = 1
+
+int
+ldns_rr_compare_no_rdata(rr, otherrr)
+ DNS__LDNS__RR rr;
+ DNS__LDNS__RR otherrr;
+ ALIAS:
+ compare_no_rdata = 1
+
+int
+ldns_rr_compare_ds(rr, otherrr)
+ DNS__LDNS__RR rr;
+ DNS__LDNS__RR otherrr;
+ ALIAS:
+ compare_ds = 1
+
+int
+compare_dname(rr, otherrr)
+ DNS__LDNS__RR rr;
+ DNS__LDNS__RR otherrr;
+ CODE:
+ RETVAL = ldns_dname_compare(
+ ldns_rr_owner(rr), ldns_rr_owner(otherrr));
+ OUTPUT:
+ RETVAL
+
+DNS__LDNS__RData
+ldns_rr_owner(rr)
+ DNS__LDNS__RR rr;
+ ALIAS:
+ _owner = 1
+
+size_t
+ldns_rr_rd_count(rr);
+ DNS__LDNS__RR rr;
+ ALIAS:
+ rd_count = 1
+
+DNS__LDNS__RData
+ldns_rr_rdf(rr, i)
+ DNS__LDNS__RR rr;
+ size_t i;
+ ALIAS:
+ _rdata = 1
+
+DNS__LDNS__RData
+ldns_rr_set_rdf(rr, rdf, i)
+ DNS__LDNS__RR rr;
+ DNS__LDNS__RData rdf;
+ size_t i;
+ ALIAS:
+ _set_rdata = 1
+
+uint32_t
+ldns_rr_ttl(rr)
+ DNS__LDNS__RR rr;
+ ALIAS:
+ ttl = 1
+
+LDNS_RR_Class
+ldns_rr_get_class(rr)
+ DNS__LDNS__RR rr;
+ ALIAS:
+ class = 1
+
+LDNS_RR_Type
+ldns_rr_get_type(rr)
+ DNS__LDNS__RR rr;
+ ALIAS:
+ type = 1
+
+DNS__LDNS__RData
+ldns_rr_pop_rdf(rr)
+ DNS__LDNS__RR rr;
+ ALIAS:
+ pop_rdata = 1
+
+bool
+ldns_rr_push_rdf(rr, rdf)
+ DNS__LDNS__RR rr;
+ DNS__LDNS__RData rdf;
+ ALIAS:
+ _push_rdata = 1
+
+DNS__LDNS__RData
+ldns_rr_rrsig_typecovered(rr)
+ DNS__LDNS__RR rr;
+ ALIAS:
+ _rrsig_typecovered = 1
+
+bool
+ldns_rr_rrsig_set_typecovered(rr, rdf)
+ DNS__LDNS__RR rr;
+ DNS__LDNS__RData rdf;
+ ALIAS:
+ _rrsig_set_typecovered = 1
+
+DNS__LDNS__RData
+ldns_rr_rrsig_algorithm(rr)
+ DNS__LDNS__RR rr;
+ ALIAS:
+ _rrsig_algorithm = 1
+
+bool
+ldns_rr_rrsig_set_algorithm(rr, rdf)
+ DNS__LDNS__RR rr;
+ DNS__LDNS__RData rdf;
+ ALIAS:
+ _rrsig_set_algorithm = 1
+
+DNS__LDNS__RData
+ldns_rr_rrsig_expiration(rr)
+ DNS__LDNS__RR rr;
+ ALIAS:
+ _rrsig_expiration = 1
+
+bool
+ldns_rr_rrsig_set_expiration(rr, rdf)
+ DNS__LDNS__RR rr;
+ DNS__LDNS__RData rdf;
+ ALIAS:
+ _rrsig_set_expiration = 1
+
+DNS__LDNS__RData
+ldns_rr_rrsig_inception(rr)
+ DNS__LDNS__RR rr;
+ ALIAS:
+ _rrsig_inception = 1
+
+bool
+ldns_rr_rrsig_set_inception(rr, rdf)
+ DNS__LDNS__RR rr;
+ DNS__LDNS__RData rdf;
+ ALIAS:
+ _rrsig_set_inception = 1
+
+DNS__LDNS__RData
+ldns_rr_rrsig_keytag(rr)
+ DNS__LDNS__RR rr;
+ ALIAS:
+ _rrsig_keytag = 1
+
+bool
+ldns_rr_rrsig_set_keytag(rr, rdf)
+ DNS__LDNS__RR rr;
+ DNS__LDNS__RData rdf;
+ ALIAS:
+ _rrsig_set_keytag = 1
+
+DNS__LDNS__RData
+ldns_rr_rrsig_sig(rr)
+ DNS__LDNS__RR rr;
+ ALIAS:
+ _rrsig_sig = 1
+
+bool
+ldns_rr_rrsig_set_sig(rr, rdf)
+ DNS__LDNS__RR rr;
+ DNS__LDNS__RData rdf;
+ ALIAS:
+ _rrsig_set_sig = 1
+
+DNS__LDNS__RData
+ldns_rr_rrsig_labels(rr)
+ DNS__LDNS__RR rr;
+ ALIAS:
+ _rrsig_labels = 1
+
+bool
+ldns_rr_rrsig_set_labels(rr, rdf)
+ DNS__LDNS__RR rr;
+ DNS__LDNS__RData rdf;
+ ALIAS:
+ _rrsig_set_labels = 1
+
+DNS__LDNS__RData
+ldns_rr_rrsig_origttl(rr)
+ DNS__LDNS__RR rr;
+ ALIAS:
+ _rrsig_origttl = 1
+
+bool
+ldns_rr_rrsig_set_origttl(rr, rdf)
+ DNS__LDNS__RR rr;
+ DNS__LDNS__RData rdf;
+ ALIAS:
+ _rrsig_set_origttl = 1
+
+DNS__LDNS__RData
+ldns_rr_rrsig_signame(rr)
+ DNS__LDNS__RR rr;
+ ALIAS:
+ _rrsig_signame = 1
+
+bool
+ldns_rr_rrsig_set_signame(rr, rdf)
+ DNS__LDNS__RR rr;
+ DNS__LDNS__RData rdf;
+ ALIAS:
+ _rrsig_set_signame = 1
+
+DNS__LDNS__RData
+ldns_rr_dnskey_algorithm(rr)
+ DNS__LDNS__RR rr;
+ ALIAS:
+ _dnskey_algorithm = 1
+
+bool
+ldns_rr_dnskey_set_algorithm(rr, rdf)
+ DNS__LDNS__RR rr;
+ DNS__LDNS__RData rdf;
+ ALIAS:
+ _dnskey_set_algorithm = 1
+
+DNS__LDNS__RData
+ldns_rr_dnskey_flags(rr)
+ DNS__LDNS__RR rr;
+ ALIAS:
+ _dnskey_flags = 1
+
+bool
+ldns_rr_dnskey_set_flags(rr, rdf)
+ DNS__LDNS__RR rr;
+ DNS__LDNS__RData rdf;
+ ALIAS:
+ _dnskey_set_flags = 1
+
+DNS__LDNS__RData
+ldns_rr_dnskey_protocol(rr)
+ DNS__LDNS__RR rr;
+ ALIAS:
+ _dnskey_protocol = 1
+
+bool
+ldns_rr_dnskey_set_protocol(rr, rdf)
+ DNS__LDNS__RR rr;
+ DNS__LDNS__RData rdf;
+ ALIAS:
+ _dnskey_set_protocol = 1
+
+DNS__LDNS__RData
+ldns_rr_dnskey_key(rr)
+ DNS__LDNS__RR rr;
+ ALIAS:
+ _dnskey_key = 1
+
+bool
+ldns_rr_dnskey_set_key(rr, rdf)
+ DNS__LDNS__RR rr;
+ DNS__LDNS__RData rdf;
+ ALIAS:
+ _dnskey_set_key = 1
+
+size_t
+ldns_rr_dnskey_key_size(rr)
+ DNS__LDNS__RR rr;
+ ALIAS:
+ dnskey_key_size = 1
+
+uint16_t
+ldns_calc_keytag(key)
+ DNS__LDNS__RR key;
+ ALIAS:
+ calc_keytag = 1
+
+DNS__LDNS__RData
+ldns_nsec3_hash_name_frm_nsec3(rr, name)
+ DNS__LDNS__RR rr;
+ DNS__LDNS__RData name;
+ ALIAS:
+ _hash_name_from_nsec3 = 1
+
+DNS__LDNS__RData
+_nsec3_hash_name(name, algorithm, iterations, salt)
+ DNS__LDNS__RData name;
+ uint8_t algorithm;
+ uint16_t iterations;
+ char * salt;
+ CODE:
+ RETVAL = ldns_nsec3_hash_name(name, algorithm, iterations,
+ strlen(salt), (uint8_t *)salt);
+ OUTPUT:
+ RETVAL
+
+LDNS_Status
+ldns_dnssec_verify_denial(rr, nsecs, rrsigs)
+ DNS__LDNS__RR rr;
+ DNS__LDNS__RRList nsecs;
+ DNS__LDNS__RRList rrsigs;
+ ALIAS:
+ _verify_denial = 1
+
+LDNS_Status
+ldns_dnssec_verify_denial_nsec3(rr, nsecs, rrsigs, packet_rcode, packet_qtype, packet_nodata)
+ DNS__LDNS__RR rr;
+ DNS__LDNS__RRList nsecs;
+ DNS__LDNS__RRList rrsigs;
+ LDNS_Pkt_Rcode packet_rcode;
+ LDNS_RR_Type packet_qtype;
+ signed char packet_nodata;
+ ALIAS:
+ _verify_denial_nsec3 = 1
+
+DNS__LDNS__RR
+_verify_denial_nsec3_match(rr, nsecs, rrsigs, packet_rcode, packet_qtype, packet_nodata, status)
+ DNS__LDNS__RR rr;
+ DNS__LDNS__RRList nsecs;
+ DNS__LDNS__RRList rrsigs;
+ LDNS_Pkt_Rcode packet_rcode;
+ LDNS_RR_Type packet_qtype;
+ signed char packet_nodata;
+ LDNS_Status status;
+ PREINIT:
+ ldns_rr ** match;
+ CODE:
+ RETVAL = NULL;
+ status = ldns_dnssec_verify_denial_nsec3_match(rr, nsecs, rrsigs,
+ packet_rcode, packet_qtype, packet_nodata, match);
+ if (status == LDNS_STATUS_OK) {
+ RETVAL = *match;
+ }
+ OUTPUT:
+ status
+ RETVAL
+
+void
+nsec3_add_param_rdfs(rr, algorithm, flags, iterations, salt)
+ DNS__LDNS__RR rr;
+ uint8_t algorithm;
+ uint8_t flags;
+ uint16_t iterations;
+ char * salt;
+ CODE:
+ ldns_nsec3_add_param_rdfs(rr, algorithm, flags, iterations, strlen(salt), (uint8_t*)salt);
+
+uint8_t
+ldns_nsec3_algorithm(nsec3)
+ DNS__LDNS__RR nsec3;
+ ALIAS:
+ nsec3_algorithm = 1
+
+uint8_t
+ldns_nsec3_flags(nsec3)
+ DNS__LDNS__RR nsec3;
+ ALIAS:
+ nsec3_flags = 1
+
+bool
+ldns_nsec3_optout(nsec3)
+ DNS__LDNS__RR nsec3;
+ ALIAS:
+ nsec3_optout = 1
+
+uint16_t
+ldns_nsec3_iterations(nsec3)
+ DNS__LDNS__RR nsec3;
+ ALIAS:
+ nsec3_iterations = 1
+
+DNS__LDNS__RData
+ldns_nsec3_next_owner(nsec3)
+ DNS__LDNS__RR nsec3;
+ ALIAS:
+ _nsec3_next_owner = 1
+
+DNS__LDNS__RData
+ldns_nsec3_bitmap(nsec3)
+ DNS__LDNS__RR nsec3;
+ ALIAS:
+ _nsec3_bitmap = 1
+
+DNS__LDNS__RData
+ldns_nsec3_salt(nsec3)
+ DNS__LDNS__RR nsec3;
+ ALIAS:
+ _nsec3_salt = 1
+
+DNS__LDNS__RR
+ldns_key_rr2ds(key, hash)
+ DNS__LDNS__RR key;
+ LDNS_Hash hash;
+ ALIAS:
+ key_to_ds = 1
+
+bool
+ldns_rr_is_question(rr)
+ DNS__LDNS__RR rr;
+ ALIAS:
+ is_question = 1
+
+uint8_t
+ldns_rr_label_count(rr)
+ DNS__LDNS__RR rr;
+ ALIAS:
+ label_count = 1
+
+MODULE = DNS::LDNS PACKAGE = DNS::LDNS::RData
+
+PROTOTYPES: ENABLE
+
+DNS__LDNS__RData
+ldns_rdf_new_frm_str(type, str)
+ LDNS_RDF_Type type;
+ const char *str;
+ ALIAS:
+ _new = 1
+
+DNS__LDNS__RData
+ldns_rdf_clone(rdf)
+ DNS__LDNS__RData rdf;
+ ALIAS:
+ clone = 1
+
+const char*
+ldns_rdf2str(rdf)
+ DNS__LDNS__RData rdf;
+ ALIAS:
+ to_string = 1
+
+void
+print(rdf, fp)
+ DNS__LDNS__RData rdf;
+ FILE* fp;
+ CODE:
+ ldns_rdf_print(fp, rdf);
+
+LDNS_RDF_Type
+ldns_rdf_get_type(rdf)
+ DNS__LDNS__RData rdf;
+ ALIAS:
+ type = 1
+
+void
+ldns_rdf_set_type(rdf, type)
+ DNS__LDNS__RData rdf;
+ LDNS_RDF_Type type
+ ALIAS:
+ set_type = 1
+
+int
+ldns_rdf_compare(rd1, rd2)
+ DNS__LDNS__RData rd1;
+ DNS__LDNS__RData rd2;
+ ALIAS:
+ compare = 1
+
+DNS__LDNS__RData
+ldns_rdf_address_reverse(rdf)
+ DNS__LDNS__RData rdf;
+ ALIAS:
+ address_reverse = 1
+
+uint8_t
+ldns_dname_label_count(rdf)
+ DNS__LDNS__RData rdf;
+ ALIAS:
+ label_count = 1
+
+DNS__LDNS__RData
+ldns_dname_label(rdf, labelpos)
+ DNS__LDNS__RData rdf;
+ uint8_t labelpos;
+ ALIAS:
+ label = 1
+
+int
+ldns_dname_is_wildcard(rdf)
+ DNS__LDNS__RData rdf;
+ ALIAS:
+ is_wildcard = 1
+
+int
+ldns_dname_match_wildcard(rdf, wildcard)
+ DNS__LDNS__RData rdf;
+ DNS__LDNS__RData wildcard;
+ ALIAS:
+ matches_wildcard = 1
+
+signed char
+ldns_dname_is_subdomain(rdf, parent)
+ DNS__LDNS__RData rdf;
+ DNS__LDNS__RData parent;
+ ALIAS:
+ is_subdomain = 1
+
+DNS__LDNS__RData
+ldns_dname_left_chop(rdf)
+ DNS__LDNS__RData rdf
+ ALIAS:
+ left_chop = 1
+
+LDNS_Status
+ldns_dname_cat(rdata, otherrd)
+ DNS__LDNS__RData rdata;
+ DNS__LDNS__RData otherrd;
+ ALIAS:
+ _cat = 1
+
+int
+ldns_dname_compare(dname, otherdname)
+ DNS__LDNS__RData dname;
+ DNS__LDNS__RData otherdname;
+ ALIAS:
+ compare = 1
+
+LDNS_RR_Type
+ldns_rdf2rr_type(rdf)
+ DNS__LDNS__RData rdf;
+ ALIAS:
+ to_rr_type = 1
+
+DNS__LDNS__RData
+ldns_dname_reverse(rdf)
+ DNS__LDNS__RData rdf;
+ ALIAS:
+ dname_reverse = 1
+
+void
+ldns_dname2canonical(rdf)
+ DNS__LDNS__RData rdf;
+ ALIAS:
+ dname2canonical = 1
+
+time_t
+ldns_rdf2native_time_t(rdf)
+ DNS__LDNS__RData rdf;
+ ALIAS:
+ to_unix_time = 1
+ 2native_time_t = 2
+
+
+MODULE = DNS::LDNS PACKAGE = DNS::LDNS::DNSSecZone
+
+PROTOTYPES: ENABLE
+
+DNS__LDNS__DNSSecZone
+ldns_dnssec_zone_new()
+ ALIAS:
+ _new = 1
+
+DNS__LDNS__DNSSecZone
+_new_from_file(fp, origin, ttl, c, s, line_nr)
+ FILE* fp;
+ DNS__LDNS__RData__Opt origin;
+ uint32_t ttl;
+ LDNS_RR_Class c;
+ LDNS_Status s;
+ int line_nr;
+ PREINIT:
+ ldns_dnssec_zone *z;
+ CODE:
+ RETVAL = NULL;
+#if LDNS_REVISION < ((1<<16)|(6<<8)|(13))
+ Perl_croak(aTHX_ "function ldns_dnssec_zone_new_frm_fp_l is not implemented in this version of ldns");
+#else
+ s = ldns_dnssec_zone_new_frm_fp_l(&z, fp, origin, ttl, c, &line_nr);
+#endif
+
+ if (s == LDNS_STATUS_OK) {
+ RETVAL = z;
+ }
+
+ OUTPUT:
+ RETVAL
+ s
+ line_nr
+
+LDNS_Status
+create_from_zone(dnssec_zone, zone)
+ DNS__LDNS__DNSSecZone dnssec_zone;
+ DNS__LDNS__Zone zone;
+ PREINIT:
+ size_t i;
+ ldns_rr *cur_rr;
+ ldns_status status;
+ ldns_rr_list *failed_nsec3s;
+ ldns_rr_list *failed_nsec3_rrsigs;
+ ldns_status result = LDNS_STATUS_OK;
+ CODE:
+ failed_nsec3s = ldns_rr_list_new();
+ failed_nsec3_rrsigs = ldns_rr_list_new();
+
+ status = ldns_dnssec_zone_add_rr(dnssec_zone,
+ ldns_rr_clone(ldns_zone_soa(zone)));
+ if (result == LDNS_STATUS_OK) {
+ result = status;
+ }
+
+ for (i = 0; i < ldns_rr_list_rr_count(ldns_zone_rrs(zone)); i++) {
+ cur_rr = ldns_rr_list_rr(ldns_zone_rrs(zone), i);
+ status = ldns_dnssec_zone_add_rr(dnssec_zone,
+ ldns_rr_clone(cur_rr));
+ if (status != LDNS_STATUS_OK) {
+ if (LDNS_STATUS_DNSSEC_NSEC3_ORIGINAL_NOT_FOUND == status) {
+ if (ldns_rr_get_type(cur_rr) == LDNS_RR_TYPE_RRSIG
+ && ldns_rdf2rr_type(ldns_rr_rrsig_typecovered(cur_rr))
+ == LDNS_RR_TYPE_NSEC3) {
+ ldns_rr_list_push_rr(failed_nsec3_rrsigs, cur_rr);
+ } else {
+ ldns_rr_list_push_rr(failed_nsec3s, cur_rr);
+ }
+ }
+ if (result == LDNS_STATUS_OK) {
+ result = status;
+ }
+ }
+ }
+
+ if (ldns_rr_list_rr_count(failed_nsec3s) > 0) {
+ (void) ldns_dnssec_zone_add_empty_nonterminals(dnssec_zone);
+ for (i = 0; i < ldns_rr_list_rr_count(failed_nsec3s); i++) {
+ cur_rr = ldns_rr_list_rr(failed_nsec3s, i);
+ status = ldns_dnssec_zone_add_rr(dnssec_zone,
+ ldns_rr_clone(cur_rr));
+ if (result == LDNS_STATUS_OK) {
+ result = status;
+ }
+ }
+ for (i = 0; i < ldns_rr_list_rr_count(failed_nsec3_rrsigs); i++) {
+ cur_rr = ldns_rr_list_rr(failed_nsec3_rrsigs, i);
+ status = ldns_dnssec_zone_add_rr(dnssec_zone,
+ ldns_rr_clone(cur_rr));
+ if (result == LDNS_STATUS_OK) {
+ result = status;
+ }
+ }
+ }
+
+ ldns_rr_list_free(failed_nsec3_rrsigs);
+ ldns_rr_list_free(failed_nsec3s);
+ RETVAL = result;
+ OUTPUT:
+ RETVAL
+
+void
+print(zone, fp)
+ DNS__LDNS__DNSSecZone zone;
+ FILE* fp;
+ CODE:
+ ldns_dnssec_zone_print(fp, zone);
+
+LDNS_Status
+ldns_dnssec_zone_add_rr(zone, rr)
+ DNS__LDNS__DNSSecZone zone;
+ DNS__LDNS__RR rr;
+ ALIAS:
+ _add_rr = 1
+
+LDNS_Status
+ldns_dnssec_zone_add_empty_nonterminals(zone)
+ DNS__LDNS__DNSSecZone zone;
+ ALIAS:
+ _add_empty_nonterminals = 1
+
+LDNS_Status
+ldns_dnssec_zone_mark_glue(zone)
+ DNS__LDNS__DNSSecZone zone;
+ ALIAS:
+ _mark_glue = 1
+
+DNS__LDNS__DNSSecName
+_soa(zone)
+ DNS__LDNS__DNSSecZone zone;
+ CODE:
+ RETVAL = zone->soa;
+ OUTPUT:
+ RETVAL
+
+DNS__LDNS__RBTree
+_names(zone)
+ DNS__LDNS__DNSSecZone zone;
+ CODE:
+ RETVAL = zone->names;
+ OUTPUT:
+ RETVAL
+
+DNS__LDNS__DNSSecRRSets
+ldns_dnssec_zone_find_rrset(zone, rdf, type)
+ DNS__LDNS__DNSSecZone zone;
+ DNS__LDNS__RData rdf;
+ LDNS_RR_Type type;
+ ALIAS:
+ _find_rrset = 1
+
+LDNS_Status
+_sign(zone, key_list, policy, flags)
+ DNS__LDNS__DNSSecZone zone;
+ DNS__LDNS__KeyList key_list;
+ uint16_t policy;
+ int flags;
+ PREINIT:
+ ldns_rr_list * new_rrs;
+ CODE:
+ new_rrs = ldns_rr_list_new();
+ RETVAL = ldns_dnssec_zone_sign_flg(zone, new_rrs, key_list,
+ sign_policy, (void*)&policy, flags);
+ ldns_rr_list_free(new_rrs);
+ OUTPUT:
+ RETVAL
+
+LDNS_Status
+_sign_nsec3(zone, key_list, policy, algorithm, flags, iterations, salt, signflags)
+ DNS__LDNS__DNSSecZone zone;
+ DNS__LDNS__KeyList key_list;
+ uint16_t policy;
+ uint8_t algorithm;
+ uint8_t flags;
+ uint16_t iterations;
+ char * salt;
+ int signflags;
+ PREINIT:
+ ldns_rr_list * new_rrs;
+ CODE:
+ new_rrs = ldns_rr_list_new();
+ RETVAL = ldns_dnssec_zone_sign_nsec3_flg(zone, new_rrs, key_list,
+ sign_policy, (void*)&policy, algorithm, flags, iterations,
+ strlen(salt), (uint8_t*)salt, signflags);
+ ldns_rr_list_free(new_rrs);
+ OUTPUT:
+ RETVAL
+
+LDNS_Status
+create_nsecs(zone)
+ DNS__LDNS__DNSSecZone zone;
+ PREINIT:
+ ldns_rr_list * new_rrs;
+ CODE:
+ new_rrs = ldns_rr_list_new();
+ RETVAL = ldns_dnssec_zone_create_nsecs(zone, new_rrs);
+ ldns_rr_list_free(new_rrs);
+ OUTPUT:
+ RETVAL
+
+LDNS_Status
+create_nsec3s(zone, algorithm, flags, iterations, salt)
+ DNS__LDNS__DNSSecZone zone;
+ uint8_t algorithm;
+ uint8_t flags;
+ uint8_t iterations;
+ char * salt;
+ PREINIT:
+ ldns_rr_list * new_rrs;
+ CODE:
+ new_rrs = ldns_rr_list_new();
+ RETVAL = ldns_dnssec_zone_create_nsec3s(zone, new_rrs, algorithm,
+ flags, iterations, strlen(salt), (uint8_t*)salt);
+ ldns_rr_list_free(new_rrs);
+ OUTPUT:
+ RETVAL
+
+LDNS_Status
+create_rrsigs(zone, key_list, policy, flags)
+ DNS__LDNS__DNSSecZone zone;
+ DNS__LDNS__KeyList key_list;
+ uint16_t policy;
+ int flags;
+ PREINIT:
+ ldns_rr_list * new_rrs;
+ CODE:
+ new_rrs = ldns_rr_list_new();
+ RETVAL = ldns_dnssec_zone_create_rrsigs_flg(zone, new_rrs, key_list,
+ sign_policy, (void*)&policy, flags);
+ ldns_rr_list_free(new_rrs);
+ OUTPUT:
+ RETVAL
+
+
+MODULE = DNS::LDNS PACKAGE = DNS::LDNS::DNSSecRRSets
+
+DNS__LDNS__DNSSecRRs
+_rrs(rrsets)
+ DNS__LDNS__DNSSecRRSets rrsets;
+ CODE:
+ RETVAL = rrsets->rrs;
+ OUTPUT:
+ RETVAL
+
+DNS__LDNS__DNSSecRRs
+_signatures(rrsets)
+ DNS__LDNS__DNSSecRRSets rrsets;
+ CODE:
+ RETVAL = rrsets->signatures;
+ OUTPUT:
+ RETVAL
+
+bool
+ldns_dnssec_rrsets_contains_type(rrsets, type)
+ DNS__LDNS__DNSSecRRSets rrsets;
+ LDNS_RR_Type type;
+ ALIAS:
+ contains_type = 1
+
+LDNS_RR_Type
+ldns_dnssec_rrsets_type(rrsets)
+ DNS__LDNS__DNSSecRRSets rrsets;
+ ALIAS:
+ type = 1
+
+LDNS_Status
+ldns_dnssec_rrsets_set_type(rrsets, type)
+ DNS__LDNS__DNSSecRRSets rrsets;
+ LDNS_RR_Type type;
+ ALIAS:
+ _set_type = 1
+
+DNS__LDNS__DNSSecRRSets
+_next(rrsets)
+ DNS__LDNS__DNSSecRRSets rrsets;
+ CODE:
+ RETVAL = rrsets->next;
+ OUTPUT:
+ RETVAL
+
+LDNS_Status
+ldns_dnssec_rrsets_add_rr(rrsets, rr)
+ DNS__LDNS__DNSSecRRSets rrsets;
+ DNS__LDNS__RR rr;
+ ALIAS:
+ _add_rr = 1
+
+
+MODULE = DNS::LDNS PACKAGE = DNS::LDNS::DNSSecRRs
+
+DNS__LDNS__DNSSecRRs
+ldns_dnssec_rrs_new()
+ ALIAS:
+ _new = 1
+
+DNS__LDNS__RR
+_rr(rrs)
+ DNS__LDNS__DNSSecRRs rrs;
+ CODE:
+ RETVAL = rrs->rr;
+ OUTPUT:
+ RETVAL
+
+DNS__LDNS__DNSSecRRs
+_next(rrs)
+ DNS__LDNS__DNSSecRRs rrs;
+ CODE:
+ RETVAL = rrs->next;
+ OUTPUT:
+ RETVAL
+
+LDNS_Status
+ldns_dnssec_rrs_add_rr(rrs, rr)
+ DNS__LDNS__DNSSecRRs rrs;
+ DNS__LDNS__RR rr;
+ ALIAS:
+ _add_rr = 1
+
+
+MODULE = DNS::LDNS PACKAGE = DNS::LDNS::DNSSecName
+
+DNS__LDNS__DNSSecName
+ldns_dnssec_name_new()
+ ALIAS:
+ _new = 1
+
+DNS__LDNS__RData
+ldns_dnssec_name_name(name)
+ DNS__LDNS__DNSSecName name;
+ ALIAS:
+ _name = 1
+
+bool
+ldns_dnssec_name_is_glue(name)
+ DNS__LDNS__DNSSecName name;
+ ALIAS:
+ is_glue = 1
+
+DNS__LDNS__DNSSecRRSets
+_rrsets(name)
+ DNS__LDNS__DNSSecName name;
+ CODE:
+ RETVAL = name->rrsets;
+ OUTPUT:
+ RETVAL
+
+DNS__LDNS__RR
+_nsec(name)
+ DNS__LDNS__DNSSecName name;
+ CODE:
+ RETVAL = name->nsec;
+ OUTPUT:
+ RETVAL
+
+DNS__LDNS__RData
+_hashed_name(name)
+ DNS__LDNS__DNSSecName name;
+ CODE:
+ RETVAL = name->hashed_name;
+ OUTPUT:
+ RETVAL
+
+DNS__LDNS__DNSSecRRs
+_nsec_signatures(name)
+ DNS__LDNS__DNSSecName name;
+ CODE:
+ RETVAL = name->nsec_signatures;
+ OUTPUT:
+ RETVAL
+
+void
+ldns_dnssec_name_set_name(name, dname)
+ DNS__LDNS__DNSSecName name;
+ DNS__LDNS__RData dname;
+ ALIAS:
+ _set_name = 1
+
+void
+ldns_dnssec_name_set_nsec(name, nsec)
+ DNS__LDNS__DNSSecName name;
+ DNS__LDNS__RR nsec;
+ ALIAS:
+ _set_nsec = 1
+
+int
+ldns_dnssec_name_cmp(a, b)
+ DNS__LDNS__DNSSecName a;
+ DNS__LDNS__DNSSecName b;
+ ALIAS:
+ compare = 1
+
+LDNS_Status
+ldns_dnssec_name_add_rr(name, rr)
+ DNS__LDNS__DNSSecName name;
+ DNS__LDNS__RR rr;
+ ALIAS:
+ _add_rr = 1
+
+
+MODULE = DNS::LDNS PACKAGE = DNS::LDNS::RBTree
+
+DNS__LDNS__RBNode
+ldns_rbtree_first(tree)
+ DNS__LDNS__RBTree tree;
+ ALIAS:
+ _first = 1
+
+DNS__LDNS__RBNode
+ldns_rbtree_last(tree)
+ DNS__LDNS__RBTree tree;
+ ALIAS:
+ _last = 1
+
+
+MODULE = DNS::LDNS PACKAGE = DNS::LDNS::RBNode
+
+DNS__LDNS__RBNode
+ldns_rbtree_next(node)
+ DNS__LDNS__RBNode node;
+ ALIAS:
+ _next = 1
+
+DNS__LDNS__RBNode
+ldns_rbtree_previous(node)
+ DNS__LDNS__RBNode node;
+ ALIAS:
+ _previous = 1
+
+DNS__LDNS__RBNode
+ldns_dnssec_name_node_next_nonglue(node)
+ DNS__LDNS__RBNode node;
+ ALIAS:
+ _next_nonglue = 1
+
+bool
+is_null(node)
+ DNS__LDNS__RBNode node;
+ CODE:
+ RETVAL = (node == LDNS_RBTREE_NULL);
+ OUTPUT:
+ RETVAL
+
+DNS__LDNS__DNSSecName
+_name(node)
+ DNS__LDNS__RBNode node;
+ CODE:
+ RETVAL = (ldns_dnssec_name*)node->data;
+ OUTPUT:
+ RETVAL
+
+
+MODULE = DNS::LDNS PACKAGE = DNS::LDNS::Resolver
+
+DNS__LDNS__Resolver
+_new_from_file(fp, s)
+ FILE* fp;
+ LDNS_Status s;
+ PREINIT:
+ ldns_resolver *r;
+ CODE:
+ RETVAL = NULL;
+ s = ldns_resolver_new_frm_fp(&r, fp);
+ if (s == LDNS_STATUS_OK) {
+ RETVAL = r;
+ }
+ OUTPUT:
+ RETVAL
+ s
+
+DNS__LDNS__Resolver
+ldns_resolver_new()
+ ALIAS:
+ _new = 1
+
+bool
+ldns_resolver_dnssec(resolver)
+ DNS__LDNS__Resolver resolver;
+ ALIAS:
+ dnssec = 1
+
+void
+ldns_resolver_set_dnssec(resolver, d)
+ DNS__LDNS__Resolver resolver;
+ bool d;
+ ALIAS:
+ set_dnssec = 1
+
+bool
+ldns_resolver_dnssec_cd(resolver)
+ DNS__LDNS__Resolver resolver;
+ ALIAS:
+ dnssec_cd = 1
+
+void
+ldns_resolver_set_dnssec_cd(resolver, d)
+ DNS__LDNS__Resolver resolver;
+ bool d;
+ ALIAS:
+ set_dnssec_cd = 1
+
+uint16_t
+ldns_resolver_port(resolver)
+ DNS__LDNS__Resolver resolver;
+ ALIAS:
+ port = 1
+
+void
+ldns_resolver_set_port(resolver, port)
+ DNS__LDNS__Resolver resolver;
+ uint16_t port;
+ ALIAS:
+ set_port = 1
+
+bool
+ldns_resolver_recursive(resolver)
+ DNS__LDNS__Resolver resolver;
+ ALIAS:
+ recursive = 1
+
+void
+ldns_resolver_set_recursive(resolver, b)
+ DNS__LDNS__Resolver resolver;
+ bool b;
+ ALIAS:
+ set_recursive = 1
+
+bool
+ldns_resolver_debug(resolver)
+ DNS__LDNS__Resolver resolver;
+ ALIAS:
+ debug = 1
+
+void
+ldns_resolver_set_debug(resolver, b)
+ DNS__LDNS__Resolver resolver;
+ bool b;
+ ALIAS:
+ set_debug = 1
+
+uint8_t
+ldns_resolver_retry(resolver)
+ DNS__LDNS__Resolver resolver;
+ ALIAS:
+ retry = 1
+
+void
+ldns_resolver_set_retry(resolver, re)
+ DNS__LDNS__Resolver resolver;
+ uint8_t re;
+ ALIAS:
+ set_retry = 1
+
+uint8_t
+ldns_resolver_retrans(resolver)
+ DNS__LDNS__Resolver resolver;
+ ALIAS:
+ retrans = 1
+
+void
+ldns_resolver_set_retrans(resolver, re)
+ DNS__LDNS__Resolver resolver;
+ uint8_t re;
+ ALIAS:
+ set_retrans = 1
+
+bool
+ldns_resolver_fallback(resolver)
+ DNS__LDNS__Resolver resolver;
+ ALIAS:
+ fallback = 1
+
+void
+ldns_resolver_set_fallback(resolver, f)
+ DNS__LDNS__Resolver resolver;
+ bool f;
+ ALIAS:
+ set_fallback = 1
+
+uint8_t
+ldns_resolver_ip6(resolver)
+ DNS__LDNS__Resolver resolver;
+ ALIAS:
+ ip6 = 1
+
+void
+ldns_resolver_set_ip6(resolver, i)
+ DNS__LDNS__Resolver resolver;
+ uint8_t i;
+ ALIAS:
+ set_ip6 = 1
+
+uint16_t
+ldns_resolver_edns_udp_size(resolver)
+ DNS__LDNS__Resolver resolver;
+ ALIAS:
+ edns_udp_size = 1
+
+void
+ldns_resolver_set_edns_udp_size(resolver, s)
+ DNS__LDNS__Resolver resolver;
+ uint16_t s;
+ ALIAS:
+ set_edns_udp_size = 1
+
+bool
+ldns_resolver_usevc(resolver)
+ DNS__LDNS__Resolver resolver;
+ ALIAS:
+ usevc = 1
+
+void
+ldns_resolver_set_usevc(resolver, b)
+ DNS__LDNS__Resolver resolver;
+ bool b;
+ ALIAS:
+ set_usevc = 1
+
+bool
+ldns_resolver_fail(resolver)
+ DNS__LDNS__Resolver resolver;
+ ALIAS:
+ fail = 1
+
+void
+ldns_resolver_set_fail(resolver, b)
+ DNS__LDNS__Resolver resolver;
+ bool b;
+ ALIAS:
+ set_fail = 1
+
+bool
+ldns_resolver_defnames(resolver)
+ DNS__LDNS__Resolver resolver;
+ ALIAS:
+ defnames = 1
+
+void
+ldns_resolver_set_defnames(resolver, b)
+ DNS__LDNS__Resolver resolver;
+ bool b;
+ ALIAS:
+ set_defnames = 1
+
+bool
+ldns_resolver_dnsrch(resolver)
+ DNS__LDNS__Resolver resolver;
+ ALIAS:
+ dnsrch = 1
+
+void
+ldns_resolver_set_dnsrch(resolver, b)
+ DNS__LDNS__Resolver resolver;
+ bool b;
+ ALIAS:
+ set_dnsrch = 1
+
+bool
+ldns_resolver_igntc(resolver)
+ DNS__LDNS__Resolver resolver;
+ ALIAS:
+ igntc = 1
+
+void
+ldns_resolver_set_igntc(resolver, b)
+ DNS__LDNS__Resolver resolver;
+ bool b;
+ ALIAS:
+ set_igntc = 1
+
+bool
+ldns_resolver_random(resolver)
+ DNS__LDNS__Resolver resolver;
+ ALIAS:
+ random = 1
+
+void
+ldns_resolver_set_random(resolver, b)
+ DNS__LDNS__Resolver resolver;
+ bool b;
+ ALIAS:
+ set_random = 1
+
+bool
+ldns_resolver_trusted_key(resolver, keys, trusted_key)
+ DNS__LDNS__Resolver resolver;
+ DNS__LDNS__RRList keys;
+ DNS__LDNS__RRList trusted_key;
+ ALIAS:
+ trusted_key = 1
+
+DNS__LDNS__RRList
+ldns_resolver_dnssec_anchors(resolver)
+ DNS__LDNS__Resolver resolver;
+ ALIAS:
+ _dnssec_anchors = 1
+
+void
+ldns_resolver_set_dnssec_anchors(resolver, list)
+ DNS__LDNS__Resolver resolver;
+ DNS__LDNS__RRList list;
+ ALIAS:
+ _set_dnssec_anchors = 1
+
+void
+ldns_resolver_push_dnssec_anchor(resolver, rr)
+ DNS__LDNS__Resolver resolver;
+ DNS__LDNS__RR rr;
+ ALIAS:
+ _push_dnssec_anchor = 1
+
+DNS__LDNS__RData
+ldns_resolver_domain(resolver)
+ DNS__LDNS__Resolver resolver;
+ ALIAS:
+ _domain = 1
+
+void
+ldns_resolver_set_domain(resolver, rd)
+ DNS__LDNS__Resolver resolver;
+ DNS__LDNS__RData rd;
+ ALIAS:
+ _set_domain = 1
+
+AV *
+_nameservers(resolver)
+ DNS__LDNS__Resolver resolver;
+ PREINIT:
+ ldns_rdf** list;
+ AV * result;
+ int i;
+ SV * elem;
+ CODE:
+ result = (AV *)sv_2mortal((SV *)newAV());
+ list = ldns_resolver_nameservers(resolver);
+
+ /* FIXME: Make a typemap for this ? */
+ for (i = 0; i < ldns_resolver_nameserver_count(resolver); i++) {
+ elem = newSVpv(0, 0);
+ sv_setref_pv(elem, "LDNS::RData", list[i]);
+ av_push(result, elem);
+ }
+ RETVAL = result;
+ OUTPUT:
+ RETVAL
+
+size_t
+ldns_resolver_nameserver_count(resolver)
+ DNS__LDNS__Resolver resolver;
+ ALIAS:
+ nameserver_count = 1
+
+LDNS_Status
+ldns_resolver_push_nameserver(resolver, n)
+ DNS__LDNS__Resolver resolver;
+ DNS__LDNS__RData n;
+ ALIAS:
+ _push_nameserver = 1
+
+DNS__LDNS__RData
+ldns_resolver_pop_nameserver(resolver)
+ DNS__LDNS__Resolver resolver;
+ ALIAS:
+ _pop_nameserver = 1
+
+void
+ldns_resolver_nameservers_randomize(resolver)
+ DNS__LDNS__Resolver resolver;
+ ALIAS:
+ nameservers_randomize = 1
+
+char*
+ldns_resolver_tsig_keyname(resolver)
+ DNS__LDNS__Resolver resolver;
+ ALIAS:
+ tsig_keyname = 1
+
+void
+ldns_resolver_set_tsig_keyname(resolver, tsig_keyname)
+ DNS__LDNS__Resolver resolver;
+ char* tsig_keyname;
+ ALIAS:
+ set_tsig_keyname = 1
+
+char*
+ldns_resolver_tsig_algorithm(resolver)
+ DNS__LDNS__Resolver resolver;
+ ALIAS:
+ tsig_algorithm = 1
+
+void
+ldns_resolver_set_tsig_algorithm(resolver, tsig_algorithm)
+ DNS__LDNS__Resolver resolver;
+ char* tsig_algorithm;
+ ALIAS:
+ set_tsig_algorithm = 1
+
+char*
+ldns_resolver_tsig_keydata(resolver)
+ DNS__LDNS__Resolver resolver;
+ ALIAS:
+ tsig_keydata = 1
+
+void
+ldns_resolver_set_tsig_keydata(resolver, tsig_keydata)
+ DNS__LDNS__Resolver resolver;
+ char* tsig_keydata;
+ ALIAS:
+ set_tsig_keydata = 1
+
+size_t
+ldns_resolver_searchlist_count(resolver)
+ DNS__LDNS__Resolver resolver;
+ ALIAS:
+ searchlist_count = 1
+
+void
+ldns_resolver_push_searchlist(resolver, rd)
+ DNS__LDNS__Resolver resolver;
+ DNS__LDNS__RData rd;
+ ALIAS:
+ _push_searchlist = 1
+
+AV *
+_searchlist(resolver)
+ DNS__LDNS__Resolver resolver;
+ PREINIT:
+ ldns_rdf** list;
+ AV * result;
+ int i;
+ SV * elem;
+ CODE:
+ result = (AV *)sv_2mortal((SV *)newAV());
+ list = ldns_resolver_searchlist(resolver);
+
+ /* FIXME: Make a typemap for this ? */
+ for (i = 0; i < ldns_resolver_searchlist_count(resolver); i++) {
+ elem = newSVpv(0, 0);
+ sv_setref_pv(elem, "LDNS::RData", list[i]);
+ av_push(result, elem);
+ }
+ RETVAL = result;
+ OUTPUT:
+ RETVAL
+
+size_t
+ldns_resolver_nameserver_rtt(resolver, pos)
+ DNS__LDNS__Resolver resolver;
+ size_t pos;
+ ALIAS:
+ nameserver_rtt = 1
+
+void
+ldns_resolver_set_nameserver_rtt(resolver, pos, val)
+ DNS__LDNS__Resolver resolver;
+ size_t pos;
+ size_t val;
+ ALIAS:
+ set_nameserver_rtt = 1
+
+AV *
+_timeout(resolver)
+ DNS__LDNS__Resolver resolver;
+ PREINIT:
+ struct timeval t;
+ AV * result;
+ CODE:
+ t = ldns_resolver_timeout(resolver);
+ result = (AV *)sv_2mortal((SV *)newAV());
+ av_push(result, newSVuv(t.tv_sec));
+ av_push(result, newSVuv(t.tv_usec));
+ RETVAL = result;
+ OUTPUT:
+ RETVAL
+
+void
+set_timeout(resolver, sec, usec)
+ DNS__LDNS__Resolver resolver;
+ uint32_t sec;
+ uint32_t usec;
+ PREINIT:
+ struct timeval t;
+ CODE:
+ t.tv_sec = sec;
+ t.tv_usec = usec;
+ ldns_resolver_set_timeout(resolver, t);
+
+void
+_set_rtt(resolver, rtt)
+ DNS__LDNS__Resolver resolver;
+ AV * rtt;
+ PREINIT:
+ size_t *buff;
+ int i;
+ SV** elem;
+ CODE:
+ buff = malloc(sizeof(size_t)*(av_len(rtt)+1));
+ for (i = 0; i <= av_len(rtt); i++) {
+ elem = av_fetch(rtt, i, 0);
+ buff[i] = SvUV(*elem);
+ }
+ ldns_resolver_set_rtt(resolver, buff);
+
+AV *
+_rtt(resolver)
+ DNS__LDNS__Resolver resolver;
+ PREINIT:
+ int i;
+ size_t *rtt;
+ AV * result;
+ CODE:
+ result = (AV *)sv_2mortal((SV *)newAV());
+ rtt = ldns_resolver_rtt(resolver);
+
+ for (i = 0; i < ldns_resolver_nameserver_count(resolver); i++) {
+ av_push(result, newSVuv(rtt[i]));
+ }
+ RETVAL = result;
+ OUTPUT:
+ RETVAL
+
+DNS__LDNS__RRList
+ldns_validate_domain_ds(resolver, domain, keys)
+ DNS__LDNS__Resolver resolver;
+ DNS__LDNS__RData domain;
+ DNS__LDNS__RRList keys;
+ ALIAS:
+ validate_domain_ds = 1
+
+DNS__LDNS__RRList
+ldns_validate_domain_ds_time(resolver, domain, keys, check_time)
+ DNS__LDNS__Resolver resolver;
+ DNS__LDNS__RData domain;
+ DNS__LDNS__RRList keys;
+ time_t check_time;
+ ALIAS:
+ validate_domain_ds_time = 1
+
+DNS__LDNS__RRList
+ldns_validate_domain_dnskey(resolver, domain, keys)
+ DNS__LDNS__Resolver resolver;
+ DNS__LDNS__RData domain;
+ DNS__LDNS__RRList keys;
+ ALIAS:
+ validate_domain_dnskey = 1
+
+DNS__LDNS__RRList
+ldns_validate_domain_dnskey_time(resolver, domain, keys, check_time)
+ DNS__LDNS__Resolver resolver;
+ DNS__LDNS__RData domain;
+ DNS__LDNS__RRList keys;
+ time_t check_time;
+ ALIAS:
+ validate_domain_dnskey_time = 1
+
+LDNS_Status
+ldns_verify_trusted(resolver, rrset, rrsigs, validating_keys)
+ DNS__LDNS__Resolver resolver;
+ DNS__LDNS__RRList rrset;
+ DNS__LDNS__RRList rrsigs;
+ DNS__LDNS__RRList validating_keys;
+ ALIAS:
+ _verify_trusted = 1
+
+LDNS_Status
+ldns_verify_trusted_time(resolver, rrset, rrsigs, check_time, validating_keys)
+ DNS__LDNS__Resolver resolver;
+ DNS__LDNS__RRList rrset;
+ DNS__LDNS__RRList rrsigs;
+ time_t check_time;
+ DNS__LDNS__RRList validating_keys;
+ ALIAS:
+ _verify_trusted_time = 1
+
+DNS__LDNS__RRList
+_fetch_valid_domain_keys(resolver, domain, keys, s)
+ DNS__LDNS__Resolver resolver;
+ DNS__LDNS__RData domain;
+ DNS__LDNS__RRList keys;
+ LDNS_Status s;
+ PREINIT:
+ DNS__LDNS__RRList trusted;
+ DNS__LDNS__RRList ret;
+ size_t i;
+ CODE:
+ RETVAL = NULL;
+ trusted = ldns_fetch_valid_domain_keys(resolver, domain, keys, &s);
+ if (s == LDNS_STATUS_OK) {
+ RETVAL = ldns_rr_list_clone(trusted);
+ ldns_rr_list_free(trusted);
+ }
+ OUTPUT:
+ RETVAL
+ s
+
+DNS__LDNS__RRList
+_fetch_valid_domain_keys_time(resolver, domain, keys, check_time, s)
+ DNS__LDNS__Resolver resolver;
+ DNS__LDNS__RData domain;
+ DNS__LDNS__RRList keys;
+ time_t check_time;
+ LDNS_Status s;
+ PREINIT:
+ DNS__LDNS__RRList trusted;
+ DNS__LDNS__RRList ret;
+ size_t i;
+ CODE:
+ RETVAL = NULL;
+ trusted = ldns_fetch_valid_domain_keys_time(
+ resolver, domain, keys, check_time, &s);
+ if (s == LDNS_STATUS_OK) {
+ RETVAL = ldns_rr_list_clone(trusted);
+ ldns_rr_list_free(trusted);
+ }
+ OUTPUT:
+ RETVAL
+ s
+
+DNS__LDNS__Packet
+ldns_resolver_query(resolver, name, type, class, flags)
+ DNS__LDNS__Resolver resolver;
+ DNS__LDNS__RData name;
+ LDNS_RR_Type type;
+ LDNS_RR_Class class;
+ uint16_t flags;
+ ALIAS:
+ query = 1
+
+DNS__LDNS__Packet
+_send(resolver, name, type, class, flags, s)
+ DNS__LDNS__Resolver resolver;
+ DNS__LDNS__RData name;
+ LDNS_RR_Type type;
+ LDNS_RR_Class class;
+ uint16_t flags;
+ LDNS_Status s;
+ PREINIT:
+ DNS__LDNS__Packet packet;
+ CODE:
+ s = ldns_resolver_send(&packet, resolver, name, type, class, flags);
+ if (s == LDNS_STATUS_OK) {
+ RETVAL = packet;
+ }
+ OUTPUT:
+ RETVAL
+ s
+
+DNS__LDNS__Packet
+_send_pkt(resolver, packet, s)
+ DNS__LDNS__Resolver resolver;
+ DNS__LDNS__Packet packet;
+ LDNS_Status s;
+ PREINIT:
+ DNS__LDNS__Packet answer;
+ CODE:
+ s = ldns_resolver_send_pkt(&answer, resolver, packet);
+ if (s == LDNS_STATUS_OK) {
+ RETVAL = answer;
+ }
+ OUTPUT:
+ RETVAL
+ s
+
+DNS__LDNS__Packet
+_prepare_query_pkt(resolver, name, type, class, flags, s)
+ DNS__LDNS__Resolver resolver;
+ DNS__LDNS__RData name;
+ LDNS_RR_Type type;
+ LDNS_RR_Class class;
+ uint16_t flags;
+ LDNS_Status s;
+ PREINIT:
+ DNS__LDNS__Packet packet;
+ CODE:
+ s = ldns_resolver_prepare_query_pkt(&packet, resolver, name, type, class, flags);
+ if (s == LDNS_STATUS_OK) {
+ RETVAL = packet;
+ }
+ OUTPUT:
+ RETVAL
+ s
+
+DNS__LDNS__Packet
+ldns_resolver_search(resolver, name, type, class, flags)
+ DNS__LDNS__Resolver resolver;
+ DNS__LDNS__RData name;
+ LDNS_RR_Type type;
+ LDNS_RR_Class class;
+ uint16_t flags;
+ ALIAS:
+ search = 1
+
+DNS__LDNS__DNSSecDataChain
+build_data_chain(res, qflags, data_set, pkt, orig_rr)
+ DNS__LDNS__Resolver res;
+ uint16_t qflags;
+ DNS__LDNS__RRList data_set;
+ DNS__LDNS__Packet pkt;
+ DNS__LDNS__RR__Opt orig_rr;
+ CODE:
+ RETVAL = ldns_dnssec_build_data_chain(res, qflags, data_set, pkt, orig_rr);
+ OUTPUT:
+ RETVAL
+
+DNS__LDNS__RRList
+ldns_get_rr_list_addr_by_name(res, name, class, flags)
+ DNS__LDNS__Resolver res;
+ DNS__LDNS__RData name;
+ LDNS_RR_Class class;
+ uint16_t flags;
+ ALIAS:
+ get_rr_list_addr_by_name = 1
+
+DNS__LDNS__RRList
+ldns_get_rr_list_name_by_addr(res, addr, class, flags)
+ DNS__LDNS__Resolver res;
+ DNS__LDNS__RData addr;
+ LDNS_RR_Class class;
+ uint16_t flags;
+ ALIAS:
+ get_rr_list_addr_by_addr = 1
+
+
+MODULE = DNS::LDNS PACKAGE = DNS::LDNS::Packet
+
+Mortal_PV
+ldns_pkt2str(pkt)
+ DNS__LDNS__Packet pkt;
+ ALIAS:
+ to_string = 1
+
+DNS__LDNS__RRList
+ldns_pkt_question(pkt)
+ DNS__LDNS__Packet pkt;
+ ALIAS:
+ _question = 1
+
+void
+ldns_pkt_set_question(pkt, l)
+ DNS__LDNS__Packet pkt;
+ DNS__LDNS__RRList l;
+ ALIAS:
+ _set_question = 1
+
+DNS__LDNS__RRList
+ldns_pkt_answer(pkt)
+ DNS__LDNS__Packet pkt;
+ ALIAS:
+ _answer = 1
+
+void
+ldns_pkt_set_answer(pkt, l)
+ DNS__LDNS__Packet pkt;
+ DNS__LDNS__RRList l;
+ ALIAS:
+ _set_answer = 1
+
+DNS__LDNS__RRList
+ldns_pkt_authority(pkt)
+ DNS__LDNS__Packet pkt;
+ ALIAS:
+ _authority = 1
+
+void
+ldns_pkt_set_authority(pkt, l)
+ DNS__LDNS__Packet pkt;
+ DNS__LDNS__RRList l;
+ ALIAS:
+ _set_authority = 1
+
+DNS__LDNS__RRList
+ldns_pkt_additional(pkt)
+ DNS__LDNS__Packet pkt;
+ ALIAS:
+ _additional = 1
+
+void
+ldns_pkt_set_additional(pkt, l)
+ DNS__LDNS__Packet pkt;
+ DNS__LDNS__RRList l;
+ ALIAS:
+ _set_additional = 1
+
+DNS__LDNS__RRList
+ldns_pkt_all(pkt)
+ DNS__LDNS__Packet pkt;
+ ALIAS:
+ all = 1
+
+DNS__LDNS__RRList
+ldns_pkt_all_noquestion(pkt)
+ DNS__LDNS__Packet pkt;
+ ALIAS:
+ all_noquestion = 1
+
+signed char
+ldns_pkt_qr(pkt)
+ DNS__LDNS__Packet pkt;
+ ALIAS:
+ qr = 1
+
+void
+ldns_pkt_set_qr(pkt, b)
+ DNS__LDNS__Packet pkt;
+ signed char b;
+ ALIAS:
+ set_qr = 1
+
+signed char
+ldns_pkt_aa(pkt)
+ DNS__LDNS__Packet pkt;
+ ALIAS:
+ aa = 1
+
+void
+ldns_pkt_set_aa(pkt, b)
+ DNS__LDNS__Packet pkt;
+ signed char b;
+ ALIAS:
+ set_aa = 1
+
+signed char
+ldns_pkt_tc(pkt)
+ DNS__LDNS__Packet pkt;
+ ALIAS:
+ tc = 1
+
+void
+ldns_pkt_set_tc(pkt, b)
+ DNS__LDNS__Packet pkt;
+ signed char b;
+ ALIAS:
+ set_tc = 1
+
+signed char
+ldns_pkt_rd(pkt)
+ DNS__LDNS__Packet pkt;
+ ALIAS:
+ rd = 1
+
+void
+ldns_pkt_set_rd(pkt, b)
+ DNS__LDNS__Packet pkt;
+ signed char b;
+ ALIAS:
+ set_rd = 1
+
+bool
+ldns_pkt_cd(pkt)
+ DNS__LDNS__Packet pkt;
+ ALIAS:
+ cd = 1
+
+void
+ldns_pkt_set_cd(pkt, b)
+ DNS__LDNS__Packet pkt;
+ signed char b;
+ ALIAS:
+ set_cd = 1
+
+signed char
+ldns_pkt_ra(pkt)
+ DNS__LDNS__Packet pkt;
+ ALIAS:
+ ra = 1
+
+void
+ldns_pkt_set_ra(pkt, b)
+ DNS__LDNS__Packet pkt;
+ signed char b;
+ ALIAS:
+ set_ra = 1
+
+signed char
+ldns_pkt_ad(pkt)
+ DNS__LDNS__Packet pkt;
+ ALIAS:
+ ad = 1
+
+void
+ldns_pkt_set_ad(pkt, b)
+ DNS__LDNS__Packet pkt;
+ signed char b;
+ ALIAS:
+ set_ad = 1
+
+uint16_t
+ldns_pkt_id(pkt)
+ DNS__LDNS__Packet pkt;
+ ALIAS:
+ id = 1
+
+void
+ldns_pkt_set_id(pkt, id)
+ DNS__LDNS__Packet pkt;
+ uint16_t id;
+ ALIAS:
+ set_id = 1
+
+void
+ldns_pkt_set_random_id(pkt)
+ DNS__LDNS__Packet pkt;
+ ALIAS:
+ set_random_id = 1
+
+uint16_t
+ldns_pkt_qdcount(pkt)
+ DNS__LDNS__Packet pkt;
+ ALIAS:
+ qdcount = 1
+
+uint16_t
+ldns_pkt_ancount(pkt)
+ DNS__LDNS__Packet pkt;
+ ALIAS:
+ ancount = 1
+
+uint16_t
+ldns_pkt_nscount(pkt)
+ DNS__LDNS__Packet pkt;
+ ALIAS:
+ nscount = 1
+
+uint16_t
+ldns_pkt_arcount(pkt)
+ DNS__LDNS__Packet pkt;
+ ALIAS:
+ arcount = 1
+
+LDNS_Pkt_Opcode
+ldns_pkt_get_opcode(pkt)
+ DNS__LDNS__Packet pkt;
+ ALIAS:
+ opcode = 1
+
+void
+ldns_pkt_set_opcode(pkt, c)
+ DNS__LDNS__Packet pkt;
+ LDNS_Pkt_Opcode c;
+ ALIAS:
+ set_opcode = 1
+
+uint8_t
+ldns_pkt_get_rcode(pkt)
+ DNS__LDNS__Packet pkt;
+ ALIAS:
+ rcode = 1
+
+void
+ldns_pkt_set_rcode(pkt, r)
+ DNS__LDNS__Packet pkt;
+ uint8_t r;
+ ALIAS:
+ set_rcode = 1
+
+size_t
+ldns_pkt_size(pkt)
+ DNS__LDNS__Packet pkt;
+ ALIAS:
+ size = 1
+
+uint32_t
+ldns_pkt_querytime(pkt)
+ DNS__LDNS__Packet pkt;
+ ALIAS:
+ querytime = 1
+
+void
+ldns_pkt_set_querytime(pkt, t)
+ DNS__LDNS__Packet pkt;
+ uint32_t t;
+ ALIAS:
+ set_querytime = 1
+
+DNS__LDNS__RData
+ldns_pkt_answerfrom(pkt)
+ DNS__LDNS__Packet pkt;
+ ALIAS:
+ _answerfrom = 1
+
+AV *
+_timestamp(pkt)
+ DNS__LDNS__Packet pkt;
+ PREINIT:
+ struct timeval t;
+ AV * result;
+ CODE:
+ t = ldns_pkt_timestamp(pkt);
+ result = (AV *)sv_2mortal((SV *)newAV());
+ av_push(result, newSVuv(t.tv_sec));
+ av_push(result, newSVuv(t.tv_usec));
+ RETVAL = result;
+ OUTPUT:
+ RETVAL
+
+void
+set_timestamp(pkt, sec, usec)
+ DNS__LDNS__Packet pkt;
+ uint32_t sec;
+ uint32_t usec;
+ PREINIT:
+ struct timeval t;
+ CODE:
+ t.tv_sec = sec;
+ t.tv_usec = usec;
+ ldns_pkt_set_timestamp(pkt, t);
+
+void
+ldns_pkt_set_answerfrom(pkt, a)
+ DNS__LDNS__Packet pkt;
+ DNS__LDNS__RData a;
+ ALIAS:
+ _set_answerfrom = 1
+
+bool
+ldns_pkt_set_flags(pkt, f)
+ DNS__LDNS__Packet pkt;
+ uint16_t f;
+ ALIAS:
+ set_flags = 1
+
+DNS__LDNS__RRList
+ldns_pkt_rr_list_by_name(pkt, name, sec)
+ DNS__LDNS__Packet pkt;
+ DNS__LDNS__RData name;
+ LDNS_Pkt_Section sec;
+ ALIAS:
+ rr_list_by_name = 1
+
+DNS__LDNS__RRList
+ldns_pkt_rr_list_by_type(pkt, type, sec)
+ DNS__LDNS__Packet pkt;
+ LDNS_RR_Type type;
+ LDNS_Pkt_Section sec;
+ ALIAS:
+ rr_list_by_type = 1
+
+DNS__LDNS__RRList
+ldns_pkt_rr_list_by_name_and_type(pkt, name, type, sec)
+ DNS__LDNS__Packet pkt;
+ DNS__LDNS__RData name;
+ LDNS_RR_Type type;
+ LDNS_Pkt_Section sec;
+ ALIAS:
+ rr_list_by_name_and_type = 1
+
+bool
+ldns_pkt_rr(pkt, sec, rr)
+ DNS__LDNS__Packet pkt;
+ LDNS_Pkt_Section sec;
+ DNS__LDNS__RR rr;
+ ALIAS:
+ rr = 1
+
+bool
+ldns_pkt_push_rr(pkt, sec, rr)
+ DNS__LDNS__Packet pkt;
+ LDNS_Pkt_Section sec;
+ DNS__LDNS__RR rr;
+ ALIAS:
+ _push_rr = 1
+
+bool
+ldns_pkt_safe_push_rr(pkt, sec, rr)
+ DNS__LDNS__Packet pkt;
+ LDNS_Pkt_Section sec;
+ DNS__LDNS__RR rr;
+ ALIAS:
+ _safe_push_rr = 1
+
+uint16_t
+ldns_pkt_section_count(pkt, sec)
+ DNS__LDNS__Packet pkt;
+ LDNS_Pkt_Section sec;
+ ALIAS:
+ section_count = 1
+
+signed char
+ldns_pkt_empty(pkt)
+ DNS__LDNS__Packet pkt;
+ ALIAS:
+ empty = 1
+
+DNS__LDNS__RR
+ldns_pkt_tsig(pkt)
+ DNS__LDNS__Packet pkt;
+ ALIAS:
+ _tsig = 1
+
+void
+ldns_pkt_set_tsig(pkt, rr)
+ DNS__LDNS__Packet pkt;
+ DNS__LDNS__RR rr;
+ ALIAS:
+ _set_tsig = 1
+
+DNS__LDNS__Packet
+ldns_pkt_clone(pkt)
+ DNS__LDNS__Packet pkt;
+ ALIAS:
+ clone = 1
+
+LDNS_Pkt_Type
+ldns_pkt_reply_type(pkt)
+ DNS__LDNS__Packet pkt;
+ ALIAS:
+ reply_type = 1
+
+DNS__LDNS__Packet
+ldns_pkt_new()
+ ALIAS:
+ _new = 1
+
+DNS__LDNS__Packet
+ldns_pkt_query_new(name, type, class, flags)
+ DNS__LDNS__RData name;
+ LDNS_RR_Type type;
+ LDNS_RR_Class class;
+ uint16_t flags;
+ ALIAS:
+ _query_new = 1
+
+DNS__LDNS__RRList
+ldns_dnssec_pkt_get_rrsigs_for_name_and_type(pkt, name, type)
+ DNS__LDNS__Packet pkt;
+ DNS__LDNS__RData name;
+ LDNS_RR_Type type;
+ ALIAS:
+ get_rrsigs_for_name_and_type = 1
+
+DNS__LDNS__RRList
+ldns_dnssec_pkt_get_rrsigs_for_type(pkt, type)
+ DNS__LDNS__Packet pkt;
+ LDNS_RR_Type type;
+ ALIAS:
+ get_rrsigs_for_type = 1
+
+uint16_t
+ldns_pkt_edns_udp_size(pkt)
+ DNS__LDNS__Packet pkt;
+ ALIAS:
+ edns_udp_size = 1
+
+void
+ldns_pkt_set_edns_udp_size(pkt, s)
+ DNS__LDNS__Packet pkt;
+ uint16_t s;
+ ALIAS:
+ set_edns_udp_size = 1
+
+uint8_t
+ldns_pkt_edns_extended_rcode(pkt)
+ DNS__LDNS__Packet pkt;
+ ALIAS:
+ edns_extended_rcode = 1
+
+void
+ldns_pkt_set_edns_extended_rcode(pkt, c)
+ DNS__LDNS__Packet pkt;
+ uint8_t c;
+ ALIAS:
+ set_edns_extended_rcode = 1
+
+uint8_t
+ldns_pkt_edns_version(pkt)
+ DNS__LDNS__Packet pkt;
+ ALIAS:
+ edns_version = 1
+
+void
+ldns_pkt_set_edns_version(pkt, v)
+ DNS__LDNS__Packet pkt;
+ uint8_t v;
+ ALIAS:
+ set_edns_version = 1
+
+uint16_t
+ldns_pkt_edns_z(pkt)
+ DNS__LDNS__Packet pkt;
+ ALIAS:
+ edns_z = 1
+
+void
+ldns_pkt_set_edns_z(pkt, z)
+ DNS__LDNS__Packet pkt;
+ uint16_t z;
+ ALIAS:
+ set_edns_z = 1
+
+signed char
+ldns_pkt_edns_do(pkt)
+ DNS__LDNS__Packet pkt;
+ ALIAS:
+ edns_do = 1
+
+DNS__LDNS__RData
+ldns_pkt_edns_data(pkt)
+ DNS__LDNS__Packet pkt;
+ ALIAS:
+ _edns_data = 1
+
+void
+ldns_pkt_set_edns_data(pkt, data)
+ DNS__LDNS__Packet pkt;
+ DNS__LDNS__RData data;
+ ALIAS:
+ _set_edns_data = 1
+
+void
+ldns_pkt_set_edns_do(pkt, val)
+ DNS__LDNS__Packet pkt;
+ signed char val;
+ ALIAS:
+ set_edns_do = 1
+
+bool
+ldns_pkt_edns(pkt)
+ DNS__LDNS__Packet pkt;
+ ALIAS:
+ edns = 1
+
+
+MODULE = DNS::LDNS PACKAGE = DNS::LDNS::Key
+
+DNS__LDNS__Key
+_new_from_file(fp, line_nr, s)
+ FILE* fp;
+ int line_nr;
+ LDNS_Status s;
+ PREINIT:
+ ldns_key *key;
+ CODE:
+ RETVAL = NULL;
+ s = ldns_key_new_frm_fp_l(&key, fp, &line_nr);
+
+ if (s == LDNS_STATUS_OK) {
+ RETVAL = key;
+ }
+ OUTPUT:
+ RETVAL
+ s
+ line_nr
+
+DNS__LDNS__Key
+ldns_key_new()
+ ALIAS:
+ _new = 1
+
+void
+print(key, fp)
+ DNS__LDNS__Key key;
+ FILE* fp;
+ CODE:
+ ldns_key_print(fp, key);
+
+Mortal_PV
+ldns_key2str(key)
+ DNS__LDNS__Key key;
+ ALIAS:
+ to_string = 1
+
+void
+ldns_key_set_algorithm(key, algorithm)
+ DNS__LDNS__Key key;
+ LDNS_Signing_Algorithm algorithm;
+ ALIAS:
+ set_algorithm = 1
+
+LDNS_Signing_Algorithm
+ldns_key_algorithm(key)
+ DNS__LDNS__Key key;
+ ALIAS:
+ algorithm = 1
+
+void
+ldns_key_set_flags(key, flags)
+ DNS__LDNS__Key key;
+ uint16_t flags;
+ ALIAS:
+ set_flags = 1
+
+uint16_t
+ldns_key_flags(key)
+ DNS__LDNS__Key key;
+ ALIAS:
+ flags = 1
+
+void
+ldns_key_set_hmac_key(key, hmac)
+ DNS__LDNS__Key key;
+ unsigned char* hmac;
+ ALIAS:
+ set_hmac_key = 1
+
+unsigned char *
+ldns_key_hmac_key(key)
+ DNS__LDNS__Key key;
+ ALIAS:
+ hmac_key = 1
+
+void
+ldns_key_set_hmac_size(key, size)
+ DNS__LDNS__Key key;
+ size_t size;
+ ALIAS:
+ set_hmac_size = 1
+
+size_t
+ldns_key_hmac_size(key)
+ DNS__LDNS__Key key;
+ ALIAS:
+ hmac_size = 1
+
+void
+ldns_key_set_origttl(key, t)
+ DNS__LDNS__Key key;
+ uint32_t t;
+ ALIAS:
+ set_origttl = 1
+
+uint32_t
+ldns_key_origttl(key)
+ DNS__LDNS__Key key;
+ ALIAS:
+ origttl = 1
+
+void
+ldns_key_set_inception(key, i)
+ DNS__LDNS__Key key;
+ uint32_t i;
+ ALIAS:
+ set_inception = 1
+
+uint32_t
+ldns_key_inception(key)
+ DNS__LDNS__Key key;
+ ALIAS:
+ inception = 1
+
+void
+ldns_key_set_expiration(key, e)
+ DNS__LDNS__Key key;
+ uint32_t e;
+ ALIAS:
+ set_expiration = 1
+
+uint32_t
+ldns_key_expiration(key)
+ DNS__LDNS__Key key;
+ ALIAS:
+ expiration = 1
+
+void
+ldns_key_set_pubkey_owner(key, r)
+ DNS__LDNS__Key key;
+ DNS__LDNS__RData r;
+ ALIAS:
+ _set_pubkey_owner = 1
+
+DNS__LDNS__RData
+ldns_key_pubkey_owner(key)
+ DNS__LDNS__Key key;
+ ALIAS:
+ _pubkey_owner = 1
+
+void
+ldns_key_set_keytag(key, tag)
+ DNS__LDNS__Key key;
+ uint16_t tag;
+ ALIAS:
+ set_keytag = 1
+
+uint16_t
+ldns_key_keytag(key)
+ DNS__LDNS__Key key;
+ ALIAS:
+ keytag = 1
+
+void
+ldns_key_set_use(key, v)
+ DNS__LDNS__Key key;
+ signed char v;
+ ALIAS:
+ set_use = 1
+
+signed char
+ldns_key_use(key)
+ DNS__LDNS__Key key;
+ ALIAS:
+ use = 1
+
+char *
+ldns_key_get_file_base_name(key)
+ DNS__LDNS__Key key;
+ ALIAS:
+ get_file_base_name = 1
+
+DNS__LDNS__RR
+ldns_key2rr(key)
+ DNS__LDNS__Key key;
+ ALIAS:
+ to_rr = 1
+
+
+MODULE = DNS::LDNS PACKAGE = DNS::LDNS::KeyList
+
+DNS__LDNS__KeyList
+ldns_key_list_new()
+ ALIAS:
+ _new = 1
+
+void
+ldns_key_list_set_use(keys, v)
+ DNS__LDNS__KeyList keys;
+ bool v;
+ ALIAS:
+ set_use = 1
+
+DNS__LDNS__Key
+ldns_key_list_pop_key(keylist)
+ DNS__LDNS__KeyList keylist;
+ ALIAS:
+ pop = 1
+
+void
+ldns_key_list_push_key(keylist, key)
+ DNS__LDNS__KeyList keylist;
+ DNS__LDNS__Key key;
+ ALIAS:
+ _push = 1
+
+size_t
+ldns_key_list_key_count(keylist)
+ DNS__LDNS__KeyList keylist;
+ ALIAS:
+ count = 1
+
+DNS__LDNS__Key
+ldns_key_list_key(keylist, nr)
+ DNS__LDNS__KeyList keylist;
+ size_t nr;
+ ALIAS:
+ _key = 1
+
+
+MODULE = DNS::LDNS PACKAGE = DNS::LDNS::DNSSecDataChain
+
+DNS__LDNS__DNSSecDataChain
+ldns_dnssec_data_chain_new()
+ ALIAS:
+ _new = 1
+
+void
+print(chain, fp)
+ DNS__LDNS__DNSSecDataChain chain;
+ FILE* fp;
+ CODE:
+ ldns_dnssec_data_chain_print(fp, chain);
+
+DNS__LDNS__DNSSecTrustTree
+ldns_dnssec_derive_trust_tree(chain, rr)
+ DNS__LDNS__DNSSecDataChain chain;
+ DNS__LDNS__RR rr;
+ ALIAS:
+ _derive_trust_tree = 1
+
+DNS__LDNS__DNSSecTrustTree
+ldns_dnssec_derive_trust_tree_time(chain, rr, check_time)
+ DNS__LDNS__DNSSecDataChain chain;
+ DNS__LDNS__RR rr;
+ time_t check_time;
+ ALIAS:
+ _derive_trust_tree_time = 1
+
+DNS__LDNS__RRList
+_rrset(chain)
+ DNS__LDNS__DNSSecDataChain chain;
+ CODE:
+ RETVAL = chain->rrset;
+ OUTPUT:
+ RETVAL
+
+DNS__LDNS__RRList
+_signatures(chain)
+ DNS__LDNS__DNSSecDataChain chain;
+ CODE:
+ RETVAL = chain->signatures;
+ OUTPUT:
+ RETVAL
+
+LDNS_RR_Type
+parent_type(chain)
+ DNS__LDNS__DNSSecDataChain chain;
+ CODE:
+ RETVAL = chain->parent_type;
+ OUTPUT:
+ RETVAL
+
+DNS__LDNS__DNSSecDataChain
+_parent(chain)
+ DNS__LDNS__DNSSecDataChain chain;
+ CODE:
+ RETVAL = chain->parent;
+ OUTPUT:
+ RETVAL
+
+LDNS_Pkt_Rcode
+packet_rcode(chain)
+ DNS__LDNS__DNSSecDataChain chain;
+ CODE:
+ RETVAL = chain->packet_rcode;
+ OUTPUT:
+ RETVAL
+
+LDNS_RR_Type
+packet_qtype(chain)
+ DNS__LDNS__DNSSecDataChain chain;
+ CODE:
+ RETVAL = chain->packet_qtype;
+ OUTPUT:
+ RETVAL
+
+signed char
+packet_nodata(chain)
+ DNS__LDNS__DNSSecDataChain chain;
+ CODE:
+ RETVAL = chain->packet_nodata;
+ OUTPUT:
+ RETVAL
+
+
+MODULE = DNS::LDNS PACKAGE = DNS::LDNS::DNSSecTrustTree
+
+DNS__LDNS__DNSSecTrustTree
+ldns_dnssec_trust_tree_new()
+ ALIAS:
+ _new = 1
+
+void
+print(tree, fp, tabs, extended)
+ DNS__LDNS__DNSSecTrustTree tree;
+ FILE* fp;
+ size_t tabs;
+ bool extended;
+ CODE:
+ ldns_dnssec_trust_tree_print(fp, tree, tabs, extended);
+
+size_t
+ldns_dnssec_trust_tree_depth(tree)
+ DNS__LDNS__DNSSecTrustTree tree;
+ ALIAS:
+ depth = 1
+
+LDNS_Status
+ldns_dnssec_trust_tree_add_parent(tree, parent, signature, parent_status)
+ DNS__LDNS__DNSSecTrustTree tree;
+ DNS__LDNS__DNSSecTrustTree parent;
+ DNS__LDNS__RR signature;
+ LDNS_Status parent_status;
+ ALIAS:
+ _add_parent = 1
+
+LDNS_Status
+ldns_dnssec_trust_tree_contains_keys(tree, trusted_keys)
+ DNS__LDNS__DNSSecTrustTree tree;
+ DNS__LDNS__RRList trusted_keys;
+ ALIAS:
+ _contains_keys = 1
+
+DNS__LDNS__RR
+_rr(tree)
+ DNS__LDNS__DNSSecTrustTree tree;
+ CODE:
+ RETVAL = tree->rr;
+ OUTPUT:
+ RETVAL
+
+DNS__LDNS__RRList
+_rrset(tree)
+ DNS__LDNS__DNSSecTrustTree tree;
+ CODE:
+ RETVAL = tree->rrset;
+ OUTPUT:
+ RETVAL
+
+DNS__LDNS__DNSSecTrustTree
+_parent(tree, i)
+ DNS__LDNS__DNSSecTrustTree tree;
+ size_t i;
+ CODE:
+ RETVAL = tree->parents[i];
+ OUTPUT:
+ RETVAL
+
+LDNS_Status
+_parent_status(tree, i)
+ DNS__LDNS__DNSSecTrustTree tree;
+ size_t i;
+ CODE:
+ RETVAL = tree->parent_status[i];
+ OUTPUT:
+ RETVAL
+
+DNS__LDNS__RR
+_parent_signature(tree, i)
+ DNS__LDNS__DNSSecTrustTree tree;
+ size_t i;
+ CODE:
+ RETVAL = tree->parent_signature[i];
+ OUTPUT:
+ RETVAL
+
+size_t
+parent_count(tree)
+ DNS__LDNS__DNSSecTrustTree tree;
+ CODE:
+ RETVAL = tree->parent_count;
+ OUTPUT:
+ RETVAL
diff --git a/contrib/DNS-LDNS/MANIFEST b/contrib/DNS-LDNS/MANIFEST
new file mode 100644
index 000000000000..decbaa0d6c07
--- /dev/null
+++ b/contrib/DNS-LDNS/MANIFEST
@@ -0,0 +1,41 @@
+Changes
+const-c.inc
+const-xs.inc
+fallback/const-c.inc
+fallback/const-xs.inc
+LDNS.xs
+lib/DNS/LDNS.pm
+lib/DNS/LDNS/DNSSecDataChain.pm
+lib/DNS/LDNS/DNSSecName.pm
+lib/DNS/LDNS/DNSSecRRs.pm
+lib/DNS/LDNS/DNSSecRRSets.pm
+lib/DNS/LDNS/DNSSecTrustTree.pm
+lib/DNS/LDNS/DNSSecZone.pm
+lib/DNS/LDNS/GC.pm
+lib/DNS/LDNS/Key.pm
+lib/DNS/LDNS/KeyList.pm
+lib/DNS/LDNS/Packet.pm
+lib/DNS/LDNS/RBNode.pm
+lib/DNS/LDNS/RBTree.pm
+lib/DNS/LDNS/RData.pm
+lib/DNS/LDNS/Resolver.pm
+lib/DNS/LDNS/RR.pm
+lib/DNS/LDNS/RRList.pm
+lib/DNS/LDNS/Zone.pm
+Makefile.PL
+MANIFEST
+ppport.h
+README
+t/dnssec_datachain.t
+t/dnssec_zone.t
+t/key.t
+t/DNS-LDNS.t
+t/rdata.t
+t/resolver.t
+t/rr.t
+t/rrlist.t
+t/testdata/key.private
+t/testdata/myzone.org
+t/testdata/resolv.conf
+t/zone.t
+typemap
diff --git a/contrib/DNS-LDNS/Makefile.PL b/contrib/DNS-LDNS/Makefile.PL
new file mode 100755
index 000000000000..2ee291ddb765
--- /dev/null
+++ b/contrib/DNS-LDNS/Makefile.PL
@@ -0,0 +1,306 @@
+use 5.014002;
+use ExtUtils::MakeMaker;
+# See lib/ExtUtils/MakeMaker.pm for details of how to influence
+# the contents of the Makefile that is written.
+WriteMakefile(
+ NAME => 'DNS::LDNS',
+ VERSION_FROM => 'lib/DNS/LDNS.pm', # finds $VERSION
+ PREREQ_PM => {}, # e.g., Module::Name => 1.1
+ ($] >= 5.005 ? ## Add these new keywords supported since 5.005
+ (ABSTRACT_FROM => 'lib/DNS/LDNS.pm', # retrieve abstract from module
+ AUTHOR => 'Erik Pihl Ostlyngen <erik.ostlyngen@uninett.no>') : ()),
+ LIBS => ['-lldns'],
+ DEFINE => '',
+ INC => '-I.',
+ # Un-comment this if you add C files to link with later:
+ # OBJECT => '$(O_FILES)', # link all the C files too
+);
+if (eval {require ExtUtils::Constant; 1}) {
+ # If you edit these definitions to change the constants used by this module,
+ # you will need to use the generated const-c.inc and const-xs.inc
+ # files to replace their "fallback" counterparts before distributing your
+ # changes.
+ my @names = (qw(LDNS_AA LDNS_AD LDNS_CD LDNS_DEFAULT_EXP_TIME
+ LDNS_DEFAULT_TTL LDNS_DNSSEC_KEYPROTO LDNS_IP4ADDRLEN
+ LDNS_IP6ADDRLEN LDNS_KEY_REVOKE_KEY LDNS_KEY_SEP_KEY
+ LDNS_KEY_ZONE_KEY LDNS_MAX_DOMAINLEN LDNS_MAX_KEYLEN
+ LDNS_MAX_LABELLEN LDNS_MAX_PACKETLEN LDNS_MAX_POINTERS
+ LDNS_MAX_RDFLEN LDNS_NSEC3_MAX_ITERATIONS
+ LDNS_NSEC3_VARS_OPTOUT_MASK LDNS_PORT LDNS_QR LDNS_RA LDNS_RD
+ LDNS_RDATA_FIELD_DESCRIPTORS_COMMON LDNS_RDF_SIZE_16BYTES
+ LDNS_RDF_SIZE_6BYTES LDNS_RDF_SIZE_BYTE
+ LDNS_RDF_SIZE_DOUBLEWORD LDNS_RDF_SIZE_WORD LDNS_RESOLV_ANCHOR
+ LDNS_RESOLV_DEFDOMAIN LDNS_RESOLV_INET LDNS_RESOLV_INET6
+ LDNS_RESOLV_INETANY LDNS_RESOLV_KEYWORD LDNS_RESOLV_KEYWORDS
+ LDNS_RESOLV_NAMESERVER LDNS_RESOLV_OPTIONS LDNS_RESOLV_RTT_INF
+ LDNS_RESOLV_RTT_MIN LDNS_RESOLV_SEARCH LDNS_RESOLV_SORTLIST
+ LDNS_RR_OVERHEAD LDNS_SIGNATURE_LEAVE_ADD_NEW
+ LDNS_SIGNATURE_LEAVE_NO_ADD LDNS_SIGNATURE_REMOVE_ADD_NEW
+ LDNS_SIGNATURE_REMOVE_NO_ADD LDNS_TC),
+ {name=>"LDNS_CERT_ACPKIX", macro=>"1"},
+ {name=>"LDNS_CERT_IACPKIX", macro=>"1"},
+ {name=>"LDNS_CERT_IPGP", macro=>"1"},
+ {name=>"LDNS_CERT_IPKIX", macro=>"1"},
+ {name=>"LDNS_CERT_ISPKI", macro=>"1"},
+ {name=>"LDNS_CERT_OID", macro=>"1"},
+ {name=>"LDNS_CERT_PGP", macro=>"1"},
+ {name=>"LDNS_CERT_PKIX", macro=>"1"},
+ {name=>"LDNS_CERT_SPKI", macro=>"1"},
+ {name=>"LDNS_CERT_URI", macro=>"1"},
+ {name=>"LDNS_DH", macro=>"1"},
+ {name=>"LDNS_DSA", macro=>"1"},
+ {name=>"LDNS_DSA_NSEC3", macro=>"1"},
+ {name=>"LDNS_ECC", macro=>"1"},
+ {name=>"LDNS_ECC_GOST", macro=>"1"},
+ {name=>"LDNS_HASH_GOST", macro=>"1"},
+ {name=>"LDNS_PACKET_ANSWER", macro=>"1"},
+ {name=>"LDNS_PACKET_IQUERY", macro=>"1"},
+ {name=>"LDNS_PACKET_NODATA", macro=>"1"},
+ {name=>"LDNS_PACKET_NOTIFY", macro=>"1"},
+ {name=>"LDNS_PACKET_NXDOMAIN", macro=>"1"},
+ {name=>"LDNS_PACKET_QUERY", macro=>"1"},
+ {name=>"LDNS_PACKET_QUESTION", macro=>"1"},
+ {name=>"LDNS_PACKET_REFERRAL", macro=>"1"},
+ {name=>"LDNS_PACKET_STATUS", macro=>"1"},
+ {name=>"LDNS_PACKET_UNKNOWN", macro=>"1"},
+ {name=>"LDNS_PACKET_UPDATE", macro=>"1"},
+ {name=>"LDNS_PRIVATEDNS", macro=>"1"},
+ {name=>"LDNS_PRIVATEOID", macro=>"1"},
+ {name=>"LDNS_RCODE_FORMERR", macro=>"1"},
+ {name=>"LDNS_RCODE_NOERROR", macro=>"1"},
+ {name=>"LDNS_RCODE_NOTAUTH", macro=>"1"},
+ {name=>"LDNS_RCODE_NOTIMPL", macro=>"1"},
+ {name=>"LDNS_RCODE_NOTZONE", macro=>"1"},
+ {name=>"LDNS_RCODE_NXDOMAIN", macro=>"1"},
+ {name=>"LDNS_RCODE_NXRRSET", macro=>"1"},
+ {name=>"LDNS_RCODE_REFUSED", macro=>"1"},
+ {name=>"LDNS_RCODE_SERVFAIL", macro=>"1"},
+ {name=>"LDNS_RCODE_YXDOMAIN", macro=>"1"},
+ {name=>"LDNS_RCODE_YXRRSET", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_A", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_AAAA", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_ALG", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_APL", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_ATMA", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_B32_EXT", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_B64", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_CERT_ALG", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_CLASS", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_DNAME", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_HEX", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_INT16", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_INT16_DATA", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_INT32", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_INT8", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_IPSECKEY", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_LOC", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_NONE", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_NSAP", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_NSEC", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_NSEC3_NEXT_OWNER", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_NSEC3_SALT", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_PERIOD", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_SERVICE", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_STR", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_TIME", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_HIP", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_TSIGTIME", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_TYPE", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_UNKNOWN", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_WKS", macro=>"1"},
+ {name=>"LDNS_RR_CLASS_ANY", macro=>"1"},
+ {name=>"LDNS_RR_CLASS_CH", macro=>"1"},
+ {name=>"LDNS_RR_CLASS_COUNT", macro=>"1"},
+ {name=>"LDNS_RR_CLASS_FIRST", macro=>"1"},
+ {name=>"LDNS_RR_CLASS_HS", macro=>"1"},
+ {name=>"LDNS_RR_CLASS_IN", macro=>"1"},
+ {name=>"LDNS_RR_CLASS_LAST", macro=>"1"},
+ {name=>"LDNS_RR_CLASS_NONE", macro=>"1"},
+ {name=>"LDNS_RR_COMPRESS", macro=>"1"},
+ {name=>"LDNS_RR_NO_COMPRESS", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_A", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_A6", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_AAAA", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_AFSDB", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_ANY", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_APL", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_ATMA", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_AXFR", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_CERT", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_CNAME", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_COUNT", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_DHCID", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_DLV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_DNAME", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_DNSKEY", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_DS", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_EID", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_FIRST", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_GID", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_GPOS", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_HINFO", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_IPSECKEY", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_ISDN", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_IXFR", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_KEY", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_KX", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_LAST", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_LOC", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_MAILA", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_MAILB", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_MB", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_MD", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_MF", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_MG", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_MINFO", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_MR", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_MX", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_NAPTR", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_NIMLOC", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_NS", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_NSAP", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_NSAP_PTR", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_NSEC", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_NSEC3", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_NSEC3PARAM", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_NSEC3PARAMS", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_NULL", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_NXT", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_OPT", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_PTR", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_PX", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_RP", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_RRSIG", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_RT", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_SIG", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_SINK", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_SOA", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_SPF", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_SRV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_SSHFP", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_TALINK", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_TSIG", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_TXT", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_UID", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_UINFO", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_UNSPEC", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_WKS", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_X25", macro=>"1"},
+ {name=>"LDNS_RSAMD5", macro=>"1"},
+ {name=>"LDNS_RSASHA1", macro=>"1"},
+ {name=>"LDNS_RSASHA1_NSEC3", macro=>"1"},
+ {name=>"LDNS_RSASHA256", macro=>"1"},
+ {name=>"LDNS_RSASHA512", macro=>"1"},
+ {name=>"LDNS_SECTION_ADDITIONAL", macro=>"1"},
+ {name=>"LDNS_SECTION_ANSWER", macro=>"1"},
+ {name=>"LDNS_SECTION_ANY", macro=>"1"},
+ {name=>"LDNS_SECTION_ANY_NOQUESTION", macro=>"1"},
+ {name=>"LDNS_SECTION_AUTHORITY", macro=>"1"},
+ {name=>"LDNS_SECTION_QUESTION", macro=>"1"},
+ {name=>"LDNS_SHA1", macro=>"1"},
+ {name=>"LDNS_SHA256", macro=>"1"},
+ {name=>"LDNS_SIGN_DSA", macro=>"1"},
+ {name=>"LDNS_SIGN_DSA_NSEC3", macro=>"1"},
+ {name=>"LDNS_SIGN_ECC_GOST", macro=>"1"},
+ {name=>"LDNS_SIGN_HMACSHA1", macro=>"1"},
+ {name=>"LDNS_SIGN_HMACSHA256", macro=>"1"},
+ {name=>"LDNS_SIGN_RSAMD5", macro=>"1"},
+ {name=>"LDNS_SIGN_RSASHA1", macro=>"1"},
+ {name=>"LDNS_SIGN_RSASHA1_NSEC3", macro=>"1"},
+ {name=>"LDNS_SIGN_RSASHA256", macro=>"1"},
+ {name=>"LDNS_SIGN_RSASHA512", macro=>"1"},
+ {name=>"LDNS_STATUS_ADDRESS_ERR", macro=>"1"},
+ {name=>"LDNS_STATUS_CERT_BAD_ALGORITHM", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_ALGO_NOT_IMPL", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_BOGUS", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_EXPIRATION_BEFORE_INCEPTION", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_NO_DNSKEY", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_NO_DS", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_NO_MATCHING_KEYTAG_DNSKEY", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_NO_RRSIG", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_NO_TRUSTED_DNSKEY", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_NO_TRUSTED_DS", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_SIG_EXPIRED", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_SIG_NOT_INCEPTED", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_TSIG_BOGUS", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_TSIG_ERR", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_TYPE_COVERED_ERR", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_UNKNOWN_ALGO", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_VALIDATED", macro=>"1"},
+ {name=>"LDNS_STATUS_DDD_OVERFLOW", macro=>"1"},
+ {name=>"LDNS_STATUS_DNSSEC_EXISTENCE_DENIED", macro=>"1"},
+ {name=>"LDNS_STATUS_DNSSEC_NSEC3_ORIGINAL_NOT_FOUND", macro=>"1"},
+ {name=>"LDNS_STATUS_DNSSEC_NSEC_RR_NOT_COVERED", macro=>"1"},
+ {name=>"LDNS_STATUS_DNSSEC_NSEC_WILDCARD_NOT_COVERED", macro=>"1"},
+ {name=>"LDNS_STATUS_DOMAINNAME_OVERFLOW", macro=>"1"},
+ {name=>"LDNS_STATUS_DOMAINNAME_UNDERFLOW", macro=>"1"},
+ {name=>"LDNS_STATUS_EMPTY_LABEL", macro=>"1"},
+ {name=>"LDNS_STATUS_ENGINE_KEY_NOT_LOADED", macro=>"1"},
+ {name=>"LDNS_STATUS_ERR", macro=>"1"},
+ {name=>"LDNS_STATUS_FILE_ERR", macro=>"1"},
+ {name=>"LDNS_STATUS_INTERNAL_ERR", macro=>"1"},
+ {name=>"LDNS_STATUS_INVALID_B32_EXT", macro=>"1"},
+ {name=>"LDNS_STATUS_INVALID_B64", macro=>"1"},
+ {name=>"LDNS_STATUS_INVALID_HEX", macro=>"1"},
+ {name=>"LDNS_STATUS_INVALID_INT", macro=>"1"},
+ {name=>"LDNS_STATUS_INVALID_IP4", macro=>"1"},
+ {name=>"LDNS_STATUS_INVALID_IP6", macro=>"1"},
+ {name=>"LDNS_STATUS_INVALID_POINTER", macro=>"1"},
+ {name=>"LDNS_STATUS_INVALID_STR", macro=>"1"},
+ {name=>"LDNS_STATUS_INVALID_TIME", macro=>"1"},
+ {name=>"LDNS_STATUS_LABEL_OVERFLOW", macro=>"1"},
+ {name=>"LDNS_STATUS_MEM_ERR", macro=>"1"},
+ {name=>"LDNS_STATUS_MISSING_RDATA_FIELDS_KEY", macro=>"1"},
+ {name=>"LDNS_STATUS_MISSING_RDATA_FIELDS_RRSIG", macro=>"1"},
+ {name=>"LDNS_STATUS_NETWORK_ERR", macro=>"1"},
+ {name=>"LDNS_STATUS_NOT_IMPL", macro=>"1"},
+ {name=>"LDNS_STATUS_NO_DATA", macro=>"1"},
+ {name=>"LDNS_STATUS_NSEC3_ERR", macro=>"1"},
+ {name=>"LDNS_STATUS_NULL", macro=>"1"},
+ {name=>"LDNS_STATUS_OK", macro=>"1"},
+ {name=>"LDNS_STATUS_PACKET_OVERFLOW", macro=>"1"},
+ {name=>"LDNS_STATUS_RES_NO_NS", macro=>"1"},
+ {name=>"LDNS_STATUS_RES_QUERY", macro=>"1"},
+ {name=>"LDNS_STATUS_SOCKET_ERROR", macro=>"1"},
+ {name=>"LDNS_STATUS_SSL_ERR", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_ALG_ERR", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_BAD_ESCAPE", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_CLASS_ERR", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_DNAME_ERR", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_EMPTY", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_ERR", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_INCLUDE", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_INCLUDE_ERR_NOTIMPL", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_INTEGER_OVERFLOW", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_ITERATIONS_OVERFLOW", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_KEYWORD_ERR", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_ORIGIN", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_RDATA_ERR", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_TTL", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_TTL_ERR", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_TYPE_ERR", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_VERSION_ERR", macro=>"1"},
+ {name=>"LDNS_STATUS_UNKNOWN_INET", macro=>"1"},
+ {name=>"LDNS_STATUS_WIRE_INCOMPLETE_ADDITIONAL", macro=>"1"},
+ {name=>"LDNS_STATUS_WIRE_INCOMPLETE_ANSWER", macro=>"1"},
+ {name=>"LDNS_STATUS_WIRE_INCOMPLETE_AUTHORITY", macro=>"1"},
+ {name=>"LDNS_STATUS_WIRE_INCOMPLETE_HEADER", macro=>"1"},
+ {name=>"LDNS_STATUS_WIRE_INCOMPLETE_QUESTION", macro=>"1"});
+ ExtUtils::Constant::WriteConstants(
+ NAME => 'LDNS',
+ NAMES => \@names,
+ DEFAULT_TYPE => 'IV',
+ C_FILE => 'const-c.inc',
+ XS_FILE => 'const-xs.inc',
+ );
+
+}
+else {
+ use File::Copy;
+ use File::Spec;
+ foreach my $file ('const-c.inc', 'const-xs.inc') {
+ my $fallback = File::Spec->catfile('fallback', $file);
+ copy ($fallback, $file) or die "Can't copy $fallback to $file: $!";
+ }
+}
diff --git a/contrib/DNS-LDNS/README b/contrib/DNS-LDNS/README
new file mode 100644
index 000000000000..9f6830323655
--- /dev/null
+++ b/contrib/DNS-LDNS/README
@@ -0,0 +1,36 @@
+DNS::LDNS version 0.06
+======================
+
+DESCRIPTION
+
+DNS::LDNS is a perl OO-wrapper for the ldns library. For a detailed
+description on how this library works, you are advised to read the ldns
+documentation. For a functional description of the wrapper classes,
+please read the perldoc for DNS::LDNS and subclasses.
+
+INSTALLATION
+
+To install this module type the following:
+
+ perl Makefile.PL
+ make
+ make test
+ make install
+
+DEPENDENCIES
+
+This module requires these other modules and libraries:
+
+ ldns
+
+AUTHOR
+
+Erik Pihl Ostlyngen, erik.ostlyngen@uninett.no
+
+COPYRIGHT AND LICENCE
+
+Copyright (C) 2013 by UNINETT Norid AS
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself, either Perl version 5.8.8 or,
+at your option, any later version of Perl 5 you may have available.
diff --git a/contrib/DNS-LDNS/const-c.inc b/contrib/DNS-LDNS/const-c.inc
new file mode 100644
index 000000000000..4b794458f9b4
--- /dev/null
+++ b/contrib/DNS-LDNS/const-c.inc
@@ -0,0 +1,2852 @@
+#define PERL_constant_NOTFOUND 1
+#define PERL_constant_NOTDEF 2
+#define PERL_constant_ISIV 3
+#define PERL_constant_ISNO 4
+#define PERL_constant_ISNV 5
+#define PERL_constant_ISPV 6
+#define PERL_constant_ISPVN 7
+#define PERL_constant_ISSV 8
+#define PERL_constant_ISUNDEF 9
+#define PERL_constant_ISUV 10
+#define PERL_constant_ISYES 11
+
+#ifndef NVTYPE
+typedef double NV; /* 5.6 and later define NVTYPE, and typedef NV to it. */
+#endif
+#ifndef aTHX_
+#define aTHX_ /* 5.6 or later define this for threading support. */
+#endif
+#ifndef pTHX_
+#define pTHX_ /* 5.6 or later define this for threading support. */
+#endif
+
+static int
+constant_7 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_AA LDNS_AD LDNS_CD LDNS_DH LDNS_QR LDNS_RA LDNS_RD LDNS_TC */
+ /* Offset 5 gives the best switch position. */
+ switch (name[5]) {
+ case 'A':
+ if (memEQ(name, "LDNS_AA", 7)) {
+ /* ^ */
+#ifdef LDNS_AA
+ *iv_return = LDNS_AA;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "LDNS_AD", 7)) {
+ /* ^ */
+#ifdef LDNS_AD
+ *iv_return = LDNS_AD;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'C':
+ if (memEQ(name, "LDNS_CD", 7)) {
+ /* ^ */
+#ifdef LDNS_CD
+ *iv_return = LDNS_CD;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'D':
+ if (memEQ(name, "LDNS_DH", 7)) {
+ /* ^ */
+ *iv_return = LDNS_DH;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'Q':
+ if (memEQ(name, "LDNS_QR", 7)) {
+ /* ^ */
+#ifdef LDNS_QR
+ *iv_return = LDNS_QR;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'R':
+ if (memEQ(name, "LDNS_RA", 7)) {
+ /* ^ */
+#ifdef LDNS_RA
+ *iv_return = LDNS_RA;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "LDNS_RD", 7)) {
+ /* ^ */
+#ifdef LDNS_RD
+ *iv_return = LDNS_RD;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'T':
+ if (memEQ(name, "LDNS_TC", 7)) {
+ /* ^ */
+#ifdef LDNS_TC
+ *iv_return = LDNS_TC;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_13 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_CERT_OID LDNS_CERT_PGP LDNS_CERT_URI LDNS_ECC_GOST LDNS_SIGN_DSA */
+ /* Offset 12 gives the best switch position. */
+ switch (name[12]) {
+ case 'A':
+ if (memEQ(name, "LDNS_SIGN_DS", 12)) {
+ /* A */
+ *iv_return = LDNS_SIGN_DSA;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'D':
+ if (memEQ(name, "LDNS_CERT_OI", 12)) {
+ /* D */
+ *iv_return = LDNS_CERT_OID;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'I':
+ if (memEQ(name, "LDNS_CERT_UR", 12)) {
+ /* I */
+ *iv_return = LDNS_CERT_URI;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'P':
+ if (memEQ(name, "LDNS_CERT_PG", 12)) {
+ /* P */
+ *iv_return = LDNS_CERT_PGP;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'T':
+ if (memEQ(name, "LDNS_ECC_GOS", 12)) {
+ /* T */
+ *iv_return = LDNS_ECC_GOST;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_14 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_CERT_IPGP LDNS_CERT_PKIX LDNS_CERT_SPKI LDNS_DSA_NSEC3 LDNS_HASH_GOST
+ LDNS_RR_TYPE_A LDNS_RSASHA256 LDNS_RSASHA512 LDNS_STATUS_OK */
+ /* Offset 13 gives the best switch position. */
+ switch (name[13]) {
+ case '2':
+ if (memEQ(name, "LDNS_RSASHA51", 13)) {
+ /* 2 */
+ *iv_return = LDNS_RSASHA512;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case '3':
+ if (memEQ(name, "LDNS_DSA_NSEC", 13)) {
+ /* 3 */
+ *iv_return = LDNS_DSA_NSEC3;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case '6':
+ if (memEQ(name, "LDNS_RSASHA25", 13)) {
+ /* 6 */
+ *iv_return = LDNS_RSASHA256;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'A':
+ if (memEQ(name, "LDNS_RR_TYPE_", 13)) {
+ /* A */
+ *iv_return = LDNS_RR_TYPE_A;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'I':
+ if (memEQ(name, "LDNS_CERT_SPK", 13)) {
+ /* I */
+ *iv_return = LDNS_CERT_SPKI;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'K':
+ if (memEQ(name, "LDNS_STATUS_O", 13)) {
+ /* K */
+ *iv_return = LDNS_STATUS_OK;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'P':
+ if (memEQ(name, "LDNS_CERT_IPG", 13)) {
+ /* P */
+ *iv_return = LDNS_CERT_IPGP;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'T':
+ if (memEQ(name, "LDNS_HASH_GOS", 13)) {
+ /* T */
+ *iv_return = LDNS_HASH_GOST;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'X':
+ if (memEQ(name, "LDNS_CERT_PKI", 13)) {
+ /* X */
+ *iv_return = LDNS_CERT_PKIX;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_15 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_CERT_IPKIX LDNS_CERT_ISPKI LDNS_IP4ADDRLEN LDNS_IP6ADDRLEN
+ LDNS_MAX_KEYLEN LDNS_MAX_RDFLEN LDNS_PRIVATEDNS LDNS_PRIVATEOID
+ LDNS_RDF_TYPE_A LDNS_RR_TYPE_A6 LDNS_RR_TYPE_DS LDNS_RR_TYPE_KX
+ LDNS_RR_TYPE_MB LDNS_RR_TYPE_MD LDNS_RR_TYPE_MF LDNS_RR_TYPE_MG
+ LDNS_RR_TYPE_MR LDNS_RR_TYPE_MX LDNS_RR_TYPE_NS LDNS_RR_TYPE_PX
+ LDNS_RR_TYPE_RP LDNS_RR_TYPE_RT LDNS_STATUS_ERR */
+ /* Offset 14 gives the best switch position. */
+ switch (name[14]) {
+ case '6':
+ if (memEQ(name, "LDNS_RR_TYPE_A", 14)) {
+ /* 6 */
+ *iv_return = LDNS_RR_TYPE_A6;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'A':
+ if (memEQ(name, "LDNS_RDF_TYPE_", 14)) {
+ /* A */
+ *iv_return = LDNS_RDF_TYPE_A;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'B':
+ if (memEQ(name, "LDNS_RR_TYPE_M", 14)) {
+ /* B */
+ *iv_return = LDNS_RR_TYPE_MB;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'D':
+ if (memEQ(name, "LDNS_PRIVATEOI", 14)) {
+ /* D */
+ *iv_return = LDNS_PRIVATEOID;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_M", 14)) {
+ /* D */
+ *iv_return = LDNS_RR_TYPE_MD;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'F':
+ if (memEQ(name, "LDNS_RR_TYPE_M", 14)) {
+ /* F */
+ *iv_return = LDNS_RR_TYPE_MF;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'G':
+ if (memEQ(name, "LDNS_RR_TYPE_M", 14)) {
+ /* G */
+ *iv_return = LDNS_RR_TYPE_MG;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'I':
+ if (memEQ(name, "LDNS_CERT_ISPK", 14)) {
+ /* I */
+ *iv_return = LDNS_CERT_ISPKI;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'N':
+ if (memEQ(name, "LDNS_IP4ADDRLE", 14)) {
+ /* N */
+#ifdef LDNS_IP4ADDRLEN
+ *iv_return = LDNS_IP4ADDRLEN;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "LDNS_IP6ADDRLE", 14)) {
+ /* N */
+#ifdef LDNS_IP6ADDRLEN
+ *iv_return = LDNS_IP6ADDRLEN;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "LDNS_MAX_KEYLE", 14)) {
+ /* N */
+#ifdef LDNS_MAX_KEYLEN
+ *iv_return = LDNS_MAX_KEYLEN;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "LDNS_MAX_RDFLE", 14)) {
+ /* N */
+#ifdef LDNS_MAX_RDFLEN
+ *iv_return = LDNS_MAX_RDFLEN;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'P':
+ if (memEQ(name, "LDNS_RR_TYPE_R", 14)) {
+ /* P */
+ *iv_return = LDNS_RR_TYPE_RP;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'R':
+ if (memEQ(name, "LDNS_RR_TYPE_M", 14)) {
+ /* R */
+ *iv_return = LDNS_RR_TYPE_MR;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_STATUS_ER", 14)) {
+ /* R */
+ *iv_return = LDNS_STATUS_ERR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'S':
+ if (memEQ(name, "LDNS_PRIVATEDN", 14)) {
+ /* S */
+ *iv_return = LDNS_PRIVATEDNS;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_D", 14)) {
+ /* S */
+ *iv_return = LDNS_RR_TYPE_DS;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_N", 14)) {
+ /* S */
+ *iv_return = LDNS_RR_TYPE_NS;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'T':
+ if (memEQ(name, "LDNS_RR_TYPE_R", 14)) {
+ /* T */
+ *iv_return = LDNS_RR_TYPE_RT;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'X':
+ if (memEQ(name, "LDNS_CERT_IPKI", 14)) {
+ /* X */
+ *iv_return = LDNS_CERT_IPKIX;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_K", 14)) {
+ /* X */
+ *iv_return = LDNS_RR_TYPE_KX;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_M", 14)) {
+ /* X */
+ *iv_return = LDNS_RR_TYPE_MX;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_P", 14)) {
+ /* X */
+ *iv_return = LDNS_RR_TYPE_PX;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_16 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_CERT_ACPKIX LDNS_DEFAULT_TTL LDNS_KEY_SEP_KEY LDNS_RESOLV_INET
+ LDNS_RR_CLASS_CH LDNS_RR_CLASS_HS LDNS_RR_CLASS_IN LDNS_RR_COMPRESS
+ LDNS_RR_OVERHEAD LDNS_RR_TYPE_ANY LDNS_RR_TYPE_APL LDNS_RR_TYPE_DLV
+ LDNS_RR_TYPE_EID LDNS_RR_TYPE_GID LDNS_RR_TYPE_KEY LDNS_RR_TYPE_LOC
+ LDNS_RR_TYPE_NXT LDNS_RR_TYPE_OPT LDNS_RR_TYPE_PTR LDNS_RR_TYPE_SIG
+ LDNS_RR_TYPE_SOA LDNS_RR_TYPE_SPF LDNS_RR_TYPE_SRV LDNS_RR_TYPE_TXT
+ LDNS_RR_TYPE_UID LDNS_RR_TYPE_WKS LDNS_RR_TYPE_X25 LDNS_SECTION_ANY
+ LDNS_SIGN_RSAMD5 LDNS_STATUS_NULL */
+ /* Offset 13 gives the best switch position. */
+ switch (name[13]) {
+ case 'A':
+ if (memEQ(name, "LDNS_RR_TYPE_ANY", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_ANY;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_APL", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_APL;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_SECTION_ANY", 16)) {
+ /* ^ */
+ *iv_return = LDNS_SECTION_ANY;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'D':
+ if (memEQ(name, "LDNS_RR_TYPE_DLV", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_DLV;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'E':
+ if (memEQ(name, "LDNS_RR_COMPRESS", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_COMPRESS;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_OVERHEAD", 16)) {
+ /* ^ */
+#ifdef LDNS_RR_OVERHEAD
+ *iv_return = LDNS_RR_OVERHEAD;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_EID", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_EID;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'G':
+ if (memEQ(name, "LDNS_RR_TYPE_GID", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_GID;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'K':
+ if (memEQ(name, "LDNS_CERT_ACPKIX", 16)) {
+ /* ^ */
+ *iv_return = LDNS_CERT_ACPKIX;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_KEY_SEP_KEY", 16)) {
+ /* ^ */
+#ifdef LDNS_KEY_SEP_KEY
+ *iv_return = LDNS_KEY_SEP_KEY;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_KEY", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_KEY;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'L':
+ if (memEQ(name, "LDNS_RR_TYPE_LOC", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_LOC;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'M':
+ if (memEQ(name, "LDNS_SIGN_RSAMD5", 16)) {
+ /* ^ */
+ *iv_return = LDNS_SIGN_RSAMD5;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'N':
+ if (memEQ(name, "LDNS_RESOLV_INET", 16)) {
+ /* ^ */
+#ifdef LDNS_RESOLV_INET
+ *iv_return = LDNS_RESOLV_INET;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_NXT", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_NXT;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'O':
+ if (memEQ(name, "LDNS_RR_TYPE_OPT", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_OPT;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'P':
+ if (memEQ(name, "LDNS_RR_TYPE_PTR", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_PTR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'S':
+ if (memEQ(name, "LDNS_RR_TYPE_SIG", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_SIG;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_SOA", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_SOA;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_SPF", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_SPF;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_SRV", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_SRV;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'T':
+ if (memEQ(name, "LDNS_DEFAULT_TTL", 16)) {
+ /* ^ */
+#ifdef LDNS_DEFAULT_TTL
+ *iv_return = LDNS_DEFAULT_TTL;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_TXT", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_TXT;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'U':
+ if (memEQ(name, "LDNS_RR_TYPE_UID", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_UID;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_STATUS_NULL", 16)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_NULL;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'W':
+ if (memEQ(name, "LDNS_RR_TYPE_WKS", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_WKS;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'X':
+ if (memEQ(name, "LDNS_RR_TYPE_X25", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_X25;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case '_':
+ if (memEQ(name, "LDNS_RR_CLASS_CH", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_CLASS_CH;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_CLASS_HS", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_CLASS_HS;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_CLASS_IN", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_CLASS_IN;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_17 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_CERT_IACPKIX LDNS_KEY_ZONE_KEY LDNS_MAX_LABELLEN LDNS_MAX_POINTERS
+ LDNS_PACKET_QUERY LDNS_RDF_TYPE_ALG LDNS_RDF_TYPE_APL LDNS_RDF_TYPE_B64
+ LDNS_RDF_TYPE_HEX LDNS_RDF_TYPE_HIP LDNS_RDF_TYPE_LOC LDNS_RDF_TYPE_STR
+ LDNS_RDF_TYPE_WKS LDNS_RESOLV_INET6 LDNS_RR_CLASS_ANY LDNS_RR_TYPE_AAAA
+ LDNS_RR_TYPE_ATMA LDNS_RR_TYPE_AXFR LDNS_RR_TYPE_CERT LDNS_RR_TYPE_GPOS
+ LDNS_RR_TYPE_ISDN LDNS_RR_TYPE_IXFR LDNS_RR_TYPE_LAST LDNS_RR_TYPE_NSAP
+ LDNS_RR_TYPE_NSEC LDNS_RR_TYPE_NULL LDNS_RR_TYPE_SINK LDNS_RR_TYPE_TSIG
+ LDNS_SIGN_RSASHA1 */
+ /* Offset 16 gives the best switch position. */
+ switch (name[16]) {
+ case '1':
+ if (memEQ(name, "LDNS_SIGN_RSASHA", 16)) {
+ /* 1 */
+ *iv_return = LDNS_SIGN_RSASHA1;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case '4':
+ if (memEQ(name, "LDNS_RDF_TYPE_B6", 16)) {
+ /* 4 */
+ *iv_return = LDNS_RDF_TYPE_B64;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case '6':
+ if (memEQ(name, "LDNS_RESOLV_INET", 16)) {
+ /* 6 */
+#ifdef LDNS_RESOLV_INET6
+ *iv_return = LDNS_RESOLV_INET6;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'A':
+ if (memEQ(name, "LDNS_RR_TYPE_AAA", 16)) {
+ /* A */
+ *iv_return = LDNS_RR_TYPE_AAAA;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_ATM", 16)) {
+ /* A */
+ *iv_return = LDNS_RR_TYPE_ATMA;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'C':
+ if (memEQ(name, "LDNS_RDF_TYPE_LO", 16)) {
+ /* C */
+ *iv_return = LDNS_RDF_TYPE_LOC;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_NSE", 16)) {
+ /* C */
+ *iv_return = LDNS_RR_TYPE_NSEC;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'G':
+ if (memEQ(name, "LDNS_RDF_TYPE_AL", 16)) {
+ /* G */
+ *iv_return = LDNS_RDF_TYPE_ALG;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_TSI", 16)) {
+ /* G */
+ *iv_return = LDNS_RR_TYPE_TSIG;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'K':
+ if (memEQ(name, "LDNS_RR_TYPE_SIN", 16)) {
+ /* K */
+ *iv_return = LDNS_RR_TYPE_SINK;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'L':
+ if (memEQ(name, "LDNS_RDF_TYPE_AP", 16)) {
+ /* L */
+ *iv_return = LDNS_RDF_TYPE_APL;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_NUL", 16)) {
+ /* L */
+ *iv_return = LDNS_RR_TYPE_NULL;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'N':
+ if (memEQ(name, "LDNS_MAX_LABELLE", 16)) {
+ /* N */
+#ifdef LDNS_MAX_LABELLEN
+ *iv_return = LDNS_MAX_LABELLEN;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_ISD", 16)) {
+ /* N */
+ *iv_return = LDNS_RR_TYPE_ISDN;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'P':
+ if (memEQ(name, "LDNS_RDF_TYPE_HI", 16)) {
+ /* P */
+ *iv_return = LDNS_RDF_TYPE_HIP;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_NSA", 16)) {
+ /* P */
+ *iv_return = LDNS_RR_TYPE_NSAP;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'R':
+ if (memEQ(name, "LDNS_RDF_TYPE_ST", 16)) {
+ /* R */
+ *iv_return = LDNS_RDF_TYPE_STR;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_AXF", 16)) {
+ /* R */
+ *iv_return = LDNS_RR_TYPE_AXFR;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_IXF", 16)) {
+ /* R */
+ *iv_return = LDNS_RR_TYPE_IXFR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'S':
+ if (memEQ(name, "LDNS_MAX_POINTER", 16)) {
+ /* S */
+#ifdef LDNS_MAX_POINTERS
+ *iv_return = LDNS_MAX_POINTERS;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "LDNS_RDF_TYPE_WK", 16)) {
+ /* S */
+ *iv_return = LDNS_RDF_TYPE_WKS;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_GPO", 16)) {
+ /* S */
+ *iv_return = LDNS_RR_TYPE_GPOS;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'T':
+ if (memEQ(name, "LDNS_RR_TYPE_CER", 16)) {
+ /* T */
+ *iv_return = LDNS_RR_TYPE_CERT;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_LAS", 16)) {
+ /* T */
+ *iv_return = LDNS_RR_TYPE_LAST;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'X':
+ if (memEQ(name, "LDNS_CERT_IACPKI", 16)) {
+ /* X */
+ *iv_return = LDNS_CERT_IACPKIX;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RDF_TYPE_HE", 16)) {
+ /* X */
+ *iv_return = LDNS_RDF_TYPE_HEX;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'Y':
+ if (memEQ(name, "LDNS_KEY_ZONE_KE", 16)) {
+ /* Y */
+#ifdef LDNS_KEY_ZONE_KEY
+ *iv_return = LDNS_KEY_ZONE_KEY;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "LDNS_PACKET_QUER", 16)) {
+ /* Y */
+ *iv_return = LDNS_PACKET_QUERY;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_CLASS_AN", 16)) {
+ /* Y */
+ *iv_return = LDNS_RR_CLASS_ANY;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_18 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_MAX_DOMAINLEN LDNS_MAX_PACKETLEN LDNS_PACKET_ANSWER
+ LDNS_PACKET_IQUERY LDNS_PACKET_NODATA LDNS_PACKET_NOTIFY
+ LDNS_PACKET_STATUS LDNS_PACKET_UPDATE LDNS_RCODE_FORMERR
+ LDNS_RCODE_NOERROR LDNS_RCODE_NOTAUTH LDNS_RCODE_NOTIMPL
+ LDNS_RCODE_NOTZONE LDNS_RCODE_NXRRSET LDNS_RCODE_REFUSED
+ LDNS_RCODE_YXRRSET LDNS_RDF_SIZE_BYTE LDNS_RDF_SIZE_WORD
+ LDNS_RDF_TYPE_AAAA LDNS_RDF_TYPE_ATMA LDNS_RDF_TYPE_INT8
+ LDNS_RDF_TYPE_NONE LDNS_RDF_TYPE_NSAP LDNS_RDF_TYPE_NSEC
+ LDNS_RDF_TYPE_TIME LDNS_RDF_TYPE_TYPE LDNS_RESOLV_ANCHOR
+ LDNS_RESOLV_SEARCH LDNS_RR_CLASS_LAST LDNS_RR_CLASS_NONE
+ LDNS_RR_TYPE_AFSDB LDNS_RR_TYPE_CNAME LDNS_RR_TYPE_COUNT
+ LDNS_RR_TYPE_DHCID LDNS_RR_TYPE_DNAME LDNS_RR_TYPE_FIRST
+ LDNS_RR_TYPE_HINFO LDNS_RR_TYPE_MAILA LDNS_RR_TYPE_MAILB
+ LDNS_RR_TYPE_MINFO LDNS_RR_TYPE_NAPTR LDNS_RR_TYPE_NSEC3
+ LDNS_RR_TYPE_RRSIG LDNS_RR_TYPE_SSHFP LDNS_RR_TYPE_UINFO
+ LDNS_RSASHA1_NSEC3 LDNS_SIGN_ECC_GOST LDNS_SIGN_HMACSHA1 */
+ /* Offset 17 gives the best switch position. */
+ switch (name[17]) {
+ case '1':
+ if (memEQ(name, "LDNS_SIGN_HMACSHA", 17)) {
+ /* 1 */
+ *iv_return = LDNS_SIGN_HMACSHA1;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case '3':
+ if (memEQ(name, "LDNS_RR_TYPE_NSEC", 17)) {
+ /* 3 */
+ *iv_return = LDNS_RR_TYPE_NSEC3;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RSASHA1_NSEC", 17)) {
+ /* 3 */
+ *iv_return = LDNS_RSASHA1_NSEC3;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case '8':
+ if (memEQ(name, "LDNS_RDF_TYPE_INT", 17)) {
+ /* 8 */
+ *iv_return = LDNS_RDF_TYPE_INT8;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'A':
+ if (memEQ(name, "LDNS_PACKET_NODAT", 17)) {
+ /* A */
+ *iv_return = LDNS_PACKET_NODATA;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RDF_TYPE_AAA", 17)) {
+ /* A */
+ *iv_return = LDNS_RDF_TYPE_AAAA;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RDF_TYPE_ATM", 17)) {
+ /* A */
+ *iv_return = LDNS_RDF_TYPE_ATMA;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_MAIL", 17)) {
+ /* A */
+ *iv_return = LDNS_RR_TYPE_MAILA;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'B':
+ if (memEQ(name, "LDNS_RR_TYPE_AFSD", 17)) {
+ /* B */
+ *iv_return = LDNS_RR_TYPE_AFSDB;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_MAIL", 17)) {
+ /* B */
+ *iv_return = LDNS_RR_TYPE_MAILB;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'C':
+ if (memEQ(name, "LDNS_RDF_TYPE_NSE", 17)) {
+ /* C */
+ *iv_return = LDNS_RDF_TYPE_NSEC;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'D':
+ if (memEQ(name, "LDNS_RCODE_REFUSE", 17)) {
+ /* D */
+ *iv_return = LDNS_RCODE_REFUSED;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RDF_SIZE_WOR", 17)) {
+ /* D */
+#ifdef LDNS_RDF_SIZE_WORD
+ *iv_return = LDNS_RDF_SIZE_WORD;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_DHCI", 17)) {
+ /* D */
+ *iv_return = LDNS_RR_TYPE_DHCID;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'E':
+ if (memEQ(name, "LDNS_PACKET_UPDAT", 17)) {
+ /* E */
+ *iv_return = LDNS_PACKET_UPDATE;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RCODE_NOTZON", 17)) {
+ /* E */
+ *iv_return = LDNS_RCODE_NOTZONE;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RDF_SIZE_BYT", 17)) {
+ /* E */
+#ifdef LDNS_RDF_SIZE_BYTE
+ *iv_return = LDNS_RDF_SIZE_BYTE;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "LDNS_RDF_TYPE_NON", 17)) {
+ /* E */
+ *iv_return = LDNS_RDF_TYPE_NONE;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RDF_TYPE_TIM", 17)) {
+ /* E */
+ *iv_return = LDNS_RDF_TYPE_TIME;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RDF_TYPE_TYP", 17)) {
+ /* E */
+ *iv_return = LDNS_RDF_TYPE_TYPE;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_CLASS_NON", 17)) {
+ /* E */
+ *iv_return = LDNS_RR_CLASS_NONE;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_CNAM", 17)) {
+ /* E */
+ *iv_return = LDNS_RR_TYPE_CNAME;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_DNAM", 17)) {
+ /* E */
+ *iv_return = LDNS_RR_TYPE_DNAME;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'G':
+ if (memEQ(name, "LDNS_RR_TYPE_RRSI", 17)) {
+ /* G */
+ *iv_return = LDNS_RR_TYPE_RRSIG;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'H':
+ if (memEQ(name, "LDNS_RCODE_NOTAUT", 17)) {
+ /* H */
+ *iv_return = LDNS_RCODE_NOTAUTH;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RESOLV_SEARC", 17)) {
+ /* H */
+#ifdef LDNS_RESOLV_SEARCH
+ *iv_return = LDNS_RESOLV_SEARCH;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'L':
+ if (memEQ(name, "LDNS_RCODE_NOTIMP", 17)) {
+ /* L */
+ *iv_return = LDNS_RCODE_NOTIMPL;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'N':
+ if (memEQ(name, "LDNS_MAX_DOMAINLE", 17)) {
+ /* N */
+#ifdef LDNS_MAX_DOMAINLEN
+ *iv_return = LDNS_MAX_DOMAINLEN;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "LDNS_MAX_PACKETLE", 17)) {
+ /* N */
+#ifdef LDNS_MAX_PACKETLEN
+ *iv_return = LDNS_MAX_PACKETLEN;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'O':
+ if (memEQ(name, "LDNS_RR_TYPE_HINF", 17)) {
+ /* O */
+ *iv_return = LDNS_RR_TYPE_HINFO;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_MINF", 17)) {
+ /* O */
+ *iv_return = LDNS_RR_TYPE_MINFO;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_UINF", 17)) {
+ /* O */
+ *iv_return = LDNS_RR_TYPE_UINFO;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'P':
+ if (memEQ(name, "LDNS_RDF_TYPE_NSA", 17)) {
+ /* P */
+ *iv_return = LDNS_RDF_TYPE_NSAP;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_SSHF", 17)) {
+ /* P */
+ *iv_return = LDNS_RR_TYPE_SSHFP;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'R':
+ if (memEQ(name, "LDNS_PACKET_ANSWE", 17)) {
+ /* R */
+ *iv_return = LDNS_PACKET_ANSWER;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RCODE_FORMER", 17)) {
+ /* R */
+ *iv_return = LDNS_RCODE_FORMERR;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RCODE_NOERRO", 17)) {
+ /* R */
+ *iv_return = LDNS_RCODE_NOERROR;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RESOLV_ANCHO", 17)) {
+ /* R */
+#ifdef LDNS_RESOLV_ANCHOR
+ *iv_return = LDNS_RESOLV_ANCHOR;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_NAPT", 17)) {
+ /* R */
+ *iv_return = LDNS_RR_TYPE_NAPTR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'S':
+ if (memEQ(name, "LDNS_PACKET_STATU", 17)) {
+ /* S */
+ *iv_return = LDNS_PACKET_STATUS;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'T':
+ if (memEQ(name, "LDNS_RCODE_NXRRSE", 17)) {
+ /* T */
+ *iv_return = LDNS_RCODE_NXRRSET;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RCODE_YXRRSE", 17)) {
+ /* T */
+ *iv_return = LDNS_RCODE_YXRRSET;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_CLASS_LAS", 17)) {
+ /* T */
+ *iv_return = LDNS_RR_CLASS_LAST;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_COUN", 17)) {
+ /* T */
+ *iv_return = LDNS_RR_TYPE_COUNT;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_FIRS", 17)) {
+ /* T */
+ *iv_return = LDNS_RR_TYPE_FIRST;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_SIGN_ECC_GOS", 17)) {
+ /* T */
+ *iv_return = LDNS_SIGN_ECC_GOST;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'Y':
+ if (memEQ(name, "LDNS_PACKET_IQUER", 17)) {
+ /* Y */
+ *iv_return = LDNS_PACKET_IQUERY;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_PACKET_NOTIF", 17)) {
+ /* Y */
+ *iv_return = LDNS_PACKET_NOTIFY;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_19 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_KEY_REVOKE_KEY LDNS_PACKET_UNKNOWN LDNS_RCODE_NXDOMAIN
+ LDNS_RCODE_SERVFAIL LDNS_RCODE_YXDOMAIN LDNS_RDF_TYPE_CLASS
+ LDNS_RDF_TYPE_DNAME LDNS_RDF_TYPE_INT16 LDNS_RDF_TYPE_INT32
+ LDNS_RESOLV_INETANY LDNS_RESOLV_KEYWORD LDNS_RESOLV_OPTIONS
+ LDNS_RESOLV_RTT_INF LDNS_RESOLV_RTT_MIN LDNS_RR_CLASS_COUNT
+ LDNS_RR_CLASS_FIRST LDNS_RR_NO_COMPRESS LDNS_RR_TYPE_DNSKEY
+ LDNS_RR_TYPE_NIMLOC LDNS_RR_TYPE_TALINK LDNS_RR_TYPE_UNSPEC
+ LDNS_SECTION_ANSWER LDNS_SIGN_DSA_NSEC3 LDNS_SIGN_RSASHA256
+ LDNS_SIGN_RSASHA512 LDNS_STATUS_MEM_ERR LDNS_STATUS_NO_DATA
+ LDNS_STATUS_SSL_ERR */
+ /* Offset 14 gives the best switch position. */
+ switch (name[14]) {
+ case 'A':
+ if (memEQ(name, "LDNS_RR_TYPE_TALINK", 19)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_TALINK;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'C':
+ if (memEQ(name, "LDNS_RDF_TYPE_CLASS", 19)) {
+ /* ^ */
+ *iv_return = LDNS_RDF_TYPE_CLASS;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_CLASS_COUNT", 19)) {
+ /* ^ */
+ *iv_return = LDNS_RR_CLASS_COUNT;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'D':
+ if (memEQ(name, "LDNS_RDF_TYPE_DNAME", 19)) {
+ /* ^ */
+ *iv_return = LDNS_RDF_TYPE_DNAME;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'E':
+ if (memEQ(name, "LDNS_KEY_REVOKE_KEY", 19)) {
+ /* ^ */
+#ifdef LDNS_KEY_REVOKE_KEY
+ *iv_return = LDNS_KEY_REVOKE_KEY;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "LDNS_RESOLV_INETANY", 19)) {
+ /* ^ */
+#ifdef LDNS_RESOLV_INETANY
+ *iv_return = LDNS_RESOLV_INETANY;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'F':
+ if (memEQ(name, "LDNS_RR_CLASS_FIRST", 19)) {
+ /* ^ */
+ *iv_return = LDNS_RR_CLASS_FIRST;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'H':
+ if (memEQ(name, "LDNS_SIGN_RSASHA256", 19)) {
+ /* ^ */
+ *iv_return = LDNS_SIGN_RSASHA256;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_SIGN_RSASHA512", 19)) {
+ /* ^ */
+ *iv_return = LDNS_SIGN_RSASHA512;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'I':
+ if (memEQ(name, "LDNS_RDF_TYPE_INT16", 19)) {
+ /* ^ */
+ *iv_return = LDNS_RDF_TYPE_INT16;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RDF_TYPE_INT32", 19)) {
+ /* ^ */
+ *iv_return = LDNS_RDF_TYPE_INT32;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_NIMLOC", 19)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_NIMLOC;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'K':
+ if (memEQ(name, "LDNS_PACKET_UNKNOWN", 19)) {
+ /* ^ */
+ *iv_return = LDNS_PACKET_UNKNOWN;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'L':
+ if (memEQ(name, "LDNS_STATUS_SSL_ERR", 19)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SSL_ERR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'M':
+ if (memEQ(name, "LDNS_STATUS_MEM_ERR", 19)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_MEM_ERR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'N':
+ if (memEQ(name, "LDNS_RR_TYPE_DNSKEY", 19)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_DNSKEY;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_UNSPEC", 19)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_UNSPEC;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_SECTION_ANSWER", 19)) {
+ /* ^ */
+ *iv_return = LDNS_SECTION_ANSWER;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_SIGN_DSA_NSEC3", 19)) {
+ /* ^ */
+ *iv_return = LDNS_SIGN_DSA_NSEC3;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'O':
+ if (memEQ(name, "LDNS_RCODE_NXDOMAIN", 19)) {
+ /* ^ */
+ *iv_return = LDNS_RCODE_NXDOMAIN;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RCODE_YXDOMAIN", 19)) {
+ /* ^ */
+ *iv_return = LDNS_RCODE_YXDOMAIN;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'P':
+ if (memEQ(name, "LDNS_RR_NO_COMPRESS", 19)) {
+ /* ^ */
+ *iv_return = LDNS_RR_NO_COMPRESS;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'T':
+ if (memEQ(name, "LDNS_RESOLV_OPTIONS", 19)) {
+ /* ^ */
+#ifdef LDNS_RESOLV_OPTIONS
+ *iv_return = LDNS_RESOLV_OPTIONS;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "LDNS_RESOLV_RTT_INF", 19)) {
+ /* ^ */
+#ifdef LDNS_RESOLV_RTT_INF
+ *iv_return = LDNS_RESOLV_RTT_INF;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "LDNS_RESOLV_RTT_MIN", 19)) {
+ /* ^ */
+#ifdef LDNS_RESOLV_RTT_MIN
+ *iv_return = LDNS_RESOLV_RTT_MIN;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'V':
+ if (memEQ(name, "LDNS_RCODE_SERVFAIL", 19)) {
+ /* ^ */
+ *iv_return = LDNS_RCODE_SERVFAIL;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'Y':
+ if (memEQ(name, "LDNS_RESOLV_KEYWORD", 19)) {
+ /* ^ */
+#ifdef LDNS_RESOLV_KEYWORD
+ *iv_return = LDNS_RESOLV_KEYWORD;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case '_':
+ if (memEQ(name, "LDNS_STATUS_NO_DATA", 19)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_NO_DATA;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_20 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_DNSSEC_KEYPROTO LDNS_PACKET_NXDOMAIN LDNS_PACKET_QUESTION
+ LDNS_PACKET_REFERRAL LDNS_RDF_SIZE_6BYTES LDNS_RDF_TYPE_PERIOD
+ LDNS_RESOLV_KEYWORDS LDNS_RESOLV_SORTLIST LDNS_SIGN_HMACSHA256
+ LDNS_STATUS_FILE_ERR LDNS_STATUS_NOT_IMPL */
+ /* Offset 18 gives the best switch position. */
+ switch (name[18]) {
+ case '5':
+ if (memEQ(name, "LDNS_SIGN_HMACSHA256", 20)) {
+ /* ^ */
+ *iv_return = LDNS_SIGN_HMACSHA256;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'A':
+ if (memEQ(name, "LDNS_PACKET_REFERRAL", 20)) {
+ /* ^ */
+ *iv_return = LDNS_PACKET_REFERRAL;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'D':
+ if (memEQ(name, "LDNS_RESOLV_KEYWORDS", 20)) {
+ /* ^ */
+#ifdef LDNS_RESOLV_KEYWORDS
+ *iv_return = LDNS_RESOLV_KEYWORDS;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'E':
+ if (memEQ(name, "LDNS_RDF_SIZE_6BYTES", 20)) {
+ /* ^ */
+#ifdef LDNS_RDF_SIZE_6BYTES
+ *iv_return = LDNS_RDF_SIZE_6BYTES;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'I':
+ if (memEQ(name, "LDNS_PACKET_NXDOMAIN", 20)) {
+ /* ^ */
+ *iv_return = LDNS_PACKET_NXDOMAIN;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'O':
+ if (memEQ(name, "LDNS_PACKET_QUESTION", 20)) {
+ /* ^ */
+ *iv_return = LDNS_PACKET_QUESTION;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RDF_TYPE_PERIOD", 20)) {
+ /* ^ */
+ *iv_return = LDNS_RDF_TYPE_PERIOD;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'P':
+ if (memEQ(name, "LDNS_STATUS_NOT_IMPL", 20)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_NOT_IMPL;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'R':
+ if (memEQ(name, "LDNS_STATUS_FILE_ERR", 20)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_FILE_ERR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'S':
+ if (memEQ(name, "LDNS_RESOLV_SORTLIST", 20)) {
+ /* ^ */
+#ifdef LDNS_RESOLV_SORTLIST
+ *iv_return = LDNS_RESOLV_SORTLIST;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'T':
+ if (memEQ(name, "LDNS_DNSSEC_KEYPROTO", 20)) {
+ /* ^ */
+#ifdef LDNS_DNSSEC_KEYPROTO
+ *iv_return = LDNS_DNSSEC_KEYPROTO;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_21 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_DEFAULT_EXP_TIME LDNS_RDF_SIZE_16BYTES LDNS_RDF_TYPE_B32_EXT
+ LDNS_RDF_TYPE_SERVICE LDNS_RDF_TYPE_UNKNOWN LDNS_RESOLV_DEFDOMAIN
+ LDNS_RR_TYPE_IPSECKEY LDNS_RR_TYPE_NSAP_PTR LDNS_SECTION_QUESTION
+ LDNS_STATUS_NSEC3_ERR LDNS_STATUS_RES_NO_NS LDNS_STATUS_RES_QUERY */
+ /* Offset 16 gives the best switch position. */
+ switch (name[16]) {
+ case '2':
+ if (memEQ(name, "LDNS_RDF_TYPE_B32_EXT", 21)) {
+ /* ^ */
+ *iv_return = LDNS_RDF_TYPE_B32_EXT;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case '3':
+ if (memEQ(name, "LDNS_STATUS_NSEC3_ERR", 21)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_NSEC3_ERR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'B':
+ if (memEQ(name, "LDNS_RDF_SIZE_16BYTES", 21)) {
+ /* ^ */
+#ifdef LDNS_RDF_SIZE_16BYTES
+ *iv_return = LDNS_RDF_SIZE_16BYTES;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'E':
+ if (memEQ(name, "LDNS_RR_TYPE_IPSECKEY", 21)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_IPSECKEY;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'K':
+ if (memEQ(name, "LDNS_RDF_TYPE_UNKNOWN", 21)) {
+ /* ^ */
+ *iv_return = LDNS_RDF_TYPE_UNKNOWN;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'N':
+ if (memEQ(name, "LDNS_STATUS_RES_NO_NS", 21)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_RES_NO_NS;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'O':
+ if (memEQ(name, "LDNS_RESOLV_DEFDOMAIN", 21)) {
+ /* ^ */
+#ifdef LDNS_RESOLV_DEFDOMAIN
+ *iv_return = LDNS_RESOLV_DEFDOMAIN;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'P':
+ if (memEQ(name, "LDNS_RR_TYPE_NSAP_PTR", 21)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_NSAP_PTR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'Q':
+ if (memEQ(name, "LDNS_STATUS_RES_QUERY", 21)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_RES_QUERY;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'R':
+ if (memEQ(name, "LDNS_RDF_TYPE_SERVICE", 21)) {
+ /* ^ */
+ *iv_return = LDNS_RDF_TYPE_SERVICE;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'S':
+ if (memEQ(name, "LDNS_SECTION_QUESTION", 21)) {
+ /* ^ */
+ *iv_return = LDNS_SECTION_QUESTION;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case '_':
+ if (memEQ(name, "LDNS_DEFAULT_EXP_TIME", 21)) {
+ /* ^ */
+#ifdef LDNS_DEFAULT_EXP_TIME
+ *iv_return = LDNS_DEFAULT_EXP_TIME;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_22 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_RDF_TYPE_CERT_ALG LDNS_RDF_TYPE_IPSECKEY LDNS_RDF_TYPE_TSIGTIME
+ LDNS_RESOLV_NAMESERVER LDNS_SECTION_AUTHORITY LDNS_STATUS_SYNTAX_ERR
+ LDNS_STATUS_SYNTAX_TTL */
+ /* Offset 14 gives the best switch position. */
+ switch (name[14]) {
+ case 'C':
+ if (memEQ(name, "LDNS_RDF_TYPE_CERT_ALG", 22)) {
+ /* ^ */
+ *iv_return = LDNS_RDF_TYPE_CERT_ALG;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'I':
+ if (memEQ(name, "LDNS_RDF_TYPE_IPSECKEY", 22)) {
+ /* ^ */
+ *iv_return = LDNS_RDF_TYPE_IPSECKEY;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'M':
+ if (memEQ(name, "LDNS_RESOLV_NAMESERVER", 22)) {
+ /* ^ */
+#ifdef LDNS_RESOLV_NAMESERVER
+ *iv_return = LDNS_RESOLV_NAMESERVER;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'N':
+ if (memEQ(name, "LDNS_STATUS_SYNTAX_ERR", 22)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SYNTAX_ERR;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_STATUS_SYNTAX_TTL", 22)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SYNTAX_TTL;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'T':
+ if (memEQ(name, "LDNS_RDF_TYPE_TSIGTIME", 22)) {
+ /* ^ */
+ *iv_return = LDNS_RDF_TYPE_TSIGTIME;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'U':
+ if (memEQ(name, "LDNS_SECTION_AUTHORITY", 22)) {
+ /* ^ */
+ *iv_return = LDNS_SECTION_AUTHORITY;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_23 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_RR_TYPE_NSEC3PARAM LDNS_SECTION_ADDITIONAL LDNS_SIGN_RSASHA1_NSEC3
+ LDNS_STATUS_ADDRESS_ERR LDNS_STATUS_EMPTY_LABEL LDNS_STATUS_INVALID_B64
+ LDNS_STATUS_INVALID_HEX LDNS_STATUS_INVALID_INT LDNS_STATUS_INVALID_IP4
+ LDNS_STATUS_INVALID_IP6 LDNS_STATUS_INVALID_STR LDNS_STATUS_NETWORK_ERR */
+ /* Offset 21 gives the best switch position. */
+ switch (name[21]) {
+ case '6':
+ if (memEQ(name, "LDNS_STATUS_INVALID_B64", 23)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_INVALID_B64;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'A':
+ if (memEQ(name, "LDNS_RR_TYPE_NSEC3PARAM", 23)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_NSEC3PARAM;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_SECTION_ADDITIONAL", 23)) {
+ /* ^ */
+ *iv_return = LDNS_SECTION_ADDITIONAL;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'C':
+ if (memEQ(name, "LDNS_SIGN_RSASHA1_NSEC3", 23)) {
+ /* ^ */
+ *iv_return = LDNS_SIGN_RSASHA1_NSEC3;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'E':
+ if (memEQ(name, "LDNS_STATUS_EMPTY_LABEL", 23)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_EMPTY_LABEL;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_STATUS_INVALID_HEX", 23)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_INVALID_HEX;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'N':
+ if (memEQ(name, "LDNS_STATUS_INVALID_INT", 23)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_INVALID_INT;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'P':
+ if (memEQ(name, "LDNS_STATUS_INVALID_IP4", 23)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_INVALID_IP4;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_STATUS_INVALID_IP6", 23)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_INVALID_IP6;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'R':
+ if (memEQ(name, "LDNS_STATUS_ADDRESS_ERR", 23)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_ADDRESS_ERR;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_STATUS_NETWORK_ERR", 23)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_NETWORK_ERR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'T':
+ if (memEQ(name, "LDNS_STATUS_INVALID_STR", 23)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_INVALID_STR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_24 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_RDF_SIZE_DOUBLEWORD LDNS_RDF_TYPE_INT16_DATA LDNS_RDF_TYPE_NSEC3_SALT
+ LDNS_RR_TYPE_NSEC3PARAMS LDNS_STATUS_CRYPTO_BOGUS LDNS_STATUS_CRYPTO_NO_DS
+ LDNS_STATUS_DDD_OVERFLOW LDNS_STATUS_INTERNAL_ERR LDNS_STATUS_INVALID_TIME
+ LDNS_STATUS_SOCKET_ERROR LDNS_STATUS_SYNTAX_EMPTY LDNS_STATUS_UNKNOWN_INET
+ */
+ /* Offset 17 gives the best switch position. */
+ switch (name[17]) {
+ case '1':
+ if (memEQ(name, "LDNS_RDF_TYPE_INT16_DATA", 24)) {
+ /* ^ */
+ *iv_return = LDNS_RDF_TYPE_INT16_DATA;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case '3':
+ if (memEQ(name, "LDNS_RR_TYPE_NSEC3PARAMS", 24)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_NSEC3PARAMS;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'B':
+ if (memEQ(name, "LDNS_RDF_SIZE_DOUBLEWORD", 24)) {
+ /* ^ */
+#ifdef LDNS_RDF_SIZE_DOUBLEWORD
+ *iv_return = LDNS_RDF_SIZE_DOUBLEWORD;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'C':
+ if (memEQ(name, "LDNS_RDF_TYPE_NSEC3_SALT", 24)) {
+ /* ^ */
+ *iv_return = LDNS_RDF_TYPE_NSEC3_SALT;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'I':
+ if (memEQ(name, "LDNS_STATUS_INVALID_TIME", 24)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_INVALID_TIME;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'N':
+ if (memEQ(name, "LDNS_STATUS_INTERNAL_ERR", 24)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_INTERNAL_ERR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'O':
+ if (memEQ(name, "LDNS_STATUS_CRYPTO_BOGUS", 24)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_CRYPTO_BOGUS;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_STATUS_CRYPTO_NO_DS", 24)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_CRYPTO_NO_DS;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'T':
+ if (memEQ(name, "LDNS_STATUS_SOCKET_ERROR", 24)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SOCKET_ERROR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'V':
+ if (memEQ(name, "LDNS_STATUS_DDD_OVERFLOW", 24)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_DDD_OVERFLOW;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'W':
+ if (memEQ(name, "LDNS_STATUS_UNKNOWN_INET", 24)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_UNKNOWN_INET;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'X':
+ if (memEQ(name, "LDNS_STATUS_SYNTAX_EMPTY", 24)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SYNTAX_EMPTY;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_26 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_STATUS_LABEL_OVERFLOW LDNS_STATUS_SYNTAX_ALG_ERR
+ LDNS_STATUS_SYNTAX_INCLUDE LDNS_STATUS_SYNTAX_TTL_ERR */
+ /* Offset 20 gives the best switch position. */
+ switch (name[20]) {
+ case 'E':
+ if (memEQ(name, "LDNS_STATUS_LABEL_OVERFLOW", 26)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_LABEL_OVERFLOW;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'L':
+ if (memEQ(name, "LDNS_STATUS_SYNTAX_ALG_ERR", 26)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SYNTAX_ALG_ERR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'N':
+ if (memEQ(name, "LDNS_STATUS_SYNTAX_INCLUDE", 26)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SYNTAX_INCLUDE;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'T':
+ if (memEQ(name, "LDNS_STATUS_SYNTAX_TTL_ERR", 26)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SYNTAX_TTL_ERR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_27 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_NSEC3_VARS_OPTOUT_MASK LDNS_SECTION_ANY_NOQUESTION
+ LDNS_SIGNATURE_LEAVE_NO_ADD LDNS_STATUS_CRYPTO_NO_RRSIG
+ LDNS_STATUS_CRYPTO_TSIG_ERR LDNS_STATUS_INVALID_B32_EXT
+ LDNS_STATUS_INVALID_POINTER LDNS_STATUS_PACKET_OVERFLOW
+ LDNS_STATUS_SYNTAX_TYPE_ERR */
+ /* Offset 20 gives the best switch position. */
+ switch (name[20]) {
+ case 'B':
+ if (memEQ(name, "LDNS_STATUS_INVALID_B32_EXT", 27)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_INVALID_B32_EXT;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'O':
+ if (memEQ(name, "LDNS_STATUS_CRYPTO_NO_RRSIG", 27)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_CRYPTO_NO_RRSIG;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'P':
+ if (memEQ(name, "LDNS_STATUS_INVALID_POINTER", 27)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_INVALID_POINTER;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'S':
+ if (memEQ(name, "LDNS_STATUS_CRYPTO_TSIG_ERR", 27)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_CRYPTO_TSIG_ERR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'U':
+ if (memEQ(name, "LDNS_NSEC3_VARS_OPTOUT_MASK", 27)) {
+ /* ^ */
+#ifdef LDNS_NSEC3_VARS_OPTOUT_MASK
+ *iv_return = LDNS_NSEC3_VARS_OPTOUT_MASK;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "LDNS_SECTION_ANY_NOQUESTION", 27)) {
+ /* ^ */
+ *iv_return = LDNS_SECTION_ANY_NOQUESTION;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'V':
+ if (memEQ(name, "LDNS_STATUS_PACKET_OVERFLOW", 27)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_PACKET_OVERFLOW;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'Y':
+ if (memEQ(name, "LDNS_STATUS_SYNTAX_TYPE_ERR", 27)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SYNTAX_TYPE_ERR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case '_':
+ if (memEQ(name, "LDNS_SIGNATURE_LEAVE_NO_ADD", 27)) {
+ /* ^ */
+#ifdef LDNS_SIGNATURE_LEAVE_NO_ADD
+ *iv_return = LDNS_SIGNATURE_LEAVE_NO_ADD;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_28 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_SIGNATURE_LEAVE_ADD_NEW LDNS_SIGNATURE_REMOVE_NO_ADD
+ LDNS_STATUS_CRYPTO_NO_DNSKEY LDNS_STATUS_CRYPTO_VALIDATED
+ LDNS_STATUS_SYNTAX_CLASS_ERR LDNS_STATUS_SYNTAX_DNAME_ERR
+ LDNS_STATUS_SYNTAX_RDATA_ERR */
+ /* Offset 20 gives the best switch position. */
+ switch (name[20]) {
+ case 'A':
+ if (memEQ(name, "LDNS_STATUS_CRYPTO_VALIDATED", 28)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_CRYPTO_VALIDATED;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'D':
+ if (memEQ(name, "LDNS_STATUS_SYNTAX_RDATA_ERR", 28)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SYNTAX_RDATA_ERR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'E':
+ if (memEQ(name, "LDNS_SIGNATURE_REMOVE_NO_ADD", 28)) {
+ /* ^ */
+#ifdef LDNS_SIGNATURE_REMOVE_NO_ADD
+ *iv_return = LDNS_SIGNATURE_REMOVE_NO_ADD;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'L':
+ if (memEQ(name, "LDNS_STATUS_SYNTAX_CLASS_ERR", 28)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SYNTAX_CLASS_ERR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'N':
+ if (memEQ(name, "LDNS_STATUS_SYNTAX_DNAME_ERR", 28)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SYNTAX_DNAME_ERR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'O':
+ if (memEQ(name, "LDNS_STATUS_CRYPTO_NO_DNSKEY", 28)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_CRYPTO_NO_DNSKEY;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case '_':
+ if (memEQ(name, "LDNS_SIGNATURE_LEAVE_ADD_NEW", 28)) {
+ /* ^ */
+#ifdef LDNS_SIGNATURE_LEAVE_ADD_NEW
+ *iv_return = LDNS_SIGNATURE_LEAVE_ADD_NEW;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_29 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_SIGNATURE_REMOVE_ADD_NEW LDNS_STATUS_CRYPTO_TSIG_BOGUS
+ LDNS_STATUS_SYNTAX_BAD_ESCAPE */
+ /* Offset 15 gives the best switch position. */
+ switch (name[15]) {
+ case 'P':
+ if (memEQ(name, "LDNS_STATUS_CRYPTO_TSIG_BOGUS", 29)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_CRYPTO_TSIG_BOGUS;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'R':
+ if (memEQ(name, "LDNS_SIGNATURE_REMOVE_ADD_NEW", 29)) {
+ /* ^ */
+#ifdef LDNS_SIGNATURE_REMOVE_ADD_NEW
+ *iv_return = LDNS_SIGNATURE_REMOVE_ADD_NEW;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'T':
+ if (memEQ(name, "LDNS_STATUS_SYNTAX_BAD_ESCAPE", 29)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SYNTAX_BAD_ESCAPE;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_30 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_RDF_TYPE_NSEC3_NEXT_OWNER LDNS_STATUS_CERT_BAD_ALGORITHM
+ LDNS_STATUS_CRYPTO_SIG_EXPIRED LDNS_STATUS_SYNTAX_KEYWORD_ERR
+ LDNS_STATUS_SYNTAX_VERSION_ERR */
+ /* Offset 25 gives the best switch position. */
+ switch (name[25]) {
+ case 'D':
+ if (memEQ(name, "LDNS_STATUS_SYNTAX_KEYWORD_ERR", 30)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SYNTAX_KEYWORD_ERR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'N':
+ if (memEQ(name, "LDNS_STATUS_SYNTAX_VERSION_ERR", 30)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SYNTAX_VERSION_ERR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'O':
+ if (memEQ(name, "LDNS_RDF_TYPE_NSEC3_NEXT_OWNER", 30)) {
+ /* ^ */
+ *iv_return = LDNS_RDF_TYPE_NSEC3_NEXT_OWNER;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'P':
+ if (memEQ(name, "LDNS_STATUS_CRYPTO_SIG_EXPIRED", 30)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_CRYPTO_SIG_EXPIRED;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'R':
+ if (memEQ(name, "LDNS_STATUS_CERT_BAD_ALGORITHM", 30)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_CERT_BAD_ALGORITHM;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_32 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_STATUS_CRYPTO_ALGO_NOT_IMPL LDNS_STATUS_CRYPTO_NO_TRUSTED_DS
+ LDNS_STATUS_DOMAINNAME_UNDERFLOW */
+ /* Offset 20 gives the best switch position. */
+ switch (name[20]) {
+ case 'L':
+ if (memEQ(name, "LDNS_STATUS_CRYPTO_ALGO_NOT_IMPL", 32)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_CRYPTO_ALGO_NOT_IMPL;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'M':
+ if (memEQ(name, "LDNS_STATUS_DOMAINNAME_UNDERFLOW", 32)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_DOMAINNAME_UNDERFLOW;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'O':
+ if (memEQ(name, "LDNS_STATUS_CRYPTO_NO_TRUSTED_DS", 32)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_CRYPTO_NO_TRUSTED_DS;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_35 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_RDATA_FIELD_DESCRIPTORS_COMMON LDNS_STATUS_CRYPTO_SIG_NOT_INCEPTED
+ LDNS_STATUS_CRYPTO_TYPE_COVERED_ERR LDNS_STATUS_DNSSEC_EXISTENCE_DENIED
+ LDNS_STATUS_SYNTAX_INTEGER_OVERFLOW */
+ /* Offset 21 gives the best switch position. */
+ switch (name[21]) {
+ case 'G':
+ if (memEQ(name, "LDNS_STATUS_CRYPTO_SIG_NOT_INCEPTED", 35)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_CRYPTO_SIG_NOT_INCEPTED;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'I':
+ if (memEQ(name, "LDNS_STATUS_DNSSEC_EXISTENCE_DENIED", 35)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_DNSSEC_EXISTENCE_DENIED;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'P':
+ if (memEQ(name, "LDNS_STATUS_CRYPTO_TYPE_COVERED_ERR", 35)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_CRYPTO_TYPE_COVERED_ERR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'R':
+ if (memEQ(name, "LDNS_RDATA_FIELD_DESCRIPTORS_COMMON", 35)) {
+ /* ^ */
+#ifdef LDNS_RDATA_FIELD_DESCRIPTORS_COMMON
+ *iv_return = LDNS_RDATA_FIELD_DESCRIPTORS_COMMON;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'T':
+ if (memEQ(name, "LDNS_STATUS_SYNTAX_INTEGER_OVERFLOW", 35)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SYNTAX_INTEGER_OVERFLOW;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_36 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_STATUS_CRYPTO_NO_TRUSTED_DNSKEY LDNS_STATUS_MISSING_RDATA_FIELDS_KEY
+ LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR LDNS_STATUS_WIRE_INCOMPLETE_QUESTION
+ */
+ /* Offset 14 gives the best switch position. */
+ switch (name[14]) {
+ case 'N':
+ if (memEQ(name, "LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR", 36)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'R':
+ if (memEQ(name, "LDNS_STATUS_WIRE_INCOMPLETE_QUESTION", 36)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_WIRE_INCOMPLETE_QUESTION;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'S':
+ if (memEQ(name, "LDNS_STATUS_MISSING_RDATA_FIELDS_KEY", 36)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_MISSING_RDATA_FIELDS_KEY;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'Y':
+ if (memEQ(name, "LDNS_STATUS_CRYPTO_NO_TRUSTED_DNSKEY", 36)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_CRYPTO_NO_TRUSTED_DNSKEY;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_38 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_STATUS_DNSSEC_NSEC_RR_NOT_COVERED
+ LDNS_STATUS_MISSING_RDATA_FIELDS_RRSIG
+ LDNS_STATUS_SYNTAX_INCLUDE_ERR_NOTIMPL
+ LDNS_STATUS_SYNTAX_ITERATIONS_OVERFLOW
+ LDNS_STATUS_WIRE_INCOMPLETE_ADDITIONAL */
+ /* Offset 20 gives the best switch position. */
+ switch (name[20]) {
+ case 'N':
+ if (memEQ(name, "LDNS_STATUS_SYNTAX_INCLUDE_ERR_NOTIMPL", 38)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SYNTAX_INCLUDE_ERR_NOTIMPL;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'O':
+ if (memEQ(name, "LDNS_STATUS_WIRE_INCOMPLETE_ADDITIONAL", 38)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_WIRE_INCOMPLETE_ADDITIONAL;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'R':
+ if (memEQ(name, "LDNS_STATUS_MISSING_RDATA_FIELDS_RRSIG", 38)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_MISSING_RDATA_FIELDS_RRSIG;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'S':
+ if (memEQ(name, "LDNS_STATUS_DNSSEC_NSEC_RR_NOT_COVERED", 38)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_DNSSEC_NSEC_RR_NOT_COVERED;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'T':
+ if (memEQ(name, "LDNS_STATUS_SYNTAX_ITERATIONS_OVERFLOW", 38)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SYNTAX_ITERATIONS_OVERFLOW;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant (pTHX_ const char *name, STRLEN len, IV *iv_return) {
+ /* Initially switch on the length of the name. */
+ /* When generated this function returned values for the list of names given
+ in this section of perl code. Rather than manually editing these functions
+ to add or remove constants, which would result in this comment and section
+ of code becoming inaccurate, we recommend that you edit this section of
+ code, and use it to regenerate a new set of constant functions which you
+ then use to replace the originals.
+
+ Regenerate these constant functions by feeding this entire source file to
+ perl -x
+
+#!/usr/bin/perl -w
+use ExtUtils::Constant qw (constant_types C_constant XS_constant);
+
+my $types = {map {($_, 1)} qw(IV)};
+my @names = (qw(LDNS_AA LDNS_AD LDNS_CD LDNS_DEFAULT_EXP_TIME LDNS_DEFAULT_TTL
+ LDNS_DNSSEC_KEYPROTO LDNS_IP4ADDRLEN LDNS_IP6ADDRLEN
+ LDNS_KEY_REVOKE_KEY LDNS_KEY_SEP_KEY LDNS_KEY_ZONE_KEY
+ LDNS_MAX_DOMAINLEN LDNS_MAX_KEYLEN LDNS_MAX_LABELLEN
+ LDNS_MAX_PACKETLEN LDNS_MAX_POINTERS LDNS_MAX_RDFLEN
+ LDNS_NSEC3_MAX_ITERATIONS LDNS_NSEC3_VARS_OPTOUT_MASK LDNS_PORT
+ LDNS_QR LDNS_RA LDNS_RD LDNS_RDATA_FIELD_DESCRIPTORS_COMMON
+ LDNS_RDF_SIZE_16BYTES LDNS_RDF_SIZE_6BYTES LDNS_RDF_SIZE_BYTE
+ LDNS_RDF_SIZE_DOUBLEWORD LDNS_RDF_SIZE_WORD LDNS_RESOLV_ANCHOR
+ LDNS_RESOLV_DEFDOMAIN LDNS_RESOLV_INET LDNS_RESOLV_INET6
+ LDNS_RESOLV_INETANY LDNS_RESOLV_KEYWORD LDNS_RESOLV_KEYWORDS
+ LDNS_RESOLV_NAMESERVER LDNS_RESOLV_OPTIONS LDNS_RESOLV_RTT_INF
+ LDNS_RESOLV_RTT_MIN LDNS_RESOLV_SEARCH LDNS_RESOLV_SORTLIST
+ LDNS_RR_OVERHEAD LDNS_SIGNATURE_LEAVE_ADD_NEW
+ LDNS_SIGNATURE_LEAVE_NO_ADD LDNS_SIGNATURE_REMOVE_ADD_NEW
+ LDNS_SIGNATURE_REMOVE_NO_ADD LDNS_TC),
+ {name=>"LDNS_CERT_ACPKIX", type=>"IV", macro=>"1"},
+ {name=>"LDNS_CERT_IACPKIX", type=>"IV", macro=>"1"},
+ {name=>"LDNS_CERT_IPGP", type=>"IV", macro=>"1"},
+ {name=>"LDNS_CERT_IPKIX", type=>"IV", macro=>"1"},
+ {name=>"LDNS_CERT_ISPKI", type=>"IV", macro=>"1"},
+ {name=>"LDNS_CERT_OID", type=>"IV", macro=>"1"},
+ {name=>"LDNS_CERT_PGP", type=>"IV", macro=>"1"},
+ {name=>"LDNS_CERT_PKIX", type=>"IV", macro=>"1"},
+ {name=>"LDNS_CERT_SPKI", type=>"IV", macro=>"1"},
+ {name=>"LDNS_CERT_URI", type=>"IV", macro=>"1"},
+ {name=>"LDNS_DH", type=>"IV", macro=>"1"},
+ {name=>"LDNS_DSA", type=>"IV", macro=>"1"},
+ {name=>"LDNS_DSA_NSEC3", type=>"IV", macro=>"1"},
+ {name=>"LDNS_ECC", type=>"IV", macro=>"1"},
+ {name=>"LDNS_ECC_GOST", type=>"IV", macro=>"1"},
+ {name=>"LDNS_HASH_GOST", type=>"IV", macro=>"1"},
+ {name=>"LDNS_PACKET_ANSWER", type=>"IV", macro=>"1"},
+ {name=>"LDNS_PACKET_IQUERY", type=>"IV", macro=>"1"},
+ {name=>"LDNS_PACKET_NODATA", type=>"IV", macro=>"1"},
+ {name=>"LDNS_PACKET_NOTIFY", type=>"IV", macro=>"1"},
+ {name=>"LDNS_PACKET_NXDOMAIN", type=>"IV", macro=>"1"},
+ {name=>"LDNS_PACKET_QUERY", type=>"IV", macro=>"1"},
+ {name=>"LDNS_PACKET_QUESTION", type=>"IV", macro=>"1"},
+ {name=>"LDNS_PACKET_REFERRAL", type=>"IV", macro=>"1"},
+ {name=>"LDNS_PACKET_STATUS", type=>"IV", macro=>"1"},
+ {name=>"LDNS_PACKET_UNKNOWN", type=>"IV", macro=>"1"},
+ {name=>"LDNS_PACKET_UPDATE", type=>"IV", macro=>"1"},
+ {name=>"LDNS_PRIVATEDNS", type=>"IV", macro=>"1"},
+ {name=>"LDNS_PRIVATEOID", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RCODE_FORMERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RCODE_NOERROR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RCODE_NOTAUTH", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RCODE_NOTIMPL", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RCODE_NOTZONE", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RCODE_NXDOMAIN", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RCODE_NXRRSET", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RCODE_REFUSED", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RCODE_SERVFAIL", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RCODE_YXDOMAIN", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RCODE_YXRRSET", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_A", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_AAAA", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_ALG", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_APL", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_ATMA", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_B32_EXT", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_B64", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_CERT_ALG", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_CLASS", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_DNAME", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_HEX", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_HIP", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_INT16", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_INT16_DATA", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_INT32", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_INT8", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_IPSECKEY", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_LOC", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_NONE", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_NSAP", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_NSEC", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_NSEC3_NEXT_OWNER", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_NSEC3_SALT", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_PERIOD", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_SERVICE", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_STR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_TIME", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_TSIGTIME", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_TYPE", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_UNKNOWN", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_WKS", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_CLASS_ANY", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_CLASS_CH", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_CLASS_COUNT", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_CLASS_FIRST", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_CLASS_HS", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_CLASS_IN", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_CLASS_LAST", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_CLASS_NONE", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_COMPRESS", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_NO_COMPRESS", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_A", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_A6", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_AAAA", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_AFSDB", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_ANY", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_APL", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_ATMA", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_AXFR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_CERT", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_CNAME", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_COUNT", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_DHCID", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_DLV", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_DNAME", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_DNSKEY", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_DS", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_EID", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_FIRST", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_GID", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_GPOS", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_HINFO", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_IPSECKEY", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_ISDN", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_IXFR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_KEY", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_KX", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_LAST", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_LOC", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_MAILA", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_MAILB", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_MB", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_MD", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_MF", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_MG", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_MINFO", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_MR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_MX", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_NAPTR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_NIMLOC", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_NS", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_NSAP", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_NSAP_PTR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_NSEC", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_NSEC3", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_NSEC3PARAM", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_NSEC3PARAMS", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_NULL", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_NXT", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_OPT", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_PTR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_PX", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_RP", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_RRSIG", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_RT", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_SIG", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_SINK", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_SOA", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_SPF", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_SRV", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_SSHFP", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_TALINK", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_TSIG", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_TXT", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_UID", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_UINFO", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_UNSPEC", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_WKS", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_X25", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RSAMD5", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RSASHA1", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RSASHA1_NSEC3", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RSASHA256", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RSASHA512", type=>"IV", macro=>"1"},
+ {name=>"LDNS_SECTION_ADDITIONAL", type=>"IV", macro=>"1"},
+ {name=>"LDNS_SECTION_ANSWER", type=>"IV", macro=>"1"},
+ {name=>"LDNS_SECTION_ANY", type=>"IV", macro=>"1"},
+ {name=>"LDNS_SECTION_ANY_NOQUESTION", type=>"IV", macro=>"1"},
+ {name=>"LDNS_SECTION_AUTHORITY", type=>"IV", macro=>"1"},
+ {name=>"LDNS_SECTION_QUESTION", type=>"IV", macro=>"1"},
+ {name=>"LDNS_SHA1", type=>"IV", macro=>"1"},
+ {name=>"LDNS_SHA256", type=>"IV", macro=>"1"},
+ {name=>"LDNS_SIGN_DSA", type=>"IV", macro=>"1"},
+ {name=>"LDNS_SIGN_DSA_NSEC3", type=>"IV", macro=>"1"},
+ {name=>"LDNS_SIGN_ECC_GOST", type=>"IV", macro=>"1"},
+ {name=>"LDNS_SIGN_HMACSHA1", type=>"IV", macro=>"1"},
+ {name=>"LDNS_SIGN_HMACSHA256", type=>"IV", macro=>"1"},
+ {name=>"LDNS_SIGN_RSAMD5", type=>"IV", macro=>"1"},
+ {name=>"LDNS_SIGN_RSASHA1", type=>"IV", macro=>"1"},
+ {name=>"LDNS_SIGN_RSASHA1_NSEC3", type=>"IV", macro=>"1"},
+ {name=>"LDNS_SIGN_RSASHA256", type=>"IV", macro=>"1"},
+ {name=>"LDNS_SIGN_RSASHA512", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_ADDRESS_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_CERT_BAD_ALGORITHM", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_ALGO_NOT_IMPL", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_BOGUS", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_EXPIRATION_BEFORE_INCEPTION", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_NO_DNSKEY", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_NO_DS", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_NO_MATCHING_KEYTAG_DNSKEY", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_NO_RRSIG", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_NO_TRUSTED_DNSKEY", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_NO_TRUSTED_DS", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_SIG_EXPIRED", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_SIG_NOT_INCEPTED", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_TSIG_BOGUS", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_TSIG_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_TYPE_COVERED_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_UNKNOWN_ALGO", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_VALIDATED", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_DDD_OVERFLOW", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_DNSSEC_EXISTENCE_DENIED", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_DNSSEC_NSEC3_ORIGINAL_NOT_FOUND", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_DNSSEC_NSEC_RR_NOT_COVERED", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_DNSSEC_NSEC_WILDCARD_NOT_COVERED", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_DOMAINNAME_OVERFLOW", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_DOMAINNAME_UNDERFLOW", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_EMPTY_LABEL", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_ENGINE_KEY_NOT_LOADED", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_FILE_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_INTERNAL_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_INVALID_B32_EXT", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_INVALID_B64", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_INVALID_HEX", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_INVALID_INT", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_INVALID_IP4", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_INVALID_IP6", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_INVALID_POINTER", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_INVALID_STR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_INVALID_TIME", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_LABEL_OVERFLOW", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_MEM_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_MISSING_RDATA_FIELDS_KEY", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_MISSING_RDATA_FIELDS_RRSIG", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_NETWORK_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_NOT_IMPL", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_NO_DATA", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_NSEC3_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_NULL", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_OK", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_PACKET_OVERFLOW", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_RES_NO_NS", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_RES_QUERY", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SOCKET_ERROR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SSL_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_ALG_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_BAD_ESCAPE", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_CLASS_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_DNAME_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_EMPTY", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_INCLUDE", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_INCLUDE_ERR_NOTIMPL", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_INTEGER_OVERFLOW", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_ITERATIONS_OVERFLOW", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_KEYWORD_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_ORIGIN", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_RDATA_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_TTL", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_TTL_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_TYPE_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_VERSION_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_UNKNOWN_INET", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_WIRE_INCOMPLETE_ADDITIONAL", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_WIRE_INCOMPLETE_ANSWER", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_WIRE_INCOMPLETE_AUTHORITY", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_WIRE_INCOMPLETE_HEADER", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_WIRE_INCOMPLETE_QUESTION", type=>"IV", macro=>"1"});
+
+print constant_types(), "\n"; # macro defs
+foreach (C_constant ("LDNS", 'constant', 'IV', $types, undef, 3, @names) ) {
+ print $_, "\n"; # C constant subs
+}
+print "\n#### XS Section:\n";
+print XS_constant ("LDNS", $types);
+__END__
+ */
+
+ switch (len) {
+ case 7:
+ return constant_7 (aTHX_ name, iv_return);
+ break;
+ case 8:
+ /* Names all of length 8. */
+ /* LDNS_DSA LDNS_ECC */
+ /* Offset 5 gives the best switch position. */
+ switch (name[5]) {
+ case 'D':
+ if (memEQ(name, "LDNS_DSA", 8)) {
+ /* ^ */
+ *iv_return = LDNS_DSA;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'E':
+ if (memEQ(name, "LDNS_ECC", 8)) {
+ /* ^ */
+ *iv_return = LDNS_ECC;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ break;
+ case 9:
+ /* Names all of length 9. */
+ /* LDNS_PORT LDNS_SHA1 */
+ /* Offset 5 gives the best switch position. */
+ switch (name[5]) {
+ case 'P':
+ if (memEQ(name, "LDNS_PORT", 9)) {
+ /* ^ */
+#ifdef LDNS_PORT
+ *iv_return = LDNS_PORT;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'S':
+ if (memEQ(name, "LDNS_SHA1", 9)) {
+ /* ^ */
+ *iv_return = LDNS_SHA1;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ break;
+ case 11:
+ /* Names all of length 11. */
+ /* LDNS_RSAMD5 LDNS_SHA256 */
+ /* Offset 10 gives the best switch position. */
+ switch (name[10]) {
+ case '5':
+ if (memEQ(name, "LDNS_RSAMD", 10)) {
+ /* 5 */
+ *iv_return = LDNS_RSAMD5;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case '6':
+ if (memEQ(name, "LDNS_SHA25", 10)) {
+ /* 6 */
+ *iv_return = LDNS_SHA256;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ break;
+ case 12:
+ if (memEQ(name, "LDNS_RSASHA1", 12)) {
+ *iv_return = LDNS_RSASHA1;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 13:
+ return constant_13 (aTHX_ name, iv_return);
+ break;
+ case 14:
+ return constant_14 (aTHX_ name, iv_return);
+ break;
+ case 15:
+ return constant_15 (aTHX_ name, iv_return);
+ break;
+ case 16:
+ return constant_16 (aTHX_ name, iv_return);
+ break;
+ case 17:
+ return constant_17 (aTHX_ name, iv_return);
+ break;
+ case 18:
+ return constant_18 (aTHX_ name, iv_return);
+ break;
+ case 19:
+ return constant_19 (aTHX_ name, iv_return);
+ break;
+ case 20:
+ return constant_20 (aTHX_ name, iv_return);
+ break;
+ case 21:
+ return constant_21 (aTHX_ name, iv_return);
+ break;
+ case 22:
+ return constant_22 (aTHX_ name, iv_return);
+ break;
+ case 23:
+ return constant_23 (aTHX_ name, iv_return);
+ break;
+ case 24:
+ return constant_24 (aTHX_ name, iv_return);
+ break;
+ case 25:
+ /* Names all of length 25. */
+ /* LDNS_NSEC3_MAX_ITERATIONS LDNS_STATUS_SYNTAX_ORIGIN */
+ /* Offset 6 gives the best switch position. */
+ switch (name[6]) {
+ case 'S':
+ if (memEQ(name, "LDNS_NSEC3_MAX_ITERATIONS", 25)) {
+ /* ^ */
+#ifdef LDNS_NSEC3_MAX_ITERATIONS
+ *iv_return = LDNS_NSEC3_MAX_ITERATIONS;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'T':
+ if (memEQ(name, "LDNS_STATUS_SYNTAX_ORIGIN", 25)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SYNTAX_ORIGIN;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ break;
+ case 26:
+ return constant_26 (aTHX_ name, iv_return);
+ break;
+ case 27:
+ return constant_27 (aTHX_ name, iv_return);
+ break;
+ case 28:
+ return constant_28 (aTHX_ name, iv_return);
+ break;
+ case 29:
+ return constant_29 (aTHX_ name, iv_return);
+ break;
+ case 30:
+ return constant_30 (aTHX_ name, iv_return);
+ break;
+ case 31:
+ /* Names all of length 31. */
+ /* LDNS_STATUS_CRYPTO_UNKNOWN_ALGO LDNS_STATUS_DOMAINNAME_OVERFLOW */
+ /* Offset 12 gives the best switch position. */
+ switch (name[12]) {
+ case 'C':
+ if (memEQ(name, "LDNS_STATUS_CRYPTO_UNKNOWN_ALGO", 31)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_CRYPTO_UNKNOWN_ALGO;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'D':
+ if (memEQ(name, "LDNS_STATUS_DOMAINNAME_OVERFLOW", 31)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_DOMAINNAME_OVERFLOW;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ break;
+ case 32:
+ return constant_32 (aTHX_ name, iv_return);
+ break;
+ case 33:
+ if (memEQ(name, "LDNS_STATUS_ENGINE_KEY_NOT_LOADED", 33)) {
+ *iv_return = LDNS_STATUS_ENGINE_KEY_NOT_LOADED;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 34:
+ /* Names all of length 34. */
+ /* LDNS_STATUS_WIRE_INCOMPLETE_ANSWER LDNS_STATUS_WIRE_INCOMPLETE_HEADER */
+ /* Offset 28 gives the best switch position. */
+ switch (name[28]) {
+ case 'A':
+ if (memEQ(name, "LDNS_STATUS_WIRE_INCOMPLETE_ANSWER", 34)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_WIRE_INCOMPLETE_ANSWER;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'H':
+ if (memEQ(name, "LDNS_STATUS_WIRE_INCOMPLETE_HEADER", 34)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_WIRE_INCOMPLETE_HEADER;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ break;
+ case 35:
+ return constant_35 (aTHX_ name, iv_return);
+ break;
+ case 36:
+ return constant_36 (aTHX_ name, iv_return);
+ break;
+ case 37:
+ if (memEQ(name, "LDNS_STATUS_WIRE_INCOMPLETE_AUTHORITY", 37)) {
+ *iv_return = LDNS_STATUS_WIRE_INCOMPLETE_AUTHORITY;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 38:
+ return constant_38 (aTHX_ name, iv_return);
+ break;
+ case 43:
+ if (memEQ(name, "LDNS_STATUS_DNSSEC_NSEC3_ORIGINAL_NOT_FOUND", 43)) {
+ *iv_return = LDNS_STATUS_DNSSEC_NSEC3_ORIGINAL_NOT_FOUND;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 44:
+ /* Names all of length 44. */
+ /* LDNS_STATUS_CRYPTO_NO_MATCHING_KEYTAG_DNSKEY
+ LDNS_STATUS_DNSSEC_NSEC_WILDCARD_NOT_COVERED */
+ /* Offset 12 gives the best switch position. */
+ switch (name[12]) {
+ case 'C':
+ if (memEQ(name, "LDNS_STATUS_CRYPTO_NO_MATCHING_KEYTAG_DNSKEY", 44)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_CRYPTO_NO_MATCHING_KEYTAG_DNSKEY;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'D':
+ if (memEQ(name, "LDNS_STATUS_DNSSEC_NSEC_WILDCARD_NOT_COVERED", 44)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_DNSSEC_NSEC_WILDCARD_NOT_COVERED;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ break;
+ case 46:
+ if (memEQ(name, "LDNS_STATUS_CRYPTO_EXPIRATION_BEFORE_INCEPTION", 46)) {
+ *iv_return = LDNS_STATUS_CRYPTO_EXPIRATION_BEFORE_INCEPTION;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
diff --git a/contrib/DNS-LDNS/const-xs.inc b/contrib/DNS-LDNS/const-xs.inc
new file mode 100644
index 000000000000..1738df2243a7
--- /dev/null
+++ b/contrib/DNS-LDNS/const-xs.inc
@@ -0,0 +1,90 @@
+void
+constant(sv)
+ PREINIT:
+#ifdef dXSTARG
+ dXSTARG; /* Faster if we have it. */
+#else
+ dTARGET;
+#endif
+ STRLEN len;
+ int type;
+ IV iv;
+ /* NV nv; Uncomment this if you need to return NVs */
+ /* const char *pv; Uncomment this if you need to return PVs */
+ INPUT:
+ SV * sv;
+ const char * s = SvPV(sv, len);
+ PPCODE:
+ /* Change this to constant(aTHX_ s, len, &iv, &nv);
+ if you need to return both NVs and IVs */
+ type = constant(aTHX_ s, len, &iv);
+ /* Return 1 or 2 items. First is error message, or undef if no error.
+ Second, if present, is found value */
+ switch (type) {
+ case PERL_constant_NOTFOUND:
+ sv =
+ sv_2mortal(newSVpvf("%s is not a valid LDNS macro", s));
+ PUSHs(sv);
+ break;
+ case PERL_constant_NOTDEF:
+ sv = sv_2mortal(newSVpvf(
+ "Your vendor has not defined LDNS macro %s, used",
+ s));
+ PUSHs(sv);
+ break;
+ case PERL_constant_ISIV:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHi(iv);
+ break;
+ /* Uncomment this if you need to return NOs
+ case PERL_constant_ISNO:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHs(&PL_sv_no);
+ break; */
+ /* Uncomment this if you need to return NVs
+ case PERL_constant_ISNV:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHn(nv);
+ break; */
+ /* Uncomment this if you need to return PVs
+ case PERL_constant_ISPV:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHp(pv, strlen(pv));
+ break; */
+ /* Uncomment this if you need to return PVNs
+ case PERL_constant_ISPVN:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHp(pv, iv);
+ break; */
+ /* Uncomment this if you need to return SVs
+ case PERL_constant_ISSV:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHs(sv);
+ break; */
+ /* Uncomment this if you need to return UNDEFs
+ case PERL_constant_ISUNDEF:
+ break; */
+ /* Uncomment this if you need to return UVs
+ case PERL_constant_ISUV:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHu((UV)iv);
+ break; */
+ /* Uncomment this if you need to return YESs
+ case PERL_constant_ISYES:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHs(&PL_sv_yes);
+ break; */
+ default:
+ sv = sv_2mortal(newSVpvf(
+ "Unexpected return type %d while processing LDNS macro %s, used",
+ type, s));
+ PUSHs(sv);
+ }
diff --git a/contrib/DNS-LDNS/fallback/const-c.inc b/contrib/DNS-LDNS/fallback/const-c.inc
new file mode 100644
index 000000000000..6456baa182b2
--- /dev/null
+++ b/contrib/DNS-LDNS/fallback/const-c.inc
@@ -0,0 +1,2798 @@
+#define PERL_constant_NOTFOUND 1
+#define PERL_constant_NOTDEF 2
+#define PERL_constant_ISIV 3
+#define PERL_constant_ISNO 4
+#define PERL_constant_ISNV 5
+#define PERL_constant_ISPV 6
+#define PERL_constant_ISPVN 7
+#define PERL_constant_ISSV 8
+#define PERL_constant_ISUNDEF 9
+#define PERL_constant_ISUV 10
+#define PERL_constant_ISYES 11
+
+#ifndef NVTYPE
+typedef double NV; /* 5.6 and later define NVTYPE, and typedef NV to it. */
+#endif
+#ifndef aTHX_
+#define aTHX_ /* 5.6 or later define this for threading support. */
+#endif
+#ifndef pTHX_
+#define pTHX_ /* 5.6 or later define this for threading support. */
+#endif
+
+static int
+constant_7 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_AA LDNS_AD LDNS_CD LDNS_DH LDNS_QR LDNS_RA LDNS_RD LDNS_TC */
+ /* Offset 5 gives the best switch position. */
+ switch (name[5]) {
+ case 'A':
+ if (memEQ(name, "LDNS_AA", 7)) {
+ /* ^ */
+#ifdef LDNS_AA
+ *iv_return = LDNS_AA;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "LDNS_AD", 7)) {
+ /* ^ */
+#ifdef LDNS_AD
+ *iv_return = LDNS_AD;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'C':
+ if (memEQ(name, "LDNS_CD", 7)) {
+ /* ^ */
+#ifdef LDNS_CD
+ *iv_return = LDNS_CD;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'D':
+ if (memEQ(name, "LDNS_DH", 7)) {
+ /* ^ */
+ *iv_return = LDNS_DH;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'Q':
+ if (memEQ(name, "LDNS_QR", 7)) {
+ /* ^ */
+#ifdef LDNS_QR
+ *iv_return = LDNS_QR;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'R':
+ if (memEQ(name, "LDNS_RA", 7)) {
+ /* ^ */
+#ifdef LDNS_RA
+ *iv_return = LDNS_RA;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "LDNS_RD", 7)) {
+ /* ^ */
+#ifdef LDNS_RD
+ *iv_return = LDNS_RD;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'T':
+ if (memEQ(name, "LDNS_TC", 7)) {
+ /* ^ */
+#ifdef LDNS_TC
+ *iv_return = LDNS_TC;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_11 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_RSAMD5 LDNS_SHA256 LDNS_SHA384 */
+ /* Offset 10 gives the best switch position. */
+ switch (name[10]) {
+ case '4':
+ if (memEQ(name, "LDNS_SHA38", 10)) {
+ /* 4 */
+ *iv_return = LDNS_SHA384;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case '5':
+ if (memEQ(name, "LDNS_RSAMD", 10)) {
+ /* 5 */
+ *iv_return = LDNS_RSAMD5;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case '6':
+ if (memEQ(name, "LDNS_SHA25", 10)) {
+ /* 6 */
+ *iv_return = LDNS_SHA256;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_13 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_CERT_OID LDNS_CERT_PGP LDNS_CERT_URI LDNS_ECC_GOST LDNS_SIGN_DSA */
+ /* Offset 12 gives the best switch position. */
+ switch (name[12]) {
+ case 'A':
+ if (memEQ(name, "LDNS_SIGN_DS", 12)) {
+ /* A */
+ *iv_return = LDNS_SIGN_DSA;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'D':
+ if (memEQ(name, "LDNS_CERT_OI", 12)) {
+ /* D */
+ *iv_return = LDNS_CERT_OID;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'I':
+ if (memEQ(name, "LDNS_CERT_UR", 12)) {
+ /* I */
+ *iv_return = LDNS_CERT_URI;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'P':
+ if (memEQ(name, "LDNS_CERT_PG", 12)) {
+ /* P */
+ *iv_return = LDNS_CERT_PGP;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'T':
+ if (memEQ(name, "LDNS_ECC_GOS", 12)) {
+ /* T */
+ *iv_return = LDNS_ECC_GOST;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_14 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_CERT_IPGP LDNS_CERT_PKIX LDNS_CERT_SPKI LDNS_DSA_NSEC3 LDNS_HASH_GOST
+ LDNS_RR_TYPE_A LDNS_RSASHA256 LDNS_RSASHA512 LDNS_STATUS_OK */
+ /* Offset 13 gives the best switch position. */
+ switch (name[13]) {
+ case '2':
+ if (memEQ(name, "LDNS_RSASHA51", 13)) {
+ /* 2 */
+ *iv_return = LDNS_RSASHA512;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case '3':
+ if (memEQ(name, "LDNS_DSA_NSEC", 13)) {
+ /* 3 */
+ *iv_return = LDNS_DSA_NSEC3;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case '6':
+ if (memEQ(name, "LDNS_RSASHA25", 13)) {
+ /* 6 */
+ *iv_return = LDNS_RSASHA256;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'A':
+ if (memEQ(name, "LDNS_RR_TYPE_", 13)) {
+ /* A */
+ *iv_return = LDNS_RR_TYPE_A;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'I':
+ if (memEQ(name, "LDNS_CERT_SPK", 13)) {
+ /* I */
+ *iv_return = LDNS_CERT_SPKI;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'K':
+ if (memEQ(name, "LDNS_STATUS_O", 13)) {
+ /* K */
+ *iv_return = LDNS_STATUS_OK;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'P':
+ if (memEQ(name, "LDNS_CERT_IPG", 13)) {
+ /* P */
+ *iv_return = LDNS_CERT_IPGP;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'T':
+ if (memEQ(name, "LDNS_HASH_GOS", 13)) {
+ /* T */
+ *iv_return = LDNS_HASH_GOST;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'X':
+ if (memEQ(name, "LDNS_CERT_PKI", 13)) {
+ /* X */
+ *iv_return = LDNS_CERT_PKIX;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_15 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_CERT_IPKIX LDNS_CERT_ISPKI LDNS_IP4ADDRLEN LDNS_IP6ADDRLEN
+ LDNS_MAX_RDFLEN LDNS_PRIVATEDNS LDNS_PRIVATEOID LDNS_RDF_TYPE_A
+ LDNS_RR_TYPE_A6 LDNS_RR_TYPE_DS LDNS_RR_TYPE_KX LDNS_RR_TYPE_MB
+ LDNS_RR_TYPE_MD LDNS_RR_TYPE_MF LDNS_RR_TYPE_MG LDNS_RR_TYPE_MR
+ LDNS_RR_TYPE_MX LDNS_RR_TYPE_NS LDNS_RR_TYPE_PX LDNS_RR_TYPE_RP
+ LDNS_RR_TYPE_RT LDNS_STATUS_ERR */
+ /* Offset 14 gives the best switch position. */
+ switch (name[14]) {
+ case '6':
+ if (memEQ(name, "LDNS_RR_TYPE_A", 14)) {
+ /* 6 */
+ *iv_return = LDNS_RR_TYPE_A6;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'A':
+ if (memEQ(name, "LDNS_RDF_TYPE_", 14)) {
+ /* A */
+ *iv_return = LDNS_RDF_TYPE_A;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'B':
+ if (memEQ(name, "LDNS_RR_TYPE_M", 14)) {
+ /* B */
+ *iv_return = LDNS_RR_TYPE_MB;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'D':
+ if (memEQ(name, "LDNS_PRIVATEOI", 14)) {
+ /* D */
+ *iv_return = LDNS_PRIVATEOID;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_M", 14)) {
+ /* D */
+ *iv_return = LDNS_RR_TYPE_MD;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'F':
+ if (memEQ(name, "LDNS_RR_TYPE_M", 14)) {
+ /* F */
+ *iv_return = LDNS_RR_TYPE_MF;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'G':
+ if (memEQ(name, "LDNS_RR_TYPE_M", 14)) {
+ /* G */
+ *iv_return = LDNS_RR_TYPE_MG;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'I':
+ if (memEQ(name, "LDNS_CERT_ISPK", 14)) {
+ /* I */
+ *iv_return = LDNS_CERT_ISPKI;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'N':
+ if (memEQ(name, "LDNS_IP4ADDRLE", 14)) {
+ /* N */
+#ifdef LDNS_IP4ADDRLEN
+ *iv_return = LDNS_IP4ADDRLEN;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "LDNS_IP6ADDRLE", 14)) {
+ /* N */
+#ifdef LDNS_IP6ADDRLEN
+ *iv_return = LDNS_IP6ADDRLEN;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "LDNS_MAX_RDFLE", 14)) {
+ /* N */
+#ifdef LDNS_MAX_RDFLEN
+ *iv_return = LDNS_MAX_RDFLEN;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'P':
+ if (memEQ(name, "LDNS_RR_TYPE_R", 14)) {
+ /* P */
+ *iv_return = LDNS_RR_TYPE_RP;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'R':
+ if (memEQ(name, "LDNS_RR_TYPE_M", 14)) {
+ /* R */
+ *iv_return = LDNS_RR_TYPE_MR;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_STATUS_ER", 14)) {
+ /* R */
+ *iv_return = LDNS_STATUS_ERR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'S':
+ if (memEQ(name, "LDNS_PRIVATEDN", 14)) {
+ /* S */
+ *iv_return = LDNS_PRIVATEDNS;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_D", 14)) {
+ /* S */
+ *iv_return = LDNS_RR_TYPE_DS;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_N", 14)) {
+ /* S */
+ *iv_return = LDNS_RR_TYPE_NS;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'T':
+ if (memEQ(name, "LDNS_RR_TYPE_R", 14)) {
+ /* T */
+ *iv_return = LDNS_RR_TYPE_RT;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'X':
+ if (memEQ(name, "LDNS_CERT_IPKI", 14)) {
+ /* X */
+ *iv_return = LDNS_CERT_IPKIX;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_K", 14)) {
+ /* X */
+ *iv_return = LDNS_RR_TYPE_KX;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_M", 14)) {
+ /* X */
+ *iv_return = LDNS_RR_TYPE_MX;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_P", 14)) {
+ /* X */
+ *iv_return = LDNS_RR_TYPE_PX;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_16 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_CERT_ACPKIX LDNS_DEFAULT_TTL LDNS_KEY_SEP_KEY LDNS_RESOLV_INET
+ LDNS_RR_CLASS_CH LDNS_RR_CLASS_HS LDNS_RR_CLASS_IN LDNS_RR_COMPRESS
+ LDNS_RR_OVERHEAD LDNS_RR_TYPE_ANY LDNS_RR_TYPE_APL LDNS_RR_TYPE_DLV
+ LDNS_RR_TYPE_EID LDNS_RR_TYPE_GID LDNS_RR_TYPE_KEY LDNS_RR_TYPE_LOC
+ LDNS_RR_TYPE_NXT LDNS_RR_TYPE_OPT LDNS_RR_TYPE_PTR LDNS_RR_TYPE_SIG
+ LDNS_RR_TYPE_SOA LDNS_RR_TYPE_SPF LDNS_RR_TYPE_SRV LDNS_RR_TYPE_TXT
+ LDNS_RR_TYPE_UID LDNS_RR_TYPE_WKS LDNS_RR_TYPE_X25 LDNS_SECTION_ANY
+ LDNS_SIGN_RSAMD5 LDNS_STATUS_NULL */
+ /* Offset 13 gives the best switch position. */
+ switch (name[13]) {
+ case 'A':
+ if (memEQ(name, "LDNS_RR_TYPE_ANY", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_ANY;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_APL", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_APL;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_SECTION_ANY", 16)) {
+ /* ^ */
+ *iv_return = LDNS_SECTION_ANY;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'D':
+ if (memEQ(name, "LDNS_RR_TYPE_DLV", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_DLV;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'E':
+ if (memEQ(name, "LDNS_RR_COMPRESS", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_COMPRESS;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_OVERHEAD", 16)) {
+ /* ^ */
+#ifdef LDNS_RR_OVERHEAD
+ *iv_return = LDNS_RR_OVERHEAD;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_EID", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_EID;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'G':
+ if (memEQ(name, "LDNS_RR_TYPE_GID", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_GID;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'K':
+ if (memEQ(name, "LDNS_CERT_ACPKIX", 16)) {
+ /* ^ */
+ *iv_return = LDNS_CERT_ACPKIX;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_KEY_SEP_KEY", 16)) {
+ /* ^ */
+#ifdef LDNS_KEY_SEP_KEY
+ *iv_return = LDNS_KEY_SEP_KEY;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_KEY", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_KEY;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'L':
+ if (memEQ(name, "LDNS_RR_TYPE_LOC", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_LOC;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'M':
+ if (memEQ(name, "LDNS_SIGN_RSAMD5", 16)) {
+ /* ^ */
+ *iv_return = LDNS_SIGN_RSAMD5;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'N':
+ if (memEQ(name, "LDNS_RESOLV_INET", 16)) {
+ /* ^ */
+#ifdef LDNS_RESOLV_INET
+ *iv_return = LDNS_RESOLV_INET;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_NXT", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_NXT;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'O':
+ if (memEQ(name, "LDNS_RR_TYPE_OPT", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_OPT;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'P':
+ if (memEQ(name, "LDNS_RR_TYPE_PTR", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_PTR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'S':
+ if (memEQ(name, "LDNS_RR_TYPE_SIG", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_SIG;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_SOA", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_SOA;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_SPF", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_SPF;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_SRV", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_SRV;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'T':
+ if (memEQ(name, "LDNS_DEFAULT_TTL", 16)) {
+ /* ^ */
+#ifdef LDNS_DEFAULT_TTL
+ *iv_return = LDNS_DEFAULT_TTL;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_TXT", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_TXT;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'U':
+ if (memEQ(name, "LDNS_RR_TYPE_UID", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_UID;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_STATUS_NULL", 16)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_NULL;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'W':
+ if (memEQ(name, "LDNS_RR_TYPE_WKS", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_WKS;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'X':
+ if (memEQ(name, "LDNS_RR_TYPE_X25", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_X25;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case '_':
+ if (memEQ(name, "LDNS_RR_CLASS_CH", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_CLASS_CH;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_CLASS_HS", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_CLASS_HS;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_CLASS_IN", 16)) {
+ /* ^ */
+ *iv_return = LDNS_RR_CLASS_IN;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_17 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_CERT_IACPKIX LDNS_KEY_ZONE_KEY LDNS_MAX_LABELLEN LDNS_MAX_POINTERS
+ LDNS_PACKET_QUERY LDNS_RDF_TYPE_ALG LDNS_RDF_TYPE_APL LDNS_RDF_TYPE_B64
+ LDNS_RDF_TYPE_HEX LDNS_RDF_TYPE_LOC LDNS_RDF_TYPE_STR LDNS_RDF_TYPE_WKS
+ LDNS_RESOLV_INET6 LDNS_RR_CLASS_ANY LDNS_RR_TYPE_AAAA LDNS_RR_TYPE_ATMA
+ LDNS_RR_TYPE_AXFR LDNS_RR_TYPE_CERT LDNS_RR_TYPE_GPOS LDNS_RR_TYPE_ISDN
+ LDNS_RR_TYPE_IXFR LDNS_RR_TYPE_LAST LDNS_RR_TYPE_NSAP LDNS_RR_TYPE_NSEC
+ LDNS_RR_TYPE_NULL LDNS_RR_TYPE_SINK LDNS_RR_TYPE_TSIG LDNS_SIGN_RSASHA1 */
+ /* Offset 16 gives the best switch position. */
+ switch (name[16]) {
+ case '1':
+ if (memEQ(name, "LDNS_SIGN_RSASHA", 16)) {
+ /* 1 */
+ *iv_return = LDNS_SIGN_RSASHA1;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case '4':
+ if (memEQ(name, "LDNS_RDF_TYPE_B6", 16)) {
+ /* 4 */
+ *iv_return = LDNS_RDF_TYPE_B64;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case '6':
+ if (memEQ(name, "LDNS_RESOLV_INET", 16)) {
+ /* 6 */
+#ifdef LDNS_RESOLV_INET6
+ *iv_return = LDNS_RESOLV_INET6;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'A':
+ if (memEQ(name, "LDNS_RR_TYPE_AAA", 16)) {
+ /* A */
+ *iv_return = LDNS_RR_TYPE_AAAA;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_ATM", 16)) {
+ /* A */
+ *iv_return = LDNS_RR_TYPE_ATMA;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'C':
+ if (memEQ(name, "LDNS_RDF_TYPE_LO", 16)) {
+ /* C */
+ *iv_return = LDNS_RDF_TYPE_LOC;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_NSE", 16)) {
+ /* C */
+ *iv_return = LDNS_RR_TYPE_NSEC;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'G':
+ if (memEQ(name, "LDNS_RDF_TYPE_AL", 16)) {
+ /* G */
+ *iv_return = LDNS_RDF_TYPE_ALG;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_TSI", 16)) {
+ /* G */
+ *iv_return = LDNS_RR_TYPE_TSIG;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'K':
+ if (memEQ(name, "LDNS_RR_TYPE_SIN", 16)) {
+ /* K */
+ *iv_return = LDNS_RR_TYPE_SINK;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'L':
+ if (memEQ(name, "LDNS_RDF_TYPE_AP", 16)) {
+ /* L */
+ *iv_return = LDNS_RDF_TYPE_APL;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_NUL", 16)) {
+ /* L */
+ *iv_return = LDNS_RR_TYPE_NULL;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'N':
+ if (memEQ(name, "LDNS_MAX_LABELLE", 16)) {
+ /* N */
+#ifdef LDNS_MAX_LABELLEN
+ *iv_return = LDNS_MAX_LABELLEN;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_ISD", 16)) {
+ /* N */
+ *iv_return = LDNS_RR_TYPE_ISDN;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'P':
+ if (memEQ(name, "LDNS_RR_TYPE_NSA", 16)) {
+ /* P */
+ *iv_return = LDNS_RR_TYPE_NSAP;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'R':
+ if (memEQ(name, "LDNS_RDF_TYPE_ST", 16)) {
+ /* R */
+ *iv_return = LDNS_RDF_TYPE_STR;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_AXF", 16)) {
+ /* R */
+ *iv_return = LDNS_RR_TYPE_AXFR;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_IXF", 16)) {
+ /* R */
+ *iv_return = LDNS_RR_TYPE_IXFR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'S':
+ if (memEQ(name, "LDNS_MAX_POINTER", 16)) {
+ /* S */
+#ifdef LDNS_MAX_POINTERS
+ *iv_return = LDNS_MAX_POINTERS;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "LDNS_RDF_TYPE_WK", 16)) {
+ /* S */
+ *iv_return = LDNS_RDF_TYPE_WKS;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_GPO", 16)) {
+ /* S */
+ *iv_return = LDNS_RR_TYPE_GPOS;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'T':
+ if (memEQ(name, "LDNS_RR_TYPE_CER", 16)) {
+ /* T */
+ *iv_return = LDNS_RR_TYPE_CERT;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_LAS", 16)) {
+ /* T */
+ *iv_return = LDNS_RR_TYPE_LAST;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'X':
+ if (memEQ(name, "LDNS_CERT_IACPKI", 16)) {
+ /* X */
+ *iv_return = LDNS_CERT_IACPKIX;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RDF_TYPE_HE", 16)) {
+ /* X */
+ *iv_return = LDNS_RDF_TYPE_HEX;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'Y':
+ if (memEQ(name, "LDNS_KEY_ZONE_KE", 16)) {
+ /* Y */
+#ifdef LDNS_KEY_ZONE_KEY
+ *iv_return = LDNS_KEY_ZONE_KEY;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "LDNS_PACKET_QUER", 16)) {
+ /* Y */
+ *iv_return = LDNS_PACKET_QUERY;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_CLASS_AN", 16)) {
+ /* Y */
+ *iv_return = LDNS_RR_CLASS_ANY;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_18 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_MAX_DOMAINLEN LDNS_MAX_PACKETLEN LDNS_PACKET_ANSWER
+ LDNS_PACKET_IQUERY LDNS_PACKET_NODATA LDNS_PACKET_NOTIFY
+ LDNS_PACKET_STATUS LDNS_PACKET_UPDATE LDNS_RCODE_FORMERR
+ LDNS_RCODE_NOERROR LDNS_RCODE_NOTAUTH LDNS_RCODE_NOTIMPL
+ LDNS_RCODE_NOTZONE LDNS_RCODE_NXRRSET LDNS_RCODE_REFUSED
+ LDNS_RCODE_YXRRSET LDNS_RDF_SIZE_BYTE LDNS_RDF_SIZE_WORD
+ LDNS_RDF_TYPE_AAAA LDNS_RDF_TYPE_ATMA LDNS_RDF_TYPE_INT8
+ LDNS_RDF_TYPE_NONE LDNS_RDF_TYPE_NSAP LDNS_RDF_TYPE_NSEC
+ LDNS_RDF_TYPE_TIME LDNS_RDF_TYPE_HIP LDNS_RDF_TYPE_TYPE
+ LDNS_RESOLV_ANCHOR LDNS_RESOLV_SEARCH LDNS_RR_CLASS_LAST
+ LDNS_RR_CLASS_NONE LDNS_RR_TYPE_AFSDB LDNS_RR_TYPE_CNAME
+ LDNS_RR_TYPE_COUNT LDNS_RR_TYPE_DHCID LDNS_RR_TYPE_DNAME
+ LDNS_RR_TYPE_FIRST LDNS_RR_TYPE_HINFO LDNS_RR_TYPE_MAILA
+ LDNS_RR_TYPE_MAILB LDNS_RR_TYPE_MINFO LDNS_RR_TYPE_NAPTR
+ LDNS_RR_TYPE_NSEC3 LDNS_RR_TYPE_RRSIG LDNS_RR_TYPE_SSHFP
+ LDNS_RR_TYPE_UINFO LDNS_RSASHA1_NSEC3 LDNS_SIGN_ECC_GOST
+ LDNS_SIGN_HMACSHA1 */
+ /* Offset 17 gives the best switch position. */
+ switch (name[17]) {
+ case '1':
+ if (memEQ(name, "LDNS_SIGN_HMACSHA", 17)) {
+ /* 1 */
+ *iv_return = LDNS_SIGN_HMACSHA1;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case '3':
+ if (memEQ(name, "LDNS_RR_TYPE_NSEC", 17)) {
+ /* 3 */
+ *iv_return = LDNS_RR_TYPE_NSEC3;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RSASHA1_NSEC", 17)) {
+ /* 3 */
+ *iv_return = LDNS_RSASHA1_NSEC3;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case '8':
+ if (memEQ(name, "LDNS_RDF_TYPE_INT", 17)) {
+ /* 8 */
+ *iv_return = LDNS_RDF_TYPE_INT8;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'A':
+ if (memEQ(name, "LDNS_PACKET_NODAT", 17)) {
+ /* A */
+ *iv_return = LDNS_PACKET_NODATA;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RDF_TYPE_AAA", 17)) {
+ /* A */
+ *iv_return = LDNS_RDF_TYPE_AAAA;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RDF_TYPE_ATM", 17)) {
+ /* A */
+ *iv_return = LDNS_RDF_TYPE_ATMA;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_MAIL", 17)) {
+ /* A */
+ *iv_return = LDNS_RR_TYPE_MAILA;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'B':
+ if (memEQ(name, "LDNS_RR_TYPE_AFSD", 17)) {
+ /* B */
+ *iv_return = LDNS_RR_TYPE_AFSDB;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_MAIL", 17)) {
+ /* B */
+ *iv_return = LDNS_RR_TYPE_MAILB;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'C':
+ if (memEQ(name, "LDNS_RDF_TYPE_NSE", 17)) {
+ /* C */
+ *iv_return = LDNS_RDF_TYPE_NSEC;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'D':
+ if (memEQ(name, "LDNS_RCODE_REFUSE", 17)) {
+ /* D */
+ *iv_return = LDNS_RCODE_REFUSED;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RDF_SIZE_WOR", 17)) {
+ /* D */
+#ifdef LDNS_RDF_SIZE_WORD
+ *iv_return = LDNS_RDF_SIZE_WORD;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_DHCI", 17)) {
+ /* D */
+ *iv_return = LDNS_RR_TYPE_DHCID;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'E':
+ if (memEQ(name, "LDNS_PACKET_UPDAT", 17)) {
+ /* E */
+ *iv_return = LDNS_PACKET_UPDATE;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RCODE_NOTZON", 17)) {
+ /* E */
+ *iv_return = LDNS_RCODE_NOTZONE;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RDF_SIZE_BYT", 17)) {
+ /* E */
+#ifdef LDNS_RDF_SIZE_BYTE
+ *iv_return = LDNS_RDF_SIZE_BYTE;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "LDNS_RDF_TYPE_NON", 17)) {
+ /* E */
+ *iv_return = LDNS_RDF_TYPE_NONE;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RDF_TYPE_TIM", 17)) {
+ /* E */
+ *iv_return = LDNS_RDF_TYPE_TIME;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RDF_TYPE_TYP", 17)) {
+ /* E */
+ *iv_return = LDNS_RDF_TYPE_TYPE;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_CLASS_NON", 17)) {
+ /* E */
+ *iv_return = LDNS_RR_CLASS_NONE;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_CNAM", 17)) {
+ /* E */
+ *iv_return = LDNS_RR_TYPE_CNAME;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_DNAM", 17)) {
+ /* E */
+ *iv_return = LDNS_RR_TYPE_DNAME;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'G':
+ if (memEQ(name, "LDNS_RDF_TYPE_HIP", 17)) {
+ /* G */
+ *iv_return = LDNS_RDF_TYPE_HIP;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_RRSI", 17)) {
+ /* G */
+ *iv_return = LDNS_RR_TYPE_RRSIG;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'H':
+ if (memEQ(name, "LDNS_RCODE_NOTAUT", 17)) {
+ /* H */
+ *iv_return = LDNS_RCODE_NOTAUTH;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RESOLV_SEARC", 17)) {
+ /* H */
+#ifdef LDNS_RESOLV_SEARCH
+ *iv_return = LDNS_RESOLV_SEARCH;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'L':
+ if (memEQ(name, "LDNS_RCODE_NOTIMP", 17)) {
+ /* L */
+ *iv_return = LDNS_RCODE_NOTIMPL;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'N':
+ if (memEQ(name, "LDNS_MAX_DOMAINLE", 17)) {
+ /* N */
+#ifdef LDNS_MAX_DOMAINLEN
+ *iv_return = LDNS_MAX_DOMAINLEN;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "LDNS_MAX_PACKETLE", 17)) {
+ /* N */
+#ifdef LDNS_MAX_PACKETLEN
+ *iv_return = LDNS_MAX_PACKETLEN;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'O':
+ if (memEQ(name, "LDNS_RR_TYPE_HINF", 17)) {
+ /* O */
+ *iv_return = LDNS_RR_TYPE_HINFO;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_MINF", 17)) {
+ /* O */
+ *iv_return = LDNS_RR_TYPE_MINFO;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_UINF", 17)) {
+ /* O */
+ *iv_return = LDNS_RR_TYPE_UINFO;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'P':
+ if (memEQ(name, "LDNS_RDF_TYPE_NSA", 17)) {
+ /* P */
+ *iv_return = LDNS_RDF_TYPE_NSAP;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_SSHF", 17)) {
+ /* P */
+ *iv_return = LDNS_RR_TYPE_SSHFP;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'R':
+ if (memEQ(name, "LDNS_PACKET_ANSWE", 17)) {
+ /* R */
+ *iv_return = LDNS_PACKET_ANSWER;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RCODE_FORMER", 17)) {
+ /* R */
+ *iv_return = LDNS_RCODE_FORMERR;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RCODE_NOERRO", 17)) {
+ /* R */
+ *iv_return = LDNS_RCODE_NOERROR;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RESOLV_ANCHO", 17)) {
+ /* R */
+#ifdef LDNS_RESOLV_ANCHOR
+ *iv_return = LDNS_RESOLV_ANCHOR;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_NAPT", 17)) {
+ /* R */
+ *iv_return = LDNS_RR_TYPE_NAPTR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'S':
+ if (memEQ(name, "LDNS_PACKET_STATU", 17)) {
+ /* S */
+ *iv_return = LDNS_PACKET_STATUS;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'T':
+ if (memEQ(name, "LDNS_RCODE_NXRRSE", 17)) {
+ /* T */
+ *iv_return = LDNS_RCODE_NXRRSET;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RCODE_YXRRSE", 17)) {
+ /* T */
+ *iv_return = LDNS_RCODE_YXRRSET;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_CLASS_LAS", 17)) {
+ /* T */
+ *iv_return = LDNS_RR_CLASS_LAST;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_COUN", 17)) {
+ /* T */
+ *iv_return = LDNS_RR_TYPE_COUNT;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_FIRS", 17)) {
+ /* T */
+ *iv_return = LDNS_RR_TYPE_FIRST;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_SIGN_ECC_GOS", 17)) {
+ /* T */
+ *iv_return = LDNS_SIGN_ECC_GOST;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'Y':
+ if (memEQ(name, "LDNS_PACKET_IQUER", 17)) {
+ /* Y */
+ *iv_return = LDNS_PACKET_IQUERY;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_PACKET_NOTIF", 17)) {
+ /* Y */
+ *iv_return = LDNS_PACKET_NOTIFY;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_19 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_KEY_REVOKE_KEY LDNS_PACKET_UNKNOWN LDNS_RCODE_NXDOMAIN
+ LDNS_RCODE_SERVFAIL LDNS_RCODE_YXDOMAIN LDNS_RDF_TYPE_CLASS
+ LDNS_RDF_TYPE_DNAME LDNS_RDF_TYPE_INT16 LDNS_RDF_TYPE_INT32
+ LDNS_RESOLV_INETANY LDNS_RESOLV_KEYWORD LDNS_RESOLV_OPTIONS
+ LDNS_RESOLV_RTT_INF LDNS_RESOLV_RTT_MIN LDNS_RR_CLASS_COUNT
+ LDNS_RR_CLASS_FIRST LDNS_RR_NO_COMPRESS LDNS_RR_TYPE_DNSKEY
+ LDNS_RR_TYPE_NIMLOC LDNS_RR_TYPE_TALINK LDNS_RR_TYPE_UNSPEC
+ LDNS_SECTION_ANSWER LDNS_SIGN_DSA_NSEC3 LDNS_SIGN_RSASHA256
+ LDNS_SIGN_RSASHA512 LDNS_STATUS_MEM_ERR LDNS_STATUS_NO_DATA
+ LDNS_STATUS_SSL_ERR */
+ /* Offset 14 gives the best switch position. */
+ switch (name[14]) {
+ case 'A':
+ if (memEQ(name, "LDNS_RR_TYPE_TALINK", 19)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_TALINK;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'C':
+ if (memEQ(name, "LDNS_RDF_TYPE_CLASS", 19)) {
+ /* ^ */
+ *iv_return = LDNS_RDF_TYPE_CLASS;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_CLASS_COUNT", 19)) {
+ /* ^ */
+ *iv_return = LDNS_RR_CLASS_COUNT;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'D':
+ if (memEQ(name, "LDNS_RDF_TYPE_DNAME", 19)) {
+ /* ^ */
+ *iv_return = LDNS_RDF_TYPE_DNAME;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'E':
+ if (memEQ(name, "LDNS_KEY_REVOKE_KEY", 19)) {
+ /* ^ */
+#ifdef LDNS_KEY_REVOKE_KEY
+ *iv_return = LDNS_KEY_REVOKE_KEY;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "LDNS_RESOLV_INETANY", 19)) {
+ /* ^ */
+#ifdef LDNS_RESOLV_INETANY
+ *iv_return = LDNS_RESOLV_INETANY;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'F':
+ if (memEQ(name, "LDNS_RR_CLASS_FIRST", 19)) {
+ /* ^ */
+ *iv_return = LDNS_RR_CLASS_FIRST;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'H':
+ if (memEQ(name, "LDNS_SIGN_RSASHA256", 19)) {
+ /* ^ */
+ *iv_return = LDNS_SIGN_RSASHA256;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_SIGN_RSASHA512", 19)) {
+ /* ^ */
+ *iv_return = LDNS_SIGN_RSASHA512;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'I':
+ if (memEQ(name, "LDNS_RDF_TYPE_INT16", 19)) {
+ /* ^ */
+ *iv_return = LDNS_RDF_TYPE_INT16;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RDF_TYPE_INT32", 19)) {
+ /* ^ */
+ *iv_return = LDNS_RDF_TYPE_INT32;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_NIMLOC", 19)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_NIMLOC;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'K':
+ if (memEQ(name, "LDNS_PACKET_UNKNOWN", 19)) {
+ /* ^ */
+ *iv_return = LDNS_PACKET_UNKNOWN;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'L':
+ if (memEQ(name, "LDNS_STATUS_SSL_ERR", 19)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SSL_ERR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'M':
+ if (memEQ(name, "LDNS_STATUS_MEM_ERR", 19)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_MEM_ERR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'N':
+ if (memEQ(name, "LDNS_RR_TYPE_DNSKEY", 19)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_DNSKEY;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RR_TYPE_UNSPEC", 19)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_UNSPEC;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_SECTION_ANSWER", 19)) {
+ /* ^ */
+ *iv_return = LDNS_SECTION_ANSWER;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_SIGN_DSA_NSEC3", 19)) {
+ /* ^ */
+ *iv_return = LDNS_SIGN_DSA_NSEC3;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'O':
+ if (memEQ(name, "LDNS_RCODE_NXDOMAIN", 19)) {
+ /* ^ */
+ *iv_return = LDNS_RCODE_NXDOMAIN;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RCODE_YXDOMAIN", 19)) {
+ /* ^ */
+ *iv_return = LDNS_RCODE_YXDOMAIN;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'P':
+ if (memEQ(name, "LDNS_RR_NO_COMPRESS", 19)) {
+ /* ^ */
+ *iv_return = LDNS_RR_NO_COMPRESS;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'T':
+ if (memEQ(name, "LDNS_RESOLV_OPTIONS", 19)) {
+ /* ^ */
+#ifdef LDNS_RESOLV_OPTIONS
+ *iv_return = LDNS_RESOLV_OPTIONS;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "LDNS_RESOLV_RTT_INF", 19)) {
+ /* ^ */
+#ifdef LDNS_RESOLV_RTT_INF
+ *iv_return = LDNS_RESOLV_RTT_INF;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "LDNS_RESOLV_RTT_MIN", 19)) {
+ /* ^ */
+#ifdef LDNS_RESOLV_RTT_MIN
+ *iv_return = LDNS_RESOLV_RTT_MIN;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'V':
+ if (memEQ(name, "LDNS_RCODE_SERVFAIL", 19)) {
+ /* ^ */
+ *iv_return = LDNS_RCODE_SERVFAIL;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'Y':
+ if (memEQ(name, "LDNS_RESOLV_KEYWORD", 19)) {
+ /* ^ */
+#ifdef LDNS_RESOLV_KEYWORD
+ *iv_return = LDNS_RESOLV_KEYWORD;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case '_':
+ if (memEQ(name, "LDNS_STATUS_NO_DATA", 19)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_NO_DATA;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_20 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_ECDSAP384SHA384 LDNS_PACKET_NXDOMAIN LDNS_PACKET_QUESTION
+ LDNS_PACKET_REFERRAL LDNS_RDF_SIZE_6BYTES LDNS_RDF_TYPE_PERIOD
+ LDNS_RESOLV_KEYWORDS LDNS_RESOLV_SORTLIST LDNS_SIGN_HMACSHA256
+ LDNS_STATUS_FILE_ERR LDNS_STATUS_NOT_IMPL */
+ /* Offset 18 gives the best switch position. */
+ switch (name[18]) {
+ case '5':
+ if (memEQ(name, "LDNS_SIGN_HMACSHA256", 20)) {
+ /* ^ */
+ *iv_return = LDNS_SIGN_HMACSHA256;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case '8':
+ if (memEQ(name, "LDNS_ECDSAP384SHA384", 20)) {
+ /* ^ */
+ *iv_return = LDNS_ECDSAP384SHA384;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'A':
+ if (memEQ(name, "LDNS_PACKET_REFERRAL", 20)) {
+ /* ^ */
+ *iv_return = LDNS_PACKET_REFERRAL;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'D':
+ if (memEQ(name, "LDNS_RESOLV_KEYWORDS", 20)) {
+ /* ^ */
+#ifdef LDNS_RESOLV_KEYWORDS
+ *iv_return = LDNS_RESOLV_KEYWORDS;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'E':
+ if (memEQ(name, "LDNS_RDF_SIZE_6BYTES", 20)) {
+ /* ^ */
+#ifdef LDNS_RDF_SIZE_6BYTES
+ *iv_return = LDNS_RDF_SIZE_6BYTES;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'I':
+ if (memEQ(name, "LDNS_PACKET_NXDOMAIN", 20)) {
+ /* ^ */
+ *iv_return = LDNS_PACKET_NXDOMAIN;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'O':
+ if (memEQ(name, "LDNS_PACKET_QUESTION", 20)) {
+ /* ^ */
+ *iv_return = LDNS_PACKET_QUESTION;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_RDF_TYPE_PERIOD", 20)) {
+ /* ^ */
+ *iv_return = LDNS_RDF_TYPE_PERIOD;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'P':
+ if (memEQ(name, "LDNS_STATUS_NOT_IMPL", 20)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_NOT_IMPL;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'R':
+ if (memEQ(name, "LDNS_STATUS_FILE_ERR", 20)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_FILE_ERR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'S':
+ if (memEQ(name, "LDNS_RESOLV_SORTLIST", 20)) {
+ /* ^ */
+#ifdef LDNS_RESOLV_SORTLIST
+ *iv_return = LDNS_RESOLV_SORTLIST;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_21 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_RDF_SIZE_16BYTES LDNS_RDF_TYPE_B32_EXT LDNS_RDF_TYPE_SERVICE
+ LDNS_RDF_TYPE_UNKNOWN LDNS_RESOLV_DEFDOMAIN LDNS_RR_TYPE_IPSECKEY
+ LDNS_RR_TYPE_NSAP_PTR LDNS_SECTION_QUESTION LDNS_STATUS_NSEC3_ERR
+ LDNS_STATUS_RES_NO_NS LDNS_STATUS_RES_QUERY */
+ /* Offset 16 gives the best switch position. */
+ switch (name[16]) {
+ case '2':
+ if (memEQ(name, "LDNS_RDF_TYPE_B32_EXT", 21)) {
+ /* ^ */
+ *iv_return = LDNS_RDF_TYPE_B32_EXT;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case '3':
+ if (memEQ(name, "LDNS_STATUS_NSEC3_ERR", 21)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_NSEC3_ERR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'B':
+ if (memEQ(name, "LDNS_RDF_SIZE_16BYTES", 21)) {
+ /* ^ */
+#ifdef LDNS_RDF_SIZE_16BYTES
+ *iv_return = LDNS_RDF_SIZE_16BYTES;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'E':
+ if (memEQ(name, "LDNS_RR_TYPE_IPSECKEY", 21)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_IPSECKEY;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'K':
+ if (memEQ(name, "LDNS_RDF_TYPE_UNKNOWN", 21)) {
+ /* ^ */
+ *iv_return = LDNS_RDF_TYPE_UNKNOWN;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'N':
+ if (memEQ(name, "LDNS_STATUS_RES_NO_NS", 21)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_RES_NO_NS;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'O':
+ if (memEQ(name, "LDNS_RESOLV_DEFDOMAIN", 21)) {
+ /* ^ */
+#ifdef LDNS_RESOLV_DEFDOMAIN
+ *iv_return = LDNS_RESOLV_DEFDOMAIN;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'P':
+ if (memEQ(name, "LDNS_RR_TYPE_NSAP_PTR", 21)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_NSAP_PTR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'Q':
+ if (memEQ(name, "LDNS_STATUS_RES_QUERY", 21)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_RES_QUERY;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'R':
+ if (memEQ(name, "LDNS_RDF_TYPE_SERVICE", 21)) {
+ /* ^ */
+ *iv_return = LDNS_RDF_TYPE_SERVICE;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'S':
+ if (memEQ(name, "LDNS_SECTION_QUESTION", 21)) {
+ /* ^ */
+ *iv_return = LDNS_SECTION_QUESTION;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_22 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_RDF_TYPE_CERT_ALG LDNS_RDF_TYPE_IPSECKEY LDNS_RDF_TYPE_TSIGTIME
+ LDNS_RESOLV_NAMESERVER LDNS_SECTION_AUTHORITY LDNS_STATUS_SYNTAX_ERR
+ LDNS_STATUS_SYNTAX_TTL */
+ /* Offset 14 gives the best switch position. */
+ switch (name[14]) {
+ case 'C':
+ if (memEQ(name, "LDNS_RDF_TYPE_CERT_ALG", 22)) {
+ /* ^ */
+ *iv_return = LDNS_RDF_TYPE_CERT_ALG;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'I':
+ if (memEQ(name, "LDNS_RDF_TYPE_IPSECKEY", 22)) {
+ /* ^ */
+ *iv_return = LDNS_RDF_TYPE_IPSECKEY;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'M':
+ if (memEQ(name, "LDNS_RESOLV_NAMESERVER", 22)) {
+ /* ^ */
+#ifdef LDNS_RESOLV_NAMESERVER
+ *iv_return = LDNS_RESOLV_NAMESERVER;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'N':
+ if (memEQ(name, "LDNS_STATUS_SYNTAX_ERR", 22)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SYNTAX_ERR;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_STATUS_SYNTAX_TTL", 22)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SYNTAX_TTL;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'T':
+ if (memEQ(name, "LDNS_RDF_TYPE_TSIGTIME", 22)) {
+ /* ^ */
+ *iv_return = LDNS_RDF_TYPE_TSIGTIME;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'U':
+ if (memEQ(name, "LDNS_SECTION_AUTHORITY", 22)) {
+ /* ^ */
+ *iv_return = LDNS_SECTION_AUTHORITY;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_23 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_RR_TYPE_NSEC3PARAM LDNS_SECTION_ADDITIONAL LDNS_SIGN_RSASHA1_NSEC3
+ LDNS_STATUS_ADDRESS_ERR LDNS_STATUS_EMPTY_LABEL LDNS_STATUS_INVALID_B64
+ LDNS_STATUS_INVALID_HEX LDNS_STATUS_INVALID_INT LDNS_STATUS_INVALID_IP4
+ LDNS_STATUS_INVALID_IP6 LDNS_STATUS_INVALID_STR LDNS_STATUS_NETWORK_ERR */
+ /* Offset 21 gives the best switch position. */
+ switch (name[21]) {
+ case '6':
+ if (memEQ(name, "LDNS_STATUS_INVALID_B64", 23)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_INVALID_B64;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'A':
+ if (memEQ(name, "LDNS_RR_TYPE_NSEC3PARAM", 23)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_NSEC3PARAM;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_SECTION_ADDITIONAL", 23)) {
+ /* ^ */
+ *iv_return = LDNS_SECTION_ADDITIONAL;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'C':
+ if (memEQ(name, "LDNS_SIGN_RSASHA1_NSEC3", 23)) {
+ /* ^ */
+ *iv_return = LDNS_SIGN_RSASHA1_NSEC3;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'E':
+ if (memEQ(name, "LDNS_STATUS_EMPTY_LABEL", 23)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_EMPTY_LABEL;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_STATUS_INVALID_HEX", 23)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_INVALID_HEX;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'N':
+ if (memEQ(name, "LDNS_STATUS_INVALID_INT", 23)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_INVALID_INT;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'P':
+ if (memEQ(name, "LDNS_STATUS_INVALID_IP4", 23)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_INVALID_IP4;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_STATUS_INVALID_IP6", 23)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_INVALID_IP6;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'R':
+ if (memEQ(name, "LDNS_STATUS_ADDRESS_ERR", 23)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_ADDRESS_ERR;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_STATUS_NETWORK_ERR", 23)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_NETWORK_ERR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'T':
+ if (memEQ(name, "LDNS_STATUS_INVALID_STR", 23)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_INVALID_STR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_24 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_RDF_SIZE_DOUBLEWORD LDNS_RDF_TYPE_INT16_DATA LDNS_RDF_TYPE_NSEC3_SALT
+ LDNS_RR_TYPE_NSEC3PARAMS LDNS_STATUS_CRYPTO_BOGUS LDNS_STATUS_CRYPTO_NO_DS
+ LDNS_STATUS_DDD_OVERFLOW LDNS_STATUS_INTERNAL_ERR LDNS_STATUS_INVALID_TIME
+ LDNS_STATUS_SOCKET_ERROR LDNS_STATUS_SYNTAX_EMPTY LDNS_STATUS_UNKNOWN_INET
+ */
+ /* Offset 17 gives the best switch position. */
+ switch (name[17]) {
+ case '1':
+ if (memEQ(name, "LDNS_RDF_TYPE_INT16_DATA", 24)) {
+ /* ^ */
+ *iv_return = LDNS_RDF_TYPE_INT16_DATA;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case '3':
+ if (memEQ(name, "LDNS_RR_TYPE_NSEC3PARAMS", 24)) {
+ /* ^ */
+ *iv_return = LDNS_RR_TYPE_NSEC3PARAMS;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'B':
+ if (memEQ(name, "LDNS_RDF_SIZE_DOUBLEWORD", 24)) {
+ /* ^ */
+#ifdef LDNS_RDF_SIZE_DOUBLEWORD
+ *iv_return = LDNS_RDF_SIZE_DOUBLEWORD;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'C':
+ if (memEQ(name, "LDNS_RDF_TYPE_NSEC3_SALT", 24)) {
+ /* ^ */
+ *iv_return = LDNS_RDF_TYPE_NSEC3_SALT;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'I':
+ if (memEQ(name, "LDNS_STATUS_INVALID_TIME", 24)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_INVALID_TIME;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'N':
+ if (memEQ(name, "LDNS_STATUS_INTERNAL_ERR", 24)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_INTERNAL_ERR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'O':
+ if (memEQ(name, "LDNS_STATUS_CRYPTO_BOGUS", 24)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_CRYPTO_BOGUS;
+ return PERL_constant_ISIV;
+ }
+ if (memEQ(name, "LDNS_STATUS_CRYPTO_NO_DS", 24)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_CRYPTO_NO_DS;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'T':
+ if (memEQ(name, "LDNS_STATUS_SOCKET_ERROR", 24)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SOCKET_ERROR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'V':
+ if (memEQ(name, "LDNS_STATUS_DDD_OVERFLOW", 24)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_DDD_OVERFLOW;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'W':
+ if (memEQ(name, "LDNS_STATUS_UNKNOWN_INET", 24)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_UNKNOWN_INET;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'X':
+ if (memEQ(name, "LDNS_STATUS_SYNTAX_EMPTY", 24)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SYNTAX_EMPTY;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_26 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_STATUS_LABEL_OVERFLOW LDNS_STATUS_SYNTAX_ALG_ERR
+ LDNS_STATUS_SYNTAX_INCLUDE LDNS_STATUS_SYNTAX_TTL_ERR */
+ /* Offset 20 gives the best switch position. */
+ switch (name[20]) {
+ case 'E':
+ if (memEQ(name, "LDNS_STATUS_LABEL_OVERFLOW", 26)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_LABEL_OVERFLOW;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'L':
+ if (memEQ(name, "LDNS_STATUS_SYNTAX_ALG_ERR", 26)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SYNTAX_ALG_ERR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'N':
+ if (memEQ(name, "LDNS_STATUS_SYNTAX_INCLUDE", 26)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SYNTAX_INCLUDE;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'T':
+ if (memEQ(name, "LDNS_STATUS_SYNTAX_TTL_ERR", 26)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SYNTAX_TTL_ERR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_27 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_NSEC3_VARS_OPTOUT_MASK LDNS_SECTION_ANY_NOQUESTION
+ LDNS_STATUS_CRYPTO_NO_RRSIG LDNS_STATUS_CRYPTO_TSIG_ERR
+ LDNS_STATUS_INVALID_B32_EXT LDNS_STATUS_INVALID_POINTER
+ LDNS_STATUS_PACKET_OVERFLOW LDNS_STATUS_SYNTAX_TYPE_ERR */
+ /* Offset 20 gives the best switch position. */
+ switch (name[20]) {
+ case 'B':
+ if (memEQ(name, "LDNS_STATUS_INVALID_B32_EXT", 27)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_INVALID_B32_EXT;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'O':
+ if (memEQ(name, "LDNS_STATUS_CRYPTO_NO_RRSIG", 27)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_CRYPTO_NO_RRSIG;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'P':
+ if (memEQ(name, "LDNS_STATUS_INVALID_POINTER", 27)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_INVALID_POINTER;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'S':
+ if (memEQ(name, "LDNS_STATUS_CRYPTO_TSIG_ERR", 27)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_CRYPTO_TSIG_ERR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'U':
+ if (memEQ(name, "LDNS_NSEC3_VARS_OPTOUT_MASK", 27)) {
+ /* ^ */
+#ifdef LDNS_NSEC3_VARS_OPTOUT_MASK
+ *iv_return = LDNS_NSEC3_VARS_OPTOUT_MASK;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ if (memEQ(name, "LDNS_SECTION_ANY_NOQUESTION", 27)) {
+ /* ^ */
+ *iv_return = LDNS_SECTION_ANY_NOQUESTION;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'V':
+ if (memEQ(name, "LDNS_STATUS_PACKET_OVERFLOW", 27)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_PACKET_OVERFLOW;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'Y':
+ if (memEQ(name, "LDNS_STATUS_SYNTAX_TYPE_ERR", 27)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SYNTAX_TYPE_ERR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_28 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_STATUS_CRYPTO_NO_DNSKEY LDNS_STATUS_CRYPTO_VALIDATED
+ LDNS_STATUS_SYNTAX_CLASS_ERR LDNS_STATUS_SYNTAX_DNAME_ERR
+ LDNS_STATUS_SYNTAX_RDATA_ERR */
+ /* Offset 20 gives the best switch position. */
+ switch (name[20]) {
+ case 'A':
+ if (memEQ(name, "LDNS_STATUS_CRYPTO_VALIDATED", 28)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_CRYPTO_VALIDATED;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'D':
+ if (memEQ(name, "LDNS_STATUS_SYNTAX_RDATA_ERR", 28)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SYNTAX_RDATA_ERR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'L':
+ if (memEQ(name, "LDNS_STATUS_SYNTAX_CLASS_ERR", 28)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SYNTAX_CLASS_ERR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'N':
+ if (memEQ(name, "LDNS_STATUS_SYNTAX_DNAME_ERR", 28)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SYNTAX_DNAME_ERR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'O':
+ if (memEQ(name, "LDNS_STATUS_CRYPTO_NO_DNSKEY", 28)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_CRYPTO_NO_DNSKEY;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_30 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_RDF_TYPE_NSEC3_NEXT_OWNER LDNS_STATUS_CERT_BAD_ALGORITHM
+ LDNS_STATUS_CRYPTO_SIG_EXPIRED LDNS_STATUS_SYNTAX_KEYWORD_ERR
+ LDNS_STATUS_SYNTAX_VERSION_ERR */
+ /* Offset 25 gives the best switch position. */
+ switch (name[25]) {
+ case 'D':
+ if (memEQ(name, "LDNS_STATUS_SYNTAX_KEYWORD_ERR", 30)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SYNTAX_KEYWORD_ERR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'N':
+ if (memEQ(name, "LDNS_STATUS_SYNTAX_VERSION_ERR", 30)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SYNTAX_VERSION_ERR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'O':
+ if (memEQ(name, "LDNS_RDF_TYPE_NSEC3_NEXT_OWNER", 30)) {
+ /* ^ */
+ *iv_return = LDNS_RDF_TYPE_NSEC3_NEXT_OWNER;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'P':
+ if (memEQ(name, "LDNS_STATUS_CRYPTO_SIG_EXPIRED", 30)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_CRYPTO_SIG_EXPIRED;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'R':
+ if (memEQ(name, "LDNS_STATUS_CERT_BAD_ALGORITHM", 30)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_CERT_BAD_ALGORITHM;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_32 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_STATUS_CRYPTO_ALGO_NOT_IMPL LDNS_STATUS_CRYPTO_NO_TRUSTED_DS
+ LDNS_STATUS_DOMAINNAME_UNDERFLOW */
+ /* Offset 20 gives the best switch position. */
+ switch (name[20]) {
+ case 'L':
+ if (memEQ(name, "LDNS_STATUS_CRYPTO_ALGO_NOT_IMPL", 32)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_CRYPTO_ALGO_NOT_IMPL;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'M':
+ if (memEQ(name, "LDNS_STATUS_DOMAINNAME_UNDERFLOW", 32)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_DOMAINNAME_UNDERFLOW;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'O':
+ if (memEQ(name, "LDNS_STATUS_CRYPTO_NO_TRUSTED_DS", 32)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_CRYPTO_NO_TRUSTED_DS;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_35 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_RDATA_FIELD_DESCRIPTORS_COMMON LDNS_STATUS_CRYPTO_SIG_NOT_INCEPTED
+ LDNS_STATUS_CRYPTO_TYPE_COVERED_ERR LDNS_STATUS_DNSSEC_EXISTENCE_DENIED
+ LDNS_STATUS_SYNTAX_INTEGER_OVERFLOW */
+ /* Offset 21 gives the best switch position. */
+ switch (name[21]) {
+ case 'G':
+ if (memEQ(name, "LDNS_STATUS_CRYPTO_SIG_NOT_INCEPTED", 35)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_CRYPTO_SIG_NOT_INCEPTED;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'I':
+ if (memEQ(name, "LDNS_STATUS_DNSSEC_EXISTENCE_DENIED", 35)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_DNSSEC_EXISTENCE_DENIED;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'P':
+ if (memEQ(name, "LDNS_STATUS_CRYPTO_TYPE_COVERED_ERR", 35)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_CRYPTO_TYPE_COVERED_ERR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'R':
+ if (memEQ(name, "LDNS_RDATA_FIELD_DESCRIPTORS_COMMON", 35)) {
+ /* ^ */
+#ifdef LDNS_RDATA_FIELD_DESCRIPTORS_COMMON
+ *iv_return = LDNS_RDATA_FIELD_DESCRIPTORS_COMMON;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'T':
+ if (memEQ(name, "LDNS_STATUS_SYNTAX_INTEGER_OVERFLOW", 35)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SYNTAX_INTEGER_OVERFLOW;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_36 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_STATUS_CRYPTO_NO_TRUSTED_DNSKEY LDNS_STATUS_MISSING_RDATA_FIELDS_KEY
+ LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR LDNS_STATUS_WIRE_INCOMPLETE_QUESTION
+ */
+ /* Offset 14 gives the best switch position. */
+ switch (name[14]) {
+ case 'N':
+ if (memEQ(name, "LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR", 36)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'R':
+ if (memEQ(name, "LDNS_STATUS_WIRE_INCOMPLETE_QUESTION", 36)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_WIRE_INCOMPLETE_QUESTION;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'S':
+ if (memEQ(name, "LDNS_STATUS_MISSING_RDATA_FIELDS_KEY", 36)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_MISSING_RDATA_FIELDS_KEY;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'Y':
+ if (memEQ(name, "LDNS_STATUS_CRYPTO_NO_TRUSTED_DNSKEY", 36)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_CRYPTO_NO_TRUSTED_DNSKEY;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant_38 (pTHX_ const char *name, IV *iv_return) {
+ /* When generated this function returned values for the list of names given
+ here. However, subsequent manual editing may have added or removed some.
+ LDNS_STATUS_DNSSEC_NSEC_RR_NOT_COVERED
+ LDNS_STATUS_MISSING_RDATA_FIELDS_RRSIG
+ LDNS_STATUS_SYNTAX_INCLUDE_ERR_NOTIMPL
+ LDNS_STATUS_SYNTAX_ITERATIONS_OVERFLOW
+ LDNS_STATUS_WIRE_INCOMPLETE_ADDITIONAL */
+ /* Offset 20 gives the best switch position. */
+ switch (name[20]) {
+ case 'N':
+ if (memEQ(name, "LDNS_STATUS_SYNTAX_INCLUDE_ERR_NOTIMPL", 38)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SYNTAX_INCLUDE_ERR_NOTIMPL;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'O':
+ if (memEQ(name, "LDNS_STATUS_WIRE_INCOMPLETE_ADDITIONAL", 38)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_WIRE_INCOMPLETE_ADDITIONAL;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'R':
+ if (memEQ(name, "LDNS_STATUS_MISSING_RDATA_FIELDS_RRSIG", 38)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_MISSING_RDATA_FIELDS_RRSIG;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'S':
+ if (memEQ(name, "LDNS_STATUS_DNSSEC_NSEC_RR_NOT_COVERED", 38)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_DNSSEC_NSEC_RR_NOT_COVERED;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'T':
+ if (memEQ(name, "LDNS_STATUS_SYNTAX_ITERATIONS_OVERFLOW", 38)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SYNTAX_ITERATIONS_OVERFLOW;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
+static int
+constant (pTHX_ const char *name, STRLEN len, IV *iv_return) {
+ /* Initially switch on the length of the name. */
+ /* When generated this function returned values for the list of names given
+ in this section of perl code. Rather than manually editing these functions
+ to add or remove constants, which would result in this comment and section
+ of code becoming inaccurate, we recommend that you edit this section of
+ code, and use it to regenerate a new set of constant functions which you
+ then use to replace the originals.
+
+ Regenerate these constant functions by feeding this entire source file to
+ perl -x
+
+#!/usr/bin/perl -w
+use ExtUtils::Constant qw (constant_types C_constant XS_constant);
+
+my $types = {map {($_, 1)} qw(IV)};
+my @names = (qw(LDNS_AA LDNS_AD LDNS_CD LDNS_DEFAULT_TTL LDNS_IP4ADDRLEN
+ LDNS_IP6ADDRLEN LDNS_KEY_REVOKE_KEY LDNS_KEY_SEP_KEY
+ LDNS_KEY_ZONE_KEY LDNS_MAX_DOMAINLEN LDNS_MAX_LABELLEN
+ LDNS_MAX_PACKETLEN LDNS_MAX_POINTERS LDNS_MAX_RDFLEN
+ LDNS_NSEC3_VARS_OPTOUT_MASK LDNS_PORT LDNS_QR LDNS_RA LDNS_RD
+ LDNS_RDATA_FIELD_DESCRIPTORS_COMMON LDNS_RDF_SIZE_16BYTES
+ LDNS_RDF_SIZE_6BYTES LDNS_RDF_SIZE_BYTE LDNS_RDF_SIZE_DOUBLEWORD
+ LDNS_RDF_SIZE_WORD LDNS_RESOLV_ANCHOR LDNS_RESOLV_DEFDOMAIN
+ LDNS_RESOLV_INET LDNS_RESOLV_INET6 LDNS_RESOLV_INETANY
+ LDNS_RESOLV_KEYWORD LDNS_RESOLV_KEYWORDS LDNS_RESOLV_NAMESERVER
+ LDNS_RESOLV_OPTIONS LDNS_RESOLV_RTT_INF LDNS_RESOLV_RTT_MIN
+ LDNS_RESOLV_SEARCH LDNS_RESOLV_SORTLIST LDNS_RR_OVERHEAD
+ LDNS_TC),
+ {name=>"LDNS_CERT_ACPKIX", type=>"IV", macro=>"1"},
+ {name=>"LDNS_CERT_IACPKIX", type=>"IV", macro=>"1"},
+ {name=>"LDNS_CERT_IPGP", type=>"IV", macro=>"1"},
+ {name=>"LDNS_CERT_IPKIX", type=>"IV", macro=>"1"},
+ {name=>"LDNS_CERT_ISPKI", type=>"IV", macro=>"1"},
+ {name=>"LDNS_CERT_OID", type=>"IV", macro=>"1"},
+ {name=>"LDNS_CERT_PGP", type=>"IV", macro=>"1"},
+ {name=>"LDNS_CERT_PKIX", type=>"IV", macro=>"1"},
+ {name=>"LDNS_CERT_SPKI", type=>"IV", macro=>"1"},
+ {name=>"LDNS_CERT_URI", type=>"IV", macro=>"1"},
+ {name=>"LDNS_DH", type=>"IV", macro=>"1"},
+ {name=>"LDNS_DSA", type=>"IV", macro=>"1"},
+ {name=>"LDNS_DSA_NSEC3", type=>"IV", macro=>"1"},
+ {name=>"LDNS_ECC", type=>"IV", macro=>"1"},
+ {name=>"LDNS_ECC_GOST", type=>"IV", macro=>"1"},
+ {name=>"LDNS_ECDSAP384SHA384", type=>"IV", macro=>"1"},
+ {name=>"LDNS_HASH_GOST", type=>"IV", macro=>"1"},
+ {name=>"LDNS_PACKET_ANSWER", type=>"IV", macro=>"1"},
+ {name=>"LDNS_PACKET_IQUERY", type=>"IV", macro=>"1"},
+ {name=>"LDNS_PACKET_NODATA", type=>"IV", macro=>"1"},
+ {name=>"LDNS_PACKET_NOTIFY", type=>"IV", macro=>"1"},
+ {name=>"LDNS_PACKET_NXDOMAIN", type=>"IV", macro=>"1"},
+ {name=>"LDNS_PACKET_QUERY", type=>"IV", macro=>"1"},
+ {name=>"LDNS_PACKET_QUESTION", type=>"IV", macro=>"1"},
+ {name=>"LDNS_PACKET_REFERRAL", type=>"IV", macro=>"1"},
+ {name=>"LDNS_PACKET_STATUS", type=>"IV", macro=>"1"},
+ {name=>"LDNS_PACKET_UNKNOWN", type=>"IV", macro=>"1"},
+ {name=>"LDNS_PACKET_UPDATE", type=>"IV", macro=>"1"},
+ {name=>"LDNS_PRIVATEDNS", type=>"IV", macro=>"1"},
+ {name=>"LDNS_PRIVATEOID", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RCODE_FORMERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RCODE_NOERROR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RCODE_NOTAUTH", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RCODE_NOTIMPL", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RCODE_NOTZONE", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RCODE_NXDOMAIN", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RCODE_NXRRSET", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RCODE_REFUSED", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RCODE_SERVFAIL", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RCODE_YXDOMAIN", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RCODE_YXRRSET", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_A", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_AAAA", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_ALG", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_APL", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_ATMA", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_B32_EXT", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_B64", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_CERT_ALG", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_CLASS", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_DNAME", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_HEX", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_INT16", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_INT16_DATA", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_INT32", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_INT8", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_IPSECKEY", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_LOC", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_NONE", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_NSAP", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_NSEC", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_NSEC3_NEXT_OWNER", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_NSEC3_SALT", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_PERIOD", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_SERVICE", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_STR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_TIME", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_HIP", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_TSIGTIME", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_TYPE", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_UNKNOWN", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RDF_TYPE_WKS", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_CLASS_ANY", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_CLASS_CH", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_CLASS_COUNT", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_CLASS_FIRST", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_CLASS_HS", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_CLASS_IN", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_CLASS_LAST", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_CLASS_NONE", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_COMPRESS", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_NO_COMPRESS", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_A", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_A6", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_AAAA", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_AFSDB", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_ANY", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_APL", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_ATMA", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_AXFR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_CERT", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_CNAME", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_COUNT", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_DHCID", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_DLV", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_DNAME", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_DNSKEY", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_DS", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_EID", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_FIRST", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_GID", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_GPOS", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_HINFO", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_IPSECKEY", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_ISDN", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_IXFR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_KEY", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_KX", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_LAST", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_LOC", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_MAILA", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_MAILB", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_MB", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_MD", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_MF", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_MG", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_MINFO", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_MR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_MX", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_NAPTR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_NIMLOC", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_NS", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_NSAP", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_NSAP_PTR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_NSEC", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_NSEC3", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_NSEC3PARAM", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_NSEC3PARAMS", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_NULL", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_NXT", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_OPT", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_PTR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_PX", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_RP", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_RRSIG", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_RT", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_SIG", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_SINK", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_SOA", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_SPF", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_SRV", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_SSHFP", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_TALINK", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_TSIG", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_TXT", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_UID", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_UINFO", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_UNSPEC", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_WKS", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RR_TYPE_X25", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RSAMD5", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RSASHA1", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RSASHA1_NSEC3", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RSASHA256", type=>"IV", macro=>"1"},
+ {name=>"LDNS_RSASHA512", type=>"IV", macro=>"1"},
+ {name=>"LDNS_SECTION_ADDITIONAL", type=>"IV", macro=>"1"},
+ {name=>"LDNS_SECTION_ANSWER", type=>"IV", macro=>"1"},
+ {name=>"LDNS_SECTION_ANY", type=>"IV", macro=>"1"},
+ {name=>"LDNS_SECTION_ANY_NOQUESTION", type=>"IV", macro=>"1"},
+ {name=>"LDNS_SECTION_AUTHORITY", type=>"IV", macro=>"1"},
+ {name=>"LDNS_SECTION_QUESTION", type=>"IV", macro=>"1"},
+ {name=>"LDNS_SHA1", type=>"IV", macro=>"1"},
+ {name=>"LDNS_SHA256", type=>"IV", macro=>"1"},
+ {name=>"LDNS_SHA384", type=>"IV", macro=>"1"},
+ {name=>"LDNS_SIGN_DSA", type=>"IV", macro=>"1"},
+ {name=>"LDNS_SIGN_DSA_NSEC3", type=>"IV", macro=>"1"},
+ {name=>"LDNS_SIGN_ECC_GOST", type=>"IV", macro=>"1"},
+ {name=>"LDNS_SIGN_ECDSAP384SHA384", type=>"IV", macro=>"1"},
+ {name=>"LDNS_SIGN_HMACSHA1", type=>"IV", macro=>"1"},
+ {name=>"LDNS_SIGN_HMACSHA256", type=>"IV", macro=>"1"},
+ {name=>"LDNS_SIGN_RSAMD5", type=>"IV", macro=>"1"},
+ {name=>"LDNS_SIGN_RSASHA1", type=>"IV", macro=>"1"},
+ {name=>"LDNS_SIGN_RSASHA1_NSEC3", type=>"IV", macro=>"1"},
+ {name=>"LDNS_SIGN_RSASHA256", type=>"IV", macro=>"1"},
+ {name=>"LDNS_SIGN_RSASHA512", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_ADDRESS_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_CERT_BAD_ALGORITHM", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_ALGO_NOT_IMPL", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_BOGUS", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_EXPIRATION_BEFORE_INCEPTION", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_NO_DNSKEY", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_NO_DS", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_NO_MATCHING_KEYTAG_DNSKEY", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_NO_RRSIG", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_NO_TRUSTED_DNSKEY", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_NO_TRUSTED_DS", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_SIG_EXPIRED", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_SIG_NOT_INCEPTED", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_TSIG_BOGUS", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_TSIG_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_TYPE_COVERED_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_UNKNOWN_ALGO", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_CRYPTO_VALIDATED", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_DDD_OVERFLOW", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_DNSSEC_EXISTENCE_DENIED", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_DNSSEC_NSEC3_ORIGINAL_NOT_FOUND", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_DNSSEC_NSEC_RR_NOT_COVERED", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_DNSSEC_NSEC_WILDCARD_NOT_COVERED", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_DOMAINNAME_OVERFLOW", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_DOMAINNAME_UNDERFLOW", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_EMPTY_LABEL", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_ENGINE_KEY_NOT_LOADED", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_FILE_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_INTERNAL_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_INVALID_B32_EXT", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_INVALID_B64", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_INVALID_HEX", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_INVALID_INT", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_INVALID_IP4", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_INVALID_IP6", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_INVALID_POINTER", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_INVALID_STR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_INVALID_TIME", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_LABEL_OVERFLOW", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_MEM_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_MISSING_RDATA_FIELDS_KEY", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_MISSING_RDATA_FIELDS_RRSIG", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_NETWORK_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_NOT_IMPL", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_NO_DATA", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_NSEC3_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_NULL", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_OK", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_PACKET_OVERFLOW", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_RES_NO_NS", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_RES_QUERY", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SOCKET_ERROR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SSL_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_ALG_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_BAD_ESCAPE", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_CLASS_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_DNAME_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_EMPTY", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_INCLUDE", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_INCLUDE_ERR_NOTIMPL", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_INTEGER_OVERFLOW", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_ITERATIONS_OVERFLOW", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_KEYWORD_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_ORIGIN", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_RDATA_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_TTL", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_TTL_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_TYPE_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_SYNTAX_VERSION_ERR", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_UNKNOWN_INET", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_WIRE_INCOMPLETE_ADDITIONAL", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_WIRE_INCOMPLETE_ANSWER", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_WIRE_INCOMPLETE_AUTHORITY", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_WIRE_INCOMPLETE_HEADER", type=>"IV", macro=>"1"},
+ {name=>"LDNS_STATUS_WIRE_INCOMPLETE_QUESTION", type=>"IV", macro=>"1"},
+ {name=>"endif", type=>"IV", macro=>"1"},
+ {name=>"if", type=>"IV", macro=>"1"});
+
+print constant_types(), "\n"; # macro defs
+foreach (C_constant ("LDNS", 'constant', 'IV', $types, undef, 3, @names) ) {
+ print $_, "\n"; # C constant subs
+}
+print "\n#### XS Section:\n";
+print XS_constant ("LDNS", $types);
+__END__
+ */
+
+ switch (len) {
+ case 2:
+ if (name[0] == 'i' && name[1] == 'f') {
+ *iv_return = if;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 5:
+ if (memEQ(name, "endif", 5)) {
+ *iv_return = endif;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 7:
+ return constant_7 (aTHX_ name, iv_return);
+ break;
+ case 8:
+ /* Names all of length 8. */
+ /* LDNS_DSA LDNS_ECC */
+ /* Offset 5 gives the best switch position. */
+ switch (name[5]) {
+ case 'D':
+ if (memEQ(name, "LDNS_DSA", 8)) {
+ /* ^ */
+ *iv_return = LDNS_DSA;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'E':
+ if (memEQ(name, "LDNS_ECC", 8)) {
+ /* ^ */
+ *iv_return = LDNS_ECC;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ break;
+ case 9:
+ /* Names all of length 9. */
+ /* LDNS_PORT LDNS_SHA1 */
+ /* Offset 5 gives the best switch position. */
+ switch (name[5]) {
+ case 'P':
+ if (memEQ(name, "LDNS_PORT", 9)) {
+ /* ^ */
+#ifdef LDNS_PORT
+ *iv_return = LDNS_PORT;
+ return PERL_constant_ISIV;
+#else
+ return PERL_constant_NOTDEF;
+#endif
+ }
+ break;
+ case 'S':
+ if (memEQ(name, "LDNS_SHA1", 9)) {
+ /* ^ */
+ *iv_return = LDNS_SHA1;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ break;
+ case 11:
+ return constant_11 (aTHX_ name, iv_return);
+ break;
+ case 12:
+ if (memEQ(name, "LDNS_RSASHA1", 12)) {
+ *iv_return = LDNS_RSASHA1;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 13:
+ return constant_13 (aTHX_ name, iv_return);
+ break;
+ case 14:
+ return constant_14 (aTHX_ name, iv_return);
+ break;
+ case 15:
+ return constant_15 (aTHX_ name, iv_return);
+ break;
+ case 16:
+ return constant_16 (aTHX_ name, iv_return);
+ break;
+ case 17:
+ return constant_17 (aTHX_ name, iv_return);
+ break;
+ case 18:
+ return constant_18 (aTHX_ name, iv_return);
+ break;
+ case 19:
+ return constant_19 (aTHX_ name, iv_return);
+ break;
+ case 20:
+ return constant_20 (aTHX_ name, iv_return);
+ break;
+ case 21:
+ return constant_21 (aTHX_ name, iv_return);
+ break;
+ case 22:
+ return constant_22 (aTHX_ name, iv_return);
+ break;
+ case 23:
+ return constant_23 (aTHX_ name, iv_return);
+ break;
+ case 24:
+ return constant_24 (aTHX_ name, iv_return);
+ break;
+ case 25:
+ /* Names all of length 25. */
+ /* LDNS_SIGN_ECDSAP384SHA384 LDNS_STATUS_SYNTAX_ORIGIN */
+ /* Offset 15 gives the best switch position. */
+ switch (name[15]) {
+ case 'P':
+ if (memEQ(name, "LDNS_SIGN_ECDSAP384SHA384", 25)) {
+ /* ^ */
+ *iv_return = LDNS_SIGN_ECDSAP384SHA384;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'T':
+ if (memEQ(name, "LDNS_STATUS_SYNTAX_ORIGIN", 25)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SYNTAX_ORIGIN;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ break;
+ case 26:
+ return constant_26 (aTHX_ name, iv_return);
+ break;
+ case 27:
+ return constant_27 (aTHX_ name, iv_return);
+ break;
+ case 28:
+ return constant_28 (aTHX_ name, iv_return);
+ break;
+ case 29:
+ /* Names all of length 29. */
+ /* LDNS_STATUS_CRYPTO_TSIG_BOGUS LDNS_STATUS_SYNTAX_BAD_ESCAPE */
+ /* Offset 15 gives the best switch position. */
+ switch (name[15]) {
+ case 'P':
+ if (memEQ(name, "LDNS_STATUS_CRYPTO_TSIG_BOGUS", 29)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_CRYPTO_TSIG_BOGUS;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'T':
+ if (memEQ(name, "LDNS_STATUS_SYNTAX_BAD_ESCAPE", 29)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_SYNTAX_BAD_ESCAPE;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ break;
+ case 30:
+ return constant_30 (aTHX_ name, iv_return);
+ break;
+ case 31:
+ /* Names all of length 31. */
+ /* LDNS_STATUS_CRYPTO_UNKNOWN_ALGO LDNS_STATUS_DOMAINNAME_OVERFLOW */
+ /* Offset 12 gives the best switch position. */
+ switch (name[12]) {
+ case 'C':
+ if (memEQ(name, "LDNS_STATUS_CRYPTO_UNKNOWN_ALGO", 31)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_CRYPTO_UNKNOWN_ALGO;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'D':
+ if (memEQ(name, "LDNS_STATUS_DOMAINNAME_OVERFLOW", 31)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_DOMAINNAME_OVERFLOW;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ break;
+ case 32:
+ return constant_32 (aTHX_ name, iv_return);
+ break;
+ case 33:
+ if (memEQ(name, "LDNS_STATUS_ENGINE_KEY_NOT_LOADED", 33)) {
+ *iv_return = LDNS_STATUS_ENGINE_KEY_NOT_LOADED;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 34:
+ /* Names all of length 34. */
+ /* LDNS_STATUS_WIRE_INCOMPLETE_ANSWER LDNS_STATUS_WIRE_INCOMPLETE_HEADER */
+ /* Offset 28 gives the best switch position. */
+ switch (name[28]) {
+ case 'A':
+ if (memEQ(name, "LDNS_STATUS_WIRE_INCOMPLETE_ANSWER", 34)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_WIRE_INCOMPLETE_ANSWER;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'H':
+ if (memEQ(name, "LDNS_STATUS_WIRE_INCOMPLETE_HEADER", 34)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_WIRE_INCOMPLETE_HEADER;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ break;
+ case 35:
+ return constant_35 (aTHX_ name, iv_return);
+ break;
+ case 36:
+ return constant_36 (aTHX_ name, iv_return);
+ break;
+ case 37:
+ if (memEQ(name, "LDNS_STATUS_WIRE_INCOMPLETE_AUTHORITY", 37)) {
+ *iv_return = LDNS_STATUS_WIRE_INCOMPLETE_AUTHORITY;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 38:
+ return constant_38 (aTHX_ name, iv_return);
+ break;
+ case 43:
+ if (memEQ(name, "LDNS_STATUS_DNSSEC_NSEC3_ORIGINAL_NOT_FOUND", 43)) {
+ *iv_return = LDNS_STATUS_DNSSEC_NSEC3_ORIGINAL_NOT_FOUND;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 44:
+ /* Names all of length 44. */
+ /* LDNS_STATUS_CRYPTO_NO_MATCHING_KEYTAG_DNSKEY
+ LDNS_STATUS_DNSSEC_NSEC_WILDCARD_NOT_COVERED */
+ /* Offset 12 gives the best switch position. */
+ switch (name[12]) {
+ case 'C':
+ if (memEQ(name, "LDNS_STATUS_CRYPTO_NO_MATCHING_KEYTAG_DNSKEY", 44)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_CRYPTO_NO_MATCHING_KEYTAG_DNSKEY;
+ return PERL_constant_ISIV;
+ }
+ break;
+ case 'D':
+ if (memEQ(name, "LDNS_STATUS_DNSSEC_NSEC_WILDCARD_NOT_COVERED", 44)) {
+ /* ^ */
+ *iv_return = LDNS_STATUS_DNSSEC_NSEC_WILDCARD_NOT_COVERED;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ break;
+ case 46:
+ if (memEQ(name, "LDNS_STATUS_CRYPTO_EXPIRATION_BEFORE_INCEPTION", 46)) {
+ *iv_return = LDNS_STATUS_CRYPTO_EXPIRATION_BEFORE_INCEPTION;
+ return PERL_constant_ISIV;
+ }
+ break;
+ }
+ return PERL_constant_NOTFOUND;
+}
+
diff --git a/contrib/DNS-LDNS/fallback/const-xs.inc b/contrib/DNS-LDNS/fallback/const-xs.inc
new file mode 100644
index 000000000000..1738df2243a7
--- /dev/null
+++ b/contrib/DNS-LDNS/fallback/const-xs.inc
@@ -0,0 +1,90 @@
+void
+constant(sv)
+ PREINIT:
+#ifdef dXSTARG
+ dXSTARG; /* Faster if we have it. */
+#else
+ dTARGET;
+#endif
+ STRLEN len;
+ int type;
+ IV iv;
+ /* NV nv; Uncomment this if you need to return NVs */
+ /* const char *pv; Uncomment this if you need to return PVs */
+ INPUT:
+ SV * sv;
+ const char * s = SvPV(sv, len);
+ PPCODE:
+ /* Change this to constant(aTHX_ s, len, &iv, &nv);
+ if you need to return both NVs and IVs */
+ type = constant(aTHX_ s, len, &iv);
+ /* Return 1 or 2 items. First is error message, or undef if no error.
+ Second, if present, is found value */
+ switch (type) {
+ case PERL_constant_NOTFOUND:
+ sv =
+ sv_2mortal(newSVpvf("%s is not a valid LDNS macro", s));
+ PUSHs(sv);
+ break;
+ case PERL_constant_NOTDEF:
+ sv = sv_2mortal(newSVpvf(
+ "Your vendor has not defined LDNS macro %s, used",
+ s));
+ PUSHs(sv);
+ break;
+ case PERL_constant_ISIV:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHi(iv);
+ break;
+ /* Uncomment this if you need to return NOs
+ case PERL_constant_ISNO:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHs(&PL_sv_no);
+ break; */
+ /* Uncomment this if you need to return NVs
+ case PERL_constant_ISNV:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHn(nv);
+ break; */
+ /* Uncomment this if you need to return PVs
+ case PERL_constant_ISPV:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHp(pv, strlen(pv));
+ break; */
+ /* Uncomment this if you need to return PVNs
+ case PERL_constant_ISPVN:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHp(pv, iv);
+ break; */
+ /* Uncomment this if you need to return SVs
+ case PERL_constant_ISSV:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHs(sv);
+ break; */
+ /* Uncomment this if you need to return UNDEFs
+ case PERL_constant_ISUNDEF:
+ break; */
+ /* Uncomment this if you need to return UVs
+ case PERL_constant_ISUV:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHu((UV)iv);
+ break; */
+ /* Uncomment this if you need to return YESs
+ case PERL_constant_ISYES:
+ EXTEND(SP, 1);
+ PUSHs(&PL_sv_undef);
+ PUSHs(&PL_sv_yes);
+ break; */
+ default:
+ sv = sv_2mortal(newSVpvf(
+ "Unexpected return type %d while processing LDNS macro %s, used",
+ type, s));
+ PUSHs(sv);
+ }
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS.pm b/contrib/DNS-LDNS/lib/DNS/LDNS.pm
new file mode 100644
index 000000000000..d2fe20e193b3
--- /dev/null
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS.pm
@@ -0,0 +1,1310 @@
+package DNS::LDNS;
+
+use 5.014002;
+use strict;
+use warnings;
+use Carp;
+
+require Exporter;
+use AutoLoader;
+
+our @ISA = qw(Exporter);
+
+# Items to export into callers namespace by default. Note: do not export
+# names by default without a very good reason. Use EXPORT_OK instead.
+# Do not simply export all your public functions/methods/constants.
+
+our %EXPORT_TAGS = ( 'all' => [ qw(
+ LDNS_AA
+ LDNS_AD
+ LDNS_CD
+ LDNS_CERT_ACPKIX
+ LDNS_CERT_IACPKIX
+ LDNS_CERT_IPGP
+ LDNS_CERT_IPKIX
+ LDNS_CERT_ISPKI
+ LDNS_CERT_OID
+ LDNS_CERT_PGP
+ LDNS_CERT_PKIX
+ LDNS_CERT_SPKI
+ LDNS_CERT_URI
+ LDNS_DEFAULT_EXP_TIME
+ LDNS_DEFAULT_TTL
+ LDNS_DH
+ LDNS_DNSSEC_KEYPROTO
+ LDNS_DSA
+ LDNS_DSA_NSEC3
+ LDNS_ECC
+ LDNS_ECC_GOST
+ LDNS_HASH_GOST
+ LDNS_IP4ADDRLEN
+ LDNS_IP6ADDRLEN
+ LDNS_KEY_REVOKE_KEY
+ LDNS_KEY_SEP_KEY
+ LDNS_KEY_ZONE_KEY
+ LDNS_MAX_DOMAINLEN
+ LDNS_MAX_KEYLEN
+ LDNS_MAX_LABELLEN
+ LDNS_MAX_PACKETLEN
+ LDNS_MAX_POINTERS
+ LDNS_MAX_RDFLEN
+ LDNS_NSEC3_MAX_ITERATIONS
+ LDNS_NSEC3_VARS_OPTOUT_MASK
+ LDNS_PACKET_ANSWER
+ LDNS_PACKET_IQUERY
+ LDNS_PACKET_NODATA
+ LDNS_PACKET_NOTIFY
+ LDNS_PACKET_NXDOMAIN
+ LDNS_PACKET_QUERY
+ LDNS_PACKET_QUESTION
+ LDNS_PACKET_REFERRAL
+ LDNS_PACKET_STATUS
+ LDNS_PACKET_UNKNOWN
+ LDNS_PACKET_UPDATE
+ LDNS_PORT
+ LDNS_PRIVATEDNS
+ LDNS_PRIVATEOID
+ LDNS_QR
+ LDNS_RA
+ LDNS_RCODE_FORMERR
+ LDNS_RCODE_NOERROR
+ LDNS_RCODE_NOTAUTH
+ LDNS_RCODE_NOTIMPL
+ LDNS_RCODE_NOTZONE
+ LDNS_RCODE_NXDOMAIN
+ LDNS_RCODE_NXRRSET
+ LDNS_RCODE_REFUSED
+ LDNS_RCODE_SERVFAIL
+ LDNS_RCODE_YXDOMAIN
+ LDNS_RCODE_YXRRSET
+ LDNS_RD
+ LDNS_RDATA_FIELD_DESCRIPTORS_COMMON
+ LDNS_RDF_SIZE_16BYTES
+ LDNS_RDF_SIZE_6BYTES
+ LDNS_RDF_SIZE_BYTE
+ LDNS_RDF_SIZE_DOUBLEWORD
+ LDNS_RDF_SIZE_WORD
+ LDNS_RDF_TYPE_A
+ LDNS_RDF_TYPE_AAAA
+ LDNS_RDF_TYPE_ALG
+ LDNS_RDF_TYPE_APL
+ LDNS_RDF_TYPE_ATMA
+ LDNS_RDF_TYPE_B32_EXT
+ LDNS_RDF_TYPE_B64
+ LDNS_RDF_TYPE_CERT_ALG
+ LDNS_RDF_TYPE_CLASS
+ LDNS_RDF_TYPE_DNAME
+ LDNS_RDF_TYPE_HEX
+ LDNS_RDF_TYPE_INT16
+ LDNS_RDF_TYPE_INT16_DATA
+ LDNS_RDF_TYPE_INT32
+ LDNS_RDF_TYPE_INT8
+ LDNS_RDF_TYPE_IPSECKEY
+ LDNS_RDF_TYPE_LOC
+ LDNS_RDF_TYPE_NONE
+ LDNS_RDF_TYPE_NSAP
+ LDNS_RDF_TYPE_NSEC
+ LDNS_RDF_TYPE_NSEC3_NEXT_OWNER
+ LDNS_RDF_TYPE_NSEC3_SALT
+ LDNS_RDF_TYPE_PERIOD
+ LDNS_RDF_TYPE_SERVICE
+ LDNS_RDF_TYPE_STR
+ LDNS_RDF_TYPE_TIME
+ LDNS_RDF_TYPE_HIP
+ LDNS_RDF_TYPE_TSIGTIME
+ LDNS_RDF_TYPE_TYPE
+ LDNS_RDF_TYPE_UNKNOWN
+ LDNS_RDF_TYPE_WKS
+ LDNS_RESOLV_ANCHOR
+ LDNS_RESOLV_DEFDOMAIN
+ LDNS_RESOLV_INET
+ LDNS_RESOLV_INET6
+ LDNS_RESOLV_INETANY
+ LDNS_RESOLV_KEYWORD
+ LDNS_RESOLV_KEYWORDS
+ LDNS_RESOLV_NAMESERVER
+ LDNS_RESOLV_OPTIONS
+ LDNS_RESOLV_RTT_INF
+ LDNS_RESOLV_RTT_MIN
+ LDNS_RESOLV_SEARCH
+ LDNS_RESOLV_SORTLIST
+ LDNS_RR_CLASS_ANY
+ LDNS_RR_CLASS_CH
+ LDNS_RR_CLASS_COUNT
+ LDNS_RR_CLASS_FIRST
+ LDNS_RR_CLASS_HS
+ LDNS_RR_CLASS_IN
+ LDNS_RR_CLASS_LAST
+ LDNS_RR_CLASS_NONE
+ LDNS_RR_COMPRESS
+ LDNS_RR_NO_COMPRESS
+ LDNS_RR_OVERHEAD
+ LDNS_RR_TYPE_A
+ LDNS_RR_TYPE_A6
+ LDNS_RR_TYPE_AAAA
+ LDNS_RR_TYPE_AFSDB
+ LDNS_RR_TYPE_ANY
+ LDNS_RR_TYPE_APL
+ LDNS_RR_TYPE_ATMA
+ LDNS_RR_TYPE_AXFR
+ LDNS_RR_TYPE_CERT
+ LDNS_RR_TYPE_CNAME
+ LDNS_RR_TYPE_COUNT
+ LDNS_RR_TYPE_DHCID
+ LDNS_RR_TYPE_DLV
+ LDNS_RR_TYPE_DNAME
+ LDNS_RR_TYPE_DNSKEY
+ LDNS_RR_TYPE_DS
+ LDNS_RR_TYPE_EID
+ LDNS_RR_TYPE_FIRST
+ LDNS_RR_TYPE_GID
+ LDNS_RR_TYPE_GPOS
+ LDNS_RR_TYPE_HINFO
+ LDNS_RR_TYPE_IPSECKEY
+ LDNS_RR_TYPE_ISDN
+ LDNS_RR_TYPE_IXFR
+ LDNS_RR_TYPE_KEY
+ LDNS_RR_TYPE_KX
+ LDNS_RR_TYPE_LAST
+ LDNS_RR_TYPE_LOC
+ LDNS_RR_TYPE_MAILA
+ LDNS_RR_TYPE_MAILB
+ LDNS_RR_TYPE_MB
+ LDNS_RR_TYPE_MD
+ LDNS_RR_TYPE_MF
+ LDNS_RR_TYPE_MG
+ LDNS_RR_TYPE_MINFO
+ LDNS_RR_TYPE_MR
+ LDNS_RR_TYPE_MX
+ LDNS_RR_TYPE_NAPTR
+ LDNS_RR_TYPE_NIMLOC
+ LDNS_RR_TYPE_NS
+ LDNS_RR_TYPE_NSAP
+ LDNS_RR_TYPE_NSAP_PTR
+ LDNS_RR_TYPE_NSEC
+ LDNS_RR_TYPE_NSEC3
+ LDNS_RR_TYPE_NSEC3PARAM
+ LDNS_RR_TYPE_NSEC3PARAMS
+ LDNS_RR_TYPE_NULL
+ LDNS_RR_TYPE_NXT
+ LDNS_RR_TYPE_OPT
+ LDNS_RR_TYPE_PTR
+ LDNS_RR_TYPE_PX
+ LDNS_RR_TYPE_RP
+ LDNS_RR_TYPE_RRSIG
+ LDNS_RR_TYPE_RT
+ LDNS_RR_TYPE_SIG
+ LDNS_RR_TYPE_SINK
+ LDNS_RR_TYPE_SOA
+ LDNS_RR_TYPE_SPF
+ LDNS_RR_TYPE_SRV
+ LDNS_RR_TYPE_SSHFP
+ LDNS_RR_TYPE_TALINK
+ LDNS_RR_TYPE_TSIG
+ LDNS_RR_TYPE_TXT
+ LDNS_RR_TYPE_UID
+ LDNS_RR_TYPE_UINFO
+ LDNS_RR_TYPE_UNSPEC
+ LDNS_RR_TYPE_WKS
+ LDNS_RR_TYPE_X25
+ LDNS_RSAMD5
+ LDNS_RSASHA1
+ LDNS_RSASHA1_NSEC3
+ LDNS_RSASHA256
+ LDNS_RSASHA512
+ LDNS_SECTION_ADDITIONAL
+ LDNS_SECTION_ANSWER
+ LDNS_SECTION_ANY
+ LDNS_SECTION_ANY_NOQUESTION
+ LDNS_SECTION_AUTHORITY
+ LDNS_SECTION_QUESTION
+ LDNS_SHA1
+ LDNS_SHA256
+ LDNS_SIGNATURE_LEAVE_ADD_NEW
+ LDNS_SIGNATURE_LEAVE_NO_ADD
+ LDNS_SIGNATURE_REMOVE_ADD_NEW
+ LDNS_SIGNATURE_REMOVE_NO_ADD
+ LDNS_SIGN_DSA
+ LDNS_SIGN_DSA_NSEC3
+ LDNS_SIGN_ECC_GOST
+ LDNS_SIGN_HMACSHA1
+ LDNS_SIGN_HMACSHA256
+ LDNS_SIGN_RSAMD5
+ LDNS_SIGN_RSASHA1
+ LDNS_SIGN_RSASHA1_NSEC3
+ LDNS_SIGN_RSASHA256
+ LDNS_SIGN_RSASHA512
+ LDNS_STATUS_ADDRESS_ERR
+ LDNS_STATUS_CERT_BAD_ALGORITHM
+ LDNS_STATUS_CRYPTO_ALGO_NOT_IMPL
+ LDNS_STATUS_CRYPTO_BOGUS
+ LDNS_STATUS_CRYPTO_EXPIRATION_BEFORE_INCEPTION
+ LDNS_STATUS_CRYPTO_NO_DNSKEY
+ LDNS_STATUS_CRYPTO_NO_DS
+ LDNS_STATUS_CRYPTO_NO_MATCHING_KEYTAG_DNSKEY
+ LDNS_STATUS_CRYPTO_NO_RRSIG
+ LDNS_STATUS_CRYPTO_NO_TRUSTED_DNSKEY
+ LDNS_STATUS_CRYPTO_NO_TRUSTED_DS
+ LDNS_STATUS_CRYPTO_SIG_EXPIRED
+ LDNS_STATUS_CRYPTO_SIG_NOT_INCEPTED
+ LDNS_STATUS_CRYPTO_TSIG_BOGUS
+ LDNS_STATUS_CRYPTO_TSIG_ERR
+ LDNS_STATUS_CRYPTO_TYPE_COVERED_ERR
+ LDNS_STATUS_CRYPTO_UNKNOWN_ALGO
+ LDNS_STATUS_CRYPTO_VALIDATED
+ LDNS_STATUS_DDD_OVERFLOW
+ LDNS_STATUS_DNSSEC_EXISTENCE_DENIED
+ LDNS_STATUS_DNSSEC_NSEC3_ORIGINAL_NOT_FOUND
+ LDNS_STATUS_DNSSEC_NSEC_RR_NOT_COVERED
+ LDNS_STATUS_DNSSEC_NSEC_WILDCARD_NOT_COVERED
+ LDNS_STATUS_DOMAINNAME_OVERFLOW
+ LDNS_STATUS_DOMAINNAME_UNDERFLOW
+ LDNS_STATUS_EMPTY_LABEL
+ LDNS_STATUS_ENGINE_KEY_NOT_LOADED
+ LDNS_STATUS_ERR
+ LDNS_STATUS_FILE_ERR
+ LDNS_STATUS_INTERNAL_ERR
+ LDNS_STATUS_INVALID_B32_EXT
+ LDNS_STATUS_INVALID_B64
+ LDNS_STATUS_INVALID_HEX
+ LDNS_STATUS_INVALID_INT
+ LDNS_STATUS_INVALID_IP4
+ LDNS_STATUS_INVALID_IP6
+ LDNS_STATUS_INVALID_POINTER
+ LDNS_STATUS_INVALID_STR
+ LDNS_STATUS_INVALID_TIME
+ LDNS_STATUS_LABEL_OVERFLOW
+ LDNS_STATUS_MEM_ERR
+ LDNS_STATUS_MISSING_RDATA_FIELDS_KEY
+ LDNS_STATUS_MISSING_RDATA_FIELDS_RRSIG
+ LDNS_STATUS_NETWORK_ERR
+ LDNS_STATUS_NOT_IMPL
+ LDNS_STATUS_NO_DATA
+ LDNS_STATUS_NSEC3_ERR
+ LDNS_STATUS_NULL
+ LDNS_STATUS_OK
+ LDNS_STATUS_PACKET_OVERFLOW
+ LDNS_STATUS_RES_NO_NS
+ LDNS_STATUS_RES_QUERY
+ LDNS_STATUS_SOCKET_ERROR
+ LDNS_STATUS_SSL_ERR
+ LDNS_STATUS_SYNTAX_ALG_ERR
+ LDNS_STATUS_SYNTAX_BAD_ESCAPE
+ LDNS_STATUS_SYNTAX_CLASS_ERR
+ LDNS_STATUS_SYNTAX_DNAME_ERR
+ LDNS_STATUS_SYNTAX_EMPTY
+ LDNS_STATUS_SYNTAX_ERR
+ LDNS_STATUS_SYNTAX_INCLUDE
+ LDNS_STATUS_SYNTAX_INCLUDE_ERR_NOTIMPL
+ LDNS_STATUS_SYNTAX_INTEGER_OVERFLOW
+ LDNS_STATUS_SYNTAX_ITERATIONS_OVERFLOW
+ LDNS_STATUS_SYNTAX_KEYWORD_ERR
+ LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR
+ LDNS_STATUS_SYNTAX_ORIGIN
+ LDNS_STATUS_SYNTAX_RDATA_ERR
+ LDNS_STATUS_SYNTAX_TTL
+ LDNS_STATUS_SYNTAX_TTL_ERR
+ LDNS_STATUS_SYNTAX_TYPE_ERR
+ LDNS_STATUS_SYNTAX_VERSION_ERR
+ LDNS_STATUS_UNKNOWN_INET
+ LDNS_STATUS_WIRE_INCOMPLETE_ADDITIONAL
+ LDNS_STATUS_WIRE_INCOMPLETE_ANSWER
+ LDNS_STATUS_WIRE_INCOMPLETE_AUTHORITY
+ LDNS_STATUS_WIRE_INCOMPLETE_HEADER
+ LDNS_STATUS_WIRE_INCOMPLETE_QUESTION
+ LDNS_TC
+
+ dnssec_create_nsec
+ dnssec_create_nsec3
+ create_nsec
+ create_nsec3
+
+ rr_type2str
+ rr_class2str
+ rr_type_by_name
+ rr_class_by_name
+ pkt_opcode2str
+ pkt_rcode2str
+
+ errorstr_by_id
+ signing_algorithm_by_name
+ key_algorithm_supported
+ read_anchor_file
+) ] );
+
+our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
+
+our @EXPORT = qw(
+ LDNS_AA
+ LDNS_AD
+ LDNS_CD
+ LDNS_CERT_ACPKIX
+ LDNS_CERT_IACPKIX
+ LDNS_CERT_IPGP
+ LDNS_CERT_IPKIX
+ LDNS_CERT_ISPKI
+ LDNS_CERT_OID
+ LDNS_CERT_PGP
+ LDNS_CERT_PKIX
+ LDNS_CERT_SPKI
+ LDNS_CERT_URI
+ LDNS_DEFAULT_EXP_TIME
+ LDNS_DEFAULT_TTL
+ LDNS_DH
+ LDNS_DNSSEC_KEYPROTO
+ LDNS_DSA
+ LDNS_DSA_NSEC3
+ LDNS_ECC
+ LDNS_ECC_GOST
+ LDNS_HASH_GOST
+ LDNS_IP4ADDRLEN
+ LDNS_IP6ADDRLEN
+ LDNS_KEY_REVOKE_KEY
+ LDNS_KEY_SEP_KEY
+ LDNS_KEY_ZONE_KEY
+ LDNS_MAX_DOMAINLEN
+ LDNS_MAX_KEYLEN
+ LDNS_MAX_LABELLEN
+ LDNS_MAX_PACKETLEN
+ LDNS_MAX_POINTERS
+ LDNS_MAX_RDFLEN
+ LDNS_NSEC3_MAX_ITERATIONS
+ LDNS_NSEC3_VARS_OPTOUT_MASK
+ LDNS_PACKET_ANSWER
+ LDNS_PACKET_IQUERY
+ LDNS_PACKET_NODATA
+ LDNS_PACKET_NOTIFY
+ LDNS_PACKET_NXDOMAIN
+ LDNS_PACKET_QUERY
+ LDNS_PACKET_QUESTION
+ LDNS_PACKET_REFERRAL
+ LDNS_PACKET_STATUS
+ LDNS_PACKET_UNKNOWN
+ LDNS_PACKET_UPDATE
+ LDNS_PORT
+ LDNS_PRIVATEDNS
+ LDNS_PRIVATEOID
+ LDNS_QR
+ LDNS_RA
+ LDNS_RCODE_FORMERR
+ LDNS_RCODE_NOERROR
+ LDNS_RCODE_NOTAUTH
+ LDNS_RCODE_NOTIMPL
+ LDNS_RCODE_NOTZONE
+ LDNS_RCODE_NXDOMAIN
+ LDNS_RCODE_NXRRSET
+ LDNS_RCODE_REFUSED
+ LDNS_RCODE_SERVFAIL
+ LDNS_RCODE_YXDOMAIN
+ LDNS_RCODE_YXRRSET
+ LDNS_RD
+ LDNS_RDATA_FIELD_DESCRIPTORS_COMMON
+ LDNS_RDF_SIZE_16BYTES
+ LDNS_RDF_SIZE_6BYTES
+ LDNS_RDF_SIZE_BYTE
+ LDNS_RDF_SIZE_DOUBLEWORD
+ LDNS_RDF_SIZE_WORD
+ LDNS_RDF_TYPE_A
+ LDNS_RDF_TYPE_AAAA
+ LDNS_RDF_TYPE_ALG
+ LDNS_RDF_TYPE_APL
+ LDNS_RDF_TYPE_ATMA
+ LDNS_RDF_TYPE_B32_EXT
+ LDNS_RDF_TYPE_B64
+ LDNS_RDF_TYPE_CERT_ALG
+ LDNS_RDF_TYPE_CLASS
+ LDNS_RDF_TYPE_DNAME
+ LDNS_RDF_TYPE_HEX
+ LDNS_RDF_TYPE_INT16
+ LDNS_RDF_TYPE_INT16_DATA
+ LDNS_RDF_TYPE_INT32
+ LDNS_RDF_TYPE_INT8
+ LDNS_RDF_TYPE_IPSECKEY
+ LDNS_RDF_TYPE_LOC
+ LDNS_RDF_TYPE_NONE
+ LDNS_RDF_TYPE_NSAP
+ LDNS_RDF_TYPE_NSEC
+ LDNS_RDF_TYPE_NSEC3_NEXT_OWNER
+ LDNS_RDF_TYPE_NSEC3_SALT
+ LDNS_RDF_TYPE_PERIOD
+ LDNS_RDF_TYPE_SERVICE
+ LDNS_RDF_TYPE_STR
+ LDNS_RDF_TYPE_TIME
+ LDNS_RDF_TYPE_HIP
+ LDNS_RDF_TYPE_TSIGTIME
+ LDNS_RDF_TYPE_TYPE
+ LDNS_RDF_TYPE_UNKNOWN
+ LDNS_RDF_TYPE_WKS
+ LDNS_RESOLV_ANCHOR
+ LDNS_RESOLV_DEFDOMAIN
+ LDNS_RESOLV_INET
+ LDNS_RESOLV_INET6
+ LDNS_RESOLV_INETANY
+ LDNS_RESOLV_KEYWORD
+ LDNS_RESOLV_KEYWORDS
+ LDNS_RESOLV_NAMESERVER
+ LDNS_RESOLV_OPTIONS
+ LDNS_RESOLV_RTT_INF
+ LDNS_RESOLV_RTT_MIN
+ LDNS_RESOLV_SEARCH
+ LDNS_RESOLV_SORTLIST
+ LDNS_RR_CLASS_ANY
+ LDNS_RR_CLASS_CH
+ LDNS_RR_CLASS_COUNT
+ LDNS_RR_CLASS_FIRST
+ LDNS_RR_CLASS_HS
+ LDNS_RR_CLASS_IN
+ LDNS_RR_CLASS_LAST
+ LDNS_RR_CLASS_NONE
+ LDNS_RR_COMPRESS
+ LDNS_RR_NO_COMPRESS
+ LDNS_RR_OVERHEAD
+ LDNS_RR_TYPE_A
+ LDNS_RR_TYPE_A6
+ LDNS_RR_TYPE_AAAA
+ LDNS_RR_TYPE_AFSDB
+ LDNS_RR_TYPE_ANY
+ LDNS_RR_TYPE_APL
+ LDNS_RR_TYPE_ATMA
+ LDNS_RR_TYPE_AXFR
+ LDNS_RR_TYPE_CERT
+ LDNS_RR_TYPE_CNAME
+ LDNS_RR_TYPE_COUNT
+ LDNS_RR_TYPE_DHCID
+ LDNS_RR_TYPE_DLV
+ LDNS_RR_TYPE_DNAME
+ LDNS_RR_TYPE_DNSKEY
+ LDNS_RR_TYPE_DS
+ LDNS_RR_TYPE_EID
+ LDNS_RR_TYPE_FIRST
+ LDNS_RR_TYPE_GID
+ LDNS_RR_TYPE_GPOS
+ LDNS_RR_TYPE_HINFO
+ LDNS_RR_TYPE_IPSECKEY
+ LDNS_RR_TYPE_ISDN
+ LDNS_RR_TYPE_IXFR
+ LDNS_RR_TYPE_KEY
+ LDNS_RR_TYPE_KX
+ LDNS_RR_TYPE_LAST
+ LDNS_RR_TYPE_LOC
+ LDNS_RR_TYPE_MAILA
+ LDNS_RR_TYPE_MAILB
+ LDNS_RR_TYPE_MB
+ LDNS_RR_TYPE_MD
+ LDNS_RR_TYPE_MF
+ LDNS_RR_TYPE_MG
+ LDNS_RR_TYPE_MINFO
+ LDNS_RR_TYPE_MR
+ LDNS_RR_TYPE_MX
+ LDNS_RR_TYPE_NAPTR
+ LDNS_RR_TYPE_NIMLOC
+ LDNS_RR_TYPE_NS
+ LDNS_RR_TYPE_NSAP
+ LDNS_RR_TYPE_NSAP_PTR
+ LDNS_RR_TYPE_NSEC
+ LDNS_RR_TYPE_NSEC3
+ LDNS_RR_TYPE_NSEC3PARAM
+ LDNS_RR_TYPE_NSEC3PARAMS
+ LDNS_RR_TYPE_NULL
+ LDNS_RR_TYPE_NXT
+ LDNS_RR_TYPE_OPT
+ LDNS_RR_TYPE_PTR
+ LDNS_RR_TYPE_PX
+ LDNS_RR_TYPE_RP
+ LDNS_RR_TYPE_RRSIG
+ LDNS_RR_TYPE_RT
+ LDNS_RR_TYPE_SIG
+ LDNS_RR_TYPE_SINK
+ LDNS_RR_TYPE_SOA
+ LDNS_RR_TYPE_SPF
+ LDNS_RR_TYPE_SRV
+ LDNS_RR_TYPE_SSHFP
+ LDNS_RR_TYPE_TALINK
+ LDNS_RR_TYPE_TSIG
+ LDNS_RR_TYPE_TXT
+ LDNS_RR_TYPE_UID
+ LDNS_RR_TYPE_UINFO
+ LDNS_RR_TYPE_UNSPEC
+ LDNS_RR_TYPE_WKS
+ LDNS_RR_TYPE_X25
+ LDNS_RSAMD5
+ LDNS_RSASHA1
+ LDNS_RSASHA1_NSEC3
+ LDNS_RSASHA256
+ LDNS_RSASHA512
+ LDNS_SECTION_ADDITIONAL
+ LDNS_SECTION_ANSWER
+ LDNS_SECTION_ANY
+ LDNS_SECTION_ANY_NOQUESTION
+ LDNS_SECTION_AUTHORITY
+ LDNS_SECTION_QUESTION
+ LDNS_SHA1
+ LDNS_SHA256
+ LDNS_SIGNATURE_LEAVE_ADD_NEW
+ LDNS_SIGNATURE_LEAVE_NO_ADD
+ LDNS_SIGNATURE_REMOVE_ADD_NEW
+ LDNS_SIGNATURE_REMOVE_NO_ADD
+ LDNS_SIGN_DSA
+ LDNS_SIGN_DSA_NSEC3
+ LDNS_SIGN_ECC_GOST
+ LDNS_SIGN_HMACSHA1
+ LDNS_SIGN_HMACSHA256
+ LDNS_SIGN_RSAMD5
+ LDNS_SIGN_RSASHA1
+ LDNS_SIGN_RSASHA1_NSEC3
+ LDNS_SIGN_RSASHA256
+ LDNS_SIGN_RSASHA512
+ LDNS_STATUS_ADDRESS_ERR
+ LDNS_STATUS_CERT_BAD_ALGORITHM
+ LDNS_STATUS_CRYPTO_ALGO_NOT_IMPL
+ LDNS_STATUS_CRYPTO_BOGUS
+ LDNS_STATUS_CRYPTO_EXPIRATION_BEFORE_INCEPTION
+ LDNS_STATUS_CRYPTO_NO_DNSKEY
+ LDNS_STATUS_CRYPTO_NO_DS
+ LDNS_STATUS_CRYPTO_NO_MATCHING_KEYTAG_DNSKEY
+ LDNS_STATUS_CRYPTO_NO_RRSIG
+ LDNS_STATUS_CRYPTO_NO_TRUSTED_DNSKEY
+ LDNS_STATUS_CRYPTO_NO_TRUSTED_DS
+ LDNS_STATUS_CRYPTO_SIG_EXPIRED
+ LDNS_STATUS_CRYPTO_SIG_NOT_INCEPTED
+ LDNS_STATUS_CRYPTO_TSIG_BOGUS
+ LDNS_STATUS_CRYPTO_TSIG_ERR
+ LDNS_STATUS_CRYPTO_TYPE_COVERED_ERR
+ LDNS_STATUS_CRYPTO_UNKNOWN_ALGO
+ LDNS_STATUS_CRYPTO_VALIDATED
+ LDNS_STATUS_DDD_OVERFLOW
+ LDNS_STATUS_DNSSEC_EXISTENCE_DENIED
+ LDNS_STATUS_DNSSEC_NSEC3_ORIGINAL_NOT_FOUND
+ LDNS_STATUS_DNSSEC_NSEC_RR_NOT_COVERED
+ LDNS_STATUS_DNSSEC_NSEC_WILDCARD_NOT_COVERED
+ LDNS_STATUS_DOMAINNAME_OVERFLOW
+ LDNS_STATUS_DOMAINNAME_UNDERFLOW
+ LDNS_STATUS_EMPTY_LABEL
+ LDNS_STATUS_ENGINE_KEY_NOT_LOADED
+ LDNS_STATUS_ERR
+ LDNS_STATUS_FILE_ERR
+ LDNS_STATUS_INTERNAL_ERR
+ LDNS_STATUS_INVALID_B32_EXT
+ LDNS_STATUS_INVALID_B64
+ LDNS_STATUS_INVALID_HEX
+ LDNS_STATUS_INVALID_INT
+ LDNS_STATUS_INVALID_IP4
+ LDNS_STATUS_INVALID_IP6
+ LDNS_STATUS_INVALID_POINTER
+ LDNS_STATUS_INVALID_STR
+ LDNS_STATUS_INVALID_TIME
+ LDNS_STATUS_LABEL_OVERFLOW
+ LDNS_STATUS_MEM_ERR
+ LDNS_STATUS_MISSING_RDATA_FIELDS_KEY
+ LDNS_STATUS_MISSING_RDATA_FIELDS_RRSIG
+ LDNS_STATUS_NETWORK_ERR
+ LDNS_STATUS_NOT_IMPL
+ LDNS_STATUS_NO_DATA
+ LDNS_STATUS_NSEC3_ERR
+ LDNS_STATUS_NULL
+ LDNS_STATUS_OK
+ LDNS_STATUS_PACKET_OVERFLOW
+ LDNS_STATUS_RES_NO_NS
+ LDNS_STATUS_RES_QUERY
+ LDNS_STATUS_SOCKET_ERROR
+ LDNS_STATUS_SSL_ERR
+ LDNS_STATUS_SYNTAX_ALG_ERR
+ LDNS_STATUS_SYNTAX_BAD_ESCAPE
+ LDNS_STATUS_SYNTAX_CLASS_ERR
+ LDNS_STATUS_SYNTAX_DNAME_ERR
+ LDNS_STATUS_SYNTAX_EMPTY
+ LDNS_STATUS_SYNTAX_ERR
+ LDNS_STATUS_SYNTAX_INCLUDE
+ LDNS_STATUS_SYNTAX_INCLUDE_ERR_NOTIMPL
+ LDNS_STATUS_SYNTAX_INTEGER_OVERFLOW
+ LDNS_STATUS_SYNTAX_ITERATIONS_OVERFLOW
+ LDNS_STATUS_SYNTAX_KEYWORD_ERR
+ LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR
+ LDNS_STATUS_SYNTAX_ORIGIN
+ LDNS_STATUS_SYNTAX_RDATA_ERR
+ LDNS_STATUS_SYNTAX_TTL
+ LDNS_STATUS_SYNTAX_TTL_ERR
+ LDNS_STATUS_SYNTAX_TYPE_ERR
+ LDNS_STATUS_SYNTAX_VERSION_ERR
+ LDNS_STATUS_UNKNOWN_INET
+ LDNS_STATUS_WIRE_INCOMPLETE_ADDITIONAL
+ LDNS_STATUS_WIRE_INCOMPLETE_ANSWER
+ LDNS_STATUS_WIRE_INCOMPLETE_AUTHORITY
+ LDNS_STATUS_WIRE_INCOMPLETE_HEADER
+ LDNS_STATUS_WIRE_INCOMPLETE_QUESTION
+ LDNS_TC
+
+ dnssec_create_nsec
+ dnssec_create_nsec3
+ create_nsec
+ create_nsec3
+
+ rr_type2str
+ rr_class2str
+ pkt_opcode2str
+ pkt_rcode2str
+ rr_type_by_name
+ rr_class_by_name
+ errorstr_by_id
+ signing_algorithm_by_name
+ key_algorithm_supported
+ read_anchor_file
+);
+
+our $VERSION = '0.06';
+
+sub AUTOLOAD {
+ # This AUTOLOAD is used to 'autoload' constants from the constant()
+ # XS function.
+
+ my $constname;
+ our $AUTOLOAD;
+ ($constname = $AUTOLOAD) =~ s/.*:://;
+ croak "&DNS::LDNS::constant not defined" if $constname eq 'constant';
+ my ($error, $val) = constant($constname);
+ if ($error) { croak $error; }
+ {
+ no strict 'refs';
+ # Fixed between 5.005_53 and 5.005_61
+#XXX if ($] >= 5.00561) {
+#XXX *$AUTOLOAD = sub () { $val };
+#XXX }
+#XXX else {
+ *$AUTOLOAD = sub { $val };
+#XXX }
+ }
+ goto &$AUTOLOAD;
+}
+
+require XSLoader;
+XSLoader::load('DNS::LDNS', $VERSION);
+
+# Preloaded methods go here.
+
+our $last_status;
+our $line_nr;
+
+sub last_error {
+ return errorstr_by_id($DNS::LDNS::last_status);
+}
+
+require DNS::LDNS::RR;
+require DNS::LDNS::GC;
+require DNS::LDNS::RData;
+require DNS::LDNS::Zone;
+require DNS::LDNS::RRList;
+require DNS::LDNS::DNSSecZone;
+require DNS::LDNS::DNSSecRRSets;
+require DNS::LDNS::DNSSecRRs;
+require DNS::LDNS::DNSSecName;
+require DNS::LDNS::RBTree;
+require DNS::LDNS::RBNode;
+require DNS::LDNS::Resolver;
+require DNS::LDNS::Packet;
+require DNS::LDNS::Key;
+require DNS::LDNS::KeyList;
+require DNS::LDNS::DNSSecDataChain;
+require DNS::LDNS::DNSSecTrustTree;
+
+# Some default values used by the constructors
+our $DEFAULT_CLASS = &LDNS_RR_CLASS_IN;
+our $DEFAULT_TTL = 86400; # 1d
+our $DEFAULT_ORIGIN = new DNS::LDNS::RData(&LDNS_RDF_TYPE_DNAME, '.');
+our $DEFAULT_SOA_REFRESH = 86400; # 1d
+our $DEFAULT_SOA_RETRY = 3600; # 1h
+our $DEFAULT_SOA_EXPIRE = 604800; # 1w
+our $DEFAULT_SOA_MINIMUM = 10800; # 3h
+
+# Autoload methods go after =cut, and are processed by the autosplit program.
+
+1;
+__END__
+
+=head1 NAME
+
+DNS::LDNS - Perl extension for the ldns library
+
+=head1 SYNOPSIS
+
+ use DNS::LDNS ':all'
+
+=head1 DESCRIPTION
+
+DNS::LDNS is a perl OO-wrapper for the ldns library. A complete list
+of object methods is found in the perldoc for each of the individual
+classes. You may also read the documentation of the ldns library
+(http://www.nlnetlabs.nl/projects/ldns).
+
+=head2 Brief examples of usage
+
+ use DNS::LDNS ':all';
+
+ my $z = new DNS::LDNS::Zone(filename => '/path/to/myzone');
+ print DNS::LDNS::last_error;
+ my $rr = new DNS::LDNS::RR('mylabel 3600 IN A 168.10.10.10');
+ print $z->soa->to_string;
+ my $rrlist = $z->rrs->push($rr);
+ print $z->to_string;
+
+ my $kl = new DNS::LDNS::KeyList;
+ $kl->push(new DNS::LDNS::Key(filename => 'key');
+ $kl->key(0)->set_pubkey_owner(
+ new DNS::LDNS::RData(LDNS_RDF_TYPE_DNAME, 'myzone.org'));
+ my $signedz = $z->sign($kl);
+ print $signedz->to_string;
+
+ my $r = new DNS::LDNS::Resolver(filename => '/my/resolv.conf');
+ my $p = $r->send(
+ new DNS::LDNS::RData(LDNS_RDF_TYPE_DNAME, 'www.google.com'),
+ LDNS_RR_TYPE_A, LDNS_RR_CLASS_IN, LDNS_RD);
+ print $p->answer->to_string;
+ print $p->authority->to_string;
+
+=head2 Classes
+
+A description of the classes included and how they map to the ldns
+library structures:
+
+=over 20
+
+=item B<DNS::LDNS>
+
+Base class with static functions and constants
+
+=item B<DNS::LDNS::Zone>
+
+Represents a parsed zonefile (maps to the ldns_zone struct)
+
+=item B<DNS::LDNS::RRList>
+
+Represents a list of RRs. This class is also used to represent an
+RRSet all the dnames and types are equal, (maps to the the
+ldns_rr_list struct)
+
+=item B<DNS::LDNS::RR>
+
+Represents a resource record (RR), (maps to the ldns_rr struct)
+
+=item B<DNS::LDNS::RData>
+
+Represents an rdata field or a dname in an RR (maps to the ldns_rdf
+struct)
+
+=item B<DNS::LDNS::Resolver>
+
+Represents a DNS resolver (maps to the ldns_resolver struct)
+
+=item B<DNS::LDNS::Packet>
+
+Represents a DNS package (maps to the ldns_pkt struct)
+
+=item B<DNS::LDNS::Key>
+
+Represents a DNSSec private key (maps to the ldns_key struct)
+
+=item B<DNS::LDNS::KeyList>
+
+Represents a linked list of keys (maps to the ldns_key_list struct)
+
+=item B<DNS::LDNS::DNSSecZone>
+
+Represents a zone with dnssec data (maps to the ldns_dnssec_zone
+struct)
+
+=item B<DNS::LDNS::RBTree>
+
+Represents a tree of DNSSecName nodes (maps to the ldns_rbtree struct)
+
+=item B<DNS::LDNS::RBNode>
+
+Represents a node in the RBTree (maps to the ldns_rbnode struct)
+
+=item B<DNS::LDNS::DNSSecName>
+
+Represents a dname in a DNSSecZone and holds a DNSSecRRSets list for
+this dname, possibly with signatures (maps to the ldns_dnssec_name
+struct)
+
+=item B<DNS::LDNS::DNSSecRRSets>
+
+Represents a linked list of DNSSec RR sets, possibly with signatures
+(maps to the ldns_dnssec_rrsets struct)
+
+=item B<DNS::LDNS::DNSSecRRs>
+
+Represents a linked list of RRs (maps to the ldns_dnssec_rrs struct)
+
+=item B<DNS::LDNS::DNSSecDataChain>
+
+Represents a chain of RR, DNSKEY, and DS data used for building a
+dnssec trust tree (maps to the ldns_dnssec_data_chain struct)
+
+=item B<DNS::LDNS::DNSSecTrustTree>
+
+Represents a tree of chained trust relationships from a signed RR to a
+set of trust anchors (maps to the ldns_dnssec_trust_tree struct).
+
+=item B<DNS::LDNS::GC>
+
+Garbage collector. Handles ownership dependencies and freeing data
+used by the other classes. Used internally only.
+
+=back
+
+One thing to note is that some of the classes have a seemingly
+overlapping functionality. The Zone and RRList are used to represent
+a generic zone. It may contain dnssec data but treats it like any
+other dns data and does not have any knowledge of its structure. The
+DNSSec* and RB* classes are building blocks for representing a signed
+zone in a more structured way.
+
+=head2 Static functions
+
+ str = rr_type2str(type)
+ str = rr_class2str(class)
+ type = rr_type_by_name(str)
+ class = rr_class_by_name(str)
+ str = pkt_opcode2str(opcode)
+ str = pkt_rcode2str(rcode)
+ error = errorstr_by_id(status)
+ str = DNS::LDNS::last_error
+ status = DNS::LDNS::last_status
+ rr = dnssec_create_nsec(from, to, type)
+ rr = dnssec_create_nsec3(from, to, algorithm, flags, iterations, salt)
+ rr = create_nsec(current, next, rrs)
+ rr = create_nsec3(cur_owner, cur_zone, algorithm, flags,
+ iterations, salt, empty_nonterminals)
+ algo = signing_algorithm_by_name(name)
+ bool = key_algorithm_supported(algorithm)
+ rr = read_anchor_file(filename)
+
+=head2 Object references and cloning
+
+Since some of the objects are found as sub objects within other
+objects, it is important to know how the wrapper classes handle
+object references, dependencies and cloning. The general rule is that
+accessor methods just return a reference to the object while methods
+inserting data inserts inserts a clone of the object. Most classes
+have a clone method which can be used if a cloned object is what you
+really want.
+
+=head3 Examples
+
+DNS::LDNS::Zone::rrs returns a reference to the DNS::LDNS::RRList
+within the zone, so if you make changes to the RRList you also
+changes the Zone object.
+
+DNS::LDNS::RRList::push(rr) clones the rr, then pushes the cloned rr
+to the list. Changing the rr afterwards will not change the list.
+
+An exception is the Key class which does not have a clone
+mechanism. In this case we allow a free Key to be added to only one
+KeyList. Adding it to multiple lists will provoke an error.
+
+The wrapper keeps track of allocated data structures and references.
+Whenever data is no longer referred to by a perl object, it will be
+freed.
+
+=head2 ERROR HANDLING
+
+The purpose for writing this wrapper class has been to be able to
+process zone file data with good time performance. Data checking and
+error handling is a bit sparse. Calling a method with wrong argument
+types will some times kill the application with an intelligible error
+message, in other cases it may provoke a segmentation fault. Using
+out-of-range data values, e.g. in array indexes, may also cause
+unexpected results.
+
+Most constructors and all methods returning a status will update the
+static DNS::LDNS::last_status variable. Most methods do not return a
+status and will not reset this variable even though they succeeds.
+
+=head2 EXPORT
+
+None by default.
+
+=head2 Exportable constants
+
+=head3 Status
+
+ LDNS_STATUS_ADDRESS_ERR
+ LDNS_STATUS_CERT_BAD_ALGORITHM
+ LDNS_STATUS_CRYPTO_ALGO_NOT_IMPL
+ LDNS_STATUS_CRYPTO_BOGUS
+ LDNS_STATUS_CRYPTO_EXPIRATION_BEFORE_INCEPTION
+ LDNS_STATUS_CRYPTO_NO_DNSKEY
+ LDNS_STATUS_CRYPTO_NO_DS
+ LDNS_STATUS_CRYPTO_NO_MATCHING_KEYTAG_DNSKEY
+ LDNS_STATUS_CRYPTO_NO_RRSIG
+ LDNS_STATUS_CRYPTO_NO_TRUSTED_DNSKEY
+ LDNS_STATUS_CRYPTO_NO_TRUSTED_DS
+ LDNS_STATUS_CRYPTO_SIG_EXPIRED
+ LDNS_STATUS_CRYPTO_SIG_NOT_INCEPTED
+ LDNS_STATUS_CRYPTO_TSIG_BOGUS
+ LDNS_STATUS_CRYPTO_TSIG_ERR
+ LDNS_STATUS_CRYPTO_TYPE_COVERED_ERR
+ LDNS_STATUS_CRYPTO_UNKNOWN_ALGO
+ LDNS_STATUS_CRYPTO_VALIDATED
+ LDNS_STATUS_DDD_OVERFLOW
+ LDNS_STATUS_DNSSEC_EXISTENCE_DENIED
+ LDNS_STATUS_DNSSEC_NSEC3_ORIGINAL_NOT_FOUND
+ LDNS_STATUS_DNSSEC_NSEC_RR_NOT_COVERED
+ LDNS_STATUS_DNSSEC_NSEC_WILDCARD_NOT_COVERED
+ LDNS_STATUS_DOMAINNAME_OVERFLOW
+ LDNS_STATUS_DOMAINNAME_UNDERFLOW
+ LDNS_STATUS_EMPTY_LABEL
+ LDNS_STATUS_ENGINE_KEY_NOT_LOADED
+ LDNS_STATUS_ERR
+ LDNS_STATUS_FILE_ERR
+ LDNS_STATUS_INTERNAL_ERR
+ LDNS_STATUS_INVALID_B32_EXT
+ LDNS_STATUS_INVALID_B64
+ LDNS_STATUS_INVALID_HEX
+ LDNS_STATUS_INVALID_INT
+ LDNS_STATUS_INVALID_IP4
+ LDNS_STATUS_INVALID_IP6
+ LDNS_STATUS_INVALID_POINTER
+ LDNS_STATUS_INVALID_STR
+ LDNS_STATUS_INVALID_TIME
+ LDNS_STATUS_LABEL_OVERFLOW
+ LDNS_STATUS_MEM_ERR
+ LDNS_STATUS_MISSING_RDATA_FIELDS_KEY
+ LDNS_STATUS_MISSING_RDATA_FIELDS_RRSIG
+ LDNS_STATUS_NETWORK_ERR
+ LDNS_STATUS_NOT_IMPL
+ LDNS_STATUS_NO_DATA
+ LDNS_STATUS_NSEC3_ERR
+ LDNS_STATUS_NULL
+ LDNS_STATUS_OK
+ LDNS_STATUS_PACKET_OVERFLOW
+ LDNS_STATUS_RES_NO_NS
+ LDNS_STATUS_RES_QUERY
+ LDNS_STATUS_SOCKET_ERROR
+ LDNS_STATUS_SSL_ERR
+ LDNS_STATUS_SYNTAX_ALG_ERR
+ LDNS_STATUS_SYNTAX_BAD_ESCAPE
+ LDNS_STATUS_SYNTAX_CLASS_ERR
+ LDNS_STATUS_SYNTAX_DNAME_ERR
+ LDNS_STATUS_SYNTAX_EMPTY
+ LDNS_STATUS_SYNTAX_ERR
+ LDNS_STATUS_SYNTAX_INCLUDE
+ LDNS_STATUS_SYNTAX_INCLUDE_ERR_NOTIMPL
+ LDNS_STATUS_SYNTAX_INTEGER_OVERFLOW
+ LDNS_STATUS_SYNTAX_ITERATIONS_OVERFLOW
+ LDNS_STATUS_SYNTAX_KEYWORD_ERR
+ LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR
+ LDNS_STATUS_SYNTAX_ORIGIN
+ LDNS_STATUS_SYNTAX_RDATA_ERR
+ LDNS_STATUS_SYNTAX_TTL
+ LDNS_STATUS_SYNTAX_TTL_ERR
+ LDNS_STATUS_SYNTAX_TYPE_ERR
+ LDNS_STATUS_SYNTAX_VERSION_ERR
+ LDNS_STATUS_UNKNOWN_INET
+ LDNS_STATUS_WIRE_INCOMPLETE_ADDITIONAL
+ LDNS_STATUS_WIRE_INCOMPLETE_ANSWER
+ LDNS_STATUS_WIRE_INCOMPLETE_AUTHORITY
+ LDNS_STATUS_WIRE_INCOMPLETE_HEADER
+ LDNS_STATUS_WIRE_INCOMPLETE_QUESTION
+
+=head3 Resolver flags and constants
+
+ LDNS_RESOLV_ANCHOR
+ LDNS_RESOLV_DEFDOMAIN
+ LDNS_RESOLV_INET
+ LDNS_RESOLV_INET6
+ LDNS_RESOLV_INETANY
+ LDNS_RESOLV_KEYWORD
+ LDNS_RESOLV_KEYWORDS
+ LDNS_RESOLV_NAMESERVER
+ LDNS_RESOLV_OPTIONS
+ LDNS_RESOLV_RTT_INF
+ LDNS_RESOLV_RTT_MIN
+ LDNS_RESOLV_SEARCH
+ LDNS_RESOLV_SORTLIST
+
+=head3 Resolver query flags
+
+ LDNS_AA
+ LDNS_AD
+ LDNS_CD
+ LDNS_QR
+ LDNS_RA
+ LDNS_RD
+ LDNS_TC
+
+=head3 Resolver rcodes
+
+ LDNS_RCODE_FORMERR
+ LDNS_RCODE_NOERROR
+ LDNS_RCODE_NOTAUTH
+ LDNS_RCODE_NOTIMPL
+ LDNS_RCODE_NOTZONE
+ LDNS_RCODE_NXDOMAIN
+ LDNS_RCODE_NXRRSET
+ LDNS_RCODE_REFUSED
+ LDNS_RCODE_SERVFAIL
+ LDNS_RCODE_YXDOMAIN
+ LDNS_RCODE_YXRRSET
+
+=head3 Packet types
+
+ LDNS_PACKET_ANSWER
+ LDNS_PACKET_NODATA
+ LDNS_PACKET_NXDOMAIN
+ LDNS_PACKET_QUESTION
+ LDNS_PACKET_REFERRAL
+ LDNS_PACKET_UNKNOWN
+
+=head3 Packet opcodes
+
+ LDNS_PACKET_IQUERY
+ LDNS_PACKET_NOTIFY
+ LDNS_PACKET_QUERY
+ LDNS_PACKET_STATUS
+ LDNS_PACKET_UPDATE
+
+=head3 Packet sections
+
+ LDNS_SECTION_ADDITIONAL
+ LDNS_SECTION_ANSWER
+ LDNS_SECTION_ANY
+ LDNS_SECTION_ANY_NOQUESTION
+ LDNS_SECTION_AUTHORITY
+ LDNS_SECTION_QUESTION
+
+=head3 DNSSec constants
+
+ LDNS_DEFAULT_EXP_TIME
+ LDNS_MAX_KEYLEN
+ LDNS_DNSSEC_KEYPROTO
+
+=head3 DNSSec sign policies
+
+ LDNS_SIGNATURE_LEAVE_ADD_NEW
+ LDNS_SIGNATURE_LEAVE_NO_ADD
+ LDNS_SIGNATURE_REMOVE_ADD_NEW
+ LDNS_SIGNATURE_REMOVE_NO_ADD
+ LDNS_NSEC3_MAX_ITERATIONS
+
+=head3 Key flags
+
+ LDNS_KEY_REVOKE_KEY
+ LDNS_KEY_SEP_KEY
+ LDNS_KEY_ZONE_KEY
+
+=head3 Key algorithms
+
+ LDNS_DH
+ LDNS_DSA
+ LDNS_DSA_NSEC3
+ LDNS_ECC
+ LDNS_RSAMD5
+ LDNS_RSASHA1
+ LDNS_RSASHA1_NSEC3
+ LDNS_RSASHA256
+ LDNS_RSASHA512
+ LDNS_ECC_GOST
+ LDNS_PRIVATEDNS
+ LDNS_PRIVATEOID
+
+=head3 Signing algorithms
+
+ LDNS_SIGN_DSA
+ LDNS_SIGN_DSA_NSEC3
+ LDNS_SIGN_ECC_GOST
+ LDNS_SIGN_HMACSHA1
+ LDNS_SIGN_HMACSHA256
+ LDNS_SIGN_RSAMD5
+ LDNS_SIGN_RSASHA1
+ LDNS_SIGN_RSASHA1_NSEC3
+ LDNS_SIGN_RSASHA256
+ LDNS_SIGN_RSASHA512
+
+=head3 Hashing algorithm
+
+ LDNS_SHA1
+ LDNS_SHA256
+ LDNS_HASH_GOST
+
+=head3 Rdata constants
+
+ LDNS_MAX_RDFLEN
+ LDNS_NSEC3_VARS_OPTOUT_MASK
+
+ LDNS_RDF_SIZE_16BYTES
+ LDNS_RDF_SIZE_6BYTES
+ LDNS_RDF_SIZE_BYTE
+ LDNS_RDF_SIZE_DOUBLEWORD
+ LDNS_RDF_SIZE_WORD
+
+=head3 Rdata types
+
+ LDNS_RDF_TYPE_A
+ LDNS_RDF_TYPE_AAAA
+ LDNS_RDF_TYPE_ALG
+ LDNS_RDF_TYPE_APL
+ LDNS_RDF_TYPE_ATMA
+ LDNS_RDF_TYPE_B32_EXT
+ LDNS_RDF_TYPE_B64
+ LDNS_RDF_TYPE_CERT_ALG
+ LDNS_RDF_TYPE_CLASS
+ LDNS_RDF_TYPE_DNAME
+ LDNS_RDF_TYPE_HEX
+ LDNS_RDF_TYPE_INT16
+ LDNS_RDF_TYPE_INT16_DATA
+ LDNS_RDF_TYPE_INT32
+ LDNS_RDF_TYPE_INT8
+ LDNS_RDF_TYPE_IPSECKEY
+ LDNS_RDF_TYPE_LOC
+ LDNS_RDF_TYPE_NONE
+ LDNS_RDF_TYPE_NSAP
+ LDNS_RDF_TYPE_NSEC
+ LDNS_RDF_TYPE_NSEC3_NEXT_OWNER
+ LDNS_RDF_TYPE_NSEC3_SALT
+ LDNS_RDF_TYPE_PERIOD
+ LDNS_RDF_TYPE_SERVICE
+ LDNS_RDF_TYPE_STR
+ LDNS_RDF_TYPE_TIME
+ LDNS_RDF_TYPE_HIP
+ LDNS_RDF_TYPE_TSIGTIME
+ LDNS_RDF_TYPE_TYPE
+ LDNS_RDF_TYPE_UNKNOWN
+ LDNS_RDF_TYPE_WKS
+
+=head3 Algorithms used in CERT RRs.
+
+ LDNS_CERT_ACPKIX
+ LDNS_CERT_IACPKIX
+ LDNS_CERT_IPGP
+ LDNS_CERT_IPKIX
+ LDNS_CERT_ISPKI
+ LDNS_CERT_OID
+ LDNS_CERT_PGP
+ LDNS_CERT_PKIX
+ LDNS_CERT_SPKI
+ LDNS_CERT_URI
+
+=head3 RR compress flag
+
+ LDNS_RR_COMPRESS
+ LDNS_RR_NO_COMPRESS
+
+=head3 RR classes
+
+ LDNS_RR_CLASS_ANY
+ LDNS_RR_CLASS_CH
+ LDNS_RR_CLASS_COUNT
+ LDNS_RR_CLASS_FIRST
+ LDNS_RR_CLASS_HS
+ LDNS_RR_CLASS_IN
+ LDNS_RR_CLASS_LAST
+ LDNS_RR_CLASS_NONE
+
+=head3 RR types
+
+ LDNS_RR_TYPE_A
+ LDNS_RR_TYPE_A6
+ LDNS_RR_TYPE_AAAA
+ LDNS_RR_TYPE_AFSDB
+ LDNS_RR_TYPE_ANY
+ LDNS_RR_TYPE_APL
+ LDNS_RR_TYPE_ATMA
+ LDNS_RR_TYPE_AXFR
+ LDNS_RR_TYPE_CERT
+ LDNS_RR_TYPE_CNAME
+ LDNS_RR_TYPE_COUNT
+ LDNS_RR_TYPE_DHCID
+ LDNS_RR_TYPE_DLV
+ LDNS_RR_TYPE_DNAME
+ LDNS_RR_TYPE_DNSKEY
+ LDNS_RR_TYPE_DS
+ LDNS_RR_TYPE_EID
+ LDNS_RR_TYPE_FIRST
+ LDNS_RR_TYPE_GID
+ LDNS_RR_TYPE_GPOS
+ LDNS_RR_TYPE_HINFO
+ LDNS_RR_TYPE_IPSECKEY
+ LDNS_RR_TYPE_ISDN
+ LDNS_RR_TYPE_IXFR
+ LDNS_RR_TYPE_KEY
+ LDNS_RR_TYPE_KX
+ LDNS_RR_TYPE_LAST
+ LDNS_RR_TYPE_LOC
+ LDNS_RR_TYPE_MAILA
+ LDNS_RR_TYPE_MAILB
+ LDNS_RR_TYPE_MB
+ LDNS_RR_TYPE_MD
+ LDNS_RR_TYPE_MF
+ LDNS_RR_TYPE_MG
+ LDNS_RR_TYPE_MINFO
+ LDNS_RR_TYPE_MR
+ LDNS_RR_TYPE_MX
+ LDNS_RR_TYPE_NAPTR
+ LDNS_RR_TYPE_NIMLOC
+ LDNS_RR_TYPE_NS
+ LDNS_RR_TYPE_NSAP
+ LDNS_RR_TYPE_NSAP_PTR
+ LDNS_RR_TYPE_NSEC
+ LDNS_RR_TYPE_NSEC3
+ LDNS_RR_TYPE_NSEC3PARAM
+ LDNS_RR_TYPE_NSEC3PARAMS
+ LDNS_RR_TYPE_NULL
+ LDNS_RR_TYPE_NXT
+ LDNS_RR_TYPE_OPT
+ LDNS_RR_TYPE_PTR
+ LDNS_RR_TYPE_PX
+ LDNS_RR_TYPE_RP
+ LDNS_RR_TYPE_RRSIG
+ LDNS_RR_TYPE_RT
+ LDNS_RR_TYPE_SIG
+ LDNS_RR_TYPE_SINK
+ LDNS_RR_TYPE_SOA
+ LDNS_RR_TYPE_SPF
+ LDNS_RR_TYPE_SRV
+ LDNS_RR_TYPE_SSHFP
+ LDNS_RR_TYPE_TALINK
+ LDNS_RR_TYPE_TSIG
+ LDNS_RR_TYPE_TXT
+ LDNS_RR_TYPE_UID
+ LDNS_RR_TYPE_UINFO
+ LDNS_RR_TYPE_UNSPEC
+ LDNS_RR_TYPE_WKS
+ LDNS_RR_TYPE_X25
+
+=head3 Various defaults and other constants
+
+ LDNS_DEFAULT_TTL
+ LDNS_PORT
+ LDNS_IP4ADDRLEN
+ LDNS_IP6ADDRLEN
+ LDNS_MAX_DOMAINLEN
+ LDNS_MAX_LABELLEN
+ LDNS_MAX_PACKETLEN
+ LDNS_MAX_POINTERS
+ LDNS_RR_OVERHEAD
+ LDNS_RDATA_FIELD_DESCRIPTORS_COMMON
+
+=head1 BUGS
+
+This package is currently in a very early stage of development. There
+are probably some bugs. You may also expect that method names and
+behaviour could still change without much considerations to backward
+compatibility.
+
+=head1 SEE ALSO
+
+http://www.nlnetlabs.nl/projects/ldns
+
+=head1 AUTHOR
+
+Erik Pihl Ostlyngen, E<lt>erik.ostlyngen@uninett.noE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2013 by UNINETT Norid AS
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself, either Perl version 5.14.2 or,
+at your option, any later version of Perl 5 you may have available.
+
+=cut
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecDataChain.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecDataChain.pm
new file mode 100644
index 000000000000..42074dc153c8
--- /dev/null
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecDataChain.pm
@@ -0,0 +1,87 @@
+package DNS::LDNS::DNSSecDataChain;
+
+use 5.008008;
+use strict;
+use warnings;
+
+use DNS::LDNS;
+
+our $VERSION = '0.06';
+
+sub rrset {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_rrset, $self);
+}
+
+sub signatures {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_signatures, $self);
+}
+
+sub parent {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_parent, $self);
+}
+
+sub derive_trust_tree {
+ my ($self, $rr) = @_;
+
+ if (!DNS::LDNS::GC::is_owned($rr) or DNS::LDNS::GC::owner($rr) ne $self) {
+ die "The rr ($rr) must be in the data chain ($self)";
+ }
+ return DNS::LDNS::GC::own($self->_derive_trust_tree($rr), $self);
+}
+
+sub derive_trust_tree_time {
+ my ($self, $rr, $checktime) = @_;
+
+ if (!DNS::LDNS::GC::is_owned($rr) or DNS::LDNS::GC::owner($rr) ne $self) {
+ die "The rr ($rr) must be in the data chain ($self)";
+ }
+ return DNS::LDNS::GC::own(
+ $self->_derive_trust_tree_time($rr, $checktime), $self);
+}
+
+
+1;
+__END__
+
+=head1 NAME
+
+DNS::LDNS::DNSSecDataChain - DNSSec data chain element
+
+=head1 SYNOPSIS
+
+ use DNS::LDNS ':all'
+
+ chain = new DNS::LDNS::DNSSecDataChain
+ chain->print(fp)
+ chain->derive_trust_tree(rr)
+ chain->derive_trust_tree_time(rr, checktime)
+
+ # Node attributes
+ rrset = chain->rrset
+ rrset = chain->signatures
+ rrtype = chain->parent_type
+ pchain = chain->parent
+ rcode = chain->packet_rcode
+ rrtype = chain->packet_qtype
+ bool = chain->packet_nodata
+
+=head1 SEE ALSO
+
+http://www.nlnetlabs.nl/projects/ldns
+
+=head1 AUTHOR
+
+Erik Pihl Ostlyngen, E<lt>erik.ostlyngen@uninett.noE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2013 by UNINETT Norid AS
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself, either Perl version 5.14.2 or,
+at your option, any later version of Perl 5 you may have available.
+
+=cut
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecName.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecName.pm
new file mode 100644
index 000000000000..bea6bb7c4931
--- /dev/null
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecName.pm
@@ -0,0 +1,110 @@
+package DNS::LDNS::DNSSecName;
+
+use 5.008008;
+use strict;
+use warnings;
+
+use DNS::LDNS ':all';
+
+our $VERSION = '0.06';
+
+sub new {
+ my $class = shift;
+ return _new;
+}
+
+sub name {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_name, $self);
+}
+
+sub set_name {
+ my ($self, $name) = @_;
+
+ DNS::LDNS::GC::disown(my $old = $self->name);
+ _set_name($self, my $copy = $name->clone);
+ DNS::LDNS::GC::own($copy, $self);
+}
+
+sub rrsets {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_rrsets, $self);
+}
+
+sub add_rr {
+ my ($self, $rr) = @_;
+
+ my $s = _add_rr($self, my $copy = $rr->clone);
+ DNS::LDNS::GC::own($copy, $self);
+ $DNS::LDNS::last_status = $s;
+ return $s;
+}
+
+sub nsec {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_nsec, $self);
+}
+
+sub set_nsec {
+ my ($self, $nsec) = @_;
+
+ DNS::LDNS::GC::disown(my $old = $self->nsec);
+ _set_nsec($self, my $copy = $nsec->clone);
+ DNS::LDNS::GC::own($copy, $self);
+}
+
+sub hashed_name {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_hashed_name, $self);
+}
+
+sub nsec_signatures {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_nsec_signatures, $self);
+}
+
+sub DESTROY {
+ DNS::LDNS::GC::free($_[0]);
+}
+
+1;
+__END__
+
+=head1 NAME
+
+DNS::LDNS::DNSSecName - Dname with rrsets in a dnssec zone
+
+=head1 SYNOPSIS
+
+ use LDNS ':all'
+
+ my name = new DNS::LDNS::DNSSecName
+
+ rdata = name->name
+ name->set_name(rdata)
+ bool = name->is_glue
+ rrsets = name->rrsets
+ name->add_rr(rr)
+
+ rr = name->nsec
+ name->set_nsec(rr)
+ hash = name->hashed_name
+ rrs = name->nsec_signatures
+
+=head1 SEE ALSO
+
+http://www.nlnetlabs.nl/projects/ldns
+
+=head1 AUTHOR
+
+Erik Pihl Ostlyngen, E<lt>erik.ostlyngen@uninett.noE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2013 by UNINETT Norid AS
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself, either Perl version 5.14.2 or,
+at your option, any later version of Perl 5 you may have available.
+
+=cut
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecRRSets.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecRRSets.pm
new file mode 100644
index 000000000000..fbd9bb735628
--- /dev/null
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecRRSets.pm
@@ -0,0 +1,85 @@
+package DNS::LDNS::DNSSecRRSets;
+
+use 5.008008;
+use strict;
+use warnings;
+
+use DNS::LDNS;
+
+our $VERSION = '0.06';
+
+# Note: Since this class does not have a constructor, we can let its child
+# objects be owned by the parent. This reduces the recursion depth on
+# DESTROY.
+
+sub rrs {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_rrs, DNS::LDNS::GC::owner($self));
+}
+
+sub signatures {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_signatures, DNS::LDNS::GC::owner($self));
+}
+
+sub next {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_next, DNS::LDNS::GC::owner($self));
+}
+
+sub set_type {
+ my ($self, $type) = @_;
+ my $s = _set_type($self, $type);
+ $DNS::LDNS::last_status = $s;
+ return $s;
+}
+
+sub add_rr {
+ my ($self, $rr) = @_;
+
+ my $s = _add_rr($self, my $copy = $rr->clone);
+ $DNS::LDNS::last_status = $s;
+ DNS::LDNS::GC::own($copy, $self);
+ return $s;
+}
+
+sub DESTROY {
+ DNS::LDNS::GC::free($_[0]);
+}
+
+1;
+__END__
+
+=head1 NAME
+
+DNS::LDNS::DNSSecRRSets - Linked list of rrsets in a dnssec zone
+
+=head1 SYNOPSIS
+
+ use DNS::LDNS ':all'
+
+ rrs = rrsets->rrs
+ rrs = rrsets->signatures
+ rrsets2 = rrsets->next
+ rrsets->add_rr(rr)
+ bool = rrsets->contains_type(rr_type)
+ rr_type = rrsets->type
+ rrsets->set_type(rr_type)
+
+=head1 SEE ALSO
+
+http://www.nlnetlabs.nl/projects/ldns
+
+=head1 AUTHOR
+
+Erik Pihl Ostlyngen, E<lt>erik.ostlyngen@uninett.noE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2013 by UNINETT Norid AS
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself, either Perl version 5.14.2 or,
+at your option, any later version of Perl 5 you may have available.
+
+=cut
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecRRs.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecRRs.pm
new file mode 100644
index 000000000000..b7b3dccf9543
--- /dev/null
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecRRs.pm
@@ -0,0 +1,82 @@
+package DNS::LDNS::DNSSecRRs;
+
+use 5.008008;
+use strict;
+use warnings;
+
+use DNS::LDNS;
+
+our $VERSION = '0.06';
+
+# Note: This class does not have a constructor. Thus, it can not be created
+# as an individual object. The data structure of the node is owned
+# and freed by the owner of the parent rather than the parent node. This
+# is to prevent deep recursion on DESTROY.
+
+sub to_string {
+ my $self = shift;
+ my $ret = '';
+ while ($self and $self->rr) {
+ $ret .= $self->rr->to_string;
+ $self = $self->next;
+ }
+
+ return $ret;
+}
+
+sub add_rr {
+ my ($self, $rr) = @_;
+
+ my $s = _add_rr($self, my $copy = $rr->clone);
+ DNS::LDNS::GC::own($self, $copy);
+ $DNS::LDNS::last_status = $s;
+ return $s;
+}
+
+sub rr {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_rr, DNS::LDNS::GC::owner($self));
+}
+
+sub next {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_next, DNS::LDNS::GC::owner($self));
+}
+
+sub DESTROY {
+ DNS::LDNS::GC::free($_[0]);
+}
+
+1;
+__END__
+
+=head1 NAME
+
+DNS::LDNS::DNSSecRRs - Linked list of rrs in a dnssec zone
+
+=head1 SYNOPSIS
+
+ use DNS::LDNS ':all'
+
+ rrs->to_string
+ rrs->add_rr(rr)
+ rr = rrs->rr
+ rrs2 = rrs->next
+
+=head1 SEE ALSO
+
+http://www.nlnetlabs.nl/projects/ldns
+
+=head1 AUTHOR
+
+Erik Pihl Ostlyngen, E<lt>erik.ostlyngen@uninett.noE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2013 by UNINETT Norid AS
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself, either Perl version 5.14.2 or,
+at your option, any later version of Perl 5 you may have available.
+
+=cut
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecTrustTree.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecTrustTree.pm
new file mode 100644
index 000000000000..1b9ca66e6102
--- /dev/null
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecTrustTree.pm
@@ -0,0 +1,99 @@
+package DNS::LDNS::DNSSecTrustTree;
+
+use 5.008008;
+use strict;
+use warnings;
+
+use DNS::LDNS;
+
+our $VERSION = '0.06';
+
+sub add_parent {
+ my ($self, $parent, $sig, $parent_status) = @_;
+
+ if (DNS::LDNS::GC::is_owned($parent)) {
+ die "Cannot add to multiple trees.";
+ }
+ my $s = _add_parent($self, $parent, $sig, $parent_status);
+ DNS::LDNS::GC::own($parent, $self);
+ $DNS::LDNS::last_status = $s;
+ return $s;
+}
+
+sub contains_keys {
+ my ($self, $trusted_keys) = @_;
+
+ my $s = _contains_keys($self, $trusted_keys);
+ $DNS::LDNS::last_status = $s;
+ return $s;
+}
+
+sub rr {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_rr, $self);
+}
+
+sub rrset {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_rrset, $self);
+}
+
+sub parent {
+ my ($self, $i) = @_;
+ return DNS::LDNS::GC::own($self->_parent($i), $self);
+}
+
+sub parent_status {
+ my ($self, $i) = @_;
+ my $s = _parent_status($self, $i);
+ $DNS::LDNS::last_status = $s;
+ return $s;
+}
+
+sub parent_signature {
+ my ($self, $i) = @_;
+ return DNS::LDNS::GC::own($self->_parent_signature($i), $self);
+}
+
+1;
+__END__
+
+=head1 NAME
+
+DNS::LDNS::DNSSecTrustTree - Trust tree from signed RR to trust anchors
+
+=head1 SYNOPSIS
+
+ use DNS::LDNS ':all'
+
+ tree = new DNS::LDNS::DNSSecTrustTree
+ tree->print(fp)
+ d = tree->depth
+ status = tree->add_parent(parent, sig, parent_status)
+ status = tree->contains_keys(trusted_keys)
+
+ # Node attributes
+ rr = tree->rr;
+ rrset = tree->rrset
+ ptree = tree->parent(i)
+ pstatus = tree->parent_status(i)
+ rr = tree->parent_signature(i)
+ count = tree->parent_count
+
+=head1 SEE ALSO
+
+http://www.nlnetlabs.nl/projects/ldns
+
+=head1 AUTHOR
+
+Erik Pihl Ostlyngen, E<lt>erik.ostlyngen@uninett.noE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2013 by UNINETT Norid AS
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself, either Perl version 5.14.2 or,
+at your option, any later version of Perl 5 you may have available.
+
+=cut
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecZone.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecZone.pm
new file mode 100644
index 000000000000..da809a6ace01
--- /dev/null
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecZone.pm
@@ -0,0 +1,176 @@
+package DNS::LDNS::DNSSecZone;
+
+use 5.008008;
+use strict;
+use warnings;
+
+use DNS::LDNS ':all';
+
+our $VERSION = '0.06';
+
+sub new {
+ my ($class, %args) = @_;
+
+ my $line_nr;
+ my $status = &LDNS_STATUS_OK;
+ my $zone;
+ my $file;
+
+ if ($args{filename}) {
+ unless (open FILE, $args{filename}) {
+ $DNS::LDNS::last_status = &LDNS_STATUS_FILE_ERR;
+ $DNS::LDNS::line_nr = 0;
+ return;
+ }
+
+ $file = \*FILE;
+ }
+ elsif ($args{file}) {
+ $file = $args{file};
+ }
+
+ if ($file) {
+ $zone = _new_from_file($file,
+ $args{origin} || $LDNS::DEFAULT_ORIGIN,
+ $args{ttl} || $LDNS::DEFAULT_TTL,
+ $args{class} || $LDNS::DEFAULT_CLASS,
+ $status, $line_nr);
+ }
+ else {
+ $zone = _new();
+ }
+
+ if ($args{filename}) {
+ close $file;
+ }
+
+ $DNS::LDNS::last_status = $status;
+ $DNS::LDNS::line_nr = $line_nr;
+ if (!defined $zone) {
+ return;
+ }
+
+ return $zone;
+}
+
+sub soa {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_soa, $self);
+}
+
+sub names {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_names, $self);
+}
+
+sub find_rrset {
+ my ($self, $name, $type) = @_;
+ return DNS::LDNS::GC::own($self->_find_rrset($name, $type), $self);
+}
+
+sub add_rr {
+ my ($self, $rr) = @_;
+
+ # Set a copy of the rr in case it is already owned
+ my $s = _add_rr($self, my $copy = $rr->clone);
+ $DNS::LDNS::last_status = $s;
+ DNS::LDNS::GC::own($copy, $self);
+ return $s;
+}
+
+sub add_empty_nonterminals {
+ my $self = shift;
+ my $s = _add_empty_nonterminals($self);
+ $DNS::LDNS::last_status = $s;
+ return $s;
+}
+
+sub mark_glue {
+ my $self = shift;
+ my $s = _mark_glue($self);
+ $DNS::LDNS::last_status = $s;
+ return $s;
+}
+
+sub sign {
+ my ($self, $keylist, $policy, $flags) = @_;
+ my $s = _sign($self, $keylist, $policy, $flags);
+ $DNS::LDNS::last_status = $s;
+ return $s;
+}
+
+sub sign_nsec3 {
+ my ($self, $keylist, $policy, $algorithm, $flags, $iterations, $salt,
+ $signflags) = @_;
+ my $s = _sign_nsec3($self, $keylist, $policy, $algorithm, $flags,
+ $iterations, $salt, $signflags);
+ $DNS::LDNS::last_status = $s;
+ return $s;
+}
+
+sub to_string {
+ return "DNS::LDNS::DNSSecZone::to_string is not yet implemented";
+}
+
+sub DESTROY {
+ DNS::LDNS::GC::free($_[0]);
+}
+
+1;
+__END__
+
+=head1 NAME
+
+DNS::LDNS::DNSSecZone - Zone with dnssec data
+
+=head1 SYNOPSIS
+
+ use DNS::LDNS ':all'
+
+ my z = new DNS::LDNS::DNSSecZone(
+ filename => '/path/to/myzone',
+ origin => new DNS::LDNS::RData(LDNS_RDF_TYPE_DNAME, 'myzone'), #optional
+ ttl => 3600, #optional
+ class => LDNS_RR_CLASS_, #optional
+ )
+ my z = new DNS::LDNS::DNSSecZone(
+ file => \*FILE,
+ origin => ..., ttl => ..., class => ...
+ )
+ my z = new DNS::LDNS::DNSSecZone
+
+ rr = z->soa
+ rbtree = z->names
+ rrsets = z->find_rrset
+ z->add_rr(rr)
+ z->create_from_zone(zone)
+ z->add_empty_nonterminals
+
+ z->sign(keylist, policy)
+ z->sign_nsec3(keylist, policy, algorithm, flags, iterations, salt)
+
+ z->create_nsecs
+ z->create_nsec3s(algorithm, flags, iterations, salt)
+ z->create_rrsigs(key_list, policy, flags)
+
+=head1 TODO
+
+ z->to_string
+
+=head1 SEE ALSO
+
+http://www.nlnetlabs.nl/projects/ldns
+
+=head1 AUTHOR
+
+Erik Pihl Ostlyngen, E<lt>erik.ostlyngen@uninett.noE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2013 by UNINETT Norid AS
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself, either Perl version 5.14.2 or,
+at your option, any later version of Perl 5 you may have available.
+
+=cut
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/GC.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/GC.pm
new file mode 100644
index 000000000000..014b7bee21af
--- /dev/null
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/GC.pm
@@ -0,0 +1,122 @@
+package DNS::LDNS::GC;
+
+use strict;
+use warnings;
+
+our $VERSION = '0.06';
+
+my %ref_count;
+my %owned_by;
+
+sub own {
+ my ($obj, $owner) = @_;
+
+# print STDERR "Owning $obj -> $owner\n";
+ return unless (defined $obj);
+
+ if ($owned_by{$$owner}) {
+ # If the owner is an owned object, let obj be owned by
+ # the owners owner. We want to avoid recursive ownerships.
+ $owner = $owned_by{$$owner};
+ }
+
+ if (exists $owned_by{$$obj}) {
+ $ref_count{$$obj}++;
+ }
+ else {
+ $ref_count{$$obj} = 1;
+ $owned_by{$$obj} = $owner;
+ }
+ return $obj;
+}
+
+# Return true if the object is owned by someone
+sub is_owned {
+ return (exists $owned_by{${$_[0]}});
+}
+
+sub owner {
+ return $owned_by{${$_[0]}};
+}
+
+sub disown {
+ return unless (defined $_[0]);
+ delete $owned_by{${$_[0]}};
+}
+
+my %free_method = (
+ 'DNS::LDNS::Zone' => '_zone_deep_free',
+ 'DNS::LDNS::RRList' => '_rrlist_deep_free',
+ 'DNS::LDNS::RR' => '_rr_free',
+ 'DNS::LDNS::RData' => '_rdata_deep_free',
+ 'DNS::LDNS::DNSSecZone' => '_dnssec_zone_deep_free',
+ 'DNS::LDNS::DNSSecName' => '_dnssec_name_deep_free',
+ 'DNS::LDNS::Resolver' => '_resolver_deep_free',
+ 'DNS::LDNS::Packet' => '_packet_free',
+ 'DNS::LDNS::Key' => '_key_deep_free',
+ 'DNS::LDNS::KeyList' => '_keylist_free',
+ 'DNS::LDNS::DNSSecDataChain' => '_dnssec_datachain',
+);
+
+my %not_deleted_by_owner = (
+ 'DNS::LDNS::DNSSecTrustChain' => 1,
+);
+
+sub free {
+ my $obj = shift;
+
+# print STDERR "Freeing $obj\n";
+
+ if (exists $ref_count{$$obj}) {
+# print STDERR "Derefing $obj\n";
+ $ref_count{$$obj}--;
+ return if ($ref_count{$$obj} > 0);
+ }
+
+# print STDERR "Deleting $obj\n";
+
+ delete $ref_count{$$obj};
+
+ if (exists $owned_by{$$obj}) {
+ delete $owned_by{$$obj};
+ return unless ($not_deleted_by_owner{ref $obj});
+ }
+
+ my $class = ref $obj;
+ my $free = $free_method{ref $obj};
+
+ die "Internal error: No freeing method for $obj (".ref $obj.")"
+ unless ($free);
+
+ no strict;
+ &$free($obj);
+}
+
+1;
+__END__
+
+=head1 NAME
+
+DNS::LDNS::GC - Garbage collector, used internally by the DNS::LDNS modules
+
+=head1 SYNOPSIS
+
+Garbage collector class for DNS::LDNS objects.
+
+=head1 SEE ALSO
+
+http://www.nlnetlabs.nl/projects/ldns
+
+=head1 AUTHOR
+
+Erik Pihl Ostlyngen, E<lt>erik.ostlyngen@uninett.noE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2013 by UNINETT Norid AS
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself, either Perl version 5.14.2 or,
+at your option, any later version of Perl 5 you may have available.
+
+=cut
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/Key.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/Key.pm
new file mode 100644
index 000000000000..bbce173dd8bb
--- /dev/null
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/Key.pm
@@ -0,0 +1,122 @@
+package DNS::LDNS::Key;
+
+use 5.008008;
+use strict;
+use warnings;
+
+use DNS::LDNS ':all';
+
+our $VERSION = '0.06';
+
+sub new {
+ my ($class, %args) = @_;
+
+ my $key;
+
+ if ($args{filename} or $args{file}) {
+ my $status = &LDNS_STATUS_OK;
+ my $line_nr = 0;
+ my $file = $args{file};
+ if ($args{filename}) {
+ unless (open FILE, $args{filename}) {
+ $DNS::LDNS::last_status = &LDNS_STATUS_FILE_ERR;
+ return;
+ }
+ $file = \*FILE;
+ }
+
+ $key = _new_from_file($file, $line_nr, $status);
+ if ($args{filename}) {
+ close $file;
+ }
+
+ $DNS::LDNS::last_status = $status;
+ $DNS::LDNS::line_nr = $line_nr;
+ if (!defined $key) {
+ return;
+ }
+ }
+ else {
+ $key = _new();
+ }
+
+ return $key;
+}
+
+sub set_pubkey_owner {
+ my ($self, $owner) = @_;
+ my $oldowner = $self->pubkey_owner;
+ DNS::LDNS::GC::disown(my $old = $self->pubkey_owner);
+ $self->_set_pubkey_owner($owner);
+ return DNS::LDNS::GC::own($owner, $self);
+}
+
+sub pubkey_owner {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_pubkey_owner, $self);
+}
+
+sub DESTROY {
+ DNS::LDNS::GC::free($_[0]);
+}
+
+1;
+__END__
+
+=head1 NAME
+
+DNS::LDNS::Key - DNSSec private key
+
+=head1 SYNOPSIS
+
+ use DNS::LDNS ':all'
+
+ key = new DNS::LDNS::Key
+ key = new DNS::LDNS::Key(file => \*FILE)
+ key = new DNS::LDNS::Key(filename => 'keyfile')
+
+ str = key->to_string
+ key->print(\*OUTPUT)
+
+ key->set_algorithm(alg)
+ alg = key->algorithm
+ key->set_flags(flags)
+ flags = key->flags
+ key->set_hmac_key(hmac)
+ hmac = key->hmac_key
+ key->set_hmac_size(size)
+ size = key->hmac_size
+ key->set_origttl(ttl)
+ ttl = key->origttl
+ key->set_inception(epoch)
+ epoch = key->inception
+ key->set_expiration(epoch)
+ epoch = key->expiration
+ key->set_pubkey_owner(rdata)
+ rdata = key->pubkey_owner
+ key->set_keytag(tag)
+ tag = key->keytag
+ key->set_use(bool)
+ bool = key->use
+
+ str = key->get_file_base_name
+
+ rr = key->to_rr
+
+=head1 SEE ALSO
+
+http://www.nlnetlabs.nl/projects/ldns
+
+=head1 AUTHOR
+
+Erik Pihl Ostlyngen, E<lt>erik.ostlyngen@uninett.noE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2013 by UNINETT Norid AS
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself, either Perl version 5.14.2 or,
+at your option, any later version of Perl 5 you may have available.
+
+=cut
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/KeyList.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/KeyList.pm
new file mode 100644
index 000000000000..c39e1c704e53
--- /dev/null
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/KeyList.pm
@@ -0,0 +1,72 @@
+package DNS::LDNS::KeyList;
+
+use 5.008008;
+use strict;
+use warnings;
+
+use DNS::LDNS ':all';
+
+our $VERSION = '0.06';
+
+sub new {
+ my $class = shift;
+
+ return _new();
+}
+
+sub push {
+ my ($self, @keys) = @_;
+
+ for my $k (@keys) {
+ if (DNS::LDNS::GC::is_owned($k)) {
+ die "Cannot push a key on multiple lists.";
+ }
+ $self->_push($k);
+ DNS::LDNS::GC::own($k, $self);
+ }
+}
+
+sub key {
+ my ($self, $index) = @_;
+ return DNS::LDNS::GC::own($self->_key($index), $self);
+}
+
+sub DESTROY {
+ DNS::LDNS::GC::free($_[0]);
+}
+
+1;
+__END__
+
+=head1 NAME
+
+DNS::LDNS::KeyList - Linked list of dnssec keys
+
+=head1 SYNOPSIS
+
+ use DNS::LDNS ':all'
+
+ my l = new DNS::LDNS::KeyList
+ l->set_use(bool)
+ l->push(@keys)
+ key = l->pop
+ c = l->count
+ key = l->key(index)
+
+=head1 SEE ALSO
+
+http://www.nlnetlabs.nl/projects/ldns
+
+=head1 AUTHOR
+
+Erik Pihl Ostlyngen, E<lt>erik.ostlyngen@uninett.noE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2013 by UNINETT Norid AS
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself, either Perl version 5.14.2 or,
+at your option, any later version of Perl 5 you may have available.
+
+=cut
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/Packet.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/Packet.pm
new file mode 100644
index 000000000000..f9875bf5abd0
--- /dev/null
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/Packet.pm
@@ -0,0 +1,259 @@
+package DNS::LDNS::Packet;
+
+use 5.008008;
+use strict;
+use warnings;
+
+use DNS::LDNS;
+
+our $VERSION = '0.06';
+
+sub new {
+ my ($class, %args) = @_;
+
+ if ($args{name}) {
+ return _query_new(
+ $args{name}, $args{type}, $args{class}, $args{flags});
+ }
+ else {
+ return _new;
+ }
+}
+
+sub question {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_question, $self);
+}
+
+sub set_question {
+ my ($self, $l) = @_;
+ DNS::LDNS::GC::disown(my $old = $self->question);
+ $self->_set_question($l);
+ return DNS::LDNS::GC::own($l, $self);
+}
+
+sub answer {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_answer, $self);
+}
+
+sub set_answer {
+ my ($self, $l) = @_;
+ DNS::LDNS::GC::disown(my $old = $self->answer);
+ $self->_set_answer($l);
+ return DNS::LDNS::GC::own($l, $self);
+}
+
+sub authority {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_authority, $self);
+}
+
+sub set_authority {
+ my ($self, $l) = @_;
+ DNS::LDNS::GC::disown(my $old = $self->authority);
+ $self->_set_authority($l);
+ return DNS::LDNS::GC::own($l, $self);
+}
+
+sub additional {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_additional, $self);
+}
+
+sub set_additional {
+ my ($self, $l) = @_;
+ DNS::LDNS::GC::disown(my $old = $self->additional);
+ $self->_set_additional($l);
+ return DNS::LDNS::GC::own($l, $self);
+}
+
+sub answerfrom {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_answerfrom, $self);
+}
+
+sub set_answerfrom {
+ my ($self, $a) = @_;
+ DNS::LDNS::GC::disown(my $old = $self->answerfrom);
+ $self->_set_answerfrom($a);
+ return DNS::LDNS::GC::own($a, $self);
+}
+
+
+sub timestamp {
+ my $self = shift;
+ my $t = _timestamp($self);
+ return wantarray ? @$t : $t;
+}
+
+sub edns_data {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_edns_data, $self);
+}
+
+sub set_edns_data {
+ my ($self, $data) = @_;
+ DNS::LDNS::GC::disown(my $old = $self->edns_data);
+ $self->_set_edns_data($data);
+ return DNS::LDNS::GC::own($data, $self);
+}
+
+sub push_rr {
+ my ($self, $sec, $rr) = @_;
+
+ my $ret = $self->_push_rr($sec, my $copy = $_->clone);
+ DNS::LDNS::GC::own($copy, $self);
+ return $ret;
+}
+
+sub safe_push_rr {
+ my ($self, $sec, $rr) = @_;
+
+ my $ret = $self->_safe_push_rr($sec, my $copy = $_->clone);
+ if ($ret) {
+ DNS::LDNS::GC::own($copy, $self);
+ }
+ return $ret;
+}
+
+sub tsig {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_tsig, $self);
+}
+
+sub set_tsig {
+ my ($self, $rr) = @_;
+ DNS::LDNS::GC::disown(my $old = $self->tsig);
+ $self->_set_tsig($rr);
+ return DNS::LDNS::GC::own($rr, $self);
+}
+
+sub DESTROY {
+ DNS::LDNS::GC::free($_[0]);
+}
+
+1;
+__END__
+
+=head1 NAME
+
+DNS::LDNS::Packet - DNS packet
+
+=head1 SYNOPSIS
+
+ use DNS::LDNS ':all'
+
+ my pkt = new DNS::LDNS::Packet(name => rdata, type => LDNS_RR_TYPE_...,
+ class => LDNS_RR_CLASS_..., flags => ...)
+ my pkt = new DNS::LDNS::Packet
+
+ pkt2 = pkt->clone
+
+ pkt->to_string
+
+ rrlist = pkt->question
+ pkt->set_question(rrlist)
+'
+ rrlist = pkt->answer
+ pkt->set_answer(rrlist)
+
+ rrlist = pkt->authority
+ pkt->set_authority(rrlist)
+
+ rrlist = pkt->additional
+ pkt->set_additional(rrlist)
+
+ rrlist = pkt->all
+ rrlist = pkt->all_noquestion
+
+ for (qw/qr aa tc rd cd ra ad/) {
+ bool = pkt->$_
+ pkt->set_$_(bool)
+ }
+
+ id = pkt->id
+ pkt->set_id(id)
+ pkt->set_random_id
+
+ count = pkt->qdcount
+ count = pkt->ancount
+ count = pkt->nscount
+ count = pkt->arcount
+
+ opcode = pkt->opcode
+ pkt->set_opcode(opcode)
+
+ rcode = pkt->rcode # Response code
+ pkt->set_rcode(rcode)
+
+ size = pkt->size
+
+ epoch = pkt->querytime
+ pkt->set_querytime(epoch)
+
+ rdata = pkt->answerfrom
+ pkt->set_answerfrom(rdata)
+
+ (sec, usec) = pkt->timestamp
+ pkt->set_timestamp(sec, usec)
+
+ bool = pkt->edns
+
+ size = pkt->edns_udp_size
+ pkt->set_edns_udp_size(size)
+
+ rcode = pkt->edns_extended_rcode
+ pkt->set_edns_extended_rcode(rcode)
+
+ v = pkt->edns_version
+ pkt->set_edns_version(v)
+
+ z = pkt->edns_z
+ pkt->set_edns_z(z)
+
+ do = pkt->edns_do
+ pkt->set_edns_do(do)
+
+ rdata = pkt->edns_data
+ pkt->set_edns_data(rdata)
+
+ pkt->set_flags(flags)
+
+ rrlist = pkt->rr_list_by_name(rdata, section)
+ rrlist = pkt->rr_list_by_type(type, section)
+ rrlist = pkt->rr_list_by_name_and_type(rdata, type, section)
+
+ bool = pkt->rr(section, rr) # Check if rr exists
+
+ pkt->push_rr(section, rr)
+ pkt->safe_push_rr(section, rr)
+
+ count = pkt->section_count(section)
+ bool = pkt->empty
+
+ rr = pkt->tsig
+ pkt->set_tsig(rr)
+
+ type = pkt->reply_type
+
+ rrlist = pkt->get_rrsigs_for_name_and_type(rdata, rrtype)
+ rrlist = pkt->get_rrsigs_for_type(rrtype)
+
+=head1 SEE ALSO
+
+http://www.nlnetlabs.nl/projects/ldns
+
+=head1 AUTHOR
+
+Erik Pihl Ostlyngen, E<lt>erik.ostlyngen@uninett.noE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2013 by UNINETT Norid AS
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself, either Perl version 5.14.2 or,
+at your option, any later version of Perl 5 you may have available.
+
+=cut
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/RBNode.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/RBNode.pm
new file mode 100644
index 000000000000..31f617cddb1b
--- /dev/null
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/RBNode.pm
@@ -0,0 +1,71 @@
+package DNS::LDNS::RBNode;
+
+use 5.008008;
+use strict;
+use warnings;
+
+use DNS::LDNS;
+
+our $VERSION = '0.06';
+
+# Note: This class does not have a constructor. Thus, it can not be created
+# as an individual object. The data structure of the object will always be
+# owned and freed by its parent object.
+
+sub next {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_next, $self);
+}
+
+sub previous {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_previous, $self);
+}
+
+sub next_nonglue {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_next_nonglue, $self);
+}
+
+sub name {
+ my ($self) = @_;
+ return DNS::LDNS::GC::own($self->_name, $self);
+}
+
+sub DESTROY {
+ DNS::LDNS::GC::free($_[0]);
+}
+
+1;
+__END__
+
+=head1 NAME
+
+DNS::LDNS::RBNode - Node in the RBTree
+
+=head1 SYNOPSIS
+
+ use DNS::LDNS ':all'
+
+ node2 = node->next
+ node2 = node->next_nonglue
+ bool = node->is_null
+ dnssec_name = node->name
+
+=head1 SEE ALSO
+
+http://www.nlnetlabs.nl/projects/ldns
+
+=head1 AUTHOR
+
+Erik Pihl Ostlyngen, E<lt>erik.ostlyngen@uninett.noE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2013 by UNINETT Norid AS
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself, either Perl version 5.14.2 or,
+at your option, any later version of Perl 5 you may have available.
+
+=cut
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/RBTree.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/RBTree.pm
new file mode 100644
index 000000000000..e86bfa8ddfa4
--- /dev/null
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/RBTree.pm
@@ -0,0 +1,59 @@
+package DNS::LDNS::RBTree;
+
+use 5.008008;
+use strict;
+use warnings;
+
+use DNS::LDNS;
+
+our $VERSION = '0.06';
+
+# Note: Since this class does not have a constructor, we can let its child
+# objects be owned by the parent. This reduces the recursion depth on
+# DESTROY.
+
+sub first {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_first, $self);
+}
+
+sub last {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_last, $self);
+}
+
+sub DESTROY {
+ DNS::LDNS::GC::free($_[0]);
+}
+
+1;
+__END__
+
+=head1 NAME
+
+DNS::LDNS::RBTree - Tree of DNSSecName nodes
+
+=head1 SYNOPSIS
+
+ use DNS::LDNS ':all'
+
+ rbnode = rbtree->first
+ rbnode = rbtree->last
+
+=head1 SEE ALSO
+
+http://www.nlnetlabs.nl/projects/ldns
+
+=head1 AUTHOR
+
+Erik Pihl Ostlyngen, E<lt>erik.ostlyngen@uninett.noE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2013 by UNINETT Norid AS
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself, either Perl version 5.14.2 or,
+at your option, any later version of Perl 5 you may have available.
+
+=cut
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/RData.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/RData.pm
new file mode 100644
index 000000000000..76ef5ebac861
--- /dev/null
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/RData.pm
@@ -0,0 +1,91 @@
+package DNS::LDNS::RData;
+
+use 5.008008;
+use strict;
+use warnings;
+
+use DNS::LDNS;
+
+our $VERSION = '0.06';
+
+sub new {
+ my ($class, $type, $str) = @_;
+ return _new($type, $str);
+}
+
+sub cat {
+ my ($self, $other) = @_;
+
+ my $s = _cat($self, $other);
+ $DNS::LDNS::last_status = $s;
+ return $s;
+}
+
+sub nsec3_hash_name {
+ my ($self, $algorithm, $iterations, $salt) = @_;
+ return DNS::LDNS::GC::own(
+ $self->_nsec3_hash_name($algorithm, $iterations, $salt), $self);
+}
+
+sub DESTROY {
+ DNS::LDNS::GC::free($_[0]);
+}
+
+1;
+__END__
+
+=head1 NAME
+
+DNS::LDNS::RData - Rdata field or a dname in an rr
+
+=head1 SYNOPSIS
+
+ use DNS::LDNS ':all'
+
+ my rd = new DNS::LDNS::RData(rdf_type, str)
+ rd2 = rd->clone
+
+ rdf_type = rd->type
+ rd->set_type(rdf_type)
+
+ rd->print(\*FILE)
+ str = rd->to_string
+
+ count = rd->label_count
+ rd2 = rd->label(pos)
+
+ bool = rd->is_wildcard
+ bool = rd->matches_wildcard(wildcard)
+ bool = rd->is_subdomain(parent)
+
+ rd2 = rd->left_chop
+
+ status = rd->cat(rd2)
+ rd->compare(rd2)
+ rd2 = rd->address_reverse
+ rd2 = rd->dname_reverse
+
+ rd2 = rd->nsec3_hash_name(name, algorithm, iterations, salt)
+
+ epoch = rd->to_unix_time
+( epoch = rd->2native_time_t )
+
+ rr_type = rd->to_rr_type
+
+=head1 SEE ALSO
+
+http://www.nlnetlabs.nl/projects/ldns
+
+=head1 AUTHOR
+
+Erik Pihl Ostlyngen, E<lt>erik.ostlyngen@uninett.noE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2013 by UNINETT Norid AS
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself, either Perl version 5.14.2 or,
+at your option, any later version of Perl 5 you may have available.
+
+=cut
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/RR.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/RR.pm
new file mode 100644
index 000000000000..91f34afb4028
--- /dev/null
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/RR.pm
@@ -0,0 +1,481 @@
+package DNS::LDNS::RR;
+
+use 5.008008;
+use strict;
+use warnings;
+
+use DNS::LDNS ':all';
+use Carp 'croak';
+
+our $VERSION = '0.06';
+
+sub new {
+ my $class = shift;
+
+ my $rr;
+ my $status = &LDNS_STATUS_OK;
+
+ if (scalar(@_) == 0) {
+ $rr = _new;
+ }
+ elsif (scalar(@_) == 1) {
+ $rr = _new_from_str($_[0], $DNS::LDNS::DEFAULT_TTL,
+ $DNS::LDNS::DEFAULT_ORIGIN, $status);
+ }
+ else {
+ my %args = @_;
+
+ if ($args{str}) {
+ $rr = _new_from_str($args{str},
+ $args{default_ttl} || $DNS::LDNS::DEFAULT_TTL,
+ $args{origin} || $DNS::LDNS::DEFAULT_ORIGIN,
+ $status);
+ }
+ elsif ($args{filename} or $args{file}) {
+ my $line_nr = 0;
+ my $file = $args{file};
+ if ($args{filename}) {
+ unless (open FILE, $args{filename}) {
+ $DNS::LDNS::last_status = &LDNS_STATUS_FILE_ERR;
+ $DNS::LDNS::line_nr = 0;
+ return;
+ }
+ $file = \*FILE;
+ }
+
+ $rr = _new_from_file($file,
+ $args{default_ttl} || $DNS::LDNS::DEFAULT_TTL,
+ $args{origin} || $DNS::LDNS::DEFAULT_ORIGIN,
+ $status, $line_nr);
+ if ($args{filename}) {
+ close $file;
+ }
+
+ $DNS::LDNS::line_nr = $line_nr;
+ }
+ elsif ($args{type}) {
+ $rr = _new_from_type($args{type});
+ if ($args{owner}) {
+ $rr->set_owner(new DNS::LDNS::RData(
+ &LDNS_RDF_TYPE_DNAME, $args{owner}));
+ }
+ $rr->set_ttl($args{ttl} || $DNS::LDNS::DEFAULT_TTL);
+ $rr->set_class($args{class} || $DNS::LDNS::DEFAULT_CLASS);
+
+ if ($args{rdata}) {
+ if (!$rr->set_rdata(@{$args{rdata}})) {
+ $DNS::LDNS::last_status = &LDNS_STATUS_SYNTAX_RDATA_ERR;
+ return;
+ }
+ }
+ }
+ }
+
+ if (!defined $rr) {
+ $DNS::LDNS::last_status = $status;
+ return;
+ }
+ return $rr;
+}
+
+sub owner {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_owner, $self);
+}
+
+sub set_owner {
+ my ($self, $owner) = @_;
+ DNS::LDNS::GC::disown(my $old = $self->owner);
+ $self->_set_owner($owner);
+ return DNS::LDNS::GC::own($owner, $self);
+}
+
+sub dname {
+ return $_[0]->owner->to_string;
+}
+
+sub rdata {
+ my ($self, $index) = @_;
+ return DNS::LDNS::GC::own($self->_rdata($index), $self);
+}
+
+# replace all existing rdata with new ones. Requires the
+# input array to be exactly same length as rd_count
+sub set_rdata {
+ my ($self, @rdata) = @_;
+
+ if (scalar @rdata != $self->rd_count) {
+ # Hopefully this is a proper error to return here...
+ $DNS::LDNS::last_status = LDNS_STATUS_SYNTAX_RDATA_ERR;
+ return;
+ }
+ my $i = 0;
+ for (@rdata) {
+ my $oldrd = _set_rdata($self, my $copy = $_->clone, $i);
+ DNS::LDNS::GC::disown(my $old = $oldrd);
+ DNS::LDNS::GC::own($copy, $self);
+ $i++;
+ }
+
+ return 1;
+}
+
+sub push_rdata {
+ my ($self, @rdata) = @_;
+
+ for (@rdata) {
+ # Push a copy in case the input rdata are already owned
+ $self->_push_rdata(my $copy = $_->clone);
+ DNS::LDNS::GC::own($copy, $self);
+ }
+}
+
+sub rrsig_typecovered {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_rrsig_typecovered, $self);
+}
+
+sub rrsig_set_typecovered {
+ my ($self, $type) = shift;
+ DNS::LDNS::GC::disown(my $old = $self->rrsig_typecovered);
+ my $result = $self->_rrsig_set_typecovered(my $copy = $type->clone);
+ DNS::LDNS::GC::own($copy, $self);
+ return $result;
+}
+
+sub rrsig_algorithm {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_rrsig_algorithm, $self);
+}
+
+sub rrsig_set_algorithm {
+ my ($self, $algo) = shift;
+ DNS::LDNS::GC::disown(my $old = $self->rrsig_algorithm);
+ my $result = $self->_rrsig_set_algorithm(my $copy = $algo->clone);
+ DNS::LDNS::GC::own($copy, $self);
+ return $result;
+}
+
+sub rrsig_expiration {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_rrsig_expiration, $self);
+}
+
+sub rrsig_set_expiration {
+ my ($self, $date) = shift;
+ DNS::LDNS::GC::disown(my $old = $self->rrsig_expiration);
+ my $result = $self->_rrsig_set_expiration(my $copy = $date->clone);
+ DNS::LDNS::GC::own($copy, $self);
+ return $result;
+}
+
+sub rrsig_inception {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_rrsig_inception, $self);
+}
+
+sub rrsig_set_inception {
+ my ($self, $date) = shift;
+ DNS::LDNS::GC::disown(my $old = $self->rrsig_inception);
+ my $result = $self->_rrsig_set_inception(my $copy = $date->clone);
+ DNS::LDNS::GC::own($copy, $self);
+ return $result;
+}
+
+sub rrsig_keytag {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_rrsig_keytag, $self);
+}
+
+sub rrsig_set_keytag {
+ my ($self, $tag) = shift;
+ DNS::LDNS::GC::disown(my $old = $self->rrsig_keytag);
+ my $result = $self->_rrsig_set_keytag(my $copy = $tag->clone);
+ DNS::LDNS::GC::own($copy, $self);
+ return $result;
+}
+
+sub rrsig_sig {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_rrsig_sig, $self);
+}
+
+sub rrsig_set_sig {
+ my ($self, $sig) = shift;
+ DNS::LDNS::GC::disown(my $old = $self->rrsig_sig);
+ my $result = $self->_rrsig_set_sig(my $copy = $sig->clone);
+ DNS::LDNS::GC::own($copy, $self);
+ return $result;
+}
+
+sub rrsig_labels {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_rrsig_labels, $self);
+}
+
+sub rrsig_set_labels {
+ my ($self, $lab) = shift;
+ DNS::LDNS::GC::disown(my $old = $self->rrsig_labels);
+ my $result = $self->_rrsig_set_labels(my $copy = $lab->clone);
+ DNS::LDNS::GC::own($copy, $self);
+ return $result;
+}
+
+sub rrsig_origttl {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_rrsig_origttl, $self);
+}
+
+sub rrsig_set_origttl {
+ my ($self, $ttl) = shift;
+ DNS::LDNS::GC::disown(my $old = $self->rrsig_origttl);
+ my $result = $self->_rrsig_set_origttl(my $copy = $ttl->clone);
+ DNS::LDNS::GC::own($copy, $self);
+ return $result;
+}
+
+sub rrsig_signame {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_rrsig_signame, $self);
+}
+
+sub rrsig_set_signame {
+ my ($self, $name) = shift;
+ DNS::LDNS::GC::disown(my $old = $self->rrsig_signame);
+ my $result = $self->_rrsig_set_signame(my $copy = $name->clone);
+ DNS::LDNS::GC::own($copy, $self);
+ return $result;
+}
+
+sub dnskey_algorithm {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_dnskey_algorithm, $self);
+}
+
+sub dnskey_set_algorithm {
+ my ($self, $algo) = shift;
+ DNS::LDNS::GC::disown(my $old = $self->dnskey_algorithm);
+ my $result = $self->_dnskey_set_algorithm(my $copy = $algo->clone);
+ DNS::LDNS::GC::own($copy, $self);
+ return $result;
+}
+
+sub dnskey_flags {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_dnskey_flags, $self);
+}
+
+sub dnskey_set_flags {
+ my ($self, $flags) = shift;
+ DNS::LDNS::GC::disown(my $old = $self->flags);
+ my $result = $self->_dnskey_set_flags(my $copy = $flags->clone);
+ DNS::LDNS::GC::own($copy, $self);
+ return $result;
+}
+
+sub dnskey_protocol {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_dnskey_protocol, $self);
+}
+
+sub dnskey_set_protocol {
+ my ($self, $proto) = shift;
+ DNS::LDNS::GC::disown(my $old = $self->dnskey_protocol);
+ my $result = $self->_dnskey_set_protocol(my $copy = $proto->clone);
+ DNS::LDNS::GC::own($copy, $self);
+ return $result;
+}
+
+sub dnskey_key {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_dnskey_key, $self);
+}
+
+sub dnskey_set_key {
+ my ($self, $key) = shift;
+ DNS::LDNS::GC::disown(my $old = $self->dnskey_key);
+ my $result = $self->_dnskey_set_key(my $copy = $key->clone);
+ DNS::LDNS::GC::own($copy, $self);
+ return $result;
+}
+
+sub nsec3_next_owner {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_nsec3_next_owner, $self);
+}
+
+sub nsec3_bitmap {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_nsec3_bitmap, $self);
+}
+
+sub nsec3_salt {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_nsec3_salt, $self);
+}
+
+sub hash_name_from_nsec3 {
+ my ($self, $name) = @_;
+ my $hash = $self->_hash_name_from_nsec3($name);
+ return DNS::LDNS::GC::own($self->_hash_name_from_nsec3($name), $self);
+}
+
+sub verify_denial {
+ my ($self, $nsecs, $rrsigs) = @_;
+ my $s = _verify_denial($self, $nsecs, $rrsigs);
+ $DNS::LDNS::last_status = $s;
+ return $s;
+}
+
+sub verify_denial_nsec3 {
+ my ($self, $nsecs, $rrsigs, $packet_rcode, $packet_qtype,
+ $packet_nodata) = @_;
+ my $s = _verify_denial_nsec3($self, $nsecs, $rrsigs, $packet_rcode,
+ $packet_qtype, $packet_nodata);
+ $DNS::LDNS::last_status = $s;
+ return $s;
+}
+
+sub verify_denial_nsec3_match {
+ my ($self, $nsecs, $rrsigs, $packet_rcode, $packet_qtype,
+ $packet_nodata) = @_;
+
+ my $status;
+ my $match = _verify_denial_nsec3_match($self, $nsecs, $rrsigs, $packet_rcode, $packet_qtype, $packet_nodata, $status);
+ $DNS::LDNS::last_status = $status;
+ if ($status != &LDNS_STATUS_OK) {
+ return;
+ }
+
+ # $match is an RR owned by the $nsecs list.
+ return DNS::LDNS::GC::own($match, $nsecs);
+}
+
+sub DESTROY {
+ DNS::LDNS::GC::free($_[0]);
+}
+
+1;
+__END__
+
+=head1 NAME
+
+DNS::LDNS::RR - Resource record
+
+=head1 SYNOPSIS
+
+ use DNS::LDNS ':all'
+
+ my rr = new DNS::LDNS::RR('mylabel 3600 IN A 168.10.10.10')
+ my rr = new DNS::LDNS::RR(
+ str => 'mylabel 3600 IN A 168.10.10.10',
+ default_ttl => 3600, # optional,
+ origin => new DNS::LDNS::RData(LDNS_RDF_TYPE_NAME, 'myzone.'), " # optional
+ )
+ my rr = new DNS::LDNS::RR(
+ filename => '/path/to/rr',
+ origin => ...)
+ my rr = new DNS::LDNS::RR(
+ file => \*FILE,
+ origin => ...)
+ my rr = new DNS::LDNS::RR(
+ type => LDNS_RR_TYPE_A,
+ rdata => [new DNS::LDNS::RData(...), new DNS::LDNS::RData(...), ...],
+ class => LDNS_RR_CLASS_IN, # optional
+ ttl => 3600, # optional
+ owner => new DNS::LDNS::RData(LDNS_RDF_TYPE_NAME, 'mylabel'), # optional)
+ my rr = new DNS::LDNS::RR
+
+ rr2 = rr->clone
+
+ rr->print(\*FILE)
+ rr->to_string
+
+ ttl = rr->ttl
+ rr->set_ttl(ttl)
+
+ type = rr->type
+ rr->set_type(type)
+
+ class = rr->class
+ rr->set_class(class)
+
+ rdata = rr->owner
+ rr->set_owner(rdata)
+ str = rr->dname
+
+ count = rr->rd_count
+ rdata = rr->rdata(index)
+ rr->set_rdata(rd1, rd2, rd3, ...)
+ rr->push_rdata(rd1, rd2, rd3, ...)
+ rdata = rr->pop_rdata
+
+ rr->compare(rr2)
+ rr->compare_dname(rr2)
+ rr->compare_no_rdata(rr2)
+ rr->compare_ds(rr2)
+
+ hash = rr->hash_name_from_nsec3(dname)
+
+ status = rr->verify_denial(nsecs, rrsigs)
+ status = rr->verify_denial_nsec3(nsecs, rrsigs, packet_rcode, packet_qtype, packet_nodata)
+ match = rr->verify_denial_nsec3_match(nsecs, rrsigs, packet_rcode, packet_qtype, packet_nodata)
+
+ rr->nsec3_add_param_rdfs(algorithm, flags, iterations, salt)
+ a = rr->nsec3_algorithm
+ f = rr->nsec3_flags
+ o = rr->nsec3_optout
+ i = rr->nsec3_iterations
+ rdata = rr->nsec3_next_owner
+ rdata = rr->nsec3_bitmap
+ rdata = rr->nsec3_salt
+
+ rdata = rr->rrsig_keytag
+ bool = rr->rrsig_set_keytag(rdata)
+ rdata = rr->rrsig_signame
+ bool = rr->rrsig_set_signame(rdata)
+ rdata = rr->rrsig_sig
+ bool = rr->rrsig_set_sig(rdata)
+ rdata = rr->rrsig_algorithm
+ bool = rr->rrsig_set_algorithm(rdata)
+ rdata = rr->rrsig_inception
+ bool = rr->rrsig_set_inception(rdata)
+ rdata = rr->rrsig_expiration
+ bool = rr->rrsig_set_expiration(rdata)
+ rdata = rr->rrsig_labels
+ bool = rr->rrsig_set_labels(rdata)
+ rdata = rr->rrsig_origttl
+ bool = rr->rrsig_set_origttl(rdata)
+ key = rr->get_dnskey_for_rrsig(rrlist)
+
+ rdata = rr->dnskey_algorithm
+ bool = rr->dnskey_set_algorithm(rdata)
+ rdata = rr->dnskey_flags
+ bool = rr->dnskey_set_flags(rdata)
+ rdata = rr->dnskey_protocol
+ bool = rr->dnskey_set_protocol(rdata)
+ rdata = rr->dnskey_key
+ bool = rr->dnskey_set_key(rdata)
+ bits = rr->dnskey_key_size
+ tag = rr->calc_keytag
+ ds = rr->key_to_ds(hash)
+
+ rr->is_question
+
+=head1 SEE ALSO
+
+http://www.nlnetlabs.nl/projects/ldns
+
+=head1 AUTHOR
+
+Erik Pihl Ostlyngen, E<lt>erik.ostlyngen@uninett.noE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2013 by UNINETT Norid AS
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself, either Perl version 5.14.2 or,
+at your option, any later version of Perl 5 you may have available.
+
+=cut
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/RRList.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/RRList.pm
new file mode 100644
index 000000000000..11570acbcdde
--- /dev/null
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/RRList.pm
@@ -0,0 +1,183 @@
+package DNS::LDNS::RRList;
+
+use 5.008008;
+use strict;
+use warnings;
+
+use DNS::LDNS;
+
+our $VERSION = '0.06';
+
+sub new {
+ my ($class, %args) = @_;
+
+ if ($args{hosts_filename} or $args{hosts_file}) {
+ my $file = $args{hosts_file};
+ if ($args{hosts_filename}) {
+ unless (open FILE, $args{hosts_filename}) {
+ $DNS::LDNS::last_status = &LDNS_STATUS_FILE_ERR;
+ $DNS::LDNS::line_nr = 0;
+ return;
+ }
+ $file = \*FILE;
+ }
+ my $list = _new_hosts_from_file($file, $DNS::LDNS::line_nr);
+ if ($args{hosts_filename}) {
+ close $file;
+ }
+ return $list;
+ }
+
+ return _new();
+}
+
+sub rr {
+ my ($self, $index) = @_;
+ return DNS::LDNS::GC::own($self->_rr($index), $self);
+}
+
+sub push {
+ my ($self, @rrs) = @_;
+
+ for my $rr (@rrs) {
+ # Push a copy of the rr in case it is already owned
+ $self->_push(my $copy = $rr->clone);
+ DNS::LDNS::GC::own($copy, $self);
+ }
+}
+
+sub push_list {
+ my ($self, $list) = @_;
+
+ $self->_push_list(my $copy = $list->clone);
+ DNS::LDNS::GC::own($copy, $self);
+}
+
+sub verify {
+ my ($self, $sig, $keys) = @_;
+ my $goodkeys = new DNS::LDNS::RRList;
+ my $s = _verify($self, $sig, $keys, $goodkeys);
+ $DNS::LDNS::last_status = $s;
+ return wantarray ? ($s, $goodkeys) : $s;
+}
+
+sub verify_time {
+ my ($self, $sig, $keys, $checktime) = @_;
+ my $goodkeys = new DNS::LDNS::RRList;
+ my $s = _verify_time($self, $sig, $keys, $checktime, $goodkeys);
+ $DNS::LDNS::last_status = $s;
+ return wantarray ? ($s, $goodkeys) : $s;
+}
+
+sub verify_notime {
+ my ($self, $sig, $keys) = @_;
+ my $goodkeys = new DNS::LDNS::RRList;
+ my $s = _verify_notime($self, $sig, $keys, $goodkeys);
+ $DNS::LDNS::last_status = $s;
+ return wantarray ? ($s, $goodkeys) : $s;
+}
+
+sub verify_rrsig_keylist {
+ my ($self, $sig, $keys) = @_;
+ my $goodkeys = new DNS::LDNS::RRList;
+ my $s = _verify_rrsig_keylist($self, $sig, $keys, $goodkeys);
+ $DNS::LDNS::last_status = $s;
+ return wantarray ? ($s, $goodkeys) : $s;
+}
+
+sub verify_rrsig_keylist_notime {
+ my ($self, $sig, $keys, $check_time) = @_;
+ my $goodkeys = new DNS::LDNS::RRList;
+ my $s = _verify_rrsig_keylist_notime($self, $sig, $keys, $goodkeys);
+ $DNS::LDNS::last_status = $s;
+ return wantarray ? ($s, $goodkeys) : $s;
+}
+
+sub get_dnskey_for_rrsig {
+ my ($self, $rrsig) = @_;
+ return DNS::LDNS::GC::own(_get_dnskey_for_rrsig($rrsig, $self), $self);
+}
+
+sub get_rrsig_for_name_and_type {
+ my ($self, $name, $type) = @_;
+ return DNS::LDNS::GC::own(
+ _get_dnskey_for_name_and_type($name, $type, $self), $self);
+}
+
+sub DESTROY {
+ DNS::LDNS::GC::free($_[0]);
+}
+
+1;
+__END__
+
+=head1 NAME
+
+DNS::LDNS::RRList - List of rrs
+
+=head1 SYNOPSIS
+
+ use DNS::LDNS ':all'
+
+ my l = new DNS::LDNS::RRList
+ my l = new DNS::LDNS::RRList(hosts_file => \*FILE)
+ my l = new DNS::LDNS::RRList(hosts_filename => fname)
+ my l2 = l->clone
+
+ l->to_string
+
+ l->print(\*FILE)
+ count = l->rr_count
+
+ rr = l->rr(index)
+ l->push(@rr)
+ rr = l->pop
+
+ l->push_list(l2)
+ l2 = l->pop_list(count)
+ l2 = l->pop_rrset
+
+ l->compare(l2)
+
+ l2 = l->subtype_by_rdata(rdata, pos)
+
+ bool = l->is_rrset
+
+ bool = l->contains_rr(rr)
+
+ (status, goodkeys) = l->verify(sig, keys)
+ (status, goodkeys) = l->verify_time(sig, keys, checktime)
+ (status, goodkeys) = l->verify_notime(sig, keys)
+ (status, goodkeys) = l->verify_rrsig_keylist(sig, keys)
+ (status, goodkeys) = l->verify_rrsig_keylist_time(sig, keys, checktime)
+ (status, goodkeys) = l->verify_rrsig_keylist_notime(sig, keys)
+ status = l->verify_rrsig(sig, keys)
+ status = l->verify_rrsig_time(sig, keys, checktime)
+
+ rr = l->create_empty_rrsig(key)
+ rrlist = l->sign_public(keylist)
+
+ rrlist->canonicalize
+ rrlist->sort
+ rrlist->sort_nsec3 # the list must contain only nsec3 rrs
+
+ rr = keylist->get_dnskey_for_rrsig(rrsig)
+ rr = keylist->get_rrsig_for_name_and_type(name, type)
+
+=head1 SEE ALSO
+
+http://www.nlnetlabs.nl/projects/ldns
+
+=head1 AUTHOR
+
+Erik Pihl Ostlyngen, E<lt>erik.ostlyngen@uninett.noE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2013 by UNINETT Norid AS
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself, either Perl version 5.14.2 or,
+at your option, any later version of Perl 5 you may have available.
+
+=cut
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/Resolver.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/Resolver.pm
new file mode 100644
index 000000000000..111e64f0b7ec
--- /dev/null
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/Resolver.pm
@@ -0,0 +1,355 @@
+package DNS::LDNS::Resolver;
+
+use 5.008008;
+use strict;
+use warnings;
+
+use DNS::LDNS ':all';
+
+our $VERSION = '0.06';
+
+sub new {
+ my ($class, %args) = @_;
+
+ my $file;
+ my $status = &LDNS_STATUS_OK;
+
+ if ($args{filename}) {
+ unless (open FILE, $args{filename}) {
+ $DNS::LDNS::last_status = &LDNS_STATUS_FILE_ERR;
+ $DNS::LDNS::line_nr = 0;
+ return;
+ }
+
+ $file = \*FILE;
+ }
+ elsif ($args{file}) {
+ $file = $args{file};
+ }
+
+ my $resolver;
+ if ($file) {
+ $resolver = _new_from_file($file, $status);
+ }
+ else {
+ $resolver = _new();
+ }
+
+ if ($args{filename}) {
+ close $file;
+ }
+
+ $DNS::LDNS::last_status = $status;
+ if (!defined $resolver) {
+ return;
+ }
+
+ return $resolver;
+}
+
+sub dnssec_anchors {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_dnssec_anchors, $self);
+}
+
+sub push_dnssec_anchor {
+ my ($self, $rr) = @_;
+
+ _push_dnssec_anchor($self, my $copy = $rr->clone);
+ DNS::LDNS::GC::own($copy, $self);
+}
+
+sub set_dnssec_anchors {
+ my ($self, $l) = @_;
+ DNS::LDNS::GC::disown(my $old = $self->dnssec_anchors);
+ $self->_set_dnssec_anchors($l);
+ DNS::LDNS::GC::own($l, $self);
+ return $l;
+}
+
+sub domain {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_domain, $self);
+}
+
+sub set_domain {
+ my ($self, $dom) = @_;
+ DNS::LDNS::GC::disown(my $old = $self->domain);
+ _set_domain($self, my $copy = $dom->clone);
+ DNS::LDNS::GC::own($copy, $self);
+}
+
+sub nameservers {
+ my $self = shift;
+ my $list = _nameservers($self);
+ for my $r (@$list) {
+ DNS::LDNS::GC::own($r, $self);
+ }
+ return wantarray ? @$list : $list;
+}
+
+sub push_nameserver {
+ my ($self, $n) = @_;
+
+ my $s = _push_nameserver($self, my $copy = $n->clone);
+ DNS::LDNS::GC::own($copy, $self);
+ $DNS::LDNS::last_status = $s;
+ return $s;
+}
+
+sub pop_nameserver {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_pop_nameserver);
+}
+
+sub push_searchlist {
+ my ($self, $rd) = @_;
+
+ _push_searchlist($self, my $copy = $rd->clone);
+ DNS::LDNS::GC::own($copy, $self);
+}
+
+sub searchlist {
+ my $self = shift;
+ my $list = _searchlist($self);
+ for my $r (@$list) {
+ DNS::LDNS::GC::own($r, $self);
+ }
+ return wantarray ? @$list : $list;
+}
+
+sub timeout {
+ my $self = shift;
+ my $t = _timeout($self);
+ return wantarray ? @$t : $t;
+}
+
+sub rtt {
+ my $self = shift;
+ my $list = _rtt($self);
+ return wantarray ? @$list : $list;
+}
+
+sub set_rtt {
+ my ($self, @rtt) = @_;
+ # FIXME: Validate @rtt, existence, size
+ _set_rtt($self, \@rtt);
+}
+
+sub fetch_valid_domain_keys {
+ my ($self, $domain, $keys) = @_;
+
+ my $status;
+ my $trusted = _fetch_valid_domain_keys($self, $domain, $keys, $status);
+ $DNS::LDNS::last_status = $status;
+ if (!$trusted) {
+ return;
+ }
+
+ return DNS::LDNS::GC::own($trusted, $self);
+}
+
+sub fetch_valid_domain_keys_time {
+ my ($self, $domain, $keys, $checktime) = @_;
+
+ my $status;
+ my $trusted = _fetch_valid_domain_keys_time(
+ $self, $domain, $keys, $checktime, $status);
+ $DNS::LDNS::last_status = $status;
+ if (!$trusted) {
+ return;
+ }
+
+ return DNS::LDNS::GC::own($trusted, $self);
+}
+
+sub prepare_query_pkt {
+ my ($self, $rdata, $type, $class, $flags) = @_;
+
+ my $s = &LDNS_STATUS_OK;
+ my $qry = _prepare_query_pkt($self, $rdata, $type, $class, $flags, $s);
+ $DNS::LDNS::last_status = $s;
+ if ($s != LDNS_STATUS_OK) {
+ return;
+ }
+ return $qry;
+}
+
+sub send {
+ my ($self, $rdata, $type, $class, $flags) = @_;
+
+ my $s = &LDNS_STATUS_OK;
+ my $ans = _send($self, $rdata, $type, $class, $flags, $s);
+ $DNS::LDNS::last_status = $s;
+ if ($s != LDNS_STATUS_OK) {
+ return;
+ }
+ return $ans;
+}
+
+sub send_pkt {
+ my ($self, $qry) = @_;
+
+ my $s = &LDNS_STATUS_OK;
+ my $ans = _send_pkt($self, $qry, $s);
+ $DNS::LDNS::last_status = $s;
+ if ($s != LDNS_STATUS_OK) {
+ return;
+ }
+ return $ans;
+}
+
+sub verify_trusted {
+ my ($self, $rrset, $rrsigs, $validating_keys) = @_;
+ my $s = _verify_trusted($self, $rrset, $rrsigs, $validating_keys);
+ $DNS::LDNS::last_status = $s;
+ return $s;
+}
+
+sub verify_trusted_time {
+ my ($self, $rrset, $rrsigs, $check_time, $validating_keys) = @_;
+ my $s = _verify_trusted_time($self, $rrset, $rrsigs, $check_time,
+ $validating_keys);
+ $DNS::LDNS::last_status = $s;
+ return $s;
+}
+
+sub DESTROY {
+ DNS::LDNS::GC::free($_[0]);
+}
+
+1;
+__END__
+
+=head1 NAME
+
+DNS::LDNS::Resolver - DNS resolver
+
+=head1 SYNOPSIS
+
+ use DNS::LDNS ':all'
+
+ my r = new DNS::LDNS::Resolver(filename => '/my/resolv.conf')
+ my r = new DNS::LDNS::Resolver(file => \*FILE)
+ my r = new DNS::LDNS::Resolver
+
+ bool = r->dnssec
+ r->set_dnssec(bool)
+
+ bool = r->dnssec_cd # Resolver sets the CD bit
+ r->set_dnssec_cd(bool)
+
+ port = r->port
+ r->set_port(port)
+
+ bool = r->recursive
+ r->set_recursive(bool)
+
+ bool = r->debug
+ r->set_debug(bool)
+
+ count = r->retry
+ r->set_retry(count)
+
+ count = r->retrans
+ r->set_retrans(count)
+
+ bool = r->fallback # Resolver truncation fallback mechanism
+ r->set_fallback(bool)
+
+ bool = r->ip6
+ r->set_ip6(bool)
+
+ size = r->edns_udp_size
+ r->set_edns_udp_size(size)
+
+ bool = r->usevc # Use virtual circuit (TCP)
+ r->set_usevc(bool)
+
+ r->fail
+ r->set_fail
+
+ r->defnames
+ r->set_defnames
+
+ r->dnsrch
+ r->set_dnsrch
+
+ r->igntc
+ r->set_igntc
+
+ bool = r->random # randomize nameserver before usage
+ r->set_random(bool)
+
+ rrlist = r->dnssec_anchors # list of trusted DNSSEC anchors
+ r->push_dnssec_anchor(rr)
+ r->set_dnssec_anchors(rrlist)
+
+ rdata = r->domain # Domain to add to relative queries
+ r->set_domain(rdata)
+
+ @rdata = r->nameservers
+ count = r->nameserver_count
+ r->push_nameserver(rdata)
+ rdata = r->pop_nameserver
+ r->nameservers_randomize
+
+ str = r->tsig_keyname
+ r->set_tsig_keyname(str)
+
+ str = r->tsig_algorithm
+ r->set_tsig_algorithm(str)
+
+ str = r->tsig_keydata
+ r->set_tsig_keydata(str)
+
+ count = r->searchlist_count
+ r->push_searchlist(rdata)
+ @rdata = r->searchlist
+
+ @times = r->rtt # Round trip times
+ r->set_rtt(@rtt)
+ time = r->nameserver_rtt(pos)
+ r->set_nameserver_rtt(pos, time)
+
+ (sec, usec) = r->timeout
+ r->set_timeout(sec, usec)
+
+ # DNSSec validation
+ rrlist = r->fetch_valid_domain_keys(domain, keys)
+ rrlist = r->fetch_valid_domain_keys_time(domain, keys, checktime)
+ rrlist = r->validate_domain_ds(domain, keys)
+ rrlist = r->validate_domain_ds_time(domain, keys, checktime)
+ rrlist = r->validate_domain_dnskey(domain, keys)
+ rrlist = r->validate_domain_dnskey_time(domain, keys, checktime)
+ status = r->verify_trusted(rrset, rrsigs, validation_keys)
+ status = r->verify_trusted_time(rrset, rrsigs, checktime, validation_keys)
+ bool = r->trusted_key(keys, trusted_keys)
+ chain = r->build_data_chain(qflags, dataset, pkt, orig_rr)
+
+ # Query
+ pkt = r->query(rdata, type, class, flags)
+ pkt = r->search(rdata, type, class, flags)
+ query = r->prepare_query_pkt(rdata, type, class, flags)
+ answer = r->send(rdata, type, class, flags)
+ answer = r->send_pkt(query)
+ rrlist = r->get_rr_list_addr_by_name(name, class, flags)
+ rrlist = r->get_rr_list_name_by_addr(addr, class, flags)
+
+=head1 SEE ALSO
+
+http://www.nlnetlabs.nl/projects/ldns
+
+=head1 AUTHOR
+
+Erik Pihl Ostlyngen, E<lt>erik.ostlyngen@uninett.noE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2013 by UNINETT Norid AS
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself, either Perl version 5.14.2 or,
+at your option, any later version of Perl 5 you may have available.
+
+=cut
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/Zone.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/Zone.pm
new file mode 100644
index 000000000000..a42beace7288
--- /dev/null
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/Zone.pm
@@ -0,0 +1,137 @@
+package DNS::LDNS::Zone;
+
+use 5.008008;
+use strict;
+use warnings;
+
+use DNS::LDNS ':all';
+
+our $VERSION = '0.06';
+
+sub new {
+ my ($class, %args) = @_;
+
+ my $line_nr = 0;
+ my $status = &LDNS_STATUS_OK;
+ my $zone;
+ my $file;
+
+ if ($args{filename}) {
+ unless (open FILE, $args{filename}) {
+ $DNS::LDNS::last_status = &LDNS_STATUS_FILE_ERR;
+ $DNS::LDNS::line_nr = 0;
+ return;
+ }
+
+ $file = \*FILE;
+ }
+
+ if ($file) {
+ $zone = _new_from_file($file,
+ $args{origin} || $DNS::LDNS::DEFAULT_ORIGIN,
+ $args{default_ttl} || $DNS::LDNS::DEFAULT_TTL,
+ $args{class} || $DNS::LDNS::DEFAULT_CLASS,
+ $status, $line_nr);
+ }
+ else {
+ $zone = _new();
+ }
+
+ if ($args{filename}) {
+ close $file;
+ }
+
+ $DNS::LDNS::last_status = $status;
+ $DNS::LDNS::line_nr = $line_nr;
+ if (!defined $zone) {
+ return;
+ }
+
+ return $zone;
+}
+
+sub to_string {
+ my $self = shift;
+
+ return join('', map { $self->$_ ? $self->$_->to_string : '' } qw/soa rrs/);
+}
+
+sub soa {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_soa, $self);
+}
+
+sub set_soa {
+ my ($self, $soa) = @_;
+ DNS::LDNS::GC::disown(my $old = $self->soa);
+ $self->_set_soa(my $copy = $soa->clone);
+ return DNS::LDNS::GC::own($copy, $self);
+}
+
+sub rrs {
+ my $self = shift;
+ return DNS::LDNS::GC::own($self->_rrs, $self);
+}
+
+sub set_rrs {
+ my ($self, $list) = @_;
+ DNS::LDNS::GC::disown(my $old = $self->rrs);
+ $self->_set_rrs(my $copy = $list->clone);
+ return DNS::LDNS::GC::own($copy, $self);
+}
+
+sub DESTROY {
+ DNS::LDNS::GC::free($_[0]);
+}
+
+1;
+__END__
+
+=head1 NAME
+
+DNS::LDNS::Zone - Parsed zonefile
+
+=head1 SYNOPSIS
+
+ use DNS::LDNS ':all'
+
+ my z = new DNS::LDNS::Zone(
+ filename => '/path/to/myzone',
+ origin => new DNS::LDNS::RData(LDNS_RDF_TYPE_DNAME, 'myzone'), #optional
+ default_ttl => 3600, #optional
+ class => LDNS_RR_CLASS_IN, #optional
+ )
+ my z = new DNS::LDNS::Zone(
+ file => \*FILE,
+ origin => ..., default_ttl => ..., class => ...
+ )
+ my z = new DNS::LDNS::Zone
+
+ z->to_string
+ z->print(\*FILE)
+ z->canonicalize
+ z->sort
+ rr = z->soa
+ z->set_soa(rr)
+ rrlist = z->rrs
+ z->set_rrs(rrlist)
+ z->sign(keylist)
+ z->sign_nsec3(keylist, algorithm, flags, iterations, salt)
+
+=head1 SEE ALSO
+
+http://www.nlnetlabs.nl/projects/ldns
+
+=head1 AUTHOR
+
+Erik Pihl Ostlyngen, E<lt>erik.ostlyngen@uninett.noE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2013 by UNINETT Norid AS
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself, either Perl version 5.14.2 or,
+at your option, any later version of Perl 5 you may have available.
+
+=cut
diff --git a/contrib/DNS-LDNS/ppport.h b/contrib/DNS-LDNS/ppport.h
new file mode 100644
index 000000000000..6d650f440d44
--- /dev/null
+++ b/contrib/DNS-LDNS/ppport.h
@@ -0,0 +1,7063 @@
+#if 0
+<<'SKIP';
+#endif
+/*
+----------------------------------------------------------------------
+
+ ppport.h -- Perl/Pollution/Portability Version 3.19
+
+ Automatically created by Devel::PPPort running under perl 5.014002.
+
+ Do NOT edit this file directly! -- Edit PPPort_pm.PL and the
+ includes in parts/inc/ instead.
+
+ Use 'perldoc ppport.h' to view the documentation below.
+
+----------------------------------------------------------------------
+
+SKIP
+
+=pod
+
+=head1 NAME
+
+ppport.h - Perl/Pollution/Portability version 3.19
+
+=head1 SYNOPSIS
+
+ perl ppport.h [options] [source files]
+
+ Searches current directory for files if no [source files] are given
+
+ --help show short help
+
+ --version show version
+
+ --patch=file write one patch file with changes
+ --copy=suffix write changed copies with suffix
+ --diff=program use diff program and options
+
+ --compat-version=version provide compatibility with Perl version
+ --cplusplus accept C++ comments
+
+ --quiet don't output anything except fatal errors
+ --nodiag don't show diagnostics
+ --nohints don't show hints
+ --nochanges don't suggest changes
+ --nofilter don't filter input files
+
+ --strip strip all script and doc functionality from
+ ppport.h
+
+ --list-provided list provided API
+ --list-unsupported list unsupported API
+ --api-info=name show Perl API portability information
+
+=head1 COMPATIBILITY
+
+This version of F<ppport.h> is designed to support operation with Perl
+installations back to 5.003, and has been tested up to 5.10.0.
+
+=head1 OPTIONS
+
+=head2 --help
+
+Display a brief usage summary.
+
+=head2 --version
+
+Display the version of F<ppport.h>.
+
+=head2 --patch=I<file>
+
+If this option is given, a single patch file will be created if
+any changes are suggested. This requires a working diff program
+to be installed on your system.
+
+=head2 --copy=I<suffix>
+
+If this option is given, a copy of each file will be saved with
+the given suffix that contains the suggested changes. This does
+not require any external programs. Note that this does not
+automagially add a dot between the original filename and the
+suffix. If you want the dot, you have to include it in the option
+argument.
+
+If neither C<--patch> or C<--copy> are given, the default is to
+simply print the diffs for each file. This requires either
+C<Text::Diff> or a C<diff> program to be installed.
+
+=head2 --diff=I<program>
+
+Manually set the diff program and options to use. The default
+is to use C<Text::Diff>, when installed, and output unified
+context diffs.
+
+=head2 --compat-version=I<version>
+
+Tell F<ppport.h> to check for compatibility with the given
+Perl version. The default is to check for compatibility with Perl
+version 5.003. You can use this option to reduce the output
+of F<ppport.h> if you intend to be backward compatible only
+down to a certain Perl version.
+
+=head2 --cplusplus
+
+Usually, F<ppport.h> will detect C++ style comments and
+replace them with C style comments for portability reasons.
+Using this option instructs F<ppport.h> to leave C++
+comments untouched.
+
+=head2 --quiet
+
+Be quiet. Don't print anything except fatal errors.
+
+=head2 --nodiag
+
+Don't output any diagnostic messages. Only portability
+alerts will be printed.
+
+=head2 --nohints
+
+Don't output any hints. Hints often contain useful portability
+notes. Warnings will still be displayed.
+
+=head2 --nochanges
+
+Don't suggest any changes. Only give diagnostic output and hints
+unless these are also deactivated.
+
+=head2 --nofilter
+
+Don't filter the list of input files. By default, files not looking
+like source code (i.e. not *.xs, *.c, *.cc, *.cpp or *.h) are skipped.
+
+=head2 --strip
+
+Strip all script and documentation functionality from F<ppport.h>.
+This reduces the size of F<ppport.h> dramatically and may be useful
+if you want to include F<ppport.h> in smaller modules without
+increasing their distribution size too much.
+
+The stripped F<ppport.h> will have a C<--unstrip> option that allows
+you to undo the stripping, but only if an appropriate C<Devel::PPPort>
+module is installed.
+
+=head2 --list-provided
+
+Lists the API elements for which compatibility is provided by
+F<ppport.h>. Also lists if it must be explicitly requested,
+if it has dependencies, and if there are hints or warnings for it.
+
+=head2 --list-unsupported
+
+Lists the API elements that are known not to be supported by
+F<ppport.h> and below which version of Perl they probably
+won't be available or work.
+
+=head2 --api-info=I<name>
+
+Show portability information for API elements matching I<name>.
+If I<name> is surrounded by slashes, it is interpreted as a regular
+expression.
+
+=head1 DESCRIPTION
+
+In order for a Perl extension (XS) module to be as portable as possible
+across differing versions of Perl itself, certain steps need to be taken.
+
+=over 4
+
+=item *
+
+Including this header is the first major one. This alone will give you
+access to a large part of the Perl API that hasn't been available in
+earlier Perl releases. Use
+
+ perl ppport.h --list-provided
+
+to see which API elements are provided by ppport.h.
+
+=item *
+
+You should avoid using deprecated parts of the API. For example, using
+global Perl variables without the C<PL_> prefix is deprecated. Also,
+some API functions used to have a C<perl_> prefix. Using this form is
+also deprecated. You can safely use the supported API, as F<ppport.h>
+will provide wrappers for older Perl versions.
+
+=item *
+
+If you use one of a few functions or variables that were not present in
+earlier versions of Perl, and that can't be provided using a macro, you
+have to explicitly request support for these functions by adding one or
+more C<#define>s in your source code before the inclusion of F<ppport.h>.
+
+These functions or variables will be marked C<explicit> in the list shown
+by C<--list-provided>.
+
+Depending on whether you module has a single or multiple files that
+use such functions or variables, you want either C<static> or global
+variants.
+
+For a C<static> function or variable (used only in a single source
+file), use:
+
+ #define NEED_function
+ #define NEED_variable
+
+For a global function or variable (used in multiple source files),
+use:
+
+ #define NEED_function_GLOBAL
+ #define NEED_variable_GLOBAL
+
+Note that you mustn't have more than one global request for the
+same function or variable in your project.
+
+ Function / Variable Static Request Global Request
+ -----------------------------------------------------------------------------------------
+ PL_parser NEED_PL_parser NEED_PL_parser_GLOBAL
+ PL_signals NEED_PL_signals NEED_PL_signals_GLOBAL
+ eval_pv() NEED_eval_pv NEED_eval_pv_GLOBAL
+ grok_bin() NEED_grok_bin NEED_grok_bin_GLOBAL
+ grok_hex() NEED_grok_hex NEED_grok_hex_GLOBAL
+ grok_number() NEED_grok_number NEED_grok_number_GLOBAL
+ grok_numeric_radix() NEED_grok_numeric_radix NEED_grok_numeric_radix_GLOBAL
+ grok_oct() NEED_grok_oct NEED_grok_oct_GLOBAL
+ load_module() NEED_load_module NEED_load_module_GLOBAL
+ my_snprintf() NEED_my_snprintf NEED_my_snprintf_GLOBAL
+ my_sprintf() NEED_my_sprintf NEED_my_sprintf_GLOBAL
+ my_strlcat() NEED_my_strlcat NEED_my_strlcat_GLOBAL
+ my_strlcpy() NEED_my_strlcpy NEED_my_strlcpy_GLOBAL
+ newCONSTSUB() NEED_newCONSTSUB NEED_newCONSTSUB_GLOBAL
+ newRV_noinc() NEED_newRV_noinc NEED_newRV_noinc_GLOBAL
+ newSV_type() NEED_newSV_type NEED_newSV_type_GLOBAL
+ newSVpvn_flags() NEED_newSVpvn_flags NEED_newSVpvn_flags_GLOBAL
+ newSVpvn_share() NEED_newSVpvn_share NEED_newSVpvn_share_GLOBAL
+ pv_display() NEED_pv_display NEED_pv_display_GLOBAL
+ pv_escape() NEED_pv_escape NEED_pv_escape_GLOBAL
+ pv_pretty() NEED_pv_pretty NEED_pv_pretty_GLOBAL
+ sv_2pv_flags() NEED_sv_2pv_flags NEED_sv_2pv_flags_GLOBAL
+ sv_2pvbyte() NEED_sv_2pvbyte NEED_sv_2pvbyte_GLOBAL
+ sv_catpvf_mg() NEED_sv_catpvf_mg NEED_sv_catpvf_mg_GLOBAL
+ sv_catpvf_mg_nocontext() NEED_sv_catpvf_mg_nocontext NEED_sv_catpvf_mg_nocontext_GLOBAL
+ sv_pvn_force_flags() NEED_sv_pvn_force_flags NEED_sv_pvn_force_flags_GLOBAL
+ sv_setpvf_mg() NEED_sv_setpvf_mg NEED_sv_setpvf_mg_GLOBAL
+ sv_setpvf_mg_nocontext() NEED_sv_setpvf_mg_nocontext NEED_sv_setpvf_mg_nocontext_GLOBAL
+ vload_module() NEED_vload_module NEED_vload_module_GLOBAL
+ vnewSVpvf() NEED_vnewSVpvf NEED_vnewSVpvf_GLOBAL
+ warner() NEED_warner NEED_warner_GLOBAL
+
+To avoid namespace conflicts, you can change the namespace of the
+explicitly exported functions / variables using the C<DPPP_NAMESPACE>
+macro. Just C<#define> the macro before including C<ppport.h>:
+
+ #define DPPP_NAMESPACE MyOwnNamespace_
+ #include "ppport.h"
+
+The default namespace is C<DPPP_>.
+
+=back
+
+The good thing is that most of the above can be checked by running
+F<ppport.h> on your source code. See the next section for
+details.
+
+=head1 EXAMPLES
+
+To verify whether F<ppport.h> is needed for your module, whether you
+should make any changes to your code, and whether any special defines
+should be used, F<ppport.h> can be run as a Perl script to check your
+source code. Simply say:
+
+ perl ppport.h
+
+The result will usually be a list of patches suggesting changes
+that should at least be acceptable, if not necessarily the most
+efficient solution, or a fix for all possible problems.
+
+If you know that your XS module uses features only available in
+newer Perl releases, if you're aware that it uses C++ comments,
+and if you want all suggestions as a single patch file, you could
+use something like this:
+
+ perl ppport.h --compat-version=5.6.0 --cplusplus --patch=test.diff
+
+If you only want your code to be scanned without any suggestions
+for changes, use:
+
+ perl ppport.h --nochanges
+
+You can specify a different C<diff> program or options, using
+the C<--diff> option:
+
+ perl ppport.h --diff='diff -C 10'
+
+This would output context diffs with 10 lines of context.
+
+If you want to create patched copies of your files instead, use:
+
+ perl ppport.h --copy=.new
+
+To display portability information for the C<newSVpvn> function,
+use:
+
+ perl ppport.h --api-info=newSVpvn
+
+Since the argument to C<--api-info> can be a regular expression,
+you can use
+
+ perl ppport.h --api-info=/_nomg$/
+
+to display portability information for all C<_nomg> functions or
+
+ perl ppport.h --api-info=/./
+
+to display information for all known API elements.
+
+=head1 BUGS
+
+If this version of F<ppport.h> is causing failure during
+the compilation of this module, please check if newer versions
+of either this module or C<Devel::PPPort> are available on CPAN
+before sending a bug report.
+
+If F<ppport.h> was generated using the latest version of
+C<Devel::PPPort> and is causing failure of this module, please
+file a bug report using the CPAN Request Tracker at L<http://rt.cpan.org/>.
+
+Please include the following information:
+
+=over 4
+
+=item 1.
+
+The complete output from running "perl -V"
+
+=item 2.
+
+This file.
+
+=item 3.
+
+The name and version of the module you were trying to build.
+
+=item 4.
+
+A full log of the build that failed.
+
+=item 5.
+
+Any other information that you think could be relevant.
+
+=back
+
+For the latest version of this code, please get the C<Devel::PPPort>
+module from CPAN.
+
+=head1 COPYRIGHT
+
+Version 3.x, Copyright (c) 2004-2009, Marcus Holland-Moritz.
+
+Version 2.x, Copyright (C) 2001, Paul Marquess.
+
+Version 1.x, Copyright (C) 1999, Kenneth Albanowski.
+
+This program is free software; you can redistribute it and/or
+modify it under the same terms as Perl itself.
+
+=head1 SEE ALSO
+
+See L<Devel::PPPort>.
+
+=cut
+
+use strict;
+
+# Disable broken TRIE-optimization
+BEGIN { eval '${^RE_TRIE_MAXBUF} = -1' if $] >= 5.009004 && $] <= 5.009005 }
+
+my $VERSION = 3.19;
+
+my %opt = (
+ quiet => 0,
+ diag => 1,
+ hints => 1,
+ changes => 1,
+ cplusplus => 0,
+ filter => 1,
+ strip => 0,
+ version => 0,
+);
+
+my($ppport) = $0 =~ /([\w.]+)$/;
+my $LF = '(?:\r\n|[\r\n])'; # line feed
+my $HS = "[ \t]"; # horizontal whitespace
+
+# Never use C comments in this file!
+my $ccs = '/'.'*';
+my $cce = '*'.'/';
+my $rccs = quotemeta $ccs;
+my $rcce = quotemeta $cce;
+
+eval {
+ require Getopt::Long;
+ Getopt::Long::GetOptions(\%opt, qw(
+ help quiet diag! filter! hints! changes! cplusplus strip version
+ patch=s copy=s diff=s compat-version=s
+ list-provided list-unsupported api-info=s
+ )) or usage();
+};
+
+if ($@ and grep /^-/, @ARGV) {
+ usage() if "@ARGV" =~ /^--?h(?:elp)?$/;
+ die "Getopt::Long not found. Please don't use any options.\n";
+}
+
+if ($opt{version}) {
+ print "This is $0 $VERSION.\n";
+ exit 0;
+}
+
+usage() if $opt{help};
+strip() if $opt{strip};
+
+if (exists $opt{'compat-version'}) {
+ my($r,$v,$s) = eval { parse_version($opt{'compat-version'}) };
+ if ($@) {
+ die "Invalid version number format: '$opt{'compat-version'}'\n";
+ }
+ die "Only Perl 5 is supported\n" if $r != 5;
+ die "Invalid version number: $opt{'compat-version'}\n" if $v >= 1000 || $s >= 1000;
+ $opt{'compat-version'} = sprintf "%d.%03d%03d", $r, $v, $s;
+}
+else {
+ $opt{'compat-version'} = 5;
+}
+
+my %API = map { /^(\w+)\|([^|]*)\|([^|]*)\|(\w*)$/
+ ? ( $1 => {
+ ($2 ? ( base => $2 ) : ()),
+ ($3 ? ( todo => $3 ) : ()),
+ (index($4, 'v') >= 0 ? ( varargs => 1 ) : ()),
+ (index($4, 'p') >= 0 ? ( provided => 1 ) : ()),
+ (index($4, 'n') >= 0 ? ( nothxarg => 1 ) : ()),
+ } )
+ : die "invalid spec: $_" } qw(
+AvFILLp|5.004050||p
+AvFILL|||
+CLASS|||n
+CPERLscope|5.005000||p
+CX_CURPAD_SAVE|||
+CX_CURPAD_SV|||
+CopFILEAV|5.006000||p
+CopFILEGV_set|5.006000||p
+CopFILEGV|5.006000||p
+CopFILESV|5.006000||p
+CopFILE_set|5.006000||p
+CopFILE|5.006000||p
+CopSTASHPV_set|5.006000||p
+CopSTASHPV|5.006000||p
+CopSTASH_eq|5.006000||p
+CopSTASH_set|5.006000||p
+CopSTASH|5.006000||p
+CopyD|5.009002||p
+Copy|||
+CvPADLIST|||
+CvSTASH|||
+CvWEAKOUTSIDE|||
+DEFSV_set|5.011000||p
+DEFSV|5.004050||p
+END_EXTERN_C|5.005000||p
+ENTER|||
+ERRSV|5.004050||p
+EXTEND|||
+EXTERN_C|5.005000||p
+F0convert|||n
+FREETMPS|||
+GIMME_V||5.004000|n
+GIMME|||n
+GROK_NUMERIC_RADIX|5.007002||p
+G_ARRAY|||
+G_DISCARD|||
+G_EVAL|||
+G_METHOD|5.006001||p
+G_NOARGS|||
+G_SCALAR|||
+G_VOID||5.004000|
+GetVars|||
+GvSVn|5.009003||p
+GvSV|||
+Gv_AMupdate|||
+HEf_SVKEY||5.004000|
+HeHASH||5.004000|
+HeKEY||5.004000|
+HeKLEN||5.004000|
+HePV||5.004000|
+HeSVKEY_force||5.004000|
+HeSVKEY_set||5.004000|
+HeSVKEY||5.004000|
+HeUTF8||5.011000|
+HeVAL||5.004000|
+HvNAMELEN_get|5.009003||p
+HvNAME_get|5.009003||p
+HvNAME|||
+INT2PTR|5.006000||p
+IN_LOCALE_COMPILETIME|5.007002||p
+IN_LOCALE_RUNTIME|5.007002||p
+IN_LOCALE|5.007002||p
+IN_PERL_COMPILETIME|5.008001||p
+IS_NUMBER_GREATER_THAN_UV_MAX|5.007002||p
+IS_NUMBER_INFINITY|5.007002||p
+IS_NUMBER_IN_UV|5.007002||p
+IS_NUMBER_NAN|5.007003||p
+IS_NUMBER_NEG|5.007002||p
+IS_NUMBER_NOT_INT|5.007002||p
+IVSIZE|5.006000||p
+IVTYPE|5.006000||p
+IVdf|5.006000||p
+LEAVE|||
+LVRET|||
+MARK|||
+MULTICALL||5.011000|
+MY_CXT_CLONE|5.009002||p
+MY_CXT_INIT|5.007003||p
+MY_CXT|5.007003||p
+MoveD|5.009002||p
+Move|||
+NOOP|5.005000||p
+NUM2PTR|5.006000||p
+NVTYPE|5.006000||p
+NVef|5.006001||p
+NVff|5.006001||p
+NVgf|5.006001||p
+Newxc|5.009003||p
+Newxz|5.009003||p
+Newx|5.009003||p
+Nullav|||
+Nullch|||
+Nullcv|||
+Nullhv|||
+Nullsv|||
+ORIGMARK|||
+PAD_BASE_SV|||
+PAD_CLONE_VARS|||
+PAD_COMPNAME_FLAGS|||
+PAD_COMPNAME_GEN_set|||
+PAD_COMPNAME_GEN|||
+PAD_COMPNAME_OURSTASH|||
+PAD_COMPNAME_PV|||
+PAD_COMPNAME_TYPE|||
+PAD_DUP|||
+PAD_RESTORE_LOCAL|||
+PAD_SAVE_LOCAL|||
+PAD_SAVE_SETNULLPAD|||
+PAD_SETSV|||
+PAD_SET_CUR_NOSAVE|||
+PAD_SET_CUR|||
+PAD_SVl|||
+PAD_SV|||
+PERLIO_FUNCS_CAST|5.009003||p
+PERLIO_FUNCS_DECL|5.009003||p
+PERL_ABS|5.008001||p
+PERL_BCDVERSION|5.011000||p
+PERL_GCC_BRACE_GROUPS_FORBIDDEN|5.008001||p
+PERL_HASH|5.004000||p
+PERL_INT_MAX|5.004000||p
+PERL_INT_MIN|5.004000||p
+PERL_LONG_MAX|5.004000||p
+PERL_LONG_MIN|5.004000||p
+PERL_MAGIC_arylen|5.007002||p
+PERL_MAGIC_backref|5.007002||p
+PERL_MAGIC_bm|5.007002||p
+PERL_MAGIC_collxfrm|5.007002||p
+PERL_MAGIC_dbfile|5.007002||p
+PERL_MAGIC_dbline|5.007002||p
+PERL_MAGIC_defelem|5.007002||p
+PERL_MAGIC_envelem|5.007002||p
+PERL_MAGIC_env|5.007002||p
+PERL_MAGIC_ext|5.007002||p
+PERL_MAGIC_fm|5.007002||p
+PERL_MAGIC_glob|5.011000||p
+PERL_MAGIC_isaelem|5.007002||p
+PERL_MAGIC_isa|5.007002||p
+PERL_MAGIC_mutex|5.011000||p
+PERL_MAGIC_nkeys|5.007002||p
+PERL_MAGIC_overload_elem|5.007002||p
+PERL_MAGIC_overload_table|5.007002||p
+PERL_MAGIC_overload|5.007002||p
+PERL_MAGIC_pos|5.007002||p
+PERL_MAGIC_qr|5.007002||p
+PERL_MAGIC_regdata|5.007002||p
+PERL_MAGIC_regdatum|5.007002||p
+PERL_MAGIC_regex_global|5.007002||p
+PERL_MAGIC_shared_scalar|5.007003||p
+PERL_MAGIC_shared|5.007003||p
+PERL_MAGIC_sigelem|5.007002||p
+PERL_MAGIC_sig|5.007002||p
+PERL_MAGIC_substr|5.007002||p
+PERL_MAGIC_sv|5.007002||p
+PERL_MAGIC_taint|5.007002||p
+PERL_MAGIC_tiedelem|5.007002||p
+PERL_MAGIC_tiedscalar|5.007002||p
+PERL_MAGIC_tied|5.007002||p
+PERL_MAGIC_utf8|5.008001||p
+PERL_MAGIC_uvar_elem|5.007003||p
+PERL_MAGIC_uvar|5.007002||p
+PERL_MAGIC_vec|5.007002||p
+PERL_MAGIC_vstring|5.008001||p
+PERL_PV_ESCAPE_ALL|5.009004||p
+PERL_PV_ESCAPE_FIRSTCHAR|5.009004||p
+PERL_PV_ESCAPE_NOBACKSLASH|5.009004||p
+PERL_PV_ESCAPE_NOCLEAR|5.009004||p
+PERL_PV_ESCAPE_QUOTE|5.009004||p
+PERL_PV_ESCAPE_RE|5.009005||p
+PERL_PV_ESCAPE_UNI_DETECT|5.009004||p
+PERL_PV_ESCAPE_UNI|5.009004||p
+PERL_PV_PRETTY_DUMP|5.009004||p
+PERL_PV_PRETTY_ELLIPSES|5.010000||p
+PERL_PV_PRETTY_LTGT|5.009004||p
+PERL_PV_PRETTY_NOCLEAR|5.010000||p
+PERL_PV_PRETTY_QUOTE|5.009004||p
+PERL_PV_PRETTY_REGPROP|5.009004||p
+PERL_QUAD_MAX|5.004000||p
+PERL_QUAD_MIN|5.004000||p
+PERL_REVISION|5.006000||p
+PERL_SCAN_ALLOW_UNDERSCORES|5.007003||p
+PERL_SCAN_DISALLOW_PREFIX|5.007003||p
+PERL_SCAN_GREATER_THAN_UV_MAX|5.007003||p
+PERL_SCAN_SILENT_ILLDIGIT|5.008001||p
+PERL_SHORT_MAX|5.004000||p
+PERL_SHORT_MIN|5.004000||p
+PERL_SIGNALS_UNSAFE_FLAG|5.008001||p
+PERL_SUBVERSION|5.006000||p
+PERL_SYS_INIT3||5.006000|
+PERL_SYS_INIT|||
+PERL_SYS_TERM||5.011000|
+PERL_UCHAR_MAX|5.004000||p
+PERL_UCHAR_MIN|5.004000||p
+PERL_UINT_MAX|5.004000||p
+PERL_UINT_MIN|5.004000||p
+PERL_ULONG_MAX|5.004000||p
+PERL_ULONG_MIN|5.004000||p
+PERL_UNUSED_ARG|5.009003||p
+PERL_UNUSED_CONTEXT|5.009004||p
+PERL_UNUSED_DECL|5.007002||p
+PERL_UNUSED_VAR|5.007002||p
+PERL_UQUAD_MAX|5.004000||p
+PERL_UQUAD_MIN|5.004000||p
+PERL_USE_GCC_BRACE_GROUPS|5.009004||p
+PERL_USHORT_MAX|5.004000||p
+PERL_USHORT_MIN|5.004000||p
+PERL_VERSION|5.006000||p
+PL_DBsignal|5.005000||p
+PL_DBsingle|||pn
+PL_DBsub|||pn
+PL_DBtrace|||pn
+PL_Sv|5.005000||p
+PL_bufend|5.011000||p
+PL_bufptr|5.011000||p
+PL_compiling|5.004050||p
+PL_copline|5.011000||p
+PL_curcop|5.004050||p
+PL_curstash|5.004050||p
+PL_debstash|5.004050||p
+PL_defgv|5.004050||p
+PL_diehook|5.004050||p
+PL_dirty|5.004050||p
+PL_dowarn|||pn
+PL_errgv|5.004050||p
+PL_error_count|5.011000||p
+PL_expect|5.011000||p
+PL_hexdigit|5.005000||p
+PL_hints|5.005000||p
+PL_in_my_stash|5.011000||p
+PL_in_my|5.011000||p
+PL_last_in_gv|||n
+PL_laststatval|5.005000||p
+PL_lex_state|5.011000||p
+PL_lex_stuff|5.011000||p
+PL_linestr|5.011000||p
+PL_modglobal||5.005000|n
+PL_na|5.004050||pn
+PL_no_modify|5.006000||p
+PL_ofsgv|||n
+PL_parser|5.009005||p
+PL_perl_destruct_level|5.004050||p
+PL_perldb|5.004050||p
+PL_ppaddr|5.006000||p
+PL_rsfp_filters|5.004050||p
+PL_rsfp|5.004050||p
+PL_rs|||n
+PL_signals|5.008001||p
+PL_stack_base|5.004050||p
+PL_stack_sp|5.004050||p
+PL_statcache|5.005000||p
+PL_stdingv|5.004050||p
+PL_sv_arenaroot|5.004050||p
+PL_sv_no|5.004050||pn
+PL_sv_undef|5.004050||pn
+PL_sv_yes|5.004050||pn
+PL_tainted|5.004050||p
+PL_tainting|5.004050||p
+PL_tokenbuf|5.011000||p
+POP_MULTICALL||5.011000|
+POPi|||n
+POPl|||n
+POPn|||n
+POPpbytex||5.007001|n
+POPpx||5.005030|n
+POPp|||n
+POPs|||n
+PTR2IV|5.006000||p
+PTR2NV|5.006000||p
+PTR2UV|5.006000||p
+PTR2nat|5.009003||p
+PTR2ul|5.007001||p
+PTRV|5.006000||p
+PUSHMARK|||
+PUSH_MULTICALL||5.011000|
+PUSHi|||
+PUSHmortal|5.009002||p
+PUSHn|||
+PUSHp|||
+PUSHs|||
+PUSHu|5.004000||p
+PUTBACK|||
+PerlIO_clearerr||5.007003|
+PerlIO_close||5.007003|
+PerlIO_context_layers||5.009004|
+PerlIO_eof||5.007003|
+PerlIO_error||5.007003|
+PerlIO_fileno||5.007003|
+PerlIO_fill||5.007003|
+PerlIO_flush||5.007003|
+PerlIO_get_base||5.007003|
+PerlIO_get_bufsiz||5.007003|
+PerlIO_get_cnt||5.007003|
+PerlIO_get_ptr||5.007003|
+PerlIO_read||5.007003|
+PerlIO_seek||5.007003|
+PerlIO_set_cnt||5.007003|
+PerlIO_set_ptrcnt||5.007003|
+PerlIO_setlinebuf||5.007003|
+PerlIO_stderr||5.007003|
+PerlIO_stdin||5.007003|
+PerlIO_stdout||5.007003|
+PerlIO_tell||5.007003|
+PerlIO_unread||5.007003|
+PerlIO_write||5.007003|
+Perl_signbit||5.009005|n
+PoisonFree|5.009004||p
+PoisonNew|5.009004||p
+PoisonWith|5.009004||p
+Poison|5.008000||p
+RETVAL|||n
+Renewc|||
+Renew|||
+SAVECLEARSV|||
+SAVECOMPPAD|||
+SAVEPADSV|||
+SAVETMPS|||
+SAVE_DEFSV|5.004050||p
+SPAGAIN|||
+SP|||
+START_EXTERN_C|5.005000||p
+START_MY_CXT|5.007003||p
+STMT_END|||p
+STMT_START|||p
+STR_WITH_LEN|5.009003||p
+ST|||
+SV_CONST_RETURN|5.009003||p
+SV_COW_DROP_PV|5.008001||p
+SV_COW_SHARED_HASH_KEYS|5.009005||p
+SV_GMAGIC|5.007002||p
+SV_HAS_TRAILING_NUL|5.009004||p
+SV_IMMEDIATE_UNREF|5.007001||p
+SV_MUTABLE_RETURN|5.009003||p
+SV_NOSTEAL|5.009002||p
+SV_SMAGIC|5.009003||p
+SV_UTF8_NO_ENCODING|5.008001||p
+SVfARG|5.009005||p
+SVf_UTF8|5.006000||p
+SVf|5.006000||p
+SVt_IV|||
+SVt_NV|||
+SVt_PVAV|||
+SVt_PVCV|||
+SVt_PVHV|||
+SVt_PVMG|||
+SVt_PV|||
+Safefree|||
+Slab_Alloc|||
+Slab_Free|||
+Slab_to_rw|||
+StructCopy|||
+SvCUR_set|||
+SvCUR|||
+SvEND|||
+SvGAMAGIC||5.006001|
+SvGETMAGIC|5.004050||p
+SvGROW|||
+SvIOK_UV||5.006000|
+SvIOK_notUV||5.006000|
+SvIOK_off|||
+SvIOK_only_UV||5.006000|
+SvIOK_only|||
+SvIOK_on|||
+SvIOKp|||
+SvIOK|||
+SvIVX|||
+SvIV_nomg|5.009001||p
+SvIV_set|||
+SvIVx|||
+SvIV|||
+SvIsCOW_shared_hash||5.008003|
+SvIsCOW||5.008003|
+SvLEN_set|||
+SvLEN|||
+SvLOCK||5.007003|
+SvMAGIC_set|5.009003||p
+SvNIOK_off|||
+SvNIOKp|||
+SvNIOK|||
+SvNOK_off|||
+SvNOK_only|||
+SvNOK_on|||
+SvNOKp|||
+SvNOK|||
+SvNVX|||
+SvNV_set|||
+SvNVx|||
+SvNV|||
+SvOK|||
+SvOOK_offset||5.011000|
+SvOOK|||
+SvPOK_off|||
+SvPOK_only_UTF8||5.006000|
+SvPOK_only|||
+SvPOK_on|||
+SvPOKp|||
+SvPOK|||
+SvPVX_const|5.009003||p
+SvPVX_mutable|5.009003||p
+SvPVX|||
+SvPV_const|5.009003||p
+SvPV_flags_const_nolen|5.009003||p
+SvPV_flags_const|5.009003||p
+SvPV_flags_mutable|5.009003||p
+SvPV_flags|5.007002||p
+SvPV_force_flags_mutable|5.009003||p
+SvPV_force_flags_nolen|5.009003||p
+SvPV_force_flags|5.007002||p
+SvPV_force_mutable|5.009003||p
+SvPV_force_nolen|5.009003||p
+SvPV_force_nomg_nolen|5.009003||p
+SvPV_force_nomg|5.007002||p
+SvPV_force|||p
+SvPV_mutable|5.009003||p
+SvPV_nolen_const|5.009003||p
+SvPV_nolen|5.006000||p
+SvPV_nomg_const_nolen|5.009003||p
+SvPV_nomg_const|5.009003||p
+SvPV_nomg|5.007002||p
+SvPV_renew|5.009003||p
+SvPV_set|||
+SvPVbyte_force||5.009002|
+SvPVbyte_nolen||5.006000|
+SvPVbytex_force||5.006000|
+SvPVbytex||5.006000|
+SvPVbyte|5.006000||p
+SvPVutf8_force||5.006000|
+SvPVutf8_nolen||5.006000|
+SvPVutf8x_force||5.006000|
+SvPVutf8x||5.006000|
+SvPVutf8||5.006000|
+SvPVx|||
+SvPV|||
+SvREFCNT_dec|||
+SvREFCNT_inc_NN|5.009004||p
+SvREFCNT_inc_simple_NN|5.009004||p
+SvREFCNT_inc_simple_void_NN|5.009004||p
+SvREFCNT_inc_simple_void|5.009004||p
+SvREFCNT_inc_simple|5.009004||p
+SvREFCNT_inc_void_NN|5.009004||p
+SvREFCNT_inc_void|5.009004||p
+SvREFCNT_inc|||p
+SvREFCNT|||
+SvROK_off|||
+SvROK_on|||
+SvROK|||
+SvRV_set|5.009003||p
+SvRV|||
+SvRXOK||5.009005|
+SvRX||5.009005|
+SvSETMAGIC|||
+SvSHARED_HASH|5.009003||p
+SvSHARE||5.007003|
+SvSTASH_set|5.009003||p
+SvSTASH|||
+SvSetMagicSV_nosteal||5.004000|
+SvSetMagicSV||5.004000|
+SvSetSV_nosteal||5.004000|
+SvSetSV|||
+SvTAINTED_off||5.004000|
+SvTAINTED_on||5.004000|
+SvTAINTED||5.004000|
+SvTAINT|||
+SvTRUE|||
+SvTYPE|||
+SvUNLOCK||5.007003|
+SvUOK|5.007001|5.006000|p
+SvUPGRADE|||
+SvUTF8_off||5.006000|
+SvUTF8_on||5.006000|
+SvUTF8||5.006000|
+SvUVXx|5.004000||p
+SvUVX|5.004000||p
+SvUV_nomg|5.009001||p
+SvUV_set|5.009003||p
+SvUVx|5.004000||p
+SvUV|5.004000||p
+SvVOK||5.008001|
+SvVSTRING_mg|5.009004||p
+THIS|||n
+UNDERBAR|5.009002||p
+UTF8_MAXBYTES|5.009002||p
+UVSIZE|5.006000||p
+UVTYPE|5.006000||p
+UVXf|5.007001||p
+UVof|5.006000||p
+UVuf|5.006000||p
+UVxf|5.006000||p
+WARN_ALL|5.006000||p
+WARN_AMBIGUOUS|5.006000||p
+WARN_ASSERTIONS|5.011000||p
+WARN_BAREWORD|5.006000||p
+WARN_CLOSED|5.006000||p
+WARN_CLOSURE|5.006000||p
+WARN_DEBUGGING|5.006000||p
+WARN_DEPRECATED|5.006000||p
+WARN_DIGIT|5.006000||p
+WARN_EXEC|5.006000||p
+WARN_EXITING|5.006000||p
+WARN_GLOB|5.006000||p
+WARN_INPLACE|5.006000||p
+WARN_INTERNAL|5.006000||p
+WARN_IO|5.006000||p
+WARN_LAYER|5.008000||p
+WARN_MALLOC|5.006000||p
+WARN_MISC|5.006000||p
+WARN_NEWLINE|5.006000||p
+WARN_NUMERIC|5.006000||p
+WARN_ONCE|5.006000||p
+WARN_OVERFLOW|5.006000||p
+WARN_PACK|5.006000||p
+WARN_PARENTHESIS|5.006000||p
+WARN_PIPE|5.006000||p
+WARN_PORTABLE|5.006000||p
+WARN_PRECEDENCE|5.006000||p
+WARN_PRINTF|5.006000||p
+WARN_PROTOTYPE|5.006000||p
+WARN_QW|5.006000||p
+WARN_RECURSION|5.006000||p
+WARN_REDEFINE|5.006000||p
+WARN_REGEXP|5.006000||p
+WARN_RESERVED|5.006000||p
+WARN_SEMICOLON|5.006000||p
+WARN_SEVERE|5.006000||p
+WARN_SIGNAL|5.006000||p
+WARN_SUBSTR|5.006000||p
+WARN_SYNTAX|5.006000||p
+WARN_TAINT|5.006000||p
+WARN_THREADS|5.008000||p
+WARN_UNINITIALIZED|5.006000||p
+WARN_UNOPENED|5.006000||p
+WARN_UNPACK|5.006000||p
+WARN_UNTIE|5.006000||p
+WARN_UTF8|5.006000||p
+WARN_VOID|5.006000||p
+XCPT_CATCH|5.009002||p
+XCPT_RETHROW|5.009002||p
+XCPT_TRY_END|5.009002||p
+XCPT_TRY_START|5.009002||p
+XPUSHi|||
+XPUSHmortal|5.009002||p
+XPUSHn|||
+XPUSHp|||
+XPUSHs|||
+XPUSHu|5.004000||p
+XSPROTO|5.010000||p
+XSRETURN_EMPTY|||
+XSRETURN_IV|||
+XSRETURN_NO|||
+XSRETURN_NV|||
+XSRETURN_PV|||
+XSRETURN_UNDEF|||
+XSRETURN_UV|5.008001||p
+XSRETURN_YES|||
+XSRETURN|||p
+XST_mIV|||
+XST_mNO|||
+XST_mNV|||
+XST_mPV|||
+XST_mUNDEF|||
+XST_mUV|5.008001||p
+XST_mYES|||
+XS_VERSION_BOOTCHECK|||
+XS_VERSION|||
+XSprePUSH|5.006000||p
+XS|||
+ZeroD|5.009002||p
+Zero|||
+_aMY_CXT|5.007003||p
+_pMY_CXT|5.007003||p
+aMY_CXT_|5.007003||p
+aMY_CXT|5.007003||p
+aTHXR_|5.011000||p
+aTHXR|5.011000||p
+aTHX_|5.006000||p
+aTHX|5.006000||p
+add_data|||n
+addmad|||
+allocmy|||
+amagic_call|||
+amagic_cmp_locale|||
+amagic_cmp|||
+amagic_i_ncmp|||
+amagic_ncmp|||
+any_dup|||
+ao|||
+append_elem|||
+append_list|||
+append_madprops|||
+apply_attrs_my|||
+apply_attrs_string||5.006001|
+apply_attrs|||
+apply|||
+atfork_lock||5.007003|n
+atfork_unlock||5.007003|n
+av_arylen_p||5.009003|
+av_clear|||
+av_create_and_push||5.009005|
+av_create_and_unshift_one||5.009005|
+av_delete||5.006000|
+av_exists||5.006000|
+av_extend|||
+av_fetch|||
+av_fill|||
+av_iter_p||5.011000|
+av_len|||
+av_make|||
+av_pop|||
+av_push|||
+av_reify|||
+av_shift|||
+av_store|||
+av_undef|||
+av_unshift|||
+ax|||n
+bad_type|||
+bind_match|||
+block_end|||
+block_gimme||5.004000|
+block_start|||
+boolSV|5.004000||p
+boot_core_PerlIO|||
+boot_core_UNIVERSAL|||
+boot_core_mro|||
+bytes_from_utf8||5.007001|
+bytes_to_uni|||n
+bytes_to_utf8||5.006001|
+call_argv|5.006000||p
+call_atexit||5.006000|
+call_list||5.004000|
+call_method|5.006000||p
+call_pv|5.006000||p
+call_sv|5.006000||p
+calloc||5.007002|n
+cando|||
+cast_i32||5.006000|
+cast_iv||5.006000|
+cast_ulong||5.006000|
+cast_uv||5.006000|
+check_type_and_open|||
+check_uni|||
+checkcomma|||
+checkposixcc|||
+ckWARN|5.006000||p
+ck_anoncode|||
+ck_bitop|||
+ck_concat|||
+ck_defined|||
+ck_delete|||
+ck_die|||
+ck_each|||
+ck_eof|||
+ck_eval|||
+ck_exec|||
+ck_exists|||
+ck_exit|||
+ck_ftst|||
+ck_fun|||
+ck_glob|||
+ck_grep|||
+ck_index|||
+ck_join|||
+ck_lfun|||
+ck_listiob|||
+ck_match|||
+ck_method|||
+ck_null|||
+ck_open|||
+ck_readline|||
+ck_repeat|||
+ck_require|||
+ck_return|||
+ck_rfun|||
+ck_rvconst|||
+ck_sassign|||
+ck_select|||
+ck_shift|||
+ck_sort|||
+ck_spair|||
+ck_split|||
+ck_subr|||
+ck_substr|||
+ck_svconst|||
+ck_trunc|||
+ck_unpack|||
+ckwarn_d||5.009003|
+ckwarn||5.009003|
+cl_and|||n
+cl_anything|||n
+cl_init_zero|||n
+cl_init|||n
+cl_is_anything|||n
+cl_or|||n
+clear_placeholders|||
+closest_cop|||
+convert|||
+cop_free|||
+cr_textfilter|||
+create_eval_scope|||
+croak_nocontext|||vn
+croak_xs_usage||5.011000|
+croak|||v
+csighandler||5.009003|n
+curmad|||
+custom_op_desc||5.007003|
+custom_op_name||5.007003|
+cv_ckproto_len|||
+cv_clone|||
+cv_const_sv||5.004000|
+cv_dump|||
+cv_undef|||
+cx_dump||5.005000|
+cx_dup|||
+cxinc|||
+dAXMARK|5.009003||p
+dAX|5.007002||p
+dITEMS|5.007002||p
+dMARK|||
+dMULTICALL||5.009003|
+dMY_CXT_SV|5.007003||p
+dMY_CXT|5.007003||p
+dNOOP|5.006000||p
+dORIGMARK|||
+dSP|||
+dTHR|5.004050||p
+dTHXR|5.011000||p
+dTHXa|5.006000||p
+dTHXoa|5.006000||p
+dTHX|5.006000||p
+dUNDERBAR|5.009002||p
+dVAR|5.009003||p
+dXCPT|5.009002||p
+dXSARGS|||
+dXSI32|||
+dXSTARG|5.006000||p
+deb_curcv|||
+deb_nocontext|||vn
+deb_stack_all|||
+deb_stack_n|||
+debop||5.005000|
+debprofdump||5.005000|
+debprof|||
+debstackptrs||5.007003|
+debstack||5.007003|
+debug_start_match|||
+deb||5.007003|v
+del_sv|||
+delete_eval_scope|||
+delimcpy||5.004000|
+deprecate_old|||
+deprecate|||
+despatch_signals||5.007001|
+destroy_matcher|||
+die_nocontext|||vn
+die_where|||
+die|||v
+dirp_dup|||
+div128|||
+djSP|||
+do_aexec5|||
+do_aexec|||
+do_aspawn|||
+do_binmode||5.004050|
+do_chomp|||
+do_chop|||
+do_close|||
+do_dump_pad|||
+do_eof|||
+do_exec3|||
+do_execfree|||
+do_exec|||
+do_gv_dump||5.006000|
+do_gvgv_dump||5.006000|
+do_hv_dump||5.006000|
+do_ipcctl|||
+do_ipcget|||
+do_join|||
+do_kv|||
+do_magic_dump||5.006000|
+do_msgrcv|||
+do_msgsnd|||
+do_oddball|||
+do_op_dump||5.006000|
+do_op_xmldump|||
+do_open9||5.006000|
+do_openn||5.007001|
+do_open||5.004000|
+do_pmop_dump||5.006000|
+do_pmop_xmldump|||
+do_print|||
+do_readline|||
+do_seek|||
+do_semop|||
+do_shmio|||
+do_smartmatch|||
+do_spawn_nowait|||
+do_spawn|||
+do_sprintf|||
+do_sv_dump||5.006000|
+do_sysseek|||
+do_tell|||
+do_trans_complex_utf8|||
+do_trans_complex|||
+do_trans_count_utf8|||
+do_trans_count|||
+do_trans_simple_utf8|||
+do_trans_simple|||
+do_trans|||
+do_vecget|||
+do_vecset|||
+do_vop|||
+docatch|||
+doeval|||
+dofile|||
+dofindlabel|||
+doform|||
+doing_taint||5.008001|n
+dooneliner|||
+doopen_pm|||
+doparseform|||
+dopoptoeval|||
+dopoptogiven|||
+dopoptolabel|||
+dopoptoloop|||
+dopoptosub_at|||
+dopoptowhen|||
+doref||5.009003|
+dounwind|||
+dowantarray|||
+dump_all||5.006000|
+dump_eval||5.006000|
+dump_exec_pos|||
+dump_fds|||
+dump_form||5.006000|
+dump_indent||5.006000|v
+dump_mstats|||
+dump_packsubs||5.006000|
+dump_sub||5.006000|
+dump_sv_child|||
+dump_trie_interim_list|||
+dump_trie_interim_table|||
+dump_trie|||
+dump_vindent||5.006000|
+dumpuntil|||
+dup_attrlist|||
+emulate_cop_io|||
+eval_pv|5.006000||p
+eval_sv|5.006000||p
+exec_failed|||
+expect_number|||
+fbm_compile||5.005000|
+fbm_instr||5.005000|
+feature_is_enabled|||
+fetch_cop_label||5.011000|
+filter_add|||
+filter_del|||
+filter_gets|||
+filter_read|||
+find_and_forget_pmops|||
+find_array_subscript|||
+find_beginning|||
+find_byclass|||
+find_hash_subscript|||
+find_in_my_stash|||
+find_runcv||5.008001|
+find_rundefsvoffset||5.009002|
+find_script|||
+find_uninit_var|||
+first_symbol|||n
+fold_constants|||
+forbid_setid|||
+force_ident|||
+force_list|||
+force_next|||
+force_version|||
+force_word|||
+forget_pmop|||
+form_nocontext|||vn
+form||5.004000|v
+fp_dup|||
+fprintf_nocontext|||vn
+free_global_struct|||
+free_tied_hv_pool|||
+free_tmps|||
+gen_constant_list|||
+get_arena|||
+get_aux_mg|||
+get_av|5.006000||p
+get_context||5.006000|n
+get_cvn_flags||5.009005|
+get_cv|5.006000||p
+get_db_sub|||
+get_debug_opts|||
+get_hash_seed|||
+get_hv|5.006000||p
+get_isa_hash|||
+get_mstats|||
+get_no_modify|||
+get_num|||
+get_op_descs||5.005000|
+get_op_names||5.005000|
+get_opargs|||
+get_ppaddr||5.006000|
+get_re_arg|||
+get_sv|5.006000||p
+get_vtbl||5.005030|
+getcwd_sv||5.007002|
+getenv_len|||
+glob_2number|||
+glob_assign_glob|||
+glob_assign_ref|||
+gp_dup|||
+gp_free|||
+gp_ref|||
+grok_bin|5.007003||p
+grok_hex|5.007003||p
+grok_number|5.007002||p
+grok_numeric_radix|5.007002||p
+grok_oct|5.007003||p
+group_end|||
+gv_AVadd|||
+gv_HVadd|||
+gv_IOadd|||
+gv_SVadd|||
+gv_autoload4||5.004000|
+gv_check|||
+gv_const_sv||5.009003|
+gv_dump||5.006000|
+gv_efullname3||5.004000|
+gv_efullname4||5.006001|
+gv_efullname|||
+gv_ename|||
+gv_fetchfile_flags||5.009005|
+gv_fetchfile|||
+gv_fetchmeth_autoload||5.007003|
+gv_fetchmethod_autoload||5.004000|
+gv_fetchmethod_flags||5.011000|
+gv_fetchmethod|||
+gv_fetchmeth|||
+gv_fetchpvn_flags|5.009002||p
+gv_fetchpvs|5.009004||p
+gv_fetchpv|||
+gv_fetchsv||5.009002|
+gv_fullname3||5.004000|
+gv_fullname4||5.006001|
+gv_fullname|||
+gv_get_super_pkg|||
+gv_handler||5.007001|
+gv_init_sv|||
+gv_init|||
+gv_name_set||5.009004|
+gv_stashpvn|5.004000||p
+gv_stashpvs|5.009003||p
+gv_stashpv|||
+gv_stashsv|||
+he_dup|||
+hek_dup|||
+hfreeentries|||
+hsplit|||
+hv_assert||5.011000|
+hv_auxinit|||n
+hv_backreferences_p|||
+hv_clear_placeholders||5.009001|
+hv_clear|||
+hv_common_key_len||5.010000|
+hv_common||5.010000|
+hv_copy_hints_hv|||
+hv_delayfree_ent||5.004000|
+hv_delete_common|||
+hv_delete_ent||5.004000|
+hv_delete|||
+hv_eiter_p||5.009003|
+hv_eiter_set||5.009003|
+hv_exists_ent||5.004000|
+hv_exists|||
+hv_fetch_ent||5.004000|
+hv_fetchs|5.009003||p
+hv_fetch|||
+hv_free_ent||5.004000|
+hv_iterinit|||
+hv_iterkeysv||5.004000|
+hv_iterkey|||
+hv_iternext_flags||5.008000|
+hv_iternextsv|||
+hv_iternext|||
+hv_iterval|||
+hv_kill_backrefs|||
+hv_ksplit||5.004000|
+hv_magic_check|||n
+hv_magic|||
+hv_name_set||5.009003|
+hv_notallowed|||
+hv_placeholders_get||5.009003|
+hv_placeholders_p||5.009003|
+hv_placeholders_set||5.009003|
+hv_riter_p||5.009003|
+hv_riter_set||5.009003|
+hv_scalar||5.009001|
+hv_store_ent||5.004000|
+hv_store_flags||5.008000|
+hv_stores|5.009004||p
+hv_store|||
+hv_undef|||
+ibcmp_locale||5.004000|
+ibcmp_utf8||5.007003|
+ibcmp|||
+incline|||
+incpush_if_exists|||
+incpush_use_sep|||
+incpush|||
+ingroup|||
+init_argv_symbols|||
+init_debugger|||
+init_global_struct|||
+init_i18nl10n||5.006000|
+init_i18nl14n||5.006000|
+init_ids|||
+init_interp|||
+init_main_stash|||
+init_perllib|||
+init_postdump_symbols|||
+init_predump_symbols|||
+init_stacks||5.005000|
+init_tm||5.007002|
+instr|||
+intro_my|||
+intuit_method|||
+intuit_more|||
+invert|||
+io_close|||
+isALNUMC|5.006000||p
+isALNUM|||
+isALPHA|||
+isASCII|5.006000||p
+isBLANK|5.006001||p
+isCNTRL|5.006000||p
+isDIGIT|||
+isGRAPH|5.006000||p
+isGV_with_GP|5.009004||p
+isLOWER|||
+isPRINT|5.004000||p
+isPSXSPC|5.006001||p
+isPUNCT|5.006000||p
+isSPACE|||
+isUPPER|||
+isXDIGIT|5.006000||p
+is_an_int|||
+is_gv_magical_sv|||
+is_handle_constructor|||n
+is_list_assignment|||
+is_lvalue_sub||5.007001|
+is_uni_alnum_lc||5.006000|
+is_uni_alnumc_lc||5.006000|
+is_uni_alnumc||5.006000|
+is_uni_alnum||5.006000|
+is_uni_alpha_lc||5.006000|
+is_uni_alpha||5.006000|
+is_uni_ascii_lc||5.006000|
+is_uni_ascii||5.006000|
+is_uni_cntrl_lc||5.006000|
+is_uni_cntrl||5.006000|
+is_uni_digit_lc||5.006000|
+is_uni_digit||5.006000|
+is_uni_graph_lc||5.006000|
+is_uni_graph||5.006000|
+is_uni_idfirst_lc||5.006000|
+is_uni_idfirst||5.006000|
+is_uni_lower_lc||5.006000|
+is_uni_lower||5.006000|
+is_uni_print_lc||5.006000|
+is_uni_print||5.006000|
+is_uni_punct_lc||5.006000|
+is_uni_punct||5.006000|
+is_uni_space_lc||5.006000|
+is_uni_space||5.006000|
+is_uni_upper_lc||5.006000|
+is_uni_upper||5.006000|
+is_uni_xdigit_lc||5.006000|
+is_uni_xdigit||5.006000|
+is_utf8_alnumc||5.006000|
+is_utf8_alnum||5.006000|
+is_utf8_alpha||5.006000|
+is_utf8_ascii||5.006000|
+is_utf8_char_slow|||n
+is_utf8_char||5.006000|
+is_utf8_cntrl||5.006000|
+is_utf8_common|||
+is_utf8_digit||5.006000|
+is_utf8_graph||5.006000|
+is_utf8_idcont||5.008000|
+is_utf8_idfirst||5.006000|
+is_utf8_lower||5.006000|
+is_utf8_mark||5.006000|
+is_utf8_print||5.006000|
+is_utf8_punct||5.006000|
+is_utf8_space||5.006000|
+is_utf8_string_loclen||5.009003|
+is_utf8_string_loc||5.008001|
+is_utf8_string||5.006001|
+is_utf8_upper||5.006000|
+is_utf8_xdigit||5.006000|
+isa_lookup|||
+items|||n
+ix|||n
+jmaybe|||
+join_exact|||
+keyword|||
+leave_scope|||
+lex_end|||
+lex_start|||
+linklist|||
+listkids|||
+list|||
+load_module_nocontext|||vn
+load_module|5.006000||pv
+localize|||
+looks_like_bool|||
+looks_like_number|||
+lop|||
+mPUSHi|5.009002||p
+mPUSHn|5.009002||p
+mPUSHp|5.009002||p
+mPUSHs|5.011000||p
+mPUSHu|5.009002||p
+mXPUSHi|5.009002||p
+mXPUSHn|5.009002||p
+mXPUSHp|5.009002||p
+mXPUSHs|5.011000||p
+mXPUSHu|5.009002||p
+mad_free|||
+madlex|||
+madparse|||
+magic_clear_all_env|||
+magic_clearenv|||
+magic_clearhint|||
+magic_clearisa|||
+magic_clearpack|||
+magic_clearsig|||
+magic_dump||5.006000|
+magic_existspack|||
+magic_freearylen_p|||
+magic_freeovrld|||
+magic_getarylen|||
+magic_getdefelem|||
+magic_getnkeys|||
+magic_getpack|||
+magic_getpos|||
+magic_getsig|||
+magic_getsubstr|||
+magic_gettaint|||
+magic_getuvar|||
+magic_getvec|||
+magic_get|||
+magic_killbackrefs|||
+magic_len|||
+magic_methcall|||
+magic_methpack|||
+magic_nextpack|||
+magic_regdata_cnt|||
+magic_regdatum_get|||
+magic_regdatum_set|||
+magic_scalarpack|||
+magic_set_all_env|||
+magic_setamagic|||
+magic_setarylen|||
+magic_setcollxfrm|||
+magic_setdbline|||
+magic_setdefelem|||
+magic_setenv|||
+magic_sethint|||
+magic_setisa|||
+magic_setmglob|||
+magic_setnkeys|||
+magic_setpack|||
+magic_setpos|||
+magic_setregexp|||
+magic_setsig|||
+magic_setsubstr|||
+magic_settaint|||
+magic_setutf8|||
+magic_setuvar|||
+magic_setvec|||
+magic_set|||
+magic_sizepack|||
+magic_wipepack|||
+make_matcher|||
+make_trie_failtable|||
+make_trie|||
+malloc_good_size|||n
+malloced_size|||n
+malloc||5.007002|n
+markstack_grow|||
+matcher_matches_sv|||
+measure_struct|||
+memEQ|5.004000||p
+memNE|5.004000||p
+mem_collxfrm|||
+mem_log_common|||n
+mess_alloc|||
+mess_nocontext|||vn
+mess||5.006000|v
+method_common|||
+mfree||5.007002|n
+mg_clear|||
+mg_copy|||
+mg_dup|||
+mg_find|||
+mg_free|||
+mg_get|||
+mg_length||5.005000|
+mg_localize|||
+mg_magical|||
+mg_set|||
+mg_size||5.005000|
+mini_mktime||5.007002|
+missingterm|||
+mode_from_discipline|||
+modkids|||
+mod|||
+more_bodies|||
+more_sv|||
+moreswitches|||
+mro_get_from_name||5.011000|
+mro_get_linear_isa_dfs|||
+mro_get_linear_isa||5.009005|
+mro_get_private_data||5.011000|
+mro_isa_changed_in|||
+mro_meta_dup|||
+mro_meta_init|||
+mro_method_changed_in||5.009005|
+mro_register||5.011000|
+mro_set_mro||5.011000|
+mro_set_private_data||5.011000|
+mul128|||
+mulexp10|||n
+my_atof2||5.007002|
+my_atof||5.006000|
+my_attrs|||
+my_bcopy|||n
+my_betoh16|||n
+my_betoh32|||n
+my_betoh64|||n
+my_betohi|||n
+my_betohl|||n
+my_betohs|||n
+my_bzero|||n
+my_chsize|||
+my_clearenv|||
+my_cxt_index|||
+my_cxt_init|||
+my_dirfd||5.009005|
+my_exit_jump|||
+my_exit|||
+my_failure_exit||5.004000|
+my_fflush_all||5.006000|
+my_fork||5.007003|n
+my_htobe16|||n
+my_htobe32|||n
+my_htobe64|||n
+my_htobei|||n
+my_htobel|||n
+my_htobes|||n
+my_htole16|||n
+my_htole32|||n
+my_htole64|||n
+my_htolei|||n
+my_htolel|||n
+my_htoles|||n
+my_htonl|||
+my_kid|||
+my_letoh16|||n
+my_letoh32|||n
+my_letoh64|||n
+my_letohi|||n
+my_letohl|||n
+my_letohs|||n
+my_lstat|||
+my_memcmp||5.004000|n
+my_memset|||n
+my_ntohl|||
+my_pclose||5.004000|
+my_popen_list||5.007001|
+my_popen||5.004000|
+my_setenv|||
+my_snprintf|5.009004||pvn
+my_socketpair||5.007003|n
+my_sprintf|5.009003||pvn
+my_stat|||
+my_strftime||5.007002|
+my_strlcat|5.009004||pn
+my_strlcpy|5.009004||pn
+my_swabn|||n
+my_swap|||
+my_unexec|||
+my_vsnprintf||5.009004|n
+need_utf8|||n
+newANONATTRSUB||5.006000|
+newANONHASH|||
+newANONLIST|||
+newANONSUB|||
+newASSIGNOP|||
+newATTRSUB||5.006000|
+newAVREF|||
+newAV|||
+newBINOP|||
+newCONDOP|||
+newCONSTSUB|5.004050||p
+newCVREF|||
+newDEFSVOP|||
+newFORM|||
+newFOROP|||
+newGIVENOP||5.009003|
+newGIVWHENOP|||
+newGP|||
+newGVOP|||
+newGVREF|||
+newGVgen|||
+newHVREF|||
+newHVhv||5.005000|
+newHV|||
+newIO|||
+newLISTOP|||
+newLOGOP|||
+newLOOPEX|||
+newLOOPOP|||
+newMADPROP|||
+newMADsv|||
+newMYSUB|||
+newNULLLIST|||
+newOP|||
+newPADOP|||
+newPMOP|||
+newPROG|||
+newPVOP|||
+newRANGE|||
+newRV_inc|5.004000||p
+newRV_noinc|5.004000||p
+newRV|||
+newSLICEOP|||
+newSTATEOP|||
+newSUB|||
+newSVOP|||
+newSVREF|||
+newSV_type|5.009005||p
+newSVhek||5.009003|
+newSViv|||
+newSVnv|||
+newSVpvf_nocontext|||vn
+newSVpvf||5.004000|v
+newSVpvn_flags|5.011000||p
+newSVpvn_share|5.007001||p
+newSVpvn_utf8|5.011000||p
+newSVpvn|5.004050||p
+newSVpvs_flags|5.011000||p
+newSVpvs_share||5.009003|
+newSVpvs|5.009003||p
+newSVpv|||
+newSVrv|||
+newSVsv|||
+newSVuv|5.006000||p
+newSV|||
+newTOKEN|||
+newUNOP|||
+newWHENOP||5.009003|
+newWHILEOP||5.009003|
+newXS_flags||5.009004|
+newXSproto||5.006000|
+newXS||5.006000|
+new_collate||5.006000|
+new_constant|||
+new_ctype||5.006000|
+new_he|||
+new_logop|||
+new_numeric||5.006000|
+new_stackinfo||5.005000|
+new_version||5.009000|
+new_warnings_bitfield|||
+next_symbol|||
+nextargv|||
+nextchar|||
+ninstr|||
+no_bareword_allowed|||
+no_fh_allowed|||
+no_op|||
+not_a_number|||
+nothreadhook||5.008000|
+nuke_stacks|||
+num_overflow|||n
+offer_nice_chunk|||
+oopsAV|||
+oopsHV|||
+op_clear|||
+op_const_sv|||
+op_dump||5.006000|
+op_free|||
+op_getmad_weak|||
+op_getmad|||
+op_null||5.007002|
+op_refcnt_dec|||
+op_refcnt_inc|||
+op_refcnt_lock||5.009002|
+op_refcnt_unlock||5.009002|
+op_xmldump|||
+open_script|||
+pMY_CXT_|5.007003||p
+pMY_CXT|5.007003||p
+pTHX_|5.006000||p
+pTHX|5.006000||p
+packWARN|5.007003||p
+pack_cat||5.007003|
+pack_rec|||
+package|||
+packlist||5.008001|
+pad_add_anon|||
+pad_add_name|||
+pad_alloc|||
+pad_block_start|||
+pad_check_dup|||
+pad_compname_type|||
+pad_findlex|||
+pad_findmy|||
+pad_fixup_inner_anons|||
+pad_free|||
+pad_leavemy|||
+pad_new|||
+pad_peg|||n
+pad_push|||
+pad_reset|||
+pad_setsv|||
+pad_sv||5.011000|
+pad_swipe|||
+pad_tidy|||
+pad_undef|||
+parse_body|||
+parse_unicode_opts|||
+parser_dup|||
+parser_free|||
+path_is_absolute|||n
+peep|||
+pending_Slabs_to_ro|||
+perl_alloc_using|||n
+perl_alloc|||n
+perl_clone_using|||n
+perl_clone|||n
+perl_construct|||n
+perl_destruct||5.007003|n
+perl_free|||n
+perl_parse||5.006000|n
+perl_run|||n
+pidgone|||
+pm_description|||
+pmflag|||
+pmop_dump||5.006000|
+pmop_xmldump|||
+pmruntime|||
+pmtrans|||
+pop_scope|||
+pregcomp||5.009005|
+pregexec|||
+pregfree2||5.011000|
+pregfree|||
+prepend_elem|||
+prepend_madprops|||
+printbuf|||
+printf_nocontext|||vn
+process_special_blocks|||
+ptr_table_clear||5.009005|
+ptr_table_fetch||5.009005|
+ptr_table_find|||n
+ptr_table_free||5.009005|
+ptr_table_new||5.009005|
+ptr_table_split||5.009005|
+ptr_table_store||5.009005|
+push_scope|||
+put_byte|||
+pv_display|5.006000||p
+pv_escape|5.009004||p
+pv_pretty|5.009004||p
+pv_uni_display||5.007003|
+qerror|||
+qsortsvu|||
+re_compile||5.009005|
+re_croak2|||
+re_dup_guts|||
+re_intuit_start||5.009005|
+re_intuit_string||5.006000|
+readpipe_override|||
+realloc||5.007002|n
+reentrant_free|||
+reentrant_init|||
+reentrant_retry|||vn
+reentrant_size|||
+ref_array_or_hash|||
+refcounted_he_chain_2hv|||
+refcounted_he_fetch|||
+refcounted_he_free|||
+refcounted_he_new_common|||
+refcounted_he_new|||
+refcounted_he_value|||
+refkids|||
+refto|||
+ref||5.011000|
+reg_check_named_buff_matched|||
+reg_named_buff_all||5.009005|
+reg_named_buff_exists||5.009005|
+reg_named_buff_fetch||5.009005|
+reg_named_buff_firstkey||5.009005|
+reg_named_buff_iter|||
+reg_named_buff_nextkey||5.009005|
+reg_named_buff_scalar||5.009005|
+reg_named_buff|||
+reg_namedseq|||
+reg_node|||
+reg_numbered_buff_fetch|||
+reg_numbered_buff_length|||
+reg_numbered_buff_store|||
+reg_qr_package|||
+reg_recode|||
+reg_scan_name|||
+reg_skipcomment|||
+reg_temp_copy|||
+reganode|||
+regatom|||
+regbranch|||
+regclass_swash||5.009004|
+regclass|||
+regcppop|||
+regcppush|||
+regcurly|||n
+regdump_extflags|||
+regdump||5.005000|
+regdupe_internal|||
+regexec_flags||5.005000|
+regfree_internal||5.009005|
+reghop3|||n
+reghop4|||n
+reghopmaybe3|||n
+reginclass|||
+reginitcolors||5.006000|
+reginsert|||
+regmatch|||
+regnext||5.005000|
+regpiece|||
+regpposixcc|||
+regprop|||
+regrepeat|||
+regtail_study|||
+regtail|||
+regtry|||
+reguni|||
+regwhite|||n
+reg|||
+repeatcpy|||
+report_evil_fh|||
+report_uninit|||
+require_pv||5.006000|
+require_tie_mod|||
+restore_magic|||
+rninstr|||
+rsignal_restore|||
+rsignal_save|||
+rsignal_state||5.004000|
+rsignal||5.004000|
+run_body|||
+run_user_filter|||
+runops_debug||5.005000|
+runops_standard||5.005000|
+rvpv_dup|||
+rxres_free|||
+rxres_restore|||
+rxres_save|||
+safesyscalloc||5.006000|n
+safesysfree||5.006000|n
+safesysmalloc||5.006000|n
+safesysrealloc||5.006000|n
+same_dirent|||
+save_I16||5.004000|
+save_I32|||
+save_I8||5.006000|
+save_adelete||5.011000|
+save_aelem||5.004050|
+save_alloc||5.006000|
+save_aptr|||
+save_ary|||
+save_bool||5.008001|
+save_clearsv|||
+save_delete|||
+save_destructor_x||5.006000|
+save_destructor||5.006000|
+save_freeop|||
+save_freepv|||
+save_freesv|||
+save_generic_pvref||5.006001|
+save_generic_svref||5.005030|
+save_gp||5.004000|
+save_hash|||
+save_hek_flags|||n
+save_helem_flags||5.011000|
+save_helem||5.004050|
+save_hints|||
+save_hptr|||
+save_int|||
+save_item|||
+save_iv||5.005000|
+save_lines|||
+save_list|||
+save_long|||
+save_magic|||
+save_mortalizesv||5.007001|
+save_nogv|||
+save_op|||
+save_padsv_and_mortalize||5.011000|
+save_pptr|||
+save_pushi32ptr|||
+save_pushptri32ptr|||
+save_pushptrptr|||
+save_pushptr||5.011000|
+save_re_context||5.006000|
+save_scalar_at|||
+save_scalar|||
+save_set_svflags||5.009000|
+save_shared_pvref||5.007003|
+save_sptr|||
+save_svref|||
+save_vptr||5.006000|
+savepvn|||
+savepvs||5.009003|
+savepv|||
+savesharedpvn||5.009005|
+savesharedpv||5.007003|
+savestack_grow_cnt||5.008001|
+savestack_grow|||
+savesvpv||5.009002|
+sawparens|||
+scalar_mod_type|||n
+scalarboolean|||
+scalarkids|||
+scalarseq|||
+scalarvoid|||
+scalar|||
+scan_bin||5.006000|
+scan_commit|||
+scan_const|||
+scan_formline|||
+scan_heredoc|||
+scan_hex|||
+scan_ident|||
+scan_inputsymbol|||
+scan_num||5.007001|
+scan_oct|||
+scan_pat|||
+scan_str|||
+scan_subst|||
+scan_trans|||
+scan_version||5.009001|
+scan_vstring||5.009005|
+scan_word|||
+scope|||
+screaminstr||5.005000|
+search_const|||
+seed||5.008001|
+sequence_num|||
+sequence_tail|||
+sequence|||
+set_context||5.006000|n
+set_numeric_local||5.006000|
+set_numeric_radix||5.006000|
+set_numeric_standard||5.006000|
+setdefout|||
+share_hek_flags|||
+share_hek||5.004000|
+si_dup|||
+sighandler|||n
+simplify_sort|||
+skipspace0|||
+skipspace1|||
+skipspace2|||
+skipspace|||
+softref2xv|||
+sortcv_stacked|||
+sortcv_xsub|||
+sortcv|||
+sortsv_flags||5.009003|
+sortsv||5.007003|
+space_join_names_mortal|||
+ss_dup|||
+stack_grow|||
+start_force|||
+start_glob|||
+start_subparse||5.004000|
+stashpv_hvname_match||5.011000|
+stdize_locale|||
+store_cop_label|||
+strEQ|||
+strGE|||
+strGT|||
+strLE|||
+strLT|||
+strNE|||
+str_to_version||5.006000|
+strip_return|||
+strnEQ|||
+strnNE|||
+study_chunk|||
+sub_crush_depth|||
+sublex_done|||
+sublex_push|||
+sublex_start|||
+sv_2bool|||
+sv_2cv|||
+sv_2io|||
+sv_2iuv_common|||
+sv_2iuv_non_preserve|||
+sv_2iv_flags||5.009001|
+sv_2iv|||
+sv_2mortal|||
+sv_2num|||
+sv_2nv|||
+sv_2pv_flags|5.007002||p
+sv_2pv_nolen|5.006000||p
+sv_2pvbyte_nolen|5.006000||p
+sv_2pvbyte|5.006000||p
+sv_2pvutf8_nolen||5.006000|
+sv_2pvutf8||5.006000|
+sv_2pv|||
+sv_2uv_flags||5.009001|
+sv_2uv|5.004000||p
+sv_add_arena|||
+sv_add_backref|||
+sv_backoff|||
+sv_bless|||
+sv_cat_decode||5.008001|
+sv_catpv_mg|5.004050||p
+sv_catpvf_mg_nocontext|||pvn
+sv_catpvf_mg|5.006000|5.004000|pv
+sv_catpvf_nocontext|||vn
+sv_catpvf||5.004000|v
+sv_catpvn_flags||5.007002|
+sv_catpvn_mg|5.004050||p
+sv_catpvn_nomg|5.007002||p
+sv_catpvn|||
+sv_catpvs|5.009003||p
+sv_catpv|||
+sv_catsv_flags||5.007002|
+sv_catsv_mg|5.004050||p
+sv_catsv_nomg|5.007002||p
+sv_catsv|||
+sv_catxmlpvn|||
+sv_catxmlsv|||
+sv_chop|||
+sv_clean_all|||
+sv_clean_objs|||
+sv_clear|||
+sv_cmp_locale||5.004000|
+sv_cmp|||
+sv_collxfrm|||
+sv_compile_2op||5.008001|
+sv_copypv||5.007003|
+sv_dec|||
+sv_del_backref|||
+sv_derived_from||5.004000|
+sv_destroyable||5.010000|
+sv_does||5.009004|
+sv_dump|||
+sv_dup_inc_multiple|||
+sv_dup|||
+sv_eq|||
+sv_exp_grow|||
+sv_force_normal_flags||5.007001|
+sv_force_normal||5.006000|
+sv_free2|||
+sv_free_arenas|||
+sv_free|||
+sv_gets||5.004000|
+sv_grow|||
+sv_i_ncmp|||
+sv_inc|||
+sv_insert_flags||5.011000|
+sv_insert|||
+sv_isa|||
+sv_isobject|||
+sv_iv||5.005000|
+sv_kill_backrefs|||
+sv_len_utf8||5.006000|
+sv_len|||
+sv_magic_portable|5.011000|5.004000|p
+sv_magicext||5.007003|
+sv_magic|||
+sv_mortalcopy|||
+sv_ncmp|||
+sv_newmortal|||
+sv_newref|||
+sv_nolocking||5.007003|
+sv_nosharing||5.007003|
+sv_nounlocking|||
+sv_nv||5.005000|
+sv_peek||5.005000|
+sv_pos_b2u_midway|||
+sv_pos_b2u||5.006000|
+sv_pos_u2b_cached|||
+sv_pos_u2b_forwards|||n
+sv_pos_u2b_midway|||n
+sv_pos_u2b||5.006000|
+sv_pvbyten_force||5.006000|
+sv_pvbyten||5.006000|
+sv_pvbyte||5.006000|
+sv_pvn_force_flags|5.007002||p
+sv_pvn_force|||
+sv_pvn_nomg|5.007003|5.005000|p
+sv_pvn||5.005000|
+sv_pvutf8n_force||5.006000|
+sv_pvutf8n||5.006000|
+sv_pvutf8||5.006000|
+sv_pv||5.006000|
+sv_recode_to_utf8||5.007003|
+sv_reftype|||
+sv_release_COW|||
+sv_replace|||
+sv_report_used|||
+sv_reset|||
+sv_rvweaken||5.006000|
+sv_setiv_mg|5.004050||p
+sv_setiv|||
+sv_setnv_mg|5.006000||p
+sv_setnv|||
+sv_setpv_mg|5.004050||p
+sv_setpvf_mg_nocontext|||pvn
+sv_setpvf_mg|5.006000|5.004000|pv
+sv_setpvf_nocontext|||vn
+sv_setpvf||5.004000|v
+sv_setpviv_mg||5.008001|
+sv_setpviv||5.008001|
+sv_setpvn_mg|5.004050||p
+sv_setpvn|||
+sv_setpvs|5.009004||p
+sv_setpv|||
+sv_setref_iv|||
+sv_setref_nv|||
+sv_setref_pvn|||
+sv_setref_pv|||
+sv_setref_uv||5.007001|
+sv_setsv_cow|||
+sv_setsv_flags||5.007002|
+sv_setsv_mg|5.004050||p
+sv_setsv_nomg|5.007002||p
+sv_setsv|||
+sv_setuv_mg|5.004050||p
+sv_setuv|5.004000||p
+sv_tainted||5.004000|
+sv_taint||5.004000|
+sv_true||5.005000|
+sv_unglob|||
+sv_uni_display||5.007003|
+sv_unmagic|||
+sv_unref_flags||5.007001|
+sv_unref|||
+sv_untaint||5.004000|
+sv_upgrade|||
+sv_usepvn_flags||5.009004|
+sv_usepvn_mg|5.004050||p
+sv_usepvn|||
+sv_utf8_decode||5.006000|
+sv_utf8_downgrade||5.006000|
+sv_utf8_encode||5.006000|
+sv_utf8_upgrade_flags_grow||5.011000|
+sv_utf8_upgrade_flags||5.007002|
+sv_utf8_upgrade_nomg||5.007002|
+sv_utf8_upgrade||5.007001|
+sv_uv|5.005000||p
+sv_vcatpvf_mg|5.006000|5.004000|p
+sv_vcatpvfn||5.004000|
+sv_vcatpvf|5.006000|5.004000|p
+sv_vsetpvf_mg|5.006000|5.004000|p
+sv_vsetpvfn||5.004000|
+sv_vsetpvf|5.006000|5.004000|p
+sv_xmlpeek|||
+svtype|||
+swallow_bom|||
+swap_match_buff|||
+swash_fetch||5.007002|
+swash_get|||
+swash_init||5.006000|
+sys_init3||5.010000|n
+sys_init||5.010000|n
+sys_intern_clear|||
+sys_intern_dup|||
+sys_intern_init|||
+sys_term||5.010000|n
+taint_env|||
+taint_proper|||
+tmps_grow||5.006000|
+toLOWER|||
+toUPPER|||
+to_byte_substr|||
+to_uni_fold||5.007003|
+to_uni_lower_lc||5.006000|
+to_uni_lower||5.007003|
+to_uni_title_lc||5.006000|
+to_uni_title||5.007003|
+to_uni_upper_lc||5.006000|
+to_uni_upper||5.007003|
+to_utf8_case||5.007003|
+to_utf8_fold||5.007003|
+to_utf8_lower||5.007003|
+to_utf8_substr|||
+to_utf8_title||5.007003|
+to_utf8_upper||5.007003|
+token_free|||
+token_getmad|||
+tokenize_use|||
+tokeq|||
+tokereport|||
+too_few_arguments|||
+too_many_arguments|||
+uiv_2buf|||n
+unlnk|||
+unpack_rec|||
+unpack_str||5.007003|
+unpackstring||5.008001|
+unshare_hek_or_pvn|||
+unshare_hek|||
+unsharepvn||5.004000|
+unwind_handler_stack|||
+update_debugger_info|||
+upg_version||5.009005|
+usage|||
+utf16_to_utf8_reversed||5.006001|
+utf16_to_utf8||5.006001|
+utf8_distance||5.006000|
+utf8_hop||5.006000|
+utf8_length||5.007001|
+utf8_mg_pos_cache_update|||
+utf8_to_bytes||5.006001|
+utf8_to_uvchr||5.007001|
+utf8_to_uvuni||5.007001|
+utf8n_to_uvchr|||
+utf8n_to_uvuni||5.007001|
+utilize|||
+uvchr_to_utf8_flags||5.007003|
+uvchr_to_utf8|||
+uvuni_to_utf8_flags||5.007003|
+uvuni_to_utf8||5.007001|
+validate_suid|||
+varname|||
+vcmp||5.009000|
+vcroak||5.006000|
+vdeb||5.007003|
+vdie_common|||
+vdie_croak_common|||
+vdie|||
+vform||5.006000|
+visit|||
+vivify_defelem|||
+vivify_ref|||
+vload_module|5.006000||p
+vmess||5.006000|
+vnewSVpvf|5.006000|5.004000|p
+vnormal||5.009002|
+vnumify||5.009000|
+vstringify||5.009000|
+vverify||5.009003|
+vwarner||5.006000|
+vwarn||5.006000|
+wait4pid|||
+warn_nocontext|||vn
+warner_nocontext|||vn
+warner|5.006000|5.004000|pv
+warn|||v
+watch|||
+whichsig|||
+write_no_mem|||
+write_to_stderr|||
+xmldump_all|||
+xmldump_attr|||
+xmldump_eval|||
+xmldump_form|||
+xmldump_indent|||v
+xmldump_packsubs|||
+xmldump_sub|||
+xmldump_vindent|||
+yyerror|||
+yylex|||
+yyparse|||
+yywarn|||
+);
+
+if (exists $opt{'list-unsupported'}) {
+ my $f;
+ for $f (sort { lc $a cmp lc $b } keys %API) {
+ next unless $API{$f}{todo};
+ print "$f ", '.'x(40-length($f)), " ", format_version($API{$f}{todo}), "\n";
+ }
+ exit 0;
+}
+
+# Scan for possible replacement candidates
+
+my(%replace, %need, %hints, %warnings, %depends);
+my $replace = 0;
+my($hint, $define, $function);
+
+sub find_api
+{
+ my $code = shift;
+ $code =~ s{
+ / (?: \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / | /[^\r\n]*)
+ | "[^"\\]*(?:\\.[^"\\]*)*"
+ | '[^'\\]*(?:\\.[^'\\]*)*' }{}egsx;
+ grep { exists $API{$_} } $code =~ /(\w+)/mg;
+}
+
+while (<DATA>) {
+ if ($hint) {
+ my $h = $hint->[0] eq 'Hint' ? \%hints : \%warnings;
+ if (m{^\s*\*\s(.*?)\s*$}) {
+ for (@{$hint->[1]}) {
+ $h->{$_} ||= ''; # suppress warning with older perls
+ $h->{$_} .= "$1\n";
+ }
+ }
+ else { undef $hint }
+ }
+
+ $hint = [$1, [split /,?\s+/, $2]]
+ if m{^\s*$rccs\s+(Hint|Warning):\s+(\w+(?:,?\s+\w+)*)\s*$};
+
+ if ($define) {
+ if ($define->[1] =~ /\\$/) {
+ $define->[1] .= $_;
+ }
+ else {
+ if (exists $API{$define->[0]} && $define->[1] !~ /^DPPP_\(/) {
+ my @n = find_api($define->[1]);
+ push @{$depends{$define->[0]}}, @n if @n
+ }
+ undef $define;
+ }
+ }
+
+ $define = [$1, $2] if m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(.*)};
+
+ if ($function) {
+ if (/^}/) {
+ if (exists $API{$function->[0]}) {
+ my @n = find_api($function->[1]);
+ push @{$depends{$function->[0]}}, @n if @n
+ }
+ undef $function;
+ }
+ else {
+ $function->[1] .= $_;
+ }
+ }
+
+ $function = [$1, ''] if m{^DPPP_\(my_(\w+)\)};
+
+ $replace = $1 if m{^\s*$rccs\s+Replace:\s+(\d+)\s+$rcce\s*$};
+ $replace{$2} = $1 if $replace and m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(\w+)};
+ $replace{$2} = $1 if m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(\w+).*$rccs\s+Replace\s+$rcce};
+ $replace{$1} = $2 if m{^\s*$rccs\s+Replace (\w+) with (\w+)\s+$rcce\s*$};
+
+ if (m{^\s*$rccs\s+(\w+(\s*,\s*\w+)*)\s+depends\s+on\s+(\w+(\s*,\s*\w+)*)\s+$rcce\s*$}) {
+ my @deps = map { s/\s+//g; $_ } split /,/, $3;
+ my $d;
+ for $d (map { s/\s+//g; $_ } split /,/, $1) {
+ push @{$depends{$d}}, @deps;
+ }
+ }
+
+ $need{$1} = 1 if m{^#if\s+defined\(NEED_(\w+)(?:_GLOBAL)?\)};
+}
+
+for (values %depends) {
+ my %s;
+ $_ = [sort grep !$s{$_}++, @$_];
+}
+
+if (exists $opt{'api-info'}) {
+ my $f;
+ my $count = 0;
+ my $match = $opt{'api-info'} =~ m!^/(.*)/$! ? $1 : "^\Q$opt{'api-info'}\E\$";
+ for $f (sort { lc $a cmp lc $b } keys %API) {
+ next unless $f =~ /$match/;
+ print "\n=== $f ===\n\n";
+ my $info = 0;
+ if ($API{$f}{base} || $API{$f}{todo}) {
+ my $base = format_version($API{$f}{base} || $API{$f}{todo});
+ print "Supported at least starting from perl-$base.\n";
+ $info++;
+ }
+ if ($API{$f}{provided}) {
+ my $todo = $API{$f}{todo} ? format_version($API{$f}{todo}) : "5.003";
+ print "Support by $ppport provided back to perl-$todo.\n";
+ print "Support needs to be explicitly requested by NEED_$f.\n" if exists $need{$f};
+ print "Depends on: ", join(', ', @{$depends{$f}}), ".\n" if exists $depends{$f};
+ print "\n$hints{$f}" if exists $hints{$f};
+ print "\nWARNING:\n$warnings{$f}" if exists $warnings{$f};
+ $info++;
+ }
+ print "No portability information available.\n" unless $info;
+ $count++;
+ }
+ $count or print "Found no API matching '$opt{'api-info'}'.";
+ print "\n";
+ exit 0;
+}
+
+if (exists $opt{'list-provided'}) {
+ my $f;
+ for $f (sort { lc $a cmp lc $b } keys %API) {
+ next unless $API{$f}{provided};
+ my @flags;
+ push @flags, 'explicit' if exists $need{$f};
+ push @flags, 'depend' if exists $depends{$f};
+ push @flags, 'hint' if exists $hints{$f};
+ push @flags, 'warning' if exists $warnings{$f};
+ my $flags = @flags ? ' ['.join(', ', @flags).']' : '';
+ print "$f$flags\n";
+ }
+ exit 0;
+}
+
+my @files;
+my @srcext = qw( .xs .c .h .cc .cpp -c.inc -xs.inc );
+my $srcext = join '|', map { quotemeta $_ } @srcext;
+
+if (@ARGV) {
+ my %seen;
+ for (@ARGV) {
+ if (-e) {
+ if (-f) {
+ push @files, $_ unless $seen{$_}++;
+ }
+ else { warn "'$_' is not a file.\n" }
+ }
+ else {
+ my @new = grep { -f } glob $_
+ or warn "'$_' does not exist.\n";
+ push @files, grep { !$seen{$_}++ } @new;
+ }
+ }
+}
+else {
+ eval {
+ require File::Find;
+ File::Find::find(sub {
+ $File::Find::name =~ /($srcext)$/i
+ and push @files, $File::Find::name;
+ }, '.');
+ };
+ if ($@) {
+ @files = map { glob "*$_" } @srcext;
+ }
+}
+
+if (!@ARGV || $opt{filter}) {
+ my(@in, @out);
+ my %xsc = map { /(.*)\.xs$/ ? ("$1.c" => 1, "$1.cc" => 1) : () } @files;
+ for (@files) {
+ my $out = exists $xsc{$_} || /\b\Q$ppport\E$/i || !/($srcext)$/i;
+ push @{ $out ? \@out : \@in }, $_;
+ }
+ if (@ARGV && @out) {
+ warning("Skipping the following files (use --nofilter to avoid this):\n| ", join "\n| ", @out);
+ }
+ @files = @in;
+}
+
+die "No input files given!\n" unless @files;
+
+my(%files, %global, %revreplace);
+%revreplace = reverse %replace;
+my $filename;
+my $patch_opened = 0;
+
+for $filename (@files) {
+ unless (open IN, "<$filename") {
+ warn "Unable to read from $filename: $!\n";
+ next;
+ }
+
+ info("Scanning $filename ...");
+
+ my $c = do { local $/; <IN> };
+ close IN;
+
+ my %file = (orig => $c, changes => 0);
+
+ # Temporarily remove C/XS comments and strings from the code
+ my @ccom;
+
+ $c =~ s{
+ ( ^$HS*\#$HS*include\b[^\r\n]+\b(?:\Q$ppport\E|XSUB\.h)\b[^\r\n]*
+ | ^$HS*\#$HS*(?:define|elif|if(?:def)?)\b[^\r\n]* )
+ | ( ^$HS*\#[^\r\n]*
+ | "[^"\\]*(?:\\.[^"\\]*)*"
+ | '[^'\\]*(?:\\.[^'\\]*)*'
+ | / (?: \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / | /[^\r\n]* ) )
+ }{ defined $2 and push @ccom, $2;
+ defined $1 ? $1 : "$ccs$#ccom$cce" }mgsex;
+
+ $file{ccom} = \@ccom;
+ $file{code} = $c;
+ $file{has_inc_ppport} = $c =~ /^$HS*#$HS*include[^\r\n]+\b\Q$ppport\E\b/m;
+
+ my $func;
+
+ for $func (keys %API) {
+ my $match = $func;
+ $match .= "|$revreplace{$func}" if exists $revreplace{$func};
+ if ($c =~ /\b(?:Perl_)?($match)\b/) {
+ $file{uses_replace}{$1}++ if exists $revreplace{$func} && $1 eq $revreplace{$func};
+ $file{uses_Perl}{$func}++ if $c =~ /\bPerl_$func\b/;
+ if (exists $API{$func}{provided}) {
+ $file{uses_provided}{$func}++;
+ if (!exists $API{$func}{base} || $API{$func}{base} > $opt{'compat-version'}) {
+ $file{uses}{$func}++;
+ my @deps = rec_depend($func);
+ if (@deps) {
+ $file{uses_deps}{$func} = \@deps;
+ for (@deps) {
+ $file{uses}{$_} = 0 unless exists $file{uses}{$_};
+ }
+ }
+ for ($func, @deps) {
+ $file{needs}{$_} = 'static' if exists $need{$_};
+ }
+ }
+ }
+ if (exists $API{$func}{todo} && $API{$func}{todo} > $opt{'compat-version'}) {
+ if ($c =~ /\b$func\b/) {
+ $file{uses_todo}{$func}++;
+ }
+ }
+ }
+ }
+
+ while ($c =~ /^$HS*#$HS*define$HS+(NEED_(\w+?)(_GLOBAL)?)\b/mg) {
+ if (exists $need{$2}) {
+ $file{defined $3 ? 'needed_global' : 'needed_static'}{$2}++;
+ }
+ else { warning("Possibly wrong #define $1 in $filename") }
+ }
+
+ for (qw(uses needs uses_todo needed_global needed_static)) {
+ for $func (keys %{$file{$_}}) {
+ push @{$global{$_}{$func}}, $filename;
+ }
+ }
+
+ $files{$filename} = \%file;
+}
+
+# Globally resolve NEED_'s
+my $need;
+for $need (keys %{$global{needs}}) {
+ if (@{$global{needs}{$need}} > 1) {
+ my @targets = @{$global{needs}{$need}};
+ my @t = grep $files{$_}{needed_global}{$need}, @targets;
+ @targets = @t if @t;
+ @t = grep /\.xs$/i, @targets;
+ @targets = @t if @t;
+ my $target = shift @targets;
+ $files{$target}{needs}{$need} = 'global';
+ for (@{$global{needs}{$need}}) {
+ $files{$_}{needs}{$need} = 'extern' if $_ ne $target;
+ }
+ }
+}
+
+for $filename (@files) {
+ exists $files{$filename} or next;
+
+ info("=== Analyzing $filename ===");
+
+ my %file = %{$files{$filename}};
+ my $func;
+ my $c = $file{code};
+ my $warnings = 0;
+
+ for $func (sort keys %{$file{uses_Perl}}) {
+ if ($API{$func}{varargs}) {
+ unless ($API{$func}{nothxarg}) {
+ my $changes = ($c =~ s{\b(Perl_$func\s*\(\s*)(?!aTHX_?)(\)|[^\s)]*\))}
+ { $1 . ($2 eq ')' ? 'aTHX' : 'aTHX_ ') . $2 }ge);
+ if ($changes) {
+ warning("Doesn't pass interpreter argument aTHX to Perl_$func");
+ $file{changes} += $changes;
+ }
+ }
+ }
+ else {
+ warning("Uses Perl_$func instead of $func");
+ $file{changes} += ($c =~ s{\bPerl_$func(\s*)\((\s*aTHX_?)?\s*}
+ {$func$1(}g);
+ }
+ }
+
+ for $func (sort keys %{$file{uses_replace}}) {
+ warning("Uses $func instead of $replace{$func}");
+ $file{changes} += ($c =~ s/\b$func\b/$replace{$func}/g);
+ }
+
+ for $func (sort keys %{$file{uses_provided}}) {
+ if ($file{uses}{$func}) {
+ if (exists $file{uses_deps}{$func}) {
+ diag("Uses $func, which depends on ", join(', ', @{$file{uses_deps}{$func}}));
+ }
+ else {
+ diag("Uses $func");
+ }
+ }
+ $warnings += hint($func);
+ }
+
+ unless ($opt{quiet}) {
+ for $func (sort keys %{$file{uses_todo}}) {
+ print "*** WARNING: Uses $func, which may not be portable below perl ",
+ format_version($API{$func}{todo}), ", even with '$ppport'\n";
+ $warnings++;
+ }
+ }
+
+ for $func (sort keys %{$file{needed_static}}) {
+ my $message = '';
+ if (not exists $file{uses}{$func}) {
+ $message = "No need to define NEED_$func if $func is never used";
+ }
+ elsif (exists $file{needs}{$func} && $file{needs}{$func} ne 'static') {
+ $message = "No need to define NEED_$func when already needed globally";
+ }
+ if ($message) {
+ diag($message);
+ $file{changes} += ($c =~ s/^$HS*#$HS*define$HS+NEED_$func\b.*$LF//mg);
+ }
+ }
+
+ for $func (sort keys %{$file{needed_global}}) {
+ my $message = '';
+ if (not exists $global{uses}{$func}) {
+ $message = "No need to define NEED_${func}_GLOBAL if $func is never used";
+ }
+ elsif (exists $file{needs}{$func}) {
+ if ($file{needs}{$func} eq 'extern') {
+ $message = "No need to define NEED_${func}_GLOBAL when already needed globally";
+ }
+ elsif ($file{needs}{$func} eq 'static') {
+ $message = "No need to define NEED_${func}_GLOBAL when only used in this file";
+ }
+ }
+ if ($message) {
+ diag($message);
+ $file{changes} += ($c =~ s/^$HS*#$HS*define$HS+NEED_${func}_GLOBAL\b.*$LF//mg);
+ }
+ }
+
+ $file{needs_inc_ppport} = keys %{$file{uses}};
+
+ if ($file{needs_inc_ppport}) {
+ my $pp = '';
+
+ for $func (sort keys %{$file{needs}}) {
+ my $type = $file{needs}{$func};
+ next if $type eq 'extern';
+ my $suffix = $type eq 'global' ? '_GLOBAL' : '';
+ unless (exists $file{"needed_$type"}{$func}) {
+ if ($type eq 'global') {
+ diag("Files [@{$global{needs}{$func}}] need $func, adding global request");
+ }
+ else {
+ diag("File needs $func, adding static request");
+ }
+ $pp .= "#define NEED_$func$suffix\n";
+ }
+ }
+
+ if ($pp && ($c =~ s/^(?=$HS*#$HS*define$HS+NEED_\w+)/$pp/m)) {
+ $pp = '';
+ $file{changes}++;
+ }
+
+ unless ($file{has_inc_ppport}) {
+ diag("Needs to include '$ppport'");
+ $pp .= qq(#include "$ppport"\n)
+ }
+
+ if ($pp) {
+ $file{changes} += ($c =~ s/^($HS*#$HS*define$HS+NEED_\w+.*?)^/$1$pp/ms)
+ || ($c =~ s/^(?=$HS*#$HS*include.*\Q$ppport\E)/$pp/m)
+ || ($c =~ s/^($HS*#$HS*include.*XSUB.*\s*?)^/$1$pp/m)
+ || ($c =~ s/^/$pp/);
+ }
+ }
+ else {
+ if ($file{has_inc_ppport}) {
+ diag("No need to include '$ppport'");
+ $file{changes} += ($c =~ s/^$HS*?#$HS*include.*\Q$ppport\E.*?$LF//m);
+ }
+ }
+
+ # put back in our C comments
+ my $ix;
+ my $cppc = 0;
+ my @ccom = @{$file{ccom}};
+ for $ix (0 .. $#ccom) {
+ if (!$opt{cplusplus} && $ccom[$ix] =~ s!^//!!) {
+ $cppc++;
+ $file{changes} += $c =~ s/$rccs$ix$rcce/$ccs$ccom[$ix] $cce/;
+ }
+ else {
+ $c =~ s/$rccs$ix$rcce/$ccom[$ix]/;
+ }
+ }
+
+ if ($cppc) {
+ my $s = $cppc != 1 ? 's' : '';
+ warning("Uses $cppc C++ style comment$s, which is not portable");
+ }
+
+ my $s = $warnings != 1 ? 's' : '';
+ my $warn = $warnings ? " ($warnings warning$s)" : '';
+ info("Analysis completed$warn");
+
+ if ($file{changes}) {
+ if (exists $opt{copy}) {
+ my $newfile = "$filename$opt{copy}";
+ if (-e $newfile) {
+ error("'$newfile' already exists, refusing to write copy of '$filename'");
+ }
+ else {
+ local *F;
+ if (open F, ">$newfile") {
+ info("Writing copy of '$filename' with changes to '$newfile'");
+ print F $c;
+ close F;
+ }
+ else {
+ error("Cannot open '$newfile' for writing: $!");
+ }
+ }
+ }
+ elsif (exists $opt{patch} || $opt{changes}) {
+ if (exists $opt{patch}) {
+ unless ($patch_opened) {
+ if (open PATCH, ">$opt{patch}") {
+ $patch_opened = 1;
+ }
+ else {
+ error("Cannot open '$opt{patch}' for writing: $!");
+ delete $opt{patch};
+ $opt{changes} = 1;
+ goto fallback;
+ }
+ }
+ mydiff(\*PATCH, $filename, $c);
+ }
+ else {
+fallback:
+ info("Suggested changes:");
+ mydiff(\*STDOUT, $filename, $c);
+ }
+ }
+ else {
+ my $s = $file{changes} == 1 ? '' : 's';
+ info("$file{changes} potentially required change$s detected");
+ }
+ }
+ else {
+ info("Looks good");
+ }
+}
+
+close PATCH if $patch_opened;
+
+exit 0;
+
+
+sub try_use { eval "use @_;"; return $@ eq '' }
+
+sub mydiff
+{
+ local *F = shift;
+ my($file, $str) = @_;
+ my $diff;
+
+ if (exists $opt{diff}) {
+ $diff = run_diff($opt{diff}, $file, $str);
+ }
+
+ if (!defined $diff and try_use('Text::Diff')) {
+ $diff = Text::Diff::diff($file, \$str, { STYLE => 'Unified' });
+ $diff = <<HEADER . $diff;
+--- $file
++++ $file.patched
+HEADER
+ }
+
+ if (!defined $diff) {
+ $diff = run_diff('diff -u', $file, $str);
+ }
+
+ if (!defined $diff) {
+ $diff = run_diff('diff', $file, $str);
+ }
+
+ if (!defined $diff) {
+ error("Cannot generate a diff. Please install Text::Diff or use --copy.");
+ return;
+ }
+
+ print F $diff;
+}
+
+sub run_diff
+{
+ my($prog, $file, $str) = @_;
+ my $tmp = 'dppptemp';
+ my $suf = 'aaa';
+ my $diff = '';
+ local *F;
+
+ while (-e "$tmp.$suf") { $suf++ }
+ $tmp = "$tmp.$suf";
+
+ if (open F, ">$tmp") {
+ print F $str;
+ close F;
+
+ if (open F, "$prog $file $tmp |") {
+ while (<F>) {
+ s/\Q$tmp\E/$file.patched/;
+ $diff .= $_;
+ }
+ close F;
+ unlink $tmp;
+ return $diff;
+ }
+
+ unlink $tmp;
+ }
+ else {
+ error("Cannot open '$tmp' for writing: $!");
+ }
+
+ return undef;
+}
+
+sub rec_depend
+{
+ my($func, $seen) = @_;
+ return () unless exists $depends{$func};
+ $seen = {%{$seen||{}}};
+ return () if $seen->{$func}++;
+ my %s;
+ grep !$s{$_}++, map { ($_, rec_depend($_, $seen)) } @{$depends{$func}};
+}
+
+sub parse_version
+{
+ my $ver = shift;
+
+ if ($ver =~ /^(\d+)\.(\d+)\.(\d+)$/) {
+ return ($1, $2, $3);
+ }
+ elsif ($ver !~ /^\d+\.[\d_]+$/) {
+ die "cannot parse version '$ver'\n";
+ }
+
+ $ver =~ s/_//g;
+ $ver =~ s/$/000000/;
+
+ my($r,$v,$s) = $ver =~ /(\d+)\.(\d{3})(\d{3})/;
+
+ $v = int $v;
+ $s = int $s;
+
+ if ($r < 5 || ($r == 5 && $v < 6)) {
+ if ($s % 10) {
+ die "cannot parse version '$ver'\n";
+ }
+ }
+
+ return ($r, $v, $s);
+}
+
+sub format_version
+{
+ my $ver = shift;
+
+ $ver =~ s/$/000000/;
+ my($r,$v,$s) = $ver =~ /(\d+)\.(\d{3})(\d{3})/;
+
+ $v = int $v;
+ $s = int $s;
+
+ if ($r < 5 || ($r == 5 && $v < 6)) {
+ if ($s % 10) {
+ die "invalid version '$ver'\n";
+ }
+ $s /= 10;
+
+ $ver = sprintf "%d.%03d", $r, $v;
+ $s > 0 and $ver .= sprintf "_%02d", $s;
+
+ return $ver;
+ }
+
+ return sprintf "%d.%d.%d", $r, $v, $s;
+}
+
+sub info
+{
+ $opt{quiet} and return;
+ print @_, "\n";
+}
+
+sub diag
+{
+ $opt{quiet} and return;
+ $opt{diag} and print @_, "\n";
+}
+
+sub warning
+{
+ $opt{quiet} and return;
+ print "*** ", @_, "\n";
+}
+
+sub error
+{
+ print "*** ERROR: ", @_, "\n";
+}
+
+my %given_hints;
+my %given_warnings;
+sub hint
+{
+ $opt{quiet} and return;
+ my $func = shift;
+ my $rv = 0;
+ if (exists $warnings{$func} && !$given_warnings{$func}++) {
+ my $warn = $warnings{$func};
+ $warn =~ s!^!*** !mg;
+ print "*** WARNING: $func\n", $warn;
+ $rv++;
+ }
+ if ($opt{hints} && exists $hints{$func} && !$given_hints{$func}++) {
+ my $hint = $hints{$func};
+ $hint =~ s/^/ /mg;
+ print " --- hint for $func ---\n", $hint;
+ }
+ $rv;
+}
+
+sub usage
+{
+ my($usage) = do { local(@ARGV,$/)=($0); <> } =~ /^=head\d$HS+SYNOPSIS\s*^(.*?)\s*^=/ms;
+ my %M = ( 'I' => '*' );
+ $usage =~ s/^\s*perl\s+\S+/$^X $0/;
+ $usage =~ s/([A-Z])<([^>]+)>/$M{$1}$2$M{$1}/g;
+
+ print <<ENDUSAGE;
+
+Usage: $usage
+
+See perldoc $0 for details.
+
+ENDUSAGE
+
+ exit 2;
+}
+
+sub strip
+{
+ my $self = do { local(@ARGV,$/)=($0); <> };
+ my($copy) = $self =~ /^=head\d\s+COPYRIGHT\s*^(.*?)^=\w+/ms;
+ $copy =~ s/^(?=\S+)/ /gms;
+ $self =~ s/^$HS+Do NOT edit.*?(?=^-)/$copy/ms;
+ $self =~ s/^SKIP.*(?=^__DATA__)/SKIP
+if (\@ARGV && \$ARGV[0] eq '--unstrip') {
+ eval { require Devel::PPPort };
+ \$@ and die "Cannot require Devel::PPPort, please install.\\n";
+ if (eval \$Devel::PPPort::VERSION < $VERSION) {
+ die "$0 was originally generated with Devel::PPPort $VERSION.\\n"
+ . "Your Devel::PPPort is only version \$Devel::PPPort::VERSION.\\n"
+ . "Please install a newer version, or --unstrip will not work.\\n";
+ }
+ Devel::PPPort::WriteFile(\$0);
+ exit 0;
+}
+print <<END;
+
+Sorry, but this is a stripped version of \$0.
+
+To be able to use its original script and doc functionality,
+please try to regenerate this file using:
+
+ \$^X \$0 --unstrip
+
+END
+/ms;
+ my($pl, $c) = $self =~ /(.*^__DATA__)(.*)/ms;
+ $c =~ s{
+ / (?: \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / | /[^\r\n]*)
+ | ( "[^"\\]*(?:\\.[^"\\]*)*"
+ | '[^'\\]*(?:\\.[^'\\]*)*' )
+ | ($HS+) }{ defined $2 ? ' ' : ($1 || '') }gsex;
+ $c =~ s!\s+$!!mg;
+ $c =~ s!^$LF!!mg;
+ $c =~ s!^\s*#\s*!#!mg;
+ $c =~ s!^\s+!!mg;
+
+ open OUT, ">$0" or die "cannot strip $0: $!\n";
+ print OUT "$pl$c\n";
+
+ exit 0;
+}
+
+__DATA__
+*/
+
+#ifndef _P_P_PORTABILITY_H_
+#define _P_P_PORTABILITY_H_
+
+#ifndef DPPP_NAMESPACE
+# define DPPP_NAMESPACE DPPP_
+#endif
+
+#define DPPP_CAT2(x,y) CAT2(x,y)
+#define DPPP_(name) DPPP_CAT2(DPPP_NAMESPACE, name)
+
+#ifndef PERL_REVISION
+# if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION))
+# define PERL_PATCHLEVEL_H_IMPLICIT
+# include <patchlevel.h>
+# endif
+# if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL)))
+# include <could_not_find_Perl_patchlevel.h>
+# endif
+# ifndef PERL_REVISION
+# define PERL_REVISION (5)
+ /* Replace: 1 */
+# define PERL_VERSION PATCHLEVEL
+# define PERL_SUBVERSION SUBVERSION
+ /* Replace PERL_PATCHLEVEL with PERL_VERSION */
+ /* Replace: 0 */
+# endif
+#endif
+
+#define _dpppDEC2BCD(dec) ((((dec)/100)<<8)|((((dec)%100)/10)<<4)|((dec)%10))
+#define PERL_BCDVERSION ((_dpppDEC2BCD(PERL_REVISION)<<24)|(_dpppDEC2BCD(PERL_VERSION)<<12)|_dpppDEC2BCD(PERL_SUBVERSION))
+
+/* It is very unlikely that anyone will try to use this with Perl 6
+ (or greater), but who knows.
+ */
+#if PERL_REVISION != 5
+# error ppport.h only works with Perl version 5
+#endif /* PERL_REVISION != 5 */
+#ifndef dTHR
+# define dTHR dNOOP
+#endif
+#ifndef dTHX
+# define dTHX dNOOP
+#endif
+
+#ifndef dTHXa
+# define dTHXa(x) dNOOP
+#endif
+#ifndef pTHX
+# define pTHX void
+#endif
+
+#ifndef pTHX_
+# define pTHX_
+#endif
+
+#ifndef aTHX
+# define aTHX
+#endif
+
+#ifndef aTHX_
+# define aTHX_
+#endif
+
+#if (PERL_BCDVERSION < 0x5006000)
+# ifdef USE_THREADS
+# define aTHXR thr
+# define aTHXR_ thr,
+# else
+# define aTHXR
+# define aTHXR_
+# endif
+# define dTHXR dTHR
+#else
+# define aTHXR aTHX
+# define aTHXR_ aTHX_
+# define dTHXR dTHX
+#endif
+#ifndef dTHXoa
+# define dTHXoa(x) dTHXa(x)
+#endif
+
+#ifdef I_LIMITS
+# include <limits.h>
+#endif
+
+#ifndef PERL_UCHAR_MIN
+# define PERL_UCHAR_MIN ((unsigned char)0)
+#endif
+
+#ifndef PERL_UCHAR_MAX
+# ifdef UCHAR_MAX
+# define PERL_UCHAR_MAX ((unsigned char)UCHAR_MAX)
+# else
+# ifdef MAXUCHAR
+# define PERL_UCHAR_MAX ((unsigned char)MAXUCHAR)
+# else
+# define PERL_UCHAR_MAX ((unsigned char)~(unsigned)0)
+# endif
+# endif
+#endif
+
+#ifndef PERL_USHORT_MIN
+# define PERL_USHORT_MIN ((unsigned short)0)
+#endif
+
+#ifndef PERL_USHORT_MAX
+# ifdef USHORT_MAX
+# define PERL_USHORT_MAX ((unsigned short)USHORT_MAX)
+# else
+# ifdef MAXUSHORT
+# define PERL_USHORT_MAX ((unsigned short)MAXUSHORT)
+# else
+# ifdef USHRT_MAX
+# define PERL_USHORT_MAX ((unsigned short)USHRT_MAX)
+# else
+# define PERL_USHORT_MAX ((unsigned short)~(unsigned)0)
+# endif
+# endif
+# endif
+#endif
+
+#ifndef PERL_SHORT_MAX
+# ifdef SHORT_MAX
+# define PERL_SHORT_MAX ((short)SHORT_MAX)
+# else
+# ifdef MAXSHORT /* Often used in <values.h> */
+# define PERL_SHORT_MAX ((short)MAXSHORT)
+# else
+# ifdef SHRT_MAX
+# define PERL_SHORT_MAX ((short)SHRT_MAX)
+# else
+# define PERL_SHORT_MAX ((short) (PERL_USHORT_MAX >> 1))
+# endif
+# endif
+# endif
+#endif
+
+#ifndef PERL_SHORT_MIN
+# ifdef SHORT_MIN
+# define PERL_SHORT_MIN ((short)SHORT_MIN)
+# else
+# ifdef MINSHORT
+# define PERL_SHORT_MIN ((short)MINSHORT)
+# else
+# ifdef SHRT_MIN
+# define PERL_SHORT_MIN ((short)SHRT_MIN)
+# else
+# define PERL_SHORT_MIN (-PERL_SHORT_MAX - ((3 & -1) == 3))
+# endif
+# endif
+# endif
+#endif
+
+#ifndef PERL_UINT_MAX
+# ifdef UINT_MAX
+# define PERL_UINT_MAX ((unsigned int)UINT_MAX)
+# else
+# ifdef MAXUINT
+# define PERL_UINT_MAX ((unsigned int)MAXUINT)
+# else
+# define PERL_UINT_MAX (~(unsigned int)0)
+# endif
+# endif
+#endif
+
+#ifndef PERL_UINT_MIN
+# define PERL_UINT_MIN ((unsigned int)0)
+#endif
+
+#ifndef PERL_INT_MAX
+# ifdef INT_MAX
+# define PERL_INT_MAX ((int)INT_MAX)
+# else
+# ifdef MAXINT /* Often used in <values.h> */
+# define PERL_INT_MAX ((int)MAXINT)
+# else
+# define PERL_INT_MAX ((int)(PERL_UINT_MAX >> 1))
+# endif
+# endif
+#endif
+
+#ifndef PERL_INT_MIN
+# ifdef INT_MIN
+# define PERL_INT_MIN ((int)INT_MIN)
+# else
+# ifdef MININT
+# define PERL_INT_MIN ((int)MININT)
+# else
+# define PERL_INT_MIN (-PERL_INT_MAX - ((3 & -1) == 3))
+# endif
+# endif
+#endif
+
+#ifndef PERL_ULONG_MAX
+# ifdef ULONG_MAX
+# define PERL_ULONG_MAX ((unsigned long)ULONG_MAX)
+# else
+# ifdef MAXULONG
+# define PERL_ULONG_MAX ((unsigned long)MAXULONG)
+# else
+# define PERL_ULONG_MAX (~(unsigned long)0)
+# endif
+# endif
+#endif
+
+#ifndef PERL_ULONG_MIN
+# define PERL_ULONG_MIN ((unsigned long)0L)
+#endif
+
+#ifndef PERL_LONG_MAX
+# ifdef LONG_MAX
+# define PERL_LONG_MAX ((long)LONG_MAX)
+# else
+# ifdef MAXLONG
+# define PERL_LONG_MAX ((long)MAXLONG)
+# else
+# define PERL_LONG_MAX ((long) (PERL_ULONG_MAX >> 1))
+# endif
+# endif
+#endif
+
+#ifndef PERL_LONG_MIN
+# ifdef LONG_MIN
+# define PERL_LONG_MIN ((long)LONG_MIN)
+# else
+# ifdef MINLONG
+# define PERL_LONG_MIN ((long)MINLONG)
+# else
+# define PERL_LONG_MIN (-PERL_LONG_MAX - ((3 & -1) == 3))
+# endif
+# endif
+#endif
+
+#if defined(HAS_QUAD) && (defined(convex) || defined(uts))
+# ifndef PERL_UQUAD_MAX
+# ifdef ULONGLONG_MAX
+# define PERL_UQUAD_MAX ((unsigned long long)ULONGLONG_MAX)
+# else
+# ifdef MAXULONGLONG
+# define PERL_UQUAD_MAX ((unsigned long long)MAXULONGLONG)
+# else
+# define PERL_UQUAD_MAX (~(unsigned long long)0)
+# endif
+# endif
+# endif
+
+# ifndef PERL_UQUAD_MIN
+# define PERL_UQUAD_MIN ((unsigned long long)0L)
+# endif
+
+# ifndef PERL_QUAD_MAX
+# ifdef LONGLONG_MAX
+# define PERL_QUAD_MAX ((long long)LONGLONG_MAX)
+# else
+# ifdef MAXLONGLONG
+# define PERL_QUAD_MAX ((long long)MAXLONGLONG)
+# else
+# define PERL_QUAD_MAX ((long long) (PERL_UQUAD_MAX >> 1))
+# endif
+# endif
+# endif
+
+# ifndef PERL_QUAD_MIN
+# ifdef LONGLONG_MIN
+# define PERL_QUAD_MIN ((long long)LONGLONG_MIN)
+# else
+# ifdef MINLONGLONG
+# define PERL_QUAD_MIN ((long long)MINLONGLONG)
+# else
+# define PERL_QUAD_MIN (-PERL_QUAD_MAX - ((3 & -1) == 3))
+# endif
+# endif
+# endif
+#endif
+
+/* This is based on code from 5.003 perl.h */
+#ifdef HAS_QUAD
+# ifdef cray
+#ifndef IVTYPE
+# define IVTYPE int
+#endif
+
+#ifndef IV_MIN
+# define IV_MIN PERL_INT_MIN
+#endif
+
+#ifndef IV_MAX
+# define IV_MAX PERL_INT_MAX
+#endif
+
+#ifndef UV_MIN
+# define UV_MIN PERL_UINT_MIN
+#endif
+
+#ifndef UV_MAX
+# define UV_MAX PERL_UINT_MAX
+#endif
+
+# ifdef INTSIZE
+#ifndef IVSIZE
+# define IVSIZE INTSIZE
+#endif
+
+# endif
+# else
+# if defined(convex) || defined(uts)
+#ifndef IVTYPE
+# define IVTYPE long long
+#endif
+
+#ifndef IV_MIN
+# define IV_MIN PERL_QUAD_MIN
+#endif
+
+#ifndef IV_MAX
+# define IV_MAX PERL_QUAD_MAX
+#endif
+
+#ifndef UV_MIN
+# define UV_MIN PERL_UQUAD_MIN
+#endif
+
+#ifndef UV_MAX
+# define UV_MAX PERL_UQUAD_MAX
+#endif
+
+# ifdef LONGLONGSIZE
+#ifndef IVSIZE
+# define IVSIZE LONGLONGSIZE
+#endif
+
+# endif
+# else
+#ifndef IVTYPE
+# define IVTYPE long
+#endif
+
+#ifndef IV_MIN
+# define IV_MIN PERL_LONG_MIN
+#endif
+
+#ifndef IV_MAX
+# define IV_MAX PERL_LONG_MAX
+#endif
+
+#ifndef UV_MIN
+# define UV_MIN PERL_ULONG_MIN
+#endif
+
+#ifndef UV_MAX
+# define UV_MAX PERL_ULONG_MAX
+#endif
+
+# ifdef LONGSIZE
+#ifndef IVSIZE
+# define IVSIZE LONGSIZE
+#endif
+
+# endif
+# endif
+# endif
+#ifndef IVSIZE
+# define IVSIZE 8
+#endif
+
+#ifndef PERL_QUAD_MIN
+# define PERL_QUAD_MIN IV_MIN
+#endif
+
+#ifndef PERL_QUAD_MAX
+# define PERL_QUAD_MAX IV_MAX
+#endif
+
+#ifndef PERL_UQUAD_MIN
+# define PERL_UQUAD_MIN UV_MIN
+#endif
+
+#ifndef PERL_UQUAD_MAX
+# define PERL_UQUAD_MAX UV_MAX
+#endif
+
+#else
+#ifndef IVTYPE
+# define IVTYPE long
+#endif
+
+#ifndef IV_MIN
+# define IV_MIN PERL_LONG_MIN
+#endif
+
+#ifndef IV_MAX
+# define IV_MAX PERL_LONG_MAX
+#endif
+
+#ifndef UV_MIN
+# define UV_MIN PERL_ULONG_MIN
+#endif
+
+#ifndef UV_MAX
+# define UV_MAX PERL_ULONG_MAX
+#endif
+
+#endif
+
+#ifndef IVSIZE
+# ifdef LONGSIZE
+# define IVSIZE LONGSIZE
+# else
+# define IVSIZE 4 /* A bold guess, but the best we can make. */
+# endif
+#endif
+#ifndef UVTYPE
+# define UVTYPE unsigned IVTYPE
+#endif
+
+#ifndef UVSIZE
+# define UVSIZE IVSIZE
+#endif
+#ifndef sv_setuv
+# define sv_setuv(sv, uv) \
+ STMT_START { \
+ UV TeMpUv = uv; \
+ if (TeMpUv <= IV_MAX) \
+ sv_setiv(sv, TeMpUv); \
+ else \
+ sv_setnv(sv, (double)TeMpUv); \
+ } STMT_END
+#endif
+#ifndef newSVuv
+# define newSVuv(uv) ((uv) <= IV_MAX ? newSViv((IV)uv) : newSVnv((NV)uv))
+#endif
+#ifndef sv_2uv
+# define sv_2uv(sv) ((PL_Sv = (sv)), (UV) (SvNOK(PL_Sv) ? SvNV(PL_Sv) : sv_2nv(PL_Sv)))
+#endif
+
+#ifndef SvUVX
+# define SvUVX(sv) ((UV)SvIVX(sv))
+#endif
+
+#ifndef SvUVXx
+# define SvUVXx(sv) SvUVX(sv)
+#endif
+
+#ifndef SvUV
+# define SvUV(sv) (SvIOK(sv) ? SvUVX(sv) : sv_2uv(sv))
+#endif
+
+#ifndef SvUVx
+# define SvUVx(sv) ((PL_Sv = (sv)), SvUV(PL_Sv))
+#endif
+
+/* Hint: sv_uv
+ * Always use the SvUVx() macro instead of sv_uv().
+ */
+#ifndef sv_uv
+# define sv_uv(sv) SvUVx(sv)
+#endif
+
+#if !defined(SvUOK) && defined(SvIOK_UV)
+# define SvUOK(sv) SvIOK_UV(sv)
+#endif
+#ifndef XST_mUV
+# define XST_mUV(i,v) (ST(i) = sv_2mortal(newSVuv(v)) )
+#endif
+
+#ifndef XSRETURN_UV
+# define XSRETURN_UV(v) STMT_START { XST_mUV(0,v); XSRETURN(1); } STMT_END
+#endif
+#ifndef PUSHu
+# define PUSHu(u) STMT_START { sv_setuv(TARG, (UV)(u)); PUSHTARG; } STMT_END
+#endif
+
+#ifndef XPUSHu
+# define XPUSHu(u) STMT_START { sv_setuv(TARG, (UV)(u)); XPUSHTARG; } STMT_END
+#endif
+
+#ifdef HAS_MEMCMP
+#ifndef memNE
+# define memNE(s1,s2,l) (memcmp(s1,s2,l))
+#endif
+
+#ifndef memEQ
+# define memEQ(s1,s2,l) (!memcmp(s1,s2,l))
+#endif
+
+#else
+#ifndef memNE
+# define memNE(s1,s2,l) (bcmp(s1,s2,l))
+#endif
+
+#ifndef memEQ
+# define memEQ(s1,s2,l) (!bcmp(s1,s2,l))
+#endif
+
+#endif
+#ifndef MoveD
+# define MoveD(s,d,n,t) memmove((char*)(d),(char*)(s), (n) * sizeof(t))
+#endif
+
+#ifndef CopyD
+# define CopyD(s,d,n,t) memcpy((char*)(d),(char*)(s), (n) * sizeof(t))
+#endif
+
+#ifdef HAS_MEMSET
+#ifndef ZeroD
+# define ZeroD(d,n,t) memzero((char*)(d), (n) * sizeof(t))
+#endif
+
+#else
+#ifndef ZeroD
+# define ZeroD(d,n,t) ((void)memzero((char*)(d), (n) * sizeof(t)), d)
+#endif
+
+#endif
+#ifndef PoisonWith
+# define PoisonWith(d,n,t,b) (void)memset((char*)(d), (U8)(b), (n) * sizeof(t))
+#endif
+
+#ifndef PoisonNew
+# define PoisonNew(d,n,t) PoisonWith(d,n,t,0xAB)
+#endif
+
+#ifndef PoisonFree
+# define PoisonFree(d,n,t) PoisonWith(d,n,t,0xEF)
+#endif
+
+#ifndef Poison
+# define Poison(d,n,t) PoisonFree(d,n,t)
+#endif
+#ifndef Newx
+# define Newx(v,n,t) New(0,v,n,t)
+#endif
+
+#ifndef Newxc
+# define Newxc(v,n,t,c) Newc(0,v,n,t,c)
+#endif
+
+#ifndef Newxz
+# define Newxz(v,n,t) Newz(0,v,n,t)
+#endif
+
+#ifndef PERL_UNUSED_DECL
+# ifdef HASATTRIBUTE
+# if (defined(__GNUC__) && defined(__cplusplus)) || defined(__INTEL_COMPILER)
+# define PERL_UNUSED_DECL
+# else
+# define PERL_UNUSED_DECL __attribute__((unused))
+# endif
+# else
+# define PERL_UNUSED_DECL
+# endif
+#endif
+
+#ifndef PERL_UNUSED_ARG
+# if defined(lint) && defined(S_SPLINT_S) /* www.splint.org */
+# include <note.h>
+# define PERL_UNUSED_ARG(x) NOTE(ARGUNUSED(x))
+# else
+# define PERL_UNUSED_ARG(x) ((void)x)
+# endif
+#endif
+
+#ifndef PERL_UNUSED_VAR
+# define PERL_UNUSED_VAR(x) ((void)x)
+#endif
+
+#ifndef PERL_UNUSED_CONTEXT
+# ifdef USE_ITHREADS
+# define PERL_UNUSED_CONTEXT PERL_UNUSED_ARG(my_perl)
+# else
+# define PERL_UNUSED_CONTEXT
+# endif
+#endif
+#ifndef NOOP
+# define NOOP /*EMPTY*/(void)0
+#endif
+
+#ifndef dNOOP
+# define dNOOP extern int /*@unused@*/ Perl___notused PERL_UNUSED_DECL
+#endif
+
+#ifndef NVTYPE
+# if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
+# define NVTYPE long double
+# else
+# define NVTYPE double
+# endif
+typedef NVTYPE NV;
+#endif
+
+#ifndef INT2PTR
+# if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE)
+# define PTRV UV
+# define INT2PTR(any,d) (any)(d)
+# else
+# if PTRSIZE == LONGSIZE
+# define PTRV unsigned long
+# else
+# define PTRV unsigned
+# endif
+# define INT2PTR(any,d) (any)(PTRV)(d)
+# endif
+#endif
+
+#ifndef PTR2ul
+# if PTRSIZE == LONGSIZE
+# define PTR2ul(p) (unsigned long)(p)
+# else
+# define PTR2ul(p) INT2PTR(unsigned long,p)
+# endif
+#endif
+#ifndef PTR2nat
+# define PTR2nat(p) (PTRV)(p)
+#endif
+
+#ifndef NUM2PTR
+# define NUM2PTR(any,d) (any)PTR2nat(d)
+#endif
+
+#ifndef PTR2IV
+# define PTR2IV(p) INT2PTR(IV,p)
+#endif
+
+#ifndef PTR2UV
+# define PTR2UV(p) INT2PTR(UV,p)
+#endif
+
+#ifndef PTR2NV
+# define PTR2NV(p) NUM2PTR(NV,p)
+#endif
+
+#undef START_EXTERN_C
+#undef END_EXTERN_C
+#undef EXTERN_C
+#ifdef __cplusplus
+# define START_EXTERN_C extern "C" {
+# define END_EXTERN_C }
+# define EXTERN_C extern "C"
+#else
+# define START_EXTERN_C
+# define END_EXTERN_C
+# define EXTERN_C extern
+#endif
+
+#if defined(PERL_GCC_PEDANTIC)
+# ifndef PERL_GCC_BRACE_GROUPS_FORBIDDEN
+# define PERL_GCC_BRACE_GROUPS_FORBIDDEN
+# endif
+#endif
+
+#if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) && !defined(__cplusplus)
+# ifndef PERL_USE_GCC_BRACE_GROUPS
+# define PERL_USE_GCC_BRACE_GROUPS
+# endif
+#endif
+
+#undef STMT_START
+#undef STMT_END
+#ifdef PERL_USE_GCC_BRACE_GROUPS
+# define STMT_START (void)( /* gcc supports ``({ STATEMENTS; })'' */
+# define STMT_END )
+#else
+# if defined(VOIDFLAGS) && (VOIDFLAGS) && (defined(sun) || defined(__sun__)) && !defined(__GNUC__)
+# define STMT_START if (1)
+# define STMT_END else (void)0
+# else
+# define STMT_START do
+# define STMT_END while (0)
+# endif
+#endif
+#ifndef boolSV
+# define boolSV(b) ((b) ? &PL_sv_yes : &PL_sv_no)
+#endif
+
+/* DEFSV appears first in 5.004_56 */
+#ifndef DEFSV
+# define DEFSV GvSV(PL_defgv)
+#endif
+
+#ifndef SAVE_DEFSV
+# define SAVE_DEFSV SAVESPTR(GvSV(PL_defgv))
+#endif
+
+#ifndef DEFSV_set
+# define DEFSV_set(sv) (DEFSV = (sv))
+#endif
+
+/* Older perls (<=5.003) lack AvFILLp */
+#ifndef AvFILLp
+# define AvFILLp AvFILL
+#endif
+#ifndef ERRSV
+# define ERRSV get_sv("@",FALSE)
+#endif
+
+/* Hint: gv_stashpvn
+ * This function's backport doesn't support the length parameter, but
+ * rather ignores it. Portability can only be ensured if the length
+ * parameter is used for speed reasons, but the length can always be
+ * correctly computed from the string argument.
+ */
+#ifndef gv_stashpvn
+# define gv_stashpvn(str,len,create) gv_stashpv(str,create)
+#endif
+
+/* Replace: 1 */
+#ifndef get_cv
+# define get_cv perl_get_cv
+#endif
+
+#ifndef get_sv
+# define get_sv perl_get_sv
+#endif
+
+#ifndef get_av
+# define get_av perl_get_av
+#endif
+
+#ifndef get_hv
+# define get_hv perl_get_hv
+#endif
+
+/* Replace: 0 */
+#ifndef dUNDERBAR
+# define dUNDERBAR dNOOP
+#endif
+
+#ifndef UNDERBAR
+# define UNDERBAR DEFSV
+#endif
+#ifndef dAX
+# define dAX I32 ax = MARK - PL_stack_base + 1
+#endif
+
+#ifndef dITEMS
+# define dITEMS I32 items = SP - MARK
+#endif
+#ifndef dXSTARG
+# define dXSTARG SV * targ = sv_newmortal()
+#endif
+#ifndef dAXMARK
+# define dAXMARK I32 ax = POPMARK; \
+ register SV ** const mark = PL_stack_base + ax++
+#endif
+#ifndef XSprePUSH
+# define XSprePUSH (sp = PL_stack_base + ax - 1)
+#endif
+
+#if (PERL_BCDVERSION < 0x5005000)
+# undef XSRETURN
+# define XSRETURN(off) \
+ STMT_START { \
+ PL_stack_sp = PL_stack_base + ax + ((off) - 1); \
+ return; \
+ } STMT_END
+#endif
+#ifndef XSPROTO
+# define XSPROTO(name) void name(pTHX_ CV* cv)
+#endif
+
+#ifndef SVfARG
+# define SVfARG(p) ((void*)(p))
+#endif
+#ifndef PERL_ABS
+# define PERL_ABS(x) ((x) < 0 ? -(x) : (x))
+#endif
+#ifndef dVAR
+# define dVAR dNOOP
+#endif
+#ifndef SVf
+# define SVf "_"
+#endif
+#ifndef UTF8_MAXBYTES
+# define UTF8_MAXBYTES UTF8_MAXLEN
+#endif
+#ifndef CPERLscope
+# define CPERLscope(x) x
+#endif
+#ifndef PERL_HASH
+# define PERL_HASH(hash,str,len) \
+ STMT_START { \
+ const char *s_PeRlHaSh = str; \
+ I32 i_PeRlHaSh = len; \
+ U32 hash_PeRlHaSh = 0; \
+ while (i_PeRlHaSh--) \
+ hash_PeRlHaSh = hash_PeRlHaSh * 33 + *s_PeRlHaSh++; \
+ (hash) = hash_PeRlHaSh; \
+ } STMT_END
+#endif
+
+#ifndef PERLIO_FUNCS_DECL
+# ifdef PERLIO_FUNCS_CONST
+# define PERLIO_FUNCS_DECL(funcs) const PerlIO_funcs funcs
+# define PERLIO_FUNCS_CAST(funcs) (PerlIO_funcs*)(funcs)
+# else
+# define PERLIO_FUNCS_DECL(funcs) PerlIO_funcs funcs
+# define PERLIO_FUNCS_CAST(funcs) (funcs)
+# endif
+#endif
+
+/* provide these typedefs for older perls */
+#if (PERL_BCDVERSION < 0x5009003)
+
+# ifdef ARGSproto
+typedef OP* (CPERLscope(*Perl_ppaddr_t))(ARGSproto);
+# else
+typedef OP* (CPERLscope(*Perl_ppaddr_t))(pTHX);
+# endif
+
+typedef OP* (CPERLscope(*Perl_check_t)) (pTHX_ OP*);
+
+#endif
+#ifndef isPSXSPC
+# define isPSXSPC(c) (isSPACE(c) || (c) == '\v')
+#endif
+
+#ifndef isBLANK
+# define isBLANK(c) ((c) == ' ' || (c) == '\t')
+#endif
+
+#ifdef EBCDIC
+#ifndef isALNUMC
+# define isALNUMC(c) isalnum(c)
+#endif
+
+#ifndef isASCII
+# define isASCII(c) isascii(c)
+#endif
+
+#ifndef isCNTRL
+# define isCNTRL(c) iscntrl(c)
+#endif
+
+#ifndef isGRAPH
+# define isGRAPH(c) isgraph(c)
+#endif
+
+#ifndef isPRINT
+# define isPRINT(c) isprint(c)
+#endif
+
+#ifndef isPUNCT
+# define isPUNCT(c) ispunct(c)
+#endif
+
+#ifndef isXDIGIT
+# define isXDIGIT(c) isxdigit(c)
+#endif
+
+#else
+# if (PERL_BCDVERSION < 0x5010000)
+/* Hint: isPRINT
+ * The implementation in older perl versions includes all of the
+ * isSPACE() characters, which is wrong. The version provided by
+ * Devel::PPPort always overrides a present buggy version.
+ */
+# undef isPRINT
+# endif
+#ifndef isALNUMC
+# define isALNUMC(c) (isALPHA(c) || isDIGIT(c))
+#endif
+
+#ifndef isASCII
+# define isASCII(c) ((c) <= 127)
+#endif
+
+#ifndef isCNTRL
+# define isCNTRL(c) ((c) < ' ' || (c) == 127)
+#endif
+
+#ifndef isGRAPH
+# define isGRAPH(c) (isALNUM(c) || isPUNCT(c))
+#endif
+
+#ifndef isPRINT
+# define isPRINT(c) (((c) >= 32 && (c) < 127))
+#endif
+
+#ifndef isPUNCT
+# define isPUNCT(c) (((c) >= 33 && (c) <= 47) || ((c) >= 58 && (c) <= 64) || ((c) >= 91 && (c) <= 96) || ((c) >= 123 && (c) <= 126))
+#endif
+
+#ifndef isXDIGIT
+# define isXDIGIT(c) (isDIGIT(c) || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F'))
+#endif
+
+#endif
+
+#ifndef PERL_SIGNALS_UNSAFE_FLAG
+
+#define PERL_SIGNALS_UNSAFE_FLAG 0x0001
+
+#if (PERL_BCDVERSION < 0x5008000)
+# define D_PPP_PERL_SIGNALS_INIT PERL_SIGNALS_UNSAFE_FLAG
+#else
+# define D_PPP_PERL_SIGNALS_INIT 0
+#endif
+
+#if defined(NEED_PL_signals)
+static U32 DPPP_(my_PL_signals) = D_PPP_PERL_SIGNALS_INIT;
+#elif defined(NEED_PL_signals_GLOBAL)
+U32 DPPP_(my_PL_signals) = D_PPP_PERL_SIGNALS_INIT;
+#else
+extern U32 DPPP_(my_PL_signals);
+#endif
+#define PL_signals DPPP_(my_PL_signals)
+
+#endif
+
+/* Hint: PL_ppaddr
+ * Calling an op via PL_ppaddr requires passing a context argument
+ * for threaded builds. Since the context argument is different for
+ * 5.005 perls, you can use aTHXR (supplied by ppport.h), which will
+ * automatically be defined as the correct argument.
+ */
+
+#if (PERL_BCDVERSION <= 0x5005005)
+/* Replace: 1 */
+# define PL_ppaddr ppaddr
+# define PL_no_modify no_modify
+/* Replace: 0 */
+#endif
+
+#if (PERL_BCDVERSION <= 0x5004005)
+/* Replace: 1 */
+# define PL_DBsignal DBsignal
+# define PL_DBsingle DBsingle
+# define PL_DBsub DBsub
+# define PL_DBtrace DBtrace
+# define PL_Sv Sv
+# define PL_bufend bufend
+# define PL_bufptr bufptr
+# define PL_compiling compiling
+# define PL_copline copline
+# define PL_curcop curcop
+# define PL_curstash curstash
+# define PL_debstash debstash
+# define PL_defgv defgv
+# define PL_diehook diehook
+# define PL_dirty dirty
+# define PL_dowarn dowarn
+# define PL_errgv errgv
+# define PL_error_count error_count
+# define PL_expect expect
+# define PL_hexdigit hexdigit
+# define PL_hints hints
+# define PL_in_my in_my
+# define PL_laststatval laststatval
+# define PL_lex_state lex_state
+# define PL_lex_stuff lex_stuff
+# define PL_linestr linestr
+# define PL_na na
+# define PL_perl_destruct_level perl_destruct_level
+# define PL_perldb perldb
+# define PL_rsfp_filters rsfp_filters
+# define PL_rsfp rsfp
+# define PL_stack_base stack_base
+# define PL_stack_sp stack_sp
+# define PL_statcache statcache
+# define PL_stdingv stdingv
+# define PL_sv_arenaroot sv_arenaroot
+# define PL_sv_no sv_no
+# define PL_sv_undef sv_undef
+# define PL_sv_yes sv_yes
+# define PL_tainted tainted
+# define PL_tainting tainting
+# define PL_tokenbuf tokenbuf
+/* Replace: 0 */
+#endif
+
+/* Warning: PL_parser
+ * For perl versions earlier than 5.9.5, this is an always
+ * non-NULL dummy. Also, it cannot be dereferenced. Don't
+ * use it if you can avoid is and unless you absolutely know
+ * what you're doing.
+ * If you always check that PL_parser is non-NULL, you can
+ * define DPPP_PL_parser_NO_DUMMY to avoid the creation of
+ * a dummy parser structure.
+ */
+
+#if (PERL_BCDVERSION >= 0x5009005)
+# ifdef DPPP_PL_parser_NO_DUMMY
+# define D_PPP_my_PL_parser_var(var) ((PL_parser ? PL_parser : \
+ (croak("panic: PL_parser == NULL in %s:%d", \
+ __FILE__, __LINE__), (yy_parser *) NULL))->var)
+# else
+# ifdef DPPP_PL_parser_NO_DUMMY_WARNING
+# define D_PPP_parser_dummy_warning(var)
+# else
+# define D_PPP_parser_dummy_warning(var) \
+ warn("warning: dummy PL_" #var " used in %s:%d", __FILE__, __LINE__),
+# endif
+# define D_PPP_my_PL_parser_var(var) ((PL_parser ? PL_parser : \
+ (D_PPP_parser_dummy_warning(var) &DPPP_(dummy_PL_parser)))->var)
+#if defined(NEED_PL_parser)
+static yy_parser DPPP_(dummy_PL_parser);
+#elif defined(NEED_PL_parser_GLOBAL)
+yy_parser DPPP_(dummy_PL_parser);
+#else
+extern yy_parser DPPP_(dummy_PL_parser);
+#endif
+
+# endif
+
+/* PL_expect, PL_copline, PL_rsfp, PL_rsfp_filters, PL_linestr, PL_bufptr, PL_bufend, PL_lex_state, PL_lex_stuff, PL_tokenbuf depends on PL_parser */
+/* Warning: PL_expect, PL_copline, PL_rsfp, PL_rsfp_filters, PL_linestr, PL_bufptr, PL_bufend, PL_lex_state, PL_lex_stuff, PL_tokenbuf
+ * Do not use this variable unless you know exactly what you're
+ * doint. It is internal to the perl parser and may change or even
+ * be removed in the future. As of perl 5.9.5, you have to check
+ * for (PL_parser != NULL) for this variable to have any effect.
+ * An always non-NULL PL_parser dummy is provided for earlier
+ * perl versions.
+ * If PL_parser is NULL when you try to access this variable, a
+ * dummy is being accessed instead and a warning is issued unless
+ * you define DPPP_PL_parser_NO_DUMMY_WARNING.
+ * If DPPP_PL_parser_NO_DUMMY is defined, the code trying to access
+ * this variable will croak with a panic message.
+ */
+
+# define PL_expect D_PPP_my_PL_parser_var(expect)
+# define PL_copline D_PPP_my_PL_parser_var(copline)
+# define PL_rsfp D_PPP_my_PL_parser_var(rsfp)
+# define PL_rsfp_filters D_PPP_my_PL_parser_var(rsfp_filters)
+# define PL_linestr D_PPP_my_PL_parser_var(linestr)
+# define PL_bufptr D_PPP_my_PL_parser_var(bufptr)
+# define PL_bufend D_PPP_my_PL_parser_var(bufend)
+# define PL_lex_state D_PPP_my_PL_parser_var(lex_state)
+# define PL_lex_stuff D_PPP_my_PL_parser_var(lex_stuff)
+# define PL_tokenbuf D_PPP_my_PL_parser_var(tokenbuf)
+# define PL_in_my D_PPP_my_PL_parser_var(in_my)
+# define PL_in_my_stash D_PPP_my_PL_parser_var(in_my_stash)
+# define PL_error_count D_PPP_my_PL_parser_var(error_count)
+
+
+#else
+
+/* ensure that PL_parser != NULL and cannot be dereferenced */
+# define PL_parser ((void *) 1)
+
+#endif
+#ifndef mPUSHs
+# define mPUSHs(s) PUSHs(sv_2mortal(s))
+#endif
+
+#ifndef PUSHmortal
+# define PUSHmortal PUSHs(sv_newmortal())
+#endif
+
+#ifndef mPUSHp
+# define mPUSHp(p,l) sv_setpvn(PUSHmortal, (p), (l))
+#endif
+
+#ifndef mPUSHn
+# define mPUSHn(n) sv_setnv(PUSHmortal, (NV)(n))
+#endif
+
+#ifndef mPUSHi
+# define mPUSHi(i) sv_setiv(PUSHmortal, (IV)(i))
+#endif
+
+#ifndef mPUSHu
+# define mPUSHu(u) sv_setuv(PUSHmortal, (UV)(u))
+#endif
+#ifndef mXPUSHs
+# define mXPUSHs(s) XPUSHs(sv_2mortal(s))
+#endif
+
+#ifndef XPUSHmortal
+# define XPUSHmortal XPUSHs(sv_newmortal())
+#endif
+
+#ifndef mXPUSHp
+# define mXPUSHp(p,l) STMT_START { EXTEND(sp,1); sv_setpvn(PUSHmortal, (p), (l)); } STMT_END
+#endif
+
+#ifndef mXPUSHn
+# define mXPUSHn(n) STMT_START { EXTEND(sp,1); sv_setnv(PUSHmortal, (NV)(n)); } STMT_END
+#endif
+
+#ifndef mXPUSHi
+# define mXPUSHi(i) STMT_START { EXTEND(sp,1); sv_setiv(PUSHmortal, (IV)(i)); } STMT_END
+#endif
+
+#ifndef mXPUSHu
+# define mXPUSHu(u) STMT_START { EXTEND(sp,1); sv_setuv(PUSHmortal, (UV)(u)); } STMT_END
+#endif
+
+/* Replace: 1 */
+#ifndef call_sv
+# define call_sv perl_call_sv
+#endif
+
+#ifndef call_pv
+# define call_pv perl_call_pv
+#endif
+
+#ifndef call_argv
+# define call_argv perl_call_argv
+#endif
+
+#ifndef call_method
+# define call_method perl_call_method
+#endif
+#ifndef eval_sv
+# define eval_sv perl_eval_sv
+#endif
+
+/* Replace: 0 */
+#ifndef PERL_LOADMOD_DENY
+# define PERL_LOADMOD_DENY 0x1
+#endif
+
+#ifndef PERL_LOADMOD_NOIMPORT
+# define PERL_LOADMOD_NOIMPORT 0x2
+#endif
+
+#ifndef PERL_LOADMOD_IMPORT_OPS
+# define PERL_LOADMOD_IMPORT_OPS 0x4
+#endif
+
+#ifndef G_METHOD
+# define G_METHOD 64
+# ifdef call_sv
+# undef call_sv
+# endif
+# if (PERL_BCDVERSION < 0x5006000)
+# define call_sv(sv, flags) ((flags) & G_METHOD ? perl_call_method((char *) SvPV_nolen_const(sv), \
+ (flags) & ~G_METHOD) : perl_call_sv(sv, flags))
+# else
+# define call_sv(sv, flags) ((flags) & G_METHOD ? Perl_call_method(aTHX_ (char *) SvPV_nolen_const(sv), \
+ (flags) & ~G_METHOD) : Perl_call_sv(aTHX_ sv, flags))
+# endif
+#endif
+
+/* Replace perl_eval_pv with eval_pv */
+
+#ifndef eval_pv
+#if defined(NEED_eval_pv)
+static SV* DPPP_(my_eval_pv)(char *p, I32 croak_on_error);
+static
+#else
+extern SV* DPPP_(my_eval_pv)(char *p, I32 croak_on_error);
+#endif
+
+#ifdef eval_pv
+# undef eval_pv
+#endif
+#define eval_pv(a,b) DPPP_(my_eval_pv)(aTHX_ a,b)
+#define Perl_eval_pv DPPP_(my_eval_pv)
+
+#if defined(NEED_eval_pv) || defined(NEED_eval_pv_GLOBAL)
+
+SV*
+DPPP_(my_eval_pv)(char *p, I32 croak_on_error)
+{
+ dSP;
+ SV* sv = newSVpv(p, 0);
+
+ PUSHMARK(sp);
+ eval_sv(sv, G_SCALAR);
+ SvREFCNT_dec(sv);
+
+ SPAGAIN;
+ sv = POPs;
+ PUTBACK;
+
+ if (croak_on_error && SvTRUE(GvSV(errgv)))
+ croak(SvPVx(GvSV(errgv), na));
+
+ return sv;
+}
+
+#endif
+#endif
+
+#ifndef vload_module
+#if defined(NEED_vload_module)
+static void DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args);
+static
+#else
+extern void DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args);
+#endif
+
+#ifdef vload_module
+# undef vload_module
+#endif
+#define vload_module(a,b,c,d) DPPP_(my_vload_module)(aTHX_ a,b,c,d)
+#define Perl_vload_module DPPP_(my_vload_module)
+
+#if defined(NEED_vload_module) || defined(NEED_vload_module_GLOBAL)
+
+void
+DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args)
+{
+ dTHR;
+ dVAR;
+ OP *veop, *imop;
+
+ OP * const modname = newSVOP(OP_CONST, 0, name);
+ /* 5.005 has a somewhat hacky force_normal that doesn't croak on
+ SvREADONLY() if PL_compling is true. Current perls take care in
+ ck_require() to correctly turn off SvREADONLY before calling
+ force_normal_flags(). This seems a better fix than fudging PL_compling
+ */
+ SvREADONLY_off(((SVOP*)modname)->op_sv);
+ modname->op_private |= OPpCONST_BARE;
+ if (ver) {
+ veop = newSVOP(OP_CONST, 0, ver);
+ }
+ else
+ veop = NULL;
+ if (flags & PERL_LOADMOD_NOIMPORT) {
+ imop = sawparens(newNULLLIST());
+ }
+ else if (flags & PERL_LOADMOD_IMPORT_OPS) {
+ imop = va_arg(*args, OP*);
+ }
+ else {
+ SV *sv;
+ imop = NULL;
+ sv = va_arg(*args, SV*);
+ while (sv) {
+ imop = append_elem(OP_LIST, imop, newSVOP(OP_CONST, 0, sv));
+ sv = va_arg(*args, SV*);
+ }
+ }
+ {
+ const line_t ocopline = PL_copline;
+ COP * const ocurcop = PL_curcop;
+ const int oexpect = PL_expect;
+
+#if (PERL_BCDVERSION >= 0x5004000)
+ utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(FALSE, 0),
+ veop, modname, imop);
+#else
+ utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(),
+ modname, imop);
+#endif
+ PL_expect = oexpect;
+ PL_copline = ocopline;
+ PL_curcop = ocurcop;
+ }
+}
+
+#endif
+#endif
+
+#ifndef load_module
+#if defined(NEED_load_module)
+static void DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...);
+static
+#else
+extern void DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...);
+#endif
+
+#ifdef load_module
+# undef load_module
+#endif
+#define load_module DPPP_(my_load_module)
+#define Perl_load_module DPPP_(my_load_module)
+
+#if defined(NEED_load_module) || defined(NEED_load_module_GLOBAL)
+
+void
+DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...)
+{
+ va_list args;
+ va_start(args, ver);
+ vload_module(flags, name, ver, &args);
+ va_end(args);
+}
+
+#endif
+#endif
+#ifndef newRV_inc
+# define newRV_inc(sv) newRV(sv) /* Replace */
+#endif
+
+#ifndef newRV_noinc
+#if defined(NEED_newRV_noinc)
+static SV * DPPP_(my_newRV_noinc)(SV *sv);
+static
+#else
+extern SV * DPPP_(my_newRV_noinc)(SV *sv);
+#endif
+
+#ifdef newRV_noinc
+# undef newRV_noinc
+#endif
+#define newRV_noinc(a) DPPP_(my_newRV_noinc)(aTHX_ a)
+#define Perl_newRV_noinc DPPP_(my_newRV_noinc)
+
+#if defined(NEED_newRV_noinc) || defined(NEED_newRV_noinc_GLOBAL)
+SV *
+DPPP_(my_newRV_noinc)(SV *sv)
+{
+ SV *rv = (SV *)newRV(sv);
+ SvREFCNT_dec(sv);
+ return rv;
+}
+#endif
+#endif
+
+/* Hint: newCONSTSUB
+ * Returns a CV* as of perl-5.7.1. This return value is not supported
+ * by Devel::PPPort.
+ */
+
+/* newCONSTSUB from IO.xs is in the core starting with 5.004_63 */
+#if (PERL_BCDVERSION < 0x5004063) && (PERL_BCDVERSION != 0x5004005)
+#if defined(NEED_newCONSTSUB)
+static void DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv);
+static
+#else
+extern void DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv);
+#endif
+
+#ifdef newCONSTSUB
+# undef newCONSTSUB
+#endif
+#define newCONSTSUB(a,b,c) DPPP_(my_newCONSTSUB)(aTHX_ a,b,c)
+#define Perl_newCONSTSUB DPPP_(my_newCONSTSUB)
+
+#if defined(NEED_newCONSTSUB) || defined(NEED_newCONSTSUB_GLOBAL)
+
+/* This is just a trick to avoid a dependency of newCONSTSUB on PL_parser */
+/* (There's no PL_parser in perl < 5.005, so this is completely safe) */
+#define D_PPP_PL_copline PL_copline
+
+void
+DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv)
+{
+ U32 oldhints = PL_hints;
+ HV *old_cop_stash = PL_curcop->cop_stash;
+ HV *old_curstash = PL_curstash;
+ line_t oldline = PL_curcop->cop_line;
+ PL_curcop->cop_line = D_PPP_PL_copline;
+
+ PL_hints &= ~HINT_BLOCK_SCOPE;
+ if (stash)
+ PL_curstash = PL_curcop->cop_stash = stash;
+
+ newSUB(
+
+#if (PERL_BCDVERSION < 0x5003022)
+ start_subparse(),
+#elif (PERL_BCDVERSION == 0x5003022)
+ start_subparse(0),
+#else /* 5.003_23 onwards */
+ start_subparse(FALSE, 0),
+#endif
+
+ newSVOP(OP_CONST, 0, newSVpv((char *) name, 0)),
+ newSVOP(OP_CONST, 0, &PL_sv_no), /* SvPV(&PL_sv_no) == "" -- GMB */
+ newSTATEOP(0, Nullch, newSVOP(OP_CONST, 0, sv))
+ );
+
+ PL_hints = oldhints;
+ PL_curcop->cop_stash = old_cop_stash;
+ PL_curstash = old_curstash;
+ PL_curcop->cop_line = oldline;
+}
+#endif
+#endif
+
+/*
+ * Boilerplate macros for initializing and accessing interpreter-local
+ * data from C. All statics in extensions should be reworked to use
+ * this, if you want to make the extension thread-safe. See ext/re/re.xs
+ * for an example of the use of these macros.
+ *
+ * Code that uses these macros is responsible for the following:
+ * 1. #define MY_CXT_KEY to a unique string, e.g. "DynaLoader_guts"
+ * 2. Declare a typedef named my_cxt_t that is a structure that contains
+ * all the data that needs to be interpreter-local.
+ * 3. Use the START_MY_CXT macro after the declaration of my_cxt_t.
+ * 4. Use the MY_CXT_INIT macro such that it is called exactly once
+ * (typically put in the BOOT: section).
+ * 5. Use the members of the my_cxt_t structure everywhere as
+ * MY_CXT.member.
+ * 6. Use the dMY_CXT macro (a declaration) in all the functions that
+ * access MY_CXT.
+ */
+
+#if defined(MULTIPLICITY) || defined(PERL_OBJECT) || \
+ defined(PERL_CAPI) || defined(PERL_IMPLICIT_CONTEXT)
+
+#ifndef START_MY_CXT
+
+/* This must appear in all extensions that define a my_cxt_t structure,
+ * right after the definition (i.e. at file scope). The non-threads
+ * case below uses it to declare the data as static. */
+#define START_MY_CXT
+
+#if (PERL_BCDVERSION < 0x5004068)
+/* Fetches the SV that keeps the per-interpreter data. */
+#define dMY_CXT_SV \
+ SV *my_cxt_sv = get_sv(MY_CXT_KEY, FALSE)
+#else /* >= perl5.004_68 */
+#define dMY_CXT_SV \
+ SV *my_cxt_sv = *hv_fetch(PL_modglobal, MY_CXT_KEY, \
+ sizeof(MY_CXT_KEY)-1, TRUE)
+#endif /* < perl5.004_68 */
+
+/* This declaration should be used within all functions that use the
+ * interpreter-local data. */
+#define dMY_CXT \
+ dMY_CXT_SV; \
+ my_cxt_t *my_cxtp = INT2PTR(my_cxt_t*,SvUV(my_cxt_sv))
+
+/* Creates and zeroes the per-interpreter data.
+ * (We allocate my_cxtp in a Perl SV so that it will be released when
+ * the interpreter goes away.) */
+#define MY_CXT_INIT \
+ dMY_CXT_SV; \
+ /* newSV() allocates one more than needed */ \
+ my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\
+ Zero(my_cxtp, 1, my_cxt_t); \
+ sv_setuv(my_cxt_sv, PTR2UV(my_cxtp))
+
+/* This macro must be used to access members of the my_cxt_t structure.
+ * e.g. MYCXT.some_data */
+#define MY_CXT (*my_cxtp)
+
+/* Judicious use of these macros can reduce the number of times dMY_CXT
+ * is used. Use is similar to pTHX, aTHX etc. */
+#define pMY_CXT my_cxt_t *my_cxtp
+#define pMY_CXT_ pMY_CXT,
+#define _pMY_CXT ,pMY_CXT
+#define aMY_CXT my_cxtp
+#define aMY_CXT_ aMY_CXT,
+#define _aMY_CXT ,aMY_CXT
+
+#endif /* START_MY_CXT */
+
+#ifndef MY_CXT_CLONE
+/* Clones the per-interpreter data. */
+#define MY_CXT_CLONE \
+ dMY_CXT_SV; \
+ my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\
+ Copy(INT2PTR(my_cxt_t*, SvUV(my_cxt_sv)), my_cxtp, 1, my_cxt_t);\
+ sv_setuv(my_cxt_sv, PTR2UV(my_cxtp))
+#endif
+
+#else /* single interpreter */
+
+#ifndef START_MY_CXT
+
+#define START_MY_CXT static my_cxt_t my_cxt;
+#define dMY_CXT_SV dNOOP
+#define dMY_CXT dNOOP
+#define MY_CXT_INIT NOOP
+#define MY_CXT my_cxt
+
+#define pMY_CXT void
+#define pMY_CXT_
+#define _pMY_CXT
+#define aMY_CXT
+#define aMY_CXT_
+#define _aMY_CXT
+
+#endif /* START_MY_CXT */
+
+#ifndef MY_CXT_CLONE
+#define MY_CXT_CLONE NOOP
+#endif
+
+#endif
+
+#ifndef IVdf
+# if IVSIZE == LONGSIZE
+# define IVdf "ld"
+# define UVuf "lu"
+# define UVof "lo"
+# define UVxf "lx"
+# define UVXf "lX"
+# else
+# if IVSIZE == INTSIZE
+# define IVdf "d"
+# define UVuf "u"
+# define UVof "o"
+# define UVxf "x"
+# define UVXf "X"
+# endif
+# endif
+#endif
+
+#ifndef NVef
+# if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && \
+ defined(PERL_PRIfldbl) && (PERL_BCDVERSION != 0x5006000)
+ /* Not very likely, but let's try anyway. */
+# define NVef PERL_PRIeldbl
+# define NVff PERL_PRIfldbl
+# define NVgf PERL_PRIgldbl
+# else
+# define NVef "e"
+# define NVff "f"
+# define NVgf "g"
+# endif
+#endif
+
+#ifndef SvREFCNT_inc
+# ifdef PERL_USE_GCC_BRACE_GROUPS
+# define SvREFCNT_inc(sv) \
+ ({ \
+ SV * const _sv = (SV*)(sv); \
+ if (_sv) \
+ (SvREFCNT(_sv))++; \
+ _sv; \
+ })
+# else
+# define SvREFCNT_inc(sv) \
+ ((PL_Sv=(SV*)(sv)) ? (++(SvREFCNT(PL_Sv)),PL_Sv) : NULL)
+# endif
+#endif
+
+#ifndef SvREFCNT_inc_simple
+# ifdef PERL_USE_GCC_BRACE_GROUPS
+# define SvREFCNT_inc_simple(sv) \
+ ({ \
+ if (sv) \
+ (SvREFCNT(sv))++; \
+ (SV *)(sv); \
+ })
+# else
+# define SvREFCNT_inc_simple(sv) \
+ ((sv) ? (SvREFCNT(sv)++,(SV*)(sv)) : NULL)
+# endif
+#endif
+
+#ifndef SvREFCNT_inc_NN
+# ifdef PERL_USE_GCC_BRACE_GROUPS
+# define SvREFCNT_inc_NN(sv) \
+ ({ \
+ SV * const _sv = (SV*)(sv); \
+ SvREFCNT(_sv)++; \
+ _sv; \
+ })
+# else
+# define SvREFCNT_inc_NN(sv) \
+ (PL_Sv=(SV*)(sv),++(SvREFCNT(PL_Sv)),PL_Sv)
+# endif
+#endif
+
+#ifndef SvREFCNT_inc_void
+# ifdef PERL_USE_GCC_BRACE_GROUPS
+# define SvREFCNT_inc_void(sv) \
+ ({ \
+ SV * const _sv = (SV*)(sv); \
+ if (_sv) \
+ (void)(SvREFCNT(_sv)++); \
+ })
+# else
+# define SvREFCNT_inc_void(sv) \
+ (void)((PL_Sv=(SV*)(sv)) ? ++(SvREFCNT(PL_Sv)) : 0)
+# endif
+#endif
+#ifndef SvREFCNT_inc_simple_void
+# define SvREFCNT_inc_simple_void(sv) STMT_START { if (sv) SvREFCNT(sv)++; } STMT_END
+#endif
+
+#ifndef SvREFCNT_inc_simple_NN
+# define SvREFCNT_inc_simple_NN(sv) (++SvREFCNT(sv), (SV*)(sv))
+#endif
+
+#ifndef SvREFCNT_inc_void_NN
+# define SvREFCNT_inc_void_NN(sv) (void)(++SvREFCNT((SV*)(sv)))
+#endif
+
+#ifndef SvREFCNT_inc_simple_void_NN
+# define SvREFCNT_inc_simple_void_NN(sv) (void)(++SvREFCNT((SV*)(sv)))
+#endif
+
+#ifndef newSV_type
+
+#if defined(NEED_newSV_type)
+static SV* DPPP_(my_newSV_type)(pTHX_ svtype const t);
+static
+#else
+extern SV* DPPP_(my_newSV_type)(pTHX_ svtype const t);
+#endif
+
+#ifdef newSV_type
+# undef newSV_type
+#endif
+#define newSV_type(a) DPPP_(my_newSV_type)(aTHX_ a)
+#define Perl_newSV_type DPPP_(my_newSV_type)
+
+#if defined(NEED_newSV_type) || defined(NEED_newSV_type_GLOBAL)
+
+SV*
+DPPP_(my_newSV_type)(pTHX_ svtype const t)
+{
+ SV* const sv = newSV(0);
+ sv_upgrade(sv, t);
+ return sv;
+}
+
+#endif
+
+#endif
+
+#if (PERL_BCDVERSION < 0x5006000)
+# define D_PPP_CONSTPV_ARG(x) ((char *) (x))
+#else
+# define D_PPP_CONSTPV_ARG(x) (x)
+#endif
+#ifndef newSVpvn
+# define newSVpvn(data,len) ((data) \
+ ? ((len) ? newSVpv((data), (len)) : newSVpv("", 0)) \
+ : newSV(0))
+#endif
+#ifndef newSVpvn_utf8
+# define newSVpvn_utf8(s, len, u) newSVpvn_flags((s), (len), (u) ? SVf_UTF8 : 0)
+#endif
+#ifndef SVf_UTF8
+# define SVf_UTF8 0
+#endif
+
+#ifndef newSVpvn_flags
+
+#if defined(NEED_newSVpvn_flags)
+static SV * DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags);
+static
+#else
+extern SV * DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags);
+#endif
+
+#ifdef newSVpvn_flags
+# undef newSVpvn_flags
+#endif
+#define newSVpvn_flags(a,b,c) DPPP_(my_newSVpvn_flags)(aTHX_ a,b,c)
+#define Perl_newSVpvn_flags DPPP_(my_newSVpvn_flags)
+
+#if defined(NEED_newSVpvn_flags) || defined(NEED_newSVpvn_flags_GLOBAL)
+
+SV *
+DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags)
+{
+ SV *sv = newSVpvn(D_PPP_CONSTPV_ARG(s), len);
+ SvFLAGS(sv) |= (flags & SVf_UTF8);
+ return (flags & SVs_TEMP) ? sv_2mortal(sv) : sv;
+}
+
+#endif
+
+#endif
+
+/* Backwards compatibility stuff... :-( */
+#if !defined(NEED_sv_2pv_flags) && defined(NEED_sv_2pv_nolen)
+# define NEED_sv_2pv_flags
+#endif
+#if !defined(NEED_sv_2pv_flags_GLOBAL) && defined(NEED_sv_2pv_nolen_GLOBAL)
+# define NEED_sv_2pv_flags_GLOBAL
+#endif
+
+/* Hint: sv_2pv_nolen
+ * Use the SvPV_nolen() or SvPV_nolen_const() macros instead of sv_2pv_nolen().
+ */
+#ifndef sv_2pv_nolen
+# define sv_2pv_nolen(sv) SvPV_nolen(sv)
+#endif
+
+#ifdef SvPVbyte
+
+/* Hint: SvPVbyte
+ * Does not work in perl-5.6.1, ppport.h implements a version
+ * borrowed from perl-5.7.3.
+ */
+
+#if (PERL_BCDVERSION < 0x5007000)
+
+#if defined(NEED_sv_2pvbyte)
+static char * DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp);
+static
+#else
+extern char * DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp);
+#endif
+
+#ifdef sv_2pvbyte
+# undef sv_2pvbyte
+#endif
+#define sv_2pvbyte(a,b) DPPP_(my_sv_2pvbyte)(aTHX_ a,b)
+#define Perl_sv_2pvbyte DPPP_(my_sv_2pvbyte)
+
+#if defined(NEED_sv_2pvbyte) || defined(NEED_sv_2pvbyte_GLOBAL)
+
+char *
+DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp)
+{
+ sv_utf8_downgrade(sv,0);
+ return SvPV(sv,*lp);
+}
+
+#endif
+
+/* Hint: sv_2pvbyte
+ * Use the SvPVbyte() macro instead of sv_2pvbyte().
+ */
+
+#undef SvPVbyte
+
+#define SvPVbyte(sv, lp) \
+ ((SvFLAGS(sv) & (SVf_POK|SVf_UTF8)) == (SVf_POK) \
+ ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pvbyte(sv, &lp))
+
+#endif
+
+#else
+
+# define SvPVbyte SvPV
+# define sv_2pvbyte sv_2pv
+
+#endif
+#ifndef sv_2pvbyte_nolen
+# define sv_2pvbyte_nolen(sv) sv_2pv_nolen(sv)
+#endif
+
+/* Hint: sv_pvn
+ * Always use the SvPV() macro instead of sv_pvn().
+ */
+
+/* Hint: sv_pvn_force
+ * Always use the SvPV_force() macro instead of sv_pvn_force().
+ */
+
+/* If these are undefined, they're not handled by the core anyway */
+#ifndef SV_IMMEDIATE_UNREF
+# define SV_IMMEDIATE_UNREF 0
+#endif
+
+#ifndef SV_GMAGIC
+# define SV_GMAGIC 0
+#endif
+
+#ifndef SV_COW_DROP_PV
+# define SV_COW_DROP_PV 0
+#endif
+
+#ifndef SV_UTF8_NO_ENCODING
+# define SV_UTF8_NO_ENCODING 0
+#endif
+
+#ifndef SV_NOSTEAL
+# define SV_NOSTEAL 0
+#endif
+
+#ifndef SV_CONST_RETURN
+# define SV_CONST_RETURN 0
+#endif
+
+#ifndef SV_MUTABLE_RETURN
+# define SV_MUTABLE_RETURN 0
+#endif
+
+#ifndef SV_SMAGIC
+# define SV_SMAGIC 0
+#endif
+
+#ifndef SV_HAS_TRAILING_NUL
+# define SV_HAS_TRAILING_NUL 0
+#endif
+
+#ifndef SV_COW_SHARED_HASH_KEYS
+# define SV_COW_SHARED_HASH_KEYS 0
+#endif
+
+#if (PERL_BCDVERSION < 0x5007002)
+
+#if defined(NEED_sv_2pv_flags)
+static char * DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
+static
+#else
+extern char * DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
+#endif
+
+#ifdef sv_2pv_flags
+# undef sv_2pv_flags
+#endif
+#define sv_2pv_flags(a,b,c) DPPP_(my_sv_2pv_flags)(aTHX_ a,b,c)
+#define Perl_sv_2pv_flags DPPP_(my_sv_2pv_flags)
+
+#if defined(NEED_sv_2pv_flags) || defined(NEED_sv_2pv_flags_GLOBAL)
+
+char *
+DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags)
+{
+ STRLEN n_a = (STRLEN) flags;
+ return sv_2pv(sv, lp ? lp : &n_a);
+}
+
+#endif
+
+#if defined(NEED_sv_pvn_force_flags)
+static char * DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
+static
+#else
+extern char * DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
+#endif
+
+#ifdef sv_pvn_force_flags
+# undef sv_pvn_force_flags
+#endif
+#define sv_pvn_force_flags(a,b,c) DPPP_(my_sv_pvn_force_flags)(aTHX_ a,b,c)
+#define Perl_sv_pvn_force_flags DPPP_(my_sv_pvn_force_flags)
+
+#if defined(NEED_sv_pvn_force_flags) || defined(NEED_sv_pvn_force_flags_GLOBAL)
+
+char *
+DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags)
+{
+ STRLEN n_a = (STRLEN) flags;
+ return sv_pvn_force(sv, lp ? lp : &n_a);
+}
+
+#endif
+
+#endif
+
+#if (PERL_BCDVERSION < 0x5008008) || ( (PERL_BCDVERSION >= 0x5009000) && (PERL_BCDVERSION < 0x5009003) )
+# define DPPP_SVPV_NOLEN_LP_ARG &PL_na
+#else
+# define DPPP_SVPV_NOLEN_LP_ARG 0
+#endif
+#ifndef SvPV_const
+# define SvPV_const(sv, lp) SvPV_flags_const(sv, lp, SV_GMAGIC)
+#endif
+
+#ifndef SvPV_mutable
+# define SvPV_mutable(sv, lp) SvPV_flags_mutable(sv, lp, SV_GMAGIC)
+#endif
+#ifndef SvPV_flags
+# define SvPV_flags(sv, lp, flags) \
+ ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
+ ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pv_flags(sv, &lp, flags))
+#endif
+#ifndef SvPV_flags_const
+# define SvPV_flags_const(sv, lp, flags) \
+ ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
+ ? ((lp = SvCUR(sv)), SvPVX_const(sv)) : \
+ (const char*) sv_2pv_flags(sv, &lp, flags|SV_CONST_RETURN))
+#endif
+#ifndef SvPV_flags_const_nolen
+# define SvPV_flags_const_nolen(sv, flags) \
+ ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
+ ? SvPVX_const(sv) : \
+ (const char*) sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, flags|SV_CONST_RETURN))
+#endif
+#ifndef SvPV_flags_mutable
+# define SvPV_flags_mutable(sv, lp, flags) \
+ ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
+ ? ((lp = SvCUR(sv)), SvPVX_mutable(sv)) : \
+ sv_2pv_flags(sv, &lp, flags|SV_MUTABLE_RETURN))
+#endif
+#ifndef SvPV_force
+# define SvPV_force(sv, lp) SvPV_force_flags(sv, lp, SV_GMAGIC)
+#endif
+
+#ifndef SvPV_force_nolen
+# define SvPV_force_nolen(sv) SvPV_force_flags_nolen(sv, SV_GMAGIC)
+#endif
+
+#ifndef SvPV_force_mutable
+# define SvPV_force_mutable(sv, lp) SvPV_force_flags_mutable(sv, lp, SV_GMAGIC)
+#endif
+
+#ifndef SvPV_force_nomg
+# define SvPV_force_nomg(sv, lp) SvPV_force_flags(sv, lp, 0)
+#endif
+
+#ifndef SvPV_force_nomg_nolen
+# define SvPV_force_nomg_nolen(sv) SvPV_force_flags_nolen(sv, 0)
+#endif
+#ifndef SvPV_force_flags
+# define SvPV_force_flags(sv, lp, flags) \
+ ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
+ ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_pvn_force_flags(sv, &lp, flags))
+#endif
+#ifndef SvPV_force_flags_nolen
+# define SvPV_force_flags_nolen(sv, flags) \
+ ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
+ ? SvPVX(sv) : sv_pvn_force_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, flags))
+#endif
+#ifndef SvPV_force_flags_mutable
+# define SvPV_force_flags_mutable(sv, lp, flags) \
+ ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
+ ? ((lp = SvCUR(sv)), SvPVX_mutable(sv)) \
+ : sv_pvn_force_flags(sv, &lp, flags|SV_MUTABLE_RETURN))
+#endif
+#ifndef SvPV_nolen
+# define SvPV_nolen(sv) \
+ ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
+ ? SvPVX(sv) : sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, SV_GMAGIC))
+#endif
+#ifndef SvPV_nolen_const
+# define SvPV_nolen_const(sv) \
+ ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
+ ? SvPVX_const(sv) : sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, SV_GMAGIC|SV_CONST_RETURN))
+#endif
+#ifndef SvPV_nomg
+# define SvPV_nomg(sv, lp) SvPV_flags(sv, lp, 0)
+#endif
+
+#ifndef SvPV_nomg_const
+# define SvPV_nomg_const(sv, lp) SvPV_flags_const(sv, lp, 0)
+#endif
+
+#ifndef SvPV_nomg_const_nolen
+# define SvPV_nomg_const_nolen(sv) SvPV_flags_const_nolen(sv, 0)
+#endif
+#ifndef SvPV_renew
+# define SvPV_renew(sv,n) STMT_START { SvLEN_set(sv, n); \
+ SvPV_set((sv), (char *) saferealloc( \
+ (Malloc_t)SvPVX(sv), (MEM_SIZE)((n)))); \
+ } STMT_END
+#endif
+#ifndef SvMAGIC_set
+# define SvMAGIC_set(sv, val) \
+ STMT_START { assert(SvTYPE(sv) >= SVt_PVMG); \
+ (((XPVMG*) SvANY(sv))->xmg_magic = (val)); } STMT_END
+#endif
+
+#if (PERL_BCDVERSION < 0x5009003)
+#ifndef SvPVX_const
+# define SvPVX_const(sv) ((const char*) (0 + SvPVX(sv)))
+#endif
+
+#ifndef SvPVX_mutable
+# define SvPVX_mutable(sv) (0 + SvPVX(sv))
+#endif
+#ifndef SvRV_set
+# define SvRV_set(sv, val) \
+ STMT_START { assert(SvTYPE(sv) >= SVt_RV); \
+ (((XRV*) SvANY(sv))->xrv_rv = (val)); } STMT_END
+#endif
+
+#else
+#ifndef SvPVX_const
+# define SvPVX_const(sv) ((const char*)((sv)->sv_u.svu_pv))
+#endif
+
+#ifndef SvPVX_mutable
+# define SvPVX_mutable(sv) ((sv)->sv_u.svu_pv)
+#endif
+#ifndef SvRV_set
+# define SvRV_set(sv, val) \
+ STMT_START { assert(SvTYPE(sv) >= SVt_RV); \
+ ((sv)->sv_u.svu_rv = (val)); } STMT_END
+#endif
+
+#endif
+#ifndef SvSTASH_set
+# define SvSTASH_set(sv, val) \
+ STMT_START { assert(SvTYPE(sv) >= SVt_PVMG); \
+ (((XPVMG*) SvANY(sv))->xmg_stash = (val)); } STMT_END
+#endif
+
+#if (PERL_BCDVERSION < 0x5004000)
+#ifndef SvUV_set
+# define SvUV_set(sv, val) \
+ STMT_START { assert(SvTYPE(sv) == SVt_IV || SvTYPE(sv) >= SVt_PVIV); \
+ (((XPVIV*) SvANY(sv))->xiv_iv = (IV) (val)); } STMT_END
+#endif
+
+#else
+#ifndef SvUV_set
+# define SvUV_set(sv, val) \
+ STMT_START { assert(SvTYPE(sv) == SVt_IV || SvTYPE(sv) >= SVt_PVIV); \
+ (((XPVUV*) SvANY(sv))->xuv_uv = (val)); } STMT_END
+#endif
+
+#endif
+
+#if (PERL_BCDVERSION >= 0x5004000) && !defined(vnewSVpvf)
+#if defined(NEED_vnewSVpvf)
+static SV * DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args);
+static
+#else
+extern SV * DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args);
+#endif
+
+#ifdef vnewSVpvf
+# undef vnewSVpvf
+#endif
+#define vnewSVpvf(a,b) DPPP_(my_vnewSVpvf)(aTHX_ a,b)
+#define Perl_vnewSVpvf DPPP_(my_vnewSVpvf)
+
+#if defined(NEED_vnewSVpvf) || defined(NEED_vnewSVpvf_GLOBAL)
+
+SV *
+DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args)
+{
+ register SV *sv = newSV(0);
+ sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*));
+ return sv;
+}
+
+#endif
+#endif
+
+#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vcatpvf)
+# define sv_vcatpvf(sv, pat, args) sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*))
+#endif
+
+#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vsetpvf)
+# define sv_vsetpvf(sv, pat, args) sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*))
+#endif
+
+#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_catpvf_mg)
+#if defined(NEED_sv_catpvf_mg)
+static void DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
+static
+#else
+extern void DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
+#endif
+
+#define Perl_sv_catpvf_mg DPPP_(my_sv_catpvf_mg)
+
+#if defined(NEED_sv_catpvf_mg) || defined(NEED_sv_catpvf_mg_GLOBAL)
+
+void
+DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...)
+{
+ va_list args;
+ va_start(args, pat);
+ sv_vcatpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
+ SvSETMAGIC(sv);
+ va_end(args);
+}
+
+#endif
+#endif
+
+#ifdef PERL_IMPLICIT_CONTEXT
+#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_catpvf_mg_nocontext)
+#if defined(NEED_sv_catpvf_mg_nocontext)
+static void DPPP_(my_sv_catpvf_mg_nocontext)(SV *sv, const char *pat, ...);
+static
+#else
+extern void DPPP_(my_sv_catpvf_mg_nocontext)(SV *sv, const char *pat, ...);
+#endif
+
+#define sv_catpvf_mg_nocontext DPPP_(my_sv_catpvf_mg_nocontext)
+#define Perl_sv_catpvf_mg_nocontext DPPP_(my_sv_catpvf_mg_nocontext)
+
+#if defined(NEED_sv_catpvf_mg_nocontext) || defined(NEED_sv_catpvf_mg_nocontext_GLOBAL)
+
+void
+DPPP_(my_sv_catpvf_mg_nocontext)(SV *sv, const char *pat, ...)
+{
+ dTHX;
+ va_list args;
+ va_start(args, pat);
+ sv_vcatpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
+ SvSETMAGIC(sv);
+ va_end(args);
+}
+
+#endif
+#endif
+#endif
+
+/* sv_catpvf_mg depends on sv_catpvf_mg_nocontext */
+#ifndef sv_catpvf_mg
+# ifdef PERL_IMPLICIT_CONTEXT
+# define sv_catpvf_mg Perl_sv_catpvf_mg_nocontext
+# else
+# define sv_catpvf_mg Perl_sv_catpvf_mg
+# endif
+#endif
+
+#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vcatpvf_mg)
+# define sv_vcatpvf_mg(sv, pat, args) \
+ STMT_START { \
+ sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)); \
+ SvSETMAGIC(sv); \
+ } STMT_END
+#endif
+
+#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_setpvf_mg)
+#if defined(NEED_sv_setpvf_mg)
+static void DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
+static
+#else
+extern void DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
+#endif
+
+#define Perl_sv_setpvf_mg DPPP_(my_sv_setpvf_mg)
+
+#if defined(NEED_sv_setpvf_mg) || defined(NEED_sv_setpvf_mg_GLOBAL)
+
+void
+DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...)
+{
+ va_list args;
+ va_start(args, pat);
+ sv_vsetpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
+ SvSETMAGIC(sv);
+ va_end(args);
+}
+
+#endif
+#endif
+
+#ifdef PERL_IMPLICIT_CONTEXT
+#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_setpvf_mg_nocontext)
+#if defined(NEED_sv_setpvf_mg_nocontext)
+static void DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...);
+static
+#else
+extern void DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...);
+#endif
+
+#define sv_setpvf_mg_nocontext DPPP_(my_sv_setpvf_mg_nocontext)
+#define Perl_sv_setpvf_mg_nocontext DPPP_(my_sv_setpvf_mg_nocontext)
+
+#if defined(NEED_sv_setpvf_mg_nocontext) || defined(NEED_sv_setpvf_mg_nocontext_GLOBAL)
+
+void
+DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...)
+{
+ dTHX;
+ va_list args;
+ va_start(args, pat);
+ sv_vsetpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
+ SvSETMAGIC(sv);
+ va_end(args);
+}
+
+#endif
+#endif
+#endif
+
+/* sv_setpvf_mg depends on sv_setpvf_mg_nocontext */
+#ifndef sv_setpvf_mg
+# ifdef PERL_IMPLICIT_CONTEXT
+# define sv_setpvf_mg Perl_sv_setpvf_mg_nocontext
+# else
+# define sv_setpvf_mg Perl_sv_setpvf_mg
+# endif
+#endif
+
+#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vsetpvf_mg)
+# define sv_vsetpvf_mg(sv, pat, args) \
+ STMT_START { \
+ sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)); \
+ SvSETMAGIC(sv); \
+ } STMT_END
+#endif
+
+#ifndef newSVpvn_share
+
+#if defined(NEED_newSVpvn_share)
+static SV * DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash);
+static
+#else
+extern SV * DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash);
+#endif
+
+#ifdef newSVpvn_share
+# undef newSVpvn_share
+#endif
+#define newSVpvn_share(a,b,c) DPPP_(my_newSVpvn_share)(aTHX_ a,b,c)
+#define Perl_newSVpvn_share DPPP_(my_newSVpvn_share)
+
+#if defined(NEED_newSVpvn_share) || defined(NEED_newSVpvn_share_GLOBAL)
+
+SV *
+DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash)
+{
+ SV *sv;
+ if (len < 0)
+ len = -len;
+ if (!hash)
+ PERL_HASH(hash, (char*) src, len);
+ sv = newSVpvn((char *) src, len);
+ sv_upgrade(sv, SVt_PVIV);
+ SvIVX(sv) = hash;
+ SvREADONLY_on(sv);
+ SvPOK_on(sv);
+ return sv;
+}
+
+#endif
+
+#endif
+#ifndef SvSHARED_HASH
+# define SvSHARED_HASH(sv) (0 + SvUVX(sv))
+#endif
+#ifndef HvNAME_get
+# define HvNAME_get(hv) HvNAME(hv)
+#endif
+#ifndef HvNAMELEN_get
+# define HvNAMELEN_get(hv) (HvNAME_get(hv) ? (I32)strlen(HvNAME_get(hv)) : 0)
+#endif
+#ifndef GvSVn
+# define GvSVn(gv) GvSV(gv)
+#endif
+
+#ifndef isGV_with_GP
+# define isGV_with_GP(gv) isGV(gv)
+#endif
+#ifndef WARN_ALL
+# define WARN_ALL 0
+#endif
+
+#ifndef WARN_CLOSURE
+# define WARN_CLOSURE 1
+#endif
+
+#ifndef WARN_DEPRECATED
+# define WARN_DEPRECATED 2
+#endif
+
+#ifndef WARN_EXITING
+# define WARN_EXITING 3
+#endif
+
+#ifndef WARN_GLOB
+# define WARN_GLOB 4
+#endif
+
+#ifndef WARN_IO
+# define WARN_IO 5
+#endif
+
+#ifndef WARN_CLOSED
+# define WARN_CLOSED 6
+#endif
+
+#ifndef WARN_EXEC
+# define WARN_EXEC 7
+#endif
+
+#ifndef WARN_LAYER
+# define WARN_LAYER 8
+#endif
+
+#ifndef WARN_NEWLINE
+# define WARN_NEWLINE 9
+#endif
+
+#ifndef WARN_PIPE
+# define WARN_PIPE 10
+#endif
+
+#ifndef WARN_UNOPENED
+# define WARN_UNOPENED 11
+#endif
+
+#ifndef WARN_MISC
+# define WARN_MISC 12
+#endif
+
+#ifndef WARN_NUMERIC
+# define WARN_NUMERIC 13
+#endif
+
+#ifndef WARN_ONCE
+# define WARN_ONCE 14
+#endif
+
+#ifndef WARN_OVERFLOW
+# define WARN_OVERFLOW 15
+#endif
+
+#ifndef WARN_PACK
+# define WARN_PACK 16
+#endif
+
+#ifndef WARN_PORTABLE
+# define WARN_PORTABLE 17
+#endif
+
+#ifndef WARN_RECURSION
+# define WARN_RECURSION 18
+#endif
+
+#ifndef WARN_REDEFINE
+# define WARN_REDEFINE 19
+#endif
+
+#ifndef WARN_REGEXP
+# define WARN_REGEXP 20
+#endif
+
+#ifndef WARN_SEVERE
+# define WARN_SEVERE 21
+#endif
+
+#ifndef WARN_DEBUGGING
+# define WARN_DEBUGGING 22
+#endif
+
+#ifndef WARN_INPLACE
+# define WARN_INPLACE 23
+#endif
+
+#ifndef WARN_INTERNAL
+# define WARN_INTERNAL 24
+#endif
+
+#ifndef WARN_MALLOC
+# define WARN_MALLOC 25
+#endif
+
+#ifndef WARN_SIGNAL
+# define WARN_SIGNAL 26
+#endif
+
+#ifndef WARN_SUBSTR
+# define WARN_SUBSTR 27
+#endif
+
+#ifndef WARN_SYNTAX
+# define WARN_SYNTAX 28
+#endif
+
+#ifndef WARN_AMBIGUOUS
+# define WARN_AMBIGUOUS 29
+#endif
+
+#ifndef WARN_BAREWORD
+# define WARN_BAREWORD 30
+#endif
+
+#ifndef WARN_DIGIT
+# define WARN_DIGIT 31
+#endif
+
+#ifndef WARN_PARENTHESIS
+# define WARN_PARENTHESIS 32
+#endif
+
+#ifndef WARN_PRECEDENCE
+# define WARN_PRECEDENCE 33
+#endif
+
+#ifndef WARN_PRINTF
+# define WARN_PRINTF 34
+#endif
+
+#ifndef WARN_PROTOTYPE
+# define WARN_PROTOTYPE 35
+#endif
+
+#ifndef WARN_QW
+# define WARN_QW 36
+#endif
+
+#ifndef WARN_RESERVED
+# define WARN_RESERVED 37
+#endif
+
+#ifndef WARN_SEMICOLON
+# define WARN_SEMICOLON 38
+#endif
+
+#ifndef WARN_TAINT
+# define WARN_TAINT 39
+#endif
+
+#ifndef WARN_THREADS
+# define WARN_THREADS 40
+#endif
+
+#ifndef WARN_UNINITIALIZED
+# define WARN_UNINITIALIZED 41
+#endif
+
+#ifndef WARN_UNPACK
+# define WARN_UNPACK 42
+#endif
+
+#ifndef WARN_UNTIE
+# define WARN_UNTIE 43
+#endif
+
+#ifndef WARN_UTF8
+# define WARN_UTF8 44
+#endif
+
+#ifndef WARN_VOID
+# define WARN_VOID 45
+#endif
+
+#ifndef WARN_ASSERTIONS
+# define WARN_ASSERTIONS 46
+#endif
+#ifndef packWARN
+# define packWARN(a) (a)
+#endif
+
+#ifndef ckWARN
+# ifdef G_WARN_ON
+# define ckWARN(a) (PL_dowarn & G_WARN_ON)
+# else
+# define ckWARN(a) PL_dowarn
+# endif
+#endif
+
+#if (PERL_BCDVERSION >= 0x5004000) && !defined(warner)
+#if defined(NEED_warner)
+static void DPPP_(my_warner)(U32 err, const char *pat, ...);
+static
+#else
+extern void DPPP_(my_warner)(U32 err, const char *pat, ...);
+#endif
+
+#define Perl_warner DPPP_(my_warner)
+
+#if defined(NEED_warner) || defined(NEED_warner_GLOBAL)
+
+void
+DPPP_(my_warner)(U32 err, const char *pat, ...)
+{
+ SV *sv;
+ va_list args;
+
+ PERL_UNUSED_ARG(err);
+
+ va_start(args, pat);
+ sv = vnewSVpvf(pat, &args);
+ va_end(args);
+ sv_2mortal(sv);
+ warn("%s", SvPV_nolen(sv));
+}
+
+#define warner Perl_warner
+
+#define Perl_warner_nocontext Perl_warner
+
+#endif
+#endif
+
+/* concatenating with "" ensures that only literal strings are accepted as argument
+ * note that STR_WITH_LEN() can't be used as argument to macros or functions that
+ * under some configurations might be macros
+ */
+#ifndef STR_WITH_LEN
+# define STR_WITH_LEN(s) (s ""), (sizeof(s)-1)
+#endif
+#ifndef newSVpvs
+# define newSVpvs(str) newSVpvn(str "", sizeof(str) - 1)
+#endif
+
+#ifndef newSVpvs_flags
+# define newSVpvs_flags(str, flags) newSVpvn_flags(str "", sizeof(str) - 1, flags)
+#endif
+
+#ifndef sv_catpvs
+# define sv_catpvs(sv, str) sv_catpvn(sv, str "", sizeof(str) - 1)
+#endif
+
+#ifndef sv_setpvs
+# define sv_setpvs(sv, str) sv_setpvn(sv, str "", sizeof(str) - 1)
+#endif
+
+#ifndef hv_fetchs
+# define hv_fetchs(hv, key, lval) hv_fetch(hv, key "", sizeof(key) - 1, lval)
+#endif
+
+#ifndef hv_stores
+# define hv_stores(hv, key, val) hv_store(hv, key "", sizeof(key) - 1, val, 0)
+#endif
+#ifndef gv_fetchpvn_flags
+# define gv_fetchpvn_flags(name, len, flags, svt) gv_fetchpv(name, flags, svt)
+#endif
+
+#ifndef gv_fetchpvs
+# define gv_fetchpvs(name, flags, svt) gv_fetchpvn_flags(name "", sizeof(name) - 1, flags, svt)
+#endif
+
+#ifndef gv_stashpvs
+# define gv_stashpvs(name, flags) gv_stashpvn(name "", sizeof(name) - 1, flags)
+#endif
+#ifndef SvGETMAGIC
+# define SvGETMAGIC(x) STMT_START { if (SvGMAGICAL(x)) mg_get(x); } STMT_END
+#endif
+#ifndef PERL_MAGIC_sv
+# define PERL_MAGIC_sv '\0'
+#endif
+
+#ifndef PERL_MAGIC_overload
+# define PERL_MAGIC_overload 'A'
+#endif
+
+#ifndef PERL_MAGIC_overload_elem
+# define PERL_MAGIC_overload_elem 'a'
+#endif
+
+#ifndef PERL_MAGIC_overload_table
+# define PERL_MAGIC_overload_table 'c'
+#endif
+
+#ifndef PERL_MAGIC_bm
+# define PERL_MAGIC_bm 'B'
+#endif
+
+#ifndef PERL_MAGIC_regdata
+# define PERL_MAGIC_regdata 'D'
+#endif
+
+#ifndef PERL_MAGIC_regdatum
+# define PERL_MAGIC_regdatum 'd'
+#endif
+
+#ifndef PERL_MAGIC_env
+# define PERL_MAGIC_env 'E'
+#endif
+
+#ifndef PERL_MAGIC_envelem
+# define PERL_MAGIC_envelem 'e'
+#endif
+
+#ifndef PERL_MAGIC_fm
+# define PERL_MAGIC_fm 'f'
+#endif
+
+#ifndef PERL_MAGIC_regex_global
+# define PERL_MAGIC_regex_global 'g'
+#endif
+
+#ifndef PERL_MAGIC_isa
+# define PERL_MAGIC_isa 'I'
+#endif
+
+#ifndef PERL_MAGIC_isaelem
+# define PERL_MAGIC_isaelem 'i'
+#endif
+
+#ifndef PERL_MAGIC_nkeys
+# define PERL_MAGIC_nkeys 'k'
+#endif
+
+#ifndef PERL_MAGIC_dbfile
+# define PERL_MAGIC_dbfile 'L'
+#endif
+
+#ifndef PERL_MAGIC_dbline
+# define PERL_MAGIC_dbline 'l'
+#endif
+
+#ifndef PERL_MAGIC_mutex
+# define PERL_MAGIC_mutex 'm'
+#endif
+
+#ifndef PERL_MAGIC_shared
+# define PERL_MAGIC_shared 'N'
+#endif
+
+#ifndef PERL_MAGIC_shared_scalar
+# define PERL_MAGIC_shared_scalar 'n'
+#endif
+
+#ifndef PERL_MAGIC_collxfrm
+# define PERL_MAGIC_collxfrm 'o'
+#endif
+
+#ifndef PERL_MAGIC_tied
+# define PERL_MAGIC_tied 'P'
+#endif
+
+#ifndef PERL_MAGIC_tiedelem
+# define PERL_MAGIC_tiedelem 'p'
+#endif
+
+#ifndef PERL_MAGIC_tiedscalar
+# define PERL_MAGIC_tiedscalar 'q'
+#endif
+
+#ifndef PERL_MAGIC_qr
+# define PERL_MAGIC_qr 'r'
+#endif
+
+#ifndef PERL_MAGIC_sig
+# define PERL_MAGIC_sig 'S'
+#endif
+
+#ifndef PERL_MAGIC_sigelem
+# define PERL_MAGIC_sigelem 's'
+#endif
+
+#ifndef PERL_MAGIC_taint
+# define PERL_MAGIC_taint 't'
+#endif
+
+#ifndef PERL_MAGIC_uvar
+# define PERL_MAGIC_uvar 'U'
+#endif
+
+#ifndef PERL_MAGIC_uvar_elem
+# define PERL_MAGIC_uvar_elem 'u'
+#endif
+
+#ifndef PERL_MAGIC_vstring
+# define PERL_MAGIC_vstring 'V'
+#endif
+
+#ifndef PERL_MAGIC_vec
+# define PERL_MAGIC_vec 'v'
+#endif
+
+#ifndef PERL_MAGIC_utf8
+# define PERL_MAGIC_utf8 'w'
+#endif
+
+#ifndef PERL_MAGIC_substr
+# define PERL_MAGIC_substr 'x'
+#endif
+
+#ifndef PERL_MAGIC_defelem
+# define PERL_MAGIC_defelem 'y'
+#endif
+
+#ifndef PERL_MAGIC_glob
+# define PERL_MAGIC_glob '*'
+#endif
+
+#ifndef PERL_MAGIC_arylen
+# define PERL_MAGIC_arylen '#'
+#endif
+
+#ifndef PERL_MAGIC_pos
+# define PERL_MAGIC_pos '.'
+#endif
+
+#ifndef PERL_MAGIC_backref
+# define PERL_MAGIC_backref '<'
+#endif
+
+#ifndef PERL_MAGIC_ext
+# define PERL_MAGIC_ext '~'
+#endif
+
+/* That's the best we can do... */
+#ifndef sv_catpvn_nomg
+# define sv_catpvn_nomg sv_catpvn
+#endif
+
+#ifndef sv_catsv_nomg
+# define sv_catsv_nomg sv_catsv
+#endif
+
+#ifndef sv_setsv_nomg
+# define sv_setsv_nomg sv_setsv
+#endif
+
+#ifndef sv_pvn_nomg
+# define sv_pvn_nomg sv_pvn
+#endif
+
+#ifndef SvIV_nomg
+# define SvIV_nomg SvIV
+#endif
+
+#ifndef SvUV_nomg
+# define SvUV_nomg SvUV
+#endif
+
+#ifndef sv_catpv_mg
+# define sv_catpv_mg(sv, ptr) \
+ STMT_START { \
+ SV *TeMpSv = sv; \
+ sv_catpv(TeMpSv,ptr); \
+ SvSETMAGIC(TeMpSv); \
+ } STMT_END
+#endif
+
+#ifndef sv_catpvn_mg
+# define sv_catpvn_mg(sv, ptr, len) \
+ STMT_START { \
+ SV *TeMpSv = sv; \
+ sv_catpvn(TeMpSv,ptr,len); \
+ SvSETMAGIC(TeMpSv); \
+ } STMT_END
+#endif
+
+#ifndef sv_catsv_mg
+# define sv_catsv_mg(dsv, ssv) \
+ STMT_START { \
+ SV *TeMpSv = dsv; \
+ sv_catsv(TeMpSv,ssv); \
+ SvSETMAGIC(TeMpSv); \
+ } STMT_END
+#endif
+
+#ifndef sv_setiv_mg
+# define sv_setiv_mg(sv, i) \
+ STMT_START { \
+ SV *TeMpSv = sv; \
+ sv_setiv(TeMpSv,i); \
+ SvSETMAGIC(TeMpSv); \
+ } STMT_END
+#endif
+
+#ifndef sv_setnv_mg
+# define sv_setnv_mg(sv, num) \
+ STMT_START { \
+ SV *TeMpSv = sv; \
+ sv_setnv(TeMpSv,num); \
+ SvSETMAGIC(TeMpSv); \
+ } STMT_END
+#endif
+
+#ifndef sv_setpv_mg
+# define sv_setpv_mg(sv, ptr) \
+ STMT_START { \
+ SV *TeMpSv = sv; \
+ sv_setpv(TeMpSv,ptr); \
+ SvSETMAGIC(TeMpSv); \
+ } STMT_END
+#endif
+
+#ifndef sv_setpvn_mg
+# define sv_setpvn_mg(sv, ptr, len) \
+ STMT_START { \
+ SV *TeMpSv = sv; \
+ sv_setpvn(TeMpSv,ptr,len); \
+ SvSETMAGIC(TeMpSv); \
+ } STMT_END
+#endif
+
+#ifndef sv_setsv_mg
+# define sv_setsv_mg(dsv, ssv) \
+ STMT_START { \
+ SV *TeMpSv = dsv; \
+ sv_setsv(TeMpSv,ssv); \
+ SvSETMAGIC(TeMpSv); \
+ } STMT_END
+#endif
+
+#ifndef sv_setuv_mg
+# define sv_setuv_mg(sv, i) \
+ STMT_START { \
+ SV *TeMpSv = sv; \
+ sv_setuv(TeMpSv,i); \
+ SvSETMAGIC(TeMpSv); \
+ } STMT_END
+#endif
+
+#ifndef sv_usepvn_mg
+# define sv_usepvn_mg(sv, ptr, len) \
+ STMT_START { \
+ SV *TeMpSv = sv; \
+ sv_usepvn(TeMpSv,ptr,len); \
+ SvSETMAGIC(TeMpSv); \
+ } STMT_END
+#endif
+#ifndef SvVSTRING_mg
+# define SvVSTRING_mg(sv) (SvMAGICAL(sv) ? mg_find(sv, PERL_MAGIC_vstring) : NULL)
+#endif
+
+/* Hint: sv_magic_portable
+ * This is a compatibility function that is only available with
+ * Devel::PPPort. It is NOT in the perl core.
+ * Its purpose is to mimic the 5.8.0 behaviour of sv_magic() when
+ * it is being passed a name pointer with namlen == 0. In that
+ * case, perl 5.8.0 and later store the pointer, not a copy of it.
+ * The compatibility can be provided back to perl 5.004. With
+ * earlier versions, the code will not compile.
+ */
+
+#if (PERL_BCDVERSION < 0x5004000)
+
+ /* code that uses sv_magic_portable will not compile */
+
+#elif (PERL_BCDVERSION < 0x5008000)
+
+# define sv_magic_portable(sv, obj, how, name, namlen) \
+ STMT_START { \
+ SV *SvMp_sv = (sv); \
+ char *SvMp_name = (char *) (name); \
+ I32 SvMp_namlen = (namlen); \
+ if (SvMp_name && SvMp_namlen == 0) \
+ { \
+ MAGIC *mg; \
+ sv_magic(SvMp_sv, obj, how, 0, 0); \
+ mg = SvMAGIC(SvMp_sv); \
+ mg->mg_len = -42; /* XXX: this is the tricky part */ \
+ mg->mg_ptr = SvMp_name; \
+ } \
+ else \
+ { \
+ sv_magic(SvMp_sv, obj, how, SvMp_name, SvMp_namlen); \
+ } \
+ } STMT_END
+
+#else
+
+# define sv_magic_portable(a, b, c, d, e) sv_magic(a, b, c, d, e)
+
+#endif
+
+#ifdef USE_ITHREADS
+#ifndef CopFILE
+# define CopFILE(c) ((c)->cop_file)
+#endif
+
+#ifndef CopFILEGV
+# define CopFILEGV(c) (CopFILE(c) ? gv_fetchfile(CopFILE(c)) : Nullgv)
+#endif
+
+#ifndef CopFILE_set
+# define CopFILE_set(c,pv) ((c)->cop_file = savepv(pv))
+#endif
+
+#ifndef CopFILESV
+# define CopFILESV(c) (CopFILE(c) ? GvSV(gv_fetchfile(CopFILE(c))) : Nullsv)
+#endif
+
+#ifndef CopFILEAV
+# define CopFILEAV(c) (CopFILE(c) ? GvAV(gv_fetchfile(CopFILE(c))) : Nullav)
+#endif
+
+#ifndef CopSTASHPV
+# define CopSTASHPV(c) ((c)->cop_stashpv)
+#endif
+
+#ifndef CopSTASHPV_set
+# define CopSTASHPV_set(c,pv) ((c)->cop_stashpv = ((pv) ? savepv(pv) : Nullch))
+#endif
+
+#ifndef CopSTASH
+# define CopSTASH(c) (CopSTASHPV(c) ? gv_stashpv(CopSTASHPV(c),GV_ADD) : Nullhv)
+#endif
+
+#ifndef CopSTASH_set
+# define CopSTASH_set(c,hv) CopSTASHPV_set(c, (hv) ? HvNAME(hv) : Nullch)
+#endif
+
+#ifndef CopSTASH_eq
+# define CopSTASH_eq(c,hv) ((hv) && (CopSTASHPV(c) == HvNAME(hv) \
+ || (CopSTASHPV(c) && HvNAME(hv) \
+ && strEQ(CopSTASHPV(c), HvNAME(hv)))))
+#endif
+
+#else
+#ifndef CopFILEGV
+# define CopFILEGV(c) ((c)->cop_filegv)
+#endif
+
+#ifndef CopFILEGV_set
+# define CopFILEGV_set(c,gv) ((c)->cop_filegv = (GV*)SvREFCNT_inc(gv))
+#endif
+
+#ifndef CopFILE_set
+# define CopFILE_set(c,pv) CopFILEGV_set((c), gv_fetchfile(pv))
+#endif
+
+#ifndef CopFILESV
+# define CopFILESV(c) (CopFILEGV(c) ? GvSV(CopFILEGV(c)) : Nullsv)
+#endif
+
+#ifndef CopFILEAV
+# define CopFILEAV(c) (CopFILEGV(c) ? GvAV(CopFILEGV(c)) : Nullav)
+#endif
+
+#ifndef CopFILE
+# define CopFILE(c) (CopFILESV(c) ? SvPVX(CopFILESV(c)) : Nullch)
+#endif
+
+#ifndef CopSTASH
+# define CopSTASH(c) ((c)->cop_stash)
+#endif
+
+#ifndef CopSTASH_set
+# define CopSTASH_set(c,hv) ((c)->cop_stash = (hv))
+#endif
+
+#ifndef CopSTASHPV
+# define CopSTASHPV(c) (CopSTASH(c) ? HvNAME(CopSTASH(c)) : Nullch)
+#endif
+
+#ifndef CopSTASHPV_set
+# define CopSTASHPV_set(c,pv) CopSTASH_set((c), gv_stashpv(pv,GV_ADD))
+#endif
+
+#ifndef CopSTASH_eq
+# define CopSTASH_eq(c,hv) (CopSTASH(c) == (hv))
+#endif
+
+#endif /* USE_ITHREADS */
+#ifndef IN_PERL_COMPILETIME
+# define IN_PERL_COMPILETIME (PL_curcop == &PL_compiling)
+#endif
+
+#ifndef IN_LOCALE_RUNTIME
+# define IN_LOCALE_RUNTIME (PL_curcop->op_private & HINT_LOCALE)
+#endif
+
+#ifndef IN_LOCALE_COMPILETIME
+# define IN_LOCALE_COMPILETIME (PL_hints & HINT_LOCALE)
+#endif
+
+#ifndef IN_LOCALE
+# define IN_LOCALE (IN_PERL_COMPILETIME ? IN_LOCALE_COMPILETIME : IN_LOCALE_RUNTIME)
+#endif
+#ifndef IS_NUMBER_IN_UV
+# define IS_NUMBER_IN_UV 0x01
+#endif
+
+#ifndef IS_NUMBER_GREATER_THAN_UV_MAX
+# define IS_NUMBER_GREATER_THAN_UV_MAX 0x02
+#endif
+
+#ifndef IS_NUMBER_NOT_INT
+# define IS_NUMBER_NOT_INT 0x04
+#endif
+
+#ifndef IS_NUMBER_NEG
+# define IS_NUMBER_NEG 0x08
+#endif
+
+#ifndef IS_NUMBER_INFINITY
+# define IS_NUMBER_INFINITY 0x10
+#endif
+
+#ifndef IS_NUMBER_NAN
+# define IS_NUMBER_NAN 0x20
+#endif
+#ifndef GROK_NUMERIC_RADIX
+# define GROK_NUMERIC_RADIX(sp, send) grok_numeric_radix(sp, send)
+#endif
+#ifndef PERL_SCAN_GREATER_THAN_UV_MAX
+# define PERL_SCAN_GREATER_THAN_UV_MAX 0x02
+#endif
+
+#ifndef PERL_SCAN_SILENT_ILLDIGIT
+# define PERL_SCAN_SILENT_ILLDIGIT 0x04
+#endif
+
+#ifndef PERL_SCAN_ALLOW_UNDERSCORES
+# define PERL_SCAN_ALLOW_UNDERSCORES 0x01
+#endif
+
+#ifndef PERL_SCAN_DISALLOW_PREFIX
+# define PERL_SCAN_DISALLOW_PREFIX 0x02
+#endif
+
+#ifndef grok_numeric_radix
+#if defined(NEED_grok_numeric_radix)
+static bool DPPP_(my_grok_numeric_radix)(pTHX_ const char ** sp, const char * send);
+static
+#else
+extern bool DPPP_(my_grok_numeric_radix)(pTHX_ const char ** sp, const char * send);
+#endif
+
+#ifdef grok_numeric_radix
+# undef grok_numeric_radix
+#endif
+#define grok_numeric_radix(a,b) DPPP_(my_grok_numeric_radix)(aTHX_ a,b)
+#define Perl_grok_numeric_radix DPPP_(my_grok_numeric_radix)
+
+#if defined(NEED_grok_numeric_radix) || defined(NEED_grok_numeric_radix_GLOBAL)
+bool
+DPPP_(my_grok_numeric_radix)(pTHX_ const char **sp, const char *send)
+{
+#ifdef USE_LOCALE_NUMERIC
+#ifdef PL_numeric_radix_sv
+ if (PL_numeric_radix_sv && IN_LOCALE) {
+ STRLEN len;
+ char* radix = SvPV(PL_numeric_radix_sv, len);
+ if (*sp + len <= send && memEQ(*sp, radix, len)) {
+ *sp += len;
+ return TRUE;
+ }
+ }
+#else
+ /* older perls don't have PL_numeric_radix_sv so the radix
+ * must manually be requested from locale.h
+ */
+#include <locale.h>
+ dTHR; /* needed for older threaded perls */
+ struct lconv *lc = localeconv();
+ char *radix = lc->decimal_point;
+ if (radix && IN_LOCALE) {
+ STRLEN len = strlen(radix);
+ if (*sp + len <= send && memEQ(*sp, radix, len)) {
+ *sp += len;
+ return TRUE;
+ }
+ }
+#endif
+#endif /* USE_LOCALE_NUMERIC */
+ /* always try "." if numeric radix didn't match because
+ * we may have data from different locales mixed */
+ if (*sp < send && **sp == '.') {
+ ++*sp;
+ return TRUE;
+ }
+ return FALSE;
+}
+#endif
+#endif
+
+#ifndef grok_number
+#if defined(NEED_grok_number)
+static int DPPP_(my_grok_number)(pTHX_ const char * pv, STRLEN len, UV * valuep);
+static
+#else
+extern int DPPP_(my_grok_number)(pTHX_ const char * pv, STRLEN len, UV * valuep);
+#endif
+
+#ifdef grok_number
+# undef grok_number
+#endif
+#define grok_number(a,b,c) DPPP_(my_grok_number)(aTHX_ a,b,c)
+#define Perl_grok_number DPPP_(my_grok_number)
+
+#if defined(NEED_grok_number) || defined(NEED_grok_number_GLOBAL)
+int
+DPPP_(my_grok_number)(pTHX_ const char *pv, STRLEN len, UV *valuep)
+{
+ const char *s = pv;
+ const char *send = pv + len;
+ const UV max_div_10 = UV_MAX / 10;
+ const char max_mod_10 = UV_MAX % 10;
+ int numtype = 0;
+ int sawinf = 0;
+ int sawnan = 0;
+
+ while (s < send && isSPACE(*s))
+ s++;
+ if (s == send) {
+ return 0;
+ } else if (*s == '-') {
+ s++;
+ numtype = IS_NUMBER_NEG;
+ }
+ else if (*s == '+')
+ s++;
+
+ if (s == send)
+ return 0;
+
+ /* next must be digit or the radix separator or beginning of infinity */
+ if (isDIGIT(*s)) {
+ /* UVs are at least 32 bits, so the first 9 decimal digits cannot
+ overflow. */
+ UV value = *s - '0';
+ /* This construction seems to be more optimiser friendly.
+ (without it gcc does the isDIGIT test and the *s - '0' separately)
+ With it gcc on arm is managing 6 instructions (6 cycles) per digit.
+ In theory the optimiser could deduce how far to unroll the loop
+ before checking for overflow. */
+ if (++s < send) {
+ int digit = *s - '0';
+ if (digit >= 0 && digit <= 9) {
+ value = value * 10 + digit;
+ if (++s < send) {
+ digit = *s - '0';
+ if (digit >= 0 && digit <= 9) {
+ value = value * 10 + digit;
+ if (++s < send) {
+ digit = *s - '0';
+ if (digit >= 0 && digit <= 9) {
+ value = value * 10 + digit;
+ if (++s < send) {
+ digit = *s - '0';
+ if (digit >= 0 && digit <= 9) {
+ value = value * 10 + digit;
+ if (++s < send) {
+ digit = *s - '0';
+ if (digit >= 0 && digit <= 9) {
+ value = value * 10 + digit;
+ if (++s < send) {
+ digit = *s - '0';
+ if (digit >= 0 && digit <= 9) {
+ value = value * 10 + digit;
+ if (++s < send) {
+ digit = *s - '0';
+ if (digit >= 0 && digit <= 9) {
+ value = value * 10 + digit;
+ if (++s < send) {
+ digit = *s - '0';
+ if (digit >= 0 && digit <= 9) {
+ value = value * 10 + digit;
+ if (++s < send) {
+ /* Now got 9 digits, so need to check
+ each time for overflow. */
+ digit = *s - '0';
+ while (digit >= 0 && digit <= 9
+ && (value < max_div_10
+ || (value == max_div_10
+ && digit <= max_mod_10))) {
+ value = value * 10 + digit;
+ if (++s < send)
+ digit = *s - '0';
+ else
+ break;
+ }
+ if (digit >= 0 && digit <= 9
+ && (s < send)) {
+ /* value overflowed.
+ skip the remaining digits, don't
+ worry about setting *valuep. */
+ do {
+ s++;
+ } while (s < send && isDIGIT(*s));
+ numtype |=
+ IS_NUMBER_GREATER_THAN_UV_MAX;
+ goto skip_value;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ numtype |= IS_NUMBER_IN_UV;
+ if (valuep)
+ *valuep = value;
+
+ skip_value:
+ if (GROK_NUMERIC_RADIX(&s, send)) {
+ numtype |= IS_NUMBER_NOT_INT;
+ while (s < send && isDIGIT(*s)) /* optional digits after the radix */
+ s++;
+ }
+ }
+ else if (GROK_NUMERIC_RADIX(&s, send)) {
+ numtype |= IS_NUMBER_NOT_INT | IS_NUMBER_IN_UV; /* valuep assigned below */
+ /* no digits before the radix means we need digits after it */
+ if (s < send && isDIGIT(*s)) {
+ do {
+ s++;
+ } while (s < send && isDIGIT(*s));
+ if (valuep) {
+ /* integer approximation is valid - it's 0. */
+ *valuep = 0;
+ }
+ }
+ else
+ return 0;
+ } else if (*s == 'I' || *s == 'i') {
+ s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
+ s++; if (s == send || (*s != 'F' && *s != 'f')) return 0;
+ s++; if (s < send && (*s == 'I' || *s == 'i')) {
+ s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
+ s++; if (s == send || (*s != 'I' && *s != 'i')) return 0;
+ s++; if (s == send || (*s != 'T' && *s != 't')) return 0;
+ s++; if (s == send || (*s != 'Y' && *s != 'y')) return 0;
+ s++;
+ }
+ sawinf = 1;
+ } else if (*s == 'N' || *s == 'n') {
+ /* XXX TODO: There are signaling NaNs and quiet NaNs. */
+ s++; if (s == send || (*s != 'A' && *s != 'a')) return 0;
+ s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
+ s++;
+ sawnan = 1;
+ } else
+ return 0;
+
+ if (sawinf) {
+ numtype &= IS_NUMBER_NEG; /* Keep track of sign */
+ numtype |= IS_NUMBER_INFINITY | IS_NUMBER_NOT_INT;
+ } else if (sawnan) {
+ numtype &= IS_NUMBER_NEG; /* Keep track of sign */
+ numtype |= IS_NUMBER_NAN | IS_NUMBER_NOT_INT;
+ } else if (s < send) {
+ /* we can have an optional exponent part */
+ if (*s == 'e' || *s == 'E') {
+ /* The only flag we keep is sign. Blow away any "it's UV" */
+ numtype &= IS_NUMBER_NEG;
+ numtype |= IS_NUMBER_NOT_INT;
+ s++;
+ if (s < send && (*s == '-' || *s == '+'))
+ s++;
+ if (s < send && isDIGIT(*s)) {
+ do {
+ s++;
+ } while (s < send && isDIGIT(*s));
+ }
+ else
+ return 0;
+ }
+ }
+ while (s < send && isSPACE(*s))
+ s++;
+ if (s >= send)
+ return numtype;
+ if (len == 10 && memEQ(pv, "0 but true", 10)) {
+ if (valuep)
+ *valuep = 0;
+ return IS_NUMBER_IN_UV;
+ }
+ return 0;
+}
+#endif
+#endif
+
+/*
+ * The grok_* routines have been modified to use warn() instead of
+ * Perl_warner(). Also, 'hexdigit' was the former name of PL_hexdigit,
+ * which is why the stack variable has been renamed to 'xdigit'.
+ */
+
+#ifndef grok_bin
+#if defined(NEED_grok_bin)
+static UV DPPP_(my_grok_bin)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
+static
+#else
+extern UV DPPP_(my_grok_bin)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
+#endif
+
+#ifdef grok_bin
+# undef grok_bin
+#endif
+#define grok_bin(a,b,c,d) DPPP_(my_grok_bin)(aTHX_ a,b,c,d)
+#define Perl_grok_bin DPPP_(my_grok_bin)
+
+#if defined(NEED_grok_bin) || defined(NEED_grok_bin_GLOBAL)
+UV
+DPPP_(my_grok_bin)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
+{
+ const char *s = start;
+ STRLEN len = *len_p;
+ UV value = 0;
+ NV value_nv = 0;
+
+ const UV max_div_2 = UV_MAX / 2;
+ bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
+ bool overflowed = FALSE;
+
+ if (!(*flags & PERL_SCAN_DISALLOW_PREFIX)) {
+ /* strip off leading b or 0b.
+ for compatibility silently suffer "b" and "0b" as valid binary
+ numbers. */
+ if (len >= 1) {
+ if (s[0] == 'b') {
+ s++;
+ len--;
+ }
+ else if (len >= 2 && s[0] == '0' && s[1] == 'b') {
+ s+=2;
+ len-=2;
+ }
+ }
+ }
+
+ for (; len-- && *s; s++) {
+ char bit = *s;
+ if (bit == '0' || bit == '1') {
+ /* Write it in this wonky order with a goto to attempt to get the
+ compiler to make the common case integer-only loop pretty tight.
+ With gcc seems to be much straighter code than old scan_bin. */
+ redo:
+ if (!overflowed) {
+ if (value <= max_div_2) {
+ value = (value << 1) | (bit - '0');
+ continue;
+ }
+ /* Bah. We're just overflowed. */
+ warn("Integer overflow in binary number");
+ overflowed = TRUE;
+ value_nv = (NV) value;
+ }
+ value_nv *= 2.0;
+ /* If an NV has not enough bits in its mantissa to
+ * represent a UV this summing of small low-order numbers
+ * is a waste of time (because the NV cannot preserve
+ * the low-order bits anyway): we could just remember when
+ * did we overflow and in the end just multiply value_nv by the
+ * right amount. */
+ value_nv += (NV)(bit - '0');
+ continue;
+ }
+ if (bit == '_' && len && allow_underscores && (bit = s[1])
+ && (bit == '0' || bit == '1'))
+ {
+ --len;
+ ++s;
+ goto redo;
+ }
+ if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT))
+ warn("Illegal binary digit '%c' ignored", *s);
+ break;
+ }
+
+ if ( ( overflowed && value_nv > 4294967295.0)
+#if UVSIZE > 4
+ || (!overflowed && value > 0xffffffff )
+#endif
+ ) {
+ warn("Binary number > 0b11111111111111111111111111111111 non-portable");
+ }
+ *len_p = s - start;
+ if (!overflowed) {
+ *flags = 0;
+ return value;
+ }
+ *flags = PERL_SCAN_GREATER_THAN_UV_MAX;
+ if (result)
+ *result = value_nv;
+ return UV_MAX;
+}
+#endif
+#endif
+
+#ifndef grok_hex
+#if defined(NEED_grok_hex)
+static UV DPPP_(my_grok_hex)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
+static
+#else
+extern UV DPPP_(my_grok_hex)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
+#endif
+
+#ifdef grok_hex
+# undef grok_hex
+#endif
+#define grok_hex(a,b,c,d) DPPP_(my_grok_hex)(aTHX_ a,b,c,d)
+#define Perl_grok_hex DPPP_(my_grok_hex)
+
+#if defined(NEED_grok_hex) || defined(NEED_grok_hex_GLOBAL)
+UV
+DPPP_(my_grok_hex)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
+{
+ const char *s = start;
+ STRLEN len = *len_p;
+ UV value = 0;
+ NV value_nv = 0;
+
+ const UV max_div_16 = UV_MAX / 16;
+ bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
+ bool overflowed = FALSE;
+ const char *xdigit;
+
+ if (!(*flags & PERL_SCAN_DISALLOW_PREFIX)) {
+ /* strip off leading x or 0x.
+ for compatibility silently suffer "x" and "0x" as valid hex numbers.
+ */
+ if (len >= 1) {
+ if (s[0] == 'x') {
+ s++;
+ len--;
+ }
+ else if (len >= 2 && s[0] == '0' && s[1] == 'x') {
+ s+=2;
+ len-=2;
+ }
+ }
+ }
+
+ for (; len-- && *s; s++) {
+ xdigit = strchr((char *) PL_hexdigit, *s);
+ if (xdigit) {
+ /* Write it in this wonky order with a goto to attempt to get the
+ compiler to make the common case integer-only loop pretty tight.
+ With gcc seems to be much straighter code than old scan_hex. */
+ redo:
+ if (!overflowed) {
+ if (value <= max_div_16) {
+ value = (value << 4) | ((xdigit - PL_hexdigit) & 15);
+ continue;
+ }
+ warn("Integer overflow in hexadecimal number");
+ overflowed = TRUE;
+ value_nv = (NV) value;
+ }
+ value_nv *= 16.0;
+ /* If an NV has not enough bits in its mantissa to
+ * represent a UV this summing of small low-order numbers
+ * is a waste of time (because the NV cannot preserve
+ * the low-order bits anyway): we could just remember when
+ * did we overflow and in the end just multiply value_nv by the
+ * right amount of 16-tuples. */
+ value_nv += (NV)((xdigit - PL_hexdigit) & 15);
+ continue;
+ }
+ if (*s == '_' && len && allow_underscores && s[1]
+ && (xdigit = strchr((char *) PL_hexdigit, s[1])))
+ {
+ --len;
+ ++s;
+ goto redo;
+ }
+ if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT))
+ warn("Illegal hexadecimal digit '%c' ignored", *s);
+ break;
+ }
+
+ if ( ( overflowed && value_nv > 4294967295.0)
+#if UVSIZE > 4
+ || (!overflowed && value > 0xffffffff )
+#endif
+ ) {
+ warn("Hexadecimal number > 0xffffffff non-portable");
+ }
+ *len_p = s - start;
+ if (!overflowed) {
+ *flags = 0;
+ return value;
+ }
+ *flags = PERL_SCAN_GREATER_THAN_UV_MAX;
+ if (result)
+ *result = value_nv;
+ return UV_MAX;
+}
+#endif
+#endif
+
+#ifndef grok_oct
+#if defined(NEED_grok_oct)
+static UV DPPP_(my_grok_oct)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
+static
+#else
+extern UV DPPP_(my_grok_oct)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
+#endif
+
+#ifdef grok_oct
+# undef grok_oct
+#endif
+#define grok_oct(a,b,c,d) DPPP_(my_grok_oct)(aTHX_ a,b,c,d)
+#define Perl_grok_oct DPPP_(my_grok_oct)
+
+#if defined(NEED_grok_oct) || defined(NEED_grok_oct_GLOBAL)
+UV
+DPPP_(my_grok_oct)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
+{
+ const char *s = start;
+ STRLEN len = *len_p;
+ UV value = 0;
+ NV value_nv = 0;
+
+ const UV max_div_8 = UV_MAX / 8;
+ bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
+ bool overflowed = FALSE;
+
+ for (; len-- && *s; s++) {
+ /* gcc 2.95 optimiser not smart enough to figure that this subtraction
+ out front allows slicker code. */
+ int digit = *s - '0';
+ if (digit >= 0 && digit <= 7) {
+ /* Write it in this wonky order with a goto to attempt to get the
+ compiler to make the common case integer-only loop pretty tight.
+ */
+ redo:
+ if (!overflowed) {
+ if (value <= max_div_8) {
+ value = (value << 3) | digit;
+ continue;
+ }
+ /* Bah. We're just overflowed. */
+ warn("Integer overflow in octal number");
+ overflowed = TRUE;
+ value_nv = (NV) value;
+ }
+ value_nv *= 8.0;
+ /* If an NV has not enough bits in its mantissa to
+ * represent a UV this summing of small low-order numbers
+ * is a waste of time (because the NV cannot preserve
+ * the low-order bits anyway): we could just remember when
+ * did we overflow and in the end just multiply value_nv by the
+ * right amount of 8-tuples. */
+ value_nv += (NV)digit;
+ continue;
+ }
+ if (digit == ('_' - '0') && len && allow_underscores
+ && (digit = s[1] - '0') && (digit >= 0 && digit <= 7))
+ {
+ --len;
+ ++s;
+ goto redo;
+ }
+ /* Allow \octal to work the DWIM way (that is, stop scanning
+ * as soon as non-octal characters are seen, complain only iff
+ * someone seems to want to use the digits eight and nine). */
+ if (digit == 8 || digit == 9) {
+ if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT))
+ warn("Illegal octal digit '%c' ignored", *s);
+ }
+ break;
+ }
+
+ if ( ( overflowed && value_nv > 4294967295.0)
+#if UVSIZE > 4
+ || (!overflowed && value > 0xffffffff )
+#endif
+ ) {
+ warn("Octal number > 037777777777 non-portable");
+ }
+ *len_p = s - start;
+ if (!overflowed) {
+ *flags = 0;
+ return value;
+ }
+ *flags = PERL_SCAN_GREATER_THAN_UV_MAX;
+ if (result)
+ *result = value_nv;
+ return UV_MAX;
+}
+#endif
+#endif
+
+#if !defined(my_snprintf)
+#if defined(NEED_my_snprintf)
+static int DPPP_(my_my_snprintf)(char * buffer, const Size_t len, const char * format, ...);
+static
+#else
+extern int DPPP_(my_my_snprintf)(char * buffer, const Size_t len, const char * format, ...);
+#endif
+
+#define my_snprintf DPPP_(my_my_snprintf)
+#define Perl_my_snprintf DPPP_(my_my_snprintf)
+
+#if defined(NEED_my_snprintf) || defined(NEED_my_snprintf_GLOBAL)
+
+int
+DPPP_(my_my_snprintf)(char *buffer, const Size_t len, const char *format, ...)
+{
+ dTHX;
+ int retval;
+ va_list ap;
+ va_start(ap, format);
+#ifdef HAS_VSNPRINTF
+ retval = vsnprintf(buffer, len, format, ap);
+#else
+ retval = vsprintf(buffer, format, ap);
+#endif
+ va_end(ap);
+ if (retval < 0 || (len > 0 && (Size_t)retval >= len))
+ Perl_croak(aTHX_ "panic: my_snprintf buffer overflow");
+ return retval;
+}
+
+#endif
+#endif
+
+#if !defined(my_sprintf)
+#if defined(NEED_my_sprintf)
+static int DPPP_(my_my_sprintf)(char * buffer, const char * pat, ...);
+static
+#else
+extern int DPPP_(my_my_sprintf)(char * buffer, const char * pat, ...);
+#endif
+
+#define my_sprintf DPPP_(my_my_sprintf)
+#define Perl_my_sprintf DPPP_(my_my_sprintf)
+
+#if defined(NEED_my_sprintf) || defined(NEED_my_sprintf_GLOBAL)
+
+int
+DPPP_(my_my_sprintf)(char *buffer, const char* pat, ...)
+{
+ va_list args;
+ va_start(args, pat);
+ vsprintf(buffer, pat, args);
+ va_end(args);
+ return strlen(buffer);
+}
+
+#endif
+#endif
+
+#ifdef NO_XSLOCKS
+# ifdef dJMPENV
+# define dXCPT dJMPENV; int rEtV = 0
+# define XCPT_TRY_START JMPENV_PUSH(rEtV); if (rEtV == 0)
+# define XCPT_TRY_END JMPENV_POP;
+# define XCPT_CATCH if (rEtV != 0)
+# define XCPT_RETHROW JMPENV_JUMP(rEtV)
+# else
+# define dXCPT Sigjmp_buf oldTOP; int rEtV = 0
+# define XCPT_TRY_START Copy(top_env, oldTOP, 1, Sigjmp_buf); rEtV = Sigsetjmp(top_env, 1); if (rEtV == 0)
+# define XCPT_TRY_END Copy(oldTOP, top_env, 1, Sigjmp_buf);
+# define XCPT_CATCH if (rEtV != 0)
+# define XCPT_RETHROW Siglongjmp(top_env, rEtV)
+# endif
+#endif
+
+#if !defined(my_strlcat)
+#if defined(NEED_my_strlcat)
+static Size_t DPPP_(my_my_strlcat)(char * dst, const char * src, Size_t size);
+static
+#else
+extern Size_t DPPP_(my_my_strlcat)(char * dst, const char * src, Size_t size);
+#endif
+
+#define my_strlcat DPPP_(my_my_strlcat)
+#define Perl_my_strlcat DPPP_(my_my_strlcat)
+
+#if defined(NEED_my_strlcat) || defined(NEED_my_strlcat_GLOBAL)
+
+Size_t
+DPPP_(my_my_strlcat)(char *dst, const char *src, Size_t size)
+{
+ Size_t used, length, copy;
+
+ used = strlen(dst);
+ length = strlen(src);
+ if (size > 0 && used < size - 1) {
+ copy = (length >= size - used) ? size - used - 1 : length;
+ memcpy(dst + used, src, copy);
+ dst[used + copy] = '\0';
+ }
+ return used + length;
+}
+#endif
+#endif
+
+#if !defined(my_strlcpy)
+#if defined(NEED_my_strlcpy)
+static Size_t DPPP_(my_my_strlcpy)(char * dst, const char * src, Size_t size);
+static
+#else
+extern Size_t DPPP_(my_my_strlcpy)(char * dst, const char * src, Size_t size);
+#endif
+
+#define my_strlcpy DPPP_(my_my_strlcpy)
+#define Perl_my_strlcpy DPPP_(my_my_strlcpy)
+
+#if defined(NEED_my_strlcpy) || defined(NEED_my_strlcpy_GLOBAL)
+
+Size_t
+DPPP_(my_my_strlcpy)(char *dst, const char *src, Size_t size)
+{
+ Size_t length, copy;
+
+ length = strlen(src);
+ if (size > 0) {
+ copy = (length >= size) ? size - 1 : length;
+ memcpy(dst, src, copy);
+ dst[copy] = '\0';
+ }
+ return length;
+}
+
+#endif
+#endif
+#ifndef PERL_PV_ESCAPE_QUOTE
+# define PERL_PV_ESCAPE_QUOTE 0x0001
+#endif
+
+#ifndef PERL_PV_PRETTY_QUOTE
+# define PERL_PV_PRETTY_QUOTE PERL_PV_ESCAPE_QUOTE
+#endif
+
+#ifndef PERL_PV_PRETTY_ELLIPSES
+# define PERL_PV_PRETTY_ELLIPSES 0x0002
+#endif
+
+#ifndef PERL_PV_PRETTY_LTGT
+# define PERL_PV_PRETTY_LTGT 0x0004
+#endif
+
+#ifndef PERL_PV_ESCAPE_FIRSTCHAR
+# define PERL_PV_ESCAPE_FIRSTCHAR 0x0008
+#endif
+
+#ifndef PERL_PV_ESCAPE_UNI
+# define PERL_PV_ESCAPE_UNI 0x0100
+#endif
+
+#ifndef PERL_PV_ESCAPE_UNI_DETECT
+# define PERL_PV_ESCAPE_UNI_DETECT 0x0200
+#endif
+
+#ifndef PERL_PV_ESCAPE_ALL
+# define PERL_PV_ESCAPE_ALL 0x1000
+#endif
+
+#ifndef PERL_PV_ESCAPE_NOBACKSLASH
+# define PERL_PV_ESCAPE_NOBACKSLASH 0x2000
+#endif
+
+#ifndef PERL_PV_ESCAPE_NOCLEAR
+# define PERL_PV_ESCAPE_NOCLEAR 0x4000
+#endif
+
+#ifndef PERL_PV_ESCAPE_RE
+# define PERL_PV_ESCAPE_RE 0x8000
+#endif
+
+#ifndef PERL_PV_PRETTY_NOCLEAR
+# define PERL_PV_PRETTY_NOCLEAR PERL_PV_ESCAPE_NOCLEAR
+#endif
+#ifndef PERL_PV_PRETTY_DUMP
+# define PERL_PV_PRETTY_DUMP PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_QUOTE
+#endif
+
+#ifndef PERL_PV_PRETTY_REGPROP
+# define PERL_PV_PRETTY_REGPROP PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_LTGT|PERL_PV_ESCAPE_RE
+#endif
+
+/* Hint: pv_escape
+ * Note that unicode functionality is only backported to
+ * those perl versions that support it. For older perl
+ * versions, the implementation will fall back to bytes.
+ */
+
+#ifndef pv_escape
+#if defined(NEED_pv_escape)
+static char * DPPP_(my_pv_escape)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, STRLEN * const escaped, const U32 flags);
+static
+#else
+extern char * DPPP_(my_pv_escape)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, STRLEN * const escaped, const U32 flags);
+#endif
+
+#ifdef pv_escape
+# undef pv_escape
+#endif
+#define pv_escape(a,b,c,d,e,f) DPPP_(my_pv_escape)(aTHX_ a,b,c,d,e,f)
+#define Perl_pv_escape DPPP_(my_pv_escape)
+
+#if defined(NEED_pv_escape) || defined(NEED_pv_escape_GLOBAL)
+
+char *
+DPPP_(my_pv_escape)(pTHX_ SV *dsv, char const * const str,
+ const STRLEN count, const STRLEN max,
+ STRLEN * const escaped, const U32 flags)
+{
+ const char esc = flags & PERL_PV_ESCAPE_RE ? '%' : '\\';
+ const char dq = flags & PERL_PV_ESCAPE_QUOTE ? '"' : esc;
+ char octbuf[32] = "%123456789ABCDF";
+ STRLEN wrote = 0;
+ STRLEN chsize = 0;
+ STRLEN readsize = 1;
+#if defined(is_utf8_string) && defined(utf8_to_uvchr)
+ bool isuni = flags & PERL_PV_ESCAPE_UNI ? 1 : 0;
+#endif
+ const char *pv = str;
+ const char * const end = pv + count;
+ octbuf[0] = esc;
+
+ if (!(flags & PERL_PV_ESCAPE_NOCLEAR))
+ sv_setpvs(dsv, "");
+
+#if defined(is_utf8_string) && defined(utf8_to_uvchr)
+ if ((flags & PERL_PV_ESCAPE_UNI_DETECT) && is_utf8_string((U8*)pv, count))
+ isuni = 1;
+#endif
+
+ for (; pv < end && (!max || wrote < max) ; pv += readsize) {
+ const UV u =
+#if defined(is_utf8_string) && defined(utf8_to_uvchr)
+ isuni ? utf8_to_uvchr((U8*)pv, &readsize) :
+#endif
+ (U8)*pv;
+ const U8 c = (U8)u & 0xFF;
+
+ if (u > 255 || (flags & PERL_PV_ESCAPE_ALL)) {
+ if (flags & PERL_PV_ESCAPE_FIRSTCHAR)
+ chsize = my_snprintf(octbuf, sizeof octbuf,
+ "%"UVxf, u);
+ else
+ chsize = my_snprintf(octbuf, sizeof octbuf,
+ "%cx{%"UVxf"}", esc, u);
+ } else if (flags & PERL_PV_ESCAPE_NOBACKSLASH) {
+ chsize = 1;
+ } else {
+ if (c == dq || c == esc || !isPRINT(c)) {
+ chsize = 2;
+ switch (c) {
+ case '\\' : /* fallthrough */
+ case '%' : if (c == esc)
+ octbuf[1] = esc;
+ else
+ chsize = 1;
+ break;
+ case '\v' : octbuf[1] = 'v'; break;
+ case '\t' : octbuf[1] = 't'; break;
+ case '\r' : octbuf[1] = 'r'; break;
+ case '\n' : octbuf[1] = 'n'; break;
+ case '\f' : octbuf[1] = 'f'; break;
+ case '"' : if (dq == '"')
+ octbuf[1] = '"';
+ else
+ chsize = 1;
+ break;
+ default: chsize = my_snprintf(octbuf, sizeof octbuf,
+ pv < end && isDIGIT((U8)*(pv+readsize))
+ ? "%c%03o" : "%c%o", esc, c);
+ }
+ } else {
+ chsize = 1;
+ }
+ }
+ if (max && wrote + chsize > max) {
+ break;
+ } else if (chsize > 1) {
+ sv_catpvn(dsv, octbuf, chsize);
+ wrote += chsize;
+ } else {
+ char tmp[2];
+ my_snprintf(tmp, sizeof tmp, "%c", c);
+ sv_catpvn(dsv, tmp, 1);
+ wrote++;
+ }
+ if (flags & PERL_PV_ESCAPE_FIRSTCHAR)
+ break;
+ }
+ if (escaped != NULL)
+ *escaped= pv - str;
+ return SvPVX(dsv);
+}
+
+#endif
+#endif
+
+#ifndef pv_pretty
+#if defined(NEED_pv_pretty)
+static char * DPPP_(my_pv_pretty)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, char const * const start_color, char const * const end_color, const U32 flags);
+static
+#else
+extern char * DPPP_(my_pv_pretty)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, char const * const start_color, char const * const end_color, const U32 flags);
+#endif
+
+#ifdef pv_pretty
+# undef pv_pretty
+#endif
+#define pv_pretty(a,b,c,d,e,f,g) DPPP_(my_pv_pretty)(aTHX_ a,b,c,d,e,f,g)
+#define Perl_pv_pretty DPPP_(my_pv_pretty)
+
+#if defined(NEED_pv_pretty) || defined(NEED_pv_pretty_GLOBAL)
+
+char *
+DPPP_(my_pv_pretty)(pTHX_ SV *dsv, char const * const str, const STRLEN count,
+ const STRLEN max, char const * const start_color, char const * const end_color,
+ const U32 flags)
+{
+ const U8 dq = (flags & PERL_PV_PRETTY_QUOTE) ? '"' : '%';
+ STRLEN escaped;
+
+ if (!(flags & PERL_PV_PRETTY_NOCLEAR))
+ sv_setpvs(dsv, "");
+
+ if (dq == '"')
+ sv_catpvs(dsv, "\"");
+ else if (flags & PERL_PV_PRETTY_LTGT)
+ sv_catpvs(dsv, "<");
+
+ if (start_color != NULL)
+ sv_catpv(dsv, D_PPP_CONSTPV_ARG(start_color));
+
+ pv_escape(dsv, str, count, max, &escaped, flags | PERL_PV_ESCAPE_NOCLEAR);
+
+ if (end_color != NULL)
+ sv_catpv(dsv, D_PPP_CONSTPV_ARG(end_color));
+
+ if (dq == '"')
+ sv_catpvs(dsv, "\"");
+ else if (flags & PERL_PV_PRETTY_LTGT)
+ sv_catpvs(dsv, ">");
+
+ if ((flags & PERL_PV_PRETTY_ELLIPSES) && escaped < count)
+ sv_catpvs(dsv, "...");
+
+ return SvPVX(dsv);
+}
+
+#endif
+#endif
+
+#ifndef pv_display
+#if defined(NEED_pv_display)
+static char * DPPP_(my_pv_display)(pTHX_ SV * dsv, const char * pv, STRLEN cur, STRLEN len, STRLEN pvlim);
+static
+#else
+extern char * DPPP_(my_pv_display)(pTHX_ SV * dsv, const char * pv, STRLEN cur, STRLEN len, STRLEN pvlim);
+#endif
+
+#ifdef pv_display
+# undef pv_display
+#endif
+#define pv_display(a,b,c,d,e) DPPP_(my_pv_display)(aTHX_ a,b,c,d,e)
+#define Perl_pv_display DPPP_(my_pv_display)
+
+#if defined(NEED_pv_display) || defined(NEED_pv_display_GLOBAL)
+
+char *
+DPPP_(my_pv_display)(pTHX_ SV *dsv, const char *pv, STRLEN cur, STRLEN len, STRLEN pvlim)
+{
+ pv_pretty(dsv, pv, cur, pvlim, NULL, NULL, PERL_PV_PRETTY_DUMP);
+ if (len > cur && pv[cur] == '\0')
+ sv_catpvs(dsv, "\\0");
+ return SvPVX(dsv);
+}
+
+#endif
+#endif
+
+#endif /* _P_P_PORTABILITY_H_ */
+
+/* End of File ppport.h */
diff --git a/contrib/DNS-LDNS/t/DNS-LDNS.t b/contrib/DNS-LDNS/t/DNS-LDNS.t
new file mode 100644
index 000000000000..eeae54c6829b
--- /dev/null
+++ b/contrib/DNS-LDNS/t/DNS-LDNS.t
@@ -0,0 +1,136 @@
+# Before `make install' is performed this script should be runnable with
+# `make test'. After `make install' it should work as `perl DNS-LDNS.t'
+
+#########################
+
+# change 'tests => 2' to 'tests => last_test_to_print';
+
+use strict;
+use warnings;
+
+use Test::More tests => 2;
+BEGIN { use_ok('DNS::LDNS') };
+
+
+my $fail = 0;
+foreach my $constname (qw(
+ LDNS_AA LDNS_AD LDNS_CD LDNS_CERT_ACPKIX LDNS_CERT_IACPKIX
+ LDNS_CERT_IPGP LDNS_CERT_IPKIX LDNS_CERT_ISPKI LDNS_CERT_OID
+ LDNS_CERT_PGP LDNS_CERT_PKIX LDNS_CERT_SPKI LDNS_CERT_URI
+ LDNS_DEFAULT_TTL LDNS_DH LDNS_DSA LDNS_DSA_NSEC3 LDNS_ECC LDNS_ECC_GOST
+ LDNS_HASH_GOST LDNS_IP4ADDRLEN LDNS_IP6ADDRLEN
+ LDNS_KEY_REVOKE_KEY LDNS_KEY_SEP_KEY LDNS_KEY_ZONE_KEY
+ LDNS_MAX_DOMAINLEN LDNS_MAX_LABELLEN LDNS_MAX_PACKETLEN
+ LDNS_MAX_POINTERS LDNS_MAX_RDFLEN LDNS_NSEC3_VARS_OPTOUT_MASK
+ LDNS_PACKET_ANSWER LDNS_PACKET_IQUERY LDNS_PACKET_NODATA
+ LDNS_PACKET_NOTIFY LDNS_PACKET_NXDOMAIN LDNS_PACKET_QUERY
+ LDNS_PACKET_QUESTION LDNS_PACKET_REFERRAL LDNS_PACKET_STATUS
+ LDNS_PACKET_UNKNOWN LDNS_PACKET_UPDATE LDNS_PORT LDNS_PRIVATEDNS
+ LDNS_PRIVATEOID LDNS_QR LDNS_RA LDNS_RCODE_FORMERR LDNS_RCODE_NOERROR
+ LDNS_RCODE_NOTAUTH LDNS_RCODE_NOTIMPL LDNS_RCODE_NOTZONE
+ LDNS_RCODE_NXDOMAIN LDNS_RCODE_NXRRSET LDNS_RCODE_REFUSED
+ LDNS_RCODE_SERVFAIL LDNS_RCODE_YXDOMAIN LDNS_RCODE_YXRRSET LDNS_RD
+ LDNS_RDATA_FIELD_DESCRIPTORS_COMMON LDNS_RDF_SIZE_16BYTES
+ LDNS_RDF_SIZE_6BYTES LDNS_RDF_SIZE_BYTE LDNS_RDF_SIZE_DOUBLEWORD
+ LDNS_RDF_SIZE_WORD LDNS_RDF_TYPE_A LDNS_RDF_TYPE_AAAA LDNS_RDF_TYPE_ALG
+ LDNS_RDF_TYPE_APL LDNS_RDF_TYPE_ATMA LDNS_RDF_TYPE_B32_EXT
+ LDNS_RDF_TYPE_B64 LDNS_RDF_TYPE_CERT_ALG LDNS_RDF_TYPE_CLASS
+ LDNS_RDF_TYPE_DNAME LDNS_RDF_TYPE_HEX LDNS_RDF_TYPE_INT16
+ LDNS_RDF_TYPE_INT16_DATA LDNS_RDF_TYPE_INT32 LDNS_RDF_TYPE_INT8
+ LDNS_RDF_TYPE_IPSECKEY LDNS_RDF_TYPE_LOC LDNS_RDF_TYPE_NONE
+ LDNS_RDF_TYPE_NSAP LDNS_RDF_TYPE_NSEC LDNS_RDF_TYPE_NSEC3_NEXT_OWNER
+ LDNS_RDF_TYPE_NSEC3_SALT LDNS_RDF_TYPE_PERIOD LDNS_RDF_TYPE_SERVICE
+ LDNS_RDF_TYPE_STR LDNS_RDF_TYPE_TIME LDNS_RDF_TYPE_HIP
+ LDNS_RDF_TYPE_TSIGTIME LDNS_RDF_TYPE_TYPE LDNS_RDF_TYPE_UNKNOWN
+ LDNS_RDF_TYPE_WKS LDNS_RESOLV_ANCHOR LDNS_RESOLV_DEFDOMAIN
+ LDNS_RESOLV_INET LDNS_RESOLV_INET6 LDNS_RESOLV_INETANY
+ LDNS_RESOLV_KEYWORD LDNS_RESOLV_KEYWORDS LDNS_RESOLV_NAMESERVER
+ LDNS_RESOLV_OPTIONS LDNS_RESOLV_RTT_INF LDNS_RESOLV_RTT_MIN
+ LDNS_RESOLV_SEARCH LDNS_RESOLV_SORTLIST LDNS_RR_CLASS_ANY
+ LDNS_RR_CLASS_CH LDNS_RR_CLASS_COUNT LDNS_RR_CLASS_FIRST
+ LDNS_RR_CLASS_HS LDNS_RR_CLASS_IN LDNS_RR_CLASS_LAST LDNS_RR_CLASS_NONE
+ LDNS_RR_COMPRESS LDNS_RR_NO_COMPRESS LDNS_RR_OVERHEAD LDNS_RR_TYPE_A
+ LDNS_RR_TYPE_A6 LDNS_RR_TYPE_AAAA LDNS_RR_TYPE_AFSDB LDNS_RR_TYPE_ANY
+ LDNS_RR_TYPE_APL LDNS_RR_TYPE_ATMA LDNS_RR_TYPE_AXFR LDNS_RR_TYPE_CERT
+ LDNS_RR_TYPE_CNAME LDNS_RR_TYPE_COUNT LDNS_RR_TYPE_DHCID
+ LDNS_RR_TYPE_DLV LDNS_RR_TYPE_DNAME LDNS_RR_TYPE_DNSKEY LDNS_RR_TYPE_DS
+ LDNS_RR_TYPE_EID LDNS_RR_TYPE_FIRST LDNS_RR_TYPE_GID LDNS_RR_TYPE_GPOS
+ LDNS_RR_TYPE_HINFO LDNS_RR_TYPE_IPSECKEY LDNS_RR_TYPE_ISDN
+ LDNS_RR_TYPE_IXFR LDNS_RR_TYPE_KEY LDNS_RR_TYPE_KX LDNS_RR_TYPE_LAST
+ LDNS_RR_TYPE_LOC LDNS_RR_TYPE_MAILA LDNS_RR_TYPE_MAILB LDNS_RR_TYPE_MB
+ LDNS_RR_TYPE_MD LDNS_RR_TYPE_MF LDNS_RR_TYPE_MG LDNS_RR_TYPE_MINFO
+ LDNS_RR_TYPE_MR LDNS_RR_TYPE_MX LDNS_RR_TYPE_NAPTR LDNS_RR_TYPE_NIMLOC
+ LDNS_RR_TYPE_NS LDNS_RR_TYPE_NSAP LDNS_RR_TYPE_NSAP_PTR
+ LDNS_RR_TYPE_NSEC LDNS_RR_TYPE_NSEC3 LDNS_RR_TYPE_NSEC3PARAM
+ LDNS_RR_TYPE_NSEC3PARAMS LDNS_RR_TYPE_NULL LDNS_RR_TYPE_NXT
+ LDNS_RR_TYPE_OPT LDNS_RR_TYPE_PTR LDNS_RR_TYPE_PX LDNS_RR_TYPE_RP
+ LDNS_RR_TYPE_RRSIG LDNS_RR_TYPE_RT LDNS_RR_TYPE_SIG LDNS_RR_TYPE_SINK
+ LDNS_RR_TYPE_SOA LDNS_RR_TYPE_SPF LDNS_RR_TYPE_SRV LDNS_RR_TYPE_SSHFP
+ LDNS_RR_TYPE_TALINK LDNS_RR_TYPE_TSIG LDNS_RR_TYPE_TXT LDNS_RR_TYPE_UID
+ LDNS_RR_TYPE_UINFO LDNS_RR_TYPE_UNSPEC LDNS_RR_TYPE_WKS
+ LDNS_RR_TYPE_X25 LDNS_RSAMD5 LDNS_RSASHA1 LDNS_RSASHA1_NSEC3
+ LDNS_RSASHA256 LDNS_RSASHA512 LDNS_SECTION_ADDITIONAL
+ LDNS_SECTION_ANSWER LDNS_SECTION_ANY LDNS_SECTION_ANY_NOQUESTION
+ LDNS_SECTION_AUTHORITY LDNS_SECTION_QUESTION LDNS_SHA1 LDNS_SHA256
+ LDNS_SIGN_DSA LDNS_SIGN_DSA_NSEC3 LDNS_SIGN_ECC_GOST
+ LDNS_SIGN_HMACSHA1 LDNS_SIGN_HMACSHA256
+ LDNS_SIGN_RSAMD5 LDNS_SIGN_RSASHA1 LDNS_SIGN_RSASHA1_NSEC3
+ LDNS_SIGN_RSASHA256 LDNS_SIGN_RSASHA512 LDNS_STATUS_ADDRESS_ERR
+ LDNS_STATUS_CERT_BAD_ALGORITHM LDNS_STATUS_CRYPTO_ALGO_NOT_IMPL
+ LDNS_STATUS_CRYPTO_BOGUS LDNS_STATUS_CRYPTO_EXPIRATION_BEFORE_INCEPTION
+ LDNS_STATUS_CRYPTO_NO_DNSKEY LDNS_STATUS_CRYPTO_NO_DS
+ LDNS_STATUS_CRYPTO_NO_MATCHING_KEYTAG_DNSKEY
+ LDNS_STATUS_CRYPTO_NO_RRSIG LDNS_STATUS_CRYPTO_NO_TRUSTED_DNSKEY
+ LDNS_STATUS_CRYPTO_NO_TRUSTED_DS LDNS_STATUS_CRYPTO_SIG_EXPIRED
+ LDNS_STATUS_CRYPTO_SIG_NOT_INCEPTED LDNS_STATUS_CRYPTO_TSIG_BOGUS
+ LDNS_STATUS_CRYPTO_TSIG_ERR LDNS_STATUS_CRYPTO_TYPE_COVERED_ERR
+ LDNS_STATUS_CRYPTO_UNKNOWN_ALGO LDNS_STATUS_CRYPTO_VALIDATED
+ LDNS_STATUS_DDD_OVERFLOW LDNS_STATUS_DNSSEC_EXISTENCE_DENIED
+ LDNS_STATUS_DNSSEC_NSEC3_ORIGINAL_NOT_FOUND
+ LDNS_STATUS_DNSSEC_NSEC_RR_NOT_COVERED
+ LDNS_STATUS_DNSSEC_NSEC_WILDCARD_NOT_COVERED
+ LDNS_STATUS_DOMAINNAME_OVERFLOW LDNS_STATUS_DOMAINNAME_UNDERFLOW
+ LDNS_STATUS_EMPTY_LABEL LDNS_STATUS_ENGINE_KEY_NOT_LOADED
+ LDNS_STATUS_ERR LDNS_STATUS_FILE_ERR LDNS_STATUS_INTERNAL_ERR
+ LDNS_STATUS_INVALID_B32_EXT LDNS_STATUS_INVALID_B64
+ LDNS_STATUS_INVALID_HEX LDNS_STATUS_INVALID_INT LDNS_STATUS_INVALID_IP4
+ LDNS_STATUS_INVALID_IP6 LDNS_STATUS_INVALID_POINTER
+ LDNS_STATUS_INVALID_STR LDNS_STATUS_INVALID_TIME
+ LDNS_STATUS_LABEL_OVERFLOW LDNS_STATUS_MEM_ERR
+ LDNS_STATUS_MISSING_RDATA_FIELDS_KEY
+ LDNS_STATUS_MISSING_RDATA_FIELDS_RRSIG LDNS_STATUS_NETWORK_ERR
+ LDNS_STATUS_NOT_IMPL LDNS_STATUS_NO_DATA LDNS_STATUS_NSEC3_ERR
+ LDNS_STATUS_NULL LDNS_STATUS_OK LDNS_STATUS_PACKET_OVERFLOW
+ LDNS_STATUS_RES_NO_NS LDNS_STATUS_RES_QUERY LDNS_STATUS_SOCKET_ERROR
+ LDNS_STATUS_SSL_ERR LDNS_STATUS_SYNTAX_ALG_ERR
+ LDNS_STATUS_SYNTAX_BAD_ESCAPE LDNS_STATUS_SYNTAX_CLASS_ERR
+ LDNS_STATUS_SYNTAX_DNAME_ERR LDNS_STATUS_SYNTAX_EMPTY
+ LDNS_STATUS_SYNTAX_ERR LDNS_STATUS_SYNTAX_INCLUDE
+ LDNS_STATUS_SYNTAX_INCLUDE_ERR_NOTIMPL
+ LDNS_STATUS_SYNTAX_INTEGER_OVERFLOW
+ LDNS_STATUS_SYNTAX_ITERATIONS_OVERFLOW LDNS_STATUS_SYNTAX_KEYWORD_ERR
+ LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR LDNS_STATUS_SYNTAX_ORIGIN
+ LDNS_STATUS_SYNTAX_RDATA_ERR LDNS_STATUS_SYNTAX_TTL
+ LDNS_STATUS_SYNTAX_TTL_ERR LDNS_STATUS_SYNTAX_TYPE_ERR
+ LDNS_STATUS_SYNTAX_VERSION_ERR LDNS_STATUS_UNKNOWN_INET
+ LDNS_STATUS_WIRE_INCOMPLETE_ADDITIONAL
+ LDNS_STATUS_WIRE_INCOMPLETE_ANSWER
+ LDNS_STATUS_WIRE_INCOMPLETE_AUTHORITY
+ LDNS_STATUS_WIRE_INCOMPLETE_HEADER LDNS_STATUS_WIRE_INCOMPLETE_QUESTION
+ LDNS_TC)) {
+ next if (eval "my \$a = $constname; 1");
+ if ($@ =~ /^Your vendor has not defined LDNS macro $constname/) {
+ print "# pass: $@";
+ } else {
+ print "# fail: $@";
+ $fail = 1;
+ }
+
+}
+
+ok( $fail == 0 , 'Constants' );
+#########################
+
+# Insert your test code below, the Test::More module is use()ed here so read
+# its man page ( perldoc Test::More ) for help writing this test script.
+
diff --git a/contrib/DNS-LDNS/t/dnssec_datachain.t b/contrib/DNS-LDNS/t/dnssec_datachain.t
new file mode 100644
index 000000000000..3eff6f15760f
--- /dev/null
+++ b/contrib/DNS-LDNS/t/dnssec_datachain.t
@@ -0,0 +1,56 @@
+use Test::More tests => 10;
+use Test::Exception;
+
+use FindBin qw/$Bin/;
+
+use DNS::LDNS ':all';
+
+BEGIN { use_ok('DNS::LDNS') };
+
+# Note: This test makes queries on real internet dns data, and assumes
+# that the iis.se domain is signed.
+
+my $r = new DNS::LDNS::Resolver(filename => "/etc/resolv.conf");
+$r->set_dnssec(1);
+$r->set_random(0);
+
+my $p = $r->query(
+ new DNS::LDNS::RData(LDNS_RDF_TYPE_DNAME, 'iis.se.'),
+ LDNS_RR_TYPE_SOA, LDNS_RR_CLASS_IN, LDNS_RD);
+
+isa_ok($p, 'DNS::LDNS::Packet');
+
+my $rrset = $p->rr_list_by_type(LDNS_RR_TYPE_SOA, LDNS_SECTION_ANSWER);
+
+ok($rrset->rr_count > 0, 'Got an answer with some content');
+
+my $chain = $r->build_data_chain(LDNS_RD, $rrset, $p, undef);
+
+isa_ok($chain, 'DNS::LDNS::DNSSecDataChain');
+
+isa_ok($chain->parent, 'DNS::LDNS::DNSSecDataChain');
+
+dies_ok {
+ my $new_rr = new DNS::LDNS::RR(str => 'test.test. 1234 IN A 10.0.0.1');
+ my $t = $chain->derive_trust_tree($new_rr);
+} 'Making a trust tree with foreign rr fails.';
+
+my $rr = $chain->rrset->rr(0);
+
+my $tree = $chain->derive_trust_tree($rr);
+
+isa_ok($tree, 'DNS::LDNS::DNSSecTrustTree');
+
+# Get root keys.
+my $root_keys_pk = $r->query(
+ new DNS::LDNS::RData(LDNS_RDF_TYPE_DNAME, '.'),
+ LDNS_RR_TYPE_DNSKEY, LDNS_RR_CLASS_IN, LDNS_RD);
+my $root_keys = $root_keys_pk->rr_list_by_type(
+ LDNS_RR_TYPE_DNSKEY, LDNS_SECTION_ANSWER);
+
+is($tree->contains_keys($root_keys), LDNS_STATUS_OK,
+ 'Root key found in trust chain');
+
+ok($tree->depth > 1, 'The trust tree is more than one node.');
+
+isa_ok($tree->parent(0), 'DNS::LDNS::DNSSecTrustTree');
diff --git a/contrib/DNS-LDNS/t/dnssec_zone.t b/contrib/DNS-LDNS/t/dnssec_zone.t
new file mode 100644
index 000000000000..48115aa8e9c7
--- /dev/null
+++ b/contrib/DNS-LDNS/t/dnssec_zone.t
@@ -0,0 +1,35 @@
+use Test::More tests => 7;
+
+use FindBin qw/$Bin/;
+
+use DNS::LDNS ':all';
+
+BEGIN { use_ok('DNS::LDNS') };
+
+# Create a new dnssec zone
+my $z = new DNS::LDNS::DNSSecZone;
+isa_ok($z, 'DNS::LDNS::DNSSecZone', 'Create an empty zone');
+
+# Read a zone from file and create a dnssec zone from it
+my $z2 = new DNS::LDNS::Zone(
+ filename => "$Bin/testdata/myzone.org");
+
+$z->create_from_zone($z2);
+
+my $rrset = $z->find_rrset(
+ new DNS::LDNS::RData(LDNS_RDF_TYPE_DNAME, 'ns1.myzone.org.'),
+ LDNS_RR_TYPE_A);
+
+is($rrset->rrs->rr->type, LDNS_RR_TYPE_A, 'Found an A record');
+is($rrset->rrs->rr->dname, 'ns1.myzone.org.', 'Dname is ns1.myzone.org.');
+
+is($z->add_empty_nonterminals, LDNS_STATUS_OK, 'Add empty non-terminals');
+
+my $klist = new DNS::LDNS::KeyList;
+$klist->push(new DNS::LDNS::Key(filename => "$Bin/testdata/key.private"));
+$klist->key(0)->set_pubkey_owner(
+ new DNS::LDNS::RData(LDNS_RDF_TYPE_DNAME, 'myzone.org'));
+
+is($z->sign($klist, LDNS_SIGNATURE_REMOVE_ADD_NEW, 0), LDNS_STATUS_OK, 'Sign');
+is($z->sign_nsec3($klist, LDNS_SIGNATURE_REMOVE_ADD_NEW, 1, 0, 10, 'ABBA', 0),
+ LDNS_STATUS_OK, 'Sign nsec3');
diff --git a/contrib/DNS-LDNS/t/key.t b/contrib/DNS-LDNS/t/key.t
new file mode 100644
index 000000000000..f0aa08d76373
--- /dev/null
+++ b/contrib/DNS-LDNS/t/key.t
@@ -0,0 +1,25 @@
+use Test::More tests => 8;
+
+use FindBin qw/$Bin/;
+
+use DNS::LDNS ':all';
+
+BEGIN { use_ok('DNS::LDNS') };
+
+my $key = new DNS::LDNS::Key(filename => "$Bin/testdata/key.private");
+ok($key, 'Created new key object from file');
+is($key->algorithm, 7, 'Algorithm is NSEC3RSASHA1');
+my $now = time;
+$key->set_inception($now);
+$key->set_expiration($now + 10000);
+is($key->inception, $now, 'Inception time');
+is($key->expiration, $now + 10000, 'Expiration time');
+like($key->to_rr->to_string, qr|3600\s+IN\s+DNSKEY\s+256\s+3\s+7\s+AwEAAfg/ghOkk|, 'Got rr representation of key');
+
+my $klist = new DNS::LDNS::KeyList;
+$klist->push($key);
+is($klist->count, 1, 'Keylist has one key');
+is($$key, ${$klist->key(0)}, 'Key in keylist is the one we pushed');
+# FIXME: pop is buggy in ldns 1.6.12, uncomment when this starts working
+# is($klist->pop(), $$key, 'Pop key from list');
+# is($klist->count, 0, 'No keys left in list');
diff --git a/contrib/DNS-LDNS/t/rdata.t b/contrib/DNS-LDNS/t/rdata.t
new file mode 100644
index 000000000000..81931c28f89e
--- /dev/null
+++ b/contrib/DNS-LDNS/t/rdata.t
@@ -0,0 +1,47 @@
+use Test::More tests => 18;
+
+use DNS::LDNS ':all';
+
+BEGIN { use_ok('DNS::LDNS') };
+
+# Integer data
+my $i = new DNS::LDNS::RData(LDNS_RDF_TYPE_INT32, '1237654');
+is($i->to_string, '1237654', 'Integer value rdata');
+
+my $ii = new DNS::LDNS::RData(LDNS_RDF_TYPE_INT32, '1237654X');
+is($ii, undef, '1237654X is invalid');
+
+# Period data
+my $p1 = new DNS::LDNS::RData(LDNS_RDF_TYPE_PERIOD, '3h3m3s');
+is($p1->to_string, sprintf("%d", 3600*3 + 60*3 + 3), 'Normalizing period');
+
+my $pi = new DNS::LDNS::RData(LDNS_RDF_TYPE_PERIOD, '3h3X3s');
+is($pi, undef, 'Invalid period value 3h3X3s');
+
+# DNames
+my $dn1 = new DNS::LDNS::RData(LDNS_RDF_TYPE_DNAME, 'azone.org');
+my $dn2 = new DNS::LDNS::RData(LDNS_RDF_TYPE_DNAME, 'other.org');
+my $dn3 = new DNS::LDNS::RData(LDNS_RDF_TYPE_DNAME, 'sub.other.org');
+my $dn4 = new DNS::LDNS::RData(LDNS_RDF_TYPE_DNAME, 'adder.org');
+
+$dn1->cat($dn2);
+is($dn1->to_string, 'azone.org.other.org.', 'Concatenating two domain names');
+my $chopped = $dn1->left_chop;
+is($chopped->to_string, 'org.other.org.', 'Chop off left domain name label');
+ok($dn3->is_subdomain($dn2), 'sub.other.org is subdomain of other.org');
+ok(!$dn2->is_subdomain($dn3), 'other.org is not subdomain of sub.other.org');
+is($dn3->label_count, 3, 'sub.other.org has 3 labels');
+is($dn3->label(1)->to_string, 'other.', 'label 1 of sub.other.org is other.');
+
+my $dni = new DNS::LDNS::RData(
+ LDNS_RDF_TYPE_DNAME, 'not..valid.org');
+is($dni, undef, 'Invalid dname not_valid.org');
+
+my $wc = new DNS::LDNS::RData(LDNS_RDF_TYPE_DNAME, '*.other.org');
+ok($wc->is_wildcard, '*.other.org is a wildcard');
+ok(!$dn3->is_wildcard, 'sub.other.org is not a wildcard');
+ok($dn3->matches_wildcard($wc), 'sub.other.org matches *.other.org');
+ok(!$dn4->matches_wildcard($wc), 'adder.org does not match *.other.org');
+
+is($dn3->compare($dn4), 1, 'sub.other.org > adder.org');
+is($dn4->compare($dn3), -1, 'adder.org < sub.other.org');
diff --git a/contrib/DNS-LDNS/t/resolver.t b/contrib/DNS-LDNS/t/resolver.t
new file mode 100644
index 000000000000..4716a8c2cad1
--- /dev/null
+++ b/contrib/DNS-LDNS/t/resolver.t
@@ -0,0 +1,23 @@
+use Test::More tests => 3;
+
+use FindBin qw/$Bin/;
+
+use DNS::LDNS ':all';
+
+BEGIN { use_ok('DNS::LDNS') };
+
+my $r = new DNS::LDNS::Resolver(filename => "/etc/resolv.conf");
+
+$r->set_random(0);
+
+my $p = $r->query(
+ new DNS::LDNS::RData(LDNS_RDF_TYPE_DNAME, 'org'),
+ LDNS_RR_TYPE_SOA, LDNS_RR_CLASS_IN, LDNS_RD);
+
+isa_ok($p, 'DNS::LDNS::Packet', 'Make a simple query');
+
+my $r2 = new DNS::LDNS::Resolver(filename => "$Bin/testdata/resolv.conf");
+
+$r2->set_rtt(2, 3);
+my @rtt = $r2->rtt;
+is_deeply(\@rtt, [2, 3], "set_rtt and rtt");
diff --git a/contrib/DNS-LDNS/t/rr.t b/contrib/DNS-LDNS/t/rr.t
new file mode 100644
index 000000000000..45b3d9f62f33
--- /dev/null
+++ b/contrib/DNS-LDNS/t/rr.t
@@ -0,0 +1,47 @@
+use Test::More tests => 14;
+
+use DNS::LDNS ':all';
+
+BEGIN { use_ok('DNS::LDNS') };
+
+my $rr1 = new DNS::LDNS::RR;
+isa_ok($rr1, 'DNS::LDNS::RR', 'Create empty rr');
+
+$rr1 = new DNS::LDNS::RR(
+ type => LDNS_RR_TYPE_SOA,
+ class => LDNS_RR_CLASS_CH,
+ ttl => 1234,
+ owner => 'myzone.org',
+ rdata => [
+ new DNS::LDNS::RData(LDNS_RDF_TYPE_DNAME, 'hostmaster.myzone.org'),
+ new DNS::LDNS::RData(LDNS_RDF_TYPE_DNAME, 'master.myzone.org'),
+ new DNS::LDNS::RData(LDNS_RDF_TYPE_INT32, '2012113030'),
+ new DNS::LDNS::RData(LDNS_RDF_TYPE_PERIOD, '12345'),
+ new DNS::LDNS::RData(LDNS_RDF_TYPE_PERIOD, '1827'),
+ new DNS::LDNS::RData(LDNS_RDF_TYPE_PERIOD, '2345678'),
+ new DNS::LDNS::RData(LDNS_RDF_TYPE_PERIOD, '87654')
+ ],
+);
+isa_ok($rr1, 'DNS::LDNS::RR', 'Create SOA rr with rdata');
+
+like($rr1->to_string, qr/^myzone\.org\.\s+1234\s+CH\s+SOA\s+hostmaster\.myzone\.org\.\s+master\.myzone\.org\.\s+2012113030\s+12345\s+1827\s+2345678\s+87654$/,
+ 'Format SOA rr as string');
+
+is($rr1->pop_rdata->to_string, '87654', 'pop rdata');
+$rr1->push_rdata(new DNS::LDNS::RData(LDNS_RDF_TYPE_PERIOD, '55667'));
+is($rr1->rdata(6)->to_string, '55667', 'push_rdata and access rdata by index');
+
+my $rr2 = new DNS::LDNS::RR(str => 'myzone.org. 1234 IN SOA hostmaster.myzone.org. master.myzone.org. 2012 12345 1827 2345678 87654');
+isa_ok($rr2, 'DNS::LDNS::RR', 'Create SOA rr from string');
+like($rr2->to_string, qr/^myzone\.org\.\s+1234\s+IN\s+SOA\s+hostmaster\.myzone\.org\.\s+master\.myzone\.org\.\s+2012\s+12345\s+1827\s+2345678\s+87654$/,
+ 'Format it back to string');
+
+ok($rr1->compare($rr2) > 0, 'Compare rr, greater than');
+ok($rr2->compare($rr1) < 0, 'Compare rr, less than');
+is($rr1->compare($rr1), 0, 'Compare rr, equal');
+
+my $rr3 = new DNS::LDNS::RR(str => 'ozone.org. 1234 IN SOA hostmaster.ozone.org. master.ozone.org. 2012 12345 1827 2345678 87654');
+
+ok($rr3->compare_dname($rr1) > 0, 'Compare dname, greater than');
+ok($rr1->compare_dname($rr3) < 0, 'Compare dname, less than');
+is($rr1->compare_dname($rr2), 0, 'Compare dname, equal');
diff --git a/contrib/DNS-LDNS/t/rrlist.t b/contrib/DNS-LDNS/t/rrlist.t
new file mode 100644
index 000000000000..1ff0b48ad448
--- /dev/null
+++ b/contrib/DNS-LDNS/t/rrlist.t
@@ -0,0 +1,84 @@
+use Test::More tests => 24;
+
+use FindBin qw/$Bin/;
+
+use DNS::LDNS ':all';
+
+BEGIN { use_ok('DNS::LDNS') };
+
+# Create list
+my $list = new DNS::LDNS::RRList;
+isa_ok($list, 'DNS::LDNS::RRList', 'Create an empty rr list');
+
+# Push/pop/count rr
+$list->push(new DNS::LDNS::RR(str => 'ns.myzone.org 3600 IN AAAA ::1'));
+is($list->rr_count, 1, 'Added one rr');
+like($list->rr(0)->to_string, qr/^ns\.myzone\.org\.\s+3600\s+IN\s+AAAA\s+::1$/, 'Added rr is at position 0');
+$list->push(new DNS::LDNS::RR(str => 'ns.myzone.org 7200 IN A 192.168.100.2'));
+is($list->rr_count, 2, 'Added another rr');
+like($list->rr(1)->to_string, qr/^ns\.myzone\.org\.\s+7200\s+IN\s+A\s+192\.168\.100\.2$/, 'Last added rr is at position 1');
+like($list->pop->to_string, qr/^ns\.myzone\.org\.\s+7200\s+IN\s+A\s+192\.168\.100\.2$/, 'pop the last element');
+is($list->rr_count, 1, '1 element left in the list');
+
+# Push/pop list
+my $l2 = new DNS::LDNS::RRList;
+$l2->push(new DNS::LDNS::RR(str => 'ns2.myzone.org 3600 IN A 192.168.100.0'));
+$l2->push(new DNS::LDNS::RR(str => 'ns2.myzone.org 3600 IN A 192.168.100.1'));
+$list->push_list($l2);
+is($list->rr_count, 3, 'Pushed two elements. List count is now 3.');
+$list->push_list($l2);
+$list->push_list($l2);
+my $l3 = $list->pop_list(1);
+is($list->rr_count, 6, 'Pushed 4 elements, popped 1, count is now 6');
+is($l3->rr_count, 1, 'Popped list contains 1 elements');
+$l3 = $list->pop_list(3);
+is($list->rr_count, 3, 'Popped 3 elements, count is now 3');
+is($l3->rr_count, 3, 'Popped list contains 3 elements');
+
+# RRSets
+ok($l2->is_rrset, 'List is rrset');
+ok(!$list->is_rrset, 'List is no longer an rrset');
+my $rrset = $list->pop_rrset;
+ok($rrset->is_rrset, 'Popped list is rrset');
+is($rrset->rr_count, 2, 'Popped rrset has two elements.');
+
+# Compare, contains, subtype
+my $rr = new DNS::LDNS::RR(str => 'ns2.myzone.org 3600 IN A 192.168.100.0');
+ok($rrset->contains_rr($rr), 'RRSet contains rr '.$rr->to_string);
+is($list->compare($l2), -1, '$list < $l2');
+is($l2->compare($list), 1, '$l2 > $list');
+
+$list->push(new DNS::LDNS::RR(str => 'ns3.myzone.org 3600 IN A 192.168.100.0'),
+ new DNS::LDNS::RR(str => 'ns3.myzone.org 3600 IN A 192.168.100.1'),
+ new DNS::LDNS::RR(str => 'ns4.myzone.org 3600 IN A 192.168.100.1'));
+my $subtype = $list->subtype_by_rdata(
+ new DNS::LDNS::RData(LDNS_RDF_TYPE_A, '192.168.100.1'), 0);
+is($subtype->to_string, "ns3.myzone.org.\t3600\tIN\tA\t192.168.100.1\nns4.myzone.org.\t3600\tIN\tA\t192.168.100.1\n", 'Filter rrs by rdata');
+
+# DNSSec signature verification
+my $keylist = new DNS::LDNS::RRList;
+$keylist->push(
+ new DNS::LDNS::RR(str => 'trondheim.no. 3600 IN DNSKEY 256 3 8 AwEAAZIDdRI8I+F/J6OT8xX7CbGQYRr8rWH9dvloUlRJXcEVE2pRAez6 pJC5Odg+i2WvDUeE4tUO1gwwjU83TIinZxxsDnqr7FzvqpHeJbVd2N3d S4zaJcbjSnwMqdebmTEXSrflp8DeIAH0GQGNQjhOPubbb/nADYP2RS1i CoOADa8P'),
+ new DNS::LDNS::RR(str => 'trondheim.no. 3600 IN DNSKEY 257 3 8 AwEAAax9EgKyRsMpU2B0E2dZ+nkWnmZHjlBO3uXBI+2x33dG8bk+XSqr kyWTelhhsqLqIxsaYSwYgzLtn+/qzlFjKwcaU95p+Tp95MOVXYqUtRyC VyLGkzA7ZDbx7TFCi3PyLDM/Arx+DvOx6nNvA/erqIU5gYEo9Nm1KXEy rhfSn3xc96p1AOhmTuSo6EfYlPY4gxHDgJdHFv7Fi9zV6VFmJ29h0rsG 5g3pV1lvCcGcxfRLJ1u7JRw2BWMo9lgHzGuypEVV7iLnvbfDlXhF+jAS owR2JxlESC3dOgNiNWvc4pbyVXBXpP6h/5JpcxkzF7BNJMZiLN14qvam G1+LuZM8qfc=')
+);
+
+my $soalist = new DNS::LDNS::RRList;
+$soalist->push(
+ new DNS::LDNS::RR(str => 'trondheim.no. 3600 IN SOA charm.norid.no. hostmaster.norid.no. 2013021137 14400 1800 2419200 3600')
+);
+
+my $siglist = new DNS::LDNS::RRList;
+$siglist->push(
+ new DNS::LDNS::RR(str => 'trondheim.no. 3600 IN RRSIG SOA 8 2 3600 20130227105101 20130213090318 36381 trondheim.no. NbeN8E4pvQSDk3Dn0i8B4e2A3KAY8JrX+zcJazPTgHbT6wjzCncn3ANn 6rs+HdcCLtptyX1QbzlZD/lOY8kjJw5TEUoFX2Q/2sBYdt1aT6qgt/+H o71iUz3bk1V73zjSG/OpqG0oXmjCWSBZgzK6UI+zGlgG0Kvrc7H1pw5S ZBA=')
+);
+
+my ($status, $goodkeys) = $soalist->verify_notime($siglist, $keylist);
+is ($status, LDNS_STATUS_OK, 'Verification returned status ok.');
+is ($goodkeys->rr_count, 1, 'One key matched the signature.');
+
+my $klist = new DNS::LDNS::KeyList;
+$klist->push(new DNS::LDNS::Key(filename => "$Bin/testdata/key.private"));
+$klist->key(0)->set_pubkey_owner(
+ new DNS::LDNS::RData(LDNS_RDF_TYPE_DNAME, 'myzone.org'));
+my $sigs = $l2->sign_public($klist);
+is($sigs->rr_count, 1, 'Sign public, got 1 rrsig');
diff --git a/contrib/DNS-LDNS/t/testdata/key.private b/contrib/DNS-LDNS/t/testdata/key.private
new file mode 100644
index 000000000000..5b6601b666b1
--- /dev/null
+++ b/contrib/DNS-LDNS/t/testdata/key.private
@@ -0,0 +1,13 @@
+Private-key-format: v1.2
+Algorithm: 7 (NSEC3RSASHA1)
+Modulus: +D+CE6ST+vFtbnXLdNESSprWSpbpRqEyri20vOx/JIViYdflGQyT0SDWSAE0JqtRlq73qSTDNuR3KWG/57oQQQ5P/wdQaF4TXA/nGjQJPEnhwKVUPVl5WRvqJLpW3C5xSSkhUkwjCp8y6z4NkbX0x7kum9ZTyTai6hkAhjyXu56yXAHX80DWadGK7RmX4JNlJalp2O33hJmakw8BVpgM9yaN4TixVsmZyHLi4hLjMAsjkEEJnfV8WoMEyyjs4kdKDHQAIa854loRcOluT1FiBKgecVAjDu/mkxnqYedN68Yx/wi7D+eClGf/gZjsmuoKKxCxnvDkRCKxrdMJtrsduw==
+PublicExponent: AQAB
+PrivateExponent: A8m0SmhweZvFd7IEcLvf85N5QZob5SAAjffUki1poz0Fy0hoDoHKn55IpsCd8xkaHZp93O7aq7PAvbjoHLkSFmwJfHK4H1+QHA+CDzxMB8d40l+zcVw0Jc/vOrA9Mw7iW6NtBrxyrG7RcBV6T4bfPUzuESKsFJ3oznmjMGksR4iUrnYAoUgi1pCQlxhSkPM74YhNWbUxYr4gRlL2xGGcJ2qMM8KG06or/Ok+d4bxnxiDBo41THik8ptfu/DL3HrJLOJ1CrvZGy9Q3uFiCvfD9Sk+eOZz1XPkJrUDKGYGoUvZc8enStXSM+TKd3EQy5owjJt+j2h0JdYJM8pxF2EWwQ==
+Prime1: /5r4e+6kJS/+UJ0DMenJGm0vxfgFHvk5yLfz+1sKd6C9qQJN5da1m6kWuPdtBG7XGhZb8cJPOfK//g9hVS9GYEDyYmhYZsPTL+1vkiecDpeEQkrf4RCtU7NXLNT/AVNe01iEnIGuKbva6z19P1hjNO23d7LXHil1oULM1W8O1Z8=
+Prime2: +KGhJOe+dB5Ud9cFlspMIIpZKHvoDc8VUb2avnhicDX5YC8dVS3nBoyc1cBNgxi4nSvBSl8/fwNT1cHJsPj7Xp2FOAsIBITRnmQt2P5JDpTEuMkEjMT8h/gJ8WnJ0+/VQhLG6rfsSAXdXvVhP4VYttPdiQ0fAe8b5v2MH1VzamU=
+Exponent1: UWCEVeifR9ukywOCHeUBirFScWPKNZdBR18RhWfxyC5b07ARHuihvyIxQsg7ZBrpzrtpoGmtkZRwfbFl2poHfOOQh7YS1vzngq3ERLLpo1en2vc9mckWdbx2N6bEXSau3Pikl7NNwKm3RAe6lW1NgG9iZvCAPnESqzm6PwVxop8=
+Exponent2: FMsnt/dttTZoKBGilQbcMQiBBmK+eJEuHkT2MSHOUcYh0gp+sIYDQUf3QeUwVlt17ScgpkCrBctYcpMfdB6On04bOyGpDP+yrEWClBhIMeD9RtsA92juGc0Dv93yFDiFpF3/pte0+h0Lc4qgFHjpf3jemTywsC+4LKxd0K0L1wU=
+Coefficient: klnXksRr0Z8HPLASytPt4EeBK3Md7MM+Ihm6DIM5PA/KO9k0s8231hspcxBDj37HYwJ7eD77svUJFzdUOqIT8gChc6uq9VI9NFggs8rn4EndoEe+zU477NpL4U09LMfbAN+NATkhDWabVIQBeGqpIAR0fxFIqGhDtkiLyNqhq3c=
+Created: 20120614100023
+Publish: 20120614100023
+Activate: 20120614100023
diff --git a/contrib/DNS-LDNS/t/testdata/myzone.org b/contrib/DNS-LDNS/t/testdata/myzone.org
new file mode 100644
index 000000000000..a99a9fe54d89
--- /dev/null
+++ b/contrib/DNS-LDNS/t/testdata/myzone.org
@@ -0,0 +1,17 @@
+$TTL 4500
+$ORIGIN myzone.org.
+
+myzone.org. 1000 IN SOA (
+ ldns.myzone.org.
+ ns.ldns.myzone.org.
+ 2012113030
+ 12345
+ 1827
+ 2345678
+ 87654 )
+
+ns.ldns A 192.168.100.2
+ns2 5600 IN AAAA 2001:dead:dead::2
+ns2 6600 IN A 192.168.100.7
+ns1 3600 IN A 192.168.100.2
+ns1 4600 IN AAAA 2001:dead:dead::1
diff --git a/contrib/DNS-LDNS/t/testdata/resolv.conf b/contrib/DNS-LDNS/t/testdata/resolv.conf
new file mode 100644
index 000000000000..b66ae5732fa3
--- /dev/null
+++ b/contrib/DNS-LDNS/t/testdata/resolv.conf
@@ -0,0 +1,3 @@
+nameserver 127.0.0.1
+nameserver 192.168.100.1
+search foo.bar.org
diff --git a/contrib/DNS-LDNS/t/zone.t b/contrib/DNS-LDNS/t/zone.t
new file mode 100644
index 000000000000..522a85664db3
--- /dev/null
+++ b/contrib/DNS-LDNS/t/zone.t
@@ -0,0 +1,75 @@
+use Test::More tests => 16;
+
+use FindBin qw/$Bin/;
+
+use DNS::LDNS ':all';
+
+BEGIN { use_ok('DNS::LDNS') };
+
+# Create a new zone
+my $z = new DNS::LDNS::Zone;
+isa_ok($z, 'DNS::LDNS::Zone', 'Create an empty zone');
+
+# Fill inn a soa and some rrs
+$z->set_soa(new DNS::LDNS::RR(str => join(' ', qw/myzone.org 1000 IN SOA
+ hostmaster.myzone.org. master.myzone.org. 2012113030 12345 1827 2345678
+ 87654/)));
+
+is($z->soa->dname, 'myzone.org.', 'Found soa record');
+
+my $rrs = new DNS::LDNS::RRList;
+$rrs->push(new DNS::LDNS::RR(str => 'ns2.myzone.org 3600 IN A 192.168.100.2'),
+ new DNS::LDNS::RR(str => 'ns2.myzone.org 3600 IN A 192.168.100.9'),
+ new DNS::LDNS::RR(str => 'ns3.myzone.org 3600 IN A 192.168.100.2'),
+ new DNS::LDNS::RR(str => 'ns1.myzone.org 3600 IN A 192.168.100.7'));
+
+$z->set_rrs($rrs);
+is($z->rrs->rr(0)->to_string, "ns2.myzone.org.\t3600\tIN\tA\t192.168.100.2\n",
+ 'Check first rr');
+is($z->rrs->rr(3)->to_string, "ns1.myzone.org.\t3600\tIN\tA\t192.168.100.7\n",
+ 'Check last rr');
+
+$z->sort;
+is($z->rrs->rr(0)->to_string, "ns1.myzone.org.\t3600\tIN\tA\t192.168.100.7\n",
+ 'Check first rr after sorting');
+is($z->rrs->rr(3)->to_string, "ns3.myzone.org.\t3600\tIN\tA\t192.168.100.2\n",
+ 'Check last rr after sorting');
+
+# Read a zone from file
+my $z2 = new DNS::LDNS::Zone(
+ filename => "$Bin/testdata/myzone.org", ttl => 100);
+
+$z2->canonicalize;
+
+like($z2->to_string, qr/\nns.ldns.myzone.org.\s+/, 'Canonicalize');
+
+like($z2->to_string, qr/^myzone.org.\s+1000\s+IN\s+SOA\s+ldns.myzone.org.\s+ns.ldns.myzone.org.\s+2012113030\s+12345\s+1827\s+2345678\s+87654\s+/, 'Found soa rec');
+
+like($z2->to_string, qr/ns.ldns.myzone.org.\s+4500\s+IN\s+A\s+192.168.100.2/, 'Found ns rec');
+
+like($z2->to_string, qr/ns2.myzone.org.\s+5600\s+IN\s+AAAA\s+2001:dead:dead::2/, 'Found yet another ns rec');
+
+is($z2->rrs->rr_count, 5, 'Zone has 5 rrs');
+
+my $klist = new DNS::LDNS::KeyList;
+$klist->push(new DNS::LDNS::Key(filename => "$Bin/testdata/key.private"));
+$klist->key(0)->set_pubkey_owner(
+ new DNS::LDNS::RData(LDNS_RDF_TYPE_DNAME, 'myzone.org'));
+
+my $z3 = $z2->sign($klist);
+
+my $sigc = grep { $z3->rrs->rr($_)->type == LDNS_RR_TYPE_RRSIG }
+ (0 .. $z3->rrs->rr_count - 1);
+is($sigc, 10, 'Signed zone has 10 signatures');
+my $nsecc = grep { $z3->rrs->rr($_)->type == LDNS_RR_TYPE_NSEC }
+ (0 .. $z3->rrs->rr_count - 1);
+is($nsecc, 4, 'Signed zone has 3 nsec recs');
+
+my $z4 = $z2->sign_nsec3($klist, 1, 0, 2, 'ABC');
+
+my $sigc3 = grep { $z4->rrs->rr($_)->type == LDNS_RR_TYPE_RRSIG }
+ (0 .. $z4->rrs->rr_count - 1);
+is($sigc3, 12, 'NSEC3-signed zone has 12 signatures');
+my $nsecc3 = grep { $z4->rrs->rr($_)->type == LDNS_RR_TYPE_NSEC3 }
+ (0 .. $z4->rrs->rr_count - 1);
+is($nsecc3, 5, 'NSEC3-signed zone has 5 nsec recs');
diff --git a/contrib/DNS-LDNS/typemap b/contrib/DNS-LDNS/typemap
new file mode 100644
index 000000000000..568404bbb472
--- /dev/null
+++ b/contrib/DNS-LDNS/typemap
@@ -0,0 +1,67 @@
+TYPEMAP
+DNS__LDNS__Zone LDNS_GENERIC_STRUCT
+DNS__LDNS__RRList LDNS_GENERIC_STRUCT
+DNS__LDNS__RR LDNS_GENERIC_STRUCT
+DNS__LDNS__RData LDNS_GENERIC_STRUCT
+DNS__LDNS__DNSSecZone LDNS_GENERIC_STRUCT
+DNS__LDNS__DNSSecRRSets LDNS_GENERIC_STRUCT
+DNS__LDNS__DNSSecRRs LDNS_GENERIC_STRUCT
+DNS__LDNS__DNSSecName LDNS_GENERIC_STRUCT
+DNS__LDNS__RBTree LDNS_GENERIC_STRUCT
+DNS__LDNS__RBNode LDNS_GENERIC_STRUCT
+DNS__LDNS__Resolver LDNS_GENERIC_STRUCT
+DNS__LDNS__Packet LDNS_GENERIC_STRUCT
+DNS__LDNS__Key LDNS_GENERIC_STRUCT
+DNS__LDNS__KeyList LDNS_GENERIC_STRUCT
+DNS__LDNS__DNSSecDataChain LDNS_GENERIC_STRUCT
+DNS__LDNS__DNSSecTrustTree LDNS_GENERIC_STRUCT
+Mortal_PV Mortal_PV
+
+DNS__LDNS__RR__Opt LDNS_GENERIC_STRUCT_OPT
+DNS__LDNS__RData__Opt LDNS_GENERIC_STRUCT_OPT
+
+LDNS_Pkt_Opcode T_ENUM
+LDNS_Pkt_Rcode T_ENUM
+LDNS_Pkt_Section T_ENUM
+LDNS_Pkt_Type T_ENUM
+LDNS_RR_Type T_ENUM
+LDNS_RR_Class T_ENUM
+LDNS_RDF_Type T_ENUM
+LDNS_Hash T_ENUM
+LDNS_Status T_ENUM
+LDNS_Signing_Algorithm T_ENUM
+
+uint32_t T_UV
+uint16_t T_UV
+uint8_t T_UV
+signed char T_UV
+
+INPUT
+LDNS_GENERIC_STRUCT_OPT
+ if (!SvOK($arg)) {
+ $var = NULL;
+ }
+ else if (sv_derived_from($arg, \"${(my $ntt=$ntype)=~s/__/::/g;$ntt=~s/::Opt$//;\$ntt}\")){
+ IV tmp = SvIV((SV*)SvRV($arg));
+ $var = INT2PTR($type, tmp);
+ }
+ else
+ croak(\"$var is not of type ${(my $ntt=$ntype)=~s/__/::/g;\$ntt}\")
+
+INPUT
+LDNS_GENERIC_STRUCT
+ if (sv_derived_from($arg, \"${(my $ntt=$ntype)=~s/__/::/g;\$ntt}\")){
+ IV tmp = SvIV((SV*)SvRV($arg));
+ $var = INT2PTR($type, tmp);
+ }
+ else
+ croak(\"$var is not of type ${(my $ntt=$ntype)=~s/__/::/g;\$ntt}\")
+
+OUTPUT
+LDNS_GENERIC_STRUCT
+ sv_setref_pv($arg, \"${(my $ntt=$ntype)=~s/__/::/g;\$ntt}\", (void*)$var);
+
+OUTPUT
+Mortal_PV
+ sv_setsv($arg, sv_2mortal(newSVpv($var, 0)));
+ free((void *)$var);
diff --git a/contrib/build-solaris.sh b/contrib/build-solaris.sh
index 9f35728ea741..c4719de3c638 100755
--- a/contrib/build-solaris.sh
+++ b/contrib/build-solaris.sh
@@ -1,6 +1,6 @@
#!/bin/ksh
#
-# $Id: build-solaris.sh 2597 2008-04-15 08:39:58Z jelte $
+# $Id$
PREFIX=/opt/ldns
diff --git a/contrib/ldnsx/ldnsx.py b/contrib/ldnsx/ldnsx.py
index ee81b2fdaab2..3ae9424f140c 100644
--- a/contrib/ldnsx/ldnsx.py
+++ b/contrib/ldnsx/ldnsx.py
@@ -132,9 +132,9 @@ def secure_query(name, rr_type, rr_class="IN", flags=["RD"], tries = 1, flex=Fal
raise Exception("%s lookup failed (server error or dnssec validation failed)" % name)
if pkt.rcode() == "NXDOMAIN":
if "AD" in pkt.flags():
- raise Exception("%s lookup failed (non-existence proven by DNSSEC)" % hostname )
+ raise Exception("%s lookup failed (non-existence proven by DNSSEC)" % name )
else:
- raise Exception("%s lookup failed" % hostname )
+ raise Exception("%s lookup failed" % name )
if pkt.rcode() == "NOERROR":
if "AD" not in pkt.flags():
if not flex:
@@ -698,7 +698,7 @@ class resource_record:
def __len__(self):
try:
- return len(_rdfs)
+ return len(self._rdfs)
except:
return 0
@@ -891,6 +891,7 @@ _rr_types={
"NSAP_PTR" : ldns.LDNS_RR_TYPE_NSAP_PTR,
"NSEC" : ldns.LDNS_RR_TYPE_NSEC,
"NSEC3": ldns.LDNS_RR_TYPE_NSEC3,
+ "NSEC3PARAM" : ldns.LDNS_RR_TYPE_NSEC3PARAM,
"NSEC3PARAMS" : ldns.LDNS_RR_TYPE_NSEC3PARAMS,
"NULL" : ldns.LDNS_RR_TYPE_NULL,
"NXT" : ldns.LDNS_RR_TYPE_NXT,
diff --git a/contrib/python/Changelog b/contrib/python/Changelog
index aaa57e13692b..7c4ccd1187d4 100644
--- a/contrib/python/Changelog
+++ b/contrib/python/Changelog
@@ -1,3 +1,29 @@
+1.6.17 2014-01-10
+ * Added ldns_rdf.data_as_bytearray(). The method returns a bytearray object
+ containing rdf data.
+ * Changed the behaviour of ldns_resolver.trusted_key() in order to prevent
+ memory corrupotion and leaks.
+ * Fixed memory leaks when destroying ldns_resolver.
+ * Removed ldns_pkt.section_count(), ldns_resolver.set_searchlist_count()
+ because it is marked static in the library.
+ * Added ldns_pkt.new(), ldns_resolver.new().
+ * Marked as returning new object ldns_pkt.get_section_clone(),
+ ldns_resolver.get_addr_by_name(), ldns_resolver.get_name_by_addr(),
+ ldns_resolver.search().
+ * Added push cloning for ldns_pkt.safe_push_rr(),
+ ldns_pkt.safe_push_rr_list(), ldns_pkt.set_additional(),
+ ldns_pkt.set_answer(), ldns_pkt.set_answerfrom(),
+ ldns_pkt.set_authority(), ldns_pkt.set_edns_data(),
+ ldns_pkt.set_question(), ldns_pkt.set_tsig(),
+ ldns_resolver.set_dnssec_anchors(), ldns_resolver.set_domain().
+ * Added pull cloning for ldns_pkt.answerfrom(), ldns_pkt.edns_data(),
+ ldns_pkt.tsig(), ldns_resolver.axfr_last_pkt(),
+ ldns_resolver.dnssec_anchors(), ldns_resolver.domain(),
+ ldns_resolver.tsig_algorithm(), ldns_resolver.tsig_keydata(),
+ ldns_resolver.tsig_keyname().
+ * Method ldns_rdf.reverse() now throws an exception when not applied
+ on dname rdfs. This is to prevent assertion fails in ldns' C code.
+
1.6.16 2012-11-13
* Fix typo in ldns_struct_pkt.opcode2str
diff --git a/contrib/python/Makefile b/contrib/python/Makefile
index 927685764bbf..debc7d0486d2 100644
--- a/contrib/python/Makefile
+++ b/contrib/python/Makefile
@@ -41,7 +41,7 @@ help:
../../Makefile: ../../configure
cd ../.. && ./configure --with-python
-_ldns.so: ../../Makefile
+_ldns.so: ../../Makefile
$(MAKE) -C ../..
../../.libs/libldns.so.1: ../../Makefile
@@ -59,13 +59,15 @@ testenv: ../../.libs/libldns.so.1 _ldns.so
cd examples && LD_LIBRARY_PATH=ldns bash
rm -rf examples/ldns
-test: ../../.libs/libldns.so.1 _ldns.so examples/test_buffer.py examples/test_rdf.py examples/test_dname.py examples/test_rr.py
+test: ../../.libs/libldns.so.1 _ldns.so examples/test_buffer.py examples/test_rdf.py examples/test_dname.py examples/test_rr.py examples/test_pkt.py examples/test_resolver.py
@rm -rf examples/ldns
@cd examples && mkdir ldns && ln -s ../../ldns.py ldns/__init__.py && ln -s ../../../../.libs/_ldns.so ldns/_ldns.so && ln -s ../../../../.libs/libldns.so.1 ldns/libldns.so.1
@cd examples && LD_LIBRARY_PATH=ldns ./test_buffer.py 2>/dev/null
@cd examples && LD_LIBRARY_PATH=ldns ./test_rdf.py 2>/dev/null
@cd examples && LD_LIBRARY_PATH=ldns ./test_dname.py 2>/dev/null
@cd examples && LD_LIBRARY_PATH=ldns ./test_rr.py 2>/dev/null
+ @cd examples && LD_LIBRARY_PATH=ldns ./test_pkt.py 2>/dev/null
+ @cd examples && LD_LIBRARY_PATH=ldns ./test_resolver.py 2>/dev/null
@rm -rf examples/ldns
doc: ../../.libs/libldns.so.1 _ldns.so
diff --git a/contrib/python/docs/source/conf.py b/contrib/python/docs/source/conf.py
index 4d891543b1a3..468b827d8bfb 100644
--- a/contrib/python/docs/source/conf.py
+++ b/contrib/python/docs/source/conf.py
@@ -37,7 +37,7 @@ master_doc = 'index'
# General substitutions.
project = 'pyLDNS'
-copyright = '2009, Karel Slany, Zdenek Vasicek'
+copyright = '2009-2013, Karel Slany, Zdenek Vasicek'
# The default replacements for |version| and |release|, also used in various
# other places throughout the built documents.
@@ -45,7 +45,7 @@ copyright = '2009, Karel Slany, Zdenek Vasicek'
# The short X.Y version.
version = '1.6'
# The full version, including alpha/beta/rc tags.
-release = '1.6.16'
+release = '1.6.17'
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
diff --git a/contrib/python/docs/source/modules/ldns_rdf.rst b/contrib/python/docs/source/modules/ldns_rdf.rst
index 5ed1799b1bb1..4a482e444398 100644
--- a/contrib/python/docs/source/modules/ldns_rdf.rst
+++ b/contrib/python/docs/source/modules/ldns_rdf.rst
@@ -35,7 +35,7 @@ Predefined constants
* LDNS_RDF_TYPE_TIME,
* LDNS_RDF_TYPE_PERIOD,
* LDNS_RDF_TYPE_TSIGTIME,
- * LDNS_RDF_TYPE_TSIG,
+ * LDNS_RDF_TYPE_HIP,
* LDNS_RDF_TYPE_INT16_DATA,
* LDNS_RDF_TYPE_SERVICE,
* LDNS_RDF_TYPE_LOC,
diff --git a/contrib/python/examples/test_buffer.py b/contrib/python/examples/test_buffer.py
index 0baf76f6ab02..472bd6fdbf4d 100755
--- a/contrib/python/examples/test_buffer.py
+++ b/contrib/python/examples/test_buffer.py
@@ -174,7 +174,7 @@ if True:
ret = buf.capacity()
except:
set_error()
- if not isinstance(ret, int):
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
# Should be int.
set_error()
@@ -284,7 +284,7 @@ if True:
ret = buf.position()
except:
set_error()
- if not isinstance(ret, int):
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
set_error()
@@ -328,7 +328,7 @@ if True:
ret = buf.read_u16()
except:
set_error()
- if not isinstance(ret, int):
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
set_error()
if ret != (ord("a") * 0x0101):
set_error()
@@ -343,7 +343,7 @@ if True:
ret = buf.read_u16_at(1)
except:
set_error()
- if not isinstance(ret, int):
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
set_error()
if ret != (ord("b") * 0x0101):
set_error()
@@ -418,7 +418,7 @@ if True:
ret = buf.read_u8()
except:
set_error()
- if not isinstance(ret, int):
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
set_error()
if ret != ord("a"):
set_error()
@@ -433,7 +433,7 @@ if True:
ret = buf.read_u8_at(1)
except:
set_error()
- if not isinstance(ret, int):
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
set_error()
if ret != ord("b"):
set_error()
@@ -462,7 +462,7 @@ if True:
ret = buf.remaining()
except:
set_error()
- if not isinstance(ret, int):
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
set_error()
if ret != (capacity - 6):
set_error()
@@ -477,7 +477,7 @@ if True:
ret = buf.remaining_at(1)
except:
set_error()
- if not isinstance(ret, int):
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
set_error()
if ret != (capacity - 1):
set_error()
diff --git a/contrib/python/examples/test_dname.py b/contrib/python/examples/test_dname.py
index d69170737acc..07e0a85070d6 100755
--- a/contrib/python/examples/test_dname.py
+++ b/contrib/python/examples/test_dname.py
@@ -388,7 +388,7 @@ if True:
dn = ldns.ldns_dname("www.nic.cz.")
try:
ret = dn.label_count()
- if not isinstance(ret, int):
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
set_error()
if ret != 3:
set_error()
diff --git a/contrib/python/examples/test_pkt.py b/contrib/python/examples/test_pkt.py
new file mode 100755
index 000000000000..7ecb7bd8cc41
--- /dev/null
+++ b/contrib/python/examples/test_pkt.py
@@ -0,0 +1,1937 @@
+#!/usr/bin/env python
+
+#
+# ldns_pkt testing script.
+#
+# Do not use constructs that differ between Python 2 and 3.
+# Use write on stdout or stderr.
+#
+
+
+import ldns
+import sys
+import os
+import inspect
+
+
+class_name = "ldns_pkt"
+method_name = None
+error_detected = False
+temp_fname = "tmp_pkt.txt"
+
+
+def set_error():
+ """
+ Writes an error message and sets error flag.
+ """
+ global class_name
+ global method_name
+ global error_detected
+ error_detected = True
+ sys.stderr.write("(line %d): malfunctioning method %s.\n" % \
+ (inspect.currentframe().f_back.f_lineno, method_name))
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".aa()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_QR | ldns.LDNS_AA)
+ try:
+ ret = pkt.aa()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != True:
+ set_error()
+ except:
+ set_error()
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_QR)
+ try:
+ ret = pkt.aa()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != False:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".ad()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_QR | ldns.LDNS_AD)
+ try:
+ ret = pkt.ad()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != True:
+ set_error()
+ except:
+ set_error()
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_QR)
+ try:
+ ret = pkt.ad()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != False:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".additional()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_QR | ldns.LDNS_AD)
+ try:
+ ret = pkt.additional()
+ if not isinstance(ret, ldns.ldns_rr_list):
+ set_error()
+ if ret.rr_count() != 0:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".algorithm2str()"
+ try:
+ ret = ldns.ldns_pkt.algorithm2str(ldns.LDNS_DSA)
+ if not isinstance(ret, str):
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".all()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_QR | ldns.LDNS_AD)
+ try:
+ ret = pkt.all()
+ if not isinstance(ret, ldns.ldns_rr_list):
+ set_error()
+ if ret.rr_count() != 1:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".all_noquestion()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_QR | ldns.LDNS_AD)
+ try:
+ ret = pkt.all_noquestion()
+ if not isinstance(ret, ldns.ldns_rr_list):
+ set_error()
+ if ret.rr_count() != 0:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".ancount()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_QR | ldns.LDNS_AD)
+ try:
+ ret = pkt.ancount()
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
+ set_error()
+ if ret != 0:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".answer()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_QR | ldns.LDNS_AD)
+ try:
+ ret = pkt.answer()
+ if not isinstance(ret, ldns.ldns_rr_list):
+ set_error()
+ if ret.rr_count() != 0:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".answerfrom()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_QR | ldns.LDNS_AD)
+ try:
+ ret = pkt.answerfrom()
+ if ret != None:
+ set_error()
+ except:
+ set_error()
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ pkt = resolver.query("www.nic.cz", ldns.LDNS_RR_TYPE_A, ldns.LDNS_RR_CLASS_IN)
+ try:
+ ret = pkt.answerfrom()
+ if not isinstance(ret, ldns.ldns_rdf):
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".arcount()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_QR | ldns.LDNS_AD)
+ try:
+ ret = pkt.arcount()
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
+ set_error()
+ if ret != 0:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".authority()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_QR | ldns.LDNS_AD)
+ try:
+ ret = pkt.authority()
+ if not isinstance(ret, ldns.ldns_rr_list):
+ set_error()
+ if ret.rr_count() != 0:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".cd()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_CD)
+ try:
+ ret = pkt.cd()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != True:
+ set_error()
+ except:
+ set_error()
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_QR)
+ try:
+ ret = pkt.cd()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != False:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".cert_algorithm2str()"
+ try:
+ ret = ldns.ldns_pkt.cert_algorithm2str(ldns.LDNS_CERT_PGP)
+ if not isinstance(ret, str):
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".clone()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_QR | ldns.LDNS_AD)
+ try:
+ ret = pkt.clone()
+ if not isinstance(ret, ldns.ldns_pkt):
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".ends()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_RD | ldns.LDNS_AD)
+ try:
+ ret = pkt.edns()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != False:
+ set_error()
+ except:
+ set_error()
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ resolver.set_dnssec(True)
+ pkt = resolver.query("www.nic.cz", ldns.LDNS_RR_TYPE_A, ldns.LDNS_RR_CLASS_IN)
+ try:
+ ret = pkt.edns()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != True:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".ends_data()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_RD | ldns.LDNS_AD)
+ try:
+ ret = pkt.edns_data()
+ if ret != None:
+ set_error()
+ except:
+ set_error()
+ #resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ #resolver.set_dnssec(True)
+ #pkt = resolver.query("www.nic.cz", ldns.LDNS_RR_TYPE_A, ldns.LDNS_RR_CLASS_IN)
+ #try:
+ # ret = pkt.edns_data()
+ # print ret
+ # if not isinstance(ret, ldns.ldns_rdf):
+ # set_error()
+ # if ret != True:
+ # set_error()
+ #except:
+ # set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".edns_do()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_RD | ldns.LDNS_AD)
+ try:
+ ret = pkt.edns_do()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != False:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".edns_extended_rcode()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_RD | ldns.LDNS_AD)
+ try:
+ ret = pkt.edns_extended_rcode()
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
+ set_error()
+ if ret != 0:
+ set_error()
+ except:
+ set_error()
+ #resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ #resolver.set_dnssec(True)
+ #pkt = resolver.query("www.nic.cz", ldns.LDNS_RR_TYPE_A, ldns.LDNS_RR_CLASS_IN)
+ #try:
+ # ret = pkt.edns_extended_rcode()
+ # if (not isinstance(ret, int)) and (not isinstance(ret, long)):
+ # set_error()
+ # if ret != 0:
+ # set_error()
+ #except:
+ # set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".edns_udp_size()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_RD | ldns.LDNS_AD)
+ try:
+ ret = pkt.edns_udp_size()
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
+ set_error()
+ if ret != 0:
+ set_error()
+ except:
+ set_error()
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ resolver.set_dnssec(True)
+ pkt = resolver.query("www.nic.cz", ldns.LDNS_RR_TYPE_A, ldns.LDNS_RR_CLASS_IN)
+ try:
+ ret = pkt.edns_udp_size()
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
+ set_error()
+ if ret == 0: # Don't know the actual size, but must be greater than 0.
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".edns_version()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_RD | ldns.LDNS_AD)
+ try:
+ ret = pkt.edns_version()
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
+ set_error()
+ if ret != 0:
+ set_error()
+ except:
+ set_error()
+ #resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ #resolver.set_dnssec(True)
+ #pkt = resolver.query("www.nic.cz", ldns.LDNS_RR_TYPE_A, ldns.LDNS_RR_CLASS_IN)
+ #try:
+ # ret = pkt.edns_version()
+ # if (not isinstance(ret, int)) and (not isinstance(ret, long)):
+ # set_error()
+ # if ret != 0:
+ # set_error()
+ #except:
+ # set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".edns_z()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_RD | ldns.LDNS_AD)
+ try:
+ ret = pkt.edns_z()
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
+ set_error()
+ if ret != 0:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".empty()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_RD | ldns.LDNS_AD)
+ try:
+ ret = pkt.empty()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != False:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".get_opcode()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_RD | ldns.LDNS_AD)
+ try:
+ ret = pkt.get_opcode()
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
+ set_error()
+ if ret != ldns.LDNS_PACKET_QUERY:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".get_rcode()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_RD | ldns.LDNS_AD)
+ try:
+ ret = pkt.get_rcode()
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
+ set_error()
+ if ret != ldns.LDNS_RCODE_NOERROR:
+ set_error()
+ except:
+ set_error()
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ resolver.set_dnssec(True)
+ pkt = resolver.query("nonexistent_domain.nic.cz", ldns.LDNS_RR_TYPE_A, ldns.LDNS_RR_CLASS_IN)
+ try:
+ ret = pkt.get_rcode()
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
+ set_error()
+ if ret != ldns.LDNS_RCODE_NXDOMAIN:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".get_section_clone()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_RD | ldns.LDNS_AD)
+ try:
+ ret = pkt.get_section_clone(ldns.LDNS_SECTION_ANY)
+ if not isinstance(ret, ldns.ldns_rr_list):
+ set_error()
+ except:
+ set_error()
+ try:
+ ret = pkt.get_section_clone(ldns.LDNS_SECTION_ANSWER)
+ if not isinstance(ret, ldns.ldns_rr_list):
+ set_error()
+ except:
+ set_error()
+ try:
+ ret = pkt.get_section_clone("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".id()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_RD | ldns.LDNS_AD)
+ try:
+ ret = pkt.id()
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".new()"
+ try:
+ pkt = ldns.ldns_pkt.new()
+ if not isinstance(pkt, ldns.ldns_pkt):
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".new_query()"
+ dname = ldns.ldns_dname("test.nic.cz.")
+ try:
+ pkt = ldns.ldns_pkt.new_query(dname, ldns.LDNS_RR_TYPE_A, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_QR | ldns.LDNS_RD)
+ if not isinstance(pkt, ldns.ldns_pkt):
+ set_error()
+ except:
+ set_error()
+ rdf = ldns.ldns_rdf_new_frm_str(ldns.LDNS_RDF_TYPE_DNAME, "test.nic.cz.")
+ try:
+ pkt = ldns.ldns_pkt.new_query(rdf, ldns.LDNS_RR_TYPE_A, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_QR | ldns.LDNS_RD)
+ if not isinstance(pkt, ldns.ldns_pkt):
+ set_error()
+ except:
+ set_error()
+ try:
+ pkt = ldns.ldns_pkt.new_query("bad argument", ldns.LDNS_RR_TYPE_A, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_QR | ldns.LDNS_RD)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+ try:
+ pkt = ldns.ldns_pkt.new_query(dname, "bad argument", ldns.LDNS_RR_CLASS_IN, ldns.LDNS_QR | ldns.LDNS_RD)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+ try:
+ pkt = ldns.ldns_pkt.new_query(dname, ldns.LDNS_RR_TYPE_A, "bad argument", ldns.LDNS_QR | ldns.LDNS_RD)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+ try:
+ pkt = ldns.ldns_pkt.new_query(dname, ldns.LDNS_RR_TYPE_A, ldns.LDNS_RR_CLASS_IN, "bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".new_query_frm_str()"
+ try:
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz", ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_QR | ldns.LDNS_AA)
+ except:
+ set_error()
+ try:
+ pkt = ldns.ldns_pkt.new_query_frm_str(pkt, ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_QR | ldns.LDNS_AA)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+ try:
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz", "bad argument", ldns.LDNS_RR_CLASS_IN, ldns.LDNS_QR | ldns.LDNS_AA)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+ try:
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz", ldns.LDNS_RR_TYPE_ANY, "bad argument", ldns.LDNS_QR | ldns.LDNS_AA)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+ try:
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz", ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, "bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".nscount()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_RD | ldns.LDNS_AD)
+ try:
+ ret = pkt.nscount()
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
+ set_error()
+ if ret != 0:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".opcode2str()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_RD | ldns.LDNS_AD)
+ try:
+ ret = pkt.opcode2str()
+ if not isinstance(ret, str):
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".print_to_file()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_RD | ldns.LDNS_AD)
+ f = open(temp_fname, "w")
+ try:
+ pkt.print_to_file(f)
+ except:
+ set_error()
+ f.close()
+ f = open(temp_fname, "r")
+ if len(f.readlines()) != 14:
+ set_error()
+ f.close()
+ os.remove(temp_fname)
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".push_rr()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_RD | ldns.LDNS_AD)
+ rr = ldns.ldns_rr.new_frm_str("test1 600 IN A 0.0.0.0")
+ try:
+ ret = pkt.push_rr(ldns.LDNS_SECTION_ANSWER, rr)
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != True:
+ set_error()
+ except:
+ set_error()
+ try:
+ ret = pkt.push_rr("bad argument", rr)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+ try:
+ ret = pkt.push_rr(ldns.LDNS_SECTION_ANSWER, "bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".push_rr_list()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_RD | ldns.LDNS_AD)
+ rrl = ldns.ldns_rr_list.new()
+ rr = ldns.ldns_rr.new_frm_str("test1 600 IN A 0.0.0.0")
+ rrl.push_rr(rr)
+ rrl.push_rr(rr)
+ try:
+ ret = pkt.push_rr_list(ldns.LDNS_SECTION_ANSWER, rrl)
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != True:
+ set_error()
+ except:
+ set_error()
+ try:
+ ret = pkt.push_rr_list("bad argument", rrl)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+ try:
+ ret = pkt.push_rr_list(ldns.LDNS_SECTION_ANSWER, "bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".qdcount()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_QR | ldns.LDNS_AD)
+ try:
+ ret = pkt.qdcount()
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
+ set_error()
+ if ret != 1:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".qr()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_QR | ldns.LDNS_AA)
+ try:
+ ret = pkt.qr()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != True:
+ set_error()
+ except:
+ set_error()
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_AA)
+ try:
+ ret = pkt.qr()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != False:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".querytime()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_QR | ldns.LDNS_AD)
+ try:
+ ret = pkt.querytime()
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
+ set_error()
+ if ret != 0:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".question()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_QR | ldns.LDNS_AD)
+ try:
+ ret = pkt.question()
+ if not isinstance(ret, ldns.ldns_rr_list):
+ set_error()
+ if ret.rr_count() != 1:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".ra()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_QR | ldns.LDNS_RA)
+ try:
+ ret = pkt.ra()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != True:
+ set_error()
+ except:
+ set_error()
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_QR)
+ try:
+ ret = pkt.ra()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != False:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".rcode2str()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_QR | ldns.LDNS_RA)
+ try:
+ ret = pkt.rcode2str()
+ if not isinstance(ret, str):
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".rd()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_QR | ldns.LDNS_RD)
+ try:
+ ret = pkt.rd()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != True:
+ set_error()
+ except:
+ set_error()
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_QR)
+ try:
+ ret = pkt.rd()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != False:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".reply_type()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_QR | ldns.LDNS_RD)
+ try:
+ ret = pkt.reply_type()
+ if ret != ldns.LDNS_PACKET_ANSWER:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".rr()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz", ldns.LDNS_RR_TYPE_A, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_QR | ldns.LDNS_RD)
+ rr = ldns.ldns_rr.new_frm_str("test1 600 IN A 0.0.0.0")
+ pkt.push_rr(ldns.LDNS_SECTION_ANSWER, rr)
+ try:
+ ret = pkt.rr(ldns.LDNS_SECTION_ANSWER, rr)
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != True:
+ set_error()
+ except:
+ set_error()
+ try:
+ ret = pkt.rr(ldns.LDNS_SECTION_QUESTION, rr)
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != False:
+ set_error()
+ except:
+ set_error()
+ try:
+ ret = pkt.rr("bad argument", rr)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+ try:
+ ret = pkt.rr(ldns.LDNS_SECTION_QUESTION, "bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".rr_list_by_name()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz", ldns.LDNS_RR_TYPE_A, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_QR | ldns.LDNS_RD)
+ rr = ldns.ldns_rr.new_frm_str("test1 600 IN A 0.0.0.0")
+ pkt.push_rr(ldns.LDNS_SECTION_ANSWER, rr)
+ rdf = ldns.ldns_rdf_new_frm_str(ldns.LDNS_RDF_TYPE_DNAME, "test1")
+ try:
+ ret = pkt.rr_list_by_name(rdf, ldns.LDNS_SECTION_ANSWER)
+ if not isinstance(ret, ldns.ldns_rr_list):
+ set_error()
+ except:
+ set_error()
+ try:
+ ret = pkt.rr_list_by_name(rdf, ldns.LDNS_SECTION_QUESTION)
+ if ret != None:
+ set_error()
+ except:
+ set_error()
+ try:
+ ret = pkt.rr_list_by_name("bad argument", ldns.LDNS_SECTION_ANSWER)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+ try:
+ ret = pkt.rr_list_by_name(rdf, "bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".rr_list_by_name_and_type()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz.", ldns.LDNS_RR_TYPE_A, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_QR | ldns.LDNS_RD)
+ rr = ldns.ldns_rr.new_frm_str("test1 600 IN A 0.0.0.0")
+ pkt.push_rr(ldns.LDNS_SECTION_ANSWER, rr)
+ rdf = ldns.ldns_rdf_new_frm_str(ldns.LDNS_RDF_TYPE_DNAME, "test1")
+ try:
+ ret = pkt.rr_list_by_name_and_type(rdf, ldns.LDNS_RR_TYPE_A, ldns.LDNS_SECTION_ANSWER)
+ if not isinstance(ret, ldns.ldns_rr_list):
+ set_error()
+ except:
+ set_error()
+ try:
+ ret = pkt.rr_list_by_name_and_type(rdf, ldns.LDNS_RR_TYPE_AAAA, ldns.LDNS_SECTION_ANSWER)
+ if ret != None:
+ set_error()
+ except:
+ set_error()
+ #try:
+ # ret = pkt.rr_list_by_name_and_type("bad argument", ldns.LDNS_RR_TYPE_A, ldns.LDNS_SECTION_ANSWER)
+ # set_error()
+ #except TypeError as e:
+ # pass
+ #except:
+ # set_error()
+ try:
+ ret = pkt.rr_list_by_name_and_type(rdf, "bad argument", ldns.LDNS_SECTION_ANSWER)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+ try:
+ ret = pkt.rr_list_by_name_and_type(rdf, ldns.LDNS_RR_TYPE_A, "bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".rr_list_by_type()"
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz.", ldns.LDNS_RR_TYPE_A, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_QR | ldns.LDNS_RD)
+ rr = ldns.ldns_rr.new_frm_str("test1 600 IN A 0.0.0.0")
+ pkt.push_rr(ldns.LDNS_SECTION_ANSWER, rr)
+ try:
+ ret = pkt.rr_list_by_type(ldns.LDNS_RR_TYPE_A, ldns.LDNS_SECTION_ANSWER)
+ if not isinstance(ret, ldns.ldns_rr_list):
+ set_error()
+ except:
+ set_error()
+ try:
+ ret = pkt.rr_list_by_type(ldns.LDNS_RR_TYPE_AAAA, ldns.LDNS_SECTION_ANSWER)
+ if ret != None:
+ set_error()
+ except:
+ set_error()
+ try:
+ ret = pkt.rr_list_by_type("bad argument", ldns.LDNS_SECTION_ANSWER)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+ try:
+ ret = pkt.rr_list_by_type(ldns.LDNS_RR_TYPE_A, "bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".safe_push_rr()"
+ pkt = ldns.ldns_pkt.new()
+ rr = ldns.ldns_rr.new_frm_str("test1 600 IN A 0.0.0.0")
+ try:
+ ret = pkt.safe_push_rr(ldns.LDNS_SECTION_ANSWER, rr)
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != True:
+ set_error()
+ except:
+ set_error()
+ try:
+ ret = pkt.safe_push_rr(ldns.LDNS_SECTION_ANSWER, rr)
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != False:
+ set_error()
+ except:
+ set_error()
+ try:
+ ret = pkt.safe_push_rr("bad argument", rr)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+ try:
+ ret = pkt.safe_push_rr(ldns.LDNS_SECTION_ANSWER, "bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".safe_push_rr_list()"
+ pkt = ldns.ldns_pkt.new()
+ rrl = ldns.ldns_rr_list.new()
+ rr = ldns.ldns_rr.new_frm_str("test1 600 IN A 0.0.0.0")
+ rrl.push_rr(rr)
+ try:
+ ret = pkt.safe_push_rr_list(ldns.LDNS_SECTION_ANSWER, rrl)
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != True:
+ set_error()
+ except:
+ set_error()
+ try:
+ ret = pkt.safe_push_rr_list(ldns.LDNS_SECTION_ANSWER, rrl)
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != False:
+ set_error()
+ except:
+ set_error()
+ try:
+ ret = pkt.safe_push_rr_list("bad argument", rrl)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+ try:
+ ret = pkt.safe_push_rr_list(ldns.LDNS_SECTION_ANSWER, "bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_aa()"
+ pkt = ldns.ldns_pkt.new()
+ try:
+ pkt.set_aa(True)
+ if pkt.aa() != True:
+ set_error()
+ except:
+ set_error()
+ try:
+ pkt.set_aa(False)
+ if pkt.aa() != False:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_ad()"
+ pkt = ldns.ldns_pkt.new()
+ try:
+ pkt.set_ad(True)
+ if pkt.ad() != True:
+ set_error()
+ except:
+ set_error()
+ try:
+ pkt.set_ad(False)
+ if pkt.ad() != False:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_additional()"
+ pkt = ldns.ldns_pkt.new()
+ rrl = ldns.ldns_rr_list.new()
+ rr = ldns.ldns_rr.new_frm_str("test1 600 IN A 0.0.0.0")
+ rrl.push_rr(rr)
+ try:
+ pkt.set_additional(rrl)
+ if not isinstance(pkt.additional() , ldns.ldns_rr_list):
+ set_error()
+ if pkt.additional() != rrl:
+ set_error()
+ except:
+ set_error()
+ try:
+ pkt.set_additional("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_ancount()"
+ pkt = ldns.ldns_pkt.new()
+ try:
+ pkt.set_ancount(1)
+ ret = pkt.ancount()
+ if ret != 1:
+ set_error()
+ except:
+ set_error()
+ try:
+ pkt.set_ancount("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_answer()"
+ pkt = ldns.ldns_pkt.new()
+ rrl = ldns.ldns_rr_list.new()
+ rr = ldns.ldns_rr.new_frm_str("test1 600 IN A 0.0.0.0")
+ rrl.push_rr(rr)
+ try:
+ pkt.set_answer(rrl)
+ if not isinstance(pkt.additional() , ldns.ldns_rr_list):
+ set_error()
+ if pkt.answer() != rrl:
+ set_error()
+ except:
+ set_error()
+ try:
+ pkt.set_answer("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_answerfrom()"
+ pkt = ldns.ldns_pkt.new()
+ rdf = ldns.ldns_rdf_new_frm_str(ldns.LDNS_RDF_TYPE_A, "127.0.0.1")
+ try:
+ pkt.set_answerfrom(rdf)
+ ret = pkt.answerfrom()
+ if ret != rdf:
+ set_error()
+ except:
+ set_error()
+ try:
+ pkt.set_answerfrom("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_arcount()"
+ pkt = ldns.ldns_pkt.new()
+ try:
+ pkt.set_arcount(1)
+ ret = pkt.arcount()
+ if ret != 1:
+ set_error()
+ except:
+ set_error()
+ try:
+ pkt.set_arcount("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_authority()"
+ pkt = ldns.ldns_pkt.new()
+ rrl = ldns.ldns_rr_list.new()
+ rr = ldns.ldns_rr.new_frm_str("test1 600 IN A 0.0.0.0")
+ rrl.push_rr(rr)
+ try:
+ pkt.set_authority(rrl)
+ if not isinstance(pkt.additional() , ldns.ldns_rr_list):
+ set_error()
+ if pkt.authority() != rrl:
+ set_error()
+ except:
+ set_error()
+ try:
+ pkt.set_authority("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_cd()"
+ pkt = ldns.ldns_pkt.new()
+ try:
+ pkt.set_cd(True)
+ if pkt.cd() != True:
+ set_error()
+ except:
+ set_error()
+ try:
+ pkt.set_cd(False)
+ if pkt.cd() != False:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_edns_data()"
+ pkt = ldns.ldns_pkt.new()
+ rdf = ldns.ldns_rdf_new_frm_str(ldns.LDNS_RDF_TYPE_A, "127.0.0.1")
+ try:
+ pkt.set_edns_data(rdf)
+ ret = pkt.edns_data()
+ if ret != rdf:
+ set_error()
+ except:
+ set_error()
+ try:
+ pkt.set_edns_data("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_edns_do()"
+ pkt = ldns.ldns_pkt.new()
+ try:
+ pkt.set_edns_do(True)
+ if pkt.edns_do() != True:
+ set_error()
+ except:
+ set_error()
+ try:
+ pkt.set_edns_do(False)
+ if pkt.edns_do() != False:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_edns_extended_rcode()"
+ pkt = ldns.ldns_pkt.new()
+ try:
+ pkt.set_edns_extended_rcode(8)
+ ret = pkt.edns_extended_rcode()
+ if ret != 8:
+ set_error()
+ except:
+ set_error()
+ try:
+ pkt.set_edns_extended_rcode("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_edns_udp_size()"
+ pkt = ldns.ldns_pkt.new()
+ try:
+ pkt.set_edns_udp_size(4096)
+ ret = pkt.edns_udp_size()
+ if ret != 4096:
+ set_error()
+ except:
+ set_error()
+ try:
+ pkt.set_edns_udp_size("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_edns_version()"
+ pkt = ldns.ldns_pkt.new()
+ try:
+ pkt.set_edns_version(8)
+ ret = pkt.edns_version()
+ if ret != 8:
+ set_error()
+ except:
+ set_error()
+ try:
+ pkt.set_edns_version("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_edns_z()"
+ pkt = ldns.ldns_pkt.new()
+ try:
+ pkt.set_edns_z(4096)
+ ret = pkt.edns_z()
+ if ret != 4096:
+ set_error()
+ except:
+ set_error()
+ try:
+ pkt.set_edns_z("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_flags()"
+ pkt = ldns.ldns_pkt.new()
+ try:
+ ret = pkt.set_flags(ldns.LDNS_AA | ldns.LDNS_AD)
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != True:
+ set_error()
+ except:
+ set_error()
+ try:
+ pkt.set_flags("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_id()"
+ pkt = ldns.ldns_pkt.new()
+ try:
+ pkt.set_id(4096)
+ ret = pkt.id()
+ if ret != 4096:
+ set_error()
+ except:
+ set_error()
+ try:
+ pkt.set_id("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_nscount()"
+ pkt = ldns.ldns_pkt.new()
+ try:
+ pkt.set_nscount(1)
+ ret = pkt.nscount()
+ if ret != 1:
+ set_error()
+ except:
+ set_error()
+ try:
+ pkt.set_nscount("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_opcode()"
+ pkt = ldns.ldns_pkt.new()
+ try:
+ pkt.set_opcode(ldns.LDNS_PACKET_QUERY)
+ ret = pkt.get_opcode()
+ if ret != ldns.LDNS_PACKET_QUERY:
+ set_error()
+ except:
+ set_error()
+ try:
+ pkt.set_opcode("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_qdcount()"
+ pkt = ldns.ldns_pkt.new()
+ try:
+ pkt.set_qdcount(10)
+ ret = pkt.qdcount()
+ if ret != 10:
+ set_error()
+ except:
+ set_error()
+ try:
+ pkt.set_qdcount("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_qr()"
+ pkt = ldns.ldns_pkt.new()
+ try:
+ pkt.set_qr(True)
+ if pkt.qr() != True:
+ set_error()
+ except:
+ set_error()
+ try:
+ pkt.set_qr(False)
+ if pkt.qr() != False:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_querytime()"
+ pkt = ldns.ldns_pkt.new()
+ try:
+ pkt.set_querytime(65536)
+ ret = pkt.querytime()
+ if ret != 65536:
+ set_error()
+ except:
+ set_error()
+ try:
+ pkt.set_querytime("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_question()"
+ pkt = ldns.ldns_pkt.new()
+ rrl = ldns.ldns_rr_list.new()
+ rr = ldns.ldns_rr.new_frm_str("test1 600 IN A 0.0.0.0")
+ rrl.push_rr(rr)
+ try:
+ pkt.set_question(rrl)
+ if not isinstance(pkt.additional() , ldns.ldns_rr_list):
+ set_error()
+ if pkt.question() != rrl:
+ set_error()
+ except:
+ set_error()
+ try:
+ pkt.set_question("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_ra()"
+ pkt = ldns.ldns_pkt.new()
+ try:
+ pkt.set_ra(True)
+ if pkt.ra() != True:
+ set_error()
+ except:
+ set_error()
+ try:
+ pkt.set_ra(False)
+ if pkt.ra() != False:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_random_id()"
+ pkt = ldns.ldns_pkt.new()
+ try:
+ pkt.set_random_id()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_rcode()"
+ pkt = ldns.ldns_pkt.new()
+ try:
+ pkt.set_rcode(127)
+ ret = pkt.get_rcode()
+ if ret != 127:
+ set_error()
+ except:
+ set_error()
+ try:
+ pkt.set_rcode("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_rd()"
+ pkt = ldns.ldns_pkt.new()
+ try:
+ pkt.set_rd(True)
+ if pkt.rd() != True:
+ set_error()
+ except:
+ set_error()
+ try:
+ pkt.set_rd(False)
+ if pkt.rd() != False:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_section_count()"
+ pkt = ldns.ldns_pkt.new()
+ try:
+ pkt.set_section_count(ldns.LDNS_PACKET_QUESTION, 4096)
+ ret = pkt.qdcount()
+ if ret != 4096:
+ set_error()
+ except:
+ set_error()
+ try:
+ pkt.set_section_count("bad argument", 4096)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+ try:
+ pkt.set_section_count(ldns.LDNS_PACKET_QUESTION, "bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_size()"
+ pkt = ldns.ldns_pkt.new()
+ try:
+ pkt.set_size(512)
+ ret = pkt.size()
+ if ret != 512:
+ set_error()
+ except:
+ set_error()
+ try:
+ pkt.set_size("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_tc()"
+ pkt = ldns.ldns_pkt.new()
+ try:
+ pkt.set_tc(True)
+ if pkt.tc() != True:
+ set_error()
+ except:
+ set_error()
+ try:
+ pkt.set_tc(False)
+ if pkt.tc() != False:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_timestamp()"
+ sys.stderr.write("%s not tested.\n" % (method_name))
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_tsig()"
+ pkt = ldns.ldns_pkt.new()
+ rr = ldns.ldns_rr.new_frm_str("test1 600 IN A 0.0.0.0")
+ try:
+ pkt.set_tsig(rr)
+ ret = pkt.tsig()
+ if ret != rr:
+ set_error()
+ except:
+ set_error()
+ try:
+ pkt.set_tsig("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".size()"
+ pkt = ldns.ldns_pkt.new()
+ pkt.set_size(512)
+ try:
+ ret = pkt.size()
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
+ set_error()
+ if ret != 512:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".tc()"
+ pkt = ldns.ldns_pkt.new()
+ pkt.set_tc(True)
+ try:
+ ret = pkt.tc()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != True:
+ set_error()
+ except:
+ set_error()
+ pkt.set_tc(False)
+ try:
+ ret = pkt.tc()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != False:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".timestamp()"
+ sys.stderr.write("%s not tested.\n" % (method_name))
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".tsig()"
+ pkt = ldns.ldns_pkt.new()
+ try:
+ ret = pkt.tsig()
+ if ret != None:
+ set_error()
+ except:
+ set_error()
+ rr = ldns.ldns_rr.new_frm_str("test1 600 IN A 0.0.0.0")
+ pkt.set_tsig(rr)
+ try:
+ ret = pkt.tsig()
+ if not isinstance(ret, ldns.ldns_rr):
+ set_error()
+ if ret != rr:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".update_pkt_tsig_add()"
+ pkt = ldns.ldns_pkt.new()
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ try:
+ ret = pkt.update_pkt_tsig_add(resolver)
+ if ret != ldns.LDNS_STATUS_OK:
+ set_error()
+ except:
+ set_error()
+ try:
+ ret = pkt.update_pkt_tsig_add("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".update_prcount()"
+ pkt = ldns.ldns_pkt.new()
+ try:
+ ret = pkt.update_prcount()
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
+ set_error()
+ if ret != 0:
+ set_error()
+ except:
+ set_error()
+ pkt.update_set_prcount(127)
+ try:
+ ret = pkt.update_prcount()
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
+ set_error()
+ if ret != 127:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".update_set_adcount()"
+ pkt = ldns.ldns_pkt.new()
+ try:
+ pkt.update_set_adcount(4096)
+ ret = pkt.update_ad()
+ if ret != 4096:
+ set_error()
+ except:
+ set_error()
+ try:
+ pkt.update_set_adcount("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".update_set_prcount()"
+ pkt = ldns.ldns_pkt.new()
+ try:
+ pkt.update_set_prcount(4096)
+ ret = pkt.update_prcount()
+ if ret != 4096:
+ set_error()
+ except:
+ set_error()
+ try:
+ pkt.update_set_prcount("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".update_set_upcount()"
+ pkt = ldns.ldns_pkt.new()
+ try:
+ pkt.update_set_upcount(4096)
+ ret = pkt.update_upcount()
+ if ret != 4096:
+ set_error()
+ except:
+ set_error()
+ try:
+ pkt.update_set_upcount("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".update_set_zo()"
+ pkt = ldns.ldns_pkt.new()
+ try:
+ pkt.update_set_zo(4096)
+ ret = pkt.update_zocount()
+ if ret != 4096:
+ set_error()
+ except:
+ set_error()
+ try:
+ pkt.update_set_zo("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".update_upcount()"
+ pkt = ldns.ldns_pkt.new()
+ try:
+ ret = pkt.update_upcount()
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
+ set_error()
+ if ret != 0:
+ set_error()
+ except:
+ set_error()
+ pkt.update_set_upcount(127)
+ try:
+ ret = pkt.update_upcount()
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
+ set_error()
+ if ret != 127:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".update_zocount()"
+ pkt = ldns.ldns_pkt.new()
+ try:
+ ret = pkt.update_zocount()
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
+ set_error()
+ if ret != 0:
+ set_error()
+ except:
+ set_error()
+ pkt.update_set_zo(127)
+ try:
+ ret = pkt.update_zocount()
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
+ set_error()
+ if ret != 127:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".write_to_buffer()"
+ pkt = pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_QR | ldns.LDNS_AA)
+ buf = buf = ldns.ldns_buffer(4096)
+ try:
+ ret = pkt.write_to_buffer(buf)
+ if ret != ldns.LDNS_STATUS_OK:
+ set_error()
+ except:
+ set_error()
+
+
+if not error_detected:
+ sys.stdout.write("%s: passed.\n" % (os.path.basename(__file__)))
+else:
+ sys.stdout.write("%s: errors detected.\n" % (os.path.basename(__file__)))
+ sys.exit(1)
diff --git a/contrib/python/examples/test_rdf.py b/contrib/python/examples/test_rdf.py
index 4991288c83f2..2e2b73b6b751 100755
--- a/contrib/python/examples/test_rdf.py
+++ b/contrib/python/examples/test_rdf.py
@@ -408,6 +408,20 @@ if True:
#if not error_detected:
if True:
+ method_name = "ldns_rdf.data_as_bytearray()"
+ rdf = ldns.ldns_rdf_new_frm_str(ldns.LDNS_RDF_TYPE_DNAME, "www.nic.cz.")
+ try:
+ ret = rdf.data_as_bytearray()
+ if not isinstance(ret, bytearray):
+ set_error()
+ if len(ret) != 12:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
method_name = "ldns_rdf.dname_compare()"
rdf1 = ldns.ldns_rdf_new_frm_str(ldns.LDNS_RDF_TYPE_DNAME, "www.nic.cz.")
rdf2 = ldns.ldns_rdf_new_frm_str(ldns.LDNS_RDF_TYPE_DNAME, "nic.cz.")
@@ -602,7 +616,7 @@ if True:
rdf = ldns.ldns_rdf_new_frm_str(ldns.LDNS_RDF_TYPE_DNAME, "www.nic.cz.")
try:
ret = rdf.label_count()
- if not isinstance(ret, int):
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
set_error()
if ret != 3:
set_error()
@@ -611,7 +625,7 @@ if True:
rdf = ldns.ldns_rdf_new_frm_str(ldns.LDNS_RDF_TYPE_A, "127.0.0.1")
try:
ret = rdf.label_count()
- if not isinstance(ret, int):
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
set_error()
if ret != 0:
set_error()
@@ -720,8 +734,9 @@ if True:
rdf = ldns.ldns_rdf_new_frm_str(ldns.LDNS_RDF_TYPE_A, "127.0.0.1")
try:
ret = rdf.reverse()
- if not isinstance(ret, ldns.ldns_rdf):
- set_error()
+ set_error()
+ except Exception:
+ pass
except:
set_error()
diff --git a/contrib/python/examples/test_resolver.py b/contrib/python/examples/test_resolver.py
new file mode 100755
index 000000000000..274a4d87364f
--- /dev/null
+++ b/contrib/python/examples/test_resolver.py
@@ -0,0 +1,1751 @@
+#!/usr/bin/env python
+
+#
+# ldns_resolver testing script.
+#
+# Do not use constructs that differ between Python 2 and 3.
+# Use write on stdout or stderr.
+#
+
+
+import ldns
+import sys
+import os
+import inspect
+
+
+class_name = "ldns_resolver"
+method_name = None
+error_detected = False
+temp_fname = "tmp_resolver.txt"
+
+
+def set_error():
+ """
+ Writes an error message and sets error flag.
+ """
+ global class_name
+ global method_name
+ global error_detected
+ error_detected = True
+ sys.stderr.write("(line %d): malfunctioning method %s.\n" % \
+ (inspect.currentframe().f_back.f_lineno, method_name))
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".axfr_complete()"
+ sys.stderr.write("%s not tested.\n" % (method_name))
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".axfr_last_pkt()"
+ sys.stderr.write("%s not tested.\n" % (method_name))
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".axfr_next()"
+ sys.stderr.write("%s not tested.\n" % (method_name))
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".axfr_start()"
+ sys.stderr.write("%s not tested.\n" % (method_name))
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".debug()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ resolver.set_debug(False)
+ try:
+ ret = resolver.debug()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != False:
+ set_error()
+ except:
+ set_error()
+ resolver.set_debug(True)
+ try:
+ ret = resolver.debug()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != True:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".dec_nameserver_count()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ cnt = resolver.nameserver_count()
+ try:
+ resolver.dec_nameserver_count()
+ except:
+ set_error()
+ if cnt != (resolver.nameserver_count() + 1):
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".defnames()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ resolver.set_defnames(False)
+ try:
+ ret = resolver.defnames()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != False:
+ set_error()
+ except:
+ set_error()
+ resolver.set_defnames(True)
+ try:
+ ret = resolver.defnames()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != True:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".dnsrch()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ resolver.set_dnsrch(False)
+ try:
+ ret = resolver.dnsrch()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != False:
+ set_error()
+ except:
+ set_error()
+ resolver.set_dnsrch(True)
+ try:
+ ret = resolver.dnsrch()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != True:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".dnssec()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ resolver.set_dnssec(False)
+ try:
+ ret = resolver.dnssec()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != False:
+ set_error()
+ except:
+ set_error()
+ resolver.set_dnssec(True)
+ try:
+ ret = resolver.dnssec()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != True:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".dnssec_anchors()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ rrl = ldns.ldns_rr_list.new()
+ try:
+ ret = resolver.dnssec_anchors()
+ if ret != None:
+ set_error()
+ except:
+ set_error()
+ resolver.set_dnssec_anchors(rrl)
+ try:
+ ret = resolver.dnssec_anchors()
+ if not isinstance(ret, ldns.ldns_rr_list):
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".dnssec_cd()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ resolver.set_dnssec_cd(False)
+ try:
+ ret = resolver.dnssec_cd()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != False:
+ set_error()
+ except:
+ set_error()
+ resolver.set_dnssec_cd(True)
+ try:
+ ret = resolver.dnssec_cd()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != True:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".domain()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ resolver.set_domain(None)
+ try:
+ ret = resolver.domain()
+ if ret != None:
+ set_error()
+ except:
+ set_error()
+ dname = ldns.ldns_dname("example.com.")
+ resolver.set_domain(dname)
+ try:
+ ret = resolver.domain()
+ if not isinstance(ret, ldns.ldns_dname):
+ set_error()
+ if ret != dname:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".edns_udp_size()"
+ try:
+ resolver = ldns.ldns_resolver.new()
+ if not isinstance(resolver, ldns.ldns_resolver):
+ set_error()
+ except:
+ set_error()
+
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".edns_udp_size()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ resolver.set_edns_udp_size(4096)
+ try:
+ ret = resolver.edns_udp_size()
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
+ set_error()
+ if ret != 4096:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".fail()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ resolver.set_fail(False)
+ try:
+ ret = resolver.fail()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != False:
+ set_error()
+ except:
+ set_error()
+ resolver.set_fail(True)
+ try:
+ ret = resolver.fail()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != True:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".fallback()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ resolver.set_fallback(False)
+ try:
+ ret = resolver.fallback()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != False:
+ set_error()
+ except:
+ set_error()
+ resolver.set_fallback(True)
+ try:
+ ret = resolver.fallback()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != True:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".get_addr_by_name()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ try:
+ ret = resolver.get_addr_by_name("www.google.com", ldns.LDNS_RR_CLASS_IN, ldns.LDNS_RD)
+ if not isinstance(ret, ldns.ldns_rr_list):
+ set_error()
+ except:
+ set_error()
+ try:
+ ret = resolver.get_addr_by_name(1, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_RD)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+ try:
+ ret = resolver.get_addr_by_name("www.google.com", "bad argument", ldns.LDNS_RD)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+ try:
+ ret = resolver.get_addr_by_name("www.google.com", ldns.LDNS_RR_CLASS_IN, "bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".get_name_by_addr()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ try:
+ addr = resolver.get_name_by_addr("8.8.8.8", ldns.LDNS_RR_CLASS_IN, ldns.LDNS_RD)
+ if not isinstance(addr, ldns.ldns_rr_list):
+ set_error()
+ except:
+ set_error()
+ try:
+ addr = resolver.get_name_by_addr(1, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_RD)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+ try:
+ addr = resolver.get_name_by_addr("8.8.8.8", "bad argument", ldns.LDNS_RD)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+ try:
+ addr = resolver.get_name_by_addr("8.8.8.8", ldns.LDNS_RR_CLASS_IN, "bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".igntc()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ resolver.set_igntc(False)
+ try:
+ ret = resolver.igntc()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != False:
+ set_error()
+ except:
+ set_error()
+ resolver.set_igntc(True)
+ try:
+ ret = resolver.igntc()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != True:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".incr_nameserver_count()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ cnt = resolver.nameserver_count()
+ try:
+ resolver.incr_nameserver_count()
+ except:
+ set_error()
+ if (cnt + 1) != resolver.nameserver_count():
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".ip6()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ resolver.set_ip6(0)
+ try:
+ ret = resolver.ip6()
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
+ set_error()
+ if ret != 0:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".nameserver_count()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ resolver.set_nameserver_count(1)
+ try:
+ ret = resolver.nameserver_count()
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
+ set_error()
+ if ret != 1:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".nameserver_rtt()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ num = resolver.nameserver_count()
+ for i in range(0, num):
+ resolver.set_nameserver_rtt(i, i + 1)
+ try:
+ for i in range(0, num):
+ ret = resolver.nameserver_rtt(i)
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
+ set_error()
+ if (i + 1) != ret:
+ set_error()
+ except:
+ set_error()
+ try:
+ ret = resolver.nameserver_rtt("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".nameservers()"
+ sys.stderr.write("%s not tested.\n" % (method_name))
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".nameservers_randomize()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ try:
+ resolver.nameservers_randomize()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".new_frm_file()"
+ try:
+ ret = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf", raiseException=True)
+ if not isinstance(ret, ldns.ldns_resolver):
+ set_error()
+ except:
+ set_error()
+ try:
+ ret = ldns.ldns_resolver.new_frm_file(1, raiseException=True)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".new_frm_fp()"
+ fi = open("/etc/resolv.conf")
+ try:
+ ret = ldns.ldns_resolver.new_frm_fp(fi, raiseException=True)
+ if not isinstance(ret, ldns.ldns_resolver):
+ set_error()
+ except:
+ set_error()
+ fi.close()
+ try:
+ ret = ldns.ldns_resolver.new_frm_fp(1, raiseException=True)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".new_frm_fp_l()"
+ fi = open("/etc/resolv.conf")
+ try:
+ ret, line = ldns.ldns_resolver.new_frm_fp_l(fi, raiseException=True)
+ if not isinstance(ret, ldns.ldns_resolver):
+ set_error()
+ if (not isinstance(line, int)) and (not isinstance(line, long)):
+ set_error()
+ except:
+ set_error()
+ fi.close()
+ try:
+ ret, line = ldns.ldns_resolver.new_frm_fp_l(1, raiseException=True)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".pop_nameserver()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ cnt = resolver.nameserver_count()
+ try:
+ for i in range(0, cnt):
+ ret = resolver.pop_nameserver()
+ if not isinstance(ret, ldns.ldns_rdf):
+ set_error()
+ except:
+ set_error()
+ try:
+ ret = resolver.pop_nameserver()
+ if ret != None:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".port()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ resolver.set_port(12345)
+ try:
+ ret = resolver.port()
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
+ set_error()
+ if ret != 12345:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".prepare_query_pkt()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ try:
+ ret = resolver.prepare_query_pkt("example.com.", ldns.LDNS_RR_TYPE_A, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_RD, raiseException=True)
+ if not isinstance(ret, ldns.ldns_pkt):
+ set_error()
+ except:
+ set_error()
+ try:
+ ret = resolver.prepare_query_pkt(1, ldns.LDNS_RR_TYPE_A, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_RD, raiseException=True)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+ try:
+ ret = resolver.prepare_query_pkt("example.com.", "bad argument", ldns.LDNS_RR_CLASS_IN, ldns.LDNS_RD, raiseException=True)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+ try:
+ ret = resolver.prepare_query_pkt("example.com.", ldns.LDNS_RR_TYPE_A, "bad argument", ldns.LDNS_RD, raiseException=True)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+ try:
+ ret = resolver.prepare_query_pkt("example.com.", ldns.LDNS_RR_TYPE_A, ldns.LDNS_RR_CLASS_IN, "bad argument", raiseException=True)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".push_dnssec_anchor()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ key = ldns.ldns_key.new_frm_algorithm(ldns.LDNS_SIGN_DSA, 512)
+ domain = ldns.ldns_dname("example.")
+ key.set_pubkey_owner(domain)
+ pubkey = key.key_to_rr()
+ ds = ldns.ldns_key_rr2ds(pubkey, ldns.LDNS_SHA1)
+ try:
+ ret = resolver.push_dnssec_anchor(ds)
+ if ret != ldns.LDNS_STATUS_OK:
+ set_error()
+ except:
+ set_error()
+ rr = ldns.ldns_rr.new_frm_str("test1 600 IN A 0.0.0.0")
+ try:
+ ret = resolver.push_dnssec_anchor(rr)
+ if ret == ldns.LDNS_STATUS_OK:
+ set_error()
+ except:
+ set_error()
+ try:
+ ret = resolver.push_dnssec_anchor("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".push_nameserver()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ rdf = ldns.ldns_rdf.new_frm_str("127.0.0.1", ldns.LDNS_RDF_TYPE_A)
+ try:
+ ret = resolver.push_nameserver(rdf)
+ if ret != ldns.LDNS_STATUS_OK:
+ set_error()
+ except:
+ set_error()
+ rdf = ldns.ldns_rdf.new_frm_str("::1", ldns.LDNS_RDF_TYPE_AAAA)
+ try:
+ ret = resolver.push_nameserver(rdf)
+ if ret != ldns.LDNS_STATUS_OK:
+ set_error()
+ except:
+ set_error()
+ rdf = ldns.ldns_rdf.new_frm_str("example.com.", ldns.LDNS_RDF_TYPE_DNAME)
+ try:
+ ret = resolver.push_nameserver(rdf)
+ if ret == ldns.LDNS_STATUS_OK:
+ set_error()
+ except:
+ set_error()
+ try:
+ ret = resolver.push_nameserver("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".push_nameserver_rr()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ rr = ldns.ldns_rr.new_frm_str("test 600 IN A 127.0.0.1")
+ try:
+ ret = resolver.push_nameserver_rr(rr)
+ if ret != ldns.LDNS_STATUS_OK:
+ set_error()
+ except:
+ set_error()
+ rr = ldns.ldns_rr.new_frm_str("test 600 IN AAAA ::1")
+ try:
+ ret = resolver.push_nameserver_rr(rr)
+ if ret != ldns.LDNS_STATUS_OK:
+ set_error()
+ except:
+ set_error()
+ rr = ldns.ldns_rr.new_frm_str("test 600 IN NS 8.8.8.8")
+ try:
+ ret = resolver.push_nameserver_rr(rr)
+ if ret == ldns.LDNS_STATUS_OK:
+ set_error()
+ except:
+ set_error()
+ try:
+ ret = resolver.push_nameserver_rr("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".push_nameserver_rr_list()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ rrl = ldns.ldns_rr_list.new()
+ rr = ldns.ldns_rr.new_frm_str("test 600 IN A 127.0.0.1")
+ rrl.push_rr(rr)
+ try:
+ ret = resolver.push_nameserver_rr_list(rrl)
+ if ret != ldns.LDNS_STATUS_OK:
+ set_error()
+ except:
+ set_error()
+ rrl = ldns.ldns_rr_list.new()
+ rr = ldns.ldns_rr.new_frm_str("test 600 IN AAAA ::1")
+ rrl.push_rr(rr)
+ try:
+ ret = resolver.push_nameserver_rr_list(rrl)
+ if ret != ldns.LDNS_STATUS_OK:
+ set_error()
+ except:
+ set_error()
+ rrl = ldns.ldns_rr_list.new()
+ rr = ldns.ldns_rr.new_frm_str("test 600 IN NS 8.8.8.8")
+ rrl.push_rr(rr)
+ try:
+ ret = resolver.push_nameserver_rr_list(rrl)
+ if ret == ldns.LDNS_STATUS_OK:
+ set_error()
+ except:
+ set_error()
+ try:
+ ret = resolver.push_nameserver_rr_list("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".push_searchlist()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ resolver.push_searchlist("example.com.")
+ try:
+ resolver.push_searchlist("example.com.")
+ except:
+ set_error()
+ try:
+ resolver.push_searchlist(1)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".query()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ try:
+ ret = resolver.query("www.nic.cz", ldns.LDNS_RR_TYPE_A, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_RD)
+ if not isinstance(ret, ldns.ldns_pkt):
+ set_error()
+ except:
+ set_error()
+ try:
+ ret = resolver.query(1, ldns.LDNS_RR_TYPE_A, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_RD)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+ try:
+ ret = resolver.query("www.nic.cz", "bad argument", ldns.LDNS_RR_CLASS_IN, ldns.LDNS_RD)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+ try:
+ ret = resolver.query("www.nic.cz", ldns.LDNS_RR_TYPE_A, "bad argument", ldns.LDNS_RD)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+ try:
+ ret = resolver.query("www.nic.cz", ldns.LDNS_RR_TYPE_A, ldns.LDNS_RR_CLASS_IN, "bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".random()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ resolver.set_random(False)
+ try:
+ ret = resolver.random()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != False:
+ set_error()
+ except:
+ set_error()
+ resolver.set_random(True)
+ try:
+ ret = resolver.random()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != True:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".recursive()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ resolver.set_recursive(False)
+ try:
+ ret = resolver.recursive()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != False:
+ set_error()
+ except:
+ set_error()
+ resolver.set_recursive(True)
+ try:
+ ret = resolver.recursive()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != True:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".retrans()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ resolver.set_retrans(127)
+ try:
+ ret = resolver.retrans()
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
+ set_error()
+ if ret != 127:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".retry()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ resolver.set_retry(4)
+ try:
+ ret = resolver.retry()
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
+ set_error()
+ if ret != 4:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".rtt()"
+ sys.stderr.write("%s not tested.\n" % (method_name))
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".search()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ try:
+ ret = resolver.search("www.nic.cz", ldns.LDNS_RR_TYPE_A, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_RD)
+ if not isinstance(ret, ldns.ldns_pkt):
+ set_error()
+ except:
+ set_error()
+ try:
+ ret = resolver.search(1, ldns.LDNS_RR_TYPE_A, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_RD)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+ try:
+ ret = resolver.search("www.nic.cz", "bad argument", ldns.LDNS_RR_CLASS_IN, ldns.LDNS_RD)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+ try:
+ ret = resolver.search("www.nic.cz", ldns.LDNS_RR_TYPE_A, "bad argument", ldns.LDNS_RD)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+ try:
+ ret = resolver.search("www.nic.cz", ldns.LDNS_RR_TYPE_A, ldns.LDNS_RR_CLASS_IN, "bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".searchlist()"
+ sys.stderr.write("%s not tested.\n" % (method_name))
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".searchlist_count()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ try:
+ ret = resolver.searchlist_count()
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
+ set_error()
+ if ret != 0:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".send()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ try:
+ ret = resolver.send("www.nic.cz", ldns.LDNS_RR_TYPE_A, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_RD)
+ if not isinstance(ret, ldns.ldns_pkt):
+ set_error()
+ except:
+ set_error()
+ try:
+ ret = resolver.send(1, ldns.LDNS_RR_TYPE_A, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_RD)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+ try:
+ ret = resolver.send("www.nic.cz", "bad argument", ldns.LDNS_RR_CLASS_IN, ldns.LDNS_RD)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+ try:
+ ret = resolver.send("www.nic.cz", ldns.LDNS_RR_TYPE_A, "bad argument", ldns.LDNS_RD)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+ try:
+ ret = resolver.send("www.nic.cz", ldns.LDNS_RR_TYPE_A, ldns.LDNS_RR_CLASS_IN, "bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".send_pkt()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ pkt = ldns.ldns_pkt.new_query_frm_str("test.nic.cz",ldns.LDNS_RR_TYPE_ANY, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_RD | ldns.LDNS_AD)
+ try:
+ status, ret = resolver.send_pkt(pkt)
+ if status != ldns.LDNS_STATUS_OK:
+ ste_error()
+ if not isinstance(ret, ldns.ldns_pkt):
+ set_error()
+ except:
+ set_error()
+ try:
+ status, ret = resolver.send_pkt("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_debug()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ try:
+ resolver.set_debug(False)
+ ret = resolver.debug()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != False:
+ set_error()
+ except:
+ set_error()
+ try:
+ resolver.set_debug(True)
+ ret = resolver.debug()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != True:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_defnames()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ try:
+ resolver.set_defnames(False)
+ ret = resolver.defnames()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != False:
+ set_error()
+ except:
+ set_error()
+ try:
+ resolver.set_defnames(True)
+ ret = resolver.defnames()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != True:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_dnsrch()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ try:
+ resolver.set_dnsrch(False)
+ ret = resolver.dnsrch()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != False:
+ set_error()
+ except:
+ set_error()
+ try:
+ resolver.set_dnsrch(True)
+ ret = resolver.dnsrch()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != True:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_dnssec()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ try:
+ resolver.set_dnssec(False)
+ ret = resolver.dnssec()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != False:
+ set_error()
+ except:
+ set_error()
+ try:
+ resolver.set_dnssec(True)
+ ret = resolver.dnssec()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != True:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_dnssec_anchors()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ rrl = ldns.ldns_rr_list.new()
+ try:
+ resolver.set_dnssec_anchors(rrl)
+ ret = resolver.dnssec_anchors()
+ if not isinstance(ret, ldns.ldns_rr_list):
+ set_error()
+ except:
+ set_error()
+ try:
+ resolver.set_dnssec_anchors("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_dnssec_cd()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ try:
+ resolver.set_dnssec_cd(False)
+ ret = resolver.dnssec_cd()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != False:
+ set_error()
+ except:
+ set_error()
+ try:
+ resolver.set_dnssec_cd(True)
+ ret = resolver.dnssec_cd()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != True:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_domain()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ try:
+ resolver.set_domain(None)
+ ret = resolver.domain()
+ if ret != None:
+ set_error()
+ except:
+ set_error()
+ dname = ldns.ldns_dname("example.com.")
+ try:
+ resolver.set_domain(dname)
+ ret = resolver.domain()
+ if not isinstance(ret, ldns.ldns_dname):
+ set_error()
+ if ret != dname:
+ set_error()
+ except:
+ set_error()
+ rdf = ldns.ldns_rdf.new_frm_str("example.com.", ldns.LDNS_RDF_TYPE_DNAME)
+ try:
+ resolver.set_domain(rdf)
+ ret = resolver.domain()
+ if not isinstance(ret, ldns.ldns_rdf):
+ set_error()
+ if ret != dname:
+ set_error()
+ except:
+ set_error()
+ resolver.set_domain("example.com.")
+ try:
+ resolver.set_domain("example.com.")
+ ret = resolver.domain()
+ if not isinstance(ret, ldns.ldns_dname):
+ set_error()
+ if ret != dname:
+ set_error()
+ except:
+ set_error()
+ rdf = ldns.ldns_rdf.new_frm_str("127.0.0.1", ldns.LDNS_RDF_TYPE_A)
+ try:
+ resolver.set_domain(rdf)
+ set_error()
+ except Exception as e:
+ pass
+ except:
+ set_error()
+ try:
+ resolver.set_domain(1)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_edns_udp_size()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ try:
+ resolver.set_edns_udp_size(4096)
+ ret = resolver.edns_udp_size()
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
+ set_error()
+ if ret != 4096:
+ set_error()
+ except:
+ set_error()
+ try:
+ resolver.set_edns_udp_size("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ ste_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_fail()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ try:
+ resolver.set_fail(False)
+ ret = resolver.fail()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != False:
+ set_error()
+ except:
+ set_error()
+ try:
+ resolver.set_fail(True)
+ ret = resolver.fail()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != True:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_fallback()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ try:
+ resolver.set_fallback(False)
+ ret = resolver.fallback()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != False:
+ set_error()
+ except:
+ set_error()
+ try:
+ resolver.set_fallback(True)
+ ret = resolver.fallback()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != True:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_igntc()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ try:
+ resolver.set_igntc(False)
+ ret = resolver.igntc()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != False:
+ set_error()
+ except:
+ set_error()
+ try:
+ resolver.set_igntc(True)
+ ret = resolver.igntc()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != True:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_ip6()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ try:
+ resolver.set_ip6(1)
+ ret = resolver.ip6()
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
+ set_error()
+ if ret != 1:
+ set_error()
+ except:
+ set_error()
+ try:
+ resolver.set_ip6("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ ste_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_nameserver_count()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ try:
+ resolver.set_nameserver_count(2)
+ ret = resolver.nameserver_count()
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
+ set_error()
+ if ret != 2:
+ set_error()
+ except:
+ set_error()
+ try:
+ resolver.set_nameserver_count("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_nameserver_rtt()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ num = resolver.nameserver_count()
+ try:
+ for i in range(0, num):
+ resolver.set_nameserver_rtt(i, i + 1)
+ ret = resolver.nameserver_rtt(i)
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
+ set_error()
+ if (i + 1) != ret:
+ set_error()
+ except:
+ set_error()
+ try:
+ ret = resolver.set_nameserver_rtt("bad argument", 0)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+ try:
+ ret = resolver.set_nameserver_rtt(0, "bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_nameservers()"
+ sys.stderr.write("%s not tested.\n" % (method_name))
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_port()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ try:
+ resolver.set_port(12345)
+ ret = resolver.port()
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
+ set_error()
+ if ret != 12345:
+ set_error()
+ except:
+ set_error()
+ try:
+ resolver.set_port("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_random()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ try:
+ resolver.set_random(False)
+ ret = resolver.random()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != False:
+ set_error()
+ except:
+ set_error()
+ try:
+ resolver.set_random(True)
+ ret = resolver.random()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != True:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_recursive()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ try:
+ resolver.set_recursive(False)
+ ret = resolver.recursive()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != False:
+ set_error()
+ except:
+ set_error()
+ try:
+ resolver.set_recursive(True)
+ ret = resolver.recursive()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != True:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_retrans()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ try:
+ resolver.set_retrans(127)
+ ret = resolver.retrans()
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
+ set_error()
+ if ret != 127:
+ set_error()
+ except:
+ set_error()
+ try:
+ resolver.set_retrans("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_retry()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ try:
+ resolver.set_retry(4)
+ ret = resolver.retry()
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
+ set_error()
+ if ret != 4:
+ set_error()
+ except:
+ set_error()
+ try:
+ resolver.set_retry("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_rtt()"
+ sys.stderr.write("%s not tested.\n" % (method_name))
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_timeout()"
+ sys.stderr.write("%s not tested.\n" % (method_name))
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_tsig_algorithm()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ tsigstr = "hmac-md5.sig-alg.reg.int."
+ try:
+ resolver.set_tsig_algorithm(tsigstr)
+ ret = resolver.tsig_algorithm()
+ if not isinstance(ret, str):
+ set_error()
+ if ret != tsigstr:
+ set_error()
+ except:
+ set_error()
+ try:
+ resolver.set_tsig_algorithm(1)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_tsig_keydata()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ tkdstr = "Humpty Dumpty sat on a wall, Humpty Dumpty had a great fall, All the King's horses and all the King's men, Couldn't put Humpty together again."
+ try:
+ resolver.set_tsig_keydata(tkdstr)
+ ret = resolver.tsig_keydata()
+ if not isinstance(ret, str):
+ set_error()
+ if ret != tkdstr:
+ set_error()
+ except:
+ set_error()
+ try:
+ resolver.set_tsig_keydata(1)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_tsig_keyname()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ tknstr = "key 1"
+ try:
+ resolver.set_tsig_keyname(tknstr)
+ ret = resolver.tsig_keyname()
+ if not isinstance(ret, str):
+ set_error()
+ if ret != tknstr:
+ set_error()
+ except:
+ set_error()
+ try:
+ resolver.set_tsig_keyname(1)
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".set_usevc()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ try:
+ resolver.set_usevc(False)
+ ret = resolver.usevc()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != False:
+ set_error()
+ except:
+ set_error()
+ try:
+ resolver.set_usevc(True)
+ ret = resolver.usevc()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != True:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".timeout()"
+ sys.stderr.write("%s not tested.\n" % (method_name))
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".trusted_key()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ key = ldns.ldns_key.new_frm_algorithm(ldns.LDNS_SIGN_DSA, 512)
+ domain = ldns.ldns_dname("example.")
+ key.set_pubkey_owner(domain)
+ pubkey = key.key_to_rr()
+ ds = ldns.ldns_key_rr2ds(pubkey, ldns.LDNS_SHA1)
+ resolver.push_dnssec_anchor(ds)
+ rrl = ldns.ldns_rr_list.new()
+ try:
+ ret = resolver.trusted_key(rrl)
+ if ret != None:
+ set_error()
+ except:
+ set_error()
+ rrl.push_rr(ds)
+ ret = resolver.trusted_key(rrl)
+ try:
+ ret = resolver.trusted_key(rrl)
+ if not isinstance(ret, ldns.ldns_rr_list):
+ set_error()
+ if ret.rr_count() != 1:
+ set_error()
+ except:
+ set_error()
+ try:
+ ret = resolver.trusted_key("bad argument")
+ set_error()
+ except TypeError as e:
+ pass
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".tsig_algorithm()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ try:
+ ret = resolver.tsig_algorithm()
+ if ret != None:
+ set_error()
+ except:
+ set_error()
+ tsigstr = "hmac-md5.sig-alg.reg.int."
+ resolver.set_tsig_algorithm(tsigstr)
+ try:
+ ret = resolver.tsig_algorithm()
+ if not isinstance(ret, str):
+ set_error()
+ if ret != tsigstr:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".tsig_keydata()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ try:
+ ret = resolver.tsig_keydata()
+ if ret != None:
+ set_error()
+ except:
+ set_error()
+ tkdstr = "Twas brillig, and the slithy toves Did gyre and gimble in the wabe; All mimsy were the borogoves, And the mome raths outgrabe."
+ resolver.set_tsig_keydata(tkdstr)
+ try:
+ ret = resolver.tsig_keydata()
+ if not isinstance(ret, str):
+ set_error()
+ if ret != tkdstr:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".tsig_keyname()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ try:
+ ret = resolver.tsig_keyname()
+ if ret != None:
+ set_error()
+ except:
+ set_error()
+ tknstr = "key 2"
+ resolver.set_tsig_keyname(tknstr)
+ try:
+ ret = resolver.tsig_keyname()
+ if not isinstance(ret, str):
+ set_error()
+ if ret != tknstr:
+ set_error()
+ except:
+ set_error()
+
+
+#if not error_detected:
+if True:
+ method_name = class_name + ".usevc()"
+ resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
+ resolver.set_usevc(False)
+ try:
+ ret = resolver.usevc()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != False:
+ set_error()
+ except:
+ set_error()
+ resolver.set_usevc(True)
+ try:
+ ret = resolver.usevc()
+ if not isinstance(ret, bool):
+ set_error()
+ if ret != True:
+ set_error()
+ except:
+ set_error()
+
+
+if not error_detected:
+ sys.stdout.write("%s: passed.\n" % (os.path.basename(__file__)))
+else:
+ sys.stdout.write("%s: errors detected.\n" % (os.path.basename(__file__)))
+ sys.exit(1)
diff --git a/contrib/python/examples/test_rr.py b/contrib/python/examples/test_rr.py
index b7bc1e0d9717..07ba0e743073 100644
--- a/contrib/python/examples/test_rr.py
+++ b/contrib/python/examples/test_rr.py
@@ -385,7 +385,7 @@ if True:
pubkey = ldns.ldns_rr.new_frm_str("example1. 3600 IN DNSKEY 256 3 3 APw7tG8Nf7MYXjt2Y6DmyWUVxVy73bRKvKbKoGXhAXJx2vbcGGxfXsScT0i4FIC2wsJ/8zy/otB5vymm3JHBf2+7cQvRdp12UMLAnzlfrbgZUpvV36D+q6ch7kbmFzaBfwRjOKhnZkRLCcMYPAdX1SrgKVNXaOzAl9KytbzGQs5MKEHU+a0PAwKfIvEsS/+pW6gKgBnL0uy4Gr5cYJ5rk48iwFXOlZ/B30gUS5dD+rNRJuR0ZgEkxtVIPVxxhQPtEI53JhlJ2nEy0CqNW88nYLmX402b ;{id = 34898 (zsk), size = 512b}")
try:
ret = pubkey.dnskey_key_size()
- if not isinstance(ret, int):
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
set_error()
if ret != 512:
set_error()
@@ -394,7 +394,7 @@ if True:
rr = ldns.ldns_rr.new_frm_str("test 600 IN A 0.0.0.0")
try:
ret = rr.dnskey_key_size()
- if not isinstance(ret, int):
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
set_error()
if ret != 0:
set_error()
@@ -638,7 +638,7 @@ if True:
rr = ldns.ldns_rr.new_frm_str("test.dom. IN A 0.0.0.0", 600)
try:
ret = rr.label_count()
- if not isinstance(ret, int):
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
set_error()
if ret != 2:
set_error()
@@ -647,7 +647,7 @@ if True:
rr = ldns.ldns_rr.new_frm_str(". IN A 0.0.0.0", 600)
try:
ret = rr.label_count()
- if not isinstance(ret, int):
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
set_error(string)
if ret != 0:
set_error()
@@ -951,7 +951,7 @@ if True:
rr = ldns.ldns_rr.new_frm_str("test 600 IN A 0.0.0.0")
try:
ret = rr.rd_count()
- if not isinstance(ret, int):
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
set_error()
if ret != 1:
set_error()
@@ -1643,7 +1643,7 @@ if True:
rr = ldns.ldns_rr.new_frm_str("test 600 IN A 0.0.0.0")
try:
ret = rr.uncompressed_size()
- if not isinstance(ret, int):
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
set_error()
if ret != 20:
set_error()
@@ -1723,7 +1723,7 @@ if True:
desc_a = ldns.ldns_rr_descriptor.ldns_rr_descriptor(ldns.LDNS_RR_TYPE_A)
try:
ret = desc_a.maximum()
- if not isinstance(ret, int):
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
set_error()
if ret != 1:
set_error()
@@ -1737,7 +1737,7 @@ if True:
desc_a = ldns.ldns_rr_descriptor.ldns_rr_descriptor(ldns.LDNS_RR_TYPE_A)
try:
ret = desc_a.minimum()
- if not isinstance(ret, int):
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
set_error()
if ret != 1:
set_error()
@@ -2203,7 +2203,7 @@ if True:
rrl = ldns.ldns_rr_list.new()
try:
ret = rrl.rr_count()
- if not isinstance(ret, int):
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
set_error()
if ret != 0:
set_error()
@@ -2213,7 +2213,7 @@ if True:
rrl.push_rr(rr)
try:
ret = rrl.rr_count()
- if not isinstance(ret, int):
+ if (not isinstance(ret, int)) and (not isinstance(ret, long)):
set_error()
if ret != 1:
set_error()
diff --git a/contrib/python/ldns_packet.i b/contrib/python/ldns_packet.i
index 9316479f13b3..eeff4aa2359a 100644
--- a/contrib/python/ldns_packet.i
+++ b/contrib/python/ldns_packet.i
@@ -14,8 +14,8 @@
* 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.
+ * 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
@@ -28,17 +28,26 @@
* 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.
- ******************************************************************************/
+ *****************************************************************************/
+
+
+/* ========================================================================= */
+/* SWIG setting and definitions. */
+/* ========================================================================= */
+
+/* Creates a temporary instance of (ldns_pkt *). */
%typemap(in,numinputs=0,noblock=1) (ldns_pkt **)
{
- ldns_pkt *$1_pkt;
- $1 = &$1_pkt;
+ ldns_pkt *$1_pkt;
+ $1 = &$1_pkt;
}
-/* result generation */
+/* Result generation, appends (ldns_pkt *) after the result. */
%typemap(argout,noblock=1) (ldns_pkt **)
{
- $result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj(SWIG_as_voidptr($1_pkt), SWIGTYPE_p_ldns_struct_pkt, SWIG_POINTER_OWN | 0 ));
+ $result = SWIG_Python_AppendOutput($result,
+ SWIG_NewPointerObj(SWIG_as_voidptr($1_pkt),
+ SWIGTYPE_p_ldns_struct_pkt, SWIG_POINTER_OWN | 0 ));
}
%newobject ldns_pkt_new;
@@ -49,83 +58,322 @@
%newobject ldns_update_pkt_new;
-%nodefaultctor ldns_struct_pkt; //no default constructor & destructor
-%nodefaultdtor ldns_struct_pkt;
+%nodefaultctor ldns_struct_pkt; /* No default constructor. */
+%nodefaultdtor ldns_struct_pkt; /* No default destructor. */
%rename(ldns_pkt) ldns_struct_pkt;
-#ifdef LDNS_DEBUG
-%rename(__ldns_pkt_free) ldns_pkt_free;
-%inline %{
-void _ldns_pkt_free (ldns_pkt* p) {
- printf("******** LDNS_PKT free 0x%lX ************\n", (long unsigned int)p);
- ldns_pkt_free(p);
-}
-%}
-#else
-%rename(_ldns_pkt_free) ldns_pkt_free;
-#endif
%newobject ldns_pkt2str;
%newobject ldns_pkt_opcode2str;
%newobject ldns_pkt_rcode2str;
%newobject ldns_pkt_algorithm2str;
%newobject ldns_pkt_cert_algorithm2str;
+%newobject ldns_pkt_get_section_clone;
-/* cloning of packet_lists to make them independent of the original packet */
+/* Clone data on pull. */
-%newobject _ldns_pkt_additional;
-%newobject _ldns_pkt_answer;
-%newobject _ldns_pkt_authority;
-%newobject _ldns_pkt_question;
+%newobject _ldns_pkt_additional;
%rename(__ldns_pkt_additional) ldns_pkt_additional;
-%inline %{
-ldns_rr_list* _ldns_pkt_additional(ldns_pkt* p) {
- return ldns_rr_list_clone(ldns_pkt_additional(p));
-}
+%inline
+%{
+ ldns_rr_list * _ldns_pkt_additional(ldns_pkt *p)
+ {
+ return ldns_rr_list_clone(ldns_pkt_additional(p));
+ }
%}
+%newobject _ldns_pkt_answer;
%rename(__ldns_pkt_answer) ldns_pkt_answer;
-%inline %{
-ldns_rr_list* _ldns_pkt_answer(ldns_pkt* p) {
- return ldns_rr_list_clone(ldns_pkt_answer(p));
-}
+%inline
+%{
+ ldns_rr_list * _ldns_pkt_answer(ldns_pkt *p)
+ {
+ return ldns_rr_list_clone(ldns_pkt_answer(p));
+ }
%}
+%newobject _ldns_pkt_answerfrom;
+%rename(__ldns_pkt_answerfrom) ldns_pkt_answerfrom;
+%inline
+%{
+ ldns_rdf * _ldns_pkt_answerfrom(ldns_pkt *p)
+ {
+ ldns_rdf *rdf;
+
+ rdf = ldns_pkt_answerfrom(p);
+ if (rdf != NULL) {
+ rdf = ldns_rdf_clone(rdf);
+ }
+ return rdf;
+ }
+%}
+
+%newobject _ldns_pkt_authority;
%rename(__ldns_pkt_authority) ldns_pkt_authority;
-%inline %{
-ldns_rr_list* _ldns_pkt_authority(ldns_pkt* p) {
- return ldns_rr_list_clone(ldns_pkt_authority(p));
-}
+%inline
+%{
+ ldns_rr_list * _ldns_pkt_authority(ldns_pkt *p)
+ {
+ return ldns_rr_list_clone(ldns_pkt_authority(p));
+ }
+%}
+
+%newobject _ldns_pkt_edns_data;
+%rename(__ldns_pkt_edns_data) ldns_pkt_edns_data;
+%inline
+%{
+ ldns_rdf * _ldns_pkt_edns_data(ldns_pkt *p)
+ {
+ ldns_rdf *rdf;
+
+ rdf = ldns_pkt_edns_data(p);
+ if (rdf != NULL) {
+ rdf = ldns_rdf_clone(rdf);
+ }
+ return rdf;
+ }
%}
+%newobject _ldns_pkt_tsig;
+%rename(__ldns_pkt_tsig) ldns_pkt_tsig;
+%inline
+%{
+ ldns_rr * _ldns_pkt_tsig(const ldns_pkt *pkt)
+ {
+ return ldns_rr_clone(ldns_pkt_tsig(pkt));
+ }
+%}
+
+%newobject _ldns_pkt_question;
%rename(__ldns_pkt_question) ldns_pkt_question;
-%inline %{
-ldns_rr_list* _ldns_pkt_question(ldns_pkt* p) {
- return ldns_rr_list_clone(ldns_pkt_question(p));
-}
+%inline
+%{
+ ldns_rr_list * _ldns_pkt_question(ldns_pkt *p)
+ {
+ return ldns_rr_list_clone(ldns_pkt_question(p));
+ }
%}
-/* clone data when pushed in */
+/* End of pull cloning. */
+
+/* Clone data on push. */
+
+%newobject _ldns_pkt_query_new;
+%rename(__ldns_pkt_query_new) ldns_pkt_query_new;
+%inline
+%{
+ ldns_pkt * _ldns_pkt_query_new(ldns_rdf *rr_name, ldns_rr_type rr_type,
+ ldns_rr_class rr_class, uint16_t flags)
+ {
+ return ldns_pkt_query_new(ldns_rdf_clone(rr_name), rr_type, rr_class,
+ flags);
+ }
+%}
%rename(__ldns_pkt_push_rr) ldns_pkt_push_rr;
-%inline %{
-bool _ldns_pkt_push_rr(ldns_pkt* p, ldns_pkt_section sec, ldns_rr *rr) {
- return ldns_pkt_push_rr(p, sec, ldns_rr_clone(rr));
-}
+%inline
+%{
+ bool _ldns_pkt_push_rr(ldns_pkt *p, ldns_pkt_section sec, ldns_rr *rr)
+ {
+ return ldns_pkt_push_rr(p, sec, ldns_rr_clone(rr));
+ }
+%}
+
+%rename(__ldns_pkt_safe_push_rr) ldns_pkt_safe_push_rr;
+%inline
+%{
+ bool _ldns_pkt_safe_push_rr(ldns_pkt *pkt, ldns_pkt_section sec,
+ ldns_rr *rr)
+ {
+ /* Prevents memory leaks when fails. */
+ ldns_rr *rr_clone = NULL;
+ bool ret;
+
+ if (rr != NULL) {
+ rr_clone = ldns_rr_clone(rr);
+ }
+ ret = ldns_pkt_safe_push_rr(pkt, sec, rr_clone);
+ if (!ret) {
+ ldns_rr_free(rr_clone);
+ }
+
+ return ret;
+ }
%}
%rename(__ldns_pkt_push_rr_list) ldns_pkt_push_rr_list;
-%inline %{
-bool _ldns_pkt_push_rr_list(ldns_pkt* p, ldns_pkt_section sec, ldns_rr_list *rrl) {
- return ldns_pkt_push_rr_list(p, sec, ldns_rr_list_clone(rrl));
-}
+%inline
+%{
+ bool _ldns_pkt_push_rr_list(ldns_pkt *p, ldns_pkt_section sec,
+ ldns_rr_list *rrl)
+ {
+ return ldns_pkt_push_rr_list(p, sec, ldns_rr_list_clone(rrl));
+ }
+%}
+
+%rename(__ldns_pkt_safe_push_rr_list) ldns_pkt_safe_push_rr_list;
+%inline
+%{
+ bool _ldns_pkt_safe_push_rr_list(ldns_pkt *p, ldns_pkt_section s,
+ ldns_rr_list *rrl)
+ {
+ /* Prevents memory leaks when fails. */
+ ldns_rr_list *rrl_clone = NULL;
+ bool ret;
+
+ if (rrl != NULL) {
+ rrl_clone = ldns_rr_list_clone(rrl);
+ }
+ ret = ldns_pkt_safe_push_rr_list(p, s, rrl_clone);
+ if (!ret) {
+ ldns_rr_list_free(rrl_clone);
+ }
+
+ return ret;
+ }
+%}
+
+%rename(__ldns_pkt_set_additional) ldns_pkt_set_additional;
+%inline
+%{
+ void _ldns_pkt_set_additional(ldns_pkt *p, ldns_rr_list *rrl)
+ {
+ ldns_rr_list *rrl_clone = NULL;
+ if (rrl != NULL) {
+ rrl_clone = ldns_rr_list_clone(rrl);
+ }
+ /* May leak memory, when overwriting pointer value. */
+ ldns_pkt_set_additional(p, rrl_clone);
+ }
+%}
+
+%rename(__ldns_pkt_set_answer) ldns_pkt_set_answer;
+%inline
+%{
+ void _ldns_pkt_set_answer(ldns_pkt *p, ldns_rr_list *rrl)
+ {
+ ldns_rr_list *rrl_clone = NULL;
+ if (rrl != NULL) {
+ rrl_clone = ldns_rr_list_clone(rrl);
+ }
+ /* May leak memory, when overwriting pointer value. */
+ ldns_pkt_set_answer(p, rrl_clone);
+ }
+%}
+
+%rename (__ldns_pkt_set_answerfrom) ldns_pkt_set_answerfrom;
+%inline
+%{
+ void _ldns_pkt_set_answerfrom(ldns_pkt *packet, ldns_rdf *rdf)
+ {
+ ldns_rdf *rdf_clone = NULL;
+ if (rdf != NULL) {
+ rdf_clone = ldns_rdf_clone(rdf);
+ }
+ /* May leak memory, when overwriting pointer value. */
+ ldns_pkt_set_answerfrom(packet, rdf_clone);
+ }
+%}
+
+%rename(__ldns_pkt_set_authority) ldns_pkt_set_authority;
+%inline
+%{
+ void _ldns_pkt_set_authority(ldns_pkt *p, ldns_rr_list *rrl)
+ {
+ ldns_rr_list *rrl_clone = NULL;
+ if (rrl != NULL) {
+ rrl_clone = ldns_rr_list_clone(rrl);
+ }
+ /* May leak memory, when overwriting pointer value. */
+ ldns_pkt_set_authority(p, rrl_clone);
+ }
+%}
+
+%rename(__ldns_pkt_set_edns_data) ldns_pkt_set_edns_data;
+%inline
+%{
+ void _ldns_pkt_set_edns_data(ldns_pkt *packet, ldns_rdf *rdf)
+ {
+ ldns_rdf *rdf_clone = NULL;
+ if (rdf != NULL) {
+ rdf_clone = ldns_rdf_clone(rdf);
+ }
+ /* May leak memory, when overwriting pointer value. */
+ ldns_pkt_set_edns_data(packet, rdf_clone);
+ }
+%}
+
+%rename(__ldns_pkt_set_question) ldns_pkt_set_question;
+%inline
+%{
+ void _ldns_pkt_set_question(ldns_pkt *p, ldns_rr_list *rrl)
+ {
+ ldns_rr_list *rrl_clone = NULL;
+ if (rrl != NULL) {
+ rrl_clone = ldns_rr_list_clone(rrl);
+ }
+ /* May leak memory, when overwriting pointer value. */
+ ldns_pkt_set_question(p, rrl_clone);
+ }
+%}
+
+%rename(__ldns_pkt_set_tsig) ldns_pkt_set_tsig;
+%inline
+%{
+ void _ldns_pkt_set_tsig(ldns_pkt *pkt, ldns_rr *rr)
+ {
+ ldns_rr *rr_clone = NULL;
+ if (rr != NULL) {
+ rr_clone = ldns_rr_clone(rr);
+ }
+ /* May leak memory, when overwriting pointer value. */
+ ldns_pkt_set_tsig(pkt, rr_clone);
+ }
+%}
+
+/* End of push cloning. */
+
+
+/* ========================================================================= */
+/* Debugging related code. */
+/* ========================================================================= */
+
+#ifdef LDNS_DEBUG
+%rename(__ldns_pkt_free) ldns_pkt_free;
+%inline
+%{
+ /*!
+ * @brief Prints information about deallocated pkt and deallocates.
+ */
+ void _ldns_pkt_free (ldns_pkt* p) {
+ printf("******** LDNS_PKT free 0x%lX ************\n",
+ (long unsigned int) p);
+ ldns_pkt_free(p);
+ }
%}
+#else /* !LDNS_DEBUG */
+%rename(_ldns_pkt_free) ldns_pkt_free;
+#endif /* LDNS_DEBUG */
+
+
+/* ========================================================================= */
+/* Added C code. */
+/* ========================================================================= */
+
+/* None. */
+
+
+/* ========================================================================= */
+/* Encapsulating Python code. */
+/* ========================================================================= */
%feature("docstring") ldns_struct_pkt "LDNS packet object.
-The ldns_pkt object contains DNS packed (either a query or an answer). It is the complete representation of what you actually send to a nameserver, and what you get back (see :class:`ldns.ldns_resolver`).
+The :class:`ldns_pkt` object contains DNS packed (either a query or an answer).
+It is the complete representation of what you actually send to a name server,
+and what you get back (see :class:`ldns.ldns_resolver`).
**Usage**
@@ -148,40 +396,91 @@ nic.cz. 758 IN NS e.ns.nic.cz.
;; WHEN: Thu Jan 11 12:54:33 2009
;; MSG SIZE rcvd: 75
-This simple example instances a resolver in order to resolve NS for nic.cz.
-"
+This simple example instances a resolver in order to resolve NS for nic.cz."
%extend ldns_struct_pkt {
- %pythoncode %{
+ %pythoncode
+ %{
def __init__(self):
- raise Exception("This class can't be created directly. Please use: ldns_pkt_new(), ldns_pkt_query_new() or ldns_pkt_query_new_frm_str()")
+ """
+ Cannot be created directly from Python.
+ """
+ raise Exception("This class can't be created directly. " +
+ "Please use: ldns_pkt_new, ldns_pkt_query_new " +
+ "or ldns_pkt_query_new_frm_str")
__swig_destroy__ = _ldns._ldns_pkt_free
- #LDNS_PKT_CONSTRUCTORS_#
+ #
+ # LDNS_PKT_CONSTRUCTORS_
+ #
+
+ @staticmethod
+ def new():
+ """
+ Creates new empty packet structure.
+
+ :return: (:class:`ldns_pkt` ) New empty packet.
+ """
+ return _ldns.ldns_pkt_new()
+
@staticmethod
def new_query(rr_name, rr_type, rr_class, flags):
- """Creates a packet with a query in it for the given name, type and class.
-
- :param rr_name: the name to query for
- :param rr_type: the type to query for
- :param rr_class: the class to query for
- :param flags: packet flags
- :returns: new ldns_pkt object
"""
- return _ldns.ldns_pkt_query_new(rr_name, rr_type, rr_class, flags)
+ Creates a packet with a query in it for the given name,
+ type and class.
+
+ :param rr_name: The name to query for.
+ :type rr_name: :class:`ldns_dname`
+ :param rr_type: The type to query for.
+ :type rr_type: ldns_rr_type
+ :param rr_class: The class to query for.
+ :type rr_class: ldns_rr_class
+ :param flags: Packet flags.
+ :type flags: uint16_t
+ :throws TypeError: When arguments of inappropriate types.
+ :return: (:class:`ldns_pkt`) New object.
+
+ .. note::
+ The type checking of parameter `rr_name` is benevolent.
+ It allows also to pass a dname :class:`ldns_rdf` object.
+ This will probably change in future.
+ """
+ if (not isinstance(rr_name, ldns_dname)) and \
+ isinstance(rr_name, ldns_rdf) and \
+ rr_name.get_type() == _ldns.LDNS_RDF_TYPE_DNAME:
+ warnings.warn("The ldns_pkt.new_query() method will" +
+ " drop the possibility to accept ldns_rdf." +
+ " Convert argument to ldns_dname.",
+ PendingDeprecationWarning, stacklevel=2)
+ if not isinstance(rr_name, ldns_rdf):
+ raise TypeError("Parameter must be derived from ldns_rdf.")
+ if (rr_name.get_type() != _ldns.LDNS_RDF_TYPE_DNAME):
+ raise Exception("Operands must be ldns_dname.")
+ return _ldns._ldns_pkt_query_new(rr_name, rr_type, rr_class, flags)
@staticmethod
def new_query_frm_str(rr_name, rr_type, rr_class, flags, raiseException = True):
- """Creates a query packet for the given name, type, class.
-
- :param rr_name: the name to query for
- :param rr_type: the type to query for
- :param rr_class: the class to query for
- :param flags: packet flags
- :param raiseException: if True, an exception occurs in case a resolver object can't be created
- :returns: query packet object or None. If the object can't be created and raiseException is True, an exception occurs.
+ """
+ Creates a query packet for the given name, type, class.
+
+ :param rr_name: The name to query for.
+ :type rr_name: str
+ :param rr_type: The type to query for.
+ :type rr_type: ldns_rr_type
+ :param rr_class: The class to query for.
+ :type rr_class: ldns_rr_class
+ :param flags: Packet flags.
+ :type flags: uint16_t
+ :param raiseException: If True, an exception occurs in case a
+ packet object can't be created.
+ :throws TypeError: When arguments of inappropriate types.
+ :throws Exception: When raiseException set and packet couldn't
+ be created.
+ :return: (:class:`ldns_pkt`) Query packet object or None.
+ If the object can't be created and raiseException is True,
+ an exception occurs.
**Usage**
@@ -209,30 +508,57 @@ This simple example instances a resolver in order to resolve NS for nic.cz.
if (raiseException): raise Exception("Can't create query packet, error: %d" % status)
return None
return pkt
- #_LDNS_PKT_CONSTRUCTORS#
+
+ #
+ # _LDNS_PKT_CONSTRUCTORS
+ #
def __str__(self):
- """Converts the data in the DNS packet to presentation format"""
+ """
+ Converts the data in the DNS packet to presentation format.
+
+ :return: (str)
+ """
return _ldns.ldns_pkt2str(self)
def opcode2str(self):
- """Converts a packet opcode to its mnemonic and returns that as an allocated null-terminated string."""
+ """
+ Converts a packet opcode to its mnemonic and returns that as an
+ allocated null-terminated string.
+
+ :return: (str)
+ """
return _ldns.ldns_pkt_opcode2str(self.get_opcode())
def rcode2str(self):
- """Converts a packet rcode to its mnemonic and returns that as an allocated null-terminated string."""
+ """
+ Converts a packet rcode to its mnemonic and returns that as an
+ allocated null-terminated string.
+
+ :return: (str)
+ """
return _ldns.ldns_pkt_rcode2str(self.get_rcode())
- def print_to_file(self,output):
- """Prints the data in the DNS packet to the given file stream (in presentation format)."""
- _ldns.ldns_pkt_print(output,self)
+ def print_to_file(self, output):
+ """
+ Prints the data in the DNS packet to the given file stream
+ (in presentation format).
+
+ :param output: Opened file to write to.
+ :type output: file
+ :throws TypeError: When arguments of inappropriate types.
+ """
+ _ldns.ldns_pkt_print(output, self)
#parameters: FILE *,const ldns_pkt *,
def write_to_buffer(self, buffer):
- """Copies the packet data to the buffer in wire format.
+ """
+ Copies the packet data to the buffer in wire format.
- :param buffer: buffer to append the result to
- :returns: (ldns_status) ldns_status
+ :param buffer: Buffer to append the result to.
+ :type buffer: :class:`ldns_buffer`
+ :throws TypeError: When arguments of inappropriate types.
+ :return: (ldns_status) ldns_status
"""
return _ldns.ldns_pkt2buffer_wire(buffer, self)
#parameters: ldns_buffer *,const ldns_pkt *,
@@ -240,847 +566,1023 @@ This simple example instances a resolver in order to resolve NS for nic.cz.
@staticmethod
def algorithm2str(alg):
- """Converts a signing algorithms to its mnemonic and returns that as an allocated null-terminated string."""
+ """
+ Converts a signing algorithms to its mnemonic and returns that
+ as an allocated null-terminated string.
+
+ :param alg: The algorithm to convert to text.
+ :type alg: ldns_algorithm
+ :return: (str)
+ """
return _ldns.ldns_pkt_algorithm2str(alg)
#parameters: ldns_algorithm,
@staticmethod
def cert_algorithm2str(alg):
- """Converts a cert algorithm to its mnemonic and returns that as an allocated null-terminated string."""
+ """
+ Converts a cert algorithm to its mnemonic and returns that as an
+ allocated null-terminated string.
+
+ :param alg: Cert algorithm to convert to text.
+ :type alg: ldns_cert_algorithm
+ :return: (str)
+ """
return _ldns.ldns_pkt_cert_algorithm2str(alg)
#parameters: ldns_algorithm,
- #LDNS_PKT_METHODS_#
+ #
+ # LDNS_PKT_METHODS_
+ #
+
def aa(self):
- """Read the packet's aa bit.
+ """
+ Read the packet's aa bit.
- :returns: (bool) value of the bit
+ :return: (bool) Value of the bit.
"""
return _ldns.ldns_pkt_aa(self)
#parameters: const ldns_pkt *,
#retvals: bool
def ad(self):
- """Read the packet's ad bit.
+ """
+ Read the packet's ad bit.
- :returns: (bool) value of the bit
+ :return: (bool) Value of the bit.
"""
return _ldns.ldns_pkt_ad(self)
#parameters: const ldns_pkt *,
#retvals: bool
def additional(self):
- """Return the packet's additional section.
+ """
+ Return the packet's additional section.
- :returns: (ldns_rr_list \*) the section
+ :return: (:class:`ldns_rr_list`) The additional section.
"""
return _ldns._ldns_pkt_additional(self)
#parameters: const ldns_pkt *,
#retvals: ldns_rr_list *
def all(self):
+ """
+ Return the packet's question, answer, authority and additional
+ sections concatenated.
+
+ :return: (:class:`ldns_rr_list`) Concatenated sections.
+ """
return _ldns.ldns_pkt_all(self)
#parameters: const ldns_pkt *,
#retvals: ldns_rr_list *
def all_noquestion(self):
+ """
+ Return the packet's answer, authority and additional sections
+ concatenated.
+ Like :meth:`all` but without the questions.
+
+ :return: (:class:`ldns_rr_list`) Concatenated sections except
+ questions.
+ """
return _ldns.ldns_pkt_all_noquestion(self)
#parameters: const ldns_pkt *,
#retvals: ldns_rr_list *
def ancount(self):
- """Return the packet's an count.
+ """
+ Return the packet's an count.
- :returns: (uint16_t) the an count
+ :return: (int) The an count.
"""
return _ldns.ldns_pkt_ancount(self)
#parameters: const ldns_pkt *,
#retvals: uint16_t
def answer(self):
- """Return the packet's answer section.
+ """
+ Return the packet's answer section.
- :returns: (ldns_rr_list \*) the section
+ :return: (:class:`ldns_rr_list`) The answer section.
"""
return _ldns._ldns_pkt_answer(self)
#parameters: const ldns_pkt *,
#retvals: ldns_rr_list *
def answerfrom(self):
- """Return the packet's answerfrom.
+ """
+ Return the packet's answerfrom.
- :returns: (ldns_rdf \*) the name of the server
+ :return: (:class:`ldns_rdf`) The name of the server.
"""
- return _ldns.ldns_pkt_answerfrom(self)
+ return _ldns._ldns_pkt_answerfrom(self)
#parameters: const ldns_pkt *,
#retvals: ldns_rdf *
def arcount(self):
- """Return the packet's ar count.
+ """
+ Return the packet's ar count.
- :returns: (uint16_t) the ar count
+ :return: (int) The ar count.
"""
return _ldns.ldns_pkt_arcount(self)
#parameters: const ldns_pkt *,
#retvals: uint16_t
def authority(self):
- """Return the packet's authority section.
+ """
+ Return the packet's authority section.
- :returns: (ldns_rr_list \*) the section
+ :return: (:class:`ldns_rr_list`) The authority section.
"""
return _ldns._ldns_pkt_authority(self)
#parameters: const ldns_pkt *,
#retvals: ldns_rr_list *
def cd(self):
- """Read the packet's cd bit.
+ """
+ Read the packet's cd bit.
- :returns: (bool) value of the bit
+ :return: (bool) Value of the bit.
"""
return _ldns.ldns_pkt_cd(self)
#parameters: const ldns_pkt *,
#retvals: bool
def clone(self):
- """clones the given packet, creating a fully allocated copy
+ """
+ Clones the packet, creating a fully allocated copy.
- :returns: (ldns_pkt \*) ldns_pkt* pointer to the new packet
+ :return: (:class:`ldns_pkt`) New packet clone.
"""
return _ldns.ldns_pkt_clone(self)
#parameters: ldns_pkt *,
#retvals: ldns_pkt *
def edns(self):
- """returns true if this packet needs and EDNS rr to be sent.
+ """
+ Returns True if this packet needs and EDNS rr to be sent.
- At the moment the only reason is an expected packet size larger than 512 bytes, but for instance dnssec would be a good reason too.
+ At the moment the only reason is an expected packet size larger
+ than 512 bytes, but for instance DNSSEC would be a good reason
+ too.
- :returns: (bool) true if packet needs edns rr
+ :return: (bool) True if packet needs EDNS rr.
"""
return _ldns.ldns_pkt_edns(self)
#parameters: const ldns_pkt *,
#retvals: bool
def edns_data(self):
- """return the packet's edns data
+ """
+ Return the packet's edns data.
- :returns: (ldns_rdf \*) the data
+ :return: (:class:`ldns_rdf`) The ensd data.
"""
- return _ldns.ldns_pkt_edns_data(self)
+ return _ldns._ldns_pkt_edns_data(self)
#parameters: const ldns_pkt *,
#retvals: ldns_rdf *
def edns_do(self):
- """return the packet's edns do bit
+ """
+ Return the packet's edns do bit
- :returns: (bool) the bit's value
+ :return: (bool) The bit's value.
"""
return _ldns.ldns_pkt_edns_do(self)
#parameters: const ldns_pkt *,
#retvals: bool
def edns_extended_rcode(self):
- """return the packet's edns extended rcode
+ """
+ Return the packet's edns extended rcode.
- :returns: (uint8_t) the rcode
+ :return: (uint8_t) The rcode.
"""
return _ldns.ldns_pkt_edns_extended_rcode(self)
#parameters: const ldns_pkt *,
#retvals: uint8_t
def edns_udp_size(self):
- """return the packet's edns udp size
+ """
+ Return the packet's edns udp size.
- :returns: (uint16_t) the size
+ :return: (uint16_t) The udp size.
"""
return _ldns.ldns_pkt_edns_udp_size(self)
#parameters: const ldns_pkt *,
#retvals: uint16_t
def edns_version(self):
- """return the packet's edns version
+ """
+ Return the packet's edns version.
- :returns: (uint8_t) the version
+ :return: (uint8_t) The edns version.
"""
return _ldns.ldns_pkt_edns_version(self)
#parameters: const ldns_pkt *,
#retvals: uint8_t
def edns_z(self):
- """return the packet's edns z value
+ """
+ Return the packet's edns z value.
- :returns: (uint16_t) the z value
+ :return: (uint16_t) The z value.
"""
return _ldns.ldns_pkt_edns_z(self)
#parameters: const ldns_pkt *,
#retvals: uint16_t
def empty(self):
- """check if a packet is empty
+ """
+ Check if a packet is empty.
- :returns: (bool) true: empty, false: empty
+ :return: (bool) True: empty, False: not empty
"""
return _ldns.ldns_pkt_empty(self)
#parameters: ldns_pkt *,
#retvals: bool
def get_opcode(self):
- """Read the packet's code.
+ """
+ Read the packet's code.
- :returns: (ldns_pkt_opcode) the opcode
+ :return: (ldns_pkt_opcode) the opcode
"""
return _ldns.ldns_pkt_get_opcode(self)
#parameters: const ldns_pkt *,
#retvals: ldns_pkt_opcode
def get_rcode(self):
- """Return the packet's respons code.
+ """
+ Return the packet's response code.
- :returns: (ldns_pkt_rcode) the respons code
+ :return: (ldns_pkt_rcode) The response code.
"""
return _ldns.ldns_pkt_get_rcode(self)
#parameters: const ldns_pkt *,
#retvals: ldns_pkt_rcode
- def get_section_clone(self,s):
- """return all the rr_list's in the packet.
-
- Clone the lists, instead of returning pointers.
+ def get_section_clone(self, s):
+ """
+ Return the selected rr_list's in the packet.
- :param s:
- what section(s) to return
- :returns: (ldns_rr_list \*) ldns_rr_list with the rr's or NULL if none were found
+ :param s: What section(s) to return.
+ :type s: ldns_pkt_section
+ :throws TypeError: When arguments of inappropriate types.
+ :return: (:class:`ldns_rr_list`) RR list with the rr's or None
+ if none were found.
"""
- return _ldns.ldns_pkt_get_section_clone(self,s)
+ return _ldns.ldns_pkt_get_section_clone(self, s)
#parameters: const ldns_pkt *,ldns_pkt_section,
#retvals: ldns_rr_list *
def id(self):
- """Read the packet id.
+ """
+ Read the packet id.
- :returns: (uint16_t) the packet id
+ :return: (uint16_t) The packet id.
"""
return _ldns.ldns_pkt_id(self)
#parameters: const ldns_pkt *,
#retvals: uint16_t
def nscount(self):
- """Return the packet's ns count.
+ """
+ Return the packet's ns count.
- :returns: (uint16_t) the ns count
+ :return: (uint16_t) The ns count.
"""
return _ldns.ldns_pkt_nscount(self)
#parameters: const ldns_pkt *,
#retvals: uint16_t
- def push_rr(self,section,rr):
- """push an rr on a packet
+ def push_rr(self, section, rr):
+ """
+ Push an rr on a packet.
- :param section:
- where to put it
- :param rr:
- rr to push
- :returns: (bool) a boolean which is true when the rr was added
+ :param section: Where to put it.
+ :type section: ldns_pkt_section
+ :param rr: RR to push.
+ :type rr: :class:`ldns_rr`
+ :throws TypeError: When arguments of inappropriate types.
+ :return: (bool) A boolean which is True when the rr was added.
"""
return _ldns._ldns_pkt_push_rr(self,section,rr)
#parameters: ldns_pkt *,ldns_pkt_section,ldns_rr *,
#retvals: bool
- def push_rr_list(self,section,list):
- """push a rr_list on a packet
+ def push_rr_list(self, section, list):
+ """
+ Push a rr_list on a packet.
- :param section:
- where to put it
- :param list:
- the rr_list to push
- :returns: (bool) a boolean which is true when the rr was added
+ :param section: Where to put it.
+ :type section: ldns_pkt_section
+ :param list: The rr_list to push.
+ :type list: :class:`ldns_rr_list`
+ :throws TypeError: When arguments of inappropriate types.
+ :return: (bool) A boolean which is True when the rr was added.
"""
return _ldns._ldns_pkt_push_rr_list(self,section,list)
#parameters: ldns_pkt *,ldns_pkt_section,ldns_rr_list *,
#retvals: bool
def qdcount(self):
- """Return the packet's qd count.
+ """
+ Return the packet's qd count.
- :returns: (uint16_t) the qd count
+ :return: (uint16_t) The qd count.
"""
return _ldns.ldns_pkt_qdcount(self)
#parameters: const ldns_pkt *,
#retvals: uint16_t
def qr(self):
- """Read the packet's qr bit.
+ """
+ Read the packet's qr bit.
- :returns: (bool) value of the bit
+ :return: (bool) value of the bit
"""
return _ldns.ldns_pkt_qr(self)
#parameters: const ldns_pkt *,
#retvals: bool
def querytime(self):
- """Return the packet's querytime.
+ """
+ Return the packet's query time.
- :returns: (uint32_t) the querytime
+ :return: (uint32_t) The query time.
"""
return _ldns.ldns_pkt_querytime(self)
#parameters: const ldns_pkt *,
#retvals: uint32_t
def question(self):
- """Return the packet's question section.
+ """
+ Return the packet's question section.
- :returns: (ldns_rr_list \*) the section
+ :return: (:class:`ldns_rr_list`) The question section.
"""
return _ldns._ldns_pkt_question(self)
#parameters: const ldns_pkt *,
#retvals: ldns_rr_list *
def ra(self):
- """Read the packet's ra bit.
+ """
+ Read the packet's ra bit.
- :returns: (bool) value of the bit
+ :return: (bool) Value of the bit.
"""
return _ldns.ldns_pkt_ra(self)
#parameters: const ldns_pkt *,
#retvals: bool
def rd(self):
- """Read the packet's rd bit.
+ """
+ Read the packet's rd bit.
- :returns: (bool) value of the bit
+ :return: (bool) Value of the bit.
"""
return _ldns.ldns_pkt_rd(self)
#parameters: const ldns_pkt *,
#retvals: bool
def reply_type(self):
- """looks inside the packet to determine what kind of packet it is, AUTH, NXDOMAIN, REFERRAL, etc.
+ """
+ Looks inside the packet to determine what kind of packet it is,
+ AUTH, NXDOMAIN, REFERRAL, etc.
- :returns: (ldns_pkt_type) the type of packet
+ :return: (ldns_pkt_type) The type of packet.
"""
return _ldns.ldns_pkt_reply_type(self)
#parameters: ldns_pkt *,
#retvals: ldns_pkt_type
- def rr(self,sec,rr):
- """check to see if an rr exist in the packet
+ def rr(self, sec, rr):
+ """
+ Check to see if an rr exist in the packet.
- :param sec:
- in which section to look
- :param rr:
- the rr to look for
- :returns: (bool)
+ :param sec: In which section to look.
+ :type sec: ldns_pkt_section
+ :param rr: The rr to look for.
+ :type rr: :class:`ldns_rr`
+ :throws TypeError: When arguments of inappropriate types.
+ :return: (bool) Return True is exists.
"""
- return _ldns.ldns_pkt_rr(self,sec,rr)
+ return _ldns.ldns_pkt_rr(self, sec, rr)
#parameters: ldns_pkt *,ldns_pkt_section,ldns_rr *,
#retvals: bool
- def rr_list_by_name(self,r,s):
- """return all the rr with a specific name from a packet.
-
- Optionally specify from which section in the packet
+ def rr_list_by_name(self, r, s):
+ """
+ Return all the rr with a specific name from a packet.
- :param r:
- the name
- :param s:
- the packet's section
- :returns: (ldns_rr_list \*) a list with the rr's or NULL if none were found
+ :param r: The name.
+ :type r: :class:`ldns_rdf`
+ :param s: The packet's section.
+ :type s: ldns_pkt_section
+ :throws TypeError: When arguments of inappropriate types.
+ :return: (:class:`ldns_rr_list`) A list with the rr's or None
+ if none were found.
"""
return _ldns.ldns_pkt_rr_list_by_name(self,r,s)
#parameters: ldns_pkt *,ldns_rdf *,ldns_pkt_section,
#retvals: ldns_rr_list *
- def rr_list_by_name_and_type(self,ownername,atype,sec):
- """return all the rr with a specific type and type from a packet.
-
- Optionally specify from which section in the packet
+ def rr_list_by_name_and_type(self, ownername, atype, sec):
+ """
+ Return all the rr with a specific type and type from a packet.
- :param ownername:
- the name
- :param atype:
- :param sec:
- the packet's section
- :returns: (ldns_rr_list \*) a list with the rr's or NULL if none were found
+ :param ownername: The name.
+ :type ownername: :class:`ldns_rdf`
+ :param atype: The type.
+ :type atype: ldns_rr_type
+ :param sec: The packet's section.
+ :type sec: ldns_pkt_section
+ :throws TypeError: When arguments of inappropriate types.
+ :return: (:class:`ldns_rr_list`) A list with the rr's or None
+ if none were found.
"""
- return _ldns.ldns_pkt_rr_list_by_name_and_type(self,ownername,atype,sec)
+ return _ldns.ldns_pkt_rr_list_by_name_and_type(self, ownername, atype, sec)
#parameters: const ldns_pkt *,const ldns_rdf *,ldns_rr_type,ldns_pkt_section,
#retvals: ldns_rr_list *
- def rr_list_by_type(self,t,s):
- """return all the rr with a specific type from a packet.
-
- Optionally specify from which section in the packet
+ def rr_list_by_type(self, t, s):
+ """
+ Return all the rr with a specific type from a packet.
- :param t:
- the type
- :param s:
- the packet's section
- :returns: (ldns_rr_list \*) a list with the rr's or NULL if none were found
+ :param t: The type.
+ :type t: ldns_rr_type
+ :param s: The packet's section.
+ :type s: ldns_pkt_section
+ :throws TypeError: When arguments of inappropriate types.
+ :return: (:class:`ldns_rr_list`) A list with the rr's or None
+ if none were found.
"""
- return _ldns.ldns_pkt_rr_list_by_type(self,t,s)
+ return _ldns.ldns_pkt_rr_list_by_type(self, t, s)
#parameters: const ldns_pkt *,ldns_rr_type,ldns_pkt_section,
#retvals: ldns_rr_list *
- def safe_push_rr(self,sec,rr):
- """push an rr on a packet, provided the RR is not there.
+ def safe_push_rr(self, sec, rr):
+ """
+ Push an rr on a packet, provided the RR is not there.
- :param sec:
- where to put it
- :param rr:
- rr to push
- :returns: (bool) a boolean which is true when the rr was added
+ :param sec: Where to put it.
+ :type sec: ldns_pkt_section
+ :param rr: RR to push.
+ :type rr: :class:`ldns_rr`
+ :throws TypeError: When arguments of inappropriate types.
+ :return: (bool) A boolean which is True when the rr was added.
"""
- return _ldns.ldns_pkt_safe_push_rr(self,sec,rr)
+ return _ldns._ldns_pkt_safe_push_rr(self,sec,rr)
#parameters: ldns_pkt *,ldns_pkt_section,ldns_rr *,
#retvals: bool
- def safe_push_rr_list(self,sec,list):
- """push an rr_list to a packet, provided the RRs are not already there.
+ def safe_push_rr_list(self, sec, list):
+ """
+ Push an rr_list to a packet, provided the RRs are not already
+ there.
- :param sec:
- where to put it
- :param list:
- the rr_list to push
- :returns: (bool) a boolean which is true when the rr was added
+ :param sec: Where to put it.
+ :type sec: ldns_pkt_section
+ :param list: The rr_list to push.
+ :type list: :class:`ldns_rr_list`
+ :throws TypeError: When arguments of inappropriate types.
+ :return: (bool) A boolean which is True when the list was added.
"""
- return _ldns.ldns_pkt_safe_push_rr_list(self,sec,list)
+ return _ldns._ldns_pkt_safe_push_rr_list(self, sec, list)
#parameters: ldns_pkt *,ldns_pkt_section,ldns_rr_list *,
#retvals: bool
- def section_count(self,s):
- return _ldns.ldns_pkt_section_count(self,s)
- #parameters: const ldns_pkt *,ldns_pkt_section,
- #retvals: uint16_t
-
- def set_aa(self,b):
- """Set the packet's aa bit.
+ def set_aa(self, b):
+ """
+ Set the packet's aa bit.
- :param b:
- the value to set (boolean)
+ :param b: The value to set.
+ :type b: bool
"""
- _ldns.ldns_pkt_set_aa(self,b)
+ _ldns.ldns_pkt_set_aa(self, b)
#parameters: ldns_pkt *,bool,
#retvals:
- def set_ad(self,b):
- """Set the packet's ad bit.
+ def set_ad(self, b):
+ """
+ Set the packet's ad bit.
- :param b:
- the value to set (boolean)
+ :param b: The value to set.
+ :type b: bool
"""
- _ldns.ldns_pkt_set_ad(self,b)
+ _ldns.ldns_pkt_set_ad(self, b)
#parameters: ldns_pkt *,bool,
#retvals:
- def set_additional(self,rr):
- """directly set the additional section
+ def set_additional(self, rr):
+ """
+ Directly set the additional section.
- :param rr:
- rrlist to set
+ :param rr: The rr list to set.
+ :type rr: :class:`ldns_rr_list`
+ :throws TypeError: When arguments of inappropriate types.
"""
- _ldns.ldns_pkt_set_additional(self,rr)
+ _ldns._ldns_pkt_set_additional(self, rr)
#parameters: ldns_pkt *,ldns_rr_list *,
#retvals:
- def set_ancount(self,c):
- """Set the packet's an count.
+ def set_ancount(self, c):
+ """
+ Set the packet's an count.
- :param c:
- the count
+ :param c: The count.
+ :type c: int
+ :throws TypeError: When arguments of inappropriate types.
"""
- _ldns.ldns_pkt_set_ancount(self,c)
+ _ldns.ldns_pkt_set_ancount(self, c)
#parameters: ldns_pkt *,uint16_t,
#retvals:
- def set_answer(self,rr):
- """directly set the answer section
+ def set_answer(self, rr):
+ """
+ Directly set the answer section.
- :param rr:
- rrlist to set
+ :param rr: The rr list to set.
+ :type rr: :class:`ldns_rr_list`
+ :throws TypeError: When arguments of inappropriate types.
"""
- _ldns.ldns_pkt_set_answer(self,rr)
+ _ldns._ldns_pkt_set_answer(self, rr)
#parameters: ldns_pkt *,ldns_rr_list *,
#retvals:
- def set_answerfrom(self,r):
- """Set the packet's answering server.
+ def set_answerfrom(self, r):
+ """
+ Set the packet's answering server.
- :param r:
- the address
+ :param r: The address.
+ :type r: :class:`ldns_rdf`
+ :throws TypeError: When arguments of inappropriate types.
"""
- _ldns.ldns_pkt_set_answerfrom(self,r)
+ _ldns._ldns_pkt_set_answerfrom(self, r)
#parameters: ldns_pkt *,ldns_rdf *,
#retvals:
- def set_arcount(self,c):
- """Set the packet's arcount.
+ def set_arcount(self, c):
+ """
+ Set the packet's arcount.
- :param c:
- the count
+ :param c: The count.
+ :type c: int
+ :throws TypeError: When arguments of inappropriate types.
"""
_ldns.ldns_pkt_set_arcount(self,c)
#parameters: ldns_pkt *,uint16_t,
#retvals:
- def set_authority(self,rr):
- """directly set the auhority section
+ def set_authority(self, rr):
+ """
+ Directly set the authority section.
- :param rr:
- rrlist to set
+ :param rr: The rr list to set.
+ :type rr: :class:`ldns_rr_list`
+ :throws TypeError: When arguments of inappropriate types.
"""
- _ldns.ldns_pkt_set_authority(self,rr)
+ _ldns._ldns_pkt_set_authority(self, rr)
#parameters: ldns_pkt *,ldns_rr_list *,
#retvals:
- def set_cd(self,b):
- """Set the packet's cd bit.
+ def set_cd(self, b):
+ """
+ Set the packet's cd bit.
- :param b:
- the value to set (boolean)
+ :param b: The value to set.
+ :type b: bool
"""
- _ldns.ldns_pkt_set_cd(self,b)
+ _ldns.ldns_pkt_set_cd(self, b)
#parameters: ldns_pkt *,bool,
#retvals:
- def set_edns_data(self,data):
- """Set the packet's edns data.
+ def set_edns_data(self, data):
+ """
+ Set the packet's edns data.
- :param data:
- the data
+ :param data: The data.
+ :type data: :class:`ldns_rdf`
+ :throws TypeError: When arguments of inappropriate types.
"""
- _ldns.ldns_pkt_set_edns_data(self,data)
+ _ldns._ldns_pkt_set_edns_data(self, data)
#parameters: ldns_pkt *,ldns_rdf *,
#retvals:
- def set_edns_do(self,value):
- """Set the packet's edns do bit.
+ def set_edns_do(self, value):
+ """
+ Set the packet's edns do bit.
- :param value:
- the bit's new value
+ :param value: The bit's new value.
+ :type value: bool
"""
- _ldns.ldns_pkt_set_edns_do(self,value)
+ _ldns.ldns_pkt_set_edns_do(self, value)
#parameters: ldns_pkt *,bool,
#retvals:
- def set_edns_extended_rcode(self,c):
- """Set the packet's edns extended rcode.
+ def set_edns_extended_rcode(self, c):
+ """
+ Set the packet's edns extended rcode.
- :param c:
- the code
+ :param c: The code.
+ :type c: uint8_t
+ :throws TypeError: When arguments of inappropriate types.
"""
- _ldns.ldns_pkt_set_edns_extended_rcode(self,c)
+ _ldns.ldns_pkt_set_edns_extended_rcode(self, c)
#parameters: ldns_pkt *,uint8_t,
#retvals:
- def set_edns_udp_size(self,s):
- """Set the packet's edns udp size.
+ def set_edns_udp_size(self, s):
+ """
+ Set the packet's edns udp size.
- :param s:
- the size
+ :param s: The size.
+ :type s: uint16_t
+ :throws TypeError: When arguments of inappropriate types.
"""
- _ldns.ldns_pkt_set_edns_udp_size(self,s)
+ _ldns.ldns_pkt_set_edns_udp_size(self, s)
#parameters: ldns_pkt *,uint16_t,
#retvals:
- def set_edns_version(self,v):
- """Set the packet's edns version.
+ def set_edns_version(self, v):
+ """
+ Set the packet's edns version.
- :param v:
- the version
+ :param v: The version.
+ :type v: uint8_t
+ :throws TypeError: When arguments of inappropriate types.
"""
- _ldns.ldns_pkt_set_edns_version(self,v)
+ _ldns.ldns_pkt_set_edns_version(self, v)
#parameters: ldns_pkt *,uint8_t,
#retvals:
- def set_edns_z(self,z):
- """Set the packet's edns z value.
+ def set_edns_z(self, z):
+ """
+ Set the packet's edns z value.
- :param z:
- the value
+ :param z: The value.
+ :type z: uint16_t
+ :throws TypeError: When arguments of inappropriate types.
"""
- _ldns.ldns_pkt_set_edns_z(self,z)
+ _ldns.ldns_pkt_set_edns_z(self, z)
#parameters: ldns_pkt *,uint16_t,
#retvals:
- def set_flags(self,flags):
- """sets the flags in a packet.
+ def set_flags(self, flags):
+ """
+ Sets the flags in a packet.
- :param flags:
- ORed values: LDNS_QR| LDNS_AR for instance
- :returns: (bool) true on success otherwise false
+ :param flags: ORed values: LDNS_QR| LDNS_AR for instance.
+ :type flags: int
+ :throws TypeError: When arguments of inappropriate types.
+ :return: (bool) True on success, False otherwise.
"""
- return _ldns.ldns_pkt_set_flags(self,flags)
+ return _ldns.ldns_pkt_set_flags(self, flags)
#parameters: ldns_pkt *,uint16_t,
#retvals: bool
- def set_id(self,id):
- """Set the packet's id.
+ def set_id(self, id):
+ """
+ Set the packet's id.
- :param id:
- the id to set
+ :param id: The id to set.
+ :type id: uint16_t
+ :throws TypeError: When arguments of inappropriate types.
"""
- _ldns.ldns_pkt_set_id(self,id)
+ _ldns.ldns_pkt_set_id(self, id)
#parameters: ldns_pkt *,uint16_t,
#retvals:
- def set_nscount(self,c):
- """Set the packet's ns count.
+ def set_nscount(self, c):
+ """
+ Set the packet's ns count.
- :param c:
- the count
+ :param c: The count.
+ :type c: int
+ :throws TypeError: When arguments of inappropriate types.
"""
- _ldns.ldns_pkt_set_nscount(self,c)
+ _ldns.ldns_pkt_set_nscount(self, c)
#parameters: ldns_pkt *,uint16_t,
#retvals:
- def set_opcode(self,c):
- """Set the packet's opcode.
+ def set_opcode(self, c):
+ """
+ Set the packet's opcode.
- :param c:
- the opcode
+ :param c: The opcode.
+ :type c: ldns_pkt_opcode
+ :throws TypeError: When arguments of inappropriate types.
"""
- _ldns.ldns_pkt_set_opcode(self,c)
+ _ldns.ldns_pkt_set_opcode(self, c)
#parameters: ldns_pkt *,ldns_pkt_opcode,
#retvals:
- def set_qdcount(self,c):
- """Set the packet's qd count.
+ def set_qdcount(self, c):
+ """
+ Set the packet's qd count.
- :param c:
- the count
+ :param c: The count.
+ :type c: int
+ :throws TypeError: When arguments of inappropriate types.
"""
- _ldns.ldns_pkt_set_qdcount(self,c)
+ _ldns.ldns_pkt_set_qdcount(self, c)
#parameters: ldns_pkt *,uint16_t,
#retvals:
- def set_qr(self,b):
- """Set the packet's qr bit.
+ def set_qr(self, b):
+ """
+ Set the packet's qr bit.
- :param b:
- the value to set (boolean)
+ :param b: The value to set.
+ :type b: bool
"""
- _ldns.ldns_pkt_set_qr(self,b)
+ _ldns.ldns_pkt_set_qr(self, b)
#parameters: ldns_pkt *,bool,
#retvals:
- def set_querytime(self,t):
- """Set the packet's query time.
+ def set_querytime(self, t):
+ """
+ Set the packet's query time.
- :param t:
- the querytime in msec
+ :param t: The query time in msec.
+ :type t: uint32_t
+ :throws TypeError: When arguments of inappropriate types.
"""
- _ldns.ldns_pkt_set_querytime(self,t)
+ _ldns.ldns_pkt_set_querytime(self, t)
#parameters: ldns_pkt *,uint32_t,
#retvals:
- def set_question(self,rr):
- """directly set the question section
+ def set_question(self, rr):
+ """
+ Directly set the question section.
- :param rr:
- rrlist to set
+ :param rr: The rr list to set.
+ :type rr: :class:`ldns_rr_list`
+ :throws TypeError: When arguments of inappropriate types.
"""
- _ldns.ldns_pkt_set_question(self,rr)
+ _ldns._ldns_pkt_set_question(self, rr)
#parameters: ldns_pkt *,ldns_rr_list *,
#retvals:
- def set_ra(self,b):
- """Set the packet's ra bit.
+ def set_ra(self, b):
+ """
+ Set the packet's ra bit.
- :param b:
- the value to set (boolean)
+ :param b: The value to set.
+ :type b: bool
"""
- _ldns.ldns_pkt_set_ra(self,b)
+ _ldns.ldns_pkt_set_ra(self, b)
#parameters: ldns_pkt *,bool,
#retvals:
def set_random_id(self):
- """Set the packet's id to a random value.
+ """
+ Set the packet's id to a random value.
"""
_ldns.ldns_pkt_set_random_id(self)
#parameters: ldns_pkt *,
#retvals:
- def set_rcode(self,c):
- """Set the packet's respons code.
+ def set_rcode(self, c):
+ """
+ Set the packet's respons code.
- :param c:
- the rcode
+ :param c: The rcode.
+ :type c: uint8_t
+ :throws TypeError: When arguments of inappropriate types.
"""
- _ldns.ldns_pkt_set_rcode(self,c)
+ _ldns.ldns_pkt_set_rcode(self, c)
#parameters: ldns_pkt *,uint8_t,
#retvals:
- def set_rd(self,b):
- """Set the packet's rd bit.
+ def set_rd(self, b):
+ """
+ Set the packet's rd bit.
- :param b:
- the value to set (boolean)
+ :param b: The value to set.
+ :type b: bool
"""
- _ldns.ldns_pkt_set_rd(self,b)
+ _ldns.ldns_pkt_set_rd(self, b)
#parameters: ldns_pkt *,bool,
#retvals:
- def set_section_count(self,s,x):
- """Set a packet's section count to x.
+ def set_section_count(self, s, x):
+ """
+ Set a packet's section count to x.
- :param s:
- the section
- :param x:
- the section count
+ :param s: The section.
+ :type s: ldns_pkt_section
+ :param x: The section count.
+ :type x: uint16_t
+ :throws TypeError: When arguments of inappropriate types.
"""
- _ldns.ldns_pkt_set_section_count(self,s,x)
+ _ldns.ldns_pkt_set_section_count(self, s, x)
#parameters: ldns_pkt *,ldns_pkt_section,uint16_t,
#retvals:
- def set_size(self,s):
- """Set the packet's size.
+ def set_size(self, s):
+ """
+ Set the packet's size.
- :param s:
- the size
+ :param s: The size.
+ :type s: int
+ :throws TypeError: When arguments of inappropriate types.
"""
_ldns.ldns_pkt_set_size(self,s)
#parameters: ldns_pkt *,size_t,
#retvals:
- def set_tc(self,b):
- """Set the packet's tc bit.
+ def set_tc(self, b):
+ """
+ Set the packet's tc bit.
- :param b:
- the value to set (boolean)
+ :param b: The value to set.
+ :type b: bool
"""
- _ldns.ldns_pkt_set_tc(self,b)
+ _ldns.ldns_pkt_set_tc(self, b)
#parameters: ldns_pkt *,bool,
#retvals:
- def set_timestamp(self,timeval):
- _ldns.ldns_pkt_set_timestamp(self,timeval)
+ def set_timestamp(self, timeval):
+ """
+ Set the packet's time stamp.
+
+ :param timestamp: The time stamp.
+ :type timestamp: struct timeval
+ :throws TypeError: When arguments of inappropriate types.
+ """
+ _ldns.ldns_pkt_set_timestamp(self, timeval)
#parameters: ldns_pkt *,struct timeval,
#retvals:
- def set_tsig(self,t):
- """Set the packet's tsig rr.
+ def set_tsig(self, t):
+ """
+ Set the packet's tsig rr.
- :param t:
- the tsig rr
+ :param t: The tsig rr.
+ :type t: :class:`ldns_rr`
+ :throws TypeError: When arguments of inappropriate types.
"""
- _ldns.ldns_pkt_set_tsig(self,t)
+ _ldns._ldns_pkt_set_tsig(self, t)
#parameters: ldns_pkt *,ldns_rr *,
#retvals:
def size(self):
- """Return the packet's size in bytes.
+ """
+ Return the packet's size in bytes.
- :returns: (size_t) the size
+ :return: (size_t) The size.
"""
return _ldns.ldns_pkt_size(self)
#parameters: const ldns_pkt *,
#retvals: size_t
def tc(self):
- """Read the packet's tc bit.
+ """
+ Read the packet's tc bit.
- :returns: (bool) value of the bit
+ :return: (bool) Value of the bit.
"""
return _ldns.ldns_pkt_tc(self)
#parameters: const ldns_pkt *,
#retvals: bool
def timestamp(self):
- """Return the packet's timestamp.
+ """
+ Return the packet's time stamp.
- :returns: (struct timeval) the timestamp
+ :return: (struct timeval) The time stamp.
"""
return _ldns.ldns_pkt_timestamp(self)
#parameters: const ldns_pkt *,
#retvals: struct timeval
def tsig(self):
- """Return the packet's tsig pseudo rr's.
+ """
+ Return the packet's tsig pseudo rr's.
- :returns: (ldns_rr \*) the tsig rr
+ :return: (:class:`ldns_rr`) The tsig rr.
"""
- return _ldns.ldns_pkt_tsig(self)
+ return _ldns._ldns_pkt_tsig(self)
#parameters: const ldns_pkt *,
#retvals: ldns_rr *
- #_LDNS_PKT_METHODS#
+ #
+ # _LDNS_PKT_METHODS#
+ #
+
+ #
+ # LDNS update methods
+ #
+
+ #
+ # LDNS_METHODS_
+ #
- #LDNS update methods
- #LDNS_METHODS_#
- def update_pkt_tsig_add(self,r):
- """add tsig credentials to a packet from a resolver
+ def update_ad(self):
+ """
+ Get the ad count.
+
+ :return: (uint16_t) The ad count.
+ """
+ return _ldns.ldns_update_ad(self)
+ #parameters: ldns_pkt *
+ #retvals: uint16_t
+
+ def update_pkt_tsig_add(self, r):
+ """
+ Add tsig credentials to a packet from a resolver.
- :param r:
- resolver to copy from
- :returns: (ldns_status) status wether successfull or not
+ :param r: Resolver to copy from.
+ :type r: :class:`ldns_resolver`
+ :throws TypeError: When arguments of inappropriate types.
+ :return: (ldns_status) Status whether successful or not.
"""
- return _ldns.ldns_update_pkt_tsig_add(self,r)
+ return _ldns.ldns_update_pkt_tsig_add(self, r)
#parameters: ldns_pkt *,ldns_resolver *,
#retvals: ldns_status
def update_prcount(self):
- """Get the zo count.
+ """
+ Get the pr count.
- :returns: (uint16_t) the pr count
+ :return: (uint16_t) The pr count.
"""
return _ldns.ldns_update_prcount(self)
#parameters: const ldns_pkt *,
#retvals: uint16_t
- def update_set_adcount(self,c):
- """Set the ad count.
+ def update_set_adcount(self, c):
+ """
+ Set the ad count.
- :param c:
- the ad count to set
+ :param c: The ad count to set.
+ :type c: uint16_t
+ :throws TypeError: When arguments of inappropriate types.
"""
- _ldns.ldns_update_set_adcount(self,c)
+ _ldns.ldns_update_set_adcount(self, c)
#parameters: ldns_pkt *,uint16_t,
#retvals:
- def update_set_prcount(self,c):
- """Set the pr count.
+ def update_set_prcount(self, c):
+ """
+ Set the pr count.
- :param c:
- the pr count to set
+ :param c: The pr count to set.
+ :type c: uint16_t
+ :throws TypeError: When arguments of inappropriate types.
"""
- _ldns.ldns_update_set_prcount(self,c)
+ _ldns.ldns_update_set_prcount(self, c)
#parameters: ldns_pkt *,uint16_t,
#retvals:
- def update_set_upcount(self,c):
- """Set the up count.
+ def update_set_upcount(self, c):
+ """
+ Set the up count.
- :param c:
- the up count to set
+ :param c: The up count to set.
+ :type c: uint16_t
+ :throws TypeError: When arguments of inappropriate types.
"""
_ldns.ldns_update_set_upcount(self,c)
#parameters: ldns_pkt *,uint16_t,
#retvals:
- def update_set_zo(self,v):
- _ldns.ldns_update_set_zo(self,v)
+ def update_set_zo(self, c):
+ """
+ Set the zo count.
+
+ :param c: The zo count to set.
+ :type c: uint16_t
+ :throws TypeError: When arguments of inappropriate types.
+ """
+ _ldns.ldns_update_set_zo(self, c)
#parameters: ldns_pkt *,uint16_t,
#retvals:
def update_upcount(self):
- """Get the zo count.
+ """
+ Get the up count.
- :returns: (uint16_t) the up count
+ :return: (uint16_t) The up count.
"""
return _ldns.ldns_update_upcount(self)
#parameters: const ldns_pkt *,
#retvals: uint16_t
def update_zocount(self):
- """Get the zo count.
+ """
+ Get the zo count.
- :returns: (uint16_t) the zo count
+ :return: (uint16_t) The zo count.
"""
return _ldns.ldns_update_zocount(self)
#parameters: const ldns_pkt *,
#retvals: uint16_t
- #_LDNS_METHODS#
- %}
+ #
+ # _LDNS_METHODS
+ #
+ %}
}
diff --git a/contrib/python/ldns_rdf.i b/contrib/python/ldns_rdf.i
index edff4d624992..7b69d8b21768 100644
--- a/contrib/python/ldns_rdf.i
+++ b/contrib/python/ldns_rdf.i
@@ -205,7 +205,7 @@
case LDNS_RDF_TYPE_TIME: return "TIME";
case LDNS_RDF_TYPE_PERIOD: return "PERIOD";
case LDNS_RDF_TYPE_TSIGTIME: return "TSIGTIME";
- case LDNS_RDF_TYPE_TSIG: return "TSIG";
+ case LDNS_RDF_TYPE_HIP: return "HIP";
case LDNS_RDF_TYPE_INT16_DATA: return "INT16_DATA";
case LDNS_RDF_TYPE_SERVICE: return "SERVICE";
case LDNS_RDF_TYPE_LOC: return "LOC";
@@ -216,6 +216,11 @@
case LDNS_RDF_TYPE_NSEC3_SALT: return "NSEC3_SALT";
case LDNS_RDF_TYPE_NSEC3_NEXT_OWNER:
return "NSEC3_NEXT_OWNER";
+ case LDNS_RDF_TYPE_ILNP64: return "ILNP64";
+ case LDNS_RDF_TYPE_EUI48: return "EUI48";
+ case LDNS_RDF_TYPE_EUI64: return "EUI64";
+ case LDNS_RDF_TYPE_TAG: return "TAG";
+ case LDNS_RDF_TYPE_LONG_STR: return "LONG_STR";
}
}
return 0;
@@ -223,6 +228,26 @@
%}
+%inline
+%{
+ /*!
+ * @brief Returns the rdf data organised into a list of bytes.
+ */
+ PyObject * ldns_rdf_data_as_bytearray(const ldns_rdf *rdf)
+ {
+ Py_ssize_t len;
+ uint8_t *data;
+
+ assert(rdf != NULL);
+
+ len = ldns_rdf_size(rdf);
+ data = ldns_rdf_data(rdf);
+
+ return PyByteArray_FromStringAndSize((char *) data, len);
+ }
+%}
+
+
/* ========================================================================= */
/* Encapsulating Python code. */
/* ========================================================================= */
@@ -463,6 +488,16 @@ specified in the (16-bit) type field with a value from ldns_rdf_type."
#parameters: const ldns_rdf *,
#retvals: uint8_t *
+ def data_as_bytearray(self):
+ """
+ Returns the data of the rdf as a bytearray.
+
+ :return: (bytearray) Bytearray containing the rdf data.
+ """
+ return _ldns.ldns_rdf_data_as_bytearray(self)
+ #parameters: const ldns_rdf *,
+ #retvals: bytearray
+
def get_type(self):
"""
Returns the type of the rdf.
@@ -818,7 +853,8 @@ specified in the (16-bit) type field with a value from ldns_rdf_type."
Returns a clone of the given dname with the labels reversed.
When reversing non-dnames a "." (root name) dname is returned.
-
+
+ :throws Exception: When used on non-dname rdfs.
:return: (:class:`ldns_rdf`) Clone of the dname with the labels
reversed or ".".
@@ -831,6 +867,8 @@ specified in the (16-bit) type field with a value from ldns_rdf_type."
" to be deprecated in future releases." +
" Convert the ldns_rdf to ldsn_dname and the use its" +
" methods.", PendingDeprecationWarning, stacklevel=2)
+ if self.get_type() != _ldns.LDNS_RDF_TYPE_DNAME:
+ raise Exception("Operand must be a dname rdf.")
return _ldns.ldns_dname_reverse(self)
#parameters: const ldns_rdf *,
#retvals: ldns_rdf *
diff --git a/contrib/python/ldns_resolver.i b/contrib/python/ldns_resolver.i
index b9640674b5a0..b926e65a81e7 100644
--- a/contrib/python/ldns_resolver.i
+++ b/contrib/python/ldns_resolver.i
@@ -14,8 +14,8 @@
* 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.
+ * 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
@@ -28,30 +28,41 @@
* 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.
- ******************************************************************************/
+ *****************************************************************************/
+
+/* ========================================================================= */
+/* SWIG setting and definitions. */
+/* ========================================================================= */
+
+/* Creates temporary instance of (ldns_rersolver *). */
%typemap(in,numinputs=0,noblock=1) (ldns_resolver **r)
{
- ldns_resolver *$1_res;
- $1 = &$1_res;
+ ldns_resolver *$1_res;
+ $1 = &$1_res;
}
-/* result generation */
+/* Result generation, appends (ldns_resolver *) after the result. */
%typemap(argout,noblock=1) (ldns_resolver **r)
{
- $result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj(SWIG_as_voidptr($1_res), SWIGTYPE_p_ldns_struct_resolver, SWIG_POINTER_OWN | 0 ));
+ $result = SWIG_Python_AppendOutput($result,
+ SWIG_NewPointerObj(SWIG_as_voidptr($1_res),
+ SWIGTYPE_p_ldns_struct_resolver, SWIG_POINTER_OWN | 0 ));
}
-//TODO: pop_nameserver a podobne funkce musi predat objekt do spravy PYTHONU!!
+%newobject ldns_resolver_new;
%newobject ldns_resolver_pop_nameserver;
%newobject ldns_resolver_query;
+%newobject ldns_resolver_search;
%newobject ldns_axfr_next;
+%newobject ldns_get_rr_list_addr_by_name;
+%newobject ldns_get_rr_list_name_by_addr;
%delobject ldns_resolver_deep_free;
%delobject ldns_resolver_free;
-%nodefaultctor ldns_struct_resolver; //no default constructor & destructor
-%nodefaultdtor ldns_struct_resolver;
+%nodefaultctor ldns_struct_resolver; /* No default constructor. */
+%nodefaultdtor ldns_struct_resolver; /* No default destructor. */
%ignore ldns_struct_resolver::_searchlist;
%ignore ldns_struct_resolver::_nameservers;
@@ -59,23 +70,225 @@
%rename(ldns_resolver) ldns_struct_resolver;
+
+/* Clone data on pull. */
+
+%newobject _ldns_axfr_last_pkt;
+%rename(__ldns_axfr_last_pkt) ldns_axfr_last_pkt;
+%inline
+%{
+ ldns_pkt * _ldns_axfr_last_pkt(const ldns_resolver *res)
+ {
+ return ldns_pkt_clone(ldns_axfr_last_pkt(res));
+ }
+%}
+
+%newobject _ldns_resolver_dnssec_anchors;
+%rename(__ldns_resolver_dnssec_anchors) ldns_resolver_dnssec_anchors;
+%inline
+%{
+ ldns_rr_list * _ldns_resolver_dnssec_anchors(const ldns_resolver *res)
+ {
+ return ldns_rr_list_clone(ldns_resolver_dnssec_anchors(res));
+ }
+%}
+
+%newobject _ldns_resolver_domain;
+%rename(__ldns_resolver_domain) ldns_resolver_domain;
+%inline
+%{
+ ldns_rdf * _ldns_resolver_domain(const ldns_resolver *res)
+ {
+ /* Prevents assertion failures. */
+ ldns_rdf *rdf;
+ rdf = ldns_resolver_domain(res);
+ if (rdf != NULL) {
+ rdf = ldns_rdf_clone(rdf);
+ }
+ return rdf;
+ }
+%}
+
+%newobject _ldns_resolver_tsig_algorithm;
+%rename(__ldns_resolver_tsig_algorithm) ldns_resolver_tsig_algorithm;
+%inline
+%{
+ char * _ldns_resolver_tsig_algorithm(const ldns_resolver *res)
+ {
+ char *str;
+ str = ldns_resolver_tsig_algorithm(res);
+ if (str != NULL) {
+ str = strdup(str);
+ }
+ return str;
+ }
+%}
+
+%newobject _ldns_resolver_tsig_keydata;
+%rename(__ldns_resolver_tsig_keydata) ldns_resolver_tsig_keydata;
+%inline
+%{
+ char * _ldns_resolver_tsig_keydata(const ldns_resolver *res)
+ {
+ char *str;
+ str = ldns_resolver_tsig_keydata(res);
+ if (str != NULL) {
+ str = strdup(str);
+ }
+ return str;
+ }
+%}
+
+%newobject _ldns_resolver_tsig_keyname;
+%rename(__ldns_resolver_tsig_keyname) ldns_resolver_tsig_keyname;
+%inline
+%{
+ char * _ldns_resolver_tsig_keyname(const ldns_resolver *res)
+ {
+ char *str;
+ str = ldns_resolver_tsig_keyname(res);
+ if (str != NULL) {
+ str = strdup(str);
+ }
+ return str;
+ }
+%}
+
+/* End of pull cloning. */
+
+/* Clone data on push. */
+
+%rename(__ldns_resolver_set_dnssec_anchors) ldns_resolver_set_dnssec_anchors;
+%inline
+%{
+ void _ldns_resolver_set_dnssec_anchors(ldns_resolver *res,
+ ldns_rr_list * rrl)
+ {
+ ldns_rr_list *rrl_clone = NULL;
+ if (rrl != NULL) {
+ rrl_clone = ldns_rr_list_clone(rrl);
+ }
+ /* May leak memory, when overwriting pointer value. */
+ ldns_resolver_set_dnssec_anchors(res, rrl_clone);
+ }
+%}
+
+%rename(__ldns_resolver_set_domain) ldns_resolver_set_domain;
+%inline
+%{
+ void _ldns_resolver_set_domain(ldns_resolver *res, ldns_rdf *rdf)
+ {
+ ldns_rdf *rdf_clone = NULL;
+ if (rdf != NULL) {
+ rdf_clone = ldns_rdf_clone(rdf);
+ }
+ /* May leak memory, when overwriting pointer value. */
+ ldns_resolver_set_domain(res, rdf_clone);
+ }
+%}
+
+/* End of push cloning. */
+
+
+/* ========================================================================= */
+/* Debugging related code. */
+/* ========================================================================= */
+
#ifdef LDNS_DEBUG
%rename(__ldns_resolver_deep_free) ldns_resolver_deep_free;
%rename(__ldns_resolver_free) ldns_resolver_free;
-%inline %{
-void _ldns_resolver_free (ldns_resolver* r) {
- printf("******** LDNS_RESOLVER deep free 0x%lX ************\n", (long unsigned int)r);
- ldns_resolver_deep_free(r);
-}
+%inline
+%{
+ /*!
+ * @brief Prints information about deallocated resolver and deallocates.
+ */
+ void _ldns_resolver_deep_free(ldns_resolver *r)
+ {
+ printf("******** LDNS_RESOLVER deep free 0x%lX ************\n",
+ (long unsigned int) r);
+ ldns_resolver_deep_free(r);
+ }
+
+ /*!
+ * @brief Prints information about deallocated resolver and deallocates.
+ *
+ * @note There should be no need to use this function in the wrapper code, as
+ * it is likely to leak memory.
+ */
+ void _ldns_resolver_free(ldns_resolver *r)
+ {
+ printf("******** LDNS_RESOLVER free 0x%lX ************\n",
+ (long unsigned int) r);
+ ldns_resolver_free(r);
+ }
%}
-#else
+#else /* !LDNS_DEBUG */
%rename(_ldns_resolver_deep_free) ldns_resolver_deep_free;
%rename(_ldns_resolver_free) ldns_resolver_free;
-#endif
+#endif /* LDNS_DEBUG */
+
+
+/* ========================================================================= */
+/* Added C code. */
+/* ========================================================================= */
+
+%newobject _replacement_ldns_resolver_trusted_key;
+%inline
+%{
+ /*!
+ * @brief Replaces the rrs in the list with their clones.
+ *
+ * Prevents memory corruption when automatically deallocating list content.
+ */
+ void _rr_list_replace_content_with_clones(ldns_rr_list *rrl)
+ {
+ size_t count;
+ unsigned int i;
+
+ if (rrl == NULL) {
+ return;
+ }
+
+ count = ldns_rr_list_rr_count(rrl);
+ for (i = 0; i < count; ++i) {
+ ldns_rr_list_set_rr(rrl,
+ ldns_rr_clone(ldns_rr_list_rr(rrl, i)),
+ i);
+ }
+ }
+
+ /*
+ * @brief Behaves similarly to ldns_resolver_trusted_key().
+ *
+ * Prevents memory leakage by controlling the usage of content cloning.
+ *
+ * @return Newly allocated list of trusted key clones if any found,
+ * NULL else.
+ */
+ ldns_rr_list * _replacement_ldns_resolver_trusted_key(
+ const ldns_resolver *res, ldns_rr_list *keys)
+ {
+ ldns_rr_list *trusted_keys = ldns_rr_list_new();
+
+ if (ldns_resolver_trusted_key(res, keys, trusted_keys)) {
+ _rr_list_replace_content_with_clones(trusted_keys);
+ } else {
+ ldns_rr_list_deep_free(trusted_keys); trusted_keys = NULL;
+ }
+
+ return trusted_keys;
+ }
+%}
+
+
+/* ========================================================================= */
+/* Encapsulating Python code. */
+/* ========================================================================= */
%feature("docstring") ldns_struct_resolver "LDNS resolver object.
-The ldns_resolver object keeps a list of nameservers and can perform queries.
+The :class:`ldns_resolver` object keeps a list of name servers and can perform
+queries.
**Usage**
@@ -86,74 +299,146 @@ The ldns_resolver object keeps a list of nameservers and can perform queries.
>>> print pkt.answer()
www.nic.cz. 1757 IN A 217.31.205.50
-This simple example instances a resolver in order to resolve www.nic.cz record of A type.
-"
+This simple example instances a resolver in order to resolve www.nic.cz A type
+record."
%extend ldns_struct_resolver {
- %pythoncode %{
+ %pythoncode
+ %{
def __init__(self):
- raise Exception("This class can't be created directly. Please use: new_frm_file(filename), new_frm_fp(file) or new_frm_fp_l(file,line)")
+ """
+ Cannot be created directly from Python.
+ """
+ raise Exception("This class can't be created directly. " +
+ "Please use: new_frm_file(filename), new_frm_fp(file) " +
+ "or new_frm_fp_l(file, line)")
- __swig_destroy__ = _ldns._ldns_resolver_free
+ __swig_destroy__ = _ldns._ldns_resolver_deep_free
+
+ #
+ # LDNS_RESOLVER_CONSTRUCTORS_
+ #
+
+ @staticmethod
+ def new():
+ """
+ Creates a new resolver object.
+
+ :return: (:class:`ldns_resolver`) New resolver object or None.
+
+ .. note::
+ The returned resolver object is unusable unless some
+ name servers are added.
+
+ **Usage**
+ >>> resolver = ldns.ldns_resolver.new()
+ >>> ns_addr = ldns.ldns_rdf.new_frm_str("8.8.8.8", ldns.LDNS_RDF_TYPE_A)
+ >>> if not ns_addr: raise Exception("Can't create resolver address.")
+ >>> status = resolver.push_nameserver(ns_addr)
+ >>> if status != ldns.LDNS_STATUS_OK: raise Exception("Can't push resolver address.")
+ >>> pkt = resolver.query("www.nic.cz.", ldns.LDNS_RR_TYPE_A, ldns.LDNS_RR_CLASS_IN, ldns.LDNS_RD)
+ >>> if (pkt) and (pkt.answer()):
+ >>> print pkt.answer()
+ www.nic.cz. 1265 IN A 217.31.205.50
+ """
+ return _ldns.ldns_resolver_new()
- #LDNS_RESOLVER_CONSTRUCTORS_#
@staticmethod
def new_frm_file(filename = "/etc/resolv.conf", raiseException=True):
- """Creates a resolver object from given filename
-
- :param filename: name of file which contains informations (usually /etc/resolv.conf)
- :param raiseException: if True, an exception occurs in case a resolver object can't be created
- :returns: resolver object or None. If the object can't be created and raiseException is True, an exception occurs.
+ """
+ Creates a resolver object from given file name
+
+ :param filename: Name of file which contains resolver
+ informations (usually /etc/resolv.conf).
+ :type filename: str
+ :param raiseException: If True, an exception occurs in case a
+ resolver object can't be created.
+ :type raiseException: bool
+ :throws TypeError: When arguments of inappropriate types.
+ :throws Exception: When `raiseException` set and resolver
+ couldn't be created.
+ :return: (:class:`ldns_resolver`) Resolver object or None.
+ An exception occurs if the object can't be created and
+ 'raiseException' is True.
"""
status, resolver = _ldns.ldns_resolver_new_frm_file(filename)
if status != LDNS_STATUS_OK:
- if (raiseException): raise Exception("Can't create resolver, error: %d" % status)
+ if (raiseException):
+ raise Exception("Can't create resolver, error: %d" % status)
return None
return resolver
@staticmethod
def new_frm_fp(file, raiseException=True):
- """Creates a resolver object from file
+ """
+ Creates a resolver object from file
- :param file: a file object
- :param raiseException: if True, an exception occurs in case a resolver object can't be created
- :returns: resolver object or None. If the object can't be created and raiseException is True, an exception occurs.
+ :param file: A file object.
+ :type file: file
+ :param raiseException: If True, an exception occurs in case a
+ resolver object can't be created.
+ :type raiseException: bool
+ :throws TypeError: When arguments of inappropriate types.
+ :throws Exception: When `raiseException` set and resolver
+ couldn't be created.
+ :return: (:class:`ldns_resolver`) Resolver object or None.
+ An exception occurs if the object can't be created and
+ `raiseException` is True.
"""
status, resolver = _ldns.ldns_resolver_new_frm_fp(file)
if status != LDNS_STATUS_OK:
- if (raiseException): raise Exception("Can't create resolver, error: %d" % status)
+ if (raiseException):
+ raise Exception("Can't create resolver, error: %d" % status)
return None
return resolver
@staticmethod
def new_frm_fp_l(file, raiseException=True):
- """Creates a resolver object from file
+ """
+ Creates a resolver object from file
- :param file: a file object
- :param raiseException: if True, an exception occurs in case a resolver instance can't be created
- :returns:
- * resolver - resolver instance or None. If an instance can't be created and raiseException is True, an exception occurs.
+ :param file: A file object.
+ :type file: file
+ :param raiseException: If True, an exception occurs in case a
+ resolver instance can't be created.
+ :type raiseException: bool
+ :throws TypeError: When arguments of inappropriate types.
+ :throws Exception: When `raiseException` set and resolver
+ couldn't be created.
+ :return:
+ * (:class:`ldns_resolver`) Resolver instance or None.
+ An exception occurs if an instance can't be created and
+ `raiseException` is True.
- * line - the line number (for debugging)
+ * (int) - The line number. (e.g., for debugging)
"""
status, resolver, line = _ldns.ldns_resolver_new_frm_fp_l(file)
if status != LDNS_STATUS_OK:
- if (raiseException): raise Exception("Can't create resolver, error: %d" % status)
+ if (raiseException):
+ raise Exception("Can't create resolver, error: %d" % status)
return None
return resolver, line
- #_LDNS_RESOLVER_CONSTRUCTORS#
+ #
+ # _LDNS_RESOLVER_CONSTRUCTORS
+ #
# High level functions
- def get_addr_by_name(self, name, aclass = _ldns.LDNS_RR_CLASS_IN, flags = _ldns.LDNS_RD):
- """Ask the resolver about name and return all address records
- :param name: (ldns_rdf) the name to look for
- :param aclass: the class to use
- :param flags: give some optional flags to the query
+ def get_addr_by_name(self, name, aclass = _ldns.LDNS_RR_CLASS_IN, flags = _ldns.LDNS_RD):
+ """
+ Ask the resolver about name and return all address records.
- :returns: RR List object or None
+ :param name: The name to look for. String is automatically
+ converrted to dname.
+ :type name: :class:`ldns_dname` or str
+ :param aclass: The class to use.
+ :type aclass: ldns_rr_class
+ :param flags: Give some optional flags to the query.
+ :type flags: uint16_t
+ :throws TypeError: When arguments of inappropriate types.
+ :return: (:class:`ldns_rr_list`) RR List object or None.
**Usage**
>>> addr = resolver.get_addr_by_name("www.google.com", ldns.LDNS_RR_CLASS_IN, ldns.LDNS_RD)
@@ -164,7 +449,6 @@ This simple example instances a resolver in order to resolve www.nic.cz record o
www.l.google.com. 300 IN A 74.125.43.103
www.l.google.com. 300 IN A 74.125.43.104
www.l.google.com. 300 IN A 74.125.43.147
-
"""
rdf = name
if isinstance(name, str):
@@ -172,13 +456,19 @@ This simple example instances a resolver in order to resolve www.nic.cz record o
return _ldns.ldns_get_rr_list_addr_by_name(self, rdf, aclass, flags)
def get_name_by_addr(self, addr, aclass = _ldns.LDNS_RR_CLASS_IN, flags = _ldns.LDNS_RD):
- """Ask the resolver about the address and return the name
-
- :param name: (ldns_rdf of A or AAAA type) the addr to look for. If a string is given, A or AAAA type is identified automatically
- :param aclass: the class to use
- :param flags: give some optional flags to the query
+ """
+ Ask the resolver about the address and return the name.
- :returns: RR List object or None
+ :param name: (ldns_rdf of A or AAAA type) the addr to look for.
+ If a string is given, A or AAAA type is identified
+ automatically.
+ :type name: :class:`ldns_rdf` of A or AAAA type
+ :param aclass: The class to use.
+ :type aclass: ldns_rr_class
+ :param flags: Give some optional flags to the query.
+ :type flags: uint16_t
+ :throws TypeError: When arguments of inappropriate types.
+ :return: (:class:`ldns_rr_list`) RR List object or None.
**Usage**
>>> addr = resolver.get_name_by_addr("74.125.43.99", ldns.LDNS_RR_CLASS_IN, ldns.LDNS_RD)
@@ -191,23 +481,70 @@ This simple example instances a resolver in order to resolve www.nic.cz record o
rdf = addr
if isinstance(addr, str):
if (addr.find("::") >= 0): #IPv6
- rdf = _ldns.ldns_rdf_new_frm_str(_ldns.LDNS_RDF_TYPE_AAAA, addr)
+ rdf = _ldns.ldns_rdf_new_frm_str(_ldns.LDNS_RDF_TYPE_AAAA, addr)
else:
- rdf = _ldns.ldns_rdf_new_frm_str(_ldns.LDNS_RDF_TYPE_A, addr)
+ rdf = _ldns.ldns_rdf_new_frm_str(_ldns.LDNS_RDF_TYPE_A, addr)
return _ldns.ldns_get_rr_list_name_by_addr(self, rdf, aclass, flags)
def print_to_file(self,output):
- """Print a resolver (in sofar that is possible) state to output."""
+ """Print a resolver (in so far that is possible) state to output."""
_ldns.ldns_resolver_print(output,self)
+ def axfr_complete(self):
+ """
+ Returns True if the axfr transfer has completed
+ (i.e., 2 SOA RRs and no errors were encountered).
+
+ :return: (bool)
+ """
+ return _ldns.ldns_axfr_complete(self)
+ #parameters: const ldns_resolver *,
+ #retvals: bool
+
+ def axfr_last_pkt(self):
+ """
+ Returns a last packet that was sent by the server in the AXFR
+ transfer (usable for instance to get the error code on failure).
+
+ :return: (:class:`ldns_pkt`) Last packet of the AXFR transfer.
+ """
+ return _ldns._ldns_axfr_last_pkt(self)
+ #parameters: const ldns_resolver *,
+ #retvals: ldns_pkt *
+
+ def axfr_next(self):
+ """
+ Get the next stream of RRs in a AXFR.
+
+ :return: (:class:`ldns_rr`) The next RR from the AXFR stream.
+ """
+ return _ldns.ldns_axfr_next(self)
+ #parameters: ldns_resolver *,
+ #retvals: ldns_rr *
+
def axfr_start(self, domain, aclass):
- """Prepares the resolver for an axfr query. The query is sent and the answers can be read with axfr_next
+ """
+ Prepares the resolver for an axfr query. The query is sent and
+ the answers can be read with :meth:`axfr_next`.
+
+ :param domain: Domain to axfr.
+ :type domain: :class:`dlsn_dname`
+ :param aclass: The class to use.
+ :type aclass: ldns_rr_class
+ :throws TypeError: When arguments of inappropriate types.
+ :return: (ldns_status) The status of the transfer.
+
+ .. note::
+ The type checking of parameter `domain` is benevolent.
+ It allows also to pass a dname :class:`ldns_rdf` object.
+ This will probably change in future.
**Usage**
::
status = resolver.axfr_start("nic.cz", ldns.LDNS_RR_CLASS_IN)
- if (status != ldns.LDNS_STATUS_OK): raise Exception("Can't start AXFR, error: %s" % ldns.ldns_get_errorstr_by_id(status))
+ if (status != ldns.LDNS_STATUS_OK):
+ raise Exception("Can't start AXFR, error: %s" % ldns.ldns_get_errorstr_by_id(status))
#Print the results
while True:
rr = resolver.axfr_next()
@@ -215,8 +552,8 @@ This simple example instances a resolver in order to resolve www.nic.cz record o
break
print rr
-
"""
+ # TODO -- Add checking for ldns_rdf and ldns_dname.
rdf = domain
if isinstance(domain, str):
rdf = _ldns.ldns_dname_new_frm_str(domain)
@@ -224,723 +561,894 @@ This simple example instances a resolver in order to resolve www.nic.cz record o
#parameters: ldns_resolver *resolver, ldns_rdf *domain, ldns_rr_class c
#retvals: int
- def axfr_complete(self):
- """returns true if the axfr transfer has completed (i.e. 2 SOA RRs and no errors were encountered)"""
- return _ldns.ldns_axfr_complete(self)
- #parameters: const ldns_resolver *,
- #retvals: bool
+ #
+ # LDNS_RESOLVER_METHODS_
+ #
- def axfr_last_pkt(self):
- """returns a pointer to the last ldns_pkt that was sent by the server in the AXFR transfer uasable for instance to get the error code on failure"""
- return _ldns.ldns_axfr_last_pkt(self)
- #parameters: const ldns_resolver *,
- #retvals: ldns_pkt *
-
- def axfr_next(self):
- """get the next stream of RRs in a AXFR"""
- return _ldns.ldns_axfr_next(self)
- #parameters: ldns_resolver *,
- #retvals: ldns_rr *
-
- #LDNS_RESOLVER_METHODS_#
def debug(self):
- """Get the debug status of the resolver.
+ """
+ Get the debug status of the resolver.
- :returns: (bool) true if so, otherwise false
+ :return: (bool) True if so, otherwise False.
"""
return _ldns.ldns_resolver_debug(self)
#parameters: const ldns_resolver *,
#retvals: bool
def dec_nameserver_count(self):
- """Decrement the resolver's nameserver count.
+ """
+ Decrement the resolver's name server count.
"""
_ldns.ldns_resolver_dec_nameserver_count(self)
#parameters: ldns_resolver *,
#retvals:
def defnames(self):
+ """
+ Does the resolver apply default domain name.
+
+ :return: (bool)
+ """
return _ldns.ldns_resolver_defnames(self)
#parameters: const ldns_resolver *,
#retvals: bool
def dnsrch(self):
+ """
+ Does the resolver apply search list.
+
+ :return: (bool)
+ """
return _ldns.ldns_resolver_dnsrch(self)
#parameters: const ldns_resolver *,
#retvals: bool
def dnssec(self):
- """Does the resolver do DNSSEC.
+ """
+ Does the resolver do DNSSEC.
- :returns: (bool) true: yes, false: no
+ :return: (bool) True: yes, False: no.
"""
return _ldns.ldns_resolver_dnssec(self)
#parameters: const ldns_resolver *,
#retvals: bool
def dnssec_anchors(self):
- """Get the resolver's DNSSEC anchors.
+ """
+ Get the resolver's DNSSEC anchors.
- :returns: (ldns_rr_list \*) an rr_list containg trusted DNSSEC anchors
+ :return: (:class:`ldns_rr_list`) An rr list containing trusted
+ DNSSEC anchors.
"""
- return _ldns.ldns_resolver_dnssec_anchors(self)
+ return _ldns._ldns_resolver_dnssec_anchors(self)
#parameters: const ldns_resolver *,
#retvals: ldns_rr_list *
def dnssec_cd(self):
- """Does the resolver set the CD bit.
+ """
+ Does the resolver set the CD bit.
- :returns: (bool) true: yes, false: no
+ :return: (bool) True: yes, False: no.
"""
return _ldns.ldns_resolver_dnssec_cd(self)
#parameters: const ldns_resolver *,
#retvals: bool
def domain(self):
- """What is the default dname to add to relative queries.
+ """
+ What is the default dname to add to relative queries.
- :returns: (ldns_rdf \*) the dname which is added
+ :return: (:class:`ldns_dname`) The dname which is added.
"""
- return _ldns.ldns_resolver_domain(self)
+ dname = _ldns._ldns_resolver_domain(self)
+ if dname != None:
+ return ldns_dname(_ldns._ldns_resolver_domain(self), clone=False)
+ else:
+ return dname
#parameters: const ldns_resolver *,
#retvals: ldns_rdf *
def edns_udp_size(self):
- """Get the resolver's udp size.
+ """
+ Get the resolver's udp size.
- :returns: (uint16_t) the udp mesg size
+ :return: (uint16_t) The udp mesg size.
"""
return _ldns.ldns_resolver_edns_udp_size(self)
#parameters: const ldns_resolver *,
#retvals: uint16_t
def fail(self):
- """Does the resolver only try the first nameserver.
+ """
+ Does the resolver only try the first name server.
- :returns: (bool) true: yes, fail, false: no, try the others
+ :return: (bool) True: yes, fail, False: no, try the others.
"""
return _ldns.ldns_resolver_fail(self)
#parameters: const ldns_resolver *,
#retvals: bool
def fallback(self):
- """Get the truncation fallback status.
+ """
+ Get the truncation fall-back status.
- :returns: (bool) whether the truncation fallback mechanism is used
+ :return: (bool) Whether the truncation fall*back mechanism
+ is used.
"""
return _ldns.ldns_resolver_fallback(self)
#parameters: const ldns_resolver *,
#retvals: bool
def igntc(self):
- """Does the resolver ignore the TC bit (truncated).
+ """
+ Does the resolver ignore the TC bit (truncated).
- :returns: (bool) true: yes, false: no
+ :return: (bool) True: yes, False: no.
"""
return _ldns.ldns_resolver_igntc(self)
#parameters: const ldns_resolver *,
#retvals: bool
def incr_nameserver_count(self):
- """Incremental the resolver's nameserver count.
+ """
+ Increment the resolver's name server count.
"""
_ldns.ldns_resolver_incr_nameserver_count(self)
#parameters: ldns_resolver *,
#retvals:
def ip6(self):
- """Does the resolver use ip6 or ip4.
+ """
+ Does the resolver use ip6 or ip4.
- :returns: (uint8_t) 0: both, 1: ip4, 2:ip6
+ :return: (uint8_t) 0: both, 1: ip4, 2:ip6
"""
return _ldns.ldns_resolver_ip6(self)
#parameters: const ldns_resolver *,
#retvals: uint8_t
def nameserver_count(self):
- """How many nameserver are configured in the resolver.
+ """
+ How many name server are configured in the resolver.
- :returns: (size_t) number of nameservers
+ :return: (size_t) Number of name servers.
"""
return _ldns.ldns_resolver_nameserver_count(self)
#parameters: const ldns_resolver *,
#retvals: size_t
- def nameserver_rtt(self,pos):
- """Return the used round trip time for a specific nameserver.
+ def nameserver_rtt(self, pos):
+ """
+ Return the used round trip time for a specific name server.
- :param pos:
- the index to the nameserver
- :returns: (size_t) the rrt, 0: infinite, >0: undefined (as of * yet)
+ :param pos: The index to the name server.
+ :type pos: size_t
+ :throws TypeError: When arguments of inappropriate types.
+ :return: (size_t) The rrt, 0: infinite,
+ >0: undefined (as of * yet).
"""
- return _ldns.ldns_resolver_nameserver_rtt(self,pos)
+ return _ldns.ldns_resolver_nameserver_rtt(self, pos)
#parameters: const ldns_resolver *,size_t,
#retvals: size_t
def nameservers(self):
- """Return the configured nameserver ip address.
+ """
+ Return the configured name server ip address.
- :returns: (ldns_rdf \*\*) a ldns_rdf pointer to a list of the addresses
+ :return: (ldns_rdf \*\*) A ldns_rdf pointer to a list of the
+ addresses.
"""
+ # TODO -- Convert to list of ldns_rdf.
return _ldns.ldns_resolver_nameservers(self)
#parameters: const ldns_resolver *,
#retvals: ldns_rdf **
def nameservers_randomize(self):
- """randomize the nameserver list in the resolver
+ """
+ Randomize the name server list in the resolver.
"""
_ldns.ldns_resolver_nameservers_randomize(self)
#parameters: ldns_resolver *,
#retvals:
def pop_nameserver(self):
- """pop the last nameserver from the resolver.
+ """
+ Pop the last name server from the resolver.
- :returns: (ldns_rdf \*) the popped address or NULL if empty
+ :return: (:class:`ldns_rdf`) The popped address or None if empty.
"""
return _ldns.ldns_resolver_pop_nameserver(self)
#parameters: ldns_resolver *,
#retvals: ldns_rdf *
def port(self):
- """Get the port the resolver should use.
+ """
+ Get the port the resolver should use.
- :returns: (uint16_t) the port number
+ :return: (uint16_t) The port number.
"""
return _ldns.ldns_resolver_port(self)
#parameters: const ldns_resolver *,
#retvals: uint16_t
- def prepare_query_pkt(self,name,t,c,f):
- """Form a query packet from a resolver and name/type/class combo.
-
- :param name:
- :param t:
- query for this type (may be 0, defaults to A)
- :param c:
- query for this class (may be 0, default to IN)
- :param f:
- the query flags
- :returns: * (ldns_status) ldns_pkt* a packet with the reply from the nameserver
- * (ldns_pkt \*\*) query packet class
+ def prepare_query_pkt(self, name, t, c, f, raiseException=True):
+ """
+ Form a query packet from a resolver and name/type/class combo.
+
+ :param name: Query for this name.
+ :type name: :class:`ldns_dname` or str
+ :param t: Query for this type (may be 0, defaults to A).
+ :type t: ldns_rr_type
+ :param c: Query for this class (may be 0, default to IN).
+ :type c: ldns_rr_class
+ :param f: The query flags.
+ :type f: uint16_t
+ :throws TypeError: When arguments of inappropriate types.
+ :throws Exception: When `raiseException` set and answer
+ couldn't be resolved.
+ :return: (:class:`ldns_pkt`) Query packet or None.
+ An exception occurs if the object can't be created and
+ 'raiseException' is True.
"""
- return _ldns.ldns_resolver_prepare_query_pkt(self,name,t,c,f)
+ rdf = name
+ if isinstance(name, str):
+ rdf = _ldns.ldns_dname_new_frm_str(name)
+ status, pkt = _ldns.ldns_resolver_prepare_query_pkt(self, rdf, t, c, f)
+ if status != LDNS_STATUS_OK:
+ if (raiseException):
+ raise Exception("Can't create resolver, error: %d" % status)
+ return None
+ return pkt
#parameters: ldns_resolver *,const ldns_rdf *,ldns_rr_type,ldns_rr_class,uint16_t,
#retvals: ldns_status,ldns_pkt **
- def push_dnssec_anchor(self,rr):
- """Push a new trust anchor to the resolver.
-
- It must be a DS or DNSKEY rr
+ def push_dnssec_anchor(self, rr):
+ """
+ Push a new trust anchor to the resolver.
+ It must be a DS or DNSKEY rr.
- :param rr:
- the RR to add as a trust anchor.
- :returns: (ldns_status) a status
+ :param rr: The RR to add as a trust anchor.
+ :type rr: DS of DNSKEY :class:`ldns_rr`
+ :throws TypeError: When arguments of inappropriate types.
+ :return: (ldns_status) A status.
"""
- return _ldns.ldns_resolver_push_dnssec_anchor(self,rr)
+ return _ldns.ldns_resolver_push_dnssec_anchor(self, rr)
#parameters: ldns_resolver *,ldns_rr *,
#retvals: ldns_status
- def push_nameserver(self,n):
- """push a new nameserver to the resolver.
-
+ def push_nameserver(self, n):
+ """
+ Push a new name server to the resolver.
It must be an IP address v4 or v6.
- :param n:
- the ip address
- :returns: (ldns_status) ldns_status a status
+ :param n: The ip address.
+ :type n: :class:`ldns_rdf` of A or AAAA type.
+ :throws TypeError: When arguments of inappropriate types.
+ :return: (ldns_status) A status.
"""
- return _ldns.ldns_resolver_push_nameserver(self,n)
+ return _ldns.ldns_resolver_push_nameserver(self, n)
#parameters: ldns_resolver *,ldns_rdf *,
#retvals: ldns_status
- def push_nameserver_rr(self,rr):
- """push a new nameserver to the resolver.
-
- It must be an A or AAAA RR record type
+ def push_nameserver_rr(self, rr):
+ """
+ Push a new name server to the resolver.
+ It must be an A or AAAA RR record type.
- :param rr:
- the resource record
- :returns: (ldns_status) ldns_status a status
+ :param rr: The resource record.
+ :type rr: :class:`ldns_rr` of A or AAAA type.
+ :throws TypeError: When arguments of inappropriate types.
+ :return: (ldns_status) A status.
"""
- return _ldns.ldns_resolver_push_nameserver_rr(self,rr)
+ return _ldns.ldns_resolver_push_nameserver_rr(self, rr)
#parameters: ldns_resolver *,ldns_rr *,
#retvals: ldns_status
- def push_nameserver_rr_list(self,rrlist):
- """push a new nameserver rr_list to the resolver.
+ def push_nameserver_rr_list(self, rrlist):
+ """
+ Push a new name server rr_list to the resolver.
- :param rrlist:
- the rr_list to push
- :returns: (ldns_status) ldns_status a status
+ :param rrlist: The rr list to push.
+ :type rrlist: :class:`ldns_rr_list`
+ :throws TypeError: When arguments of inappropriate types.
+ :return: (ldns_status) A status.
"""
- return _ldns.ldns_resolver_push_nameserver_rr_list(self,rrlist)
+ return _ldns.ldns_resolver_push_nameserver_rr_list(self, rrlist)
#parameters: ldns_resolver *,ldns_rr_list *,
#retvals: ldns_status
- def push_searchlist(self,rd):
- """Push a new rd to the resolver's searchlist.
+ def push_searchlist(self, rd):
+ """
+ Push a new rd to the resolver's search-list.
- :param rd:
- to push
+ :param rd: To push.
+ :param rd: :class:`ldns_dname` or str
+ :throws TypeError: When arguments of inappropriate types.
+
+ .. note:
+ The function does not return any return status,
+ so the caller must ensure the correctness of the passed
+ values.
"""
- _ldns.ldns_resolver_push_searchlist(self,rd)
+ rdf = rd
+ if isinstance(rd, str):
+ rdf = _ldns.ldns_dname_new_frm_str(rd)
+ _ldns.ldns_resolver_push_searchlist(self, rdf)
#parameters: ldns_resolver *,ldns_rdf *,
#retvals:
def query(self,name,atype=_ldns.LDNS_RR_TYPE_A,aclass=_ldns.LDNS_RR_CLASS_IN,flags=_ldns.LDNS_RD):
- """Send a query to a nameserver.
-
- :param name: (ldns_rdf) the name to look for
- :param atype: the RR type to use
- :param aclass: the RR class to use
- :param flags: give some optional flags to the query
- :returns: (ldns_pkt) a packet with the reply from the nameserver if _defnames is true the default domain will be added
"""
- return _ldns.ldns_resolver_query(self,name,atype,aclass,flags)
+ Send a query to a name server.
+
+ :param name: The name to look for.
+ :type name: :class:`ldns_dname` or str
+ :param atype: The RR type to use.
+ :type atype: ldns_rr_type
+ :param aclass: The RR class to use.
+ :type aclass: ldns_rr_class
+ :param flags: Give some optional flags to the query.
+ :type flags: uint16_t
+ :throws TypeError: When arguments of inappropriate types.
+ :return: (:class:`ldns_pkt`) A packet with the reply from the
+ name server if _defnames is true the default domain will
+ be added.
+ """
+ # Explicit conversion from string to ldns_rdf prevents memory leaks.
+ # TODO -- Find out why.
+ dname = name
+ if isinstance(name, str):
+ dname = _ldns.ldns_dname_new_frm_str(name)
+ return _ldns.ldns_resolver_query(self, dname, atype, aclass, flags)
#parameters: const ldns_resolver *,const ldns_rdf *,ldns_rr_type,ldns_rr_class,uint16_t,
#retvals: ldns_pkt *
def random(self):
- """Does the resolver randomize the nameserver before usage.
+ """
+ Does the resolver randomize the name server before usage?
- :returns: (bool) true: yes, false: no
+ :return: (bool) True: yes, False: no.
"""
return _ldns.ldns_resolver_random(self)
#parameters: const ldns_resolver *,
#retvals: bool
def recursive(self):
- """Is the resolver set to recurse.
+ """
+ Is the resolver set to recurse?
- :returns: (bool) true if so, otherwise false
+ :return: (bool) True if so, otherwise False.
"""
return _ldns.ldns_resolver_recursive(self)
#parameters: const ldns_resolver *,
#retvals: bool
def retrans(self):
- """Get the retransmit interval.
+ """
+ Get the retransmit interval.
- :returns: (uint8_t) the retransmit interval
+ :return: (uint8_t) The retransmit interval.
"""
return _ldns.ldns_resolver_retrans(self)
#parameters: const ldns_resolver *,
#retvals: uint8_t
def retry(self):
- """Get the number of retries.
+ """
+ Get the number of retries.
- :returns: (uint8_t) the number of retries
+ :return: (uint8_t) The number of retries.
"""
return _ldns.ldns_resolver_retry(self)
#parameters: const ldns_resolver *,
#retvals: uint8_t
def rtt(self):
- """Return the used round trip times for the nameservers.
+ """
+ Return the used round trip times for the name servers.
- :returns: (size_t \*) a size_t* pointer to the list. yet)
+ :return: (size_t \*) a size_t* pointer to the list. yet)
"""
return _ldns.ldns_resolver_rtt(self)
#parameters: const ldns_resolver *,
#retvals: size_t *
- def search(self,rdf,t,c,flags):
- """Send the query for using the resolver and take the search list into account The search algorithm is as follows: If the name is absolute, try it as-is, otherwise apply the search list.
-
- :param rdf:
- :param t:
- query for this type (may be 0, defaults to A)
- :param c:
- query for this class (may be 0, default to IN)
- :param flags:
- the query flags
- :returns: (ldns_pkt \*) ldns_pkt* a packet with the reply from the nameserver
- """
- return _ldns.ldns_resolver_search(self,rdf,t,c,flags)
+ def search(self, name, atype=_ldns.LDNS_RR_TYPE_A, aclass=_ldns.LDNS_RR_CLASS_IN, flags=_ldns.LDNS_RD):
+ """
+ Send the query for using the resolver and take the search list
+ into account The search algorithm is as follows: If the name is
+ absolute, try it as-is, otherwise apply the search list.
+
+ :param name: The name to look for.
+ :type name: :class:`ldns_dname` or str
+ :param atype: The RR type to use.
+ :type atype: ldns_rr_type
+ :param aclass: The RR class to use.
+ :type aclass: ldns_rr_class
+ :param flags: Give some optional flags to the query.
+ :type flags: uint16_t
+ :throws TypeError: When arguments of inappropriate types.
+ :return: (:class:`ldns_pkt`) A packet with the reply from the
+ name server.
+ """
+ # Explicit conversion from string to ldns_rdf prevents memory leaks.
+ # TODO -- Find out why.
+ dname = name
+ if isinstance(name, str):
+ dname = _ldns.ldns_dname_new_frm_str(name)
+ return _ldns.ldns_resolver_search(self, dname, atype, aclass, flags)
#parameters: const ldns_resolver *,const ldns_rdf *,ldns_rr_type,ldns_rr_class,uint16_t,
#retvals: ldns_pkt *
def searchlist(self):
- """What is the searchlist as used by the resolver.
+ """
+ What is the search-list as used by the resolver.
- :returns: (ldns_rdf \*\*) a ldns_rdf pointer to a list of the addresses
+ :return: (ldns_rdf \*\*) A ldns_rdf pointer to a list of the addresses.
"""
return _ldns.ldns_resolver_searchlist(self)
#parameters: const ldns_resolver *,
#retvals: ldns_rdf \*\*
def searchlist_count(self):
- """Return the resolver's searchlist count.
+ """
+ Return the resolver's search-list count.
- :returns: (size_t) the searchlist count
+ :return: (size_t) The search-list count.
"""
return _ldns.ldns_resolver_searchlist_count(self)
#parameters: const ldns_resolver *,
#retvals: size_t
- def send(self,name,t,c,flags):
- """Send the query for name as-is.
-
- :param name:
- :param t:
- query for this type (may be 0, defaults to A)
- :param c:
- query for this class (may be 0, default to IN)
- :param flags:
- the query flags
- :returns: * (ldns_status) ldns_pkt* a packet with the reply from the nameserver
- * (ldns_pkt \*\*)
- """
- return _ldns.ldns_resolver_send(self,name,t,c,flags)
+ def send(self, name, atype, aclass, flags, raiseException=True):
+ """
+ Send the query for name as-is.
+
+ :param name: The name to look for.
+ :type name: :class:`ldns_dname` or str
+ :param atype: The RR type to use.
+ :type atype: ldns_rr_type
+ :param aclass: The RR class to use.
+ :type aclass: ldns_rr_class
+ :param flags: Give some optional flags to the query.
+ :type flags: uint16_t
+ :throws TypeError: When arguments of inappropriate types.
+ :throws Exception: When `raiseException` set and answer
+ couldn't be resolved.
+ :return: (:class:`ldns_pkt`) A packet with the reply from the
+ name server.
+ """
+ # Explicit conversion from string to ldns_rdf prevents memory leaks.
+ # TODO -- Find out why.
+ dname = name
+ if isinstance(name, str):
+ dname = _ldns.ldns_dname_new_frm_str(name)
+ status, pkt = _ldns.ldns_resolver_send(self, dname, atype, aclass, flags)
+ if status != LDNS_STATUS_OK:
+ if (raiseException):
+ raise Exception("Can't create resolver, error: %d" % status)
+ return None
+ return pkt
#parameters: ldns_resolver *,const ldns_rdf *,ldns_rr_type,ldns_rr_class,uint16_t,
#retvals: ldns_status,ldns_pkt **
- def send_pkt(self,query_pkt):
- """Send the given packet to a nameserver.
+ def send_pkt(self, query_pkt):
+ """
+ Send the given packet to a name server.
- :param query_pkt:
- :returns: * (ldns_status)
- * (ldns_pkt \*\*)
+ :param query_pkt: Query packet.
+ :type query_pkt: :class:`ldns_pkt`
+ :throws TypeError: When arguments of inappropriate types.
+ :return: * (ldns_status) Return status.
+ * (:class:`ldns_pkt`) Response packet if returns status ok.
"""
+ status, answer = _ldns.ldns_resolver_send_pkt(self, query_pkt)
return _ldns.ldns_resolver_send_pkt(self,query_pkt)
#parameters: ldns_resolver *,ldns_pkt *,
#retvals: ldns_status,ldns_pkt **
- def set_debug(self,b):
- """Set the resolver debugging.
+ def set_debug(self, b):
+ """
+ Set the resolver debugging.
- :param b:
- true: debug on: false debug off
+ :param b: True: debug on, False: debug off.
+ :type b: bool
"""
- _ldns.ldns_resolver_set_debug(self,b)
+ _ldns.ldns_resolver_set_debug(self, b)
#parameters: ldns_resolver *,bool,
#retvals:
- def set_defnames(self,b):
- """Whether the resolver uses the name set with _set_domain.
+ def set_defnames(self, b):
+ """
+ Whether the resolver uses the name set with _set_domain.
- :param b:
- true: use the defaults, false: don't use them
+ :param b: True: use the defaults, False: don't use them.
+ :type b: bool
"""
- _ldns.ldns_resolver_set_defnames(self,b)
+ _ldns.ldns_resolver_set_defnames(self, b)
#parameters: ldns_resolver *,bool,
#retvals:
- def set_dnsrch(self,b):
- """Whether the resolver uses the searchlist.
+ def set_dnsrch(self, b):
+ """
+ Whether the resolver uses the search list.
- :param b:
- true: use the list, false: don't use the list
+ :param b: True: use the list, False: don't use the list.
+ :type b: bool
"""
- _ldns.ldns_resolver_set_dnsrch(self,b)
+ _ldns.ldns_resolver_set_dnsrch(self, b)
#parameters: ldns_resolver *,bool,
#retvals:
- def set_dnssec(self,b):
- """Whether the resolver uses DNSSEC.
+ def set_dnssec(self, b):
+ """
+ Whether the resolver uses DNSSEC.
- :param b:
- true: use DNSSEC, false: don't use DNSSEC
+ :param b: True: use DNSSEC, False: don't use DNSSEC.
+ :type b: bool
"""
- _ldns.ldns_resolver_set_dnssec(self,b)
+ _ldns.ldns_resolver_set_dnssec(self, b)
#parameters: ldns_resolver *,bool,
#retvals:
- def set_dnssec_anchors(self,l):
- """Set the resolver's DNSSEC anchor list directly.
-
+ def set_dnssec_anchors(self, l):
+ """
+ Set the resolver's DNSSEC anchor list directly.
RRs should be of type DS or DNSKEY.
- :param l:
- the list of RRs to use as trust anchors
+ :param l: The list of RRs to use as trust anchors.
+ :type l: :class:`ldns_rr_list`
+ :throws TypeError: When arguments of inappropriate types.
"""
- _ldns.ldns_resolver_set_dnssec_anchors(self,l)
+ _ldns._ldns_resolver_set_dnssec_anchors(self, l)
#parameters: ldns_resolver *,ldns_rr_list *,
#retvals:
- def set_dnssec_cd(self,b):
- """Whether the resolver uses the checking disable bit.
+ def set_dnssec_cd(self, b):
+ """
+ Whether the resolver uses the checking disable bit.
- :param b:
- true: enable , false: don't use TCP
+ :param b: True: enable, False: disable.
+ :type b: bool
"""
- _ldns.ldns_resolver_set_dnssec_cd(self,b)
+ _ldns.ldns_resolver_set_dnssec_cd(self, b)
#parameters: ldns_resolver *,bool,
#retvals:
- def set_domain(self,rd):
- """Set the resolver's default domain.
-
- This gets appended when no absolute name is given
-
- :param rd:
- the name to append
- """
- _ldns.ldns_resolver_set_domain(self,rd)
+ def set_domain(self, rd):
+ """
+ Set the resolver's default domain.
+ This gets appended when no absolute name is given.
+
+ :param rd: The name to append.
+ :type rd: :class:`ldns_dname` or str
+ :throws TypeError: When arguments of inappropriate types.
+ :throws Exception: When `rd` a non dname rdf.
+
+ .. note::
+ The type checking of parameter `rd` is benevolent.
+ It allows also to pass a dname :class:`ldns_rdf` object.
+ This will probably change in future.
+ """
+ # Also has to be able to pass None or dame string.
+ if isinstance(rd, str):
+ dname = _ldns.ldns_dname_new_frm_str(rd)
+ elif (not isinstance(rd, ldns_dname)) and \
+ isinstance(rd, ldns_rdf) and \
+ rd.get_type() == _ldns.LDNS_RDF_TYPE_DNAME:
+ warnings.warn("The ldns_resolver.set_domain() method" +
+ " will drop the possibility to accept ldns_rdf." +
+ " Convert argument to ldns_dname.",
+ PendingDeprecationWarning, stacklevel=2)
+ dname = rd
+ else:
+ dname = rd
+ if (not isinstance(dname, ldns_rdf)) and (dname != None):
+ raise TypeError("Parameter must be derived from ldns_rdf.")
+ if (isinstance(dname, ldns_rdf)) and \
+ (dname.get_type() != _ldns.LDNS_RDF_TYPE_DNAME):
+ raise Exception("Operands must be ldns_dname.")
+ _ldns._ldns_resolver_set_domain(self, dname)
#parameters: ldns_resolver *,ldns_rdf *,
#retvals:
- def set_edns_udp_size(self,s):
- """Set maximum udp size.
+ def set_edns_udp_size(self, s):
+ """
+ Set maximum udp size.
- :param s:
- the udp max size
+ :param s: The udp max size.
+ :type s: uint16_t
+ :throws TypeError: When arguments of inappropriate types.
"""
_ldns.ldns_resolver_set_edns_udp_size(self,s)
#parameters: ldns_resolver *,uint16_t,
#retvals:
- def set_fail(self,b):
- """Whether or not to fail after one failed query.
+ def set_fail(self, b):
+ """
+ Whether or not to fail after one failed query.
- :param b:
- true: yes fail, false: continue with next nameserver
+ :param b: True: yes fail, False: continue with next name server.
+ :type b: bool
"""
- _ldns.ldns_resolver_set_fail(self,b)
+ _ldns.ldns_resolver_set_fail(self, b)
#parameters: ldns_resolver *,bool,
#retvals:
- def set_fallback(self,fallback):
- """Set whether the resolvers truncation fallback mechanism is used when ldns_resolver_query() is called.
+ def set_fallback(self, fallback):
+ """
+ Set whether the resolvers truncation fall-back mechanism is used
+ when :meth:`query` is called.
- :param fallback:
- whether to use the fallback mechanism
+ :param fallback: Whether to use the fall-back mechanism.
+ :type fallback: bool
"""
- _ldns.ldns_resolver_set_fallback(self,fallback)
+ _ldns.ldns_resolver_set_fallback(self, fallback)
#parameters: ldns_resolver *,bool,
#retvals:
- def set_igntc(self,b):
- """Whether or not to ignore the TC bit.
+ def set_igntc(self, b):
+ """
+ Whether or not to ignore the TC bit.
- :param b:
- true: yes ignore, false: don't ignore
+ :param b: True: yes ignore, False: don't ignore.
+ :type b: bool
"""
- _ldns.ldns_resolver_set_igntc(self,b)
+ _ldns.ldns_resolver_set_igntc(self, b)
#parameters: ldns_resolver *,bool,
#retvals:
- def set_ip6(self,i):
- """Whether the resolver uses ip6.
+ def set_ip6(self, i):
+ """
+ Whether the resolver uses ip6.
- :param i:
- 0: no pref, 1: ip4, 2: ip6
+ :param i: 0: no pref, 1: ip4, 2: ip6
+ :type i: uint8_t
+ :throws TypeError: When arguments of inappropriate types.
"""
- _ldns.ldns_resolver_set_ip6(self,i)
+ _ldns.ldns_resolver_set_ip6(self, i)
#parameters: ldns_resolver *,uint8_t,
#retvals:
- def set_nameserver_count(self,c):
- """Set the resolver's nameserver count directly.
+ def set_nameserver_count(self, c):
+ """
+ Set the resolver's name server count directly.
- :param c:
- the nameserver count
+ :param c: The name server count.
+ :type c: size_t
+ :throws TypeError: When arguments of inappropriate types.
"""
- _ldns.ldns_resolver_set_nameserver_count(self,c)
+ _ldns.ldns_resolver_set_nameserver_count(self, c)
#parameters: ldns_resolver *,size_t,
#retvals:
- def set_nameserver_rtt(self,pos,value):
- """Set round trip time for a specific nameserver.
-
- Note this currently differentiates between: unreachable and reachable.
+ def set_nameserver_rtt(self, pos, value):
+ """
+ Set round trip time for a specific name server.
+ Note this currently differentiates between: unreachable and
+ reachable.
- :param pos:
- the nameserver position
- :param value:
- the rtt
+ :param pos: The name server position.
+ :type pos: size_t
+ :param value: The rtt.
+ :type value: size_t
+ :throws TypeError: When arguments of inappropriate types.
"""
- _ldns.ldns_resolver_set_nameserver_rtt(self,pos,value)
+ _ldns.ldns_resolver_set_nameserver_rtt(self, pos, value)
#parameters: ldns_resolver *,size_t,size_t,
#retvals:
- def set_nameservers(self,rd):
- """Set the resolver's nameserver count directly by using an rdf list.
+ def set_nameservers(self, rd):
+ """
+ Set the resolver's name server count directly by using an
+ rdf list.
- :param rd:
- the resolver addresses
+ :param rd: The resolver addresses.
+ :type rd: ldns_rdf \*\*
+ :throws TypeError: When arguments of inappropriate types.
"""
- _ldns.ldns_resolver_set_nameservers(self,rd)
+ _ldns.ldns_resolver_set_nameservers(self, rd)
#parameters: ldns_resolver *,ldns_rdf **,
#retvals:
- def set_port(self,p):
- """Set the port the resolver should use.
+ def set_port(self, p):
+ """
+ Set the port the resolver should use.
- :param p:
- the port number
+ :param p: The port number.
+ :type p: uint16_t
+ :throws TypeError: When arguments of inappropriate types.
"""
- _ldns.ldns_resolver_set_port(self,p)
+ _ldns.ldns_resolver_set_port(self, p)
#parameters: ldns_resolver *,uint16_t,
#retvals:
- def set_random(self,b):
- """Should the nameserver list be randomized before each use.
+ def set_random(self, b):
+ """
+ Should the name server list be randomized before each use.
- :param b:
- true: randomize, false: don't
+ :param b: True: randomize, False: don't.
+ :type b: bool
"""
- _ldns.ldns_resolver_set_random(self,b)
+ _ldns.ldns_resolver_set_random(self, b)
#parameters: ldns_resolver *,bool,
#retvals:
- def set_recursive(self,b):
- """Set the resolver recursion.
+ def set_recursive(self, b):
+ """
+ Set the resolver recursion.
- :param b:
- true: set to recurse, false: unset
+ :param b: True: set to recurse, False: unset.
+ :type b: bool
"""
- _ldns.ldns_resolver_set_recursive(self,b)
+ _ldns.ldns_resolver_set_recursive(self, b)
#parameters: ldns_resolver *,bool,
#retvals:
- def set_retrans(self,re):
- """Set the resolver retrans timeout (in seconds).
+ def set_retrans(self, re):
+ """
+ Set the resolver retrans time-out (in seconds).
- :param re:
- the retransmission interval in seconds
+ :param re: The retransmission interval in seconds.
+ :type re: uint8_t
+ :throws TypeError: When arguments of inappropriate types.
"""
- _ldns.ldns_resolver_set_retrans(self,re)
+ _ldns.ldns_resolver_set_retrans(self, re)
#parameters: ldns_resolver *,uint8_t,
#retvals:
- def set_retry(self,re):
- """Set the resolver retry interval (in seconds).
+ def set_retry(self, re):
+ """
+ Set the resolver retry interval (in seconds).
- :param re:
- the retry interval
+ :param re: The retry interval.
+ :type re: uint8_t
+ :throws TypeError: When arguments of inappropriate types.
"""
_ldns.ldns_resolver_set_retry(self,re)
#parameters: ldns_resolver *,uint8_t,
#retvals:
- def set_rtt(self,rtt):
- """Set round trip time for all nameservers.
-
+ def set_rtt(self, rtt):
+ """
+ Set round trip time for all name servers.
Note this currently differentiates between: unreachable and reachable.
- :param rtt:
- a list with the times
+ :param rtt: A list with the times.
+ :type rtt: size \*
+ :throws TypeError: When arguments of inappropriate types.
"""
- _ldns.ldns_resolver_set_rtt(self,rtt)
+ _ldns.ldns_resolver_set_rtt(self, rtt)
#parameters: ldns_resolver *,size_t *,
#retvals:
- def set_searchlist_count(self,c):
- _ldns.ldns_resolver_set_searchlist_count(self,c)
- #parameters: ldns_resolver *,size_t,
- #retvals:
-
- def set_timeout(self,timeout):
- """Set the resolver's socket time out when talking to remote hosts.
+ def set_timeout(self, timeout):
+ """
+ Set the resolver's socket time out when talking to remote hosts.
- :param timeout:
- the timeout to use
+ :param timeout: The time-out to use.
+ :param timeout: struct timeval
+ :throws TypeError: When arguments of inappropriate types.
"""
_ldns.ldns_resolver_set_timeout(self,timeout)
#parameters: ldns_resolver *,struct timeval,
#retvals:
- def set_tsig_algorithm(self,tsig_algorithm):
- """Set the tsig algorithm.
+ def set_tsig_algorithm(self, tsig_algorithm):
+ """
+ Set the tsig algorithm.
- :param tsig_algorithm:
- the tsig algorithm
+ :param tsig_algorithm: The tsig algorithm.
+ :param tsig_algorithm: str
+ :throws TypeError: When arguments of inappropriate types.
"""
- _ldns.ldns_resolver_set_tsig_algorithm(self,tsig_algorithm)
+ _ldns.ldns_resolver_set_tsig_algorithm(self, tsig_algorithm)
#parameters: ldns_resolver *,char *,
#retvals:
- def set_tsig_keydata(self,tsig_keydata):
- """Set the tsig key data.
+ def set_tsig_keydata(self, tsig_keydata):
+ """
+ Set the tsig key data.
- :param tsig_keydata:
- the key data
+ :param tsig_keydata: The key data.
+ :type tsig_keydata: str
+ :throws TypeError: When arguments of inappropriate types.
"""
- _ldns.ldns_resolver_set_tsig_keydata(self,tsig_keydata)
+ _ldns.ldns_resolver_set_tsig_keydata(self, tsig_keydata)
#parameters: ldns_resolver *,char *,
#retvals:
- def set_tsig_keyname(self,tsig_keyname):
- """Set the tsig key name.
+ def set_tsig_keyname(self, tsig_keyname):
+ """
+ Set the tsig key name.
- :param tsig_keyname:
- the tsig key name
+ :param tsig_keyname: The tsig key name.
+ :type tsig_keyname: str
+ :throws TypeError: When arguments of inappropriate types.
"""
- _ldns.ldns_resolver_set_tsig_keyname(self,tsig_keyname)
+ _ldns.ldns_resolver_set_tsig_keyname(self, tsig_keyname)
#parameters: ldns_resolver *,char *,
#retvals:
- def set_usevc(self,b):
- """Whether the resolver uses a virtual circuit (TCP).
+ def set_usevc(self, b):
+ """
+ Whether the resolver uses a virtual circuit (TCP).
- :param b:
- true: use TCP, false: don't use TCP
+ :param b: True: use TCP, False: don't use TCP.
+ :type b: bool
"""
- _ldns.ldns_resolver_set_usevc(self,b)
+ _ldns.ldns_resolver_set_usevc(self, b)
#parameters: ldns_resolver *,bool,
#retvals:
def timeout(self):
- """What is the timeout on socket connections.
+ """
+ What is the time-out on socket connections.
- :returns: (struct timeval) the timeout as struct timeval
+ :return: (struct timeval) The time-out.
"""
return _ldns.ldns_resolver_timeout(self)
#parameters: const ldns_resolver *,
#retvals: struct timeval
- def trusted_key(self,keys,trusted_keys):
- """Returns true if at least one of the provided keys is a trust anchor.
+ def trusted_key(self, keys):
+ """
+ Returns true if at least one of the provided keys is a trust
+ anchor.
- :param keys:
- the keyset to check
- :param trusted_keys:
- the subset of trusted keys in the 'keys' rrset
- :returns: (bool) true if at least one of the provided keys is a configured trust anchor
+ :param keys: The key set to check.
+ :type keys: :class:`ldns_rr_list`
+ :throws TypeError: When arguments of inappropriate types.
+ :return: (:class:`ldns_rr_list`) List of trusted keys if at
+ least one of the provided keys is a configured trust anchor,
+ None else.
"""
- return _ldns.ldns_resolver_trusted_key(self,keys,trusted_keys)
+ return _ldns._replacement_ldns_resolver_trusted_key(self, keys)
#parameters: const ldns_resolver *,ldns_rr_list *,ldns_rr_list *,
#retvals: bool
def tsig_algorithm(self):
- """Return the tsig algorithm as used by the nameserver.
+ """
+ Return the tsig algorithm as used by the name server.
- :returns: (char \*) the algorithm used.
+ :return: (str) The algorithm used.
"""
- return _ldns.ldns_resolver_tsig_algorithm(self)
+ return _ldns._ldns_resolver_tsig_algorithm(self)
#parameters: const ldns_resolver *,
#retvals: char *
def tsig_keydata(self):
- """Return the tsig keydata as used by the nameserver.
+ """
+ Return the tsig key data as used by the name server.
- :returns: (char \*) the keydata used.
+ :return: (str) The key data used.
"""
- return _ldns.ldns_resolver_tsig_keydata(self)
+ return _ldns._ldns_resolver_tsig_keydata(self)
#parameters: const ldns_resolver *,
#retvals: char *
def tsig_keyname(self):
- """Return the tsig keyname as used by the nameserver.
+ """
+ Return the tsig key name as used by the name server.
- :returns: (char \*) the name used.
+ :return: (str) The name used.
"""
- return _ldns.ldns_resolver_tsig_keyname(self)
+ return _ldns._ldns_resolver_tsig_keyname(self)
#parameters: const ldns_resolver *,
#retvals: char *
def usevc(self):
- """Does the resolver use tcp or udp.
+ """
+ Does the resolver use tcp or udp.
- :returns: (bool) true: tcp, false: udp
+ :return: (bool) True: tcp, False: udp.
"""
return _ldns.ldns_resolver_usevc(self)
#parameters: const ldns_resolver *,
#retvals: bool
- #_LDNS_RESOLVER_METHODS#
- %}
+ #
+ # _LDNS_RESOLVER_METHODS
+ #
+ %}
}
diff --git a/dane.c b/dane.c
index 793005ddcb30..675dfa8bf335 100644
--- a/dane.c
+++ b/dane.c
@@ -8,6 +8,7 @@
*/
#include <ldns/config.h>
+#ifdef USE_DANE
#include <ldns/ldns.h>
#include <ldns/dane.h>
@@ -15,8 +16,12 @@
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETDB_H
#include <netdb.h>
+#endif
#ifdef HAVE_SSL
#include <openssl/ssl.h>
@@ -119,13 +124,13 @@ ldns_dane_cert2rdf(ldns_rdf** rdf, X509* cert,
case LDNS_TLSA_MATCHING_TYPE_SHA256:
- digest = LDNS_XMALLOC(unsigned char, SHA256_DIGEST_LENGTH);
+ digest = LDNS_XMALLOC(unsigned char, LDNS_SHA256_DIGEST_LENGTH);
if (digest == NULL) {
LDNS_FREE(buf);
return LDNS_STATUS_MEM_ERR;
}
(void) ldns_sha256(buf, (unsigned int)len, digest);
- *rdf = ldns_rdf_new(LDNS_RDF_TYPE_HEX, SHA256_DIGEST_LENGTH,
+ *rdf = ldns_rdf_new(LDNS_RDF_TYPE_HEX, LDNS_SHA256_DIGEST_LENGTH,
digest);
LDNS_FREE(buf);
@@ -134,13 +139,13 @@ ldns_dane_cert2rdf(ldns_rdf** rdf, X509* cert,
case LDNS_TLSA_MATCHING_TYPE_SHA512:
- digest = LDNS_XMALLOC(unsigned char, SHA512_DIGEST_LENGTH);
+ digest = LDNS_XMALLOC(unsigned char, LDNS_SHA512_DIGEST_LENGTH);
if (digest == NULL) {
LDNS_FREE(buf);
return LDNS_STATUS_MEM_ERR;
}
(void) ldns_sha512(buf, (unsigned int)len, digest);
- *rdf = ldns_rdf_new(LDNS_RDF_TYPE_HEX, SHA512_DIGEST_LENGTH,
+ *rdf = ldns_rdf_new(LDNS_RDF_TYPE_HEX, LDNS_SHA512_DIGEST_LENGTH,
digest);
LDNS_FREE(buf);
@@ -740,3 +745,4 @@ ldns_dane_verify(ldns_rr_list* tlsas,
return s;
}
#endif /* HAVE_SSL */
+#endif /* USE_DANE */
diff --git a/dnssec.c b/dnssec.c
index 684d17169e2a..a41a9f633c4e 100644
--- a/dnssec.c
+++ b/dnssec.c
@@ -654,103 +654,113 @@ ldns_key_rr2ds(const ldns_rr *key, ldns_hash h)
return ds;
}
+/* From RFC3845:
+ *
+ * 2.1.2. The List of Type Bit Map(s) Field
+ *
+ * The RR type space is split into 256 window blocks, each representing
+ * the low-order 8 bits of the 16-bit RR type space. Each block that
+ * has at least one active RR type is encoded using a single octet
+ * window number (from 0 to 255), a single octet bitmap length (from 1
+ * to 32) indicating the number of octets used for the window block's
+ * bitmap, and up to 32 octets (256 bits) of bitmap.
+ *
+ * Window blocks are present in the NSEC RR RDATA in increasing
+ * numerical order.
+ *
+ * "|" denotes concatenation
+ *
+ * Type Bit Map(s) Field = ( Window Block # | Bitmap Length | Bitmap ) +
+ *
+ * <cut>
+ *
+ * Blocks with no types present MUST NOT be included. Trailing zero
+ * octets in the bitmap MUST be omitted. The length of each block's
+ * bitmap is determined by the type code with the largest numerical
+ * value within that block, among the set of RR types present at the
+ * NSEC RR's owner name. Trailing zero octets not specified MUST be
+ * interpreted as zero octets.
+ */
ldns_rdf *
ldns_dnssec_create_nsec_bitmap(ldns_rr_type rr_type_list[],
size_t size,
ldns_rr_type nsec_type)
{
- size_t i;
- uint8_t *bitmap;
- uint16_t bm_len = 0;
- uint16_t i_type;
- ldns_rdf *bitmap_rdf;
+ uint8_t window; /* most significant octet of type */
+ uint8_t subtype; /* least significant octet of type */
+ uint16_t windows[256] /* Max subtype per window */
+#ifndef S_SPLINT_S
+ = { 0 } /* Initialize ALL elements with 0 */
+#endif
+ ;
+ ldns_rr_type* d; /* used to traverse rr_type_list*/
+ size_t i; /* used to traverse windows array */
- uint8_t *data = NULL;
- uint8_t cur_data[32];
- uint8_t cur_window = 0;
- uint8_t cur_window_max = 0;
- uint16_t cur_data_size = 0;
+ size_t sz; /* size needed for type bitmap rdf */
+ uint8_t* data = NULL; /* rdf data */
+ uint8_t* dptr; /* used to itraverse rdf data */
+ ldns_rdf* rdf; /* bitmap rdf to return */
if (nsec_type != LDNS_RR_TYPE_NSEC &&
nsec_type != LDNS_RR_TYPE_NSEC3) {
return NULL;
}
- i_type = 0;
- for (i = 0; i < size; i++) {
- if (i_type < rr_type_list[i])
- i_type = rr_type_list[i];
- }
- if (i_type < nsec_type) {
- i_type = nsec_type;
- }
-
- bm_len = i_type / 8 + 2;
- bitmap = LDNS_XMALLOC(uint8_t, bm_len);
- if(!bitmap) return NULL;
- for (i = 0; i < bm_len; i++) {
- bitmap[i] = 0;
- }
-
- for (i = 0; i < size; i++) {
- i_type = rr_type_list[i];
- ldns_set_bit(bitmap + (int) i_type / 8,
- (int) (7 - (i_type % 8)),
- true);
- }
-
- /* fold it into windows TODO: can this be done directly? */
- memset(cur_data, 0, 32);
- for (i = 0; i < bm_len; i++) {
- if (i / 32 > cur_window) {
- /* check, copy, new */
- if (cur_window_max > 0) {
- /* this window has stuff, add it */
- data = LDNS_XREALLOC(data,
- uint8_t,
- cur_data_size + cur_window_max + 3);
- if(!data) {
- LDNS_FREE(bitmap);
- return NULL;
- }
- data[cur_data_size] = cur_window;
- data[cur_data_size + 1] = cur_window_max + 1;
- memcpy(data + cur_data_size + 2,
- cur_data,
- cur_window_max+1);
- cur_data_size += cur_window_max + 3;
- }
- cur_window++;
- cur_window_max = 0;
- memset(cur_data, 0, 32);
+ /* Which other windows need to be in the bitmap rdf?
+ */
+ for (d = rr_type_list; d < rr_type_list + size; d++) {
+ window = *d >> 8;
+ subtype = *d & 0xff;
+ if (windows[window] < subtype) {
+ windows[window] = subtype;
}
- cur_data[i%32] = bitmap[i];
- if (bitmap[i] > 0) {
- cur_window_max = i%32;
+ }
+
+ /* How much space do we need in the rdf for those windows?
+ */
+ sz = 0;
+ for (i = 0; i < 256; i++) {
+ if (windows[i]) {
+ sz += windows[i] / 8 + 3;
}
}
- if (cur_window_max > 0 || cur_data[0] != 0) {
- /* this window has stuff, add it */
- data = LDNS_XREALLOC(data,
- uint8_t,
- cur_data_size + cur_window_max + 3);
- if(!data) {
- LDNS_FREE(bitmap);
- return NULL;
- }
- data[cur_data_size] = cur_window;
- data[cur_data_size + 1] = cur_window_max + 1;
- memcpy(data + cur_data_size + 2, cur_data, cur_window_max+1);
- cur_data_size += cur_window_max + 3;
+ if (sz > 0) {
+ /* Format rdf data according RFC3845 Section 2.1.2 (see above)
+ */
+ dptr = data = LDNS_CALLOC(uint8_t, sz);
+ if (!data) {
+ return NULL;
+ }
+ for (i = 0; i < 256; i++) {
+ if (windows[i]) {
+ *dptr++ = (uint8_t)i;
+ *dptr++ = (uint8_t)(windows[i] / 8 + 1);
+
+ /* Now let windows[i] index the bitmap
+ * within data
+ */
+ windows[i] = (uint16_t)(dptr - data);
+
+ dptr += dptr[-1];
+ }
+ }
}
- bitmap_rdf = ldns_rdf_new_frm_data(LDNS_RDF_TYPE_NSEC,
- cur_data_size,
- data);
- LDNS_FREE(bitmap);
- LDNS_FREE(data);
+ /* Set the bits?
+ */
+ for (d = rr_type_list; d < rr_type_list + size; d++) {
+ subtype = *d & 0xff;
+ data[windows[*d >> 8] + subtype/8] |= (0x80 >> (subtype % 8));
+ }
- return bitmap_rdf;
+ /* Allocate and return rdf structure for the data
+ */
+ rdf = ldns_rdf_new(LDNS_RDF_TYPE_BITMAP, sz, data);
+ if (!rdf) {
+ LDNS_FREE(data);
+ return NULL;
+ }
+ return rdf;
}
int
@@ -987,7 +997,9 @@ ldns_nsec3_hash_name(ldns_rdf *name,
/* prepare the owner name according to the draft section bla */
cann = ldns_rdf_clone(name);
if(!cann) {
+#ifdef STDERR_MSGS
fprintf(stderr, "Memory error\n");
+#endif
return NULL;
}
ldns_dname2canonical(cann);
@@ -1032,11 +1044,13 @@ ldns_nsec3_hash_name(ldns_rdf *name,
hashed_owner_b32,
ldns_b32_ntop_calculate_size(hashed_owner_str_len)+1);
if (hashed_owner_b32_len < 1) {
+#ifdef STDERR_MSGS
fprintf(stderr, "Error in base32 extended hex encoding ");
fprintf(stderr, "of hashed owner name (name: ");
ldns_rdf_print(stderr, name);
fprintf(stderr, ", return code: %u)\n",
(unsigned int) hashed_owner_b32_len);
+#endif
LDNS_FREE(hashed_owner_b32);
return NULL;
}
@@ -1044,7 +1058,9 @@ ldns_nsec3_hash_name(ldns_rdf *name,
status = ldns_str2rdf_dname(&hashed_owner, hashed_owner_b32);
if (status != LDNS_STATUS_OK) {
+#ifdef STDERR_MSGS
fprintf(stderr, "Error creating rdf from %s\n", hashed_owner_b32);
+#endif
LDNS_FREE(hashed_owner_b32);
return NULL;
}
@@ -1338,38 +1354,120 @@ ldns_nsec3_hash_name_frm_nsec3(const ldns_rr *nsec, ldns_rdf *name)
}
bool
-ldns_nsec_bitmap_covers_type(const ldns_rdf *nsec_bitmap, ldns_rr_type type)
+ldns_nsec_bitmap_covers_type(const ldns_rdf* bitmap, ldns_rr_type type)
{
- uint8_t window_block_nr;
- uint8_t bitmap_length;
- uint16_t cur_type;
- uint16_t pos = 0;
- uint16_t bit_pos;
- uint8_t *data;
-
- if (nsec_bitmap == NULL) {
+ uint8_t* dptr;
+ uint8_t* dend;
+
+ /* From RFC3845 Section 2.1.2:
+ *
+ * "The RR type space is split into 256 window blocks, each re-
+ * presenting the low-order 8 bits of the 16-bit RR type space."
+ */
+ uint8_t window = type >> 8;
+ uint8_t subtype = type & 0xff;
+
+ if (! bitmap) {
return false;
}
- data = ldns_rdf_data(nsec_bitmap);
- while(pos < ldns_rdf_size(nsec_bitmap)) {
- window_block_nr = data[pos];
- bitmap_length = data[pos + 1];
- pos += 2;
-
- for (bit_pos = 0; bit_pos < (bitmap_length) * 8; bit_pos++) {
- if (ldns_get_bit(&data[pos], bit_pos)) {
- cur_type = 256 * (uint16_t) window_block_nr + bit_pos;
- if (cur_type == type) {
- return true;
- }
- }
- }
+ assert(ldns_rdf_get_type(bitmap) == LDNS_RDF_TYPE_BITMAP);
+
+ dptr = ldns_rdf_data(bitmap);
+ dend = ldns_rdf_data(bitmap) + ldns_rdf_size(bitmap);
+
+ /* Type Bitmap = ( Window Block # | Bitmap Length | Bitmap ) +
+ * dptr[0] dptr[1] dptr[2:]
+ */
+ while (dptr < dend && dptr[0] <= window) {
+
+ if (dptr[0] == window && subtype / 8 < dptr[1] &&
+ dptr + dptr[1] + 2 <= dend) {
- pos += (uint16_t) bitmap_length;
+ return dptr[2 + subtype / 8] & (0x80 >> (subtype % 8));
+ }
+ dptr += dptr[1] + 2; /* next window */
}
return false;
}
+ldns_status
+ldns_nsec_bitmap_set_type(ldns_rdf* bitmap, ldns_rr_type type)
+{
+ uint8_t* dptr;
+ uint8_t* dend;
+
+ /* From RFC3845 Section 2.1.2:
+ *
+ * "The RR type space is split into 256 window blocks, each re-
+ * presenting the low-order 8 bits of the 16-bit RR type space."
+ */
+ uint8_t window = type >> 8;
+ uint8_t subtype = type & 0xff;
+
+ if (! bitmap) {
+ return false;
+ }
+ assert(ldns_rdf_get_type(bitmap) == LDNS_RDF_TYPE_BITMAP);
+
+ dptr = ldns_rdf_data(bitmap);
+ dend = ldns_rdf_data(bitmap) + ldns_rdf_size(bitmap);
+
+ /* Type Bitmap = ( Window Block # | Bitmap Length | Bitmap ) +
+ * dptr[0] dptr[1] dptr[2:]
+ */
+ while (dptr < dend && dptr[0] <= window) {
+
+ if (dptr[0] == window && subtype / 8 < dptr[1] &&
+ dptr + dptr[1] + 2 <= dend) {
+
+ dptr[2 + subtype / 8] |= (0x80 >> (subtype % 8));
+ return LDNS_STATUS_OK;
+ }
+ dptr += dptr[1] + 2; /* next window */
+ }
+ return LDNS_STATUS_TYPE_NOT_IN_BITMAP;
+}
+
+ldns_status
+ldns_nsec_bitmap_clear_type(ldns_rdf* bitmap, ldns_rr_type type)
+{
+ uint8_t* dptr;
+ uint8_t* dend;
+
+ /* From RFC3845 Section 2.1.2:
+ *
+ * "The RR type space is split into 256 window blocks, each re-
+ * presenting the low-order 8 bits of the 16-bit RR type space."
+ */
+ uint8_t window = type >> 8;
+ uint8_t subtype = type & 0xff;
+
+ if (! bitmap) {
+ return false;
+ }
+
+ assert(ldns_rdf_get_type(bitmap) == LDNS_RDF_TYPE_BITMAP);
+
+ dptr = ldns_rdf_data(bitmap);
+ dend = ldns_rdf_data(bitmap) + ldns_rdf_size(bitmap);
+
+ /* Type Bitmap = ( Window Block # | Bitmap Length | Bitmap ) +
+ * dptr[0] dptr[1] dptr[2:]
+ */
+ while (dptr < dend && dptr[0] <= window) {
+
+ if (dptr[0] == window && subtype / 8 < dptr[1] &&
+ dptr + dptr[1] + 2 <= dend) {
+
+ dptr[2 + subtype / 8] &= ~(0x80 >> (subtype % 8));
+ return LDNS_STATUS_OK;
+ }
+ dptr += dptr[1] + 2; /* next window */
+ }
+ return LDNS_STATUS_TYPE_NOT_IN_BITMAP;
+}
+
+
bool
ldns_nsec_covers_name(const ldns_rr *nsec, const ldns_rdf *name)
{
@@ -1407,9 +1505,11 @@ ldns_nsec_covers_name(const ldns_rr *nsec, const ldns_rdf *name)
if(ldns_dname_compare(nsec_owner, nsec_next) > 0) {
result = (ldns_dname_compare(nsec_owner, name) <= 0 ||
ldns_dname_compare(name, nsec_next) < 0);
- } else {
+ } else if(ldns_dname_compare(nsec_owner, nsec_next) < 0) {
result = (ldns_dname_compare(nsec_owner, name) <= 0 &&
ldns_dname_compare(name, nsec_next) < 0);
+ } else {
+ result = true;
}
ldns_rdf_deep_free(nsec_next);
diff --git a/dnssec_sign.c b/dnssec_sign.c
index 2e5a7a92e15c..4af882a2845f 100644
--- a/dnssec_sign.c
+++ b/dnssec_sign.c
@@ -566,7 +566,7 @@ ldns_dnssec_addresses_on_glue_list(
* when walking the tree with the ldns_dnssec_name_node_next_nonglue()
* function. But watch out! Names that are partially occluded (like glue with
* the same name as the delegation) will not be marked and should specifically
- * be taken into account seperately.
+ * be taken into account separately.
*
* When glue_list is given (not NULL), in the process of marking the names, all
* glue resource records will be pushed to that list, even glue at delegation names.
@@ -659,7 +659,7 @@ ldns_dnssec_zone_mark_and_get_glue(ldns_dnssec_zone *zone,
* when walking the tree with the ldns_dnssec_name_node_next_nonglue()
* function. But watch out! Names that are partially occluded (like glue with
* the same name as the delegation) will not be marked and should specifically
- * be taken into account seperately.
+ * be taken into account separately.
*
* \param[in] zone the zone in which to mark the names
* \return LDNS_STATUS_OK on success, an error code otherwise
@@ -771,8 +771,11 @@ ldns_dnssec_zone_create_nsecs(ldns_dnssec_zone *zone,
}
#ifdef HAVE_SSL
-/* in dnssec_zone.c */
-extern int ldns_dname_compare_v(const void *a, const void *b);
+static void
+ldns_hashed_names_node_free(ldns_rbnode_t *node, void *arg) {
+ (void) arg;
+ LDNS_FREE(node);
+}
static ldns_status
ldns_dnssec_zone_create_nsec3s_mkmap(ldns_dnssec_zone *zone,
@@ -813,21 +816,24 @@ ldns_dnssec_zone_create_nsec3s_mkmap(ldns_dnssec_zone *zone,
nsec_ttl = LDNS_DEFAULT_TTL;
}
- if (map) {
- if ((*map = ldns_rbtree_create(ldns_dname_compare_v))
- == NULL) {
- map = NULL;
- };
+ if (zone->hashed_names) {
+ ldns_traverse_postorder(zone->hashed_names,
+ ldns_hashed_names_node_free, NULL);
+ LDNS_FREE(zone->hashed_names);
+ }
+ zone->hashed_names = ldns_rbtree_create(ldns_dname_compare_v);
+ if (zone->hashed_names && map) {
+ *map = zone->hashed_names;
}
- nsec3_list = ldns_rr_list_new();
first_name_node = ldns_dnssec_name_node_next_nonglue(
ldns_rbtree_first(zone->names));
current_name_node = first_name_node;
- while (current_name_node &&
- current_name_node != LDNS_RBTREE_NULL) {
+ while (current_name_node && current_name_node != LDNS_RBTREE_NULL &&
+ result == LDNS_STATUS_OK) {
+
current_name = (ldns_dnssec_name *) current_name_node->data;
nsec_rr = ldns_dnssec_create_nsec3(current_name,
NULL,
@@ -845,28 +851,49 @@ ldns_dnssec_zone_create_nsec3s_mkmap(ldns_dnssec_zone *zone,
ldns_rr_set_ttl(nsec_rr, nsec_ttl);
result = ldns_dnssec_name_add_rr(current_name, nsec_rr);
ldns_rr_list_push_rr(new_rrs, nsec_rr);
- ldns_rr_list_push_rr(nsec3_list, nsec_rr);
- if (map) {
+ if (ldns_rr_owner(nsec_rr)) {
hashmap_node = LDNS_MALLOC(ldns_rbnode_t);
- if (hashmap_node && ldns_rr_owner(nsec_rr)) {
- hashmap_node->key = ldns_dname_label(
- ldns_rr_owner(nsec_rr), 0);
- if (hashmap_node->key) {
- hashmap_node->data = current_name->name;
- (void) ldns_rbtree_insert(
- *map, hashmap_node);
- }
+ if (hashmap_node == NULL) {
+ return LDNS_STATUS_MEM_ERR;
+ }
+ current_name->hashed_name =
+ ldns_dname_label(ldns_rr_owner(nsec_rr), 0);
+
+ if (current_name->hashed_name == NULL) {
+ LDNS_FREE(hashmap_node);
+ return LDNS_STATUS_MEM_ERR;
+ }
+ hashmap_node->key = current_name->hashed_name;
+ hashmap_node->data = current_name;
+
+ if (! ldns_rbtree_insert(zone->hashed_names
+ , hashmap_node)) {
+ LDNS_FREE(hashmap_node);
}
}
current_name_node = ldns_dnssec_name_node_next_nonglue(
ldns_rbtree_next(current_name_node));
}
if (result != LDNS_STATUS_OK) {
- ldns_rr_list_free(nsec3_list);
return result;
}
- ldns_rr_list_sort_nsec3(nsec3_list);
+ /* Make sorted list of nsec3s (via zone->hashed_names)
+ */
+ nsec3_list = ldns_rr_list_new();
+ if (nsec3_list == NULL) {
+ return LDNS_STATUS_MEM_ERR;
+ }
+ for ( hashmap_node = ldns_rbtree_first(zone->hashed_names)
+ ; hashmap_node != LDNS_RBTREE_NULL
+ ; hashmap_node = ldns_rbtree_next(hashmap_node)
+ ) {
+ current_name = (ldns_dnssec_name *) hashmap_node->data;
+ nsec_rr = ((ldns_dnssec_name *) hashmap_node->data)->nsec;
+ if (nsec_rr) {
+ ldns_rr_list_push_rr(nsec3_list, nsec_rr);
+ }
+ }
result = ldns_dnssec_chain_nsec3_list(nsec3_list);
ldns_rr_list_free(nsec3_list);
@@ -913,7 +940,9 @@ ldns_dnssec_remove_signatures( ldns_dnssec_rrs *signatures
ldns_key_list_set_use(key_list, false);
break;
default:
+#ifdef STDERR_MSGS
fprintf(stderr, "[XX] unknown return value from callback\n");
+#endif
break;
}
return NULL;
@@ -965,7 +994,9 @@ ldns_dnssec_remove_signatures( ldns_dnssec_rrs *signatures
LDNS_FREE(cur_rr);
break;
default:
+#ifdef STDERR_MSGS
fprintf(stderr, "[XX] unknown return value from callback\n");
+#endif
break;
}
cur_rr = next_rr;
diff --git a/dnssec_zone.c b/dnssec_zone.c
index 57b62c693632..60d62eae09f2 100644
--- a/dnssec_zone.c
+++ b/dnssec_zone.c
@@ -54,10 +54,8 @@ ldns_dnssec_rrs_add_rr(ldns_dnssec_rrs *rrs, ldns_rr *rr)
/* this could be done more efficiently; name and type should already
be equal */
- cmp = ldns_rr_compare(rrs->rr,
- rr);
- /* should we error on equal? */
- if (cmp <= 0) {
+ cmp = ldns_rr_compare(rrs->rr, rr);
+ if (cmp < 0) {
if (rrs->next) {
return ldns_dnssec_rrs_add_rr(rrs->next, rr);
} else {
@@ -74,6 +72,7 @@ ldns_dnssec_rrs_add_rr(ldns_dnssec_rrs *rrs, ldns_rr *rr)
rrs->rr = rr;
rrs->next = new_rrs;
}
+ /* Silently ignore equal rr's */
return LDNS_STATUS_OK;
}
@@ -450,8 +449,6 @@ ldns_dnssec_name_add_rr(ldns_dnssec_name *name,
ldns_rr *rr)
{
ldns_status result = LDNS_STATUS_OK;
- ldns_rdf *name_name;
- bool hashed_name = false;
ldns_rr_type rr_type;
ldns_rr_type typecovered = 0;
@@ -467,19 +464,6 @@ ldns_dnssec_name_add_rr(ldns_dnssec_name *name,
typecovered = ldns_rdf2rr_type(ldns_rr_rrsig_typecovered(rr));
}
-#ifdef HAVE_SSL
- if (rr_type == LDNS_RR_TYPE_NSEC3 ||
- typecovered == LDNS_RR_TYPE_NSEC3) {
- name_name = ldns_nsec3_hash_name_frm_nsec3(rr,
- ldns_dnssec_name_name(name));
- hashed_name = true;
- } else {
- name_name = ldns_dnssec_name_name(name);
- }
-#else
- name_name = ldns_dnssec_name_name(name);
-#endif /* HAVE_SSL */
-
if (rr_type == LDNS_RR_TYPE_NSEC ||
rr_type == LDNS_RR_TYPE_NSEC3) {
/* XX check if is already set (and error?) */
@@ -501,11 +485,6 @@ ldns_dnssec_name_add_rr(ldns_dnssec_name *name,
result = ldns_dnssec_rrsets_add_rr(name->rrsets, rr);
}
}
-
- if (hashed_name) {
- ldns_rdf_deep_free(name_name);
- }
-
return result;
}
@@ -593,6 +572,8 @@ ldns_dnssec_zone_new(void)
if(!zone) return NULL;
zone->soa = NULL;
zone->names = NULL;
+ zone->hashed_names = NULL;
+ zone->_nsec3params = NULL;
return zone;
}
@@ -675,6 +656,8 @@ ldns_dnssec_zone_new_frm_fp_l(ldns_dnssec_zone** z, FILE* fp, ldns_rdf* origin,
ldns_rr_list_push_rr(todo_nsec3s,
cur_rr);
}
+ status = LDNS_STATUS_OK;
+
} else if (status != LDNS_STATUS_OK)
goto error;
@@ -698,18 +681,13 @@ ldns_dnssec_zone_new_frm_fp_l(ldns_dnssec_zone** z, FILE* fp, ldns_rdf* origin,
if (ldns_rr_list_rr_count(todo_nsec3s) > 0) {
(void) ldns_dnssec_zone_add_empty_nonterminals(newzone);
- for (i = 0; status == LDNS_STATUS_OK &&
+ for (i = 0; status == LDNS_STATUS_OK &&
i < ldns_rr_list_rr_count(todo_nsec3s); i++) {
cur_rr = ldns_rr_list_rr(todo_nsec3s, i);
status = ldns_dnssec_zone_add_rr(newzone, cur_rr);
}
- for (i = 0; status == LDNS_STATUS_OK &&
- i < ldns_rr_list_rr_count(todo_nsec3_rrsigs);
- i++){
- cur_rr = ldns_rr_list_rr(todo_nsec3_rrsigs, i);
- status = ldns_dnssec_zone_add_rr(newzone, cur_rr);
- }
- } else if (ldns_rr_list_rr_count(todo_nsec3_rrsigs) > 0) {
+ }
+ if (ldns_rr_list_rr_count(todo_nsec3_rrsigs) > 0) {
for (i = 0; status == LDNS_STATUS_OK &&
i < ldns_rr_list_rr_count(todo_nsec3_rrsigs);
i++){
@@ -803,31 +781,99 @@ ldns_dname_compare_v(const void *a, const void *b) {
return ldns_dname_compare((ldns_rdf *)a, (ldns_rdf *)b);
}
-static ldns_rbnode_t *
-ldns_dnssec_zone_find_nsec3_original(ldns_dnssec_zone *zone,
- ldns_rr *rr) {
- ldns_rbnode_t *current_node = ldns_rbtree_first(zone->names);
- ldns_dnssec_name *current_name;
- ldns_rdf *hashed_name;
+static void
+ldns_dnssec_name_make_hashed_name(ldns_dnssec_zone *zone,
+ ldns_dnssec_name* name, ldns_rr* nsec3rr);
- hashed_name = ldns_dname_label(ldns_rr_owner(rr), 0);
+static void
+ldns_hashed_names_node_free(ldns_rbnode_t *node, void *arg) {
+ (void) arg;
+ LDNS_FREE(node);
+}
- while (current_node != LDNS_RBTREE_NULL) {
+static void
+ldns_dnssec_zone_hashed_names_from_nsec3(
+ ldns_dnssec_zone* zone, ldns_rr* nsec3rr)
+{
+ ldns_rbnode_t* current_node;
+ ldns_dnssec_name* current_name;
+
+ assert(zone != NULL);
+ assert(nsec3rr != NULL);
+
+ if (zone->hashed_names) {
+ ldns_traverse_postorder(zone->hashed_names,
+ ldns_hashed_names_node_free, NULL);
+ LDNS_FREE(zone->hashed_names);
+ }
+ zone->_nsec3params = nsec3rr;
+
+ /* So this is a NSEC3 zone.
+ * Calculate hashes for all names already in the zone
+ */
+ zone->hashed_names = ldns_rbtree_create(ldns_dname_compare_v);
+ if (zone->hashed_names == NULL) {
+ return;
+ }
+ for ( current_node = ldns_rbtree_first(zone->names)
+ ; current_node != LDNS_RBTREE_NULL
+ ; current_node = ldns_rbtree_next(current_node)
+ ) {
current_name = (ldns_dnssec_name *) current_node->data;
- if (!current_name->hashed_name) {
- current_name->hashed_name =
- ldns_nsec3_hash_name_frm_nsec3(rr, current_name->name);
+ ldns_dnssec_name_make_hashed_name(zone, current_name, nsec3rr);
+
+ }
+}
+
+static void
+ldns_dnssec_name_make_hashed_name(ldns_dnssec_zone *zone,
+ ldns_dnssec_name* name, ldns_rr* nsec3rr)
+{
+ ldns_rbnode_t* new_node;
+
+ assert(name != NULL);
+ if (! zone->_nsec3params) {
+ if (! nsec3rr) {
+ return;
}
- if (ldns_dname_compare(hashed_name,
- current_name->hashed_name)
- == 0) {
- ldns_rdf_deep_free(hashed_name);
- return current_node;
+ ldns_dnssec_zone_hashed_names_from_nsec3(zone, nsec3rr);
+
+ } else if (! nsec3rr) {
+ nsec3rr = zone->_nsec3params;
+ }
+ name->hashed_name = ldns_nsec3_hash_name_frm_nsec3(nsec3rr, name->name);
+
+ /* Also store in zone->hashed_names */
+ if ((new_node = LDNS_MALLOC(ldns_rbnode_t))) {
+
+ new_node->key = name->hashed_name;
+ new_node->data = name;
+
+ if (ldns_rbtree_insert(zone->hashed_names, new_node) == NULL) {
+
+ LDNS_FREE(new_node);
}
- current_node = ldns_rbtree_next(current_node);
}
- ldns_rdf_deep_free(hashed_name);
- return NULL;
+}
+
+
+static ldns_rbnode_t *
+ldns_dnssec_zone_find_nsec3_original(ldns_dnssec_zone *zone, ldns_rr *rr) {
+ ldns_rdf *hashed_name;
+
+ hashed_name = ldns_dname_label(ldns_rr_owner(rr), 0);
+ if (hashed_name == NULL) {
+ return NULL;
+ }
+ if (ldns_rr_get_type(rr) == LDNS_RR_TYPE_NSEC3 && ! zone->_nsec3params){
+
+ ldns_dnssec_zone_hashed_names_from_nsec3(zone, rr);
+ }
+ if (zone->hashed_names == NULL) {
+ ldns_rdf_deep_free(hashed_name);
+ return NULL;
+ }
+ return ldns_rbtree_search(zone->hashed_names, hashed_name);
}
ldns_status
@@ -854,15 +900,13 @@ ldns_dnssec_zone_add_rr(ldns_dnssec_zone *zone, ldns_rr *rr)
}
if (ldns_rr_get_type(rr) == LDNS_RR_TYPE_NSEC3 ||
type_covered == LDNS_RR_TYPE_NSEC3) {
- cur_node = ldns_dnssec_zone_find_nsec3_original(zone,
- rr);
+ cur_node = ldns_dnssec_zone_find_nsec3_original(zone, rr);
if (!cur_node) {
return LDNS_STATUS_DNSSEC_NSEC3_ORIGINAL_NOT_FOUND;
}
} else {
cur_node = ldns_rbtree_search(zone->names, ldns_rr_owner(rr));
}
-
if (!cur_node) {
/* add */
cur_name = ldns_dnssec_name_new_frm_rr(rr);
@@ -875,21 +919,14 @@ ldns_dnssec_zone_add_rr(ldns_dnssec_zone *zone, ldns_rr *rr)
cur_node->key = ldns_rr_owner(rr);
cur_node->data = cur_name;
(void)ldns_rbtree_insert(zone->names, cur_node);
+ ldns_dnssec_name_make_hashed_name(zone, cur_name, NULL);
} else {
cur_name = (ldns_dnssec_name *) cur_node->data;
result = ldns_dnssec_name_add_rr(cur_name, rr);
}
-
- if (result != LDNS_STATUS_OK) {
- fprintf(stderr, "error adding rr: ");
- ldns_rr_print(stderr, rr);
- }
-
- /*TODO ldns_dnssec_name_print_names(stdout, zone->names, 0);*/
if (ldns_rr_get_type(rr) == LDNS_RR_TYPE_SOA) {
zone->soa = cur_name;
}
-
return result;
}
@@ -1035,6 +1072,8 @@ ldns_dnssec_zone_add_empty_nonterminals(ldns_dnssec_zone *zone)
new_node->key = new_name->name;
new_node->data = new_name;
(void)ldns_rbtree_insert(zone->names, new_node);
+ ldns_dnssec_name_make_hashed_name(
+ zone, new_name, NULL);
}
ldns_rdf_deep_free(l1);
ldns_rdf_deep_free(l2);
diff --git a/doc/API.xml b/doc/API.xml
index 07007b9a2956..554420d11c29 100644
--- a/doc/API.xml
+++ b/doc/API.xml
@@ -196,7 +196,7 @@ TODO the 'set' functions of the 'get'
<t>
In the DNS the atomic data type is an RRset. This is a list
of RRs with the same ownername, type and class. Net::DNS doesn't
-have rrsets as a seperate object.
+have rrsets as a separate object.
</t>
<t>
In lDNS we have the ldns_rr_list, which just holds a bunch of RR's.
diff --git a/drill/chasetrace.c b/drill/chasetrace.c
index 0a37ff3017e6..370f627673e2 100644
--- a/drill/chasetrace.c
+++ b/drill/chasetrace.c
@@ -74,6 +74,8 @@ do_trace(ldns_resolver *local_res, ldns_rdf *name, ldns_rr_type t,
ldns_resolver_usevc(local_res));
ldns_resolver_set_random(res,
ldns_resolver_random(local_res));
+ ldns_resolver_set_source(res,
+ ldns_resolver_source(local_res));
ldns_resolver_set_recursive(res, false);
/* setup the root nameserver in the new resolver */
diff --git a/drill/configure b/drill/configure
index 6a4487d9a979..0937a1b288ab 100755
--- a/drill/configure
+++ b/drill/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for ldns 1.6.16.
+# Generated by GNU Autoconf 2.68 for ldns 1.6.17.
#
# Report bugs to <libdns@nlnetlabs.nl>.
#
@@ -560,8 +560,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='ldns'
PACKAGE_TARNAME='libdns'
-PACKAGE_VERSION='1.6.16'
-PACKAGE_STRING='ldns 1.6.16'
+PACKAGE_VERSION='1.6.17'
+PACKAGE_STRING='ldns 1.6.17'
PACKAGE_BUGREPORT='libdns@nlnetlabs.nl'
PACKAGE_URL=''
@@ -1218,7 +1218,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures ldns 1.6.16 to adapt to many kinds of systems.
+\`configure' configures ldns 1.6.17 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1279,7 +1279,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of ldns 1.6.16:";;
+ short | recursive ) echo "Configuration of ldns 1.6.17:";;
esac
cat <<\_ACEOF
@@ -1378,7 +1378,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-ldns configure 1.6.16
+ldns configure 1.6.17
generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
@@ -1801,7 +1801,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by ldns $as_me 1.6.16, which was
+It was created by ldns $as_me 1.6.17, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
@@ -2154,7 +2154,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
# Copyright 2009, Wouter Wijngaards, NLnet Labs.
# BSD licensed.
#
-# Version 21
+# Version 26
+# 2013-09-19 FLTO help text improved.
+# 2013-07-18 Enable ACX_CHECK_COMPILER_FLAG to test for -Wstrict-prototypes
+# 2013-06-25 FLTO has --disable-flto option.
+# 2013-05-03 Update W32_SLEEP for newer mingw that links but not defines it.
+# 2013-03-22 Fix ACX_RSRC_VERSION for long version numbers.
# 2012-02-09 Fix AHX_MEMCMP_BROKEN with undef in compat/memcmp.h.
# 2012-01-20 Fix COMPILER_FLAGS_UNBOUND for gcc 4.6.2 assigned-not-used-warns.
# 2011-12-05 Fix getaddrinfowithincludes on windows with fedora16 mingw32-gcc.
@@ -2169,7 +2174,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
# 2010-07-02 Add check for ss_family (for minix).
# 2010-04-26 Fix to use CPPFLAGS for CHECK_COMPILER_FLAGS.
# 2010-03-01 Fix RPATH using CONFIG_COMMANDS to run at the very end.
-# 2010-02-18 WITH_SSL outputs the LIBSSL_LDFLAGS, LIBS, CPPFLAGS seperate, -ldl
+# 2010-02-18 WITH_SSL outputs the LIBSSL_LDFLAGS, LIBS, CPPFLAGS separate, -ldl
# 2010-02-01 added ACX_CHECK_MEMCMP_SIGNED, AHX_MEMCMP_BROKEN
# 2010-01-20 added AHX_COONFIG_STRLCAT
# 2009-07-14 U_CHAR detection improved for windows crosscompile.
@@ -4240,7 +4245,7 @@ if eval \${cv_prog_cc_flag_$cache+:} false; then :
$as_echo_n "(cached) " >&6
else
-echo 'void f(){}' >conftest.c
+echo 'void f(void){}' >conftest.c
if test -z "`$CC $CPPFLAGS $CFLAGS -std=c99 -c conftest.c 2>&1`"; then
eval "cv_prog_cc_flag_$cache=yes"
else
@@ -4271,7 +4276,7 @@ if eval \${cv_prog_cc_flag_$cache+:} false; then :
$as_echo_n "(cached) " >&6
else
-echo 'void f(){}' >conftest.c
+echo 'void f(void){}' >conftest.c
if test -z "`$CC $CPPFLAGS $CFLAGS -xc99 -c conftest.c 2>&1`"; then
eval "cv_prog_cc_flag_$cache=yes"
else
@@ -4314,7 +4319,7 @@ if eval \${cv_prog_cc_flag_$cache+:} false; then :
$as_echo_n "(cached) " >&6
else
-echo 'void f(){}' >conftest.c
+echo 'void f(void){}' >conftest.c
if test -z "`$CC $CPPFLAGS $CFLAGS -O2 -c conftest.c 2>&1`"; then
eval "cv_prog_cc_flag_$cache=yes"
else
@@ -4347,7 +4352,7 @@ if eval \${cv_prog_cc_flag_$cache+:} false; then :
$as_echo_n "(cached) " >&6
else
-echo 'void f(){}' >conftest.c
+echo 'void f(void){}' >conftest.c
if test -z "`$CC $CPPFLAGS $CFLAGS -Werror -c conftest.c 2>&1`"; then
eval "cv_prog_cc_flag_$cache=yes"
else
@@ -4378,7 +4383,7 @@ if eval \${cv_prog_cc_flag_$cache+:} false; then :
$as_echo_n "(cached) " >&6
else
-echo 'void f(){}' >conftest.c
+echo 'void f(void){}' >conftest.c
if test -z "`$CC $CPPFLAGS $CFLAGS -Wall -c conftest.c 2>&1`"; then
eval "cv_prog_cc_flag_$cache=yes"
else
@@ -5945,7 +5950,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by ldns $as_me 1.6.16, which was
+This file was extended by ldns $as_me 1.6.17, which was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -6007,7 +6012,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-ldns config.status 1.6.16
+ldns config.status 1.6.17
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
diff --git a/drill/configure.ac b/drill/configure.ac
index 17d7541c027b..b7fe2aee07a8 100644
--- a/drill/configure.ac
+++ b/drill/configure.ac
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.56)
-AC_INIT(ldns, 1.6.16, libdns@nlnetlabs.nl,libdns)
+AC_INIT(ldns, 1.6.17, libdns@nlnetlabs.nl,libdns)
AC_CONFIG_SRCDIR([drill.c])
sinclude(../acx_nlnetlabs.m4)
diff --git a/drill/drill.1.in b/drill/drill.1.in
index 15b15a425333..b6d74f6554d7 100644
--- a/drill/drill.1.in
+++ b/drill/drill.1.in
@@ -83,6 +83,11 @@ Chase the signature(s) of 'name' to a known key or as high up in
the tree as possible.
.TP
+\fB\-I \fIIPv4 or IPv6 address\fR
+Source address to query from. The source address has to be present
+on an interface of the host running drill.
+
+.TP
\fB\-V \fIlevel\fR
Be more verbose. Set level to 5 to see the actual query that is sent.
@@ -217,6 +222,12 @@ specify named base64 tsig key, and optional an algorithm (defaults to hmac-md5.s
\fB\-z \fR
don't randomize the nameserver list before sending queries.
+.SH "EXIT STATUS"
+The exit status is 0 if the looked up answer is secure and trusted,
+or insecure.
+The exit status is not 0 if the looked up answer is untrusted or bogus,
+or an error occurred while performing the lookup.
+
.SH "FILES"
.TP
@LDNS_TRUST_ANCHOR_FILE@
diff --git a/drill/drill.c b/drill/drill.c
index 574c8b98c856..b967ad949c8d 100644
--- a/drill/drill.c
+++ b/drill/drill.c
@@ -33,6 +33,7 @@ usage(FILE *stream, const char *progname)
fprintf(stream, "\t-T\t\ttrace from the root down to <name>\n");
fprintf(stream, "\t-S\t\tchase signature(s) from <name> to a know key [*]\n");
#endif /*HAVE_SSL*/
+ fprintf(stream, "\t-I <address>\tsource address to query from\n");
fprintf(stream, "\t-V <number>\tverbosity (0-5)\n");
fprintf(stream, "\t-Q\t\tquiet mode (overrules -V)\n");
fprintf(stream, "\n");
@@ -103,6 +104,7 @@ main(int argc, char *argv[])
ldns_pkt *pkt;
ldns_pkt *qpkt;
char *serv;
+ char *src = NULL;
const char *name;
char *name2;
char *progname;
@@ -110,6 +112,7 @@ main(int argc, char *argv[])
char *answer_file = NULL;
ldns_buffer *query_buffer = NULL;
ldns_rdf *serv_rdf;
+ ldns_rdf *src_rdf = NULL;
ldns_rr_type type;
ldns_rr_class clas;
#if 0
@@ -157,7 +160,7 @@ main(int argc, char *argv[])
int_type = -1; serv = NULL; type = 0;
int_clas = -1; name = NULL; clas = 0;
- qname = NULL;
+ qname = NULL; src = NULL;
progname = strdup(argv[0]);
#ifdef USE_WINSOCK
@@ -195,7 +198,7 @@ main(int argc, char *argv[])
/* global first, query opt next, option with parm's last
* and sorted */ /* "46DITSVQf:i:w:q:achuvxzy:so:p:b:k:" */
- while ((c = getopt(argc, argv, "46ab:c:d:Df:hi:Ik:o:p:q:Qr:sStTuvV:w:xy:z")) != -1) {
+ while ((c = getopt(argc, argv, "46ab:c:d:Df:hi:I:k:o:p:q:Qr:sStTuvV:w:xy:z")) != -1) {
switch(c) {
/* global options */
case '4':
@@ -208,7 +211,7 @@ main(int argc, char *argv[])
qdnssec = true;
break;
case 'I':
- /* reserved for backward compatibility */
+ src = optarg;
break;
case 'T':
if (PURPOSE == DRILL_CHASE) {
@@ -482,6 +485,14 @@ main(int argc, char *argv[])
}
}
+ if (src) {
+ src_rdf = ldns_rdf_new_addr_frm_str(src);
+ if(!src_rdf) {
+ fprintf(stderr, "-I must be (or resolve) to a valid IP[v6] address.\n");
+ exit(EXIT_FAILURE);
+ }
+ }
+
/* set the nameserver to use */
if (!serv) {
/* no server given make a resolver from /etc/resolv.conf */
@@ -513,6 +524,7 @@ main(int argc, char *argv[])
ldns_resolver_set_ip6(cmdline_res, qfamily);
ldns_resolver_set_fallback(cmdline_res, qfallback);
ldns_resolver_set_usevc(cmdline_res, qusevc);
+ ldns_resolver_set_source(cmdline_res, src_rdf);
cmdline_dname = ldns_dname_new_frm_str(serv);
@@ -543,6 +555,7 @@ main(int argc, char *argv[])
}
/* set the resolver options */
ldns_resolver_set_port(res, qport);
+ ldns_resolver_set_source(res, src_rdf);
if (verbosity >= 5) {
ldns_resolver_set_debug(res, true);
} else {
@@ -613,10 +626,17 @@ main(int argc, char *argv[])
ldns_resolver_set_dnssec_cd(res, true);
/* set dnssec implies udp_size of 4096 */
ldns_resolver_set_edns_udp_size(res, 4096);
- pkt = ldns_resolver_query(res, qname, type, clas, qflags);
-
+ pkt = NULL;
+ status = ldns_resolver_query_status(
+ &pkt, res, qname, type, clas, qflags);
+ if (status != LDNS_STATUS_OK) {
+ error("error sending query: %s",
+ ldns_get_errorstr_by_id(status));
+ }
if (!pkt) {
- error("%s", "error pkt sending");
+ if (status == LDNS_STATUS_OK) {
+ error("%s", "error pkt sending");
+ }
result = EXIT_FAILURE;
} else {
if (verbosity >= 3) {
@@ -742,9 +762,17 @@ main(int argc, char *argv[])
}
/* create a packet and set the RD flag on it */
- pkt = ldns_resolver_query(res, qname, type, clas, qflags);
+ pkt = NULL;
+ status = ldns_resolver_query_status(
+ &pkt, res, qname, type, clas, qflags);
+ if (status != LDNS_STATUS_OK) {
+ error("error sending query: %s",
+ ldns_get_errorstr_by_id(status));
+ }
if (!pkt) {
- error("%s", "pkt sending");
+ if (status == LDNS_STATUS_OK) {
+ error("%s", "pkt sending");
+ }
result = EXIT_FAILURE;
} else {
if (verbosity != -1) {
@@ -815,7 +843,15 @@ main(int argc, char *argv[])
goto exit;
} else {
/* create a packet and set the RD flag on it */
- pkt = ldns_resolver_query(res, qname, type, clas, qflags);
+ pkt = NULL;
+ status = ldns_resolver_query_status(
+ &pkt, res, qname,
+ type, clas, qflags);
+ if (status != LDNS_STATUS_OK) {
+ error("error sending query: %s"
+ , ldns_get_errorstr_by_id(
+ status));
+ }
}
}
@@ -926,6 +962,7 @@ main(int argc, char *argv[])
exit:
ldns_rdf_deep_free(qname);
+ ldns_rdf_deep_free(src_rdf);
ldns_resolver_deep_free(res);
ldns_resolver_deep_free(cmdline_res);
ldns_rr_list_deep_free(key_list);
diff --git a/drill/drill_util.c b/drill/drill_util.c
index db0433e77e1d..9cf90a50ff0a 100644
--- a/drill/drill_util.c
+++ b/drill/drill_util.c
@@ -17,10 +17,10 @@ static int
read_line(FILE *input, char *line, size_t len)
{
int i;
-
- char c;
+ int c;
+
for (i = 0; i < (int)len-1; i++) {
- c = (char)getc(input);
+ c = getc(input);
if (c == EOF) {
return -1;
} else if (c != '\n') {
diff --git a/drill/securetrace.c b/drill/securetrace.c
index c6e7e588409a..5fc493a7275d 100644
--- a/drill/securetrace.c
+++ b/drill/securetrace.c
@@ -138,7 +138,7 @@ do_secure_trace(ldns_resolver *local_res, ldns_rdf *name, ldns_rr_type t,
size_t j;
size_t k;
size_t l;
- uint8_t labels_count;
+ uint8_t labels_count = 0;
/* dnssec */
ldns_rr_list *key_list;
@@ -156,6 +156,9 @@ do_secure_trace(ldns_resolver *local_res, ldns_rdf *name, ldns_rr_type t,
/* empty non-terminal check */
bool ent;
+ ldns_rr *nsecrr; /* The nsec that proofs the non-terminal */
+ ldns_rdf *hashed_name; /* The query hashed with nsec3 params */
+ ldns_rdf *label0; /* The first label of an nsec3 owner name */
/* glue handling */
ldns_rr_list *new_ns_addr;
@@ -220,6 +223,8 @@ do_secure_trace(ldns_resolver *local_res, ldns_rdf *name, ldns_rr_type t,
ldns_resolver_usevc(local_res));
ldns_resolver_set_random(res,
ldns_resolver_random(local_res));
+ ldns_resolver_set_source(res,
+ ldns_resolver_source(local_res));
ldns_resolver_set_recursive(local_res, true);
ldns_resolver_set_recursive(res, false);
@@ -380,8 +385,27 @@ do_secure_trace(ldns_resolver *local_res, ldns_rdf *name, ldns_rr_type t,
/* there might be an empty non-terminal, in which case we need to continue */
ent = false;
for (j = 0; j < ldns_rr_list_rr_count(nsec_rrs); j++) {
- if (ldns_dname_is_subdomain(ldns_rr_rdf(ldns_rr_list_rr(nsec_rrs, j), 0), labels[i])) {
+ nsecrr = ldns_rr_list_rr(nsec_rrs, j);
+ /* For NSEC when the next name is a subdomain of the question */
+ if (ldns_rr_get_type(nsecrr) == LDNS_RR_TYPE_NSEC &&
+ ldns_dname_is_subdomain(ldns_rr_rdf(nsecrr, 0), labels[i])) {
ent = true;
+
+ /* For NSEC3, the hash matches the name and the type bitmap is empty*/
+ } else if (ldns_rr_get_type(nsecrr) == LDNS_RR_TYPE_NSEC3) {
+ hashed_name = ldns_nsec3_hash_name_frm_nsec3(nsecrr, labels[i]);
+ label0 = ldns_dname_label(ldns_rr_owner(nsecrr), 0);
+ if (hashed_name && label0 &&
+ ldns_dname_compare(hashed_name, label0) == 0 &&
+ ldns_nsec3_bitmap(nsecrr) == NULL) {
+ ent = true;
+ }
+ if (label0) {
+ LDNS_FREE(label0);
+ }
+ if (hashed_name) {
+ LDNS_FREE(hashed_name);
+ }
}
}
if (!ent) {
diff --git a/drill/work.c b/drill/work.c
index 653145fe522b..370d48b01b3e 100644
--- a/drill/work.c
+++ b/drill/work.c
@@ -235,6 +235,7 @@ dump_hex(const ldns_pkt *pkt, const char *filename)
if (status != LDNS_STATUS_OK) {
error("Unable to convert packet: error code %u", status);
LDNS_FREE(wire);
+ fclose(fp);
return;
}
diff --git a/error.c b/error.c
index 2fc63e9b099b..82ea61a1dcc2 100644
--- a/error.c
+++ b/error.c
@@ -65,6 +65,7 @@ ldns_lookup_table ldns_error_str[] = {
{ LDNS_STATUS_WIRE_INCOMPLETE_AUTHORITY, "authority section incomplete" },
{ LDNS_STATUS_WIRE_INCOMPLETE_ADDITIONAL, "additional section incomplete" },
{ LDNS_STATUS_NO_DATA, "No data" },
+ { LDNS_STATUS_EXISTS_ERR, "Element already exists" },
{ LDNS_STATUS_CERT_BAD_ALGORITHM, "Bad algorithm type for CERT record" },
{ LDNS_STATUS_SYNTAX_TYPE_ERR, "Syntax error, could not parse the RR's type" },
{ LDNS_STATUS_SYNTAX_CLASS_ERR, "Syntax error, could not parse the RR's class" },
@@ -124,6 +125,24 @@ ldns_lookup_table ldns_error_str[] = {
{ LDNS_STATUS_DANE_PKIX_NO_SELF_SIGNED_TRUST_ANCHOR,
"The validation path "
"did not end in a self-signed certificate" },
+ { LDNS_STATUS_INVALID_ILNP64,
+ "Conversion error, 4 colon separated hex numbers expected" },
+ { LDNS_STATUS_INVALID_EUI48,
+ "Conversion error, 6 two character hex numbers "
+ "separated by dashes expected (i.e. xx-xx-xx-xx-xx-xx" },
+ { LDNS_STATUS_INVALID_EUI64,
+ "Conversion error, 8 two character hex numbers "
+ "separated by dashes expected (i.e. xx-xx-xx-xx-xx-xx-xx-xx" },
+ { LDNS_STATUS_WIRE_RDATA_ERR, "invalid rdata in wire format" },
+ { LDNS_STATUS_INVALID_TAG,
+ "Conversion error, a non-zero sequence of US-ASCII letters "
+ "and numbers in lower case expected" },
+ { LDNS_STATUS_TYPE_NOT_IN_BITMAP,
+ "The RR type bitmap rdata field did not have "
+ "a bit reserved for the specific RR type" },
+ { LDNS_STATUS_INVALID_RDF_TYPE,
+ "The rdata field was not of the expected type" },
+ { LDNS_STATUS_RDATA_OVERFLOW, "Rdata size overflow" },
{ 0, NULL }
};
diff --git a/examples/config.h.in b/examples/config.h.in
index 1f548a17c8d5..e645acea1744 100644
--- a/examples/config.h.in
+++ b/examples/config.h.in
@@ -19,6 +19,14 @@
don't. */
#undef HAVE_DECL_IN6ADDR_ANY
+/* Define to 1 if you have the declaration of `NID_secp384r1', and to 0 if you
+ don't. */
+#undef HAVE_DECL_NID_SECP384R1
+
+/* Define to 1 if you have the declaration of `NID_X9_62_prime256v1', and to 0
+ if you don't. */
+#undef HAVE_DECL_NID_X9_62_PRIME256V1
+
/* Define to 1 if you have the `fork' function. */
#undef HAVE_FORK
@@ -187,6 +195,9 @@
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
+/* Define this to enable DANE support. */
+#undef USE_DANE
+
/* Define this to enable ECDSA support. */
#undef USE_ECDSA
diff --git a/examples/configure b/examples/configure
index 66c1e718f9ed..601f6ee06a0b 100755
--- a/examples/configure
+++ b/examples/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for ldns 1.6.16.
+# Generated by GNU Autoconf 2.68 for ldns 1.6.17.
#
# Report bugs to <libdns@nlnetlabs.nl>.
#
@@ -560,8 +560,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='ldns'
PACKAGE_TARNAME='libdns'
-PACKAGE_VERSION='1.6.16'
-PACKAGE_STRING='ldns 1.6.16'
+PACKAGE_VERSION='1.6.17'
+PACKAGE_STRING='ldns 1.6.17'
PACKAGE_BUGREPORT='libdns@nlnetlabs.nl'
PACKAGE_URL=''
@@ -673,6 +673,7 @@ with_ssl
enable_sha2
enable_gost
enable_ecdsa
+enable_dane
with_ldns
with_trust_anchor
with_ca_file
@@ -1229,7 +1230,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures ldns 1.6.16 to adapt to many kinds of systems.
+\`configure' configures ldns 1.6.17 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1290,7 +1291,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of ldns 1.6.16:";;
+ short | recursive ) echo "Configuration of ldns 1.6.17:";;
esac
cat <<\_ACEOF
@@ -1301,7 +1302,8 @@ Optional Features:
--disable-rpath Disable hardcoded rpath (default=enabled)
--disable-sha2 Disable SHA256 and SHA512 RRSIG support
--disable-gost Disable GOST support
- --enable-ecdsa Enable ECDSA support, experimental
+ --disable-ecdsa Disable ECDSA support
+ --disable-dane Disable DANE support
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -1395,7 +1397,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-ldns configure 1.6.16
+ldns configure 1.6.17
generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
@@ -1864,7 +1866,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by ldns $as_me 1.6.16, which was
+It was created by ldns $as_me 1.6.17, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
@@ -2217,7 +2219,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
# Copyright 2009, Wouter Wijngaards, NLnet Labs.
# BSD licensed.
#
-# Version 21
+# Version 26
+# 2013-09-19 FLTO help text improved.
+# 2013-07-18 Enable ACX_CHECK_COMPILER_FLAG to test for -Wstrict-prototypes
+# 2013-06-25 FLTO has --disable-flto option.
+# 2013-05-03 Update W32_SLEEP for newer mingw that links but not defines it.
+# 2013-03-22 Fix ACX_RSRC_VERSION for long version numbers.
# 2012-02-09 Fix AHX_MEMCMP_BROKEN with undef in compat/memcmp.h.
# 2012-01-20 Fix COMPILER_FLAGS_UNBOUND for gcc 4.6.2 assigned-not-used-warns.
# 2011-12-05 Fix getaddrinfowithincludes on windows with fedora16 mingw32-gcc.
@@ -2232,7 +2239,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
# 2010-07-02 Add check for ss_family (for minix).
# 2010-04-26 Fix to use CPPFLAGS for CHECK_COMPILER_FLAGS.
# 2010-03-01 Fix RPATH using CONFIG_COMMANDS to run at the very end.
-# 2010-02-18 WITH_SSL outputs the LIBSSL_LDFLAGS, LIBS, CPPFLAGS seperate, -ldl
+# 2010-02-18 WITH_SSL outputs the LIBSSL_LDFLAGS, LIBS, CPPFLAGS separate, -ldl
# 2010-02-01 added ACX_CHECK_MEMCMP_SIGNED, AHX_MEMCMP_BROKEN
# 2010-01-20 added AHX_COONFIG_STRLCAT
# 2009-07-14 U_CHAR detection improved for windows crosscompile.
@@ -4289,7 +4296,7 @@ if eval \${cv_prog_cc_flag_$cache+:} false; then :
$as_echo_n "(cached) " >&6
else
-echo 'void f(){}' >conftest.c
+echo 'void f(void){}' >conftest.c
if test -z "`$CC $CPPFLAGS $CFLAGS -std=c99 -c conftest.c 2>&1`"; then
eval "cv_prog_cc_flag_$cache=yes"
else
@@ -4320,7 +4327,7 @@ if eval \${cv_prog_cc_flag_$cache+:} false; then :
$as_echo_n "(cached) " >&6
else
-echo 'void f(){}' >conftest.c
+echo 'void f(void){}' >conftest.c
if test -z "`$CC $CPPFLAGS $CFLAGS -xc99 -c conftest.c 2>&1`"; then
eval "cv_prog_cc_flag_$cache=yes"
else
@@ -4376,7 +4383,7 @@ if eval \${cv_prog_cc_flag_$cache+:} false; then :
$as_echo_n "(cached) " >&6
else
-echo 'void f(){}' >conftest.c
+echo 'void f(void){}' >conftest.c
if test -z "`$CC $CPPFLAGS $CFLAGS -O2 -c conftest.c 2>&1`"; then
eval "cv_prog_cc_flag_$cache=yes"
else
@@ -4409,7 +4416,7 @@ if eval \${cv_prog_cc_flag_$cache+:} false; then :
$as_echo_n "(cached) " >&6
else
-echo 'void f(){}' >conftest.c
+echo 'void f(void){}' >conftest.c
if test -z "`$CC $CPPFLAGS $CFLAGS -Werror -c conftest.c 2>&1`"; then
eval "cv_prog_cc_flag_$cache=yes"
else
@@ -4440,7 +4447,7 @@ if eval \${cv_prog_cc_flag_$cache+:} false; then :
$as_echo_n "(cached) " >&6
else
-echo 'void f(){}' >conftest.c
+echo 'void f(void){}' >conftest.c
if test -z "`$CC $CPPFLAGS $CFLAGS -Wall -c conftest.c 2>&1`"; then
eval "cv_prog_cc_flag_$cache=yes"
else
@@ -5272,7 +5279,7 @@ done
if test "x$HAVE_SSL" = "xyes"; then
-LIBSSL_SSL_LIBS="$LIBSSL_LIBS -lssl"
+LIBSSL_SSL_LIBS="-lssl $LIBSSL_LIBS"
fi
CPPFLAGS="$tmp_CPPFLAGS"
@@ -5354,31 +5361,94 @@ if test "${enable_ecdsa+set}" = set; then :
fi
case "$enable_ecdsa" in
- yes)
- ac_fn_c_check_func "$LINENO" "ECDSA_sign" "ac_cv_func_ECDSA_sign"
+ no)
+ ;;
+ *) if test "x$HAVE_SSL" != "xyes"; then
+ as_fn_error $? "ECDSA enabled, but no SSL support" "$LINENO" 5
+ fi
+ ac_fn_c_check_func "$LINENO" "ECDSA_sign" "ac_cv_func_ECDSA_sign"
if test "x$ac_cv_func_ECDSA_sign" = xyes; then :
else
- as_fn_error $? "OpenSSL does not support ECDSA" "$LINENO" 5
+ as_fn_error $? "OpenSSL does not support ECDSA: please upgrade OpenSSL or rerun with --disable-ecdsa" "$LINENO" 5
+fi
+
+ ac_fn_c_check_func "$LINENO" "SHA384_Init" "ac_cv_func_SHA384_Init"
+if test "x$ac_cv_func_SHA384_Init" = xyes; then :
+
+else
+ as_fn_error $? "OpenSSL does not support SHA384: please upgrade OpenSSL or rerun with --disable-ecdsa" "$LINENO" 5
fi
+ ac_fn_c_check_decl "$LINENO" "NID_X9_62_prime256v1" "ac_cv_have_decl_NID_X9_62_prime256v1" "$ac_includes_default
+#include <openssl/evp.h>
+
+"
+if test "x$ac_cv_have_decl_NID_X9_62_prime256v1" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_NID_X9_62_PRIME256V1 $ac_have_decl
+_ACEOF
+if test $ac_have_decl = 1; then :
+
+else
+ as_fn_error $? "OpenSSL does not support the ECDSA curves: please upgrade OpenSSL or rerun with --disable-ecdsa" "$LINENO" 5
+fi
+ac_fn_c_check_decl "$LINENO" "NID_secp384r1" "ac_cv_have_decl_NID_secp384r1" "$ac_includes_default
+#include <openssl/evp.h>
+
+"
+if test "x$ac_cv_have_decl_NID_secp384r1" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_NID_SECP384R1 $ac_have_decl
+_ACEOF
+if test $ac_have_decl = 1; then :
+
+else
+ as_fn_error $? "OpenSSL does not support the ECDSA curves: please upgrade OpenSSL or rerun with --disable-ecdsa" "$LINENO" 5
+fi
+
+ # we now know we have ECDSA and the required curves.
cat >>confdefs.h <<_ACEOF
#define USE_ECDSA 1
_ACEOF
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
- *****************************************************************
- *** YOU HAVE ENABLED ECDSA WHICH IS EXPERIMENTAL AT THIS TIME ***
- *** PLEASE DO NOT USE THIS ON THE PUBLIC INTERNET ***
- *****************************************************************" >&5
-$as_echo "$as_me: WARNING:
- *****************************************************************
- *** YOU HAVE ENABLED ECDSA WHICH IS EXPERIMENTAL AT THIS TIME ***
- *** PLEASE DO NOT USE THIS ON THE PUBLIC INTERNET ***
- *****************************************************************" >&2;}
;;
- no|*)
+esac
+
+# Check whether --enable-dane was given.
+if test "${enable_dane+set}" = set; then :
+ enableval=$enable_dane;
+fi
+
+case "$enable_dane" in
+ no)
+ ;;
+ *) if test "x$HAVE_SSL" != "xyes"; then
+ as_fn_error $? "DANE enabled, but no SSL support" "$LINENO" 5
+ fi
+ ac_fn_c_check_func "$LINENO" "X509_check_ca" "ac_cv_func_X509_check_ca"
+if test "x$ac_cv_func_X509_check_ca" = xyes; then :
+
+else
+ as_fn_error $? "OpenSSL does not support DANE: please upgrade OpenSSL or rerun with --disable-dane" "$LINENO" 5
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define USE_DANE 1
+_ACEOF
+
;;
esac
@@ -6489,7 +6559,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by ldns $as_me 1.6.16, which was
+This file was extended by ldns $as_me 1.6.17, which was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -6551,7 +6621,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-ldns config.status 1.6.16
+ldns config.status 1.6.17
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
diff --git a/examples/configure.ac b/examples/configure.ac
index 9bd74ff41aa6..e33983e77185 100644
--- a/examples/configure.ac
+++ b/examples/configure.ac
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.56)
-AC_INIT(ldns, 1.6.16, libdns@nlnetlabs.nl,libdns)
+AC_INIT(ldns, 1.6.17, libdns@nlnetlabs.nl,libdns)
AC_CONFIG_SRCDIR([ldns-read-zone.c])
sinclude(../acx_nlnetlabs.m4)
@@ -137,7 +137,7 @@ AC_SUBST(LIBSSL_CPPFLAGS)
AC_SUBST(LIBSSL_LDFLAGS)
AC_SUBST(LIBSSL_LIBS)
if test "x$HAVE_SSL" = "xyes"; then
-AC_SUBST(LIBSSL_SSL_LIBS, ["$LIBSSL_LIBS -lssl"])
+AC_SUBST(LIBSSL_SSL_LIBS, ["-lssl $LIBSSL_LIBS"])
fi
CPPFLAGS="$tmp_CPPFLAGS"
LDFLAGS="$tmp_LDFLAGS"
@@ -176,18 +176,34 @@ case "$enable_gost" in
;;
esac
-AC_ARG_ENABLE(ecdsa, AC_HELP_STRING([--enable-ecdsa], [Enable ECDSA support, experimental]))
+AC_ARG_ENABLE(ecdsa, AC_HELP_STRING([--disable-ecdsa], [Disable ECDSA support]))
case "$enable_ecdsa" in
- yes)
- AC_CHECK_FUNC(ECDSA_sign,,[AC_MSG_ERROR([OpenSSL does not support ECDSA])])
- AC_DEFINE_UNQUOTED([USE_ECDSA], [1], [Define this to enable ECDSA support.])
- AC_WARN([
- *****************************************************************
- *** YOU HAVE ENABLED ECDSA WHICH IS EXPERIMENTAL AT THIS TIME ***
- *** PLEASE DO NOT USE THIS ON THE PUBLIC INTERNET ***
- *****************************************************************])
+ no)
+ ;;
+ *) dnl default
+ if test "x$HAVE_SSL" != "xyes"; then
+ AC_MSG_ERROR([ECDSA enabled, but no SSL support])
+ fi
+ AC_CHECK_FUNC(ECDSA_sign, [], [AC_MSG_ERROR([OpenSSL does not support ECDSA: please upgrade OpenSSL or rerun with --disable-ecdsa])])
+ AC_CHECK_FUNC(SHA384_Init, [], [AC_MSG_ERROR([OpenSSL does not support SHA384: please upgrade OpenSSL or rerun with --disable-ecdsa])])
+ AC_CHECK_DECLS([NID_X9_62_prime256v1, NID_secp384r1], [], [AC_MSG_ERROR([OpenSSL does not support the ECDSA curves: please upgrade OpenSSL or rerun with --disable-ecdsa])], [AC_INCLUDES_DEFAULT
+#include <openssl/evp.h>
+ ])
+ # we now know we have ECDSA and the required curves.
+ AC_DEFINE_UNQUOTED([USE_ECDSA], [1], [Define this to enable ECDSA support.])
+ ;;
+esac
+
+AC_ARG_ENABLE(dane, AC_HELP_STRING([--disable-dane], [Disable DANE support]))
+case "$enable_dane" in
+ no)
;;
- no|*)
+ *) dnl default
+ if test "x$HAVE_SSL" != "xyes"; then
+ AC_MSG_ERROR([DANE enabled, but no SSL support])
+ fi
+ AC_CHECK_FUNC(X509_check_ca, [], [AC_MSG_ERROR([OpenSSL does not support DANE: please upgrade OpenSSL or rerun with --disable-dane])])
+ AC_DEFINE_UNQUOTED([USE_DANE], [1], [Define this to enable DANE support.])
;;
esac
diff --git a/examples/ldns-compare-zones.c b/examples/ldns-compare-zones.c
index 663b744acc57..a39c4b80c607 100644
--- a/examples/ldns-compare-zones.c
+++ b/examples/ldns-compare-zones.c
@@ -33,6 +33,8 @@ usage(char *prog)
printf(" -a - print all differences (-i -d -c)\n");
printf(" -s - do not exclude SOA record from comparison\n");
printf(" -z - do not sort zones\n");
+ printf(" -h - show usage and exit\n");
+ printf(" -v - show the version and exit\n");
}
int
diff --git a/examples/ldns-dane.1.in b/examples/ldns-dane.1.in
index 8f05d7f681a1..b65e64f0441f 100644
--- a/examples/ldns-dane.1.in
+++ b/examples/ldns-dane.1.in
@@ -151,6 +151,9 @@ Read TLSA record(s) from \fItlsafile\fR. When \fIname\fR and \fIport\fR
are also given, only TLSA records that match the \fIname\fR, \fIport\fR and
\fItransport\fR are used. Otherwise the owner name of the TLSA record(s)
will be used to determine \fIname\fR, \fIport\fR and \fItransport\fR.
+.IP -T
+Return exit status 2 for PKIX validated connections without (secure)
+TLSA records(s)
.IP -u
Use UDP transport instead of TCP.
.IP -v
diff --git a/examples/ldns-dane.c b/examples/ldns-dane.c
index 3ae358813296..93c18e548353 100644
--- a/examples/ldns-dane.c
+++ b/examples/ldns-dane.c
@@ -15,13 +15,27 @@
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
+
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETDB_H
#include <netdb.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#include <sys/time.h>
+#include <errno.h>
+#include <fcntl.h>
#include <ldns/ldns.h>
-
#include <errno.h>
+#ifdef USE_DANE
#ifdef HAVE_SSL
#include <openssl/ssl.h>
#include <openssl/err.h>
@@ -37,6 +51,11 @@
exit(EXIT_FAILURE); } while (false)
#define BUFSIZE 16384
+/* Exit status on a PKIX validated connection but without TLSA records
+ * when the -T option was given:
+ */
+#define NO_TLSAS_EXIT_STATUS 2
+
/* int verbosity = 3; */
void
@@ -106,9 +125,11 @@ print_usage(const char* progname)
printf("\t-t <tlsafile>\tdo not use DNS, "
"but read TLSA record(s) from <tlsafile>\n"
);
+ printf("\t-T\t\tReturn exit status 2 for PKIX validated connections\n"
+ "\t\t\twithout (secure) TLSA records(s)\n");
printf("\t-u\t\tuse UDP transport instead of TCP\n");
printf("\t-v\t\tshow version and exit\n");
- /* printf("\t-V [0-5]\tset verbosity level (defaul 3)\n"); */
+ /* printf("\t-V [0-5]\tset verbosity level (default 3)\n"); */
exit(EXIT_SUCCESS);
}
@@ -197,7 +218,8 @@ ldns_err(const char* s, ldns_status err)
ldns_status
ssl_connect_and_get_cert_chain(
X509** cert, STACK_OF(X509)** extra_certs,
- SSL* ssl, ldns_rdf* address, uint16_t port,
+ SSL* ssl, const char* name_str,
+ ldns_rdf* address, uint16_t port,
ldns_dane_transport transport)
{
struct sockaddr_storage *a = NULL;
@@ -246,6 +268,9 @@ ssl_connect_and_get_cert_chain(
fprintf(stderr, "SSL_clear\n");
return LDNS_STATUS_SSL_ERR;
}
+#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
+ (void) SSL_set_tlsext_host_name(ssl, name_str);
+#endif
SSL_set_connect_state(ssl);
(void) SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY);
if (! SSL_set_fd(ssl, sock)) {
@@ -359,12 +384,6 @@ ssl_interact(SSL* ssl)
}
-void
-ssl_shutdown(SSL* ssl)
-{
- while (SSL_shutdown(ssl) == 0);
-}
-
ldns_rr_list*
rr_list_filter_rr_type(ldns_rr_list* l, ldns_rr_type t)
{
@@ -715,7 +734,7 @@ dane_lookup_addresses(ldns_resolver* res, ldns_rdf* dname,
} else if (s == LDNS_STATUS_DANE_BOGUS ||
LDNS_STATUS_CRYPTO_BOGUS == s) {
- fprintf(stderr, "Warning! Bogus IPv4 addresses. "
+ fprintf(stderr, "Warning! Bogus IPv6 addresses. "
"Discarding...\n");
ldns_rr_list_deep_free(aaas);
aaas = ldns_rr_list_new();
@@ -1041,7 +1060,8 @@ bool
dane_verify(ldns_rr_list* tlsas, ldns_rdf* address,
X509* cert, STACK_OF(X509)* extra_certs,
X509_STORE* validate_store,
- bool verify_server_name, ldns_rdf* name)
+ bool verify_server_name, ldns_rdf* name,
+ bool assume_pkix_validity)
{
ldns_status s;
char* address_str = NULL;
@@ -1066,6 +1086,11 @@ dane_verify(ldns_rr_list* tlsas, ldns_rdf* address,
}
fprintf(stdout, " dane-validated successfully\n");
return true;
+ } else if (assume_pkix_validity &&
+ s == LDNS_STATUS_DANE_PKIX_DID_NOT_VALIDATE) {
+ fprintf(stdout, " dane-validated successfully,"
+ " because PKIX is assumed valid\n");
+ return true;
}
fprintf(stdout, " did not dane-validate, because: %s\n",
ldns_get_errorstr_by_id(s));
@@ -1145,12 +1170,15 @@ main(int argc, char* const* argv)
SSL_CTX* ctx = NULL;
SSL* ssl = NULL;
+ int no_tlsas_exit_status = EXIT_SUCCESS;
+ int exit_success = EXIT_SUCCESS;
+
bool success = true;
if (! keys || ! addresses) {
MEMERR("ldns_rr_list_new");
}
- while((c = getopt(argc, argv, "46a:bc:df:hik:no:p:sSt:uvV:")) != -1) {
+ while((c = getopt(argc, argv, "46a:bc:df:hik:no:p:sSt:TuvV:")) != -1){
switch(c) {
case 'h':
print_usage("ldns-dane");
@@ -1242,6 +1270,9 @@ main(int argc, char* const* argv)
case 't':
tlsas_file = optarg;
break;
+ case 'T':
+ no_tlsas_exit_status = NO_TLSAS_EXIT_STATUS;
+ break;
case 'u':
transport = LDNS_DANE_TRANSPORT_UDP;
break;
@@ -1323,7 +1354,7 @@ main(int argc, char* const* argv)
exit(EXIT_FAILURE);
}
s = dane_read_tlsas_from_file(&tlsas, tlsas_file, NULL);
- LDNS_ERR(s, "could not read tlas from file");
+ LDNS_ERR(s, "could not read tlsas from file");
/* extract port, transport and hostname from TLSA owner name */
@@ -1465,7 +1496,9 @@ main(int argc, char* const* argv)
"PKIX validation without DANE will be "
"performed. If you wish to perform DANE\n"
"even though the RR's are insecure, "
- "se the -d option.\n", tlsa_owner_str);
+ "use the -d option.\n", tlsa_owner_str);
+
+ exit_success = no_tlsas_exit_status;
} else if (s != LDNS_STATUS_OK) {
@@ -1478,6 +1511,8 @@ main(int argc, char* const* argv)
"PKIX validation without DANE will be "
"performed.\n", ldns_rdf2str(tlsa_owner));
+ exit_success = no_tlsas_exit_status;
+
} else if (assume_pkix_validity) { /* number of tlsa's > 0 */
/* transform type "CA constraint" to "Trust anchor
@@ -1590,13 +1625,13 @@ main(int argc, char* const* argv)
SSL_CTX_use_certificate_chain_file(ctx, cert_file) != 1) {
ssl_err("error loading certificate");
}
- ssl = SSL_new(ctx);
- if (! ssl) {
- ssl_err("could not SSL_new");
- }
if (cert_file) { /* ssl load certificate */
+ ssl = SSL_new(ctx);
+ if (! ssl) {
+ ssl_err("could not SSL_new");
+ }
cert = SSL_get_certificate(ssl);
if (! cert) {
ssl_err("could not SSL_get_certificate");
@@ -1613,12 +1648,14 @@ main(int argc, char* const* argv)
break;
case VERIFY: if (! dane_verify(tlsas, NULL,
cert, extra_certs, store,
- verify_server_name, name)) {
+ verify_server_name, name,
+ assume_pkix_validity)) {
success = false;
}
break;
default: break; /* suppress warning */
}
+ SSL_free(ssl);
} else {/* No certificate file given, creation/validation via TLS. */
@@ -1639,12 +1676,16 @@ main(int argc, char* const* argv)
/* for all addresses, setup SSL and retrieve certificates */
for (i = 0; i < ldns_rr_list_rr_count(addresses); i++) {
+ ssl = SSL_new(ctx);
+ if (! ssl) {
+ ssl_err("could not SSL_new");
+ }
address = ldns_rr_a_address(
ldns_rr_list_rr(addresses, i));
assert(address != NULL);
s = ssl_connect_and_get_cert_chain(&cert, &extra_certs,
- ssl, address, port, transport);
+ ssl, name_str, address,port, transport);
if (s == LDNS_STATUS_NETWORK_ERR) {
fprintf(stderr, "Could not connect to ");
ldns_rdf_print(stderr, address);
@@ -1666,7 +1707,8 @@ main(int argc, char* const* argv)
case VERIFY: if (! dane_verify(tlsas, address,
cert, extra_certs, store,
- verify_server_name, name)) {
+ verify_server_name, name,
+ assume_pkix_validity)) {
success = false;
} else if (interact) {
@@ -1675,7 +1717,8 @@ main(int argc, char* const* argv)
break;
default: break; /* suppress warning */
}
- ssl_shutdown(ssl);
+ while (SSL_shutdown(ssl) == 0);
+ SSL_free(ssl);
} /* end for all addresses */
} /* end No certification file */
@@ -1689,7 +1732,6 @@ main(int argc, char* const* argv)
ldns_rr_list_deep_free(tlsas);
/* cleanup */
- SSL_free(ssl);
SSL_CTX_free(ctx);
if (store) {
@@ -1705,12 +1747,12 @@ main(int argc, char* const* argv)
ldns_rr_list_deep_free(addresses);
}
if (success) {
- exit(EXIT_SUCCESS);
+ exit(exit_success);
} else {
exit(EXIT_FAILURE);
}
}
-#else
+#else /* HAVE_SSL */
int
main(int argc, char **argv)
@@ -1720,3 +1762,15 @@ main(int argc, char **argv)
return 1;
}
#endif /* HAVE_SSL */
+
+#else /* USE_DANE */
+
+int
+main(int argc, char **argv)
+{
+ fprintf(stderr, "dane support was disabled with this build of ldns, "
+ "and has not been compiled in\n");
+ return 1;
+}
+
+#endif /* USE_DANE */
diff --git a/examples/ldns-dpa.c b/examples/ldns-dpa.c
index c5717b245e9e..0bc8a8403296 100644
--- a/examples/ldns-dpa.c
+++ b/examples/ldns-dpa.c
@@ -2823,13 +2823,13 @@ int main(int argc, char *argv[]) {
}
#else
-int main() {
+int main(void) {
fprintf(stderr, "ldns-dpa was not built because there is no pcap library on this system, or there was no pcap header file at compilation time. Please install pcap and rebuild.\n");
return 1;
}
#endif
#else
-int main() {
+int main(void) {
fprintf(stderr, "ldns-dpa was not built because there is no pcap library on this system, or there was no pcap header file at compilation time. Please install pcap and rebuild.\n");
return 1;
}
diff --git a/examples/ldns-key2ds.1 b/examples/ldns-key2ds.1
index 6fdbee5f1a3f..a20ab96fb475 100644
--- a/examples/ldns-key2ds.1
+++ b/examples/ldns-key2ds.1
@@ -17,6 +17,10 @@ SHA1 for RSASHA1, and so on.
.SH OPTIONS
.TP
+\fB-f\fR
+Ignore SEP flag (i.e. make DS records for any key)
+
+.TP
\fB-n\fR
Write the result DS Resource Record to stdout instead of a file
diff --git a/examples/ldns-key2ds.c b/examples/ldns-key2ds.c
index a3e54383ab9c..9426f685929b 100644
--- a/examples/ldns-key2ds.c
+++ b/examples/ldns-key2ds.c
@@ -63,8 +63,7 @@ suitable_hash(ldns_signing_algorithm algorithm)
case LDNS_SIGN_ECDSAP384SHA384:
return LDNS_SHA384;
#endif
- default:
- return LDNS_SHA1;
+ default: break;
}
return LDNS_SHA1;
}
diff --git a/examples/ldns-keyfetcher.c b/examples/ldns-keyfetcher.c
index fa78b432b39f..4988bfbb3fb3 100644
--- a/examples/ldns-keyfetcher.c
+++ b/examples/ldns-keyfetcher.c
@@ -151,7 +151,7 @@ retrieve_dnskeys(ldns_resolver *local_res, ldns_rdf *name, ldns_rr_type t,
* try to resolve the names we do got
*/
if (verbosity >= 3) {
- printf("Did not get address record for nameserver, doing seperate query.\n");
+ printf("Did not get address record for nameserver, doing separate query.\n");
}
ns_addr = ldns_rr_list_new();
for(i = 0; (size_t) i < ldns_rr_list_rr_count(new_nss); i++) {
diff --git a/examples/ldns-keygen.c b/examples/ldns-keygen.c
index 576541790c90..316d60d77740 100644
--- a/examples/ldns-keygen.c
+++ b/examples/ldns-keygen.c
@@ -71,7 +71,7 @@ main(int argc, char *argv[])
random = NULL;
ksk = false; /* don't create a ksk per default */
- while ((c = getopt(argc, argv, "a:kb:r:v25")) != -1) {
+ while ((c = getopt(argc, argv, "a:kb:r:v")) != -1) {
switch (c) {
case 'a':
if (algorithm != 0) {
@@ -182,7 +182,7 @@ main(int argc, char *argv[])
/* generate a new key */
key = ldns_key_new_frm_algorithm(algorithm, bits);
- /* set the owner name in the key - this is a /seperate/ step */
+ /* set the owner name in the key - this is a /separate/ step */
ldns_key_set_pubkey_owner(key, domain);
/* ksk flag */
diff --git a/examples/ldns-read-zone.1 b/examples/ldns-read-zone.1
index 7d4fd7d94941..8652fe9acd39 100644
--- a/examples/ldns-read-zone.1
+++ b/examples/ldns-read-zone.1
@@ -22,6 +22,10 @@ that is not of type NSEC, NSEC3, RRSIG or DNSKEY. DS records are not
printed.
.TP
+\fB-b\fR
+Include Bubble Babble encoding of DS's.
+
+.TP
\fB-0\fR
Print a (null) for the RRSIG inception, expiry and key data. This option
can be used when comparing different signing systems that use the same
@@ -58,6 +62,23 @@ increased by one.
When updating a serial number, records of type NSEC, NSEC3, RRSIG and DNSKEY
will be skipped when printing the zone.
+.TP
+\fB-u\fR \fIRR type\fR
+Mark \fIRR type\fR for printing in unknown type format.
+
+\fB-u\fR is not meant to be used together with \fB-U\fR.
+
+.TP
+\fB-U\fR \fIRR type\fR
+Mark \fIRR type\fR for \fBnot\fR printing in unknown type format.
+
+The first occurrence of the \fB-U\fR option marks all RR types for printing
+in unknown type format except for the given \fIRR type\fR.
+Subsequent \fB-U\fR options will clear the mark for those \fIRR type\fRs too,
+so that only the given \fIRR type\fRs will be printed in the presentation
+format specific for those \fIRR type\fRs.
+
+\fB-U\fR is not meant to be used together with \fB-u\fR.
.TP
\fB-v\fR
diff --git a/examples/ldns-read-zone.c b/examples/ldns-read-zone.c
index efe187e6a223..512621d3fff6 100644
--- a/examples/ldns-read-zone.c
+++ b/examples/ldns-read-zone.c
@@ -15,6 +15,52 @@
#include <errno.h>
+void print_usage(const char* progname)
+{
+ printf("Usage: %s [OPTIONS] <zonefile>\n", progname);
+ printf("\tReads the zonefile and prints it.\n");
+ printf("\tThe RR count of the zone is printed to stderr.\n");
+ printf("\t-b include Bubble Babble encoding of DS's.\n");
+ printf("\t-0 zeroize timestamps and signature in RRSIG records.\n");
+ printf("\t-c canonicalize all rrs in the zone.\n");
+ printf("\t-d only show DNSSEC data from the zone\n");
+ printf("\t-h show this text\n");
+ printf("\t-n do not print the SOA record\n");
+ printf("\t-p prepend SOA serial with spaces so"
+ " it takes exactly ten characters.\n");
+ printf("\t-s strip DNSSEC data from the zone\n");
+ printf("\t-S [[+|-]<number> | YYYYMMDDxx | "
+ " unixtime ]\n"
+ "\t\tSet serial number to <number> or,"
+ " when preceded by a sign,\n"
+ "\t\toffset the existing number with "
+ "<number>. With YYYYMMDDxx\n"
+ "\t\tthe serial is formatted as a datecounter"
+ ", and with unixtime as\n"
+ "\t\tthe number of seconds since 1-1-1970."
+ " However, on serial\n"
+ "\t\tnumber decrease, +1 is used in stead"
+ ". (implies -s)\n");
+ printf("\t-u <rr type>\n");
+ printf("\t\tMark <rr type> for printing in unknown type format.\n");
+ printf("\t\tThis option may be given multiple times.\n");
+ printf("\t\t-u is not meant to be used together with -U.\n");
+ printf("\t-U <rr type>\n");
+ printf("\t\tMark <rr type> for not printing in unknown type format.\n");
+ printf("\t\tThis option may be given multiple times.\n");
+ printf(
+ "\t\tThe first occurrence of the -U option marks all RR types for"
+ "\n\t\tprinting in unknown type format except for the given <rr type>."
+ "\n\t\tSubsequent -U options will clear the mark for those <rr type>s"
+ "\n\t\ttoo, so that only the given <rr type>s will be printed in the"
+ "\n\t\tpresentation format specific for those <rr type>s.\n");
+ printf("\t\t-U is not meant to be used together with -u.\n");
+ printf("\t-v shows the version and exits\n");
+ printf("\t-z sort the zone (implies -c).\n");
+ printf("\nif no file is given standard input is read\n");
+ exit(EXIT_SUCCESS);
+}
+
int
main(int argc, char **argv)
{
@@ -33,22 +79,21 @@ main(int argc, char **argv)
ldns_rr_list *stripped_list;
ldns_rr *cur_rr;
ldns_rr_type cur_rr_type;
- ldns_output_format fmt = {
- ldns_output_format_default->flags,
- ldns_output_format_default->data
- };
+ ldns_output_format_storage fmt_storage;
+ ldns_output_format* fmt = ldns_output_format_init(&fmt_storage);
+
ldns_soa_serial_increment_func_t soa_serial_increment_func = NULL;
int soa_serial_increment_func_data = 0;
- while ((c = getopt(argc, argv, "0bcdhnpsvzS:")) != -1) {
+ while ((c = getopt(argc, argv, "0bcdhnpsu:U:vzS:")) != -1) {
switch(c) {
case 'b':
- fmt.flags |=
+ fmt->flags |=
( LDNS_COMMENT_BUBBLEBABBLE |
LDNS_COMMENT_FLAGS );
break;
case '0':
- fmt.flags |= LDNS_FMT_ZEROIZE_RRSIGS;
+ fmt->flags |= LDNS_FMT_ZEROIZE_RRSIGS;
break;
case 'c':
canonicalize = true;
@@ -60,40 +105,13 @@ main(int argc, char **argv)
}
break;
case 'h':
- printf("Usage: %s [OPTIONS] <zonefile>\n", argv[0]);
- printf("\tReads the zonefile and prints it.\n");
- printf("\tThe RR count of the zone is printed to stderr.\n");
- printf("\t-b include bubblebabble of DS's.\n");
- printf("\t-0 zeroize timestamps and signature in RRSIG records.\n");
- printf("\t-c canonicalize all rrs in the zone.\n");
- printf("\t-d only show DNSSEC data from the zone\n");
- printf("\t-h show this text\n");
- printf("\t-n do not print the SOA record\n");
- printf("\t-p prepend SOA serial with spaces so"
- " it takes exactly ten characters.\n");
- printf("\t-s strip DNSSEC data from the zone\n");
- printf("\t-S [[+|-]<number> | YYYYMMDDxx | "
- " unixtime ]\n"
- "\t\tSet serial number to <number> or,"
- " when preceded by a sign,\n"
- "\t\toffset the existing number with "
- "<number>. With YYYYMMDDxx\n"
- "\t\tthe serial is formatted as a datecounter"
- ", and with unixtime as the\n"
- "\t\tnumber of seconds since 1-1-1970."
- " However, on serial number"
- "\n\t\tdecrease, +1 is used in stead"
- ". (implies -s)\n");
- printf("\t-v shows the version and exits\n");
- printf("\t-z sort the zone (implies -c).\n");
- printf("\nif no file is given standard input is read\n");
- exit(EXIT_SUCCESS);
+ print_usage("ldns-read-zone");
break;
case 'n':
print_soa = false;
break;
case 'p':
- fmt.flags |= LDNS_FMT_PAD_SOA_SERIAL;
+ fmt->flags |= LDNS_FMT_PAD_SOA_SERIAL;
break;
case 's':
strip = true;
@@ -101,6 +119,38 @@ main(int argc, char **argv)
fprintf(stderr, "Warning: stripping both DNSSEC and non-DNSSEC records. Output will be sparse.\n");
}
break;
+ case 'u':
+ s = ldns_output_format_set_type(fmt,
+ ldns_get_rr_type_by_name(optarg));
+ if (s != LDNS_STATUS_OK) {
+ fprintf( stderr
+ , "Cannot set rr type %s "
+ "in output format to "
+ "print as unknown type: %s\n"
+ , ldns_rr_descript(
+ ldns_get_rr_type_by_name(optarg)
+ )->_name
+ , ldns_get_errorstr_by_id(s)
+ );
+ exit(EXIT_FAILURE);
+ }
+ break;
+ case 'U':
+ s = ldns_output_format_clear_type(fmt,
+ ldns_get_rr_type_by_name(optarg));
+ if (s != LDNS_STATUS_OK) {
+ fprintf( stderr
+ , "Cannot set rr type %s "
+ "in output format to not "
+ "print as unknown type: %s\n"
+ , ldns_rr_descript(
+ ldns_get_rr_type_by_name(optarg)
+ )->_name
+ , ldns_get_errorstr_by_id(s)
+ );
+ exit(EXIT_FAILURE);
+ }
+ break;
case 'v':
printf("read zone version %s (ldns version %s)\n", LDNS_VERSION, ldns_version());
exit(EXIT_SUCCESS);
@@ -218,9 +268,9 @@ main(int argc, char **argv)
, soa_serial_increment_func_data
);
}
- ldns_rr_print_fmt(stdout, &fmt, ldns_zone_soa(z));
+ ldns_rr_print_fmt(stdout, fmt, ldns_zone_soa(z));
}
- ldns_rr_list_print_fmt(stdout, &fmt, ldns_zone_rrs(z));
+ ldns_rr_list_print_fmt(stdout, fmt, ldns_zone_rrs(z));
ldns_zone_deep_free(z);
diff --git a/examples/ldns-signzone.c b/examples/ldns-signzone.c
index 25ece3a651e9..ffdd3c03cd24 100644
--- a/examples/ldns-signzone.c
+++ b/examples/ldns-signzone.c
@@ -223,7 +223,7 @@ find_or_create_pubkey(const char *keyfile_name_base, ldns_key *key, ldns_zone *o
}
/* find the public key in the zone, or in a
- * seperate file
+ * separate file
* we 'generate' one anyway,
* then match that to any present in the zone,
* if it matches, we drop our own. If not,
@@ -368,9 +368,8 @@ main(int argc, char *argv[])
char *prog = strdup(argv[0]);
ldns_status result;
- ldns_output_format fmt = { ldns_output_format_default->flags, NULL };
- void **hashmap = NULL;
-
+ ldns_output_format_storage fmt_st;
+ ldns_output_format* fmt = ldns_output_format_init(&fmt_st);
inception = 0;
expiration = 0;
@@ -379,7 +378,7 @@ main(int argc, char *argv[])
OPENSSL_config(NULL);
- while ((c = getopt(argc, argv, "a:bde:f:i:k:lno:ps:t:vAE:K:")) != -1) {
+ while ((c = getopt(argc, argv, "a:bde:f:i:k:no:ps:t:vAE:K:")) != -1) {
switch (c) {
case 'a':
nsec3_algorithm = (uint8_t) atoi(optarg);
@@ -389,11 +388,10 @@ main(int argc, char *argv[])
}
break;
case 'b':
- fmt.flags |= LDNS_COMMENT_BUBBLEBABBLE;
- fmt.flags |= LDNS_COMMENT_FLAGS;
- fmt.flags |= LDNS_COMMENT_NSEC3_CHAIN;
- fmt.flags |= LDNS_COMMENT_LAYOUT;
- hashmap = &fmt.data;
+ ldns_output_format_set(fmt, LDNS_COMMENT_FLAGS
+ | LDNS_COMMENT_LAYOUT
+ | LDNS_COMMENT_NSEC3_CHAIN
+ | LDNS_COMMENT_BUBBLEBABBLE);
break;
case 'd':
add_keys = false;
@@ -767,7 +765,7 @@ main(int argc, char *argv[])
nsec3_salt_length,
nsec3_salt,
signflags,
- (ldns_rbtree_t**) hashmap);
+ &fmt_st.hashmap);
} else {
result = ldns_dnssec_zone_sign_flg(signed_zone,
added_rrs,
@@ -796,7 +794,7 @@ main(int argc, char *argv[])
outputfile_name, strerror(errno));
} else {
ldns_dnssec_zone_print_fmt(
- outputfile, &fmt, signed_zone);
+ outputfile, fmt, signed_zone);
fclose(outputfile);
}
}
diff --git a/examples/ldns-testns.c b/examples/ldns-testns.c
index 86219d605c55..f9732faaf07e 100644
--- a/examples/ldns-testns.c
+++ b/examples/ldns-testns.c
@@ -155,7 +155,7 @@ static const char* prog_name = "ldns-testns";
static FILE* logfile = 0;
static int do_verbose = 0;
-static void usage()
+static void usage(void)
{
printf("Usage: %s [options] <datafile>\n", prog_name);
printf(" -r listens on random port. Port number is printed.\n");
diff --git a/examples/ldns-testpkts.c b/examples/ldns-testpkts.c
index be94eb2fe438..ed26285c1f23 100644
--- a/examples/ldns-testpkts.c
+++ b/examples/ldns-testpkts.c
@@ -118,6 +118,8 @@ static void matchline(char* line, struct entry* e)
e->match_do = true;
} else if(str_keyword(&parse, "noedns")) {
e->match_noedns = true;
+ } else if(str_keyword(&parse, "ednsdata")) {
+ e->match_ednsdata_raw = true;
} else if(str_keyword(&parse, "UDP")) {
e->match_transport = transport_udp;
} else if(str_keyword(&parse, "TCP")) {
@@ -228,7 +230,7 @@ static void adjustline(char* line, struct entry* e,
}
/** create new entry */
-static struct entry* new_entry()
+static struct entry* new_entry(void)
{
struct entry* e = LDNS_MALLOC(struct entry);
memset(e, 0, sizeof(*e));
@@ -434,7 +436,9 @@ read_entry(FILE* in, const char* name, int *lineno, uint32_t* default_ttl,
ldns_pkt_section add_section = LDNS_SECTION_QUESTION;
struct reply_packet *cur_reply = NULL;
bool reading_hex = false;
+ bool reading_hex_ednsdata = false;
ldns_buffer* hex_data_buffer = NULL;
+ ldns_buffer* hex_ednsdata_buffer = NULL;
while(fgets(line, (int)sizeof(line), in) != NULL) {
line[MAX_LINE-1] = 0;
@@ -497,12 +501,26 @@ read_entry(FILE* in, const char* name, int *lineno, uint32_t* default_ttl,
cur_reply->reply_from_hex = data_buffer2wire(hex_data_buffer);
ldns_buffer_free(hex_data_buffer);
hex_data_buffer = NULL;
+ } else if(reading_hex) {
+ ldns_buffer_printf(hex_data_buffer, line);
+ } else if(str_keyword(&parse, "HEX_EDNSDATA_BEGIN")) {
+ hex_ednsdata_buffer = ldns_buffer_new(LDNS_MAX_PACKETLEN);
+ reading_hex_ednsdata = true;
+ } else if(str_keyword(&parse, "HEX_EDNSDATA_END")) {
+ if (!reading_hex_ednsdata) {
+ error("%s line %d: HEX_EDNSDATA_END read but no"
+ "HEX_EDNSDATA_BEGIN keyword seen", name, *lineno);
+ }
+ reading_hex_ednsdata = false;
+ cur_reply->raw_ednsdata = data_buffer2wire(hex_ednsdata_buffer);
+ ldns_buffer_free(hex_ednsdata_buffer);
+ hex_ednsdata_buffer = NULL;
+ } else if(reading_hex_ednsdata) {
+ ldns_buffer_printf(hex_ednsdata_buffer, line);
} else if(str_keyword(&parse, "ENTRY_END")) {
if (hex_data_buffer)
ldns_buffer_free(hex_data_buffer);
return current;
- } else if(reading_hex) {
- ldns_buffer_printf(hex_data_buffer, line);
} else {
/* it must be a RR, parse and add to packet. */
ldns_rr* n = NULL;
@@ -674,6 +692,38 @@ match_all(ldns_pkt* q, ldns_pkt* p, bool mttl)
return 1;
}
+/** Convert to hexstring and call verbose(), prepend with header */
+static void
+verbose_hex(int lvl, uint8_t *data, size_t datalen, const char *header)
+{
+ verbose(lvl, "%s", header);
+ while (datalen-- > 0) {
+ verbose(lvl, " %02x", (unsigned int)*data++);
+ }
+ verbose(lvl, "\n");
+}
+
+/** Match q edns data to p raw edns data */
+static int
+match_ednsdata(ldns_pkt* q, struct reply_packet* p)
+{
+ size_t qdlen, pdlen;
+ uint8_t *qd, *pd;
+ if(!ldns_pkt_edns(q) || !ldns_pkt_edns_data(q)) {
+ verbose(3, "No EDNS data\n");
+ return 0;
+ }
+ qdlen = ldns_rdf_size(ldns_pkt_edns_data(q));
+ pdlen = ldns_buffer_limit(p->raw_ednsdata);
+ qd = ldns_rdf_data(ldns_pkt_edns_data(q));
+ pd = ldns_buffer_begin(p->raw_ednsdata);
+ if( qdlen == pdlen && 0 == memcmp(qd, pd, qdlen) ) return 1;
+ verbose(3, "EDNS data does not match.\n");
+ verbose_hex(3, qd, qdlen, "q:");
+ verbose_hex(3, pd, pdlen, "p:");
+ return 0;
+}
+
/* finds entry in list, or returns NULL */
struct entry*
find_match(struct entry* entries, ldns_pkt* query_pkt,
@@ -724,6 +774,11 @@ find_match(struct entry* entries, ldns_pkt* query_pkt,
verbose(3, "bad; EDNS OPT present\n");
continue;
}
+ if(p->match_ednsdata_raw &&
+ !match_ednsdata(query_pkt, p->reply_list)) {
+ verbose(3, "bad EDNS data match.\n");
+ continue;
+ }
if(p->match_transport != transport_any && p->match_transport != transport) {
verbose(3, "bad transport\n");
continue;
diff --git a/examples/ldns-testpkts.h b/examples/ldns-testpkts.h
index 4941525250f2..26a71dad8dd1 100644
--- a/examples/ldns-testpkts.h
+++ b/examples/ldns-testpkts.h
@@ -48,6 +48,7 @@
; 'ttl' used with all, rrs in packet must also have matching TTLs.
; 'DO' will match only queries with DO bit set.
; 'noedns' matches queries without EDNS OPT records.
+ ; 'ednsdata' matches queries to HEX_EDNS section.
MATCH [opcode] [qtype] [qname] [serial=<value>] [all] [ttl]
MATCH [UDP|TCP] DO
MATCH ...
@@ -82,6 +83,11 @@
; be parsed, ADJUST rules for the answer packet
; are ignored. Only copy_id is done.
HEX_ANSWER_END
+ HEX_EDNS_BEGIN ; follow with hex data.
+ ; Raw EDNS data to match against. It must be an
+ ; exact match (all options are matched) and will be
+ ; evaluated only when 'MATCH ednsdata' given.
+ HEX_EDNS_END
ENTRY_END
@@ -142,6 +148,8 @@ struct reply_packet {
struct reply_packet* next;
/** the reply pkt */
ldns_pkt* reply;
+ /** Additional EDNS data for matching queries. */
+ ldns_buffer* raw_ednsdata;
/** or reply pkt in hex if not parsable */
ldns_buffer* reply_from_hex;
/** seconds to sleep before giving packet */
@@ -171,6 +179,8 @@ struct entry {
bool match_do;
/** match absence of EDNS OPT record in query */
bool match_noedns;
+ /** match edns data field given in hex */
+ bool match_ednsdata_raw;
/** match query serial with this value. */
uint32_t ixfr_soa_serial;
/** match on UDP/TCP */
@@ -197,7 +207,8 @@ struct entry {
/**
* reads the canned reply file and returns a list of structs
* does an exit on error.
- * @param skip_withespace: skip leftside whitespace.
+ * @param name: name of the file to read.
+ * @param skip_whitespace: skip leftside whitespace.
*/
struct entry* read_datafile(const char* name, int skip_whitespace);
diff --git a/examples/ldns-update.c b/examples/ldns-update.c
index dca4cbe7a5ca..af4dd02a5438 100644
--- a/examples/ldns-update.c
+++ b/examples/ldns-update.c
@@ -17,7 +17,7 @@ ldns_update_resolver_new(const char *fqdn, const char *zone,
ldns_rr_class class, uint16_t port, ldns_tsig_credentials *tsig_cred, ldns_rdf **zone_rdf)
{
ldns_resolver *r1, *r2;
- ldns_pkt *query = NULL, *resp;
+ ldns_pkt *query = NULL, *resp = NULL;
ldns_rr_list *nslist, *iplist;
ldns_rdf *soa_zone, *soa_mname = NULL, *ns_name;
size_t i;
diff --git a/examples/ldns-verify-zone.c b/examples/ldns-verify-zone.c
index 0bbb97f412ba..156eb649196e 100644
--- a/examples/ldns-verify-zone.c
+++ b/examples/ldns-verify-zone.c
@@ -11,6 +11,7 @@
#include "config.h"
#include <unistd.h>
#include <stdlib.h>
+#include <sys/time.h>
#include <ldns/ldns.h>
@@ -245,74 +246,25 @@ verify_next_hashed_name(ldns_dnssec_zone* zone, ldns_dnssec_name *name)
{
ldns_rbnode_t *next_node;
ldns_dnssec_name *next_name;
- ldns_dnssec_name *cur_next_name = NULL;
- ldns_dnssec_name *cur_first_name = NULL;
int cmp;
char *next_owner_str;
ldns_rdf *next_owner_dname;
- if (!name->hashed_name) {
- name->hashed_name = ldns_nsec3_hash_name_frm_nsec3(
- name->nsec, name->name);
- }
- next_node = ldns_rbtree_first(zone->names);
- while (next_node != LDNS_RBTREE_NULL) {
- next_name = (ldns_dnssec_name *)next_node->data;
- /* skip over names that have no NSEC3 records (whether it
- * actually should or should not should have been checked
- * already */
- if (!next_name->nsec) {
- next_node = ldns_rbtree_next(next_node);
- continue;
- }
- if (!next_name->hashed_name) {
- next_name->hashed_name =
- ldns_nsec3_hash_name_frm_nsec3(name->nsec,
- next_name->name);
- }
- /* we keep track of what 'so far' is the next hashed name;
- * it must of course be 'larger' than the current name
- * if we find one that is larger, but smaller than what we
- * previously thought was the next one, that one is the next
- */
- cmp = ldns_dname_compare(name->hashed_name,
- next_name->hashed_name);
- if (cmp < 0) {
- if (!cur_next_name) {
- cur_next_name = next_name;
- } else {
- cmp = ldns_dname_compare(
- next_name->hashed_name,
- cur_next_name->hashed_name);
- if (cmp < 0) {
- cur_next_name = next_name;
- }
- }
- }
- /* in case the hashed name of the nsec we are checking is the
- * last one, we need the first hashed name of the zone */
- if (!cur_first_name) {
- cur_first_name = next_name;
- } else {
- cmp = ldns_dname_compare(next_name->hashed_name,
- cur_first_name->hashed_name);
- if (cmp < 0) {
- cur_first_name = next_name;
- }
- }
+ assert(name->hashed_name != NULL);
+
+ next_node = ldns_rbtree_search(zone->hashed_names, name->hashed_name);
+ assert(next_node != NULL);
+ do {
next_node = ldns_rbtree_next(next_node);
- }
- if (!cur_next_name) {
- cur_next_name = cur_first_name;
- }
- assert(cur_next_name != NULL);
- /* Because this function is called on nsec occurrence,
- * there must be a cur_next_name!
- */
+ if (next_node == LDNS_RBTREE_NULL) {
+ next_node = ldns_rbtree_first(zone->hashed_names);
+ }
+ next_name = (ldns_dnssec_name *) next_node->data;
+ } while (! next_name->nsec);
next_owner_str = ldns_rdf2str(ldns_nsec3_next_owner(name->nsec));
next_owner_dname = ldns_dname_new_frm_str(next_owner_str);
- cmp = ldns_dname_compare(next_owner_dname, cur_next_name->hashed_name);
+ cmp = ldns_dname_compare(next_owner_dname, next_name->hashed_name);
ldns_rdf_deep_free(next_owner_dname);
LDNS_FREE(next_owner_str);
if (cmp != 0) {
@@ -321,9 +273,9 @@ verify_next_hashed_name(ldns_dnssec_zone* zone, ldns_dnssec_name *name)
ldns_rdf_print(stdout, name->name);
fprintf(myerr, " points to the wrong next hashed owner"
" name\n\tshould point to ");
- ldns_rdf_print(myerr, cur_next_name->name);
+ ldns_rdf_print(myerr, next_name->name);
fprintf(myerr, ", whose hashed name is ");
- ldns_rdf_print(myerr, cur_next_name->hashed_name);
+ ldns_rdf_print(myerr, next_name->hashed_name);
fprintf(myerr, "\n");
}
return LDNS_STATUS_ERR;
@@ -458,7 +410,7 @@ verify_dnssec_name(ldns_rdf *zone_name, ldns_dnssec_zone* zone,
/* for NSEC chain checks */
name = (ldns_dnssec_name *) cur_node->data;
- if (verbosity >= 3) {
+ if (verbosity >= 5) {
fprintf(myout, "Checking: ");
ldns_rdf_print(myout, name->name);
fprintf(myout, "\n");
@@ -913,7 +865,6 @@ main(int argc, char **argv)
"glue in the zone\n");
}
}
-
if (verbosity >= 5) {
ldns_dnssec_zone_print(myout, dnssec_zone);
}
diff --git a/examples/ldns-walk.1 b/examples/ldns-walk.1
index c8ace40ec04b..d4d1b6e79c17 100644
--- a/examples/ldns-walk.1
+++ b/examples/ldns-walk.1
@@ -22,6 +22,14 @@ Of course the nameserver that is used must be DNSSEC-aware.
.SH OPTIONS
.TP
+\fB-4\fR
+Use only IPv4.
+
+.TP
+\fB-6\fR
+Use only IPv6.
+
+.TP
\fB-f\fR
Do a 'full' zone walk; by default, ldns-walk will only show the names, and types present at those names. If this option is given, all resource records will be printed.
@@ -31,6 +39,10 @@ Start the walk with this owner name. Useful when continuing the walk for a
large zone.
.TP
+\fB-v\fR \fIverbosity\fR
+Verbosity level [1-5].
+
+.TP
\fB@\fR \fInameserver\fR
Send the queries to this nameserver.
diff --git a/examples/ldns-zcat.1 b/examples/ldns-zcat.1
index 9c4054df3cd3..4fd7ba6d7dbb 100644
--- a/examples/ldns-zcat.1
+++ b/examples/ldns-zcat.1
@@ -18,6 +18,10 @@ The resulted zone file is printed to standard output.
.B -o ORIGIN
use ORIGIN when reading in the zone
+.TP
+.B -v
+show the version number and exit
+
.SH AUTHOR
Written by the ldns team as an example for ldns usage.
diff --git a/examples/ldns-zcat.c b/examples/ldns-zcat.c
index df4ecbafbf79..017e632ca077 100644
--- a/examples/ldns-zcat.c
+++ b/examples/ldns-zcat.c
@@ -54,7 +54,7 @@ main(int argc, char **argv)
progname = strdup(argv[0]);
origin = NULL;
- while ((c = getopt(argc, argv, "n:o:v")) != -1) {
+ while ((c = getopt(argc, argv, "o:v")) != -1) {
switch(c) {
case 'o':
origin = ldns_dname_new_frm_str(strdup(optarg));
@@ -95,7 +95,7 @@ main(int argc, char **argv)
}
zrr = ldns_zone_rrs(z);
- soa = ldns_zone_soa(z); /* SOA is stored seperately */
+ soa = ldns_zone_soa(z); /* SOA is stored separately */
fprintf(stderr, "%s\n", argv[i]);
diff --git a/examples/ldns-zsplit.1 b/examples/ldns-zsplit.1
index 8e64668fe2b6..02dce404cfb8 100644
--- a/examples/ldns-zsplit.1
+++ b/examples/ldns-zsplit.1
@@ -27,6 +27,10 @@ use ORIGIN as origin when reading the zonefile.
.B -z
Sort the zone before splitting.
+.TP
+.B -v
+Show version number and exit.
+
.SH AUTHOR
Written by the ldns team as an example for ldns usage.
diff --git a/examples/ldnsd.c b/examples/ldnsd.c
index e2a55200f399..77c5dd5c628d 100644
--- a/examples/ldnsd.c
+++ b/examples/ldnsd.c
@@ -236,8 +236,10 @@ main(int argc, char **argv)
ldns_rr_list_free(answer_ad);
}
- ldns_rdf_deep_free(origin);
- ldns_zone_deep_free(zone);
-
- return 0;
+ /* No cleanup because of the infinite loop
+ *
+ * ldns_rdf_deep_free(origin);
+ * ldns_zone_deep_free(zone);
+ * return 0;
+ */
}
diff --git a/higher.c b/higher.c
index 990fb6afb25b..8ce86a41d560 100644
--- a/higher.c
+++ b/higher.c
@@ -131,6 +131,7 @@ ldns_get_rr_list_name_by_addr(ldns_resolver *res, ldns_rdf *addr, ldns_rr_class
/* extract the data we need */
names = ldns_pkt_rr_list_by_type(pkt,
LDNS_RR_TYPE_PTR, LDNS_SECTION_ANSWER);
+ ldns_pkt_free(pkt);
}
return names;
}
@@ -303,39 +304,21 @@ ldns_getaddrinfo(ldns_resolver *res, ldns_rdf *node, ldns_rr_class c,
bool
ldns_nsec_type_check(ldns_rr *nsec, ldns_rr_type t)
{
- /* does the nsec cover the t given? */
- /* copied from host2str.c line 465: ldns_rdf2buffer_str_nsec */
- uint8_t window_block_nr;
- uint8_t bitmap_length;
- uint16_t type;
- uint16_t pos = 0;
- uint16_t bit_pos;
- ldns_rdf *nsec_type_list = ldns_rr_rdf(nsec, 1);
- uint8_t *data;
-
- if (nsec_type_list == NULL) {
- return false;
- }
- data = ldns_rdf_data(nsec_type_list);
-
- while(pos < ldns_rdf_size(nsec_type_list)) {
- window_block_nr = data[pos];
- bitmap_length = data[pos + 1];
- pos += 2;
-
- for (bit_pos = 0; bit_pos < (bitmap_length) * 8; bit_pos++) {
- if (ldns_get_bit(&data[pos], bit_pos)) {
- type = 256 * (uint16_t) window_block_nr + bit_pos;
-
- if ((ldns_rr_type)type == t) {
- /* we have a winner */
- return true;
- }
- }
- }
- pos += (uint16_t) bitmap_length;
+ switch (ldns_rr_get_type(nsec)) {
+ case LDNS_RR_TYPE_NSEC : if (ldns_rr_rd_count(nsec) < 2) {
+ return false;
+ }
+ return ldns_nsec_bitmap_covers_type(
+ ldns_rr_rdf(nsec, 1), t);
+
+ case LDNS_RR_TYPE_NSEC3 : if (ldns_rr_rd_count(nsec) < 6) {
+ return false;
+ }
+ return ldns_nsec_bitmap_covers_type(
+ ldns_rr_rdf(nsec, 5), t);
+
+ default : return false;
}
- return false;
}
void
@@ -358,3 +341,4 @@ ldns_print_rr_rdf(FILE *fp, ldns_rr *r, int rdfnum, ...)
}
va_end(va_rdf);
}
+
diff --git a/host2str.c b/host2str.c
index cddf6da2e7a6..e2c936baf1ab 100644
--- a/host2str.c
+++ b/host2str.c
@@ -130,6 +130,55 @@ const ldns_output_format ldns_output_format_bubblebabble_record = {
const ldns_output_format *ldns_output_format_bubblebabble
= &ldns_output_format_bubblebabble_record;
+static bool
+ldns_output_format_covers_type(const ldns_output_format* fmt, ldns_rr_type t)
+{
+ return fmt && (fmt->flags & LDNS_FMT_RFC3597) &&
+ ((ldns_output_format_storage*)fmt)->bitmap &&
+ ldns_nsec_bitmap_covers_type(
+ ((ldns_output_format_storage*)fmt)->bitmap, t);
+}
+
+ldns_status
+ldns_output_format_set_type(ldns_output_format* fmt, ldns_rr_type t)
+{
+ ldns_output_format_storage* fmt_st = (ldns_output_format_storage*)fmt;
+ ldns_status s;
+
+ assert(fmt != NULL);
+
+ if (!(fmt_st->flags & LDNS_FMT_RFC3597)) {
+ ldns_output_format_set(fmt, LDNS_FMT_RFC3597);
+ }
+ if (! fmt_st->bitmap) {
+ s = ldns_rdf_bitmap_known_rr_types_space(&fmt_st->bitmap);
+ if (s != LDNS_STATUS_OK) {
+ return s;
+ }
+ }
+ return ldns_nsec_bitmap_set_type(fmt_st->bitmap, t);
+}
+
+ldns_status
+ldns_output_format_clear_type(ldns_output_format* fmt, ldns_rr_type t)
+{
+ ldns_output_format_storage* fmt_st = (ldns_output_format_storage*)fmt;
+ ldns_status s;
+
+ assert(fmt != NULL);
+
+ if (!(fmt_st->flags & LDNS_FMT_RFC3597)) {
+ ldns_output_format_set(fmt, LDNS_FMT_RFC3597);
+ }
+ if (! fmt_st->bitmap) {
+ s = ldns_rdf_bitmap_known_rr_types(&fmt_st->bitmap);
+ if (s != LDNS_STATUS_OK) {
+ return s;
+ }
+ }
+ return ldns_nsec_bitmap_clear_type(fmt_st->bitmap, t);
+}
+
ldns_status
ldns_pkt_opcode2buffer_str(ldns_buffer *output, ldns_pkt_opcode opcode)
{
@@ -381,18 +430,15 @@ ldns_rdf2buffer_str_aaaa(ldns_buffer *output, const ldns_rdf *rdf)
return ldns_buffer_status(output);
}
-ldns_status
-ldns_rdf2buffer_str_str(ldns_buffer *output, const ldns_rdf *rdf)
+static void
+ldns_characters2buffer_str(ldns_buffer* output,
+ size_t amount, const uint8_t* characters)
{
- const uint8_t *data = ldns_rdf_data(rdf);
- uint8_t length = data[0];
- size_t i;
-
- ldns_buffer_printf(output, "\"");
- for (i = 1; i <= length; ++i) {
- char ch = (char) data[i];
- if (isprint((int)ch) || ch=='\t') {
- if (ch=='\"'||ch=='\\')
+ uint8_t ch;
+ while (amount > 0) {
+ ch = *characters++;
+ if (isprint((int)ch) || ch == '\t') {
+ if (ch == '\"' || ch == '\\')
ldns_buffer_printf(output, "\\%c", ch);
else
ldns_buffer_printf(output, "%c", ch);
@@ -400,7 +446,22 @@ ldns_rdf2buffer_str_str(ldns_buffer *output, const ldns_rdf *rdf)
ldns_buffer_printf(output, "\\%03u",
(unsigned)(uint8_t) ch);
}
+ amount--;
}
+}
+
+ldns_status
+ldns_rdf2buffer_str_str(ldns_buffer *output, const ldns_rdf *rdf)
+{
+ if(ldns_rdf_size(rdf) < 1) {
+ return LDNS_STATUS_WIRE_RDATA_ERR;
+ }
+ if((int)ldns_rdf_size(rdf) < (int)ldns_rdf_data(rdf)[0] + 1) {
+ return LDNS_STATUS_WIRE_RDATA_ERR;
+ }
+ ldns_buffer_printf(output, "\"");
+ ldns_characters2buffer_str(output,
+ ldns_rdf_data(rdf)[0], ldns_rdf_data(rdf) + 1);
ldns_buffer_printf(output, "\"");
return ldns_buffer_status(output);
}
@@ -451,18 +512,27 @@ ldns_rdf2buffer_str_hex(ldns_buffer *output, const ldns_rdf *rdf)
}
ldns_status
-ldns_rdf2buffer_str_type(ldns_buffer *output, const ldns_rdf *rdf)
+ldns_rdf2buffer_str_type_fmt(ldns_buffer *output,
+ const ldns_output_format* fmt, const ldns_rdf *rdf)
{
uint16_t data = ldns_read_uint16(ldns_rdf_data(rdf));
- const ldns_rr_descriptor *descriptor;
- descriptor = ldns_rr_descript(data);
- if (descriptor && descriptor->_name) {
- ldns_buffer_printf(output, "%s", descriptor->_name);
+ if (! ldns_output_format_covers_type(fmt, data) &&
+ ldns_rr_descript(data) &&
+ ldns_rr_descript(data)->_name) {
+
+ ldns_buffer_printf(output, "%s",ldns_rr_descript(data)->_name);
} else {
ldns_buffer_printf(output, "TYPE%u", data);
}
- return ldns_buffer_status(output);
+ return ldns_buffer_status(output);
+}
+
+ldns_status
+ldns_rdf2buffer_str_type(ldns_buffer *output, const ldns_rdf *rdf)
+{
+ return ldns_rdf2buffer_str_type_fmt(output,
+ ldns_output_format_default, rdf);
}
ldns_status
@@ -614,7 +684,7 @@ ldns_status
ldns_rdf2buffer_str_loc(ldns_buffer *output, const ldns_rdf *rdf)
{
/* we could do checking (ie degrees < 90 etc)? */
- uint8_t version = ldns_rdf_data(rdf)[0];
+ uint8_t version;
uint8_t size;
uint8_t horizontal_precision;
uint8_t vertical_precision;
@@ -629,7 +699,14 @@ ldns_rdf2buffer_str_loc(ldns_buffer *output, const ldns_rdf *rdf)
uint32_t equator = (uint32_t) ldns_power(2, 31);
+ if(ldns_rdf_size(rdf) < 1) {
+ return LDNS_STATUS_WIRE_RDATA_ERR;
+ }
+ version = ldns_rdf_data(rdf)[0];
if (version == 0) {
+ if(ldns_rdf_size(rdf) < 16) {
+ return LDNS_STATUS_WIRE_RDATA_ERR;
+ }
size = ldns_rdf_data(rdf)[1];
horizontal_precision = ldns_rdf_data(rdf)[2];
vertical_precision = ldns_rdf_data(rdf)[3];
@@ -669,12 +746,12 @@ ldns_rdf2buffer_str_loc(ldns_buffer *output, const ldns_rdf *rdf)
h, m, s, easterness);
- s = ((double) altitude) / 100;
- s -= 100000;
+ s = ((double) altitude) / 100;
+ s -= 100000;
if(altitude%100 != 0)
ldns_buffer_printf(output, "%.2f", s);
- else
+ else
ldns_buffer_printf(output, "%.0f", s);
ldns_buffer_printf(output, "m ");
@@ -726,6 +803,9 @@ ldns_rdf2buffer_str_wks(ldns_buffer *output, const ldns_rdf *rdf)
struct servent *service;
uint16_t current_service;
+ if(ldns_rdf_size(rdf) < 1) {
+ return LDNS_STATUS_WIRE_RDATA_ERR;
+ }
protocol_nr = ldns_rdf_data(rdf)[0];
protocol = getprotobynumber((int) protocol_nr);
if (protocol && (protocol->p_name != NULL)) {
@@ -758,7 +838,8 @@ ldns_rdf2buffer_str_wks(ldns_buffer *output, const ldns_rdf *rdf)
}
ldns_status
-ldns_rdf2buffer_str_nsec(ldns_buffer *output, const ldns_rdf *rdf)
+ldns_rdf2buffer_str_nsec_fmt(ldns_buffer *output,
+ const ldns_output_format* fmt, const ldns_rdf *rdf)
{
/* Note: this code is duplicated in higher.c in
* ldns_nsec_type_check() function
@@ -769,34 +850,43 @@ ldns_rdf2buffer_str_nsec(ldns_buffer *output, const ldns_rdf *rdf)
uint16_t pos = 0;
uint16_t bit_pos;
uint8_t *data = ldns_rdf_data(rdf);
- const ldns_rr_descriptor *descriptor;
- while(pos < ldns_rdf_size(rdf)) {
+ while((size_t)(pos + 2) < ldns_rdf_size(rdf)) {
window_block_nr = data[pos];
bitmap_length = data[pos + 1];
pos += 2;
-
+ if (ldns_rdf_size(rdf) < pos + bitmap_length) {
+ return LDNS_STATUS_WIRE_RDATA_ERR;
+ }
for (bit_pos = 0; bit_pos < (bitmap_length) * 8; bit_pos++) {
- if (ldns_get_bit(&data[pos], bit_pos)) {
- type = 256 * (uint16_t) window_block_nr + bit_pos;
- descriptor = ldns_rr_descript(type);
+ if (! ldns_get_bit(&data[pos], bit_pos)) {
+ continue;
+ }
+ type = 256 * (uint16_t) window_block_nr + bit_pos;
- if (descriptor && descriptor->_name) {
- ldns_buffer_printf(output, "%s ",
- descriptor->_name);
- } else {
- ldns_buffer_printf(output, "TYPE%u ", type);
- }
+ if (! ldns_output_format_covers_type(fmt, type) &&
+ ldns_rr_descript(type) &&
+ ldns_rr_descript(type)->_name){
+
+ ldns_buffer_printf(output, "%s ",
+ ldns_rr_descript(type)->_name);
+ } else {
+ ldns_buffer_printf(output, "TYPE%u ", type);
}
}
-
pos += (uint16_t) bitmap_length;
}
-
return ldns_buffer_status(output);
}
ldns_status
+ldns_rdf2buffer_str_nsec(ldns_buffer *output, const ldns_rdf *rdf)
+{
+ return ldns_rdf2buffer_str_nsec_fmt(output,
+ ldns_output_format_default, rdf);
+}
+
+ldns_status
ldns_rdf2buffer_str_nsec3_salt(ldns_buffer *output, const ldns_rdf *rdf)
{
uint8_t salt_length;
@@ -804,9 +894,8 @@ ldns_rdf2buffer_str_nsec3_salt(ldns_buffer *output, const ldns_rdf *rdf)
uint8_t *data = ldns_rdf_data(rdf);
- if(ldns_rdf_size(rdf) == 0) {
- output->_status = LDNS_STATUS_ERR;
- return ldns_buffer_status(output);
+ if(ldns_rdf_size(rdf) < 1) {
+ return LDNS_STATUS_WIRE_RDATA_ERR;
}
salt_length = data[0];
/* from now there are variable length entries so remember pos */
@@ -826,8 +915,10 @@ ldns_status
ldns_rdf2buffer_str_period(ldns_buffer *output, const ldns_rdf *rdf)
{
/* period is the number of seconds */
- uint32_t p = ldns_read_uint32(ldns_rdf_data(rdf));
- ldns_buffer_printf(output, "%u", p);
+ if (ldns_rdf_size(rdf) != 4) {
+ return LDNS_STATUS_WIRE_RDATA_ERR;
+ }
+ ldns_buffer_printf(output, "%u", ldns_read_uint32(ldns_rdf_data(rdf)));
return ldns_buffer_status(output);
}
@@ -837,17 +928,20 @@ ldns_rdf2buffer_str_tsigtime(ldns_buffer *output,const ldns_rdf *rdf)
/* tsigtime is 48 bits network order unsigned integer */
uint64_t tsigtime = 0;
uint8_t *data = ldns_rdf_data(rdf);
+ uint64_t d0, d1, d2, d3, d4, d5;
- if (ldns_rdf_size(rdf) != 6) {
- return LDNS_STATUS_ERR;
+ if (ldns_rdf_size(rdf) < 6) {
+ return LDNS_STATUS_WIRE_RDATA_ERR;
}
+ d0 = data[0]; /* cast to uint64 for shift operations */
+ d1 = data[1];
+ d2 = data[2];
+ d3 = data[3];
+ d4 = data[4];
+ d5 = data[5];
+ tsigtime = (d0<<40) | (d1<<32) | (d2<<24) | (d3<<16) | (d4<<8) | d5;
- tsigtime = ldns_read_uint16(data);
- tsigtime *= 65536;
- tsigtime += ldns_read_uint16(data+2);
- tsigtime *= 65536;
-
- ldns_buffer_printf(output, "%llu ", tsigtime);
+ ldns_buffer_printf(output, "%llu ", (long long)tsigtime);
return ldns_buffer_status(output);
}
@@ -865,7 +959,7 @@ ldns_rdf2buffer_str_apl(ldns_buffer *output, const ldns_rdf *rdf)
while (pos < (unsigned int) ldns_rdf_size(rdf)) {
if(pos + 3 >= (unsigned)ldns_rdf_size(rdf))
- return LDNS_STATUS_SYNTAX_RDATA_ERR;
+ return LDNS_STATUS_WIRE_RDATA_ERR;
address_family = ldns_read_uint16(&data[pos]);
prefix = data[pos + 2];
negation = data[pos + 3] & LDNS_APL_NEGATION;
@@ -883,7 +977,7 @@ ldns_rdf2buffer_str_apl(ldns_buffer *output, const ldns_rdf *rdf)
}
if (i < (unsigned short) adf_length) {
if(pos+i+4 >= ldns_rdf_size(rdf))
- return LDNS_STATUS_SYNTAX_RDATA_ERR;
+ return LDNS_STATUS_WIRE_RDATA_ERR;
ldns_buffer_printf(output, "%d",
data[pos + i + 4]);
} else {
@@ -904,7 +998,7 @@ ldns_rdf2buffer_str_apl(ldns_buffer *output, const ldns_rdf *rdf)
}
if (i < (unsigned short) adf_length) {
if(pos+i+4 >= ldns_rdf_size(rdf))
- return LDNS_STATUS_SYNTAX_RDATA_ERR;
+ return LDNS_STATUS_WIRE_RDATA_ERR;
ldns_buffer_printf(output, "%02x",
data[pos + i + 4]);
} else {
@@ -915,11 +1009,12 @@ ldns_rdf2buffer_str_apl(ldns_buffer *output, const ldns_rdf *rdf)
} else {
/* unknown address family */
- ldns_buffer_printf(output, "Unknown address family: %u data: ",
+ ldns_buffer_printf(output,
+ "Unknown address family: %u data: ",
address_family);
for (i = 1; i < (unsigned short) (4 + adf_length); i++) {
if(pos+i >= ldns_rdf_size(rdf))
- return LDNS_STATUS_SYNTAX_RDATA_ERR;
+ return LDNS_STATUS_WIRE_RDATA_ERR;
ldns_buffer_printf(output, "%02x", data[i]);
}
}
@@ -931,21 +1026,27 @@ ldns_rdf2buffer_str_apl(ldns_buffer *output, const ldns_rdf *rdf)
ldns_status
ldns_rdf2buffer_str_int16_data(ldns_buffer *output, const ldns_rdf *rdf)
{
+ size_t size;
+ char *b64;
+ if (ldns_rdf_size(rdf) < 2) {
+ return LDNS_STATUS_WIRE_RDATA_ERR;
+ }
/* Subtract the size (2) of the number that specifies the length */
- size_t size = ldns_b64_ntop_calculate_size(ldns_rdf_size(rdf) - 2);
- char *b64 = LDNS_XMALLOC(char, size);
- if(!b64)
- return LDNS_STATUS_MEM_ERR;
-
+ size = ldns_b64_ntop_calculate_size(ldns_rdf_size(rdf) - 2);
ldns_buffer_printf(output, "%u ", ldns_rdf_size(rdf) - 2);
-
- if (ldns_rdf_size(rdf) > 2 &&
- ldns_b64_ntop(ldns_rdf_data(rdf) + 2,
- ldns_rdf_size(rdf) - 2,
- b64, size)) {
- ldns_buffer_printf(output, "%s", b64);
+ if (ldns_rdf_size(rdf) > 2) {
+ b64 = LDNS_XMALLOC(char, size);
+ if(!b64)
+ return LDNS_STATUS_MEM_ERR;
+
+ if (ldns_rdf_size(rdf) > 2 &&
+ ldns_b64_ntop(ldns_rdf_data(rdf) + 2,
+ ldns_rdf_size(rdf) - 2,
+ b64, size)) {
+ ldns_buffer_printf(output, "%s", b64);
+ }
+ LDNS_FREE(b64);
}
- LDNS_FREE(b64);
return ldns_buffer_status(output);
}
@@ -970,6 +1071,9 @@ ldns_rdf2buffer_str_ipseckey(ldns_buffer *output, const ldns_rdf *rdf)
size_t offset = 0;
ldns_status status;
+ if (ldns_rdf_size(rdf) < 3) {
+ return LDNS_STATUS_WIRE_RDATA_ERR;
+ }
precedence = data[0];
gateway_type = data[1];
algorithm = data[2];
@@ -983,8 +1087,12 @@ ldns_rdf2buffer_str_ipseckey(ldns_buffer *output, const ldns_rdf *rdf)
gateway_data = LDNS_XMALLOC(uint8_t, LDNS_IP4ADDRLEN);
if(!gateway_data)
return LDNS_STATUS_MEM_ERR;
+ if (ldns_rdf_size(rdf) < offset + LDNS_IP4ADDRLEN) {
+ return LDNS_STATUS_ERR;
+ }
memcpy(gateway_data, &data[offset], LDNS_IP4ADDRLEN);
- gateway = ldns_rdf_new(LDNS_RDF_TYPE_A, LDNS_IP4ADDRLEN , gateway_data);
+ gateway = ldns_rdf_new(LDNS_RDF_TYPE_A,
+ LDNS_IP4ADDRLEN , gateway_data);
offset += LDNS_IP4ADDRLEN;
if(!gateway) {
LDNS_FREE(gateway_data);
@@ -995,17 +1103,22 @@ ldns_rdf2buffer_str_ipseckey(ldns_buffer *output, const ldns_rdf *rdf)
gateway_data = LDNS_XMALLOC(uint8_t, LDNS_IP6ADDRLEN);
if(!gateway_data)
return LDNS_STATUS_MEM_ERR;
+ if (ldns_rdf_size(rdf) < offset + LDNS_IP6ADDRLEN) {
+ return LDNS_STATUS_ERR;
+ }
memcpy(gateway_data, &data[offset], LDNS_IP6ADDRLEN);
offset += LDNS_IP6ADDRLEN;
gateway =
- ldns_rdf_new(LDNS_RDF_TYPE_AAAA, LDNS_IP6ADDRLEN, gateway_data);
+ ldns_rdf_new(LDNS_RDF_TYPE_AAAA,
+ LDNS_IP6ADDRLEN, gateway_data);
if(!gateway) {
LDNS_FREE(gateway_data);
return LDNS_STATUS_MEM_ERR;
}
break;
case 3:
- status = ldns_wire2dname(&gateway, data, ldns_rdf_size(rdf), &offset);
+ status = ldns_wire2dname(&gateway, data,
+ ldns_rdf_size(rdf), &offset);
if(status != LDNS_STATUS_OK)
return status;
break;
@@ -1014,6 +1127,9 @@ ldns_rdf2buffer_str_ipseckey(ldns_buffer *output, const ldns_rdf *rdf)
break;
}
+ if (ldns_rdf_size(rdf) <= offset) {
+ return LDNS_STATUS_ERR;
+ }
public_key_size = ldns_rdf_size(rdf) - offset;
public_key_data = LDNS_XMALLOC(uint8_t, public_key_size);
if(!public_key_data) {
@@ -1021,7 +1137,8 @@ ldns_rdf2buffer_str_ipseckey(ldns_buffer *output, const ldns_rdf *rdf)
return LDNS_STATUS_MEM_ERR;
}
memcpy(public_key_data, &data[offset], public_key_size);
- public_key = ldns_rdf_new(LDNS_RDF_TYPE_B64, public_key_size, public_key_data);
+ public_key = ldns_rdf_new(LDNS_RDF_TYPE_B64,
+ public_key_size, public_key_data);
if(!public_key) {
LDNS_FREE(public_key_data);
ldns_rdf_free(gateway);
@@ -1029,7 +1146,7 @@ ldns_rdf2buffer_str_ipseckey(ldns_buffer *output, const ldns_rdf *rdf)
}
ldns_buffer_printf(output, "%u %u %u ", precedence, gateway_type, algorithm);
- if (gateway)
+ if (gateway)
(void) ldns_rdf2buffer_str(output, gateway);
else
ldns_buffer_printf(output, ".");
@@ -1043,15 +1160,129 @@ ldns_rdf2buffer_str_ipseckey(ldns_buffer *output, const ldns_rdf *rdf)
}
ldns_status
-ldns_rdf2buffer_str_tsig(ldns_buffer *output, const ldns_rdf *rdf)
+ldns_rdf2buffer_str_ilnp64(ldns_buffer *output, const ldns_rdf *rdf)
+{
+ if (ldns_rdf_size(rdf) != 8) {
+ return LDNS_STATUS_WIRE_RDATA_ERR;
+ }
+ ldns_buffer_printf(output,"%.4x:%.4x:%.4x:%.4x",
+ ldns_read_uint16(ldns_rdf_data(rdf)),
+ ldns_read_uint16(ldns_rdf_data(rdf)+2),
+ ldns_read_uint16(ldns_rdf_data(rdf)+4),
+ ldns_read_uint16(ldns_rdf_data(rdf)+6));
+ return ldns_buffer_status(output);
+}
+
+ldns_status
+ldns_rdf2buffer_str_eui48(ldns_buffer *output, const ldns_rdf *rdf)
{
- /* TSIG RRs have no presentation format, make them #size <data> */
- return ldns_rdf2buffer_str_unknown(output, rdf);
+ if (ldns_rdf_size(rdf) != 6) {
+ return LDNS_STATUS_WIRE_RDATA_ERR;
+ }
+ ldns_buffer_printf(output,"%.2x-%.2x-%.2x-%.2x-%.2x-%.2x",
+ ldns_rdf_data(rdf)[0], ldns_rdf_data(rdf)[1],
+ ldns_rdf_data(rdf)[2], ldns_rdf_data(rdf)[3],
+ ldns_rdf_data(rdf)[4], ldns_rdf_data(rdf)[5]);
+ return ldns_buffer_status(output);
}
+ldns_status
+ldns_rdf2buffer_str_eui64(ldns_buffer *output, const ldns_rdf *rdf)
+{
+ if (ldns_rdf_size(rdf) != 8) {
+ return LDNS_STATUS_WIRE_RDATA_ERR;
+ }
+ ldns_buffer_printf(output,"%.2x-%.2x-%.2x-%.2x-%.2x-%.2x-%.2x-%.2x",
+ ldns_rdf_data(rdf)[0], ldns_rdf_data(rdf)[1],
+ ldns_rdf_data(rdf)[2], ldns_rdf_data(rdf)[3],
+ ldns_rdf_data(rdf)[4], ldns_rdf_data(rdf)[5],
+ ldns_rdf_data(rdf)[6], ldns_rdf_data(rdf)[7]);
+ return ldns_buffer_status(output);
+}
ldns_status
-ldns_rdf2buffer_str(ldns_buffer *buffer, const ldns_rdf *rdf)
+ldns_rdf2buffer_str_tag(ldns_buffer *output, const ldns_rdf *rdf)
+{
+ size_t nchars;
+ const uint8_t* chars;
+ char ch;
+ if (ldns_rdf_size(rdf) < 2) {
+ return LDNS_STATUS_WIRE_RDATA_ERR;
+ }
+ nchars = ldns_rdf_data(rdf)[0];
+ if (nchars >= ldns_rdf_size(rdf) || /* should be rdf_size - 1 */
+ nchars < 1) {
+ return LDNS_STATUS_WIRE_RDATA_ERR;
+ }
+ chars = ldns_rdf_data(rdf) + 1;
+ while (nchars > 0) {
+ ch = (char)*chars++;
+ if (! isalnum(ch)) {
+ return LDNS_STATUS_WIRE_RDATA_ERR;
+ }
+ ldns_buffer_printf(output, "%c", ch);
+ nchars--;
+ }
+ return ldns_buffer_status(output);
+}
+
+ldns_status
+ldns_rdf2buffer_str_long_str(ldns_buffer *output, const ldns_rdf *rdf)
+{
+
+ ldns_buffer_printf(output, "\"");
+ ldns_characters2buffer_str(output,
+ ldns_rdf_size(rdf), ldns_rdf_data(rdf));
+ ldns_buffer_printf(output, "\"");
+ return ldns_buffer_status(output);
+}
+
+ldns_status
+ldns_rdf2buffer_str_hip(ldns_buffer *output, const ldns_rdf *rdf)
+{
+ uint8_t *data = ldns_rdf_data(rdf);
+ size_t rdf_size = ldns_rdf_size(rdf);
+ uint8_t hit_size;
+ uint16_t pk_size;
+ int written;
+
+ if (rdf_size < 6) {
+ return LDNS_STATUS_WIRE_RDATA_ERR;
+ }
+ if ((hit_size = data[0]) == 0 ||
+ (pk_size = ldns_read_uint16(data + 2)) == 0 ||
+ rdf_size < (size_t) hit_size + pk_size + 4) {
+
+ return LDNS_STATUS_WIRE_RDATA_ERR;
+ }
+
+ ldns_buffer_printf(output, "%d ", (int) data[1]);
+
+ for (data += 4; hit_size > 0; hit_size--, data++) {
+
+ ldns_buffer_printf(output, "%02x", (int) *data);
+ }
+ ldns_buffer_write_u8(output, (uint8_t) ' ');
+
+ if (ldns_buffer_reserve(output,
+ ldns_b64_ntop_calculate_size(pk_size))) {
+
+ written = ldns_b64_ntop(data, pk_size,
+ (char *) ldns_buffer_current(output),
+ ldns_buffer_remaining(output));
+
+ if (written > 0 &&
+ written < (int) ldns_buffer_remaining(output)) {
+
+ output->_position += written;
+ }
+ }
+ return ldns_buffer_status(output);
+}
+
+ldns_status
+ldns_rdf2buffer_str_fmt(ldns_buffer *buffer,
+ const ldns_output_format* fmt, const ldns_rdf *rdf)
{
ldns_status res = LDNS_STATUS_OK;
@@ -1100,13 +1331,13 @@ ldns_rdf2buffer_str(ldns_buffer *buffer, const ldns_rdf *rdf)
res = ldns_rdf2buffer_str_hex(buffer, rdf);
break;
case LDNS_RDF_TYPE_NSEC:
- res = ldns_rdf2buffer_str_nsec(buffer, rdf);
+ res = ldns_rdf2buffer_str_nsec_fmt(buffer, fmt, rdf);
break;
case LDNS_RDF_TYPE_NSEC3_SALT:
res = ldns_rdf2buffer_str_nsec3_salt(buffer, rdf);
break;
case LDNS_RDF_TYPE_TYPE:
- res = ldns_rdf2buffer_str_type(buffer, rdf);
+ res = ldns_rdf2buffer_str_type_fmt(buffer, fmt, rdf);
break;
case LDNS_RDF_TYPE_CLASS:
res = ldns_rdf2buffer_str_class(buffer, rdf);
@@ -1123,6 +1354,9 @@ ldns_rdf2buffer_str(ldns_buffer *buffer, const ldns_rdf *rdf)
case LDNS_RDF_TYPE_TIME:
res = ldns_rdf2buffer_str_time(buffer, rdf);
break;
+ case LDNS_RDF_TYPE_HIP:
+ res = ldns_rdf2buffer_str_hip(buffer, rdf);
+ break;
case LDNS_RDF_TYPE_LOC:
res = ldns_rdf2buffer_str_loc(buffer, rdf);
break;
@@ -1139,15 +1373,27 @@ ldns_rdf2buffer_str(ldns_buffer *buffer, const ldns_rdf *rdf)
case LDNS_RDF_TYPE_IPSECKEY:
res = ldns_rdf2buffer_str_ipseckey(buffer, rdf);
break;
- case LDNS_RDF_TYPE_TSIG:
- res = ldns_rdf2buffer_str_tsig(buffer, rdf);
- break;
case LDNS_RDF_TYPE_INT16_DATA:
res = ldns_rdf2buffer_str_int16_data(buffer, rdf);
break;
case LDNS_RDF_TYPE_NSEC3_NEXT_OWNER:
res = ldns_rdf2buffer_str_b32_ext(buffer, rdf);
break;
+ case LDNS_RDF_TYPE_ILNP64:
+ res = ldns_rdf2buffer_str_ilnp64(buffer, rdf);
+ break;
+ case LDNS_RDF_TYPE_EUI48:
+ res = ldns_rdf2buffer_str_eui48(buffer, rdf);
+ break;
+ case LDNS_RDF_TYPE_EUI64:
+ res = ldns_rdf2buffer_str_eui64(buffer, rdf);
+ break;
+ case LDNS_RDF_TYPE_TAG:
+ res = ldns_rdf2buffer_str_tag(buffer, rdf);
+ break;
+ case LDNS_RDF_TYPE_LONG_STR:
+ res = ldns_rdf2buffer_str_long_str(buffer, rdf);
+ break;
}
} else {
/** This will write mangled RRs */
@@ -1157,6 +1403,12 @@ ldns_rdf2buffer_str(ldns_buffer *buffer, const ldns_rdf *rdf)
return res;
}
+ldns_status
+ldns_rdf2buffer_str(ldns_buffer *buffer, const ldns_rdf *rdf)
+{
+ return ldns_rdf2buffer_str_fmt(buffer,ldns_output_format_default,rdf);
+}
+
static ldns_rdf *
ldns_b32_ext2dname(const ldns_rdf *rdf)
{
@@ -1184,18 +1436,45 @@ ldns_b32_ext2dname(const ldns_rdf *rdf)
return NULL;
}
+static ldns_status
+ldns_rr2buffer_str_rfc3597(ldns_buffer *output, const ldns_rr *rr)
+{
+ size_t total_rdfsize = 0;
+ size_t i, j;
+
+ ldns_buffer_printf(output, "TYPE%u\t", ldns_rr_get_type(rr));
+ for (i = 0; i < ldns_rr_rd_count(rr); i++) {
+ total_rdfsize += ldns_rdf_size(ldns_rr_rdf(rr, i));
+ }
+ if (total_rdfsize == 0) {
+ ldns_buffer_printf(output, "\\# 0\n");
+ return ldns_buffer_status(output);
+ }
+ ldns_buffer_printf(output, "\\# %d ", total_rdfsize);
+ for (i = 0; i < ldns_rr_rd_count(rr); i++) {
+ for (j = 0; j < ldns_rdf_size(ldns_rr_rdf(rr, i)); j++) {
+ ldns_buffer_printf(output, "%.2x",
+ ldns_rdf_data(ldns_rr_rdf(rr, i))[j]);
+ }
+ }
+ ldns_buffer_printf(output, "\n");
+ return ldns_buffer_status(output);
+}
+
ldns_status
ldns_rr2buffer_str_fmt(ldns_buffer *output,
const ldns_output_format *fmt, const ldns_rr *rr)
{
uint16_t i, flags;
ldns_status status = LDNS_STATUS_OK;
+ ldns_output_format_storage* fmt_st = (ldns_output_format_storage*)fmt;
- if (fmt == NULL) {
- fmt = ldns_output_format_default;
+ if (fmt_st == NULL) {
+ fmt_st = (ldns_output_format_storage*)
+ ldns_output_format_default;
}
if (!rr) {
- if (LDNS_COMMENT_NULLS & fmt->flags) {
+ if (LDNS_COMMENT_NULLS & fmt_st->flags) {
ldns_buffer_printf(output, "; (null)\n");
}
return ldns_buffer_status(output);
@@ -1219,6 +1498,9 @@ ldns_rr2buffer_str_fmt(ldns_buffer *output,
}
ldns_buffer_printf(output, "\t");
+ if (ldns_output_format_covers_type(fmt, ldns_rr_get_type(rr))) {
+ return ldns_rr2buffer_str_rfc3597(output, rr);
+ }
status = ldns_rr_type2buffer_str(output, ldns_rr_get_type(rr));
if (status != LDNS_STATUS_OK) {
return status;
@@ -1232,7 +1514,7 @@ ldns_rr2buffer_str_fmt(ldns_buffer *output,
for (i = 0; i < ldns_rr_rd_count(rr); i++) {
/* ldns_rdf2buffer_str handles NULL input fine! */
- if ((fmt->flags & LDNS_FMT_ZEROIZE_RRSIGS) &&
+ if ((fmt_st->flags & LDNS_FMT_ZEROIZE_RRSIGS) &&
(ldns_rr_get_type(rr) == LDNS_RR_TYPE_RRSIG) &&
((/* inception */ i == 4 &&
ldns_rdf_get_type(ldns_rr_rdf(rr, 4)) ==
@@ -1246,7 +1528,7 @@ ldns_rr2buffer_str_fmt(ldns_buffer *output,
ldns_buffer_printf(output, "(null)");
status = ldns_buffer_status(output);
- } else if ((fmt->flags & LDNS_FMT_PAD_SOA_SERIAL) &&
+ } else if ((fmt_st->flags & LDNS_FMT_PAD_SOA_SERIAL) &&
(ldns_rr_get_type(rr) == LDNS_RR_TYPE_SOA) &&
/* serial */ i == 2 &&
ldns_rdf_get_type(ldns_rr_rdf(rr, 2)) ==
@@ -1256,8 +1538,8 @@ ldns_rr2buffer_str_fmt(ldns_buffer *output,
ldns_rdf_data(ldns_rr_rdf(rr, 2))));
status = ldns_buffer_status(output);
} else {
- status = ldns_rdf2buffer_str(output,
- ldns_rr_rdf(rr, i));
+ status = ldns_rdf2buffer_str_fmt(output,
+ fmt, ldns_rr_rdf(rr, i));
}
if(status != LDNS_STATUS_OK)
return status;
@@ -1270,137 +1552,126 @@ ldns_rr2buffer_str_fmt(ldns_buffer *output,
* getting here */
if (ldns_rr_rd_count(rr) > 0) {
switch (ldns_rr_get_type(rr)) {
- case LDNS_RR_TYPE_DNSKEY:
- /* if ldns_rr_rd_count(rr) > 0
- then ldns_rr_rdf(rr, 0) exists! */
- if (! (fmt->flags & LDNS_COMMENT_KEY)) {
- break;
- }
- flags = ldns_rdf2native_int16(
- ldns_rr_rdf(rr, 0));
- ldns_buffer_printf(output, " ;{");
- if (fmt->flags & LDNS_COMMENT_KEY_ID) {
- ldns_buffer_printf(output, "id = %u",
- (unsigned int)
- ldns_calc_keytag(rr));
- }
- if ((fmt->flags & LDNS_COMMENT_KEY_TYPE)
- && (flags & LDNS_KEY_ZONE_KEY)){
- if (flags & LDNS_KEY_SEP_KEY) {
- ldns_buffer_printf(
- output, " (ksk)");
- }
- else {
- ldns_buffer_printf(
- output, " (zsk)");
- }
- if (fmt->flags & LDNS_COMMENT_KEY_SIZE){
- ldns_buffer_printf(
- output, ", ");
- }
- } else if (fmt->flags
- & (LDNS_COMMENT_KEY_ID
- |LDNS_COMMENT_KEY_SIZE)) {
- ldns_buffer_printf( output, ", ");
+ case LDNS_RR_TYPE_DNSKEY:
+ /* if ldns_rr_rd_count(rr) > 0
+ then ldns_rr_rdf(rr, 0) exists! */
+ if (! (fmt_st->flags & LDNS_COMMENT_KEY)) {
+ break;
+ }
+ flags = ldns_rdf2native_int16(ldns_rr_rdf(rr, 0));
+ ldns_buffer_printf(output, " ;{");
+ if (fmt_st->flags & LDNS_COMMENT_KEY_ID) {
+ ldns_buffer_printf(output, "id = %u",
+ (unsigned int) ldns_calc_keytag(rr));
+ }
+ if ((fmt_st->flags & LDNS_COMMENT_KEY_TYPE) &&
+ (flags & LDNS_KEY_ZONE_KEY)){
+
+ if (flags & LDNS_KEY_SEP_KEY) {
+ ldns_buffer_printf(output, " (ksk)");
+ } else {
+ ldns_buffer_printf(output, " (zsk)");
}
- if (fmt->flags & LDNS_COMMENT_KEY_SIZE) {
- ldns_buffer_printf(output, "size = %db",
- ldns_rr_dnskey_key_size(rr));
+ if (fmt_st->flags & LDNS_COMMENT_KEY_SIZE){
+ ldns_buffer_printf(output, ", ");
}
- ldns_buffer_printf(output, "}");
- break;
- case LDNS_RR_TYPE_RRSIG:
- if ((fmt->flags & LDNS_COMMENT_KEY)
- && (fmt->flags
- & LDNS_COMMENT_RRSIGS)
- && ldns_rr_rdf(rr, 6) != NULL) {
- ldns_buffer_printf(output
- , " ;{id = %d}"
- , ldns_rdf2native_int16(
+ } else if (fmt_st->flags
+ & (LDNS_COMMENT_KEY_ID
+ |LDNS_COMMENT_KEY_SIZE)) {
+ ldns_buffer_printf( output, ", ");
+ }
+ if (fmt_st->flags & LDNS_COMMENT_KEY_SIZE) {
+ ldns_buffer_printf(output, "size = %db",
+ ldns_rr_dnskey_key_size(rr));
+ }
+ ldns_buffer_printf(output, "}");
+ break;
+ case LDNS_RR_TYPE_RRSIG:
+ if ((fmt_st->flags & LDNS_COMMENT_KEY)
+ && (fmt_st->flags& LDNS_COMMENT_RRSIGS)
+ && ldns_rr_rdf(rr, 6) != NULL) {
+ ldns_buffer_printf(output, " ;{id = %d}",
+ ldns_rdf2native_int16(
ldns_rr_rdf(rr, 6)));
+ }
+ break;
+ case LDNS_RR_TYPE_DS:
+ if ((fmt_st->flags & LDNS_COMMENT_BUBBLEBABBLE) &&
+ ldns_rr_rdf(rr, 3) != NULL) {
+
+ uint8_t *data = ldns_rdf_data(
+ ldns_rr_rdf(rr, 3));
+ size_t len = ldns_rdf_size(ldns_rr_rdf(rr, 3));
+ char *babble = ldns_bubblebabble(data, len);
+ if(babble) {
+ ldns_buffer_printf(output,
+ " ;{%s}", babble);
}
+ LDNS_FREE(babble);
+ }
+ break;
+ case LDNS_RR_TYPE_NSEC3:
+ if (! (fmt_st->flags & LDNS_COMMENT_FLAGS) &&
+ ! (fmt_st->flags & LDNS_COMMENT_NSEC3_CHAIN)) {
break;
- case LDNS_RR_TYPE_DS:
- if ((fmt->flags & LDNS_COMMENT_BUBBLEBABBLE)
- && ldns_rr_rdf(rr, 3) != NULL) {
- uint8_t *data = ldns_rdf_data(
- ldns_rr_rdf(rr, 3));
- size_t len = ldns_rdf_size(
- ldns_rr_rdf(rr, 3));
- char *babble = ldns_bubblebabble(
- data, len);
- if(babble) {
- ldns_buffer_printf(output
- , " ;{%s}", babble);
- }
- LDNS_FREE(babble);
+ }
+ ldns_buffer_printf(output, " ;{");
+ if ((fmt_st->flags & LDNS_COMMENT_FLAGS)) {
+ if (ldns_nsec3_optout(rr)) {
+ ldns_buffer_printf(output,
+ " flags: optout");
+ } else {
+ ldns_buffer_printf(output," flags: -");
}
- break;
- case LDNS_RR_TYPE_NSEC3:
- if (! (fmt->flags & LDNS_COMMENT_FLAGS) &&
- ! (fmt->flags & LDNS_COMMENT_NSEC3_CHAIN)) {
- break;
+ if (fmt_st->flags & LDNS_COMMENT_NSEC3_CHAIN &&
+ fmt_st->hashmap != NULL) {
+ ldns_buffer_printf(output, ", ");
}
- ldns_buffer_printf(output, " ;{");
- if ((fmt->flags & LDNS_COMMENT_FLAGS)) {
- if (ldns_nsec3_optout(rr)) {
- ldns_buffer_printf(output,
- " flags: optout");
- } else {
+ }
+ if (fmt_st->flags & LDNS_COMMENT_NSEC3_CHAIN &&
+ fmt_st->hashmap != NULL) {
+ ldns_rbnode_t *node;
+ ldns_rdf *key = ldns_dname_label(
+ ldns_rr_owner(rr), 0);
+ if (key) {
+ node = ldns_rbtree_search(
+ fmt_st->hashmap,
+ (void *) key);
+ if (node->data) {
ldns_buffer_printf(output,
- " flags: -");
- }
- if (fmt->flags & LDNS_COMMENT_NSEC3_CHAIN
- && fmt->data != NULL) {
- ldns_buffer_printf(output, ", ");
+ "from: ");
+ (void) ldns_rdf2buffer_str(
+ output,
+ ldns_dnssec_name_name(
+ (ldns_dnssec_name*)
+ node->data
+ ));
}
+ ldns_rdf_free(key);
}
- if (fmt->flags & LDNS_COMMENT_NSEC3_CHAIN
- && fmt->data != NULL) {
- ldns_rbnode_t *node;
- ldns_rdf *key = ldns_dname_label(
- ldns_rr_owner(rr), 0);
- if (key) {
- node = ldns_rbtree_search(
- (ldns_rbtree_t *)
- fmt->data,
- (void *) key);
- if (node->data) {
- ldns_buffer_printf(
- output,
- "from: ");
- (void)
- ldns_rdf2buffer_str(
- output,
- (ldns_rdf *)
- node->data);
- }
- ldns_rdf_free(key);
- }
- key = ldns_b32_ext2dname(
+ key = ldns_b32_ext2dname(
ldns_nsec3_next_owner(rr));
- if (key) {
- node = ldns_rbtree_search(
- (ldns_rbtree_t *)
- fmt->data,
- (void *) key);
- if (node->data) {
- ldns_buffer_printf(
- output,
- " to: ");
- (void)
- ldns_rdf2buffer_str(
- output,
- (ldns_rdf *)
- node->data);
- }
- ldns_rdf_free(key);
+ if (key) {
+ node = ldns_rbtree_search(
+ fmt_st->hashmap,
+ (void *) key);
+ if (node->data) {
+ ldns_buffer_printf(output,
+ " to: ");
+ (void) ldns_rdf2buffer_str(
+ output,
+ ldns_dnssec_name_name(
+ (ldns_dnssec_name*)
+ node->data
+ ));
}
+ ldns_rdf_free(key);
}
- ldns_buffer_printf(output, "}");
- break;
- default:
- break;
+ }
+ ldns_buffer_printf(output, "}");
+ break;
+ default:
+ break;
}
}
@@ -1724,10 +1995,12 @@ ldns_key2buffer_str(ldns_buffer *output, const ldns_key *k)
break;
#endif
default:
+#ifdef STDERR_MSGS
fprintf(stderr, "Warning: unknown signature ");
fprintf(stderr,
"algorithm type %u\n",
ldns_key_algorithm(k));
+#endif
ldns_buffer_printf(output,
"Algorithm: %u (Unknown)\n",
ldns_key_algorithm(k));
diff --git a/host2wire.c b/host2wire.c
index de1e01e9ba3f..8fb5c3a2ba59 100644
--- a/host2wire.c
+++ b/host2wire.c
@@ -81,6 +81,7 @@ ldns_rr_list2buffer_wire(ldns_buffer *buffer,const ldns_rr_list *rr_list)
return ldns_buffer_status(buffer);
}
+
ldns_status
ldns_rr2buffer_wire_canonical(ldns_buffer *buffer,
const ldns_rr *rr,
@@ -136,17 +137,15 @@ ldns_rr2buffer_wire_canonical(ldns_buffer *buffer,
rdl_pos = ldns_buffer_position(buffer);
ldns_buffer_write_u16(buffer, 0);
}
-
for (i = 0; i < ldns_rr_rd_count(rr); i++) {
if (pre_rfc3597) {
(void) ldns_rdf2buffer_wire_canonical(
- buffer, ldns_rr_rdf(rr, i));
+ buffer, ldns_rr_rdf(rr, i));
} else {
(void) ldns_rdf2buffer_wire(
- buffer, ldns_rr_rdf(rr, i));
+ buffer, ldns_rr_rdf(rr, i));
}
}
-
if (rdl_pos != 0) {
ldns_buffer_write_u16_at(buffer, rdl_pos,
ldns_buffer_position(buffer)
@@ -177,13 +176,11 @@ ldns_rr2buffer_wire(ldns_buffer *buffer, const ldns_rr *rr, int section)
/* remember pos for later */
rdl_pos = ldns_buffer_position(buffer);
ldns_buffer_write_u16(buffer, 0);
- }
-
+ }
for (i = 0; i < ldns_rr_rd_count(rr); i++) {
(void) ldns_rdf2buffer_wire(
buffer, ldns_rr_rdf(rr, i));
}
-
if (rdl_pos != 0) {
ldns_buffer_write_u16_at(buffer, rdl_pos,
ldns_buffer_position(buffer)
@@ -206,7 +203,8 @@ ldns_rrsig2buffer_wire(ldns_buffer *buffer, const ldns_rr *rr)
/* Convert all the rdfs, except the actual signature data
* rdf number 8 - the last, hence: -1 */
for (i = 0; i < ldns_rr_rd_count(rr) - 1; i++) {
- (void) ldns_rdf2buffer_wire_canonical(buffer, ldns_rr_rdf(rr, i));
+ (void) ldns_rdf2buffer_wire_canonical(buffer,
+ ldns_rr_rdf(rr, i));
}
return ldns_buffer_status(buffer);
@@ -218,9 +216,8 @@ ldns_rr_rdata2buffer_wire(ldns_buffer *buffer, const ldns_rr *rr)
uint16_t i;
/* convert all the rdf's */
for (i = 0; i < ldns_rr_rd_count(rr); i++) {
- (void) ldns_rdf2buffer_wire(buffer, ldns_rr_rdf(rr, i));
+ (void) ldns_rdf2buffer_wire(buffer, ldns_rr_rdf(rr,i));
}
-
return ldns_buffer_status(buffer);
}
@@ -245,7 +242,8 @@ ldns_hdr2buffer_wire(ldns_buffer *buffer, const ldns_pkt *packet)
flags = ldns_pkt_ra(packet) << 7
/*| ldns_pkt_z(packet) << 6*/
| ldns_pkt_ad(packet) << 5
- | ldns_pkt_cd(packet) << 4 | ldns_pkt_get_rcode(packet);
+ | ldns_pkt_cd(packet) << 4
+ | ldns_pkt_get_rcode(packet);
ldns_buffer_write_u8(buffer, flags);
ldns_buffer_write_u16(buffer, ldns_pkt_qdcount(packet));
diff --git a/install-sh b/install-sh
index a9244eb07865..377bb8687ffe 100755
--- a/install-sh
+++ b/install-sh
@@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
-scriptversion=2011-01-19.21; # UTC
+scriptversion=2011-11-20.07; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@@ -35,7 +35,7 @@ scriptversion=2011-01-19.21; # UTC
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
+# 'make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
@@ -156,7 +156,7 @@ while test $# -ne 0; do
-s) stripcmd=$stripprog;;
-t) dst_arg=$2
- # Protect names problematic for `test' and other utilities.
+ # Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
@@ -190,7 +190,7 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
fi
shift # arg
dst_arg=$arg
- # Protect names problematic for `test' and other utilities.
+ # Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
@@ -202,7 +202,7 @@ if test $# -eq 0; then
echo "$0: no input file specified." >&2
exit 1
fi
- # It's OK to call `install-sh -d' without argument.
+ # It's OK to call 'install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
@@ -240,7 +240,7 @@ fi
for src
do
- # Protect names problematic for `test' and other utilities.
+ # Protect names problematic for 'test' and other utilities.
case $src in
-* | [=\(\)!]) src=./$src;;
esac
@@ -354,7 +354,7 @@ do
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
- # other-writeable bit of parent directory when it shouldn't.
+ # other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
diff --git a/keys.c b/keys.c
index e16ac9153192..46f6a3d0cb68 100644
--- a/keys.c
+++ b/keys.c
@@ -368,40 +368,50 @@ ldns_key_new_frm_fp_l(ldns_key **key, FILE *fp, int *line_nr)
#ifdef USE_SHA2
alg = LDNS_SIGN_RSASHA256;
#else
+# ifdef STDERR_MSGS
fprintf(stderr, "Warning: SHA256 not compiled into this ");
fprintf(stderr, "version of ldns\n");
+# endif
#endif
}
if (strncmp(d, "10 RSASHA512", 3) == 0) {
#ifdef USE_SHA2
alg = LDNS_SIGN_RSASHA512;
#else
+# ifdef STDERR_MSGS
fprintf(stderr, "Warning: SHA512 not compiled into this ");
fprintf(stderr, "version of ldns\n");
+# endif
#endif
}
if (strncmp(d, "12 ECC-GOST", 3) == 0) {
#ifdef USE_GOST
alg = LDNS_SIGN_ECC_GOST;
#else
+# ifdef STDERR_MSGS
fprintf(stderr, "Warning: ECC-GOST not compiled into this ");
fprintf(stderr, "version of ldns, use --enable-gost\n");
+# endif
#endif
}
if (strncmp(d, "13 ECDSAP256SHA256", 3) == 0) {
#ifdef USE_ECDSA
alg = LDNS_SIGN_ECDSAP256SHA256;
#else
+# ifdef STDERR_MSGS
fprintf(stderr, "Warning: ECDSA not compiled into this ");
fprintf(stderr, "version of ldns, use --enable-ecdsa\n");
+# endif
#endif
}
if (strncmp(d, "14 ECDSAP384SHA384", 3) == 0) {
#ifdef USE_ECDSA
alg = LDNS_SIGN_ECDSAP384SHA384;
#else
+# ifdef STDERR_MSGS
fprintf(stderr, "Warning: ECDSA not compiled into this ");
fprintf(stderr, "version of ldns, use --enable-ecdsa\n");
+# endif
#endif
}
if (strncmp(d, "157 HMAC-MD5", 4) == 0) {
@@ -1317,8 +1327,10 @@ ldns_key_dsa2bin(unsigned char *data, DSA *k, uint16_t *size)
memcpy(data, &T, 1);
if (T > 8) {
+#ifdef STDERR_MSGS
fprintf(stderr, "DSA key with T > 8 (ie. > 1024 bits)");
fprintf(stderr, " not implemented\n");
+#endif
return false;
}
@@ -1605,7 +1617,9 @@ ldns_read_anchor_file(const char *filename)
fp = fopen(filename, "r");
if (!fp) {
+#ifdef STDERR_MSGS
fprintf(stderr, "Unable to open %s: %s\n", filename, strerror(errno));
+#endif
LDNS_FREE(line);
return NULL;
}
@@ -1619,7 +1633,9 @@ ldns_read_anchor_file(const char *filename)
fclose(fp);
if (i <= 0) {
+#ifdef STDERR_MSGS
fprintf(stderr, "nothing read from %s", filename);
+#endif
LDNS_FREE(line);
return NULL;
} else {
@@ -1628,7 +1644,9 @@ ldns_read_anchor_file(const char *filename)
LDNS_FREE(line);
return r;
} else {
+#ifdef STDERR_MSGS
fprintf(stderr, "Error creating DNSKEY or DS rr from %s: %s\n", filename, ldns_get_errorstr_by_id(status));
+#endif
LDNS_FREE(line);
return NULL;
}
diff --git a/ldns/common.h.in b/ldns/common.h.in
index aedfc96da7f2..8bf9654b4ff5 100644
--- a/ldns/common.h.in
+++ b/ldns/common.h.in
@@ -24,6 +24,9 @@
#define LDNS_BUILD_CONFIG_HAVE_ATTR_FORMAT @ldns_build_config_have_attr_format@
#define LDNS_BUILD_CONFIG_HAVE_ATTR_UNUSED @ldns_build_config_have_attr_unused@
#define LDNS_BUILD_CONFIG_HAVE_SOCKLEN_T @ldns_build_config_have_socklen_t@
+#define LDNS_BUILD_CONFIG_USE_DANE @ldns_build_config_use_dane@
+#define LDNS_BUILD_CONFIG_HAVE_B32_PTON @ldns_build_config_have_b32_pton@
+#define LDNS_BUILD_CONFIG_HAVE_B32_NTOP @ldns_build_config_have_b32_ntop@
/*
* HAVE_STDBOOL_H is not available when distributed as a library, but no build
diff --git a/ldns/config.h.in b/ldns/config.h.in
index 98cf357074ba..b41af233c3bd 100644
--- a/ldns/config.h.in
+++ b/ldns/config.h.in
@@ -86,9 +86,6 @@
/* Define to 1 if you have the `inet_pton' function. */
#undef HAVE_INET_PTON
-/* Define to 1 if the system has the type `intptr_t'. */
-#undef HAVE_INTPTR_T
-
/* define if you have inttypes.h */
#undef HAVE_INTTYPES_H
@@ -287,15 +284,36 @@
/* Define to the version of this package. */
#undef PACKAGE_VERSION
+/* Define this to enable RR type CDS. */
+#undef RRTYPE_CDS
+
+/* Define this to enable RR type NINFO. */
+#undef RRTYPE_NINFO
+
+/* Define this to enable RR type RKEY. */
+#undef RRTYPE_RKEY
+
+/* Define this to enable RR type TA. */
+#undef RRTYPE_TA
+
+/* Define this to enable RR type URI. */
+#undef RRTYPE_URI
+
/* The size of `time_t', as computed by sizeof. */
#undef SIZEOF_TIME_T
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
+/* Define this to enable messages to stderr. */
+#undef STDERR_MSGS
+
/* System configuration dir */
#undef SYSCONFDIR
+/* Define this to enable DANE support. */
+#undef USE_DANE
+
/* Define this to enable ECDSA support. */
#undef USE_ECDSA
@@ -382,8 +400,7 @@
/* Define to `char' if <sys/types.h> does not define. */
#undef int8_t
-/* Define to the type of a signed integer type wide enough to hold a pointer,
- if such a type exists, and if the system does not define it. */
+/* Define to `size_t' if <sys/types.h> does not define. */
#undef intptr_t
/* Define to rpl_malloc if the replacement function should be used. */
@@ -488,7 +505,6 @@
extern "C" {
#endif
-#ifndef B64_PTON
int ldns_b64_ntop(uint8_t const *src, size_t srclength,
char *target, size_t targsize);
/**
@@ -499,8 +515,6 @@ static inline size_t ldns_b64_ntop_calculate_size(size_t srcsize)
{
return ((((srcsize + 2) / 3) * 4) + 1);
}
-#endif /* !B64_PTON */
-#ifndef B64_NTOP
int ldns_b64_pton(char const *src, uint8_t *target, size_t targsize);
/**
* calculates the size needed to store the result of ldns_b64_pton
@@ -510,7 +524,12 @@ static inline size_t ldns_b64_pton_calculate_size(size_t srcsize)
{
return (((((srcsize + 3) / 4) * 3)) + 1);
}
-#endif /* !B64_NTOP */
+
+/**
+ * Given in dnssec_zone.c, also used in dnssec_sign.c:w
+
+ */
+int ldns_dname_compare_v(const void *a, const void *b);
#ifndef HAVE_SLEEP
/* use windows sleep, in millisecs, instead */
diff --git a/ldns/dane.h b/ldns/dane.h
index c1c4e2d75caf..6adecd575c51 100644
--- a/ldns/dane.h
+++ b/ldns/dane.h
@@ -22,6 +22,7 @@
#ifndef LDNS_DANE_H
#define LDNS_DANE_H
+#if LDNS_BUILD_CONFIG_USE_DANE
#include <ldns/common.h>
#include <ldns/rdata.h>
@@ -240,5 +241,6 @@ ldns_status ldns_dane_verify(ldns_rr_list* tlsas,
}
#endif
+#endif /* LDNS_BUILD_CONFIG_USE_DANE */
#endif /* LDNS_DANE_H */
diff --git a/ldns/dnssec.h b/ldns/dnssec.h
index 34f63714c34d..f4cdafbe9deb 100644
--- a/ldns/dnssec.h
+++ b/ldns/dnssec.h
@@ -364,12 +364,30 @@ ldns_rdf *ldns_nsec3_bitmap(const ldns_rr *nsec3_rr);
ldns_rdf *ldns_nsec3_hash_name_frm_nsec3(const ldns_rr *nsec, ldns_rdf *name);
/**
- * Checks coverage of NSEC RR type bitmap
- * \param[in] nsec_bitmap The NSEC bitmap rdata field to check
- * \param[in] type The type to check
- * \return true if the NSEC RR covers the type
+ * Check if RR type t is enumerated and set in the RR type bitmap rdf.
+ * \param[in] bitmap the RR type bitmap rdf to look in
+ * \param[in] type the type to check for
+ * \return true when t is found and set, otherwise return false
*/
-bool ldns_nsec_bitmap_covers_type(const ldns_rdf *nsec_bitmap, ldns_rr_type type);
+bool ldns_nsec_bitmap_covers_type(const ldns_rdf* bitmap, ldns_rr_type type);
+
+/**
+ * Checks if RR type t is enumerated in the type bitmap rdf and sets the bit.
+ * \param[in] bitmap the RR type bitmap rdf to look in
+ * \param[in] type the type to for which the bit to set
+ * \return LDNS_STATUS_OK on success. LDNS_STATUS_TYPE_NOT_IN_BITMAP is
+ * returned when the bitmap does not contain the bit to set.
+ */
+ldns_status ldns_nsec_bitmap_set_type(ldns_rdf* bitmap, ldns_rr_type type);
+
+/**
+ * Checks if RR type t is enumerated in the type bitmap rdf and clears the bit.
+ * \param[in] bitmap the RR type bitmap rdf to look in
+ * \param[in] type the type to for which the bit to clear
+ * \return LDNS_STATUS_OK on success. LDNS_STATUS_TYPE_NOT_IN_BITMAP is
+ * returned when the bitmap does not contain the bit to clear.
+ */
+ldns_status ldns_nsec_bitmap_clear_type(ldns_rdf* bitmap, ldns_rr_type type);
/**
* Checks coverage of NSEC(3) RR name span
diff --git a/ldns/dnssec_sign.h b/ldns/dnssec_sign.h
index e77cb6959dfd..f51c7fb38121 100644
--- a/ldns/dnssec_sign.h
+++ b/ldns/dnssec_sign.h
@@ -87,7 +87,7 @@ ldns_rdf *ldns_sign_public_rsamd5(ldns_buffer *to_sign, RSA *key);
* when walking the tree with the ldns_dnssec_name_node_next_nonglue()
* function. But watch out! Names that are partially occluded (like glue with
* the same name as the delegation) will not be marked and should specifically
- * be taken into account seperately.
+ * be taken into account separately.
*
* When glue_list is given (not NULL), in the process of marking the names, all
* glue resource records will be pushed to that list, even glue at the delegation name.
@@ -105,7 +105,7 @@ ldns_dnssec_zone_mark_and_get_glue(
* when walking the tree with the ldns_dnssec_name_node_next_nonglue()
* function. But watch out! Names that are partially occluded (like glue with
* the same name as the delegation) will not be marked and should specifically
- * be taken into account seperately.
+ * be taken into account separately.
*
* \param[in] zone the zone in which to mark the names
* \return LDNS_STATUS_OK on succesful completion
diff --git a/ldns/dnssec_zone.h b/ldns/dnssec_zone.h
index 257bfba23cd9..b794f942f47e 100644
--- a/ldns/dnssec_zone.h
+++ b/ldns/dnssec_zone.h
@@ -93,6 +93,13 @@ struct ldns_struct_dnssec_zone {
ldns_dnssec_name *soa;
/** tree of ldns_dnssec_names */
ldns_rbtree_t *names;
+ /** tree of ldns_dnssec_names by nsec3 hashes (when applicible) */
+ ldns_rbtree_t *hashed_names;
+ /** points to the first added NSEC3 rr whose parameters will be
+ * assumed for all subsequent NSEC3 rr's and which will be used
+ * to calculate hashed names
+ */
+ ldns_rr *_nsec3params;
};
typedef struct ldns_struct_dnssec_zone ldns_dnssec_zone;
@@ -119,7 +126,8 @@ void ldns_dnssec_rrs_free(ldns_dnssec_rrs *rrs);
void ldns_dnssec_rrs_deep_free(ldns_dnssec_rrs *rrs);
/**
- * Adds an RR to the list of RRs. The list will remain ordered
+ * Adds an RR to the list of RRs. The list will remain ordered.
+ * If an equal RR already exists, this RR will not be added.
*
* \param[in] rrs the list to add to
* \param[in] rr the RR to add
diff --git a/ldns/error.h b/ldns/error.h
index bac38ff87141..41b99ad146d9 100644
--- a/ldns/error.h
+++ b/ldns/error.h
@@ -117,7 +117,16 @@ enum ldns_enum_status {
LDNS_STATUS_DANE_TLSA_DID_NOT_MATCH,
LDNS_STATUS_DANE_NON_CA_CERTIFICATE,
LDNS_STATUS_DANE_PKIX_DID_NOT_VALIDATE,
- LDNS_STATUS_DANE_PKIX_NO_SELF_SIGNED_TRUST_ANCHOR
+ LDNS_STATUS_DANE_PKIX_NO_SELF_SIGNED_TRUST_ANCHOR,
+ LDNS_STATUS_EXISTS_ERR,
+ LDNS_STATUS_INVALID_ILNP64,
+ LDNS_STATUS_INVALID_EUI48,
+ LDNS_STATUS_INVALID_EUI64,
+ LDNS_STATUS_WIRE_RDATA_ERR,
+ LDNS_STATUS_INVALID_TAG,
+ LDNS_STATUS_TYPE_NOT_IN_BITMAP,
+ LDNS_STATUS_INVALID_RDF_TYPE,
+ LDNS_STATUS_RDATA_OVERFLOW,
};
typedef enum ldns_enum_status ldns_status;
diff --git a/ldns/host2str.h b/ldns/host2str.h
index bbf932767b3b..e69389e90aee 100644
--- a/ldns/host2str.h
+++ b/ldns/host2str.h
@@ -40,32 +40,38 @@ extern "C" {
#define LDNS_APL_NEGATION 0x80
/**
- * Represent a NULL pointer (in stead of a pointer to a ldns_rr as "; (null)"
+ * Represent a NULL pointer (instead of a pointer to a ldns_rr as "; (null)"
* as opposed to outputting nothing at all in such a case.
*/
-#define LDNS_COMMENT_NULLS 0x0001
+/* Flag Name Flag Nr. Has data associated
+ ---------------------------------------------------------------------*/
+#define LDNS_COMMENT_NULLS (1 << 0)
/** Show key id with DNSKEY RR's as comment */
-#define LDNS_COMMENT_KEY_ID 0x0002
+#define LDNS_COMMENT_KEY_ID (1 << 1)
/** Show if a DNSKEY is a ZSK or KSK as comment */
-#define LDNS_COMMENT_KEY_TYPE 0x0004
+#define LDNS_COMMENT_KEY_TYPE (1 << 2)
/** Show DNSKEY key size as comment */
-#define LDNS_COMMENT_KEY_SIZE 0x0008
-/** Show key id, type and size as comment for DNSKEY RR's */
-#define LDNS_COMMENT_KEY (LDNS_COMMENT_KEY_ID \
- |LDNS_COMMENT_KEY_TYPE\
- |LDNS_COMMENT_KEY_SIZE)
+#define LDNS_COMMENT_KEY_SIZE (1 << 3)
/** Provide bubblebabble representation for DS RR's as comment */
-#define LDNS_COMMENT_BUBBLEBABBLE 0x0010
+#define LDNS_COMMENT_BUBBLEBABBLE (1 << 4)
/** Show when a NSEC3 RR has the optout flag set as comment */
-#define LDNS_COMMENT_FLAGS 0x0020
+#define LDNS_COMMENT_FLAGS (1 << 5)
/** Show the unhashed owner and next owner names for NSEC3 RR's as comment */
-#define LDNS_COMMENT_NSEC3_CHAIN 0x0040
+#define LDNS_COMMENT_NSEC3_CHAIN (1 << 6) /* yes */
/** Print mark up */
-#define LDNS_COMMENT_LAYOUT 0x0080
+#define LDNS_COMMENT_LAYOUT (1 << 7)
/** Also comment KEY_ID with RRSIGS **/
-#define LDNS_COMMENT_RRSIGS 0x0100
-#define LDNS_FMT_ZEROIZE_RRSIGS 0x0200
-#define LDNS_FMT_PAD_SOA_SERIAL 0x0400
+#define LDNS_COMMENT_RRSIGS (1 << 8)
+#define LDNS_FMT_ZEROIZE_RRSIGS (1 << 9)
+#define LDNS_FMT_PAD_SOA_SERIAL (1 << 10)
+#define LDNS_FMT_RFC3597 (1 << 11) /* yes */
+
+#define LDNS_FMT_FLAGS_WITH_DATA 2
+
+/** Show key id, type and size as comment for DNSKEY RR's */
+#define LDNS_COMMENT_KEY (LDNS_COMMENT_KEY_ID \
+ |LDNS_COMMENT_KEY_TYPE\
+ |LDNS_COMMENT_KEY_SIZE)
/**
* Output format specifier
@@ -87,6 +93,18 @@ struct ldns_struct_output_format
typedef struct ldns_struct_output_format ldns_output_format;
/**
+ * Output format struct with additional data for flags that use them.
+ * This struct may not be initialized directly. Use ldns_output_format_init
+ * to initialize.
+ */
+struct ldns_struct_output_format_storage
+{ int flags;
+ ldns_rbtree_t* hashmap; /* for LDNS_COMMENT_NSEC3_CHAIN */
+ ldns_rdf* bitmap; /* for LDNS_FMT_RFC3597 */
+};
+typedef struct ldns_struct_output_format_storage ldns_output_format_storage;
+
+/**
* Standard output format record that disables commenting in the textual
* representation of Resource Records completely.
*/
@@ -108,6 +126,55 @@ extern const ldns_output_format *ldns_output_format_default;
extern const ldns_output_format *ldns_output_format_bubblebabble;
/**
+ * Initialize output format storage to the default value.
+ * \param[in] fmt A reference to an output_format_ storage struct
+ * \return The initialized storage struct typecasted to ldns_output_format
+ */
+INLINE
+ldns_output_format* ldns_output_format_init(ldns_output_format_storage* fmt) {
+ fmt->flags = ldns_output_format_default->flags;
+ fmt->hashmap = NULL;
+ fmt->bitmap = NULL;
+ return (ldns_output_format*)fmt;
+}
+
+/**
+ * Set an ouput format flag.
+ */
+INLINE void ldns_output_format_set(ldns_output_format* fmt, int flag) {
+ fmt->flags |= flag;
+}
+
+/**
+ * Clear an ouput format flag.
+ */
+INLINE void ldns_output_format_clear(ldns_output_format* fmt, int flag) {
+ fmt->flags &= !flag;
+}
+
+/**
+ * Makes sure the LDNS_FMT_RFC3597 is set in the output format.
+ * Marks the type to be printed in RFC3597 format.
+ * /param[in] fmt the output format to update
+ * /param[in] the type to be printed in RFC3597 format
+ * /return LDNS_STATUS_OK on success
+ */
+ldns_status
+ldns_output_format_set_type(ldns_output_format* fmt, ldns_rr_type type);
+
+/**
+ * Makes sure the LDNS_FMT_RFC3597 is set in the output format.
+ * Marks the type to not be printed in RFC3597 format. When no other types
+ * have been marked before, all known types (except the given one) will be
+ * marked for printing in RFC3597 format.
+ * /param[in] fmt the output format to update
+ * /param[in] the type not to be printed in RFC3597 format
+ * /return LDNS_STATUS_OK on success
+ */
+ldns_status
+ldns_output_format_clear_type(ldns_output_format* fmt, ldns_rr_type type);
+
+/**
* Converts an ldns packet opcode value to its mnemonic, and adds that
* to the output buffer
* \param[in] *output the buffer to add the data to
@@ -399,15 +466,6 @@ ldns_status ldns_rdf2buffer_str_int16_data(ldns_buffer *output, const ldns_rdf *
*/
ldns_status ldns_rdf2buffer_str_ipseckey(ldns_buffer *output, const ldns_rdf *rdf);
-/**
- * Converts an LDNS_RDF_TYPE_TSIG rdata element to string format and adds it to the output buffer
- * \param[in] *rdf The rdata to convert
- * \param[in] *output The buffer to add the data to
- * \return LDNS_STATUS_OK on success, and error status on failure
- */
-ldns_status ldns_rdf2buffer_str_tsig(ldns_buffer *output, const ldns_rdf *rdf);
-
-
/**
* Converts the data in the rdata field to presentation
* format (as char *) and appends it to the given buffer
@@ -518,6 +576,66 @@ ldns_status ldns_rdf2buffer_str_int32(ldns_buffer *output, const ldns_rdf *rdf);
*/
ldns_status ldns_rdf2buffer_str_time(ldns_buffer *output, const ldns_rdf *rdf);
+/**
+ * Converts an LDNS_RDF_TYPE_ILNP64 rdata element to 4 hexadecimal numbers
+ * separated by colons and adds it to the output buffer
+ * \param[in] *rdf The rdata to convert
+ * \param[in] *output The buffer to add the data to
+ * \return LDNS_STATUS_OK on success, and error status on failure
+ */
+ldns_status ldns_rdf2buffer_str_ilnp64(ldns_buffer *output,
+ const ldns_rdf *rdf);
+
+/**
+ * Converts an LDNS_RDF_TYPE_EUI48 rdata element to 6 hexadecimal numbers
+ * separated by dashes and adds it to the output buffer
+ * \param[in] *rdf The rdata to convert
+ * \param[in] *output The buffer to add the data to
+ * \return LDNS_STATUS_OK on success, and error status on failure
+ */
+ldns_status ldns_rdf2buffer_str_eui48(ldns_buffer *output,
+ const ldns_rdf *rdf);
+
+/**
+ * Converts an LDNS_RDF_TYPE_EUI64 rdata element to 8 hexadecimal numbers
+ * separated by dashes and adds it to the output buffer
+ * \param[in] *rdf The rdata to convert
+ * \param[in] *output The buffer to add the data to
+ * \return LDNS_STATUS_OK on success, and error status on failure
+ */
+ldns_status ldns_rdf2buffer_str_eui64(ldns_buffer *output,
+ const ldns_rdf *rdf);
+
+/**
+ * Adds the LDNS_RDF_TYPE_TAG rdata to the output buffer,
+ * provided it contains only alphanumeric characters.
+ * \param[in] *rdf The rdata to convert
+ * \param[in] *output The buffer to add the data to
+ * \return LDNS_STATUS_OK on success, and error status on failure
+ */
+ldns_status ldns_rdf2buffer_str_tag(ldns_buffer *output,
+ const ldns_rdf *rdf);
+
+/**
+ * Adds the LDNS_RDF_TYPE_LONG_STR rdata to the output buffer, in-between
+ * double quotes and all non printable characters properly escaped.
+ * \param[in] *rdf The rdata to convert
+ * \param[in] *output The buffer to add the data to
+ * \return LDNS_STATUS_OK on success, and error status on failure
+ */
+ldns_status ldns_rdf2buffer_str_long_str(ldns_buffer *output,
+ const ldns_rdf *rdf);
+
+/**
+ * Converts an LDNS_RDF_TYPE_HIP rdata element to presentation format for
+ * the algorithm, HIT and Public Key and adds it the output buffer .
+ * \param[in] *rdf The rdata to convert
+ * \param[in] *output The buffer to add the data to
+ * \return LDNS_STATUS_OK on success, and error status on failure
+ */
+ldns_status ldns_rdf2buffer_str_hip(ldns_buffer *output,
+ const ldns_rdf *rdf);
+
/**
* Converts the data in the rdata field to presentation format and
* returns that as a char *.
diff --git a/ldns/ldns.h b/ldns/ldns.h
index a41e0325d673..60663ef95c7f 100644
--- a/ldns/ldns.h
+++ b/ldns/ldns.h
@@ -26,7 +26,7 @@ faster than Perl.
The first main tool to use ldns is Drill, from which part of the library was
derived. From version 1.0.0 on, drill is included in the ldns release
-and will not be distributed seperately anymore. The library also includes some
+and will not be distributed separately anymore. The library also includes some
other examples and tools to show how it can be used. These can be found in the
examples/ directory in the tarball.
@@ -37,9 +37,9 @@ Feature list
- TSIG support,
- DNSSEC support; signing and verification,
- small size,
- - online documentation as well as manual pages.
+ - online documentation as well as manual pages.
-If you want to send us patches please use the code from subversion (trunk).
+If you want to send us patches please use the code from git.
\section using_ldns Using ldns
@@ -119,6 +119,7 @@ Or you can just use the menu above to browse through the API docs.
#include <ldns/parse.h>
#include <ldns/zone.h>
#include <ldns/dnssec_zone.h>
+#include <ldns/radix.h>
#include <ldns/rbtree.h>
#include <ldns/sha1.h>
#include <ldns/sha2.h>
diff --git a/ldns/net.h.in b/ldns/net.h.in
index cd4cfdec9c64..e6b3618f20f2 100644
--- a/ldns/net.h.in
+++ b/ldns/net.h.in
@@ -50,7 +50,6 @@ ldns_status ldns_udp_send(uint8_t **result, ldns_buffer *qbin, const struct sock
* \param[in] timeout *unused*, was the timeout value for the network
* \return the socket used
*/
-
int ldns_udp_bgsend(ldns_buffer *qbin, const struct sockaddr_storage *to, socklen_t tolen, struct timeval timeout);
/**
diff --git a/ldns/packet.h b/ldns/packet.h
index ed7c32746363..9dca06f56274 100644
--- a/ldns/packet.h
+++ b/ldns/packet.h
@@ -411,6 +411,17 @@ uint32_t ldns_pkt_querytime(const ldns_pkt *p);
size_t ldns_pkt_size(const ldns_pkt *p);
/**
+ * Return the number of RRs in the given section.
+ * Returns the sum of all RRs when LDNS_SECTION_ANY is given.
+ * Returns the sum of all non-question RRs when LDNS_SECTION_ANY_NOQUESTION
+ * is given.
+ * \param[in] p the packet
+ * \param[in] s the section
+ * \return the number of RRs in the given section
+ */
+uint16_t ldns_pkt_section_count(const ldns_pkt *p, ldns_pkt_section s);
+
+/**
* Return the packet's tsig pseudo rr's
* \param[in] p the packet
* \return the tsig rr
@@ -760,6 +771,18 @@ void ldns_pkt_free(ldns_pkt *packet);
ldns_status ldns_pkt_query_new_frm_str(ldns_pkt **p, const char *rr_name, ldns_rr_type rr_type, ldns_rr_class rr_class , uint16_t flags);
/**
+ * creates an IXFR request packet for the given name, class.
+ * adds the SOA record to the authority section.
+ * \param[out] p the packet to be returned
+ * \param[in] rr_name the name to query for (as string)
+ * \param[in] rr_class the class to query for
+ * \param[in] flags packet flags
+ * \param[in] soa soa record to be added to the authority section
+ * \return LDNS_STATUS_OK or a ldns_status mesg with the error
+ */
+ldns_status ldns_pkt_ixfr_request_new_frm_str(ldns_pkt **p, const char *rr_name, ldns_rr_class rr_class, uint16_t flags, ldns_rr* soa);
+
+/**
* creates a packet with a query in it for the given name, type and class.
* \param[in] rr_name the name to query for
* \param[in] rr_type the type to query for
@@ -770,6 +793,17 @@ ldns_status ldns_pkt_query_new_frm_str(ldns_pkt **p, const char *rr_name, ldns_r
ldns_pkt *ldns_pkt_query_new(ldns_rdf *rr_name, ldns_rr_type rr_type, ldns_rr_class rr_class, uint16_t flags);
/**
+ * creates an IXFR request packet for the given name, type and class.
+ * adds the SOA record to the authority section.
+ * \param[in] rr_name the name to query for
+ * \param[in] rr_class the class to query for
+ * \param[in] flags packet flags
+ * \param[in] soa soa record to be added to the authority section
+ * \return ldns_pkt* a pointer to the new pkt
+ */
+ldns_pkt *ldns_pkt_ixfr_request_new(ldns_rdf *rr_name, ldns_rr_class rr_class, uint16_t flags, ldns_rr* soa);
+
+/**
* clones the given packet, creating a fully allocated copy
*
* \param[in] pkt the packet to clone
diff --git a/ldns/radix.h b/ldns/radix.h
new file mode 100644
index 000000000000..f8833eb2cec8
--- /dev/null
+++ b/ldns/radix.h
@@ -0,0 +1,240 @@
+/*
+ * radix.h -- generic radix tree
+ *
+ * Copyright (c) 2012, NLnet Labs. All rights reserved.
+ *
+ * This software is open source.
+ *
+ * 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 NLNET LABS nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+/**
+ * \file
+ * Radix tree. Implementation taken from NSD 4, adjusted for use in ldns.
+ *
+ */
+
+#ifndef LDNS_RADIX_H_
+#define LDNS_RADIX_H_
+
+#include <ldns/error.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef uint16_t radix_strlen_t;
+typedef struct ldns_radix_array_t ldns_radix_array_t;
+typedef struct ldns_radix_node_t ldns_radix_node_t;
+typedef struct ldns_radix_t ldns_radix_t;
+
+/** Radix node select edge array */
+struct ldns_radix_array_t {
+ /** Additional string after the selection byte for this edge. */
+ uint8_t* str;
+ /** Length of additional string for this edge. */
+ radix_strlen_t len;
+ /** Node that deals with byte+str. */
+ ldns_radix_node_t* edge;
+};
+
+/** A node in a radix tree */
+struct ldns_radix_node_t {
+ /** Key corresponding to this node. */
+ uint8_t* key;
+ /** Key length corresponding to this node. */
+ radix_strlen_t klen;
+ /** Data corresponding to this node. */
+ void* data;
+ /** Parent node. */
+ ldns_radix_node_t* parent;
+ /** Index in the the parent node select edge array. */
+ uint8_t parent_index;
+ /** Length of the array. */
+ uint16_t len;
+ /** Offset of the array. */
+ uint16_t offset;
+ /** Capacity of the array. */
+ uint16_t capacity;
+ /** Select edge array. */
+ ldns_radix_array_t* array;
+};
+
+/** An entire radix tree */
+struct ldns_radix_t {
+ /** Root. */
+ ldns_radix_node_t* root;
+ /** Number of nodes in tree. */
+ size_t count;
+};
+
+/**
+ * Create a new radix tree.
+ * @return: new radix tree.
+ *
+ */
+ldns_radix_t* ldns_radix_create(void);
+
+/**
+ * Initialize radix tree.
+ * @param tree: uninitialized radix tree.
+ *
+ */
+void ldns_radix_init(ldns_radix_t* tree);
+
+/**
+ * Free the radix tree.
+ * @param tree: radix tree.
+ *
+ */
+void ldns_radix_free(ldns_radix_t* tree);
+
+/**
+ * Insert data into the tree.
+ * @param tree: tree to insert to.
+ * @param key: key.
+ * @param len: length of key.
+ * @param data: data.
+ * @return: status.
+ *
+ */
+ldns_status ldns_radix_insert(ldns_radix_t* tree, uint8_t* key,
+ radix_strlen_t len, void* data);
+
+/**
+ * Delete data from the tree.
+ * @param tree: tree to insert to.
+ * @param key: key.
+ * @param len: length of key.
+ * @return: unlinked data or NULL if not present.
+ *
+ */
+void* ldns_radix_delete(ldns_radix_t* tree, uint8_t* key, radix_strlen_t len);
+
+/**
+ * Search data in the tree.
+ * @param tree: tree to insert to.
+ * @param key: key.
+ * @param len: length of key.
+ * @return: the radix node or NULL if not found.
+ *
+ */
+ldns_radix_node_t* ldns_radix_search(ldns_radix_t* tree, uint8_t* key,
+ radix_strlen_t len);
+
+/**
+ * Search data in the tree, and if not found, find the closest smaller
+ * element in the tree.
+ * @param tree: tree to insert to.
+ * @param key: key.
+ * @param len: length of key.
+ * @param result: the radix node with the exact or closest match. NULL if
+ * the key is smaller than the smallest key in the tree.
+ * @return 1 if exact match, 0 otherwise.
+ *
+ */
+int ldns_radix_find_less_equal(ldns_radix_t* tree, uint8_t* key,
+ radix_strlen_t len, ldns_radix_node_t** result);
+
+/**
+ * Get the first element in the tree.
+ * @param tree: tree.
+ * @return: the radix node with the first element.
+ *
+ */
+ldns_radix_node_t* ldns_radix_first(ldns_radix_t* tree);
+
+/**
+ * Get the last element in the tree.
+ * @param tree: tree.
+ * @return: the radix node with the last element.
+ *
+ */
+ldns_radix_node_t* ldns_radix_last(ldns_radix_t* tree);
+
+/**
+ * Next element.
+ * @param node: node.
+ * @return: node with next element.
+ *
+ */
+ldns_radix_node_t* ldns_radix_next(ldns_radix_node_t* node);
+
+/**
+ * Previous element.
+ * @param node: node.
+ * @return: node with previous element.
+ *
+ */
+ldns_radix_node_t* ldns_radix_prev(ldns_radix_node_t* node);
+
+/**
+ * Split radix tree intwo.
+ * @param tree1: one tree.
+ * @param num: number of elements to split off.
+ * @param tree2: another tree.
+ * @return: status.
+ *
+ */
+ldns_status ldns_radix_split(ldns_radix_t* tree1, size_t num,
+ ldns_radix_t** tree2);
+
+/**
+ * Join two radix trees.
+ * @param tree1: one tree.
+ * @param tree2: another tree.
+ * @return: status.
+ *
+ */
+ldns_status ldns_radix_join(ldns_radix_t* tree1, ldns_radix_t* tree2);
+
+/**
+ * Call function for all nodes in the tree, such that leaf nodes are
+ * called before parent nodes.
+ * @param node: start node.
+ * @param func: function.
+ * @param arg: user argument.
+ *
+ */
+void ldns_radix_traverse_postorder(ldns_radix_node_t* node,
+ void (*func)(ldns_radix_node_t*, void*), void* arg);
+
+/**
+ * Print radix tree (for debugging purposes).
+ * @param fd: file descriptor.
+ * @param tree: tree.
+ *
+ */
+void ldns_radix_printf(FILE* fd, ldns_radix_t* tree);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* LDNS_RADIX_H_ */
diff --git a/ldns/rdata.h b/ldns/rdata.h
index 229a4d4c5b50..1866e8fc066f 100644
--- a/ldns/rdata.h
+++ b/ldns/rdata.h
@@ -28,12 +28,13 @@
extern "C" {
#endif
-#define LDNS_MAX_RDFLEN 8192
+#define LDNS_MAX_RDFLEN 65535
#define LDNS_RDF_SIZE_BYTE 1
#define LDNS_RDF_SIZE_WORD 2
#define LDNS_RDF_SIZE_DOUBLEWORD 4
#define LDNS_RDF_SIZE_6BYTES 6
+#define LDNS_RDF_SIZE_8BYTES 8
#define LDNS_RDF_SIZE_16BYTES 16
#define LDNS_NSEC3_VARS_OPTOUT_MASK 0x01
@@ -85,7 +86,10 @@ enum ldns_enum_rdf_type
LDNS_RDF_TYPE_PERIOD,
/** tsig time 48 bits */
LDNS_RDF_TYPE_TSIGTIME,
- LDNS_RDF_TYPE_TSIG,
+ /** Represents the Public Key Algorithm, HIT and Public Key fields
+ for the HIP RR types. A HIP specific rdf type is used because of
+ the unusual layout in wireformat (see RFC 5205 Section 5) */
+ LDNS_RDF_TYPE_HIP,
/** variable length any type rdata where the length
is specified by the first 2 bytes */
LDNS_RDF_TYPE_INT16_DATA,
@@ -104,7 +108,31 @@ enum ldns_enum_rdf_type
/** nsec3 hash salt */
LDNS_RDF_TYPE_NSEC3_SALT,
/** nsec3 base32 string (with length byte on wire */
- LDNS_RDF_TYPE_NSEC3_NEXT_OWNER
+ LDNS_RDF_TYPE_NSEC3_NEXT_OWNER,
+
+ /** 4 shorts represented as 4 * 16 bit hex numbers
+ * separated by colons. For NID and L64.
+ */
+ LDNS_RDF_TYPE_ILNP64,
+
+ /** 6 * 8 bit hex numbers separated by dashes. For EUI48. */
+ LDNS_RDF_TYPE_EUI48,
+ /** 8 * 8 bit hex numbers separated by dashes. For EUI64. */
+ LDNS_RDF_TYPE_EUI64,
+
+ /** A non-zero sequence of US-ASCII letters and numbers in lower case.
+ * For CAA.
+ */
+ LDNS_RDF_TYPE_TAG,
+
+ /** A <character-string> encoding of the value field as specified
+ * [RFC1035], Section 5.1., encoded as remaining rdata.
+ * For CAA.
+ */
+ LDNS_RDF_TYPE_LONG_STR,
+
+ /* Aliases */
+ LDNS_RDF_TYPE_BITMAP = LDNS_RDF_TYPE_NSEC
};
typedef enum ldns_enum_rdf_type ldns_rdf_type;
@@ -380,6 +408,34 @@ ldns_rdf *ldns_rdf_clone(const ldns_rdf *rd);
*/
int ldns_rdf_compare(const ldns_rdf *rd1, const ldns_rdf *rd2);
+/**
+ * Gets the algorithm value, the HIT and Public Key data from the rdf with
+ * type LDNS_RDF_TYPE_HIP.
+ * \param[in] rdf the rdf with type LDNS_RDF_TYPE_HIP
+ * \param[out] alg the algorithm
+ * \param[out] hit_size the size of the HIT data
+ * \param[out] hit the hit data
+ * \param[out] pk_size the size of the Public Key data
+ * \param[out] pk the Public Key data
+ * \return LDNS_STATUS_OK on success, and the error otherwise
+ */
+ldns_status ldns_rdf_hip_get_alg_hit_pk(ldns_rdf *rdf, uint8_t* alg,
+ uint8_t *hit_size, uint8_t** hit,
+ uint16_t *pk_size, uint8_t** pk);
+
+/**
+ * Creates a new LDNS_RDF_TYPE_HIP rdf from given data.
+ * \param[out] rdf the newly created LDNS_RDF_TYPE_HIP rdf
+ * \param[in] alg the algorithm
+ * \param[in] hit_size the size of the HIT data
+ * \param[in] hit the hit data
+ * \param[in] pk_size the size of the Public Key data
+ * \param[in] pk the Public Key data
+ * \return LDNS_STATUS_OK on success, and the error otherwise
+ */
+ldns_status ldns_rdf_hip_new_frm_alg_hit_pk(ldns_rdf** rdf, uint8_t alg,
+ uint8_t hit_size, uint8_t *hit, uint16_t pk_size, uint8_t *pk);
+
#ifdef __cplusplus
}
#endif
diff --git a/ldns/resolver.h b/ldns/resolver.h
index 7af5d401e65c..26d4f480b5fc 100644
--- a/ldns/resolver.h
+++ b/ldns/resolver.h
@@ -138,6 +138,9 @@ struct ldns_struct_resolver
char *_tsig_keydata;
/** TSIG signing algorithm */
char *_tsig_algorithm;
+
+ /** Source address to query from */
+ ldns_rdf *_source;
};
typedef struct ldns_struct_resolver ldns_resolver;
@@ -152,6 +155,13 @@ typedef struct ldns_struct_resolver ldns_resolver;
uint16_t ldns_resolver_port(const ldns_resolver *r);
/**
+ * Get the source address the resolver should use
+ * \param[in] r the resolver
+ * \return the source rdf
+ */
+ldns_rdf *ldns_resolver_source(const ldns_resolver *r);
+
+/**
* Is the resolver set to recurse
* \param[in] r the resolver
* \return true if so, otherwise false
@@ -338,6 +348,13 @@ size_t ldns_resolver_searchlist_count(const ldns_resolver *r);
void ldns_resolver_set_port(ldns_resolver *r, uint16_t p);
/**
+ * Set the source rdf (address) the resolver should use
+ * \param[in] r the resolver
+ * \param[in] s the source address
+ */
+void ldns_resolver_set_source(ldns_resolver *r, ldns_rdf *s);
+
+/**
* Set the resolver recursion
* \param[in] r the resolver
* \param[in] b true: set to recurse, false: unset
@@ -464,9 +481,10 @@ void ldns_resolver_set_retrans(ldns_resolver *r, uint8_t re);
void ldns_resolver_set_fallback(ldns_resolver *r, bool fallback);
/**
- * Set the resolver retry interval (in seconds)
+ * Set the number of times a resolver should retry a nameserver before the
+ * next one is tried.
* \param[in] r the resolver
- * \param[in] re the retry interval
+ * \param[in] re the number of retries
*/
void ldns_resolver_set_retry(ldns_resolver *r, uint8_t re);
@@ -583,6 +601,22 @@ ldns_status ldns_resolver_push_nameserver_rr_list(ldns_resolver *r, ldns_rr_list
*/
ldns_pkt* ldns_resolver_search(const ldns_resolver *r, const ldns_rdf *rdf, ldns_rr_type t, ldns_rr_class c, uint16_t flags);
+
+/**
+ * Send the query for using the resolver and take the search list into account
+ * The search algorithm is as follows:
+ * If the name is absolute, try it as-is, otherwise apply the search list
+ * \param[out] pkt a packet with the reply from the nameserver
+ * \param[in] *r operate using this resolver
+ * \param[in] *rdf query for this name
+ * \param[in] t query for this type (may be 0, defaults to A)
+ * \param[in] c query for this class (may be 0, default to IN)
+ * \param[in] flags the query flags
+ *
+ * \return ldns_status LDNS_STATUS_OK on success
+ */
+ldns_status ldns_resolver_search_status(ldns_pkt** pkt, ldns_resolver *r, const ldns_rdf *rdf, ldns_rr_type t, ldns_rr_class c, uint16_t flags);
+
/**
* Form a query packet from a resolver and name/type/class combo
* \param[out] **q a pointer to a ldns_pkt pointer (initialized by this function)
@@ -619,12 +653,29 @@ ldns_status ldns_resolver_send_pkt(ldns_pkt **answer, ldns_resolver *r, ldns_pkt
/**
* Send a query to a nameserver
+ * \param[out] pkt a packet with the reply from the nameserver
* \param[in] *r operate using this resolver
* \param[in] *name query for this name
* \param[in] *t query for this type (may be 0, defaults to A)
* \param[in] *c query for this class (may be 0, default to IN)
* \param[in] flags the query flags
*
+ * \return ldns_status LDNS_STATUS_OK on success
+ * if _defnames is true the default domain will be added
+ */
+ldns_status ldns_resolver_query_status(ldns_pkt** pkt, ldns_resolver *r, const ldns_rdf *name, ldns_rr_type t, ldns_rr_class c, uint16_t flags);
+
+
+/**
+ * Send a query to a nameserver
+ * \param[in] *r operate using this resolver
+ * (despite the const in the declaration,
+ * the struct is altered as a side-effect)
+ * \param[in] *name query for this name
+ * \param[in] *t query for this type (may be 0, defaults to A)
+ * \param[in] *c query for this class (may be 0, default to IN)
+ * \param[in] flags the query flags
+ *
* \return ldns_pkt* a packet with the reply from the nameserver
* if _defnames is true the default domain will be added
*/
diff --git a/ldns/rr.h b/ldns/rr.h
index e42fda6a45a2..ff499395c00b 100644
--- a/ldns/rr.h
+++ b/ldns/rr.h
@@ -36,8 +36,8 @@ extern "C" {
/** The bytes TTL, CLASS and length use up in an rr */
#define LDNS_RR_OVERHEAD 10
-/* The first fields are 'common' and can be referenced instantly */
-#define LDNS_RDATA_FIELD_DESCRIPTORS_COMMON 53
+/* The first fields are contiguous and can be referenced instantly */
+#define LDNS_RDATA_FIELD_DESCRIPTORS_COMMON 258
@@ -163,7 +163,7 @@ enum ldns_enum_rr_type
LDNS_RR_TYPE_OPT = 41,
/** RFC3123 */
LDNS_RR_TYPE_APL = 42,
- /** draft-ietf-dnsext-delegation */
+ /** RFC4034, RFC3658 */
LDNS_RR_TYPE_DS = 43,
/** SSH Key Fingerprint */
LDNS_RR_TYPE_SSHFP = 44, /* RFC 4255 */
@@ -179,19 +179,35 @@ enum ldns_enum_rr_type
LDNS_RR_TYPE_NSEC3 = 50, /* RFC 5155 */
LDNS_RR_TYPE_NSEC3PARAM = 51, /* RFC 5155 */
LDNS_RR_TYPE_NSEC3PARAMS = 51,
- /** draft-ietf-dane-protocol */
- LDNS_RR_TYPE_TLSA = 52,
+ LDNS_RR_TYPE_TLSA = 52, /* RFC 6698 */
+ LDNS_RR_TYPE_HIP = 55, /* RFC 5205 */
+
+ /** draft-reid-dnsext-zs */
+ LDNS_RR_TYPE_NINFO = 56,
+ /** draft-reid-dnsext-rkey */
+ LDNS_RR_TYPE_RKEY = 57,
/** draft-ietf-dnsop-trust-history */
LDNS_RR_TYPE_TALINK = 58,
+ /** draft-barwood-dnsop-ds-publis */
+ LDNS_RR_TYPE_CDS = 59,
- LDNS_RR_TYPE_SPF = 99,
+ LDNS_RR_TYPE_SPF = 99, /* RFC 4408 */
LDNS_RR_TYPE_UINFO = 100,
LDNS_RR_TYPE_UID = 101,
LDNS_RR_TYPE_GID = 102,
LDNS_RR_TYPE_UNSPEC = 103,
+ LDNS_RR_TYPE_NID = 104, /* RFC 6742 */
+ LDNS_RR_TYPE_L32 = 105, /* RFC 6742 */
+ LDNS_RR_TYPE_L64 = 106, /* RFC 6742 */
+ LDNS_RR_TYPE_LP = 107, /* RFC 6742 */
+
+ LDNS_RR_TYPE_EUI48 = 108, /* RFC 7043 */
+ LDNS_RR_TYPE_EUI64 = 109, /* RFC 7043 */
+
+ LDNS_RR_TYPE_TKEY = 249, /* RFC 2930 */
LDNS_RR_TYPE_TSIG = 250,
LDNS_RR_TYPE_IXFR = 251,
LDNS_RR_TYPE_AXFR = 252,
@@ -201,7 +217,12 @@ enum ldns_enum_rr_type
LDNS_RR_TYPE_MAILA = 254,
/** any type (wildcard) */
LDNS_RR_TYPE_ANY = 255,
+ /** draft-faltstrom-uri-06 */
+ LDNS_RR_TYPE_URI = 256,
+ LDNS_RR_TYPE_CAA = 257, /* RFC 6844 */
+ /** DNSSEC Trust Authorities */
+ LDNS_RR_TYPE_TA = 32768,
/* RFC 4431, 5074, DNSSEC Lookaside Validation */
LDNS_RR_TYPE_DLV = 32769,
@@ -337,6 +358,23 @@ struct ldns_struct_rr_descriptor
};
typedef struct ldns_struct_rr_descriptor ldns_rr_descriptor;
+
+/**
+ * Create a rr type bitmap rdf providing enough space to set all
+ * known (to ldns) rr types.
+ * \param[out] rdf the constructed rdf
+ * \return LDNS_STATUS_OK if all went well.
+ */
+ldns_status ldns_rdf_bitmap_known_rr_types_space(ldns_rdf** rdf);
+
+/**
+ * Create a rr type bitmap rdf with at least all known (to ldns) rr types set.
+ * \param[out] rdf the constructed rdf
+ * \return LDNS_STATUS_OK if all went well.
+ */
+ldns_status ldns_rdf_bitmap_known_rr_types(ldns_rdf** rdf);
+
+
/**
* creates a new rr structure.
* \return ldns_rr *
diff --git a/ldns/str2host.h b/ldns/str2host.h
index 09416cd22527..341aa2481958 100644
--- a/ldns/str2host.h
+++ b/ldns/str2host.h
@@ -181,14 +181,6 @@ ldns_status ldns_str2rdf_alg(ldns_rdf **rd, const char *str);
ldns_status ldns_str2rdf_unknown(ldns_rdf **rd, const char *str);
/**
- * convert string with a tsig? RR into wireformat
- * \param[in] rd the rdf where to put the data
- * \param[in] str the string to be converted
- * \return ldns_status
- */
-ldns_status ldns_str2rdf_tsig(ldns_rdf **rd, const char *str);
-
-/**
* convert string with a protocol service into wireformat
* \param[in] rd the rdf where to put the data
* \param[in] str the string to be converted
@@ -244,6 +236,58 @@ ldns_status ldns_str2rdf_ipseckey(ldns_rdf **rd, const char *str);
*/
ldns_status ldns_str2rdf_dname(ldns_rdf **rd, const char *str);
+/**
+ * convert 4 * 16bit hex separated by colons into wireformat
+ * \param[in] rd the rdf where to put the data
+ * \param[in] str the string to be converted
+ * \return ldns_status
+ */
+ldns_status ldns_str2rdf_ilnp64(ldns_rdf **rd, const char *str);
+
+/**
+ * convert 6 hex bytes separated by dashes into wireformat
+ * \param[in] rd the rdf where to put the data
+ * \param[in] str the string to be converted
+ * \return ldns_status
+ */
+ldns_status ldns_str2rdf_eui48(ldns_rdf **rd, const char *str);
+
+/**
+ * convert 8 hex bytes separated by dashes into wireformat
+ * \param[in] rd the rdf where to put the data
+ * \param[in] str the string to be converted
+ * \return ldns_status
+ */
+ldns_status ldns_str2rdf_eui64(ldns_rdf **rd, const char *str);
+
+/**
+ * Convert a non-zero sequence of US-ASCII letters and numbers into wireformat
+ * \param[in] rd the rdf where to put the data
+ * \param[in] str the string to be converted
+ * \return ldns_status
+ */
+ldns_status ldns_str2rdf_tag(ldns_rdf **rd, const char *str);
+
+/**
+ * Convert a <character-string> encoding of the value field as specified
+ * [RFC1035], Section 5.1., encoded as one bug chunk of data.
+ * \param[in] rd the rdf where to put the data
+ * \param[in] str the string to be converted
+ * \return ldns_status
+ */
+ldns_status ldns_str2rdf_long_str(ldns_rdf **rd, const char *str);
+
+/**
+ * Convert a "<algorithm> <hit> <pk>" encoding of the value field as specified
+ * in Section 6. of [RFC5205], encoded as wireformat as specified in Section 5.
+ * of [RFC5205].
+ * \param[in] rd the rdf where to put the data
+ * \param[in] str the string to be converted
+ * \return ldns_status
+ */
+ldns_status ldns_str2rdf_hip(ldns_rdf **rd, const char *str);
+
+
#ifdef __cplusplus
}
#endif
diff --git a/ldns/util.h.in b/ldns/util.h.in
index fe4ff3720b07..b6c9abe022f5 100644
--- a/ldns/util.h.in
+++ b/ldns/util.h.in
@@ -325,42 +325,66 @@ uint16_t ldns_get_random(void);
*/
char *ldns_bubblebabble(uint8_t *data, size_t len);
-#ifndef B32_NTOP
-int ldns_b32_ntop(uint8_t const *src, size_t srclength,
- char *target, size_t targsize);
-int b32_ntop(uint8_t const *src, size_t srclength,
- char *target, size_t targsize);
-int ldns_b32_ntop_extended_hex(uint8_t const *src, size_t srclength,
- char *target, size_t targsize);
-int b32_ntop_extended_hex(uint8_t const *src, size_t srclength,
- char *target, size_t targsize);
+
+INLINE time_t ldns_time(time_t *t) { return time(t); }
+
+
/**
* calculates the size needed to store the result of b32_ntop
*/
/*@unused@*/
-INLINE size_t ldns_b32_ntop_calculate_size(size_t srcsize)
+INLINE size_t ldns_b32_ntop_calculate_size(size_t src_data_length)
{
- size_t result = ((((srcsize / 5) * 8) - 2) + 2);
- return result;
+ return src_data_length == 0 ? 0 : ((src_data_length - 1) / 5 + 1) * 8;
+}
+
+INLINE size_t ldns_b32_ntop_calculate_size_no_padding(size_t src_data_length)
+{
+ return ((src_data_length + 3) * 8 / 5) - 4;
}
-#endif /* !B32_NTOP */
-#ifndef B32_PTON
-int ldns_b32_pton(char const *src, size_t hashed_owner_str_len, uint8_t *target, size_t targsize);
-int b32_pton(char const *src, size_t hashed_owner_str_len, uint8_t *target, size_t targsize);
-int ldns_b32_pton_extended_hex(char const *src, size_t hashed_owner_str_len, uint8_t *target, size_t targsize);
-int b32_pton_extended_hex(char const *src, size_t hashed_owner_str_len, uint8_t *target, size_t targsize);
+
+int ldns_b32_ntop(const uint8_t* src_data, size_t src_data_length,
+ char* target_text_buffer, size_t target_text_buffer_size);
+
+int ldns_b32_ntop_extended_hex(const uint8_t* src_data, size_t src_data_length,
+ char* target_text_buffer, size_t target_text_buffer_size);
+
+#if ! LDNS_BUILD_CONFIG_HAVE_B32_NTOP
+
+int b32_ntop(const uint8_t* src_data, size_t src_data_length,
+ char* target_text_buffer, size_t target_text_buffer_size);
+
+int b32_ntop_extended_hex(const uint8_t* src_data, size_t src_data_length,
+ char* target_text_buffer, size_t target_text_buffer_size);
+
+#endif /* ! LDNS_BUILD_CONFIG_HAVE_B32_NTOP */
+
+
/**
* calculates the size needed to store the result of b32_pton
*/
/*@unused@*/
-INLINE size_t ldns_b32_pton_calculate_size(size_t srcsize)
+INLINE size_t ldns_b32_pton_calculate_size(size_t src_text_length)
{
- size_t result = ((((srcsize) / 8) * 5));
- return result;
+ return src_text_length * 5 / 8;
}
-#endif /* !B32_PTON */
-INLINE time_t ldns_time(time_t *t) { return time(t); }
+int ldns_b32_pton(const char* src_text, size_t src_text_length,
+ uint8_t* target_data_buffer, size_t target_data_buffer_size);
+
+int ldns_b32_pton_extended_hex(const char* src_text, size_t src_text_length,
+ uint8_t* target_data_buffer, size_t target_data_buffer_size);
+
+#if ! LDNS_BUILD_CONFIG_HAVE_B32_PTON
+
+int b32_pton(const char* src_text, size_t src_text_length,
+ uint8_t* target_data_buffer, size_t target_data_buffer_size);
+
+int b32_pton_extended_hex(const char* src_text, size_t src_text_length,
+ uint8_t* target_data_buffer, size_t target_data_buffer_size);
+
+#endif /* ! LDNS_BUILD_CONFIG_HAVE_B32_PTON */
+
#ifdef __cplusplus
}
diff --git a/m4/libtool.m4 b/m4/libtool.m4
new file mode 100644
index 000000000000..828104cfde21
--- /dev/null
+++ b/m4/libtool.m4
@@ -0,0 +1,8001 @@
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+m4_define([_LT_COPYING], [dnl
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+])
+
+# serial 57 LT_INIT
+
+
+# LT_PREREQ(VERSION)
+# ------------------
+# Complain and exit if this libtool version is less that VERSION.
+m4_defun([LT_PREREQ],
+[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
+ [m4_default([$3],
+ [m4_fatal([Libtool version $1 or higher is required],
+ 63)])],
+ [$2])])
+
+
+# _LT_CHECK_BUILDDIR
+# ------------------
+# Complain if the absolute build directory name contains unusual characters
+m4_defun([_LT_CHECK_BUILDDIR],
+[case `pwd` in
+ *\ * | *\ *)
+ AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
+esac
+])
+
+
+# LT_INIT([OPTIONS])
+# ------------------
+AC_DEFUN([LT_INIT],
+[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
+AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+AC_BEFORE([$0], [LT_LANG])dnl
+AC_BEFORE([$0], [LT_OUTPUT])dnl
+AC_BEFORE([$0], [LTDL_INIT])dnl
+m4_require([_LT_CHECK_BUILDDIR])dnl
+
+dnl Autoconf doesn't catch unexpanded LT_ macros by default:
+m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
+m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
+dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
+dnl unless we require an AC_DEFUNed macro:
+AC_REQUIRE([LTOPTIONS_VERSION])dnl
+AC_REQUIRE([LTSUGAR_VERSION])dnl
+AC_REQUIRE([LTVERSION_VERSION])dnl
+AC_REQUIRE([LTOBSOLETE_VERSION])dnl
+m4_require([_LT_PROG_LTMAIN])dnl
+
+_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
+
+dnl Parse OPTIONS
+_LT_SET_OPTIONS([$0], [$1])
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+_LT_SETUP
+
+# Only expand once:
+m4_define([LT_INIT])
+])# LT_INIT
+
+# Old names:
+AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
+AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
+dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
+m4_defun([_LT_CC_BASENAME],
+[for cc_temp in $1""; do
+ case $cc_temp in
+ compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+ distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+])
+
+
+# _LT_FILEUTILS_DEFAULTS
+# ----------------------
+# It is okay to use these file commands and assume they have been set
+# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
+m4_defun([_LT_FILEUTILS_DEFAULTS],
+[: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+])# _LT_FILEUTILS_DEFAULTS
+
+
+# _LT_SETUP
+# ---------
+m4_defun([_LT_SETUP],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
+
+_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
+dnl
+_LT_DECL([], [host_alias], [0], [The host system])dnl
+_LT_DECL([], [host], [0])dnl
+_LT_DECL([], [host_os], [0])dnl
+dnl
+_LT_DECL([], [build_alias], [0], [The build system])dnl
+_LT_DECL([], [build], [0])dnl
+_LT_DECL([], [build_os], [0])dnl
+dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+test -z "$LN_S" && LN_S="ln -s"
+_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
+dnl
+AC_REQUIRE([LT_CMD_MAX_LEN])dnl
+_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
+_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
+dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
+m4_require([_LT_CMD_RELOAD])dnl
+m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
+m4_require([_LT_CMD_OLD_ARCHIVE])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_WITH_SYSROOT])dnl
+
+_LT_CONFIG_LIBTOOL_INIT([
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+])
+if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+_LT_CHECK_OBJDIR
+
+m4_require([_LT_TAG_COMPILER])dnl
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ _LT_PATH_MAGIC
+ fi
+ ;;
+esac
+
+# Use C for the default configuration in the libtool script
+LT_SUPPORTED_TAG([CC])
+_LT_LANG_C_CONFIG
+_LT_LANG_DEFAULT_CONFIG
+_LT_CONFIG_COMMANDS
+])# _LT_SETUP
+
+
+# _LT_PREPARE_SED_QUOTE_VARS
+# --------------------------
+# Define a few sed substitution that help us do robust quoting.
+m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
+[# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([["`\\]]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+])
+
+# _LT_PROG_LTMAIN
+# ---------------
+# Note that this code is called both from `configure', and `config.status'
+# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
+# `config.status' has no value for ac_aux_dir unless we are using Automake,
+# so we pass a copy along to make sure it has a sensible value anyway.
+m4_defun([_LT_PROG_LTMAIN],
+[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
+_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
+ltmain="$ac_aux_dir/ltmain.sh"
+])# _LT_PROG_LTMAIN
+
+
+## ------------------------------------- ##
+## Accumulate code for creating libtool. ##
+## ------------------------------------- ##
+
+# So that we can recreate a full libtool script including additional
+# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
+# in macros and then make a single call at the end using the `libtool'
+# label.
+
+
+# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
+# ----------------------------------------
+# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL_INIT],
+[m4_ifval([$1],
+ [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
+ [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_INIT])
+
+
+# _LT_CONFIG_LIBTOOL([COMMANDS])
+# ------------------------------
+# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL],
+[m4_ifval([$1],
+ [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
+ [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
+
+
+# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
+# -----------------------------------------------------
+m4_defun([_LT_CONFIG_SAVE_COMMANDS],
+[_LT_CONFIG_LIBTOOL([$1])
+_LT_CONFIG_LIBTOOL_INIT([$2])
+])
+
+
+# _LT_FORMAT_COMMENT([COMMENT])
+# -----------------------------
+# Add leading comment marks to the start of each line, and a trailing
+# full-stop to the whole comment if one is not present already.
+m4_define([_LT_FORMAT_COMMENT],
+[m4_ifval([$1], [
+m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
+ [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
+)])
+
+
+
+## ------------------------ ##
+## FIXME: Eliminate VARNAME ##
+## ------------------------ ##
+
+
+# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
+# -------------------------------------------------------------------
+# CONFIGNAME is the name given to the value in the libtool script.
+# VARNAME is the (base) name used in the configure script.
+# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
+# VARNAME. Any other value will be used directly.
+m4_define([_LT_DECL],
+[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
+ [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
+ [m4_ifval([$1], [$1], [$2])])
+ lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
+ m4_ifval([$4],
+ [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
+ lt_dict_add_subkey([lt_decl_dict], [$2],
+ [tagged?], [m4_ifval([$5], [yes], [no])])])
+])
+
+
+# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
+# --------------------------------------------------------
+m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
+
+
+# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_tag_varnames],
+[_lt_decl_filter([tagged?], [yes], $@)])
+
+
+# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
+# ---------------------------------------------------------
+m4_define([_lt_decl_filter],
+[m4_case([$#],
+ [0], [m4_fatal([$0: too few arguments: $#])],
+ [1], [m4_fatal([$0: too few arguments: $#: $1])],
+ [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
+ [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
+ [lt_dict_filter([lt_decl_dict], $@)])[]dnl
+])
+
+
+# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
+# --------------------------------------------------
+m4_define([lt_decl_quote_varnames],
+[_lt_decl_filter([value], [1], $@)])
+
+
+# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_dquote_varnames],
+[_lt_decl_filter([value], [2], $@)])
+
+
+# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_varnames_tagged],
+[m4_assert([$# <= 2])dnl
+_$0(m4_quote(m4_default([$1], [[, ]])),
+ m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
+ m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
+m4_define([_lt_decl_varnames_tagged],
+[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
+
+
+# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_all_varnames],
+[_$0(m4_quote(m4_default([$1], [[, ]])),
+ m4_if([$2], [],
+ m4_quote(lt_decl_varnames),
+ m4_quote(m4_shift($@))))[]dnl
+])
+m4_define([_lt_decl_all_varnames],
+[lt_join($@, lt_decl_varnames_tagged([$1],
+ lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
+])
+
+
+# _LT_CONFIG_STATUS_DECLARE([VARNAME])
+# ------------------------------------
+# Quote a variable value, and forward it to `config.status' so that its
+# declaration there will have the same value as in `configure'. VARNAME
+# must have a single quote delimited value for this to work.
+m4_define([_LT_CONFIG_STATUS_DECLARE],
+[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
+
+
+# _LT_CONFIG_STATUS_DECLARATIONS
+# ------------------------------
+# We delimit libtool config variables with single quotes, so when
+# we write them to config.status, we have to be sure to quote all
+# embedded single quotes properly. In configure, this macro expands
+# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
+#
+# <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
+m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
+ [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAGS
+# ----------------
+# Output comment and list of tags supported by the script
+m4_defun([_LT_LIBTOOL_TAGS],
+[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
+available_tags="_LT_TAGS"dnl
+])
+
+
+# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
+# -----------------------------------
+# Extract the dictionary values for VARNAME (optionally with TAG) and
+# expand to a commented shell variable setting:
+#
+# # Some comment about what VAR is for.
+# visible_name=$lt_internal_name
+m4_define([_LT_LIBTOOL_DECLARE],
+[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
+ [description])))[]dnl
+m4_pushdef([_libtool_name],
+ m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
+m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
+ [0], [_libtool_name=[$]$1],
+ [1], [_libtool_name=$lt_[]$1],
+ [2], [_libtool_name=$lt_[]$1],
+ [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
+m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
+])
+
+
+# _LT_LIBTOOL_CONFIG_VARS
+# -----------------------
+# Produce commented declarations of non-tagged libtool config variables
+# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
+# script. Tagged libtool config variables (even for the LIBTOOL CONFIG
+# section) are produced by _LT_LIBTOOL_TAG_VARS.
+m4_defun([_LT_LIBTOOL_CONFIG_VARS],
+[m4_foreach([_lt_var],
+ m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAG_VARS(TAG)
+# -------------------------
+m4_define([_LT_LIBTOOL_TAG_VARS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
+
+
+# _LT_TAGVAR(VARNAME, [TAGNAME])
+# ------------------------------
+m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
+
+
+# _LT_CONFIG_COMMANDS
+# -------------------
+# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
+# variables for single and double quote escaping we saved from calls
+# to _LT_DECL, we can put quote escaped variables declarations
+# into `config.status', and then the shell code to quote escape them in
+# for loops in `config.status'. Finally, any additional code accumulated
+# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
+m4_defun([_LT_CONFIG_COMMANDS],
+[AC_PROVIDE_IFELSE([LT_OUTPUT],
+ dnl If the libtool generation code has been placed in $CONFIG_LT,
+ dnl instead of duplicating it all over again into config.status,
+ dnl then we will have config.status run $CONFIG_LT later, so it
+ dnl needs to know what name is stored there:
+ [AC_CONFIG_COMMANDS([libtool],
+ [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
+ dnl If the libtool generation code is destined for config.status,
+ dnl expand the accumulated commands and init code now:
+ [AC_CONFIG_COMMANDS([libtool],
+ [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
+])#_LT_CONFIG_COMMANDS
+
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
+[
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+_LT_CONFIG_STATUS_DECLARATIONS
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+\$[]1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_quote_varnames); do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Double-quote double-evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_dquote_varnames); do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+_LT_OUTPUT_LIBTOOL_INIT
+])
+
+# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
+# ------------------------------------
+# Generate a child script FILE with all initialization necessary to
+# reuse the environment learned by the parent script, and make the
+# file executable. If COMMENT is supplied, it is inserted after the
+# `#!' sequence but before initialization text begins. After this
+# macro, additional text can be appended to FILE to form the body of
+# the child script. The macro ends with non-zero status if the
+# file could not be fully written (such as if the disk is full).
+m4_ifdef([AS_INIT_GENERATED],
+[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
+[m4_defun([_LT_GENERATED_FILE_INIT],
+[m4_require([AS_PREPARE])]dnl
+[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
+[lt_write_fail=0
+cat >$1 <<_ASEOF || lt_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+$2
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$1 <<\_ASEOF || lt_write_fail=1
+AS_SHELL_SANITIZE
+_AS_PREPARE
+exec AS_MESSAGE_FD>&1
+_ASEOF
+test $lt_write_fail = 0 && chmod +x $1[]dnl
+m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
+
+# LT_OUTPUT
+# ---------
+# This macro allows early generation of the libtool script (before
+# AC_OUTPUT is called), incase it is used in configure for compilation
+# tests.
+AC_DEFUN([LT_OUTPUT],
+[: ${CONFIG_LT=./config.lt}
+AC_MSG_NOTICE([creating $CONFIG_LT])
+_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
+[# Run this file to recreate a libtool stub with the current configuration.])
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+lt_cl_silent=false
+exec AS_MESSAGE_LOG_FD>>config.log
+{
+ echo
+ AS_BOX([Running $as_me.])
+} >&AS_MESSAGE_LOG_FD
+
+lt_cl_help="\
+\`$as_me' creates a local libtool stub from the current configuration,
+for use in further configure time tests before the real libtool is
+generated.
+
+Usage: $[0] [[OPTIONS]]
+
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -q, --quiet do not print progress messages
+ -d, --debug don't remove temporary files
+
+Report bugs to <bug-libtool@gnu.org>."
+
+lt_cl_version="\
+m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
+m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
+configured by $[0], generated by m4_PACKAGE_STRING.
+
+Copyright (C) 2011 Free Software Foundation, Inc.
+This config.lt script is free software; the Free Software Foundation
+gives unlimited permision to copy, distribute and modify it."
+
+while test $[#] != 0
+do
+ case $[1] in
+ --version | --v* | -V )
+ echo "$lt_cl_version"; exit 0 ;;
+ --help | --h* | -h )
+ echo "$lt_cl_help"; exit 0 ;;
+ --debug | --d* | -d )
+ debug=: ;;
+ --quiet | --q* | --silent | --s* | -q )
+ lt_cl_silent=: ;;
+
+ -*) AC_MSG_ERROR([unrecognized option: $[1]
+Try \`$[0] --help' for more information.]) ;;
+
+ *) AC_MSG_ERROR([unrecognized argument: $[1]
+Try \`$[0] --help' for more information.]) ;;
+ esac
+ shift
+done
+
+if $lt_cl_silent; then
+ exec AS_MESSAGE_FD>/dev/null
+fi
+_LTEOF
+
+cat >>"$CONFIG_LT" <<_LTEOF
+_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AC_MSG_NOTICE([creating $ofile])
+_LT_OUTPUT_LIBTOOL_COMMANDS
+AS_EXIT(0)
+_LTEOF
+chmod +x "$CONFIG_LT"
+
+# configure is writing to config.log, but config.lt does its own redirection,
+# appending to config.log, which fails on DOS, as config.log is still kept
+# open by configure. Here we exec the FD to /dev/null, effectively closing
+# config.log, so it can be properly (re)opened and appended to by config.lt.
+lt_cl_success=:
+test "$silent" = yes &&
+ lt_config_lt_args="$lt_config_lt_args --quiet"
+exec AS_MESSAGE_LOG_FD>/dev/null
+$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+exec AS_MESSAGE_LOG_FD>>config.log
+$lt_cl_success || AS_EXIT(1)
+])# LT_OUTPUT
+
+
+# _LT_CONFIG(TAG)
+# ---------------
+# If TAG is the built-in tag, create an initial libtool script with a
+# default configuration from the untagged config vars. Otherwise add code
+# to config.status for appending the configuration named by TAG from the
+# matching tagged config vars.
+m4_defun([_LT_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_CONFIG_SAVE_COMMANDS([
+ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
+ m4_if(_LT_TAG, [C], [
+ # See if we are running on zsh, and set the options which allow our
+ # commands through without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+
+ cfgfile="${ofile}T"
+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+ $RM "$cfgfile"
+
+ cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+_LT_COPYING
+_LT_LIBTOOL_TAGS
+
+# ### BEGIN LIBTOOL CONFIG
+_LT_LIBTOOL_CONFIG_VARS
+_LT_LIBTOOL_TAG_VARS
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+ case $host_os in
+ aix3*)
+ cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+_LT_EOF
+ ;;
+ esac
+
+ _LT_PROG_LTMAIN
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ _LT_PROG_REPLACE_SHELLFNS
+
+ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+],
+[cat <<_LT_EOF >> "$ofile"
+
+dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
+dnl in a comment (ie after a #).
+# ### BEGIN LIBTOOL TAG CONFIG: $1
+_LT_LIBTOOL_TAG_VARS(_LT_TAG)
+# ### END LIBTOOL TAG CONFIG: $1
+_LT_EOF
+])dnl /m4_if
+],
+[m4_if([$1], [], [
+ PACKAGE='$PACKAGE'
+ VERSION='$VERSION'
+ TIMESTAMP='$TIMESTAMP'
+ RM='$RM'
+ ofile='$ofile'], [])
+])dnl /_LT_CONFIG_SAVE_COMMANDS
+])# _LT_CONFIG
+
+
+# LT_SUPPORTED_TAG(TAG)
+# ---------------------
+# Trace this macro to discover what tags are supported by the libtool
+# --tag option, using:
+# autoconf --trace 'LT_SUPPORTED_TAG:$1'
+AC_DEFUN([LT_SUPPORTED_TAG], [])
+
+
+# C support is built-in for now
+m4_define([_LT_LANG_C_enabled], [])
+m4_define([_LT_TAGS], [])
+
+
+# LT_LANG(LANG)
+# -------------
+# Enable libtool support for the given language if not already enabled.
+AC_DEFUN([LT_LANG],
+[AC_BEFORE([$0], [LT_OUTPUT])dnl
+m4_case([$1],
+ [C], [_LT_LANG(C)],
+ [C++], [_LT_LANG(CXX)],
+ [Go], [_LT_LANG(GO)],
+ [Java], [_LT_LANG(GCJ)],
+ [Fortran 77], [_LT_LANG(F77)],
+ [Fortran], [_LT_LANG(FC)],
+ [Windows Resource], [_LT_LANG(RC)],
+ [m4_ifdef([_LT_LANG_]$1[_CONFIG],
+ [_LT_LANG($1)],
+ [m4_fatal([$0: unsupported language: "$1"])])])dnl
+])# LT_LANG
+
+
+# _LT_LANG(LANGNAME)
+# ------------------
+m4_defun([_LT_LANG],
+[m4_ifdef([_LT_LANG_]$1[_enabled], [],
+ [LT_SUPPORTED_TAG([$1])dnl
+ m4_append([_LT_TAGS], [$1 ])dnl
+ m4_define([_LT_LANG_]$1[_enabled], [])dnl
+ _LT_LANG_$1_CONFIG($1)])dnl
+])# _LT_LANG
+
+
+m4_ifndef([AC_PROG_GO], [
+############################################################
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_GO. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+############################################################
+m4_defun([AC_PROG_GO],
+[AC_LANG_PUSH(Go)dnl
+AC_ARG_VAR([GOC], [Go compiler command])dnl
+AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
+_AC_ARG_VAR_LDFLAGS()dnl
+AC_CHECK_TOOL(GOC, gccgo)
+if test -z "$GOC"; then
+ if test -n "$ac_tool_prefix"; then
+ AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
+ fi
+fi
+if test -z "$GOC"; then
+ AC_CHECK_PROG(GOC, gccgo, gccgo, false)
+fi
+])#m4_defun
+])#m4_ifndef
+
+
+# _LT_LANG_DEFAULT_CONFIG
+# -----------------------
+m4_defun([_LT_LANG_DEFAULT_CONFIG],
+[AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [LT_LANG(CXX)],
+ [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_F77],
+ [LT_LANG(F77)],
+ [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_FC],
+ [LT_LANG(FC)],
+ [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
+
+dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
+dnl pulling things in needlessly.
+AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [m4_ifdef([AC_PROG_GCJ],
+ [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
+ m4_ifdef([A][M_PROG_GCJ],
+ [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
+ m4_ifdef([LT_PROG_GCJ],
+ [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
+
+AC_PROVIDE_IFELSE([AC_PROG_GO],
+ [LT_LANG(GO)],
+ [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
+
+AC_PROVIDE_IFELSE([LT_PROG_RC],
+ [LT_LANG(RC)],
+ [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
+])# _LT_LANG_DEFAULT_CONFIG
+
+# Obsolete macros:
+AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
+AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
+AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
+AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
+AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
+dnl AC_DEFUN([AC_LIBTOOL_F77], [])
+dnl AC_DEFUN([AC_LIBTOOL_FC], [])
+dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
+dnl AC_DEFUN([AC_LIBTOOL_RC], [])
+
+
+# _LT_TAG_COMPILER
+# ----------------
+m4_defun([_LT_TAG_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
+_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
+_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
+_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_TAG_COMPILER
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+m4_defun([_LT_COMPILER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+])# _LT_COMPILER_BOILERPLATE
+
+
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+m4_defun([_LT_LINKER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+])# _LT_LINKER_BOILERPLATE
+
+# _LT_REQUIRED_DARWIN_CHECKS
+# -------------------------
+m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
+ case $host_os in
+ rhapsody* | darwin*)
+ AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
+ AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
+ AC_CHECK_TOOL([LIPO], [lipo], [:])
+ AC_CHECK_TOOL([OTOOL], [otool], [:])
+ AC_CHECK_TOOL([OTOOL64], [otool64], [:])
+ _LT_DECL([], [DSYMUTIL], [1],
+ [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
+ _LT_DECL([], [NMEDIT], [1],
+ [Tool to change global to local symbols on Mac OS X])
+ _LT_DECL([], [LIPO], [1],
+ [Tool to manipulate fat objects and archives on Mac OS X])
+ _LT_DECL([], [OTOOL], [1],
+ [ldd/readelf like tool for Mach-O binaries on Mac OS X])
+ _LT_DECL([], [OTOOL64], [1],
+ [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
+
+ AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
+ [lt_cv_apple_cc_single_mod=no
+ if test -z "${LT_MULTI_MODULE}"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ rm -rf libconftest.dylib*
+ echo "int foo(void){return 1;}" > conftest.c
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+ _lt_result=$?
+ # If there is a non-empty error log, and "single_module"
+ # appears in it, assume the flag caused a linker warning
+ if test -s conftest.err && $GREP single_module conftest.err; then
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ # Otherwise, if the output was created with a 0 exit code from
+ # the compiler, it worked.
+ elif test -f libconftest.dylib && test $_lt_result -eq 0; then
+ lt_cv_apple_cc_single_mod=yes
+ else
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ fi
+ rm -rf libconftest.dylib*
+ rm -f conftest.*
+ fi])
+
+ AC_CACHE_CHECK([for -exported_symbols_list linker flag],
+ [lt_cv_ld_exported_symbols_list],
+ [lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [lt_cv_ld_exported_symbols_list=yes],
+ [lt_cv_ld_exported_symbols_list=no])
+ LDFLAGS="$save_LDFLAGS"
+ ])
+
+ AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
+ [lt_cv_ld_force_load=no
+ cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
+ echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
+ $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
+ echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
+ $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
+ cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+ _lt_result=$?
+ if test -s conftest.err && $GREP force_load conftest.err; then
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
+ lt_cv_ld_force_load=yes
+ else
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ fi
+ rm -f conftest.err libconftest.a conftest conftest.c
+ rm -rf conftest.dSYM
+ ])
+ case $host_os in
+ rhapsody* | darwin1.[[012]])
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ darwin*) # darwin 5.x on
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ 10.[[012]]*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+ else
+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+ _lt_dsymutil='~$DSYMUTIL $lib || :'
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+])
+
+
+# _LT_DARWIN_LINKER_FEATURES([TAG])
+# ---------------------------------
+# Checks for linker and compiler features on darwin
+m4_defun([_LT_DARWIN_LINKER_FEATURES],
+[
+ m4_require([_LT_REQUIRED_DARWIN_CHECKS])
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ if test "$lt_cv_ld_force_load" = "yes"; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+ m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
+ [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes])
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+ fi
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+ case $cc_basename in
+ ifort*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test "$_lt_dar_can_shared" = "yes"; then
+ output_verbose_link_cmd=func_echo_all
+ _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+ m4_if([$1], [CXX],
+[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+ _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+ fi
+],[])
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+])
+
+# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
+# ----------------------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+# Store the results from the different compilers for each TAGNAME.
+# Allow to override them for all tags through lt_cv_aix_libpath.
+m4_defun([_LT_SYS_MODULE_PATH_AIX],
+[m4_require([_LT_DECL_SED])dnl
+if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
+ lt_aix_libpath_sed='[
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }]'
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi],[])
+ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
+ fi
+ ])
+ aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
+fi
+])# _LT_SYS_MODULE_PATH_AIX
+
+
+# _LT_SHELL_INIT(ARG)
+# -------------------
+m4_define([_LT_SHELL_INIT],
+[m4_divert_text([M4SH-INIT], [$1
+])])# _LT_SHELL_INIT
+
+
+
+# _LT_PROG_ECHO_BACKSLASH
+# -----------------------
+# Find how we can fake an echo command that does not interpret backslash.
+# In particular, with Autoconf 2.60 or later we add some code to the start
+# of the generated configure script which will find a shell with a builtin
+# printf (which we can use as an echo command).
+m4_defun([_LT_PROG_ECHO_BACKSLASH],
+[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+AC_MSG_CHECKING([how to print strings])
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='printf %s\n'
+else
+ # Use this function as a fallback that always works.
+ func_fallback_echo ()
+ {
+ eval 'cat <<_LTECHO_EOF
+$[]1
+_LTECHO_EOF'
+ }
+ ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+ $ECHO "$*"
+}
+
+case "$ECHO" in
+ printf*) AC_MSG_RESULT([printf]) ;;
+ print*) AC_MSG_RESULT([print -r]) ;;
+ *) AC_MSG_RESULT([cat]) ;;
+esac
+
+m4_ifdef([_AS_DETECT_SUGGESTED],
+[_AS_DETECT_SUGGESTED([
+ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
+ ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+ PATH=/empty FPATH=/empty; export PATH FPATH
+ test "X`printf %s $ECHO`" = "X$ECHO" \
+ || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
+
+_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
+_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
+])# _LT_PROG_ECHO_BACKSLASH
+
+
+# _LT_WITH_SYSROOT
+# ----------------
+AC_DEFUN([_LT_WITH_SYSROOT],
+[AC_MSG_CHECKING([for sysroot])
+AC_ARG_WITH([sysroot],
+[ --with-sysroot[=DIR] Search for dependent libraries within DIR
+ (or the compiler's sysroot if not specified).],
+[], [with_sysroot=no])
+
+dnl lt_sysroot will always be passed unquoted. We quote it here
+dnl in case the user passed a directory name.
+lt_sysroot=
+case ${with_sysroot} in #(
+ yes)
+ if test "$GCC" = yes; then
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ fi
+ ;; #(
+ /*)
+ lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+ ;; #(
+ no|'')
+ ;; #(
+ *)
+ AC_MSG_RESULT([${with_sysroot}])
+ AC_MSG_ERROR([The sysroot must be an absolute path.])
+ ;;
+esac
+
+ AC_MSG_RESULT([${lt_sysroot:-no}])
+_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
+[dependent libraries, and in which our libraries should be installed.])])
+
+# _LT_ENABLE_LOCK
+# ---------------
+m4_defun([_LT_ENABLE_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+ [AS_HELP_STRING([--disable-libtool-lock],
+ [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.o` in
+ *32-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*|s390*-*tpf*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+ [AC_LANG_PUSH(C)
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+ AC_LANG_POP])
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+*-*solaris*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.o` in
+ *64-bit*)
+ case $lt_cv_prog_gnu_ld in
+ yes*)
+ case $host in
+ i?86-*-solaris*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ sparc*-*-solaris*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
+ if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
+ LD="${LD-ld}_sol2"
+ fi
+ ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+esac
+
+need_locks="$enable_libtool_lock"
+])# _LT_ENABLE_LOCK
+
+
+# _LT_PROG_AR
+# -----------
+m4_defun([_LT_PROG_AR],
+[AC_CHECK_TOOLS(AR, [ar], false)
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+_LT_DECL([], [AR], [1], [The archiver])
+_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
+
+AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
+ [lt_cv_ar_at_file=no
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
+ [echo conftest.$ac_objext > conftest.lst
+ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
+ AC_TRY_EVAL([lt_ar_try])
+ if test "$ac_status" -eq 0; then
+ # Ensure the archiver fails upon bogus file names.
+ rm -f conftest.$ac_objext libconftest.a
+ AC_TRY_EVAL([lt_ar_try])
+ if test "$ac_status" -ne 0; then
+ lt_cv_ar_at_file=@
+ fi
+ fi
+ rm -f conftest.* libconftest.a
+ ])
+ ])
+
+if test "x$lt_cv_ar_at_file" = xno; then
+ archiver_list_spec=
+else
+ archiver_list_spec=$lt_cv_ar_at_file
+fi
+_LT_DECL([], [archiver_list_spec], [1],
+ [How to feed a file listing to the archiver])
+])# _LT_PROG_AR
+
+
+# _LT_CMD_OLD_ARCHIVE
+# -------------------
+m4_defun([_LT_CMD_OLD_ARCHIVE],
+[_LT_PROG_AR
+
+AC_CHECK_TOOL(STRIP, strip, :)
+test -z "$STRIP" && STRIP=:
+_LT_DECL([], [STRIP], [1], [A symbol stripping program])
+
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+test -z "$RANLIB" && RANLIB=:
+_LT_DECL([], [RANLIB], [1],
+ [Commands used to install an old-style archive])
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
+fi
+
+case $host_os in
+ darwin*)
+ lock_old_archive_extraction=yes ;;
+ *)
+ lock_old_archive_extraction=no ;;
+esac
+_LT_DECL([], [old_postinstall_cmds], [2])
+_LT_DECL([], [old_postuninstall_cmds], [2])
+_LT_TAGDECL([], [old_archive_cmds], [2],
+ [Commands used to build an old-style archive])
+_LT_DECL([], [lock_old_archive_extraction], [0],
+ [Whether to use a lock for old archive extraction])
+])# _LT_CMD_OLD_ARCHIVE
+
+
+# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([_LT_COMPILER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$3"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ fi
+ $RM conftest*
+])
+
+if test x"[$]$2" = xyes; then
+ m4_if([$5], , :, [$5])
+else
+ m4_if([$6], , :, [$6])
+fi
+])# _LT_COMPILER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
+
+
+# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------
+# Check whether the given linker option works
+AC_DEFUN([_LT_LINKER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $3"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&AS_MESSAGE_LOG_FD
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ else
+ $2=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+])
+
+if test x"[$]$2" = xyes; then
+ m4_if([$4], , :, [$4])
+else
+ m4_if([$5], , :, [$5])
+fi
+])# _LT_LINKER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
+
+
+# LT_CMD_MAX_LEN
+#---------------
+AC_DEFUN([LT_CMD_MAX_LEN],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+ i=0
+ teststring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw* | cegcc*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ mint*)
+ # On MiNT this can take a long time and run out of memory.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+
+ interix*)
+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
+ lt_cv_sys_max_cmd_len=196608
+ ;;
+
+ os2*)
+ # The test takes a long time on OS/2.
+ lt_cv_sys_max_cmd_len=8192
+ ;;
+
+ osf*)
+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+ # nice to cause kernel panics so lets avoid the loop below.
+ # First set a reasonable default.
+ lt_cv_sys_max_cmd_len=16384
+ #
+ if test -x /sbin/sysconfig; then
+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+ *1*) lt_cv_sys_max_cmd_len=-1 ;;
+ esac
+ fi
+ ;;
+ sco3.2v5*)
+ lt_cv_sys_max_cmd_len=102400
+ ;;
+ sysv5* | sco5v6* | sysv4.2uw2*)
+ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+ if test -n "$kargmax"; then
+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
+ else
+ lt_cv_sys_max_cmd_len=32768
+ fi
+ ;;
+ *)
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ # Make teststring a little bigger before we do anything with it.
+ # a 1K string should be a reasonable start.
+ for i in 1 2 3 4 5 6 7 8 ; do
+ teststring=$teststring$teststring
+ done
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
+ = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ # Only check the string length outside the loop.
+ lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on
+ # massive amounts of additional arguments before passing them to the
+ # linker. It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
+ ;;
+ esac
+])
+if test -n $lt_cv_sys_max_cmd_len ; then
+ AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+ AC_MSG_RESULT(none)
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+_LT_DECL([], [max_cmd_len], [0],
+ [What is the maximum length of a command?])
+])# LT_CMD_MAX_LEN
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
+
+
+# _LT_HEADER_DLFCN
+# ----------------
+m4_defun([_LT_HEADER_DLFCN],
+[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
+])# _LT_HEADER_DLFCN
+
+
+# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ----------------------------------------------------------------
+m4_defun([_LT_TRY_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "$cross_compiling" = yes; then :
+ [$4]
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+[#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}]
+_LT_EOF
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) $1 ;;
+ x$lt_dlneed_uscore) $2 ;;
+ x$lt_dlunknown|x*) $3 ;;
+ esac
+ else :
+ # compilation failed
+ $3
+ fi
+fi
+rm -fr conftest*
+])# _LT_TRY_DLOPEN_SELF
+
+
+# LT_SYS_DLOPEN_SELF
+# ------------------
+AC_DEFUN([LT_SYS_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32* | cegcc*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ])
+ ;;
+
+ *)
+ AC_CHECK_FUNC([shl_load],
+ [lt_cv_dlopen="shl_load"],
+ [AC_CHECK_LIB([dld], [shl_load],
+ [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
+ [AC_CHECK_FUNC([dlopen],
+ [lt_cv_dlopen="dlopen"],
+ [AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+ [AC_CHECK_LIB([svld], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+ [AC_CHECK_LIB([dld], [dld_link],
+ [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
+ ])
+ ])
+ ])
+ ])
+ ])
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ AC_CACHE_CHECK([whether a program can dlopen itself],
+ lt_cv_dlopen_self, [dnl
+ _LT_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+ lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+ ])
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+ AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+ lt_cv_dlopen_self_static, [dnl
+ _LT_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+ lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
+ ])
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+_LT_DECL([dlopen_support], [enable_dlopen], [0],
+ [Whether dlopen is supported])
+_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
+ [Whether dlopen of programs is supported])
+_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
+ [Whether dlopen of statically linked programs is supported])
+])# LT_SYS_DLOPEN_SELF
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
+
+
+# _LT_COMPILER_C_O([TAGNAME])
+# ---------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler.
+# This macro does not hard code the compiler like AC_PROG_CC_C_O.
+m4_defun([_LT_COMPILER_C_O],
+[m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+ fi
+ fi
+ chmod u+w . 2>&AS_MESSAGE_LOG_FD
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+])
+_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
+ [Does compiler simultaneously support -c and -o options?])
+])# _LT_COMPILER_C_O
+
+
+# _LT_COMPILER_FILE_LOCKS([TAGNAME])
+# ----------------------------------
+# Check to see if we can do hard links to lock some files if needed
+m4_defun([_LT_COMPILER_FILE_LOCKS],
+[m4_require([_LT_ENABLE_LOCK])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_COMPILER_C_O([$1])
+
+hard_links="nottested"
+if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ AC_MSG_CHECKING([if we can lock with hard links])
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ AC_MSG_RESULT([$hard_links])
+ if test "$hard_links" = no; then
+ AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
+])# _LT_COMPILER_FILE_LOCKS
+
+
+# _LT_CHECK_OBJDIR
+# ----------------
+m4_defun([_LT_CHECK_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+_LT_DECL([], [objdir], [0],
+ [The name of the directory that contains temporary libtool files])dnl
+m4_pattern_allow([LT_OBJDIR])dnl
+AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
+ [Define to the sub-directory in which libtool stores uninstalled libraries.])
+])# _LT_CHECK_OBJDIR
+
+
+# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
+# --------------------------------------
+# Check hardcoding attributes.
+m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
+ test -n "$_LT_TAGVAR(runpath_var, $1)" ||
+ test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+
+ # We can hardcode non-existent directories.
+ if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+ test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
+ # Linking always hardcodes the temporary library directory.
+ _LT_TAGVAR(hardcode_action, $1)=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ _LT_TAGVAR(hardcode_action, $1)=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ _LT_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
+ test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+_LT_TAGDECL([], [hardcode_action], [0],
+ [How to hardcode a shared library path into an executable])
+])# _LT_LINKER_HARDCODE_LIBPATH
+
+
+# _LT_CMD_STRIPLIB
+# ----------------
+m4_defun([_LT_CMD_STRIPLIB],
+[m4_require([_LT_DECL_EGREP])
+striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ ;;
+ *)
+ AC_MSG_RESULT([no])
+ ;;
+ esac
+fi
+_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
+_LT_DECL([], [striplib], [1])
+])# _LT_CMD_STRIPLIB
+
+
+# _LT_SYS_DYNAMIC_LINKER([TAG])
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+m4_defun([_LT_SYS_DYNAMIC_LINKER],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_OBJDUMP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+AC_MSG_CHECKING([dynamic linker characteristics])
+m4_if([$1],
+ [], [
+if test "$GCC" = yes; then
+ case $host_os in
+ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+ *) lt_awk_arg="/^libraries:/" ;;
+ esac
+ case $host_os in
+ mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
+ *) lt_sed_strip_eq="s,=/,/,g" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+ case $lt_search_path_spec in
+ *\;*)
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+ ;;
+ *)
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ esac
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary.
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+ else
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+ lt_foo="";
+ lt_count=0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo="/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[[lt_foo]]++; }
+ if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
+}'`
+ # AWK program above erroneously prepends '/' to C:/dos/paths
+ # for these hosts.
+ case $host_os in
+ mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
+ esac
+ sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix[[4-9]]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[[01]] | aix4.[[01]].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[[45]]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$cc_basename in
+ yes,*)
+ # gcc
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+m4_if([$1], [],[
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
+ ;;
+ mingw* | cegcc*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ ;;
+
+ *,cl*)
+ # Native MSVC
+ libname_spec='$name'
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ library_names_spec='${libname}.dll.lib'
+
+ case $build_os in
+ mingw*)
+ sys_lib_search_path_spec=
+ lt_save_ifs=$IFS
+ IFS=';'
+ for lt_path in $LIB
+ do
+ IFS=$lt_save_ifs
+ # Let DOS variable expansion print the short 8.3 style file name.
+ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+ done
+ IFS=$lt_save_ifs
+ # Convert to MSYS style.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
+ ;;
+ cygwin*)
+ # Convert to unix form, then to dos form, then back to unix form
+ # but this time dos style (no spaces!) so that the unix form looks
+ # like /cygdrive/c/PROGRA~1:/cygdr...
+ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ *)
+ sys_lib_search_path_spec="$LIB"
+ if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
+ # It is most probably a Windows format PATH.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # FIXME: find the short name or the path components, as spaces are
+ # common. (e.g. "Program Files" -> "PROGRA~1")
+ ;;
+ esac
+
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+ dynamic_linker='Win32 link.exe'
+ ;;
+
+ *)
+ # Assume MSVC wrapper
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ dynamic_linker='Win32 ld.exe'
+ ;;
+ esac
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+m4_if([$1], [],[
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ 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
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[[23]].*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2.*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[[01]]* | freebsdelf3.[[01]]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
+ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ 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
+ ;;
+
+haiku*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os runtime_loader"
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+ postinstall_cmds='chmod 555 $lib'
+ # or fails outright, so override atomically:
+ install_override_mode=555
+ ;;
+
+interix[[3-9]]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux # correct to gnu/linux during the next big refactor
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+
+ # Some binutils ld are patched to set DT_RUNPATH
+ AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
+ [lt_cv_shlibpath_overrides_runpath=no
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
+ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
+ [lt_cv_shlibpath_overrides_runpath=yes])])
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+ ])
+ shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # 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="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+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
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+*nto* | *qnx*)
+ version_type=qnx
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[[89]] | openbsd2.[[89]].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+_LT_DECL([], [variables_saved_for_relink], [1],
+ [Variables whose values should be saved in libtool wrapper scripts and
+ restored at link time])
+_LT_DECL([], [need_lib_prefix], [0],
+ [Do we need the "lib" prefix for modules?])
+_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
+_LT_DECL([], [version_type], [0], [Library versioning type])
+_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])
+_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
+_LT_DECL([], [shlibpath_overrides_runpath], [0],
+ [Is shlibpath searched before the hard-coded library search path?])
+_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
+_LT_DECL([], [library_names_spec], [1],
+ [[List of archive names. First name is the real one, the rest are links.
+ The last name is the one that the linker finds with -lNAME]])
+_LT_DECL([], [soname_spec], [1],
+ [[The coded name of the library, if different from the real name]])
+_LT_DECL([], [install_override_mode], [1],
+ [Permission mode override for installation of shared libraries])
+_LT_DECL([], [postinstall_cmds], [2],
+ [Command to use after installation of a shared archive])
+_LT_DECL([], [postuninstall_cmds], [2],
+ [Command to use after uninstallation of a shared archive])
+_LT_DECL([], [finish_cmds], [2],
+ [Commands used to finish a libtool library installation in a directory])
+_LT_DECL([], [finish_eval], [1],
+ [[As "finish_cmds", except a single script fragment to be evaled but
+ not shown]])
+_LT_DECL([], [hardcode_into_libs], [0],
+ [Whether we should hardcode library paths into libraries])
+_LT_DECL([], [sys_lib_search_path_spec], [2],
+ [Compile-time system search path for libraries])
+_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
+ [Run-time system search path for libraries])
+])# _LT_SYS_DYNAMIC_LINKER
+
+
+# _LT_PATH_TOOL_PREFIX(TOOL)
+# --------------------------
+# find a file program which can recognize shared library
+AC_DEFUN([_LT_PATH_TOOL_PREFIX],
+[m4_require([_LT_DECL_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] | ?:[\\/]*])
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word. This closes a longstanding sh security hole.
+ ac_dummy="m4_if([$2], , $PATH, [$2])"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$1; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ AC_MSG_RESULT($MAGIC_CMD)
+else
+ AC_MSG_RESULT(no)
+fi
+_LT_DECL([], [MAGIC_CMD], [0],
+ [Used to examine libraries when file_magic_cmd begins with "file"])dnl
+])# _LT_PATH_TOOL_PREFIX
+
+# Old name:
+AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
+
+
+# _LT_PATH_MAGIC
+# --------------
+# find a file program which can recognize a shared library
+m4_defun([_LT_PATH_MAGIC],
+[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+ else
+ MAGIC_CMD=:
+ fi
+fi
+])# _LT_PATH_MAGIC
+
+
+# LT_PATH_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([LT_PATH_LD],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
+
+AC_ARG_WITH([gnu-ld],
+ [AS_HELP_STRING([--with-gnu-ld],
+ [assume the C compiler uses GNU ld @<:@default=no@:>@])],
+ [test "$withval" = no || with_gnu_ld=yes],
+ [with_gnu_ld=no])dnl
+
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ AC_MSG_CHECKING([for ld used by $CC])
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [[\\/]]* | ?:[[\\/]]*)
+ re_direlt='/[[^/]][[^/]]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ AC_MSG_CHECKING([for GNU ld])
+else
+ AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ AC_MSG_RESULT($LD)
+else
+ AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+_LT_PATH_LD_GNU
+AC_SUBST([LD])
+
+_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
+])# LT_PATH_LD
+
+# Old names:
+AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
+AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_LD], [])
+dnl AC_DEFUN([AC_PROG_LD], [])
+
+
+# _LT_PATH_LD_GNU
+#- --------------
+m4_defun([_LT_PATH_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# _LT_PATH_LD_GNU
+
+
+# _LT_CMD_RELOAD
+# --------------
+# find reload flag for linker
+# -- PORTME Some linkers may need a different reload flag.
+m4_defun([_LT_CMD_RELOAD],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+ lt_cv_ld_reload_flag,
+ [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ if test "$GCC" != yes; then
+ reload_cmds=false
+ fi
+ ;;
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+_LT_TAGDECL([], [reload_cmds], [2])dnl
+])# _LT_CMD_RELOAD
+
+
+# _LT_CHECK_MAGIC_METHOD
+# ----------------------
+# how to check for library dependencies
+# -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_MAGIC_METHOD],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+AC_CACHE_CHECK([how to recognize dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[[4-9]]*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi[[45]]*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # func_win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+ if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+ # Keep this pattern in sync with the one in func_win32_libid.
+ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+
+cegcc*)
+ # use the weaker test based on 'objdump'. See mingw*.
+ lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | dragonfly*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+haiku*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case $host_cpu in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+interix[[3-9]]*)
+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+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
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+*nto* | *qnx*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+openbsd*)
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.3*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ pc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+tpf*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+])
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+ case $host_os in
+ mingw* | pw32*)
+ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+ want_nocaseglob=yes
+ else
+ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
+ fi
+ ;;
+ esac
+fi
+
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+_LT_DECL([], [deplibs_check_method], [1],
+ [Method to check whether dependent libraries are shared objects])
+_LT_DECL([], [file_magic_cmd], [1],
+ [Command to use when deplibs_check_method = "file_magic"])
+_LT_DECL([], [file_magic_glob], [1],
+ [How to find potential files when deplibs_check_method = "file_magic"])
+_LT_DECL([], [want_nocaseglob], [1],
+ [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
+])# _LT_CHECK_MAGIC_METHOD
+
+
+# LT_PATH_NM
+# ----------
+# find the pathname to a BSD- or MS-compatible name lister
+AC_DEFUN([LT_PATH_NM],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
+[if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ lt_nm_to_check="${ac_tool_prefix}nm"
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ lt_nm_to_check="$lt_nm_to_check nm"
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm="$ac_dir/$lt_tmp_nm"
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
+fi])
+if test "$lt_cv_path_NM" != "no"; then
+ NM="$lt_cv_path_NM"
+else
+ # Didn't find any BSD compatible name lister, look for dumpbin.
+ if test -n "$DUMPBIN"; then :
+ # Let the user override the test.
+ else
+ AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
+ case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+ *COFF*)
+ DUMPBIN="$DUMPBIN -symbols"
+ ;;
+ *)
+ DUMPBIN=:
+ ;;
+ esac
+ fi
+ AC_SUBST([DUMPBIN])
+ if test "$DUMPBIN" != ":"; then
+ NM="$DUMPBIN"
+ fi
+fi
+test -z "$NM" && NM=nm
+AC_SUBST([NM])
+_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
+
+AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
+ [lt_cv_nm_interface="BSD nm"
+ echo "int some_variable = 0;" > conftest.$ac_ext
+ (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$ac_compile" 2>conftest.err)
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
+ cat conftest.out >&AS_MESSAGE_LOG_FD
+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+ lt_cv_nm_interface="MS dumpbin"
+ fi
+ rm -f conftest*])
+])# LT_PATH_NM
+
+# Old names:
+AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
+AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_NM], [])
+dnl AC_DEFUN([AC_PROG_NM], [])
+
+# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+# --------------------------------
+# how to determine the name of the shared library
+# associated with a specific link library.
+# -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+m4_require([_LT_DECL_DLLTOOL])
+AC_CACHE_CHECK([how to associate runtime and link libraries],
+lt_cv_sharedlib_from_linklib_cmd,
+[lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+ # two different shell functions defined in ltmain.sh
+ # decide which to use based on capabilities of $DLLTOOL
+ case `$DLLTOOL --help 2>&1` in
+ *--identify-strict*)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+ ;;
+ *)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+ ;;
+ esac
+ ;;
+*)
+ # fallback: assume linklib IS sharedlib
+ lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+ ;;
+esac
+])
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
+ [Command to associate shared and link libraries])
+])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+
+
+# _LT_PATH_MANIFEST_TOOL
+# ----------------------
+# locate the manifest tool
+m4_defun([_LT_PATH_MANIFEST_TOOL],
+[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
+ [lt_cv_path_mainfest_tool=no
+ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
+ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+ lt_cv_path_mainfest_tool=yes
+ fi
+ rm -f conftest*])
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
+ MANIFEST_TOOL=:
+fi
+_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
+])# _LT_PATH_MANIFEST_TOOL
+
+
+# LT_LIB_M
+# --------
+# check for math library
+AC_DEFUN([LT_LIB_M],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
+ # These system don't have libm, or don't need it
+ ;;
+*-ncr-sysv4.3*)
+ AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+ AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+ ;;
+*)
+ AC_CHECK_LIB(m, cos, LIBM="-lm")
+ ;;
+esac
+AC_SUBST([LIBM])
+])# LT_LIB_M
+
+# Old name:
+AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_CHECK_LIBM], [])
+
+
+# _LT_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------
+m4_defun([_LT_COMPILER_NO_RTTI],
+[m4_require([_LT_TAG_COMPILER])dnl
+
+_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+ case $cc_basename in
+ nvcc*)
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
+ esac
+
+ _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+ lt_cv_prog_compiler_rtti_exceptions,
+ [-fno-rtti -fno-exceptions], [],
+ [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
+ [Compiler flag to turn off builtin functions])
+])# _LT_COMPILER_NO_RTTI
+
+
+# _LT_CMD_GLOBAL_SYMBOLS
+# ----------------------
+m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[[BCDT]]'
+ ;;
+cygwin* | mingw* | pw32* | cegcc*)
+ symcode='[[ABCDGISTW]]'
+ ;;
+hpux*)
+ if test "$host_cpu" = ia64; then
+ symcode='[[ABCDEGRST]]'
+ fi
+ ;;
+irix* | nonstopux*)
+ symcode='[[BCDEGRST]]'
+ ;;
+osf*)
+ symcode='[[BCDEGQRST]]'
+ ;;
+solaris*)
+ symcode='[[BDRT]]'
+ ;;
+sco3.2v5*)
+ symcode='[[DT]]'
+ ;;
+sysv4.2uw2*)
+ symcode='[[DT]]'
+ ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+ symcode='[[ABDT]]'
+ ;;
+sysv4)
+ symcode='[[DFNSTU]]'
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+ symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+ # Write the raw and C identifiers.
+ if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Fake it for dumpbin and say T for any non-static function
+ # and D for any global variable.
+ # Also find C++ and __fastcall symbols from MSVC++,
+ # which start with @ or ?.
+ lt_cv_sys_global_symbol_pipe="$AWK ['"\
+" {last_section=section; section=\$ 3};"\
+" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
+" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+" \$ 0!~/External *\|/{next};"\
+" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+" {if(hide[section]) next};"\
+" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+" s[1]~/^[@?]/{print s[1], s[1]; next};"\
+" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+" ' prfx=^$ac_symprfx]"
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+ if AC_TRY_EVAL(ac_compile); then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT@&t@_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data. */
+# define LT@&t@_DLSYM_CONST
+#else
+# define LT@&t@_DLSYM_CONST const
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols. */
+LT@&t@_DLSYM_CONST struct {
+ const char *name;
+ void *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[[]] =
+{
+ { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ cat <<\_LT_EOF >> conftest.$ac_ext
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_globsym_save_LIBS=$LIBS
+ lt_globsym_save_CFLAGS=$CFLAGS
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+ LIBS=$lt_globsym_save_LIBS
+ CFLAGS=$lt_globsym_save_CFLAGS
+ else
+ echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+ cat conftest.$ac_ext >&5
+ fi
+ rm -rf conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$pipe_works" = yes; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ AC_MSG_RESULT(failed)
+else
+ AC_MSG_RESULT(ok)
+fi
+
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
+ nm_file_list_spec='@'
+fi
+
+_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
+ [Take the output of nm and produce a listing of raw symbols and C names])
+_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
+ [Transform the output of nm in a proper C declaration])
+_LT_DECL([global_symbol_to_c_name_address],
+ [lt_cv_sys_global_symbol_to_c_name_address], [1],
+ [Transform the output of nm in a C name address pair])
+_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
+ [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
+ [Transform the output of nm in a C name address pair when lib prefix is needed])
+_LT_DECL([], [nm_file_list_spec], [1],
+ [Specify filename containing input files for $NM])
+]) # _LT_CMD_GLOBAL_SYMBOLS
+
+
+# _LT_COMPILER_PIC([TAGNAME])
+# ---------------------------
+m4_defun([_LT_COMPILER_PIC],
+[m4_require([_LT_TAG_COMPILER])dnl
+_LT_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_TAGVAR(lt_prog_compiler_static, $1)=
+
+m4_if([$1], [CXX], [
+ # C++ specific cases for pic, static, wl, etc.
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)=
+ ;;
+ interix[[3-9]]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ else
+ case $host_os in
+ aix[[4-9]]*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ cxch68*)
+ # Green Hills C++ Compiler
+ # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+ ;;
+ esac
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd* | dragonfly*)
+ # FreeBSD uses GNU C++
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ if test "$host_cpu" != ia64; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ fi
+ ;;
+ aCC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ interix*)
+ # This is c89, which is MS Visual C++ (no shared libs)
+ # Anyone wants to do a port?
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ # CC pic flag -KPIC is the default.
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ KCC*)
+ # KAI C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ ecpc* )
+ # old Intel C++ for x86_64 which still supported -KPIC.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ icpc* )
+ # Intel C++, used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ cxx*)
+ # Compaq C++
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
+ # IBM XL 8.0, 9.0 on PPC and BlueGene
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ lynxos*)
+ ;;
+ m88k*)
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ netbsd* | netbsdelf*-gnu)
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ cxx*)
+ # Digital/Compaq C++
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ psos*)
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ lcc*)
+ # Lucid
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ vxworks*)
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+],
+[
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)=
+ ;;
+
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+
+ interix[[3-9]]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ enable_shared=no
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+
+ case $cc_basename in
+ nvcc*) # Cuda Compiler Driver 2.2
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
+ if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
+ fi
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC (with -KPIC) is the default.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ # old Intel for x86_64 which still supported -KPIC.
+ ecc*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
+ ;;
+ nagfor*)
+ # NAG Fortran compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ ccc*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All Alpha code is PIC.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ xl* | bgxl* | bgf* | mpixl*)
+ # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
+ ;;
+ *Sun\ F* | *Sun*Fortran*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ *Sun\ C*)
+ # Sun C 5.9
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ ;;
+ *Intel*\ [[CF]]*Compiler*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ *Portland\ Group*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ newsos6)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+
+ osf3* | osf4* | osf5*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All OSF/1 code is PIC.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ rdos*)
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ solaris*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ unicos*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+
+ uts4*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *)
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+])
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
+ ;;
+esac
+
+AC_CACHE_CHECK([for $compiler option to produce PIC],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+ _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
+ [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
+ [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
+ "" | " "*) ;;
+ *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+ esac],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
+ [Additional compiler flags for building library objects])
+
+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+ [How to pass a linker flag through the compiler])
+#
+# Check to make sure the static flag actually works.
+#
+wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
+_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
+ _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
+ $lt_tmp_static_flag,
+ [],
+ [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
+_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
+ [Compiler flag to prevent dynamic linking])
+])# _LT_COMPILER_PIC
+
+
+# _LT_LINKER_SHLIBS([TAGNAME])
+# ----------------------------
+# See if the linker supports building shared libraries.
+m4_defun([_LT_LINKER_SHLIBS],
+[AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+m4_if([$1], [CXX], [
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+ case $host_os in
+ aix[[4-9]]*)
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global defined
+ # symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ ;;
+ pw32*)
+ _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+ ;;
+ cygwin* | mingw* | cegcc*)
+ case $cc_basename in
+ cl*)
+ _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+ ;;
+ *)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+ ;;
+ esac
+ ;;
+ linux* | k*bsd*-gnu | gnu*)
+ _LT_TAGVAR(link_all_deplibs, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ esac
+], [
+ runpath_var=
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(archive_cmds, $1)=
+ _LT_TAGVAR(archive_expsym_cmds, $1)=
+ _LT_TAGVAR(compiler_needs_object, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(hardcode_automatic, $1)=no
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ _LT_TAGVAR(hardcode_minus_L, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_TAGVAR(inherit_rpath, $1)=no
+ _LT_TAGVAR(link_all_deplibs, $1)=unknown
+ _LT_TAGVAR(module_cmds, $1)=
+ _LT_TAGVAR(module_expsym_cmds, $1)=
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)=
+ _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+ _LT_TAGVAR(thread_safe_flag_spec, $1)=
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ _LT_TAGVAR(include_expsyms, $1)=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+dnl Note also adjust exclude_expsyms for C++ above.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ linux* | k*bsd*-gnu | gnu*)
+ _LT_TAGVAR(link_all_deplibs, $1)=no
+ ;;
+ esac
+
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+
+ # On some targets, GNU ld is compatible enough with the native linker
+ # that we're better off using the native interface for both.
+ lt_use_gnu_ld_interface=no
+ if test "$with_gnu_ld" = yes; then
+ case $host_os in
+ aix*)
+ # The AIX port of GNU ld has always aspired to compatibility
+ # with the native linker. However, as the warning in the GNU ld
+ # block says, versions before 2.19.5* couldn't really create working
+ # shared libraries, regardless of the interface used.
+ case `$LD -v 2>&1` in
+ *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+ *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
+ *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ fi
+
+ if test "$lt_use_gnu_ld_interface" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>&1` in
+ *GNU\ gold*) supports_anon_versioning=yes ;;
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[[3-9]]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
+ ;;
+ m68k)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ haiku*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ interix[[3-9]]*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+ tmp_diet=no
+ if test "$host_os" = linux-dietlibc; then
+ case $cc_basename in
+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
+ esac
+ fi
+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ && test "$tmp_diet" = no
+ then
+ tmp_addflag=' $pic_flag'
+ tmp_sharedflag='-shared'
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group f77 and f90 compilers
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ lf95*) # Lahey Fortran 8.1
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ tmp_sharedflag='--shared' ;;
+ xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
+ nvcc*) # Cuda Compiler Driver 2.2
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+ ;;
+ esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+ _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+
+ case $cc_basename in
+ xlf* | bgf* | bgxlf* | mpixlf*)
+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ netbsd* | netbsdelf*-gnu)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+
+ if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
+ runpath_var=
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ fi
+ ;;
+
+ aix[[4-9]]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global
+ # defined symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_TAGVAR(archive_cmds, $1)=''
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ _LT_TAGVAR(link_all_deplibs, $1)=no
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ if test "$with_gnu_ld" = yes; then
+ # We only use this code for GNU lds that support --whole-archive.
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
+ ;;
+ m68k)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ ;;
+
+ bsdi[[45]]*)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ case $cc_basename in
+ cl*)
+ # Native MSVC
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+ # Don't use ranlib
+ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # Assume MSVC wrapper
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ # FIXME: Should let the user specify the lib program.
+ _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ ;;
+ esac
+ ;;
+
+ darwin* | rhapsody*)
+ _LT_DARWIN_LINKER_FEATURES($1)
+ ;;
+
+ dgux*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2.*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+
+ hpux10*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ m4_if($1, [], [
+ # Older versions of the 11.00 compiler do not understand -b yet
+ # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+ _LT_LINKER_OPTION([if $CC understands -b],
+ _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
+ [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
+ [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
+ [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+ # This should be the same for all languages, so no per-tag cache variable.
+ AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
+ [lt_cv_irix_exported_symbol],
+ [save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+ AC_LINK_IFELSE(
+ [AC_LANG_SOURCE(
+ [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
+ [C++], [[int foo (void) { return 0; }]],
+ [Fortran 77], [[
+ subroutine foo
+ end]],
+ [Fortran], [[
+ subroutine foo
+ end]])])],
+ [lt_cv_irix_exported_symbol=yes],
+ [lt_cv_irix_exported_symbol=no])
+ LDFLAGS="$save_LDFLAGS"])
+ if test "$lt_cv_irix_exported_symbol" = yes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+ fi
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(inherit_rpath, $1)=yes
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ netbsd* | netbsdelf*-gnu)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ newsos6)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *nto* | *qnx*)
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ else
+ case $host_os in
+ openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ os2*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ else
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ solaris*)
+ _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+ wlarc=''
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+ ;;
+ *)
+ wlarc='${wl}'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ ;;
+ esac
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
+ esac
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ ;;
+ motorola)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4.3*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+
+ if test x$host_vendor = xsni; then
+ case $host in
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
+ ;;
+ esac
+ fi
+ fi
+])
+AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
+
+_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
+_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
+_LT_DECL([], [extract_expsyms_cmds], [2],
+ [The commands to extract the exported symbol list from a shared archive])
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+ # Assume -lc should be added
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $_LT_TAGVAR(archive_cmds, $1) in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ AC_CACHE_CHECK([whether -lc should be explicitly linked in],
+ [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
+ [$RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
+ pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+ if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
+ then
+ lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ else
+ lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ fi
+ _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+ ])
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
+ [Whether or not to add -lc for building shared libraries])
+_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
+ [enable_shared_with_static_runtimes], [0],
+ [Whether or not to disallow shared libs when runtime libs are static])
+_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
+ [Compiler flag to allow reflexive dlopens])
+_LT_TAGDECL([], [whole_archive_flag_spec], [1],
+ [Compiler flag to generate shared objects directly from archives])
+_LT_TAGDECL([], [compiler_needs_object], [1],
+ [Whether the compiler copes with passing no objects directly])
+_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
+ [Create an old-style archive from a shared archive])
+_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
+ [Create a temporary old-style archive to link instead of a shared archive])
+_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
+_LT_TAGDECL([], [archive_expsym_cmds], [2])
+_LT_TAGDECL([], [module_cmds], [2],
+ [Commands used to build a loadable module if different from building
+ a shared archive.])
+_LT_TAGDECL([], [module_expsym_cmds], [2])
+_LT_TAGDECL([], [with_gnu_ld], [1],
+ [Whether we are building with GNU ld or not])
+_LT_TAGDECL([], [allow_undefined_flag], [1],
+ [Flag that allows shared libraries with undefined symbols to be built])
+_LT_TAGDECL([], [no_undefined_flag], [1],
+ [Flag that enforces no undefined symbols])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
+ [Flag to hardcode $libdir into a binary during linking.
+ This must work even if $libdir does not exist])
+_LT_TAGDECL([], [hardcode_libdir_separator], [1],
+ [Whether we need a single "-rpath" flag with a separated argument])
+_LT_TAGDECL([], [hardcode_direct], [0],
+ [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+ DIR into the resulting binary])
+_LT_TAGDECL([], [hardcode_direct_absolute], [0],
+ [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+ DIR into the resulting binary and the resulting library dependency is
+ "absolute", i.e impossible to change by setting ${shlibpath_var} if the
+ library is relocated])
+_LT_TAGDECL([], [hardcode_minus_L], [0],
+ [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+ into the resulting binary])
+_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
+ [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+ into the resulting binary])
+_LT_TAGDECL([], [hardcode_automatic], [0],
+ [Set to "yes" if building a shared library automatically hardcodes DIR
+ into the library and all subsequent libraries and executables linked
+ against it])
+_LT_TAGDECL([], [inherit_rpath], [0],
+ [Set to yes if linker adds runtime paths of dependent libraries
+ to runtime path list])
+_LT_TAGDECL([], [link_all_deplibs], [0],
+ [Whether libtool must link a program against all its dependency libraries])
+_LT_TAGDECL([], [always_export_symbols], [0],
+ [Set to "yes" if exported symbols are required])
+_LT_TAGDECL([], [export_symbols_cmds], [2],
+ [The commands to list exported symbols])
+_LT_TAGDECL([], [exclude_expsyms], [1],
+ [Symbols that should not be listed in the preloaded symbols])
+_LT_TAGDECL([], [include_expsyms], [1],
+ [Symbols that must always be exported])
+_LT_TAGDECL([], [prelink_cmds], [2],
+ [Commands necessary for linking programs (against libraries) with templates])
+_LT_TAGDECL([], [postlink_cmds], [2],
+ [Commands necessary for finishing linking programs])
+_LT_TAGDECL([], [file_list_spec], [1],
+ [Specify filename containing input files])
+dnl FIXME: Not yet implemented
+dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
+dnl [Compiler flag to generate thread safe objects])
+])# _LT_LINKER_SHLIBS
+
+
+# _LT_LANG_C_CONFIG([TAG])
+# ------------------------
+# Ensure that the configuration variables for a C compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_C_CONFIG],
+[m4_require([_LT_DECL_EGREP])dnl
+lt_save_CC="$CC"
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+_LT_TAG_COMPILER
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+## 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_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+ LT_SYS_DLOPEN_SELF
+ _LT_CMD_STRIPLIB
+
+ # Report which library types will actually be built
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_CONFIG($1)
+fi
+AC_LANG_POP
+CC="$lt_save_CC"
+])# _LT_LANG_C_CONFIG
+
+
+# _LT_LANG_CXX_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a C++ compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_CXX_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+ (test "X$CXX" != "Xg++"))) ; then
+ AC_PROG_CXXCPP
+else
+ _lt_caught_CXX_error=yes
+fi
+
+AC_LANG_PUSH(C++)
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(compiler_needs_object, $1)=no
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_caught_CXX_error" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="int some_variable = 0;"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC=$CC
+ lt_save_CFLAGS=$CFLAGS
+ lt_save_LD=$LD
+ lt_save_GCC=$GCC
+ GCC=$GXX
+ lt_save_with_gnu_ld=$with_gnu_ld
+ lt_save_path_LD=$lt_cv_path_LD
+ if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+ else
+ $as_unset lt_cv_prog_gnu_ld
+ fi
+ if test -n "${lt_cv_path_LDCXX+set}"; then
+ lt_cv_path_LD=$lt_cv_path_LDCXX
+ else
+ $as_unset lt_cv_path_LD
+ fi
+ test -z "${LDCXX+set}" || LD=$LDCXX
+ CC=${CXX-"c++"}
+ CFLAGS=$CXXFLAGS
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+
+ if test -n "$compiler"; then
+ # We don't want -fno-exception when compiling C++ code, so set the
+ # no_builtin_flag separately
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+ else
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+ fi
+
+ if test "$GXX" = yes; then
+ # Set up default GNU C++ configuration
+
+ LT_PATH_LD
+
+ # Check if GNU C++ uses GNU ld as the underlying linker, since the
+ # archiving commands below assume that GNU ld is being used.
+ if test "$with_gnu_ld" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+ # investigate it a little bit more. (MM)
+ wlarc='${wl}'
+
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+ $GREP 'no-whole-archive' > /dev/null; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ with_gnu_ld=no
+ wlarc=
+
+ # A generic and very simple default shared library creation
+ # command for GNU C++ for the case where it uses the native
+ # linker, instead of GNU ld. If possible, this setting should
+ # overridden to take advantage of the native linker features on
+ # the platform it is being used on.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ fi
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+ else
+ GXX=no
+ with_gnu_ld=no
+ wlarc=
+ fi
+
+ # PORTME: fill in a description of your system's C++ link characteristics
+ AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ case $host_os in
+ aix3*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+ for ld_flag in $LDFLAGS; do
+ case $ld_flag in
+ *-brtl*)
+ aix_use_runtimelinking=yes
+ break
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_TAGVAR(archive_cmds, $1)=''
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+ if test "$GXX" = yes; then
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to
+ # export.
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an empty
+ # executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ if test "$with_gnu_ld" = yes; then
+ # We only use this code for GNU lds that support --whole-archive.
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds its shared
+ # libraries.
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ chorus*)
+ case $cc_basename in
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ case $GXX,$cc_basename in
+ ,cl* | no,cl*)
+ # Native MSVC
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ # Don't use ranlib
+ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ func_to_tool_file "$lt_outputfile"~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # g++
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ darwin* | rhapsody*)
+ _LT_DARWIN_LINKER_FEATURES($1)
+ ;;
+
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ freebsd2.*)
+ # C++ shared libraries reported to be fairly broken before
+ # switch to ELF
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ freebsd-elf*)
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ ;;
+
+ freebsd* | dragonfly*)
+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+ # conventions
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
+ gnu*)
+ ;;
+
+ haiku*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ hpux9*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ hpux10*|hpux11*)
+ if test $with_gnu_ld = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ ;;
+ *)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+ esac
+ fi
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ esac
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test $with_gnu_ld = no; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ fi
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ interix[[3-9]]*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+ irix5* | irix6*)
+ case $cc_basename in
+ CC*)
+ # SGI C++
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+
+ # Archives containing C++ object files must be created using
+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+ fi
+ fi
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+ esac
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(inherit_rpath, $1)=yes
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+ ;;
+ icpc* | ecpc* )
+ # Intel C++
+ with_gnu_ld=yes
+ # version 8.0 and above of icpc choke on multiply defined symbols
+ # if we add $predep_objects and $postdep_objects, however 7.1 and
+ # earlier do not add the objects themselves.
+ case `$CC -V 2>&1` in
+ *"Version 7."*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ *) # Version 8.0 or newer
+ tmp_idyn=
+ case $host_cpu in
+ ia64*) tmp_idyn=' -i_dynamic';;
+ esac
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ esac
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ case `$CC -V` in
+ *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
+ _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+ _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+ $RANLIB $oldlib'
+ _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ *) # Version 6 and above use weak symbols
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ ;;
+ cxx*)
+ # Compaq C++
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+ runpath_var=LD_RUN_PATH
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+ ;;
+ xl* | mpixl* | bgxl*)
+ # IBM XL 8.0 on PPC, with GNU ld
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+
+ # Not sure whether something based on
+ # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+ # would be better.
+ output_verbose_link_cmd='func_echo_all'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ lynxos*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ m88k*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+ wlarc=
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ fi
+ # Workaround some broken pre-1.5 toolchains
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+ ;;
+
+ *nto* | *qnx*)
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
+ openbsd2*)
+ # C++ shared libraries are fairly broken
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ fi
+ output_verbose_link_cmd=func_echo_all
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Archives containing C++ object files must be created using
+ # the KAI C++ compiler.
+ case $host in
+ osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
+ *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
+ esac
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ cxx*)
+ case $host in
+ osf3*)
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ ;;
+ *)
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+ echo "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
+ $RM $lib.exp'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ case $host in
+ osf3*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ psos*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ lcc*)
+ # Lucid
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ ;;
+ esac
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+
+ output_verbose_link_cmd='func_echo_all'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+ # The C++ compiler must be used to create the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+ ;;
+ *)
+ # GNU C++ compiler with Solaris linker
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+ if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ else
+ # g++ 2.7 appears to require `-G' NOT `-shared' on this
+ # platform.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ fi
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
+ '"$_LT_TAGVAR(old_archive_cmds, $1)"
+ _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
+ '"$_LT_TAGVAR(reload_cmds, $1)"
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ vxworks*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+
+ AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+ test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+ _LT_TAGVAR(GCC, $1)="$GXX"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_SYS_HIDDEN_LIBDEPS($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+ LDCXX=$LD
+ LD=$lt_save_LD
+ GCC=$lt_save_GCC
+ with_gnu_ld=$lt_save_with_gnu_ld
+ lt_cv_path_LDCXX=$lt_cv_path_LD
+ lt_cv_path_LD=$lt_save_path_LD
+ lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+ lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test "$_lt_caught_CXX_error" != yes
+
+AC_LANG_POP
+])# _LT_LANG_CXX_CONFIG
+
+
+# _LT_FUNC_STRIPNAME_CNF
+# ----------------------
+# func_stripname_cnf prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+#
+# This function is identical to the (non-XSI) version of func_stripname,
+# except this one can be used by m4 code that may be executed by configure,
+# rather than the libtool script.
+m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
+AC_REQUIRE([_LT_DECL_SED])
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
+func_stripname_cnf ()
+{
+ case ${2} in
+ .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+ esac
+} # func_stripname_cnf
+])# _LT_FUNC_STRIPNAME_CNF
+
+# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
+# ---------------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
+# Dependencies to place before and after the object being linked:
+_LT_TAGVAR(predep_objects, $1)=
+_LT_TAGVAR(postdep_objects, $1)=
+_LT_TAGVAR(predeps, $1)=
+_LT_TAGVAR(postdeps, $1)=
+_LT_TAGVAR(compiler_lib_search_path, $1)=
+
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library. It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
+int a;
+void foo (void) { a = 0; }
+_LT_EOF
+], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+ Foo (void) { a = 0; }
+private:
+ int a;
+};
+_LT_EOF
+], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
+ subroutine foo
+ implicit none
+ integer*4 a
+ a=0
+ return
+ end
+_LT_EOF
+], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
+ subroutine foo
+ implicit none
+ integer a
+ a=0
+ return
+ end
+_LT_EOF
+], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
+public class foo {
+ private int a;
+ public void bar (void) {
+ a = 0;
+ }
+};
+_LT_EOF
+], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
+package foo
+func foo() {
+}
+_LT_EOF
+])
+
+_lt_libdeps_save_CFLAGS=$CFLAGS
+case "$CC $CFLAGS " in #(
+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
+esac
+
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
+
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
+
+ for p in `eval "$output_verbose_link_cmd"`; do
+ case ${prev}${p} in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test $p = "-L" ||
+ test $p = "-R"; then
+ prev=$p
+ continue
+ fi
+
+ # Expand the sysroot to ease extracting the directories later.
+ if test -z "$prev"; then
+ case $p in
+ -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+ -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+ -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+ esac
+ fi
+ case $p in
+ =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+ esac
+ if test "$pre_test_object_deps_done" = no; then
+ case ${prev} in
+ -L | -R)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
+ _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+ else
+ _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+ fi
+ ;;
+ # The "-l" case would never come before the object being
+ # linked, so don't bother handling this case.
+ esac
+ else
+ if test -z "$_LT_TAGVAR(postdeps, $1)"; then
+ _LT_TAGVAR(postdeps, $1)="${prev}${p}"
+ else
+ _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
+ fi
+ fi
+ prev=
+ ;;
+
+ *.lto.$objext) ;; # Ignore GCC LTO objects
+ *.$objext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+ if test "$p" = "conftest.$objext"; then
+ pre_test_object_deps_done=yes
+ continue
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
+ _LT_TAGVAR(predep_objects, $1)="$p"
+ else
+ _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
+ fi
+ else
+ if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
+ _LT_TAGVAR(postdep_objects, $1)="$p"
+ else
+ _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
+ fi
+ fi
+ ;;
+
+ *) ;; # Ignore the rest.
+
+ esac
+ done
+
+ # Clean up.
+ rm -f a.out a.exe
+else
+ echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
+
+# PORTME: override above test on systems where it is broken
+m4_if([$1], [CXX],
+[case $host_os in
+interix[[3-9]]*)
+ # Interix 3.5 installs completely hosed .la files for C++, so rather than
+ # hack all around it, let's just trust "g++" to DTRT.
+ _LT_TAGVAR(predep_objects,$1)=
+ _LT_TAGVAR(postdep_objects,$1)=
+ _LT_TAGVAR(postdeps,$1)=
+ ;;
+
+linux*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ if test "$solaris_use_stlport4" != yes; then
+ _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+
+solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ # Adding this requires a known-good setup of shared libraries for
+ # Sun compiler versions before 5.6, else PIC objects from an old
+ # archive will be linked into the output, leading to subtle bugs.
+ if test "$solaris_use_stlport4" != yes; then
+ _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+esac
+])
+
+case " $_LT_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=
+if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
+ [The directories searched by this compiler when creating a shared library])
+_LT_TAGDECL([], [predep_objects], [1],
+ [Dependencies to place before and after the objects being linked to
+ create a shared library])
+_LT_TAGDECL([], [postdep_objects], [1])
+_LT_TAGDECL([], [predeps], [1])
+_LT_TAGDECL([], [postdeps], [1])
+_LT_TAGDECL([], [compiler_lib_search_path], [1],
+ [The library search path used internally by the compiler when linking
+ a shared library])
+])# _LT_SYS_HIDDEN_LIBDEPS
+
+
+# _LT_LANG_F77_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a Fortran 77 compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_F77_CONFIG],
+[AC_LANG_PUSH(Fortran 77)
+if test -z "$F77" || test "X$F77" = "Xno"; then
+ _lt_disable_F77=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the F77 compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_F77" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC="$CC"
+ lt_save_GCC=$GCC
+ lt_save_CFLAGS=$CFLAGS
+ CC=${F77-"f77"}
+ CFLAGS=$FFLAGS
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+ GCC=$G77
+ if test -n "$compiler"; then
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_TAGVAR(GCC, $1)="$G77"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC="$lt_save_CC"
+ CFLAGS="$lt_save_CFLAGS"
+fi # test "$_lt_disable_F77" != yes
+
+AC_LANG_POP
+])# _LT_LANG_F77_CONFIG
+
+
+# _LT_LANG_FC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for a Fortran compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_FC_CONFIG],
+[AC_LANG_PUSH(Fortran)
+
+if test -z "$FC" || test "X$FC" = "Xno"; then
+ _lt_disable_FC=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for fc test sources.
+ac_ext=${ac_fc_srcext-f}
+
+# Object file extension for compiled fc test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the FC compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_FC" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC="$CC"
+ lt_save_GCC=$GCC
+ lt_save_CFLAGS=$CFLAGS
+ CC=${FC-"f95"}
+ CFLAGS=$FCFLAGS
+ compiler=$CC
+ GCC=$ac_cv_fc_compiler_gnu
+
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+
+ if test -n "$compiler"; then
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_SYS_HIDDEN_LIBDEPS($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+fi # test "$_lt_disable_FC" != yes
+
+AC_LANG_POP
+])# _LT_LANG_FC_CONFIG
+
+
+# _LT_LANG_GCJ_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Java Compiler compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GCJ_CONFIG],
+[AC_REQUIRE([LT_PROG_GCJ])dnl
+AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GCJ-"gcj"}
+CFLAGS=$GCJFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+## 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_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_GCJ_CONFIG
+
+
+# _LT_LANG_GO_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Go compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GO_CONFIG],
+[AC_REQUIRE([LT_PROG_GO])dnl
+AC_LANG_SAVE
+
+# Source file extension for Go test sources.
+ac_ext=go
+
+# Object file extension for compiled Go test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="package main; func main() { }"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='package main; func main() { }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GOC-"gccgo"}
+CFLAGS=$GOFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# Go did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+## 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_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_GO_CONFIG
+
+
+# _LT_LANG_RC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for the Windows resource compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_RC_CONFIG],
+[AC_REQUIRE([LT_PROG_RC])dnl
+AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=
+CC=${RC-"windres"}
+CFLAGS=
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+if test -n "$compiler"; then
+ :
+ _LT_CONFIG($1)
+fi
+
+GCC=$lt_save_GCC
+AC_LANG_RESTORE
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_RC_CONFIG
+
+
+# LT_PROG_GCJ
+# -----------
+AC_DEFUN([LT_PROG_GCJ],
+[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
+ [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
+ [AC_CHECK_TOOL(GCJ, gcj,)
+ test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+ AC_SUBST(GCJFLAGS)])])[]dnl
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
+
+
+# LT_PROG_GO
+# ----------
+AC_DEFUN([LT_PROG_GO],
+[AC_CHECK_TOOL(GOC, gccgo,)
+])
+
+
+# LT_PROG_RC
+# ----------
+AC_DEFUN([LT_PROG_RC],
+[AC_CHECK_TOOL(RC, windres,)
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_RC], [])
+
+
+# _LT_DECL_EGREP
+# --------------
+# If we don't have a new enough Autoconf to choose the best grep
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_EGREP],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_REQUIRE([AC_PROG_FGREP])dnl
+test -z "$GREP" && GREP=grep
+_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
+_LT_DECL([], [EGREP], [1], [An ERE matcher])
+_LT_DECL([], [FGREP], [1], [A literal string matcher])
+dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
+AC_SUBST([GREP])
+])
+
+
+# _LT_DECL_OBJDUMP
+# --------------
+# If we don't have a new enough Autoconf to choose the best objdump
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_OBJDUMP],
+[AC_CHECK_TOOL(OBJDUMP, objdump, false)
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
+AC_SUBST([OBJDUMP])
+])
+
+# _LT_DECL_DLLTOOL
+# ----------------
+# Ensure DLLTOOL variable is set.
+m4_defun([_LT_DECL_DLLTOOL],
+[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
+AC_SUBST([DLLTOOL])
+])
+
+# _LT_DECL_SED
+# ------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible. Prefer GNU sed if found.
+m4_defun([_LT_DECL_SED],
+[AC_PROG_SED
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
+_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
+ [Sed that helps us avoid accidentally triggering echo(1) options like -n])
+])# _LT_DECL_SED
+
+m4_ifndef([AC_PROG_SED], [
+############################################################
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_SED. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+############################################################
+
+m4_defun([AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for lt_ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+ lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+ fi
+ done
+ done
+done
+IFS=$as_save_IFS
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+ test ! -f $lt_ac_sed && continue
+ cat /dev/null > conftest.in
+ lt_ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+ # Check for GNU sed and select it if it is found.
+ if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+ lt_cv_path_SED=$lt_ac_sed
+ break
+ fi
+ while true; do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo >>conftest.nl
+ $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+ cmp -s conftest.out conftest.nl || break
+ # 10000 chars as input seems more than enough
+ test $lt_ac_count -gt 10 && break
+ lt_ac_count=`expr $lt_ac_count + 1`
+ if test $lt_ac_count -gt $lt_ac_max; then
+ lt_ac_max=$lt_ac_count
+ lt_cv_path_SED=$lt_ac_sed
+ fi
+ done
+done
+])
+SED=$lt_cv_path_SED
+AC_SUBST([SED])
+AC_MSG_RESULT([$SED])
+])#AC_PROG_SED
+])#m4_ifndef
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_SED], [])
+
+
+# _LT_CHECK_SHELL_FEATURES
+# ------------------------
+# Find out whether the shell is Bourne or XSI compatible,
+# or has some other useful features.
+m4_defun([_LT_CHECK_SHELL_FEATURES],
+[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+ = c,a/b,b/c, \
+ && eval 'test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+ && xsi_shell=yes
+AC_MSG_RESULT([$xsi_shell])
+_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
+
+AC_MSG_CHECKING([whether the shell understands "+="])
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
+ >/dev/null 2>&1 \
+ && lt_shell_append=yes
+AC_MSG_RESULT([$lt_shell_append])
+_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ lt_unset=unset
+else
+ lt_unset=false
+fi
+_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+ lt_SP2NL='tr \040 \012'
+ lt_NL2SP='tr \015\012 \040\040'
+ ;;
+ *) # EBCDIC based system
+ lt_SP2NL='tr \100 \n'
+ lt_NL2SP='tr \r\n \100\100'
+ ;;
+esac
+_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
+_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
+])# _LT_CHECK_SHELL_FEATURES
+
+
+# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
+# ------------------------------------------------------
+# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
+# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
+m4_defun([_LT_PROG_FUNCTION_REPLACE],
+[dnl {
+sed -e '/^$1 ()$/,/^} # $1 /c\
+$1 ()\
+{\
+m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1])
+} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+])
+
+
+# _LT_PROG_REPLACE_SHELLFNS
+# -------------------------
+# Replace existing portable implementations of several shell functions with
+# equivalent extended shell implementations where those features are available..
+m4_defun([_LT_PROG_REPLACE_SHELLFNS],
+[if test x"$xsi_shell" = xyes; then
+ _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac])
+
+ _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
+ func_basename_result="${1##*/}"])
+
+ _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac
+ func_basename_result="${1##*/}"])
+
+ _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
+ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+ # positional parameters, so assign one to ordinary parameter first.
+ func_stripname_result=${3}
+ func_stripname_result=${func_stripname_result#"${1}"}
+ func_stripname_result=${func_stripname_result%"${2}"}])
+
+ _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
+ func_split_long_opt_name=${1%%=*}
+ func_split_long_opt_arg=${1#*=}])
+
+ _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
+ func_split_short_opt_arg=${1#??}
+ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
+
+ _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
+ case ${1} in
+ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+ *) func_lo2o_result=${1} ;;
+ esac])
+
+ _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo])
+
+ _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))])
+
+ _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}])
+fi
+
+if test x"$lt_shell_append" = xyes; then
+ _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"])
+
+ _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
+ func_quote_for_eval "${2}"
+dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
+ eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
+
+ # Save a `func_append' function call where possible by direct use of '+='
+ sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+else
+ # Save a `func_append' function call even when '+=' is not available
+ sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+fi
+
+if test x"$_lt_function_replace_fail" = x":"; then
+ AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
+fi
+])
+
+# _LT_PATH_CONVERSION_FUNCTIONS
+# -----------------------------
+# Determine which file name conversion functions should be used by
+# func_to_host_file (and, implicitly, by func_to_host_path). These are needed
+# for certain cross-compile configurations and native mingw.
+m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_MSG_CHECKING([how to convert $build file names to $host format])
+AC_CACHE_VAL(lt_cv_to_host_file_cmd,
+[case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+ ;;
+ esac
+ ;;
+ *-*-cygwin* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+ ;;
+ esac
+ ;;
+ * ) # unhandled hosts (and "normal" native builds)
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+esac
+])
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
+_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
+ [0], [convert $build file names to $host format])dnl
+
+AC_MSG_CHECKING([how to convert $build file names to toolchain format])
+AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
+[#assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ esac
+ ;;
+esac
+])
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
+_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
+ [0], [convert $build files to toolchain format])dnl
+])# _LT_PATH_CONVERSION_FUNCTIONS
diff --git a/m4/ltoptions.m4 b/m4/ltoptions.m4
new file mode 100644
index 000000000000..5d9acd8e23bc
--- /dev/null
+++ b/m4/ltoptions.m4
@@ -0,0 +1,384 @@
+# Helper functions for option handling. -*- Autoconf -*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 7 ltoptions.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
+
+
+# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
+# ------------------------------------------
+m4_define([_LT_MANGLE_OPTION],
+[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
+
+
+# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
+# ---------------------------------------
+# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
+# matching handler defined, dispatch to it. Other OPTION-NAMEs are
+# saved as a flag.
+m4_define([_LT_SET_OPTION],
+[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
+m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
+ _LT_MANGLE_DEFUN([$1], [$2]),
+ [m4_warning([Unknown $1 option `$2'])])[]dnl
+])
+
+
+# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
+# ------------------------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+m4_define([_LT_IF_OPTION],
+[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
+
+
+# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
+# -------------------------------------------------------
+# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
+# are set.
+m4_define([_LT_UNLESS_OPTIONS],
+[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+ [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
+ [m4_define([$0_found])])])[]dnl
+m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
+])[]dnl
+])
+
+
+# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
+# ----------------------------------------
+# OPTION-LIST is a space-separated list of Libtool options associated
+# with MACRO-NAME. If any OPTION has a matching handler declared with
+# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
+# the unknown option and exit.
+m4_defun([_LT_SET_OPTIONS],
+[# Set options
+m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+ [_LT_SET_OPTION([$1], _LT_Option)])
+
+m4_if([$1],[LT_INIT],[
+ dnl
+ dnl Simply set some default values (i.e off) if boolean options were not
+ dnl specified:
+ _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
+ ])
+ _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
+ ])
+ dnl
+ dnl If no reference was made to various pairs of opposing options, then
+ dnl we run the default mode handler for the pair. For example, if neither
+ dnl `shared' nor `disable-shared' was passed, we enable building of shared
+ dnl archives by default:
+ _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
+ _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
+ _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
+ _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
+ [_LT_ENABLE_FAST_INSTALL])
+ ])
+])# _LT_SET_OPTIONS
+
+
+## --------------------------------- ##
+## Macros to handle LT_INIT options. ##
+## --------------------------------- ##
+
+# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
+# -----------------------------------------
+m4_define([_LT_MANGLE_DEFUN],
+[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
+
+
+# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
+# -----------------------------------------------
+m4_define([LT_OPTION_DEFINE],
+[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
+])# LT_OPTION_DEFINE
+
+
+# dlopen
+# ------
+LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
+])
+
+AU_DEFUN([AC_LIBTOOL_DLOPEN],
+[_LT_SET_OPTION([LT_INIT], [dlopen])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `dlopen' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
+
+
+# win32-dll
+# ---------
+# Declare package support for building win32 dll's.
+LT_OPTION_DEFINE([LT_INIT], [win32-dll],
+[enable_win32_dll=yes
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
+ AC_CHECK_TOOL(AS, as, false)
+ AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+ AC_CHECK_TOOL(OBJDUMP, objdump, false)
+ ;;
+esac
+
+test -z "$AS" && AS=as
+_LT_DECL([], [AS], [1], [Assembler program])dnl
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
+])# win32-dll
+
+AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+_LT_SET_OPTION([LT_INIT], [win32-dll])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `win32-dll' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
+
+
+# _LT_ENABLE_SHARED([DEFAULT])
+# ----------------------------
+# implement the --enable-shared flag, and supports the `shared' and
+# `disable-shared' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_SHARED],
+[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([shared],
+ [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+ [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
+
+ _LT_DECL([build_libtool_libs], [enable_shared], [0],
+ [Whether or not to build shared libraries])
+])# _LT_ENABLE_SHARED
+
+LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
+])
+
+AC_DEFUN([AC_DISABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], [disable-shared])
+])
+
+AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_SHARED], [])
+dnl AC_DEFUN([AM_DISABLE_SHARED], [])
+
+
+
+# _LT_ENABLE_STATIC([DEFAULT])
+# ----------------------------
+# implement the --enable-static flag, and support the `static' and
+# `disable-static' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_STATIC],
+[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([static],
+ [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+ [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
+
+ _LT_DECL([build_old_libs], [enable_static], [0],
+ [Whether or not to build static libraries])
+])# _LT_ENABLE_STATIC
+
+LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
+])
+
+AC_DEFUN([AC_DISABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], [disable-static])
+])
+
+AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_STATIC], [])
+dnl AC_DEFUN([AM_DISABLE_STATIC], [])
+
+
+
+# _LT_ENABLE_FAST_INSTALL([DEFAULT])
+# ----------------------------------
+# implement the --enable-fast-install flag, and support the `fast-install'
+# and `disable-fast-install' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_FAST_INSTALL],
+[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([fast-install],
+ [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+ [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
+
+_LT_DECL([fast_install], [enable_fast_install], [0],
+ [Whether or not to optimize for fast installation])dnl
+])# _LT_ENABLE_FAST_INSTALL
+
+LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
+
+# Old names:
+AU_DEFUN([AC_ENABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `fast-install' option into LT_INIT's first parameter.])
+])
+
+AU_DEFUN([AC_DISABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `disable-fast-install' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
+dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
+
+
+# _LT_WITH_PIC([MODE])
+# --------------------
+# implement the --with-pic flag, and support the `pic-only' and `no-pic'
+# LT_INIT options.
+# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
+m4_define([_LT_WITH_PIC],
+[AC_ARG_WITH([pic],
+ [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
+ [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+ [lt_p=${PACKAGE-default}
+ case $withval in
+ yes|no) pic_mode=$withval ;;
+ *)
+ pic_mode=default
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for lt_pkg in $withval; do
+ IFS="$lt_save_ifs"
+ if test "X$lt_pkg" = "X$lt_p"; then
+ pic_mode=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [pic_mode=default])
+
+test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
+
+_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
+])# _LT_WITH_PIC
+
+LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
+
+# Old name:
+AU_DEFUN([AC_LIBTOOL_PICMODE],
+[_LT_SET_OPTION([LT_INIT], [pic-only])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `pic-only' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
+
+## ----------------- ##
+## LTDL_INIT Options ##
+## ----------------- ##
+
+m4_define([_LTDL_MODE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
+ [m4_define([_LTDL_MODE], [nonrecursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [recursive],
+ [m4_define([_LTDL_MODE], [recursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [subproject],
+ [m4_define([_LTDL_MODE], [subproject])])
+
+m4_define([_LTDL_TYPE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [installable],
+ [m4_define([_LTDL_TYPE], [installable])])
+LT_OPTION_DEFINE([LTDL_INIT], [convenience],
+ [m4_define([_LTDL_TYPE], [convenience])])
diff --git a/m4/ltsugar.m4 b/m4/ltsugar.m4
new file mode 100644
index 000000000000..9000a057d31d
--- /dev/null
+++ b/m4/ltsugar.m4
@@ -0,0 +1,123 @@
+# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 6 ltsugar.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
+
+
+# lt_join(SEP, ARG1, [ARG2...])
+# -----------------------------
+# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
+# associated separator.
+# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
+# versions in m4sugar had bugs.
+m4_define([lt_join],
+[m4_if([$#], [1], [],
+ [$#], [2], [[$2]],
+ [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
+m4_define([_lt_join],
+[m4_if([$#$2], [2], [],
+ [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
+
+
+# lt_car(LIST)
+# lt_cdr(LIST)
+# ------------
+# Manipulate m4 lists.
+# These macros are necessary as long as will still need to support
+# Autoconf-2.59 which quotes differently.
+m4_define([lt_car], [[$1]])
+m4_define([lt_cdr],
+[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
+ [$#], 1, [],
+ [m4_dquote(m4_shift($@))])])
+m4_define([lt_unquote], $1)
+
+
+# lt_append(MACRO-NAME, STRING, [SEPARATOR])
+# ------------------------------------------
+# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
+# Note that neither SEPARATOR nor STRING are expanded; they are appended
+# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
+# No SEPARATOR is output if MACRO-NAME was previously undefined (different
+# than defined and empty).
+#
+# This macro is needed until we can rely on Autoconf 2.62, since earlier
+# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
+m4_define([lt_append],
+[m4_define([$1],
+ m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
+
+
+
+# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
+# ----------------------------------------------------------
+# Produce a SEP delimited list of all paired combinations of elements of
+# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
+# has the form PREFIXmINFIXSUFFIXn.
+# Needed until we can rely on m4_combine added in Autoconf 2.62.
+m4_define([lt_combine],
+[m4_if(m4_eval([$# > 3]), [1],
+ [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
+[[m4_foreach([_Lt_prefix], [$2],
+ [m4_foreach([_Lt_suffix],
+ ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
+ [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
+
+
+# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
+# -----------------------------------------------------------------------
+# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
+# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
+m4_define([lt_if_append_uniq],
+[m4_ifdef([$1],
+ [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
+ [lt_append([$1], [$2], [$3])$4],
+ [$5])],
+ [lt_append([$1], [$2], [$3])$4])])
+
+
+# lt_dict_add(DICT, KEY, VALUE)
+# -----------------------------
+m4_define([lt_dict_add],
+[m4_define([$1($2)], [$3])])
+
+
+# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
+# --------------------------------------------
+m4_define([lt_dict_add_subkey],
+[m4_define([$1($2:$3)], [$4])])
+
+
+# lt_dict_fetch(DICT, KEY, [SUBKEY])
+# ----------------------------------
+m4_define([lt_dict_fetch],
+[m4_ifval([$3],
+ m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
+ m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
+
+
+# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
+# -----------------------------------------------------------------
+m4_define([lt_if_dict_fetch],
+[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
+ [$5],
+ [$6])])
+
+
+# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
+# --------------------------------------------------------------
+m4_define([lt_dict_filter],
+[m4_if([$5], [], [],
+ [lt_join(m4_quote(m4_default([$4], [[, ]])),
+ lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
+ [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
+])
diff --git a/m4/ltversion.m4 b/m4/ltversion.m4
new file mode 100644
index 000000000000..07a8602d48d6
--- /dev/null
+++ b/m4/ltversion.m4
@@ -0,0 +1,23 @@
+# ltversion.m4 -- version numbers -*- Autoconf -*-
+#
+# Copyright (C) 2004 Free Software Foundation, Inc.
+# Written by Scott James Remnant, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# @configure_input@
+
+# serial 3337 ltversion.m4
+# This file is part of GNU Libtool
+
+m4_define([LT_PACKAGE_VERSION], [2.4.2])
+m4_define([LT_PACKAGE_REVISION], [1.3337])
+
+AC_DEFUN([LTVERSION_VERSION],
+[macro_version='2.4.2'
+macro_revision='1.3337'
+_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
+_LT_DECL(, macro_revision, 0)
+])
diff --git a/m4/lt~obsolete.m4 b/m4/lt~obsolete.m4
new file mode 100644
index 000000000000..c573da90c5cc
--- /dev/null
+++ b/m4/lt~obsolete.m4
@@ -0,0 +1,98 @@
+# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+# Written by Scott James Remnant, 2004.
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 5 lt~obsolete.m4
+
+# These exist entirely to fool aclocal when bootstrapping libtool.
+#
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
+# which have later been changed to m4_define as they aren't part of the
+# exported API, or moved to Autoconf or Automake where they belong.
+#
+# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
+# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
+# using a macro with the same name in our local m4/libtool.m4 it'll
+# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
+# and doesn't know about Autoconf macros at all.)
+#
+# So we provide this file, which has a silly filename so it's always
+# included after everything else. This provides aclocal with the
+# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
+# because those macros already exist, or will be overwritten later.
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
+#
+# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
+# Yes, that means every name once taken will need to remain here until
+# we give up compatibility with versions before 1.7, at which point
+# we need to keep only those names which we still refer to.
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
+
+m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
+m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
+m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
+m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
+m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
+m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
+m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
+m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
+m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
+m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
+m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
+m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
+m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
+m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
+m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
+m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
+m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
+m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
+m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
+m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
+m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
+m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
+m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
+m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
+m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
+m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
+m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
+m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
+m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
+m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
+m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
+m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
+m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
+m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
+m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
+m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
+m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
+m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
+m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
+m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
+m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
+m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
+m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
+m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
+m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
+m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
+m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
+m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
+m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
+m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
diff --git a/net.c b/net.c
index 6b444da677bc..b8a5385e1c20 100644
--- a/net.c
+++ b/net.c
@@ -56,11 +56,417 @@ ldns_send(ldns_pkt **result_packet, ldns_resolver *r, const ldns_pkt *query_pkt)
return result;
}
+/* code from rdata.c */
+static struct sockaddr_storage *
+ldns_rdf2native_sockaddr_storage_port(
+ const ldns_rdf *rd, uint16_t port, size_t *size)
+{
+ struct sockaddr_storage *data;
+ struct sockaddr_in *data_in;
+ struct sockaddr_in6 *data_in6;
+
+ data = LDNS_MALLOC(struct sockaddr_storage);
+ if (!data) {
+ return NULL;
+ }
+ /* zero the structure for portability */
+ memset(data, 0, sizeof(struct sockaddr_storage));
+
+ switch(ldns_rdf_get_type(rd)) {
+ case LDNS_RDF_TYPE_A:
+#ifndef S_SPLINT_S
+ data->ss_family = AF_INET;
+#endif
+ data_in = (struct sockaddr_in*) data;
+ data_in->sin_port = (in_port_t)htons(port);
+ memcpy(&(data_in->sin_addr), ldns_rdf_data(rd), ldns_rdf_size(rd));
+ *size = sizeof(struct sockaddr_in);
+ return data;
+ case LDNS_RDF_TYPE_AAAA:
+#ifndef S_SPLINT_S
+ data->ss_family = AF_INET6;
+#endif
+ data_in6 = (struct sockaddr_in6*) data;
+ data_in6->sin6_port = (in_port_t)htons(port);
+ memcpy(&data_in6->sin6_addr, ldns_rdf_data(rd), ldns_rdf_size(rd));
+ *size = sizeof(struct sockaddr_in6);
+ return data;
+ default:
+ LDNS_FREE(data);
+ return NULL;
+ }
+}
+
+struct sockaddr_storage *
+ldns_rdf2native_sockaddr_storage(
+ const ldns_rdf *rd, uint16_t port, size_t *size)
+{
+ return ldns_rdf2native_sockaddr_storage_port(
+ rd, (port == 0 ? (uint16_t)LDNS_PORT : port), size);
+}
+
+/** best effort to set nonblocking */
+static void
+ldns_sock_nonblock(int sockfd)
+{
+#ifdef HAVE_FCNTL
+ int flag;
+ if((flag = fcntl(sockfd, F_GETFL)) != -1) {
+ flag |= O_NONBLOCK;
+ if(fcntl(sockfd, F_SETFL, flag) == -1) {
+ /* ignore error, continue blockingly */
+ }
+ }
+#elif defined(HAVE_IOCTLSOCKET)
+ unsigned long on = 1;
+ if(ioctlsocket(sockfd, FIONBIO, &on) != 0) {
+ /* ignore error, continue blockingly */
+ }
+#endif
+}
+
+/** best effort to set blocking */
+static void
+ldns_sock_block(int sockfd)
+{
+#ifdef HAVE_FCNTL
+ int flag;
+ if((flag = fcntl(sockfd, F_GETFL)) != -1) {
+ flag &= ~O_NONBLOCK;
+ if(fcntl(sockfd, F_SETFL, flag) == -1) {
+ /* ignore error, continue */
+ }
+ }
+#elif defined(HAVE_IOCTLSOCKET)
+ unsigned long off = 0;
+ if(ioctlsocket(sockfd, FIONBIO, &off) != 0) {
+ /* ignore error, continue */
+ }
+#endif
+}
+
+/** wait for a socket to become ready */
+static int
+ldns_sock_wait(int sockfd, struct timeval timeout, int write)
+{
+ int ret;
+#ifndef S_SPLINT_S
+ fd_set fds;
+ FD_ZERO(&fds);
+ FD_SET(FD_SET_T sockfd, &fds);
+ if(write)
+ ret = select(sockfd+1, NULL, &fds, NULL, &timeout);
+ else
+ ret = select(sockfd+1, &fds, NULL, NULL, &timeout);
+#endif
+ if(ret == 0)
+ /* timeout expired */
+ return 0;
+ else if(ret == -1)
+ /* error */
+ return 0;
+ return 1;
+}
+
+
+static int
+ldns_tcp_connect_from(const struct sockaddr_storage *to, socklen_t tolen,
+ const struct sockaddr_storage *from, socklen_t fromlen,
+ struct timeval timeout)
+{
+ int sockfd;
+
+#ifndef S_SPLINT_S
+ if ((sockfd = socket((int)((struct sockaddr*)to)->sa_family, SOCK_STREAM,
+ IPPROTO_TCP)) == -1) {
+ return 0;
+ }
+#endif
+ if (from && bind(sockfd, (const struct sockaddr*)from, fromlen) == -1){
+ return 0;
+ }
+
+ /* perform nonblocking connect, to be able to wait with select() */
+ ldns_sock_nonblock(sockfd);
+ if (connect(sockfd, (struct sockaddr*)to, tolen) == -1) {
+#ifndef USE_WINSOCK
+#ifdef EINPROGRESS
+ if(errno != EINPROGRESS) {
+#else
+ if(1) {
+#endif
+ close(sockfd);
+ return 0;
+ }
+#else /* USE_WINSOCK */
+ if(WSAGetLastError() != WSAEINPROGRESS &&
+ WSAGetLastError() != WSAEWOULDBLOCK) {
+ closesocket(sockfd);
+ return 0;
+ }
+#endif
+ /* error was only telling us that it would block */
+ }
+
+ /* wait(write) until connected or error */
+ while(1) {
+ int error = 0;
+ socklen_t len = (socklen_t)sizeof(error);
+
+ if(!ldns_sock_wait(sockfd, timeout, 1)) {
+#ifndef USE_WINSOCK
+ close(sockfd);
+#else
+ closesocket(sockfd);
+#endif
+ return 0;
+ }
+
+ /* check if there is a pending error for nonblocking connect */
+ if(getsockopt(sockfd, SOL_SOCKET, SO_ERROR, (void*)&error,
+ &len) < 0) {
+#ifndef USE_WINSOCK
+ error = errno; /* on solaris errno is error */
+#else
+ error = WSAGetLastError();
+#endif
+ }
+#ifndef USE_WINSOCK
+#if defined(EINPROGRESS) && defined(EWOULDBLOCK)
+ if(error == EINPROGRESS || error == EWOULDBLOCK)
+ continue; /* try again */
+#endif
+ else if(error != 0) {
+ close(sockfd);
+ /* error in errno for our user */
+ errno = error;
+ return 0;
+ }
+#else /* USE_WINSOCK */
+ if(error == WSAEINPROGRESS)
+ continue;
+ else if(error == WSAEWOULDBLOCK)
+ continue;
+ else if(error != 0) {
+ closesocket(sockfd);
+ errno = error;
+ return 0;
+ }
+#endif /* USE_WINSOCK */
+ /* connected */
+ break;
+ }
+
+ /* set the socket blocking again */
+ ldns_sock_block(sockfd);
+
+ return sockfd;
+}
+
+int
+ldns_tcp_connect(const struct sockaddr_storage *to, socklen_t tolen,
+ struct timeval timeout)
+{
+ return ldns_tcp_connect_from(to, tolen, NULL, 0, timeout);
+}
+
+static int
+ldns_tcp_bgsend_from(ldns_buffer *qbin,
+ const struct sockaddr_storage *to, socklen_t tolen,
+ const struct sockaddr_storage *from, socklen_t fromlen,
+ struct timeval timeout)
+{
+ int sockfd;
+
+ sockfd = ldns_tcp_connect_from(to, tolen, from, fromlen, timeout);
+
+ if (sockfd == 0) {
+ return 0;
+ }
+
+ if (ldns_tcp_send_query(qbin, sockfd, to, tolen) == 0) {
+#ifndef USE_WINSOCK
+ close(sockfd);
+#else
+ closesocket(sockfd);
+#endif
+ return 0;
+ }
+
+ return sockfd;
+}
+
+int
+ldns_tcp_bgsend(ldns_buffer *qbin,
+ const struct sockaddr_storage *to, socklen_t tolen,
+ struct timeval timeout)
+{
+ return ldns_tcp_bgsend_from(qbin, to, tolen, NULL, 0, timeout);
+}
+
+
+/* keep in mind that in DNS tcp messages the first 2 bytes signal the
+ * amount data to expect
+ */
+static ldns_status
+ldns_tcp_send_from(uint8_t **result, ldns_buffer *qbin,
+ const struct sockaddr_storage *to, socklen_t tolen,
+ const struct sockaddr_storage *from, socklen_t fromlen,
+ struct timeval timeout, size_t *answer_size)
+{
+ int sockfd;
+ uint8_t *answer;
+
+ sockfd = ldns_tcp_bgsend_from(qbin, to, tolen, from, fromlen, timeout);
+
+ if (sockfd == 0) {
+ return LDNS_STATUS_ERR;
+ }
+
+ answer = ldns_tcp_read_wire_timeout(sockfd, answer_size, timeout);
+#ifndef USE_WINSOCK
+ close(sockfd);
+#else
+ closesocket(sockfd);
+#endif
+
+ if (*answer_size == 0) {
+ /* oops */
+ return LDNS_STATUS_NETWORK_ERR;
+ }
+
+ /* resize accordingly */
+ *result = LDNS_XREALLOC(answer, uint8_t, (size_t)*answer_size);
+ if(!*result) {
+ LDNS_FREE(answer);
+ return LDNS_STATUS_MEM_ERR;
+ }
+ return LDNS_STATUS_OK;
+}
+
+ldns_status
+ldns_tcp_send(uint8_t **result, ldns_buffer *qbin,
+ const struct sockaddr_storage *to, socklen_t tolen,
+ struct timeval timeout, size_t *answer_size)
+{
+ return ldns_tcp_send_from(result, qbin,
+ to, tolen, NULL, 0, timeout, answer_size);
+}
+
+int
+ldns_udp_connect(const struct sockaddr_storage *to, struct timeval ATTR_UNUSED(timeout))
+{
+ int sockfd;
+
+#ifndef S_SPLINT_S
+ if ((sockfd = socket((int)((struct sockaddr*)to)->sa_family, SOCK_DGRAM,
+ IPPROTO_UDP))
+ == -1) {
+ return 0;
+ }
+#endif
+ return sockfd;
+}
+
+static int
+ldns_udp_bgsend_from(ldns_buffer *qbin,
+ const struct sockaddr_storage *to , socklen_t tolen,
+ const struct sockaddr_storage *from, socklen_t fromlen,
+ struct timeval timeout)
+{
+ int sockfd;
+
+ sockfd = ldns_udp_connect(to, timeout);
+
+ if (sockfd == 0) {
+ return 0;
+ }
+
+ if (from && bind(sockfd, (const struct sockaddr*)from, fromlen) == -1){
+ return 0;
+ }
+
+ if (ldns_udp_send_query(qbin, sockfd, to, tolen) == 0) {
+#ifndef USE_WINSOCK
+ close(sockfd);
+#else
+ closesocket(sockfd);
+#endif
+ return 0;
+ }
+ return sockfd;
+}
+
+int
+ldns_udp_bgsend(ldns_buffer *qbin,
+ const struct sockaddr_storage *to , socklen_t tolen,
+ struct timeval timeout)
+{
+ return ldns_udp_bgsend_from(qbin, to, tolen, NULL, 0, timeout);
+}
+
+static ldns_status
+ldns_udp_send_from(uint8_t **result, ldns_buffer *qbin,
+ const struct sockaddr_storage *to , socklen_t tolen,
+ const struct sockaddr_storage *from, socklen_t fromlen,
+ struct timeval timeout, size_t *answer_size)
+{
+ int sockfd;
+ uint8_t *answer;
+
+ sockfd = ldns_udp_bgsend_from(qbin, to, tolen, from, fromlen, timeout);
+
+ if (sockfd == 0) {
+ return LDNS_STATUS_SOCKET_ERROR;
+ }
+
+ /* wait for an response*/
+ if(!ldns_sock_wait(sockfd, timeout, 0)) {
+#ifndef USE_WINSOCK
+ close(sockfd);
+#else
+ closesocket(sockfd);
+#endif
+ return LDNS_STATUS_NETWORK_ERR;
+ }
+
+ /* set to nonblocking, so if the checksum is bad, it becomes
+ * an EGAIN error and the ldns_udp_send function does not block,
+ * but returns a 'NETWORK_ERROR' much like a timeout. */
+ ldns_sock_nonblock(sockfd);
+
+ answer = ldns_udp_read_wire(sockfd, answer_size, NULL, NULL);
+#ifndef USE_WINSOCK
+ close(sockfd);
+#else
+ closesocket(sockfd);
+#endif
+
+ if (*answer_size == 0) {
+ /* oops */
+ return LDNS_STATUS_NETWORK_ERR;
+ }
+
+ *result = answer;
+ return LDNS_STATUS_OK;
+}
+
+ldns_status
+ldns_udp_send(uint8_t **result, ldns_buffer *qbin,
+ const struct sockaddr_storage *to , socklen_t tolen,
+ struct timeval timeout, size_t *answer_size)
+{
+ return ldns_udp_send_from(result, qbin, to, tolen, NULL, 0,
+ timeout, answer_size);
+}
+
ldns_status
ldns_send_buffer(ldns_pkt **result, ldns_resolver *r, ldns_buffer *qb, ldns_rdf *tsig_mac)
{
uint8_t i;
-
+
+ struct sockaddr_storage *src = NULL;
+ size_t src_len;
struct sockaddr_storage *ns;
size_t ns_len;
struct timeval tv_s;
@@ -90,6 +496,11 @@ ldns_send_buffer(ldns_pkt **result, ldns_resolver *r, ldns_buffer *qb, ldns_rdf
ldns_resolver_nameservers_randomize(r);
}
+ if(ldns_resolver_source(r)) {
+ src = ldns_rdf2native_sockaddr_storage_port(
+ ldns_resolver_source(r), 0, &src_len);
+ }
+
/* loop through all defined nameservers */
for (i = 0; i < ldns_resolver_nameserver_count(r); i++) {
if (rtt[i] == LDNS_RESOLV_RTT_INF) {
@@ -129,12 +540,14 @@ ldns_send_buffer(ldns_pkt **result, ldns_resolver *r, ldns_buffer *qb, ldns_rdf
send_status = LDNS_STATUS_ERR;
/* reply_bytes implicitly handles our error */
- if (1 == ldns_resolver_usevc(r)) {
+ if (ldns_resolver_usevc(r)) {
for (retries = ldns_resolver_retry(r); retries > 0; retries--) {
send_status =
- ldns_tcp_send(&reply_bytes, qb, ns,
- (socklen_t)ns_len, ldns_resolver_timeout(r),
- &reply_size);
+ ldns_tcp_send_from(&reply_bytes, qb,
+ ns, (socklen_t)ns_len,
+ src, (socklen_t)src_len,
+ ldns_resolver_timeout(r),
+ &reply_size);
if (send_status == LDNS_STATUS_OK) {
break;
}
@@ -143,10 +556,11 @@ ldns_send_buffer(ldns_pkt **result, ldns_resolver *r, ldns_buffer *qb, ldns_rdf
for (retries = ldns_resolver_retry(r); retries > 0; retries--) {
/* ldns_rdf_print(stdout, ns_array[i]); */
send_status =
- ldns_udp_send(&reply_bytes, qb, ns,
- (socklen_t)ns_len, ldns_resolver_timeout(r),
- &reply_size);
-
+ ldns_udp_send_from(&reply_bytes, qb,
+ ns, (socklen_t)ns_len,
+ src, (socklen_t)src_len,
+ ldns_resolver_timeout(r),
+ &reply_size);
if (send_status == LDNS_STATUS_OK) {
break;
}
@@ -201,6 +615,9 @@ ldns_send_buffer(ldns_pkt **result, ldns_resolver *r, ldns_buffer *qb, ldns_rdf
sleep((unsigned int) ldns_resolver_retrans(r));
}
+ if(src) {
+ LDNS_FREE(src);
+ }
if (all_servers_rtt_inf) {
LDNS_FREE(reply_bytes);
return LDNS_STATUS_RES_NO_NS;
@@ -227,241 +644,6 @@ ldns_send_buffer(ldns_pkt **result, ldns_resolver *r, ldns_buffer *qb, ldns_rdf
return status;
}
-/** best effort to set nonblocking */
-static void
-ldns_sock_nonblock(int sockfd)
-{
-#ifdef HAVE_FCNTL
- int flag;
- if((flag = fcntl(sockfd, F_GETFL)) != -1) {
- flag |= O_NONBLOCK;
- if(fcntl(sockfd, F_SETFL, flag) == -1) {
- /* ignore error, continue blockingly */
- }
- }
-#elif defined(HAVE_IOCTLSOCKET)
- unsigned long on = 1;
- if(ioctlsocket(sockfd, FIONBIO, &on) != 0) {
- /* ignore error, continue blockingly */
- }
-#endif
-}
-
-/** best effort to set blocking */
-static void
-ldns_sock_block(int sockfd)
-{
-#ifdef HAVE_FCNTL
- int flag;
- if((flag = fcntl(sockfd, F_GETFL)) != -1) {
- flag &= ~O_NONBLOCK;
- if(fcntl(sockfd, F_SETFL, flag) == -1) {
- /* ignore error, continue */
- }
- }
-#elif defined(HAVE_IOCTLSOCKET)
- unsigned long off = 0;
- if(ioctlsocket(sockfd, FIONBIO, &off) != 0) {
- /* ignore error, continue */
- }
-#endif
-}
-
-/** wait for a socket to become ready */
-static int
-ldns_sock_wait(int sockfd, struct timeval timeout, int write)
-{
- int ret;
-#ifndef S_SPLINT_S
- fd_set fds;
- FD_ZERO(&fds);
- FD_SET(FD_SET_T sockfd, &fds);
- if(write)
- ret = select(sockfd+1, NULL, &fds, NULL, &timeout);
- else
- ret = select(sockfd+1, &fds, NULL, NULL, &timeout);
-#endif
- if(ret == 0)
- /* timeout expired */
- return 0;
- else if(ret == -1)
- /* error */
- return 0;
- return 1;
-}
-
-ldns_status
-ldns_udp_send(uint8_t **result, ldns_buffer *qbin, const struct sockaddr_storage *to,
- socklen_t tolen, struct timeval timeout, size_t *answer_size)
-{
- int sockfd;
- uint8_t *answer;
-
- sockfd = ldns_udp_bgsend(qbin, to, tolen, timeout);
-
- if (sockfd == 0) {
- return LDNS_STATUS_SOCKET_ERROR;
- }
-
- /* wait for an response*/
- if(!ldns_sock_wait(sockfd, timeout, 0)) {
-#ifndef USE_WINSOCK
- close(sockfd);
-#else
- closesocket(sockfd);
-#endif
- return LDNS_STATUS_NETWORK_ERR;
- }
-
- /* set to nonblocking, so if the checksum is bad, it becomes
- * an EGAIN error and the ldns_udp_send function does not block,
- * but returns a 'NETWORK_ERROR' much like a timeout. */
- ldns_sock_nonblock(sockfd);
-
- answer = ldns_udp_read_wire(sockfd, answer_size, NULL, NULL);
-#ifndef USE_WINSOCK
- close(sockfd);
-#else
- closesocket(sockfd);
-#endif
-
- if (*answer_size == 0) {
- /* oops */
- return LDNS_STATUS_NETWORK_ERR;
- }
-
- *result = answer;
- return LDNS_STATUS_OK;
-}
-
-int
-ldns_udp_bgsend(ldns_buffer *qbin, const struct sockaddr_storage *to, socklen_t tolen,
- struct timeval timeout)
-{
- int sockfd;
-
- sockfd = ldns_udp_connect(to, timeout);
-
- if (sockfd == 0) {
- return 0;
- }
-
- if (ldns_udp_send_query(qbin, sockfd, to, tolen) == 0) {
-#ifndef USE_WINSOCK
- close(sockfd);
-#else
- closesocket(sockfd);
-#endif
- return 0;
- }
- return sockfd;
-}
-
-int
-ldns_udp_connect(const struct sockaddr_storage *to, struct timeval ATTR_UNUSED(timeout))
-{
- int sockfd;
-
-#ifndef S_SPLINT_S
- if ((sockfd = socket((int)((struct sockaddr*)to)->sa_family, SOCK_DGRAM,
- IPPROTO_UDP))
- == -1) {
- return 0;
- }
-#endif
- return sockfd;
-}
-
-int
-ldns_tcp_connect(const struct sockaddr_storage *to, socklen_t tolen,
- struct timeval timeout)
-{
- int sockfd;
-
-#ifndef S_SPLINT_S
- if ((sockfd = socket((int)((struct sockaddr*)to)->sa_family, SOCK_STREAM,
- IPPROTO_TCP)) == -1) {
- return 0;
- }
-#endif
-
- /* perform nonblocking connect, to be able to wait with select() */
- ldns_sock_nonblock(sockfd);
- if (connect(sockfd, (struct sockaddr*)to, tolen) == -1) {
-#ifndef USE_WINSOCK
-#ifdef EINPROGRESS
- if(errno != EINPROGRESS) {
-#else
- if(1) {
-#endif
- close(sockfd);
- return 0;
- }
-#else /* USE_WINSOCK */
- if(WSAGetLastError() != WSAEINPROGRESS &&
- WSAGetLastError() != WSAEWOULDBLOCK) {
- closesocket(sockfd);
- return 0;
- }
-#endif
- /* error was only telling us that it would block */
- }
-
- /* wait(write) until connected or error */
- while(1) {
- int error = 0;
- socklen_t len = (socklen_t)sizeof(error);
-
- if(!ldns_sock_wait(sockfd, timeout, 1)) {
-#ifndef USE_WINSOCK
- close(sockfd);
-#else
- closesocket(sockfd);
-#endif
- return 0;
- }
-
- /* check if there is a pending error for nonblocking connect */
- if(getsockopt(sockfd, SOL_SOCKET, SO_ERROR, (void*)&error,
- &len) < 0) {
-#ifndef USE_WINSOCK
- error = errno; /* on solaris errno is error */
-#else
- error = WSAGetLastError();
-#endif
- }
-#ifndef USE_WINSOCK
-#if defined(EINPROGRESS) && defined(EWOULDBLOCK)
- if(error == EINPROGRESS || error == EWOULDBLOCK)
- continue; /* try again */
-#endif
- else if(error != 0) {
- close(sockfd);
- /* error in errno for our user */
- errno = error;
- return 0;
- }
-#else /* USE_WINSOCK */
- if(error == WSAEINPROGRESS)
- continue;
- else if(error == WSAEWOULDBLOCK)
- continue;
- else if(error != 0) {
- closesocket(sockfd);
- errno = error;
- return 0;
- }
-#endif /* USE_WINSOCK */
- /* connected */
- break;
- }
-
- /* set the socket blocking again */
- ldns_sock_block(sockfd);
-
- return sockfd;
-}
-
ssize_t
ldns_tcp_send_query(ldns_buffer *qbin, int sockfd,
const struct sockaddr_storage *to, socklen_t tolen)
@@ -643,110 +825,6 @@ ldns_tcp_read_wire(int sockfd, size_t *size)
return wire;
}
-/* keep in mind that in DNS tcp messages the first 2 bytes signal the
- * amount data to expect
- */
-ldns_status
-ldns_tcp_send(uint8_t **result, ldns_buffer *qbin, const struct sockaddr_storage *to,
- socklen_t tolen, struct timeval timeout, size_t *answer_size)
-{
- int sockfd;
- uint8_t *answer;
-
- sockfd = ldns_tcp_bgsend(qbin, to, tolen, timeout);
-
- if (sockfd == 0) {
- return LDNS_STATUS_ERR;
- }
-
- answer = ldns_tcp_read_wire_timeout(sockfd, answer_size, timeout);
-#ifndef USE_WINSOCK
- close(sockfd);
-#else
- closesocket(sockfd);
-#endif
-
- if (*answer_size == 0) {
- /* oops */
- return LDNS_STATUS_NETWORK_ERR;
- }
-
- /* resize accordingly */
- *result = LDNS_XREALLOC(answer, uint8_t, (size_t)*answer_size);
- if(!*result) {
- LDNS_FREE(answer);
- return LDNS_STATUS_MEM_ERR;
- }
- return LDNS_STATUS_OK;
-}
-
-int
-ldns_tcp_bgsend(ldns_buffer *qbin, const struct sockaddr_storage *to, socklen_t tolen,
- struct timeval timeout)
-{
- int sockfd;
-
- sockfd = ldns_tcp_connect(to, tolen, timeout);
-
- if (sockfd == 0) {
- return 0;
- }
-
- if (ldns_tcp_send_query(qbin, sockfd, to, tolen) == 0) {
-#ifndef USE_WINSOCK
- close(sockfd);
-#else
- closesocket(sockfd);
-#endif
- return 0;
- }
-
- return sockfd;
-}
-
-/* code from rdata.c */
-struct sockaddr_storage *
-ldns_rdf2native_sockaddr_storage(const ldns_rdf *rd, uint16_t port, size_t *size)
-{
- struct sockaddr_storage *data;
- struct sockaddr_in *data_in;
- struct sockaddr_in6 *data_in6;
-
- data = LDNS_MALLOC(struct sockaddr_storage);
- if (!data) {
- return NULL;
- }
- /* zero the structure for portability */
- memset(data, 0, sizeof(struct sockaddr_storage));
- if (port == 0) {
- port = LDNS_PORT;
- }
-
- switch(ldns_rdf_get_type(rd)) {
- case LDNS_RDF_TYPE_A:
-#ifndef S_SPLINT_S
- data->ss_family = AF_INET;
-#endif
- data_in = (struct sockaddr_in*) data;
- data_in->sin_port = (in_port_t)htons(port);
- memcpy(&(data_in->sin_addr), ldns_rdf_data(rd), ldns_rdf_size(rd));
- *size = sizeof(struct sockaddr_in);
- return data;
- case LDNS_RDF_TYPE_AAAA:
-#ifndef S_SPLINT_S
- data->ss_family = AF_INET6;
-#endif
- data_in6 = (struct sockaddr_in6*) data;
- data_in6->sin6_port = (in_port_t)htons(port);
- memcpy(&data_in6->sin6_addr, ldns_rdf_data(rd), ldns_rdf_size(rd));
- *size = sizeof(struct sockaddr_in6);
- return data;
- default:
- LDNS_FREE(data);
- return NULL;
- }
-}
-
#ifndef S_SPLINT_S
ldns_rdf *
ldns_sockaddr_storage2rdf(struct sockaddr_storage *sock, uint16_t *port)
@@ -789,6 +867,8 @@ ldns_axfr_start(ldns_resolver *resolver, ldns_rdf *domain, ldns_rr_class class)
ldns_pkt *query;
ldns_buffer *query_wire;
+ struct sockaddr_storage *src = NULL;
+ size_t src_len = 0;
struct sockaddr_storage *ns = NULL;
size_t ns_len = 0;
size_t ns_i;
@@ -803,6 +883,10 @@ ldns_axfr_start(ldns_resolver *resolver, ldns_rdf *domain, ldns_rr_class class)
if (!query) {
return LDNS_STATUS_ADDRESS_ERR;
}
+ if(ldns_resolver_source(resolver)) {
+ src = ldns_rdf2native_sockaddr_storage_port(
+ ldns_resolver_source(resolver), 0, &src_len);
+ }
/* For AXFR, we have to make the connection ourselves */
/* try all nameservers (which usually would mean v4 fallback if
* @hostname is used */
@@ -817,7 +901,9 @@ ldns_axfr_start(ldns_resolver *resolver, ldns_rdf *domain, ldns_rr_class class)
resolver->_nameservers[ns_i],
ldns_resolver_port(resolver), &ns_len);
- resolver->_socket = ldns_tcp_connect(ns, (socklen_t)ns_len,
+ resolver->_socket = ldns_tcp_connect_from(
+ ns, (socklen_t)ns_len,
+ src, (socklen_t)src_len,
ldns_resolver_timeout(resolver));
}
@@ -834,8 +920,8 @@ ldns_axfr_start(ldns_resolver *resolver, ldns_rdf *domain, ldns_rr_class class)
ldns_resolver_tsig_keydata(resolver),
300, ldns_resolver_tsig_algorithm(resolver), NULL);
if (status != LDNS_STATUS_OK) {
- /* RoRi: to prevent problems on subsequent calls to ldns_axfr_start
- we have to close the socket here! */
+ /* to prevent problems on subsequent calls to
+ * ldns_axfr_start we have to close the socket here! */
#ifndef USE_WINSOCK
close(resolver->_socket);
#else
@@ -873,8 +959,8 @@ ldns_axfr_start(ldns_resolver *resolver, ldns_rdf *domain, ldns_rr_class class)
ldns_buffer_free(query_wire);
LDNS_FREE(ns);
- /* RoRi: to prevent problems on subsequent calls to ldns_axfr_start
- we have to close the socket here! */
+ /* to prevent problems on subsequent calls to ldns_axfr_start
+ * we have to close the socket here! */
#ifndef USE_WINSOCK
close(resolver->_socket);
#else
@@ -891,8 +977,8 @@ ldns_axfr_start(ldns_resolver *resolver, ldns_rdf *domain, ldns_rr_class class)
ldns_buffer_free(query_wire);
LDNS_FREE(ns);
- /* RoRi: to prevent problems on subsequent calls to ldns_axfr_start
- we have to close the socket here! */
+ /* to prevent problems on subsequent calls to ldns_axfr_start
+ * we have to close the socket here! */
#ifndef USE_WINSOCK
close(resolver->_socket);
diff --git a/packaging/ldns-config.1 b/packaging/ldns-config.1
index c5a00a1eb384..72afc1898ebb 100644
--- a/packaging/ldns-config.1
+++ b/packaging/ldns-config.1
@@ -24,7 +24,11 @@ Show the flags to be used to link with ldns
.TP
\fB--version\fR
-Shows the version of the installed ldns library
+Shows the ldns version of the installed ldns library
+
+.TP
+\fB--libversion\fR
+Shows version of the binary api of the installed ldns library
.TP
\fB--help\fR
diff --git a/packaging/ldns-config.in b/packaging/ldns-config.in
index b728ba544e12..d2cf4d43cafa 100755
--- a/packaging/ldns-config.in
+++ b/packaging/ldns-config.in
@@ -9,6 +9,7 @@ LDFLAGS="@LDFLAGS@ @LIBSSL_LDFLAGS@ @PYTHON_LDFLAGS@"
LIBS="@LIBS@ @LIBSSL_LIBS@"
LIBDIR="@libdir@"
INCLUDEDIR="@includedir@"
+LIBVERSION="@LIBLDNS_CURRENT@.@LIBLDNS_REVISION@.@LIBLDNS_AGE@"
for arg in $@
do
@@ -28,4 +29,8 @@ do
then
echo "${VERSION}"
fi
+ if [ $arg = "--libversion" ]
+ then
+ echo "${LIBVERSION}"
+ fi
done
diff --git a/packet.c b/packet.c
index d57e9e275ed2..0ac64c52fc4f 100644
--- a/packet.c
+++ b/packet.c
@@ -266,7 +266,7 @@ ldns_pkt_rr_list_by_name(ldns_pkt *packet,
ret = NULL;
for(i = 0; i < ldns_rr_list_rr_count(rrs); i++) {
- if (ldns_rdf_compare(ldns_rr_owner(
+ if (ldns_dname_compare(ldns_rr_owner(
ldns_rr_list_rr(rrs, i)),
ownername) == 0) {
/* owner names match */
@@ -337,7 +337,7 @@ ldns_pkt_rr_list_by_name_and_type(const ldns_pkt *packet,
for(i = 0; i < ldns_rr_list_rr_count(rrs); i++) {
if (type == ldns_rr_get_type(ldns_rr_list_rr(rrs, i)) &&
- ldns_rdf_compare(ldns_rr_owner(ldns_rr_list_rr(rrs, i)),
+ ldns_dname_compare(ldns_rr_owner(ldns_rr_list_rr(rrs, i)),
ownername
) == 0
) {
@@ -379,7 +379,7 @@ ldns_pkt_rr(ldns_pkt *pkt, ldns_pkt_section sec, ldns_rr *rr)
return result;
}
-static uint16_t
+uint16_t
ldns_pkt_section_count(const ldns_pkt *packet, ldns_pkt_section s)
{
switch(s) {
@@ -827,8 +827,8 @@ ldns_pkt_set_flags(ldns_pkt *packet, uint16_t flags)
}
-static ldns_status
-ldns_pkt_add_authsoa(ldns_pkt* packet, ldns_rdf* rr_name, ldns_rr_class rr_class)
+static ldns_rr*
+ldns_pkt_authsoa(ldns_rdf* rr_name, ldns_rr_class rr_class)
{
ldns_rr* soa_rr = ldns_rr_new();
ldns_rdf *owner_rdf;
@@ -841,12 +841,12 @@ ldns_pkt_add_authsoa(ldns_pkt* packet, ldns_rdf* rr_name, ldns_rr_class rr_class
ldns_rdf *minimum_rdf;
if (!soa_rr) {
- return LDNS_STATUS_MEM_ERR;
+ return NULL;
}
owner_rdf = ldns_rdf_clone(rr_name);
if (!owner_rdf) {
ldns_rr_free(soa_rr);
- return LDNS_STATUS_MEM_ERR;
+ return NULL;
}
ldns_rr_set_owner(soa_rr, owner_rdf);
@@ -856,59 +856,59 @@ ldns_pkt_add_authsoa(ldns_pkt* packet, ldns_rdf* rr_name, ldns_rr_class rr_class
if (ldns_str2rdf_dname(&mname_rdf, ".") != LDNS_STATUS_OK) {
ldns_rr_free(soa_rr);
- return LDNS_STATUS_MEM_ERR;
+ return NULL;
} else {
ldns_rr_push_rdf(soa_rr, mname_rdf);
}
if (ldns_str2rdf_dname(&rname_rdf, ".") != LDNS_STATUS_OK) {
ldns_rr_free(soa_rr);
- return LDNS_STATUS_MEM_ERR;
+ return NULL;
} else {
ldns_rr_push_rdf(soa_rr, rname_rdf);
}
serial_rdf = ldns_native2rdf_int32(LDNS_RDF_TYPE_INT32, 0);
if (!serial_rdf) {
ldns_rr_free(soa_rr);
- return LDNS_STATUS_MEM_ERR;
+ return NULL;
} else {
ldns_rr_push_rdf(soa_rr, serial_rdf);
}
refresh_rdf = ldns_native2rdf_int32(LDNS_RDF_TYPE_INT32, 0);
if (!refresh_rdf) {
ldns_rr_free(soa_rr);
- return LDNS_STATUS_MEM_ERR;
+ return NULL;
} else {
ldns_rr_push_rdf(soa_rr, refresh_rdf);
}
retry_rdf = ldns_native2rdf_int32(LDNS_RDF_TYPE_INT32, 0);
if (!retry_rdf) {
ldns_rr_free(soa_rr);
- return LDNS_STATUS_MEM_ERR;
+ return NULL;
} else {
ldns_rr_push_rdf(soa_rr, retry_rdf);
}
expire_rdf = ldns_native2rdf_int32(LDNS_RDF_TYPE_INT32, 0);
if (!expire_rdf) {
ldns_rr_free(soa_rr);
- return LDNS_STATUS_MEM_ERR;
+ return NULL;
} else {
ldns_rr_push_rdf(soa_rr, expire_rdf);
}
minimum_rdf = ldns_native2rdf_int32(LDNS_RDF_TYPE_INT32, 0);
if (!minimum_rdf) {
ldns_rr_free(soa_rr);
- return LDNS_STATUS_MEM_ERR;
+ return NULL;
} else {
ldns_rr_push_rdf(soa_rr, minimum_rdf);
}
- ldns_pkt_push_rr(packet, LDNS_SECTION_AUTHORITY, soa_rr);
- return LDNS_STATUS_OK;
+ return soa_rr;
}
-ldns_status
-ldns_pkt_query_new_frm_str(ldns_pkt **p, const char *name, ldns_rr_type rr_type,
- ldns_rr_class rr_class, uint16_t flags)
+static ldns_status
+ldns_pkt_query_new_frm_str_internal(ldns_pkt **p, const char *name,
+ ldns_rr_type rr_type, ldns_rr_class rr_class, uint16_t flags,
+ ldns_rr* authsoa_rr)
{
ldns_pkt *packet;
ldns_rr *question_rr;
@@ -918,11 +918,11 @@ ldns_pkt_query_new_frm_str(ldns_pkt **p, const char *name, ldns_rr_type rr_type,
if (!packet) {
return LDNS_STATUS_MEM_ERR;
}
-
+
if (!ldns_pkt_set_flags(packet, flags)) {
return LDNS_STATUS_ERR;
}
-
+
question_rr = ldns_rr_new();
if (!question_rr) {
return LDNS_STATUS_MEM_ERR;
@@ -948,12 +948,8 @@ ldns_pkt_query_new_frm_str(ldns_pkt **p, const char *name, ldns_rr_type rr_type,
return LDNS_STATUS_ERR;
}
- /** IXFR? */
- if (rr_type == LDNS_RR_TYPE_IXFR) {
- if (ldns_pkt_add_authsoa(packet, name_rdf, rr_class) != LDNS_STATUS_OK) {
- ldns_pkt_free(packet);
- return LDNS_STATUS_ERR;
- }
+ if (authsoa_rr) {
+ ldns_pkt_push_rr(packet, LDNS_SECTION_AUTHORITY, authsoa_rr);
}
packet->_tsig_rr = NULL;
@@ -967,9 +963,33 @@ ldns_pkt_query_new_frm_str(ldns_pkt **p, const char *name, ldns_rr_type rr_type,
}
}
-ldns_pkt *
-ldns_pkt_query_new(ldns_rdf *rr_name, ldns_rr_type rr_type, ldns_rr_class rr_class,
- uint16_t flags)
+ldns_status
+ldns_pkt_query_new_frm_str(ldns_pkt **p, const char *name,
+ ldns_rr_type rr_type, ldns_rr_class rr_class, uint16_t flags)
+{
+ return ldns_pkt_query_new_frm_str_internal(p, name, rr_type,
+ rr_class, flags, NULL);
+}
+
+ldns_status
+ldns_pkt_ixfr_request_new_frm_str(ldns_pkt **p, const char *name,
+ ldns_rr_class rr_class, uint16_t flags, ldns_rr *soa)
+{
+ ldns_rr* authsoa_rr = soa;
+ if (!authsoa_rr) {
+ ldns_rdf *name_rdf;
+ if (ldns_str2rdf_dname(&name_rdf, name) == LDNS_STATUS_OK) {
+ authsoa_rr = ldns_pkt_authsoa(name_rdf, rr_class);
+ }
+ ldns_rdf_free(name_rdf);
+ }
+ return ldns_pkt_query_new_frm_str_internal(p, name, LDNS_RR_TYPE_IXFR,
+ rr_class, flags, authsoa_rr);
+}
+
+static ldns_pkt *
+ldns_pkt_query_new_internal(ldns_rdf *rr_name, ldns_rr_type rr_type,
+ ldns_rr_class rr_class, uint16_t flags, ldns_rr* authsoa_rr)
{
ldns_pkt *packet;
ldns_rr *question_rr;
@@ -982,7 +1002,7 @@ ldns_pkt_query_new(ldns_rdf *rr_name, ldns_rr_type rr_type, ldns_rr_class rr_cla
if (!ldns_pkt_set_flags(packet, flags)) {
return NULL;
}
-
+
question_rr = ldns_rr_new();
if (!question_rr) {
ldns_pkt_free(packet);
@@ -1002,18 +1022,34 @@ ldns_pkt_query_new(ldns_rdf *rr_name, ldns_rr_type rr_type, ldns_rr_class rr_cla
ldns_rr_set_question(question_rr, true);
ldns_pkt_push_rr(packet, LDNS_SECTION_QUESTION, question_rr);
- /** IXFR? */
- if (rr_type == LDNS_RR_TYPE_IXFR) {
- if (ldns_pkt_add_authsoa(packet, rr_name, rr_class) != LDNS_STATUS_OK) {
- ldns_pkt_free(packet);
- return NULL;
- }
+ if (authsoa_rr) {
+ ldns_pkt_push_rr(packet, LDNS_SECTION_AUTHORITY, authsoa_rr);
}
packet->_tsig_rr = NULL;
return packet;
}
+ldns_pkt *
+ldns_pkt_query_new(ldns_rdf *rr_name, ldns_rr_type rr_type,
+ ldns_rr_class rr_class, uint16_t flags)
+{
+ return ldns_pkt_query_new_internal(rr_name, rr_type,
+ rr_class, flags, NULL);
+}
+
+ldns_pkt *
+ldns_pkt_ixfr_request_new(ldns_rdf *rr_name, ldns_rr_class rr_class,
+ uint16_t flags, ldns_rr* soa)
+{
+ ldns_rr* authsoa_rr = soa;
+ if (!authsoa_rr) {
+ authsoa_rr = ldns_pkt_authsoa(rr_name, rr_class);
+ }
+ return ldns_pkt_query_new_internal(rr_name, LDNS_RR_TYPE_IXFR,
+ rr_class, flags, authsoa_rr);
+}
+
ldns_pkt_type
ldns_pkt_reply_type(ldns_pkt *p)
{
diff --git a/parse.c b/parse.c
index 8849effad6ff..710c4e70b848 100644
--- a/parse.c
+++ b/parse.c
@@ -135,7 +135,7 @@ ldns_fget_token_l(FILE *f, char *token, const char *delim, size_t limit, int *li
if (c != '\0' && c != '\n') {
i++;
}
- if (limit > 0 && i >= limit) {
+ if (limit > 0 && (i >= limit || (size_t)(t-token) >= limit)) {
*t = '\0';
return -1;
}
@@ -308,7 +308,7 @@ ldns_bget_token(ldns_buffer *b, char *token, const char *delim, size_t limit)
}
i++;
- if (limit > 0 && i >= limit) {
+ if (limit > 0 && (i >= limit || (size_t)(t-token) >= limit)) {
*t = '\0';
return -1;
}
diff --git a/radix.c b/radix.c
new file mode 100644
index 000000000000..697975672137
--- /dev/null
+++ b/radix.c
@@ -0,0 +1,1590 @@
+/*
+ * radix.c -- generic radix tree
+ *
+ * Taken from NSD4, modified for ldns
+ *
+ * Copyright (c) 2012, NLnet Labs. All rights reserved.
+ *
+ * This software is open source.
+ *
+ * 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 NLNET LABS nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+/**
+ * \file
+ * Implementation of a radix tree.
+ */
+
+#include <ldns/config.h>
+#include <ldns/radix.h>
+#include <ldns/util.h>
+#include <stdlib.h>
+
+/** Helper functions */
+static ldns_radix_node_t* ldns_radix_new_node(void* data, uint8_t* key,
+ radix_strlen_t len);
+static int ldns_radix_find_prefix(ldns_radix_t* tree, uint8_t* key,
+ radix_strlen_t len, ldns_radix_node_t** result, radix_strlen_t* pos);
+static int ldns_radix_array_space(ldns_radix_node_t* node, uint8_t byte);
+static int ldns_radix_array_grow(ldns_radix_node_t* node, unsigned need);
+static int ldns_radix_str_create(ldns_radix_array_t* array, uint8_t* key,
+ radix_strlen_t pos, radix_strlen_t len);
+static int ldns_radix_prefix_remainder(radix_strlen_t prefix_len,
+ uint8_t* longer_str, radix_strlen_t longer_len, uint8_t** split_str,
+ radix_strlen_t* split_len);
+static int ldns_radix_array_split(ldns_radix_array_t* array, uint8_t* key,
+ radix_strlen_t pos, radix_strlen_t len, ldns_radix_node_t* add);
+static int ldns_radix_str_is_prefix(uint8_t* str1, radix_strlen_t len1,
+ uint8_t* str2, radix_strlen_t len2);
+static radix_strlen_t ldns_radix_str_common(uint8_t* str1, radix_strlen_t len1,
+ uint8_t* str2, radix_strlen_t len2);
+static ldns_radix_node_t* ldns_radix_next_in_subtree(ldns_radix_node_t* node);
+static ldns_radix_node_t* ldns_radix_prev_from_index(ldns_radix_node_t* node,
+ uint8_t index);
+static ldns_radix_node_t* ldns_radix_last_in_subtree_incl_self(
+ ldns_radix_node_t* node);
+static ldns_radix_node_t* ldns_radix_last_in_subtree(ldns_radix_node_t* node);
+static void ldns_radix_del_fix(ldns_radix_t* tree, ldns_radix_node_t* node);
+static void ldns_radix_cleanup_onechild(ldns_radix_node_t* node);
+static void ldns_radix_cleanup_leaf(ldns_radix_node_t* node);
+static void ldns_radix_node_free(ldns_radix_node_t* node, void* arg);
+static void ldns_radix_node_array_free(ldns_radix_node_t* node);
+static void ldns_radix_node_array_free_front(ldns_radix_node_t* node);
+static void ldns_radix_node_array_free_end(ldns_radix_node_t* node);
+static void ldns_radix_array_reduce(ldns_radix_node_t* node);
+static void ldns_radix_self_or_prev(ldns_radix_node_t* node,
+ ldns_radix_node_t** result);
+
+
+/**
+ * Create a new radix node.
+ *
+ */
+static ldns_radix_node_t*
+ldns_radix_new_node(void* data, uint8_t* key, radix_strlen_t len)
+{
+ ldns_radix_node_t* node = LDNS_MALLOC(ldns_radix_node_t);
+ if (!node) {
+ return NULL;
+ }
+ node->data = data;
+ node->key = key;
+ node->klen = len;
+ node->parent = NULL;
+ node->parent_index = 0;
+ node->len = 0;
+ node->offset = 0;
+ node->capacity = 0;
+ node->array = NULL;
+ return node;
+}
+
+
+/**
+ * Create a new radix tree.
+ *
+ */
+ldns_radix_t *
+ldns_radix_create(void)
+{
+ ldns_radix_t* tree;
+
+ /** Allocate memory for it */
+ tree = (ldns_radix_t *) LDNS_MALLOC(ldns_radix_t);
+ if (!tree) {
+ return NULL;
+ }
+ /** Initialize it */
+ ldns_radix_init(tree);
+ return tree;
+}
+
+
+/**
+ * Initialize radix tree.
+ *
+ */
+void
+ldns_radix_init(ldns_radix_t* tree)
+{
+ /** Initialize it */
+ if (tree) {
+ tree->root = NULL;
+ tree->count = 0;
+ }
+ return;
+}
+
+
+/**
+ * Free radix tree.
+ *
+ */
+void
+ldns_radix_free(ldns_radix_t* tree)
+{
+ if (tree) {
+ if (tree->root) {
+ ldns_radix_traverse_postorder(tree->root,
+ ldns_radix_node_free, NULL);
+ }
+ LDNS_FREE(tree);
+ }
+ return;
+}
+
+
+/**
+ * Insert data into the tree.
+ *
+ */
+ldns_status
+ldns_radix_insert(ldns_radix_t* tree, uint8_t* key, radix_strlen_t len,
+ void* data)
+{
+ radix_strlen_t pos = 0;
+ ldns_radix_node_t* add = NULL;
+ ldns_radix_node_t* prefix = NULL;
+
+ if (!tree || !key || !data) {
+ return LDNS_STATUS_NULL;
+ }
+ add = ldns_radix_new_node(data, key, len);
+ if (!add) {
+ return LDNS_STATUS_MEM_ERR;
+ }
+ /** Search the trie until we can make no further process. */
+ if (!ldns_radix_find_prefix(tree, key, len, &prefix, &pos)) {
+ /** No prefix found */
+ assert(tree->root == NULL);
+ if (len == 0) {
+ /**
+ * Example 1: The root:
+ * | [0]
+ **/
+ tree->root = add;
+ } else {
+ /** Example 2: 'dns':
+ * | [0]
+ * --| [d+ns] dns
+ **/
+ prefix = ldns_radix_new_node(NULL, (uint8_t*)"", 0);
+ if (!prefix) {
+ LDNS_FREE(add);
+ return LDNS_STATUS_MEM_ERR;
+ }
+ /** Find some space in the array for the first byte */
+ if (!ldns_radix_array_space(prefix, key[0])) {
+ LDNS_FREE(add);
+ LDNS_FREE(prefix->array);
+ LDNS_FREE(prefix);
+ return LDNS_STATUS_MEM_ERR;
+ }
+ /** Set relational pointers */
+ add->parent = prefix;
+ add->parent_index = 0;
+ prefix->array[0].edge = add;
+ if (len > 1) {
+ /** Store the remainder of the prefix */
+ if (!ldns_radix_prefix_remainder(1, key,
+ len, &prefix->array[0].str,
+ &prefix->array[0].len)) {
+ LDNS_FREE(add);
+ LDNS_FREE(prefix->array);
+ LDNS_FREE(prefix);
+ return LDNS_STATUS_MEM_ERR;
+ }
+ }
+ tree->root = prefix;
+ }
+ } else if (pos == len) {
+ /** Exact match found */
+ if (prefix->data) {
+ /* Element already exists */
+ LDNS_FREE(add);
+ return LDNS_STATUS_EXISTS_ERR;
+ }
+ prefix->data = data;
+ prefix->key = key;
+ prefix->klen = len; /* redundant */
+ } else {
+ /** Prefix found */
+ uint8_t byte = key[pos];
+ assert(pos < len);
+ if (byte < prefix->offset ||
+ (byte - prefix->offset) >= prefix->len) {
+ /** Find some space in the array for the byte. */
+ /**
+ * Example 3: 'ldns'
+ * | [0]
+ * --| [d+ns] dns
+ * --| [l+dns] ldns
+ **/
+ if (!ldns_radix_array_space(prefix, byte)) {
+ LDNS_FREE(add);
+ return LDNS_STATUS_MEM_ERR;
+ }
+ assert(byte >= prefix->offset);
+ assert((byte - prefix->offset) <= prefix->len);
+ byte -= prefix->offset;
+ if (pos+1 < len) {
+ /** Create remainder of the string. */
+ if (!ldns_radix_str_create(
+ &prefix->array[byte], key, pos+1,
+ len)) {
+ LDNS_FREE(add);
+ return LDNS_STATUS_MEM_ERR;
+ }
+ }
+ /** Add new node. */
+ add->parent = prefix;
+ add->parent_index = byte;
+ prefix->array[byte].edge = add;
+ } else if (prefix->array[byte-prefix->offset].edge == NULL) {
+ /** Use existing element. */
+ /**
+ * Example 4: 'edns'
+ * | [0]
+ * --| [d+ns] dns
+ * --| [e+dns] edns
+ * --| [l+dns] ldns
+ **/
+ byte -= prefix->offset;
+ if (pos+1 < len) {
+ /** Create remainder of the string. */
+ if (!ldns_radix_str_create(
+ &prefix->array[byte], key, pos+1,
+ len)) {
+ LDNS_FREE(add);
+ return LDNS_STATUS_MEM_ERR;
+ }
+ }
+ /** Add new node. */
+ add->parent = prefix;
+ add->parent_index = byte;
+ prefix->array[byte].edge = add;
+ } else {
+ /**
+ * Use existing element, but it has a shared prefix,
+ * we need a split.
+ */
+ if (!ldns_radix_array_split(&prefix->array[byte-(prefix->offset)],
+ key, pos+1, len, add)) {
+ LDNS_FREE(add);
+ return LDNS_STATUS_MEM_ERR;
+ }
+ }
+ }
+
+ tree->count ++;
+ return LDNS_STATUS_OK;
+}
+
+
+/**
+ * Delete data from the tree.
+ *
+ */
+void* ldns_radix_delete(ldns_radix_t* tree, uint8_t* key, radix_strlen_t len)
+{
+ ldns_radix_node_t* del = ldns_radix_search(tree, key, len);
+ void* data = NULL;
+ if (del) {
+ tree->count--;
+ data = del->data;
+ del->data = NULL;
+ ldns_radix_del_fix(tree, del);
+ return data;
+ }
+ return NULL;
+}
+
+
+/**
+ * Search data in the tree.
+ *
+ */
+ldns_radix_node_t*
+ldns_radix_search(ldns_radix_t* tree, uint8_t* key, radix_strlen_t len)
+{
+ ldns_radix_node_t* node = NULL;
+ radix_strlen_t pos = 0;
+ uint8_t byte = 0;
+
+ if (!tree || !key) {
+ return NULL;
+ }
+ node = tree->root;
+ while (node) {
+ if (pos == len) {
+ return node->data?node:NULL;
+ }
+ byte = key[pos];
+ if (byte < node->offset) {
+ return NULL;
+ }
+ byte -= node->offset;
+ if (byte >= node->len) {
+ return NULL;
+ }
+ pos++;
+ if (node->array[byte].len > 0) {
+ /** Must match additional string. */
+ if (pos + node->array[byte].len > len) {
+ return NULL;
+ }
+ if (memcmp(&key[pos], node->array[byte].str,
+ node->array[byte].len) != 0) {
+ return NULL;
+ }
+ pos += node->array[byte].len;
+ }
+ node = node->array[byte].edge;
+ }
+ return NULL;
+}
+
+
+/**
+ * Search data in the tree, and if not found, find the closest smaller
+ * element in the tree.
+ *
+ */
+int
+ldns_radix_find_less_equal(ldns_radix_t* tree, uint8_t* key,
+ radix_strlen_t len, ldns_radix_node_t** result)
+{
+ ldns_radix_node_t* node = NULL;
+ radix_strlen_t pos = 0;
+ uint8_t byte;
+ int memcmp_res = 0;
+
+ if (!tree || !tree->root || !key) {
+ *result = NULL;
+ return 0;
+ }
+
+ node = tree->root;
+ while (pos < len) {
+ byte = key[pos];
+ if (byte < node->offset) {
+ /**
+ * No exact match. The lesser is in this or the
+ * previous node.
+ */
+ ldns_radix_self_or_prev(node, result);
+ return 0;
+ }
+ byte -= node->offset;
+ if (byte >= node->len) {
+ /**
+ * No exact match. The lesser is in this node or the
+ * last of this array, or something before this node.
+ */
+ *result = ldns_radix_last_in_subtree_incl_self(node);
+ if (*result == NULL) {
+ *result = ldns_radix_prev(node);
+ }
+ return 0;
+ }
+ pos++;
+ if (!node->array[byte].edge) {
+ /**
+ * No exact match. Find the previous in the array
+ * from this index.
+ */
+ *result = ldns_radix_prev_from_index(node, byte);
+ if (*result == NULL) {
+ ldns_radix_self_or_prev(node, result);
+ }
+ return 0;
+ }
+ if (node->array[byte].len != 0) {
+ /** Must match additional string. */
+ if (pos + node->array[byte].len > len) {
+ /** Additional string is longer than key. */
+ if (memcmp(&key[pos], node->array[byte].str,
+ len-pos) <= 0) {
+ /** Key is before this node. */
+ *result = ldns_radix_prev(
+ node->array[byte].edge);
+ } else {
+ /** Key is after additional string. */
+ *result = ldns_radix_last_in_subtree_incl_self(node->array[byte].edge);
+ if (*result == NULL) {
+ *result = ldns_radix_prev(node->array[byte].edge);
+ }
+ }
+ return 0;
+ }
+ memcmp_res = memcmp(&key[pos], node->array[byte].str,
+ node->array[byte].len);
+ if (memcmp_res < 0) {
+ *result = ldns_radix_prev(
+ node->array[byte].edge);
+ return 0;
+ } else if (memcmp_res > 0) {
+ *result = ldns_radix_last_in_subtree_incl_self(node->array[byte].edge);
+ if (*result == NULL) {
+ *result = ldns_radix_prev(node->array[byte].edge);
+ }
+ return 0;
+ }
+
+ pos += node->array[byte].len;
+ }
+ node = node->array[byte].edge;
+ }
+ if (node->data) {
+ /** Exact match. */
+ *result = node;
+ return 1;
+ }
+ /** There is a node which is an exact match, but has no element. */
+ *result = ldns_radix_prev(node);
+ return 0;
+}
+
+
+/**
+ * Get the first element in the tree.
+ *
+ */
+ldns_radix_node_t*
+ldns_radix_first(ldns_radix_t* tree)
+{
+ ldns_radix_node_t* first = NULL;
+ if (!tree || !tree->root) {
+ return NULL;
+ }
+ first = tree->root;
+ if (first->data) {
+ return first;
+ }
+ return ldns_radix_next(first);
+}
+
+
+/**
+ * Get the last element in the tree.
+ *
+ */
+ldns_radix_node_t*
+ldns_radix_last(ldns_radix_t* tree)
+{
+ if (!tree || !tree->root) {
+ return NULL;
+ }
+ return ldns_radix_last_in_subtree_incl_self(tree->root);
+}
+
+
+/**
+ * Next element.
+ *
+ */
+ldns_radix_node_t*
+ldns_radix_next(ldns_radix_node_t* node)
+{
+ if (!node) {
+ return NULL;
+ }
+ if (node->len) {
+ /** Go down: most-left child is the next. */
+ ldns_radix_node_t* next = ldns_radix_next_in_subtree(node);
+ if (next) {
+ return next;
+ }
+ }
+ /** No elements in subtree, get to parent and go down next branch. */
+ while (node->parent) {
+ uint8_t index = node->parent_index;
+ node = node->parent;
+ index++;
+ for (; index < node->len; index++) {
+ if (node->array[index].edge) {
+ ldns_radix_node_t* next;
+ /** Node itself. */
+ if (node->array[index].edge->data) {
+ return node->array[index].edge;
+ }
+ /** Dive into subtree. */
+ next = ldns_radix_next_in_subtree(node);
+ if (next) {
+ return next;
+ }
+ }
+ }
+ }
+ return NULL;
+}
+
+
+/**
+ * Previous element.
+ *
+ */
+ldns_radix_node_t*
+ldns_radix_prev(ldns_radix_node_t* node)
+{
+ if (!node) {
+ return NULL;
+ }
+
+ /** Get to parent and go down previous branch. */
+ while (node->parent) {
+ uint8_t index = node->parent_index;
+ ldns_radix_node_t* prev;
+ node = node->parent;
+ assert(node->len > 0);
+ prev = ldns_radix_prev_from_index(node, index);
+ if (prev) {
+ return prev;
+ }
+ if (node->data) {
+ return node;
+ }
+ }
+ return NULL;
+}
+
+
+/**
+ * Print node.
+ *
+ */
+static void
+ldns_radix_node_print(FILE* fd, ldns_radix_node_t* node,
+ uint8_t i, uint8_t* str, radix_strlen_t len, unsigned d)
+{
+ uint8_t j;
+ if (!node) {
+ return;
+ }
+ for (j = 0; j < d; j++) {
+ fprintf(fd, "--");
+ }
+ if (str) {
+ radix_strlen_t l;
+ fprintf(fd, "| [%u+", (unsigned) i);
+ for (l=0; l < len; l++) {
+ fprintf(fd, "%c", (char) str[l]);
+ }
+ fprintf(fd, "]%u", (unsigned) len);
+ } else {
+ fprintf(fd, "| [%u]", (unsigned) i);
+ }
+
+ if (node->data) {
+ fprintf(fd, " %s", (char*) node->data);
+ }
+ fprintf(fd, "\n");
+
+ for (j = 0; j < node->len; j++) {
+ if (node->array[j].edge) {
+ ldns_radix_node_print(fd, node->array[j].edge, j,
+ node->array[j].str, node->array[j].len, d+1);
+ }
+ }
+ return;
+}
+
+
+/**
+ * Print radix tree.
+ *
+ */
+void
+ldns_radix_printf(FILE* fd, ldns_radix_t* tree)
+{
+ if (!fd || !tree) {
+ return;
+ }
+ if (!tree->root) {
+ fprintf(fd, "; empty radix tree\n");
+ return;
+ }
+ ldns_radix_node_print(fd, tree->root, 0, NULL, 0, 0);
+ return;
+}
+
+
+/**
+ * Join two radix trees.
+ *
+ */
+ldns_status
+ldns_radix_join(ldns_radix_t* tree1, ldns_radix_t* tree2)
+{
+ ldns_radix_node_t* cur_node, *next_node;
+ ldns_status status;
+ if (!tree2 || !tree2->root) {
+ return LDNS_STATUS_OK;
+ }
+ /** Add all elements from tree2 into tree1. */
+
+ cur_node = ldns_radix_first(tree2);
+ while (cur_node) {
+ status = LDNS_STATUS_NO_DATA;
+ /** Insert current node into tree1 */
+ if (cur_node->data) {
+ status = ldns_radix_insert(tree1, cur_node->key,
+ cur_node->klen, cur_node->data);
+ /** Exist errors may occur */
+ if (status != LDNS_STATUS_OK &&
+ status != LDNS_STATUS_EXISTS_ERR) {
+ return status;
+ }
+ }
+ next_node = ldns_radix_next(cur_node);
+ if (status == LDNS_STATUS_OK) {
+ (void) ldns_radix_delete(tree2, cur_node->key,
+ cur_node->klen);
+ }
+ cur_node = next_node;
+ }
+
+ return LDNS_STATUS_OK;
+}
+
+
+/**
+ * Split a radix tree intwo.
+ *
+ */
+ldns_status
+ldns_radix_split(ldns_radix_t* tree1, size_t num, ldns_radix_t** tree2)
+{
+ size_t count = 0;
+ ldns_radix_node_t* cur_node;
+ ldns_status status = LDNS_STATUS_OK;
+ if (!tree1 || !tree1->root || num == 0) {
+ return LDNS_STATUS_OK;
+ }
+ if (!tree2) {
+ return LDNS_STATUS_NULL;
+ }
+ if (!*tree2) {
+ *tree2 = ldns_radix_create();
+ if (!*tree2) {
+ return LDNS_STATUS_MEM_ERR;
+ }
+ }
+ cur_node = ldns_radix_first(tree1);
+ while (count < num && cur_node) {
+ if (cur_node->data) {
+ /** Delete current node from tree1. */
+ uint8_t* cur_key = cur_node->key;
+ radix_strlen_t cur_len = cur_node->klen;
+ void* cur_data = ldns_radix_delete(tree1, cur_key,
+ cur_len);
+ /** Insert current node into tree2/ */
+ if (!cur_data) {
+ return LDNS_STATUS_NO_DATA;
+ }
+ status = ldns_radix_insert(*tree2, cur_key, cur_len,
+ cur_data);
+ if (status != LDNS_STATUS_OK &&
+ status != LDNS_STATUS_EXISTS_ERR) {
+ return status;
+ }
+/*
+ if (status == LDNS_STATUS_OK) {
+ cur_node->key = NULL;
+ cur_node->klen = 0;
+ }
+*/
+ /** Update count; get first element from tree1 again. */
+ count++;
+ cur_node = ldns_radix_first(tree1);
+ } else {
+ cur_node = ldns_radix_next(cur_node);
+ }
+ }
+ return LDNS_STATUS_OK;
+}
+
+
+/**
+ * Call function for all nodes in the tree, such that leaf nodes are
+ * called before parent nodes.
+ *
+ */
+void
+ldns_radix_traverse_postorder(ldns_radix_node_t* node,
+ void (*func)(ldns_radix_node_t*, void*), void* arg)
+{
+ uint8_t i;
+ if (!node) {
+ return;
+ }
+ for (i=0; i < node->len; i++) {
+ ldns_radix_traverse_postorder(node->array[i].edge,
+ func, arg);
+ }
+ /** Call user function */
+ (*func)(node, arg);
+ return;
+}
+
+
+/** Static helper functions */
+
+/**
+ * Find a prefix of the key.
+ * @param tree: tree.
+ * @param key: key.
+ * @param len: length of key.
+ * @param result: the longest prefix, the entry itself if *pos==len,
+ * otherwise an array entry.
+ * @param pos: position in string where next unmatched byte is.
+ * If *pos==len, an exact match is found.
+ * If *pos== 0, a "" match was found.
+ * @return 0 (false) if no prefix found.
+ *
+ */
+static int
+ldns_radix_find_prefix(ldns_radix_t* tree, uint8_t* key,
+ radix_strlen_t len, ldns_radix_node_t** result, radix_strlen_t* respos)
+{
+ /** Start searching at the root node */
+ ldns_radix_node_t* n = tree->root;
+ radix_strlen_t pos = 0;
+ uint8_t byte;
+ *respos = 0;
+ *result = n;
+ if (!n) {
+ /** No root, no prefix found */
+ return 0;
+ }
+ /** For each node, look if we can make further progress */
+ while (n) {
+ if (pos == len) {
+ /** Exact match */
+ return 1;
+ }
+ byte = key[pos];
+ if (byte < n->offset) {
+ /** key < node */
+ return 1;
+ }
+ byte -= n->offset;
+ if (byte >= n->len) {
+ /** key > node */
+ return 1;
+ }
+ /** So far, the trie matches */
+ pos++;
+ if (n->array[byte].len != 0) {
+ /** Must match additional string */
+ if (pos + n->array[byte].len > len) {
+ return 1; /* no match at child node */
+ }
+ if (memcmp(&key[pos], n->array[byte].str,
+ n->array[byte].len) != 0) {
+ return 1; /* no match at child node */
+ }
+ pos += n->array[byte].len;
+ }
+ /** Continue searching prefix at this child node */
+ n = n->array[byte].edge;
+ if (!n) {
+ return 1;
+ }
+ /** Update the prefix node */
+ *respos = pos;
+ *result = n;
+ }
+ /** Done */
+ return 1;
+}
+
+
+/**
+ * Make space in the node's array for another byte.
+ * @param node: node.
+ * @param byte: byte.
+ * @return 1 if successful, 0 otherwise.
+ *
+ */
+static int
+ldns_radix_array_space(ldns_radix_node_t* node, uint8_t byte)
+{
+ /** Is there an array? */
+ if (!node->array) {
+ assert(node->capacity == 0);
+ /** No array, create new array */
+ node->array = LDNS_MALLOC(ldns_radix_array_t);
+ if (!node->array) {
+ return 0;
+ }
+ memset(&node->array[0], 0, sizeof(ldns_radix_array_t));
+ node->len = 1;
+ node->capacity = 1;
+ node->offset = byte;
+ return 1;
+ }
+ /** Array exist */
+ assert(node->array != NULL);
+ assert(node->capacity > 0);
+
+ if (node->len == 0) {
+ /** Unused array */
+ node->len = 1;
+ node->offset = byte;
+ } else if (byte < node->offset) {
+ /** Byte is below the offset */
+ uint8_t index;
+ uint16_t need = node->offset - byte;
+ /** Is there enough capacity? */
+ if (node->len + need > node->capacity) {
+ /** Not enough capacity, grow array */
+ if (!ldns_radix_array_grow(node,
+ (unsigned) (node->len + need))) {
+ return 0; /* failed to grow array */
+ }
+ }
+ /** Move items to the end */
+ memmove(&node->array[need], &node->array[0],
+ node->len*sizeof(ldns_radix_array_t));
+ /** Fix parent index */
+ for (index = 0; index < node->len; index++) {
+ if (node->array[index+need].edge) {
+ node->array[index+need].edge->parent_index =
+ index + need;
+ }
+ }
+ /** Zero the first */
+ memset(&node->array[0], 0, need*sizeof(ldns_radix_array_t));
+ node->len += need;
+ node->offset = byte;
+ } else if (byte - node->offset >= node->len) {
+ /** Byte does not fit in array */
+ uint16_t need = (byte - node->offset) - node->len + 1;
+ /** Is there enough capacity? */
+ if (node->len + need > node->capacity) {
+ /** Not enough capacity, grow array */
+ if (!ldns_radix_array_grow(node,
+ (unsigned) (node->len + need))) {
+ return 0; /* failed to grow array */
+ }
+ }
+ /** Zero the added items */
+ memset(&node->array[node->len], 0,
+ need*sizeof(ldns_radix_array_t));
+ node->len += need;
+ }
+ return 1;
+}
+
+
+/**
+ * Grow the array.
+ * @param node: node.
+ * @param need: number of elements the array at least need to grow.
+ * Can't be bigger than 256.
+ * @return: 0 if failed, 1 if was successful.
+ *
+ */
+static int
+ldns_radix_array_grow(ldns_radix_node_t* node, unsigned need)
+{
+ unsigned size = ((unsigned)node->capacity)*2;
+ ldns_radix_array_t* a = NULL;
+ if (need > size) {
+ size = need;
+ }
+ if (size > 256) {
+ size = 256;
+ }
+ a = LDNS_XMALLOC(ldns_radix_array_t, size);
+ if (!a) {
+ return 0;
+ }
+ assert(node->len <= node->capacity);
+ assert(node->capacity < size);
+ memcpy(&a[0], &node->array[0], node->len*sizeof(ldns_radix_array_t));
+ LDNS_FREE(node->array);
+ node->array = a;
+ node->capacity = size;
+ return 1;
+}
+
+
+/**
+ * Create a prefix in the array string.
+ * @param array: array.
+ * @param key: key.
+ * @param pos: start position in key.
+ * @param len: length of key.
+ * @return 0 if failed, 1 if was successful.
+ *
+ */
+static int
+ldns_radix_str_create(ldns_radix_array_t* array, uint8_t* key,
+ radix_strlen_t pos, radix_strlen_t len)
+{
+ array->str = LDNS_XMALLOC(uint8_t, (len-pos));
+ if (!array->str) {
+ return 0;
+ }
+ memmove(array->str, key+pos, len-pos);
+ array->len = (len-pos);
+ return 1;
+}
+
+
+/**
+ * Allocate remainder from prefixes for a split.
+ * @param prefixlen: length of prefix.
+ * @param longer_str: the longer string.
+ * @param longer_len: the longer string length.
+ * @param split_str: the split string.
+ * @param split_len: the split string length.
+ * @return 0 if failed, 1 if successful.
+ *
+ */
+static int
+ldns_radix_prefix_remainder(radix_strlen_t prefix_len,
+ uint8_t* longer_str, radix_strlen_t longer_len,
+ uint8_t** split_str, radix_strlen_t* split_len)
+{
+ *split_len = longer_len - prefix_len;
+ *split_str = LDNS_XMALLOC(uint8_t, (*split_len));
+ if (!*split_str) {
+ return 0;
+ }
+ memmove(*split_str, longer_str+prefix_len, longer_len-prefix_len);
+ return 1;
+}
+
+
+/**
+ * Create a split when two nodes have a shared prefix.
+ * @param array: array.
+ * @param key: key.
+ * @param pos: start position in key.
+ * @param len: length of the key.
+ * @param add: node to be added.
+ * @return 0 if failed, 1 if was successful.
+ *
+ */
+static int
+ldns_radix_array_split(ldns_radix_array_t* array, uint8_t* key,
+ radix_strlen_t pos, radix_strlen_t len, ldns_radix_node_t* add)
+{
+ uint8_t* str_to_add = key + pos;
+ radix_strlen_t strlen_to_add = len - pos;
+
+ if (ldns_radix_str_is_prefix(str_to_add, strlen_to_add,
+ array->str, array->len)) {
+ /** The string to add is a prefix of the existing string */
+ uint8_t* split_str = NULL, *dup_str = NULL;
+ radix_strlen_t split_len = 0;
+ /**
+ * Example 5: 'ld'
+ * | [0]
+ * --| [d+ns] dns
+ * --| [e+dns] edns
+ * --| [l+d] ld
+ * ----| [n+s] ldns
+ **/
+ assert(strlen_to_add < array->len);
+ /** Store the remainder in the split string */
+ if (array->len - strlen_to_add > 1) {
+ if (!ldns_radix_prefix_remainder(strlen_to_add+1,
+ array->str, array->len, &split_str,
+ &split_len)) {
+ return 0;
+ }
+ }
+ /** Duplicate the string to add */
+ if (strlen_to_add != 0) {
+ dup_str = LDNS_XMALLOC(uint8_t, strlen_to_add);
+ if (!dup_str) {
+ LDNS_FREE(split_str);
+ return 0;
+ }
+ memcpy(dup_str, str_to_add, strlen_to_add);
+ }
+ /** Make space in array for the new node */
+ if (!ldns_radix_array_space(add,
+ array->str[strlen_to_add])) {
+ LDNS_FREE(split_str);
+ LDNS_FREE(dup_str);
+ return 0;
+ }
+ /**
+ * The added node should go direct under the existing parent.
+ * The existing node should go under the added node.
+ */
+ add->parent = array->edge->parent;
+ add->parent_index = array->edge->parent_index;
+ add->array[0].edge = array->edge;
+ add->array[0].str = split_str;
+ add->array[0].len = split_len;
+ array->edge->parent = add;
+ array->edge->parent_index = 0;
+ LDNS_FREE(array->str);
+ array->edge = add;
+ array->str = dup_str;
+ array->len = strlen_to_add;
+ } else if (ldns_radix_str_is_prefix(array->str, array->len,
+ str_to_add, strlen_to_add)) {
+ /** The existing string is a prefix of the string to add */
+ /**
+ * Example 6: 'dns-ng'
+ * | [0]
+ * --| [d+ns] dns
+ * ----| [-+ng] dns-ng
+ * --| [e+dns] edns
+ * --| [l+d] ld
+ * ----| [n+s] ldns
+ **/
+ uint8_t* split_str = NULL;
+ radix_strlen_t split_len = 0;
+ assert(array->len < strlen_to_add);
+ if (strlen_to_add - array->len > 1) {
+ if (!ldns_radix_prefix_remainder(array->len+1,
+ str_to_add, strlen_to_add, &split_str,
+ &split_len)) {
+ return 0;
+ }
+ }
+ /** Make space in array for the new node */
+ if (!ldns_radix_array_space(array->edge,
+ str_to_add[array->len])) {
+ LDNS_FREE(split_str);
+ return 0;
+ }
+ /**
+ * The added node should go direct under the existing node.
+ */
+ add->parent = array->edge;
+ add->parent_index = str_to_add[array->len] -
+ array->edge->offset;
+ array->edge->array[add->parent_index].edge = add;
+ array->edge->array[add->parent_index].str = split_str;
+ array->edge->array[add->parent_index].len = split_len;
+ } else {
+ /** Create a new split node. */
+ /**
+ * Example 7: 'dndns'
+ * | [0]
+ * --| [d+n]
+ * ----| [d+ns] dndns
+ * ----| [s] dns
+ * ------| [-+ng] dns-ng
+ * --| [e+dns] edns
+ * --| [l+d] ld
+ * ----| [n+s] ldns
+ **/
+ ldns_radix_node_t* common = NULL;
+ uint8_t* common_str = NULL, *s1 = NULL, *s2 = NULL;
+ radix_strlen_t common_len = 0, l1 = 0, l2 = 0;
+ common_len = ldns_radix_str_common(array->str, array->len,
+ str_to_add, strlen_to_add);
+ assert(common_len < array->len);
+ assert(common_len < strlen_to_add);
+ /** Create the new common node. */
+ common = ldns_radix_new_node(NULL, (uint8_t*)"", 0);
+ if (!common) {
+ return 0;
+ }
+ if (array->len - common_len > 1) {
+ if (!ldns_radix_prefix_remainder(common_len+1,
+ array->str, array->len, &s1, &l1)) {
+ return 0;
+ }
+ }
+ if (strlen_to_add - common_len > 1) {
+ if (!ldns_radix_prefix_remainder(common_len+1,
+ str_to_add, strlen_to_add, &s2, &l2)) {
+ return 0;
+ }
+ }
+ /** Create the shared prefix. */
+ if (common_len > 0) {
+ common_str = LDNS_XMALLOC(uint8_t, common_len);
+ if (!common_str) {
+ LDNS_FREE(common);
+ LDNS_FREE(s1);
+ LDNS_FREE(s2);
+ return 0;
+ }
+ memcpy(common_str, str_to_add, common_len);
+ }
+ /** Make space in the common node array. */
+ if (!ldns_radix_array_space(common, array->str[common_len]) ||
+ !ldns_radix_array_space(common, str_to_add[common_len])) {
+ LDNS_FREE(common->array);
+ LDNS_FREE(common);
+ LDNS_FREE(common_str);
+ LDNS_FREE(s1);
+ LDNS_FREE(s2);
+ return 0;
+ }
+ /**
+ * The common node should go direct under the parent node.
+ * The added and existing nodes go under the common node.
+ */
+ common->parent = array->edge->parent;
+ common->parent_index = array->edge->parent_index;
+ array->edge->parent = common;
+ array->edge->parent_index = array->str[common_len] -
+ common->offset;
+ add->parent = common;
+ add->parent_index = str_to_add[common_len] - common->offset;
+ common->array[array->edge->parent_index].edge = array->edge;
+ common->array[array->edge->parent_index].str = s1;
+ common->array[array->edge->parent_index].len = l1;
+ common->array[add->parent_index].edge = add;
+ common->array[add->parent_index].str = s2;
+ common->array[add->parent_index].len = l2;
+ LDNS_FREE(array->str);
+ array->edge = common;
+ array->str = common_str;
+ array->len = common_len;
+ }
+ return 1;
+}
+
+
+/**
+ * Check if one string prefix of other string.
+ * @param str1: one string.
+ * @param len1: one string length.
+ * @param str2: other string.
+ * @param len2: other string length.
+ * @return 1 if prefix, 0 otherwise.
+ *
+ */
+static int
+ldns_radix_str_is_prefix(uint8_t* str1, radix_strlen_t len1,
+ uint8_t* str2, radix_strlen_t len2)
+{
+ if (len1 == 0) {
+ return 1; /* empty prefix is also a prefix */
+ }
+ if (len1 > len2) {
+ return 0; /* len1 is longer so str1 cannot be a prefix */
+ }
+ return (memcmp(str1, str2, len1) == 0);
+}
+
+
+/**
+ * Return the number of bytes in common for the two strings.
+ * @param str1: one string.
+ * @param len1: one string length.
+ * @param str2: other string.
+ * @param len2: other string length.
+ * @return length of substring that the two strings have in common.
+ *
+ */
+static radix_strlen_t
+ldns_radix_str_common(uint8_t* str1, radix_strlen_t len1,
+ uint8_t* str2, radix_strlen_t len2)
+{
+ radix_strlen_t i, max = (len1<len2)?len1:len2;
+ for (i=0; i<max; i++) {
+ if (str1[i] != str2[i]) {
+ return i;
+ }
+ }
+ return max;
+}
+
+
+/**
+ * Find the next element in the subtree of this node.
+ * @param node: node.
+ * @return: node with next element.
+ *
+ */
+static ldns_radix_node_t*
+ldns_radix_next_in_subtree(ldns_radix_node_t* node)
+{
+ uint16_t i;
+ ldns_radix_node_t* next;
+ /** Try every subnode. */
+ for (i = 0; i < node->len; i++) {
+ if (node->array[i].edge) {
+ /** Node itself. */
+ if (node->array[i].edge->data) {
+ return node->array[i].edge;
+ }
+ /** Dive into subtree. */
+ next = ldns_radix_next_in_subtree(node->array[i].edge);
+ if (next) {
+ return next;
+ }
+ }
+ }
+ return NULL;
+}
+
+
+/**
+ * Find the previous element in the array of this node, from index.
+ * @param node: node.
+ * @param index: index.
+ * @return previous node from index.
+ *
+ */
+static ldns_radix_node_t*
+ldns_radix_prev_from_index(ldns_radix_node_t* node, uint8_t index)
+{
+ uint8_t i = index;
+ while (i > 0) {
+ i--;
+ if (node->array[i].edge) {
+ ldns_radix_node_t* prev =
+ ldns_radix_last_in_subtree_incl_self(node);
+ if (prev) {
+ return prev;
+ }
+ }
+ }
+ return NULL;
+}
+
+
+/**
+ * Find last node in subtree, or this node (if have data).
+ * @param node: node.
+ * @return last node in subtree, or this node, or NULL.
+ *
+ */
+static ldns_radix_node_t*
+ldns_radix_last_in_subtree_incl_self(ldns_radix_node_t* node)
+{
+ ldns_radix_node_t* last = ldns_radix_last_in_subtree(node);
+ if (last) {
+ return last;
+ } else if (node->data) {
+ return node;
+ }
+ return NULL;
+}
+
+
+/**
+ * Find last node in subtree.
+ * @param node: node.
+ * @return last node in subtree.
+ *
+ */
+static ldns_radix_node_t*
+ldns_radix_last_in_subtree(ldns_radix_node_t* node)
+{
+ int i;
+ /** Look for the most right leaf node. */
+ for (i=(int)(node->len)-1; i >= 0; i--) {
+ if (node->array[i].edge) {
+ /** Keep looking for the most right leaf node. */
+ if (node->array[i].edge->len > 0) {
+ ldns_radix_node_t* last =
+ ldns_radix_last_in_subtree(
+ node->array[i].edge);
+ if (last) {
+ return last;
+ }
+ }
+ /** Could this be the most right leaf node? */
+ if (node->array[i].edge->data) {
+ return node->array[i].edge;
+ }
+ }
+ }
+ return NULL;
+}
+
+
+/**
+ * Fix tree after deleting element.
+ * @param tree: tree.
+ * @param node: node with deleted element.
+ *
+ */
+static void
+ldns_radix_del_fix(ldns_radix_t* tree, ldns_radix_node_t* node)
+{
+ while (node) {
+ if (node->data) {
+ /** Thou should not delete nodes with data attached. */
+ return;
+ } else if (node->len == 1 && node->parent) {
+ /** Node with one child is fold back into. */
+ ldns_radix_cleanup_onechild(node);
+ return;
+ } else if (node->len == 0) {
+ /** Leaf node. */
+ ldns_radix_node_t* parent = node->parent;
+ if (!parent) {
+ /** The root is a leaf node. */
+ ldns_radix_node_free(node, NULL);
+ tree->root = NULL;
+ return;
+ }
+ /** Cleanup leaf node and continue with parent. */
+ ldns_radix_cleanup_leaf(node);
+ node = parent;
+ } else {
+ /**
+ * Node cannot be deleted, because it has edge nodes
+ * and no parent to fix up to.
+ */
+ return;
+ }
+ }
+ /** Not reached. */
+ return;
+}
+
+
+/**
+ * Clean up a node with one child.
+ * @param node: node with one child.
+ *
+ */
+static void
+ldns_radix_cleanup_onechild(ldns_radix_node_t* node)
+{
+ uint8_t* join_str;
+ radix_strlen_t join_len;
+ uint8_t parent_index = node->parent_index;
+ ldns_radix_node_t* child = node->array[0].edge;
+ ldns_radix_node_t* parent = node->parent;
+
+ /** Node has one child, merge the child node into the parent node. */
+ assert(parent_index < parent->len);
+ join_len = parent->array[parent_index].len + node->array[0].len + 1;
+
+ join_str = LDNS_XMALLOC(uint8_t, join_len);
+ if (!join_str) {
+ /**
+ * Cleanup failed due to out of memory.
+ * This tree is now inefficient, with the empty node still
+ * existing, but it is still valid.
+ */
+ return;
+ }
+
+ memcpy(join_str, parent->array[parent_index].str,
+ parent->array[parent_index].len);
+ join_str[parent->array[parent_index].len] = child->parent_index +
+ node->offset;
+ memmove(join_str + parent->array[parent_index].len+1,
+ node->array[0].str, node->array[0].len);
+
+ LDNS_FREE(parent->array[parent_index].str);
+ parent->array[parent_index].str = join_str;
+ parent->array[parent_index].len = join_len;
+ parent->array[parent_index].edge = child;
+ child->parent = parent;
+ child->parent_index = parent_index;
+ ldns_radix_node_free(node, NULL);
+ return;
+}
+
+
+/**
+ * Clean up a leaf node.
+ * @param node: leaf node.
+ *
+ */
+static void
+ldns_radix_cleanup_leaf(ldns_radix_node_t* node)
+{
+ uint8_t parent_index = node->parent_index;
+ ldns_radix_node_t* parent = node->parent;
+ /** Delete lead node and fix parent array. */
+ assert(parent_index < parent->len);
+ ldns_radix_node_free(node, NULL);
+ LDNS_FREE(parent->array[parent_index].str);
+ parent->array[parent_index].str = NULL;
+ parent->array[parent_index].len = 0;
+ parent->array[parent_index].edge = NULL;
+ /** Fix array in parent. */
+ if (parent->len == 1) {
+ ldns_radix_node_array_free(parent);
+ } else if (parent_index == 0) {
+ ldns_radix_node_array_free_front(parent);
+ } else {
+ ldns_radix_node_array_free_end(parent);
+ }
+ return;
+}
+
+
+/**
+ * Free a radix node.
+ * @param node: node.
+ * @param arg: user argument.
+ *
+ */
+static void
+ldns_radix_node_free(ldns_radix_node_t* node, void* arg)
+{
+ uint16_t i;
+ (void) arg;
+ if (!node) {
+ return;
+ }
+ for (i=0; i < node->len; i++) {
+ LDNS_FREE(node->array[i].str);
+ }
+ node->key = NULL;
+ node->klen = 0;
+ LDNS_FREE(node->array);
+ LDNS_FREE(node);
+ return;
+}
+
+
+/**
+ * Free select edge array.
+ * @param node: node.
+ *
+ */
+static void
+ldns_radix_node_array_free(ldns_radix_node_t* node)
+{
+ node->offset = 0;
+ node->len = 0;
+ LDNS_FREE(node->array);
+ node->array = NULL;
+ node->capacity = 0;
+ return;
+}
+
+
+/**
+ * Free front of select edge array.
+ * @param node: node.
+ *
+ */
+static void
+ldns_radix_node_array_free_front(ldns_radix_node_t* node)
+{
+ uint16_t i, n = 0;
+ /** Remove until a non NULL entry. */
+ while (n < node->len && node->array[n].edge == NULL) {
+ n++;
+ }
+ if (n == 0) {
+ return;
+ }
+ if (n == node->len) {
+ ldns_radix_node_array_free(node);
+ return;
+ }
+ assert(n < node->len);
+ assert((int) n <= (255 - (int) node->offset));
+ memmove(&node->array[0], &node->array[n],
+ (node->len - n)*sizeof(ldns_radix_array_t));
+ node->offset += n;
+ node->len -= n;
+ for (i=0; i < node->len; i++) {
+ if (node->array[i].edge) {
+ node->array[i].edge->parent_index = i;
+ }
+ }
+ ldns_radix_array_reduce(node);
+ return;
+}
+
+
+/**
+ * Free front of select edge array.
+ * @param node: node.
+ *
+ */
+static void
+ldns_radix_node_array_free_end(ldns_radix_node_t* node)
+{
+ uint16_t n = 0;
+ /** Shorten array. */
+ while (n < node->len && node->array[node->len-1-n].edge == NULL) {
+ n++;
+ }
+ if (n == 0) {
+ return;
+ }
+ if (n == node->len) {
+ ldns_radix_node_array_free(node);
+ return;
+ }
+ assert(n < node->len);
+ node->len -= n;
+ ldns_radix_array_reduce(node);
+ return;
+}
+
+
+/**
+ * Reduce the capacity of the array if needed.
+ * @param node: node.
+ *
+ */
+static void
+ldns_radix_array_reduce(ldns_radix_node_t* node)
+{
+ if (node->len <= node->capacity/2 && node->len != node->capacity) {
+ ldns_radix_array_t* a = LDNS_XMALLOC(ldns_radix_array_t,
+ node->len);
+ if (!a) {
+ return;
+ }
+ memcpy(a, node->array, sizeof(ldns_radix_array_t)*node->len);
+ LDNS_FREE(node->array);
+ node->array = a;
+ node->capacity = node->len;
+ }
+ return;
+}
+
+
+/**
+ * Return this element if it exists, the previous otherwise.
+ * @param node: from this node.
+ * @param result: result node.
+ *
+ */
+static void
+ldns_radix_self_or_prev(ldns_radix_node_t* node, ldns_radix_node_t** result)
+{
+ if (node->data) {
+ *result = node;
+ } else {
+ *result = ldns_radix_prev(node);
+ }
+ return;
+}
diff --git a/rdata.c b/rdata.c
index 8af16a13a1c2..6493543f0a28 100644
--- a/rdata.c
+++ b/rdata.c
@@ -112,14 +112,14 @@ time_t
ldns_rdf2native_time_t(const ldns_rdf *rd)
{
uint32_t data;
-
- switch(ldns_rdf_get_type(rd)) {
- case LDNS_RDF_TYPE_TIME:
- memcpy(&data, ldns_rdf_data(rd), sizeof(data));
- return (time_t)ntohl(data);
- default:
- return 0;
+
+ /* only allow 32 bit rdfs */
+ if (ldns_rdf_size(rd) != LDNS_RDF_SIZE_DOUBLEWORD ||
+ ldns_rdf_get_type(rd) != LDNS_RDF_TYPE_TIME) {
+ return 0;
}
+ memcpy(&data, ldns_rdf_data(rd), sizeof(data));
+ return (time_t)ntohl(data);
}
ldns_rdf *
@@ -309,8 +309,8 @@ ldns_rdf_new_frm_str(ldns_rdf_type type, const char *str)
case LDNS_RDF_TYPE_PERIOD:
status = ldns_str2rdf_period(&rdf, str);
break;
- case LDNS_RDF_TYPE_TSIG:
- status = ldns_str2rdf_tsig(&rdf, str);
+ case LDNS_RDF_TYPE_HIP:
+ status = ldns_str2rdf_hip(&rdf, str);
break;
case LDNS_RDF_TYPE_SERVICE:
status = ldns_str2rdf_service(&rdf, str);
@@ -336,6 +336,21 @@ ldns_rdf_new_frm_str(ldns_rdf_type type, const char *str)
case LDNS_RDF_TYPE_NSEC3_NEXT_OWNER:
status = ldns_str2rdf_b32_ext(&rdf, str);
break;
+ case LDNS_RDF_TYPE_ILNP64:
+ status = ldns_str2rdf_ilnp64(&rdf, str);
+ break;
+ case LDNS_RDF_TYPE_EUI48:
+ status = ldns_str2rdf_eui48(&rdf, str);
+ break;
+ case LDNS_RDF_TYPE_EUI64:
+ status = ldns_str2rdf_eui64(&rdf, str);
+ break;
+ case LDNS_RDF_TYPE_TAG:
+ status = ldns_str2rdf_tag(&rdf, str);
+ break;
+ case LDNS_RDF_TYPE_LONG_STR:
+ status = ldns_str2rdf_long_str(&rdf, str);
+ break;
case LDNS_RDF_TYPE_NONE:
default:
/* default default ??? */
@@ -504,6 +519,64 @@ ldns_rdf_address_reverse(ldns_rdf *rd)
}
ldns_status
+ldns_rdf_hip_get_alg_hit_pk(ldns_rdf *rdf, uint8_t* alg,
+ uint8_t *hit_size, uint8_t** hit,
+ uint16_t *pk_size, uint8_t** pk)
+{
+ uint8_t *data;
+ size_t rdf_size;
+
+ if (! rdf || ! alg || ! hit || ! hit_size || ! pk || ! pk_size) {
+ return LDNS_STATUS_INVALID_POINTER;
+ } else if (ldns_rdf_get_type(rdf) != LDNS_RDF_TYPE_HIP) {
+ return LDNS_STATUS_INVALID_RDF_TYPE;
+ } else if ((rdf_size = ldns_rdf_size(rdf)) < 6) {
+ return LDNS_STATUS_WIRE_RDATA_ERR;
+ }
+ data = ldns_rdf_data(rdf);
+ *hit_size = data[0];
+ *alg = data[1];
+ *pk_size = ldns_read_uint16(data + 2);
+ *hit = data + 4;
+ *pk = data + 4 + *hit_size;
+ if (*hit_size == 0 || *pk_size == 0 ||
+ rdf_size < (size_t) *hit_size + *pk_size + 4) {
+ return LDNS_STATUS_WIRE_RDATA_ERR;
+ }
+ return LDNS_STATUS_OK;
+}
+
+ldns_status
+ldns_rdf_hip_new_frm_alg_hit_pk(ldns_rdf** rdf, uint8_t alg,
+ uint8_t hit_size, uint8_t *hit,
+ uint16_t pk_size, uint8_t *pk)
+{
+ uint8_t *data;
+
+ if (! rdf) {
+ return LDNS_STATUS_INVALID_POINTER;
+ }
+ if (4 + hit_size + pk_size > LDNS_MAX_RDFLEN) {
+ return LDNS_STATUS_RDATA_OVERFLOW;
+ }
+ data = LDNS_XMALLOC(uint8_t, 4 + hit_size + pk_size);
+ if (data == NULL) {
+ return LDNS_STATUS_MEM_ERR;
+ }
+ data[0] = hit_size;
+ data[1] = alg;
+ ldns_write_uint16(data + 2, pk_size);
+ memcpy(data + 4, hit, hit_size);
+ memcpy(data + 4 + hit_size, pk, pk_size);
+ *rdf = ldns_rdf_new(LDNS_RDF_TYPE_HIP, 4 + hit_size + pk_size, data);
+ if (! *rdf) {
+ LDNS_FREE(data);
+ return LDNS_STATUS_MEM_ERR;
+ }
+ return LDNS_STATUS_OK;
+}
+
+ldns_status
ldns_octet(char *word, size_t *length)
{
char *s;
diff --git a/resolver.c b/resolver.c
index 20d4e6dd4b5a..16efc90f1a34 100644
--- a/resolver.c
+++ b/resolver.c
@@ -26,6 +26,12 @@ ldns_resolver_port(const ldns_resolver *r)
return r->_port;
}
+ldns_rdf *
+ldns_resolver_source(const ldns_resolver *r)
+{
+ return r->_source;
+}
+
uint16_t
ldns_resolver_edns_udp_size(const ldns_resolver *r)
{
@@ -234,6 +240,12 @@ ldns_resolver_set_port(ldns_resolver *r, uint16_t p)
r->_port = p;
}
+void
+ldns_resolver_set_source(ldns_resolver *r, ldns_rdf *s)
+{
+ r->_source = s;
+}
+
ldns_rdf *
ldns_resolver_pop_nameserver(ldns_resolver *r)
{
@@ -625,6 +637,7 @@ ldns_resolver_new(void)
ldns_resolver_set_igntc(r, false);
ldns_resolver_set_recursive(r, false);
ldns_resolver_set_dnsrch(r, true);
+ ldns_resolver_set_source(r, NULL);
/* randomize the nameserver to be queried
* when there are multiple
@@ -670,8 +683,15 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr)
ssize_t gtr, bgtr;
ldns_buffer *b;
int lnr = 0, oldline;
+ FILE* myfp = fp;
if(!line_nr) line_nr = &lnr;
+ if(!fp) {
+ myfp = fopen("/etc/resolv.conf", "r");
+ if(!myfp)
+ return LDNS_STATUS_FILE_ERR;
+ }
+
/* do this better
* expect =
* 0: keyword
@@ -691,6 +711,7 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr)
r = ldns_resolver_new();
if (!r) {
+ if(!fp) fclose(myfp);
return LDNS_STATUS_MEM_ERR;
}
@@ -706,9 +727,9 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr)
/* skip until end of line */
int c;
do {
- c = fgetc(fp);
+ c = fgetc(myfp);
} while(c != EOF && c != '\n');
- if(c=='\n' && line_nr) (*line_nr)++;
+ if(c=='\n') (*line_nr)++;
}
/* and read next to prepare for further parsing */
oldline = *line_nr;
@@ -718,7 +739,7 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr)
switch(expect) {
case LDNS_RESOLV_KEYWORD:
/* keyword */
- gtr = ldns_fget_token_l(fp, word, LDNS_PARSE_NORMAL, 0, line_nr);
+ gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr);
if (gtr != 0) {
if(word[0] == '#') continue;
for(i = 0; i < LDNS_RESOLV_KEYWORDS; i++) {
@@ -735,6 +756,7 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr)
/* skip line */
/*
ldns_resolver_deep_free(r);
+ if(!fp) fclose(myfp);
return LDNS_STATUS_SYNTAX_KEYWORD_ERR;
*/
}
@@ -742,8 +764,9 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr)
break;
case LDNS_RESOLV_DEFDOMAIN:
/* default domain dname */
- gtr = ldns_fget_token_l(fp, word, LDNS_PARSE_NORMAL, 0, line_nr);
+ gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr);
if (gtr == 0) {
+ if(!fp) fclose(myfp);
return LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR;
}
if(word[0] == '#') {
@@ -753,6 +776,7 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr)
tmp = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_DNAME, word);
if (!tmp) {
ldns_resolver_deep_free(r);
+ if(!fp) fclose(myfp);
return LDNS_STATUS_SYNTAX_DNAME_ERR;
}
@@ -762,8 +786,9 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr)
break;
case LDNS_RESOLV_NAMESERVER:
/* NS aaaa or a record */
- gtr = ldns_fget_token_l(fp, word, LDNS_PARSE_NORMAL, 0, line_nr);
+ gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr);
if (gtr == 0) {
+ if(!fp) fclose(myfp);
return LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR;
}
if(word[0] == '#') {
@@ -783,6 +808,7 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr)
/* could not parse it, exit */
if (!tmp) {
ldns_resolver_deep_free(r);
+ if(!fp) fclose(myfp);
return LDNS_STATUS_SYNTAX_ERR;
}
(void)ldns_resolver_push_nameserver(r, tmp);
@@ -791,10 +817,11 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr)
break;
case LDNS_RESOLV_SEARCH:
/* search list domain dname */
- gtr = ldns_fget_token_l(fp, word, LDNS_PARSE_SKIP_SPACE, 0, line_nr);
+ gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_SKIP_SPACE, 0, line_nr);
b = LDNS_MALLOC(ldns_buffer);
if(!b) {
ldns_resolver_deep_free(r);
+ if(!fp) fclose(myfp);
return LDNS_STATUS_MEM_ERR;
}
@@ -802,6 +829,7 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr)
if(ldns_buffer_status(b) != LDNS_STATUS_OK) {
LDNS_FREE(b);
ldns_resolver_deep_free(r);
+ if(!fp) fclose(myfp);
return LDNS_STATUS_MEM_ERR;
}
bgtr = ldns_bget_token(b, word, LDNS_PARSE_NORMAL, (size_t) gtr + 1);
@@ -815,6 +843,7 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr)
if (!tmp) {
ldns_resolver_deep_free(r);
ldns_buffer_free(b);
+ if(!fp) fclose(myfp);
return LDNS_STATUS_SYNTAX_DNAME_ERR;
}
@@ -831,20 +860,21 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr)
}
break;
case LDNS_RESOLV_SORTLIST:
- gtr = ldns_fget_token_l(fp, word, LDNS_PARSE_SKIP_SPACE, 0, line_nr);
+ gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_SKIP_SPACE, 0, line_nr);
/* sortlist not implemented atm */
expect = LDNS_RESOLV_KEYWORD;
break;
case LDNS_RESOLV_OPTIONS:
- gtr = ldns_fget_token_l(fp, word, LDNS_PARSE_SKIP_SPACE, 0, line_nr);
+ gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_SKIP_SPACE, 0, line_nr);
/* options not implemented atm */
expect = LDNS_RESOLV_KEYWORD;
break;
case LDNS_RESOLV_ANCHOR:
/* a file containing a DNSSEC trust anchor */
- gtr = ldns_fget_token_l(fp, word, LDNS_PARSE_NORMAL, 0, line_nr);
+ gtr = ldns_fget_token_l(myfp, word, LDNS_PARSE_NORMAL, 0, line_nr);
if (gtr == 0) {
ldns_resolver_deep_free(r);
+ if(!fp) fclose(myfp);
return LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR;
}
if(word[0] == '#') {
@@ -862,6 +892,9 @@ ldns_resolver_new_frm_fp_l(ldns_resolver **res, FILE *fp, int *line_nr)
}
}
+ if(!fp)
+ fclose(myfp);
+
if (res) {
*res = r;
return LDNS_STATUS_OK;
@@ -953,86 +986,82 @@ ldns_resolver_deep_free(ldns_resolver *res)
}
}
-ldns_pkt *
-ldns_resolver_search(const ldns_resolver *r,const ldns_rdf *name,
- ldns_rr_type t, ldns_rr_class c, uint16_t flags)
+ldns_status
+ldns_resolver_search_status(ldns_pkt** pkt,
+ ldns_resolver *r, const ldns_rdf *name,
+ ldns_rr_type t, ldns_rr_class c, uint16_t flags)
{
-
ldns_rdf *new_name;
ldns_rdf **search_list;
size_t i;
- ldns_pkt *p;
+ ldns_status s = LDNS_STATUS_OK;
if (ldns_dname_absolute(name)) {
/* query as-is */
- return ldns_resolver_query(r, name, t, c, flags);
+ return ldns_resolver_query_status(pkt, r, name, t, c, flags);
} else if (ldns_resolver_dnsrch(r)) {
search_list = ldns_resolver_searchlist(r);
for (i = 0; i < ldns_resolver_searchlist_count(r); i++) {
new_name = ldns_dname_cat_clone(name, search_list[i]);
- p = ldns_resolver_query(r, new_name, t, c, flags);
+ s = ldns_resolver_query_status(pkt, r,
+ new_name, t, c, flags);
ldns_rdf_free(new_name);
- if (p) {
- if (ldns_pkt_get_rcode(p) == LDNS_RCODE_NOERROR) {
- return p;
- } else {
- ldns_pkt_free(p);
- p = NULL;
+ if (pkt) {
+ if (s == LDNS_STATUS_OK && *pkt &&
+ ldns_pkt_get_rcode(*pkt) ==
+ LDNS_RCODE_NOERROR) {
+ return LDNS_STATUS_OK;
}
+ ldns_pkt_free(*pkt);
}
}
}
- return NULL;
+ return s;
}
ldns_pkt *
-ldns_resolver_query(const ldns_resolver *r, const ldns_rdf *name,
+ldns_resolver_search(const ldns_resolver *r,const ldns_rdf *name,
ldns_rr_type t, ldns_rr_class c, uint16_t flags)
{
+ ldns_pkt* pkt = NULL;
+ if (ldns_resolver_search_status(&pkt, (ldns_resolver *)r,
+ name, t, c, flags) != LDNS_STATUS_OK) {
+ ldns_pkt_free(pkt);
+ }
+ return pkt;
+}
+
+ldns_status
+ldns_resolver_query_status(ldns_pkt** pkt,
+ ldns_resolver *r, const ldns_rdf *name,
+ ldns_rr_type t, ldns_rr_class c, uint16_t flags)
+{
ldns_rdf *newname;
- ldns_pkt *pkt;
ldns_status status;
- pkt = NULL;
-
- if (!ldns_resolver_defnames(r)) {
- status = ldns_resolver_send(&pkt, (ldns_resolver *)r, name,
- t, c, flags);
- if (status == LDNS_STATUS_OK) {
- return pkt;
- } else {
- if (pkt) {
- ldns_pkt_free(pkt);
- }
- return NULL;
- }
- }
-
- if (!ldns_resolver_domain(r)) {
- /* _defnames is set, but the domain is not....?? */
- status = ldns_resolver_send(&pkt, (ldns_resolver *)r, name,
- t, c, flags);
- if (status == LDNS_STATUS_OK) {
- return pkt;
- } else {
- if (pkt) {
- ldns_pkt_free(pkt);
- }
- return NULL;
- }
+ if (!ldns_resolver_defnames(r) || !ldns_resolver_domain(r)) {
+ return ldns_resolver_send(pkt, r, name, t, c, flags);
}
- newname = ldns_dname_cat_clone((const ldns_rdf*)name, ldns_resolver_domain(r));
+ newname = ldns_dname_cat_clone(name, ldns_resolver_domain(r));
if (!newname) {
- return NULL;
+ return LDNS_STATUS_MEM_ERR;
}
-
- (void)ldns_resolver_send(&pkt, (ldns_resolver *)r, newname, t, c,
- flags);
-
+ status = ldns_resolver_send(pkt, r, newname, t, c, flags);
ldns_rdf_free(newname);
+ return status;
+}
+ldns_pkt *
+ldns_resolver_query(const ldns_resolver *r, const ldns_rdf *name,
+ ldns_rr_type t, ldns_rr_class c, uint16_t flags)
+{
+ ldns_pkt* pkt = NULL;
+ if (ldns_resolver_query_status(&pkt, (ldns_resolver *)r,
+ name, t, c, flags) != LDNS_STATUS_OK) {
+ ldns_pkt_free(pkt);
+ }
return pkt;
}
@@ -1129,7 +1158,12 @@ ldns_resolver_prepare_query_pkt(ldns_pkt **query_pkt, ldns_resolver *r,
/* prepare a question pkt from the parameters
* and then send this */
- *query_pkt = ldns_pkt_query_new(ldns_rdf_clone(name), t, c, flags);
+ if (t == LDNS_RR_TYPE_IXFR) {
+ *query_pkt = ldns_pkt_ixfr_request_new(ldns_rdf_clone(name),
+ c, flags, NULL);
+ } else {
+ *query_pkt = ldns_pkt_query_new(ldns_rdf_clone(name), t, c, flags);
+ }
if (!*query_pkt) {
return LDNS_STATUS_ERR;
}
@@ -1206,7 +1240,7 @@ ldns_resolver_send(ldns_pkt **answer, ldns_resolver *r, const ldns_rdf *name,
/* if tsig values are set, tsign it */
/* TODO: make last 3 arguments optional too? maybe make complete
- rr instead of seperate values in resolver (and packet)
+ rr instead of separate values in resolver (and packet)
Jelte
should this go in pkt_prepare?
*/
@@ -1286,9 +1320,11 @@ ldns_axfr_next(ldns_resolver *resolver)
resolver->_axfr_i = 0;
if (status != LDNS_STATUS_OK) {
/* TODO: make status return type of this function (...api change) */
+#ifdef STDERR_MSGS
fprintf(stderr, "Error parsing rr during AXFR: %s\n", ldns_get_errorstr_by_id(status));
+#endif
- /* RoRi: we must now also close the socket, otherwise subsequent uses of the
+ /* we must now also close the socket, otherwise subsequent uses of the
same resolver structure will fail because the link is still open or
in an undefined state */
#ifndef USE_WINSOCK
@@ -1301,6 +1337,7 @@ ldns_axfr_next(ldns_resolver *resolver)
return NULL;
} else if (ldns_pkt_get_rcode(resolver->_cur_axfr_pkt) != 0) {
rcode = ldns_lookup_by_id(ldns_rcodes, (int) ldns_pkt_get_rcode(resolver->_cur_axfr_pkt));
+#ifdef STDERR_MSGS
if (rcode) {
fprintf(stderr, "Error in AXFR: %s\n",
rcode->name);
@@ -1309,8 +1346,9 @@ ldns_axfr_next(ldns_resolver *resolver)
(int) ldns_pkt_get_rcode(
resolver->_cur_axfr_pkt));
}
+#endif
- /* RoRi: we must now also close the socket, otherwise subsequent uses of the
+ /* we must now also close the socket, otherwise subsequent uses of the
same resolver structure will fail because the link is still open or
in an undefined state */
#ifndef USE_WINSOCK
@@ -1329,6 +1367,26 @@ ldns_axfr_next(ldns_resolver *resolver)
}
+/* this function is needed to abort a transfer that is in progress;
+ * without it an aborted transfer will lead to the AXFR code in the
+ * library staying in an indetermined state because the socket for the
+ * AXFR is never closed
+ */
+void
+ldns_axfr_abort(ldns_resolver *resolver)
+{
+ /* Only abort if an actual AXFR is in progress */
+ if (resolver->_socket != 0)
+ {
+#ifndef USE_WINSOCK
+ close(resolver->_socket);
+#else
+ closesocket(resolver->_socket);
+#endif
+ resolver->_socket = 0;
+ }
+}
+
bool
ldns_axfr_complete(const ldns_resolver *res)
{
diff --git a/rr.c b/rr.c
index c8b2ef9ce89a..cfee170eb2b7 100644
--- a/rr.c
+++ b/rr.c
@@ -87,6 +87,14 @@ ldns_rr_free(ldns_rr *rr)
}
}
+/* Syntactic sugar for ldns_rr_new_frm_str_internal */
+INLINE bool
+ldns_rdf_type_maybe_quoted(ldns_rdf_type rdf_type)
+{
+ return rdf_type == LDNS_RDF_TYPE_STR ||
+ rdf_type == LDNS_RDF_TYPE_LONG_STR;
+}
+
/*
* trailing spaces are allowed
* leading spaces are not allowed
@@ -119,7 +127,7 @@ ldns_rr_new_frm_str_internal(ldns_rr **newrr, const char *str,
char *type = NULL;
char *rdata = NULL;
char *rd = NULL;
- char * b64 = NULL;
+ char *xtok = NULL; /* For RDF types with spaces (i.e. extra tokens) */
size_t rd_strlen;
const char *delimiters;
ssize_t c;
@@ -138,6 +146,12 @@ ldns_rr_new_frm_str_internal(ldns_rr **newrr, const char *str,
uint16_t r_max;
size_t pre_data_pos;
+ uint16_t hex_data_size;
+ char *hex_data_str = NULL;
+ uint16_t cur_hex_data_size;
+ size_t hex_pos = 0;
+ uint8_t *hex_data = NULL;
+
new = ldns_rr_new();
owner = LDNS_XMALLOC(char, LDNS_MAX_DOMAINLEN + 1);
@@ -147,26 +161,32 @@ ldns_rr_new_frm_str_internal(ldns_rr **newrr, const char *str,
rr_buf = LDNS_MALLOC(ldns_buffer);
rd_buf = LDNS_MALLOC(ldns_buffer);
rd = LDNS_XMALLOC(char, LDNS_MAX_RDFLEN);
- b64 = LDNS_XMALLOC(char, LDNS_MAX_RDFLEN);
- if (!new || !owner || !ttl || !clas || !rdata || !rr_buf || !rd_buf || !rd || !b64 ) {
- status = LDNS_STATUS_MEM_ERR;
- LDNS_FREE(rr_buf);
- goto ldnserror;
+ xtok = LDNS_XMALLOC(char, LDNS_MAX_RDFLEN);
+ if (rr_buf) {
+ rr_buf->_data = NULL;
+ }
+ if (rd_buf) {
+ rd_buf->_data = NULL;
+ }
+ if (!new || !owner || !ttl || !clas || !rdata ||
+ !rr_buf || !rd_buf || !rd || !xtok) {
+
+ goto memerror;
}
ldns_buffer_new_frm_data(rr_buf, (char*)str, strlen(str));
/* split the rr in its parts -1 signals trouble */
- if (ldns_bget_token(rr_buf, owner, "\t\n ", LDNS_MAX_DOMAINLEN) == -1) {
+ if (ldns_bget_token(rr_buf, owner, "\t\n ", LDNS_MAX_DOMAINLEN) == -1){
+
status = LDNS_STATUS_SYNTAX_ERR;
- ldns_buffer_free(rr_buf);
- goto ldnserror;
+ goto error;
}
if (ldns_bget_token(rr_buf, ttl, "\t\n ", LDNS_TTL_DATALEN) == -1) {
+
status = LDNS_STATUS_SYNTAX_TTL_ERR;
- ldns_buffer_free(rr_buf);
- goto ldnserror;
+ goto error;
}
ttl_val = (uint32_t) ldns_str2period(ttl, &endptr);
@@ -189,18 +209,17 @@ ldns_rr_new_frm_str_internal(ldns_rr **newrr, const char *str,
if (clas_val == 0) {
clas_val = LDNS_RR_CLASS_IN;
type = LDNS_XMALLOC(char, strlen(ttl) + 1);
- if(!type) {
- status = LDNS_STATUS_MEM_ERR;
- ldns_buffer_free(rr_buf);
- goto ldnserror;
+ if (!type) {
+ goto memerror;
}
strncpy(type, ttl, strlen(ttl) + 1);
}
} else {
- if (ldns_bget_token(rr_buf, clas, "\t\n ", LDNS_SYNTAX_DATALEN) == -1) {
+ if (-1 == ldns_bget_token(
+ rr_buf, clas, "\t\n ", LDNS_SYNTAX_DATALEN)) {
+
status = LDNS_STATUS_SYNTAX_CLASS_ERR;
- ldns_buffer_free(rr_buf);
- goto ldnserror;
+ goto error;
}
clas_val = ldns_get_rr_class_by_name(clas);
/* class can be left out too, assume IN, current
@@ -209,10 +228,8 @@ ldns_rr_new_frm_str_internal(ldns_rr **newrr, const char *str,
if (clas_val == 0) {
clas_val = LDNS_RR_CLASS_IN;
type = LDNS_XMALLOC(char, strlen(clas) + 1);
- if(!type) {
- status = LDNS_STATUS_MEM_ERR;
- ldns_buffer_free(rr_buf);
- goto ldnserror;
+ if (!type) {
+ goto memerror;
}
strncpy(type, clas, strlen(clas) + 1);
}
@@ -221,24 +238,22 @@ ldns_rr_new_frm_str_internal(ldns_rr **newrr, const char *str,
if (!type) {
type = LDNS_XMALLOC(char, LDNS_SYNTAX_DATALEN);
- if(!type) {
- status = LDNS_STATUS_MEM_ERR;
- ldns_buffer_free(rr_buf);
- goto ldnserror;
+ if (!type) {
+ goto memerror;
}
- if (ldns_bget_token(rr_buf, type, "\t\n ", LDNS_SYNTAX_DATALEN) == -1) {
+ if (-1 == ldns_bget_token(
+ rr_buf, type, "\t\n ", LDNS_SYNTAX_DATALEN)) {
+
status = LDNS_STATUS_SYNTAX_TYPE_ERR;
- ldns_buffer_free(rr_buf);
- goto ldnserror;
+ goto error;
}
}
if (ldns_bget_token(rr_buf, rdata, "\0", LDNS_MAX_PACKETLEN) == -1) {
/* apparently we are done, and it's only a question RR
* so do not set status and go to ldnserror here
- */
+ */
}
-
ldns_buffer_new_frm_data(rd_buf, rdata, strlen(rdata));
if (strlen(owner) <= 1 && strncmp(owner, "@", 1) == 0) {
@@ -256,9 +271,7 @@ ldns_rr_new_frm_str_internal(ldns_rr **newrr, const char *str,
ldns_rdf_deep_free(*prev);
*prev = ldns_rdf_clone(ldns_rr_owner(new));
if (!*prev) {
- status = LDNS_STATUS_MEM_ERR;
- ldns_buffer_free(rr_buf);
- goto ldnserror;
+ goto memerror;
}
}
} else {
@@ -270,57 +283,49 @@ ldns_rr_new_frm_str_internal(ldns_rr **newrr, const char *str,
} else if (origin) {
ldns_rr_set_owner(new, ldns_rdf_clone(origin));
} else {
- ldns_rr_set_owner(new, ldns_dname_new_frm_str("."));
+ ldns_rr_set_owner(new,
+ ldns_dname_new_frm_str("."));
}
if(!ldns_rr_owner(new)) {
- status = LDNS_STATUS_MEM_ERR;
- ldns_buffer_free(rr_buf);
- goto ldnserror;
+ goto memerror;
}
} else {
owner_dname = ldns_dname_new_frm_str(owner);
if (!owner_dname) {
status = LDNS_STATUS_SYNTAX_ERR;
- ldns_buffer_free(rr_buf);
- goto ldnserror;
+ goto error;
}
ldns_rr_set_owner(new, owner_dname);
if (!ldns_dname_str_absolute(owner) && origin) {
- if(ldns_dname_cat(ldns_rr_owner(new),
- origin) != LDNS_STATUS_OK) {
+ if(ldns_dname_cat(ldns_rr_owner(new), origin)
+ != LDNS_STATUS_OK) {
+
status = LDNS_STATUS_SYNTAX_ERR;
- ldns_buffer_free(rr_buf);
- goto ldnserror;
+ goto error;
}
}
if (prev) {
ldns_rdf_deep_free(*prev);
*prev = ldns_rdf_clone(ldns_rr_owner(new));
- if(!*prev) {
- status = LDNS_STATUS_MEM_ERR;
- ldns_buffer_free(rr_buf);
- goto ldnserror;
+ if (!*prev) {
+ goto error;
}
}
}
}
LDNS_FREE(owner);
- owner = NULL;
ldns_rr_set_question(new, question);
ldns_rr_set_ttl(new, ttl_val);
LDNS_FREE(ttl);
- ttl = NULL;
ldns_rr_set_class(new, clas_val);
LDNS_FREE(clas);
- clas = NULL;
rr_type = ldns_get_rr_type_by_name(type);
LDNS_FREE(type);
- type = NULL;
desc = ldns_rr_descript((uint16_t)rr_type);
ldns_rr_set_type(new, rr_type);
@@ -333,268 +338,275 @@ ldns_rr_new_frm_str_internal(ldns_rr **newrr, const char *str,
r_max = 1;
}
- /* depending on the rr_type we need to extract
- * the rdata differently, e.g. NSEC/NSEC3 */
- switch(rr_type) {
- default:
- done = false;
-
- for (r_cnt = 0; !done && r_cnt < r_max; r_cnt++) {
- quoted = false;
- /* if type = B64, the field may contain spaces */
- if (ldns_rr_descriptor_field_type(desc,
- r_cnt) == LDNS_RDF_TYPE_B64 ||
- ldns_rr_descriptor_field_type(desc,
- r_cnt) == LDNS_RDF_TYPE_HEX ||
- ldns_rr_descriptor_field_type(desc,
- r_cnt) == LDNS_RDF_TYPE_LOC ||
- ldns_rr_descriptor_field_type(desc,
- r_cnt) == LDNS_RDF_TYPE_WKS ||
- ldns_rr_descriptor_field_type(desc,
- r_cnt) == LDNS_RDF_TYPE_IPSECKEY ||
- ldns_rr_descriptor_field_type(desc,
- r_cnt) == LDNS_RDF_TYPE_NSEC) {
- delimiters = "\n\t";
- } else {
- delimiters = "\n\t ";
- }
+ for (done = false, r_cnt = 0; !done && r_cnt < r_max; r_cnt++) {
+ quoted = false;
- if (ldns_rr_descriptor_field_type(desc,
- r_cnt) == LDNS_RDF_TYPE_STR &&
- ldns_buffer_remaining(rd_buf) > 0) {
- /* skip spaces */
- while (*(ldns_buffer_current(rd_buf)) == ' ') {
- ldns_buffer_skip(rd_buf, 1);
- }
+ switch (ldns_rr_descriptor_field_type(desc, r_cnt)) {
+ case LDNS_RDF_TYPE_B64 :
+ case LDNS_RDF_TYPE_HEX : /* These rdf types may con- */
+ case LDNS_RDF_TYPE_LOC : /* tain whitespace, only if */
+ case LDNS_RDF_TYPE_WKS : /* it is the last rd field. */
+ case LDNS_RDF_TYPE_IPSECKEY :
+ case LDNS_RDF_TYPE_NSEC : if (r_cnt == r_max - 1) {
+ delimiters = "\n\t";
+ break;
+ }
+ default : delimiters = "\n\t ";
+ }
- if (*(ldns_buffer_current(rd_buf)) == '\"') {
- delimiters = "\"\0";
- ldns_buffer_skip(rd_buf, 1);
- quoted = true;
- }
+ if (ldns_rdf_type_maybe_quoted(
+ ldns_rr_descriptor_field_type(
+ desc, r_cnt)) &&
+ ldns_buffer_remaining(rd_buf) > 0){
+
+ /* skip spaces */
+ while (*(ldns_buffer_current(rd_buf)) == ' ') {
+ ldns_buffer_skip(rd_buf, 1);
+ }
+
+ if (*(ldns_buffer_current(rd_buf)) == '\"') {
+ delimiters = "\"\0";
+ ldns_buffer_skip(rd_buf, 1);
+ quoted = true;
+ }
+ }
+
+ /* because number of fields can be variable, we can't rely on
+ * _maximum() only
+ */
+
+ /* skip spaces */
+ while (ldns_buffer_position(rd_buf) < ldns_buffer_limit(rd_buf)
+ && *(ldns_buffer_current(rd_buf)) == ' '
+ && !quoted) {
+
+ ldns_buffer_skip(rd_buf, 1);
+ }
+
+ pre_data_pos = ldns_buffer_position(rd_buf);
+ if (-1 == (c = ldns_bget_token(
+ rd_buf, rd, delimiters, LDNS_MAX_RDFLEN))) {
+
+ done = true;
+ break;
+ }
+ /* hmmz, rfc3597 specifies that any type can be represented
+ * with \# method, which can contain spaces...
+ * it does specify size though...
+ */
+ rd_strlen = strlen(rd);
+
+ /* unknown RR data */
+ if (strncmp(rd, "\\#", 2) == 0 && !quoted &&
+ (rd_strlen == 2 || rd[2]==' ')) {
+
+ was_unknown_rr_format = 1;
+ /* go back to before \#
+ * and skip it while setting delimiters better
+ */
+ ldns_buffer_set_position(rd_buf, pre_data_pos);
+ delimiters = "\n\t ";
+ (void)ldns_bget_token(rd_buf, rd,
+ delimiters, LDNS_MAX_RDFLEN);
+ /* read rdata octet length */
+ c = ldns_bget_token(rd_buf, rd,
+ delimiters, LDNS_MAX_RDFLEN);
+ if (c == -1) {
+ /* something goes very wrong here */
+ status = LDNS_STATUS_SYNTAX_RDATA_ERR;
+ goto error;
+ }
+ hex_data_size = (uint16_t) atoi(rd);
+ /* copy hex chars into hex str (2 chars per byte) */
+ hex_data_str = LDNS_XMALLOC(char, 2*hex_data_size + 1);
+ if (!hex_data_str) {
+ /* malloc error */
+ goto memerror;
+ }
+ cur_hex_data_size = 0;
+ while(cur_hex_data_size < 2 * hex_data_size) {
+ c = ldns_bget_token(rd_buf, rd,
+ delimiters, LDNS_MAX_RDFLEN);
+ if (c != -1) {
+ rd_strlen = strlen(rd);
}
+ if (c == -1 ||
+ (size_t)cur_hex_data_size + rd_strlen >
+ 2 * (size_t)hex_data_size) {
- /* because number of fields can be variable, we can't
- rely on _maximum() only */
- /* skip spaces */
- while (ldns_buffer_position(rd_buf) < ldns_buffer_limit(rd_buf) &&
- *(ldns_buffer_current(rd_buf)) == ' ' && !quoted
- ) {
- ldns_buffer_skip(rd_buf, 1);
+ status = LDNS_STATUS_SYNTAX_RDATA_ERR;
+ goto error;
}
+ strncpy(hex_data_str + cur_hex_data_size, rd,
+ rd_strlen);
- pre_data_pos = ldns_buffer_position(rd_buf);
- if ((c = ldns_bget_token(rd_buf, rd, delimiters,
- LDNS_MAX_RDFLEN)) != -1) {
- /* hmmz, rfc3597 specifies that any type can be represented with
- * \# method, which can contain spaces...
- * it does specify size though...
- */
- rd_strlen = strlen(rd);
+ cur_hex_data_size += rd_strlen;
+ }
+ hex_data_str[cur_hex_data_size] = '\0';
- /* unknown RR data */
- if (strncmp(rd, "\\#", 2) == 0 && !quoted && (rd_strlen == 2 || rd[2]==' ')) {
- uint16_t hex_data_size;
- char *hex_data_str;
- uint16_t cur_hex_data_size;
-
- was_unknown_rr_format = 1;
- /* go back to before \# and skip it while setting delimiters better */
- ldns_buffer_set_position(rd_buf, pre_data_pos);
- delimiters = "\n\t ";
- (void)ldns_bget_token(rd_buf, rd, delimiters, LDNS_MAX_RDFLEN);
- /* read rdata octet length */
- c = ldns_bget_token(rd_buf, rd, delimiters, LDNS_MAX_RDFLEN);
- if (c == -1) {
- /* something goes very wrong here */
- LDNS_FREE(rd);
- LDNS_FREE(b64);
- ldns_buffer_free(rd_buf);
- ldns_buffer_free(rr_buf);
- LDNS_FREE(rdata);
- ldns_rr_free(new);
- return LDNS_STATUS_SYNTAX_RDATA_ERR;
- }
- hex_data_size = (uint16_t) atoi(rd);
- /* copy the hex chars into hex str (which is 2 chars per byte) */
- hex_data_str = LDNS_XMALLOC(char, 2 * hex_data_size + 1);
- if (!hex_data_str) {
- /* malloc error */
- LDNS_FREE(rd);
- LDNS_FREE(b64);
- ldns_buffer_free(rd_buf);
- ldns_buffer_free(rr_buf);
- LDNS_FREE(rdata);
- ldns_rr_free(new);
- return LDNS_STATUS_SYNTAX_RDATA_ERR;
- }
- cur_hex_data_size = 0;
- while(cur_hex_data_size < 2 * hex_data_size) {
- c = ldns_bget_token(rd_buf, rd, delimiters, LDNS_MAX_RDFLEN);
- if (c != -1) {
- rd_strlen = strlen(rd);
- }
- if (c == -1 || (size_t)cur_hex_data_size + rd_strlen > 2 * (size_t)hex_data_size) {
- LDNS_FREE(hex_data_str);
- LDNS_FREE(rd);
- LDNS_FREE(b64);
- ldns_buffer_free(rd_buf);
- ldns_buffer_free(rr_buf);
- LDNS_FREE(rdata);
- ldns_rr_free(new);
- return LDNS_STATUS_SYNTAX_RDATA_ERR;
- }
- strncpy(hex_data_str + cur_hex_data_size, rd, rd_strlen);
- cur_hex_data_size += rd_strlen;
- }
- hex_data_str[cur_hex_data_size] = '\0';
-
- /* correct the rdf type */
- /* if *we* know the type, interpret it as wireformat */
- if (desc) {
- size_t hex_pos = 0;
- uint8_t *hex_data = LDNS_XMALLOC(uint8_t, hex_data_size + 2);
- ldns_status s;
- if(!hex_data) {
- LDNS_FREE(hex_data_str);
- LDNS_FREE(rd);
- LDNS_FREE(b64);
- ldns_buffer_free(rd_buf);
- ldns_buffer_free(rr_buf);
- LDNS_FREE(rdata);
- ldns_rr_free(new);
- return LDNS_STATUS_MEM_ERR;
- }
- ldns_write_uint16(hex_data, hex_data_size);
- ldns_hexstring_to_data(hex_data + 2, hex_data_str);
- s = ldns_wire2rdf(new, hex_data,
- hex_data_size+2, &hex_pos);
- if(s != LDNS_STATUS_OK) {
- LDNS_FREE(hex_data_str);
- LDNS_FREE(rd);
- LDNS_FREE(b64);
- ldns_buffer_free(rd_buf);
- ldns_buffer_free(rr_buf);
- LDNS_FREE(rdata);
- ldns_rr_free(new);
- LDNS_FREE(hex_data);
- return s;
- }
- LDNS_FREE(hex_data);
- } else {
- r = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_HEX, hex_data_str);
- if(!r) {
- LDNS_FREE(hex_data_str);
- LDNS_FREE(rd);
- LDNS_FREE(b64);
- ldns_buffer_free(rd_buf);
- ldns_buffer_free(rr_buf);
- LDNS_FREE(rdata);
- ldns_rr_free(new);
- return LDNS_STATUS_MEM_ERR;
- }
- ldns_rdf_set_type(r, LDNS_RDF_TYPE_UNKNOWN);
- if(!ldns_rr_push_rdf(new, r)) {
- LDNS_FREE(hex_data_str);
- LDNS_FREE(rd);
- LDNS_FREE(b64);
- ldns_buffer_free(rd_buf);
- ldns_buffer_free(rr_buf);
- LDNS_FREE(rdata);
- ldns_rr_free(new);
- return LDNS_STATUS_MEM_ERR;
- }
- }
- LDNS_FREE(hex_data_str);
- } else {
- /* Normal RR */
- switch(ldns_rr_descriptor_field_type(desc, r_cnt)) {
- case LDNS_RDF_TYPE_HEX:
- case LDNS_RDF_TYPE_B64:
- /* can have spaces, and will always be the last
- * record of the rrdata. Read in the rest */
- if ((c = ldns_bget_token(rd_buf,
- b64,
- "\n",
- LDNS_MAX_RDFLEN))
- != -1) {
- rd = strncat(rd,
- b64,
- LDNS_MAX_RDFLEN
- - strlen(rd) - 1);
- }
- r = ldns_rdf_new_frm_str(
- ldns_rr_descriptor_field_type(desc, r_cnt),
- rd);
- break;
- case LDNS_RDF_TYPE_DNAME:
- r = ldns_rdf_new_frm_str(
- ldns_rr_descriptor_field_type(desc, r_cnt),
- rd);
-
- /* check if the origin should be used or concatenated */
- if (r && ldns_rdf_size(r) > 1 && ldns_rdf_data(r)[0] == 1
- && ldns_rdf_data(r)[1] == '@') {
- ldns_rdf_deep_free(r);
- if (origin) {
- r = ldns_rdf_clone(origin);
- } else {
- /* if this is the SOA, use its own owner name */
- if (rr_type == LDNS_RR_TYPE_SOA) {
- r = ldns_rdf_clone(ldns_rr_owner(new));
- } else {
- r = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_DNAME, ".");
- }
- }
- } else if (r && rd_strlen >= 1 && !ldns_dname_str_absolute(rd) && origin) {
- if (ldns_dname_cat(r, origin) != LDNS_STATUS_OK) {
- LDNS_FREE(rd);
- LDNS_FREE(b64);
- ldns_buffer_free(rd_buf);
- ldns_buffer_free(rr_buf);
- LDNS_FREE(rdata);
- ldns_rr_free(new);
- return LDNS_STATUS_ERR;
- }
- }
- break;
- default:
- r = ldns_rdf_new_frm_str(
- ldns_rr_descriptor_field_type(desc, r_cnt),
- rd);
- break;
- }
- if (r) {
- ldns_rr_push_rdf(new, r);
- } else {
- LDNS_FREE(rd);
- LDNS_FREE(b64);
- ldns_buffer_free(rd_buf);
- ldns_buffer_free(rr_buf);
- LDNS_FREE(rdata);
- ldns_rr_free(new);
- return LDNS_STATUS_SYNTAX_RDATA_ERR;
- }
+ /* correct the rdf type */
+ /* if *we* know the type, interpret it as wireformat */
+ if (desc) {
+ hex_pos = 0;
+ hex_data =
+ LDNS_XMALLOC(uint8_t, hex_data_size+2);
+
+ if (!hex_data) {
+ goto memerror;
+ }
+ ldns_write_uint16(hex_data, hex_data_size);
+ ldns_hexstring_to_data(
+ hex_data + 2, hex_data_str);
+ status = ldns_wire2rdf(new, hex_data,
+ hex_data_size + 2, &hex_pos);
+ if (status != LDNS_STATUS_OK) {
+ goto error;
+ }
+ LDNS_FREE(hex_data);
+ } else {
+ r = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_HEX,
+ hex_data_str);
+ if (!r) {
+ goto memerror;
+ }
+ ldns_rdf_set_type(r, LDNS_RDF_TYPE_UNKNOWN);
+ if (!ldns_rr_push_rdf(new, r)) {
+ goto memerror;
+ }
+ }
+ LDNS_FREE(hex_data_str);
+
+ } else {
+ /* Normal RR */
+ switch(ldns_rr_descriptor_field_type(desc, r_cnt)) {
+
+ case LDNS_RDF_TYPE_HEX:
+ case LDNS_RDF_TYPE_B64:
+ /* When this is the last rdata field, then the
+ * rest should be read in (cause then these
+ * rdf types may contain spaces).
+ */
+ if (r_cnt == r_max - 1) {
+ c = ldns_bget_token(rd_buf, xtok,
+ "\n", LDNS_MAX_RDFLEN);
+ if (c != -1) {
+ (void) strncat(rd, xtok,
+ LDNS_MAX_RDFLEN -
+ strlen(rd) - 1);
}
- if (quoted) {
- if (ldns_buffer_available(rd_buf, 1)) {
- ldns_buffer_skip(rd_buf, 1);
- } else {
- done = true;
- }
+ }
+ r = ldns_rdf_new_frm_str(
+ ldns_rr_descriptor_field_type(
+ desc, r_cnt), rd);
+ break;
+
+ case LDNS_RDF_TYPE_HIP:
+ /*
+ * In presentation format this RDATA type has
+ * three tokens: An algorithm byte, then a
+ * variable length HIT (in hexbytes) and then
+ * a variable length Public Key (in base64).
+ *
+ * We have just read the algorithm, so we need
+ * two more tokens: HIT and Public Key.
+ */
+ do {
+ /* Read and append HIT */
+ if (ldns_bget_token(rd_buf,
+ xtok, delimiters,
+ LDNS_MAX_RDFLEN) == -1)
+ break;
+
+ (void) strncat(rd, " ",
+ LDNS_MAX_RDFLEN -
+ strlen(rd) - 1);
+ (void) strncat(rd, xtok,
+ LDNS_MAX_RDFLEN -
+ strlen(rd) - 1);
+
+ /* Read and append Public Key*/
+ if (ldns_bget_token(rd_buf,
+ xtok, delimiters,
+ LDNS_MAX_RDFLEN) == -1)
+ break;
+
+ (void) strncat(rd, " ",
+ LDNS_MAX_RDFLEN -
+ strlen(rd) - 1);
+ (void) strncat(rd, xtok,
+ LDNS_MAX_RDFLEN -
+ strlen(rd) - 1);
+ } while (false);
+
+ r = ldns_rdf_new_frm_str(
+ ldns_rr_descriptor_field_type(
+ desc, r_cnt), rd);
+ break;
+
+ case LDNS_RDF_TYPE_DNAME:
+ r = ldns_rdf_new_frm_str(
+ ldns_rr_descriptor_field_type(
+ desc, r_cnt), rd);
+
+ /* check if the origin should be used
+ * or concatenated
+ */
+ if (r && ldns_rdf_size(r) > 1 &&
+ ldns_rdf_data(r)[0] == 1 &&
+ ldns_rdf_data(r)[1] == '@') {
+
+ ldns_rdf_deep_free(r);
+
+ r = origin ? ldns_rdf_clone(origin)
+
+ : ( rr_type == LDNS_RR_TYPE_SOA ?
+
+ ldns_rdf_clone(
+ ldns_rr_owner(new))
+
+ : ldns_rdf_new_frm_str(
+ LDNS_RDF_TYPE_DNAME, ".")
+ );
+
+ } else if (r && rd_strlen >= 1 && origin &&
+ !ldns_dname_str_absolute(rd)) {
+
+ status = ldns_dname_cat(r, origin);
+ if (status != LDNS_STATUS_OK) {
+ goto error;
}
- } else {
- done = true;
}
+ break;
+ default:
+ r = ldns_rdf_new_frm_str(
+ ldns_rr_descriptor_field_type(
+ desc, r_cnt), rd);
+ break;
}
- }
+ if (!r) {
+ status = LDNS_STATUS_SYNTAX_RDATA_ERR;
+ goto error;
+ }
+ ldns_rr_push_rdf(new, r);
+ }
+ if (quoted) {
+ if (ldns_buffer_available(rd_buf, 1)) {
+ ldns_buffer_skip(rd_buf, 1);
+ } else {
+ done = true;
+ }
+ }
+
+ } /* for (done = false, r_cnt = 0; !done && r_cnt < r_max; r_cnt++) */
LDNS_FREE(rd);
- LDNS_FREE(b64);
+ LDNS_FREE(xtok);
ldns_buffer_free(rd_buf);
ldns_buffer_free(rr_buf);
LDNS_FREE(rdata);
- if (!question && desc && !was_unknown_rr_format && ldns_rr_rd_count(new) < r_min) {
+ if (!question && desc && !was_unknown_rr_format &&
+ ldns_rr_rd_count(new) < r_min) {
+
ldns_rr_free(new);
return LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR;
}
@@ -607,17 +619,30 @@ ldns_rr_new_frm_str_internal(ldns_rr **newrr, const char *str,
}
return LDNS_STATUS_OK;
-ldnserror:
+memerror:
+ status = LDNS_STATUS_MEM_ERR;
+error:
+ if (rd_buf && rd_buf->_data) {
+ ldns_buffer_free(rd_buf);
+ } else {
+ LDNS_FREE(rd_buf);
+ }
+ if (rr_buf && rr_buf->_data) {
+ ldns_buffer_free(rr_buf);
+ } else {
+ LDNS_FREE(rr_buf);
+ }
LDNS_FREE(type);
LDNS_FREE(owner);
LDNS_FREE(ttl);
LDNS_FREE(clas);
- LDNS_FREE(rdata);
+ LDNS_FREE(hex_data);
+ LDNS_FREE(hex_data_str);
+ LDNS_FREE(xtok);
LDNS_FREE(rd);
- LDNS_FREE(rd_buf);
- LDNS_FREE(b64);
+ LDNS_FREE(rdata);
ldns_rr_free(new);
- return status;
+ return status;
}
ldns_status
@@ -1845,9 +1870,7 @@ static const ldns_rdf_type type_px_wireformat[] = {
LDNS_RDF_TYPE_INT16, LDNS_RDF_TYPE_DNAME, LDNS_RDF_TYPE_DNAME
};
static const ldns_rdf_type type_gpos_wireformat[] = {
- LDNS_RDF_TYPE_STR,
- LDNS_RDF_TYPE_STR,
- LDNS_RDF_TYPE_STR
+ LDNS_RDF_TYPE_STR, LDNS_RDF_TYPE_STR, LDNS_RDF_TYPE_STR
};
static const ldns_rdf_type type_aaaa_wireformat[] = { LDNS_RDF_TYPE_AAAA };
static const ldns_rdf_type type_loc_wireformat[] = { LDNS_RDF_TYPE_LOC };
@@ -1925,6 +1948,15 @@ static const ldns_rdf_type type_dnskey_wireformat[] = {
LDNS_RDF_TYPE_ALG,
LDNS_RDF_TYPE_B64
};
+static const ldns_rdf_type type_tkey_wireformat[] = {
+ LDNS_RDF_TYPE_DNAME,
+ LDNS_RDF_TYPE_TIME,
+ LDNS_RDF_TYPE_TIME,
+ LDNS_RDF_TYPE_INT16,
+ LDNS_RDF_TYPE_INT16,
+ LDNS_RDF_TYPE_INT16_DATA,
+ LDNS_RDF_TYPE_INT16_DATA,
+};
static const ldns_rdf_type type_tsig_wireformat[] = {
LDNS_RDF_TYPE_DNAME,
LDNS_RDF_TYPE_TSIGTIME,
@@ -1940,6 +1972,43 @@ static const ldns_rdf_type type_tlsa_wireformat[] = {
LDNS_RDF_TYPE_INT8,
LDNS_RDF_TYPE_HEX
};
+static const ldns_rdf_type type_hip_wireformat[] = {
+ LDNS_RDF_TYPE_HIP
+};
+static const ldns_rdf_type type_nid_wireformat[] = {
+ LDNS_RDF_TYPE_INT16,
+ LDNS_RDF_TYPE_ILNP64
+};
+static const ldns_rdf_type type_l32_wireformat[] = {
+ LDNS_RDF_TYPE_INT16,
+ LDNS_RDF_TYPE_A
+};
+static const ldns_rdf_type type_l64_wireformat[] = {
+ LDNS_RDF_TYPE_INT16,
+ LDNS_RDF_TYPE_ILNP64
+};
+static const ldns_rdf_type type_lp_wireformat[] = {
+ LDNS_RDF_TYPE_INT16,
+ LDNS_RDF_TYPE_DNAME
+};
+static const ldns_rdf_type type_eui48_wireformat[] = {
+ LDNS_RDF_TYPE_EUI48
+};
+static const ldns_rdf_type type_eui64_wireformat[] = {
+ LDNS_RDF_TYPE_EUI64
+};
+#ifdef RRTYPE_URI
+static const ldns_rdf_type type_uri_wireformat[] = {
+ LDNS_RDF_TYPE_INT16,
+ LDNS_RDF_TYPE_INT16,
+ LDNS_RDF_TYPE_LONG_STR
+};
+#endif
+static const ldns_rdf_type type_caa_wireformat[] = {
+ LDNS_RDF_TYPE_INT8,
+ LDNS_RDF_TYPE_TAG,
+ LDNS_RDF_TYPE_LONG_STR
+};
/** \endcond */
/** \cond */
@@ -2003,7 +2072,7 @@ static ldns_rr_descriptor rdata_field_descriptors[] = {
/* 26 */
{LDNS_RR_TYPE_PX, "PX", 3, 3, type_px_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 2 },
/* 27 */
- {LDNS_RR_TYPE_GPOS, "GPOS", 1, 1, type_gpos_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
+ {LDNS_RR_TYPE_GPOS, "GPOS", 3, 3, type_gpos_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 28 */
{LDNS_RR_TYPE_AAAA, "AAAA", 1, 1, type_aaaa_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 29 */
@@ -2043,7 +2112,7 @@ static ldns_rr_descriptor rdata_field_descriptors[] = {
/* 46 */
{LDNS_RR_TYPE_RRSIG, "RRSIG", 9, 9, type_rrsig_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 1 },
/* 47 */
- {LDNS_RR_TYPE_NSEC, "NSEC", 1, 2, type_nsec_wireformat, LDNS_RDF_TYPE_NSEC, LDNS_RR_NO_COMPRESS, 1 },
+ {LDNS_RR_TYPE_NSEC, "NSEC", 1, 2, type_nsec_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 1 },
/* 48 */
{LDNS_RR_TYPE_DNSKEY, "DNSKEY", 4, 4, type_dnskey_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
/* 49 */
@@ -2057,12 +2126,36 @@ static ldns_rr_descriptor rdata_field_descriptors[] = {
{LDNS_RR_TYPE_NULL, "TYPE53", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE54", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE55", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
+
+ /* 55
+ * Hip ends with 0 or more Rendezvous Servers represented as dname's.
+ * Hence the LDNS_RDF_TYPE_DNAME _variable field and the _maximum field
+ * set to 0.
+ */
+ {LDNS_RR_TYPE_HIP, "HIP", 1, 1, type_hip_wireformat, LDNS_RDF_TYPE_DNAME, LDNS_RR_NO_COMPRESS, 0 },
+
+#ifdef RRTYPE_NINFO
+ /* 56 */
+ {LDNS_RR_TYPE_NINFO, "NINFO", 1, 0, NULL, LDNS_RDF_TYPE_STR, LDNS_RR_NO_COMPRESS, 0 },
+#else
{LDNS_RR_TYPE_NULL, "TYPE56", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
+#endif
+#ifdef RRTYPE_RKEY
+ /* 57 */
+ {LDNS_RR_TYPE_RKEY, "RKEY", 4, 4, type_key_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
+#else
{LDNS_RR_TYPE_NULL, "TYPE57", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
+#endif
/* 58 */
-{LDNS_RR_TYPE_TALINK, "TALINK", 2, 2, type_talink_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 2 },
+ {LDNS_RR_TYPE_TALINK, "TALINK", 2, 2, type_talink_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 2 },
+
+#ifdef RRTYPE_CDS
+ /* 59 */
+ {LDNS_RR_TYPE_CDS, "CDS", 4, 4, type_ds_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
+#else
{LDNS_RR_TYPE_NULL, "TYPE59", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
+#endif
+
{LDNS_RR_TYPE_NULL, "TYPE60", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE61", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE62", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
@@ -2102,17 +2195,32 @@ static ldns_rr_descriptor rdata_field_descriptors[] = {
{LDNS_RR_TYPE_NULL, "TYPE96", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE97", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE98", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_SPF, "SPF", 1, 0, NULL, LDNS_RDF_TYPE_STR, LDNS_RR_NO_COMPRESS, 0 },
+
+ /* 99 */
+ {LDNS_RR_TYPE_SPF, "SPF", 1, 0, NULL, LDNS_RDF_TYPE_STR, LDNS_RR_NO_COMPRESS, 0 },
+
+ /* UINFO [IANA-Reserved] */
{LDNS_RR_TYPE_NULL, "TYPE100", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
+ /* UID [IANA-Reserved] */
{LDNS_RR_TYPE_NULL, "TYPE101", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
+ /* GID [IANA-Reserved] */
{LDNS_RR_TYPE_NULL, "TYPE102", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
+ /* UNSPEC [IANA-Reserved] */
{LDNS_RR_TYPE_NULL, "TYPE103", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE104", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE105", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE106", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE107", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE108", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE109", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
+
+ /* 104 */
+ {LDNS_RR_TYPE_NID, "NID", 2, 2, type_nid_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
+ /* 105 */
+ {LDNS_RR_TYPE_L32, "L32", 2, 2, type_l32_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
+ /* 106 */
+ {LDNS_RR_TYPE_L64, "L64", 2, 2, type_l64_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
+ /* 107 */
+ {LDNS_RR_TYPE_LP, "LP", 2, 2, type_lp_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 1 },
+ /* 108 */
+ {LDNS_RR_TYPE_EUI48, "EUI48", 1, 1, type_eui48_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
+ /* 109 */
+ {LDNS_RR_TYPE_EUI64, "EUI64", 1, 1, type_eui64_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
+
{LDNS_RR_TYPE_NULL, "TYPE110", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE111", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE112", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
@@ -2252,14 +2360,48 @@ static ldns_rr_descriptor rdata_field_descriptors[] = {
{LDNS_RR_TYPE_NULL, "TYPE246", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE247", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
{LDNS_RR_TYPE_NULL, "TYPE248", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE249", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-/* LDNS_RDF_TYPE_INT16_DATA essentially takes two fields (length and data) and
- * makes them into one. So, while in rfc 2845 is specified that a TSIG may have
- * 8 or 9 rdata fields, by this implementation, the min/max are 7 each.
- */
-{LDNS_RR_TYPE_TSIG, "TSIG", 7, 7, type_tsig_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
+
+ /* LDNS_RDF_TYPE_INT16_DATA takes two fields (length and data) as one.
+ * So, unlike RFC 2930 spec, we have 7 min/max rdf's i.s.o. 8/9.
+ */
+ /* 249 */
+ {LDNS_RR_TYPE_TKEY, "TKEY", 7, 7, type_tkey_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 1 },
+ /* LDNS_RDF_TYPE_INT16_DATA takes two fields (length and data) as one.
+ * So, unlike RFC 2930 spec, we have 7 min/max rdf's i.s.o. 8/9.
+ */
+ /* 250 */
+ {LDNS_RR_TYPE_TSIG, "TSIG", 7, 7, type_tsig_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 1 },
+
+ /* IXFR: A request for a transfer of an incremental zone transfer */
+{LDNS_RR_TYPE_NULL, "TYPE251", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
+ /* AXFR: A request for a transfer of an entire zone */
+{LDNS_RR_TYPE_NULL, "TYPE252", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
+ /* MAILB: A request for mailbox-related records (MB, MG or MR) */
+{LDNS_RR_TYPE_NULL, "TYPE253", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
+ /* MAILA: A request for mail agent RRs (Obsolete - see MX) */
+{LDNS_RR_TYPE_NULL, "TYPE254", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
+ /* ANY: A request for all (available) records */
+{LDNS_RR_TYPE_NULL, "TYPE255", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
+
+#ifdef RRTYPE_URI
+ /* 256 */
+ {LDNS_RR_TYPE_URI, "URI", 3, 3, type_uri_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
+#else
+{LDNS_RR_TYPE_NULL, "TYPE256", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
+#endif
+ /* 257 */
+ {LDNS_RR_TYPE_CAA, "CAA", 3, 3, type_caa_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
+
/* split in array, no longer contiguous */
-{LDNS_RR_TYPE_DLV, "DLV", 4, 4, type_ds_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 }
+
+#ifdef RRTYPE_TA
+ /* 32768 */
+ {LDNS_RR_TYPE_TA, "TA", 4, 4, type_ds_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
+#else
+{LDNS_RR_TYPE_NULL, "TYPE32768", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
+#endif
+ /* 32769 */
+ {LDNS_RR_TYPE_DLV, "DLV", 4, 4, type_ds_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 }
};
/** \endcond */
@@ -2270,11 +2412,130 @@ static ldns_rr_descriptor rdata_field_descriptors[] = {
#define LDNS_RDATA_FIELD_DESCRIPTORS_COUNT \
(sizeof(rdata_field_descriptors)/sizeof(rdata_field_descriptors[0]))
+
+/*---------------------------------------------------------------------------*
+ * The functions below return an bitmap RDF with the space required to set
+ * or unset all known RR types. Arguably these functions are better situated
+ * in rdata.c, however for the space calculation it is necesarry to walk
+ * through rdata_field_descriptors which is not easily possible from anywhere
+ * other than rr.c where it is declared static.
+ *
+ * Alternatively rr.c could have provided an iterator for rr_type or
+ * rdf_descriptors, but this seemed overkill for internal use only.
+ */
+static ldns_rr_descriptor* rdata_field_descriptors_end =
+ &rdata_field_descriptors[LDNS_RDATA_FIELD_DESCRIPTORS_COUNT];
+
+/* From RFC3845:
+ *
+ * 2.1.2. The List of Type Bit Map(s) Field
+ *
+ * The RR type space is split into 256 window blocks, each representing
+ * the low-order 8 bits of the 16-bit RR type space. Each block that
+ * has at least one active RR type is encoded using a single octet
+ * window number (from 0 to 255), a single octet bitmap length (from 1
+ * to 32) indicating the number of octets used for the window block's
+ * bitmap, and up to 32 octets (256 bits) of bitmap.
+ *
+ * Window blocks are present in the NSEC RR RDATA in increasing
+ * numerical order.
+ *
+ * "|" denotes concatenation
+ *
+ * Type Bit Map(s) Field = ( Window Block # | Bitmap Length | Bitmap ) +
+ *
+ * <cut>
+ *
+ * Blocks with no types present MUST NOT be included. Trailing zero
+ * octets in the bitmap MUST be omitted. The length of each block's
+ * bitmap is determined by the type code with the largest numerical
+ * value within that block, among the set of RR types present at the
+ * NSEC RR's owner name. Trailing zero octets not specified MUST be
+ * interpreted as zero octets.
+ */
+static ldns_status
+ldns_rdf_bitmap_known_rr_types_set(ldns_rdf** rdf, int value)
+{
+ uint8_t window; /* most significant octet of type */
+ uint8_t subtype; /* least significant octet of type */
+ uint16_t windows[256] /* Max subtype per window */
+#ifndef S_SPLINT_S
+ = { 0 }
+#endif
+ ;
+ ldns_rr_descriptor* d; /* used to traverse rdata_field_descriptors */
+ size_t i; /* used to traverse windows array */
+
+ size_t sz; /* size needed for type bitmap rdf */
+ uint8_t* data = NULL; /* rdf data */
+ uint8_t* dptr; /* used to itraverse rdf data */
+
+ assert(rdf != NULL);
+
+ /* Which windows need to be in the bitmap rdf?
+ */
+ for (d=rdata_field_descriptors; d < rdata_field_descriptors_end; d++) {
+ window = d->_type >> 8;
+ subtype = d->_type & 0xff;
+ if (windows[window] < subtype) {
+ windows[window] = subtype;
+ }
+ }
+
+ /* How much space do we need in the rdf for those windows?
+ */
+ sz = 0;
+ for (i = 0; i < 256; i++) {
+ if (windows[i]) {
+ sz += windows[i] / 8 + 3;
+ }
+ }
+ if (sz > 0) {
+ /* Format rdf data according RFC3845 Section 2.1.2 (see above)
+ */
+ dptr = data = LDNS_XMALLOC(uint8_t, sz);
+ memset(data, value, sz);
+ if (!data) {
+ return LDNS_STATUS_MEM_ERR;
+ }
+ for (i = 0; i < 256; i++) {
+ if (windows[i]) {
+ *dptr++ = (uint8_t)i;
+ *dptr++ = (uint8_t)(windows[i] / 8 + 1);
+ dptr += dptr[-1];
+ }
+ }
+ }
+ /* Allocate and return rdf structure for the data
+ */
+ *rdf = ldns_rdf_new(LDNS_RDF_TYPE_BITMAP, sz, data);
+ if (!*rdf) {
+ LDNS_FREE(data);
+ return LDNS_STATUS_MEM_ERR;
+ }
+ return LDNS_STATUS_OK;
+}
+
+ldns_status
+ldns_rdf_bitmap_known_rr_types_space(ldns_rdf** rdf)
+{
+ return ldns_rdf_bitmap_known_rr_types_set(rdf, 0);
+}
+
+ldns_status
+ldns_rdf_bitmap_known_rr_types(ldns_rdf** rdf)
+{
+ return ldns_rdf_bitmap_known_rr_types_set(rdf, 255);
+}
+/* End of RDF bitmap functions
+ *---------------------------------------------------------------------------*/
+
+
const ldns_rr_descriptor *
ldns_rr_descript(uint16_t type)
{
size_t i;
- if (type <= LDNS_RDATA_FIELD_DESCRIPTORS_COMMON) {
+ if (type < LDNS_RDATA_FIELD_DESCRIPTORS_COMMON) {
return &rdata_field_descriptors[type];
} else {
/* because not all array index equals type code */
diff --git a/sha1.c b/sha1.c
index 5dec680a1b79..18a4dd28f34e 100644
--- a/sha1.c
+++ b/sha1.c
@@ -15,12 +15,12 @@
*/
/* #define LITTLE_ENDIAN * This should be #define'd already, if true. */
-/* #define SHA1HANDSOFF * Copies data before messing with it. */
#include <ldns/config.h>
#include <ldns/ldns.h>
#include <strings.h>
+#define SHA1HANDSOFF 1 /* Copies data before messing with it. */
#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits))))
/* blk0() and blk() perform the initial expand. */
diff --git a/sha2.c b/sha2.c
index 6ba4ab5cb1e0..9a27122bfe1e 100644
--- a/sha2.c
+++ b/sha2.c
@@ -546,9 +546,15 @@ void ldns_sha256_update(ldns_sha256_CTX* context, const sha2_byte *data, size_t
usedspace = freespace = 0;
}
+typedef union _ldns_sha2_buffer_union {
+ uint8_t* theChars;
+ uint64_t* theLongs;
+} ldns_sha2_buffer_union;
+
void ldns_sha256_final(sha2_byte digest[], ldns_sha256_CTX* context) {
sha2_word32 *d = (sha2_word32*)digest;
size_t usedspace;
+ ldns_sha2_buffer_union cast_var;
/* Sanity check: */
assert(context != (ldns_sha256_CTX*)0);
@@ -585,7 +591,8 @@ void ldns_sha256_final(sha2_byte digest[], ldns_sha256_CTX* context) {
*context->buffer = 0x80;
}
/* Set the bit count: */
- *(sha2_word64*)&context->buffer[ldns_sha256_SHORT_BLOCK_LENGTH] = context->bitcount;
+ cast_var.theChars = context->buffer;
+ cast_var.theLongs[ldns_sha256_SHORT_BLOCK_LENGTH / 8] = context->bitcount;
/* final transform: */
ldns_sha256_Transform(context, (sha2_word32*)context->buffer);
@@ -850,6 +857,7 @@ void ldns_sha512_update(ldns_sha512_CTX* context, const sha2_byte *data, size_t
static void ldns_sha512_Last(ldns_sha512_CTX* context) {
size_t usedspace;
+ ldns_sha2_buffer_union cast_var;
usedspace = (context->bitcount[0] >> 3) % LDNS_SHA512_BLOCK_LENGTH;
#if BYTE_ORDER == LITTLE_ENDIAN
@@ -882,8 +890,9 @@ static void ldns_sha512_Last(ldns_sha512_CTX* context) {
*context->buffer = 0x80;
}
/* Store the length of input data (in bits): */
- *(sha2_word64*)&context->buffer[ldns_sha512_SHORT_BLOCK_LENGTH] = context->bitcount[1];
- *(sha2_word64*)&context->buffer[ldns_sha512_SHORT_BLOCK_LENGTH+8] = context->bitcount[0];
+ cast_var.theChars = context->buffer;
+ cast_var.theLongs[ldns_sha512_SHORT_BLOCK_LENGTH / 8] = context->bitcount[1];
+ cast_var.theLongs[ldns_sha512_SHORT_BLOCK_LENGTH / 8 + 1] = context->bitcount[0];
/* final transform: */
ldns_sha512_Transform(context, (sha2_word64*)context->buffer);
diff --git a/str2host.c b/str2host.c
index 51357cc3176c..26cef3d036e1 100644
--- a/str2host.c
+++ b/str2host.c
@@ -257,33 +257,48 @@ ldns_str2rdf_int8(ldns_rdf **rd, const char *bytestr)
* Returns the number of bytes read from the escaped string, or
* 0 on error
*/
-static int
-parse_escape(uint8_t *s, uint8_t *q) {
+INLINE bool
+parse_escape(uint8_t *ch_p, const char** str_p)
+{
uint16_t val;
- if (strlen((char *)s) > 3 &&
- isdigit((int) s[1]) &&
- isdigit((int) s[2]) &&
- isdigit((int) s[3])) {
- /* cast this so it fits */
- val = (uint16_t) ldns_hexdigit_to_int((char) s[1]) * 100 +
- ldns_hexdigit_to_int((char) s[2]) * 10 +
- ldns_hexdigit_to_int((char) s[3]);
+
+ if ((*str_p)[0] && isdigit((*str_p)[0]) &&
+ (*str_p)[1] && isdigit((*str_p)[1]) &&
+ (*str_p)[2] && isdigit((*str_p)[2])) {
+
+ val = (uint16_t)(((*str_p)[0] - '0') * 100 +
+ ((*str_p)[1] - '0') * 10 +
+ ((*str_p)[2] - '0'));
+
if (val > 255) {
- /* outside range */
- return 0;
- }
- *q = (uint8_t) val;
- return 3;
- } else {
- s++;
- if (*s == '\0' || isdigit((int) *s)) {
- /* apparently the string terminator
- * or a digit has been escaped...
- */
- return 0;
+ goto error;
}
- *q = *s;
- return 1;
+ *ch_p = (uint8_t)val;
+ *str_p += 3;
+ return true;
+
+ } else if ((*str_p)[0] && !isdigit((*str_p)[0])) {
+
+ *ch_p = (uint8_t)*(*str_p)++;
+ return true;
+ }
+error:
+ *str_p = NULL;
+ return false; /* LDNS_STATUS_SYNTAX_BAD_ESCAPE */
+}
+
+INLINE bool
+parse_char(uint8_t *ch_p, const char** str_p)
+{
+ switch (**str_p) {
+
+ case '\0': return false;
+
+ case '\\': *str_p += 1;
+ return parse_escape(ch_p, str_p);
+
+ default: *ch_p = (uint8_t)*(*str_p)++;
+ return true;
}
}
@@ -297,8 +312,8 @@ ldns_str2rdf_dname(ldns_rdf **d, const char *str)
{
size_t len;
- int esc;
- uint8_t *s, *q, *pq, label_len;
+ const char *s;
+ uint8_t *q, *pq, label_len;
uint8_t buf[LDNS_MAX_DOMAINLEN + 1];
*d = NULL;
@@ -328,7 +343,7 @@ ldns_str2rdf_dname(ldns_rdf **d, const char *str)
q = buf+1;
pq = buf;
label_len = 0;
- for (s = (uint8_t *)str; *s; s++, q++) {
+ for (s = str; *s; s++, q++) {
if (q > buf + LDNS_MAX_DOMAINLEN) {
return LDNS_STATUS_DOMAINNAME_OVERFLOW;
}
@@ -348,16 +363,15 @@ ldns_str2rdf_dname(ldns_rdf **d, const char *str)
break;
case '\\':
/* octet value or literal char */
- esc = parse_escape(s, q);
- if (esc > 0) {
- s += esc;
- label_len++;
- } else {
+ s += 1;
+ if (! parse_escape(q, &s)) {
return LDNS_STATUS_SYNTAX_BAD_ESCAPE;
}
+ s -= 1;
+ label_len++;
break;
default:
- *q = *s;
+ *q = (uint8_t)*s;
label_len++;
}
}
@@ -413,36 +427,44 @@ ldns_str2rdf_aaaa(ldns_rdf **rd, const char *str)
ldns_status
ldns_str2rdf_str(ldns_rdf **rd, const char *str)
{
- uint8_t *data;
- size_t i, str_i, esc_i;
+ uint8_t *data, *dp, ch = 0;
+ size_t length;
- if (strlen(str) > 255) {
- return LDNS_STATUS_INVALID_STR;
+ /* Worst case space requirement. We'll realloc to actual size later. */
+ dp = data = LDNS_XMALLOC(uint8_t, strlen(str) > 255 ? 256 : (strlen(str) + 1));
+ if (! data) {
+ return LDNS_STATUS_MEM_ERR;
}
- data = LDNS_XMALLOC(uint8_t, strlen(str) + 1);
- if(!data) return LDNS_STATUS_MEM_ERR;
- i = 1;
-
- for (str_i = 0; str_i < strlen(str); str_i++) {
- if (str[str_i] == '\\') {
- /* octet value or literal char */
- esc_i = (size_t) parse_escape((uint8_t*) &str[str_i], (uint8_t*) &data[i]);
- if (esc_i == 0) {
- LDNS_FREE(data);
- return LDNS_STATUS_SYNTAX_BAD_ESCAPE;
- }
- str_i += esc_i;
- } else {
- data[i] = (uint8_t) str[str_i];
+ /* Fill data (up to 255 characters) */
+ while (parse_char(&ch, &str)) {
+ if (dp - data >= 255) {
+ LDNS_FREE(data);
+ return LDNS_STATUS_INVALID_STR;
}
- i++;
+ *++dp = ch;
+ }
+ if (! str) {
+ return LDNS_STATUS_SYNTAX_BAD_ESCAPE;
}
- data[0] = i - 1;
- *rd = ldns_rdf_new_frm_data(LDNS_RDF_TYPE_STR, i, data);
+ length = (size_t)(dp - data);
+ /* Fix last length byte */
+ data[0] = (uint8_t)length;
- LDNS_FREE(data);
- return *rd?LDNS_STATUS_OK:LDNS_STATUS_MEM_ERR;
+ /* Lose the overmeasure */
+ data = LDNS_XREALLOC(dp = data, uint8_t, length + 1);
+ if (! data) {
+ LDNS_FREE(dp);
+ return LDNS_STATUS_MEM_ERR;
+ }
+
+ /* Create rdf */
+ *rd = ldns_rdf_new(LDNS_RDF_TYPE_STR, length + 1, data);
+ if (! *rd) {
+ LDNS_FREE(data);
+ return LDNS_STATUS_MEM_ERR;
+ }
+ return LDNS_STATUS_OK;
}
ldns_status
@@ -791,15 +813,6 @@ ldns_str2rdf_unknown( ATTR_UNUSED(ldns_rdf **rd)
}
ldns_status
-ldns_str2rdf_tsig( ATTR_UNUSED(ldns_rdf **rd)
- , ATTR_UNUSED(const char *str)
- )
-{
- /* there is no string representation for TSIG rrs */
- return LDNS_STATUS_NOT_IMPL;
-}
-
-ldns_status
ldns_str2rdf_service( ATTR_UNUSED(ldns_rdf **rd)
, ATTR_UNUSED(const char *str)
)
@@ -1317,3 +1330,240 @@ ldns_str2rdf_ipseckey(ldns_rdf **rd, const char *str)
if(!*rd) return LDNS_STATUS_MEM_ERR;
return LDNS_STATUS_OK;
}
+
+ldns_status
+ldns_str2rdf_ilnp64(ldns_rdf **rd, const char *str)
+{
+ unsigned int a, b, c, d;
+ uint16_t shorts[4];
+ int l;
+
+ if (sscanf(str, "%4x:%4x:%4x:%4x%n", &a, &b, &c, &d, &l) != 4 ||
+ l != (int)strlen(str) || /* more data to read */
+ strpbrk(str, "+-") /* signed hexes */
+ ) {
+ return LDNS_STATUS_INVALID_ILNP64;
+ } else {
+ shorts[0] = htons(a);
+ shorts[1] = htons(b);
+ shorts[2] = htons(c);
+ shorts[3] = htons(d);
+ *rd = ldns_rdf_new_frm_data(
+ LDNS_RDF_TYPE_ILNP64, 4 * sizeof(uint16_t), &shorts);
+ }
+ return *rd ? LDNS_STATUS_OK : LDNS_STATUS_MEM_ERR;
+}
+
+ldns_status
+ldns_str2rdf_eui48(ldns_rdf **rd, const char *str)
+{
+ unsigned int a, b, c, d, e, f;
+ uint8_t bytes[6];
+ int l;
+
+ if (sscanf(str, "%2x-%2x-%2x-%2x-%2x-%2x%n",
+ &a, &b, &c, &d, &e, &f, &l) != 6 ||
+ l != (int)strlen(str) || /* more data to read */
+ strpbrk(str, "+-") /* signed hexes */
+ ) {
+ return LDNS_STATUS_INVALID_EUI48;
+ } else {
+ bytes[0] = a;
+ bytes[1] = b;
+ bytes[2] = c;
+ bytes[3] = d;
+ bytes[4] = e;
+ bytes[5] = f;
+ *rd = ldns_rdf_new_frm_data(LDNS_RDF_TYPE_EUI48, 6, &bytes);
+ }
+ return *rd ? LDNS_STATUS_OK : LDNS_STATUS_MEM_ERR;
+}
+
+ldns_status
+ldns_str2rdf_eui64(ldns_rdf **rd, const char *str)
+{
+ unsigned int a, b, c, d, e, f, g, h;
+ uint8_t bytes[8];
+ int l;
+
+ if (sscanf(str, "%2x-%2x-%2x-%2x-%2x-%2x-%2x-%2x%n",
+ &a, &b, &c, &d, &e, &f, &g, &h, &l) != 8 ||
+ l != (int)strlen(str) || /* more data to read */
+ strpbrk(str, "+-") /* signed hexes */
+ ) {
+ return LDNS_STATUS_INVALID_EUI64;
+ } else {
+ bytes[0] = a;
+ bytes[1] = b;
+ bytes[2] = c;
+ bytes[3] = d;
+ bytes[4] = e;
+ bytes[5] = f;
+ bytes[6] = g;
+ bytes[7] = h;
+ *rd = ldns_rdf_new_frm_data(LDNS_RDF_TYPE_EUI64, 8, &bytes);
+ }
+ return *rd ? LDNS_STATUS_OK : LDNS_STATUS_MEM_ERR;
+}
+
+ldns_status
+ldns_str2rdf_tag(ldns_rdf **rd, const char *str)
+{
+ uint8_t *data;
+ const char* ptr;
+
+ if (strlen(str) > 255) {
+ return LDNS_STATUS_INVALID_TAG;
+ }
+ for (ptr = str; *ptr; ptr++) {
+ if (! isalnum(*ptr)) {
+ return LDNS_STATUS_INVALID_TAG;
+ }
+ }
+ data = LDNS_XMALLOC(uint8_t, strlen(str) + 1);
+ if (!data) {
+ return LDNS_STATUS_MEM_ERR;
+ }
+ data[0] = strlen(str);
+ memcpy(data + 1, str, strlen(str));
+
+ *rd = ldns_rdf_new(LDNS_RDF_TYPE_TAG, strlen(str) + 1, data);
+ if (!*rd) {
+ LDNS_FREE(data);
+ return LDNS_STATUS_MEM_ERR;
+ }
+ return LDNS_STATUS_OK;
+}
+
+ldns_status
+ldns_str2rdf_long_str(ldns_rdf **rd, const char *str)
+{
+ uint8_t *data, *dp, ch = 0;
+ size_t length;
+
+ /* Worst case space requirement. We'll realloc to actual size later. */
+ dp = data = LDNS_XMALLOC(uint8_t, strlen(str));
+ if (! data) {
+ return LDNS_STATUS_MEM_ERR;
+ }
+
+ /* Fill data with parsed bytes */
+ while (parse_char(&ch, &str)) {
+ *dp++ = ch;
+ if (dp - data > LDNS_MAX_RDFLEN) {
+ LDNS_FREE(data);
+ return LDNS_STATUS_INVALID_STR;
+ }
+ }
+ if (! str) {
+ return LDNS_STATUS_SYNTAX_BAD_ESCAPE;
+ }
+ length = (size_t)(dp - data);
+
+ /* Lose the overmeasure */
+ data = LDNS_XREALLOC(dp = data, uint8_t, length);
+ if (! data) {
+ LDNS_FREE(dp);
+ return LDNS_STATUS_MEM_ERR;
+ }
+
+ /* Create rdf */
+ *rd = ldns_rdf_new(LDNS_RDF_TYPE_LONG_STR, length, data);
+ if (! *rd) {
+ LDNS_FREE(data);
+ return LDNS_STATUS_MEM_ERR;
+ }
+ return LDNS_STATUS_OK;
+}
+
+ldns_status
+ldns_str2rdf_hip(ldns_rdf **rd, const char *str)
+{
+ const char *hit = strchr(str, ' ') + 1;
+ const char *pk = hit == NULL ? NULL : strchr(hit, ' ') + 1;
+ size_t hit_size = hit == NULL ? 0
+ : pk == NULL ? strlen(hit) : (size_t) (pk - hit) - 1;
+ size_t pk_size = pk == NULL ? 0 : strlen(pk);
+ size_t hit_wire_size = (hit_size + 1) / 2;
+ size_t pk_wire_size = ldns_b64_pton_calculate_size(pk_size);
+ size_t rdf_size = 4 + hit_wire_size + pk_wire_size;
+
+ char *endptr; /* utility var for strtol usage */
+ int algorithm = strtol(str, &endptr, 10);
+
+ uint8_t *data, *dp;
+ int hi, lo, written;
+
+ if (hit_size == 0 || pk_size == 0 || (hit_size + 1) / 2 > 255
+ || rdf_size > LDNS_MAX_RDFLEN
+ || algorithm < 0 || algorithm > 255
+ || (errno != 0 && algorithm == 0) /* out of range */
+ || endptr == str /* no digits */) {
+
+ return LDNS_STATUS_SYNTAX_ERR;
+ }
+ if ((data = LDNS_XMALLOC(uint8_t, rdf_size)) == NULL) {
+
+ return LDNS_STATUS_MEM_ERR;
+ }
+ /* From RFC 5205 section 5. HIP RR Storage Format:
+ *************************************************
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | HIT length | PK algorithm | PK length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ ~ HIT ~
+ | |
+ + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | | |
+ +-+-+-+-+-+-+-+-+-+-+-+ +
+ | Public Key |
+ ~ ~
+ | |
+ + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | | |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
+ | |
+ ~ Rendezvous Servers ~
+ | |
+ + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ +-+-+-+-+-+-+-+ */
+
+ data[0] = (uint8_t) hit_wire_size;
+ data[1] = (uint8_t) algorithm;
+
+ for (dp = data + 4; *hit && *hit != ' '; dp++) {
+
+ if ((hi = ldns_hexdigit_to_int(*hit++)) == -1 ||
+ (lo = ldns_hexdigit_to_int(*hit++)) == -1) {
+
+ LDNS_FREE(data);
+ return LDNS_STATUS_INVALID_HEX;
+ }
+ *dp = (uint8_t) hi << 4 | lo;
+ }
+ if ((written = ldns_b64_pton(pk, dp, pk_wire_size)) <= 0) {
+
+ LDNS_FREE(data);
+ return LDNS_STATUS_INVALID_B64;
+ }
+
+ /* Because ldns_b64_pton_calculate_size isn't always correct:
+ * (we have to fix it at some point)
+ */
+ pk_wire_size = (uint16_t) written;
+ ldns_write_uint16(data + 2, pk_wire_size);
+ rdf_size = 4 + hit_wire_size + pk_wire_size;
+
+ /* Create rdf */
+ if (! (*rd = ldns_rdf_new(LDNS_RDF_TYPE_HIP, rdf_size, data))) {
+
+ LDNS_FREE(data);
+ return LDNS_STATUS_MEM_ERR;
+ }
+ return LDNS_STATUS_OK;
+}
diff --git a/tsig.c b/tsig.c
index afc2590231f1..53aa85ecb46a 100644
--- a/tsig.c
+++ b/tsig.c
@@ -134,19 +134,15 @@ ldns_digest_function(char *name)
{
/* these are the mandatory algorithms from RFC4635 */
/* The optional algorithms are not yet implemented */
- if (strlen(name) == 12
- && strncasecmp(name, "hmac-sha256.", 11) == 0) {
+ if (strcasecmp(name, "hmac-sha256.") == 0) {
#ifdef HAVE_EVP_SHA256
return EVP_sha256();
#else
return NULL;
#endif
- } else if (strlen(name) == 10
- && strncasecmp(name, "hmac-sha1.", 9) == 0) {
+ } else if (strcasecmp(name, "hmac-sha1.") == 0) {
return EVP_sha1();
- } else if (strlen(name) == 25
- && strncasecmp(name, "hmac-md5.sig-alg.reg.int.", 25)
- == 0) {
+ } else if (strcasecmp(name, "hmac-md5.sig-alg.reg.int.") == 0) {
return EVP_md5();
} else {
return NULL;
diff --git a/util.c b/util.c
index 0439fbe25b3a..33060d9637b5 100644
--- a/util.c
+++ b/util.c
@@ -20,6 +20,7 @@
#include <stdio.h>
#include <sys/time.h>
#include <time.h>
+#include <ctype.h>
#ifdef HAVE_SSL
#include <openssl/rand.h>
@@ -460,3 +461,313 @@ ldns_bubblebabble(uint8_t *data, size_t len)
retval[j++] = '\0';
return retval;
}
+
+/*
+ * For backwards compatibility, because we have always exported this symbol.
+ */
+#ifdef HAVE_B64_NTOP
+int ldns_b64_ntop(const uint8_t* src, size_t srclength,
+ char *target, size_t targsize);
+{
+ return b64_ntop(src, srclength, target, targsize);
+}
+#endif
+
+/*
+ * For backwards compatibility, because we have always exported this symbol.
+ */
+#ifdef HAVE_B64_PTON
+int ldns_b64_pton(const char* src, uint8_t *target, size_t targsize)
+{
+ return b64_pton(src, target, targsize);
+}
+#endif
+
+
+static int
+ldns_b32_ntop_base(const uint8_t* src, size_t src_sz,
+ char* dst, size_t dst_sz,
+ bool extended_hex, bool add_padding)
+{
+ size_t ret_sz;
+ const char* b32 = extended_hex ? "0123456789abcdefghijklmnopqrstuv"
+ : "abcdefghijklmnopqrstuvwxyz234567";
+
+ size_t c = 0; /* c is used to carry partial base32 character over
+ * byte boundaries for sizes with a remainder.
+ * (i.e. src_sz % 5 != 0)
+ */
+
+ ret_sz = add_padding ? ldns_b32_ntop_calculate_size(src_sz)
+ : ldns_b32_ntop_calculate_size_no_padding(src_sz);
+
+ /* Do we have enough space? */
+ if (dst_sz < ret_sz + 1)
+ return -1;
+
+ /* We know the size; terminate the string */
+ dst[ret_sz] = '\0';
+
+ /* First process all chunks of five */
+ while (src_sz >= 5) {
+ /* 00000... ........ ........ ........ ........ */
+ dst[0] = b32[(src[0] ) >> 3];
+
+ /* .....111 11...... ........ ........ ........ */
+ dst[1] = b32[(src[0] & 0x07) << 2 | src[1] >> 6];
+
+ /* ........ ..22222. ........ ........ ........ */
+ dst[2] = b32[(src[1] & 0x3e) >> 1];
+
+ /* ........ .......3 3333.... ........ ........ */
+ dst[3] = b32[(src[1] & 0x01) << 4 | src[2] >> 4];
+
+ /* ........ ........ ....4444 4....... ........ */
+ dst[4] = b32[(src[2] & 0x0f) << 1 | src[3] >> 7];
+
+ /* ........ ........ ........ .55555.. ........ */
+ dst[5] = b32[(src[3] & 0x7c) >> 2];
+
+ /* ........ ........ ........ ......66 666..... */
+ dst[6] = b32[(src[3] & 0x03) << 3 | src[4] >> 5];
+
+ /* ........ ........ ........ ........ ...77777 */
+ dst[7] = b32[(src[4] & 0x1f) ];
+
+ src_sz -= 5;
+ src += 5;
+ dst += 8;
+ }
+ /* Process what remains */
+ switch (src_sz) {
+ case 4: /* ........ ........ ........ ......66 666..... */
+ dst[6] = b32[(src[3] & 0x03) << 3];
+
+ /* ........ ........ ........ .55555.. ........ */
+ dst[5] = b32[(src[3] & 0x7c) >> 2];
+
+ /* ........ ........ ....4444 4....... ........ */
+ c = src[3] >> 7 ;
+ case 3: dst[4] = b32[(src[2] & 0x0f) << 1 | c];
+
+ /* ........ .......3 3333.... ........ ........ */
+ c = src[2] >> 4 ;
+ case 2: dst[3] = b32[(src[1] & 0x01) << 4 | c];
+
+ /* ........ ..22222. ........ ........ ........ */
+ dst[2] = b32[(src[1] & 0x3e) >> 1];
+
+ /* .....111 11...... ........ ........ ........ */
+ c = src[1] >> 6 ;
+ case 1: dst[1] = b32[(src[0] & 0x07) << 2 | c];
+
+ /* 00000... ........ ........ ........ ........ */
+ dst[0] = b32[ src[0] >> 3];
+ }
+ /* Add padding */
+ if (add_padding) {
+ switch (src_sz) {
+ case 1: dst[2] = '=';
+ dst[3] = '=';
+ case 2: dst[4] = '=';
+ case 3: dst[5] = '=';
+ dst[6] = '=';
+ case 4: dst[7] = '=';
+ }
+ }
+ return (int)ret_sz;
+}
+
+int
+ldns_b32_ntop(const uint8_t* src, size_t src_sz, char* dst, size_t dst_sz)
+{
+ return ldns_b32_ntop_base(src, src_sz, dst, dst_sz, false, true);
+}
+
+int
+ldns_b32_ntop_extended_hex(const uint8_t* src, size_t src_sz,
+ char* dst, size_t dst_sz)
+{
+ return ldns_b32_ntop_base(src, src_sz, dst, dst_sz, true, true);
+}
+
+#ifndef HAVE_B32_NTOP
+
+int
+b32_ntop(const uint8_t* src, size_t src_sz, char* dst, size_t dst_sz)
+{
+ return ldns_b32_ntop_base(src, src_sz, dst, dst_sz, false, true);
+}
+
+int
+b32_ntop_extended_hex(const uint8_t* src, size_t src_sz,
+ char* dst, size_t dst_sz)
+{
+ return ldns_b32_ntop_base(src, src_sz, dst, dst_sz, true, true);
+}
+
+#endif /* ! HAVE_B32_NTOP */
+
+static int
+ldns_b32_pton_base(const char* src, size_t src_sz,
+ uint8_t* dst, size_t dst_sz,
+ bool extended_hex, bool check_padding)
+{
+ size_t i = 0;
+ char ch = '\0';
+ uint8_t buf[8];
+ uint8_t* start = dst;
+
+ while (src_sz) {
+ /* Collect 8 characters in buf (if possible) */
+ for (i = 0; i < 8; i++) {
+
+ do {
+ ch = *src++;
+ --src_sz;
+
+ } while (isspace(ch) && src_sz > 0);
+
+ if (ch == '=' || ch == '\0')
+ break;
+
+ else if (extended_hex)
+
+ if (ch >= '0' && ch <= '9')
+ buf[i] = (uint8_t)ch - '0';
+ else if (ch >= 'a' && ch <= 'v')
+ buf[i] = (uint8_t)ch - 'a' + 10;
+ else if (ch >= 'A' && ch <= 'V')
+ buf[i] = (uint8_t)ch - 'A' + 10;
+ else
+ return -1;
+
+ else if (ch >= 'a' && ch <= 'z')
+ buf[i] = (uint8_t)ch - 'a';
+ else if (ch >= 'A' && ch <= 'Z')
+ buf[i] = (uint8_t)ch - 'A';
+ else if (ch >= '2' && ch <= '7')
+ buf[i] = (uint8_t)ch - '2' + 26;
+ else
+ return -1;
+ }
+ /* Less that 8 characters. We're done. */
+ if (i < 8)
+ break;
+
+ /* Enough space available at the destination? */
+ if (dst_sz < 5)
+ return -1;
+
+ /* 00000... ........ ........ ........ ........ */
+ /* .....111 11...... ........ ........ ........ */
+ dst[0] = buf[0] << 3 | buf[1] >> 2;
+
+ /* .....111 11...... ........ ........ ........ */
+ /* ........ ..22222. ........ ........ ........ */
+ /* ........ .......3 3333.... ........ ........ */
+ dst[1] = buf[1] << 6 | buf[2] << 1 | buf[3] >> 4;
+
+ /* ........ .......3 3333.... ........ ........ */
+ /* ........ ........ ....4444 4....... ........ */
+ dst[2] = buf[3] << 4 | buf[4] >> 1;
+
+ /* ........ ........ ....4444 4....... ........ */
+ /* ........ ........ ........ .55555.. ........ */
+ /* ........ ........ ........ ......66 666..... */
+ dst[3] = buf[4] << 7 | buf[5] << 2 | buf[6] >> 3;
+
+ /* ........ ........ ........ ......66 666..... */
+ /* ........ ........ ........ ........ ...77777 */
+ dst[4] = buf[6] << 5 | buf[7];
+
+ dst += 5;
+ dst_sz -= 5;
+ }
+ /* Not ending on a eight byte boundary? */
+ if (i > 0 && i < 8) {
+
+ /* Enough space available at the destination? */
+ if (dst_sz < (i + 1) / 2)
+ return -1;
+
+ switch (i) {
+ case 7: /* ........ ........ ........ ......66 666..... */
+ /* ........ ........ ........ .55555.. ........ */
+ /* ........ ........ ....4444 4....... ........ */
+ dst[3] = buf[4] << 7 | buf[5] << 2 | buf[6] >> 3;
+
+ case 5: /* ........ ........ ....4444 4....... ........ */
+ /* ........ .......3 3333.... ........ ........ */
+ dst[2] = buf[3] << 4 | buf[4] >> 1;
+
+ case 4: /* ........ .......3 3333.... ........ ........ */
+ /* ........ ..22222. ........ ........ ........ */
+ /* .....111 11...... ........ ........ ........ */
+ dst[1] = buf[1] << 6 | buf[2] << 1 | buf[3] >> 4;
+
+ case 2: /* .....111 11...... ........ ........ ........ */
+ /* 00000... ........ ........ ........ ........ */
+ dst[0] = buf[0] << 3 | buf[1] >> 2;
+
+ break;
+
+ default:
+ return -1;
+ }
+ dst += (i + 1) / 2;
+
+ if (check_padding) {
+ /* Check remaining padding characters */
+ if (ch != '=')
+ return -1;
+
+ /* One down, 8 - i - 1 more to come... */
+ for (i = 8 - i - 1; i > 0; i--) {
+
+ do {
+ if (src_sz == 0)
+ return -1;
+ ch = *src++;
+ src_sz--;
+
+ } while (isspace(ch));
+
+ if (ch != '=')
+ return -1;
+ }
+ }
+ }
+ return dst - start;
+}
+
+int
+ldns_b32_pton(const char* src, size_t src_sz, uint8_t* dst, size_t dst_sz)
+{
+ return ldns_b32_pton_base(src, src_sz, dst, dst_sz, false, true);
+}
+
+int
+ldns_b32_pton_extended_hex(const char* src, size_t src_sz,
+ uint8_t* dst, size_t dst_sz)
+{
+ return ldns_b32_pton_base(src, src_sz, dst, dst_sz, true, true);
+}
+
+#ifndef HAVE_B32_PTON
+
+int
+b32_pton(const char* src, size_t src_sz, uint8_t* dst, size_t dst_sz)
+{
+ return ldns_b32_pton_base(src, src_sz, dst, dst_sz, false, true);
+}
+
+int
+b32_pton_extended_hex(const char* src, size_t src_sz,
+ uint8_t* dst, size_t dst_sz)
+{
+ return ldns_b32_pton_base(src, src_sz, dst, dst_sz, true, true);
+}
+
+#endif /* ! HAVE_B32_PTON */
+
diff --git a/wire2host.c b/wire2host.c
index e87fcdf5df64..f305808c2851 100644
--- a/wire2host.c
+++ b/wire2host.c
@@ -64,10 +64,12 @@ ldns_wire2dname(ldns_rdf **dname, const uint8_t *wire, size_t max, size_t *pos)
uint8_t tmp_dname[LDNS_MAX_DOMAINLEN];
unsigned int pointer_count = 0;
+ if (pos == NULL) {
+ return LDNS_STATUS_WIRE_RDATA_ERR;
+ }
if (*pos >= max) {
return LDNS_STATUS_PACKET_OVERFLOW;
}
-
label_size = wire[*pos];
while (label_size > 0) {
/* compression */
@@ -162,9 +164,13 @@ ldns_wire2rdf(ldns_rr *rr, const uint8_t *wire, size_t max, size_t *pos)
uint16_t rd_length;
ldns_rdf *cur_rdf = NULL;
ldns_rdf_type cur_rdf_type;
- const ldns_rr_descriptor *descriptor = ldns_rr_descript(ldns_rr_get_type(rr));
+ const ldns_rr_descriptor *descriptor;
ldns_status status;
+ assert(rr != NULL);
+
+ descriptor = ldns_rr_descript(ldns_rr_get_type(rr));
+
if (*pos + 2 > max) {
return LDNS_STATUS_PACKET_OVERFLOW;
}
@@ -178,14 +184,15 @@ ldns_wire2rdf(ldns_rr *rr, const uint8_t *wire, size_t max, size_t *pos)
end = *pos + (size_t) rd_length;
- for (rdf_index = 0;
- rdf_index < ldns_rr_descriptor_maximum(descriptor); rdf_index++) {
- if (*pos >= end) {
- break;
- }
+ rdf_index = 0;
+ while (*pos < end &&
+ rdf_index < ldns_rr_descriptor_maximum(descriptor)) {
+
cur_rdf_length = 0;
- cur_rdf_type = ldns_rr_descriptor_field_type(descriptor, rdf_index);
+ cur_rdf_type = ldns_rr_descriptor_field_type(
+ descriptor, rdf_index);
+
/* handle special cases immediately, set length
for fixed length rdata and do them below */
switch (cur_rdf_type) {
@@ -210,21 +217,40 @@ ldns_wire2rdf(ldns_rr *rr, const uint8_t *wire, size_t max, size_t *pos)
cur_rdf_length = LDNS_RDF_SIZE_DOUBLEWORD;
break;
case LDNS_RDF_TYPE_TSIGTIME:
+ case LDNS_RDF_TYPE_EUI48:
cur_rdf_length = LDNS_RDF_SIZE_6BYTES;
break;
+ case LDNS_RDF_TYPE_ILNP64:
+ case LDNS_RDF_TYPE_EUI64:
+ cur_rdf_length = LDNS_RDF_SIZE_8BYTES;
+ break;
case LDNS_RDF_TYPE_AAAA:
cur_rdf_length = LDNS_RDF_SIZE_16BYTES;
break;
case LDNS_RDF_TYPE_STR:
case LDNS_RDF_TYPE_NSEC3_SALT:
+ case LDNS_RDF_TYPE_TAG:
/* len is stored in first byte
* it should be in the rdf too, so just
* copy len+1 from this position
*/
cur_rdf_length = ((size_t) wire[*pos]) + 1;
break;
+
case LDNS_RDF_TYPE_INT16_DATA:
- cur_rdf_length = (size_t) ldns_read_uint16(&wire[*pos]) + 2;
+ if (*pos + 2 > end) {
+ return LDNS_STATUS_PACKET_OVERFLOW;
+ }
+ cur_rdf_length =
+ (size_t) ldns_read_uint16(&wire[*pos]) + 2;
+ break;
+ case LDNS_RDF_TYPE_HIP:
+ if (*pos + 4 > end) {
+ return LDNS_STATUS_PACKET_OVERFLOW;
+ }
+ cur_rdf_length =
+ (size_t) wire[*pos] +
+ (size_t) ldns_read_uint16(&wire[*pos + 2]) + 4;
break;
case LDNS_RDF_TYPE_B32_EXT:
case LDNS_RDF_TYPE_NSEC3_NEXT_OWNER:
@@ -242,7 +268,7 @@ ldns_wire2rdf(ldns_rr *rr, const uint8_t *wire, size_t max, size_t *pos)
case LDNS_RDF_TYPE_NSAP:
case LDNS_RDF_TYPE_ATMA:
case LDNS_RDF_TYPE_IPSECKEY:
- case LDNS_RDF_TYPE_TSIG:
+ case LDNS_RDF_TYPE_LONG_STR:
case LDNS_RDF_TYPE_NONE:
/*
* Read to end of rr rdata
@@ -262,7 +288,8 @@ ldns_wire2rdf(ldns_rr *rr, const uint8_t *wire, size_t max, size_t *pos)
}
memcpy(data, &wire[*pos], cur_rdf_length);
- cur_rdf = ldns_rdf_new(cur_rdf_type, cur_rdf_length, data);
+ cur_rdf = ldns_rdf_new(cur_rdf_type,
+ cur_rdf_length, data);
*pos = *pos + cur_rdf_length;
}
@@ -270,7 +297,11 @@ ldns_wire2rdf(ldns_rr *rr, const uint8_t *wire, size_t max, size_t *pos)
ldns_rr_push_rdf(rr, cur_rdf);
cur_rdf = NULL;
}
- }
+
+ rdf_index++;
+
+ } /* while (rdf_index < ldns_rr_descriptor_maximum(descriptor)) */
+
return LDNS_STATUS_OK;
}