mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-27 13:32:45 +00:00
MFH (r266114, r266138): upgrade to latest ldns and unbound
MFH (r266139-r266143, r266145, r266149, r266150): fix props MFH (r266179, r266180, r266193, r266238, r266777): misc cleanup MFH (r266863): create and use /var/unbound/conf.d MFH (r268839): import unblock-lan-zones patch from upstream MFH (r268840): fix reverse lookups on private networks MFH (r268883): avoid spamming source tree during build PR: 190739 (for r268883)
This commit is contained in:
parent
2c76c28e0a
commit
da2a556f17
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/stable/10/; revision=269257
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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)
|
@ -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 */
|
||||
])
|
||||
|
@ -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)
|
||||
|
@ -1,337 +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>
|
||||
#ifndef HAVE_B32_NTOP
|
||||
|
||||
#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>
|
||||
|
||||
#include <ldns/util.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
|
||||
|
||||
*/
|
||||
|
||||
|
||||
static 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);
|
||||
}
|
||||
|
||||
#endif /* !HAVE_B32_NTOP */
|
@ -1,392 +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>
|
||||
#ifndef HAVE_B32_PTON
|
||||
|
||||
#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 <ldns/util.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.
|
||||
*/
|
||||
|
||||
static 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);
|
||||
}
|
||||
|
||||
#endif /* !HAVE_B32_PTON */
|
@ -40,30 +40,10 @@
|
||||
* IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
#include <ldns/config.h>
|
||||
#ifndef HAVE_B64_NTOP
|
||||
|
||||
#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 <ldns/util.h>
|
||||
|
||||
#define Assert(Cond) if (!(Cond)) abort()
|
||||
|
||||
static const char Base64[] =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
static const char Pad64 = '=';
|
||||
@ -157,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);
|
||||
@ -181,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);
|
||||
@ -203,5 +183,3 @@ ldns_b64_ntop(uint8_t const *src, size_t srclength, char *target, size_t targsiz
|
||||
target[datalength] = '\0'; /* Returned value doesn't count \0. */
|
||||
return (int) (datalength);
|
||||
}
|
||||
|
||||
#endif /* !HAVE_B64_NTOP */
|
||||
|
@ -40,28 +40,10 @@
|
||||
* IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
#include <ldns/config.h>
|
||||
#ifndef HAVE_B64_PTON
|
||||
|
||||
#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 <ldns/util.h>
|
||||
|
||||
static const char Base64[] =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
static const char Pad64 = '=';
|
||||
@ -259,5 +241,3 @@ ldns_b64_pton(char const *src, uint8_t *target, size_t targsize)
|
||||
|
||||
return (tarindex);
|
||||
}
|
||||
|
||||
#endif /* !HAVE_B64_PTON */
|
||||
|
File diff suppressed because it is too large
Load Diff
6981
contrib/ldns/configure
vendored
6981
contrib/ldns/configure
vendored
File diff suppressed because it is too large
Load Diff
@ -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 */
|
||||
|
@ -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 */
|
||||
|
@ -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;
|
||||
/* 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;
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
/* 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_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);
|
||||
|
||||
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);
|
||||
}
|
||||
/* Now let windows[i] index the bitmap
|
||||
* within data
|
||||
*/
|
||||
windows[i] = (uint16_t)(dptr - data);
|
||||
|
||||
/* 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;
|
||||
dptr += dptr[-1];
|
||||
}
|
||||
cur_window++;
|
||||
cur_window_max = 0;
|
||||
memset(cur_data, 0, 32);
|
||||
}
|
||||
cur_data[i%32] = bitmap[i];
|
||||
if (bitmap[i] > 0) {
|
||||
cur_window_max = i%32;
|
||||
}
|
||||
}
|
||||
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;
|
||||
|
||||
/* 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));
|
||||
}
|
||||
bitmap_rdf = ldns_rdf_new_frm_data(LDNS_RDF_TYPE_NSEC,
|
||||
cur_data_size,
|
||||
data);
|
||||
|
||||
LDNS_FREE(bitmap);
|
||||
LDNS_FREE(data);
|
||||
|
||||
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;
|
||||
uint8_t* dptr;
|
||||
uint8_t* dend;
|
||||
|
||||
if (nsec_bitmap == NULL) {
|
||||
/* 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;
|
||||
assert(ldns_rdf_get_type(bitmap) == LDNS_RDF_TYPE_BITMAP);
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
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) {
|
||||
|
||||
return dptr[2 + subtype / 8] & (0x80 >> (subtype % 8));
|
||||
}
|
||||
|
||||
pos += (uint16_t) bitmap_length;
|
||||
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);
|
||||
|
@ -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,6 +771,12 @@ ldns_dnssec_zone_create_nsecs(ldns_dnssec_zone *zone,
|
||||
}
|
||||
|
||||
#ifdef HAVE_SSL
|
||||
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,
|
||||
ldns_rr_list *new_rrs,
|
||||
@ -810,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,
|
||||
@ -842,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);
|
||||
|
||||
@ -910,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;
|
||||
@ -962,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;
|
||||
|
@ -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 void
|
||||
ldns_dnssec_name_make_hashed_name(ldns_dnssec_zone *zone,
|
||||
ldns_dnssec_name* name, ldns_rr* nsec3rr);
|
||||
|
||||
static void
|
||||
ldns_hashed_names_node_free(ldns_rbnode_t *node, void *arg) {
|
||||
(void) arg;
|
||||
LDNS_FREE(node);
|
||||
}
|
||||
|
||||
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;
|
||||
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;
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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_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);
|
||||
|
||||
while (current_node != LDNS_RBTREE_NULL) {
|
||||
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);
|
||||
}
|
||||
if (ldns_dname_compare(hashed_name,
|
||||
current_name->hashed_name)
|
||||
== 0) {
|
||||
ldns_rdf_deep_free(hashed_name);
|
||||
return current_node;
|
||||
}
|
||||
current_node = ldns_rbtree_next(current_node);
|
||||
if (hashed_name == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
ldns_rdf_deep_free(hashed_name);
|
||||
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);
|
||||
|
@ -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 */
|
||||
|
37
contrib/ldns/drill/configure
vendored
37
contrib/ldns/drill/configure
vendored
@ -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\\"
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -82,6 +82,11 @@ the type arguments are not used.
|
||||
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@
|
||||
|
@ -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);
|
||||
|
@ -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') {
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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 }
|
||||
};
|
||||
|
||||
|
@ -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;
|
||||
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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
@ -358,3 +341,4 @@ ldns_print_rr_rdf(FILE *fp, ldns_rr *r, int rdfnum, ...)
|
||||
}
|
||||
va_end(va_rdf);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
@ -450,19 +511,28 @@ ldns_rdf2buffer_str_hex(ldns_buffer *output, const ldns_rdf *rdf)
|
||||
return ldns_buffer_status(output);
|
||||
}
|
||||
|
||||
ldns_status
|
||||
ldns_rdf2buffer_str_type(ldns_buffer *output, const ldns_rdf *rdf)
|
||||
static ldns_status
|
||||
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)) {
|
||||
@ -757,8 +837,9 @@ ldns_rdf2buffer_str_wks(ldns_buffer *output, const ldns_rdf *rdf)
|
||||
return ldns_buffer_status(output);
|
||||
}
|
||||
|
||||
ldns_status
|
||||
ldns_rdf2buffer_str_nsec(ldns_buffer *output, const ldns_rdf *rdf)
|
||||
static ldns_status
|
||||
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,33 +850,42 @@ 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)
|
||||
{
|
||||
@ -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)
|
||||
{
|
||||
/* 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;
|
||||
|
||||
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);
|
||||
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 = 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) {
|
||||
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)
|
||||
{
|
||||
/* TSIG RRs have no presentation format, make them #size <data> */
|
||||
return ldns_rdf2buffer_str_unknown(output, 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)
|
||||
{
|
||||
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(ldns_buffer *buffer, const ldns_rdf *rdf)
|
||||
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_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);
|
||||
}
|
||||
|
||||
static 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, ", ");
|
||||
}
|
||||
if (fmt->flags & LDNS_COMMENT_KEY_SIZE) {
|
||||
ldns_buffer_printf(output, "size = %db",
|
||||
ldns_rr_dnskey_key_size(rr));
|
||||
}
|
||||
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;
|
||||
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(
|
||||
}
|
||||
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_st->flags & LDNS_COMMENT_KEY_SIZE){
|
||||
ldns_buffer_printf(output, ", ");
|
||||
}
|
||||
} 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)) {
|
||||
}
|
||||
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: optout");
|
||||
} else {
|
||||
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));
|
||||
|
@ -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));
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -24,6 +24,9 @@
|
||||
#define LDNS_BUILD_CONFIG_HAVE_ATTR_FORMAT 1
|
||||
#define LDNS_BUILD_CONFIG_HAVE_ATTR_UNUSED 1
|
||||
#define LDNS_BUILD_CONFIG_HAVE_SOCKLEN_T 1
|
||||
#define LDNS_BUILD_CONFIG_USE_DANE 1
|
||||
#define LDNS_BUILD_CONFIG_HAVE_B32_PTON 0
|
||||
#define LDNS_BUILD_CONFIG_HAVE_B32_NTOP 0
|
||||
|
||||
/*
|
||||
* HAVE_STDBOOL_H is not available when distributed as a library, but no build
|
||||
|
@ -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
|
||||
|
@ -87,9 +87,6 @@
|
||||
/* Define to 1 if you have the `inet_pton' function. */
|
||||
#define HAVE_INET_PTON 1
|
||||
|
||||
/* Define to 1 if the system has the type `intptr_t'. */
|
||||
#define HAVE_INTPTR_T 1
|
||||
|
||||
/* define if you have inttypes.h */
|
||||
#define HAVE_INTTYPES_H 1
|
||||
|
||||
@ -277,7 +274,7 @@
|
||||
#define PACKAGE_NAME "ldns"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "ldns 1.6.16"
|
||||
#define PACKAGE_STRING "ldns 1.6.17"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "libdns"
|
||||
@ -286,7 +283,22 @@
|
||||
#define PACKAGE_URL ""
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "1.6.16"
|
||||
#define PACKAGE_VERSION "1.6.17"
|
||||
|
||||
/* 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. */
|
||||
#define SIZEOF_TIME_T 8
|
||||
@ -294,9 +306,15 @@
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Define this to enable messages to stderr. */
|
||||
/* #undef STDERR_MSGS */
|
||||
|
||||
/* System configuration dir */
|
||||
#define SYSCONFDIR sysconfdir
|
||||
|
||||
/* Define this to enable DANE support. */
|
||||
#define USE_DANE 1
|
||||
|
||||
/* Define this to enable ECDSA support. */
|
||||
#define USE_ECDSA 1
|
||||
|
||||
@ -383,8 +401,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. */
|
||||
@ -489,6 +506,32 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int ldns_b64_ntop(uint8_t const *src, size_t srclength,
|
||||
char *target, size_t targsize);
|
||||
/**
|
||||
* calculates the size needed to store the result of b64_ntop
|
||||
*/
|
||||
/*@unused@*/
|
||||
static inline size_t ldns_b64_ntop_calculate_size(size_t srcsize)
|
||||
{
|
||||
return ((((srcsize + 2) / 3) * 4) + 1);
|
||||
}
|
||||
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
|
||||
*/
|
||||
/*@unused@*/
|
||||
static inline size_t ldns_b64_pton_calculate_size(size_t srcsize)
|
||||
{
|
||||
return (((((srcsize + 3) / 4) * 3)) + 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 */
|
||||
#define sleep(x) Sleep((x)*1000)
|
||||
|
@ -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 */
|
||||
|
@ -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 */
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
#define LDNS_COMMENT_KEY_SIZE (1 << 3)
|
||||
/** Provide bubblebabble representation for DS RR's as comment */
|
||||
#define LDNS_COMMENT_BUBBLEBABBLE (1 << 4)
|
||||
/** Show when a NSEC3 RR has the optout flag set as comment */
|
||||
#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 (1 << 6) /* yes */
|
||||
/** Print mark up */
|
||||
#define LDNS_COMMENT_LAYOUT (1 << 7)
|
||||
/** Also comment KEY_ID with RRSIGS **/
|
||||
#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)
|
||||
/** Provide bubblebabble representation for DS RR's as comment */
|
||||
#define LDNS_COMMENT_BUBBLEBABBLE 0x0010
|
||||
/** Show when a NSEC3 RR has the optout flag set as comment */
|
||||
#define LDNS_COMMENT_FLAGS 0x0020
|
||||
/** Show the unhashed owner and next owner names for NSEC3 RR's as comment */
|
||||
#define LDNS_COMMENT_NSEC3_CHAIN 0x0040
|
||||
/** Print mark up */
|
||||
#define LDNS_COMMENT_LAYOUT 0x0080
|
||||
/** Also comment KEY_ID with RRSIGS **/
|
||||
#define LDNS_COMMENT_RRSIGS 0x0100
|
||||
#define LDNS_FMT_ZEROIZE_RRSIGS 0x0200
|
||||
#define LDNS_FMT_PAD_SOA_SERIAL 0x0400
|
||||
|
||||
/**
|
||||
* Output format specifier
|
||||
@ -86,6 +92,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.
|
||||
@ -107,6 +125,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
|
||||
@ -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 *.
|
||||
|
@ -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>
|
||||
|
@ -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);
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
|
||||
/**
|
||||
|
@ -410,6 +410,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
|
||||
@ -759,6 +770,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
|
||||
@ -769,6 +792,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
|
||||
*
|
||||
|
240
contrib/ldns/ldns/radix.h
Normal file
240
contrib/ldns/ldns/radix.h
Normal file
@ -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_ */
|
@ -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
|
||||
|
@ -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;
|
||||
|
||||
@ -151,6 +154,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
|
||||
@ -337,6 +347,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
|
||||
@ -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
|
||||
*/
|
||||
@ -688,6 +739,12 @@ void ldns_resolver_deep_free(ldns_resolver *res);
|
||||
*/
|
||||
ldns_rr* ldns_axfr_next(ldns_resolver *resolver);
|
||||
|
||||
/**
|
||||
* Abort a transfer that is in progress
|
||||
* \param[in] resolver the resolver that is used
|
||||
*/
|
||||
void ldns_axfr_abort(ldns_resolver *resolver);
|
||||
|
||||
/**
|
||||
* Returns true if the axfr transfer has completed (i.e. 2 SOA RRs and no errors were encountered
|
||||
* \param[in] resolver the resolver that is used
|
||||
|
@ -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 *
|
||||
|
@ -180,14 +180,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
|
||||
@ -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
|
||||
|
@ -27,8 +27,8 @@ extern "C" {
|
||||
#define dprintf(X,Y) fprintf(stderr, (X), (Y))
|
||||
/* #define dprintf(X, Y) */
|
||||
|
||||
#define LDNS_VERSION "1.6.16"
|
||||
#define LDNS_REVISION ((1<<16)|(6<<8)|(16))
|
||||
#define LDNS_VERSION "1.6.17"
|
||||
#define LDNS_REVISION ((1<<16)|(6<<8)|(17))
|
||||
|
||||
/**
|
||||
* splint static inline workaround
|
||||
@ -70,7 +70,7 @@ INLINE uint16_t
|
||||
ldns_read_uint16(const void *src)
|
||||
{
|
||||
#ifdef ALLOW_UNALIGNED_ACCESSES
|
||||
return ntohs(*(uint16_t *) src);
|
||||
return ntohs(*(const uint16_t *) src);
|
||||
#else
|
||||
const uint8_t *p = (const uint8_t *) src;
|
||||
return ((uint16_t) p[0] << 8) | (uint16_t) p[1];
|
||||
@ -81,7 +81,7 @@ INLINE uint32_t
|
||||
ldns_read_uint32(const void *src)
|
||||
{
|
||||
#ifdef ALLOW_UNALIGNED_ACCESSES
|
||||
return ntohl(*(uint32_t *) src);
|
||||
return ntohl(*(const uint32_t *) src);
|
||||
#else
|
||||
const uint8_t *p = (const uint8_t *) src;
|
||||
return ( ((uint32_t) p[0] << 24)
|
||||
@ -325,65 +325,66 @@ uint16_t ldns_get_random(void);
|
||||
*/
|
||||
char *ldns_bubblebabble(uint8_t *data, size_t len);
|
||||
|
||||
#ifndef HAVE_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;
|
||||
}
|
||||
#endif /* !HAVE_B32_NTOP */
|
||||
#ifndef HAVE_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);
|
||||
|
||||
INLINE size_t ldns_b32_ntop_calculate_size_no_padding(size_t src_data_length)
|
||||
{
|
||||
return ((src_data_length + 3) * 8 / 5) - 4;
|
||||
}
|
||||
|
||||
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 /* !HAVE_B32_PTON */
|
||||
#ifndef HAVE_B64_NTOP
|
||||
int ldns_b64_ntop(uint8_t const *src, size_t srclength,
|
||||
char *target, size_t targsize);
|
||||
/**
|
||||
* calculates the size needed to store the result of b64_ntop
|
||||
*/
|
||||
/*@unused@*/
|
||||
static inline size_t ldns_b64_ntop_calculate_size(size_t srcsize)
|
||||
{
|
||||
return ((((srcsize + 2) / 3) * 4) + 1);
|
||||
}
|
||||
#endif /* !HAVE_B64_NTOP */
|
||||
#ifndef HAVE_B64_PTON
|
||||
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
|
||||
*/
|
||||
/*@unused@*/
|
||||
static inline size_t ldns_b64_pton_calculate_size(size_t srcsize)
|
||||
{
|
||||
return (((((srcsize + 3) / 4) * 3)) + 1);
|
||||
}
|
||||
#endif /* !HAVE_B64_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
|
||||
}
|
||||
|
@ -70,9 +70,9 @@ INLINE uint16_t
|
||||
ldns_read_uint16(const void *src)
|
||||
{
|
||||
#ifdef ALLOW_UNALIGNED_ACCESSES
|
||||
return ntohs(*(uint16_t *) src);
|
||||
return ntohs(*(const uint16_t *) src);
|
||||
#else
|
||||
uint8_t *p = (uint8_t *) src;
|
||||
const uint8_t *p = (const uint8_t *) src;
|
||||
return ((uint16_t) p[0] << 8) | (uint16_t) p[1];
|
||||
#endif
|
||||
}
|
||||
@ -81,9 +81,9 @@ INLINE uint32_t
|
||||
ldns_read_uint32(const void *src)
|
||||
{
|
||||
#ifdef ALLOW_UNALIGNED_ACCESSES
|
||||
return ntohl(*(uint32_t *) src);
|
||||
return ntohl(*(const uint32_t *) src);
|
||||
#else
|
||||
uint8_t *p = (uint8_t *) src;
|
||||
const uint8_t *p = (const uint8_t *) src;
|
||||
return ( ((uint32_t) p[0] << 24)
|
||||
| ((uint32_t) p[1] << 16)
|
||||
| ((uint32_t) p[2] << 8)
|
||||
@ -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;
|
||||
}
|
||||
#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);
|
||||
|
||||
INLINE size_t ldns_b32_ntop_calculate_size_no_padding(size_t src_data_length)
|
||||
{
|
||||
return ((src_data_length + 3) * 8 / 5) - 4;
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
8001
contrib/ldns/m4/libtool.m4
vendored
Normal file
8001
contrib/ldns/m4/libtool.m4
vendored
Normal file
File diff suppressed because it is too large
Load Diff
384
contrib/ldns/m4/ltoptions.m4
vendored
Normal file
384
contrib/ldns/m4/ltoptions.m4
vendored
Normal file
@ -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])])
|
123
contrib/ldns/m4/ltsugar.m4
vendored
Normal file
123
contrib/ldns/m4/ltsugar.m4
vendored
Normal file
@ -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
|
||||
])
|
23
contrib/ldns/m4/ltversion.m4
vendored
Normal file
23
contrib/ldns/m4/ltversion.m4
vendored
Normal file
@ -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)
|
||||
])
|
98
contrib/ldns/m4/lt~obsolete.m4
vendored
Normal file
98
contrib/ldns/m4/lt~obsolete.m4
vendored
Normal file
@ -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])])
|
@ -56,175 +56,53 @@ ldns_send(ldns_pkt **result_packet, ldns_resolver *r, const ldns_pkt *query_pkt)
|
||||
return result;
|
||||
}
|
||||
|
||||
ldns_status
|
||||
ldns_send_buffer(ldns_pkt **result, ldns_resolver *r, ldns_buffer *qb, ldns_rdf *tsig_mac)
|
||||
/* code from rdata.c */
|
||||
static struct sockaddr_storage *
|
||||
ldns_rdf2native_sockaddr_storage_port(
|
||||
const ldns_rdf *rd, uint16_t port, size_t *size)
|
||||
{
|
||||
uint8_t i;
|
||||
|
||||
struct sockaddr_storage *ns;
|
||||
size_t ns_len;
|
||||
struct timeval tv_s;
|
||||
struct timeval tv_e;
|
||||
|
||||
ldns_rdf **ns_array;
|
||||
size_t *rtt;
|
||||
ldns_pkt *reply;
|
||||
bool all_servers_rtt_inf;
|
||||
uint8_t retries;
|
||||
|
||||
uint8_t *reply_bytes = NULL;
|
||||
size_t reply_size = 0;
|
||||
ldns_status status, send_status;
|
||||
|
||||
assert(r != NULL);
|
||||
|
||||
status = LDNS_STATUS_OK;
|
||||
rtt = ldns_resolver_rtt(r);
|
||||
ns_array = ldns_resolver_nameservers(r);
|
||||
reply = NULL;
|
||||
ns_len = 0;
|
||||
|
||||
all_servers_rtt_inf = true;
|
||||
|
||||
if (ldns_resolver_random(r)) {
|
||||
ldns_resolver_nameservers_randomize(r);
|
||||
}
|
||||
|
||||
/* loop through all defined nameservers */
|
||||
for (i = 0; i < ldns_resolver_nameserver_count(r); i++) {
|
||||
if (rtt[i] == LDNS_RESOLV_RTT_INF) {
|
||||
/* not reachable nameserver! */
|
||||
continue;
|
||||
}
|
||||
|
||||
/* maybe verbosity setting?
|
||||
printf("Sending to ");
|
||||
ldns_rdf_print(stdout, ns_array[i]);
|
||||
printf("\n");
|
||||
*/
|
||||
ns = ldns_rdf2native_sockaddr_storage(ns_array[i],
|
||||
ldns_resolver_port(r), &ns_len);
|
||||
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
|
||||
if ((ns->ss_family == AF_INET) &&
|
||||
(ldns_resolver_ip6(r) == LDNS_RESOLV_INET6)) {
|
||||
/* not reachable */
|
||||
LDNS_FREE(ns);
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((ns->ss_family == AF_INET6) &&
|
||||
(ldns_resolver_ip6(r) == LDNS_RESOLV_INET)) {
|
||||
/* not reachable */
|
||||
LDNS_FREE(ns);
|
||||
continue;
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
all_servers_rtt_inf = false;
|
||||
|
||||
gettimeofday(&tv_s, NULL);
|
||||
|
||||
send_status = LDNS_STATUS_ERR;
|
||||
|
||||
/* reply_bytes implicitly handles our error */
|
||||
if (1 == 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);
|
||||
if (send_status == LDNS_STATUS_OK) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
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);
|
||||
|
||||
if (send_status == LDNS_STATUS_OK) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (send_status != LDNS_STATUS_OK) {
|
||||
ldns_resolver_set_nameserver_rtt(r, i, LDNS_RESOLV_RTT_INF);
|
||||
status = send_status;
|
||||
}
|
||||
|
||||
/* obey the fail directive */
|
||||
if (!reply_bytes) {
|
||||
/* the current nameserver seems to have a problem, blacklist it */
|
||||
if (ldns_resolver_fail(r)) {
|
||||
LDNS_FREE(ns);
|
||||
return LDNS_STATUS_ERR;
|
||||
} else {
|
||||
LDNS_FREE(ns);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
status = ldns_wire2pkt(&reply, reply_bytes, reply_size);
|
||||
if (status != LDNS_STATUS_OK) {
|
||||
LDNS_FREE(reply_bytes);
|
||||
LDNS_FREE(ns);
|
||||
return status;
|
||||
}
|
||||
|
||||
LDNS_FREE(ns);
|
||||
gettimeofday(&tv_e, NULL);
|
||||
|
||||
if (reply) {
|
||||
ldns_pkt_set_querytime(reply, (uint32_t)
|
||||
((tv_e.tv_sec - tv_s.tv_sec) * 1000) +
|
||||
(tv_e.tv_usec - tv_s.tv_usec) / 1000);
|
||||
ldns_pkt_set_answerfrom(reply,
|
||||
ldns_rdf_clone(ns_array[i]));
|
||||
ldns_pkt_set_timestamp(reply, tv_s);
|
||||
ldns_pkt_set_size(reply, reply_size);
|
||||
break;
|
||||
} else {
|
||||
if (ldns_resolver_fail(r)) {
|
||||
/* if fail is set bail out, after the first
|
||||
* one */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* wait retrans seconds... */
|
||||
sleep((unsigned int) ldns_resolver_retrans(r));
|
||||
}
|
||||
|
||||
if (all_servers_rtt_inf) {
|
||||
LDNS_FREE(reply_bytes);
|
||||
return LDNS_STATUS_RES_NO_NS;
|
||||
}
|
||||
#ifdef HAVE_SSL
|
||||
if (tsig_mac && reply && reply_bytes) {
|
||||
if (!ldns_pkt_tsig_verify(reply,
|
||||
reply_bytes,
|
||||
reply_size,
|
||||
ldns_resolver_tsig_keyname(r),
|
||||
ldns_resolver_tsig_keydata(r), tsig_mac)) {
|
||||
status = LDNS_STATUS_CRYPTO_TSIG_BOGUS;
|
||||
}
|
||||
}
|
||||
#else
|
||||
(void)tsig_mac;
|
||||
#endif /* HAVE_SSL */
|
||||
|
||||
LDNS_FREE(reply_bytes);
|
||||
if (result) {
|
||||
*result = reply;
|
||||
}
|
||||
|
||||
return status;
|
||||
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 */
|
||||
@ -290,90 +168,10 @@ ldns_sock_wait(int sockfd, struct timeval timeout, int write)
|
||||
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,
|
||||
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;
|
||||
@ -384,6 +182,9 @@ ldns_tcp_connect(const struct sockaddr_storage *to, socklen_t tolen,
|
||||
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);
|
||||
@ -462,6 +263,387 @@ ldns_tcp_connect(const struct sockaddr_storage *to, socklen_t tolen,
|
||||
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;
|
||||
struct timeval tv_e;
|
||||
|
||||
ldns_rdf **ns_array;
|
||||
size_t *rtt;
|
||||
ldns_pkt *reply;
|
||||
bool all_servers_rtt_inf;
|
||||
uint8_t retries;
|
||||
|
||||
uint8_t *reply_bytes = NULL;
|
||||
size_t reply_size = 0;
|
||||
ldns_status status, send_status;
|
||||
|
||||
assert(r != NULL);
|
||||
|
||||
status = LDNS_STATUS_OK;
|
||||
rtt = ldns_resolver_rtt(r);
|
||||
ns_array = ldns_resolver_nameservers(r);
|
||||
reply = NULL;
|
||||
ns_len = 0;
|
||||
|
||||
all_servers_rtt_inf = true;
|
||||
|
||||
if (ldns_resolver_random(r)) {
|
||||
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) {
|
||||
/* not reachable nameserver! */
|
||||
continue;
|
||||
}
|
||||
|
||||
/* maybe verbosity setting?
|
||||
printf("Sending to ");
|
||||
ldns_rdf_print(stdout, ns_array[i]);
|
||||
printf("\n");
|
||||
*/
|
||||
ns = ldns_rdf2native_sockaddr_storage(ns_array[i],
|
||||
ldns_resolver_port(r), &ns_len);
|
||||
|
||||
|
||||
#ifndef S_SPLINT_S
|
||||
if ((ns->ss_family == AF_INET) &&
|
||||
(ldns_resolver_ip6(r) == LDNS_RESOLV_INET6)) {
|
||||
/* not reachable */
|
||||
LDNS_FREE(ns);
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((ns->ss_family == AF_INET6) &&
|
||||
(ldns_resolver_ip6(r) == LDNS_RESOLV_INET)) {
|
||||
/* not reachable */
|
||||
LDNS_FREE(ns);
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
|
||||
all_servers_rtt_inf = false;
|
||||
|
||||
gettimeofday(&tv_s, NULL);
|
||||
|
||||
send_status = LDNS_STATUS_ERR;
|
||||
|
||||
/* reply_bytes implicitly handles our error */
|
||||
if (ldns_resolver_usevc(r)) {
|
||||
for (retries = ldns_resolver_retry(r); retries > 0; retries--) {
|
||||
send_status =
|
||||
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;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (retries = ldns_resolver_retry(r); retries > 0; retries--) {
|
||||
/* ldns_rdf_print(stdout, ns_array[i]); */
|
||||
send_status =
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (send_status != LDNS_STATUS_OK) {
|
||||
ldns_resolver_set_nameserver_rtt(r, i, LDNS_RESOLV_RTT_INF);
|
||||
status = send_status;
|
||||
}
|
||||
|
||||
/* obey the fail directive */
|
||||
if (!reply_bytes) {
|
||||
/* the current nameserver seems to have a problem, blacklist it */
|
||||
if (ldns_resolver_fail(r)) {
|
||||
LDNS_FREE(ns);
|
||||
return LDNS_STATUS_ERR;
|
||||
} else {
|
||||
LDNS_FREE(ns);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
status = ldns_wire2pkt(&reply, reply_bytes, reply_size);
|
||||
if (status != LDNS_STATUS_OK) {
|
||||
LDNS_FREE(reply_bytes);
|
||||
LDNS_FREE(ns);
|
||||
return status;
|
||||
}
|
||||
|
||||
LDNS_FREE(ns);
|
||||
gettimeofday(&tv_e, NULL);
|
||||
|
||||
if (reply) {
|
||||
ldns_pkt_set_querytime(reply, (uint32_t)
|
||||
((tv_e.tv_sec - tv_s.tv_sec) * 1000) +
|
||||
(tv_e.tv_usec - tv_s.tv_usec) / 1000);
|
||||
ldns_pkt_set_answerfrom(reply,
|
||||
ldns_rdf_clone(ns_array[i]));
|
||||
ldns_pkt_set_timestamp(reply, tv_s);
|
||||
ldns_pkt_set_size(reply, reply_size);
|
||||
break;
|
||||
} else {
|
||||
if (ldns_resolver_fail(r)) {
|
||||
/* if fail is set bail out, after the first
|
||||
* one */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* wait retrans seconds... */
|
||||
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;
|
||||
}
|
||||
#ifdef HAVE_SSL
|
||||
if (tsig_mac && reply && reply_bytes) {
|
||||
if (!ldns_pkt_tsig_verify(reply,
|
||||
reply_bytes,
|
||||
reply_size,
|
||||
ldns_resolver_tsig_keyname(r),
|
||||
ldns_resolver_tsig_keydata(r), tsig_mac)) {
|
||||
status = LDNS_STATUS_CRYPTO_TSIG_BOGUS;
|
||||
}
|
||||
}
|
||||
#else
|
||||
(void)tsig_mac;
|
||||
#endif /* HAVE_SSL */
|
||||
|
||||
LDNS_FREE(reply_bytes);
|
||||
if (result) {
|
||||
*result = reply;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
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);
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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;
|
||||
}
|
||||
|
1590
contrib/ldns/radix.c
Normal file
1590
contrib/ldns/radix.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -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 ??? */
|
||||
@ -503,6 +518,64 @@ ldns_rdf_address_reverse(ldns_rdf *rd)
|
||||
return rev;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
|
@ -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_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_status status;
|
||||
|
||||
if (!ldns_resolver_defnames(r) || !ldns_resolver_domain(r)) {
|
||||
return ldns_resolver_send(pkt, r, name, t, c, flags);
|
||||
}
|
||||
|
||||
newname = ldns_dname_cat_clone(name, ldns_resolver_domain(r));
|
||||
if (!newname) {
|
||||
return LDNS_STATUS_MEM_ERR;
|
||||
}
|
||||
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_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;
|
||||
}
|
||||
ldns_pkt* pkt = NULL;
|
||||
if (ldns_resolver_query_status(&pkt, (ldns_resolver *)r,
|
||||
name, t, c, flags) != LDNS_STATUS_OK) {
|
||||
ldns_pkt_free(pkt);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
newname = ldns_dname_cat_clone((const ldns_rdf*)name, ldns_resolver_domain(r));
|
||||
if (!newname) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
(void)ldns_resolver_send(&pkt, (ldns_resolver *)r, newname, t, c,
|
||||
flags);
|
||||
|
||||
ldns_rdf_free(newname);
|
||||
|
||||
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)
|
||||
{
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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. */
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
goto error;
|
||||
}
|
||||
*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;
|
||||
}
|
||||
*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;
|
||||
}
|
||||
data[0] = i - 1;
|
||||
*rd = ldns_rdf_new_frm_data(LDNS_RDF_TYPE_STR, i, data);
|
||||
if (! str) {
|
||||
return LDNS_STATUS_SYNTAX_BAD_ESCAPE;
|
||||
}
|
||||
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
|
||||
@ -790,15 +812,6 @@ ldns_str2rdf_unknown( ATTR_UNUSED(ldns_rdf **rd)
|
||||
return LDNS_STATUS_NOT_IMPL;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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 */
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -18,13 +18,13 @@ 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.
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER 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.
|
||||
|
@ -16,7 +16,6 @@ datadir=@datadir@
|
||||
includedir=@includedir@
|
||||
doxygen=@doxygen@
|
||||
libtool=@libtool@
|
||||
ldnsdir=@ldnsdir@
|
||||
staticexe=@staticexe@
|
||||
EXEEXT=@EXEEXT@
|
||||
configfile=@ub_conf_file@
|
||||
@ -30,7 +29,13 @@ PYTHONMOD_INSTALL=@PYTHONMOD_INSTALL@
|
||||
PYTHONMOD_UNINSTALL=@PYTHONMOD_UNINSTALL@
|
||||
PYUNBOUND_INSTALL=@PYUNBOUND_INSTALL@
|
||||
PYUNBOUND_UNINSTALL=@PYUNBOUND_UNINSTALL@
|
||||
UNBOUND_EVENT_INSTALL=@UNBOUND_EVENT_INSTALL@
|
||||
UNBOUND_EVENT_UNINSTALL=@UNBOUND_EVENT_UNINSTALL@
|
||||
UNBOUND_VERSION_MAJOR=@UNBOUND_VERSION_MAJOR@
|
||||
UNBOUND_VERSION_MINOR=@UNBOUND_VERSION_MINOR@
|
||||
UNBOUND_VERSION_MICRO=@UNBOUND_VERSION_MICRO@
|
||||
ALLTARGET=@ALLTARGET@
|
||||
INSTALLTARGET=@INSTALLTARGET@
|
||||
|
||||
# _unbound.la if pyunbound enabled.
|
||||
PYUNBOUND_TARGET=@PYUNBOUND_TARGET@
|
||||
@ -61,7 +66,7 @@ EXTRALINK=@EXTRALINK@
|
||||
|
||||
WINDRES=@WINDRES@
|
||||
LINT=splint
|
||||
LINTFLAGS=+quiet -weak -warnposix -unrecog -Din_addr_t=uint32_t -Du_int=unsigned -Du_char=uint8_t -preproc -Drlimit=rlimit64 -D__gnuc_va_list=va_list
|
||||
LINTFLAGS=+quiet -weak -warnposix -unrecog -Din_addr_t=uint32_t -Du_int=unsigned -Du_char=uint8_t -preproc -Drlimit=rlimit64 -D__gnuc_va_list=va_list -formatcode
|
||||
#-Dglob64=glob -Dglobfree64=globfree
|
||||
# compat with openssl linux edition.
|
||||
LINTFLAGS+="-DBN_ULONG=unsigned long" -Dkrb5_int32=int "-Dkrb5_ui_4=unsigned int" -DPQ_64BIT=uint64_t -DRC4_INT=unsigned -fixedformalarray -D"ENGINE=unsigned" -D"RSA=unsigned" -D"DSA=unsigned" -D"EVP_PKEY=unsigned" -D"EVP_MD=unsigned" -D"SSL=unsigned" -D"SSL_CTX=unsigned" -D"X509=unsigned" -D"RC4_KEY=unsigned" -D"EVP_MD_CTX=unsigned" -D"ECDSA_SIG=DSA_SIG"
|
||||
@ -69,8 +74,8 @@ LINTFLAGS+="-DBN_ULONG=unsigned long" -Dkrb5_int32=int "-Dkrb5_ui_4=unsigned int
|
||||
LINTFLAGS+=@NETBSD_LINTFLAGS@
|
||||
# compat with OpenBSD
|
||||
LINTFLAGS+="-Dsigset_t=long"
|
||||
# FreeBSD8
|
||||
LINTFLAGS+="-D__uint16_t=uint16_t"
|
||||
# FreeBSD
|
||||
LINTFLAGS+="-D__uint16_t=uint16_t" "-DEVP_PKEY_ASN1_METHOD=int"
|
||||
|
||||
INSTALL=$(srcdir)/install-sh
|
||||
|
||||
@ -118,80 +123,83 @@ outside_network.lo
|
||||
COMMON_OBJ_ALL_SYMBOLS=@COMMON_OBJ_ALL_SYMBOLS@
|
||||
COMPAT_SRC=compat/ctime_r.c compat/fake-rfc2553.c compat/gmtime_r.c \
|
||||
compat/inet_aton.c compat/inet_ntop.c compat/inet_pton.c compat/malloc.c \
|
||||
compat/memcmp.c compat/memmove.c compat/snprintf.c compat/strlcpy.c \
|
||||
compat/strptime.c
|
||||
compat/memcmp.c compat/memmove.c compat/snprintf.c compat/strlcat.c \
|
||||
compat/strlcpy.c compat/strptime.c
|
||||
COMPAT_OBJ=$(LIBOBJS:.o=.lo)
|
||||
COMPAT_OBJ_WITHOUT_CTIME=$(LIBOBJ_WITHOUT_CTIME:.o=.lo)
|
||||
SLDNS_SRC=ldns/keyraw.c ldns/sbuffer.c ldns/wire2str.c ldns/parse.c \
|
||||
ldns/parseutil.c ldns/rrdef.c ldns/str2wire.c
|
||||
SLDNS_OBJ=keyraw.lo sbuffer.lo wire2str.lo parse.lo parseutil.lo rrdef.lo \
|
||||
str2wire.lo
|
||||
UNITTEST_SRC=testcode/unitanchor.c testcode/unitdname.c \
|
||||
testcode/unitlruhash.c testcode/unitmain.c testcode/unitmsgparse.c \
|
||||
testcode/unitneg.c testcode/unitregional.c testcode/unitslabhash.c \
|
||||
testcode/unitverify.c testcode/readhex.c testcode/ldns-testpkts.c
|
||||
testcode/unitverify.c testcode/readhex.c testcode/testpkts.c testcode/unitldns.c
|
||||
UNITTEST_OBJ=unitanchor.lo unitdname.lo unitlruhash.lo unitmain.lo \
|
||||
unitmsgparse.lo unitneg.lo unitregional.lo unitslabhash.lo unitverify.lo \
|
||||
readhex.lo ldns-testpkts.lo
|
||||
UNITTEST_OBJ_LINK=$(UNITTEST_OBJ) worker_cb.lo $(COMMON_OBJ) $(COMPAT_OBJ)
|
||||
readhex.lo testpkts.lo unitldns.lo
|
||||
UNITTEST_OBJ_LINK=$(UNITTEST_OBJ) worker_cb.lo $(COMMON_OBJ) $(SLDNS_OBJ) \
|
||||
$(COMPAT_OBJ)
|
||||
DAEMON_SRC=daemon/acl_list.c daemon/cachedump.c daemon/daemon.c \
|
||||
daemon/remote.c daemon/stats.c daemon/unbound.c daemon/worker.c @WIN_DAEMON_SRC@
|
||||
DAEMON_OBJ=acl_list.lo cachedump.lo daemon.lo remote.lo stats.lo unbound.lo \
|
||||
worker.lo @WIN_DAEMON_OBJ@
|
||||
DAEMON_OBJ_LINK=$(DAEMON_OBJ) $(COMMON_OBJ_ALL_SYMBOLS) \
|
||||
DAEMON_OBJ_LINK=$(DAEMON_OBJ) $(COMMON_OBJ_ALL_SYMBOLS) $(SLDNS_OBJ) \
|
||||
$(COMPAT_OBJ) @WIN_DAEMON_OBJ_LINK@
|
||||
CHECKCONF_SRC=smallapp/unbound-checkconf.c smallapp/worker_cb.c
|
||||
CHECKCONF_OBJ=unbound-checkconf.lo worker_cb.lo
|
||||
CHECKCONF_OBJ_LINK=$(CHECKCONF_OBJ) $(COMMON_OBJ_ALL_SYMBOLS) \
|
||||
CHECKCONF_OBJ_LINK=$(CHECKCONF_OBJ) $(COMMON_OBJ_ALL_SYMBOLS) $(SLDNS_OBJ) \
|
||||
$(COMPAT_OBJ) @WIN_CHECKCONF_OBJ_LINK@
|
||||
CONTROL_SRC=smallapp/unbound-control.c
|
||||
CONTROL_OBJ=unbound-control.lo
|
||||
CONTROL_OBJ_LINK=$(CONTROL_OBJ) worker_cb.lo $(COMMON_OBJ_ALL_SYMBOLS) \
|
||||
$(COMPAT_OBJ) @WIN_CONTROL_OBJ_LINK@
|
||||
$(SLDNS_OBJ) $(COMPAT_OBJ) @WIN_CONTROL_OBJ_LINK@
|
||||
HOST_SRC=smallapp/unbound-host.c
|
||||
HOST_OBJ=unbound-host.lo
|
||||
HOST_OBJ_LINK=$(HOST_OBJ) $(COMPAT_OBJ_WITHOUT_CTIME) @WIN_HOST_OBJ_LINK@
|
||||
HOST_OBJ_LINK=$(HOST_OBJ) $(SLDNS_OBJ) $(COMPAT_OBJ_WITHOUT_CTIME) @WIN_HOST_OBJ_LINK@
|
||||
UBANCHOR_SRC=smallapp/unbound-anchor.c
|
||||
UBANCHOR_OBJ=unbound-anchor.lo
|
||||
UBANCHOR_OBJ_LINK=$(UBANCHOR_OBJ) \
|
||||
$(COMPAT_OBJ_WITHOUT_CTIME) @WIN_UBANCHOR_OBJ_LINK@
|
||||
TESTBOUND_SRC=testcode/testbound.c testcode/ldns-testpkts.c \
|
||||
TESTBOUND_SRC=testcode/testbound.c testcode/testpkts.c \
|
||||
daemon/worker.c daemon/acl_list.c daemon/daemon.c daemon/stats.c \
|
||||
testcode/replay.c testcode/fake_event.c
|
||||
TESTBOUND_OBJ=testbound.lo replay.lo fake_event.lo
|
||||
TESTBOUND_OBJ_LINK=$(TESTBOUND_OBJ) ldns-testpkts.lo worker.lo acl_list.lo \
|
||||
daemon.lo stats.lo $(COMMON_OBJ_WITHOUT_NETCALL) $(COMPAT_OBJ)
|
||||
TESTBOUND_OBJ_LINK=$(TESTBOUND_OBJ) testpkts.lo worker.lo acl_list.lo \
|
||||
daemon.lo stats.lo $(COMMON_OBJ_WITHOUT_NETCALL) $(SLDNS_OBJ) $(COMPAT_OBJ)
|
||||
LOCKVERIFY_SRC=testcode/lock_verify.c
|
||||
LOCKVERIFY_OBJ=lock_verify.lo
|
||||
LOCKVERIFY_OBJ_LINK=$(LOCKVERIFY_OBJ) worker_cb.lo $(COMMON_OBJ) $(COMPAT_OBJ)
|
||||
LOCKVERIFY_OBJ_LINK=$(LOCKVERIFY_OBJ) worker_cb.lo $(COMMON_OBJ) $(COMPAT_OBJ) \
|
||||
$(SLDNS_OBJ)
|
||||
PETAL_SRC=testcode/petal.c
|
||||
PETAL_OBJ=petal.lo
|
||||
PETAL_OBJ_LINK=$(PETAL_OBJ) $(COMPAT_OBJ_WITHOUT_CTIME)
|
||||
PKTVIEW_SRC=testcode/pktview.c testcode/readhex.c
|
||||
PKTVIEW_OBJ=pktview.lo
|
||||
PKTVIEW_OBJ_LINK=$(PKTVIEW_OBJ) worker_cb.lo readhex.lo $(COMMON_OBJ) \
|
||||
$(COMPAT_OBJ)
|
||||
SIGNIT_SRC=testcode/signit.c
|
||||
SIGNIT_OBJ=signit.lo
|
||||
SIGNIT_OBJ_LINK=$(SIGNIT_OBJ) worker_cb.lo $(COMMON_OBJ) $(COMPAT_OBJ)
|
||||
$(COMPAT_OBJ) $(SLDNS_OBJ)
|
||||
MEMSTATS_SRC=testcode/memstats.c
|
||||
MEMSTATS_OBJ=memstats.lo
|
||||
MEMSTATS_OBJ_LINK=$(MEMSTATS_OBJ) worker_cb.lo $(COMMON_OBJ) $(COMPAT_OBJ)
|
||||
MEMSTATS_OBJ_LINK=$(MEMSTATS_OBJ) worker_cb.lo $(COMMON_OBJ) $(COMPAT_OBJ) \
|
||||
$(SLDNS_OBJ)
|
||||
ASYNCLOOK_SRC=testcode/asynclook.c
|
||||
ASYNCLOOK_OBJ=asynclook.lo
|
||||
ASYNCLOOK_OBJ_LINK=$(ASYNCLOOK_OBJ) log.lo locks.lo $(COMPAT_OBJ)
|
||||
STREAMTCP_SRC=testcode/streamtcp.c
|
||||
STREAMTCP_OBJ=streamtcp.lo
|
||||
STREAMTCP_OBJ_LINK=$(STREAMTCP_OBJ) worker_cb.lo $(COMMON_OBJ) $(COMPAT_OBJ)
|
||||
STREAMTCP_OBJ_LINK=$(STREAMTCP_OBJ) worker_cb.lo $(COMMON_OBJ) $(COMPAT_OBJ) \
|
||||
$(SLDNS_OBJ)
|
||||
PERF_SRC=testcode/perf.c
|
||||
PERF_OBJ=perf.lo
|
||||
PERF_OBJ_LINK=$(PERF_OBJ) worker_cb.lo $(COMMON_OBJ) $(COMPAT_OBJ)
|
||||
PERF_OBJ_LINK=$(PERF_OBJ) worker_cb.lo $(COMMON_OBJ) $(COMPAT_OBJ) $(SLDNS_OBJ)
|
||||
DELAYER_SRC=testcode/delayer.c
|
||||
DELAYER_OBJ=delayer.lo
|
||||
DELAYER_OBJ_LINK=$(DELAYER_OBJ) worker_cb.lo $(COMMON_OBJ) $(COMPAT_OBJ)
|
||||
HARVEST_SRC=testcode/harvest.c
|
||||
HARVEST_OBJ=harvest.lo
|
||||
HARVEST_OBJ_LINK=$(HARVEST_OBJ) $(COMPAT_OBJ_WITHOUT_CTIME)
|
||||
DELAYER_OBJ_LINK=$(DELAYER_OBJ) worker_cb.lo $(COMMON_OBJ) $(COMPAT_OBJ) \
|
||||
$(SLDNS_OBJ)
|
||||
LIBUNBOUND_SRC=libunbound/context.c libunbound/libunbound.c \
|
||||
libunbound/libworker.c
|
||||
LIBUNBOUND_OBJ=context.lo libunbound.lo libworker.lo
|
||||
LIBUNBOUND_OBJ_LINK=$(LIBUNBOUND_OBJ) $(COMMON_OBJ) $(COMPAT_OBJ)
|
||||
LIBUNBOUND_OBJ_LINK=$(LIBUNBOUND_OBJ) $(COMMON_OBJ) $(SLDNS_OBJ) $(COMPAT_OBJ)
|
||||
|
||||
# win apps or "" if not on windows
|
||||
WINAPPS=@WINAPPS@
|
||||
@ -211,19 +219,19 @@ RSRC_OBJ=rsrc_svcinst.o rsrc_svcuninst.o rsrc_anchorupd.o rsrc_unbound.o \
|
||||
rsrc_unbound_checkconf.o
|
||||
|
||||
ALL_SRC=$(COMMON_SRC) $(UNITTEST_SRC) $(DAEMON_SRC) \
|
||||
$(TESTBOUND_SRC) $(LOCKVERIFY_SRC) $(PKTVIEW_SRC) $(SIGNIT_SRC) \
|
||||
$(TESTBOUND_SRC) $(LOCKVERIFY_SRC) $(PKTVIEW_SRC) \
|
||||
$(MEMSTATS_SRC) $(CHECKCONF_SRC) $(LIBUNBOUND_SRC) $(HOST_SRC) \
|
||||
$(ASYNCLOOK_SRC) $(STREAMTCP_SRC) $(PERF_SRC) $(DELAYER_SRC) \
|
||||
$(HARVEST_SRC) $(CONTROL_SRC) $(UBANCHOR_SRC) $(PETAL_SRC) \
|
||||
$(CONTROL_SRC) $(UBANCHOR_SRC) $(PETAL_SRC) \
|
||||
$(PYTHONMOD_SRC) $(PYUNBOUND_SRC) $(WIN_DAEMON_THE_SRC)\
|
||||
$(SVCINST_SRC) $(SVCUNINST_SRC) $(ANCHORUPD_SRC)
|
||||
$(SVCINST_SRC) $(SVCUNINST_SRC) $(ANCHORUPD_SRC) $(SLDNS_SRC)
|
||||
ALL_OBJ=$(COMMON_OBJ) $(UNITTEST_OBJ) $(DAEMON_OBJ) \
|
||||
$(TESTBOUND_OBJ) $(LOCKVERIFY_OBJ) $(PKTVIEW_OBJ) $(SIGNIT_OBJ) \
|
||||
$(TESTBOUND_OBJ) $(LOCKVERIFY_OBJ) $(PKTVIEW_OBJ) \
|
||||
$(MEMSTATS_OBJ) $(CHECKCONF_OBJ) $(LIBUNBOUND_OBJ) $(HOST_OBJ) \
|
||||
$(ASYNCLOOK_OBJ) $(STREAMTCP_OBJ) $(PERF_OBJ) $(DELAYER_OBJ) \
|
||||
$(HARVEST_OBJ) $(CONTROL_OBJ) $(UBANCHOR_OBJ) $(PETAL_OBJ) \
|
||||
$(CONTROL_OBJ) $(UBANCHOR_OBJ) $(PETAL_OBJ) \
|
||||
$(COMPAT_OBJ) $(PYUNBOUND_OBJ) \
|
||||
$(SVCINST_OBJ) $(SVCUNINST_OBJ) $(ANCHORUPD_OBJ)
|
||||
$(SVCINST_OBJ) $(SVCUNINST_OBJ) $(ANCHORUPD_OBJ) $(SLDNS_OBJ)
|
||||
|
||||
COMPILE=$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS)
|
||||
LINK=$(LIBTOOL) --tag=CC --mode=link $(CC) $(staticexe) $(RUNTIME_PATH) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
|
||||
@ -257,9 +265,9 @@ rsrc_unbound_anchor.o: $(srcdir)/winrc/rsrc_unbound_anchor.rc config.h
|
||||
rsrc_unbound_control.o: $(srcdir)/winrc/rsrc_unbound_control.rc config.h
|
||||
rsrc_unbound_checkconf.o: $(srcdir)/winrc/rsrc_unbound_checkconf.rc config.h
|
||||
|
||||
TEST_BIN=asynclook$(EXEEXT) delayer$(EXEEXT) harvest$(EXEEXT) \
|
||||
TEST_BIN=asynclook$(EXEEXT) delayer$(EXEEXT) \
|
||||
lock-verify$(EXEEXT) memstats$(EXEEXT) perf$(EXEEXT) \
|
||||
petal$(EXEEXT) pktview$(EXEEXT) signit$(EXEEXT) streamtcp$(EXEEXT) \
|
||||
petal$(EXEEXT) pktview$(EXEEXT) streamtcp$(EXEEXT) \
|
||||
testbound$(EXEEXT) unittest$(EXEEXT)
|
||||
tests: all $(TEST_BIN)
|
||||
|
||||
@ -275,7 +283,7 @@ test: unittest$(EXEEXT) testbound$(EXEEXT)
|
||||
longtest: tests
|
||||
if test -x "`which bash`"; then bash testcode/do-tests.sh; else sh testcode/do-tests.sh; fi
|
||||
|
||||
lib: libunbound.la
|
||||
lib: libunbound.la unbound.h
|
||||
|
||||
libunbound.la: $(LIBUNBOUND_OBJ_LINK)
|
||||
$(LINK_LIB) $(UBSYMS) -o $@ $(LIBUNBOUND_OBJ_LINK) -rpath $(libdir) -lssl $(LIBS)
|
||||
@ -319,9 +327,6 @@ petal$(EXEEXT): $(PETAL_OBJ_LINK)
|
||||
pktview$(EXEEXT): $(PKTVIEW_OBJ_LINK)
|
||||
$(LINK) -o $@ $(PKTVIEW_OBJ_LINK) -lssl $(LIBS)
|
||||
|
||||
signit$(EXEEXT): $(SIGNIT_OBJ_LINK)
|
||||
$(LINK) -o $@ $(SIGNIT_OBJ_LINK) -lssl $(LIBS)
|
||||
|
||||
memstats$(EXEEXT): $(MEMSTATS_OBJ_LINK)
|
||||
$(LINK) -o $@ $(MEMSTATS_OBJ_LINK) -lssl $(LIBS)
|
||||
|
||||
@ -337,18 +342,16 @@ perf$(EXEEXT): $(PERF_OBJ_LINK)
|
||||
delayer$(EXEEXT): $(DELAYER_OBJ_LINK)
|
||||
$(LINK) -o $@ $(DELAYER_OBJ_LINK) -lssl $(LIBS)
|
||||
|
||||
harvest$(EXEEXT): $(HARVEST_OBJ_LINK) libunbound.la
|
||||
$(LINK) -o $@ $(HARVEST_OBJ_LINK) $(LIBS) -L. -L.libs -lunbound
|
||||
signit$(EXEEXT): testcode/signit.c
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ testcode/signit.c $(LDFLAGS) -lldns -lssl $(LIBS)
|
||||
|
||||
unbound.h: $(srcdir)/libunbound/unbound.h
|
||||
sed -e 's/@''UNBOUND_VERSION_MAJOR@/$(UNBOUND_VERSION_MAJOR)/' -e 's/@''UNBOUND_VERSION_MINOR@/$(UNBOUND_VERSION_MINOR)/' -e 's/@''UNBOUND_VERSION_MICRO@/$(UNBOUND_VERSION_MICRO)/' < $(srcdir)/libunbound/unbound.h > $@
|
||||
|
||||
unbound-control-setup: $(srcdir)/smallapp/unbound-control-setup.sh
|
||||
sed -e 's:^DESTDIR=.*$$:DESTDIR=$(UNBOUND_RUN_DIR):' < $(srcdir)/smallapp/unbound-control-setup.sh > $@
|
||||
-chmod +x $@
|
||||
|
||||
#testcode/ldns-testpkts.c: $(ldnsdir)/examples/ldns-testpkts.c \
|
||||
# $(ldnsdir)/examples/ldns-testpkts.h
|
||||
# cp $(ldnsdir)/examples/ldns-testpkts.c testcode/ldns-testpkts.c
|
||||
# cp $(ldnsdir)/examples/ldns-testpkts.h testcode/ldns-testpkts.h
|
||||
|
||||
# Python Module
|
||||
pythonmod.lo pythonmod.o: $(srcdir)/pythonmod/pythonmod.c config.h \
|
||||
pythonmod/interface.h \
|
||||
@ -367,8 +370,8 @@ pythonmod/interface.h: $(srcdir)/pythonmod/interface.i config.h
|
||||
$(SWIG) $(CPPFLAGS) -o $@ -python $(srcdir)/pythonmod/interface.i
|
||||
|
||||
libunbound_wrap.lo libunbound_wrap.o: libunbound/python/libunbound_wrap.c \
|
||||
$(srcdir)/libunbound/unbound.h
|
||||
libunbound/python/libunbound_wrap.c: $(srcdir)/libunbound/python/libunbound.i $(srcdir)/libunbound/unbound.h
|
||||
unbound.h
|
||||
libunbound/python/libunbound_wrap.c: $(srcdir)/libunbound/python/libunbound.i unbound.h
|
||||
@-if test ! -d libunbound/python; then $(INSTALL) -d libunbound/python; fi
|
||||
$(SWIG) -python -o $@ $(CPPFLAGS) $(srcdir)/libunbound/python/libunbound.i
|
||||
|
||||
@ -391,7 +394,7 @@ util/configparser.c util/configparser.h: $(srcdir)/util/configparser.y
|
||||
|
||||
clean:
|
||||
rm -f *.o *.d *.lo *~ tags
|
||||
rm -f unbound$(EXEEXT) unbound-checkconf$(EXEEXT) unbound-host$(EXEEXT) unbound-control$(EXEEXT) unbound-anchor$(EXEEXT) unbound-control-setup libunbound.la
|
||||
rm -f unbound$(EXEEXT) unbound-checkconf$(EXEEXT) unbound-host$(EXEEXT) unbound-control$(EXEEXT) unbound-anchor$(EXEEXT) unbound-control-setup libunbound.la unbound.h
|
||||
rm -f $(ALL_SRC:.c=.lint)
|
||||
rm -f _unbound.la libunbound/python/libunbound_wrap.c libunbound/python/unbound.py pythonmod/interface.h pythonmod/unboundmodule.py
|
||||
rm -rf autom4te.cache .libs build doc/html doc/xml
|
||||
@ -406,7 +409,7 @@ realclean: clean
|
||||
|
||||
.SUFFIXES: .lint
|
||||
.c.lint:
|
||||
$(LINT) $(LINTFLAGS) -I. -I$(srcdir) -I$(ldnsdir)/include $<
|
||||
$(LINT) $(LINTFLAGS) -I. -I$(srcdir) $<
|
||||
touch $@
|
||||
|
||||
util/configparser.lint util/configlexer.lint pythonmod/pythonmod.lint libunbound/python/libunbound_wrap.lint:
|
||||
@ -449,26 +452,17 @@ pyunbound-install:
|
||||
$(LIBTOOL) --mode=install cp _unbound.la $(DESTDIR)$(PYTHON_SITE_PKG)
|
||||
$(LIBTOOL) --mode=finish $(DESTDIR)$(PYTHON_SITE_PKG)
|
||||
|
||||
install: all $(PYTHONMOD_INSTALL) $(PYUNBOUND_INSTALL)
|
||||
$(INSTALL) -m 755 -d $(DESTDIR)$(sbindir)
|
||||
$(INSTALL) -m 755 -d $(DESTDIR)$(mandir)
|
||||
$(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man8
|
||||
$(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man5
|
||||
$(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man3
|
||||
$(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1
|
||||
unbound-event-install:
|
||||
$(INSTALL) -m 755 -d $(DESTDIR)$(includedir)
|
||||
$(LIBTOOL) --mode=install cp $(srcdir)/libunbound/unbound-event.h $(DESTDIR)$(includedir)/unbound-event.h
|
||||
|
||||
install: $(INSTALLTARGET)
|
||||
|
||||
install-lib: lib $(UNBOUND_EVENT_INSTALL)
|
||||
$(INSTALL) -m 755 -d $(DESTDIR)$(libdir)
|
||||
$(INSTALL) -m 755 -d $(DESTDIR)$(includedir)
|
||||
$(LIBTOOL) --mode=install cp unbound$(EXEEXT) $(DESTDIR)$(sbindir)/unbound$(EXEEXT)
|
||||
$(LIBTOOL) --mode=install cp unbound-checkconf$(EXEEXT) $(DESTDIR)$(sbindir)/unbound-checkconf$(EXEEXT)
|
||||
$(LIBTOOL) --mode=install cp unbound-control$(EXEEXT) $(DESTDIR)$(sbindir)/unbound-control$(EXEEXT)
|
||||
$(LIBTOOL) --mode=install cp unbound-host$(EXEEXT) $(DESTDIR)$(sbindir)/unbound-host$(EXEEXT)
|
||||
$(LIBTOOL) --mode=install cp unbound-anchor$(EXEEXT) $(DESTDIR)$(sbindir)/unbound-anchor$(EXEEXT)
|
||||
$(INSTALL) -c -m 644 doc/unbound.8 $(DESTDIR)$(mandir)/man8
|
||||
$(INSTALL) -c -m 644 doc/unbound-checkconf.8 $(DESTDIR)$(mandir)/man8
|
||||
$(INSTALL) -c -m 644 doc/unbound-control.8 $(DESTDIR)$(mandir)/man8
|
||||
$(INSTALL) -c -m 644 doc/unbound-anchor.8 $(DESTDIR)$(mandir)/man8
|
||||
$(INSTALL) -c -m 644 doc/unbound.conf.5 $(DESTDIR)$(mandir)/man5
|
||||
$(INSTALL) -c -m 644 $(srcdir)/doc/unbound-host.1 $(DESTDIR)$(mandir)/man1
|
||||
$(INSTALL) -m 755 -d $(DESTDIR)$(mandir)
|
||||
$(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man3
|
||||
$(INSTALL) -c -m 644 doc/libunbound.3 $(DESTDIR)$(mandir)/man3
|
||||
for mpage in ub_ctx ub_result ub_ctx_create ub_ctx_delete \
|
||||
ub_ctx_set_option ub_ctx_get_option ub_ctx_config ub_ctx_set_fwd \
|
||||
@ -480,12 +474,31 @@ install: all $(PYTHONMOD_INSTALL) $(PYUNBOUND_INSTALL)
|
||||
do \
|
||||
echo ".so man3/libunbound.3" > $(DESTDIR)$(mandir)/man3/$$mpage.3 ; \
|
||||
done
|
||||
$(INSTALL) -c -m 755 unbound-control-setup $(DESTDIR)$(sbindir)/unbound-control-setup
|
||||
if test ! -e $(DESTDIR)$(configfile); then $(INSTALL) -d `dirname $(DESTDIR)$(configfile)`; $(INSTALL) -c -m 644 doc/example.conf $(DESTDIR)$(configfile); fi
|
||||
$(LIBTOOL) --mode=install cp $(srcdir)/libunbound/unbound.h $(DESTDIR)$(includedir)/unbound.h
|
||||
$(LIBTOOL) --mode=install cp unbound.h $(DESTDIR)$(includedir)/unbound.h
|
||||
$(LIBTOOL) --mode=install cp libunbound.la $(DESTDIR)$(libdir)
|
||||
$(LIBTOOL) --mode=finish $(DESTDIR)$(libdir)
|
||||
|
||||
install-all: all $(PYTHONMOD_INSTALL) $(PYUNBOUND_INSTALL) $(UNBOUND_EVENT_INSTALL) install-lib
|
||||
$(INSTALL) -m 755 -d $(DESTDIR)$(sbindir)
|
||||
$(INSTALL) -m 755 -d $(DESTDIR)$(mandir)
|
||||
$(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man8
|
||||
$(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man5
|
||||
$(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1
|
||||
$(LIBTOOL) --mode=install cp unbound$(EXEEXT) $(DESTDIR)$(sbindir)/unbound$(EXEEXT)
|
||||
$(LIBTOOL) --mode=install cp unbound-checkconf$(EXEEXT) $(DESTDIR)$(sbindir)/unbound-checkconf$(EXEEXT)
|
||||
$(LIBTOOL) --mode=install cp unbound-control$(EXEEXT) $(DESTDIR)$(sbindir)/unbound-control$(EXEEXT)
|
||||
$(LIBTOOL) --mode=install cp unbound-host$(EXEEXT) $(DESTDIR)$(sbindir)/unbound-host$(EXEEXT)
|
||||
$(LIBTOOL) --mode=install cp unbound-anchor$(EXEEXT) $(DESTDIR)$(sbindir)/unbound-anchor$(EXEEXT)
|
||||
$(INSTALL) -c -m 644 doc/unbound.8 $(DESTDIR)$(mandir)/man8
|
||||
$(INSTALL) -c -m 644 doc/unbound-checkconf.8 $(DESTDIR)$(mandir)/man8
|
||||
$(INSTALL) -c -m 644 doc/unbound-control.8 $(DESTDIR)$(mandir)/man8
|
||||
$(INSTALL) -c -m 644 doc/unbound-control.8 $(DESTDIR)$(mandir)/man8/unbound-control-setup.8
|
||||
$(INSTALL) -c -m 644 doc/unbound-anchor.8 $(DESTDIR)$(mandir)/man8
|
||||
$(INSTALL) -c -m 644 doc/unbound.conf.5 $(DESTDIR)$(mandir)/man5
|
||||
$(INSTALL) -c -m 644 $(srcdir)/doc/unbound-host.1 $(DESTDIR)$(mandir)/man1
|
||||
$(INSTALL) -c -m 755 unbound-control-setup $(DESTDIR)$(sbindir)/unbound-control-setup
|
||||
if test ! -e $(DESTDIR)$(configfile); then $(INSTALL) -d `dirname $(DESTDIR)$(configfile)`; $(INSTALL) -c -m 644 doc/example.conf $(DESTDIR)$(configfile); fi
|
||||
|
||||
pythonmod-uninstall:
|
||||
rm -f -- $(DESTDIR)$(PYTHON_SITE_PKG)/unboundmodule.py
|
||||
|
||||
@ -493,9 +506,12 @@ pyunbound-uninstall:
|
||||
rm -f -- $(DESTDIR)$(PYTHON_SITE_PKG)/unbound.py
|
||||
$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(PYTHON_SITE_PKG)/_unbound.la
|
||||
|
||||
uninstall: $(PYTHONMOD_UNINSTALL) $(PYUNBOUND_UNINSTALL)
|
||||
unbound-event-uninstall:
|
||||
rm -f -- $(DESTDIR)$(includedir)/unbound-event.h
|
||||
|
||||
uninstall: $(PYTHONMOD_UNINSTALL) $(PYUNBOUND_UNINSTALL) $(UNBOUND_EVENT_UNINSTALL)
|
||||
rm -f -- $(DESTDIR)$(sbindir)/unbound$(EXEEXT) $(DESTDIR)$(sbindir)/unbound-checkconf$(EXEEXT) $(DESTDIR)$(sbindir)/unbound-host$(EXEEXT) $(DESTDIR)$(sbindir)/unbound-control$(EXEEXT) $(DESTDIR)$(sbindir)/unbound-anchor$(EXEEXT) $(DESTDIR)$(sbindir)/unbound-control-setup
|
||||
rm -f -- $(DESTDIR)$(mandir)/man8/unbound.8 $(DESTDIR)$(mandir)/man8/unbound-checkconf.8 $(DESTDIR)$(mandir)/man5/unbound.conf.5 $(DESTDIR)$(mandir)/man8/unbound-control.8 $(DESTDIR)$(mandir)/man8/unbound-anchor.8
|
||||
rm -f -- $(DESTDIR)$(mandir)/man8/unbound.8 $(DESTDIR)$(mandir)/man8/unbound-checkconf.8 $(DESTDIR)$(mandir)/man5/unbound.conf.5 $(DESTDIR)$(mandir)/man8/unbound-control.8 $(DESTDIR)$(mandir)/man8/unbound-anchor.8 $(DESTDIR)$(mandir)/man8/unbound-control-setup.8
|
||||
rm -f -- $(DESTDIR)$(mandir)/man1/unbound-host.1 $(DESTDIR)$(mandir)/man3/libunbound.3
|
||||
for mpage in ub_ctx ub_result ub_ctx_create ub_ctx_delete \
|
||||
ub_ctx_set_option ub_ctx_get_option ub_ctx_config ub_ctx_set_fwd \
|
||||
@ -556,655 +572,3 @@ depend:
|
||||
rm -f $(DEPEND_TMP) $(DEPEND_TMP2)
|
||||
|
||||
# Dependencies
|
||||
dns.lo dns.o: $(srcdir)/services/cache/dns.c config.h $(srcdir)/iterator/iter_delegpt.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/validator/val_nsec.h \
|
||||
$(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \
|
||||
$(srcdir)/services/cache/dns.h \
|
||||
$(srcdir)/util/data/msgreply.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \
|
||||
$(srcdir)/util/data/dname.h $(srcdir)/util/module.h $(srcdir)/util/data/msgparse.h \
|
||||
$(srcdir)/util/net_help.h \
|
||||
$(srcdir)/util/regional.h $(srcdir)/util/config_file.h
|
||||
infra.lo infra.o: $(srcdir)/services/cache/infra.c config.h \
|
||||
$(srcdir)/services/cache/infra.h \
|
||||
$(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/rtt.h \
|
||||
$(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lookup3.h $(srcdir)/util/data/dname.h \
|
||||
$(srcdir)/util/net_help.h $(srcdir)/util/config_file.h $(srcdir)/iterator/iterator.h \
|
||||
$(srcdir)/services/outbound_list.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \
|
||||
$(srcdir)/util/module.h $(srcdir)/util/data/msgparse.h \
|
||||
|
||||
rrset.lo rrset.o: $(srcdir)/services/cache/rrset.c config.h $(srcdir)/services/cache/rrset.h \
|
||||
$(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/util/storage/slabhash.h $(srcdir)/util/data/packed_rrset.h \
|
||||
$(srcdir)/util/config_file.h \
|
||||
$(srcdir)/util/data/msgreply.h $(srcdir)/util/regional.h $(srcdir)/util/alloc.h
|
||||
dname.lo dname.o: $(srcdir)/util/data/dname.c config.h $(srcdir)/util/data/dname.h \
|
||||
$(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/util/data/msgparse.h \
|
||||
$(srcdir)/util/storage/lookup3.h
|
||||
msgencode.lo msgencode.o: $(srcdir)/util/data/msgencode.c config.h \
|
||||
$(srcdir)/util/data/msgencode.h \
|
||||
$(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/util/data/dname.h \
|
||||
$(srcdir)/util/regional.h $(srcdir)/util/net_help.h
|
||||
msgparse.lo msgparse.o: $(srcdir)/util/data/msgparse.c config.h \
|
||||
$(srcdir)/util/data/msgparse.h \
|
||||
$(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/dname.h \
|
||||
$(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lookup3.h $(srcdir)/util/regional.h
|
||||
msgreply.lo msgreply.o: $(srcdir)/util/data/msgreply.c config.h \
|
||||
$(srcdir)/util/data/msgreply.h \
|
||||
$(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/packed_rrset.h \
|
||||
$(srcdir)/util/storage/lookup3.h $(srcdir)/util/alloc.h $(srcdir)/util/netevent.h $(srcdir)/util/net_help.h \
|
||||
$(srcdir)/util/data/dname.h $(srcdir)/util/regional.h $(srcdir)/util/data/msgparse.h \
|
||||
$(srcdir)/util/data/msgencode.h
|
||||
packed_rrset.lo packed_rrset.o: $(srcdir)/util/data/packed_rrset.c config.h \
|
||||
$(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/util/data/dname.h $(srcdir)/util/storage/lookup3.h $(srcdir)/util/alloc.h $(srcdir)/util/regional.h \
|
||||
$(srcdir)/util/net_help.h
|
||||
iterator.lo iterator.o: $(srcdir)/iterator/iterator.c config.h \
|
||||
$(srcdir)/iterator/iterator.h \
|
||||
$(srcdir)/services/outbound_list.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h \
|
||||
$(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/module.h \
|
||||
$(srcdir)/util/data/msgparse.h $(srcdir)/iterator/iter_utils.h $(srcdir)/iterator/iter_resptype.h \
|
||||
$(srcdir)/iterator/iter_hints.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \
|
||||
$(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_donotq.h $(srcdir)/iterator/iter_delegpt.h \
|
||||
$(srcdir)/iterator/iter_scrub.h $(srcdir)/iterator/iter_priv.h $(srcdir)/validator/val_neg.h \
|
||||
$(srcdir)/services/cache/dns.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h $(srcdir)/util/netevent.h \
|
||||
$(srcdir)/util/net_help.h $(srcdir)/util/regional.h $(srcdir)/util/data/dname.h $(srcdir)/util/data/msgencode.h \
|
||||
$(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h \
|
||||
$(srcdir)/util/config_file.h
|
||||
iter_delegpt.lo iter_delegpt.o: $(srcdir)/iterator/iter_delegpt.c config.h $(srcdir)/iterator/iter_delegpt.h \
|
||||
$(srcdir)/util/log.h \
|
||||
$(srcdir)/services/cache/dns.h \
|
||||
$(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/data/msgreply.h \
|
||||
$(srcdir)/util/data/packed_rrset.h \
|
||||
$(srcdir)/util/regional.h \
|
||||
$(srcdir)/util/data/dname.h $(srcdir)/util/net_help.h
|
||||
iter_donotq.lo iter_donotq.o: $(srcdir)/iterator/iter_donotq.c config.h $(srcdir)/iterator/iter_donotq.h \
|
||||
$(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/regional.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/util/config_file.h \
|
||||
$(srcdir)/util/net_help.h
|
||||
iter_fwd.lo iter_fwd.o: $(srcdir)/iterator/iter_fwd.c config.h \
|
||||
$(srcdir)/iterator/iter_fwd.h \
|
||||
$(srcdir)/util/rbtree.h $(srcdir)/iterator/iter_delegpt.h $(srcdir)/util/log.h $(srcdir)/util/config_file.h \
|
||||
$(srcdir)/util/net_help.h $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h
|
||||
iter_hints.lo iter_hints.o: $(srcdir)/iterator/iter_hints.c config.h \
|
||||
$(srcdir)/iterator/iter_hints.h \
|
||||
$(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/iterator/iter_delegpt.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/util/config_file.h $(srcdir)/util/net_help.h $(srcdir)/util/data/dname.h \
|
||||
$(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h
|
||||
iter_priv.lo iter_priv.o: $(srcdir)/iterator/iter_priv.c config.h \
|
||||
$(srcdir)/iterator/iter_priv.h \
|
||||
$(srcdir)/util/rbtree.h \
|
||||
$(srcdir)/util/regional.h $(srcdir)/util/log.h $(srcdir)/util/config_file.h $(srcdir)/util/data/dname.h \
|
||||
$(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/data/msgparse.h \
|
||||
$(srcdir)/util/net_help.h \
|
||||
$(srcdir)/util/storage/dnstree.h
|
||||
iter_resptype.lo iter_resptype.o: $(srcdir)/iterator/iter_resptype.c config.h \
|
||||
$(srcdir)/iterator/iter_resptype.h $(srcdir)/iterator/iter_delegpt.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/services/cache/dns.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \
|
||||
$(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/net_help.h \
|
||||
$(srcdir)/util/data/dname.h
|
||||
iter_scrub.lo iter_scrub.o: $(srcdir)/iterator/iter_scrub.c config.h $(srcdir)/iterator/iter_scrub.h \
|
||||
$(srcdir)/iterator/iterator.h \
|
||||
$(srcdir)/services/outbound_list.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h \
|
||||
$(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/packed_rrset.h \
|
||||
$(srcdir)/util/module.h \
|
||||
$(srcdir)/util/data/msgparse.h \
|
||||
$(srcdir)/iterator/iter_priv.h $(srcdir)/util/rbtree.h $(srcdir)/services/cache/rrset.h \
|
||||
$(srcdir)/util/storage/slabhash.h $(srcdir)/util/net_help.h $(srcdir)/util/regional.h \
|
||||
$(srcdir)/util/config_file.h $(srcdir)/util/data/dname.h $(srcdir)/util/alloc.h
|
||||
iter_utils.lo iter_utils.o: $(srcdir)/iterator/iter_utils.c config.h $(srcdir)/iterator/iter_utils.h \
|
||||
$(srcdir)/iterator/iter_resptype.h \
|
||||
$(srcdir)/iterator/iterator.h \
|
||||
$(srcdir)/services/outbound_list.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h \
|
||||
$(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/packed_rrset.h \
|
||||
$(srcdir)/util/module.h \
|
||||
$(srcdir)/util/data/msgparse.h \
|
||||
$(srcdir)/iterator/iter_hints.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \
|
||||
$(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_donotq.h $(srcdir)/iterator/iter_delegpt.h \
|
||||
$(srcdir)/iterator/iter_priv.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \
|
||||
$(srcdir)/services/cache/dns.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \
|
||||
$(srcdir)/util/net_help.h $(srcdir)/util/config_file.h $(srcdir)/util/regional.h $(srcdir)/util/data/dname.h \
|
||||
$(srcdir)/util/random.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/util/tube.h \
|
||||
$(srcdir)/services/mesh.h $(srcdir)/services/modstack.h $(srcdir)/validator/val_anchor.h \
|
||||
$(srcdir)/validator/val_kcache.h $(srcdir)/validator/val_kentry.h $(srcdir)/validator/val_utils.h
|
||||
listen_dnsport.lo listen_dnsport.o: $(srcdir)/services/listen_dnsport.c config.h \
|
||||
$(srcdir)/services/listen_dnsport.h $(srcdir)/util/netevent.h \
|
||||
$(srcdir)/services/outside_network.h $(srcdir)/util/rbtree.h $(srcdir)/util/log.h $(srcdir)/util/config_file.h \
|
||||
$(srcdir)/util/net_help.h
|
||||
localzone.lo localzone.o: $(srcdir)/services/localzone.c config.h \
|
||||
$(srcdir)/services/localzone.h \
|
||||
$(srcdir)/util/rbtree.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/regional.h $(srcdir)/util/config_file.h \
|
||||
$(srcdir)/util/data/dname.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/data/packed_rrset.h \
|
||||
$(srcdir)/util/data/msgencode.h $(srcdir)/util/net_help.h $(srcdir)/util/data/msgreply.h \
|
||||
$(srcdir)/util/data/msgparse.h
|
||||
mesh.lo mesh.o: $(srcdir)/services/mesh.c config.h \
|
||||
$(srcdir)/services/mesh.h \
|
||||
$(srcdir)/util/rbtree.h $(srcdir)/util/netevent.h $(srcdir)/util/data/msgparse.h \
|
||||
$(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/module.h \
|
||||
$(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/modstack.h \
|
||||
$(srcdir)/services/outbound_list.h $(srcdir)/services/cache/dns.h $(srcdir)/util/net_help.h \
|
||||
$(srcdir)/util/regional.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/timehist.h $(srcdir)/util/fptr_wlist.h \
|
||||
$(srcdir)/util/tube.h $(srcdir)/util/alloc.h $(srcdir)/util/config_file.h
|
||||
modstack.lo modstack.o: $(srcdir)/services/modstack.c config.h $(srcdir)/services/modstack.h \
|
||||
$(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/util/data/msgreply.h \
|
||||
$(srcdir)/util/data/packed_rrset.h \
|
||||
$(srcdir)/util/data/msgparse.h \
|
||||
$(srcdir)/util/fptr_wlist.h \
|
||||
$(srcdir)/util/netevent.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \
|
||||
$(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/validator/validator.h \
|
||||
$(srcdir)/validator/val_utils.h
|
||||
outbound_list.lo outbound_list.o: $(srcdir)/services/outbound_list.c config.h \
|
||||
$(srcdir)/services/outbound_list.h $(srcdir)/services/outside_network.h $(srcdir)/util/rbtree.h \
|
||||
$(srcdir)/util/netevent.h \
|
||||
|
||||
outside_network.lo outside_network.o: $(srcdir)/services/outside_network.c config.h \
|
||||
$(srcdir)/services/outside_network.h $(srcdir)/util/rbtree.h $(srcdir)/util/netevent.h \
|
||||
$(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/lruhash.h \
|
||||
$(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/rtt.h $(srcdir)/util/data/msgparse.h \
|
||||
$(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgencode.h \
|
||||
$(srcdir)/util/data/dname.h $(srcdir)/util/net_help.h $(srcdir)/util/random.h $(srcdir)/util/fptr_wlist.h \
|
||||
$(srcdir)/util/module.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h \
|
||||
|
||||
alloc.lo alloc.o: $(srcdir)/util/alloc.c config.h $(srcdir)/util/alloc.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/util/regional.h \
|
||||
$(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \
|
||||
$(srcdir)/util/fptr_wlist.h \
|
||||
$(srcdir)/util/netevent.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h \
|
||||
$(srcdir)/util/tube.h \
|
||||
$(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h
|
||||
config_file.lo config_file.o: $(srcdir)/util/config_file.c config.h \
|
||||
$(srcdir)/util/log.h \
|
||||
$(srcdir)/util/configyyrename.h $(srcdir)/util/config_file.h util/configparser.h \
|
||||
$(srcdir)/util/net_help.h $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \
|
||||
$(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \
|
||||
$(srcdir)/util/regional.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/util/tube.h \
|
||||
$(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h $(srcdir)/util/data/dname.h \
|
||||
$(srcdir)/util/iana_ports.inc
|
||||
configlexer.lo configlexer.o: util/configlexer.c config.h $(srcdir)/util/configyyrename.h \
|
||||
$(srcdir)/util/config_file.h util/configparser.h
|
||||
configparser.lo configparser.o: util/configparser.c config.h $(srcdir)/util/configyyrename.h \
|
||||
$(srcdir)/util/config_file.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h \
|
||||
|
||||
fptr_wlist.lo fptr_wlist.o: $(srcdir)/util/fptr_wlist.c config.h $(srcdir)/util/fptr_wlist.h \
|
||||
$(srcdir)/util/netevent.h \
|
||||
$(srcdir)/util/storage/lruhash.h \
|
||||
$(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \
|
||||
$(srcdir)/util/data/packed_rrset.h \
|
||||
$(srcdir)/util/data/msgparse.h \
|
||||
$(srcdir)/util/tube.h \
|
||||
$(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h $(srcdir)/util/mini_event.h \
|
||||
$(srcdir)/daemon/worker.h $(srcdir)/util/alloc.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \
|
||||
$(srcdir)/daemon/remote.h \
|
||||
$(srcdir)/services/outside_network.h $(srcdir)/services/localzone.h $(srcdir)/services/cache/infra.h \
|
||||
$(srcdir)/util/rtt.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \
|
||||
$(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/iterator/iter_fwd.h \
|
||||
$(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h $(srcdir)/validator/val_anchor.h \
|
||||
$(srcdir)/validator/val_nsec3.h $(srcdir)/validator/val_sigcrypt.h $(srcdir)/validator/val_kentry.h \
|
||||
$(srcdir)/validator/val_neg.h $(srcdir)/validator/autotrust.h $(srcdir)/util/storage/dnstree.h \
|
||||
$(srcdir)/libunbound/libworker.h $(srcdir)/libunbound/context.h $(srcdir)/libunbound/unbound.h \
|
||||
$(srcdir)/util/config_file.h
|
||||
locks.lo locks.o: $(srcdir)/util/locks.c config.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \
|
||||
|
||||
log.lo log.o: $(srcdir)/util/log.c config.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/util/locks.h
|
||||
mini_event.lo mini_event.o: $(srcdir)/util/mini_event.c config.h
|
||||
module.lo module.o: $(srcdir)/util/module.c config.h $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h \
|
||||
$(srcdir)/util/locks.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/util/data/msgreply.h \
|
||||
$(srcdir)/util/data/packed_rrset.h \
|
||||
$(srcdir)/util/data/msgparse.h \
|
||||
|
||||
netevent.lo netevent.o: $(srcdir)/util/netevent.c config.h \
|
||||
$(srcdir)/util/netevent.h \
|
||||
$(srcdir)/util/log.h $(srcdir)/util/net_help.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/storage/lruhash.h \
|
||||
$(srcdir)/util/locks.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \
|
||||
$(srcdir)/util/data/msgparse.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \
|
||||
$(srcdir)/services/modstack.h \
|
||||
|
||||
net_help.lo net_help.o: $(srcdir)/util/net_help.c config.h \
|
||||
$(srcdir)/util/net_help.h \
|
||||
$(srcdir)/util/log.h $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \
|
||||
$(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \
|
||||
$(srcdir)/util/data/msgparse.h $(srcdir)/util/regional.h \
|
||||
|
||||
random.lo random.o: $(srcdir)/util/random.c config.h $(srcdir)/util/random.h $(srcdir)/util/log.h \
|
||||
|
||||
rbtree.lo rbtree.o: $(srcdir)/util/rbtree.c config.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/util/fptr_wlist.h \
|
||||
$(srcdir)/util/netevent.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \
|
||||
$(srcdir)/util/data/msgparse.h \
|
||||
$(srcdir)/util/tube.h \
|
||||
$(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h
|
||||
regional.lo regional.o: $(srcdir)/util/regional.c config.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/util/regional.h
|
||||
rtt.lo rtt.o: $(srcdir)/util/rtt.c config.h $(srcdir)/util/rtt.h
|
||||
dnstree.lo dnstree.o: $(srcdir)/util/storage/dnstree.c config.h $(srcdir)/util/storage/dnstree.h \
|
||||
$(srcdir)/util/rbtree.h $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \
|
||||
$(srcdir)/util/log.h \
|
||||
$(srcdir)/util/net_help.h
|
||||
lookup3.lo lookup3.o: $(srcdir)/util/storage/lookup3.c config.h $(srcdir)/util/storage/lookup3.h
|
||||
lruhash.lo lruhash.o: $(srcdir)/util/storage/lruhash.c config.h $(srcdir)/util/storage/lruhash.h \
|
||||
$(srcdir)/util/locks.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/util/fptr_wlist.h \
|
||||
$(srcdir)/util/netevent.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \
|
||||
$(srcdir)/util/data/packed_rrset.h \
|
||||
$(srcdir)/util/data/msgparse.h \
|
||||
$(srcdir)/util/tube.h \
|
||||
$(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h
|
||||
slabhash.lo slabhash.o: $(srcdir)/util/storage/slabhash.c config.h $(srcdir)/util/storage/slabhash.h \
|
||||
$(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \
|
||||
|
||||
timehist.lo timehist.o: $(srcdir)/util/timehist.c config.h $(srcdir)/util/timehist.h $(srcdir)/util/log.h \
|
||||
|
||||
tube.lo tube.o: $(srcdir)/util/tube.c config.h $(srcdir)/util/tube.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/util/net_help.h \
|
||||
$(srcdir)/util/netevent.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \
|
||||
$(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \
|
||||
$(srcdir)/util/data/msgparse.h \
|
||||
$(srcdir)/services/mesh.h \
|
||||
$(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h
|
||||
winsock_event.lo winsock_event.o: $(srcdir)/util/winsock_event.c config.h
|
||||
autotrust.lo autotrust.o: $(srcdir)/validator/autotrust.c config.h \
|
||||
$(srcdir)/validator/autotrust.h \
|
||||
$(srcdir)/util/rbtree.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \
|
||||
$(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/validator/val_anchor.h $(srcdir)/validator/val_utils.h \
|
||||
$(srcdir)/validator/val_sigcrypt.h $(srcdir)/util/data/dname.h $(srcdir)/util/module.h \
|
||||
$(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/util/net_help.h \
|
||||
$(srcdir)/util/config_file.h $(srcdir)/util/regional.h $(srcdir)/util/random.h $(srcdir)/services/mesh.h \
|
||||
$(srcdir)/util/netevent.h $(srcdir)/services/modstack.h $(srcdir)/services/cache/rrset.h \
|
||||
$(srcdir)/util/storage/slabhash.h $(srcdir)/validator/val_kcache.h
|
||||
val_anchor.lo val_anchor.o: $(srcdir)/validator/val_anchor.c config.h \
|
||||
$(srcdir)/validator/val_anchor.h \
|
||||
$(srcdir)/util/rbtree.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/validator/val_sigcrypt.h \
|
||||
$(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/validator/autotrust.h \
|
||||
$(srcdir)/util/data/dname.h $(srcdir)/util/net_help.h $(srcdir)/util/config_file.h
|
||||
validator.lo validator.o: $(srcdir)/validator/validator.c config.h \
|
||||
$(srcdir)/validator/validator.h \
|
||||
$(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \
|
||||
$(srcdir)/validator/val_utils.h $(srcdir)/validator/val_anchor.h $(srcdir)/util/rbtree.h \
|
||||
$(srcdir)/validator/val_kcache.h $(srcdir)/util/storage/slabhash.h $(srcdir)/validator/val_kentry.h \
|
||||
$(srcdir)/validator/val_nsec.h $(srcdir)/validator/val_nsec3.h $(srcdir)/validator/val_neg.h \
|
||||
$(srcdir)/validator/val_sigcrypt.h $(srcdir)/validator/autotrust.h $(srcdir)/services/cache/dns.h \
|
||||
$(srcdir)/util/data/dname.h $(srcdir)/util/net_help.h $(srcdir)/util/regional.h $(srcdir)/util/config_file.h \
|
||||
$(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h \
|
||||
$(srcdir)/services/modstack.h
|
||||
val_kcache.lo val_kcache.o: $(srcdir)/validator/val_kcache.c config.h $(srcdir)/validator/val_kcache.h \
|
||||
$(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/validator/val_kentry.h \
|
||||
$(srcdir)/util/config_file.h $(srcdir)/util/data/dname.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \
|
||||
$(srcdir)/util/data/packed_rrset.h \
|
||||
$(srcdir)/util/data/msgparse.h \
|
||||
|
||||
val_kentry.lo val_kentry.o: $(srcdir)/validator/val_kentry.c config.h \
|
||||
$(srcdir)/validator/val_kentry.h \
|
||||
$(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/packed_rrset.h \
|
||||
$(srcdir)/util/data/dname.h $(srcdir)/util/storage/lookup3.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h
|
||||
val_neg.lo val_neg.o: $(srcdir)/validator/val_neg.c config.h \
|
||||
$(srcdir)/validator/val_neg.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/util/rbtree.h \
|
||||
$(srcdir)/validator/val_nsec.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \
|
||||
$(srcdir)/validator/val_nsec3.h \
|
||||
$(srcdir)/validator/val_utils.h $(srcdir)/util/data/dname.h $(srcdir)/util/data/msgreply.h \
|
||||
$(srcdir)/util/net_help.h $(srcdir)/util/config_file.h $(srcdir)/services/cache/rrset.h \
|
||||
$(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/dns.h
|
||||
val_nsec3.lo val_nsec3.o: $(srcdir)/validator/val_nsec3.c config.h \
|
||||
$(srcdir)/validator/val_nsec3.h $(srcdir)/util/rbtree.h $(srcdir)/util/data/packed_rrset.h \
|
||||
$(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/validator/validator.h \
|
||||
$(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h \
|
||||
$(srcdir)/validator/val_utils.h \
|
||||
$(srcdir)/validator/val_kentry.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \
|
||||
$(srcdir)/util/regional.h $(srcdir)/util/net_help.h $(srcdir)/util/data/dname.h $(srcdir)/validator/val_nsec.h
|
||||
val_nsec.lo val_nsec.o: $(srcdir)/validator/val_nsec.c config.h \
|
||||
$(srcdir)/validator/val_nsec.h \
|
||||
$(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/validator/val_utils.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/dname.h \
|
||||
$(srcdir)/util/net_help.h $(srcdir)/util/module.h $(srcdir)/util/data/msgparse.h \
|
||||
$(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h
|
||||
val_secalgo.lo val_secalgo.o: $(srcdir)/validator/val_secalgo.c config.h \
|
||||
$(srcdir)/validator/val_secalgo.h \
|
||||
$(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \
|
||||
|
||||
val_sigcrypt.lo val_sigcrypt.o: $(srcdir)/validator/val_sigcrypt.c config.h \
|
||||
$(srcdir)/validator/val_sigcrypt.h \
|
||||
$(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/validator/val_secalgo.h $(srcdir)/validator/validator.h $(srcdir)/util/module.h \
|
||||
$(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/validator/val_utils.h \
|
||||
$(srcdir)/util/data/dname.h $(srcdir)/util/rbtree.h $(srcdir)/util/net_help.h $(srcdir)/util/regional.h \
|
||||
|
||||
val_utils.lo val_utils.o: $(srcdir)/validator/val_utils.c config.h $(srcdir)/validator/val_utils.h \
|
||||
$(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/validator/validator.h \
|
||||
$(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h \
|
||||
$(srcdir)/validator/val_kentry.h \
|
||||
$(srcdir)/validator/val_sigcrypt.h $(srcdir)/validator/val_anchor.h $(srcdir)/util/rbtree.h \
|
||||
$(srcdir)/validator/val_nsec.h $(srcdir)/validator/val_neg.h $(srcdir)/services/cache/rrset.h \
|
||||
$(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/dns.h $(srcdir)/util/data/dname.h \
|
||||
$(srcdir)/util/net_help.h $(srcdir)/util/regional.h
|
||||
checklocks.lo checklocks.o: $(srcdir)/testcode/checklocks.c config.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/testcode/checklocks.h
|
||||
unitanchor.lo unitanchor.o: $(srcdir)/testcode/unitanchor.c config.h \
|
||||
$(srcdir)/util/log.h \
|
||||
$(srcdir)/util/data/dname.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \
|
||||
$(srcdir)/testcode/unitmain.h $(srcdir)/validator/val_anchor.h $(srcdir)/util/rbtree.h
|
||||
unitdname.lo unitdname.o: $(srcdir)/testcode/unitdname.c config.h \
|
||||
$(srcdir)/util/log.h \
|
||||
$(srcdir)/testcode/unitmain.h $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lruhash.h \
|
||||
$(srcdir)/util/locks.h
|
||||
unitlruhash.lo unitlruhash.o: $(srcdir)/testcode/unitlruhash.c config.h $(srcdir)/testcode/unitmain.h \
|
||||
$(srcdir)/util/log.h \
|
||||
$(srcdir)/util/storage/lruhash.h \
|
||||
$(srcdir)/util/locks.h $(srcdir)/util/storage/slabhash.h
|
||||
unitmain.lo unitmain.o: $(srcdir)/testcode/unitmain.c config.h \
|
||||
$(srcdir)/util/log.h \
|
||||
$(srcdir)/testcode/unitmain.h $(srcdir)/util/alloc.h $(srcdir)/util/locks.h $(srcdir)/util/net_help.h \
|
||||
$(srcdir)/util/config_file.h $(srcdir)/util/rtt.h $(srcdir)/services/cache/infra.h \
|
||||
$(srcdir)/util/storage/lruhash.h $(srcdir)/util/random.h
|
||||
unitmsgparse.lo unitmsgparse.o: $(srcdir)/testcode/unitmsgparse.c config.h \
|
||||
$(srcdir)/util/log.h \
|
||||
$(srcdir)/testcode/unitmain.h $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h \
|
||||
$(srcdir)/util/locks.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \
|
||||
$(srcdir)/util/data/msgencode.h $(srcdir)/util/data/dname.h $(srcdir)/util/alloc.h $(srcdir)/util/regional.h \
|
||||
$(srcdir)/util/net_help.h $(srcdir)/testcode/readhex.h
|
||||
unitneg.lo unitneg.o: $(srcdir)/testcode/unitneg.c config.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/util/net_help.h \
|
||||
$(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \
|
||||
$(srcdir)/util/data/dname.h \
|
||||
$(srcdir)/testcode/unitmain.h $(srcdir)/validator/val_neg.h $(srcdir)/util/rbtree.h
|
||||
unitregional.lo unitregional.o: $(srcdir)/testcode/unitregional.c config.h $(srcdir)/testcode/unitmain.h \
|
||||
$(srcdir)/util/log.h \
|
||||
$(srcdir)/util/regional.h
|
||||
unitslabhash.lo unitslabhash.o: $(srcdir)/testcode/unitslabhash.c config.h $(srcdir)/testcode/unitmain.h \
|
||||
$(srcdir)/util/log.h \
|
||||
$(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h
|
||||
unitverify.lo unitverify.o: $(srcdir)/testcode/unitverify.c config.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/testcode/unitmain.h \
|
||||
$(srcdir)/validator/val_sigcrypt.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \
|
||||
$(srcdir)/util/locks.h \
|
||||
$(srcdir)/validator/val_secalgo.h \
|
||||
$(srcdir)/validator/val_nsec.h $(srcdir)/validator/val_nsec3.h $(srcdir)/util/rbtree.h \
|
||||
$(srcdir)/validator/validator.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \
|
||||
$(srcdir)/util/data/msgparse.h \
|
||||
$(srcdir)/validator/val_utils.h $(srcdir)/testcode/ldns-testpkts.h \
|
||||
$(srcdir)/util/data/dname.h \
|
||||
$(srcdir)/util/regional.h $(srcdir)/util/alloc.h $(srcdir)/util/net_help.h $(srcdir)/util/config_file.h
|
||||
readhex.lo readhex.o: $(srcdir)/testcode/readhex.c config.h $(srcdir)/testcode/readhex.h \
|
||||
$(srcdir)/util/log.h
|
||||
ldns-testpkts.lo ldns-testpkts.o: $(srcdir)/testcode/ldns-testpkts.c config.h \
|
||||
$(srcdir)/testcode/ldns-testpkts.h
|
||||
acl_list.lo acl_list.o: $(srcdir)/daemon/acl_list.c config.h $(srcdir)/daemon/acl_list.h \
|
||||
$(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/regional.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/util/config_file.h \
|
||||
$(srcdir)/util/net_help.h
|
||||
cachedump.lo cachedump.o: $(srcdir)/daemon/cachedump.c config.h \
|
||||
$(srcdir)/daemon/cachedump.h \
|
||||
$(srcdir)/daemon/remote.h $(srcdir)/daemon/worker.h $(srcdir)/util/netevent.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h \
|
||||
$(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/daemon/stats.h \
|
||||
$(srcdir)/util/timehist.h $(srcdir)/util/module.h $(srcdir)/services/cache/rrset.h \
|
||||
$(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/dns.h $(srcdir)/services/cache/infra.h \
|
||||
$(srcdir)/util/rtt.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h $(srcdir)/util/data/dname.h \
|
||||
$(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/iterator/iter_delegpt.h \
|
||||
$(srcdir)/iterator/iter_utils.h $(srcdir)/iterator/iter_resptype.h $(srcdir)/iterator/iter_fwd.h \
|
||||
$(srcdir)/util/rbtree.h $(srcdir)/iterator/iter_hints.h $(srcdir)/util/storage/dnstree.h
|
||||
daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h \
|
||||
$(srcdir)/daemon/daemon.h \
|
||||
$(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h $(srcdir)/daemon/worker.h \
|
||||
$(srcdir)/util/netevent.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h \
|
||||
$(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/daemon/stats.h \
|
||||
$(srcdir)/util/timehist.h $(srcdir)/util/module.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/acl_list.h \
|
||||
$(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/config_file.h \
|
||||
$(srcdir)/util/storage/lookup3.h $(srcdir)/util/storage/slabhash.h $(srcdir)/services/listen_dnsport.h \
|
||||
$(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \
|
||||
$(srcdir)/services/localzone.h $(srcdir)/util/random.h $(srcdir)/util/tube.h $(srcdir)/util/net_help.h
|
||||
remote.lo remote.o: $(srcdir)/daemon/remote.c config.h \
|
||||
$(srcdir)/daemon/remote.h \
|
||||
$(srcdir)/daemon/worker.h $(srcdir)/util/netevent.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/alloc.h \
|
||||
$(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/data/packed_rrset.h \
|
||||
$(srcdir)/util/data/msgparse.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/util/module.h \
|
||||
$(srcdir)/daemon/daemon.h $(srcdir)/services/modstack.h $(srcdir)/daemon/cachedump.h \
|
||||
$(srcdir)/util/config_file.h $(srcdir)/util/net_help.h $(srcdir)/services/listen_dnsport.h \
|
||||
$(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/infra.h \
|
||||
$(srcdir)/util/rtt.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/localzone.h \
|
||||
$(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/data/dname.h $(srcdir)/validator/validator.h \
|
||||
$(srcdir)/validator/val_utils.h $(srcdir)/validator/val_kcache.h $(srcdir)/validator/val_kentry.h \
|
||||
$(srcdir)/validator/val_anchor.h $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h \
|
||||
$(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h $(srcdir)/util/storage/dnstree.h \
|
||||
$(srcdir)/iterator/iter_delegpt.h $(srcdir)/services/outside_network.h
|
||||
stats.lo stats.o: $(srcdir)/daemon/stats.c config.h \
|
||||
$(srcdir)/daemon/stats.h \
|
||||
$(srcdir)/util/timehist.h $(srcdir)/daemon/worker.h $(srcdir)/util/netevent.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h \
|
||||
$(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/util/module.h \
|
||||
$(srcdir)/daemon/daemon.h $(srcdir)/services/modstack.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \
|
||||
$(srcdir)/services/outside_network.h $(srcdir)/util/config_file.h $(srcdir)/util/tube.h \
|
||||
$(srcdir)/util/net_help.h $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h
|
||||
unbound.lo unbound.o: $(srcdir)/daemon/unbound.c config.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/daemon/daemon.h \
|
||||
$(srcdir)/util/locks.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h $(srcdir)/daemon/remote.h \
|
||||
$(srcdir)/util/config_file.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h \
|
||||
$(srcdir)/services/listen_dnsport.h $(srcdir)/util/netevent.h $(srcdir)/services/cache/rrset.h \
|
||||
$(srcdir)/util/data/packed_rrset.h \
|
||||
$(srcdir)/services/cache/infra.h \
|
||||
$(srcdir)/util/rtt.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/module.h $(srcdir)/util/data/msgparse.h \
|
||||
$(srcdir)/util/net_help.h
|
||||
worker.lo worker.o: $(srcdir)/daemon/worker.c config.h \
|
||||
$(srcdir)/util/log.h \
|
||||
$(srcdir)/util/net_help.h $(srcdir)/util/random.h $(srcdir)/daemon/worker.h $(srcdir)/util/netevent.h \
|
||||
$(srcdir)/util/locks.h $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h \
|
||||
$(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/daemon/stats.h \
|
||||
$(srcdir)/util/timehist.h $(srcdir)/util/module.h $(srcdir)/daemon/daemon.h $(srcdir)/services/modstack.h \
|
||||
$(srcdir)/daemon/remote.h \
|
||||
$(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \
|
||||
$(srcdir)/util/config_file.h $(srcdir)/util/regional.h $(srcdir)/util/storage/slabhash.h \
|
||||
$(srcdir)/services/listen_dnsport.h $(srcdir)/services/outside_network.h \
|
||||
$(srcdir)/services/outbound_list.h $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h \
|
||||
$(srcdir)/util/rtt.h $(srcdir)/services/cache/dns.h $(srcdir)/services/mesh.h $(srcdir)/services/localzone.h \
|
||||
$(srcdir)/util/data/msgencode.h $(srcdir)/util/data/dname.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h \
|
||||
$(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h $(srcdir)/validator/autotrust.h \
|
||||
$(srcdir)/validator/val_anchor.h
|
||||
testbound.lo testbound.o: $(srcdir)/testcode/testbound.c config.h $(srcdir)/testcode/ldns-testpkts.h \
|
||||
$(srcdir)/testcode/replay.h \
|
||||
$(srcdir)/util/netevent.h $(srcdir)/util/rbtree.h $(srcdir)/testcode/fake_event.h $(srcdir)/daemon/remote.h \
|
||||
$(srcdir)/util/config_file.h $(srcdir)/daemon/unbound.c $(srcdir)/util/log.h $(srcdir)/daemon/daemon.h \
|
||||
$(srcdir)/util/locks.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h $(srcdir)/util/storage/slabhash.h \
|
||||
$(srcdir)/util/storage/lruhash.h $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h \
|
||||
$(srcdir)/util/data/packed_rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \
|
||||
$(srcdir)/util/data/msgreply.h $(srcdir)/util/module.h $(srcdir)/util/data/msgparse.h $(srcdir)/util/net_help.h
|
||||
ldns-testpkts.lo ldns-testpkts.o: $(srcdir)/testcode/ldns-testpkts.c config.h \
|
||||
$(srcdir)/testcode/ldns-testpkts.h
|
||||
worker.lo worker.o: $(srcdir)/daemon/worker.c config.h \
|
||||
$(srcdir)/util/log.h \
|
||||
$(srcdir)/util/net_help.h $(srcdir)/util/random.h $(srcdir)/daemon/worker.h $(srcdir)/util/netevent.h \
|
||||
$(srcdir)/util/locks.h $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h \
|
||||
$(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/daemon/stats.h \
|
||||
$(srcdir)/util/timehist.h $(srcdir)/util/module.h $(srcdir)/daemon/daemon.h $(srcdir)/services/modstack.h \
|
||||
$(srcdir)/daemon/remote.h \
|
||||
$(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \
|
||||
$(srcdir)/util/config_file.h $(srcdir)/util/regional.h $(srcdir)/util/storage/slabhash.h \
|
||||
$(srcdir)/services/listen_dnsport.h $(srcdir)/services/outside_network.h \
|
||||
$(srcdir)/services/outbound_list.h $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h \
|
||||
$(srcdir)/util/rtt.h $(srcdir)/services/cache/dns.h $(srcdir)/services/mesh.h $(srcdir)/services/localzone.h \
|
||||
$(srcdir)/util/data/msgencode.h $(srcdir)/util/data/dname.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h \
|
||||
$(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h $(srcdir)/validator/autotrust.h \
|
||||
$(srcdir)/validator/val_anchor.h
|
||||
acl_list.lo acl_list.o: $(srcdir)/daemon/acl_list.c config.h $(srcdir)/daemon/acl_list.h \
|
||||
$(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/regional.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/util/config_file.h \
|
||||
$(srcdir)/util/net_help.h
|
||||
daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h \
|
||||
$(srcdir)/daemon/daemon.h \
|
||||
$(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h $(srcdir)/daemon/worker.h \
|
||||
$(srcdir)/util/netevent.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h \
|
||||
$(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/daemon/stats.h \
|
||||
$(srcdir)/util/timehist.h $(srcdir)/util/module.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/acl_list.h \
|
||||
$(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/config_file.h \
|
||||
$(srcdir)/util/storage/lookup3.h $(srcdir)/util/storage/slabhash.h $(srcdir)/services/listen_dnsport.h \
|
||||
$(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \
|
||||
$(srcdir)/services/localzone.h $(srcdir)/util/random.h $(srcdir)/util/tube.h $(srcdir)/util/net_help.h
|
||||
stats.lo stats.o: $(srcdir)/daemon/stats.c config.h \
|
||||
$(srcdir)/daemon/stats.h \
|
||||
$(srcdir)/util/timehist.h $(srcdir)/daemon/worker.h $(srcdir)/util/netevent.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h \
|
||||
$(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/util/module.h \
|
||||
$(srcdir)/daemon/daemon.h $(srcdir)/services/modstack.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \
|
||||
$(srcdir)/services/outside_network.h $(srcdir)/util/config_file.h $(srcdir)/util/tube.h \
|
||||
$(srcdir)/util/net_help.h $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h
|
||||
replay.lo replay.o: $(srcdir)/testcode/replay.c config.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/util/net_help.h \
|
||||
$(srcdir)/util/config_file.h $(srcdir)/testcode/replay.h $(srcdir)/util/netevent.h \
|
||||
$(srcdir)/testcode/ldns-testpkts.h \
|
||||
$(srcdir)/util/rbtree.h \
|
||||
$(srcdir)/testcode/fake_event.h
|
||||
fake_event.lo fake_event.o: $(srcdir)/testcode/fake_event.c config.h $(srcdir)/testcode/fake_event.h \
|
||||
$(srcdir)/util/netevent.h \
|
||||
$(srcdir)/util/net_help.h \
|
||||
$(srcdir)/util/log.h $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \
|
||||
$(srcdir)/util/data/msgreply.h \
|
||||
$(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/dname.h \
|
||||
$(srcdir)/util/config_file.h $(srcdir)/services/listen_dnsport.h $(srcdir)/services/outside_network.h \
|
||||
$(srcdir)/util/rbtree.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h $(srcdir)/testcode/replay.h \
|
||||
$(srcdir)/testcode/ldns-testpkts.h \
|
||||
$(srcdir)/util/fptr_wlist.h \
|
||||
$(srcdir)/util/module.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h
|
||||
lock_verify.lo lock_verify.o: $(srcdir)/testcode/lock_verify.c config.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/util/rbtree.h \
|
||||
$(srcdir)/util/locks.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/util/storage/lruhash.h \
|
||||
$(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \
|
||||
$(srcdir)/util/data/msgparse.h \
|
||||
$(srcdir)/util/tube.h \
|
||||
$(srcdir)/services/mesh.h $(srcdir)/services/modstack.h
|
||||
pktview.lo pktview.o: $(srcdir)/testcode/pktview.c config.h \
|
||||
$(srcdir)/util/log.h \
|
||||
$(srcdir)/util/data/dname.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \
|
||||
$(srcdir)/util/data/msgparse.h $(srcdir)/testcode/unitmain.h $(srcdir)/testcode/readhex.h
|
||||
readhex.lo readhex.o: $(srcdir)/testcode/readhex.c config.h $(srcdir)/testcode/readhex.h \
|
||||
$(srcdir)/util/log.h
|
||||
signit.lo signit.o: $(srcdir)/testcode/signit.c config.h \
|
||||
$(srcdir)/util/log.h \
|
||||
$(srcdir)/util/config_file.h $(srcdir)/util/net_help.h
|
||||
memstats.lo memstats.o: $(srcdir)/testcode/memstats.c config.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/util/rbtree.h \
|
||||
$(srcdir)/util/locks.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/util/storage/lruhash.h \
|
||||
$(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \
|
||||
$(srcdir)/util/data/msgparse.h \
|
||||
$(srcdir)/util/tube.h \
|
||||
$(srcdir)/services/mesh.h $(srcdir)/services/modstack.h
|
||||
unbound-checkconf.lo unbound-checkconf.o: $(srcdir)/smallapp/unbound-checkconf.c config.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/util/config_file.h \
|
||||
$(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/data/msgreply.h \
|
||||
$(srcdir)/util/data/packed_rrset.h \
|
||||
$(srcdir)/util/data/msgparse.h \
|
||||
$(srcdir)/util/net_help.h \
|
||||
$(srcdir)/util/regional.h $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h \
|
||||
$(srcdir)/iterator/iter_fwd.h $(srcdir)/util/rbtree.h $(srcdir)/iterator/iter_hints.h \
|
||||
$(srcdir)/util/storage/dnstree.h $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h \
|
||||
$(srcdir)/services/localzone.h
|
||||
worker_cb.lo worker_cb.o: $(srcdir)/smallapp/worker_cb.c config.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/services/mesh.h \
|
||||
$(srcdir)/util/rbtree.h $(srcdir)/util/netevent.h $(srcdir)/util/data/msgparse.h \
|
||||
$(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \
|
||||
$(srcdir)/util/module.h \
|
||||
$(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/modstack.h
|
||||
context.lo context.o: $(srcdir)/libunbound/context.c config.h $(srcdir)/libunbound/context.h \
|
||||
$(srcdir)/util/locks.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/util/alloc.h \
|
||||
$(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h $(srcdir)/libunbound/unbound.h \
|
||||
$(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \
|
||||
$(srcdir)/util/module.h \
|
||||
$(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h \
|
||||
$(srcdir)/util/config_file.h \
|
||||
$(srcdir)/util/net_help.h $(srcdir)/services/localzone.h $(srcdir)/services/cache/rrset.h \
|
||||
$(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h
|
||||
libunbound.lo libunbound.o: $(srcdir)/libunbound/libunbound.c $(srcdir)/libunbound/unbound.h config.h \
|
||||
$(srcdir)/libunbound/context.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/util/alloc.h \
|
||||
$(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h $(srcdir)/util/data/packed_rrset.h \
|
||||
$(srcdir)/util/storage/lruhash.h \
|
||||
$(srcdir)/libunbound/libworker.h \
|
||||
$(srcdir)/util/config_file.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \
|
||||
$(srcdir)/util/data/msgparse.h \
|
||||
$(srcdir)/util/regional.h $(srcdir)/util/random.h $(srcdir)/util/net_help.h $(srcdir)/util/tube.h \
|
||||
$(srcdir)/services/localzone.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \
|
||||
$(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h
|
||||
libworker.lo libworker.o: $(srcdir)/libunbound/libworker.c config.h \
|
||||
$(srcdir)/libunbound/libworker.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \
|
||||
$(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/libunbound/context.h $(srcdir)/util/alloc.h $(srcdir)/util/rbtree.h \
|
||||
$(srcdir)/services/modstack.h $(srcdir)/libunbound/unbound.h $(srcdir)/services/outside_network.h \
|
||||
$(srcdir)/util/netevent.h $(srcdir)/services/mesh.h $(srcdir)/util/data/msgparse.h $(srcdir)/util/module.h \
|
||||
$(srcdir)/util/data/msgreply.h $(srcdir)/services/localzone.h $(srcdir)/services/cache/rrset.h \
|
||||
$(srcdir)/util/storage/slabhash.h $(srcdir)/services/outbound_list.h $(srcdir)/util/regional.h \
|
||||
$(srcdir)/util/random.h $(srcdir)/util/config_file.h $(srcdir)/util/storage/lookup3.h $(srcdir)/util/net_help.h \
|
||||
$(srcdir)/util/data/dname.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/tube.h $(srcdir)/iterator/iter_fwd.h \
|
||||
$(srcdir)/iterator/iter_hints.h $(srcdir)/util/storage/dnstree.h
|
||||
unbound-host.lo unbound-host.o: $(srcdir)/smallapp/unbound-host.c config.h $(srcdir)/libunbound/unbound.h \
|
||||
|
||||
asynclook.lo asynclook.o: $(srcdir)/testcode/asynclook.c config.h $(srcdir)/libunbound/unbound.h \
|
||||
$(srcdir)/libunbound/context.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/util/alloc.h \
|
||||
$(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h $(srcdir)/util/data/packed_rrset.h \
|
||||
$(srcdir)/util/storage/lruhash.h \
|
||||
|
||||
streamtcp.lo streamtcp.o: $(srcdir)/testcode/streamtcp.c config.h \
|
||||
$(srcdir)/util/locks.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/util/net_help.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/msgparse.h \
|
||||
$(srcdir)/util/storage/lruhash.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \
|
||||
$(srcdir)/util/data/dname.h \
|
||||
|
||||
perf.lo perf.o: $(srcdir)/testcode/perf.c config.h \
|
||||
$(srcdir)/util/log.h $(srcdir)/util/locks.h \
|
||||
$(srcdir)/util/net_help.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/msgreply.h \
|
||||
$(srcdir)/util/storage/lruhash.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h
|
||||
delayer.lo delayer.o: $(srcdir)/testcode/delayer.c config.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/util/config_file.h
|
||||
harvest.lo harvest.o: $(srcdir)/testcode/harvest.c config.h \
|
||||
$(srcdir)/libunbound/unbound.h
|
||||
unbound-control.lo unbound-control.o: $(srcdir)/smallapp/unbound-control.c config.h \
|
||||
$(srcdir)/util/log.h \
|
||||
$(srcdir)/util/config_file.h \
|
||||
$(srcdir)/util/locks.h $(srcdir)/util/net_help.h
|
||||
unbound-anchor.lo unbound-anchor.o: $(srcdir)/smallapp/unbound-anchor.c config.h $(srcdir)/libunbound/unbound.h \
|
||||
|
||||
petal.lo petal.o: $(srcdir)/testcode/petal.c config.h \
|
||||
|
||||
pythonmod_utils.lo pythonmod_utils.o: $(srcdir)/pythonmod/pythonmod_utils.c config.h $(srcdir)/util/module.h \
|
||||
$(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/util/data/msgreply.h \
|
||||
$(srcdir)/util/data/packed_rrset.h \
|
||||
$(srcdir)/util/data/msgparse.h \
|
||||
$(srcdir)/util/netevent.h \
|
||||
$(srcdir)/util/net_help.h $(srcdir)/services/cache/dns.h $(srcdir)/services/cache/rrset.h \
|
||||
$(srcdir)/util/storage/slabhash.h $(srcdir)/util/regional.h
|
||||
win_svc.lo win_svc.o: $(srcdir)/winrc/win_svc.c config.h $(srcdir)/winrc/win_svc.h $(srcdir)/winrc/w_inst.h \
|
||||
$(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \
|
||||
$(srcdir)/util/alloc.h \
|
||||
$(srcdir)/services/modstack.h $(srcdir)/daemon/worker.h $(srcdir)/util/netevent.h $(srcdir)/util/data/msgreply.h \
|
||||
$(srcdir)/util/storage/lruhash.h $(srcdir)/util/data/packed_rrset.h \
|
||||
$(srcdir)/util/data/msgparse.h \
|
||||
$(srcdir)/daemon/stats.h \
|
||||
$(srcdir)/util/timehist.h $(srcdir)/util/module.h $(srcdir)/daemon/remote.h \
|
||||
$(srcdir)/util/config_file.h $(srcdir)/util/winsock_event.h
|
||||
w_inst.lo w_inst.o: $(srcdir)/winrc/w_inst.c config.h $(srcdir)/winrc/w_inst.h $(srcdir)/winrc/win_svc.h
|
||||
unbound-service-install.lo unbound-service-install.o: $(srcdir)/winrc/unbound-service-install.c config.h \
|
||||
$(srcdir)/winrc/w_inst.h
|
||||
unbound-service-remove.lo unbound-service-remove.o: $(srcdir)/winrc/unbound-service-remove.c config.h \
|
||||
$(srcdir)/winrc/w_inst.h
|
||||
anchor-update.lo anchor-update.o: $(srcdir)/winrc/anchor-update.c config.h \
|
||||
$(srcdir)/libunbound/unbound.h
|
||||
ctime_r.lo ctime_r.o: $(srcdir)/compat/ctime_r.c config.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \
|
||||
|
||||
fake-rfc2553.lo fake-rfc2553.o: $(srcdir)/compat/fake-rfc2553.c $(srcdir)/compat/fake-rfc2553.h config.h
|
||||
gmtime_r.lo gmtime_r.o: $(srcdir)/compat/gmtime_r.c config.h
|
||||
inet_aton.lo inet_aton.o: $(srcdir)/compat/inet_aton.c config.h
|
||||
inet_ntop.lo inet_ntop.o: $(srcdir)/compat/inet_ntop.c config.h
|
||||
inet_pton.lo inet_pton.o: $(srcdir)/compat/inet_pton.c config.h
|
||||
malloc.lo malloc.o: $(srcdir)/compat/malloc.c config.h
|
||||
memcmp.lo memcmp.o: $(srcdir)/compat/memcmp.c config.h
|
||||
memmove.lo memmove.o: $(srcdir)/compat/memmove.c config.h
|
||||
snprintf.lo snprintf.o: $(srcdir)/compat/snprintf.c config.h
|
||||
strlcpy.lo strlcpy.o: $(srcdir)/compat/strlcpy.c config.h
|
||||
strptime.lo strptime.o: $(srcdir)/compat/strptime.c config.h
|
||||
|
@ -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.
|
||||
@ -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 */
|
||||
])
|
||||
|
@ -1,280 +0,0 @@
|
||||
##### http://autoconf-archive.cryp.to/acx_pthread.html
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# This macro figures out how to build C programs using POSIX threads.
|
||||
# It sets the PTHREAD_LIBS output variable to the threads library and
|
||||
# linker flags, and the PTHREAD_CFLAGS output variable to any special
|
||||
# C compiler flags that are needed. (The user can also force certain
|
||||
# compiler flags/libs to be tested by setting these environment
|
||||
# variables.)
|
||||
#
|
||||
# Also sets PTHREAD_CC to any special C compiler that is needed for
|
||||
# multi-threaded programs (defaults to the value of CC otherwise).
|
||||
# (This is necessary on AIX to use the special cc_r compiler alias.)
|
||||
#
|
||||
# NOTE: You are assumed to not only compile your program with these
|
||||
# flags, but also link it with them as well. e.g. you should link
|
||||
# with $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS
|
||||
# $LIBS
|
||||
#
|
||||
# If you are only building threads programs, you may wish to use
|
||||
# these variables in your default LIBS, CFLAGS, and CC:
|
||||
#
|
||||
# LIBS="$PTHREAD_LIBS $LIBS"
|
||||
# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
# CC="$PTHREAD_CC"
|
||||
#
|
||||
# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute
|
||||
# constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to
|
||||
# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
|
||||
#
|
||||
# ACTION-IF-FOUND is a list of shell commands to run if a threads
|
||||
# library is found, and ACTION-IF-NOT-FOUND is a list of commands to
|
||||
# run it if it is not found. If ACTION-IF-FOUND is not specified, the
|
||||
# default action will define HAVE_PTHREAD.
|
||||
#
|
||||
# Please let the authors know if this macro fails on any platform, or
|
||||
# if you have any other suggestions or comments. This macro was based
|
||||
# on work by SGJ on autoconf scripts for FFTW (http://www.fftw.org/)
|
||||
# (with help from M. Frigo), as well as ac_pthread and hb_pthread
|
||||
# macros posted by Alejandro Forero Cuervo to the autoconf macro
|
||||
# repository. We are also grateful for the helpful feedback of
|
||||
# numerous users.
|
||||
#
|
||||
# LAST MODIFICATION
|
||||
#
|
||||
# 2006-05-29
|
||||
#
|
||||
# COPYLEFT
|
||||
#
|
||||
# Copyright (c) 2006 Steven G. Johnson <stevenj@alum.mit.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 2 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
# 02111-1307, USA.
|
||||
#
|
||||
# As a special exception, 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 Macro 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.
|
||||
|
||||
AC_DEFUN([ACX_PTHREAD], [
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_C
|
||||
acx_pthread_ok=no
|
||||
|
||||
# We used to check for pthread.h first, but this fails if pthread.h
|
||||
# requires special compiler flags (e.g. on True64 or Sequent).
|
||||
# It gets checked for in the link test anyway.
|
||||
|
||||
# First of all, check if the user has set any of the PTHREAD_LIBS,
|
||||
# etcetera environment variables, and if threads linking works using
|
||||
# them:
|
||||
if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
|
||||
AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
|
||||
AC_MSG_RESULT($acx_pthread_ok)
|
||||
if test x"$acx_pthread_ok" = xno; then
|
||||
PTHREAD_LIBS=""
|
||||
PTHREAD_CFLAGS=""
|
||||
fi
|
||||
LIBS="$save_LIBS"
|
||||
CFLAGS="$save_CFLAGS"
|
||||
fi
|
||||
|
||||
# We must check for the threads library under a number of different
|
||||
# names; the ordering is very important because some systems
|
||||
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
|
||||
# libraries is broken (non-POSIX).
|
||||
|
||||
# Create a list of thread flags to try. Items starting with a "-" are
|
||||
# C compiler flags, and other items are library names, except for "none"
|
||||
# which indicates that we try without any flags at all, and "pthread-config"
|
||||
# which is a program returning the flags for the Pth emulation library.
|
||||
|
||||
acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
|
||||
|
||||
# The ordering *is* (sometimes) important. Some notes on the
|
||||
# individual items follow:
|
||||
|
||||
# pthreads: AIX (must check this before -lpthread)
|
||||
# none: in case threads are in libc; should be tried before -Kthread and
|
||||
# other compiler flags to prevent continual compiler warnings
|
||||
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
|
||||
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
|
||||
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
|
||||
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
|
||||
# -pthreads: Solaris/gcc
|
||||
# -mthreads: Mingw32/gcc, Lynx/gcc
|
||||
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
|
||||
# doesn't hurt to check since this sometimes defines pthreads too;
|
||||
# also defines -D_REENTRANT)
|
||||
# ... -mt is also the pthreads flag for HP/aCC
|
||||
# pthread: Linux, etcetera
|
||||
# --thread-safe: KAI C++
|
||||
# pthread-config: use pthread-config program (for GNU Pth library)
|
||||
|
||||
case "${host_cpu}-${host_os}" in
|
||||
*solaris*)
|
||||
|
||||
# On Solaris (at least, for some versions), libc contains stubbed
|
||||
# (non-functional) versions of the pthreads routines, so link-based
|
||||
# tests will erroneously succeed. (We need to link with -pthreads/-mt/
|
||||
# -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
|
||||
# a function called by this macro, so we could check for that, but
|
||||
# who knows whether they'll stub that too in a future libc.) So,
|
||||
# we'll just look for -pthreads and -lpthread first:
|
||||
|
||||
acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags"
|
||||
;;
|
||||
esac
|
||||
|
||||
if test x"$acx_pthread_ok" = xno; then
|
||||
for flag in $acx_pthread_flags; do
|
||||
|
||||
case $flag in
|
||||
none)
|
||||
AC_MSG_CHECKING([whether pthreads work without any flags])
|
||||
;;
|
||||
|
||||
-*)
|
||||
AC_MSG_CHECKING([whether pthreads work with $flag])
|
||||
PTHREAD_CFLAGS="$flag"
|
||||
;;
|
||||
|
||||
pthread-config)
|
||||
AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no)
|
||||
if test x"$acx_pthread_config" = xno; then continue; fi
|
||||
PTHREAD_CFLAGS="`pthread-config --cflags`"
|
||||
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
|
||||
;;
|
||||
|
||||
*)
|
||||
AC_MSG_CHECKING([for the pthreads library -l$flag])
|
||||
PTHREAD_LIBS="-l$flag"
|
||||
;;
|
||||
esac
|
||||
|
||||
save_LIBS="$LIBS"
|
||||
save_CFLAGS="$CFLAGS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
|
||||
# Check for various functions. We must include pthread.h,
|
||||
# since some functions may be macros. (On the Sequent, we
|
||||
# need a special flag -Kthread to make this header compile.)
|
||||
# We check for pthread_join because it is in -lpthread on IRIX
|
||||
# while pthread_create is in libc. We check for pthread_attr_init
|
||||
# due to DEC craziness with -lpthreads. We check for
|
||||
# pthread_cleanup_push because it is one of the few pthread
|
||||
# functions on Solaris that doesn't have a non-functional libc stub.
|
||||
# We try pthread_create on general principles.
|
||||
AC_TRY_LINK([#include <pthread.h>],
|
||||
[pthread_t th; pthread_join(th, 0);
|
||||
pthread_attr_init(0); pthread_cleanup_push(0, 0);
|
||||
pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
|
||||
[acx_pthread_ok=yes])
|
||||
|
||||
LIBS="$save_LIBS"
|
||||
CFLAGS="$save_CFLAGS"
|
||||
|
||||
AC_MSG_RESULT($acx_pthread_ok)
|
||||
if test "x$acx_pthread_ok" = xyes; then
|
||||
break;
|
||||
fi
|
||||
|
||||
PTHREAD_LIBS=""
|
||||
PTHREAD_CFLAGS=""
|
||||
done
|
||||
fi
|
||||
|
||||
# Various other checks:
|
||||
if test "x$acx_pthread_ok" = xyes; then
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
|
||||
# Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
|
||||
AC_MSG_CHECKING([for joinable pthread attribute])
|
||||
attr_name=unknown
|
||||
for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
|
||||
AC_TRY_LINK([#include <pthread.h>], [int attr=$attr; return attr;],
|
||||
[attr_name=$attr; break])
|
||||
done
|
||||
AC_MSG_RESULT($attr_name)
|
||||
if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
|
||||
AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
|
||||
[Define to necessary symbol if this constant
|
||||
uses a non-standard name on your system.])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([if more special flags are required for pthreads])
|
||||
flag=no
|
||||
case "${host_cpu}-${host_os}" in
|
||||
*-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
|
||||
*solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
|
||||
esac
|
||||
AC_MSG_RESULT(${flag})
|
||||
if test "x$flag" != xno; then
|
||||
PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
|
||||
fi
|
||||
|
||||
LIBS="$save_LIBS"
|
||||
CFLAGS="$save_CFLAGS"
|
||||
|
||||
# More AIX lossage: must compile with xlc_r or cc_r
|
||||
if test x"$GCC" != xyes; then
|
||||
AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
|
||||
else
|
||||
PTHREAD_CC=$CC
|
||||
fi
|
||||
else
|
||||
PTHREAD_CC="$CC"
|
||||
fi
|
||||
|
||||
AC_SUBST(PTHREAD_LIBS)
|
||||
AC_SUBST(PTHREAD_CFLAGS)
|
||||
AC_SUBST(PTHREAD_CC)
|
||||
|
||||
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
|
||||
if test x"$acx_pthread_ok" = xyes; then
|
||||
ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
|
||||
:
|
||||
else
|
||||
acx_pthread_ok=no
|
||||
$2
|
||||
fi
|
||||
AC_LANG_RESTORE
|
||||
])dnl ACX_PTHREAD
|
317
contrib/unbound/ax_pthread.m4
Normal file
317
contrib/unbound/ax_pthread.m4
Normal file
@ -0,0 +1,317 @@
|
||||
# ===========================================================================
|
||||
# http://www.gnu.org/software/autoconf-archive/ax_pthread.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# This macro figures out how to build C programs using POSIX threads. It
|
||||
# sets the PTHREAD_LIBS output variable to the threads library and linker
|
||||
# flags, and the PTHREAD_CFLAGS output variable to any special C compiler
|
||||
# flags that are needed. (The user can also force certain compiler
|
||||
# flags/libs to be tested by setting these environment variables.)
|
||||
#
|
||||
# Also sets PTHREAD_CC to any special C compiler that is needed for
|
||||
# multi-threaded programs (defaults to the value of CC otherwise). (This
|
||||
# is necessary on AIX to use the special cc_r compiler alias.)
|
||||
#
|
||||
# NOTE: You are assumed to not only compile your program with these flags,
|
||||
# but also link it with them as well. e.g. you should link with
|
||||
# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
|
||||
#
|
||||
# If you are only building threads programs, you may wish to use these
|
||||
# variables in your default LIBS, CFLAGS, and CC:
|
||||
#
|
||||
# LIBS="$PTHREAD_LIBS $LIBS"
|
||||
# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
# CC="$PTHREAD_CC"
|
||||
#
|
||||
# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
|
||||
# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name
|
||||
# (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
|
||||
#
|
||||
# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the
|
||||
# PTHREAD_PRIO_INHERIT symbol is defined when compiling with
|
||||
# PTHREAD_CFLAGS.
|
||||
#
|
||||
# ACTION-IF-FOUND is a list of shell commands to run if a threads library
|
||||
# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
|
||||
# is not found. If ACTION-IF-FOUND is not specified, the default action
|
||||
# will define HAVE_PTHREAD.
|
||||
#
|
||||
# Please let the authors know if this macro fails on any platform, or if
|
||||
# you have any other suggestions or comments. This macro was based on work
|
||||
# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help
|
||||
# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by
|
||||
# Alejandro Forero Cuervo to the autoconf macro repository. We are also
|
||||
# grateful for the helpful feedback of numerous users.
|
||||
#
|
||||
# Updated for Autoconf 2.68 by Daniel Richard G.
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
|
||||
# Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.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 20
|
||||
|
||||
AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
|
||||
AC_DEFUN([AX_PTHREAD], [
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_LANG_PUSH([C])
|
||||
ax_pthread_ok=no
|
||||
|
||||
# We used to check for pthread.h first, but this fails if pthread.h
|
||||
# requires special compiler flags (e.g. on True64 or Sequent).
|
||||
# It gets checked for in the link test anyway.
|
||||
|
||||
# First of all, check if the user has set any of the PTHREAD_LIBS,
|
||||
# etcetera environment variables, and if threads linking works using
|
||||
# them:
|
||||
if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
|
||||
AC_TRY_LINK_FUNC(pthread_join, ax_pthread_ok=yes)
|
||||
AC_MSG_RESULT($ax_pthread_ok)
|
||||
if test x"$ax_pthread_ok" = xno; then
|
||||
PTHREAD_LIBS=""
|
||||
PTHREAD_CFLAGS=""
|
||||
fi
|
||||
LIBS="$save_LIBS"
|
||||
CFLAGS="$save_CFLAGS"
|
||||
fi
|
||||
|
||||
# We must check for the threads library under a number of different
|
||||
# names; the ordering is very important because some systems
|
||||
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
|
||||
# libraries is broken (non-POSIX).
|
||||
|
||||
# Create a list of thread flags to try. Items starting with a "-" are
|
||||
# C compiler flags, and other items are library names, except for "none"
|
||||
# which indicates that we try without any flags at all, and "pthread-config"
|
||||
# which is a program returning the flags for the Pth emulation library.
|
||||
|
||||
ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
|
||||
|
||||
# The ordering *is* (sometimes) important. Some notes on the
|
||||
# individual items follow:
|
||||
|
||||
# pthreads: AIX (must check this before -lpthread)
|
||||
# none: in case threads are in libc; should be tried before -Kthread and
|
||||
# other compiler flags to prevent continual compiler warnings
|
||||
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
|
||||
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
|
||||
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
|
||||
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
|
||||
# -pthreads: Solaris/gcc
|
||||
# -mthreads: Mingw32/gcc, Lynx/gcc
|
||||
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
|
||||
# doesn't hurt to check since this sometimes defines pthreads too;
|
||||
# also defines -D_REENTRANT)
|
||||
# ... -mt is also the pthreads flag for HP/aCC
|
||||
# pthread: Linux, etcetera
|
||||
# --thread-safe: KAI C++
|
||||
# pthread-config: use pthread-config program (for GNU Pth library)
|
||||
|
||||
case ${host_os} in
|
||||
solaris*)
|
||||
|
||||
# On Solaris (at least, for some versions), libc contains stubbed
|
||||
# (non-functional) versions of the pthreads routines, so link-based
|
||||
# tests will erroneously succeed. (We need to link with -pthreads/-mt/
|
||||
# -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
|
||||
# a function called by this macro, so we could check for that, but
|
||||
# who knows whether they'll stub that too in a future libc.) So,
|
||||
# we'll just look for -pthreads and -lpthread first:
|
||||
|
||||
ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags"
|
||||
;;
|
||||
|
||||
darwin*)
|
||||
ax_pthread_flags="-pthread $ax_pthread_flags"
|
||||
;;
|
||||
esac
|
||||
|
||||
if test x"$ax_pthread_ok" = xno; then
|
||||
for flag in $ax_pthread_flags; do
|
||||
|
||||
case $flag in
|
||||
none)
|
||||
AC_MSG_CHECKING([whether pthreads work without any flags])
|
||||
;;
|
||||
|
||||
-*)
|
||||
AC_MSG_CHECKING([whether pthreads work with $flag])
|
||||
PTHREAD_CFLAGS="$flag"
|
||||
;;
|
||||
|
||||
pthread-config)
|
||||
AC_CHECK_PROG(ax_pthread_config, pthread-config, yes, no)
|
||||
if test x"$ax_pthread_config" = xno; then continue; fi
|
||||
PTHREAD_CFLAGS="`pthread-config --cflags`"
|
||||
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
|
||||
;;
|
||||
|
||||
*)
|
||||
AC_MSG_CHECKING([for the pthreads library -l$flag])
|
||||
PTHREAD_LIBS="-l$flag"
|
||||
;;
|
||||
esac
|
||||
|
||||
save_LIBS="$LIBS"
|
||||
save_CFLAGS="$CFLAGS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
|
||||
# Check for various functions. We must include pthread.h,
|
||||
# since some functions may be macros. (On the Sequent, we
|
||||
# need a special flag -Kthread to make this header compile.)
|
||||
# We check for pthread_join because it is in -lpthread on IRIX
|
||||
# while pthread_create is in libc. We check for pthread_attr_init
|
||||
# due to DEC craziness with -lpthreads. We check for
|
||||
# pthread_cleanup_push because it is one of the few pthread
|
||||
# functions on Solaris that doesn't have a non-functional libc stub.
|
||||
# We try pthread_create on general principles.
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>
|
||||
static void routine(void *a) { *((int*)a) = 0; }
|
||||
static void *start_routine(void *a) { return a; }],
|
||||
[pthread_t th; pthread_attr_t attr;
|
||||
pthread_create(&th, 0, start_routine, 0);
|
||||
pthread_join(th, 0);
|
||||
pthread_attr_init(&attr);
|
||||
pthread_cleanup_push(routine, 0);
|
||||
pthread_cleanup_pop(0) /* ; */])],
|
||||
[ax_pthread_ok=yes],
|
||||
[])
|
||||
|
||||
LIBS="$save_LIBS"
|
||||
CFLAGS="$save_CFLAGS"
|
||||
|
||||
AC_MSG_RESULT($ax_pthread_ok)
|
||||
if test "x$ax_pthread_ok" = xyes; then
|
||||
break;
|
||||
fi
|
||||
|
||||
PTHREAD_LIBS=""
|
||||
PTHREAD_CFLAGS=""
|
||||
done
|
||||
fi
|
||||
|
||||
# Various other checks:
|
||||
if test "x$ax_pthread_ok" = xyes; then
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
|
||||
# Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
|
||||
AC_MSG_CHECKING([for joinable pthread attribute])
|
||||
attr_name=unknown
|
||||
for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
|
||||
[int attr = $attr; return attr /* ; */])],
|
||||
[attr_name=$attr; break],
|
||||
[])
|
||||
done
|
||||
AC_MSG_RESULT($attr_name)
|
||||
if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
|
||||
AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
|
||||
[Define to necessary symbol if this constant
|
||||
uses a non-standard name on your system.])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([if more special flags are required for pthreads])
|
||||
flag=no
|
||||
case ${host_os} in
|
||||
aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";;
|
||||
osf* | hpux*) flag="-D_REENTRANT";;
|
||||
solaris*)
|
||||
if test "$GCC" = "yes"; then
|
||||
flag="-D_REENTRANT"
|
||||
else
|
||||
flag="-mt -D_REENTRANT"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
AC_MSG_RESULT(${flag})
|
||||
if test "x$flag" != xno; then
|
||||
PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
|
||||
ax_cv_PTHREAD_PRIO_INHERIT, [
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_PROGRAM([[#include <pthread.h>]], [[int i = PTHREAD_PRIO_INHERIT;]])],
|
||||
[ax_cv_PTHREAD_PRIO_INHERIT=yes],
|
||||
[ax_cv_PTHREAD_PRIO_INHERIT=no])
|
||||
])
|
||||
AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"],
|
||||
AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], 1, [Have PTHREAD_PRIO_INHERIT.]))
|
||||
|
||||
LIBS="$save_LIBS"
|
||||
CFLAGS="$save_CFLAGS"
|
||||
|
||||
# More AIX lossage: compile with *_r variant
|
||||
if test "x$GCC" != xyes; then
|
||||
case $host_os in
|
||||
aix*)
|
||||
AS_CASE(["x/$CC"],
|
||||
[x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6],
|
||||
[#handle absolute path differently from PATH based program lookup
|
||||
AS_CASE(["x$CC"],
|
||||
[x/*],
|
||||
[AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])],
|
||||
[AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])])
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
|
||||
test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
|
||||
|
||||
AC_SUBST(PTHREAD_LIBS)
|
||||
AC_SUBST(PTHREAD_CFLAGS)
|
||||
AC_SUBST(PTHREAD_CC)
|
||||
|
||||
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
|
||||
if test x"$ax_pthread_ok" = xyes; then
|
||||
ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
|
||||
:
|
||||
else
|
||||
ax_pthread_ok=no
|
||||
$2
|
||||
fi
|
||||
AC_LANG_POP
|
||||
])dnl AX_PTHREAD
|
File diff suppressed because it is too large
Load Diff
73
contrib/unbound/compat/strlcat.c
Normal file
73
contrib/unbound/compat/strlcat.c
Normal file
@ -0,0 +1,73 @@
|
||||
/* compat/strlcat.c */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED ``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 AUTHOR 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.
|
||||
*/
|
||||
|
||||
/* OPENBSD ORIGINAL: lib/libc/string/strlcat.c */
|
||||
|
||||
#include "config.h"
|
||||
#ifndef HAVE_STRLCAT
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <string.h>
|
||||
|
||||
/*
|
||||
* Appends src to string dst of size siz (unlike strncat, siz is the
|
||||
* full size of dst, not space left). At most siz-1 characters
|
||||
* will be copied. Always NUL terminates (unless siz <= strlen(dst)).
|
||||
* Returns strlen(src) + MIN(siz, strlen(initial dst)).
|
||||
* If retval >= siz, truncation occurred.
|
||||
*/
|
||||
size_t
|
||||
strlcat(char *dst, const char *src, size_t siz)
|
||||
{
|
||||
char *d = dst;
|
||||
const char *s = src;
|
||||
size_t n = siz;
|
||||
size_t dlen;
|
||||
|
||||
/* Find the end of dst and adjust bytes left but don't go past end */
|
||||
while (n-- != 0 && *d != '\0')
|
||||
d++;
|
||||
dlen = d - dst;
|
||||
n = siz - dlen;
|
||||
|
||||
if (n == 0)
|
||||
return(dlen + strlen(s));
|
||||
while (*s != '\0') {
|
||||
if (n != 1) {
|
||||
*d++ = *s;
|
||||
n--;
|
||||
}
|
||||
s++;
|
||||
}
|
||||
*d = '\0';
|
||||
|
||||
return(dlen + (s - src)); /* count does not include NUL */
|
||||
}
|
||||
|
||||
#endif /* !HAVE_STRLCAT */
|
@ -62,6 +62,12 @@
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#define HAVE_DLFCN_H 1
|
||||
|
||||
/* Define to 1 if you have the `endprotoent' function. */
|
||||
#define HAVE_ENDPROTOENT 1
|
||||
|
||||
/* Define to 1 if you have the `endservent' function. */
|
||||
#define HAVE_ENDSERVENT 1
|
||||
|
||||
/* Define to 1 if you have the `event_base_free' function. */
|
||||
/* #undef HAVE_EVENT_BASE_FREE */
|
||||
|
||||
@ -158,15 +164,6 @@
|
||||
/* Define to 1 if you have the `kill' function. */
|
||||
#define HAVE_KILL 1
|
||||
|
||||
/* Define to 1 if you have the `ldns_key_EVP_unload_gost' function. */
|
||||
/* #undef HAVE_LDNS_KEY_EVP_UNLOAD_GOST */
|
||||
|
||||
/* Define to 1 if you have the <ldns/ldns.h> header file. */
|
||||
#define HAVE_LDNS_LDNS_H 1
|
||||
|
||||
/* Define to 1 if you have the `ldns' library (-lldns). */
|
||||
#define HAVE_LIBLDNS 1
|
||||
|
||||
/* Define to 1 if you have the `localtime_r' function. */
|
||||
#define HAVE_LOCALTIME_R 1
|
||||
|
||||
@ -212,6 +209,9 @@
|
||||
/* Define if you have POSIX threads libraries and header files. */
|
||||
#define HAVE_PTHREAD 1
|
||||
|
||||
/* Have PTHREAD_PRIO_INHERIT. */
|
||||
#define HAVE_PTHREAD_PRIO_INHERIT 1
|
||||
|
||||
/* Define to 1 if the system has the type `pthread_rwlock_t'. */
|
||||
#define HAVE_PTHREAD_RWLOCK_T 1
|
||||
|
||||
@ -231,7 +231,7 @@
|
||||
#define HAVE_RECVMSG 1
|
||||
|
||||
/* Define to 1 if you have the `sbrk' function. */
|
||||
#define HAVE_SBRK 1
|
||||
/* #undef HAVE_SBRK */
|
||||
|
||||
/* Define to 1 if you have the `sendmsg' function. */
|
||||
#define HAVE_SENDMSG 1
|
||||
@ -299,6 +299,9 @@
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* Define to 1 if you have the `strlcat' function. */
|
||||
#define HAVE_STRLCAT 1
|
||||
|
||||
/* Define to 1 if you have the `strlcpy' function. */
|
||||
#define HAVE_STRLCPY 1
|
||||
|
||||
@ -428,7 +431,7 @@
|
||||
#define PACKAGE_NAME "unbound"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "unbound 1.4.20"
|
||||
#define PACKAGE_STRING "unbound 1.4.22"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "unbound"
|
||||
@ -437,7 +440,7 @@
|
||||
#define PACKAGE_URL ""
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "1.4.20"
|
||||
#define PACKAGE_VERSION "1.4.22"
|
||||
|
||||
/* default pidfile location */
|
||||
#define PIDFILE "/var/unbound/unbound.pid"
|
||||
@ -456,7 +459,7 @@
|
||||
#define ROOT_CERT_FILE "/var/unbound/icannbundle.pem"
|
||||
|
||||
/* version number for resource files */
|
||||
#define RSRC_PACKAGE_VERSION 1,4,2,0
|
||||
#define RSRC_PACKAGE_VERSION 1,4,22,0
|
||||
|
||||
/* Directory to chdir to */
|
||||
#define RUN_DIR "/var/unbound"
|
||||
@ -464,6 +467,9 @@
|
||||
/* Shared data */
|
||||
#define SHARE_DIR "/var/unbound"
|
||||
|
||||
/* The size of `time_t', as computed by sizeof. */
|
||||
#define SIZEOF_TIME_T 8
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
@ -558,6 +564,9 @@
|
||||
/* Define to 1 if on MINIX. */
|
||||
/* #undef _MINIX */
|
||||
|
||||
/* Enable for compile on Minix */
|
||||
/* #undef _NETBSD_SOURCE */
|
||||
|
||||
/* Define to 2 if the system does not provide POSIX.1 features except with
|
||||
this defined. */
|
||||
/* #undef _POSIX_1_SOURCE */
|
||||
@ -676,6 +685,12 @@
|
||||
# define NDEBUG
|
||||
#endif
|
||||
|
||||
/** Use small-ldns codebase */
|
||||
#define USE_SLDNS 1
|
||||
#ifdef HAVE_SSL
|
||||
# define LDNS_BUILD_CONFIG_HAVE_SSL 1
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
@ -686,6 +701,10 @@
|
||||
#include <stddef.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDARG_H
|
||||
#include <stdarg.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDINT_H
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
@ -720,6 +739,12 @@
|
||||
#include <ws2tcpip.h>
|
||||
#endif
|
||||
|
||||
#ifndef USE_WINSOCK
|
||||
#define ARG_LL "%ll"
|
||||
#else
|
||||
#define ARG_LL "%I64"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifdef HAVE_ATTR_FORMAT
|
||||
@ -785,6 +810,12 @@ void *memmove(void *dest, const void *src, size_t n);
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAVE_STRLCAT
|
||||
#define strlcat strlcat_unbound
|
||||
size_t strlcat(char *dst, const char *src, size_t siz);
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAVE_STRLCPY
|
||||
#define strlcpy strlcpy_unbound
|
||||
size_t strlcpy(char *dst, const char *src, size_t siz);
|
||||
@ -797,7 +828,7 @@ struct tm *gmtime_r(const time_t *timep, struct tm *result);
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAVE_SLEEP
|
||||
#if !defined(HAVE_SLEEP) || defined(HAVE_WINDOWS_H)
|
||||
#define sleep(x) Sleep((x)*1000) /* on win32 */
|
||||
#endif /* HAVE_SLEEP */
|
||||
|
||||
@ -863,8 +894,6 @@ char *strptime(const char *s, const char *format, struct tm *tm);
|
||||
# endif
|
||||
#endif /* CHECKED_INET6 */
|
||||
|
||||
/* maximum nesting of included files */
|
||||
#define MAXINCLUDES 10
|
||||
#ifndef HAVE_GETADDRINFO
|
||||
struct sockaddr_storage;
|
||||
#include "compat/fake-rfc2553.h"
|
||||
|
@ -61,6 +61,12 @@
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
/* Define to 1 if you have the `endprotoent' function. */
|
||||
#undef HAVE_ENDPROTOENT
|
||||
|
||||
/* Define to 1 if you have the `endservent' function. */
|
||||
#undef HAVE_ENDSERVENT
|
||||
|
||||
/* Define to 1 if you have the `event_base_free' function. */
|
||||
#undef HAVE_EVENT_BASE_FREE
|
||||
|
||||
@ -157,15 +163,6 @@
|
||||
/* Define to 1 if you have the `kill' function. */
|
||||
#undef HAVE_KILL
|
||||
|
||||
/* Define to 1 if you have the `ldns_key_EVP_unload_gost' function. */
|
||||
#undef HAVE_LDNS_KEY_EVP_UNLOAD_GOST
|
||||
|
||||
/* Define to 1 if you have the <ldns/ldns.h> header file. */
|
||||
#undef HAVE_LDNS_LDNS_H
|
||||
|
||||
/* Define to 1 if you have the `ldns' library (-lldns). */
|
||||
#undef HAVE_LIBLDNS
|
||||
|
||||
/* Define to 1 if you have the `localtime_r' function. */
|
||||
#undef HAVE_LOCALTIME_R
|
||||
|
||||
@ -211,6 +208,9 @@
|
||||
/* Define if you have POSIX threads libraries and header files. */
|
||||
#undef HAVE_PTHREAD
|
||||
|
||||
/* Have PTHREAD_PRIO_INHERIT. */
|
||||
#undef HAVE_PTHREAD_PRIO_INHERIT
|
||||
|
||||
/* Define to 1 if the system has the type `pthread_rwlock_t'. */
|
||||
#undef HAVE_PTHREAD_RWLOCK_T
|
||||
|
||||
@ -298,6 +298,9 @@
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define to 1 if you have the `strlcat' function. */
|
||||
#undef HAVE_STRLCAT
|
||||
|
||||
/* Define to 1 if you have the `strlcpy' function. */
|
||||
#undef HAVE_STRLCPY
|
||||
|
||||
@ -463,6 +466,9 @@
|
||||
/* Shared data */
|
||||
#undef SHARE_DIR
|
||||
|
||||
/* 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
|
||||
|
||||
@ -557,6 +563,9 @@
|
||||
/* Define to 1 if on MINIX. */
|
||||
#undef _MINIX
|
||||
|
||||
/* Enable for compile on Minix */
|
||||
#undef _NETBSD_SOURCE
|
||||
|
||||
/* Define to 2 if the system does not provide POSIX.1 features except with
|
||||
this defined. */
|
||||
#undef _POSIX_1_SOURCE
|
||||
@ -675,6 +684,12 @@
|
||||
# define NDEBUG
|
||||
#endif
|
||||
|
||||
/** Use small-ldns codebase */
|
||||
#define USE_SLDNS 1
|
||||
#ifdef HAVE_SSL
|
||||
# define LDNS_BUILD_CONFIG_HAVE_SSL 1
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
@ -685,6 +700,10 @@
|
||||
#include <stddef.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDARG_H
|
||||
#include <stdarg.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDINT_H
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
@ -719,6 +738,12 @@
|
||||
#include <ws2tcpip.h>
|
||||
#endif
|
||||
|
||||
#ifndef USE_WINSOCK
|
||||
#define ARG_LL "%ll"
|
||||
#else
|
||||
#define ARG_LL "%I64"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifdef HAVE_ATTR_FORMAT
|
||||
@ -784,6 +809,12 @@ void *memmove(void *dest, const void *src, size_t n);
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAVE_STRLCAT
|
||||
#define strlcat strlcat_unbound
|
||||
size_t strlcat(char *dst, const char *src, size_t siz);
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAVE_STRLCPY
|
||||
#define strlcpy strlcpy_unbound
|
||||
size_t strlcpy(char *dst, const char *src, size_t siz);
|
||||
@ -796,7 +827,7 @@ struct tm *gmtime_r(const time_t *timep, struct tm *result);
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAVE_SLEEP
|
||||
#if !defined(HAVE_SLEEP) || defined(HAVE_WINDOWS_H)
|
||||
#define sleep(x) Sleep((x)*1000) /* on win32 */
|
||||
#endif /* HAVE_SLEEP */
|
||||
|
||||
@ -862,8 +893,6 @@ char *strptime(const char *s, const char *format, struct tm *tm);
|
||||
# endif
|
||||
#endif /* CHECKED_INET6 */
|
||||
|
||||
/* maximum nesting of included files */
|
||||
#define MAXINCLUDES 10
|
||||
#ifndef HAVE_GETADDRINFO
|
||||
struct sockaddr_storage;
|
||||
#include "compat/fake-rfc2553.h"
|
||||
|
762
contrib/unbound/configure
vendored
762
contrib/unbound/configure
vendored
File diff suppressed because it is too large
Load Diff
@ -2,15 +2,22 @@
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
AC_PREREQ(2.56)
|
||||
sinclude(acx_nlnetlabs.m4)
|
||||
sinclude(acx_pthread.m4)
|
||||
sinclude(ax_pthread.m4)
|
||||
sinclude(acx_python.m4)
|
||||
sinclude(ac_pkg_swig.m4)
|
||||
|
||||
AC_INIT(unbound, 1.4.20, unbound-bugs@nlnetlabs.nl, unbound)
|
||||
# must be numbers. ac_defun because of later processing
|
||||
m4_define([VERSION_MAJOR],[1])
|
||||
m4_define([VERSION_MINOR],[4])
|
||||
m4_define([VERSION_MICRO],[22])
|
||||
AC_INIT(unbound, m4_defn([VERSION_MAJOR]).m4_defn([VERSION_MINOR]).m4_defn([VERSION_MICRO]), unbound-bugs@nlnetlabs.nl, unbound)
|
||||
AC_SUBST(UNBOUND_VERSION_MAJOR, [VERSION_MAJOR])
|
||||
AC_SUBST(UNBOUND_VERSION_MINOR, [VERSION_MINOR])
|
||||
AC_SUBST(UNBOUND_VERSION_MICRO, [VERSION_MICRO])
|
||||
|
||||
LIBUNBOUND_CURRENT=3
|
||||
LIBUNBOUND_REVISION=5
|
||||
LIBUNBOUND_AGE=1
|
||||
LIBUNBOUND_CURRENT=4
|
||||
LIBUNBOUND_REVISION=1
|
||||
LIBUNBOUND_AGE=2
|
||||
# 1.0.0 had 0:12:0
|
||||
# 1.0.1 had 0:13:0
|
||||
# 1.0.2 had 0:14:0
|
||||
@ -45,7 +52,8 @@ LIBUNBOUND_AGE=1
|
||||
# 1.4.17 had 3:2:1
|
||||
# 1.4.18 had 3:3:1
|
||||
# 1.4.19 had 3:4:1
|
||||
# 1.4.20 had 4:0:2 # adds libunbound.ttl
|
||||
# 1.4.20 had 4:0:2 # adds libunbound.ttl # but shipped 3:5:1
|
||||
# 1.4.21 had 4:1:2
|
||||
|
||||
# Current -- the number of the binary API that we're implementing
|
||||
# Revision -- which iteration of the implementation of the binary
|
||||
@ -71,6 +79,9 @@ AC_SUBST(LIBUNBOUND_AGE)
|
||||
|
||||
CFLAGS="$CFLAGS"
|
||||
AC_AIX
|
||||
if test "$ac_cv_header_minix_config_h" = "yes"; then
|
||||
AC_DEFINE(_NETBSD_SOURCE,1, [Enable for compile on Minix])
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl By default set prefix to /usr/local
|
||||
@ -275,6 +286,20 @@ ACX_TYPE_IN_ADDR_T
|
||||
ACX_TYPE_IN_PORT_T
|
||||
ACX_CHECK_MEMCMP_SIGNED
|
||||
|
||||
AC_CHECK_SIZEOF(time_t,,[
|
||||
AC_INCLUDES_DEFAULT
|
||||
#ifdef TIME_WITH_SYS_TIME
|
||||
# include <sys/time.h>
|
||||
# include <time.h>
|
||||
#else
|
||||
# ifdef HAVE_SYS_TIME_H
|
||||
# include <sys/time.h>
|
||||
# else
|
||||
# include <time.h>
|
||||
# endif
|
||||
#endif
|
||||
])
|
||||
|
||||
# add option to disable the evil rpath
|
||||
ACX_ARG_RPATH
|
||||
AC_SUBST(RUNTIME_PATH)
|
||||
@ -371,7 +396,7 @@ AC_ARG_WITH(pthreads, AC_HELP_STRING([--with-pthreads],
|
||||
[ ],[ withval="yes" ])
|
||||
ub_have_pthreads=no
|
||||
if test x_$withval != x_no; then
|
||||
ACX_PTHREAD([
|
||||
AX_PTHREAD([
|
||||
AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.])
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
@ -579,7 +604,7 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/engine.h>
|
||||
#include <openssl/conf.h>
|
||||
/* routine to load gost from ldns */
|
||||
/* routine to load gost (from sldns) */
|
||||
int load_gost_id(void)
|
||||
{
|
||||
static int gost_id = 0;
|
||||
@ -707,6 +732,16 @@ case "$enable_ecdsa" in
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_ARG_ENABLE(event-api, AC_HELP_STRING([--enable-event-api], [Enable (experimental) libevent-based libunbound API installed to unbound-event.h]))
|
||||
use_unbound_event="no"
|
||||
case "$enable_event_api" in
|
||||
yes)
|
||||
use_unbound_event="yes"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
# check for libevent
|
||||
AC_ARG_WITH(libevent, AC_HELP_STRING([--with-libevent=pathname],
|
||||
[use libevent (will check /usr/local /opt/local /usr/lib /usr/pkg /usr/sfw /usr or you can specify an explicit path). Slower, but allows use of large outgoing port ranges.]),
|
||||
@ -718,7 +753,7 @@ if test x_$withval = x_yes -o x_$withval != x_no; then
|
||||
fi
|
||||
for dir in $withval; do
|
||||
thedir="$dir"
|
||||
if test -f "$dir/include/event.h"; then
|
||||
if test -f "$dir/include/event.h" -o -f "$dir/include/event2/event.h"; then
|
||||
found_libevent="yes"
|
||||
dnl assume /usr is in default path.
|
||||
if test "$thedir" != "/usr"; then
|
||||
@ -754,10 +789,16 @@ large outgoing port ranges. ])
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT(found in $thedir)
|
||||
dnl assume /usr is in default path, do not add "".
|
||||
if test "$thedir" != "/usr" -a "$thedir" != ""; then
|
||||
LDFLAGS="$LDFLAGS -L$thedir/lib"
|
||||
ACX_RUNTIME_PATH_ADD([$thedir/lib])
|
||||
dnl if event2 exists and no event lib in dir itself, use subdir
|
||||
if test ! -f $thedir/lib/libevent.a -a ! -f $thedir/lib/libevent.so -a -d "$thedir/lib/event2"; then
|
||||
LDFLAGS="$LDFLAGS -L$thedir/lib/event2"
|
||||
ACX_RUNTIME_PATH_ADD([$thedir/lib/event2])
|
||||
else
|
||||
dnl assume /usr is in default path, do not add "".
|
||||
if test "$thedir" != "/usr" -a "$thedir" != ""; then
|
||||
LDFLAGS="$LDFLAGS -L$thedir/lib"
|
||||
ACX_RUNTIME_PATH_ADD([$thedir/lib])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
# check for library used by libevent after 1.3c
|
||||
@ -781,6 +822,10 @@ large outgoing port ranges. ])
|
||||
if test -n "$BAK_LDFLAGS_SET"; then
|
||||
LDFLAGS="$BAK_LDFLAGS"
|
||||
fi
|
||||
if test "$use_unbound_event" = "yes"; then
|
||||
AC_SUBST(UNBOUND_EVENT_INSTALL, [unbound-event-install])
|
||||
AC_SUBST(UNBOUND_EVENT_UNINSTALL, [unbound-event-uninstall])
|
||||
fi
|
||||
else
|
||||
AC_DEFINE(USE_MINI_EVENT, 1, [Define if you want to use internal select based events])
|
||||
fi
|
||||
@ -812,7 +857,7 @@ AC_CHECK_HEADERS([expat.h],,, [AC_INCLUDES_DEFAULT])
|
||||
AC_SUBST(staticexe)
|
||||
staticexe=""
|
||||
AC_ARG_ENABLE(static-exe, AC_HELP_STRING([--enable-static-exe],
|
||||
[ enable to compile executables statically against event, ldns libs, for debug purposes ]),
|
||||
[ enable to compile executables statically against (event) libs, for debug purposes ]),
|
||||
, )
|
||||
if test x_$enable_static_exe = x_yes; then
|
||||
staticexe="-static"
|
||||
@ -905,7 +950,7 @@ AC_INCLUDES_DEFAULT
|
||||
#endif
|
||||
])
|
||||
AC_SEARCH_LIBS([setusercontext], [util])
|
||||
AC_CHECK_FUNCS([tzset sigprocmask fcntl getpwnam getrlimit setrlimit setsid sbrk chroot kill sleep usleep random srandom recvmsg sendmsg writev socketpair glob initgroups strftime localtime_r setusercontext _beginthreadex])
|
||||
AC_CHECK_FUNCS([tzset sigprocmask fcntl getpwnam getrlimit setrlimit setsid sbrk chroot kill sleep usleep random srandom recvmsg sendmsg writev socketpair glob initgroups strftime localtime_r setusercontext _beginthreadex endservent endprotoent])
|
||||
AC_CHECK_FUNCS([setresuid],,[AC_CHECK_FUNCS([setreuid])])
|
||||
AC_CHECK_FUNCS([setresgid],,[AC_CHECK_FUNCS([setregid])])
|
||||
|
||||
@ -917,6 +962,7 @@ AC_REPLACE_FUNCS(inet_aton)
|
||||
AC_REPLACE_FUNCS(inet_pton)
|
||||
AC_REPLACE_FUNCS(inet_ntop)
|
||||
AC_REPLACE_FUNCS(snprintf)
|
||||
AC_REPLACE_FUNCS(strlcat)
|
||||
AC_REPLACE_FUNCS(strlcpy)
|
||||
AC_REPLACE_FUNCS(memmove)
|
||||
AC_REPLACE_FUNCS(gmtime_r)
|
||||
@ -993,100 +1039,17 @@ AC_SUBST(SOURCEFILE)
|
||||
|
||||
# see if we want to build the library or everything
|
||||
ALLTARGET="alltargets"
|
||||
INSTALLTARGET="install-all"
|
||||
AC_ARG_WITH(libunbound-only, AC_HELP_STRING([--with-libunbound-only],
|
||||
[do not build daemon and tool programs]),
|
||||
[
|
||||
if test "$withval" = "yes"; then
|
||||
ALLTARGET="lib"
|
||||
INSTALLTARGET="install-lib"
|
||||
fi
|
||||
])
|
||||
AC_SUBST(ALLTARGET)
|
||||
|
||||
# check this after all other compilation checks, since the linking of the lib
|
||||
# may break checks after this.
|
||||
AC_ARG_WITH(ldns, AC_HELP_STRING([--with-ldns=PATH],
|
||||
[specify prefix of path of ldns library to use]),
|
||||
[
|
||||
if test "$withval" != "yes"; then
|
||||
if test "$withval" != "/usr" -a "$withval" != ""; then
|
||||
CPPFLAGS="-I$withval/include $CPPFLAGS"
|
||||
LDFLAGS="-L$withval/lib $LDFLAGS"
|
||||
ACX_RUNTIME_PATH_ADD([$withval/lib])
|
||||
fi
|
||||
ldnsdir="$withval"
|
||||
AC_SUBST(ldnsdir)
|
||||
fi
|
||||
])
|
||||
|
||||
# check if ldns is good enough
|
||||
AC_CHECK_LIB(ldns, ldns_rr_new,,[
|
||||
AC_MSG_ERROR([No ldns library found, install the ldns library into system lib dir or use --with-ldns=path to other location. The --with-ldns can point to the make-dir of ldns. Install the package ldns or download source http://www.nlnetlabs.nl/projects/ldns])
|
||||
])
|
||||
AC_CHECK_FUNC(ldns_buffer_copy)
|
||||
if test $USE_NSS = "no"; then
|
||||
AC_CHECK_FUNC(ldns_key_buf2rsa_raw)
|
||||
else
|
||||
dnl ignore test
|
||||
ac_cv_func_ldns_key_buf2rsa_raw="yes"
|
||||
fi
|
||||
AC_CHECK_FUNC(ldns_get_random)
|
||||
AC_CHECK_FUNC(ldns_b32_ntop_extended_hex)
|
||||
if test x$use_gost = xyes -a x$USE_NSS = xno; then
|
||||
AC_CHECK_FUNC(ldns_key_EVP_load_gost_id)
|
||||
AC_CHECK_FUNCS([ldns_key_EVP_unload_gost])
|
||||
else
|
||||
dnl ignore test
|
||||
ac_cv_func_ldns_key_EVP_load_gost_id="yes"
|
||||
fi
|
||||
if test x$use_ecdsa = xyes; then
|
||||
AC_CHECK_DECL([LDNS_ECDSAP384SHA384], [], [], [
|
||||
AC_INCLUDES_DEFAULT
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_WS2TCPIP_H
|
||||
# include <ws2tcpip.h>
|
||||
#endif
|
||||
#include <ldns/ldns.h>
|
||||
])
|
||||
else
|
||||
ac_cv_have_decl_LDNS_ECDSAP384SHA384="yes"
|
||||
fi
|
||||
AC_CHECK_HEADERS([ldns/ldns.h],,[
|
||||
AC_MSG_ERROR([No ldns include file found, install the ldns library development files. Install package ldns-dev or ldns-devel or download source http://www.nlnetlabs.nl/projects/ldns])
|
||||
], [AC_INCLUDES_DEFAULT
|
||||
#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
|
||||
|
||||
#ifdef HAVE_WINSOCK2_H
|
||||
#include <winsock2.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_WS2TCPIP_H
|
||||
#include <ws2tcpip.h>
|
||||
#endif
|
||||
])
|
||||
if test $ac_cv_func_ldns_buffer_copy = yes \
|
||||
-a $ac_cv_func_ldns_key_buf2rsa_raw = yes \
|
||||
-a $ac_cv_func_ldns_get_random = yes \
|
||||
-a $ac_cv_header_ldns_ldns_h = yes \
|
||||
-a $ac_cv_func_ldns_b32_ntop_extended_hex = yes \
|
||||
-a $ac_cv_func_ldns_key_EVP_load_gost_id = yes \
|
||||
-a $ac_cv_have_decl_LDNS_ECDSAP384SHA384 = yes; then
|
||||
dnl ldns was found
|
||||
:
|
||||
else
|
||||
AC_MSG_ERROR([ldns library is not recent, update the ldns library, install it into system lib dir or use --with-ldns=path to other location. The --with-ldns can point to the make-dir of ldns. Package libldns or download source http://www.nlnetlabs.nl/projects/ldns])
|
||||
fi
|
||||
AC_SUBST(INSTALLTARGET)
|
||||
|
||||
ACX_STRIP_EXT_FLAGS
|
||||
LDFLAGS="$LATE_LDFLAGS $LDFLAGS"
|
||||
@ -1103,6 +1066,12 @@ dnl includes
|
||||
# define NDEBUG
|
||||
#endif
|
||||
|
||||
/** Use small-ldns codebase */
|
||||
#define USE_SLDNS 1
|
||||
#ifdef HAVE_SSL
|
||||
# define LDNS_BUILD_CONFIG_HAVE_SSL 1
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
@ -1113,6 +1082,10 @@ dnl includes
|
||||
#include <stddef.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDARG_H
|
||||
#include <stdarg.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDINT_H
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
@ -1146,6 +1119,12 @@ dnl includes
|
||||
#ifdef HAVE_WS2TCPIP_H
|
||||
#include <ws2tcpip.h>
|
||||
#endif
|
||||
|
||||
#ifndef USE_WINSOCK
|
||||
#define ARG_LL "%ll"
|
||||
#else
|
||||
#define ARG_LL "%I64"
|
||||
#endif
|
||||
]
|
||||
|
||||
AHX_CONFIG_FORMAT_ATTRIBUTE
|
||||
@ -1157,6 +1136,7 @@ AHX_CONFIG_INET_PTON(unbound)
|
||||
AHX_CONFIG_INET_NTOP(unbound)
|
||||
AHX_CONFIG_INET_ATON(unbound)
|
||||
AHX_CONFIG_MEMMOVE(unbound)
|
||||
AHX_CONFIG_STRLCAT(unbound)
|
||||
AHX_CONFIG_STRLCPY(unbound)
|
||||
AHX_CONFIG_GMTIME_R(unbound)
|
||||
AHX_CONFIG_W32_SLEEP
|
||||
@ -1193,8 +1173,6 @@ char *strptime(const char *s, const char *format, struct tm *tm);
|
||||
# endif
|
||||
#endif /* CHECKED_INET6 */
|
||||
|
||||
/* maximum nesting of included files */
|
||||
#define MAXINCLUDES 10
|
||||
#ifndef HAVE_GETADDRINFO
|
||||
struct sockaddr_storage;
|
||||
#include "compat/fake-rfc2553.h"
|
||||
|
@ -21,16 +21,16 @@
|
||||
* 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.
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDER 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -103,6 +103,10 @@ acl_list_str_cfg(struct acl_list* acl, const char* str, const char* s2,
|
||||
control = acl_deny;
|
||||
else if(strcmp(s2, "refuse") == 0)
|
||||
control = acl_refuse;
|
||||
else if(strcmp(s2, "deny_non_local") == 0)
|
||||
control = acl_deny_non_local;
|
||||
else if(strcmp(s2, "refuse_non_local") == 0)
|
||||
control = acl_refuse_non_local;
|
||||
else if(strcmp(s2, "allow_snoop") == 0)
|
||||
control = acl_allow_snoop;
|
||||
else {
|
||||
|
@ -21,16 +21,16 @@
|
||||
* 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.
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDER 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -55,6 +55,10 @@ enum acl_access {
|
||||
acl_deny = 0,
|
||||
/** disallow access, send a polite 'REFUSED' reply */
|
||||
acl_refuse,
|
||||
/** disallow any access to zones that aren't local, drop it */
|
||||
acl_deny_non_local,
|
||||
/** disallow access to zones that aren't local, 'REFUSED' reply */
|
||||
acl_refuse_non_local,
|
||||
/** allow full access for recursion (+RD) queries */
|
||||
acl_allow,
|
||||
/** allow full access for all queries, recursion and cache snooping */
|
||||
|
@ -21,16 +21,16 @@
|
||||
* 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.
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDER 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -40,7 +40,7 @@
|
||||
* to text format.
|
||||
*/
|
||||
#include "config.h"
|
||||
#include <ldns/ldns.h>
|
||||
#include <openssl/ssl.h>
|
||||
#include "daemon/cachedump.h"
|
||||
#include "daemon/remote.h"
|
||||
#include "daemon/worker.h"
|
||||
@ -56,70 +56,25 @@
|
||||
#include "iterator/iter_utils.h"
|
||||
#include "iterator/iter_fwd.h"
|
||||
#include "iterator/iter_hints.h"
|
||||
|
||||
/** convert to ldns rr */
|
||||
static ldns_rr*
|
||||
to_rr(struct ub_packed_rrset_key* k, struct packed_rrset_data* d,
|
||||
uint32_t now, size_t i, uint16_t type)
|
||||
{
|
||||
ldns_rr* rr = ldns_rr_new();
|
||||
ldns_rdf* rdf;
|
||||
ldns_status status;
|
||||
size_t pos;
|
||||
log_assert(i < d->count + d->rrsig_count);
|
||||
if(!rr) {
|
||||
return NULL;
|
||||
}
|
||||
ldns_rr_set_type(rr, type);
|
||||
ldns_rr_set_class(rr, ntohs(k->rk.rrset_class));
|
||||
if(d->rr_ttl[i] < now)
|
||||
ldns_rr_set_ttl(rr, 0);
|
||||
else ldns_rr_set_ttl(rr, d->rr_ttl[i] - now);
|
||||
pos = 0;
|
||||
status = ldns_wire2dname(&rdf, k->rk.dname, k->rk.dname_len, &pos);
|
||||
if(status != LDNS_STATUS_OK) {
|
||||
/* we drop detailed error in status */
|
||||
ldns_rr_free(rr);
|
||||
return NULL;
|
||||
}
|
||||
ldns_rr_set_owner(rr, rdf);
|
||||
pos = 0;
|
||||
status = ldns_wire2rdf(rr, d->rr_data[i], d->rr_len[i], &pos);
|
||||
if(status != LDNS_STATUS_OK) {
|
||||
/* we drop detailed error in status */
|
||||
ldns_rr_free(rr);
|
||||
return NULL;
|
||||
}
|
||||
return rr;
|
||||
}
|
||||
#include "ldns/sbuffer.h"
|
||||
#include "ldns/wire2str.h"
|
||||
#include "ldns/str2wire.h"
|
||||
|
||||
/** dump one rrset zonefile line */
|
||||
static int
|
||||
dump_rrset_line(SSL* ssl, struct ub_packed_rrset_key* k,
|
||||
struct packed_rrset_data* d, uint32_t now, size_t i, uint16_t type)
|
||||
dump_rrset_line(SSL* ssl, struct ub_packed_rrset_key* k, time_t now, size_t i)
|
||||
{
|
||||
char* s;
|
||||
ldns_rr* rr = to_rr(k, d, now, i, type);
|
||||
if(!rr) {
|
||||
char s[65535];
|
||||
if(!packed_rr_to_string(k, i, now, s, sizeof(s))) {
|
||||
return ssl_printf(ssl, "BADRR\n");
|
||||
}
|
||||
s = ldns_rr2str(rr);
|
||||
ldns_rr_free(rr);
|
||||
if(!s) {
|
||||
return ssl_printf(ssl, "BADRR\n");
|
||||
}
|
||||
if(!ssl_printf(ssl, "%s", s)) {
|
||||
free(s);
|
||||
return 0;
|
||||
}
|
||||
free(s);
|
||||
return 1;
|
||||
return ssl_printf(ssl, "%s", s);
|
||||
}
|
||||
|
||||
/** dump rrset key and data info */
|
||||
static int
|
||||
dump_rrset(SSL* ssl, struct ub_packed_rrset_key* k,
|
||||
struct packed_rrset_data* d, uint32_t now)
|
||||
struct packed_rrset_data* d, time_t now)
|
||||
{
|
||||
size_t i;
|
||||
/* rd lock held by caller */
|
||||
@ -127,29 +82,23 @@ dump_rrset(SSL* ssl, struct ub_packed_rrset_key* k,
|
||||
if(d->ttl < now) return 1; /* expired */
|
||||
|
||||
/* meta line */
|
||||
if(!ssl_printf(ssl, ";rrset%s %u %u %u %d %d\n",
|
||||
if(!ssl_printf(ssl, ";rrset%s " ARG_LL "d %u %u %d %d\n",
|
||||
(k->rk.flags & PACKED_RRSET_NSEC_AT_APEX)?" nsec_apex":"",
|
||||
(unsigned)(d->ttl - now),
|
||||
(long long)(d->ttl - now),
|
||||
(unsigned)d->count, (unsigned)d->rrsig_count,
|
||||
(int)d->trust, (int)d->security
|
||||
))
|
||||
return 0;
|
||||
for(i=0; i<d->count; i++) {
|
||||
if(!dump_rrset_line(ssl, k, d, now, i, ntohs(k->rk.type)))
|
||||
for(i=0; i<d->count + d->rrsig_count; i++) {
|
||||
if(!dump_rrset_line(ssl, k, now, i))
|
||||
return 0;
|
||||
}
|
||||
for(i=0; i<d->rrsig_count; i++) {
|
||||
if(!dump_rrset_line(ssl, k, d, now, i+d->count,
|
||||
LDNS_RR_TYPE_RRSIG))
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/** dump lruhash rrset cache */
|
||||
static int
|
||||
dump_rrset_lruhash(SSL* ssl, struct lruhash* h, uint32_t now)
|
||||
dump_rrset_lruhash(SSL* ssl, struct lruhash* h, time_t now)
|
||||
{
|
||||
struct lruhash_entry* e;
|
||||
/* lruhash already locked by caller */
|
||||
@ -189,20 +138,10 @@ dump_rrset_cache(SSL* ssl, struct worker* worker)
|
||||
static int
|
||||
dump_msg_ref(SSL* ssl, struct ub_packed_rrset_key* k)
|
||||
{
|
||||
ldns_rdf* rdf;
|
||||
ldns_status status;
|
||||
size_t pos;
|
||||
char* nm, *tp, *cl;
|
||||
|
||||
pos = 0;
|
||||
status = ldns_wire2dname(&rdf, k->rk.dname, k->rk.dname_len, &pos);
|
||||
if(status != LDNS_STATUS_OK) {
|
||||
return ssl_printf(ssl, "BADREF\n");
|
||||
}
|
||||
nm = ldns_rdf2str(rdf);
|
||||
ldns_rdf_deep_free(rdf);
|
||||
tp = ldns_rr_type2str(ntohs(k->rk.type));
|
||||
cl = ldns_rr_class2str(ntohs(k->rk.rrset_class));
|
||||
nm = sldns_wire2str_dname(k->rk.dname, k->rk.dname_len);
|
||||
tp = sldns_wire2str_type(ntohs(k->rk.type));
|
||||
cl = sldns_wire2str_class(ntohs(k->rk.rrset_class));
|
||||
if(!nm || !cl || !tp) {
|
||||
free(nm);
|
||||
free(tp);
|
||||
@ -225,25 +164,16 @@ dump_msg_ref(SSL* ssl, struct ub_packed_rrset_key* k)
|
||||
/** dump message entry */
|
||||
static int
|
||||
dump_msg(SSL* ssl, struct query_info* k, struct reply_info* d,
|
||||
uint32_t now)
|
||||
time_t now)
|
||||
{
|
||||
size_t i;
|
||||
char* nm, *tp, *cl;
|
||||
ldns_rdf* rdf;
|
||||
ldns_status status;
|
||||
size_t pos;
|
||||
if(!k || !d) return 1;
|
||||
if(d->ttl < now) return 1; /* expired */
|
||||
|
||||
pos = 0;
|
||||
status = ldns_wire2dname(&rdf, k->qname, k->qname_len, &pos);
|
||||
if(status != LDNS_STATUS_OK) {
|
||||
return 1; /* skip this entry */
|
||||
}
|
||||
nm = ldns_rdf2str(rdf);
|
||||
ldns_rdf_deep_free(rdf);
|
||||
tp = ldns_rr_type2str(k->qtype);
|
||||
cl = ldns_rr_class2str(k->qclass);
|
||||
nm = sldns_wire2str_dname(k->qname, k->qname_len);
|
||||
tp = sldns_wire2str_type(k->qtype);
|
||||
cl = sldns_wire2str_class(k->qclass);
|
||||
if(!nm || !tp || !cl) {
|
||||
free(nm);
|
||||
free(tp);
|
||||
@ -259,10 +189,10 @@ dump_msg(SSL* ssl, struct query_info* k, struct reply_info* d,
|
||||
}
|
||||
|
||||
/* meta line */
|
||||
if(!ssl_printf(ssl, "msg %s %s %s %d %d %u %d %u %u %u\n",
|
||||
if(!ssl_printf(ssl, "msg %s %s %s %d %d " ARG_LL "d %d %u %u %u\n",
|
||||
nm, cl, tp,
|
||||
(int)d->flags, (int)d->qdcount,
|
||||
(unsigned)(d->ttl-now), (int)d->security,
|
||||
(long long)(d->ttl-now), (int)d->security,
|
||||
(unsigned)d->an_numrrsets,
|
||||
(unsigned)d->ns_numrrsets,
|
||||
(unsigned)d->ar_numrrsets)) {
|
||||
@ -369,96 +299,74 @@ dump_cache(SSL* ssl, struct worker* worker)
|
||||
|
||||
/** read a line from ssl into buffer */
|
||||
static int
|
||||
ssl_read_buf(SSL* ssl, ldns_buffer* buf)
|
||||
ssl_read_buf(SSL* ssl, sldns_buffer* buf)
|
||||
{
|
||||
return ssl_read_line(ssl, (char*)ldns_buffer_begin(buf),
|
||||
ldns_buffer_capacity(buf));
|
||||
return ssl_read_line(ssl, (char*)sldns_buffer_begin(buf),
|
||||
sldns_buffer_capacity(buf));
|
||||
}
|
||||
|
||||
/** check fixed text on line */
|
||||
static int
|
||||
read_fixed(SSL* ssl, ldns_buffer* buf, const char* str)
|
||||
read_fixed(SSL* ssl, sldns_buffer* buf, const char* str)
|
||||
{
|
||||
if(!ssl_read_buf(ssl, buf)) return 0;
|
||||
return (strcmp((char*)ldns_buffer_begin(buf), str) == 0);
|
||||
return (strcmp((char*)sldns_buffer_begin(buf), str) == 0);
|
||||
}
|
||||
|
||||
/** load an RR into rrset */
|
||||
static int
|
||||
load_rr(SSL* ssl, ldns_buffer* buf, struct regional* region,
|
||||
load_rr(SSL* ssl, sldns_buffer* buf, struct regional* region,
|
||||
struct ub_packed_rrset_key* rk, struct packed_rrset_data* d,
|
||||
unsigned int i, int is_rrsig, int* go_on, uint32_t now)
|
||||
unsigned int i, int is_rrsig, int* go_on, time_t now)
|
||||
{
|
||||
ldns_rr* rr;
|
||||
ldns_status status;
|
||||
uint8_t rr[LDNS_RR_BUF_SIZE];
|
||||
size_t rr_len = sizeof(rr), dname_len = 0;
|
||||
int status;
|
||||
|
||||
/* read the line */
|
||||
if(!ssl_read_buf(ssl, buf))
|
||||
return 0;
|
||||
if(strncmp((char*)ldns_buffer_begin(buf), "BADRR\n", 6) == 0) {
|
||||
if(strncmp((char*)sldns_buffer_begin(buf), "BADRR\n", 6) == 0) {
|
||||
*go_on = 0;
|
||||
return 1;
|
||||
}
|
||||
status = ldns_rr_new_frm_str(&rr, (char*)ldns_buffer_begin(buf),
|
||||
LDNS_DEFAULT_TTL, NULL, NULL);
|
||||
if(status != LDNS_STATUS_OK) {
|
||||
status = sldns_str2wire_rr_buf((char*)sldns_buffer_begin(buf), rr,
|
||||
&rr_len, &dname_len, 3600, NULL, 0, NULL, 0);
|
||||
if(status != 0) {
|
||||
log_warn("error cannot parse rr: %s: %s",
|
||||
ldns_get_errorstr_by_id(status),
|
||||
(char*)ldns_buffer_begin(buf));
|
||||
sldns_get_errorstr_parse(status),
|
||||
(char*)sldns_buffer_begin(buf));
|
||||
return 0;
|
||||
}
|
||||
if(is_rrsig && ldns_rr_get_type(rr) != LDNS_RR_TYPE_RRSIG) {
|
||||
if(is_rrsig && sldns_wirerr_get_type(rr, rr_len, dname_len)
|
||||
!= LDNS_RR_TYPE_RRSIG) {
|
||||
log_warn("error expected rrsig but got %s",
|
||||
(char*)ldns_buffer_begin(buf));
|
||||
(char*)sldns_buffer_begin(buf));
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* convert ldns rr into packed_rr */
|
||||
d->rr_ttl[i] = ldns_rr_ttl(rr) + now;
|
||||
ldns_buffer_clear(buf);
|
||||
ldns_buffer_skip(buf, 2);
|
||||
status = ldns_rr_rdata2buffer_wire(buf, rr);
|
||||
if(status != LDNS_STATUS_OK) {
|
||||
log_warn("error cannot rr2wire: %s",
|
||||
ldns_get_errorstr_by_id(status));
|
||||
ldns_rr_free(rr);
|
||||
return 0;
|
||||
}
|
||||
ldns_buffer_flip(buf);
|
||||
ldns_buffer_write_u16_at(buf, 0, ldns_buffer_limit(buf) - 2);
|
||||
|
||||
d->rr_len[i] = ldns_buffer_limit(buf);
|
||||
d->rr_ttl[i] = (time_t)sldns_wirerr_get_ttl(rr, rr_len, dname_len) + now;
|
||||
sldns_buffer_clear(buf);
|
||||
d->rr_len[i] = sldns_wirerr_get_rdatalen(rr, rr_len, dname_len)+2;
|
||||
d->rr_data[i] = (uint8_t*)regional_alloc_init(region,
|
||||
ldns_buffer_begin(buf), ldns_buffer_limit(buf));
|
||||
sldns_wirerr_get_rdatawl(rr, rr_len, dname_len), d->rr_len[i]);
|
||||
if(!d->rr_data[i]) {
|
||||
ldns_rr_free(rr);
|
||||
log_warn("error out of memory");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* if first entry, fill the key structure */
|
||||
if(i==0) {
|
||||
rk->rk.type = htons(ldns_rr_get_type(rr));
|
||||
rk->rk.rrset_class = htons(ldns_rr_get_class(rr));
|
||||
ldns_buffer_clear(buf);
|
||||
status = ldns_dname2buffer_wire(buf, ldns_rr_owner(rr));
|
||||
if(status != LDNS_STATUS_OK) {
|
||||
log_warn("error cannot dname2buffer: %s",
|
||||
ldns_get_errorstr_by_id(status));
|
||||
ldns_rr_free(rr);
|
||||
return 0;
|
||||
}
|
||||
ldns_buffer_flip(buf);
|
||||
rk->rk.dname_len = ldns_buffer_limit(buf);
|
||||
rk->rk.dname = regional_alloc_init(region,
|
||||
ldns_buffer_begin(buf), ldns_buffer_limit(buf));
|
||||
rk->rk.type = htons(sldns_wirerr_get_type(rr, rr_len, dname_len));
|
||||
rk->rk.rrset_class = htons(sldns_wirerr_get_class(rr, rr_len, dname_len));
|
||||
rk->rk.dname_len = dname_len;
|
||||
rk->rk.dname = regional_alloc_init(region, rr, dname_len);
|
||||
if(!rk->rk.dname) {
|
||||
log_warn("error out of memory");
|
||||
ldns_rr_free(rr);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
ldns_rr_free(rr);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -489,7 +397,7 @@ move_into_cache(struct ub_packed_rrset_key* k,
|
||||
return 0;
|
||||
}
|
||||
s = sizeof(*ad) + (sizeof(size_t) + sizeof(uint8_t*) +
|
||||
sizeof(uint32_t))* num;
|
||||
sizeof(time_t))* num;
|
||||
for(i=0; i<num; i++)
|
||||
s += d->rr_len[i];
|
||||
ad = (struct packed_rrset_data*)malloc(s);
|
||||
@ -505,8 +413,8 @@ move_into_cache(struct ub_packed_rrset_key* k,
|
||||
p += sizeof(size_t)*num;
|
||||
memmove(p, &d->rr_data[0], sizeof(uint8_t*)*num);
|
||||
p += sizeof(uint8_t*)*num;
|
||||
memmove(p, &d->rr_ttl[0], sizeof(uint32_t)*num);
|
||||
p += sizeof(uint32_t)*num;
|
||||
memmove(p, &d->rr_ttl[0], sizeof(time_t)*num);
|
||||
p += sizeof(time_t)*num;
|
||||
for(i=0; i<num; i++) {
|
||||
memmove(p, d->rr_data[i], d->rr_len[i]);
|
||||
p += d->rr_len[i];
|
||||
@ -524,13 +432,14 @@ move_into_cache(struct ub_packed_rrset_key* k,
|
||||
|
||||
/** load an rrset entry */
|
||||
static int
|
||||
load_rrset(SSL* ssl, ldns_buffer* buf, struct worker* worker)
|
||||
load_rrset(SSL* ssl, sldns_buffer* buf, struct worker* worker)
|
||||
{
|
||||
char* s = (char*)ldns_buffer_begin(buf);
|
||||
char* s = (char*)sldns_buffer_begin(buf);
|
||||
struct regional* region = worker->scratchpad;
|
||||
struct ub_packed_rrset_key* rk;
|
||||
struct packed_rrset_data* d;
|
||||
unsigned int ttl, rr_count, rrsig_count, trust, security;
|
||||
unsigned int rr_count, rrsig_count, trust, security;
|
||||
long long ttl;
|
||||
unsigned int i;
|
||||
int go_on = 1;
|
||||
regional_free_all(region);
|
||||
@ -552,7 +461,7 @@ load_rrset(SSL* ssl, ldns_buffer* buf, struct worker* worker)
|
||||
s += 10;
|
||||
rk->rk.flags |= PACKED_RRSET_NSEC_AT_APEX;
|
||||
}
|
||||
if(sscanf(s, " %u %u %u %u %u", &ttl, &rr_count, &rrsig_count,
|
||||
if(sscanf(s, " " ARG_LL "d %u %u %u %u", &ttl, &rr_count, &rrsig_count,
|
||||
&trust, &security) != 5) {
|
||||
log_warn("error bad rrset spec %s", s);
|
||||
return 0;
|
||||
@ -565,12 +474,12 @@ load_rrset(SSL* ssl, ldns_buffer* buf, struct worker* worker)
|
||||
d->rrsig_count = (size_t)rrsig_count;
|
||||
d->security = (enum sec_status)security;
|
||||
d->trust = (enum rrset_trust)trust;
|
||||
d->ttl = (uint32_t)ttl + *worker->env.now;
|
||||
d->ttl = (time_t)ttl + *worker->env.now;
|
||||
|
||||
d->rr_len = regional_alloc_zero(region,
|
||||
sizeof(size_t)*(d->count+d->rrsig_count));
|
||||
d->rr_ttl = regional_alloc_zero(region,
|
||||
sizeof(uint32_t)*(d->count+d->rrsig_count));
|
||||
sizeof(time_t)*(d->count+d->rrsig_count));
|
||||
d->rr_data = regional_alloc_zero(region,
|
||||
sizeof(uint8_t*)*(d->count+d->rrsig_count));
|
||||
if(!d->rr_len || !d->rr_ttl || !d->rr_data) {
|
||||
@ -605,10 +514,10 @@ load_rrset(SSL* ssl, ldns_buffer* buf, struct worker* worker)
|
||||
static int
|
||||
load_rrset_cache(SSL* ssl, struct worker* worker)
|
||||
{
|
||||
ldns_buffer* buf = worker->env.scratch_buffer;
|
||||
sldns_buffer* buf = worker->env.scratch_buffer;
|
||||
if(!read_fixed(ssl, buf, "START_RRSET_CACHE")) return 0;
|
||||
while(ssl_read_buf(ssl, buf) &&
|
||||
strcmp((char*)ldns_buffer_begin(buf), "END_RRSET_CACHE")!=0) {
|
||||
strcmp((char*)sldns_buffer_begin(buf), "END_RRSET_CACHE")!=0) {
|
||||
if(!load_rrset(ssl, buf, worker))
|
||||
return 0;
|
||||
}
|
||||
@ -617,13 +526,13 @@ load_rrset_cache(SSL* ssl, struct worker* worker)
|
||||
|
||||
/** read qinfo from next three words */
|
||||
static char*
|
||||
load_qinfo(char* str, struct query_info* qinfo, ldns_buffer* buf,
|
||||
struct regional* region)
|
||||
load_qinfo(char* str, struct query_info* qinfo, struct regional* region)
|
||||
{
|
||||
/* s is part of the buf */
|
||||
char* s = str;
|
||||
ldns_rr* rr;
|
||||
ldns_status status;
|
||||
uint8_t rr[LDNS_RR_BUF_SIZE];
|
||||
size_t rr_len = sizeof(rr), dname_len = 0;
|
||||
int status;
|
||||
|
||||
/* skip three words */
|
||||
s = strchr(str, ' ');
|
||||
@ -637,26 +546,17 @@ load_qinfo(char* str, struct query_info* qinfo, ldns_buffer* buf,
|
||||
s++;
|
||||
|
||||
/* parse them */
|
||||
status = ldns_rr_new_question_frm_str(&rr, str, NULL, NULL);
|
||||
if(status != LDNS_STATUS_OK) {
|
||||
status = sldns_str2wire_rr_question_buf(str, rr, &rr_len, &dname_len,
|
||||
NULL, 0, NULL, 0);
|
||||
if(status != 0) {
|
||||
log_warn("error cannot parse: %s %s",
|
||||
ldns_get_errorstr_by_id(status), str);
|
||||
sldns_get_errorstr_parse(status), str);
|
||||
return NULL;
|
||||
}
|
||||
qinfo->qtype = ldns_rr_get_type(rr);
|
||||
qinfo->qclass = ldns_rr_get_class(rr);
|
||||
ldns_buffer_clear(buf);
|
||||
status = ldns_dname2buffer_wire(buf, ldns_rr_owner(rr));
|
||||
ldns_rr_free(rr);
|
||||
if(status != LDNS_STATUS_OK) {
|
||||
log_warn("error cannot dname2wire: %s",
|
||||
ldns_get_errorstr_by_id(status));
|
||||
return NULL;
|
||||
}
|
||||
ldns_buffer_flip(buf);
|
||||
qinfo->qname_len = ldns_buffer_limit(buf);
|
||||
qinfo->qname = (uint8_t*)regional_alloc_init(region,
|
||||
ldns_buffer_begin(buf), ldns_buffer_limit(buf));
|
||||
qinfo->qtype = sldns_wirerr_get_type(rr, rr_len, dname_len);
|
||||
qinfo->qclass = sldns_wirerr_get_class(rr, rr_len, dname_len);
|
||||
qinfo->qname_len = dname_len;
|
||||
qinfo->qname = (uint8_t*)regional_alloc_init(region, rr, dname_len);
|
||||
if(!qinfo->qname) {
|
||||
log_warn("error out of memory");
|
||||
return NULL;
|
||||
@ -667,11 +567,11 @@ load_qinfo(char* str, struct query_info* qinfo, ldns_buffer* buf,
|
||||
|
||||
/** load a msg rrset reference */
|
||||
static int
|
||||
load_ref(SSL* ssl, ldns_buffer* buf, struct worker* worker,
|
||||
load_ref(SSL* ssl, sldns_buffer* buf, struct worker* worker,
|
||||
struct regional *region, struct ub_packed_rrset_key** rrset,
|
||||
int* go_on)
|
||||
{
|
||||
char* s = (char*)ldns_buffer_begin(buf);
|
||||
char* s = (char*)sldns_buffer_begin(buf);
|
||||
struct query_info qinfo;
|
||||
unsigned int flags;
|
||||
struct ub_packed_rrset_key* k;
|
||||
@ -684,7 +584,7 @@ load_ref(SSL* ssl, ldns_buffer* buf, struct worker* worker,
|
||||
return 1;
|
||||
}
|
||||
|
||||
s = load_qinfo(s, &qinfo, buf, region);
|
||||
s = load_qinfo(s, &qinfo, region);
|
||||
if(!s) {
|
||||
return 0;
|
||||
}
|
||||
@ -712,13 +612,14 @@ load_ref(SSL* ssl, ldns_buffer* buf, struct worker* worker,
|
||||
|
||||
/** load a msg entry */
|
||||
static int
|
||||
load_msg(SSL* ssl, ldns_buffer* buf, struct worker* worker)
|
||||
load_msg(SSL* ssl, sldns_buffer* buf, struct worker* worker)
|
||||
{
|
||||
struct regional* region = worker->scratchpad;
|
||||
struct query_info qinf;
|
||||
struct reply_info rep;
|
||||
char* s = (char*)ldns_buffer_begin(buf);
|
||||
unsigned int flags, qdcount, ttl, security, an, ns, ar;
|
||||
char* s = (char*)sldns_buffer_begin(buf);
|
||||
unsigned int flags, qdcount, security, an, ns, ar;
|
||||
long long ttl;
|
||||
size_t i;
|
||||
int go_on = 1;
|
||||
|
||||
@ -729,20 +630,20 @@ load_msg(SSL* ssl, ldns_buffer* buf, struct worker* worker)
|
||||
return 0;
|
||||
}
|
||||
s += 4;
|
||||
s = load_qinfo(s, &qinf, buf, region);
|
||||
s = load_qinfo(s, &qinf, region);
|
||||
if(!s) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* read remainder of line */
|
||||
if(sscanf(s, " %u %u %u %u %u %u %u", &flags, &qdcount, &ttl,
|
||||
if(sscanf(s, " %u %u " ARG_LL "d %u %u %u %u", &flags, &qdcount, &ttl,
|
||||
&security, &an, &ns, &ar) != 7) {
|
||||
log_warn("error cannot parse numbers: %s", s);
|
||||
return 0;
|
||||
}
|
||||
rep.flags = (uint16_t)flags;
|
||||
rep.qdcount = (uint16_t)qdcount;
|
||||
rep.ttl = (uint32_t)ttl;
|
||||
rep.ttl = (time_t)ttl;
|
||||
rep.prefetch_ttl = PREFETCH_TTL_CALC(rep.ttl);
|
||||
rep.security = (enum sec_status)security;
|
||||
rep.an_numrrsets = (size_t)an;
|
||||
@ -774,10 +675,10 @@ load_msg(SSL* ssl, ldns_buffer* buf, struct worker* worker)
|
||||
static int
|
||||
load_msg_cache(SSL* ssl, struct worker* worker)
|
||||
{
|
||||
ldns_buffer* buf = worker->env.scratch_buffer;
|
||||
sldns_buffer* buf = worker->env.scratch_buffer;
|
||||
if(!read_fixed(ssl, buf, "START_MSG_CACHE")) return 0;
|
||||
while(ssl_read_buf(ssl, buf) &&
|
||||
strcmp((char*)ldns_buffer_begin(buf), "END_MSG_CACHE")!=0) {
|
||||
strcmp((char*)sldns_buffer_begin(buf), "END_MSG_CACHE")!=0) {
|
||||
if(!load_msg(ssl, buf, worker))
|
||||
return 0;
|
||||
}
|
||||
@ -800,8 +701,9 @@ print_dp_details(SSL* ssl, struct worker* worker, struct delegpt* dp)
|
||||
{
|
||||
char buf[257];
|
||||
struct delegpt_addr* a;
|
||||
int lame, dlame, rlame, rto, edns_vs, to, delay, entry_ttl,
|
||||
int lame, dlame, rlame, rto, edns_vs, to, delay,
|
||||
tA = 0, tAAAA = 0, tother = 0;
|
||||
long long entry_ttl;
|
||||
struct rtt_info ri;
|
||||
uint8_t edns_lame_known;
|
||||
for(a = dp->target_list; a; a = a->next_target) {
|
||||
@ -840,8 +742,8 @@ print_dp_details(SSL* ssl, struct worker* worker, struct delegpt* dp)
|
||||
return;
|
||||
continue; /* skip stuff not in infra cache */
|
||||
}
|
||||
if(!ssl_printf(ssl, "%s%s%s%srto %d msec, ttl %d, ping %d "
|
||||
"var %d rtt %d, tA %d, tAAAA %d, tother %d",
|
||||
if(!ssl_printf(ssl, "%s%s%s%srto %d msec, ttl " ARG_LL "d, "
|
||||
"ping %d var %d rtt %d, tA %d, tAAAA %d, tother %d",
|
||||
lame?"LAME ":"", dlame?"NoDNSSEC ":"",
|
||||
a->lame?"AddrWasParentSide ":"",
|
||||
rlame?"NoAuthButRecursive ":"", rto, entry_ttl,
|
||||
|
@ -21,16 +21,16 @@
|
||||
* 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.
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDER 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -21,16 +21,16 @@
|
||||
* 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.
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDER 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -56,12 +56,16 @@
|
||||
#include <openssl/engine.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_TIME_H
|
||||
#include <time.h>
|
||||
#endif
|
||||
#include <sys/time.h>
|
||||
|
||||
#ifdef HAVE_NSS
|
||||
/* nss3 */
|
||||
#include "nss.h"
|
||||
#endif
|
||||
|
||||
#include <ldns/ldns.h>
|
||||
#include "daemon/daemon.h"
|
||||
#include "daemon/worker.h"
|
||||
#include "daemon/remote.h"
|
||||
@ -80,6 +84,7 @@
|
||||
#include "util/random.h"
|
||||
#include "util/tube.h"
|
||||
#include "util/net_help.h"
|
||||
#include "ldns/keyraw.h"
|
||||
#include <signal.h>
|
||||
|
||||
/** How many quit requests happened. */
|
||||
@ -203,7 +208,7 @@ daemon_init(void)
|
||||
OPENSSL_config("unbound");
|
||||
# endif
|
||||
# ifdef USE_GOST
|
||||
(void)ldns_key_EVP_load_gost_id();
|
||||
(void)sldns_key_EVP_load_gost_id();
|
||||
# endif
|
||||
OpenSSL_add_all_algorithms();
|
||||
# if HAVE_DECL_SSL_COMP_GET_COMPRESSION_METHODS
|
||||
@ -250,9 +255,55 @@ daemon_open_shared_ports(struct daemon* daemon)
|
||||
{
|
||||
log_assert(daemon);
|
||||
if(daemon->cfg->port != daemon->listening_port) {
|
||||
listening_ports_free(daemon->ports);
|
||||
if(!(daemon->ports=listening_ports_open(daemon->cfg)))
|
||||
size_t i;
|
||||
int reuseport = 0;
|
||||
struct listen_port* p0;
|
||||
/* free and close old ports */
|
||||
if(daemon->ports != NULL) {
|
||||
for(i=0; i<daemon->num_ports; i++)
|
||||
listening_ports_free(daemon->ports[i]);
|
||||
free(daemon->ports);
|
||||
daemon->ports = NULL;
|
||||
}
|
||||
/* see if we want to reuseport */
|
||||
#if defined(__linux__) && defined(SO_REUSEPORT)
|
||||
if(daemon->cfg->so_reuseport && daemon->cfg->num_threads > 0)
|
||||
reuseport = 1;
|
||||
#endif
|
||||
/* try to use reuseport */
|
||||
p0 = listening_ports_open(daemon->cfg, &reuseport);
|
||||
if(!p0) {
|
||||
listening_ports_free(p0);
|
||||
return 0;
|
||||
}
|
||||
if(reuseport) {
|
||||
/* reuseport was successful, allocate for it */
|
||||
daemon->num_ports = (size_t)daemon->cfg->num_threads;
|
||||
} else {
|
||||
/* do the normal, singleportslist thing,
|
||||
* reuseport not enabled or did not work */
|
||||
daemon->num_ports = 1;
|
||||
}
|
||||
if(!(daemon->ports = (struct listen_port**)calloc(
|
||||
daemon->num_ports, sizeof(*daemon->ports)))) {
|
||||
listening_ports_free(p0);
|
||||
return 0;
|
||||
}
|
||||
daemon->ports[0] = p0;
|
||||
if(reuseport) {
|
||||
/* continue to use reuseport */
|
||||
for(i=1; i<daemon->num_ports; i++) {
|
||||
if(!(daemon->ports[i]=
|
||||
listening_ports_open(daemon->cfg,
|
||||
&reuseport)) || !reuseport ) {
|
||||
for(i=0; i<daemon->num_ports; i++)
|
||||
listening_ports_free(daemon->ports[i]);
|
||||
free(daemon->ports);
|
||||
daemon->ports = NULL;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
daemon->listening_port = daemon->cfg->port;
|
||||
}
|
||||
if(!daemon->cfg->remote_control_enable && daemon->rc_port) {
|
||||
@ -389,6 +440,7 @@ static void*
|
||||
thread_start(void* arg)
|
||||
{
|
||||
struct worker* worker = (struct worker*)arg;
|
||||
int port_num = 0;
|
||||
log_thread_set(&worker->thread_num);
|
||||
ub_thread_blocksigs();
|
||||
#ifdef THREADS_DISABLED
|
||||
@ -396,7 +448,14 @@ thread_start(void* arg)
|
||||
tube_close_write(worker->cmd);
|
||||
close_other_pipes(worker->daemon, worker->thread_num);
|
||||
#endif
|
||||
if(!worker_init(worker, worker->daemon->cfg, worker->daemon->ports, 0))
|
||||
#if defined(__linux__) && defined(SO_REUSEPORT)
|
||||
if(worker->daemon->cfg->so_reuseport)
|
||||
port_num = worker->thread_num;
|
||||
else
|
||||
port_num = 0;
|
||||
#endif
|
||||
if(!worker_init(worker, worker->daemon->cfg,
|
||||
worker->daemon->ports[port_num], 0))
|
||||
fatal_exit("Could not initialize thread");
|
||||
|
||||
worker_work(worker);
|
||||
@ -469,7 +528,7 @@ daemon_fork(struct daemon* daemon)
|
||||
|
||||
#if defined(HAVE_EV_LOOP) || defined(HAVE_EV_DEFAULT_LOOP)
|
||||
/* in libev the first inited base gets signals */
|
||||
if(!worker_init(daemon->workers[0], daemon->cfg, daemon->ports, 1))
|
||||
if(!worker_init(daemon->workers[0], daemon->cfg, daemon->ports[0], 1))
|
||||
fatal_exit("Could not initialize main thread");
|
||||
#endif
|
||||
|
||||
@ -483,7 +542,7 @@ daemon_fork(struct daemon* daemon)
|
||||
*/
|
||||
#if !(defined(HAVE_EV_LOOP) || defined(HAVE_EV_DEFAULT_LOOP))
|
||||
/* libevent has the last inited base get signals (or any base) */
|
||||
if(!worker_init(daemon->workers[0], daemon->cfg, daemon->ports, 1))
|
||||
if(!worker_init(daemon->workers[0], daemon->cfg, daemon->ports[0], 1))
|
||||
fatal_exit("Could not initialize main thread");
|
||||
#endif
|
||||
signal_handling_playback(daemon->workers[0]);
|
||||
@ -529,11 +588,14 @@ daemon_cleanup(struct daemon* daemon)
|
||||
void
|
||||
daemon_delete(struct daemon* daemon)
|
||||
{
|
||||
size_t i;
|
||||
if(!daemon)
|
||||
return;
|
||||
modstack_desetup(&daemon->mods, daemon->env);
|
||||
daemon_remote_delete(daemon->rc);
|
||||
listening_ports_free(daemon->ports);
|
||||
for(i = 0; i < daemon->num_ports; i++)
|
||||
listening_ports_free(daemon->ports[i]);
|
||||
free(daemon->ports);
|
||||
listening_ports_free(daemon->rc_ports);
|
||||
if(daemon->env) {
|
||||
slabhash_delete(daemon->env->msg_cache);
|
||||
@ -558,7 +620,7 @@ daemon_delete(struct daemon* daemon)
|
||||
/* libcrypto cleanup */
|
||||
#ifdef HAVE_SSL
|
||||
# if defined(USE_GOST) && defined(HAVE_LDNS_KEY_EVP_UNLOAD_GOST)
|
||||
ldns_key_EVP_unload_gost();
|
||||
sldns_key_EVP_unload_gost();
|
||||
# endif
|
||||
# if HAVE_DECL_SSL_COMP_GET_COMPRESSION_METHODS && HAVE_DECL_SK_SSL_COMP_POP_FREE
|
||||
# ifndef S_SPLINT_S
|
||||
|
@ -21,16 +21,16 @@
|
||||
* 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.
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDER 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -72,8 +72,11 @@ struct daemon {
|
||||
char* pidfile;
|
||||
/** port number that has ports opened. */
|
||||
int listening_port;
|
||||
/** listening ports, opened, to be shared by threads */
|
||||
struct listen_port* ports;
|
||||
/** array of listening ports, opened. Listening ports per worker,
|
||||
* or just one element[0] shared by the worker threads. */
|
||||
struct listen_port** ports;
|
||||
/** size of ports array */
|
||||
size_t num_ports;
|
||||
/** port number for remote that has ports opened. */
|
||||
int rc_port;
|
||||
/** listening ports for remote control */
|
||||
|
@ -21,16 +21,16 @@
|
||||
* 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.
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDER 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -47,7 +47,6 @@
|
||||
#include <openssl/err.h>
|
||||
#endif
|
||||
#include <ctype.h>
|
||||
#include <ldns/ldns.h>
|
||||
#include "daemon/remote.h"
|
||||
#include "daemon/worker.h"
|
||||
#include "daemon/daemon.h"
|
||||
@ -75,6 +74,10 @@
|
||||
#include "iterator/iter_delegpt.h"
|
||||
#include "services/outbound_list.h"
|
||||
#include "services/outside_network.h"
|
||||
#include "ldns/str2wire.h"
|
||||
#include "ldns/parseutil.h"
|
||||
#include "ldns/wire2str.h"
|
||||
#include "ldns/sbuffer.h"
|
||||
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
@ -268,7 +271,7 @@ add_open(const char* ip, int nr, struct listen_port** list, int noproto_is_err)
|
||||
}
|
||||
|
||||
/* open fd */
|
||||
fd = create_tcp_accept_sock(res, 1, &noproto);
|
||||
fd = create_tcp_accept_sock(res, 1, &noproto, 0);
|
||||
freeaddrinfo(res);
|
||||
if(fd == -1 && noproto) {
|
||||
if(!noproto_is_err)
|
||||
@ -629,8 +632,8 @@ print_stats(SSL* ssl, const char* nm, struct stats_info* s)
|
||||
if(!ssl_printf(ssl, "%s.requestlist.current.user"SQ"%u\n", nm,
|
||||
(unsigned)s->mesh_num_reply_states)) return 0;
|
||||
timeval_divide(&avg, &s->mesh_replies_sum_wait, s->mesh_replies_sent);
|
||||
if(!ssl_printf(ssl, "%s.recursion.time.avg"SQ"%d.%6.6d\n", nm,
|
||||
(int)avg.tv_sec, (int)avg.tv_usec)) return 0;
|
||||
if(!ssl_printf(ssl, "%s.recursion.time.avg"SQ ARG_LL "d.%6.6d\n", nm,
|
||||
(long long)avg.tv_sec, (int)avg.tv_usec)) return 0;
|
||||
if(!ssl_printf(ssl, "%s.recursion.time.median"SQ"%g\n", nm,
|
||||
s->mesh_time_median)) return 0;
|
||||
return 1;
|
||||
@ -713,12 +716,12 @@ print_uptime(SSL* ssl, struct worker* worker, int reset)
|
||||
timeval_subtract(&dt, &now, &worker->daemon->time_last_stat);
|
||||
if(reset)
|
||||
worker->daemon->time_last_stat = now;
|
||||
if(!ssl_printf(ssl, "time.now"SQ"%d.%6.6d\n",
|
||||
(unsigned)now.tv_sec, (unsigned)now.tv_usec)) return 0;
|
||||
if(!ssl_printf(ssl, "time.up"SQ"%d.%6.6d\n",
|
||||
(unsigned)up.tv_sec, (unsigned)up.tv_usec)) return 0;
|
||||
if(!ssl_printf(ssl, "time.elapsed"SQ"%d.%6.6d\n",
|
||||
(unsigned)dt.tv_sec, (unsigned)dt.tv_usec)) return 0;
|
||||
if(!ssl_printf(ssl, "time.now"SQ ARG_LL "d.%6.6d\n",
|
||||
(long long)now.tv_sec, (unsigned)now.tv_usec)) return 0;
|
||||
if(!ssl_printf(ssl, "time.up"SQ ARG_LL "d.%6.6d\n",
|
||||
(long long)up.tv_sec, (unsigned)up.tv_usec)) return 0;
|
||||
if(!ssl_printf(ssl, "time.elapsed"SQ ARG_LL "d.%6.6d\n",
|
||||
(long long)dt.tv_sec, (unsigned)dt.tv_usec)) return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -756,13 +759,13 @@ print_ext(SSL* ssl, struct stats_info* s)
|
||||
{
|
||||
int i;
|
||||
char nm[16];
|
||||
const ldns_rr_descriptor* desc;
|
||||
const ldns_lookup_table* lt;
|
||||
const sldns_rr_descriptor* desc;
|
||||
const sldns_lookup_table* lt;
|
||||
/* TYPE */
|
||||
for(i=0; i<STATS_QTYPE_NUM; i++) {
|
||||
if(inhibit_zero && s->svr.qtype[i] == 0)
|
||||
continue;
|
||||
desc = ldns_rr_descript((uint16_t)i);
|
||||
desc = sldns_rr_descript((uint16_t)i);
|
||||
if(desc && desc->_name) {
|
||||
snprintf(nm, sizeof(nm), "%s", desc->_name);
|
||||
} else if (i == LDNS_RR_TYPE_IXFR) {
|
||||
@ -789,7 +792,7 @@ print_ext(SSL* ssl, struct stats_info* s)
|
||||
for(i=0; i<STATS_QCLASS_NUM; i++) {
|
||||
if(inhibit_zero && s->svr.qclass[i] == 0)
|
||||
continue;
|
||||
lt = ldns_lookup_by_id(ldns_rr_classes, i);
|
||||
lt = sldns_lookup_by_id(sldns_rr_classes, i);
|
||||
if(lt && lt->name) {
|
||||
snprintf(nm, sizeof(nm), "%s", lt->name);
|
||||
} else {
|
||||
@ -806,7 +809,7 @@ print_ext(SSL* ssl, struct stats_info* s)
|
||||
for(i=0; i<STATS_OPCODE_NUM; i++) {
|
||||
if(inhibit_zero && s->svr.qopcode[i] == 0)
|
||||
continue;
|
||||
lt = ldns_lookup_by_id(ldns_opcodes, i);
|
||||
lt = sldns_lookup_by_id(sldns_opcodes, i);
|
||||
if(lt && lt->name) {
|
||||
snprintf(nm, sizeof(nm), "%s", lt->name);
|
||||
} else {
|
||||
@ -846,7 +849,7 @@ print_ext(SSL* ssl, struct stats_info* s)
|
||||
for(i=0; i<STATS_RCODE_NUM; i++) {
|
||||
if(inhibit_zero && s->svr.ans_rcode[i] == 0)
|
||||
continue;
|
||||
lt = ldns_lookup_by_id(ldns_rcodes, i);
|
||||
lt = sldns_lookup_by_id(sldns_rcodes, i);
|
||||
if(lt && lt->name) {
|
||||
snprintf(nm, sizeof(nm), "%s", lt->name);
|
||||
} else {
|
||||
@ -912,17 +915,20 @@ do_stats(SSL* ssl, struct daemon_remote* rc, int reset)
|
||||
static int
|
||||
parse_arg_name(SSL* ssl, char* str, uint8_t** res, size_t* len, int* labs)
|
||||
{
|
||||
ldns_rdf* rdf;
|
||||
uint8_t nm[LDNS_MAX_DOMAINLEN+1];
|
||||
size_t nmlen = sizeof(nm);
|
||||
int status;
|
||||
*res = NULL;
|
||||
*len = 0;
|
||||
*labs = 0;
|
||||
rdf = ldns_dname_new_frm_str(str);
|
||||
if(!rdf) {
|
||||
ssl_printf(ssl, "error cannot parse name %s\n", str);
|
||||
status = sldns_str2wire_dname_buf(str, nm, &nmlen);
|
||||
if(status != 0) {
|
||||
ssl_printf(ssl, "error cannot parse name %s at %d: %s\n", str,
|
||||
LDNS_WIREPARSE_OFFSET(status),
|
||||
sldns_get_errorstr_parse(status));
|
||||
return 0;
|
||||
}
|
||||
*res = memdup(ldns_rdf_data(rdf), ldns_rdf_size(rdf));
|
||||
ldns_rdf_deep_free(rdf);
|
||||
*res = memdup(nm, nmlen);
|
||||
if(!*res) {
|
||||
ssl_printf(ssl, "error out of memory\n");
|
||||
return 0;
|
||||
@ -975,7 +981,7 @@ do_zone_add(SSL* ssl, struct worker* worker, char* arg)
|
||||
free(nm);
|
||||
return;
|
||||
}
|
||||
lock_quick_lock(&worker->daemon->local_zones->lock);
|
||||
lock_rw_wrlock(&worker->daemon->local_zones->lock);
|
||||
if((z=local_zones_find(worker->daemon->local_zones, nm, nmlen,
|
||||
nmlabs, LDNS_RR_CLASS_IN))) {
|
||||
/* already present in tree */
|
||||
@ -983,17 +989,17 @@ do_zone_add(SSL* ssl, struct worker* worker, char* arg)
|
||||
z->type = t; /* update type anyway */
|
||||
lock_rw_unlock(&z->lock);
|
||||
free(nm);
|
||||
lock_quick_unlock(&worker->daemon->local_zones->lock);
|
||||
lock_rw_unlock(&worker->daemon->local_zones->lock);
|
||||
send_ok(ssl);
|
||||
return;
|
||||
}
|
||||
if(!local_zones_add_zone(worker->daemon->local_zones, nm, nmlen,
|
||||
nmlabs, LDNS_RR_CLASS_IN, t)) {
|
||||
lock_quick_unlock(&worker->daemon->local_zones->lock);
|
||||
lock_rw_unlock(&worker->daemon->local_zones->lock);
|
||||
ssl_printf(ssl, "error out of memory\n");
|
||||
return;
|
||||
}
|
||||
lock_quick_unlock(&worker->daemon->local_zones->lock);
|
||||
lock_rw_unlock(&worker->daemon->local_zones->lock);
|
||||
send_ok(ssl);
|
||||
}
|
||||
|
||||
@ -1007,13 +1013,13 @@ do_zone_remove(SSL* ssl, struct worker* worker, char* arg)
|
||||
struct local_zone* z;
|
||||
if(!parse_arg_name(ssl, arg, &nm, &nmlen, &nmlabs))
|
||||
return;
|
||||
lock_quick_lock(&worker->daemon->local_zones->lock);
|
||||
lock_rw_wrlock(&worker->daemon->local_zones->lock);
|
||||
if((z=local_zones_find(worker->daemon->local_zones, nm, nmlen,
|
||||
nmlabs, LDNS_RR_CLASS_IN))) {
|
||||
/* present in tree */
|
||||
local_zones_del_zone(worker->daemon->local_zones, z);
|
||||
}
|
||||
lock_quick_unlock(&worker->daemon->local_zones->lock);
|
||||
lock_rw_unlock(&worker->daemon->local_zones->lock);
|
||||
free(nm);
|
||||
send_ok(ssl);
|
||||
}
|
||||
@ -1022,8 +1028,7 @@ do_zone_remove(SSL* ssl, struct worker* worker, char* arg)
|
||||
static void
|
||||
do_data_add(SSL* ssl, struct worker* worker, char* arg)
|
||||
{
|
||||
if(!local_zones_add_RR(worker->daemon->local_zones, arg,
|
||||
worker->env.scratch_buffer)) {
|
||||
if(!local_zones_add_RR(worker->daemon->local_zones, arg)) {
|
||||
ssl_printf(ssl,"error in syntax or out of memory, %s\n", arg);
|
||||
return;
|
||||
}
|
||||
@ -1090,7 +1095,7 @@ do_flush_type(SSL* ssl, struct worker* worker, char* arg)
|
||||
return;
|
||||
if(!parse_arg_name(ssl, arg, &nm, &nmlen, &nmlabs))
|
||||
return;
|
||||
t = ldns_get_rr_type_by_name(arg2);
|
||||
t = sldns_get_rr_type_by_name(arg2);
|
||||
do_cache_remove(worker, nm, nmlen, t, LDNS_RR_CLASS_IN);
|
||||
|
||||
free(nm);
|
||||
@ -1118,9 +1123,9 @@ struct del_info {
|
||||
/** labels */
|
||||
int labs;
|
||||
/** now */
|
||||
uint32_t now;
|
||||
time_t now;
|
||||
/** time to invalidate to */
|
||||
uint32_t expired;
|
||||
time_t expired;
|
||||
/** number of rrsets removed */
|
||||
size_t num_rrsets;
|
||||
/** number of msgs removed */
|
||||
@ -1388,9 +1393,9 @@ ssl_print_name_dp(SSL* ssl, const char* str, uint8_t* nm, uint16_t dclass,
|
||||
struct delegpt_addr* a;
|
||||
int f = 0;
|
||||
if(str) { /* print header for forward, stub */
|
||||
char* c = ldns_rr_class2str(dclass);
|
||||
char* c = sldns_wire2str_class(dclass);
|
||||
dname_str(nm, buf);
|
||||
if(!ssl_printf(ssl, "%s %s %s: ", buf, c, str)) {
|
||||
if(!ssl_printf(ssl, "%s %s %s: ", buf, (c?c:"CLASS??"), str)) {
|
||||
free(c);
|
||||
return 0;
|
||||
}
|
||||
@ -1571,7 +1576,7 @@ do_forward_add(SSL* ssl, struct worker* worker, char* args)
|
||||
struct delegpt* dp = NULL;
|
||||
if(!parse_fs_args(ssl, args, &nm, &dp, &insecure, NULL))
|
||||
return;
|
||||
if(insecure) {
|
||||
if(insecure && worker->env.anchors) {
|
||||
if(!anchors_add_insecure(worker->env.anchors, LDNS_RR_CLASS_IN,
|
||||
nm)) {
|
||||
(void)ssl_printf(ssl, "error out of memory\n");
|
||||
@ -1598,7 +1603,7 @@ do_forward_remove(SSL* ssl, struct worker* worker, char* args)
|
||||
uint8_t* nm = NULL;
|
||||
if(!parse_fs_args(ssl, args, &nm, NULL, &insecure, NULL))
|
||||
return;
|
||||
if(insecure)
|
||||
if(insecure && worker->env.anchors)
|
||||
anchors_delete_insecure(worker->env.anchors, LDNS_RR_CLASS_IN,
|
||||
nm);
|
||||
forwards_delete_zone(fwd, LDNS_RR_CLASS_IN, nm);
|
||||
@ -1616,7 +1621,7 @@ do_stub_add(SSL* ssl, struct worker* worker, char* args)
|
||||
struct delegpt* dp = NULL;
|
||||
if(!parse_fs_args(ssl, args, &nm, &dp, &insecure, &prime))
|
||||
return;
|
||||
if(insecure) {
|
||||
if(insecure && worker->env.anchors) {
|
||||
if(!anchors_add_insecure(worker->env.anchors, LDNS_RR_CLASS_IN,
|
||||
nm)) {
|
||||
(void)ssl_printf(ssl, "error out of memory\n");
|
||||
@ -1626,8 +1631,9 @@ do_stub_add(SSL* ssl, struct worker* worker, char* args)
|
||||
}
|
||||
}
|
||||
if(!forwards_add_stub_hole(fwd, LDNS_RR_CLASS_IN, nm)) {
|
||||
if(insecure) anchors_delete_insecure(worker->env.anchors,
|
||||
LDNS_RR_CLASS_IN, nm);
|
||||
if(insecure && worker->env.anchors)
|
||||
anchors_delete_insecure(worker->env.anchors,
|
||||
LDNS_RR_CLASS_IN, nm);
|
||||
(void)ssl_printf(ssl, "error out of memory\n");
|
||||
delegpt_free_mlc(dp);
|
||||
free(nm);
|
||||
@ -1636,8 +1642,9 @@ do_stub_add(SSL* ssl, struct worker* worker, char* args)
|
||||
if(!hints_add_stub(worker->env.hints, LDNS_RR_CLASS_IN, dp, !prime)) {
|
||||
(void)ssl_printf(ssl, "error out of memory\n");
|
||||
forwards_delete_stub_hole(fwd, LDNS_RR_CLASS_IN, nm);
|
||||
if(insecure) anchors_delete_insecure(worker->env.anchors,
|
||||
LDNS_RR_CLASS_IN, nm);
|
||||
if(insecure && worker->env.anchors)
|
||||
anchors_delete_insecure(worker->env.anchors,
|
||||
LDNS_RR_CLASS_IN, nm);
|
||||
free(nm);
|
||||
return;
|
||||
}
|
||||
@ -1654,7 +1661,7 @@ do_stub_remove(SSL* ssl, struct worker* worker, char* args)
|
||||
uint8_t* nm = NULL;
|
||||
if(!parse_fs_args(ssl, args, &nm, NULL, &insecure, NULL))
|
||||
return;
|
||||
if(insecure)
|
||||
if(insecure && worker->env.anchors)
|
||||
anchors_delete_insecure(worker->env.anchors, LDNS_RR_CLASS_IN,
|
||||
nm);
|
||||
forwards_delete_stub_hole(fwd, LDNS_RR_CLASS_IN, nm);
|
||||
@ -1663,6 +1670,43 @@ do_stub_remove(SSL* ssl, struct worker* worker, char* args)
|
||||
send_ok(ssl);
|
||||
}
|
||||
|
||||
/** do the insecure_add command */
|
||||
static void
|
||||
do_insecure_add(SSL* ssl, struct worker* worker, char* arg)
|
||||
{
|
||||
size_t nmlen;
|
||||
int nmlabs;
|
||||
uint8_t* nm = NULL;
|
||||
if(!parse_arg_name(ssl, arg, &nm, &nmlen, &nmlabs))
|
||||
return;
|
||||
if(worker->env.anchors) {
|
||||
if(!anchors_add_insecure(worker->env.anchors,
|
||||
LDNS_RR_CLASS_IN, nm)) {
|
||||
(void)ssl_printf(ssl, "error out of memory\n");
|
||||
free(nm);
|
||||
return;
|
||||
}
|
||||
}
|
||||
free(nm);
|
||||
send_ok(ssl);
|
||||
}
|
||||
|
||||
/** do the insecure_remove command */
|
||||
static void
|
||||
do_insecure_remove(SSL* ssl, struct worker* worker, char* arg)
|
||||
{
|
||||
size_t nmlen;
|
||||
int nmlabs;
|
||||
uint8_t* nm = NULL;
|
||||
if(!parse_arg_name(ssl, arg, &nm, &nmlen, &nmlabs))
|
||||
return;
|
||||
if(worker->env.anchors)
|
||||
anchors_delete_insecure(worker->env.anchors,
|
||||
LDNS_RR_CLASS_IN, nm);
|
||||
free(nm);
|
||||
send_ok(ssl);
|
||||
}
|
||||
|
||||
/** do the status command */
|
||||
static void
|
||||
do_status(SSL* ssl, struct worker* worker)
|
||||
@ -1684,7 +1728,7 @@ do_status(SSL* ssl, struct worker* worker)
|
||||
if(!ssl_printf(ssl, " ]\n"))
|
||||
return;
|
||||
uptime = (time_t)time(NULL) - (time_t)worker->daemon->time_boot.tv_sec;
|
||||
if(!ssl_printf(ssl, "uptime: %u seconds\n", (unsigned)uptime))
|
||||
if(!ssl_printf(ssl, "uptime: " ARG_LL "d seconds\n", (long long)uptime))
|
||||
return;
|
||||
if(!ssl_printf(ssl, "unbound (pid %d) is running...\n",
|
||||
(int)getpid()))
|
||||
@ -1703,7 +1747,8 @@ get_mesh_age(struct mesh_state* m, char* buf, size_t len,
|
||||
while(r && r->next)
|
||||
r = r->next;
|
||||
timeval_subtract(&d, env->now_tv, &r->start_time);
|
||||
snprintf(buf, len, "%d.%6.6d", (int)d.tv_sec, (int)d.tv_usec);
|
||||
snprintf(buf, len, ARG_LL "d.%6.6d",
|
||||
(long long)d.tv_sec, (int)d.tv_usec);
|
||||
} else {
|
||||
snprintf(buf, len, "-");
|
||||
}
|
||||
@ -1748,10 +1793,11 @@ get_mesh_status(struct mesh_area* mesh, struct mesh_state* m,
|
||||
if(m->sub_set.count == 0)
|
||||
snprintf(buf, len, " (empty_list)");
|
||||
RBTREE_FOR(sub, struct mesh_state_ref*, &m->sub_set) {
|
||||
char* t = ldns_rr_type2str(sub->s->s.qinfo.qtype);
|
||||
char* c = ldns_rr_class2str(sub->s->s.qinfo.qclass);
|
||||
char* t = sldns_wire2str_type(sub->s->s.qinfo.qtype);
|
||||
char* c = sldns_wire2str_class(sub->s->s.qinfo.qclass);
|
||||
dname_str(sub->s->s.qinfo.qname, nm);
|
||||
snprintf(buf, len, " %s %s %s", t, c, nm);
|
||||
snprintf(buf, len, " %s %s %s", (t?t:"TYPE??"),
|
||||
(c?c:"CLASS??"), nm);
|
||||
l = strlen(buf);
|
||||
buf += l; len -= l;
|
||||
free(t);
|
||||
@ -1780,13 +1826,14 @@ do_dump_requestlist(SSL* ssl, struct worker* worker)
|
||||
mesh = worker->env.mesh;
|
||||
if(!mesh) return;
|
||||
RBTREE_FOR(m, struct mesh_state*, &mesh->all) {
|
||||
char* t = ldns_rr_type2str(m->s.qinfo.qtype);
|
||||
char* c = ldns_rr_class2str(m->s.qinfo.qclass);
|
||||
char* t = sldns_wire2str_type(m->s.qinfo.qtype);
|
||||
char* c = sldns_wire2str_class(m->s.qinfo.qclass);
|
||||
dname_str(m->s.qinfo.qname, buf);
|
||||
get_mesh_age(m, timebuf, sizeof(timebuf), &worker->env);
|
||||
get_mesh_status(mesh, m, statbuf, sizeof(statbuf));
|
||||
if(!ssl_printf(ssl, "%3d %4s %2s %s %s %s\n",
|
||||
num, t, c, buf, timebuf, statbuf)) {
|
||||
num, (t?t:"TYPE??"), (c?c:"CLASS??"), buf, timebuf,
|
||||
statbuf)) {
|
||||
free(t);
|
||||
free(c);
|
||||
return;
|
||||
@ -1804,7 +1851,7 @@ struct infra_arg {
|
||||
/** the SSL connection */
|
||||
SSL* ssl;
|
||||
/** the time now */
|
||||
uint32_t now;
|
||||
time_t now;
|
||||
};
|
||||
|
||||
/** callback for every host element in the infra cache */
|
||||
@ -1927,7 +1974,7 @@ do_list_local_zones(SSL* ssl, struct worker* worker)
|
||||
struct local_zones* zones = worker->daemon->local_zones;
|
||||
struct local_zone* z;
|
||||
char buf[257];
|
||||
lock_quick_lock(&zones->lock);
|
||||
lock_rw_rdlock(&zones->lock);
|
||||
RBTREE_FOR(z, struct local_zone*, &zones->ztree) {
|
||||
lock_rw_rdlock(&z->lock);
|
||||
dname_str(z->name, buf);
|
||||
@ -1935,7 +1982,7 @@ do_list_local_zones(SSL* ssl, struct worker* worker)
|
||||
local_zone_type2str(z->type));
|
||||
lock_rw_unlock(&z->lock);
|
||||
}
|
||||
lock_quick_unlock(&zones->lock);
|
||||
lock_rw_unlock(&zones->lock);
|
||||
}
|
||||
|
||||
/** do the list_local_data command */
|
||||
@ -1946,22 +1993,30 @@ do_list_local_data(SSL* ssl, struct worker* worker)
|
||||
struct local_zone* z;
|
||||
struct local_data* d;
|
||||
struct local_rrset* p;
|
||||
lock_quick_lock(&zones->lock);
|
||||
char* s = (char*)sldns_buffer_begin(worker->env.scratch_buffer);
|
||||
size_t slen = sldns_buffer_capacity(worker->env.scratch_buffer);
|
||||
lock_rw_rdlock(&zones->lock);
|
||||
RBTREE_FOR(z, struct local_zone*, &zones->ztree) {
|
||||
lock_rw_rdlock(&z->lock);
|
||||
RBTREE_FOR(d, struct local_data*, &z->data) {
|
||||
for(p = d->rrsets; p; p = p->next) {
|
||||
ldns_rr_list* rr = packed_rrset_to_rr_list(
|
||||
p->rrset, worker->env.scratch_buffer);
|
||||
char* str = ldns_rr_list2str(rr);
|
||||
(void)ssl_printf(ssl, "%s", str);
|
||||
free(str);
|
||||
ldns_rr_list_free(rr);
|
||||
struct packed_rrset_data* d =
|
||||
(struct packed_rrset_data*)p->rrset->entry.data;
|
||||
size_t i;
|
||||
for(i=0; i<d->count + d->rrsig_count; i++) {
|
||||
if(!packed_rr_to_string(p->rrset, i,
|
||||
0, s, slen)) {
|
||||
if(!ssl_printf(ssl, "BADRR\n"))
|
||||
return;
|
||||
}
|
||||
if(!ssl_printf(ssl, "%s\n", s))
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
lock_rw_unlock(&z->lock);
|
||||
}
|
||||
lock_quick_unlock(&zones->lock);
|
||||
lock_rw_unlock(&zones->lock);
|
||||
}
|
||||
|
||||
/** tell other processes to execute the command */
|
||||
@ -2050,6 +2105,16 @@ execute_cmd(struct daemon_remote* rc, SSL* ssl, char* cmd,
|
||||
if(rc) distribute_cmd(rc, ssl, cmd);
|
||||
do_forward_remove(ssl, worker, skipwhite(p+14));
|
||||
return;
|
||||
} else if(cmdcmp(p, "insecure_add", 12)) {
|
||||
/* must always distribute this cmd */
|
||||
if(rc) distribute_cmd(rc, ssl, cmd);
|
||||
do_insecure_add(ssl, worker, skipwhite(p+12));
|
||||
return;
|
||||
} else if(cmdcmp(p, "insecure_remove", 15)) {
|
||||
/* must always distribute this cmd */
|
||||
if(rc) distribute_cmd(rc, ssl, cmd);
|
||||
do_insecure_remove(ssl, worker, skipwhite(p+15));
|
||||
return;
|
||||
} else if(cmdcmp(p, "forward", 7)) {
|
||||
/* must always distribute this cmd */
|
||||
if(rc) distribute_cmd(rc, ssl, cmd);
|
||||
|
@ -21,16 +21,16 @@
|
||||
* 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.
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDER 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -21,16 +21,16 @@
|
||||
* 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.
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDER 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -40,7 +40,11 @@
|
||||
* numbers. These 'statistics' may be of interest to the operator.
|
||||
*/
|
||||
#include "config.h"
|
||||
#include <ldns/wire2host.h>
|
||||
#ifdef HAVE_TIME_H
|
||||
#include <time.h>
|
||||
#endif
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#include "daemon/stats.h"
|
||||
#include "daemon/worker.h"
|
||||
#include "daemon/daemon.h"
|
||||
@ -51,6 +55,7 @@
|
||||
#include "util/timehist.h"
|
||||
#include "util/net_help.h"
|
||||
#include "validator/validator.h"
|
||||
#include "ldns/sbuffer.h"
|
||||
|
||||
/** add timers and the values do not overflow or become negative */
|
||||
static void
|
||||
@ -257,14 +262,14 @@ void server_stats_insquery(struct server_stats* stats, struct comm_point* c,
|
||||
uint16_t qtype, uint16_t qclass, struct edns_data* edns,
|
||||
struct comm_reply* repinfo)
|
||||
{
|
||||
uint16_t flags = ldns_buffer_read_u16_at(c->buffer, 2);
|
||||
uint16_t flags = sldns_buffer_read_u16_at(c->buffer, 2);
|
||||
if(qtype < STATS_QTYPE_NUM)
|
||||
stats->qtype[qtype]++;
|
||||
else stats->qtype_big++;
|
||||
if(qclass < STATS_QCLASS_NUM)
|
||||
stats->qclass[qclass]++;
|
||||
else stats->qclass_big++;
|
||||
stats->qopcode[ LDNS_OPCODE_WIRE(ldns_buffer_begin(c->buffer)) ]++;
|
||||
stats->qopcode[ LDNS_OPCODE_WIRE(sldns_buffer_begin(c->buffer)) ]++;
|
||||
if(c->type != comm_udp)
|
||||
stats->qtcp++;
|
||||
if(repinfo && addr_is_ip6(&repinfo->addr, repinfo->addrlen))
|
||||
@ -292,12 +297,12 @@ void server_stats_insquery(struct server_stats* stats, struct comm_point* c,
|
||||
}
|
||||
}
|
||||
|
||||
void server_stats_insrcode(struct server_stats* stats, ldns_buffer* buf)
|
||||
void server_stats_insrcode(struct server_stats* stats, sldns_buffer* buf)
|
||||
{
|
||||
if(stats->extended && ldns_buffer_limit(buf) != 0) {
|
||||
int r = (int)LDNS_RCODE_WIRE( ldns_buffer_begin(buf) );
|
||||
if(stats->extended && sldns_buffer_limit(buf) != 0) {
|
||||
int r = (int)LDNS_RCODE_WIRE( sldns_buffer_begin(buf) );
|
||||
stats->ans_rcode[r] ++;
|
||||
if(r == 0 && LDNS_ANCOUNT( ldns_buffer_begin(buf) ) == 0)
|
||||
if(r == 0 && LDNS_ANCOUNT( sldns_buffer_begin(buf) ) == 0)
|
||||
stats->ans_rcode_nodata ++;
|
||||
}
|
||||
}
|
||||
|
@ -21,16 +21,16 @@
|
||||
* 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.
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDER 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -43,12 +43,12 @@
|
||||
#ifndef DAEMON_STATS_H
|
||||
#define DAEMON_STATS_H
|
||||
#include "util/timehist.h"
|
||||
#include <ldns/buffer.h>
|
||||
struct worker;
|
||||
struct config_file;
|
||||
struct comm_point;
|
||||
struct comm_reply;
|
||||
struct edns_data;
|
||||
struct sldns_buffer;
|
||||
|
||||
/** number of qtype that is stored for in array */
|
||||
#define STATS_QTYPE_NUM 256
|
||||
@ -230,6 +230,6 @@ void server_stats_insquery(struct server_stats* stats, struct comm_point* c,
|
||||
* @param stats: the stats
|
||||
* @param buf: buffer with rcode. If buffer is length0: not counted.
|
||||
*/
|
||||
void server_stats_insrcode(struct server_stats* stats, ldns_buffer* buf);
|
||||
void server_stats_insrcode(struct server_stats* stats, struct sldns_buffer* buf);
|
||||
|
||||
#endif /* DAEMON_STATS_H */
|
||||
|
@ -21,16 +21,16 @@
|
||||
* 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.
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDER 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.
|
||||
*
|
||||
*/
|
||||
|
||||
@ -67,9 +67,12 @@
|
||||
#include <grp.h>
|
||||
#endif
|
||||
|
||||
#ifndef S_SPLINT_S
|
||||
/* splint chokes on this system header file */
|
||||
#ifdef HAVE_SYS_RESOURCE_H
|
||||
#include <sys/resource.h>
|
||||
#endif
|
||||
#endif /* S_SPLINT_S */
|
||||
#ifdef HAVE_LOGIN_CAP_H
|
||||
#include <login_cap.h>
|
||||
#endif
|
||||
@ -165,8 +168,8 @@ static void usage()
|
||||
#endif
|
||||
printf("Version %s\n", PACKAGE_VERSION);
|
||||
get_event_sys(&evnm, &evsys, &evmethod);
|
||||
printf("linked libs: %s %s (it uses %s), ldns %s, %s\n",
|
||||
evnm, evsys, evmethod, ldns_version(),
|
||||
printf("linked libs: %s %s (it uses %s), %s\n",
|
||||
evnm, evsys, evmethod,
|
||||
#ifdef HAVE_SSL
|
||||
SSLeay_version(SSLEAY_VERSION)
|
||||
#elif defined(HAVE_NSS)
|
||||
@ -193,6 +196,7 @@ int replay_var_compare(const void* ATTR_UNUSED(a), const void* ATTR_UNUSED(b))
|
||||
static void
|
||||
checkrlimits(struct config_file* cfg)
|
||||
{
|
||||
#ifndef S_SPLINT_S
|
||||
#ifdef HAVE_GETRLIMIT
|
||||
/* list has number of ports to listen to, ifs number addresses */
|
||||
int list = ((cfg->do_udp?1:0) + (cfg->do_tcp?1 +
|
||||
@ -283,6 +287,7 @@ checkrlimits(struct config_file* cfg)
|
||||
#else
|
||||
(void)cfg;
|
||||
#endif /* HAVE_GETRLIMIT */
|
||||
#endif /* S_SPLINT_S */
|
||||
}
|
||||
|
||||
/** set verbosity, check rlimits, cache settings */
|
||||
@ -522,7 +527,7 @@ perform_setup(struct daemon* daemon, struct config_file* cfg, int debug_mode,
|
||||
/* setusercontext does initgroups, setuid, setgid, and
|
||||
* also resource limits from login config, but we
|
||||
* still call setresuid, setresgid to be sure to set all uid*/
|
||||
if(setusercontext(NULL, pwd, uid,
|
||||
if(setusercontext(NULL, pwd, uid, (unsigned)
|
||||
LOGIN_SETALL & ~LOGIN_SETUSER & ~LOGIN_SETGROUP) != 0)
|
||||
log_warn("unable to setusercontext %s: %s",
|
||||
cfg->username, strerror(errno));
|
||||
@ -715,6 +720,7 @@ main(int argc, char* argv[])
|
||||
#endif
|
||||
|
||||
log_init(NULL, 0, NULL);
|
||||
log_ident_set(strrchr(argv[0],'/')?strrchr(argv[0],'/')+1:argv[0]);
|
||||
/* parse the options */
|
||||
while( (c=getopt(argc, argv, "c:dhvw:")) != -1) {
|
||||
switch(c) {
|
||||
|
@ -21,16 +21,16 @@
|
||||
* 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.
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDER 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -40,7 +40,6 @@
|
||||
* pending requests.
|
||||
*/
|
||||
#include "config.h"
|
||||
#include <ldns/wire2host.h>
|
||||
#include "util/log.h"
|
||||
#include "util/net_help.h"
|
||||
#include "util/random.h"
|
||||
@ -72,6 +71,7 @@
|
||||
#include "validator/val_anchor.h"
|
||||
#include "libunbound/context.h"
|
||||
#include "libunbound/libworker.h"
|
||||
#include "ldns/sbuffer.h"
|
||||
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
@ -181,7 +181,7 @@ worker_mem_report(struct worker* ATTR_UNUSED(worker),
|
||||
+ sizeof(worker->rndstate)
|
||||
+ regional_get_mem(worker->scratchpad)
|
||||
+ sizeof(*worker->env.scratch_buffer)
|
||||
+ ldns_buffer_capacity(worker->env.scratch_buffer)
|
||||
+ sldns_buffer_capacity(worker->env.scratch_buffer)
|
||||
+ forwards_get_mem(worker->env.fwds)
|
||||
+ hints_get_mem(worker->env.hints);
|
||||
if(worker->thread_num == 0)
|
||||
@ -243,10 +243,10 @@ worker_handle_reply(struct comm_point* c, void* arg, int error,
|
||||
return 0;
|
||||
}
|
||||
/* sanity check. */
|
||||
if(!LDNS_QR_WIRE(ldns_buffer_begin(c->buffer))
|
||||
|| LDNS_OPCODE_WIRE(ldns_buffer_begin(c->buffer)) !=
|
||||
if(!LDNS_QR_WIRE(sldns_buffer_begin(c->buffer))
|
||||
|| LDNS_OPCODE_WIRE(sldns_buffer_begin(c->buffer)) !=
|
||||
LDNS_PACKET_QUERY
|
||||
|| LDNS_QDCOUNT(ldns_buffer_begin(c->buffer)) > 1) {
|
||||
|| LDNS_QDCOUNT(sldns_buffer_begin(c->buffer)) > 1) {
|
||||
/* error becomes timeout for the module as if this reply
|
||||
* never arrived. */
|
||||
mesh_report_reply(worker->env.mesh, &e, reply_info,
|
||||
@ -274,10 +274,10 @@ worker_handle_service_reply(struct comm_point* c, void* arg, int error,
|
||||
return 0;
|
||||
}
|
||||
/* sanity check. */
|
||||
if(!LDNS_QR_WIRE(ldns_buffer_begin(c->buffer))
|
||||
|| LDNS_OPCODE_WIRE(ldns_buffer_begin(c->buffer)) !=
|
||||
if(!LDNS_QR_WIRE(sldns_buffer_begin(c->buffer))
|
||||
|| LDNS_OPCODE_WIRE(sldns_buffer_begin(c->buffer)) !=
|
||||
LDNS_PACKET_QUERY
|
||||
|| LDNS_QDCOUNT(ldns_buffer_begin(c->buffer)) > 1) {
|
||||
|| LDNS_QDCOUNT(sldns_buffer_begin(c->buffer)) > 1) {
|
||||
/* error becomes timeout for the module as if this reply
|
||||
* never arrived. */
|
||||
verbose(VERB_ALGO, "worker: bad reply handled as timeout");
|
||||
@ -297,49 +297,49 @@ worker_handle_service_reply(struct comm_point* c, void* arg, int error,
|
||||
* @return error code, 0 OK, or -1 discard.
|
||||
*/
|
||||
static int
|
||||
worker_check_request(ldns_buffer* pkt, struct worker* worker)
|
||||
worker_check_request(sldns_buffer* pkt, struct worker* worker)
|
||||
{
|
||||
if(ldns_buffer_limit(pkt) < LDNS_HEADER_SIZE) {
|
||||
if(sldns_buffer_limit(pkt) < LDNS_HEADER_SIZE) {
|
||||
verbose(VERB_QUERY, "request too short, discarded");
|
||||
return -1;
|
||||
}
|
||||
if(ldns_buffer_limit(pkt) > NORMAL_UDP_SIZE &&
|
||||
if(sldns_buffer_limit(pkt) > NORMAL_UDP_SIZE &&
|
||||
worker->daemon->cfg->harden_large_queries) {
|
||||
verbose(VERB_QUERY, "request too large, discarded");
|
||||
return -1;
|
||||
}
|
||||
if(LDNS_QR_WIRE(ldns_buffer_begin(pkt))) {
|
||||
if(LDNS_QR_WIRE(sldns_buffer_begin(pkt))) {
|
||||
verbose(VERB_QUERY, "request has QR bit on, discarded");
|
||||
return -1;
|
||||
}
|
||||
if(LDNS_TC_WIRE(ldns_buffer_begin(pkt))) {
|
||||
LDNS_TC_CLR(ldns_buffer_begin(pkt));
|
||||
if(LDNS_TC_WIRE(sldns_buffer_begin(pkt))) {
|
||||
LDNS_TC_CLR(sldns_buffer_begin(pkt));
|
||||
verbose(VERB_QUERY, "request bad, has TC bit on");
|
||||
return LDNS_RCODE_FORMERR;
|
||||
}
|
||||
if(LDNS_OPCODE_WIRE(ldns_buffer_begin(pkt)) != LDNS_PACKET_QUERY) {
|
||||
if(LDNS_OPCODE_WIRE(sldns_buffer_begin(pkt)) != LDNS_PACKET_QUERY) {
|
||||
verbose(VERB_QUERY, "request unknown opcode %d",
|
||||
LDNS_OPCODE_WIRE(ldns_buffer_begin(pkt)));
|
||||
LDNS_OPCODE_WIRE(sldns_buffer_begin(pkt)));
|
||||
return LDNS_RCODE_NOTIMPL;
|
||||
}
|
||||
if(LDNS_QDCOUNT(ldns_buffer_begin(pkt)) != 1) {
|
||||
if(LDNS_QDCOUNT(sldns_buffer_begin(pkt)) != 1) {
|
||||
verbose(VERB_QUERY, "request wrong nr qd=%d",
|
||||
LDNS_QDCOUNT(ldns_buffer_begin(pkt)));
|
||||
LDNS_QDCOUNT(sldns_buffer_begin(pkt)));
|
||||
return LDNS_RCODE_FORMERR;
|
||||
}
|
||||
if(LDNS_ANCOUNT(ldns_buffer_begin(pkt)) != 0) {
|
||||
if(LDNS_ANCOUNT(sldns_buffer_begin(pkt)) != 0) {
|
||||
verbose(VERB_QUERY, "request wrong nr an=%d",
|
||||
LDNS_ANCOUNT(ldns_buffer_begin(pkt)));
|
||||
LDNS_ANCOUNT(sldns_buffer_begin(pkt)));
|
||||
return LDNS_RCODE_FORMERR;
|
||||
}
|
||||
if(LDNS_NSCOUNT(ldns_buffer_begin(pkt)) != 0) {
|
||||
if(LDNS_NSCOUNT(sldns_buffer_begin(pkt)) != 0) {
|
||||
verbose(VERB_QUERY, "request wrong nr ns=%d",
|
||||
LDNS_NSCOUNT(ldns_buffer_begin(pkt)));
|
||||
LDNS_NSCOUNT(sldns_buffer_begin(pkt)));
|
||||
return LDNS_RCODE_FORMERR;
|
||||
}
|
||||
if(LDNS_ARCOUNT(ldns_buffer_begin(pkt)) > 1) {
|
||||
if(LDNS_ARCOUNT(sldns_buffer_begin(pkt)) > 1) {
|
||||
verbose(VERB_QUERY, "request wrong nr ar=%d",
|
||||
LDNS_ARCOUNT(ldns_buffer_begin(pkt)));
|
||||
LDNS_ARCOUNT(sldns_buffer_begin(pkt)));
|
||||
return LDNS_RCODE_FORMERR;
|
||||
}
|
||||
return 0;
|
||||
@ -361,7 +361,7 @@ worker_handle_control_cmd(struct tube* ATTR_UNUSED(tube), uint8_t* msg,
|
||||
if(len != sizeof(uint32_t)) {
|
||||
fatal_exit("bad control msg length %d", (int)len);
|
||||
}
|
||||
cmd = ldns_read_uint32(msg);
|
||||
cmd = sldns_read_uint32(msg);
|
||||
free(msg);
|
||||
switch(cmd) {
|
||||
case worker_cmd_quit:
|
||||
@ -451,7 +451,7 @@ answer_norec_from_cache(struct worker* worker, struct query_info* qinfo,
|
||||
*/
|
||||
uint16_t udpsize = edns->udp_size;
|
||||
int secure = 0;
|
||||
uint32_t timenow = *worker->env.now;
|
||||
time_t timenow = *worker->env.now;
|
||||
int must_validate = (!(flags&BIT_CD) || worker->env.cfg->ignore_cd)
|
||||
&& worker->env.need_to_validate;
|
||||
struct dns_msg *msg = NULL;
|
||||
@ -526,7 +526,7 @@ answer_from_cache(struct worker* worker, struct query_info* qinfo,
|
||||
struct reply_info* rep, uint16_t id, uint16_t flags,
|
||||
struct comm_reply* repinfo, struct edns_data* edns)
|
||||
{
|
||||
uint32_t timenow = *worker->env.now;
|
||||
time_t timenow = *worker->env.now;
|
||||
uint16_t udpsize = edns->udp_size;
|
||||
int secure;
|
||||
int must_validate = (!(flags&BIT_CD) || worker->env.cfg->ignore_cd)
|
||||
@ -616,7 +616,7 @@ answer_from_cache(struct worker* worker, struct query_info* qinfo,
|
||||
/** Reply to client and perform prefetch to keep cache up to date */
|
||||
static void
|
||||
reply_and_prefetch(struct worker* worker, struct query_info* qinfo,
|
||||
uint16_t flags, struct comm_reply* repinfo, uint32_t leeway)
|
||||
uint16_t flags, struct comm_reply* repinfo, time_t leeway)
|
||||
{
|
||||
/* first send answer to client to keep its latency
|
||||
* as small as a cachereply */
|
||||
@ -638,32 +638,32 @@ reply_and_prefetch(struct worker* worker, struct query_info* qinfo,
|
||||
* @param edns: edns reply information.
|
||||
*/
|
||||
static void
|
||||
chaos_replystr(ldns_buffer* pkt, const char* str, struct edns_data* edns)
|
||||
chaos_replystr(sldns_buffer* pkt, const char* str, struct edns_data* edns)
|
||||
{
|
||||
size_t len = strlen(str);
|
||||
unsigned int rd = LDNS_RD_WIRE(ldns_buffer_begin(pkt));
|
||||
unsigned int cd = LDNS_CD_WIRE(ldns_buffer_begin(pkt));
|
||||
unsigned int rd = LDNS_RD_WIRE(sldns_buffer_begin(pkt));
|
||||
unsigned int cd = LDNS_CD_WIRE(sldns_buffer_begin(pkt));
|
||||
if(len>255) len=255; /* cap size of TXT record */
|
||||
ldns_buffer_clear(pkt);
|
||||
ldns_buffer_skip(pkt, (ssize_t)sizeof(uint16_t)); /* skip id */
|
||||
ldns_buffer_write_u16(pkt, (uint16_t)(BIT_QR|BIT_RA));
|
||||
if(rd) LDNS_RD_SET(ldns_buffer_begin(pkt));
|
||||
if(cd) LDNS_CD_SET(ldns_buffer_begin(pkt));
|
||||
ldns_buffer_write_u16(pkt, 1); /* qdcount */
|
||||
ldns_buffer_write_u16(pkt, 1); /* ancount */
|
||||
ldns_buffer_write_u16(pkt, 0); /* nscount */
|
||||
ldns_buffer_write_u16(pkt, 0); /* arcount */
|
||||
sldns_buffer_clear(pkt);
|
||||
sldns_buffer_skip(pkt, (ssize_t)sizeof(uint16_t)); /* skip id */
|
||||
sldns_buffer_write_u16(pkt, (uint16_t)(BIT_QR|BIT_RA));
|
||||
if(rd) LDNS_RD_SET(sldns_buffer_begin(pkt));
|
||||
if(cd) LDNS_CD_SET(sldns_buffer_begin(pkt));
|
||||
sldns_buffer_write_u16(pkt, 1); /* qdcount */
|
||||
sldns_buffer_write_u16(pkt, 1); /* ancount */
|
||||
sldns_buffer_write_u16(pkt, 0); /* nscount */
|
||||
sldns_buffer_write_u16(pkt, 0); /* arcount */
|
||||
(void)query_dname_len(pkt); /* skip qname */
|
||||
ldns_buffer_skip(pkt, (ssize_t)sizeof(uint16_t)); /* skip qtype */
|
||||
ldns_buffer_skip(pkt, (ssize_t)sizeof(uint16_t)); /* skip qclass */
|
||||
ldns_buffer_write_u16(pkt, 0xc00c); /* compr ptr to query */
|
||||
ldns_buffer_write_u16(pkt, LDNS_RR_TYPE_TXT);
|
||||
ldns_buffer_write_u16(pkt, LDNS_RR_CLASS_CH);
|
||||
ldns_buffer_write_u32(pkt, 0); /* TTL */
|
||||
ldns_buffer_write_u16(pkt, sizeof(uint8_t) + len);
|
||||
ldns_buffer_write_u8(pkt, len);
|
||||
ldns_buffer_write(pkt, str, len);
|
||||
ldns_buffer_flip(pkt);
|
||||
sldns_buffer_skip(pkt, (ssize_t)sizeof(uint16_t)); /* skip qtype */
|
||||
sldns_buffer_skip(pkt, (ssize_t)sizeof(uint16_t)); /* skip qclass */
|
||||
sldns_buffer_write_u16(pkt, 0xc00c); /* compr ptr to query */
|
||||
sldns_buffer_write_u16(pkt, LDNS_RR_TYPE_TXT);
|
||||
sldns_buffer_write_u16(pkt, LDNS_RR_CLASS_CH);
|
||||
sldns_buffer_write_u32(pkt, 0); /* TTL */
|
||||
sldns_buffer_write_u16(pkt, sizeof(uint8_t) + len);
|
||||
sldns_buffer_write_u8(pkt, len);
|
||||
sldns_buffer_write(pkt, str, len);
|
||||
sldns_buffer_flip(pkt);
|
||||
edns->edns_version = EDNS_ADVERTISED_VERSION;
|
||||
edns->udp_size = EDNS_ADVERTISED_SIZE;
|
||||
edns->bits &= EDNS_DO;
|
||||
@ -680,7 +680,7 @@ chaos_replystr(ldns_buffer* pkt, const char* str, struct edns_data* edns)
|
||||
*/
|
||||
static int
|
||||
answer_chaos(struct worker* w, struct query_info* qinfo,
|
||||
struct edns_data* edns, ldns_buffer* pkt)
|
||||
struct edns_data* edns, sldns_buffer* pkt)
|
||||
{
|
||||
struct config_file* cfg = w->env.cfg;
|
||||
if(qinfo->qtype != LDNS_RR_TYPE_ANY && qinfo->qtype != LDNS_RR_TYPE_TXT)
|
||||
@ -720,6 +720,52 @@ answer_chaos(struct worker* w, struct query_info* qinfo,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
deny_refuse(struct comm_point* c, enum acl_access acl,
|
||||
enum acl_access deny, enum acl_access refuse,
|
||||
struct worker* worker, struct comm_reply* repinfo)
|
||||
{
|
||||
if(acl == deny) {
|
||||
comm_point_drop_reply(repinfo);
|
||||
if(worker->stats.extended)
|
||||
worker->stats.unwanted_queries++;
|
||||
return 0;
|
||||
} else if(acl == refuse) {
|
||||
log_addr(VERB_ALGO, "refused query from",
|
||||
&repinfo->addr, repinfo->addrlen);
|
||||
log_buf(VERB_ALGO, "refuse", c->buffer);
|
||||
if(worker->stats.extended)
|
||||
worker->stats.unwanted_queries++;
|
||||
if(worker_check_request(c->buffer, worker) == -1) {
|
||||
comm_point_drop_reply(repinfo);
|
||||
return 0; /* discard this */
|
||||
}
|
||||
sldns_buffer_set_limit(c->buffer, LDNS_HEADER_SIZE);
|
||||
sldns_buffer_write_at(c->buffer, 4,
|
||||
(uint8_t*)"\0\0\0\0\0\0\0\0", 8);
|
||||
LDNS_QR_SET(sldns_buffer_begin(c->buffer));
|
||||
LDNS_RCODE_SET(sldns_buffer_begin(c->buffer),
|
||||
LDNS_RCODE_REFUSED);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int
|
||||
deny_refuse_all(struct comm_point* c, enum acl_access acl,
|
||||
struct worker* worker, struct comm_reply* repinfo)
|
||||
{
|
||||
return deny_refuse(c, acl, acl_deny, acl_refuse, worker, repinfo);
|
||||
}
|
||||
|
||||
static int
|
||||
deny_refuse_non_local(struct comm_point* c, enum acl_access acl,
|
||||
struct worker* worker, struct comm_reply* repinfo)
|
||||
{
|
||||
return deny_refuse(c, acl, acl_deny_non_local, acl_refuse_non_local, worker, repinfo);
|
||||
}
|
||||
|
||||
int
|
||||
worker_handle_request(struct comm_point* c, void* arg, int error,
|
||||
struct comm_reply* repinfo)
|
||||
@ -739,35 +785,16 @@ worker_handle_request(struct comm_point* c, void* arg, int error,
|
||||
}
|
||||
acl = acl_list_lookup(worker->daemon->acl, &repinfo->addr,
|
||||
repinfo->addrlen);
|
||||
if(acl == acl_deny) {
|
||||
comm_point_drop_reply(repinfo);
|
||||
if(worker->stats.extended)
|
||||
worker->stats.unwanted_queries++;
|
||||
return 0;
|
||||
} else if(acl == acl_refuse) {
|
||||
log_addr(VERB_ALGO, "refused query from",
|
||||
&repinfo->addr, repinfo->addrlen);
|
||||
log_buf(VERB_ALGO, "refuse", c->buffer);
|
||||
if(worker->stats.extended)
|
||||
worker->stats.unwanted_queries++;
|
||||
if(worker_check_request(c->buffer, worker) == -1) {
|
||||
comm_point_drop_reply(repinfo);
|
||||
return 0; /* discard this */
|
||||
}
|
||||
ldns_buffer_set_limit(c->buffer, LDNS_HEADER_SIZE);
|
||||
ldns_buffer_write_at(c->buffer, 4,
|
||||
(uint8_t*)"\0\0\0\0\0\0\0\0", 8);
|
||||
LDNS_QR_SET(ldns_buffer_begin(c->buffer));
|
||||
LDNS_RCODE_SET(ldns_buffer_begin(c->buffer),
|
||||
LDNS_RCODE_REFUSED);
|
||||
return 1;
|
||||
if((ret=deny_refuse_all(c, acl, worker, repinfo)) != -1)
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
if((ret=worker_check_request(c->buffer, worker)) != 0) {
|
||||
verbose(VERB_ALGO, "worker check request: bad query.");
|
||||
log_addr(VERB_CLIENT,"from",&repinfo->addr, repinfo->addrlen);
|
||||
if(ret != -1) {
|
||||
LDNS_QR_SET(ldns_buffer_begin(c->buffer));
|
||||
LDNS_RCODE_SET(ldns_buffer_begin(c->buffer), ret);
|
||||
LDNS_QR_SET(sldns_buffer_begin(c->buffer));
|
||||
LDNS_RCODE_SET(sldns_buffer_begin(c->buffer), ret);
|
||||
return 1;
|
||||
}
|
||||
comm_point_drop_reply(repinfo);
|
||||
@ -778,9 +805,9 @@ worker_handle_request(struct comm_point* c, void* arg, int error,
|
||||
if(!query_info_parse(&qinfo, c->buffer)) {
|
||||
verbose(VERB_ALGO, "worker parse request: formerror.");
|
||||
log_addr(VERB_CLIENT,"from",&repinfo->addr, repinfo->addrlen);
|
||||
ldns_buffer_rewind(c->buffer);
|
||||
LDNS_QR_SET(ldns_buffer_begin(c->buffer));
|
||||
LDNS_RCODE_SET(ldns_buffer_begin(c->buffer),
|
||||
sldns_buffer_rewind(c->buffer);
|
||||
LDNS_QR_SET(sldns_buffer_begin(c->buffer));
|
||||
LDNS_RCODE_SET(sldns_buffer_begin(c->buffer),
|
||||
LDNS_RCODE_FORMERR);
|
||||
server_stats_insrcode(&worker->stats, c->buffer);
|
||||
return 1;
|
||||
@ -794,9 +821,9 @@ worker_handle_request(struct comm_point* c, void* arg, int error,
|
||||
qinfo.qtype == LDNS_RR_TYPE_IXFR) {
|
||||
verbose(VERB_ALGO, "worker request: refused zone transfer.");
|
||||
log_addr(VERB_CLIENT,"from",&repinfo->addr, repinfo->addrlen);
|
||||
ldns_buffer_rewind(c->buffer);
|
||||
LDNS_QR_SET(ldns_buffer_begin(c->buffer));
|
||||
LDNS_RCODE_SET(ldns_buffer_begin(c->buffer),
|
||||
sldns_buffer_rewind(c->buffer);
|
||||
LDNS_QR_SET(sldns_buffer_begin(c->buffer));
|
||||
LDNS_RCODE_SET(sldns_buffer_begin(c->buffer),
|
||||
LDNS_RCODE_REFUSED);
|
||||
if(worker->stats.extended) {
|
||||
worker->stats.qtype[qinfo.qtype]++;
|
||||
@ -807,9 +834,9 @@ worker_handle_request(struct comm_point* c, void* arg, int error,
|
||||
if((ret=parse_edns_from_pkt(c->buffer, &edns)) != 0) {
|
||||
verbose(VERB_ALGO, "worker parse edns: formerror.");
|
||||
log_addr(VERB_CLIENT,"from",&repinfo->addr, repinfo->addrlen);
|
||||
ldns_buffer_rewind(c->buffer);
|
||||
LDNS_QR_SET(ldns_buffer_begin(c->buffer));
|
||||
LDNS_RCODE_SET(ldns_buffer_begin(c->buffer), ret);
|
||||
sldns_buffer_rewind(c->buffer);
|
||||
LDNS_QR_SET(sldns_buffer_begin(c->buffer));
|
||||
LDNS_RCODE_SET(sldns_buffer_begin(c->buffer), ret);
|
||||
server_stats_insrcode(&worker->stats, c->buffer);
|
||||
return 1;
|
||||
}
|
||||
@ -821,8 +848,8 @@ worker_handle_request(struct comm_point* c, void* arg, int error,
|
||||
verbose(VERB_ALGO, "query with bad edns version.");
|
||||
log_addr(VERB_CLIENT,"from",&repinfo->addr, repinfo->addrlen);
|
||||
error_encode(c->buffer, EDNS_RCODE_BADVERS&0xf, &qinfo,
|
||||
*(uint16_t*)(void *)ldns_buffer_begin(c->buffer),
|
||||
ldns_buffer_read_u16_at(c->buffer, 2), NULL);
|
||||
*(uint16_t*)(void *)sldns_buffer_begin(c->buffer),
|
||||
sldns_buffer_read_u16_at(c->buffer, 2), NULL);
|
||||
attach_edns_record(c->buffer, &edns);
|
||||
return 1;
|
||||
}
|
||||
@ -833,17 +860,25 @@ worker_handle_request(struct comm_point* c, void* arg, int error,
|
||||
log_addr(VERB_CLIENT,"from",&repinfo->addr, repinfo->addrlen);
|
||||
edns.udp_size = NORMAL_UDP_SIZE;
|
||||
}
|
||||
if(edns.edns_present && edns.udp_size < LDNS_HEADER_SIZE) {
|
||||
if(edns.udp_size > worker->daemon->cfg->max_udp_size &&
|
||||
c->type == comm_udp) {
|
||||
verbose(VERB_QUERY,
|
||||
"worker request: max UDP reply size modified"
|
||||
" (%d to max-udp-size)", (int)edns.udp_size);
|
||||
log_addr(VERB_CLIENT,"from",&repinfo->addr, repinfo->addrlen);
|
||||
edns.udp_size = worker->daemon->cfg->max_udp_size;
|
||||
}
|
||||
if(edns.udp_size < LDNS_HEADER_SIZE) {
|
||||
verbose(VERB_ALGO, "worker request: edns is too small.");
|
||||
log_addr(VERB_CLIENT, "from", &repinfo->addr, repinfo->addrlen);
|
||||
LDNS_QR_SET(ldns_buffer_begin(c->buffer));
|
||||
LDNS_TC_SET(ldns_buffer_begin(c->buffer));
|
||||
LDNS_RCODE_SET(ldns_buffer_begin(c->buffer),
|
||||
LDNS_QR_SET(sldns_buffer_begin(c->buffer));
|
||||
LDNS_TC_SET(sldns_buffer_begin(c->buffer));
|
||||
LDNS_RCODE_SET(sldns_buffer_begin(c->buffer),
|
||||
LDNS_RCODE_SERVFAIL);
|
||||
ldns_buffer_set_position(c->buffer, LDNS_HEADER_SIZE);
|
||||
ldns_buffer_write_at(c->buffer, 4,
|
||||
sldns_buffer_set_position(c->buffer, LDNS_HEADER_SIZE);
|
||||
sldns_buffer_write_at(c->buffer, 4,
|
||||
(uint8_t*)"\0\0\0\0\0\0\0\0", 8);
|
||||
ldns_buffer_flip(c->buffer);
|
||||
sldns_buffer_flip(c->buffer);
|
||||
return 1;
|
||||
}
|
||||
if(worker->stats.extended)
|
||||
@ -859,22 +894,32 @@ worker_handle_request(struct comm_point* c, void* arg, int error,
|
||||
if(local_zones_answer(worker->daemon->local_zones, &qinfo, &edns,
|
||||
c->buffer, worker->scratchpad)) {
|
||||
regional_free_all(worker->scratchpad);
|
||||
if(ldns_buffer_limit(c->buffer) == 0) {
|
||||
if(sldns_buffer_limit(c->buffer) == 0) {
|
||||
comm_point_drop_reply(repinfo);
|
||||
return 0;
|
||||
}
|
||||
server_stats_insrcode(&worker->stats, c->buffer);
|
||||
return 1;
|
||||
}
|
||||
if(!(LDNS_RD_WIRE(ldns_buffer_begin(c->buffer))) &&
|
||||
|
||||
/* We've looked in our local zones. If the answer isn't there, we
|
||||
* might need to bail out based on ACLs now. */
|
||||
if((ret=deny_refuse_non_local(c, acl, worker, repinfo)) != -1)
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* If this request does not have the recursion bit set, verify
|
||||
* ACLs allow the snooping. */
|
||||
if(!(LDNS_RD_WIRE(sldns_buffer_begin(c->buffer))) &&
|
||||
acl != acl_allow_snoop ) {
|
||||
ldns_buffer_set_limit(c->buffer, LDNS_HEADER_SIZE);
|
||||
ldns_buffer_write_at(c->buffer, 4,
|
||||
sldns_buffer_set_limit(c->buffer, LDNS_HEADER_SIZE);
|
||||
sldns_buffer_write_at(c->buffer, 4,
|
||||
(uint8_t*)"\0\0\0\0\0\0\0\0", 8);
|
||||
LDNS_QR_SET(ldns_buffer_begin(c->buffer));
|
||||
LDNS_RCODE_SET(ldns_buffer_begin(c->buffer),
|
||||
LDNS_QR_SET(sldns_buffer_begin(c->buffer));
|
||||
LDNS_RCODE_SET(sldns_buffer_begin(c->buffer),
|
||||
LDNS_RCODE_REFUSED);
|
||||
ldns_buffer_flip(c->buffer);
|
||||
sldns_buffer_flip(c->buffer);
|
||||
server_stats_insrcode(&worker->stats, c->buffer);
|
||||
log_addr(VERB_ALGO, "refused nonrec (cache snoop) query from",
|
||||
&repinfo->addr, repinfo->addrlen);
|
||||
@ -885,17 +930,17 @@ worker_handle_request(struct comm_point* c, void* arg, int error,
|
||||
/* answer from cache - we have acquired a readlock on it */
|
||||
if(answer_from_cache(worker, &qinfo,
|
||||
(struct reply_info*)e->data,
|
||||
*(uint16_t*)(void *)ldns_buffer_begin(c->buffer),
|
||||
ldns_buffer_read_u16_at(c->buffer, 2), repinfo,
|
||||
*(uint16_t*)(void *)sldns_buffer_begin(c->buffer),
|
||||
sldns_buffer_read_u16_at(c->buffer, 2), repinfo,
|
||||
&edns)) {
|
||||
/* prefetch it if the prefetch TTL expired */
|
||||
if(worker->env.cfg->prefetch && *worker->env.now >=
|
||||
((struct reply_info*)e->data)->prefetch_ttl) {
|
||||
uint32_t leeway = ((struct reply_info*)e->
|
||||
time_t leeway = ((struct reply_info*)e->
|
||||
data)->ttl - *worker->env.now;
|
||||
lock_rw_unlock(&e->lock);
|
||||
reply_and_prefetch(worker, &qinfo,
|
||||
ldns_buffer_read_u16_at(c->buffer, 2),
|
||||
sldns_buffer_read_u16_at(c->buffer, 2),
|
||||
repinfo, leeway);
|
||||
return 0;
|
||||
}
|
||||
@ -905,17 +950,17 @@ worker_handle_request(struct comm_point* c, void* arg, int error,
|
||||
verbose(VERB_ALGO, "answer from the cache failed");
|
||||
lock_rw_unlock(&e->lock);
|
||||
}
|
||||
if(!LDNS_RD_WIRE(ldns_buffer_begin(c->buffer))) {
|
||||
if(!LDNS_RD_WIRE(sldns_buffer_begin(c->buffer))) {
|
||||
if(answer_norec_from_cache(worker, &qinfo,
|
||||
*(uint16_t*)(void *)ldns_buffer_begin(c->buffer),
|
||||
ldns_buffer_read_u16_at(c->buffer, 2), repinfo,
|
||||
*(uint16_t*)(void *)sldns_buffer_begin(c->buffer),
|
||||
sldns_buffer_read_u16_at(c->buffer, 2), repinfo,
|
||||
&edns)) {
|
||||
return 1;
|
||||
}
|
||||
verbose(VERB_ALGO, "answer norec from cache -- "
|
||||
"need to validate or not primed");
|
||||
}
|
||||
ldns_buffer_rewind(c->buffer);
|
||||
sldns_buffer_rewind(c->buffer);
|
||||
server_stats_querymiss(&worker->stats, worker);
|
||||
|
||||
if(verbosity >= VERB_CLIENT) {
|
||||
@ -928,8 +973,8 @@ worker_handle_request(struct comm_point* c, void* arg, int error,
|
||||
|
||||
/* grab a work request structure for this new request */
|
||||
mesh_new_client(worker->env.mesh, &qinfo,
|
||||
ldns_buffer_read_u16_at(c->buffer, 2), &edns, repinfo,
|
||||
*(uint16_t*)(void *)ldns_buffer_begin(c->buffer));
|
||||
sldns_buffer_read_u16_at(c->buffer, 2),
|
||||
&edns, repinfo, *(uint16_t*)(void *)sldns_buffer_begin(c->buffer));
|
||||
worker_mem_report(worker, NULL);
|
||||
return 0;
|
||||
}
|
||||
@ -1113,7 +1158,7 @@ worker_init(struct worker* worker, struct config_file *cfg,
|
||||
worker->daemon->env->infra_cache, worker->rndstate,
|
||||
cfg->use_caps_bits_for_id, worker->ports, worker->numports,
|
||||
cfg->unwanted_threshold, &worker_alloc_cleanup, worker,
|
||||
cfg->do_udp, worker->daemon->connect_sslctx);
|
||||
cfg->do_udp, worker->daemon->connect_sslctx, cfg->delay_close);
|
||||
if(!worker->back) {
|
||||
log_err("could not create outgoing sockets");
|
||||
worker_delete(worker);
|
||||
@ -1159,7 +1204,7 @@ worker_init(struct worker* worker, struct config_file *cfg,
|
||||
worker->env.attach_sub = &mesh_attach_sub;
|
||||
worker->env.kill_sub = &mesh_state_delete;
|
||||
worker->env.detect_cycle = &mesh_detect_cycle;
|
||||
worker->env.scratch_buffer = ldns_buffer_new(cfg->msg_buffer_size);
|
||||
worker->env.scratch_buffer = sldns_buffer_new(cfg->msg_buffer_size);
|
||||
if(!(worker->env.fwds = forwards_create()) ||
|
||||
!forwards_apply_cfg(worker->env.fwds, cfg)) {
|
||||
log_err("Could not set forward zones");
|
||||
@ -1222,7 +1267,7 @@ worker_delete(struct worker* worker)
|
||||
}
|
||||
outside_network_quit_prepare(worker->back);
|
||||
mesh_delete(worker->env.mesh);
|
||||
ldns_buffer_free(worker->env.scratch_buffer);
|
||||
sldns_buffer_free(worker->env.scratch_buffer);
|
||||
forwards_delete(worker->env.fwds);
|
||||
hints_delete(worker->env.hints);
|
||||
listen_delete(worker->front);
|
||||
@ -1336,14 +1381,21 @@ void libworker_handle_control_cmd(struct tube* ATTR_UNUSED(tube),
|
||||
}
|
||||
|
||||
void libworker_fg_done_cb(void* ATTR_UNUSED(arg), int ATTR_UNUSED(rcode),
|
||||
ldns_buffer* ATTR_UNUSED(buf), enum sec_status ATTR_UNUSED(s),
|
||||
sldns_buffer* ATTR_UNUSED(buf), enum sec_status ATTR_UNUSED(s),
|
||||
char* ATTR_UNUSED(why_bogus))
|
||||
{
|
||||
log_assert(0);
|
||||
}
|
||||
|
||||
void libworker_bg_done_cb(void* ATTR_UNUSED(arg), int ATTR_UNUSED(rcode),
|
||||
ldns_buffer* ATTR_UNUSED(buf), enum sec_status ATTR_UNUSED(s),
|
||||
sldns_buffer* ATTR_UNUSED(buf), enum sec_status ATTR_UNUSED(s),
|
||||
char* ATTR_UNUSED(why_bogus))
|
||||
{
|
||||
log_assert(0);
|
||||
}
|
||||
|
||||
void libworker_event_done_cb(void* ATTR_UNUSED(arg), int ATTR_UNUSED(rcode),
|
||||
sldns_buffer* ATTR_UNUSED(buf), enum sec_status ATTR_UNUSED(s),
|
||||
char* ATTR_UNUSED(why_bogus))
|
||||
{
|
||||
log_assert(0);
|
||||
|
@ -21,16 +21,16 @@
|
||||
* 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.
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDER 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -1,5 +1,316 @@
|
||||
12 March 2014: Wouter
|
||||
- tag 1.4.22
|
||||
|
||||
10 March 2014: Wouter
|
||||
- Fix bug#561: contrib/cacti plugin did not report SERVFAIL rcodes
|
||||
because of spelling. Patch from Chris Coates.
|
||||
|
||||
27 February 2014: Wouter
|
||||
- tag 1.4.22rc1
|
||||
|
||||
21 February 2014: Wouter
|
||||
- iana portlist updated.
|
||||
|
||||
20 February 2014: Matthijs
|
||||
- Be lenient when a NSEC NameError response with RCODE=NXDOMAIN is
|
||||
received. This is okay according 4035, but not after revising
|
||||
existence in 4592. NSEC empty non-terminals exist and thus the
|
||||
RCODE should have been NOERROR. If this occurs, and the RRsets
|
||||
are secure, we set the RCODE to NOERROR and the security status
|
||||
of the reponse is also considered secure.
|
||||
|
||||
14 February 2014: Wouter
|
||||
- Works on Minix (3.2.1).
|
||||
|
||||
11 February 2014: Wouter
|
||||
- Fix parse of #553(NSD) string in sldns, quotes without spaces.
|
||||
|
||||
7 February 2014: Wouter
|
||||
- iana portlist updated.
|
||||
- add body to ifstatement if locks disabled.
|
||||
- add TXT string"string" test case to unit test.
|
||||
- Fix #551: License change "Regents" to "Copyright holder", matching
|
||||
the BSD license on opensource.org.
|
||||
|
||||
6 February 2014: Wouter
|
||||
- sldns has type HIP.
|
||||
- code documentation on the module interface.
|
||||
|
||||
5 February 2014: Wouter
|
||||
- Fix sldns parse tests on osx.
|
||||
|
||||
3 February 2014: Wouter
|
||||
- Detect libevent2 install automatically by configure.
|
||||
- Fixup link with lib/event2 subdir.
|
||||
- Fix parse in sldns of quoted parenthesized text strings.
|
||||
|
||||
31 January 2014: Wouter
|
||||
- unit test for ldns wire to str and back with zones, root, nlnetlabs
|
||||
and types.sidnlabs.
|
||||
- Fix for hex to string in unknown, atma and nsap.
|
||||
- fixup nss compile (no ldns in it).
|
||||
- fixup warning in unitldns
|
||||
- fixup WKS and rdata type service to print unsigned because strings
|
||||
are not portable; they cannot be read (for sure) on other computers.
|
||||
- fixup type EUI48 and EUI64, type APL and type IPSECKEY in string
|
||||
parse sldns.
|
||||
|
||||
30 January 2014: Wouter
|
||||
- delay-close does not act if there are udp-wait queries, so that
|
||||
it does not make a socketdrain DoS easier.
|
||||
|
||||
28 January 2014: Wouter
|
||||
- iana portlist updated.
|
||||
- iana portlist test updated so it does not touch the source
|
||||
if there are no changes.
|
||||
- delay-close: msec option that delays closing ports for which
|
||||
the UDP reply has timed out. Keeps the port open, only accepts
|
||||
the correct reply. This correct reply is not used, but the port
|
||||
is open so that no port-denied ICMPs are generated.
|
||||
|
||||
27 January 2014: Wouter
|
||||
- reuseport is attempted, then fallback to without on failure.
|
||||
|
||||
24 January 2014: Wouter
|
||||
- Change unbound-event.h to use void* buffer, length idiom.
|
||||
- iana portlist updated.
|
||||
- unbound-event.h is installed if you configure --enable-event-api.
|
||||
- speed up unbound (reports say it could be up to 10%), by reducing
|
||||
lock contention on localzones.lock. It is changed to an rwlock.
|
||||
- so-reuseport: yesno option to distribute queries evenly over
|
||||
threads on Linux (Thanks Robert Edmonds).
|
||||
- made lint clean.
|
||||
|
||||
21 January 2014: Wouter
|
||||
- Fix #547: no trustanchor written if filesystem full, fclose checked.
|
||||
|
||||
17 January 2014: Wouter
|
||||
- Fix isprint() portability in sldns, uses unsigned int.
|
||||
- iana portlist updated.
|
||||
|
||||
16 January 2014: Wouter
|
||||
- fix #544: Fixed +i causes segfault when running with module conf
|
||||
"iterator".
|
||||
- Windows port, adjust %lld to %I64d, and warning in win_event.c.
|
||||
|
||||
14 January 2014: Wouter
|
||||
- iana portlist updated.
|
||||
|
||||
5 Dec 2013: Wouter
|
||||
- Fix bug in cachedump that uses sldns.
|
||||
- update pythonmod for ldns_ to sldns_ name change.
|
||||
|
||||
3 Dec 2013: Wouter
|
||||
- Fix sldns to use sldns_ prefix for all ldns_ variables.
|
||||
- Fix windows compile to compile with sldns.
|
||||
|
||||
30 Nov 2013: Wouter
|
||||
- Fix sldns to make globals use sldns_ prefix. This fixes
|
||||
linking with libldns that uses global variables ldns_ .
|
||||
|
||||
13 Nov 2013: Wouter
|
||||
- Fix bug#537: compile python plugin without ldns library.
|
||||
|
||||
12 Nov 2013: Wouter
|
||||
- Fix bug#536: acl_deny_non_local and refuse_non_local added.
|
||||
|
||||
5 Nov 2013: Wouter
|
||||
- Patch from Neel Goyal to fix async id assignment if callback
|
||||
is called by libunbound in the mesh attach.
|
||||
- Accept ip-address: as an alternative for interface: for
|
||||
consistency with nsd.conf syntax.
|
||||
|
||||
4 Nov 2013: Wouter
|
||||
- Patch from Neel Goyal to fix callback in libunbound.
|
||||
|
||||
3 Nov 2013: Wouter
|
||||
- if configured --with-libunbound-only fix make install.
|
||||
|
||||
31 Oct 2013: Wouter
|
||||
- Fix #531: Set SO_REUSEADDR so that the wildcard interface and a
|
||||
more specific interface port 53 can be used at the same time, and
|
||||
one of the daemons is unbound.
|
||||
- iana portlist update.
|
||||
- separate ldns into core ldns inside ldns/ subdirectory. No more
|
||||
--with-ldns is needed and unbound does not rely on libldns.
|
||||
- portability fixes for new USE_SLDNS ldns subdir codebase.
|
||||
|
||||
22 Oct 2013: Wouter
|
||||
- Patch from Neel Goyal: Add an API call to set an event base on an
|
||||
existing ub_ctx. This basically just destroys the current worker and
|
||||
sets the event base to the current. And fix a deadlock in
|
||||
ub_resolve_event – the cfglock is held when libworker_create is
|
||||
called. This ends up trying to acquire the lock again in
|
||||
context_obtain_alloc in the call chain.
|
||||
- Fix #528: if very high logging (4 or more) segfault on allow_snoop.
|
||||
|
||||
26 Sep 2013: Wouter
|
||||
- unbound-event.h is installed if configured --with-libevent. It
|
||||
contains low-level library calls, that use libevent's event_base
|
||||
and an ldns_buffer for the wire return packet to perform async
|
||||
resolution in the client's eventloop.
|
||||
|
||||
19 Sep 2013: Wouter
|
||||
- 1.4.21 tag created.
|
||||
- trunk has 1.4.22 number inside it.
|
||||
- iana portlist updated.
|
||||
- acx_nlnetlabs.m4 to 26; improve FLTO help text.
|
||||
|
||||
16 Sep 2013: Wouter
|
||||
- Fix#524: max-udp-size not effective to non-EDNS0 queries, from
|
||||
Daisuke HIGASHI.
|
||||
|
||||
10 Sep 2013: Wouter
|
||||
- MIN_TTL and MAX_TTL also in time_t.
|
||||
- tag 1.4.21rc1 made again.
|
||||
|
||||
26 Aug 2013: Wouter
|
||||
- More fixes for bug#519: for the threaded case test if the bg
|
||||
thread has been killed, on ub_ctx_delete, to avoid hangs.
|
||||
|
||||
22 Aug 2013: Wouter
|
||||
- more fixes that I overlooked.
|
||||
- review fixes from Willem.
|
||||
|
||||
21 Aug 2013: Wouter
|
||||
- Fix#520: Errors found by static analysis from Tomas Hozza(redhat).
|
||||
|
||||
20 Aug 2013: Wouter
|
||||
- Fix for 2038, with time_t instead of uint32_t.
|
||||
|
||||
19 Aug 2013: Wouter
|
||||
- Fix#519 ub_ctx_delete may hang in some scenarios (libunbound).
|
||||
|
||||
14 Aug 2013: Wouter
|
||||
- Fix uninit variable in fix#516.
|
||||
|
||||
8 Aug 2013: Wouter
|
||||
- Fix#516 dnssec lameness detection for answers that are improper.
|
||||
|
||||
30 Jun 2013: Wouter
|
||||
- tag 1.4.21rc1
|
||||
|
||||
29 Jun 2013: Wouter
|
||||
- Fix#512 memleak in testcode for testbound (if it fails).
|
||||
- Fix#512 NSS returned arrays out of setup function to be statics.
|
||||
|
||||
26 Jun 2013: Wouter
|
||||
- max include of 100.000 files (depth and globbed at one time).
|
||||
This is to preserve system memory in bug cases, or endless cases.
|
||||
- iana portlist updated.
|
||||
|
||||
19 Jun 2013: Wouter
|
||||
- streamtcp man page, contributed by Tomas Hozza.
|
||||
- iana portlist updated.
|
||||
- libunbound documentation on how to avoid openssl race conditions.
|
||||
|
||||
25 Jun 2013: Wouter
|
||||
- Squelch sendto-permission denied errors when the network is
|
||||
not connected, to avoid spamming syslog.
|
||||
- configure --disable-flto option (from Robert Edmonds).
|
||||
|
||||
18 Jun 2013: Wouter
|
||||
- Fix for const string literals in C++ for libunbound, from Karel
|
||||
Slany.
|
||||
- iana portlist updated.
|
||||
|
||||
17 Jun 2013: Wouter
|
||||
- Fixup manpage syntax.
|
||||
|
||||
14 Jun 2013: Wouter
|
||||
- get_option and set_option support for log-time-ascii, python-script
|
||||
val-sig-skew-min and val-sig-skew-max. log-time-ascii takes effect
|
||||
immediately. The others are mostly useful for libunbound users.
|
||||
|
||||
13 Jun 2013: Wouter
|
||||
- get_option, set_option, unbound-checkconf -o and libunbound
|
||||
getoption and setoption support cache-min-ttl and cache-max-ttl.
|
||||
|
||||
10 Jun 2013: Wouter
|
||||
- Fix#501: forward-first does not recurse, when forward name is ".".
|
||||
- iana portlist update.
|
||||
- Max include depth is unlimited.
|
||||
|
||||
27 May 2013: Wouter
|
||||
- Update acx_pthreads.m4 to ax_pthreads.4 (2013-03-29), and apply
|
||||
patch to it to not fail when -Werror is also specified, from the
|
||||
autoconf-archives.
|
||||
- iana portlist update.
|
||||
|
||||
21 May 2013: Wouter
|
||||
- Explain bogus and secure flags in libunbound more.
|
||||
|
||||
16 May 2013: Wouter
|
||||
- Fix#499 use-after-free in out-of-memory handling code (thanks Jake
|
||||
Montgomery).
|
||||
- Fix#500 use on non-initialised values on socket bind failures.
|
||||
|
||||
15 May 2013: Wouter
|
||||
- Fix round-robin doesn't work with some Windows clients (from Ilya
|
||||
Bakulin).
|
||||
|
||||
3 May 2013: Wouter
|
||||
- update acx_nlnetlabs.m4 to v23, sleep w32 fix.
|
||||
|
||||
26 April 2013: Wouter
|
||||
- add unbound-control insecure_add and insecure_remove for the
|
||||
administration of negative trust anchors.
|
||||
|
||||
25 April 2013: Wouter
|
||||
- Implement max-udp-size config option, default 4096 (thanks
|
||||
Daisuke Higashi).
|
||||
- Robust checks on dname validity from rdata for dname compare.
|
||||
- updated iana portlist.
|
||||
|
||||
19 April 2013: Wouter
|
||||
- Fixup snprintf return value usage, fixed libunbound_get_option.
|
||||
|
||||
18 April 2013: Wouter
|
||||
- fix bug #491: pick program name (0th argument) as syslog identity.
|
||||
- own implementation of compat/snprintf.c.
|
||||
|
||||
15 April 2013: Wouter
|
||||
- Fix so that for a configuration line of include: "*.conf" it is not
|
||||
an error if there are no files matching the glob pattern.
|
||||
- unbound-anchor review: BIO_write can return 0 successfully if it
|
||||
has successfully appended a zero length string.
|
||||
|
||||
11 April 2013: Wouter
|
||||
- Fix queries leaking up for stubs and forwards, if the configured
|
||||
nameservers all fail to answer.
|
||||
|
||||
10 April 2013: Wouter
|
||||
- code improve for minimal responses, small speed increase.
|
||||
|
||||
9 April 2013: Wouter
|
||||
- updated iana portlist.
|
||||
- Fix crash in previous private address fixup of 22 March.
|
||||
|
||||
28 March 2013: Wouter
|
||||
- Make reverse zones easier by documenting the nodefault statements
|
||||
commented-out in the example config file.
|
||||
|
||||
26 March 2013: Wouter
|
||||
- more fixes to lookup3.c endianness detection.
|
||||
|
||||
25 March 2013: Wouter
|
||||
- #492: Fix endianness detection, revert to older lookup3.c detection
|
||||
and put new detect lines after previous tests, to avoid regressions
|
||||
but allow new detections to succeed.
|
||||
And add detection for machine/endian.h to it.
|
||||
|
||||
22 March 2013: Wouter
|
||||
- Fix resolve of names that use a mix of public and private addresses.
|
||||
- iana portlist update.
|
||||
- Fix makedist for new svn for -d option.
|
||||
- unbound.h header file has UNBOUND_VERSION_MAJOR define.
|
||||
- Fix windows RSRC version for long version numbers.
|
||||
|
||||
21 March 2013: Wouter
|
||||
- release 1.4.20
|
||||
- trunk has 1.4.21
|
||||
- committed libunbound version 4:1:2 for binary API updated in 1.4.20
|
||||
- install copy of unbound-control.8 man page for unbound-control-setup
|
||||
|
||||
14 March 2013: Wouter
|
||||
- iana portlist update.
|
||||
|
@ -99,4 +99,5 @@ SSHFP type
|
||||
4701: DHCID
|
||||
5155: NSEC3, NSEC3PARAM
|
||||
4408: SPF
|
||||
6944: DNSKEY algorithm status
|
||||
|
||||
|
@ -18,13 +18,13 @@ 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.
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER 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.
|
||||
|
@ -1,4 +1,4 @@
|
||||
README for Unbound 1.4.20
|
||||
README for Unbound 1.4.22
|
||||
Copyright 2007 NLnet Labs
|
||||
http://unbound.net
|
||||
|
||||
@ -10,14 +10,11 @@ This software is under BSD license, see LICENSE for details.
|
||||
http://unbound.net/svn/
|
||||
|
||||
* Uses the following libraries;
|
||||
* ldns http://www.nlnetlabs.nl/ldns/ (BSD license)
|
||||
(required) can use ldns build directory directly with --with-ldns=path.
|
||||
* libevent http://www.monkey.org/~provos/libevent/ (BSD license)
|
||||
(optional) can use builtin alternative instead.
|
||||
* libexpat (for the unbound-anchor helper program) (MIT license)
|
||||
|
||||
* Make and install: ./configure; make; make install
|
||||
* --with-ldns=/path/to/ldns
|
||||
It will dynamically link against it.
|
||||
* --with-libevent=/path/to/libevent
|
||||
Can be set to either the system install or the build directory.
|
||||
--with-libevent=no (default) gives a builtin alternative
|
||||
@ -36,8 +33,8 @@ This software is under BSD license, see LICENSE for details.
|
||||
programming errors, among which buffer overflows. The program exits
|
||||
with an error if an assertion fails (but the buffer did not overflow).
|
||||
* --enable-static-exe
|
||||
This enables a debug option to statically link, against ldns and
|
||||
libevent libraries.
|
||||
This enables a debug option to statically link against the
|
||||
libevent library.
|
||||
* --enable-lock-checks
|
||||
This enables a debug option to check lock and unlock calls. It needs
|
||||
a recent pthreads library to work.
|
||||
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# Example configuration file.
|
||||
#
|
||||
# See unbound.conf(5) man page, version 1.4.20.
|
||||
# See unbound.conf(5) man page, version 1.4.22.
|
||||
#
|
||||
# this is a comment.
|
||||
|
||||
@ -84,11 +84,18 @@ server:
|
||||
# buffer size for UDP port 53 outgoing (SO_SNDBUF socket option).
|
||||
# 0 is system default. Use 4m to handle spikes on very busy servers.
|
||||
# so-sndbuf: 0
|
||||
|
||||
# on Linux(3.9+) use SO_REUSEPORT to distribute queries over threads.
|
||||
# so-reuseport: no
|
||||
|
||||
# EDNS reassembly buffer to advertise to UDP peers (the actual buffer
|
||||
# is set with msg-buffer-size). 1480 can solve fragmentation (timeouts).
|
||||
# edns-buffer-size: 4096
|
||||
|
||||
# Maximum UDP response size (not applied to TCP response).
|
||||
# Suggested values are 512 to 4096. Default is 4096. 65536 disables it.
|
||||
# max-udp-size: 4096
|
||||
|
||||
# buffer size for handling DNS data. No messages larger than this
|
||||
# size can be sent or received, by UDP or TCP. In bytes.
|
||||
# msg-buffer-size: 65552
|
||||
@ -107,6 +114,9 @@ server:
|
||||
|
||||
# if very busy, 50% queries run to completion, 50% get timeout in msec
|
||||
# jostle-timeout: 200
|
||||
|
||||
# msec to wait before close of port on timeout UDP. 0 disables.
|
||||
# delay-close: 0
|
||||
|
||||
# the amount of memory to use for the RRset cache.
|
||||
# plain value in bytes or you can append k, m or G. default is "4Mb".
|
||||
@ -161,6 +171,8 @@ server:
|
||||
# By default everything is refused, except for localhost.
|
||||
# Choose deny (drop message), refuse (polite error reply),
|
||||
# allow (recursive ok), allow_snoop (recursive and nonrecursive ok)
|
||||
# deny_non_local (drop queries unless can be answered from local-data)
|
||||
# refuse_non_local (like deny_non_local but polite error reply).
|
||||
# access-control: 0.0.0.0/0 refuse
|
||||
# access-control: 127.0.0.0/8 allow
|
||||
# access-control: ::0/0 refuse
|
||||
@ -425,6 +437,54 @@ server:
|
||||
# the amount of memory to use for the negative cache (used for DLV).
|
||||
# plain value in bytes or you can append k, m or G. default is "1Mb".
|
||||
# neg-cache-size: 1m
|
||||
|
||||
# if unbound is running service for the local host then it is useful
|
||||
# to perform lan-wide lookups to the upstream, and unblock the
|
||||
# long list of local-zones above. If this unbound is a dns server
|
||||
# for a network of computers, disabled is better and stops information
|
||||
# leakage of local lan information.
|
||||
# unblock-lan-zones: no
|
||||
|
||||
# By default, for a number of zones a small default 'nothing here'
|
||||
# reply is built-in. Query traffic is thus blocked. If you
|
||||
# wish to serve such zone you can unblock them by uncommenting one
|
||||
# of the nodefault statements below.
|
||||
# You may also have to use domain-insecure: zone to make DNSSEC work,
|
||||
# unless you have your own trust anchors for this zone.
|
||||
# local-zone: "localhost." nodefault
|
||||
# local-zone: "127.in-addr.arpa." nodefault
|
||||
# local-zone: "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa." nodefault
|
||||
# local-zone: "10.in-addr.arpa." nodefault
|
||||
# local-zone: "16.172.in-addr.arpa." nodefault
|
||||
# local-zone: "17.172.in-addr.arpa." nodefault
|
||||
# local-zone: "18.172.in-addr.arpa." nodefault
|
||||
# local-zone: "19.172.in-addr.arpa." nodefault
|
||||
# local-zone: "20.172.in-addr.arpa." nodefault
|
||||
# local-zone: "21.172.in-addr.arpa." nodefault
|
||||
# local-zone: "22.172.in-addr.arpa." nodefault
|
||||
# local-zone: "23.172.in-addr.arpa." nodefault
|
||||
# local-zone: "24.172.in-addr.arpa." nodefault
|
||||
# local-zone: "25.172.in-addr.arpa." nodefault
|
||||
# local-zone: "26.172.in-addr.arpa." nodefault
|
||||
# local-zone: "27.172.in-addr.arpa." nodefault
|
||||
# local-zone: "28.172.in-addr.arpa." nodefault
|
||||
# local-zone: "29.172.in-addr.arpa." nodefault
|
||||
# local-zone: "30.172.in-addr.arpa." nodefault
|
||||
# local-zone: "31.172.in-addr.arpa." nodefault
|
||||
# local-zone: "168.192.in-addr.arpa." nodefault
|
||||
# local-zone: "0.in-addr.arpa." nodefault
|
||||
# local-zone: "254.169.in-addr.arpa." nodefault
|
||||
# local-zone: "2.0.192.in-addr.arpa." nodefault
|
||||
# local-zone: "100.51.198.in-addr.arpa." nodefault
|
||||
# local-zone: "113.0.203.in-addr.arpa." nodefault
|
||||
# local-zone: "255.255.255.255.in-addr.arpa." nodefault
|
||||
# local-zone: "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa." nodefault
|
||||
# local-zone: "d.f.ip6.arpa." nodefault
|
||||
# local-zone: "8.e.f.ip6.arpa." nodefault
|
||||
# local-zone: "9.e.f.ip6.arpa." nodefault
|
||||
# local-zone: "a.e.f.ip6.arpa." nodefault
|
||||
# local-zone: "b.e.f.ip6.arpa." nodefault
|
||||
# local-zone: "8.b.d.0.1.0.0.2.ip6.arpa." nodefault
|
||||
|
||||
# a number of locally served zones can be configured.
|
||||
# local-zone: <zone> <type>
|
||||
|
@ -1,4 +1,4 @@
|
||||
.TH "libunbound" "3" "Mar 21, 2013" "NLnet Labs" "unbound 1.4.20"
|
||||
.TH "libunbound" "3" "Mar 12, 2014" "NLnet Labs" "unbound 1.4.22"
|
||||
.\"
|
||||
.\" libunbound.3 -- unbound library functions manual
|
||||
.\"
|
||||
@ -42,7 +42,7 @@
|
||||
.B ub_ctx_zone_remove,
|
||||
.B ub_ctx_data_add,
|
||||
.B ub_ctx_data_remove
|
||||
\- Unbound DNS validating resolver 1.4.20 functions.
|
||||
\- Unbound DNS validating resolver 1.4.22 functions.
|
||||
.SH "SYNOPSIS"
|
||||
.LP
|
||||
.B #include <unbound.h>
|
||||
@ -171,6 +171,9 @@ by default. Use
|
||||
and
|
||||
.B ub_ctx_hosts
|
||||
to read them.
|
||||
Before you call this, use the openssl functions CRYPTO_set_id_callback and
|
||||
CRYPTO_set_locking_callback to set up asyncronous operation if you use
|
||||
lib openssl (the application calls these functions once for initialisation).
|
||||
.TP
|
||||
.B ub_ctx_delete
|
||||
Delete validation context and free associated resources.
|
||||
@ -364,7 +367,7 @@ The result of the DNS resolution and validation is returned as
|
||||
.fi
|
||||
.P
|
||||
If both secure and bogus are false, security was not enabled for the
|
||||
domain of the query.
|
||||
domain of the query. Else, they are not both true, one of them is true.
|
||||
.SH "RETURN VALUES"
|
||||
Many routines return an error code. The value 0 (zero) denotes no error
|
||||
happened. Other values can be passed to
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user