staticexe=@staticexe@
EXEEXT=@EXEEXT@
configfile=@ub_conf_file@
-UNBOUND_RUN_DIR=@UNBOUND_RUN_DIR@
CHECKLOCK_SRC=testcode/checklocks.c
CHECKLOCK_OBJ=@CHECKLOCK_OBJ@
+DNSTAP_SRC=@DNSTAP_SRC@
+DNSTAP_OBJ=@DNSTAP_OBJ@
WITH_PYTHONMODULE=@WITH_PYTHONMODULE@
WITH_PYUNBOUND=@WITH_PYUNBOUND@
+PY_MAJOR_VERSION=@PY_MAJOR_VERSION@
PYTHON_SITE_PKG=@PYTHON_SITE_PKG@
PYTHONMOD_INSTALL=@PYTHONMOD_INSTALL@
PYTHONMOD_UNINSTALL=@PYTHONMOD_UNINSTALL@
# K&R C compilers), but causes problems if $U is defined in the env).
U=
+PROTOC_C=@PROTOC_C@
SWIG=@SWIG@
YACC=@YACC@
LEX=@LEX@
LIBOBJS=@LIBOBJS@
# filter out ctime_r from compat obj.
LIBOBJ_WITHOUT_CTIME=@LIBOBJ_WITHOUT_CTIME@
+LIBOBJ_WITHOUT_CTIMEARC4=@LIBOBJ_WITHOUT_CTIMEARC4@
RUNTIME_PATH=@RUNTIME_PATH@
DEPFLAG=@DEPFLAG@
DATE=@CONFIG_DATE@
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"
+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" -Dfstrm_res=int
# compat with NetBSD
LINTFLAGS+=@NETBSD_LINTFLAGS@
# compat with OpenBSD
LINTFLAGS+="-Dsigset_t=long"
# FreeBSD
-LINTFLAGS+="-D__uint16_t=uint16_t" "-DEVP_PKEY_ASN1_METHOD=int"
+LINTFLAGS+="-D__uint16_t=uint16_t" "-DEVP_PKEY_ASN1_METHOD=int" "-D_RuneLocale=int" "-D__va_list=va_list"
-INSTALL=$(srcdir)/install-sh
+INSTALL=$(SHELL) $(srcdir)/install-sh
#pythonmod.c is not here, it is mentioned by itself in its own rules,
#makedepend fails on missing interface.h otherwise.
validator/val_neg.c validator/val_nsec3.c validator/val_nsec.c \
validator/val_secalgo.c validator/val_sigcrypt.c \
validator/val_utils.c edns-subnet/edns-subnet.c edns-subnet/subnetmod.c \
-edns-subnet/addrtree.c edns-subnet/subnet-whitelist.c $(CHECKLOCK_SRC)
+edns-subnet/addrtree.c edns-subnet/subnet-whitelist.c dns64/dns64.c $(CHECKLOCK_SRC) $(DNSTAP_SRC)
COMMON_OBJ_WITHOUT_NETCALL=dns.lo infra.lo rrset.lo dname.lo msgencode.lo \
msgparse.lo msgreply.lo packed_rrset.lo iterator.lo iter_delegpt.lo \
iter_donotq.lo iter_fwd.lo iter_hints.lo iter_priv.lo iter_resptype.lo \
random.lo rbtree.lo regional.lo rtt.lo dnstree.lo lookup3.lo lruhash.lo \
slabhash.lo timehist.lo tube.lo winsock_event.lo autotrust.lo val_anchor.lo \
validator.lo val_kcache.lo val_kentry.lo val_neg.lo val_nsec3.lo val_nsec.lo \
-val_secalgo.lo val_sigcrypt.lo val_utils.lo $(SUBNET_OBJ) $(PYTHONMOD_OBJ) \
-$(CHECKLOCK_OBJ)
+val_secalgo.lo val_sigcrypt.lo val_utils.lo dns64.lo \
+$(SUBNET_OBJ) $(PYTHONMOD_OBJ) $(CHECKLOCK_OBJ) $(DNSTAP_OBJ)
COMMON_OBJ=$(COMMON_OBJ_WITHOUT_NETCALL) netevent.lo listen_dnsport.lo \
outside_network.lo
# set to $COMMON_OBJ or to "" if --enableallsymbols
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/strlcat.c \
-compat/strlcpy.c compat/strptime.c
+compat/strlcpy.c compat/strptime.c compat/getentropy_linux.c \
+compat/getentropy_osx.c compat/getentropy_solaris.c compat/getentropy_win.c \
+compat/explicit_bzero.c compat/arc4random.c compat/arc4random_uniform.c \
+compat/arc4_lock.c compat/sha512.c compat/reallocarray.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
+COMPAT_OBJ_WITHOUT_CTIMEARC4=$(LIBOBJ_WITHOUT_CTIMEARC4:.o=.lo)
+SLDNS_SRC=sldns/keyraw.c sldns/sbuffer.c sldns/wire2str.c sldns/parse.c \
+sldns/parseutil.c sldns/rrdef.c sldns/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 \
$(SLDNS_OBJ) $(COMPAT_OBJ) @WIN_CONTROL_OBJ_LINK@
HOST_SRC=smallapp/unbound-host.c
HOST_OBJ=unbound-host.lo
-HOST_OBJ_LINK=$(HOST_OBJ) $(SLDNS_OBJ) $(COMPAT_OBJ_WITHOUT_CTIME) @WIN_HOST_OBJ_LINK@
+HOST_OBJ_LINK=$(HOST_OBJ) $(SLDNS_OBJ) $(COMPAT_OBJ_WITHOUT_CTIMEARC4) @WIN_HOST_OBJ_LINK@
UBANCHOR_SRC=smallapp/unbound-anchor.c
UBANCHOR_OBJ=unbound-anchor.lo
UBANCHOR_OBJ_LINK=$(UBANCHOR_OBJ) \
$(SLDNS_OBJ)
PETAL_SRC=testcode/petal.c
PETAL_OBJ=petal.lo
-PETAL_OBJ_LINK=$(PETAL_OBJ) $(COMPAT_OBJ_WITHOUT_CTIME)
+PETAL_OBJ_LINK=$(PETAL_OBJ) $(COMPAT_OBJ_WITHOUT_CTIMEARC4)
PKTVIEW_SRC=testcode/pktview.c testcode/readhex.c
PKTVIEW_OBJ=pktview.lo
PKTVIEW_OBJ_LINK=$(PKTVIEW_OBJ) worker_cb.lo readhex.lo $(COMMON_OBJ) \
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 > $@
+unbound-control-setup: smallapp/unbound-control-setup.sh
+ cp smallapp/unbound-control-setup.sh $@
-chmod +x $@
+# dnstap
+dnstap.lo dnstap.o: $(srcdir)/dnstap/dnstap.c config.h dnstap/dnstap_config.h \
+ dnstap/dnstap.pb-c.c dnstap/dnstap.pb-c.h $(srcdir)/dnstap/dnstap.h \
+ $(srcdir)/util/config_file.h $(srcdir)/util/log.h \
+ $(srcdir)/util/netevent.h $(srcdir)/util/net_help.h
+
+dnstap/dnstap.pb-c.c dnstap/dnstap.pb-c.h: $(srcdir)/dnstap/dnstap.proto
+ @-if test ! -d dnstap; then $(INSTALL) -d dnstap; fi
+ $(PROTOC_C) --c_out=. $(srcdir)/dnstap/dnstap.proto
+
+dnstap.pb-c.lo dnstap.pb-c.o: dnstap/dnstap.pb-c.c dnstap/dnstap.pb-c.h
+
# Python Module
pythonmod.lo pythonmod.o: $(srcdir)/pythonmod/pythonmod.c config.h \
pythonmod/interface.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
+ $(SWIG) -python -o $@ $(CPPFLAGS) -DPY_MAJOR_VERSION=$(PY_MAJOR_VERSION) $(srcdir)/libunbound/python/libunbound.i
# Pyunbound python unbound wrapper
_unbound.la: libunbound_wrap.lo libunbound.la
- $(LIBTOOL) --tag=CC --mode=link $(CC) $(RUNTIME_PATH) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -module -version-info @LIBUNBOUND_CURRENT@:@LIBUNBOUND_REVISION@:@LIBUNBOUND_AGE@ -no-undefined -o $@ libunbound_wrap.lo -rpath $(PYTHON_SITE_PKG) L. -L.libs -lunbound $(LIBS)
+ $(LIBTOOL) --tag=CC --mode=link $(CC) $(RUNTIME_PATH) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -module -avoid-version -no-undefined -shared -o $@ libunbound_wrap.lo -rpath $(PYTHON_SITE_PKG) L. -L.libs -lunbound
util/config_file.c: util/configparser.h
util/configlexer.c: $(srcdir)/util/configlexer.lex util/configparser.h
$(LINT) $(LINTFLAGS) -I. -I$(srcdir) $<
touch $@
-util/configparser.lint util/configlexer.lint pythonmod/pythonmod.lint libunbound/python/libunbound_wrap.lint:
+util/configparser.lint util/configlexer.lint pythonmod/pythonmod.lint libunbound/python/libunbound_wrap.lint dnstap/dnstap.pb-c.lint:
# skip lint for generated code
touch $@
$(STRIP) unbound$(EXEEXT)
$(STRIP) unbound-checkconf$(EXEEXT)
$(STRIP) unbound-control$(EXEEXT)
- $(STRIP) unbound-host$(EXEEXT)
- $(STRIP) unbound-anchor$(EXEEXT)
+ $(STRIP) unbound-host$(EXEEXT) || $(STRIP) .libs/unbound-host$(EXEEXT)
+ $(STRIP) unbound-anchor$(EXEEXT) || $(STRIP) .libs/unbound-anchor$(EXEEXT)
pythonmod-install:
$(INSTALL) -m 755 -d $(DESTDIR)$(PYTHON_SITE_PKG)
-e 's?$$(srcdir)/util/configlexer.c?util/configlexer.c?g' \
-e 's?$$(srcdir)/util/configparser.c?util/configparser.c?g' \
-e 's?$$(srcdir)/util/configparser.h?util/configparser.h?g' \
+ -e 's?$$(srcdir)/dnstap/dnstap_config.h??g' \
-e 's?$$(srcdir)/pythonmod/pythonmod.h?$$(PYTHONMOD_HEADER)?g' \
-e 's?$$(srcdir)/edns-subnet/subnetmod.h $$(srcdir)/edns-subnet/subnet-whitelist.h $$(srcdir)/edns-subnet/edns-subnet.h $$(srcdir)/edns-subnet/addrtree.h?$$(SUBNET_HEADER)?g' \
-e 's!\(.*\)\.o[ :]*!\1.lo \1.o: !g' \
$(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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.h \
- $(srcdir)/util/net_help.h $(srcdir)/util/regional.h $(srcdir)/util/config_file.h $(srcdir)/ldns/sbuffer.h
-infra.lo infra.o: $(srcdir)/services/cache/infra.c config.h $(srcdir)/ldns/rrdef.h \
+ $(srcdir)/util/module.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \
+ $(srcdir)/util/net_help.h $(srcdir)/util/regional.h $(srcdir)/util/config_file.h $(srcdir)/sldns/sbuffer.h
+infra.lo infra.o: $(srcdir)/services/cache/infra.c config.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/str2wire.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 $(srcdir)/ldns/pkthdr.h
+ $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.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 $(srcdir)/sldns/pkthdr.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)/ldns/rrdef.h $(srcdir)/util/config_file.h \
+ $(srcdir)/util/data/packed_rrset.h $(srcdir)/sldns/rrdef.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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.h $(srcdir)/util/storage/lookup3.h $(srcdir)/ldns/sbuffer.h
+ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/storage/lookup3.h $(srcdir)/sldns/sbuffer.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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.h \
- $(srcdir)/util/data/dname.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h $(srcdir)/ldns/sbuffer.h
+ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \
+ $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/dname.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h \
+ $(srcdir)/sldns/sbuffer.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)/ldns/pkthdr.h \
- $(srcdir)/ldns/rrdef.h $(srcdir)/util/data/dname.h $(srcdir)/util/data/packed_rrset.h \
- $(srcdir)/util/storage/lookup3.h $(srcdir)/util/regional.h $(srcdir)/ldns/sbuffer.h $(srcdir)/ldns/parseutil.h \
- $(srcdir)/ldns/wire2str.h
+ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/sldns/pkthdr.h \
+ $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/dname.h $(srcdir)/util/data/packed_rrset.h \
+ $(srcdir)/util/storage/lookup3.h $(srcdir)/util/regional.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/parseutil.h \
+ $(srcdir)/sldns/wire2str.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)/ldns/pkthdr.h \
- $(srcdir)/ldns/rrdef.h $(srcdir)/util/data/msgencode.h $(srcdir)/ldns/sbuffer.h $(srcdir)/ldns/wire2str.h
+ $(srcdir)/util/data/dname.h $(srcdir)/util/regional.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \
+ $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgencode.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.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 $(srcdir)/ldns/rrdef.h $(srcdir)/ldns/sbuffer.h $(srcdir)/ldns/wire2str.h
+ $(srcdir)/util/net_help.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.h $(srcdir)/iterator/iter_utils.h \
+ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.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 $(srcdir)/ldns/wire2str.h \
- $(srcdir)/ldns/parseutil.h $(srcdir)/ldns/sbuffer.h
+ $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h $(srcdir)/util/config_file.h $(srcdir)/util/random.h \
+ $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/sbuffer.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 $(srcdir)/ldns/rrdef.h $(srcdir)/ldns/sbuffer.h
+ $(srcdir)/util/data/dname.h $(srcdir)/util/net_help.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/sbuffer.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 \
- $(srcdir)/ldns/rrdef.h $(srcdir)/ldns/str2wire.h
+ $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/str2wire.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 $(srcdir)/ldns/rrdef.h $(srcdir)/ldns/str2wire.h \
- $(srcdir)/ldns/wire2str.h
+ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/str2wire.h \
+ $(srcdir)/sldns/wire2str.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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.h $(srcdir)/util/net_help.h \
- $(srcdir)/util/storage/dnstree.h $(srcdir)/ldns/str2wire.h $(srcdir)/ldns/sbuffer.h
+ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/net_help.h \
+ $(srcdir)/util/storage/dnstree.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/sbuffer.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 $(srcdir)/ldns/rrdef.h $(srcdir)/ldns/pkthdr.h
+ $(srcdir)/util/data/dname.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/pkthdr.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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.h \
+ $(srcdir)/util/module.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.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 $(srcdir)/ldns/sbuffer.h
+ $(srcdir)/util/config_file.h $(srcdir)/util/data/dname.h $(srcdir)/util/alloc.h $(srcdir)/sldns/sbuffer.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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.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 $(srcdir)/validator/val_sigcrypt.h $(srcdir)/ldns/sbuffer.h
+ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.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 $(srcdir)/validator/val_sigcrypt.h \
+ $(srcdir)/sldns/sbuffer.h
edns-subnet.lo edns-subnet.o: $(srcdir)/edns-subnet/edns-subnet.c config.h $(srcdir)/edns-subnet/edns-subnet.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/config_file.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 \
- $(srcdir)/ldns/sbuffer.h
+ $(srcdir)/util/rbtree.h $(srcdir)/util/log.h $(srcdir)/util/config_file.h \
+ $(srcdir)/util/net_help.h $(srcdir)/sldns/sbuffer.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)/ldns/str2wire.h $(srcdir)/ldns/rrdef.h \
- $(srcdir)/ldns/sbuffer.h $(srcdir)/util/regional.h $(srcdir)/util/config_file.h $(srcdir)/util/data/dname.h \
+ $(srcdir)/util/rbtree.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.h \
+ $(srcdir)/sldns/sbuffer.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 $(srcdir)/ldns/pkthdr.h
+ $(srcdir)/util/net_help.h $(srcdir)/util/netevent.h $(srcdir)/util/data/msgreply.h \
+ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.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 $(srcdir)/ldns/sbuffer.h
+ $(srcdir)/util/log.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.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 $(srcdir)/sldns/sbuffer.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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.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
+ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h \
+ $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/dns64/dns64.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 $(srcdir)/edns-subnet/subnetmod.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)/ldns/pkthdr.h \
- $(srcdir)/ldns/rrdef.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 $(srcdir)/ldns/sbuffer.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/storage/dnstree.h \
+ $(srcdir)/util/rtt.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.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 \
+ $(srcdir)/sldns/sbuffer.h $(srcdir)/dnstap/dnstap.h \
$(srcdir)/edns-subnet/edns-subnet.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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.h $(srcdir)/util/tube.h \
+ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \
+ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.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)/ldns/wire2str.h $(srcdir)/ldns/parseutil.h \
+ $(srcdir)/services/modstack.h $(srcdir)/util/data/dname.h $(srcdir)/util/rtt.h $(srcdir)/services/cache/infra.h \
+ $(srcdir)/util/storage/dnstree.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/parseutil.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
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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.h $(srcdir)/util/tube.h \
+ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \
$(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h $(srcdir)/util/mini_event.h \
- $(srcdir)/util/rbtree.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)/util/rbtree.h $(srcdir)/services/outside_network.h \
+ $(srcdir)/services/localzone.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h \
+ $(srcdir)/util/rtt.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/dns64/dns64.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
+ $(srcdir)/validator/val_neg.h $(srcdir)/validator/autotrust.h $(srcdir)/libunbound/libworker.h \
+ $(srcdir)/libunbound/context.h $(srcdir)/util/alloc.h $(srcdir)/libunbound/unbound.h \
+ $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.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 $(srcdir)/ldns/sbuffer.h
+log.lo log.o: $(srcdir)/util/log.c config.h $(srcdir)/util/log.h $(srcdir)/util/locks.h $(srcdir)/sldns/sbuffer.h
mini_event.lo mini_event.o: $(srcdir)/util/mini_event.c config.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.h $(srcdir)/util/tube.h \
+ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \
$(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.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 $(srcdir)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.h
+ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.h $(srcdir)/util/tube.h \
- $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h $(srcdir)/ldns/sbuffer.h \
+ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \
+ $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h $(srcdir)/sldns/sbuffer.h \
+ $(srcdir)/dnstap/dnstap.h \
$(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.h $(srcdir)/util/regional.h $(srcdir)/ldns/parseutil.h \
- $(srcdir)/ldns/wire2str.h \
-
-random.lo random.o: $(srcdir)/util/random.c config.h $(srcdir)/util/random.h $(srcdir)/util/log.h \
+ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/regional.h $(srcdir)/sldns/parseutil.h \
+ $(srcdir)/sldns/wire2str.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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.h $(srcdir)/util/tube.h \
+ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.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
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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \
+ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.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
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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.h $(srcdir)/services/mesh.h \
+ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.h \
+ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.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 \
- $(srcdir)/ldns/sbuffer.h $(srcdir)/ldns/wire2str.h $(srcdir)/ldns/str2wire.h $(srcdir)/ldns/keyraw.h \
+ $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/keyraw.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 $(srcdir)/ldns/sbuffer.h \
- $(srcdir)/ldns/rrdef.h $(srcdir)/ldns/str2wire.h
+ $(srcdir)/util/data/dname.h $(srcdir)/util/net_help.h $(srcdir)/util/config_file.h $(srcdir)/sldns/sbuffer.h \
+ $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/str2wire.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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.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 $(srcdir)/ldns/wire2str.h
+ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.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 \
+ $(srcdir)/sldns/wire2str.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 $(srcdir)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.h
+ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.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 \
- $(srcdir)/ldns/rrdef.h $(srcdir)/ldns/keyraw.h \
+ $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.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_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 \
- $(srcdir)/ldns/rrdef.h $(srcdir)/ldns/sbuffer.h
+ $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/sbuffer.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)/ldns/pkthdr.h \
- $(srcdir)/ldns/rrdef.h $(srcdir)/validator/val_utils.h $(srcdir)/validator/val_kentry.h \
+ $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \
+ $(srcdir)/sldns/rrdef.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 $(srcdir)/ldns/sbuffer.h
+ $(srcdir)/util/net_help.h $(srcdir)/util/data/dname.h $(srcdir)/validator/val_nsec.h $(srcdir)/sldns/sbuffer.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)/ldns/pkthdr.h \
- $(srcdir)/ldns/rrdef.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 \
- $(srcdir)/ldns/rrdef.h $(srcdir)/ldns/keyraw.h \
- $(srcdir)/ldns/sbuffer.h \
+ $(srcdir)/util/net_help.h $(srcdir)/util/module.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \
+ $(srcdir)/sldns/rrdef.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)/util/data/packed_rrset.h \
+ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/validator/val_secalgo.h \
+ $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \
+ $(srcdir)/sldns/sbuffer.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)/ldns/pkthdr.h \
- $(srcdir)/ldns/rrdef.h $(srcdir)/validator/val_utils.h $(srcdir)/util/data/dname.h $(srcdir)/util/rbtree.h \
- $(srcdir)/util/net_help.h $(srcdir)/util/regional.h $(srcdir)/ldns/keyraw.h \
- $(srcdir)/ldns/sbuffer.h $(srcdir)/ldns/parseutil.h $(srcdir)/ldns/wire2str.h \
+ $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \
+ $(srcdir)/sldns/rrdef.h $(srcdir)/validator/val_utils.h $(srcdir)/util/data/dname.h $(srcdir)/util/rbtree.h \
+ $(srcdir)/util/net_help.h $(srcdir)/util/regional.h $(srcdir)/sldns/keyraw.h \
+ $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/wire2str.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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.h $(srcdir)/validator/val_kentry.h \
+ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.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
+dns64.lo dns64.o: $(srcdir)/dns64/dns64.c config.h $(srcdir)/dns64/dns64.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)/sldns/pkthdr.h \
+ $(srcdir)/sldns/rrdef.h $(srcdir)/services/cache/dns.h $(srcdir)/services/cache/rrset.h \
+ $(srcdir)/util/storage/slabhash.h $(srcdir)/util/config_file.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/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
+dnstap.lo dnstap.o: $(srcdir)/dnstap/dnstap.c config.h $(srcdir)/sldns/sbuffer.h \
+ $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h \
+ $(srcdir)/dnstap/dnstap.h \
+ $(srcdir)/dnstap/dnstap.pb-c.h
+dnstap.pb-c.lo dnstap.pb-c.o: $(srcdir)/dnstap/dnstap.pb-c.c $(srcdir)/dnstap/dnstap.pb-c.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 $(srcdir)/ldns/sbuffer.h $(srcdir)/ldns/rrdef.h
+ $(srcdir)/validator/val_anchor.h $(srcdir)/util/rbtree.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/rrdef.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 $(srcdir)/ldns/sbuffer.h \
- $(srcdir)/ldns/str2wire.h $(srcdir)/ldns/rrdef.h
+ $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/sldns/sbuffer.h \
+ $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.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)/ldns/rrdef.h $(srcdir)/ldns/keyraw.h \
+ $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.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
+ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.h $(srcdir)/util/data/msgreply.h \
+ $(srcdir)/util/locks.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.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 \
- $(srcdir)/testcode/testpkts.h $(srcdir)/ldns/sbuffer.h $(srcdir)/ldns/str2wire.h $(srcdir)/ldns/wire2str.h
+ $(srcdir)/testcode/testpkts.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/wire2str.h
unitvandergaast.lo unitvandergaast.o: $(srcdir)/testcode/unitvandergaast.c \
config.h $(srcdir)/util/log.h $(srcdir)/testcode/unitmain.h \
$(srcdir)/edns-subnet/addrtree.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 \
- $(srcdir)/ldns/rrdef.h
+ $(srcdir)/sldns/rrdef.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/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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.h $(srcdir)/validator/val_utils.h \
+ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/validator/val_utils.h \
$(srcdir)/testcode/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 $(srcdir)/ldns/sbuffer.h $(srcdir)/ldns/keyraw.h \
- $(srcdir)/ldns/str2wire.h $(srcdir)/ldns/wire2str.h
+ $(srcdir)/util/net_help.h $(srcdir)/util/config_file.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/keyraw.h \
+ $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/wire2str.h
readhex.lo readhex.o: $(srcdir)/testcode/readhex.c config.h $(srcdir)/testcode/readhex.h $(srcdir)/util/log.h \
- $(srcdir)/ldns/sbuffer.h $(srcdir)/ldns/parseutil.h
+ $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/parseutil.h
testpkts.lo testpkts.o: $(srcdir)/testcode/testpkts.c config.h $(srcdir)/testcode/testpkts.h \
- $(srcdir)/util/net_help.h $(srcdir)/util/log.h $(srcdir)/ldns/sbuffer.h $(srcdir)/ldns/rrdef.h $(srcdir)/ldns/pkthdr.h \
- $(srcdir)/ldns/str2wire.h $(srcdir)/ldns/wire2str.h
+ $(srcdir)/util/net_help.h $(srcdir)/util/log.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/pkthdr.h \
+ $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/wire2str.h
unitldns.lo unitldns.o: $(srcdir)/testcode/unitldns.c config.h $(srcdir)/util/log.h $(srcdir)/testcode/unitmain.h \
- $(srcdir)/ldns/sbuffer.h $(srcdir)/ldns/str2wire.h $(srcdir)/ldns/rrdef.h $(srcdir)/ldns/wire2str.h
+ $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/wire2str.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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.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)/daemon/cachedump.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h \
+ $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \
+ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h $(srcdir)/util/alloc.h \
+ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \
+ $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \
+ $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \
+ $(srcdir)/services/cache/dns.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h \
+ $(srcdir)/util/rbtree.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 $(srcdir)/ldns/sbuffer.h $(srcdir)/ldns/wire2str.h $(srcdir)/ldns/str2wire.h
+ $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h $(srcdir)/sldns/wire2str.h \
+ $(srcdir)/sldns/str2wire.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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/util/module.h \
- $(srcdir)/daemon/remote.h \
+ $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h \
+ $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \
+ $(srcdir)/util/netevent.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \
+ $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/util/module.h \
+ $(srcdir)/dnstap/dnstap.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 $(srcdir)/ldns/keyraw.h
+ $(srcdir)/util/net_help.h $(srcdir)/sldns/keyraw.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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.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 $(srcdir)/ldns/str2wire.h $(srcdir)/ldns/parseutil.h \
- $(srcdir)/ldns/wire2str.h $(srcdir)/ldns/sbuffer.h
+ $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \
+ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \
+ $(srcdir)/util/netevent.h $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h \
+ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \
+ $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.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/storage/dnstree.h \
+ $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h $(srcdir)/services/mesh.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)/iterator/iter_delegpt.h \
+ $(srcdir)/services/outside_network.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/parseutil.h \
+ $(srcdir)/sldns/wire2str.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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.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 \
- $(srcdir)/ldns/sbuffer.h
+ $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \
+ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \
+ $(srcdir)/util/netevent.h $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h \
+ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \
+ $(srcdir)/daemon/daemon.h $(srcdir)/services/modstack.h \
+ $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/outside_network.h \
+ $(srcdir)/services/listen_dnsport.h $(srcdir)/util/config_file.h $(srcdir)/util/tube.h $(srcdir)/util/net_help.h \
+ $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h $(srcdir)/services/cache/rrset.h \
+ $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h \
+ $(srcdir)/util/rtt.h $(srcdir)/validator/val_kcache.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/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)/ldns/pkthdr.h \
- $(srcdir)/ldns/rrdef.h $(srcdir)/util/net_help.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h
+ $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h \
+ $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/module.h \
+ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \
+ $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/net_help.h $(srcdir)/util/mini_event.h \
+ $(srcdir)/util/rbtree.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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.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)/util/random.h $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \
+ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \
+ $(srcdir)/util/netevent.h $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h \
+ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \
+ $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.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)/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 $(srcdir)/ldns/sbuffer.h
+ $(srcdir)/validator/val_anchor.h $(srcdir)/libunbound/context.h $(srcdir)/libunbound/unbound.h \
+ $(srcdir)/libunbound/libworker.h
testbound.lo testbound.o: $(srcdir)/testcode/testbound.c config.h $(srcdir)/testcode/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)/ldns/keyraw.h $(srcdir)/daemon/unbound.c $(srcdir)/util/log.h \
+ $(srcdir)/util/config_file.h $(srcdir)/sldns/keyraw.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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.h $(srcdir)/util/net_help.h $(srcdir)/util/mini_event.h \
- $(srcdir)/util/rbtree.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/storage/dnstree.h \
+ $(srcdir)/util/rtt.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \
+ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \
+ $(srcdir)/services/mesh.h $(srcdir)/util/net_help.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h
testpkts.lo testpkts.o: $(srcdir)/testcode/testpkts.c config.h $(srcdir)/testcode/testpkts.h \
- $(srcdir)/util/net_help.h $(srcdir)/util/log.h $(srcdir)/ldns/sbuffer.h $(srcdir)/ldns/rrdef.h $(srcdir)/ldns/pkthdr.h \
- $(srcdir)/ldns/str2wire.h $(srcdir)/ldns/wire2str.h
+ $(srcdir)/util/net_help.h $(srcdir)/util/log.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/pkthdr.h \
+ $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/wire2str.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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.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)/util/random.h $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \
+ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \
+ $(srcdir)/util/netevent.h $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h \
+ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \
+ $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.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)/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 $(srcdir)/ldns/sbuffer.h
+ $(srcdir)/validator/val_anchor.h $(srcdir)/libunbound/context.h $(srcdir)/libunbound/unbound.h \
+ $(srcdir)/libunbound/libworker.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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/util/module.h \
- $(srcdir)/daemon/remote.h \
+ $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h \
+ $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \
+ $(srcdir)/util/netevent.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \
+ $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/util/module.h \
+ $(srcdir)/dnstap/dnstap.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 $(srcdir)/ldns/keyraw.h $(srcdir)/edns-subnet/edns-subnet.h
+ $(srcdir)/util/net_help.h $(srcdir)/sldns/keyraw.h $(srcdir)/edns-subnet/edns-subnet.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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.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 \
- $(srcdir)/ldns/sbuffer.h
+ $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \
+ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \
+ $(srcdir)/util/netevent.h $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h \
+ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \
+ $(srcdir)/daemon/daemon.h $(srcdir)/services/modstack.h \
+ $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/outside_network.h \
+ $(srcdir)/services/listen_dnsport.h $(srcdir)/util/config_file.h $(srcdir)/util/tube.h $(srcdir)/util/net_help.h \
+ $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h $(srcdir)/services/cache/rrset.h \
+ $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h \
+ $(srcdir)/util/rtt.h $(srcdir)/validator/val_kcache.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/testpkts.h \
- $(srcdir)/util/rbtree.h $(srcdir)/testcode/fake_event.h $(srcdir)/ldns/str2wire.h $(srcdir)/ldns/rrdef.h
+ $(srcdir)/util/rbtree.h $(srcdir)/testcode/fake_event.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.h \
+ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.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/testpkts.h $(srcdir)/util/fptr_wlist.h \
- $(srcdir)/util/module.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h \
- $(srcdir)/ldns/sbuffer.h $(srcdir)/ldns/wire2str.h $(srcdir)/ldns/str2wire.h
+ $(srcdir)/services/outside_network.h $(srcdir)/util/rbtree.h \
+ $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rtt.h \
+ $(srcdir)/testcode/replay.h $(srcdir)/testcode/testpkts.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/module.h \
+ $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h $(srcdir)/sldns/sbuffer.h \
+ $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.h $(srcdir)/util/tube.h \
+ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.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)/ldns/pkthdr.h \
- $(srcdir)/ldns/rrdef.h $(srcdir)/testcode/unitmain.h $(srcdir)/testcode/readhex.h $(srcdir)/ldns/sbuffer.h \
- $(srcdir)/ldns/parseutil.h
+ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \
+ $(srcdir)/sldns/rrdef.h $(srcdir)/testcode/unitmain.h $(srcdir)/testcode/readhex.h $(srcdir)/sldns/sbuffer.h \
+ $(srcdir)/sldns/parseutil.h
readhex.lo readhex.o: $(srcdir)/testcode/readhex.c config.h $(srcdir)/testcode/readhex.h $(srcdir)/util/log.h \
- $(srcdir)/ldns/sbuffer.h $(srcdir)/ldns/parseutil.h
+ $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/parseutil.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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.h $(srcdir)/util/tube.h \
+ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.h $(srcdir)/util/net_help.h $(srcdir)/util/regional.h \
+ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.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 \
- $(srcdir)/ldns/sbuffer.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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.h \
- $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \
- $(srcdir)/services/modstack.h
+ $(srcdir)/sldns/sbuffer.h
+worker_cb.lo worker_cb.o: $(srcdir)/smallapp/worker_cb.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)/libunbound/worker.h $(srcdir)/sldns/sbuffer.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)/sldns/pkthdr.h \
+ $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.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)/ldns/pkthdr.h \
- $(srcdir)/ldns/rrdef.h $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h $(srcdir)/services/localzone.h \
+ $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \
+ $(srcdir)/sldns/rrdef.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 $(srcdir)/ldns/sbuffer.h
+ $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rtt.h $(srcdir)/sldns/sbuffer.h
libunbound.lo libunbound.o: $(srcdir)/libunbound/libunbound.c $(srcdir)/libunbound/unbound.h \
$(srcdir)/libunbound/unbound-event.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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.h $(srcdir)/util/regional.h \
+ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.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 $(srcdir)/ldns/sbuffer.h
+ $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rtt.h \
+ $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/sldns/sbuffer.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)/libunbound/unbound-event.h \
- $(srcdir)/services/outside_network.h $(srcdir)/util/netevent.h $(srcdir)/services/mesh.h \
- $(srcdir)/util/data/msgparse.h $(srcdir)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.h $(srcdir)/util/module.h \
+ $(srcdir)/services/modstack.h $(srcdir)/libunbound/unbound.h $(srcdir)/libunbound/worker.h \
+ $(srcdir)/sldns/sbuffer.h $(srcdir)/libunbound/unbound-event.h $(srcdir)/services/outside_network.h \
+ $(srcdir)/util/netevent.h $(srcdir)/services/mesh.h \
+ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.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 $(srcdir)/ldns/sbuffer.h \
- $(srcdir)/ldns/str2wire.h
+ $(srcdir)/util/storage/slabhash.h $(srcdir)/services/outbound_list.h $(srcdir)/util/fptr_wlist.h \
+ $(srcdir)/util/tube.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)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h \
+ $(srcdir)/util/storage/dnstree.h $(srcdir)/sldns/str2wire.h
unbound-host.lo unbound-host.o: $(srcdir)/smallapp/unbound-host.c config.h $(srcdir)/libunbound/unbound.h \
- $(srcdir)/ldns/rrdef.h $(srcdir)/ldns/wire2str.h
+ $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/wire2str.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 \
- $(srcdir)/ldns/rrdef.h
+ $(srcdir)/sldns/rrdef.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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.h $(srcdir)/util/data/msgreply.h \
- $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/dname.h $(srcdir)/ldns/sbuffer.h \
- $(srcdir)/ldns/str2wire.h $(srcdir)/ldns/wire2str.h \
+ $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgreply.h \
+ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/dname.h $(srcdir)/sldns/sbuffer.h \
+ $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/wire2str.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 $(srcdir)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.h \
- $(srcdir)/ldns/sbuffer.h $(srcdir)/ldns/wire2str.h $(srcdir)/ldns/str2wire.h
+ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \
+ $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.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 $(srcdir)/ldns/sbuffer.h
+ $(srcdir)/util/config_file.h $(srcdir)/sldns/sbuffer.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 \
- $(srcdir)/ldns/rrdef.h \
+ $(srcdir)/sldns/rrdef.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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.h \
- $(srcdir)/util/netevent.h $(srcdir)/util/net_help.h $(srcdir)/services/cache/dns.h \
+ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \
+ $(srcdir)/sldns/rrdef.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 \
- $(srcdir)/ldns/sbuffer.h
+ $(srcdir)/iterator/iter_delegpt.h $(srcdir)/sldns/sbuffer.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)/ldns/pkthdr.h $(srcdir)/ldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/util/module.h \
- $(srcdir)/daemon/remote.h \
+ $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h \
+ $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \
+ $(srcdir)/util/netevent.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \
+ $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/util/module.h \
+ $(srcdir)/dnstap/dnstap.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 \
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 \
- $(srcdir)/ldns/rrdef.h $(srcdir)/ldns/pkthdr.h $(srcdir)/ldns/wire2str.h
-keyraw.lo keyraw.o: $(srcdir)/ldns/keyraw.c config.h $(srcdir)/ldns/keyraw.h \
- $(srcdir)/ldns/rrdef.h \
+ $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/wire2str.h
+keyraw.lo keyraw.o: $(srcdir)/sldns/keyraw.c config.h $(srcdir)/sldns/keyraw.h \
+ $(srcdir)/sldns/rrdef.h \
-sbuffer.lo sbuffer.o: $(srcdir)/ldns/sbuffer.c config.h $(srcdir)/ldns/sbuffer.h
-wire2str.lo wire2str.o: $(srcdir)/ldns/wire2str.c config.h $(srcdir)/ldns/wire2str.h $(srcdir)/ldns/str2wire.h \
- $(srcdir)/ldns/rrdef.h $(srcdir)/ldns/pkthdr.h $(srcdir)/ldns/parseutil.h $(srcdir)/ldns/sbuffer.h $(srcdir)/ldns/keyraw.h \
+sbuffer.lo sbuffer.o: $(srcdir)/sldns/sbuffer.c config.h $(srcdir)/sldns/sbuffer.h
+wire2str.lo wire2str.o: $(srcdir)/sldns/wire2str.c config.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h \
+ $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/sbuffer.h \
+ $(srcdir)/sldns/keyraw.h \
-parse.lo parse.o: $(srcdir)/ldns/parse.c config.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/parseutil.h \
- $(srcdir)/ldns/sbuffer.h
-parseutil.lo parseutil.o: $(srcdir)/ldns/parseutil.c config.h $(srcdir)/ldns/parseutil.h
-rrdef.lo rrdef.o: $(srcdir)/ldns/rrdef.c config.h $(srcdir)/ldns/rrdef.h $(srcdir)/ldns/parseutil.h
-str2wire.lo str2wire.o: $(srcdir)/ldns/str2wire.c config.h $(srcdir)/ldns/str2wire.h $(srcdir)/ldns/rrdef.h \
- $(srcdir)/ldns/wire2str.h $(srcdir)/ldns/sbuffer.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/parseutil.h
+parse.lo parse.o: $(srcdir)/sldns/parse.c config.h $(srcdir)/sldns/parse.h $(srcdir)/sldns/parseutil.h \
+ $(srcdir)/sldns/sbuffer.h
+parseutil.lo parseutil.o: $(srcdir)/sldns/parseutil.c config.h $(srcdir)/sldns/parseutil.h
+rrdef.lo rrdef.o: $(srcdir)/sldns/rrdef.c config.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/parseutil.h
+str2wire.lo str2wire.o: $(srcdir)/sldns/str2wire.c config.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.h \
+ $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/parse.h $(srcdir)/sldns/parseutil.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
strlcat.lo strlcat.o: $(srcdir)/compat/strlcat.c config.h
strlcpy.lo strlcpy.o: $(srcdir)/compat/strlcpy.c config.h
strptime.lo strptime.o: $(srcdir)/compat/strptime.c config.h
+getentropy_linux.lo getentropy_linux.o: $(srcdir)/compat/getentropy_linux.c config.h \
+
+getentropy_osx.lo getentropy_osx.o: $(srcdir)/compat/getentropy_osx.c config.h
+getentropy_solaris.lo getentropy_solaris.o: $(srcdir)/compat/getentropy_solaris.c config.h
+getentropy_win.lo getentropy_win.o: $(srcdir)/compat/getentropy_win.c
+explicit_bzero.lo explicit_bzero.o: $(srcdir)/compat/explicit_bzero.c config.h
+arc4random.lo arc4random.o: $(srcdir)/compat/arc4random.c config.h $(srcdir)/compat/chacha_private.h
+arc4random_uniform.lo arc4random_uniform.o: $(srcdir)/compat/arc4random_uniform.c config.h
+arc4_lock.lo arc4_lock.o: $(srcdir)/compat/arc4_lock.c config.h $(srcdir)/util/locks.h
+sha512.lo sha512.o: $(srcdir)/compat/sha512.c config.h
+reallocarray.lo reallocarray.o: $(srcdir)/compat/reallocarray.c config.h
# Copyright 2009, Wouter Wijngaards, NLnet Labs.
# BSD licensed.
#
-# Version 26
+# Version 27
+# 2015-03-17 AHX_CONFIG_REALLOCARRAY added
# 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.
#endif
])
+dnl provide reallocarray compat prototype.
+dnl $1: unique name for compat code
+AC_DEFUN([AHX_CONFIG_REALLOCARRAY],
+[
+#ifndef HAVE_REALLOCARRAY
+#define reallocarray reallocarray$1
+void* reallocarray(void *ptr, size_t nmemb, size_t size);
+#endif
+])
+
dnl provide w32 compat definition for sleep
AC_DEFUN([AHX_CONFIG_W32_SLEEP],
[
fi
if test -z "$PYTHON_VERSION"; then
- PYTHON_VERSION=`$PYTHON -c "import sys, string; \
- print string.split(sys.version)[[0]]"`
+ PYTHON_VERSION=`$PYTHON -c "import sys; \
+ print(sys.version.split()[[0]])"`
fi
- #
- # Check for a version of Python >= 2.1.0
- #
- AC_MSG_CHECKING([for a version of Python >= '2.1.0'])
- ac_supports_python_ver=`$PYTHON -c "import sys, string; \
- ver = string.split(sys.version)[[0]]; \
- print ver >= '2.1.0'"`
- if test "$ac_supports_python_ver" != "True"; then
- if test -z "$PYTHON_NOVERSIONCHECK"; then
- AC_MSG_RESULT([no])
- AC_MSG_FAILURE([
-This version of the AC@&t@_PYTHON_DEVEL macro
-doesn't work properly with versions of Python before
-2.1.0. You may need to re-run configure, setting the
-variables PYTHON_CPPFLAGS, PYTHON_LDFLAGS, PYTHON_SITE_PKG,
-PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand.
-Moreover, to disable this check, set PYTHON_NOVERSIONCHECK
-to something else than an empty string.
-])
- else
- AC_MSG_RESULT([skip at user request])
- fi
- else
- AC_MSG_RESULT([yes])
- fi
-
- #
- # if the macro parameter ``version'' is set, honour it
- #
- if test -n "$1"; then
- AC_MSG_CHECKING([for a version of Python $1])
- ac_supports_python_ver=`$PYTHON -c "import sys, string; \
- ver = string.split(sys.version)[[0]]; \
- print ver $1"`
- if test "$ac_supports_python_ver" = "True"; then
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
- AC_MSG_ERROR([this package requires Python $1.
-If you have it installed, but it isn't the default Python
-interpreter in your system path, please pass the PYTHON_VERSION
-variable to configure. See ``configure --help'' for reference.
-])
- PYTHON_VERSION=""
- fi
- fi
-
#
# Check if you have distutils, else fail
#
AC_MSG_CHECKING([for Python include path])
if test -z "$PYTHON_CPPFLAGS"; then
python_path=`$PYTHON -c "import distutils.sysconfig; \
- print distutils.sysconfig.get_python_inc();"`
+ print(distutils.sysconfig.get_python_inc());"`
if test -n "${python_path}"; then
python_path="-I$python_path"
fi
#
AC_MSG_CHECKING([for Python library path])
if test -z "$PYTHON_LDFLAGS"; then
- # (makes two attempts to ensure we've got a version number
- # from the interpreter)
- py_version=`$PYTHON -c "from distutils.sysconfig import *; \
- from string import join; \
- print join(get_config_vars('VERSION'))"`
- if test "$py_version" = "[None]"; then
- if test -n "$PYTHON_VERSION"; then
- py_version=$PYTHON_VERSION
- else
- py_version=`$PYTHON -c "import sys; \
- print sys.version[[:3]]"`
- fi
- fi
-
PYTHON_LDFLAGS=`$PYTHON -c "from distutils.sysconfig import *; \
- from string import join; \
- print '-L' + get_python_lib(0,1), \
- '-L' + os.path.dirname(get_python_lib(0,1)), \
- '-lpython';"`$py_version
+ print(get_config_var('BLDLIBRARY'));"`
fi
AC_MSG_RESULT([$PYTHON_LDFLAGS])
AC_SUBST([PYTHON_LDFLAGS])
AC_MSG_CHECKING([for Python site-packages path])
if test -z "$PYTHON_SITE_PKG"; then
PYTHON_SITE_PKG=`$PYTHON -c "import distutils.sysconfig; \
- print distutils.sysconfig.get_python_lib(1,0);"`
+ print(distutils.sysconfig.get_python_lib(1,0));"`
fi
AC_MSG_RESULT([$PYTHON_SITE_PKG])
AC_SUBST([PYTHON_SITE_PKG])
- #
- # libraries which must be linked in when embedding
- #
- AC_MSG_CHECKING(python extra libraries)
- if test -z "$PYTHON_EXTRA_LIBS"; then
- PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \
- conf = distutils.sysconfig.get_config_var; \
- print conf('LOCALMODLIBS'), conf('LIBS')"`
- fi
- AC_MSG_RESULT([$PYTHON_EXTRA_LIBS])
- AC_SUBST(PYTHON_EXTRA_LIBS)
-
- #
- # linking flags needed when embedding
- #
- AC_MSG_CHECKING(python extra linking flags)
- if test -z "$PYTHON_EXTRA_LDFLAGS"; then
- PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import distutils.sysconfig; \
- conf = distutils.sysconfig.get_config_var; \
- print conf('LINKFORSHARED')"`
- fi
- AC_MSG_RESULT([$PYTHON_EXTRA_LDFLAGS])
- AC_SUBST(PYTHON_EXTRA_LDFLAGS)
-
#
# final check to see if everything compiles alright
#
{
struct addrinfo *ai;
- ai = malloc(sizeof(*ai) + sizeof(struct sockaddr_in));
+ ai = calloc(1, sizeof(*ai) + sizeof(struct sockaddr_in));
if (ai == NULL)
return (NULL);
- memset(ai, '\0', sizeof(*ai) + sizeof(struct sockaddr_in));
-
ai->ai_addr = (struct sockaddr *)(ai + 1);
/* XXX -- ssh doesn't use sa_len */
ai->ai_addrlen = sizeof(struct sockaddr_in);
* Values are specified as for C:
* 0x=hex, 0=octal, isdigit=decimal.
*/
- if (!isdigit(c))
+ if (!isdigit((unsigned char)c))
return (0);
val = 0; base = 10;
if (c == '0') {
base = 8;
}
for (;;) {
- if (isascii(c) && isdigit(c)) {
+ if (isascii((unsigned char)c) && isdigit((unsigned char)c)) {
val = (val * base) + (c - '0');
c = *++cp;
- } else if (base == 16 && isascii(c) && isxdigit(c)) {
+ } else if (base == 16 && isascii((unsigned char)c) && isxdigit((unsigned char)c)) {
val = (val << 4) |
- (c + 10 - (islower(c) ? 'a' : 'A'));
+ (c + 10 - (islower((unsigned char)c) ? 'a' : 'A'));
c = *++cp;
} else
break;
/*
* Check for trailing characters.
*/
- if (c != '\0' && (!isascii(c) || !isspace(c)))
+ if (c != '\0' && (!isascii((unsigned char)c) || !isspace((unsigned char)c)))
return (0);
/*
* Concoct the address according to
to[i] = from[i];
return dest;
}
- if (from > to && from-to < (int)n) {
+ if (from > to && from-to < (int)n) {
/* to overlaps with from */
/* <from......> */
/* <to........> */
{
int ret=0, count=0;
- while (*buf[0] != '\0' && isdigit(*buf[0]) && count<max) {
+ while (*buf[0] != '\0' && isdigit((unsigned char)*buf[0]) && count<max) {
ret = ret*10 + (*buf[0] - '0');
(*buf)++;
count++;
while ((c = *format) != '\0') {
/* whitespace, literal or format */
- if (isspace(c)) { /* whitespace */
+ if (isspace((unsigned char)c)) { /* whitespace */
/** whitespace matches zero or more whitespace characters in the
* input string.
**/
- while (isspace(*s))
+ while (isspace((unsigned char)*s))
s++;
}
else if (c == '%') { /* format */
break;
case 'n': /* arbitrary whitespace */
case 't':
- while (isspace(*s))
+ while (isspace((unsigned char)*s))
s++;
break;
case 'p': /* am pm */
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright 1992-2013 Free Software Foundation, Inc.
+# Copyright 1992-2014 Free Software Foundation, Inc.
-timestamp='2013-06-10'
+timestamp='2014-03-23'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright 1992-2013 Free Software Foundation, Inc.
+Copyright 1992-2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
LIBC=gnu
#endif
EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
;;
esac
*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
- i*:MSYS*:*)
+ *:MSYS*:*)
echo ${UNAME_MACHINE}-pc-msys
exit ;;
i*:windows32*:*)
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
;;
- or1k:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ openrisc*:Linux:*:*)
+ echo or1k-unknown-linux-${LIBC}
exit ;;
- or32:Linux:*:*)
+ or32:Linux:*:* | or1k*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
padre:Linux:*:*)
if test "$UNAME_PROCESSOR" = unknown ; then
UNAME_PROCESSOR=powerpc
fi
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
- if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_64BIT_ARCH >/dev/null
- then
- case $UNAME_PROCESSOR in
- i386) UNAME_PROCESSOR=x86_64 ;;
- powerpc) UNAME_PROCESSOR=powerpc64 ;;
- esac
+ if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ case $UNAME_PROCESSOR in
+ i386) UNAME_PROCESSOR=x86_64 ;;
+ powerpc) UNAME_PROCESSOR=powerpc64 ;;
+ esac
+ fi
fi
+ elif test "$UNAME_PROCESSOR" = i386 ; then
+ # Avoid executing cc on OS X 10.9, as it ships with a stub
+ # that puts up a graphical alert prompting to install
+ # developer tools. Any system running Mac OS X 10.7 or
+ # later (Darwin 11 and later) is required to have a 64-bit
+ # processor. This is not true of the ARM version of Darwin
+ # that Apple uses in portable devices.
+ UNAME_PROCESSOR=x86_64
fi
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
exit ;;
exit ;;
esac
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
- /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
- I don't know.... */
- printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
- printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
- "4"
-#else
- ""
-#endif
- ); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
- printf ("arm-acorn-riscix\n"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
- printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
- int version;
- version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
- if (version < 4)
- printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
- else
- printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
- exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
- printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
- printf ("ns32k-encore-mach\n"); exit (0);
-#else
- printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
- printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
- printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
- printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
- struct utsname un;
-
- uname(&un);
-
- if (strncmp(un.version, "V2", 2) == 0) {
- printf ("i386-sequent-ptx2\n"); exit (0);
- }
- if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
- printf ("i386-sequent-ptx1\n"); exit (0);
- }
- printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-# include <sys/param.h>
-# if defined (BSD)
-# if BSD == 43
- printf ("vax-dec-bsd4.3\n"); exit (0);
-# else
-# if BSD == 199006
- printf ("vax-dec-bsd4.3reno\n"); exit (0);
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# endif
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# else
- printf ("vax-dec-ultrix\n"); exit (0);
-# endif
-#endif
-
-#if defined (alliant) && defined (i860)
- printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
- exit (1);
-}
-EOF
-
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
- { echo "$SYSTEM_NAME"; exit; }
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
- case `getsysinfo -f cpu_type` in
- c1*)
- echo c1-convex-bsd
- exit ;;
- c2*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit ;;
- c34*)
- echo c34-convex-bsd
- exit ;;
- c38*)
- echo c38-convex-bsd
- exit ;;
- c4*)
- echo c4-convex-bsd
- exit ;;
- esac
-fi
-
cat >&2 <<EOF
$0: unable to guess system type
/* Define this to enable client subnet option. */
#undef CLIENT_SUBNET
+/* Do sha512 definitions in config.h */
+#undef COMPAT_SHA512
+
/* Pathname to the Unbound configuration file */
#undef CONFIGFILE
-/* configure flags */
-#undef CONFIGURE_BUILD_WITH
-
-/* configure date */
-#undef CONFIGURE_DATE
-
-/* configure target system */
-#undef CONFIGURE_TARGET
-
/* Define this if on macOSX10.4-darwin8 and setreuid and setregid do not work
*/
#undef DARWIN_BROKEN_SETREUID
/* Whether daemon is deprecated */
#undef DEPRECATED_DAEMON
+/* default dnstap socket path */
+#undef DNSTAP_SOCKET_PATH
+
/* Define if you want to use debug lock checking (slow). */
#undef ENABLE_LOCK_CHECKS
internal symbols */
#undef EXPORT_ALL_SYMBOLS
+/* Define to 1 if you have the `arc4random' function. */
+#undef HAVE_ARC4RANDOM
+
/* Define to 1 if you have the `arc4random_uniform' function. */
#undef HAVE_ARC4RANDOM_UNIFORM
/* Whether the C compiler accepts the "unused" attribute */
#undef HAVE_ATTR_UNUSED
-/* Define to 1 if your system has a working `chown' function. */
+/* Define to 1 if you have the `chown' function. */
#undef HAVE_CHOWN
/* Define to 1 if you have the `chroot' function. */
/* Define to 1 if you have the `daemon' function. */
#undef HAVE_DAEMON
+/* Define to 1 if you have the declaration of `arc4random', and to 0 if you
+ don't. */
+#undef HAVE_DECL_ARC4RANDOM
+
+/* Define to 1 if you have the declaration of `arc4random_uniform', and to 0
+ if you don't. */
+#undef HAVE_DECL_ARC4RANDOM_UNIFORM
+
/* Define to 1 if you have the declaration of `NID_secp384r1', and to 0 if you
don't. */
#undef HAVE_DECL_NID_SECP384R1
if you don't. */
#undef HAVE_DECL_NID_X9_62_PRIME256V1
+/* Define to 1 if you have the declaration of `reallocarray', and to 0 if you
+ don't. */
+#undef HAVE_DECL_REALLOCARRAY
+
/* Define to 1 if you have the declaration of `sk_SSL_COMP_pop_free', and to 0
if you don't. */
#undef HAVE_DECL_SK_SSL_COMP_POP_FREE
`SSL_COMP_get_compression_methods', and to 0 if you don't. */
#undef HAVE_DECL_SSL_COMP_GET_COMPRESSION_METHODS
+/* Define to 1 if you have the declaration of `strlcat', and to 0 if you
+ don't. */
+#undef HAVE_DECL_STRLCAT
+
+/* Define to 1 if you have the declaration of `strlcpy', and to 0 if you
+ don't. */
+#undef HAVE_DECL_STRLCPY
+
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
+/* Define to 1 if you have the <endian.h> header file. */
+#undef HAVE_ENDIAN_H
+
/* Define to 1 if you have the `endprotoent' function. */
#undef HAVE_ENDPROTOENT
/* Whether getaddrinfo is available */
#undef HAVE_GETADDRINFO
+/* Define to 1 if you have the `getauxval' function. */
+#undef HAVE_GETAUXVAL
+
+/* Define to 1 if you have the `getentropy' function. */
+#undef HAVE_GETENTROPY
+
/* Define to 1 if you have the <getopt.h> header file. */
#undef HAVE_GETOPT_H
/* Define to 1 if you have the `kill' function. */
#undef HAVE_KILL
+/* Define if we have LibreSSL */
+#undef HAVE_LIBRESSL
+
/* Define to 1 if you have the `localtime_r' function. */
#undef HAVE_LOCALTIME_R
/* Define to 1 if you have the `random' function. */
#undef HAVE_RANDOM
+/* Define to 1 if you have the `reallocarray' function. */
+#undef HAVE_REALLOCARRAY
+
/* Define to 1 if you have the `recvmsg' function. */
#undef HAVE_RECVMSG
/* Define to 1 if you have the `setusercontext' function. */
#undef HAVE_SETUSERCONTEXT
+/* Define to 1 if you have the `SHA512_Update' function. */
+#undef HAVE_SHA512_UPDATE
+
/* Define to 1 if you have the `sigprocmask' function. */
#undef HAVE_SIGPROCMASK
/* Define to 1 if `ipi_spec_dst' is a member of `struct in_pktinfo'. */
#undef HAVE_STRUCT_IN_PKTINFO_IPI_SPEC_DST
+/* Define to 1 if `sun_len' is a member of `struct sockaddr_un'. */
+#undef HAVE_STRUCT_SOCKADDR_UN_SUN_LEN
+
/* Define if you have Swig libraries and header files. */
#undef HAVE_SWIG
/* Define to 1 if you have the <sys/resource.h> header file. */
#undef HAVE_SYS_RESOURCE_H
+/* Define to 1 if you have the <sys/sha2.h> header file. */
+#undef HAVE_SYS_SHA2_H
+
/* Define to 1 if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
+/* Define to 1 if you have the <sys/sysctl.h> header file. */
+#undef HAVE_SYS_SYSCTL_H
+
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <sys/uio.h> header file. */
#undef HAVE_SYS_UIO_H
+/* Define to 1 if you have the <sys/un.h> header file. */
+#undef HAVE_SYS_UN_H
+
/* Define to 1 if you have the <sys/wait.h> header file. */
#undef HAVE_SYS_WAIT_H
/* define this to enable debug checks. */
#undef UNBOUND_DEBUG
+/* Define to 1 to enable dnstap support */
+#undef USE_DNSTAP
+
/* Define this to enable ECDSA support. */
#undef USE_ECDSA
#define ARG_LL "%I64"
#endif
+#ifndef AF_LOCAL
+#define AF_LOCAL AF_UNIX
+#endif
+
#ifdef HAVE_ATTR_FORMAT
#endif
+#ifndef HAVE_REALLOCARRAY
+#define reallocarray reallocarrayunbound
+void* reallocarray(void *ptr, size_t nmemb, size_t size);
+#endif
+
+
#if !defined(HAVE_SLEEP) || defined(HAVE_WINDOWS_H)
#define sleep(x) Sleep((x)*1000) /* on win32 */
#endif /* HAVE_SLEEP */
char *strptime(const char *s, const char *format, struct tm *tm);
#endif
+#ifdef HAVE_LIBRESSL
+# if !HAVE_DECL_STRLCPY
+size_t strlcpy(char *dst, const char *src, size_t siz);
+# endif
+# if !HAVE_DECL_STRLCAT
+size_t strlcat(char *dst, const char *src, size_t siz);
+# endif
+# if !HAVE_DECL_ARC4RANDOM && defined(HAVE_ARC4RANDOM)
+uint32_t arc4random(void);
+# endif
+# if !HAVE_DECL_ARC4RANDOM_UNIFORM && defined(HAVE_ARC4RANDOM_UNIFORM)
+uint32_t arc4random_uniform(uint32_t upper_bound);
+# endif
+# if !HAVE_DECL_REALLOCARRAY
+void *reallocarray(void *ptr, size_t nmemb, size_t size);
+# endif
+#endif /* HAVE_LIBRESSL */
+#ifndef HAVE_ARC4RANDOM
+void explicit_bzero(void* buf, size_t len);
+int getentropy(void* buf, size_t len);
+uint32_t arc4random(void);
+void arc4random_buf(void* buf, size_t n);
+void _ARC4_LOCK(void);
+void _ARC4_UNLOCK(void);
+#endif
+#ifndef HAVE_ARC4RANDOM_UNIFORM
+uint32_t arc4random_uniform(uint32_t upper_bound);
+#endif
+#ifdef COMPAT_SHA512
+#ifndef SHA512_DIGEST_LENGTH
+#define SHA512_BLOCK_LENGTH 128
+#define SHA512_DIGEST_LENGTH 64
+#define SHA512_DIGEST_STRING_LENGTH (SHA512_DIGEST_LENGTH * 2 + 1)
+typedef struct _SHA512_CTX {
+ uint64_t state[8];
+ uint64_t bitcount[2];
+ uint8_t buffer[SHA512_BLOCK_LENGTH];
+} SHA512_CTX;
+#endif /* SHA512_DIGEST_LENGTH */
+void SHA512_Init(SHA512_CTX*);
+void SHA512_Update(SHA512_CTX*, void*, size_t);
+void SHA512_Final(uint8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*);
+unsigned char *SHA512(void* data, unsigned int data_len, unsigned char *digest);
+#endif /* COMPAT_SHA512 */
+
+
+
#if defined(HAVE_EVENT_H) && !defined(HAVE_EVENT_BASE_ONCE) && !(defined(HAVE_EV_LOOP) || defined(HAVE_EV_DEFAULT_LOOP)) && (defined(HAVE_PTHREAD) || defined(HAVE_SOLARIS_THREADS))
/* using version of libevent that is not threadsafe. */
# define LIBEVENT_SIGNAL_PROBLEM 1
#! /bin/sh
# Configuration validation subroutine script.
-# Copyright 1992-2013 Free Software Foundation, Inc.
+# Copyright 1992-2014 Free Software Foundation, Inc.
-timestamp='2013-08-10'
+timestamp='2014-09-11'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
version="\
GNU config.sub ($timestamp)
-Copyright 1992-2013 Free Software Foundation, Inc.
+Copyright 1992-2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
| hexagon \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
+ | k1om \
| le32 | le64 \
| lm32 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
| mips64vr5900 | mips64vr5900el \
| mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \
+ | mipsisa32r6 | mipsisa32r6el \
| mipsisa64 | mipsisa64el \
| mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64r6 | mipsisa64r6el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
| mipsr5900 | mipsr5900el \
| nds32 | nds32le | nds32be \
| nios | nios2 | nios2eb | nios2el \
| ns16k | ns32k \
- | open8 \
- | or1k | or32 \
+ | open8 | or1k | or1knd | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle \
| pyramid \
+ | riscv32 | riscv64 \
| rl78 | rx \
| score \
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
c6x)
basic_machine=tic6x-unknown
;;
- m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
+ m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
basic_machine=$basic_machine-unknown
os=-none
;;
| hexagon-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \
+ | k1om-* \
| le32-* | le64-* \
| lm32-* \
| m32c-* | m32r-* | m32rle-* \
| mips64vr5900-* | mips64vr5900el-* \
| mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \
+ | mipsisa32r6-* | mipsisa32r6el-* \
| mipsisa64-* | mipsisa64el-* \
| mipsisa64r2-* | mipsisa64r2el-* \
+ | mipsisa64r6-* | mipsisa64r6el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipsr5900-* | mipsr5900el-* \
| nios-* | nios2-* | nios2eb-* | nios2el-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| open8-* \
+ | or1k*-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
basic_machine=powerpc-unknown
os=-morphos
;;
+ moxiebox)
+ basic_machine=moxie-unknown
+ os=-moxiebox
+ ;;
msdos)
basic_machine=i386-pc
os=-msdos
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
| -linux-newlib* | -linux-musl* | -linux-uclibc* \
- | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
mips*-*)
os=-elf
;;
- or1k-*)
- os=-elf
- ;;
or32-*)
os=-coff
;;
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for unbound 1.4.23.
+# Generated by GNU Autoconf 2.69 for unbound 1.5.4.
#
# Report bugs to <unbound-bugs@nlnetlabs.nl>.
#
# Identity of this package.
PACKAGE_NAME='unbound'
PACKAGE_TARNAME='unbound'
-PACKAGE_VERSION='1.4.23'
-PACKAGE_STRING='unbound 1.4.23'
+PACKAGE_VERSION='1.5.4'
+PACKAGE_STRING='unbound 1.5.4'
PACKAGE_BUGREPORT='unbound-bugs@nlnetlabs.nl'
PACKAGE_URL=''
#endif"
ac_subst_vars='LTLIBOBJS
+date
+version
INSTALLTARGET
ALLTARGET
SOURCEFILE
SOURCEDETERMINE
+DNSTAP_OBJ
+DNSTAP_SRC
+opt_dnstap_socket_path
+ENABLE_DNSTAP
+PROTOC_C
UBSYMS
EXTRALINK
COMMON_OBJ_ALL_SYMBOLS
LIBOBJ_WITHOUT_CTIME
+LIBOBJ_WITHOUT_CTIMEARC4
WIN_CHECKCONF_OBJ_LINK
WIN_CONTROL_OBJ_LINK
WIN_UBANCHOR_OBJ_LINK
swig
SWIG_LIB
SWIG
-PYTHON_EXTRA_LDFLAGS
-PYTHON_EXTRA_LIBS
+PY_MAJOR_VERSION
PYTHON_SITE_PKG
PYTHON_LDFLAGS
PYTHON_CPPFLAGS
SED
LIBTOOL
AR
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
libtool
STRIP
doxygen
UNBOUND_SHARE_DIR
UNBOUND_CHROOT_DIR
UNBOUND_RUN_DIR
+ub_conf_dir
ub_conf_file
EGREP
GREP
LDFLAGS
CFLAGS
CC
-target_os
-target_vendor
-target_cpu
-target
-host_os
-host_vendor
-host_cpu
-host
-build_os
-build_vendor
-build_cpu
-build
LIBUNBOUND_AGE
LIBUNBOUND_REVISION
LIBUNBOUND_CURRENT
enable_static_exe
enable_lock_checks
enable_allsymbols
+enable_dnstap
+with_dnstap_socket_path
+with_protobuf_c
+with_libfstrm
with_libunbound_only
'
ac_precious_vars='build_alias
# 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 unbound 1.4.23 to adapt to many kinds of systems.
+\`configure' configures unbound 1.5.4 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
System types:
--build=BUILD configure for building on BUILD [guessed]
--host=HOST cross-compile to build programs to run on HOST [BUILD]
- --target=TARGET configure for building compilers for TARGET [HOST]
_ACEOF
fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of unbound 1.4.23:";;
+ short | recursive ) echo "Configuration of unbound 1.5.4:";;
esac
cat <<\_ACEOF
--enable-allsymbols export all symbols from libunbound and link binaries
to it, smaller install size but libunbound export
table is polluted by internal symbols
+ --enable-dnstap Enable dnstap support (requires fstrm, protobuf-c)
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
an explicit path). Slower, but allows use of large
outgoing port ranges.
--with-libexpat=path specify explicit path for libexpat.
+ --with-dnstap-socket-path=pathname
+ set default dnstap socket path
+ --with-protobuf-c=path Path where protobuf-c is installed, for dnstap
+ --with-libfstrm=path Path where libfstrm is installed, for dnstap
--with-libunbound-only do not build daemon and tool programs
Some influential environment variables:
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-unbound configure 1.4.23
+unbound configure 1.5.4
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by unbound $as_me 1.4.23, which was
+It was created by unbound $as_me 1.5.4, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
UNBOUND_VERSION_MAJOR=1
-UNBOUND_VERSION_MINOR=4
+UNBOUND_VERSION_MINOR=5
-UNBOUND_VERSION_MICRO=23
+UNBOUND_VERSION_MICRO=4
-LIBUNBOUND_CURRENT=4
-LIBUNBOUND_REVISION=3
-LIBUNBOUND_AGE=2
+LIBUNBOUND_CURRENT=5
+LIBUNBOUND_REVISION=7
+LIBUNBOUND_AGE=3
# 1.0.0 had 0:12:0
# 1.0.1 had 0:13:0
# 1.0.2 had 0:14:0
# 1.4.20 had 4:0:2 # adds libunbound.ttl # but shipped 3:5:1
# 1.4.21 had 4:1:2
# 1.4.22 had 4:1:2
-# 1.4.23 had 4:3:2
+# 1.5.0 had 5:3:3 # adds ub_ctx_add_ta_autr
+# 1.5.1 had 5:3:3
+# 1.5.2 had 5:5:3
+# 1.5.3 had 5:6:3
+# 1.5.4 had 5:7:3
# Current -- the number of the binary API that we're implementing
# Revision -- which iteration of the implementation of the binary
-pretty_cmdline() {
- cmdline=""
- while test -n "$1"; do
- cmdline="$cmdline '"`echo $1 | sed -e 's/\\\\/\\\\\\\\/g' | sed -e 's/"/\\\\"/g' `"'"
- shift
- done
-}
-pretty_cmdline $@
-
-cat >>confdefs.h <<_ACEOF
-#define CONFIGURE_BUILD_WITH "$cmdline"
-_ACEOF
-
-ac_aux_dir=
-for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
- if test -f "$ac_dir/install-sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f "$ac_dir/install.sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- elif test -f "$ac_dir/shtool"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/shtool install -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
-fi
-
-# These three variables are undocumented and unsupported,
-# and are intended to be withdrawn in a future Autoconf release.
-# They can cause serious problems if a builder's source tree is in a directory
-# whose full name contains unusual characters.
-ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
-ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
-ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
-
-
-# Make sure we can run config.sub.
-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
- as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
-$as_echo_n "checking build system type... " >&6; }
-if ${ac_cv_build+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_build_alias=$build_alias
-test "x$ac_build_alias" = x &&
- ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
-test "x$ac_build_alias" = x &&
- as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
-$as_echo "$ac_cv_build" >&6; }
-case $ac_cv_build in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
-esac
-build=$ac_cv_build
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_build
-shift
-build_cpu=$1
-build_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-build_os=$*
-IFS=$ac_save_IFS
-case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
-$as_echo_n "checking host system type... " >&6; }
-if ${ac_cv_host+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "x$host_alias" = x; then
- ac_cv_host=$ac_cv_build
-else
- ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
-$as_echo "$ac_cv_host" >&6; }
-case $ac_cv_host in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
-esac
-host=$ac_cv_host
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_host
-shift
-host_cpu=$1
-host_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-host_os=$*
-IFS=$ac_save_IFS
-case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5
-$as_echo_n "checking target system type... " >&6; }
-if ${ac_cv_target+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "x$target_alias" = x; then
- ac_cv_target=$ac_cv_host
-else
- ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5
-$as_echo "$ac_cv_target" >&6; }
-case $ac_cv_target in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;;
-esac
-target=$ac_cv_target
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_target
-shift
-target_cpu=$1
-target_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-target_os=$*
-IFS=$ac_save_IFS
-case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
-
-
-# The aliases save the names the user supplied, while $host etc.
-# will get canonicalized.
-test -n "$target_alias" &&
- test "$program_prefix$program_suffix$program_transform_name" = \
- NONENONEs,x,x, &&
- program_prefix=${target_alias}-
-
-cat >>confdefs.h <<_ACEOF
-#define CONFIGURE_TARGET "$target"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define CONFIGURE_DATE "`date`"
-_ACEOF
-
-
CFLAGS="$CFLAGS"
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
#define CONFIGFILE "$hdr_config"
_ACEOF
+ub_conf_dir=`$as_dirname -- "$ub_conf_file" ||
+$as_expr X"$ub_conf_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ub_conf_file" : 'X\(//\)[^/]' \| \
+ X"$ub_conf_file" : 'X\(//\)$' \| \
+ X"$ub_conf_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ub_conf_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
# Determine run, chroot directory and pidfile locations
STRIP="$ac_cv_prog_STRIP"
fi
+ac_aux_dir=
+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+ if test -f "$ac_dir/install-sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f "$ac_dir/install.sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f "$ac_dir/shtool"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
+fi
-# skip these tests, we do not need them.
-
-
-
-
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+ as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if ${ac_cv_build+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+ ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+ as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
-# always use ./libtool unless override from commandline (libtool=mylibtool)
-if test -z "$libtool"; then
- libtool="./libtool"
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
-# avoid libtool max commandline length test on systems that fork slowly.
-if echo "$host_os" | grep "sunos4" >/dev/null; then
- lt_cv_sys_max_cmd_len=32750;
-fi
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ar; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_AR+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if ${ac_cv_host+:} false; then :
$as_echo_n "(cached) " >&6
else
- case $AR in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_AR="$AR" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "x$host_alias" = x; then
+ ac_cv_host=$ac_cv_build
+else
+ ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+
+# skip these tests, we do not need them.
+
+
+
+
+
+
+
+
+# always use ./libtool unless override from commandline (libtool=mylibtool)
+if test -z "$libtool"; then
+ libtool="./libtool"
+fi
+
+# avoid libtool max commandline length test on systems that fork slowly.
+
+if echo "$host_os" | grep "sunos4" >/dev/null; then
+ lt_cv_sys_max_cmd_len=32750;
+fi
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $AR in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_AR="$AR" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_AR="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
# Checks for header files.
-for ac_header in stdarg.h stdbool.h netinet/in.h sys/param.h sys/socket.h sys/uio.h sys/resource.h arpa/inet.h syslog.h netdb.h sys/wait.h pwd.h glob.h grp.h login_cap.h winsock2.h ws2tcpip.h
+for ac_header in stdarg.h stdbool.h netinet/in.h sys/param.h sys/socket.h sys/un.h sys/uio.h sys/resource.h arpa/inet.h syslog.h netdb.h sys/wait.h pwd.h glob.h grp.h login_cap.h winsock2.h ws2tcpip.h endian.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#define _XOPEN_SOURCE
+#define _XOPEN_SOURCE 600
#include <time.h>
int main(void) { struct tm tm; char *res;
res = strptime("2010-07-15T00:00:00+00:00", "%t%Y%t-%t%m%t-%t%d%tT%t%H%t:%t%M%t:%t%S%t", &tm);
fi
if test -z "$PYTHON_VERSION"; then
- PYTHON_VERSION=`$PYTHON -c "import sys, string; \
- print string.split(sys.version)[0]"`
+ PYTHON_VERSION=`$PYTHON -c "import sys; \
+ print(sys.version.split()[0])"`
fi
- #
- # Check for a version of Python >= 2.1.0
- #
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a version of Python >= '2.1.0'" >&5
-$as_echo_n "checking for a version of Python >= '2.1.0'... " >&6; }
- ac_supports_python_ver=`$PYTHON -c "import sys, string; \
- ver = string.split(sys.version)[0]; \
- print ver >= '2.1.0'"`
- if test "$ac_supports_python_ver" != "True"; then
- if test -z "$PYTHON_NOVERSIONCHECK"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "
-This version of the AC_PYTHON_DEVEL macro
-doesn't work properly with versions of Python before
-2.1.0. You may need to re-run configure, setting the
-variables PYTHON_CPPFLAGS, PYTHON_LDFLAGS, PYTHON_SITE_PKG,
-PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand.
-Moreover, to disable this check, set PYTHON_NOVERSIONCHECK
-to something else than an empty string.
-
-See \`config.log' for more details" "$LINENO" 5; }
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: skip at user request" >&5
-$as_echo "skip at user request" >&6; }
- fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- fi
-
- #
- # if the macro parameter ``version'' is set, honour it
- #
- if test -n ""; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a version of Python " >&5
-$as_echo_n "checking for a version of Python ... " >&6; }
- ac_supports_python_ver=`$PYTHON -c "import sys, string; \
- ver = string.split(sys.version)[0]; \
- print ver "`
- if test "$ac_supports_python_ver" = "True"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- as_fn_error $? "this package requires Python .
-If you have it installed, but it isn't the default Python
-interpreter in your system path, please pass the PYTHON_VERSION
-variable to configure. See \`\`configure --help'' for reference.
-" "$LINENO" 5
- PYTHON_VERSION=""
- fi
- fi
-
#
# Check if you have distutils, else fail
#
$as_echo_n "checking for Python include path... " >&6; }
if test -z "$PYTHON_CPPFLAGS"; then
python_path=`$PYTHON -c "import distutils.sysconfig; \
- print distutils.sysconfig.get_python_inc();"`
+ print(distutils.sysconfig.get_python_inc());"`
if test -n "${python_path}"; then
python_path="-I$python_path"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python library path" >&5
$as_echo_n "checking for Python library path... " >&6; }
if test -z "$PYTHON_LDFLAGS"; then
- # (makes two attempts to ensure we've got a version number
- # from the interpreter)
- py_version=`$PYTHON -c "from distutils.sysconfig import *; \
- from string import join; \
- print join(get_config_vars('VERSION'))"`
- if test "$py_version" = "None"; then
- if test -n "$PYTHON_VERSION"; then
- py_version=$PYTHON_VERSION
- else
- py_version=`$PYTHON -c "import sys; \
- print sys.version[:3]"`
- fi
- fi
-
PYTHON_LDFLAGS=`$PYTHON -c "from distutils.sysconfig import *; \
- from string import join; \
- print '-L' + get_python_lib(0,1), \
- '-L' + os.path.dirname(get_python_lib(0,1)), \
- '-lpython';"`$py_version
+ print(get_config_var('BLDLIBRARY'));"`
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_LDFLAGS" >&5
$as_echo "$PYTHON_LDFLAGS" >&6; }
$as_echo_n "checking for Python site-packages path... " >&6; }
if test -z "$PYTHON_SITE_PKG"; then
PYTHON_SITE_PKG=`$PYTHON -c "import distutils.sysconfig; \
- print distutils.sysconfig.get_python_lib(1,0);"`
+ print(distutils.sysconfig.get_python_lib(1,0));"`
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_SITE_PKG" >&5
$as_echo "$PYTHON_SITE_PKG" >&6; }
- #
- # libraries which must be linked in when embedding
- #
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking python extra libraries" >&5
-$as_echo_n "checking python extra libraries... " >&6; }
- if test -z "$PYTHON_EXTRA_LIBS"; then
- PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \
- conf = distutils.sysconfig.get_config_var; \
- print conf('LOCALMODLIBS'), conf('LIBS')"`
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_EXTRA_LIBS" >&5
-$as_echo "$PYTHON_EXTRA_LIBS" >&6; }
-
-
- #
- # linking flags needed when embedding
- #
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking python extra linking flags" >&5
-$as_echo_n "checking python extra linking flags... " >&6; }
- if test -z "$PYTHON_EXTRA_LDFLAGS"; then
- PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import distutils.sysconfig; \
- conf = distutils.sysconfig.get_config_var; \
- print conf('LINKFORSHARED')"`
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_EXTRA_LDFLAGS" >&5
-$as_echo "$PYTHON_EXTRA_LDFLAGS" >&6; }
-
-
#
# final check to see if everything compiles alright
#
#
if test ! -z "$PYTHON_VERSION"; then
- if test `$PYTHON -c "print '$PYTHON_VERSION' >= '2.4.0'"` = "False"; then
+ if test `$PYTHON -c "print('$PYTHON_VERSION' >= '2.4.0')"` = "False"; then
as_fn_error $? "Python version >= 2.4.0 is required" "$LINENO" 5
fi
+ PY_MAJOR_VERSION="`$PYTHON -c "import sys; print(sys.version_info.major)"`"
+
# Have Python
$as_echo "#define HAVE_PYTHON 1" >>confdefs.h
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LibreSSL" >&5
+$as_echo_n "checking for LibreSSL... " >&6; }
+if grep OPENSSL_VERSION_TEXT $ssldir/include/openssl/opensslv.h | grep "LibreSSL" >/dev/null; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_LIBRESSL 1" >>confdefs.h
+
+ # libressl provides these compat functions, but they may also be
+ # declared by the OS in libc. See if they have been declared.
+ ac_fn_c_check_decl "$LINENO" "strlcpy" "ac_cv_have_decl_strlcpy" "$ac_includes_default"
+if test "x$ac_cv_have_decl_strlcpy" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRLCPY $ac_have_decl
+_ACEOF
+ac_fn_c_check_decl "$LINENO" "strlcat" "ac_cv_have_decl_strlcat" "$ac_includes_default"
+if test "x$ac_cv_have_decl_strlcat" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRLCAT $ac_have_decl
+_ACEOF
+ac_fn_c_check_decl "$LINENO" "arc4random" "ac_cv_have_decl_arc4random" "$ac_includes_default"
+if test "x$ac_cv_have_decl_arc4random" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ARC4RANDOM $ac_have_decl
+_ACEOF
+ac_fn_c_check_decl "$LINENO" "arc4random_uniform" "ac_cv_have_decl_arc4random_uniform" "$ac_includes_default"
+if test "x$ac_cv_have_decl_arc4random_uniform" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ARC4RANDOM_UNIFORM $ac_have_decl
+_ACEOF
+ac_fn_c_check_decl "$LINENO" "reallocarray" "ac_cv_have_decl_reallocarray" "$ac_includes_default"
+if test "x$ac_cv_have_decl_reallocarray" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_REALLOCARRAY $ac_have_decl
+_ACEOF
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
for ac_header in openssl/conf.h
do :
ac_fn_c_check_header_compile "$LINENO" "openssl/conf.h" "ac_cv_header_openssl_conf_h" "$ac_includes_default
fi
+
# Check whether --enable-sha2 was given.
if test "${enable_sha2+set}" = set; then :
enableval=$enable_sha2;
# see if OPENSSL 1.0.0 or later (has EVP MD and Verify independency)
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if openssl supports SHA2 and ECDSA with EVP" >&5
$as_echo_n "checking if openssl supports SHA2 and ECDSA with EVP... " >&6; }
- if grep OPENSSL_VERSION_NUMBER $ssldir/include/openssl/opensslv.h | grep 0x0 >/dev/null; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ if grep OPENSSL_VERSION_TEXT $ssldir/include/openssl/opensslv.h | grep "OpenSSL" >/dev/null; then
+ if grep OPENSSL_VERSION_NUMBER $ssldir/include/openssl/opensslv.h | grep 0x0 >/dev/null; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
cat >>confdefs.h <<_ACEOF
#define USE_ECDSA_EVP_WORKAROUND 1
_ACEOF
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ fi
else
+ # not OpenSSL, thus likely LibreSSL, which supports it
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
fi
fi
+fi
+
+ac_fn_c_check_member "$LINENO" "struct sockaddr_un" "sun_len" "ac_cv_member_struct_sockaddr_un_sun_len" "
+$ac_includes_default
+#ifdef HAVE_SYS_UN_H
+#include <sys/un.h>
+#endif
+
+"
+if test "x$ac_cv_member_struct_sockaddr_un_sun_len" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_SOCKADDR_UN_SUN_LEN 1
+_ACEOF
+
+
fi
ac_fn_c_check_member "$LINENO" "struct in_pktinfo" "ipi_spec_dst" "ac_cv_member_struct_in_pktinfo_ipi_spec_dst" "
fi
-for ac_func in tzset sigprocmask fcntl getpwnam getrlimit setrlimit setsid sbrk chroot kill sleep usleep random srandom arc4random_uniform recvmsg sendmsg writev socketpair glob initgroups strftime localtime_r setusercontext _beginthreadex endservent endprotoent
+for ac_func in tzset sigprocmask fcntl getpwnam getrlimit setrlimit setsid sbrk chroot kill chown sleep usleep random srandom recvmsg sendmsg writev socketpair glob initgroups strftime localtime_r setusercontext _beginthreadex endservent endprotoent
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
fi
-LIBOBJ_WITHOUT_CTIME="$LIBOBJS"
-
-ac_fn_c_check_func "$LINENO" "ctime_r" "ac_cv_func_ctime_r"
-if test "x$ac_cv_func_ctime_r" = xyes; then :
- $as_echo "#define HAVE_CTIME_R 1" >>confdefs.h
+ac_fn_c_check_func "$LINENO" "reallocarray" "ac_cv_func_reallocarray"
+if test "x$ac_cv_func_reallocarray" = xyes; then :
+ $as_echo "#define HAVE_REALLOCARRAY 1" >>confdefs.h
else
case " $LIBOBJS " in
- *" ctime_r.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS ctime_r.$ac_objext"
+ *" reallocarray.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS reallocarray.$ac_objext"
;;
esac
fi
+LIBOBJ_WITHOUT_CTIMEARC4="$LIBOBJS"
-# Check whether --enable-allsymbols was given.
-if test "${enable_allsymbols+set}" = set; then :
- enableval=$enable_allsymbols;
-fi
+if test "$USE_NSS" = "no"; then
+ ac_fn_c_check_func "$LINENO" "arc4random" "ac_cv_func_arc4random"
+if test "x$ac_cv_func_arc4random" = xyes; then :
+ $as_echo "#define HAVE_ARC4RANDOM 1" >>confdefs.h
-case "$enable_allsymbols" in
- yes)
- COMMON_OBJ_ALL_SYMBOLS=""
- UBSYMS=""
- EXTRALINK="-L. -L.libs -lunbound"
+else
+ case " $LIBOBJS " in
+ *" arc4random.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS arc4random.$ac_objext"
+ ;;
+esac
-$as_echo "#define EXPORT_ALL_SYMBOLS 1" >>confdefs.h
+fi
- ;;
- no|*)
- COMMON_OBJ_ALL_SYMBOLS='$(COMMON_OBJ)'
- UBSYMS='-export-symbols $(srcdir)/libunbound/ubsyms.def'
- EXTRALINK=""
- ;;
-esac
+ ac_fn_c_check_func "$LINENO" "arc4random_uniform" "ac_cv_func_arc4random_uniform"
+if test "x$ac_cv_func_arc4random_uniform" = xyes; then :
+ $as_echo "#define HAVE_ARC4RANDOM_UNIFORM 1" >>confdefs.h
+else
+ case " $LIBOBJS " in
+ *" arc4random_uniform.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS arc4random_uniform.$ac_objext"
+ ;;
+esac
-if test x_$enable_lock_checks = x_yes; then
- UBSYMS="-export-symbols clubsyms.def"
- cp ${srcdir}/libunbound/ubsyms.def clubsyms.def
- echo lock_protect >> clubsyms.def
- echo lock_unprotect >> clubsyms.def
- echo lock_get_mem >> clubsyms.def
- echo checklock_start >> clubsyms.def
- echo checklock_stop >> clubsyms.def
- echo checklock_lock >> clubsyms.def
- echo checklock_unlock >> clubsyms.def
- echo checklock_init >> clubsyms.def
- echo checklock_thrcreate >> clubsyms.def
- echo checklock_thrjoin >> clubsyms.def
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if ${MAKE:-make} supports $< with implicit rule in scope" >&5
-$as_echo_n "checking if ${MAKE:-make} supports $< with implicit rule in scope... " >&6; }
-# on openBSD, the implicit rule make $< work.
-# on Solaris, it does not work ($? is changed sources, $^ lists dependencies).
-# gmake works.
-cat >conftest.make <<EOF
-all: conftest.lo
-conftest.lo foo.lo bla.lo:
- if test -f "\$<"; then touch \$@; fi
+ if test "$ac_cv_func_arc4random" = "no"; then
+ case " $LIBOBJS " in
+ *" explicit_bzero.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS explicit_bzero.$ac_objext"
+ ;;
+esac
-.SUFFIXES: .lo
-.c.lo:
- if test -f "\$<"; then touch \$@; fi
+ case " $LIBOBJS " in
+ *" arc4_lock.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS arc4_lock.$ac_objext"
+ ;;
+esac
+
+ for ac_func in getentropy
+do :
+ ac_fn_c_check_func "$LINENO" "getentropy" "ac_cv_func_getentropy"
+if test "x$ac_cv_func_getentropy" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GETENTROPY 1
+_ACEOF
-conftest.lo: conftest.dir/conftest.c
-EOF
-mkdir conftest.dir
-touch conftest.dir/conftest.c
-rm -f conftest.lo conftest.c
-${MAKE:-make} -f conftest.make >/dev/null
-rm -f conftest.make conftest.c conftest.dir/conftest.c
-rm -rf conftest.dir
-if test ! -f conftest.lo; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- SOURCEDETERMINE='echo "$^" | awk "-F " "{print \$$1;}" > .source'
- SOURCEFILE='`cat .source`'
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- SOURCEDETERMINE=':'
- SOURCEFILE='$<'
-fi
-rm -f conftest.lo
+ if test "$USE_WINSOCK" = 1; then
+ case " $LIBOBJS " in
+ *" getentropy_win.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS getentropy_win.$ac_objext"
+ ;;
+esac
+ else
+ case `uname` in
+ Darwin)
+ case " $LIBOBJS " in
+ *" getentropy_osx.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS getentropy_osx.$ac_objext"
+ ;;
+esac
-# see if we want to build the library or everything
-ALLTARGET="alltargets"
+ ;;
+ SunOS)
+ case " $LIBOBJS " in
+ *" getentropy_solaris.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS getentropy_solaris.$ac_objext"
+ ;;
+esac
+
+ for ac_header in sys/sha2.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "sys/sha2.h" "ac_cv_header_sys_sha2_h" "$ac_includes_default
+"
+if test "x$ac_cv_header_sys_sha2_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_SHA2_H 1
+_ACEOF
+
+else
+
+ for ac_func in SHA512_Update
+do :
+ ac_fn_c_check_func "$LINENO" "SHA512_Update" "ac_cv_func_SHA512_Update"
+if test "x$ac_cv_func_SHA512_Update" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SHA512_UPDATE 1
+_ACEOF
+
+else
+
+ case " $LIBOBJS " in
+ *" sha512.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS sha512.$ac_objext"
+ ;;
+esac
+
+
+fi
+done
+
+
+fi
+
+done
+
+ if test "$ac_cv_header_sys_sha2_h" = "yes"; then
+ # this lib needed for sha2 on solaris
+ LIBS="$LIBS -lmd"
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5
+$as_echo_n "checking for library containing clock_gettime... " >&6; }
+if ${ac_cv_search_clock_gettime+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char clock_gettime ();
+int
+main ()
+{
+return clock_gettime ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' rt; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_clock_gettime=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_clock_gettime+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_clock_gettime+:} false; then :
+
+else
+ ac_cv_search_clock_gettime=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5
+$as_echo "$ac_cv_search_clock_gettime" >&6; }
+ac_res=$ac_cv_search_clock_gettime
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+ ;;
+ Linux|*)
+ case " $LIBOBJS " in
+ *" getentropy_linux.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS getentropy_linux.$ac_objext"
+ ;;
+esac
+
+ for ac_func in SHA512_Update
+do :
+ ac_fn_c_check_func "$LINENO" "SHA512_Update" "ac_cv_func_SHA512_Update"
+if test "x$ac_cv_func_SHA512_Update" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SHA512_UPDATE 1
+_ACEOF
+
+else
+
+
+$as_echo "#define COMPAT_SHA512 1" >>confdefs.h
+
+ case " $LIBOBJS " in
+ *" sha512.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS sha512.$ac_objext"
+ ;;
+esac
+
+
+fi
+done
+
+ for ac_header in sys/sysctl.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "sys/sysctl.h" "ac_cv_header_sys_sysctl_h" "$ac_includes_default
+"
+if test "x$ac_cv_header_sys_sysctl_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_SYSCTL_H 1
+_ACEOF
+
+fi
+
+done
+
+ for ac_func in getauxval
+do :
+ ac_fn_c_check_func "$LINENO" "getauxval" "ac_cv_func_getauxval"
+if test "x$ac_cv_func_getauxval" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GETAUXVAL 1
+_ACEOF
+
+fi
+done
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5
+$as_echo_n "checking for library containing clock_gettime... " >&6; }
+if ${ac_cv_search_clock_gettime+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char clock_gettime ();
+int
+main ()
+{
+return clock_gettime ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' rt; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_clock_gettime=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_clock_gettime+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_clock_gettime+:} false; then :
+
+else
+ ac_cv_search_clock_gettime=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5
+$as_echo "$ac_cv_search_clock_gettime" >&6; }
+ac_res=$ac_cv_search_clock_gettime
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+ ;;
+ esac
+ fi
+
+fi
+done
+
+ fi
+fi
+LIBOBJ_WITHOUT_CTIME="$LIBOBJS"
+
+ac_fn_c_check_func "$LINENO" "ctime_r" "ac_cv_func_ctime_r"
+if test "x$ac_cv_func_ctime_r" = xyes; then :
+ $as_echo "#define HAVE_CTIME_R 1" >>confdefs.h
+
+else
+ case " $LIBOBJS " in
+ *" ctime_r.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS ctime_r.$ac_objext"
+ ;;
+esac
+
+fi
+
+
+
+# Check whether --enable-allsymbols was given.
+if test "${enable_allsymbols+set}" = set; then :
+ enableval=$enable_allsymbols;
+fi
+
+case "$enable_allsymbols" in
+ yes)
+ COMMON_OBJ_ALL_SYMBOLS=""
+ UBSYMS=""
+ EXTRALINK="-L. -L.libs -lunbound"
+
+$as_echo "#define EXPORT_ALL_SYMBOLS 1" >>confdefs.h
+
+ ;;
+ no|*)
+ COMMON_OBJ_ALL_SYMBOLS='$(COMMON_OBJ)'
+ UBSYMS='-export-symbols $(srcdir)/libunbound/ubsyms.def'
+ EXTRALINK=""
+ ;;
+esac
+
+
+
+if test x_$enable_lock_checks = x_yes; then
+ UBSYMS="-export-symbols clubsyms.def"
+ cp ${srcdir}/libunbound/ubsyms.def clubsyms.def
+ echo lock_protect >> clubsyms.def
+ echo lock_unprotect >> clubsyms.def
+ echo lock_get_mem >> clubsyms.def
+ echo checklock_start >> clubsyms.def
+ echo checklock_stop >> clubsyms.def
+ echo checklock_lock >> clubsyms.def
+ echo checklock_unlock >> clubsyms.def
+ echo checklock_init >> clubsyms.def
+ echo checklock_thrcreate >> clubsyms.def
+ echo checklock_thrjoin >> clubsyms.def
+fi
+
+# check for dnstap if requested
+
+ # Check whether --enable-dnstap was given.
+if test "${enable_dnstap+set}" = set; then :
+ enableval=$enable_dnstap; opt_dnstap=$enableval
+else
+ opt_dnstap=no
+fi
+
+
+
+# Check whether --with-dnstap-socket-path was given.
+if test "${with_dnstap_socket_path+set}" = set; then :
+ withval=$with_dnstap_socket_path; opt_dnstap_socket_path=$withval
+else
+ opt_dnstap_socket_path="$UNBOUND_RUN_DIR/dnstap.sock"
+fi
+
+
+ if test "x$opt_dnstap" != "xno"; then
+ # Extract the first word of "protoc-c", so it can be a program name with args.
+set dummy protoc-c; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PROTOC_C+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PROTOC_C in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PROTOC_C="$PROTOC_C" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PROTOC_C="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PROTOC_C=$ac_cv_path_PROTOC_C
+if test -n "$PROTOC_C"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PROTOC_C" >&5
+$as_echo "$PROTOC_C" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ if test -z "$PROTOC_C"; then
+ as_fn_error $? "The protoc-c program was not found. Please install protobuf-c!" "$LINENO" 5
+ fi
+
+# Check whether --with-protobuf-c was given.
+if test "${with_protobuf_c+set}" = set; then :
+ withval=$with_protobuf_c;
+ # workaround for protobuf-c includes at old dir before protobuf-c-1.0.0
+ if test -f $withval/include/google/protobuf-c/protobuf-c.h; then
+ CFLAGS="$CFLAGS -I$withval/include/google"
+ else
+ CFLAGS="$CFLAGS -I$withval/include"
+ fi
+ LDFLAGS="$LDFLAGS -L$withval/lib"
+
+else
+
+ # workaround for protobuf-c includes at old dir before protobuf-c-1.0.0
+ if test -f /usr/include/google/protobuf-c/protobuf-c.h; then
+ CFLAGS="$CFLAGS -I/usr/include/google"
+ else
+ if test -f /usr/local/include/google/protobuf-c/protobuf-c.h; then
+ CFLAGS="$CFLAGS -I/usr/local/include/google"
+ LDFLAGS="$LDFLAGS -L/usr/local/lib"
+ fi
+ fi
+
+fi
+
+
+# Check whether --with-libfstrm was given.
+if test "${with_libfstrm+set}" = set; then :
+ withval=$with_libfstrm;
+ CFLAGS="$CFLAGS -I$withval/include"
+ LDFLAGS="$LDFLAGS -L$withval/lib"
+
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing fstrm_iothr_init" >&5
+$as_echo_n "checking for library containing fstrm_iothr_init... " >&6; }
+if ${ac_cv_search_fstrm_iothr_init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char fstrm_iothr_init ();
+int
+main ()
+{
+return fstrm_iothr_init ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' fstrm; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_fstrm_iothr_init=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_fstrm_iothr_init+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_fstrm_iothr_init+:} false; then :
+
+else
+ ac_cv_search_fstrm_iothr_init=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_fstrm_iothr_init" >&5
+$as_echo "$ac_cv_search_fstrm_iothr_init" >&6; }
+ac_res=$ac_cv_search_fstrm_iothr_init
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+else
+ as_fn_error $? "The fstrm library was not found. Please install fstrm!" "$LINENO" 5
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing protobuf_c_message_pack" >&5
+$as_echo_n "checking for library containing protobuf_c_message_pack... " >&6; }
+if ${ac_cv_search_protobuf_c_message_pack+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char protobuf_c_message_pack ();
+int
+main ()
+{
+return protobuf_c_message_pack ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' protobuf-c; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_protobuf_c_message_pack=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_protobuf_c_message_pack+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_protobuf_c_message_pack+:} false; then :
+
+else
+ ac_cv_search_protobuf_c_message_pack=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_protobuf_c_message_pack" >&5
+$as_echo "$ac_cv_search_protobuf_c_message_pack" >&6; }
+ac_res=$ac_cv_search_protobuf_c_message_pack
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+else
+ as_fn_error $? "The protobuf-c library was not found. Please install protobuf-c!" "$LINENO" 5
+fi
+
+
+
+$as_echo "#define USE_DNSTAP 1" >>confdefs.h
+
+ ENABLE_DNSTAP=1
+
+
+
+ hdr_dnstap_socket_path="`echo $opt_dnstap_socket_path | sed -e 's/\\\\/\\\\\\\\/g'`"
+
+
+cat >>confdefs.h <<_ACEOF
+#define DNSTAP_SOCKET_PATH "$hdr_dnstap_socket_path"
+_ACEOF
+
+
+ DNSTAP_SRC="dnstap/dnstap.c dnstap/dnstap.pb-c.c"
+
+ DNSTAP_OBJ="dnstap.lo dnstap.pb-c.lo"
+
+
+ else
+
+ ENABLE_DNSTAP=0
+
+
+
+ fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if ${MAKE:-make} supports $< with implicit rule in scope" >&5
+$as_echo_n "checking if ${MAKE:-make} supports $< with implicit rule in scope... " >&6; }
+# on openBSD, the implicit rule make $< work.
+# on Solaris, it does not work ($? is changed sources, $^ lists dependencies).
+# gmake works.
+cat >conftest.make <<EOF
+all: conftest.lo
+
+conftest.lo foo.lo bla.lo:
+ if test -f "\$<"; then touch \$@; fi
+
+.SUFFIXES: .lo
+.c.lo:
+ if test -f "\$<"; then touch \$@; fi
+
+conftest.lo: conftest.dir/conftest.c
+EOF
+mkdir conftest.dir
+touch conftest.dir/conftest.c
+rm -f conftest.lo conftest.c
+${MAKE:-make} -f conftest.make >/dev/null
+rm -f conftest.make conftest.c conftest.dir/conftest.c
+rm -rf conftest.dir
+if test ! -f conftest.lo; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ SOURCEDETERMINE='echo "$^" | awk "-F " "{print \$$1;}" > .source'
+ SOURCEFILE='`cat .source`'
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ SOURCEDETERMINE=':'
+ SOURCEFILE='$<'
+fi
+rm -f conftest.lo
+
+
+
+# see if we want to build the library or everything
+ALLTARGET="alltargets"
INSTALLTARGET="install-all"
# Check whether --with-libunbound-only was given.
-ac_config_files="$ac_config_files Makefile doc/example.conf doc/libunbound.3 doc/unbound.8 doc/unbound-anchor.8 doc/unbound-checkconf.8 doc/unbound.conf.5 doc/unbound-control.8 doc/unbound-host.1"
+version=1.5.4
+
+date=`date +'%b %e, %Y'`
+
+
+ac_config_files="$ac_config_files Makefile doc/example.conf doc/libunbound.3 doc/unbound.8 doc/unbound-anchor.8 doc/unbound-checkconf.8 doc/unbound.conf.5 doc/unbound-control.8 doc/unbound-host.1 smallapp/unbound-control-setup.sh dnstap/dnstap_config.h"
ac_config_headers="$ac_config_headers config.h"
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by unbound $as_me 1.4.23, which was
+This file was extended by unbound $as_me 1.5.4, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-unbound config.status 1.4.23
+unbound config.status 1.5.4
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
"doc/unbound.conf.5") CONFIG_FILES="$CONFIG_FILES doc/unbound.conf.5" ;;
"doc/unbound-control.8") CONFIG_FILES="$CONFIG_FILES doc/unbound-control.8" ;;
"doc/unbound-host.1") CONFIG_FILES="$CONFIG_FILES doc/unbound-host.1" ;;
+ "smallapp/unbound-control-setup.sh") CONFIG_FILES="$CONFIG_FILES smallapp/unbound-control-setup.sh" ;;
+ "dnstap/dnstap_config.h") CONFIG_FILES="$CONFIG_FILES dnstap/dnstap_config.h" ;;
"config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
sinclude(ax_pthread.m4)
sinclude(acx_python.m4)
sinclude(ac_pkg_swig.m4)
+sinclude(dnstap/dnstap.m4)
# must be numbers. ac_defun because of later processing
m4_define([VERSION_MAJOR],[1])
-m4_define([VERSION_MINOR],[4])
-m4_define([VERSION_MICRO],[23])
+m4_define([VERSION_MINOR],[5])
+m4_define([VERSION_MICRO],[4])
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=4
-LIBUNBOUND_REVISION=3
-LIBUNBOUND_AGE=2
+LIBUNBOUND_CURRENT=5
+LIBUNBOUND_REVISION=7
+LIBUNBOUND_AGE=3
# 1.0.0 had 0:12:0
# 1.0.1 had 0:13:0
# 1.0.2 had 0:14:0
# 1.4.20 had 4:0:2 # adds libunbound.ttl # but shipped 3:5:1
# 1.4.21 had 4:1:2
# 1.4.22 had 4:1:2
-# 1.4.23 had 4:3:2
+# 1.5.0 had 5:3:3 # adds ub_ctx_add_ta_autr
+# 1.5.1 had 5:3:3
+# 1.5.2 had 5:5:3
+# 1.5.3 had 5:6:3
+# 1.5.4 had 5:7:3
# Current -- the number of the binary API that we're implementing
# Revision -- which iteration of the implementation of the binary
AC_SUBST(LIBUNBOUND_REVISION)
AC_SUBST(LIBUNBOUND_AGE)
-pretty_cmdline() {
- cmdline=""
- while test -n "$1"; do
- cmdline="$cmdline '"`echo $1 | sed -e 's/\\\\/\\\\\\\\/g' | sed -e 's/"/\\\\"/g' `"'"
- shift
- done
-}
-pretty_cmdline $@
-AC_DEFINE_UNQUOTED(CONFIGURE_BUILD_WITH, ["$cmdline"], [configure flags])
-AC_CANONICAL_TARGET
-AC_DEFINE_UNQUOTED(CONFIGURE_TARGET, ["$target"], [configure target system])
-AC_DEFINE_UNQUOTED(CONFIGURE_DATE, ["`date`"], [configure date])
-
CFLAGS="$CFLAGS"
AC_AIX
if test "$ac_cv_header_minix_config_h" = "yes"; then
AC_SUBST(ub_conf_file)
ACX_ESCAPE_BACKSLASH($ub_conf_file, hdr_config)
AC_DEFINE_UNQUOTED(CONFIGFILE, ["$hdr_config"], [Pathname to the Unbound configuration file])
+ub_conf_dir=`AS_DIRNAME(["$ub_conf_file"])`
+AC_SUBST(ub_conf_dir)
# Determine run, chroot directory and pidfile locations
AC_ARG_WITH(run-dir,
ACX_LIBTOOL_C_ONLY
# Checks for header files.
-AC_CHECK_HEADERS([stdarg.h stdbool.h netinet/in.h sys/param.h sys/socket.h sys/uio.h sys/resource.h arpa/inet.h syslog.h netdb.h sys/wait.h pwd.h glob.h grp.h login_cap.h winsock2.h ws2tcpip.h],,, [AC_INCLUDES_DEFAULT])
+AC_CHECK_HEADERS([stdarg.h stdbool.h netinet/in.h sys/param.h sys/socket.h sys/un.h sys/uio.h sys/resource.h arpa/inet.h syslog.h netdb.h sys/wait.h pwd.h glob.h grp.h login_cap.h winsock2.h ws2tcpip.h endian.h],,, [AC_INCLUDES_DEFAULT])
# check for types.
# Using own tests for int64* because autoconf builtin only give 32bit.
AC_MSG_CHECKING(whether strptime works)
if test c${cross_compiling} = cno; then
AC_RUN_IFELSE([AC_LANG_SOURCE([[
-#define _XOPEN_SOURCE
+#define _XOPEN_SOURCE 600
#include <time.h>
int main(void) { struct tm tm; char *res;
res = strptime("2010-07-15T00:00:00+00:00", "%t%Y%t-%t%m%t-%t%d%tT%t%H%t:%t%M%t:%t%S%t", &tm);
ac_save_LIBS="$LIBS" dnl otherwise AC_PYTHON_DEVEL thrashes $LIBS
AC_PYTHON_DEVEL
if test ! -z "$PYTHON_VERSION"; then
- if test `$PYTHON -c "print '$PYTHON_VERSION' >= '2.4.0'"` = "False"; then
+ if test `$PYTHON -c "print('$PYTHON_VERSION' >= '2.4.0')"` = "False"; then
AC_ERROR([Python version >= 2.4.0 is required])
fi
+ PY_MAJOR_VERSION="`$PYTHON -c "import sys; print(sys.version_info.major)"`"
+ AC_SUBST(PY_MAJOR_VERSION)
# Have Python
AC_DEFINE(HAVE_PYTHON,1,[Define if you have Python libraries and header files.])
LIBS="$PYTHON_LDFLAGS $LIBS"
if test $USE_NSS = "no"; then
ACX_WITH_SSL
ACX_LIB_SSL
+AC_MSG_CHECKING([for LibreSSL])
+if grep OPENSSL_VERSION_TEXT $ssldir/include/openssl/opensslv.h | grep "LibreSSL" >/dev/null; then
+ AC_MSG_RESULT([yes])
+ AC_DEFINE([HAVE_LIBRESSL], [1], [Define if we have LibreSSL])
+ # libressl provides these compat functions, but they may also be
+ # declared by the OS in libc. See if they have been declared.
+ AC_CHECK_DECLS([strlcpy,strlcat,arc4random,arc4random_uniform,reallocarray])
+else
+ AC_MSG_RESULT([no])
+fi
AC_CHECK_HEADERS([openssl/conf.h],,, [AC_INCLUDES_DEFAULT])
AC_CHECK_HEADERS([openssl/engine.h],,, [AC_INCLUDES_DEFAULT])
AC_CHECK_FUNCS([OPENSSL_config EVP_sha1 EVP_sha256 EVP_sha512 FIPS_mode])
])
fi
+
AC_ARG_ENABLE(sha2, AC_HELP_STRING([--disable-sha2], [Disable SHA256 and SHA512 RRSIG support]))
case "$enable_sha2" in
no)
])
# see if OPENSSL 1.0.0 or later (has EVP MD and Verify independency)
AC_MSG_CHECKING([if openssl supports SHA2 and ECDSA with EVP])
- if grep OPENSSL_VERSION_NUMBER $ssldir/include/openssl/opensslv.h | grep 0x0 >/dev/null; then
- AC_MSG_RESULT([no])
- AC_DEFINE_UNQUOTED([USE_ECDSA_EVP_WORKAROUND], [1], [Define this to enable an EVP workaround for older openssl])
+ if grep OPENSSL_VERSION_TEXT $ssldir/include/openssl/opensslv.h | grep "OpenSSL" >/dev/null; then
+ if grep OPENSSL_VERSION_NUMBER $ssldir/include/openssl/opensslv.h | grep 0x0 >/dev/null; then
+ AC_MSG_RESULT([no])
+ AC_DEFINE_UNQUOTED([USE_ECDSA_EVP_WORKAROUND], [1], [Define this to enable an EVP workaround for older openssl])
+ else
+ AC_MSG_RESULT([yes])
+ fi
else
+ # not OpenSSL, thus likely LibreSSL, which supports it
AC_MSG_RESULT([yes])
fi
fi
])
fi
+AC_CHECK_MEMBERS([struct sockaddr_un.sun_len],,,[
+AC_INCLUDES_DEFAULT
+#ifdef HAVE_SYS_UN_H
+#include <sys/un.h>
+#endif
+])
AC_CHECK_MEMBERS([struct in_pktinfo.ipi_spec_dst],,,[
AC_INCLUDES_DEFAULT
#if HAVE_SYS_PARAM_H
#endif
])
AC_SEARCH_LIBS([setusercontext], [util])
-AC_CHECK_FUNCS([tzset sigprocmask fcntl getpwnam getrlimit setrlimit setsid sbrk chroot kill sleep usleep random srandom arc4random_uniform recvmsg sendmsg writev socketpair glob initgroups strftime localtime_r setusercontext _beginthreadex endservent endprotoent])
+AC_CHECK_FUNCS([tzset sigprocmask fcntl getpwnam getrlimit setrlimit setsid sbrk chroot kill chown 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])])
AC_REPLACE_FUNCS(strlcpy)
AC_REPLACE_FUNCS(memmove)
AC_REPLACE_FUNCS(gmtime_r)
+AC_REPLACE_FUNCS(reallocarray)
+LIBOBJ_WITHOUT_CTIMEARC4="$LIBOBJS"
+AC_SUBST(LIBOBJ_WITHOUT_CTIMEARC4)
+if test "$USE_NSS" = "no"; then
+ AC_REPLACE_FUNCS(arc4random)
+ AC_REPLACE_FUNCS(arc4random_uniform)
+ if test "$ac_cv_func_arc4random" = "no"; then
+ AC_LIBOBJ(explicit_bzero)
+ AC_LIBOBJ(arc4_lock)
+ AC_CHECK_FUNCS([getentropy],,[
+ if test "$USE_WINSOCK" = 1; then
+ AC_LIBOBJ(getentropy_win)
+ else
+ case `uname` in
+ Darwin)
+ AC_LIBOBJ(getentropy_osx)
+ ;;
+ SunOS)
+ AC_LIBOBJ(getentropy_solaris)
+ AC_CHECK_HEADERS([sys/sha2.h],, [
+ AC_CHECK_FUNCS([SHA512_Update],,[
+ AC_LIBOBJ(sha512)
+ ])
+ ], [AC_INCLUDES_DEFAULT])
+ if test "$ac_cv_header_sys_sha2_h" = "yes"; then
+ # this lib needed for sha2 on solaris
+ LIBS="$LIBS -lmd"
+ fi
+ AC_SEARCH_LIBS([clock_gettime], [rt])
+ ;;
+ Linux|*)
+ AC_LIBOBJ(getentropy_linux)
+ AC_CHECK_FUNCS([SHA512_Update],,[
+ AC_DEFINE([COMPAT_SHA512], [1], [Do sha512 definitions in config.h])
+ AC_LIBOBJ(sha512)
+ ])
+ AC_CHECK_HEADERS([sys/sysctl.h],,, [AC_INCLUDES_DEFAULT])
+ AC_CHECK_FUNCS([getauxval])
+ AC_SEARCH_LIBS([clock_gettime], [rt])
+ ;;
+ esac
+ fi
+ ])
+ fi
+fi
LIBOBJ_WITHOUT_CTIME="$LIBOBJS"
AC_SUBST(LIBOBJ_WITHOUT_CTIME)
AC_REPLACE_FUNCS(ctime_r)
echo checklock_thrjoin >> clubsyms.def
fi
+# check for dnstap if requested
+dt_DNSTAP([$UNBOUND_RUN_DIR/dnstap.sock],
+ [
+ AC_DEFINE([USE_DNSTAP], [1], [Define to 1 to enable dnstap support])
+ AC_SUBST([ENABLE_DNSTAP], [1])
+
+ AC_SUBST([opt_dnstap_socket_path])
+ ACX_ESCAPE_BACKSLASH($opt_dnstap_socket_path, hdr_dnstap_socket_path)
+ AC_DEFINE_UNQUOTED(DNSTAP_SOCKET_PATH,
+ ["$hdr_dnstap_socket_path"], [default dnstap socket path])
+
+ AC_SUBST([DNSTAP_SRC], ["dnstap/dnstap.c dnstap/dnstap.pb-c.c"])
+ AC_SUBST([DNSTAP_OBJ], ["dnstap.lo dnstap.pb-c.lo"])
+ ],
+ [
+ AC_SUBST([ENABLE_DNSTAP], [0])
+ ]
+)
+
AC_MSG_CHECKING([if ${MAKE:-make} supports $< with implicit rule in scope])
# on openBSD, the implicit rule make $< work.
# on Solaris, it does not work ($? is changed sources, $^ lists dependencies).
#else
#define ARG_LL "%I64"
#endif
+
+#ifndef AF_LOCAL
+#define AF_LOCAL AF_UNIX
+#endif
]
AHX_CONFIG_FORMAT_ATTRIBUTE
AHX_CONFIG_STRLCAT(unbound)
AHX_CONFIG_STRLCPY(unbound)
AHX_CONFIG_GMTIME_R(unbound)
+AHX_CONFIG_REALLOCARRAY(unbound)
AHX_CONFIG_W32_SLEEP
AHX_CONFIG_W32_USLEEP
AHX_CONFIG_W32_RANDOM
char *strptime(const char *s, const char *format, struct tm *tm);
#endif
+#ifdef HAVE_LIBRESSL
+# if !HAVE_DECL_STRLCPY
+size_t strlcpy(char *dst, const char *src, size_t siz);
+# endif
+# if !HAVE_DECL_STRLCAT
+size_t strlcat(char *dst, const char *src, size_t siz);
+# endif
+# if !HAVE_DECL_ARC4RANDOM && defined(HAVE_ARC4RANDOM)
+uint32_t arc4random(void);
+# endif
+# if !HAVE_DECL_ARC4RANDOM_UNIFORM && defined(HAVE_ARC4RANDOM_UNIFORM)
+uint32_t arc4random_uniform(uint32_t upper_bound);
+# endif
+# if !HAVE_DECL_REALLOCARRAY
+void *reallocarray(void *ptr, size_t nmemb, size_t size);
+# endif
+#endif /* HAVE_LIBRESSL */
+#ifndef HAVE_ARC4RANDOM
+void explicit_bzero(void* buf, size_t len);
+int getentropy(void* buf, size_t len);
+uint32_t arc4random(void);
+void arc4random_buf(void* buf, size_t n);
+void _ARC4_LOCK(void);
+void _ARC4_UNLOCK(void);
+#endif
+#ifndef HAVE_ARC4RANDOM_UNIFORM
+uint32_t arc4random_uniform(uint32_t upper_bound);
+#endif
+#ifdef COMPAT_SHA512
+#ifndef SHA512_DIGEST_LENGTH
+#define SHA512_BLOCK_LENGTH 128
+#define SHA512_DIGEST_LENGTH 64
+#define SHA512_DIGEST_STRING_LENGTH (SHA512_DIGEST_LENGTH * 2 + 1)
+typedef struct _SHA512_CTX {
+ uint64_t state[8];
+ uint64_t bitcount[2];
+ uint8_t buffer[SHA512_BLOCK_LENGTH];
+} SHA512_CTX;
+#endif /* SHA512_DIGEST_LENGTH */
+void SHA512_Init(SHA512_CTX*);
+void SHA512_Update(SHA512_CTX*, void*, size_t);
+void SHA512_Final(uint8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*);
+unsigned char *SHA512(void* data, unsigned int data_len, unsigned char *digest);
+#endif /* COMPAT_SHA512 */
+
+
+
#if defined(HAVE_EVENT_H) && !defined(HAVE_EVENT_BASE_ONCE) && !(defined(HAVE_EV_LOOP) || defined(HAVE_EV_DEFAULT_LOOP)) && (defined(HAVE_PTHREAD) || defined(HAVE_SOLARIS_THREADS))
/* using version of libevent that is not threadsafe. */
# define LIBEVENT_SIGNAL_PROBLEM 1
])
-AC_CONFIG_FILES([Makefile doc/example.conf doc/libunbound.3 doc/unbound.8 doc/unbound-anchor.8 doc/unbound-checkconf.8 doc/unbound.conf.5 doc/unbound-control.8 doc/unbound-host.1])
+dnl if we build from source tree, the man pages need @date@ and @version@
+dnl if this is a distro tarball, that was already done by makedist.sh
+AC_SUBST(version, [VERSION_MAJOR.VERSION_MINOR.VERSION_MICRO])
+AC_SUBST(date, [`date +'%b %e, %Y'`])
+
+AC_CONFIG_FILES([Makefile doc/example.conf doc/libunbound.3 doc/unbound.8 doc/unbound-anchor.8 doc/unbound-checkconf.8 doc/unbound.conf.5 doc/unbound-control.8 doc/unbound-host.1 smallapp/unbound-control-setup.sh dnstap/dnstap_config.h])
AC_CONFIG_HEADER([config.h])
AC_OUTPUT
a local-zone and local-data include file for unbound.conf.
* unbound-host.nagios.patch: makes unbound-host return status that fits right
in with the nagios monitoring framework. Contributed by Migiel de Vos.
-* unbound_unixsock.diff: Add Unix socket support for unbound-control.
- Contributed by Ilya Bakulin, 2012-08-28.
* patch_rsamd5_enable.diff: this patch enables RSAMD5 validation (otherwise
it is treated as insecure). The RSAMD5 algorithm is deprecated (RFC6725).
* create_unbound_ad_servers.sh: shell script to enter anti-ad server lists.
* unbound_cache.cmd: windows script to save and load the cache.
* warmup.sh: shell script to warm up DNS cache by your own MRU domains.
* warmup.cmd: windows script to warm up DNS cache by your own MRU domains.
-
+* aaaa-filter-iterator.patch: adds config option aaaa-filter: yes that
+ works like the BIND feature (removes AAAA records unless AAAA-only domain).
+ Useful for certain 'broken IPv6 default route' scenarios.
+ Patch from Stephane Lapie for ASAHI Net.
+* unbound_smf22.tar.gz: Solaris SMF installation/removal scripts.
+ Contributed by Yuri Voinov.
rem --------------------------------------------------------------\r
rem -- DNS cache save/load script\r
rem --\r
-rem -- Version 1.0\r
+rem -- Version 1.2\r
rem -- By Yuri Voinov (c) 2014\r
rem --------------------------------------------------------------\r
\r
\r
:start\r
\r
-set arg=%1\r
+rem arg1 - command (optional)\r
+rem arg2 - file name (optional)\r
+set arg1=%1\r
+set arg2=%2\r
\r
-if /I "%arg%" == "-h" goto help\r
+if /I "%arg1%" == "-h" goto help\r
\r
-if "%arg%" == "" (\r
+if "%arg1%" == "" (\r
echo Loading cache from %program_path%\%fname%\r
+dir /a %program_path%\%fname%\r
type %program_path%\%fname%|%uc% load_cache\r
goto end\r
)\r
\r
-if /I "%arg%" == "-s" (\r
+if defined %arg2% (goto Not_Defined) else (goto Defined)\r
+\r
+rem If file not specified; use default dump file\r
+:Not_defined\r
+if /I "%arg1%" == "-s" (\r
echo Saving cache to %program_path%\%fname%\r
%uc% dump_cache>%program_path%\%fname%\r
+dir /a %program_path%\%fname%\r
echo ok\r
goto end\r
)\r
\r
-if /I "%arg%" == "-l" (\r
+if /I "%arg1%" == "-l" (\r
echo Loading cache from %program_path%\%fname%\r
+dir /a %program_path%\%fname%\r
type %program_path%\%fname%|%uc% load_cache\r
goto end\r
)\r
\r
-if /I "%arg%" == "-r" (\r
+if /I "%arg1%" == "-r" (\r
echo Saving cache to %program_path%\%fname%\r
+dir /a %program_path%\%fname%\r
%uc% dump_cache>%program_path%\%fname%\r
echo ok\r
echo Loading cache from %program_path%\%fname%\r
goto end\r
)\r
\r
+rem If file name specified; use this filename\r
+:Defined\r
+if /I "%arg1%" == "-s" (\r
+echo Saving cache to %arg2%\r
+%uc% dump_cache>%arg2%\r
+dir /a %arg2%\r
+echo ok\r
+goto end\r
+)\r
+\r
+if /I "%arg1%" == "-l" (\r
+echo Loading cache from %arg2%\r
+dir /a %arg2%\r
+type %arg2%|%uc% load_cache\r
+goto end\r
+)\r
+\r
+if /I "%arg1%" == "-r" (\r
+echo Saving cache to %arg2%\r
+dir /a %arg2%\r
+%uc% dump_cache>%arg2%\r
+echo ok\r
+echo Loading cache from %arg2%\r
+type %arg2%|%uc% load_cache\r
+goto end\r
+)\r
+\r
:help\r
-echo Usage: unbound_cache.cmd [-s] or [-l] or [-r] or [-h]\r
+echo Usage: unbound_cache.cmd [-s] or [-l] or [-r] or [-h] [filename]\r
echo.\r
echo l - Load - default mode. Warming up Unbound DNS cache from saved file. cache-ttl must be high value.\r
echo s - Save - save Unbound DNS cache contents to plain file with domain names.\r
echo r - Reload - reloadind new cache entries and refresh existing cache\r
echo h - this screen.\r
+echo filename - file to save/load dumped cache. If not specified, %program_path%\%fname% will be used instead.\r
echo Note: Run without any arguments will be in default mode.\r
echo Also, unbound-control must be configured.\r
exit 1\r
\r
:end\r
+exit 0\r
#!/sbin/sh
-#
+
# --------------------------------------------------------------
# -- DNS cache save/load script
# --
-# -- Version 1.0
+# -- Version 1.2
# -- By Yuri Voinov (c) 2006, 2014
# --------------------------------------------------------------
#
-# ident "@(#)unbound_cache.sh 1.1 14/04/26 YV"
+# ident "@(#)unbound_cache.sh 1.2 14/10/30 YV"
#
#############
CAT=`which cat`
CUT=`which cut`
ECHO=`which echo`
+EXPR=`which expr`
GETOPT=`which getopt`
ID=`which id`
-PRINTF=`which printf`
+LS=`which ls`
###############
# Subroutines #
usage_note ()
{
# Script usage note
- $ECHO "Usage: `$BASENAME $0` [-s] or [-l] or [-r] or [-h]"
- $ECHO
+ $ECHO "Usage: `$BASENAME $0` [-s] or [-l] or [-r] or [-h] [filename]"
+ $ECHO .
$ECHO "l - Load - default mode. Warming up Unbound DNS cache from saved file. cache-ttl must be high value."
$ECHO "s - Save - save Unbound DNS cache contents to plain file with domain names."
$ECHO "r - Reload - reloadind new cache entries and refresh existing cache"
$ECHO "h - this screen."
+ $ECHO "filename - file to save/load dumped cache. If not specified, $CONF/$FNAME will be used instead."
$ECHO "Note: Run without any arguments will be in default mode."
$ECHO " Also, unbound-control must be configured."
exit 0
check_saved_file ()
{
- if [ ! -f "$CONF/$FNAME" ]; then
+ filename=$1
+ if [ ! -z "$filename" -a ! -f "$filename" ]; then
+ $ECHO .
+ $ECHO "ERROR: File $filename does not exists. Save it first."
+ exit 1
+ elif [ ! -f "$CONF/$FNAME" ]; then
$ECHO .
$ECHO "ERROR: File $CONF/$FNAME does not exists. Save it first."
exit 1
save_cache ()
{
# Save unbound cache
- $PRINTF "Saving cache in $CONF/$FNAME..."
- $UC dump_cache>$CONF/$FNAME
+ filename=$1
+ if [ -z "$filename" ]; then
+ $ECHO "Saving cache in $CONF/$FNAME..."
+ $UC dump_cache>$CONF/$FNAME
+ $LS -lh $CONF/$FNAME
+ else
+ $ECHO "Saving cache in $filename..."
+ $UC dump_cache>$filename
+ $LS -lh $filename
+ fi
$ECHO "ok"
}
load_cache ()
{
- # Load saved cache contents and warmup DNS cache
- $PRINTF "Loading cache from saved $CONF/$FNAME..."
- check_saved_file
- $CAT $CONF/$FNAME|$UC load_cache
+ # Load saved cache contents and warmup cache
+ filename=$1
+ if [ -z "$filename" ]; then
+ $ECHO "Loading cache from saved $CONF/$FNAME..."
+ $LS -lh $CONF/$FNAME
+ check_saved_file $filename
+ $CAT $CONF/$FNAME|$UC load_cache
+ else
+ $ECHO "Loading cache from saved $filename..."
+ $LS -lh $filename
+ check_saved_file $filename
+ $CAT $filename|$UC load_cache
+ fi
}
reload_cache ()
{
# Reloading and refresh existing cache and saved dump
- save_cache
- load_cache
+ filename=$1
+ save_cache $filename
+ load_cache $filename
}
##############
check_uc
# Check command-line arguments
-if [ "x$1" = "x" ]; then
-# If arguments list empty, load cache by default
+if [ "x$*" = "x" ]; then
+ # If arguments list empty,load cache by default
load_cache
else
- arg_list=$1
+ arg_list=$*
# Parse command line
set -- `$GETOPT sSlLrRhH: $arg_list` || {
usage_note 1>&2
}
- # Read arguments
+ # Read arguments
for i in $arg_list
do
case $i in
- -s | -S) save_cache;;
- -l | -L) load_cache;;
- -r | -R) reload_cache;;
+ -s | -S) save="1";;
+ -l | -L) save="0";;
+ -r | -R) save="2";;
-h | -H | \?) usage_note;;
+ *) shift
+ file=$1
+ break;;
esac
- break
+ shift
done
+
+ # Remove trailing --
+ shift `$EXPR $OPTIND - 1`
+fi
+
+if [ "$save" = "1" ]; then
+ save_cache $file
+elif [ "$save" = "0" ]; then
+ load_cache $file
+elif [ "$save" = "2" ]; then
+ reload_cache $file
fi
exit 0
\ No newline at end of file
if grep '^'$1'=' $state >/dev/null 2>&1; then
echo "$mn.label $2"
echo "$mn.min 0"
+ echo "$mn.type ABSOLUTE"
fi
}
mn=`echo $1 | sed $ABBREV | tr . _`
echo $mn.label "$2"
echo $mn.min 0
+ echo $mn.type $3
}
if test "$1" = "config" ; then
hits)
echo "graph_title Unbound DNS traffic and cache hits"
echo "graph_args --base 1000 -l 0"
- echo "graph_vlabel queries / second"
+ echo "graph_vlabel queries / \${graph_period}"
+ echo "graph_scale no"
echo "graph_category DNS"
for x in `grep "^thread[0-9][0-9]*\.num\.queries=" $state |
sed -e 's/=.*//'`; do
exist_config $x "queries handled by `basename $x .num.queries`"
done
- p_config "total.num.queries" "total queries from clients"
- p_config "total.num.cachehits" "cache hits"
- p_config "total.num.prefetch" "cache prefetch"
- p_config "num.query.tcp" "TCP queries"
- p_config "num.query.tcpout" "TCP out queries"
- p_config "num.query.ipv6" "IPv6 queries"
- p_config "unwanted.queries" "queries that failed acl"
- p_config "unwanted.replies" "unwanted or unsolicited replies"
+ p_config "total.num.queries" "total queries from clients" "ABSOLUTE"
+ p_config "total.num.cachehits" "cache hits" "ABSOLUTE"
+ p_config "total.num.prefetch" "cache prefetch" "ABSOLUTE"
+ p_config "num.query.tcp" "TCP queries" "ABSOLUTE"
+ p_config "num.query.tcpout" "TCP out queries" "ABSOLUTE"
+ p_config "num.query.ipv6" "IPv6 queries" "ABSOLUTE"
+ p_config "unwanted.queries" "queries that failed acl" "ABSOLUTE"
+ p_config "unwanted.replies" "unwanted or unsolicited replies" "ABSOLUTE"
echo "u_replies.warning $warn"
echo "u_replies.critical $crit"
echo "graph_info DNS queries to the recursive resolver. The unwanted replies could be innocent duplicate packets, late replies, or spoof threats."
echo "graph_title Unbound requestlist size"
echo "graph_args --base 1000 -l 0"
echo "graph_vlabel number of queries"
+ echo "graph_scale no"
echo "graph_category DNS"
- p_config "total.requestlist.avg" "Average size of queue on insert"
- p_config "total.requestlist.max" "Max size of queue (in 5 min)"
- p_config "total.requestlist.overwritten" "Number of queries replaced by new ones"
- p_config "total.requestlist.exceeded" "Number of queries dropped due to lack of space"
+ p_config "total.requestlist.avg" "Average size of queue on insert" "GAUGE"
+ p_config "total.requestlist.max" "Max size of queue (in 5 min)" "GAUGE"
+ p_config "total.requestlist.overwritten" "Number of queries replaced by new ones" "GAUGE"
+ p_config "total.requestlist.exceeded" "Number of queries dropped due to lack of space" "GAUGE"
echo "graph_info The queries that did not hit the cache and need recursion service take up space in the requestlist. If there are too many queries, first queries get overwritten, and at last resort dropped."
;;
memory)
echo "graph_args --base 1024 -l 0"
echo "graph_vlabel memory used in bytes"
echo "graph_category DNS"
- p_config "mem.total.sbrk" "Total memory"
- p_config "mem.cache.rrset" "RRset cache memory"
- p_config "mem.cache.message" "Message cache memory"
- p_config "mem.mod.iterator" "Iterator module memory"
- p_config "mem.mod.validator" "Validator module and key cache memory"
+ p_config "mem.total.sbrk" "Total memory" "GAUGE"
+ p_config "mem.cache.rrset" "RRset cache memory" "GAUGE"
+ p_config "mem.cache.message" "Message cache memory" "GAUGE"
+ p_config "mem.mod.iterator" "Iterator module memory" "GAUGE"
+ p_config "mem.mod.validator" "Validator module and key cache memory" "GAUGE"
+ p_config "msg.cache.count" "msg cache count" "GAUGE"
+ p_config "rrset.cache.count" "rrset cache count" "GAUGE"
+ p_config "infra.cache.count" "infra cache count" "GAUGE"
+ p_config "key.cache.count" "key cache count" "GAUGE"
echo "graph_info The memory used by unbound."
;;
by_type)
echo "graph_title Unbound DNS queries by type"
echo "graph_args --base 1000 -l 0"
- echo "graph_vlabel queries / second"
+ echo "graph_vlabel queries / \${graph_period}"
+ echo "graph_scale no"
echo "graph_category DNS"
for x in `grep "^num.query.type" $state`; do
nm=`echo $x | sed -e 's/=.*$//'`
tp=`echo $nm | sed -e s/num.query.type.//`
- p_config "$nm" "$tp"
+ p_config "$nm" "$tp" "ABSOLUTE"
done
echo "graph_info queries by DNS RR type queried for"
;;
by_class)
echo "graph_title Unbound DNS queries by class"
echo "graph_args --base 1000 -l 0"
- echo "graph_vlabel queries / second"
+ echo "graph_vlabel queries / \${graph_period}"
+ echo "graph_scale no"
echo "graph_category DNS"
for x in `grep "^num.query.class" $state`; do
nm=`echo $x | sed -e 's/=.*$//'`
tp=`echo $nm | sed -e s/num.query.class.//`
- p_config "$nm" "$tp"
+ p_config "$nm" "$tp" "ABSOLUTE"
done
echo "graph_info queries by DNS RR class queried for."
;;
by_opcode)
echo "graph_title Unbound DNS queries by opcode"
echo "graph_args --base 1000 -l 0"
- echo "graph_vlabel queries / second"
+ echo "graph_vlabel queries / \${graph_period}"
+ echo "graph_scale no"
echo "graph_category DNS"
for x in `grep "^num.query.opcode" $state`; do
nm=`echo $x | sed -e 's/=.*$//'`
tp=`echo $nm | sed -e s/num.query.opcode.//`
- p_config "$nm" "$tp"
+ p_config "$nm" "$tp" "ABSOLUTE"
done
echo "graph_info queries by opcode in the query packet."
;;
by_rcode)
echo "graph_title Unbound DNS answers by return code"
echo "graph_args --base 1000 -l 0"
- echo "graph_vlabel answer packets / second"
+ echo "graph_vlabel answer packets / \${graph_period}"
+ echo "graph_scale no"
echo "graph_category DNS"
for x in `grep "^num.answer.rcode" $state`; do
nm=`echo $x | sed -e 's/=.*$//'`
tp=`echo $nm | sed -e s/num.answer.rcode.//`
- p_config "$nm" "$tp"
+ p_config "$nm" "$tp" "ABSOLUTE"
done
- p_config "num.answer.secure" "answer secure"
- p_config "num.answer.bogus" "answer bogus"
- p_config "num.rrset.bogus" "num rrsets marked bogus"
- echo "graph_info answers sorted by return value. rrsets bogus is the number of rrsets marked bogus per second by the validator"
+ p_config "num.answer.secure" "answer secure" "ABSOLUTE"
+ p_config "num.answer.bogus" "answer bogus" "ABSOLUTE"
+ p_config "num.rrset.bogus" "num rrsets marked bogus" "ABSOLUTE"
+ echo "graph_info answers sorted by return value. rrsets bogus is the number of rrsets marked bogus per \${graph_period} by the validator"
;;
by_flags)
echo "graph_title Unbound DNS incoming queries by flags"
echo "graph_args --base 1000 -l 0"
- echo "graph_vlabel queries / second"
+ echo "graph_vlabel queries / \${graph_period}"
+ echo "graph_scale no"
echo "graph_category DNS"
- p_config "num.query.flags.QR" "QR (query reply) flag"
- p_config "num.query.flags.AA" "AA (auth answer) flag"
- p_config "num.query.flags.TC" "TC (truncated) flag"
- p_config "num.query.flags.RD" "RD (recursion desired) flag"
- p_config "num.query.flags.RA" "RA (rec avail) flag"
- p_config "num.query.flags.Z" "Z (zero) flag"
- p_config "num.query.flags.AD" "AD (auth data) flag"
- p_config "num.query.flags.CD" "CD (check disabled) flag"
- p_config "num.query.edns.present" "EDNS OPT present"
- p_config "num.query.edns.DO" "DO (DNSSEC OK) flag"
+ p_config "num.query.flags.QR" "QR (query reply) flag" "ABSOLUTE"
+ p_config "num.query.flags.AA" "AA (auth answer) flag" "ABSOLUTE"
+ p_config "num.query.flags.TC" "TC (truncated) flag" "ABSOLUTE"
+ p_config "num.query.flags.RD" "RD (recursion desired) flag" "ABSOLUTE"
+ p_config "num.query.flags.RA" "RA (rec avail) flag" "ABSOLUTE"
+ p_config "num.query.flags.Z" "Z (zero) flag" "ABSOLUTE"
+ p_config "num.query.flags.AD" "AD (auth data) flag" "ABSOLUTE"
+ p_config "num.query.flags.CD" "CD (check disabled) flag" "ABSOLUTE"
+ p_config "num.query.edns.present" "EDNS OPT present" "ABSOLUTE"
+ p_config "num.query.edns.DO" "DO (DNSSEC OK) flag" "ABSOLUTE"
echo "graph_info This graphs plots the flags inside incoming queries. For example, if QR, AA, TC, RA, Z flags are set, the query can be rejected. RD, AD, CD and DO are legitimately set by some software."
;;
histogram)
echo "graph_title Unbound DNS histogram of reply time"
echo "graph_args --base 1000 -l 0"
- echo "graph_vlabel queries / second"
+ echo "graph_vlabel queries / \${graph_period}"
+ echo "graph_scale no"
echo "graph_category DNS"
echo hcache.label "cache hits"
echo hcache.min 0
+ echo hcache.type ABSOLUTE
echo hcache.draw AREA
echo hcache.colour 999999
echo h64ms.label "0 msec - 66 msec"
echo h64ms.min 0
+ echo h64ms.type ABSOLUTE
echo h64ms.draw STACK
echo h64ms.colour 0000FF
echo h128ms.label "66 msec - 131 msec"
echo h128ms.min 0
+ echo h128ms.type ABSOLUTE
echo h128ms.colour 1F00DF
echo h128ms.draw STACK
echo h256ms.label "131 msec - 262 msec"
echo h256ms.min 0
+ echo h256ms.type ABSOLUTE
echo h256ms.draw STACK
echo h256ms.colour 3F00BF
echo h512ms.label "262 msec - 524 msec"
echo h512ms.min 0
+ echo h512ms.type ABSOLUTE
echo h512ms.draw STACK
echo h512ms.colour 5F009F
echo h1s.label "524 msec - 1 sec"
echo h1s.min 0
+ echo h1s.type ABSOLUTE
echo h1s.draw STACK
echo h1s.colour 7F007F
echo h2s.label "1 sec - 2 sec"
echo h2s.min 0
+ echo h2s.type ABSOLUTE
echo h2s.draw STACK
echo h2s.colour 9F005F
echo h4s.label "2 sec - 4 sec"
echo h4s.min 0
+ echo h4s.type ABSOLUTE
echo h4s.draw STACK
echo h4s.colour BF003F
echo h8s.label "4 sec - 8 sec"
echo h8s.min 0
+ echo h8s.type ABSOLUTE
echo h8s.draw STACK
echo h8s.colour DF001F
echo h16s.label "8 sec - ..."
echo h16s.min 0
+ echo h16s.type ABSOLUTE
echo h16s.draw STACK
echo h16s.colour FF0000
echo "graph_info Histogram of the reply times for queries."
fi
elapsed="$value"
-# print value for $1 / elapsed
-print_qps ( ) {
+# print value for $1
+print_value ( ) {
mn=`echo $1 | sed $ABBREV | tr . _`
get_value $1
- echo "$mn.value" `echo scale=6';' $value / $elapsed | bc `
+ echo "$mn.value" $value
}
-# print qps if line already found in $2
-print_qps_line ( ) {
+# print value if line already found in $2
+print_value_line ( ) {
mn=`echo $1 | sed $ABBREV | tr . _`
value="`echo $2 | sed -e 's/^.*=//'`"
- echo "$mn.value" `echo scale=6';' $value / $elapsed | bc `
-}
-
-# print value for $1
-print_value ( ) {
- mn=`echo $1 | sed $ABBREV | tr . _`
- get_value $1
echo "$mn.value" $value
}
+
case $id in
hits)
for x in `grep "^thread[0-9][0-9]*\.num\.queries=" $state |
num.query.tcpout num.query.ipv6 unwanted.queries \
unwanted.replies; do
if grep "^"$x"=" $state >/dev/null 2>&1; then
- print_qps $x
+ print_value $x
fi
done
;;
fi
fi
echo "$mn.value" $value
- for x in mem.cache.rrset mem.cache.message \
- mem.mod.iterator mem.mod.validator; do
+ for x in mem.cache.rrset mem.cache.message mem.mod.iterator \
+ mem.mod.validator msg.cache.count rrset.cache.count \
+ infra.cache.count key.cache.count; do
print_value $x
done
;;
by_type)
for x in `grep "^num.query.type" $state`; do
nm=`echo $x | sed -e 's/=.*$//'`
- print_qps_line $nm $x
+ print_value_line $nm $x
done
;;
by_class)
for x in `grep "^num.query.class" $state`; do
nm=`echo $x | sed -e 's/=.*$//'`
- print_qps_line $nm $x
+ print_value_line $nm $x
done
;;
by_opcode)
for x in `grep "^num.query.opcode" $state`; do
nm=`echo $x | sed -e 's/=.*$//'`
- print_qps_line $nm $x
+ print_value_line $nm $x
done
;;
by_rcode)
for x in `grep "^num.answer.rcode" $state`; do
nm=`echo $x | sed -e 's/=.*$//'`
- print_qps_line $nm $x
+ print_value_line $nm $x
done
- print_qps "num.answer.secure"
- print_qps "num.answer.bogus"
- print_qps "num.rrset.bogus"
+ print_value "num.answer.secure"
+ print_value "num.answer.bogus"
+ print_value "num.rrset.bogus"
;;
by_flags)
for x in num.query.flags.QR num.query.flags.AA num.query.flags.TC num.query.flags.RD num.query.flags.RA num.query.flags.Z num.query.flags.AD num.query.flags.CD num.query.edns.present num.query.edns.DO; do
- print_qps $x
+ print_value $x
done
;;
histogram)
get_value total.num.cachehits
- echo hcache.value `echo scale=6';' $value / $elapsed | bc `
+ echo hcache.value $value
r=0
for x in histogram.000000.000000.to.000000.000001 \
histogram.000000.000001.to.000000.000002 \
get_value $x
r=`expr $r + $value`
done
- echo h64ms.value `echo scale=6';' $r / $elapsed | bc `
+ echo h64ms.value $r
get_value histogram.000000.065536.to.000000.131072
- echo h128ms.value `echo scale=6';' $value / $elapsed | bc `
+ echo h128ms.value $value
get_value histogram.000000.131072.to.000000.262144
- echo h256ms.value `echo scale=6';' $value / $elapsed | bc `
+ echo h256ms.value $value
get_value histogram.000000.262144.to.000000.524288
- echo h512ms.value `echo scale=6';' $value / $elapsed | bc `
+ echo h512ms.value $value
get_value histogram.000000.524288.to.000001.000000
- echo h1s.value `echo scale=6';' $value / $elapsed | bc `
+ echo h1s.value $value
get_value histogram.000001.000000.to.000002.000000
- echo h2s.value `echo scale=6';' $value / $elapsed | bc `
+ echo h2s.value $value
get_value histogram.000002.000000.to.000004.000000
- echo h4s.value `echo scale=6';' $value / $elapsed | bc `
+ echo h4s.value $value
get_value histogram.000004.000000.to.000008.000000
- echo h8s.value `echo scale=6';' $value / $elapsed | bc `
+ echo h8s.value $value
r=0
for x in histogram.000008.000000.to.000016.000000 \
histogram.000016.000000.to.000032.000000 \
get_value $x
r=`expr $r + $value`
done
- echo h16s.value `echo scale=6';' $r / $elapsed | bc `
+ echo h16s.value $r
;;
esac
+++ /dev/null
-diff --git a/daemon/remote.c b/daemon/remote.c
-index a2b2204..b6990f3 100644
---- a/daemon/remote.c
-+++ b/daemon/remote.c
-@@ -81,6 +81,11 @@
- #ifdef HAVE_NETDB_H
- #include <netdb.h>
- #endif
-+#ifdef HAVE_PWD_H
-+#include <pwd.h>
-+#include <sys/stat.h>
-+#include <fcntl.h>
-+#endif
-
- /* just for portability */
- #ifdef SQ
-@@ -235,7 +240,8 @@ void daemon_remote_delete(struct daemon_remote* rc)
- * @return false on failure.
- */
- static int
--add_open(const char* ip, int nr, struct listen_port** list, int noproto_is_err)
-+add_open(const char* ip, int nr, struct listen_port** list, int noproto_is_err,
-+ struct config_file* cfg)
- {
- struct addrinfo hints;
- struct addrinfo* res;
-@@ -246,29 +252,74 @@ add_open(const char* ip, int nr, struct listen_port** list, int noproto_is_err)
- snprintf(port, sizeof(port), "%d", nr);
- port[sizeof(port)-1]=0;
- memset(&hints, 0, sizeof(hints));
-- hints.ai_socktype = SOCK_STREAM;
-- hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
-- if((r = getaddrinfo(ip, port, &hints, &res)) != 0 || !res) {
--#ifdef USE_WINSOCK
-- if(!noproto_is_err && r == EAI_NONAME) {
-- /* tried to lookup the address as name */
-- return 1; /* return success, but do nothing */
-+
-+ if(ip[0] == '/') {
-+ /* This looks like UNIX socket! */
-+ fd = create_domain_accept_sock(ip);
-+/*
-+ * When unbound starts, it first creates a socket and then
-+ * drops privs, so the socket is created as root user.
-+ * This is fine, but we would like to set _unbound user group
-+ * for this socket, and permissions should be 0660 so only
-+ * root and _unbound group members can invoke unbound-control.
-+ * The username used here is the same as username that unbound
-+ * uses for its worker processes.
-+ */
-+
-+/*
-+ * Note: this code is an exact copy of code from daemon.c
-+ * Normally this should be either wrapped into a function,
-+ * or gui/gid values should be retrieved at config parsing time
-+ * and then stored in configfile structure.
-+ * This requires action from unbound developers!
-+*/
-+#ifdef HAVE_GETPWNAM
-+ struct passwd *pwd = NULL;
-+ uid_t uid;
-+ gid_t gid;
-+ /* initialize, but not to 0 (root) */
-+ memset(&uid, 112, sizeof(uid));
-+ memset(&gid, 112, sizeof(gid));
-+ log_assert(cfg);
-+
-+ if(cfg->username && cfg->username[0]) {
-+ if((pwd = getpwnam(cfg->username)) == NULL)
-+ fatal_exit("user '%s' does not exist.",
-+ cfg->username);
-+ uid = pwd->pw_uid;
-+ gid = pwd->pw_gid;
-+ endpwent();
- }
-+
-+ chown(ip, 0, gid);
-+ chmod(ip, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
-+#endif
-+ } else {
-+ hints.ai_socktype = SOCK_STREAM;
-+ hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
-+ if((r = getaddrinfo(ip, port, &hints, &res)) != 0 || !res) {
-+#ifdef USE_WINSOCK
-+ if(!noproto_is_err && r == EAI_NONAME) {
-+ /* tried to lookup the address as name */
-+ return 1; /* return success, but do nothing */
-+ }
- #endif /* USE_WINSOCK */
-- log_err("control interface %s:%s getaddrinfo: %s %s",
-- ip?ip:"default", port, gai_strerror(r),
-+ log_err("control interface %s:%s getaddrinfo: %s %s",
-+ ip?ip:"default", port, gai_strerror(r),
- #ifdef EAI_SYSTEM
- r==EAI_SYSTEM?(char*)strerror(errno):""
- #else
- ""
- #endif
- );
-- return 0;
-+ return 0;
-+ }
-+
-+ /* open fd */
-+ fd = create_tcp_accept_sock(res, 1, &noproto);
-+ freeaddrinfo(res);
- }
-
-- /* open fd */
-- fd = create_tcp_accept_sock(res, 1, &noproto);
-- freeaddrinfo(res);
- if(fd == -1 && noproto) {
- if(!noproto_is_err)
- return 1; /* return success, but do nothing */
-@@ -305,7 +356,7 @@ struct listen_port* daemon_remote_open_ports(struct config_file* cfg)
- if(cfg->control_ifs) {
- struct config_strlist* p;
- for(p = cfg->control_ifs; p; p = p->next) {
-- if(!add_open(p->str, cfg->control_port, &l, 1)) {
-+ if(!add_open(p->str, cfg->control_port, &l, 1, cfg)) {
- listening_ports_free(l);
- return NULL;
- }
-@@ -313,12 +364,12 @@ struct listen_port* daemon_remote_open_ports(struct config_file* cfg)
- } else {
- /* defaults */
- if(cfg->do_ip6 &&
-- !add_open("::1", cfg->control_port, &l, 0)) {
-+ !add_open("::1", cfg->control_port, &l, 0, cfg)) {
- listening_ports_free(l);
- return NULL;
- }
- if(cfg->do_ip4 &&
-- !add_open("127.0.0.1", cfg->control_port, &l, 1)) {
-+ !add_open("127.0.0.1", cfg->control_port, &l, 1, cfg)) {
- listening_ports_free(l);
- return NULL;
- }
-diff --git a/services/listen_dnsport.c b/services/listen_dnsport.c
-index ea7ec3a..4cb04e2 100644
---- a/services/listen_dnsport.c
-+++ b/services/listen_dnsport.c
-@@ -55,6 +55,10 @@
- #endif
- #include <fcntl.h>
-
-+#ifndef USE_WINSOCK
-+#include <sys/un.h>
-+#endif
-+
- /** number of queued TCP connections for listen() */
- #define TCP_BACKLOG 5
-
-@@ -376,6 +380,53 @@ create_udp_sock(int family, int socktype, struct sockaddr* addr,
- }
-
- int
-+create_domain_accept_sock(char *path) {
-+ int s;
-+ struct sockaddr_un unixaddr;
-+
-+#ifndef USE_WINSOCK
-+ unixaddr.sun_len = sizeof(unixaddr);
-+ unixaddr.sun_family = AF_UNIX;
-+ strlcpy(unixaddr.sun_path, path, 104);
-+
-+ if((s = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) {
-+ log_err("Cannot create UNIX socket %s (%s)",
-+ path, strerror(errno));
-+ return -1;
-+ }
-+
-+ if(unlink(path) && errno != ENOENT) {
-+ /* The socket already exists and cannot be removed */
-+ log_err("Cannot remove old UNIX socket %s (%s)",
-+ path, strerror(errno));
-+ return -1;
-+ }
-+
-+ if(bind(s, (struct sockaddr *) &unixaddr,
-+ sizeof(struct sockaddr_un)) == -1) {
-+ log_err("Cannot bind UNIX socket %s (%s)",
-+ path, strerror(errno));
-+ return -1;
-+ }
-+
-+ if(!fd_set_nonblock(s)) {
-+ log_err("Cannot set non-blocking mode");
-+ return -1;
-+ }
-+
-+ if(listen(s, TCP_BACKLOG) == -1) {
-+ log_err("can't listen: %s", strerror(errno));
-+ return -1;
-+ }
-+
-+ return s;
-+#else
-+ log_err("UNIX sockets are not supported");
-+ return -1;
-+#endif
-+}
-+
-+int
- create_tcp_accept_sock(struct addrinfo *addr, int v6only, int* noproto)
- {
- int s;
-diff --git a/smallapp/unbound-control.c b/smallapp/unbound-control.c
-index a872f92..10631fd 100644
---- a/smallapp/unbound-control.c
-+++ b/smallapp/unbound-control.c
-@@ -59,6 +59,8 @@
- #include "util/locks.h"
- #include "util/net_help.h"
-
-+#include <sys/un.h>
-+
- /** Give unbound-control usage, and exit (1). */
- static void
- usage()
-@@ -158,6 +160,7 @@ contact_server(const char* svr, struct config_file* cfg, int statuscmd)
- {
- struct sockaddr_storage addr;
- socklen_t addrlen;
-+ int addrfamily = 0;
- int fd;
- /* use svr or the first config entry */
- if(!svr) {
-@@ -176,12 +179,21 @@ contact_server(const char* svr, struct config_file* cfg, int statuscmd)
- if(strchr(svr, '@')) {
- if(!extstrtoaddr(svr, &addr, &addrlen))
- fatal_exit("could not parse IP@port: %s", svr);
-+ } else if(svr[0] == '/') {
-+ struct sockaddr_un* unixsock = (struct sockaddr_un *) &addr;
-+ unixsock->sun_family = AF_UNIX;
-+ unixsock->sun_len = sizeof(unixsock);
-+ strlcpy(unixsock->sun_path, svr, 104);
-+ addrlen = sizeof(struct sockaddr_un);
-+ addrfamily = AF_UNIX;
- } else {
- if(!ipstrtoaddr(svr, cfg->control_port, &addr, &addrlen))
- fatal_exit("could not parse IP: %s", svr);
- }
-- fd = socket(addr_is_ip6(&addr, addrlen)?AF_INET6:AF_INET,
-- SOCK_STREAM, 0);
-+
-+ if(addrfamily != AF_UNIX)
-+ addrfamily = addr_is_ip6(&addr, addrlen)?AF_INET6:AF_INET;
-+ fd = socket(addrfamily, SOCK_STREAM, 0);
- if(fd == -1) {
- #ifndef USE_WINSOCK
- fatal_exit("socket: %s", strerror(errno));
-diff --git a/util/net_help.c b/util/net_help.c
-index b3136a3..5b5b4a3 100644
---- a/util/net_help.c
-+++ b/util/net_help.c
-@@ -45,6 +45,7 @@
- #include "util/module.h"
- #include "util/regional.h"
- #include <fcntl.h>
-+#include <sys/un.h>
- #include <openssl/ssl.h>
- #include <openssl/err.h>
-
-@@ -135,7 +136,7 @@ log_addr(enum verbosity_value v, const char* str,
- {
- uint16_t port;
- const char* family = "unknown";
-- char dest[100];
-+ char dest[108];
- int af = (int)((struct sockaddr_in*)addr)->sin_family;
- void* sinaddr = &((struct sockaddr_in*)addr)->sin_addr;
- if(verbosity < v)
-@@ -148,15 +149,23 @@ log_addr(enum verbosity_value v, const char* str,
- case AF_UNIX: family="unix"; break;
- default: break;
- }
-- if(inet_ntop(af, sinaddr, dest, (socklen_t)sizeof(dest)) == 0) {
-- strncpy(dest, "(inet_ntop error)", sizeof(dest));
-+
-+ if(af != AF_UNIX) {
-+ if(inet_ntop(af, sinaddr, dest, (socklen_t)sizeof(dest)) == 0) {
-+ strncpy(dest, "(inet_ntop error)", sizeof(dest));
-+ }
-+ dest[sizeof(dest)-1] = 0;
-+ port = ntohs(((struct sockaddr_in*)addr)->sin_port);
-+ if(verbosity >= 4)
-+ verbose(v, "%s %s %s port %d (len %d)", str, family,
-+ dest, (int)port, (int)addrlen);
-+ else verbose(v, "%s %s port %d", str, dest, (int)port);
-+ } else {
-+ struct sockaddr_un* unixsock;
-+ unixsock = (struct sockaddr_un *) addr;
-+ strlcpy(dest, unixsock->sun_path, sizeof(dest));
-+ verbose(v, "%s %s %s", str, family, dest);
- }
-- dest[sizeof(dest)-1] = 0;
-- port = ntohs(((struct sockaddr_in*)addr)->sin_port);
-- if(verbosity >= 4)
-- verbose(v, "%s %s %s port %d (len %d)", str, family, dest,
-- (int)port, (int)addrlen);
-- else verbose(v, "%s %s port %d", str, dest, (int)port);
- }
-
- int
@echo off\r
\r
rem --------------------------------------------------------------\r
-rem -- Warm up DNS cache script by your own MRU domains\r
+rem -- Warm up DNS cache script by your own MRU domains or from\r
+rem -- file when it specified as script argument.\r
rem --\r
-rem -- Version 1.0\r
+rem -- Version 1.1\r
rem -- By Yuri Voinov (c) 2014\r
rem --------------------------------------------------------------\r
\r
+rem DNS host address\r
+set address="127.0.0.1"\r
+\r
rem Check dig installed\r
for /f "delims=" %%a in ('where dig') do @set dig=%%a\r
if /I "%dig%"=="" echo Dig not found. If installed, add path to PATH environment variable. & exit 1\r
echo Dig found: %dig%\r
\r
-echo Warming up cache by MRU domains...\r
-rem dig -f my_domains 1>nul 2>nul\r
-rem echo Done.\r
+set arg=%1%\r
+\r
+if defined %arg% (goto builtin) else (goto from_file)\r
\r
+:builtin\r
+echo Warming up cache by MRU domains...\r
for %%a in (\r
-mail.ru\r
-my.mail.ru\r
-mra.mail.ru\r
+2gis.ru\r
+admir.kz\r
+adobe.com\r
agent.mail.ru\r
-news.mail.ru\r
-icq.com\r
-lenta.ru\r
-gazeta.ru\r
-peerbet.ru\r
-www.opennet.ru\r
-snob.ru\r
+aimp.ru\r
+akamai.com\r
+akamai.net\r
+almaty.tele2.kz\r
+aol.com\r
+apple.com\r
+arin.com\r
artlebedev.ru\r
-mail.google.com\r
-translate.google.com\r
-drive.google.com\r
-google.com\r
-google.kz\r
-drive.google.com\r
+auto.mail.ru\r
+beeline.kz\r
+bing.com\r
blogspot.com\r
+comodo.com\r
+dnscrypt.org\r
+drive.google.com\r
+drive.mail.ru\r
+facebook.com\r
farmanager.com\r
+fb.com\r
+firefox.com\r
forum.farmanager.com\r
+gazeta.ru\r
+getsharex.com\r
+gismeteo.ru\r
+google.com\r
+google.kz\r
+google.ru\r
+googlevideo.com\r
+goto.kz\r
+iana.org\r
+icq.com\r
+imap.mail.ru\r
+instagram.com\r
+intel.com\r
+irr.kz\r
+java.com\r
+kaspersky.com\r
+kaspersky.ru\r
+kcell.kz\r
+krisha.kz\r
+lady.mail.ru\r
+lenta.ru\r
+libreoffice.org\r
+linkedin.com\r
+livejournal.com\r
+mail.google.com\r
+mail.ru\r
+microsoft.com\r
+mozilla.org\r
+mra.mail.ru\r
+munin-monitoring.org\r
+my.mail.ru\r
+news.bbcimg.co.uk\r
+news.mail.ru\r
+newsimg.bbc.net.uk\r
+nvidia.com\r
+odnoklassniki.ru\r
+ok.ru\r
+opencsw.org\r
+opendns.com\r
+opendns.org\r
+opennet.ru\r
+opera.com\r
+oracle.com\r
+peerbet.ru\r
+piriform.com\r
plugring.farmanager.com\r
+privoxy.org\r
+qip.ru\r
+raidcall.com\r
+rambler.ru\r
+reddit.com\r
+ru.wikipedia.org\r
+shallalist.de\r
+skype.com\r
+snob.ru\r
+squid-cache.org\r
+squidclamav.darold.net\r
+squidguard.org\r
+ssl.comodo.com\r
+ssl.verisign.com\r
symantec.com\r
symantecliveupdate.com\r
-shalla.de\r
-torstatus.blutmagie.de\r
+tele2.kz\r
+tengrinews.kz\r
+thunderbird.com\r
torproject.org\r
-dnscrypt.org\r
+torstatus.blutmagie.de\r
+translate.google.com\r
unbound.net\r
-getsharex.com\r
-skype.com\r
+verisign.com\r
+vk.com\r
+vk.me\r
+vk.ru\r
+vkontakte.com\r
+vkontakte.ru\r
vlc.org\r
-aimp.ru\r
-mozilla.org\r
-libreoffice.org\r
-piriform.com\r
-raidcall.com\r
-nvidia.com\r
-intel.com\r
-microsoft.com\r
+watsapp.net\r
+weather.mail.ru\r
windowsupdate.com\r
-ru.wikipedia.org\r
+www.baidu.com\r
www.bbc.co.uk\r
-tengrinews.kz\r
-) do "%dig%" %%a 1>nul 2>nul\r
+www.internic.net\r
+www.opennet.ru\r
+www.topgear.com\r
+ya.ru\r
+yahoo.com\r
+yandex.com\r
+yandex.ru\r
+youtube.com\r
+ytimg.com\r
+) do "%dig%" %%a @%address% 1>nul 2>nul\r
+goto end\r
\r
+:from_file\r
+echo Warming up cache from %1% file...\r
+%dig% -f %arg% @%address% 1>nul 2>nul \r
+\r
+:end\r
echo Saving cache...\r
-unbound_cache.cmd -s\r
+if exist unbound_cache.cmd unbound_cache.cmd -s\r
echo Done.\r
+\r
+exit 0
\ No newline at end of file
#!/bin/sh
# --------------------------------------------------------------
-# -- Warm up DNS cache script by your own MRU domains
+# -- Warm up DNS cache script by your own MRU domains or from
+# -- file when it specified as script argument.
# --
-# -- Version 1.0
+# -- Version 1.1
# -- By Yuri Voinov (c) 2014
# --------------------------------------------------------------
+# Default DNS host address
+address="127.0.0.1"
+
+cat=`which cat`
dig=`which dig`
+if [ -z "$1" ]; then
echo "Warming up cache by MRU domains..."
-$dig -f - >/dev/null 2>&1 <<EOT
-mail.ru
-my.mail.ru
-mra.mail.ru
+$dig -f - @$address >/dev/null 2>&1 <<EOT
+2gis.ru
+admir.kz
+adobe.com
agent.mail.ru
-news.mail.ru
-icq.com
-lenta.ru
-gazeta.ru
-peerbet.ru
-www.opennet.ru
-snob.ru
+aimp.ru
+akamai.com
+akamai.net
+almaty.tele2.kz
+aol.com
+apple.com
+arin.com
artlebedev.ru
-mail.google.com
-translate.google.com
-drive.google.com
-google.com
-google.kz
-drive.google.com
+auto.mail.ru
+beeline.kz
+bing.com
blogspot.com
+clamav.net
+comodo.com
+dnscrypt.org
+drive.google.com
+drive.mail.ru
+facebook.com
farmanager.com
+fb.com
+firefox.com
forum.farmanager.com
+gazeta.ru
+getsharex.com
+gismeteo.ru
+google.com
+google.kz
+google.ru
+googlevideo.com
+goto.kz
+iana.org
+icq.com
+imap.mail.ru
+instagram.com
+instagram.com
+intel.com
+irr.kz
+java.com
+kaspersky.com
+kaspersky.ru
+kcell.kz
+krisha.kz
+lady.mail.ru
+lenta.ru
+libreoffice.org
+linkedin.com
+livejournal.com
+mail.google.com
+mail.ru
+microsoft.com
+mozilla.org
+mra.mail.ru
+munin-monitoring.org
+my.mail.ru
+news.bbcimg.co.uk
+news.mail.ru
+newsimg.bbc.net.uk
+nvidia.com
+odnoklassniki.ru
+ok.ru
+opencsw.org
+opendns.com
+opendns.org
+opennet.ru
+opera.com
+oracle.com
+peerbet.ru
+piriform.com
plugring.farmanager.com
+privoxy.org
+qip.ru
+raidcall.com
+rambler.ru
+reddit.com
+ru.wikipedia.org
+shallalist.de
+skype.com
+snob.ru
+squid-cache.org
+squidclamav.darold.net
+squidguard.org
+ssl.comodo.com
+ssl.verisign.com
symantec.com
symantecliveupdate.com
-shalla.de
-torstatus.blutmagie.de
+tele2.kz
+tengrinews.kz
+thunderbird.com
torproject.org
-dnscrypt.org
+torstatus.blutmagie.de
+translate.google.com
unbound.net
-getsharex.com
-skype.com
+verisign.com
+vk.com
+vk.me
+vk.ru
+vkontakte.com
+vkontakte.ru
vlc.org
-aimp.ru
-mozilla.org
-libreoffice.org
-piriform.com
-raidcall.com
-nvidia.com
-intel.com
-microsoft.com
+watsapp.net
+weather.mail.ru
windowsupdate.com
-ru.wikipedia.org
+www.baidu.com
www.bbc.co.uk
-tengrinews.kz
+www.internic.net
+www.opennet.ru
+www.topgear.com
+ya.ru
+yahoo.com
+yandex.com
+yandex.ru
+youtube.com
+ytimg.com
EOT
+else
+ echo "Warming up cache from $1 file..."
+ $cat $1 | $dig -f - @$address >/dev/null 2>&1
+fi
+
echo "Done."
echo "Saving cache..."
-/usr/local/bin/unbound_cache.sh -s
+script=`which unbound_cache.sh`
+[ -f "$script" ] && $script -s
echo "Done."
exit 0
#include "iterator/iter_utils.h"
#include "iterator/iter_fwd.h"
#include "iterator/iter_hints.h"
-#include "ldns/sbuffer.h"
-#include "ldns/wire2str.h"
-#include "ldns/str2wire.h"
+#include "sldns/sbuffer.h"
+#include "sldns/wire2str.h"
+#include "sldns/str2wire.h"
/** dump one rrset zonefile line */
static int
struct query_info** k, struct reply_info** d)
{
struct reply_info* rep = (struct reply_info*)e->data;
+ if(rep->rrset_count > RR_COUNT_MAX)
+ return 0; /* to protect against integer overflow */
*d = (struct reply_info*)regional_alloc_init(region, e->data,
sizeof(struct reply_info) +
sizeof(struct rrset_ref) * (rep->rrset_count-1) +
sizeof(struct ub_packed_rrset_key*) * rep->rrset_count);
if(!*d)
return 0;
- (*d)->rrsets = (struct ub_packed_rrset_key**)(
+ (*d)->rrsets = (struct ub_packed_rrset_key**)(void *)(
(uint8_t*)(&((*d)->ref[0])) +
sizeof(struct rrset_ref) * rep->rrset_count);
*k = (struct query_info*)regional_alloc_init(region,
log_warn("bad rrset without contents");
return 0;
}
+ if(rr_count > RR_COUNT_MAX || rrsig_count > RR_COUNT_MAX) {
+ log_warn("bad rrset with too many rrs");
+ return 0;
+ }
d->count = (size_t)rr_count;
d->rrsig_count = (size_t)rrsig_count;
d->security = (enum sec_status)security;
rep.ttl = (time_t)ttl;
rep.prefetch_ttl = PREFETCH_TTL_CALC(rep.ttl);
rep.security = (enum sec_status)security;
+ if(an > RR_COUNT_MAX || ns > RR_COUNT_MAX || ar > RR_COUNT_MAX) {
+ log_warn("error too many rrsets");
+ return 0; /* protect against integer overflow in alloc */
+ }
rep.an_numrrsets = (size_t)an;
rep.ns_numrrsets = (size_t)ns;
rep.ar_numrrsets = (size_t)ar;
if(!go_on)
return 1; /* skip this one, not all references satisfied */
- if(!dns_cache_store(&worker->env, &qinf, &rep, 0, 0, 0, NULL)) {
+ if(!dns_cache_store(&worker->env, &qinf, &rep, 0, 0, 0, NULL, flags)) {
log_warn("error out of memory");
return 0;
}
#endif
#include "util/net_help.h"
-#include "ldns/keyraw.h"
+#include "sldns/keyraw.h"
#include <signal.h>
/** How many quit requests happened. */
static RETSIGTYPE record_sigh(int sig)
{
#ifdef LIBEVENT_SIGNAL_PROBLEM
- verbose(VERB_OPS, "quit on signal, no cleanup and statistics, "
- "because installed libevent version is not threadsafe");
+ /* cannot log, verbose here because locks may be held */
+ /* quit on signal, no cleanup and statistics,
+ because installed libevent version is not threadsafe */
exit(0);
#endif
switch(sig)
break;
#endif
default:
- log_err("ignoring signal %d", sig);
+ /* ignoring signal */
+ break;
}
}
log_assert(daemon);
if(daemon->cfg->port != daemon->listening_port) {
size_t i;
- int reuseport = 0;
struct listen_port* p0;
+ daemon->reuseport = 0;
/* free and close old ports */
if(daemon->ports != NULL) {
for(i=0; i<daemon->num_ports; i++)
daemon->ports = NULL;
}
/* see if we want to reuseport */
-#if defined(__linux__) && defined(SO_REUSEPORT)
+#ifdef SO_REUSEPORT
if(daemon->cfg->so_reuseport && daemon->cfg->num_threads > 0)
- reuseport = 1;
+ daemon->reuseport = 1;
#endif
/* try to use reuseport */
- p0 = listening_ports_open(daemon->cfg, &reuseport);
+ p0 = listening_ports_open(daemon->cfg, &daemon->reuseport);
if(!p0) {
listening_ports_free(p0);
return 0;
}
- if(reuseport) {
+ if(daemon->reuseport) {
/* reuseport was successful, allocate for it */
daemon->num_ports = (size_t)daemon->cfg->num_threads;
} else {
return 0;
}
daemon->ports[0] = p0;
- if(reuseport) {
+ if(daemon->reuseport) {
/* continue to use reuseport */
for(i=1; i<daemon->num_ports; i++) {
if(!(daemon->ports[i]=
listening_ports_open(daemon->cfg,
- &reuseport)) || !reuseport ) {
+ &daemon->reuseport))
+ || !daemon->reuseport ) {
for(i=0; i<daemon->num_ports; i++)
listening_ports_free(daemon->ports[i]);
free(daemon->ports);
daemon->num = (daemon->cfg->num_threads?daemon->cfg->num_threads:1);
daemon->workers = (struct worker**)calloc((size_t)daemon->num,
sizeof(struct worker*));
+ if(daemon->cfg->dnstap) {
+#ifdef USE_DNSTAP
+ daemon->dtenv = dt_create(daemon->cfg->dnstap_socket_path,
+ (unsigned int)daemon->num);
+ if (!daemon->dtenv)
+ fatal_exit("dt_create failed");
+ dt_apply_cfg(daemon->dtenv, daemon->cfg);
+#else
+ fatal_exit("dnstap enabled in config but not built with dnstap support");
+#endif
+ }
for(i=0; i<daemon->num; i++) {
if(!(daemon->workers[i] = worker_create(daemon, i,
shufport+numport*i/daemon->num,
tube_close_write(worker->cmd);
close_other_pipes(worker->daemon, worker->thread_num);
#endif
-#if defined(__linux__) && defined(SO_REUSEPORT)
+#ifdef SO_REUSEPORT
if(worker->daemon->cfg->so_reuseport)
port_num = worker->thread_num;
else
free(daemon->workers);
daemon->workers = NULL;
daemon->num = 0;
+#ifdef USE_DNSTAP
+ dt_delete(daemon->dtenv);
+#endif
daemon->cfg = NULL;
}
struct ub_randstate;
struct daemon_remote;
+#include "dnstap/dnstap_config.h"
+#ifdef USE_DNSTAP
+struct dt_env;
+#endif
+
/**
* Structure holding worker list.
* Holds globally visible information.
struct listen_port** ports;
/** size of ports array */
size_t num_ports;
+ /** reuseport is enabled if true */
+ int reuseport;
/** port number for remote that has ports opened. */
int rc_port;
/** listening ports for remote control */
struct timeval time_last_stat;
/** time when daemon started */
struct timeval time_boot;
+#ifdef USE_DNSTAP
+ /** the dnstap environment master value, copied and changed by threads*/
+ struct dt_env* dtenv;
+#endif
};
/**
*
* This file contains the remote control functionality for the daemon.
* The remote control can be performed using either the commandline
- * unbound-control tool, or a SSLv3/TLS capable web browser.
- * The channel is secured using SSLv3 or TLSv1, and certificates.
+ * unbound-control tool, or a TLS capable web browser.
+ * The channel is secured using TLSv1, and certificates.
* Both the server and the client(control tool) have their own keys.
*/
#include "config.h"
#ifdef HAVE_OPENSSL_ERR_H
#include <openssl/err.h>
#endif
+#ifndef HEADER_DH_H
+#include <openssl/dh.h>
+#endif
+
#include <ctype.h>
#include "daemon/remote.h"
#include "daemon/worker.h"
#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"
+#include "sldns/str2wire.h"
+#include "sldns/parseutil.h"
+#include "sldns/wire2str.h"
+#include "sldns/sbuffer.h"
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
#endif
}
+/*
+ * The following function was generated using the openssl utility, using
+ * the command : "openssl dhparam -dsaparam -C 1024"
+ * (some openssl versions reject DH that is 'too small', eg. 512).
+ */
+#ifndef S_SPLINT_S
+DH *get_dh1024()
+{
+ static unsigned char dh1024_p[]={
+ 0xB3,0x67,0x2E,0x3B,0x68,0xC5,0xDA,0x58,0x46,0xD6,0x2B,0xD3,
+ 0x41,0x78,0x97,0xE4,0xE1,0x61,0x71,0x68,0xE6,0x0F,0x1D,0x78,
+ 0x05,0xAA,0xF0,0xFF,0x30,0xDF,0xAC,0x49,0x7F,0xE0,0x90,0xFE,
+ 0xB9,0x56,0x4E,0x3F,0xE2,0x98,0x8A,0xED,0xF5,0x28,0x39,0xEF,
+ 0x2E,0xA6,0xB7,0x67,0xB2,0x43,0xE4,0x53,0xF8,0xEB,0x2C,0x1F,
+ 0x06,0x77,0x3A,0x6F,0x62,0x98,0xC1,0x3B,0xF7,0xBA,0x4D,0x93,
+ 0xF7,0xEB,0x5A,0xAD,0xC5,0x5F,0xF0,0xB7,0x24,0x35,0x81,0xF7,
+ 0x7F,0x1F,0x24,0xC0,0xDF,0xD3,0xD8,0x40,0x72,0x7E,0xF3,0x19,
+ 0x2B,0x26,0x27,0xF4,0xB6,0xB3,0xD4,0x7D,0x08,0x23,0xBE,0x68,
+ 0x2B,0xCA,0xB4,0x46,0xA8,0x9E,0xDD,0x6C,0x3D,0x75,0xA6,0x48,
+ 0xF7,0x44,0x43,0xBF,0x91,0xC2,0xB4,0x49,
+ };
+ static unsigned char dh1024_g[]={
+ 0x5F,0x37,0xB5,0x80,0x4D,0xB4,0xC4,0xB2,0x37,0x12,0xD5,0x2F,
+ 0x56,0x81,0xB0,0xDF,0x3D,0x27,0xA2,0x54,0xE7,0x14,0x65,0x2D,
+ 0x72,0xA8,0x97,0xE0,0xA9,0x4A,0x09,0x5E,0x89,0xBE,0x34,0x9A,
+ 0x90,0x98,0xC1,0xE8,0xBB,0x01,0x2B,0xC2,0x74,0x74,0x90,0x59,
+ 0x0B,0x72,0x62,0x5C,0xFD,0x49,0x63,0x4B,0x38,0x91,0xF1,0x7F,
+ 0x13,0x25,0xEB,0x52,0x50,0x47,0xA2,0x8C,0x32,0x28,0x42,0xAC,
+ 0xBD,0x7A,0xCC,0x58,0xBE,0x36,0xDA,0x6A,0x24,0x06,0xC7,0xF1,
+ 0xDA,0x8D,0x8A,0x3B,0x03,0xFA,0x6F,0x25,0xE5,0x20,0xA7,0xD6,
+ 0x6F,0x74,0x61,0x53,0x14,0x81,0x29,0x04,0xB5,0x61,0x12,0x53,
+ 0xA3,0xD6,0x09,0x98,0x0C,0x8F,0x1C,0xBB,0xD7,0x1C,0x2C,0xEE,
+ 0x56,0x4B,0x74,0x8F,0x4A,0xF8,0xA9,0xD5,
+ };
+ DH *dh;
+
+ if ((dh=DH_new()) == NULL) return(NULL);
+ dh->p=BN_bin2bn(dh1024_p,sizeof(dh1024_p),NULL);
+ dh->g=BN_bin2bn(dh1024_g,sizeof(dh1024_g),NULL);
+ if ((dh->p == NULL) || (dh->g == NULL))
+ { DH_free(dh); return(NULL); }
+ dh->length = 160;
+ return(dh);
+}
+#endif /* SPLINT */
+
struct daemon_remote*
daemon_remote_create(struct config_file* cfg)
{
free(rc);
return NULL;
}
- /* no SSLv2 because has defects */
+ /* no SSLv2, SSLv3 because has defects */
if(!(SSL_CTX_set_options(rc->ctx, SSL_OP_NO_SSLv2) & SSL_OP_NO_SSLv2)){
log_crypto_err("could not set SSL_OP_NO_SSLv2");
daemon_remote_delete(rc);
return NULL;
}
+ if(!(SSL_CTX_set_options(rc->ctx, SSL_OP_NO_SSLv3) & SSL_OP_NO_SSLv3)){
+ log_crypto_err("could not set SSL_OP_NO_SSLv3");
+ daemon_remote_delete(rc);
+ return NULL;
+ }
+
+ if (cfg->remote_control_use_cert == 0) {
+ /* No certificates are requested */
+ if(!SSL_CTX_set_cipher_list(rc->ctx, "aNULL")) {
+ log_crypto_err("Failed to set aNULL cipher list");
+ return NULL;
+ }
+
+ /* Since we have no certificates and hence no source of
+ * DH params, let's generate and set them
+ */
+ if(!SSL_CTX_set_tmp_dh(rc->ctx,get_dh1024())) {
+ log_crypto_err("Wanted to set DH param, but failed");
+ return NULL;
+ }
+ return rc;
+ }
+ rc->use_cert = 1;
s_cert = fname_after_chroot(cfg->server_cert_file, cfg, 1);
s_key = fname_after_chroot(cfg->server_key_file, cfg, 1);
if(!s_cert || !s_key) {
* @param nr: port nr
* @param list: list head
* @param noproto_is_err: if lack of protocol support is an error.
+ * @param cfg: config with username for chown of unix-sockets.
* @return false on failure.
*/
static int
-add_open(const char* ip, int nr, struct listen_port** list, int noproto_is_err)
+add_open(const char* ip, int nr, struct listen_port** list, int noproto_is_err,
+ struct config_file* cfg)
{
struct addrinfo hints;
struct addrinfo* res;
snprintf(port, sizeof(port), "%d", nr);
port[sizeof(port)-1]=0;
memset(&hints, 0, sizeof(hints));
- hints.ai_socktype = SOCK_STREAM;
- hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
- if((r = getaddrinfo(ip, port, &hints, &res)) != 0 || !res) {
-#ifdef USE_WINSOCK
- if(!noproto_is_err && r == EAI_NONAME) {
- /* tried to lookup the address as name */
- return 1; /* return success, but do nothing */
+
+ if(ip[0] == '/') {
+ /* This looks like a local socket */
+ fd = create_local_accept_sock(ip, &noproto);
+ /*
+ * Change socket ownership and permissions so users other
+ * than root can access it provided they are in the same
+ * group as the user we run as.
+ */
+ if(fd != -1) {
+#ifdef HAVE_CHOWN
+ if (cfg->username && cfg->username[0] &&
+ cfg_uid != (uid_t)-1)
+ chown(ip, cfg_uid, cfg_gid);
+ chmod(ip, (mode_t)(S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP));
+#else
+ (void)cfg;
+#endif
}
+ } else {
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
+ if((r = getaddrinfo(ip, port, &hints, &res)) != 0 || !res) {
+#ifdef USE_WINSOCK
+ if(!noproto_is_err && r == EAI_NONAME) {
+ /* tried to lookup the address as name */
+ return 1; /* return success, but do nothing */
+ }
#endif /* USE_WINSOCK */
- log_err("control interface %s:%s getaddrinfo: %s %s",
- ip?ip:"default", port, gai_strerror(r),
+ log_err("control interface %s:%s getaddrinfo: %s %s",
+ ip?ip:"default", port, gai_strerror(r),
#ifdef EAI_SYSTEM
- r==EAI_SYSTEM?(char*)strerror(errno):""
+ r==EAI_SYSTEM?(char*)strerror(errno):""
#else
- ""
+ ""
#endif
);
- return 0;
+ return 0;
+ }
+
+ /* open fd */
+ fd = create_tcp_accept_sock(res, 1, &noproto, 0,
+ cfg->ip_transparent);
+ freeaddrinfo(res);
}
- /* open fd */
- fd = create_tcp_accept_sock(res, 1, &noproto, 0);
- freeaddrinfo(res);
if(fd == -1 && noproto) {
if(!noproto_is_err)
return 1; /* return success, but do nothing */
if(cfg->control_ifs) {
struct config_strlist* p;
for(p = cfg->control_ifs; p; p = p->next) {
- if(!add_open(p->str, cfg->control_port, &l, 1)) {
+ if(!add_open(p->str, cfg->control_port, &l, 1, cfg)) {
listening_ports_free(l);
return NULL;
}
} else {
/* defaults */
if(cfg->do_ip6 &&
- !add_open("::1", cfg->control_port, &l, 0)) {
+ !add_open("::1", cfg->control_port, &l, 0, cfg)) {
listening_ports_free(l);
return NULL;
}
if(cfg->do_ip4 &&
- !add_open("127.0.0.1", cfg->control_port, &l, 1)) {
+ !add_open("127.0.0.1", cfg->control_port, &l, 1, cfg)) {
listening_ports_free(l);
return NULL;
}
skipwhite(char* str)
{
/* EOS \0 is not a space */
- while( isspace(*str) )
+ while( isspace((unsigned char)*str) )
str++;
return str;
}
(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;
+ if(!ssl_printf(ssl, "%s.tcpusage"SQ"%lu\n", nm,
+ (unsigned long)s->svr.tcp_accept_usage)) return 0;
return 1;
}
/** print long number */
static int
-print_longnum(SSL* ssl, char* desc, size_t x)
+print_longnum(SSL* ssl, const char* desc, size_t x)
{
if(x > 1024*1024*1024) {
/* more than a Gb */
/* RCODE */
for(i=0; i<STATS_RCODE_NUM; i++) {
- if(inhibit_zero && s->svr.ans_rcode[i] == 0)
+ /* Always include RCODEs 0-5 */
+ if(inhibit_zero && i > LDNS_RCODE_REFUSED && s->svr.ans_rcode[i] == 0)
continue;
lt = sldns_lookup_by_id(sldns_rcodes, i);
if(lt && lt->name) {
(unsigned long)s->svr.unwanted_queries)) return 0;
if(!ssl_printf(ssl, "unwanted.replies"SQ"%lu\n",
(unsigned long)s->svr.unwanted_replies)) return 0;
+ /* cache counts */
+ if(!ssl_printf(ssl, "msg.cache.count"SQ"%u\n",
+ (unsigned)s->svr.msg_cache_count)) return 0;
+ if(!ssl_printf(ssl, "rrset.cache.count"SQ"%u\n",
+ (unsigned)s->svr.rrset_cache_count)) return 0;
+ if(!ssl_printf(ssl, "infra.cache.count"SQ"%u\n",
+ (unsigned)s->svr.infra_cache_count)) return 0;
+ if(!ssl_printf(ssl, "key.cache.count"SQ"%u\n",
+ (unsigned)s->svr.key_cache_count)) return 0;
return 1;
}
k.qname_len = nmlen;
k.qtype = t;
k.qclass = c;
- h = query_info_hash(&k);
+ h = query_info_hash(&k, 0);
slabhash_remove(worker->env.msg_cache, h, &k);
+ if(t == LDNS_RR_TYPE_AAAA) {
+ /* for AAAA also flush dns64 bit_cd packet */
+ h = query_info_hash(&k, BIT_CD);
+ slabhash_remove(worker->env.msg_cache, h, &k);
+ }
}
/** flush a type */
/** printout a delegation point info */
static int
-ssl_print_name_dp(SSL* ssl, char* str, uint8_t* nm, uint16_t dclass,
+ssl_print_name_dp(SSL* ssl, const char* str, uint8_t* nm, uint16_t dclass,
struct delegpt* dp)
{
char buf[257];
send_ok(ssl);
}
+static void
+do_insecure_list(SSL* ssl, struct worker* worker)
+{
+ char buf[257];
+ struct trust_anchor* a;
+ if(worker->env.anchors) {
+ RBTREE_FOR(a, struct trust_anchor*, worker->env.anchors->tree) {
+ if(a->numDS == 0 && a->numDNSKEY == 0) {
+ dname_str(a->name, buf);
+ ssl_printf(ssl, "%s\n", buf);
+ }
+ }
+ }
+}
+
/** do the status command */
static void
do_status(SSL* ssl, struct worker* worker)
uptime = (time_t)time(NULL) - (time_t)worker->daemon->time_boot.tv_sec;
if(!ssl_printf(ssl, "uptime: " ARG_LL "d seconds\n", (long long)uptime))
return;
+ if(!ssl_printf(ssl, "options:%s%s\n" ,
+ (worker->daemon->reuseport?" reuseport":""),
+ (worker->daemon->rc->accept_list?" control(ssl)":"")))
+ return;
if(!ssl_printf(ssl, "unbound (pid %d) is running...\n",
(int)getpid()))
return;
SSL* ssl;
/** the time now */
time_t now;
+ /** ssl failure? stop writing and skip the rest. If the tcp
+ * connection is broken, and writes fail, we then stop writing. */
+ int ssl_failed;
};
/** callback for every host element in the infra cache */
struct infra_data* d = (struct infra_data*)e->data;
char ip_str[1024];
char name[257];
+ if(a->ssl_failed)
+ return;
addr_to_str(&k->addr, k->addrlen, ip_str, sizeof(ip_str));
dname_str(k->zonename, name);
/* skip expired stuff (only backed off) */
if(d->ttl < a->now) {
if(d->rtt.rto >= USEFUL_SERVER_TOP_TIMEOUT) {
if(!ssl_printf(a->ssl, "%s %s expired rto %d\n", ip_str,
- name, d->rtt.rto)) return;
+ name, d->rtt.rto)) {
+ a->ssl_failed = 1;
+ return;
+ }
}
return;
}
d->rtt.srtt, d->rtt.rttvar, rtt_notimeout(&d->rtt), d->rtt.rto,
d->timeout_A, d->timeout_AAAA, d->timeout_other,
(int)d->edns_lame_known, (int)d->edns_version,
- (int)(a->now<d->probedelay?d->probedelay-a->now:0),
+ (int)(a->now<d->probedelay?(d->probedelay - a->now):0),
(int)d->isdnsseclame, (int)d->rec_lame, (int)d->lame_type_A,
- (int)d->lame_other))
+ (int)d->lame_other)) {
+ a->ssl_failed = 1;
return;
+ }
}
/** do the dump_infra command */
arg.infra = worker->env.infra_cache;
arg.ssl = ssl;
arg.now = *worker->env.now;
+ arg.ssl_failed = 0;
slabhash_traverse(arg.infra->hosts, 0, &dump_infra_host, (void*)&arg);
}
RBTREE_FOR(z, struct local_zone*, &zones->ztree) {
lock_rw_rdlock(&z->lock);
dname_str(z->name, buf);
- (void)ssl_printf(ssl, "%s %s\n", buf,
- local_zone_type2str(z->type));
+ if(!ssl_printf(ssl, "%s %s\n", buf,
+ local_zone_type2str(z->type))) {
+ /* failure to print */
+ lock_rw_unlock(&z->lock);
+ lock_rw_unlock(&zones->lock);
+ return;
+ }
lock_rw_unlock(&z->lock);
}
lock_rw_unlock(&zones->lock);
lock_rw_unlock(&zones->lock);
}
+/** struct for user arg ratelimit list */
+struct ratelimit_list_arg {
+ /** the infra cache */
+ struct infra_cache* infra;
+ /** the SSL to print to */
+ SSL* ssl;
+ /** all or only ratelimited */
+ int all;
+ /** current time */
+ time_t now;
+};
+
+/** list items in the ratelimit table */
+static void
+rate_list(struct lruhash_entry* e, void* arg)
+{
+ struct ratelimit_list_arg* a = (struct ratelimit_list_arg*)arg;
+ struct rate_key* k = (struct rate_key*)e->key;
+ struct rate_data* d = (struct rate_data*)e->data;
+ char buf[257];
+ int lim = infra_find_ratelimit(a->infra, k->name, k->namelen);
+ int max = infra_rate_max(d, a->now);
+ if(a->all == 0) {
+ if(max < lim)
+ return;
+ }
+ dname_str(k->name, buf);
+ ssl_printf(a->ssl, "%s %d limit %d\n", buf, max, lim);
+}
+
+/** do the ratelimit_list command */
+static void
+do_ratelimit_list(SSL* ssl, struct worker* worker, char* arg)
+{
+ struct ratelimit_list_arg a;
+ a.all = 0;
+ a.infra = worker->env.infra_cache;
+ a.now = *worker->env.now;
+ a.ssl = ssl;
+ arg = skipwhite(arg);
+ if(strcmp(arg, "+a") == 0)
+ a.all = 1;
+ if(a.infra->domain_rates==NULL ||
+ (a.all == 0 && infra_dp_ratelimit == 0))
+ return;
+ slabhash_traverse(a.infra->domain_rates, 0, rate_list, &a);
+}
+
/** tell other processes to execute the command */
static void
distribute_cmd(struct daemon_remote* rc, SSL* ssl, char* cmd)
} else if(cmdcmp(p, "list_stubs", 10)) {
do_list_stubs(ssl, worker);
return;
+ } else if(cmdcmp(p, "list_insecure", 13)) {
+ do_insecure_list(ssl, worker);
+ return;
} else if(cmdcmp(p, "list_local_zones", 16)) {
do_list_local_zones(ssl, worker);
return;
} else if(cmdcmp(p, "list_local_data", 15)) {
do_list_local_data(ssl, worker);
return;
+ } else if(cmdcmp(p, "ratelimit_list", 14)) {
+ do_ratelimit_list(ssl, worker, p+14);
+ return;
} else if(cmdcmp(p, "stub_add", 8)) {
/* must always distribute this cmd */
if(rc) distribute_cmd(rc, ssl, cmd);
s->shake_state = rc_none;
/* once handshake has completed, check authentication */
- if(SSL_get_verify_result(s->ssl) == X509_V_OK) {
+ if (!rc->use_cert) {
+ verbose(VERB_ALGO, "unauthenticated remote control connection");
+ } else if(SSL_get_verify_result(s->ssl) == X509_V_OK) {
X509* x = SSL_get_peer_certificate(s->ssl);
if(!x) {
verbose(VERB_DETAIL, "remote control connection "
struct worker* worker;
/** commpoints for accepting remote control connections */
struct listen_list* accept_list;
+ /* if certificates are used */
+ int use_cert;
/** number of active commpoints that are handling remote control */
int active;
/** max active commpoints */
*/
void daemon_remote_exec(struct worker* worker);
-/** handle remote control accept callbacks */
-int remote_accept_callback(struct comm_point*, void*, int, struct comm_reply*);
-
-/** handle remote control data callbacks */
-int remote_control_callback(struct comm_point*, void*, int, struct comm_reply*);
-
#ifdef HAVE_SSL
/**
* Print fixed line of text over ssl connection in blocking mode
int ssl_read_line(SSL* ssl, char* buf, size_t max);
#endif /* HAVE_SSL */
-/** routine to printout option values over SSL */
-void remote_get_opt_ssl(char* line, void* arg);
-
#endif /* DAEMON_REMOTE_H */
#include "daemon/daemon.h"
#include "services/mesh.h"
#include "services/outside_network.h"
+#include "services/listen_dnsport.h"
#include "util/config_file.h"
#include "util/tube.h"
#include "util/timehist.h"
#include "util/net_help.h"
#include "validator/validator.h"
-#include "ldns/sbuffer.h"
+#include "sldns/sbuffer.h"
+#include "services/cache/rrset.h"
+#include "services/cache/infra.h"
+#include "validator/val_kcache.h"
/** add timers and the values do not overflow or become negative */
static void
server_stats_compile(struct worker* worker, struct stats_info* s, int reset)
{
int i;
+ struct listen_list* lp;
s->svr = worker->stats;
s->mesh_num_states = worker->env.mesh->all.count;
/* get and reset validator rrset bogus number */
s->svr.rrset_bogus = get_rrset_bogus(worker);
+ /* get cache sizes */
+ s->svr.msg_cache_count = count_slabhash_entries(worker->env.msg_cache);
+ s->svr.rrset_cache_count = count_slabhash_entries(&worker->env.rrset_cache->table);
+ s->svr.infra_cache_count = count_slabhash_entries(worker->env.infra_cache->hosts);
+ if(worker->env.key_cache)
+ s->svr.key_cache_count = count_slabhash_entries(worker->env.key_cache->slab);
+ else s->svr.key_cache_count = 0;
+
+ /* get tcp accept usage */
+ s->svr.tcp_accept_usage = 0;
+ for(lp = worker->front->cps; lp; lp = lp->next) {
+ if(lp->com->type == comm_tcp_accept)
+ s->svr.tcp_accept_usage += lp->com->cur_tcp_count;
+ }
+
if(reset && !worker->env.cfg->stat_cumulative) {
worker_stats_clear(worker);
}
total->svr.rrset_bogus += a->svr.rrset_bogus;
total->svr.unwanted_replies += a->svr.unwanted_replies;
total->svr.unwanted_queries += a->svr.unwanted_queries;
+ total->svr.tcp_accept_usage += a->svr.tcp_accept_usage;
for(i=0; i<STATS_QTYPE_NUM; i++)
total->svr.qtype[i] += a->svr.qtype[i];
for(i=0; i<STATS_QCLASS_NUM; i++)
size_t unwanted_replies;
/** unwanted traffic received on client-facing ports */
size_t unwanted_queries;
+ /** usage of tcp accept list */
+ size_t tcp_accept_usage;
/** histogram data exported to array
* if the array is the same size, no data is lost, and
* if all histograms are same size (is so by default) then
* adding up works well. */
size_t hist[NUM_BUCKETS_HIST];
+
+ /** number of message cache entries */
+ size_t msg_cache_count;
+ /** number of rrset cache entries */
+ size_t rrset_cache_count;
+ /** number of infra cache entries */
+ size_t infra_cache_count;
+ /** number of key cache entries */
+ size_t key_cache_count;
};
/**
#include "services/listen_dnsport.h"
#include "services/cache/rrset.h"
#include "services/cache/infra.h"
+#include "util/fptr_wlist.h"
#include "util/data/msgreply.h"
#include "util/module.h"
#include "util/net_help.h"
# include "nss.h"
#endif
+#ifdef HAVE_SBRK
/** global debug value to keep track of heap memory allocation */
void* unbound_start_brk = 0;
+#endif
#if !defined(HAVE_EVENT_BASE_GET_METHOD) && (defined(HAVE_EV_LOOP) || defined(HAVE_EV_DEFAULT_LOOP))
static const char* ev_backend2str(int b)
for(m = module_list_avail(); *m; m++)
printf(" %s", *m);
printf("\n");
- printf("configured for %s on %s with options:%s\n",
- CONFIGURE_TARGET, CONFIGURE_DATE, CONFIGURE_BUILD_WITH);
printf("BSD licensed, see LICENSE in source package for details.\n");
printf("Report bugs to %s\n", PACKAGE_BUGREPORT);
}
#ifdef HAVE_SETRLIMIT
if(setrlimit(RLIMIT_NOFILE, &rlim) < 0) {
log_warn("setrlimit: %s", strerror(errno));
-#else
- if(1) {
#endif
log_warn("cannot increase max open fds from %u to %u",
(unsigned)avail, (unsigned)total+10);
log_warn("increase ulimit or decrease threads, "
"ports in config to remove this warning");
return;
+#ifdef HAVE_SETRLIMIT
}
- log_warn("increased limit(open files) from %u to %u",
+#endif
+ verbose(VERB_ALGO, "increased limit(open files) from %u to %u",
(unsigned)avail, (unsigned)total+10);
}
#else
/** set verbosity, check rlimits, cache settings */
static void
apply_settings(struct daemon* daemon, struct config_file* cfg,
- int cmdline_verbose)
+ int cmdline_verbose, int debug_mode)
{
/* apply if they have changed */
verbosity = cmdline_verbose + cfg->verbosity;
+ if (debug_mode > 1) {
+ cfg->use_syslog = 0;
+ cfg->logfile = NULL;
+ }
daemon_apply_cfg(daemon, cfg);
checkrlimits(cfg);
}
{
#ifdef HAVE_GETPWNAM
struct passwd *pwd = NULL;
- uid_t uid;
- gid_t gid;
- /* initialize, but not to 0 (root) */
- memset(&uid, 112, sizeof(uid));
- memset(&gid, 112, sizeof(gid));
- log_assert(cfg);
if(cfg->username && cfg->username[0]) {
if((pwd = getpwnam(cfg->username)) == NULL)
fatal_exit("user '%s' does not exist.", cfg->username);
- uid = pwd->pw_uid;
- gid = pwd->pw_gid;
/* endpwent below, in case we need pwd for setusercontext */
}
#endif
#ifdef HAVE_KILL
if(cfg->pidfile && cfg->pidfile[0]) {
writepid(daemon->pidfile, getpid());
- if(!(cfg->chrootdir && cfg->chrootdir[0]) ||
- (cfg->chrootdir && cfg->chrootdir[0] &&
- strncmp(daemon->pidfile, cfg->chrootdir,
- strlen(cfg->chrootdir))==0)) {
- /* delete of pidfile could potentially work,
- * chown to get permissions */
- if(cfg->username && cfg->username[0]) {
- if(chown(daemon->pidfile, uid, gid) == -1) {
+ if(cfg->username && cfg->username[0] && cfg_uid != (uid_t)-1) {
+# ifdef HAVE_CHOWN
+ if(chown(daemon->pidfile, cfg_uid, cfg_gid) == -1) {
log_err("cannot chown %u.%u %s: %s",
- (unsigned)uid, (unsigned)gid,
+ (unsigned)cfg_uid, (unsigned)cfg_gid,
daemon->pidfile, strerror(errno));
- }
}
+# endif /* HAVE_CHOWN */
}
}
#else
(void)daemon;
-#endif
+#endif /* HAVE_KILL */
/* Set user context */
#ifdef HAVE_GETPWNAM
- if(cfg->username && cfg->username[0]) {
+ if(cfg->username && cfg->username[0] && cfg_uid != (uid_t)-1) {
#ifdef HAVE_SETUSERCONTEXT
/* 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, (unsigned)
- (unsigned int)LOGIN_SETALL & ~LOGIN_SETUSER & ~LOGIN_SETGROUP) != 0)
+ if(setusercontext(NULL, pwd, cfg_uid, (unsigned)
+ LOGIN_SETALL & ~LOGIN_SETUSER & ~LOGIN_SETGROUP) != 0)
log_warn("unable to setusercontext %s: %s",
cfg->username, strerror(errno));
#endif /* HAVE_SETUSERCONTEXT */
/* drop permissions after chroot, getpwnam, pidfile, syslog done*/
#ifdef HAVE_GETPWNAM
- if(cfg->username && cfg->username[0]) {
+ if(cfg->username && cfg->username[0] && cfg_uid != (uid_t)-1) {
# ifdef HAVE_INITGROUPS
- if(initgroups(cfg->username, gid) != 0)
+ if(initgroups(cfg->username, cfg_gid) != 0)
log_warn("unable to initgroups %s: %s",
cfg->username, strerror(errno));
# endif /* HAVE_INITGROUPS */
endpwent();
#ifdef HAVE_SETRESGID
- if(setresgid(gid,gid,gid) != 0)
+ if(setresgid(cfg_gid,cfg_gid,cfg_gid) != 0)
#elif defined(HAVE_SETREGID) && !defined(DARWIN_BROKEN_SETREUID)
- if(setregid(gid,gid) != 0)
+ if(setregid(cfg_gid,cfg_gid) != 0)
#else /* use setgid */
- if(setgid(gid) != 0)
+ if(setgid(cfg_gid) != 0)
#endif /* HAVE_SETRESGID */
fatal_exit("unable to set group id of %s: %s",
cfg->username, strerror(errno));
#ifdef HAVE_SETRESUID
- if(setresuid(uid,uid,uid) != 0)
+ if(setresuid(cfg_uid,cfg_uid,cfg_uid) != 0)
#elif defined(HAVE_SETREUID) && !defined(DARWIN_BROKEN_SETREUID)
- if(setreuid(uid,uid) != 0)
+ if(setreuid(cfg_uid,cfg_uid) != 0)
#else /* use setuid */
- if(setuid(uid) != 0)
+ if(setuid(cfg_uid) != 0)
#endif /* HAVE_SETRESUID */
fatal_exit("unable to set user id of %s: %s",
cfg->username, strerror(errno));
cfgfile);
log_warn("Continuing with default config settings");
}
- apply_settings(daemon, cfg, cmdline_verbose);
+ apply_settings(daemon, cfg, cmdline_verbose, debug_mode);
+ if(!done_setup)
+ config_lookup_uid(cfg);
/* prepare */
if(!daemon_open_shared_ports(daemon))
verbosity++;
break;
case 'd':
- debug_mode = 1;
+ debug_mode++;
break;
case 'w':
winopt = optarg;
#include "iterator/iter_hints.h"
#include "validator/autotrust.h"
#include "validator/val_anchor.h"
-#include "ldns/sbuffer.h"
-
+#include "libunbound/context.h"
+#include "libunbound/libworker.h"
+#include "sldns/sbuffer.h"
#ifdef CLIENT_SUBNET
#include "edns-subnet/subnetmod.h"
#endif
+
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
return 0;
}
-int
+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)
return -1;
}
-int
+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);
}
-int
+static int
deny_refuse_non_local(struct comm_point* c, enum acl_access acl,
struct worker* worker, struct comm_reply* repinfo)
{
struct query_info qinfo;
struct edns_data edns;
enum acl_access acl;
+ int rc = 0;
if(error != NETEVENT_NOERROR) {
/* some bad tcp query DNS formats give these error calls */
verbose(VERB_ALGO, "handle request called with err=%d", error);
return 0;
}
+#ifdef USE_DNSTAP
+ if(worker->dtenv.log_client_query_messages)
+ dt_msg_send_client_query(&worker->dtenv, &repinfo->addr, c->type,
+ c->buffer);
+#endif
acl = acl_list_lookup(worker->daemon->acl, &repinfo->addr,
repinfo->addrlen);
if((ret=deny_refuse_all(c, acl, worker, repinfo)) != -1)
{
+ if(ret == 1)
+ goto send_reply;
return ret;
}
if((ret=worker_check_request(c->buffer, worker)) != 0) {
LDNS_RCODE_SET(sldns_buffer_begin(c->buffer),
LDNS_RCODE_FORMERR);
server_stats_insrcode(&worker->stats, c->buffer);
- return 1;
+ goto send_reply;
}
if(worker->env.cfg->log_queries) {
char ip[128];
worker->stats.qtype[qinfo.qtype]++;
server_stats_insrcode(&worker->stats, c->buffer);
}
- return 1;
+ goto send_reply;
}
if((ret=parse_edns_from_pkt(c->buffer, &edns)) != 0) {
verbose(VERB_ALGO, "worker parse edns: formerror.");
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;
+ goto send_reply;
}
if(edns.edns_present && edns.edns_version != 0) {
edns.ext_rcode = (uint8_t)(EDNS_RCODE_BADVERS>>4);
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*)sldns_buffer_begin(c->buffer),
+ *(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;
+ goto send_reply;
}
if(edns.edns_present && edns.udp_size < NORMAL_UDP_SIZE &&
worker->daemon->cfg->harden_short_bufsize) {
sldns_buffer_write_at(c->buffer, 4,
(uint8_t*)"\0\0\0\0\0\0\0\0", 8);
sldns_buffer_flip(c->buffer);
- return 1;
+ goto send_reply;
}
if(worker->stats.extended)
server_stats_insquery(&worker->stats, c, qinfo.qtype,
if(qinfo.qclass == LDNS_RR_CLASS_CH && answer_chaos(worker, &qinfo,
&edns, c->buffer)) {
server_stats_insrcode(&worker->stats, c->buffer);
- return 1;
+ goto send_reply;
}
if(local_zones_answer(worker->daemon->local_zones, &qinfo, &edns,
- c->buffer, worker->scratchpad)) {
+ c->buffer, worker->scratchpad, repinfo)) {
regional_free_all(worker->scratchpad);
if(sldns_buffer_limit(c->buffer) == 0) {
comm_point_drop_reply(repinfo);
return 0;
}
server_stats_insrcode(&worker->stats, c->buffer);
- return 1;
+ goto send_reply;
}
/* 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)
{
+ if(ret == 1)
+ goto send_reply;
return ret;
}
server_stats_insrcode(&worker->stats, c->buffer);
log_addr(VERB_ALGO, "refused nonrec (cache snoop) query from",
&repinfo->addr, repinfo->addrlen);
- return 1;
+ goto send_reply;
}
#ifdef CLIENT_SUBNET
/* Skip cache lookup if subnet is used, do not skip cache lookup if
if(!edns.edns_present || !edns.subnet_validdata ||
edns.subnet_source_mask == 0) {
#endif
- h = query_info_hash(&qinfo);
+ h = query_info_hash(&qinfo, sldns_buffer_read_u16_at(c->buffer, 2));
if((e=slabhash_lookup(worker->env.msg_cache, h, &qinfo, 0))) {
/* answer from cache - we have acquired a readlock on it */
if(answer_from_cache(worker, &qinfo,
(struct reply_info*)e->data,
- *(uint16_t*)sldns_buffer_begin(c->buffer),
+ *(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 */
reply_and_prefetch(worker, &qinfo,
sldns_buffer_read_u16_at(c->buffer, 2),
repinfo, leeway);
- return 0;
+ rc = 0;
+ goto send_reply_rc;
}
lock_rw_unlock(&e->lock);
- return 1;
+ goto send_reply;
}
verbose(VERB_ALGO, "answer from the cache failed");
lock_rw_unlock(&e->lock);
#endif
if(!LDNS_RD_WIRE(sldns_buffer_begin(c->buffer))) {
if(answer_norec_from_cache(worker, &qinfo,
- *(uint16_t*)sldns_buffer_begin(c->buffer),
+ *(uint16_t*)(void *)sldns_buffer_begin(c->buffer),
sldns_buffer_read_u16_at(c->buffer, 2), repinfo,
&edns)) {
- return 1;
+ goto send_reply;
}
verbose(VERB_ALGO, "answer norec from cache -- "
"need to validate or not primed");
/* grab a work request structure for this new request */
mesh_new_client(worker->env.mesh, &qinfo,
sldns_buffer_read_u16_at(c->buffer, 2),
- &edns, repinfo, *(uint16_t*)sldns_buffer_begin(c->buffer));
+ &edns, repinfo, *(uint16_t*)(void *)sldns_buffer_begin(c->buffer));
worker_mem_report(worker, NULL);
return 0;
+
+send_reply:
+ rc = 1;
+send_reply_rc:
+#ifdef USE_DNSTAP
+ if(worker->dtenv.log_client_response_messages)
+ dt_msg_send_client_response(&worker->dtenv, &repinfo->addr,
+ c->type, c->buffer);
+#endif
+ return rc;
}
void
worker_sighandler(int sig, void* arg)
{
- /* note that log, print, syscalls here give race conditions. */
- /* we still print DETAIL logs, because this is extensive per message
- * logging anyway, and the operator may then have an interest
- * in the cause for unbound to exit */
+ /* note that log, print, syscalls here give race conditions.
+ * And cause hangups if the log-lock is held by the application. */
struct worker* worker = (struct worker*)arg;
switch(sig) {
#ifdef SIGHUP
case SIGHUP:
- verbose(VERB_QUERY, "caught signal SIGHUP");
comm_base_exit(worker->base);
break;
#endif
case SIGINT:
- verbose(VERB_QUERY, "caught signal SIGINT");
worker->need_to_exit = 1;
comm_base_exit(worker->base);
break;
#ifdef SIGQUIT
case SIGQUIT:
- verbose(VERB_QUERY, "caught signal SIGQUIT");
worker->need_to_exit = 1;
comm_base_exit(worker->base);
break;
#endif
case SIGTERM:
- verbose(VERB_QUERY, "caught signal SIGTERM");
worker->need_to_exit = 1;
comm_base_exit(worker->base);
break;
default:
- log_err("unknown signal: %d, ignored", sig);
+ /* unknown signal, ignored */
break;
}
}
return NULL;
}
seed = 0;
+#ifdef USE_DNSTAP
+ if(daemon->cfg->dnstap) {
+ log_assert(daemon->dtenv != NULL);
+ memcpy(&worker->dtenv, daemon->dtenv, sizeof(struct dt_env));
+ if(!dt_init(&worker->dtenv))
+ fatal_exit("dt_init failed");
+ }
+#endif
return worker;
}
worker_init(struct worker* worker, struct config_file *cfg,
struct listen_port* ports, int do_sigs)
{
+#ifdef USE_DNSTAP
+ struct dt_env* dtenv = &worker->dtenv;
+#else
+ void* dtenv = NULL;
+#endif
worker->need_to_exit = 0;
worker->base = comm_base_create(do_sigs);
if(!worker->base) {
}
worker->front = listen_create(worker->base, ports,
cfg->msg_buffer_size, (int)cfg->incoming_num_tcp,
- worker->daemon->listen_sslctx, worker_handle_request, worker);
+ worker->daemon->listen_sslctx, dtenv, worker_handle_request,
+ worker);
if(!worker->front) {
log_err("could not create listening sockets");
worker_delete(worker);
return 0;
}
-
worker->back = outside_network_create(worker->base,
cfg->msg_buffer_size, (size_t)cfg->outgoing_num_ports,
cfg->out_ifs, cfg->num_out_ifs, cfg->do_ip4, cfg->do_ip6,
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->delay_close
+ cfg->do_udp, worker->daemon->connect_sslctx, cfg->delay_close,
+ dtenv
#ifdef CLIENT_SUBNET
,worker->daemon->edns_subnet_upstreams
#endif
struct outbound_entry*
worker_send_query(uint8_t* qname, size_t qnamelen, uint16_t qtype,
uint16_t qclass, uint16_t flags, int dnssec, int want_dnssec,
- struct sockaddr_storage* addr, socklen_t addrlen, uint8_t* zone,
- size_t zonelen, struct module_qstate* q)
+ int nocaps, struct sockaddr_storage* addr, socklen_t addrlen,
+ uint8_t* zone, size_t zonelen, struct module_qstate* q)
{
struct worker* worker = q->env->worker;
struct outbound_entry* e = (struct outbound_entry*)regional_alloc(
return NULL;
e->qstate = q;
e->qsent = outnet_serviced_query(worker->back, qname,
- qnamelen, qtype, qclass, flags, dnssec, want_dnssec,
+ qnamelen, qtype, qclass, flags, dnssec, want_dnssec, nocaps,
q->env->cfg->tcp_upstream, q->env->cfg->ssl_upstream, addr,
addrlen, zone, zonelen, worker_handle_service_reply, e,
worker->back->udp_buff
size_t ATTR_UNUSED(qnamelen), uint16_t ATTR_UNUSED(qtype),
uint16_t ATTR_UNUSED(qclass), uint16_t ATTR_UNUSED(flags),
int ATTR_UNUSED(dnssec), int ATTR_UNUSED(want_dnssec),
- struct sockaddr_storage* ATTR_UNUSED(addr),
- socklen_t ATTR_UNUSED(addrlen), struct module_qstate* ATTR_UNUSED(q))
+ int ATTR_UNUSED(nocaps), struct sockaddr_storage* ATTR_UNUSED(addr),
+ socklen_t ATTR_UNUSED(addrlen), uint8_t* ATTR_UNUSED(zone),
+ size_t ATTR_UNUSED(zonelen), struct module_qstate* ATTR_UNUSED(q))
{
log_assert(0);
return 0;
#ifndef DAEMON_WORKER_H
#define DAEMON_WORKER_H
+#include "libunbound/worker.h"
#include "util/netevent.h"
#include "util/locks.h"
#include "util/alloc.h"
#include "util/data/msgparse.h"
#include "daemon/stats.h"
#include "util/module.h"
+#include "dnstap/dnstap.h"
struct listen_dnsport;
struct outside_network;
struct config_file;
/** module environment passed to modules, changed for this thread */
struct module_env env;
+
+#ifdef USE_DNSTAP
+ /** dnstap environment, changed for this thread */
+ struct dt_env dtenv;
+#endif
};
/**
*/
void worker_send_cmd(struct worker* worker, enum worker_commands cmd);
-/**
- * Worker signal handler function. User argument is the worker itself.
- * @param sig: signal number.
- * @param arg: the worker (main worker) that handles signals.
- */
-void worker_sighandler(int sig, void* arg);
-
-/**
- * Worker service routine to send serviced queries to authoritative servers.
- * @param qname: query name. (host order)
- * @param qnamelen: length in bytes of qname, including trailing 0.
- * @param qtype: query type. (host order)
- * @param qclass: query class. (host order)
- * @param flags: host order flags word, with opcode and CD bit.
- * @param dnssec: if set, EDNS record will have DO bit set.
- * @param want_dnssec: signatures needed.
- * @param addr: where to.
- * @param addrlen: length of addr.
- * @param zone: wireformat dname of the zone.
- * @param zonelen: length of zone name.
- * @param q: wich query state to reactivate upon return.
- * @return: false on failure (memory or socket related). no query was
- * sent.
- */
-struct outbound_entry* worker_send_query(uint8_t* qname, size_t qnamelen,
- uint16_t qtype, uint16_t qclass, uint16_t flags, int dnssec,
- int want_dnssec, struct sockaddr_storage* addr, socklen_t addrlen,
- uint8_t* zone, size_t zonelen, struct module_qstate* q);
-
-/**
- * process control messages from the main thread. Frees the control
- * command message.
- * @param tube: tube control message came on.
- * @param msg: message contents. Is freed.
- * @param len: length of message.
- * @param error: if error (NETEVENT_*) happened.
- * @param arg: user argument
- */
-void worker_handle_control_cmd(struct tube* tube, uint8_t* msg, size_t len,
- int error, void* arg);
-
-/** handles callbacks from listening event interface */
-int worker_handle_request(struct comm_point* c, void* arg, int error,
- struct comm_reply* repinfo);
-
-/** process incoming replies from the network */
-int worker_handle_reply(struct comm_point* c, void* arg, int error,
- struct comm_reply* reply_info);
-
-/** process incoming serviced query replies from the network */
-int worker_handle_service_reply(struct comm_point* c, void* arg, int error,
- struct comm_reply* reply_info);
-
-/** cleanup the cache to remove all rrset IDs from it, arg is worker */
-void worker_alloc_cleanup(void* arg);
-
/**
* Init worker stats - includes server_stats_init, outside network and mesh.
* @param worker: the worker to init
*/
void worker_stats_clear(struct worker* worker);
-/** statistics timer callback handler */
-void worker_stat_timer_cb(void* arg);
-
-/** probe timer callback handler */
-void worker_probe_timer_cb(void* arg);
-
-/** start accept callback handler */
-void worker_start_accept(void* arg);
-
-/** stop accept callback handler */
-void worker_stop_accept(void* arg);
-
#endif /* DAEMON_WORKER_H */
Luca Bruno - patch for windows support in libunbound hosts and resolvconf().
Tom Hendrikx - contributed split-itar.sh a useful script to 5011-track ITAR.
Daisuke HIGASHI - patch for rrset-roundrobin and minimal-responses.
+Simon Perrault - DNS64 module.
+Robert Edmonds - dnstap code.
+22 April 2015: Wouter
+ - Removed contrib/unbound_unixsock.diff, because it has been
+ integrated, use control-interface: /path in unbound.conf.
+ - iana portlist update.
+
+17 April 2015: Wouter
+ - Synthesize ANY responses from cache. Does not search exhaustively,
+ but MX,A,AAAA,SOA,NS also CNAME.
+ - Fix leaked dns64prefix configuration string.
+
+16 April 2015: Wouter
+ - Add local-zone type inform_deny, that logs query and drops answer.
+ - Ratelimit does not apply to prefetched queries, and ratelimit-factor
+ is default 10. Repeated normal queries get resolved and with
+ prefetch stay in the cache.
+ - Fix bug#664: libunbound python3 related fixes (from Tomas Hozza)
+ Use print_function also for Python2.
+ libunbound examples: produce sorted output.
+ libunbound-Python: libldns is not used anymore.
+ Fix issue with Python 3 mapping of FILE* using file_py3.i from ldns.
+
+10 April 2015: Wouter
+ - unbound-control ratelimit_list lists high rate domains.
+ - ratelimit feature, ratelimit: 100, or some sensible qps, can be
+ used to turn it on. It ratelimits recursion effort per zone.
+ For particular names you can configure exceptions in unbound.conf.
+ - Fix that get_option for cache-sizes does not print double newline.
+ - Fix#663: ssl handshake fails when using unix socket because dh size
+ is too small.
+
+8 April 2015: Wouter
+ - Fix crash in dnstap: Do not try to log TCP responses after timeout.
+
+7 April 2015: Wouter
+ - Libunbound skips dos-line-endings from etc/hosts.
+ - Unbound exits with a fatal error when the auto-trust-anchor-file
+ fails to be writable. This is seconds after startup. You can
+ load a readonly auto-trust-anchor-file with trust-anchor-file.
+ The file has to be writable to notice the trust anchor change,
+ without it, a trust anchor change will be unnoticed and the system
+ will then become inoperable.
+ - unbound-control list_insecure command shows the negative trust
+ anchors currently configured, patch from Jelte Jansen.
+
+2 April 2015: Wouter
+ - Fix #660: Fix interface-automatic broken in the presence of
+ asymmetric routing.
+
+26 March 2015: Wouter
+ - remote.c probedelay line is easier to read.
+ - rename ldns subdirectory to sldns to avoid name collision.
+
+25 March 2015: Wouter
+ - Fix #657: libunbound(3) recommends deprecated
+ CRYPTO_set_id_callback.
+ - If unknown trust anchor algorithm, and libressl is used, error
+ message encourages upgrade of the libressl package.
+
+23 March 2015: Wouter
+ - Fix segfault on user not found at startup (from Maciej Soltysiak).
+
+20 March 2015: Wouter
+ - Fixed to add integer overflow checks on allocation (defense in depth).
+
+19 March 2015: Wouter
+ - Add ip-transparent config option for bind to non-local addresses.
+
+17 March 2015: Wouter
+ - Use reallocarray for integer overflow protection, patch submitted
+ by Loganaden Velvindron.
+
+16 March 2015: Wouter
+ - Fixup compile on cygwin, more portable openssl thread id.
+
+12 March 2015: Wouter
+ - Updated default keylength in unbound-control-setup to 3k.
+
+10 March 2015: Wouter
+ - Fix lintian warning in unbound-checkconf man page (from Andreas
+ Schulze).
+ - print svnroot when building windows dist.
+ - iana portlist update.
+ - Fix warning on sign compare in getentropy_linux.
+
+9 March 2015: Wouter
+ - Fix #644: harden-algo-downgrade option, if turned off, fixes the
+ reported excessive validation failure when multiple algorithms
+ are present. It allows the weakest algorithm to validate the zone.
+ - iana portlist update.
+
+5 March 2015: Wouter
+ - contrib/unbound_smf22.tar.gz: Solaris SMF installation/removal
+ scripts. Contributed by Yuri Voinov.
+ - Document that incoming-num-tcp increase is good for large servers.
+ - stats reports tcp usage, of incoming-num-tcp buffers.
+
+4 March 2015: Wouter
+ - Patch from Brad Smith that syncs compat/getentropy_linux with
+ OpenBSD's version (2015-03-04).
+ - 0x20 fallback improved: servfail responses do not count as missing
+ comparisons (except if all responses are errors),
+ inability to find nameservers does not fail equality comparisons,
+ many nameservers does not try to compare more than max-sent-count,
+ parse failures start 0x20 fallback procedure.
+ - store caps_response with best response in case downgrade response
+ happens to be the last one.
+ - Document windows 8 tests.
+
+3 March 2015: Wouter
+ - tag 1.5.3rc1
+ [ This became 1.5.3 on 10 March, trunk is 1.5.4 in development ]
+
+2 March 2015: Wouter
+ - iana portlist update.
+
+20 February 2015: Wouter
+ - Use the getrandom syscall introduced in Linux 3.17 (from Heiner
+ Kallweit).
+ - Fix #645 Portability to Solaris 10, use AF_LOCAL.
+ - Fix #646 Portability to Solaris, -lrt for getentropy_solaris.
+ - Fix #647 crash in 1.5.2 because pwd.db no longer accessible after
+ reload.
+
+19 February 2015: Wouter
+ - 1.5.2 release tag.
+ - svn trunk contains 1.5.3 under development.
+
+13 February 2015: Wouter
+ - Fix #643: doc/example.conf.in: unnecessary whitespace.
+
+12 February 2015: Wouter
+ - tag 1.5.2rc1
+
+11 February 2015: Wouter
+ - iana portlist update.
+
+10 February 2015: Wouter
+ - Fix scrubber with harden-glue turned off to reject NS (and other
+ not-address) records.
+
+9 February 2015: Wouter
+ - Fix validation failure in case upstream forwarder (ISC BIND) does
+ not have the same trust anchors and decides to insert unsigned NS
+ record in authority section.
+
+2 February 2015: Wouter
+ - infra-cache-min-rtt patch from Florian Riehm, for expected long
+ uplink roundtrip times.
+
+30 January 2015: Wouter
+ - Fix 0x20 capsforid fallback to omit gratuitous NS and additional
+ section changes.
+ - Portability fix for Solaris ('sun' is not usable for a variable).
+
+29 January 2015: Wouter
+ - Fix pyunbound byte string representation for python3.
+
+26 January 2015: Wouter
+ - Fix unintended use of gcc extension for incomplete enum types,
+ compile with pedantic c99 compliance (from Daniel Dickman).
+
+23 January 2015: Wouter
+ - windows port fixes, no AF_LOCAL, no chown, no chmod(grp).
+
+16 January 2015: Wouter
+ - unit test for local unix connection. Documentation and log_addr
+ does not inspect port for AF_LOCAL.
+ - unbound-checkconf -f prints chroot with pidfile path.
+
+13 January 2015: Wouter
+ - iana portlist update.
+
+12 January 2015: Wouter
+ - Cast sun_len sizeof to socklen_t.
+ - Fix pyunbound ord call, portable for python 2 and 3.
+
+7 January 2015: Wouter
+ - Fix warnings in pythonmod changes.
+
+6 January 2015: Wouter
+ - iana portlist update.
+ - patch for remote control over local sockets, from Dag-Erling
+ Smorgrav, Ilya Bakulin. Use control-interface: /path/sock and
+ control-use-cert: no.
+ - Fixup that patch and uid lookup (only for daemon).
+ - coded the default of control-use-cert, to yes.
+
+5 January 2015: Wouter
+ - getauxval test for ppc64 linux compatibility.
+ - make strip works for unbound-host and unbound-anchor.
+ - patch from Stephane Lapie that adds to the python API, that
+ exposes struct delegpt, and adds the find_delegation function.
+ - print query name when max target count is exceeded.
+ - patch from Stuart Henderson that fixes DESTDIR in
+ unbound-control-setup for installs where config is not in
+ the prefix location.
+ - Fix #634: fix fail to start on Linux LTS 3.14.X, ignores missing
+ IP_MTU_DISCOVER OMIT option (fix from Remi Gacogne).
+ - Updated contrib warmup.cmd/sh to support two modes - load
+ from pre-defined list of domains or (with filename as argument)
+ load from user-specified list of domains, and updated contrib
+ unbound_cache.sh/cmd to support loading/save/reload cache to/from
+ default path or (with secondary argument) arbitrary path/filename,
+ from Yuri Voinov.
+ - Patch from Philip Paeps to contrib/unbound_munin_ that uses
+ type ABSOLUTE. Allows munin.conf: [idleserver.example.net]
+ unbound_munin_hits.graph_period minute
+
+9 December 2014: Wouter
+ - svn trunk has 1.5.2 in development.
+ - config.guess and config.sub update from libtoolize.
+ - local-zone: example.com inform makes unbound log a message with
+ client IP for queries in that zone. Eg. for finding infected hosts.
+
+8 December 2014: Wouter
+ - Fix CVE-2014-8602: denial of service by making resolver chase
+ endless series of delegations.
+
+1 December 2014: Wouter
+ - Fix bug#632: unbound fails to build on AArch64, protects
+ getentropy compat code from calling sysctl if it is has been removed.
+
+29 November 2014: Wouter
+ - Add include to getentropy_linux.c, hopefully fixing debian build.
+
+28 November 2014: Wouter
+ - Fix makefile for build from noexec source tree.
+
+26 November 2014: Wouter
+ - Fix libunbound undefined symbol errors for main.
+ Referencing main does not seem to be possible for libunbound.
+
+24 November 2014: Wouter
+ - Fix log at high verbosity and memory allocation failure.
+ - iana portlist update.
+
+21 November 2014: Wouter
+ - Fix crash on multiple thread random usage on systems without
+ arc4random.
+
+20 November 2014: Wouter
+ - fix compat/getentropy_win.c check if CryptGenRandom works and no
+ immediate exit on windows.
+
+19 November 2014: Wouter
+ - Fix cdflag dns64 processing.
+
+18 November 2014: Wouter
+ - Fix that CD flag disables DNS64 processing, returning the DNSSEC
+ signed AAAA denial.
+ - iana portlist update.
+
+17 November 2014: Wouter
+ - Fix #627: SSL_CTX_load_verify_locations return code not properly
+ checked.
+
+14 November 2014: Wouter
+ - parser with bison 2.7
+
+13 November 2014: Wouter
+ - Patch from Stephane Lapie for ASAHI Net that implements aaaa-filter,
+ added to contrib/aaaa-filter-iterator.patch.
+
+12 November 2014: Wouter
+ - trunk has 1.5.1 in development.
+ - Patch from Robert Edmonds to build pyunbound python module
+ differently. No versioninfo, with -shared and without $(LIBS).
+ - Patch from Robert Edmonds fixes hyphens in unbound-anchor man page.
+ - Removed 'increased limit open files' log message that is written
+ to console. It is only written on verbosity 4 and higher.
+ This keeps system bootup console cleaner.
+ - Patch from James Raftery, always print stats for rcodes 0..5.
+
+11 November 2014: Wouter
+ - iana portlist update.
+ - Fix bug where forward or stub addresses with same address but
+ different port number were not tried.
+ - version number in svn trunk is 1.5.0
+ - tag 1.5.0rc1
+ - review fix from Ralph.
+
+7 November 2014: Wouter
+ - dnstap fixes by Robert Edmonds:
+ dnstap/dnstap.m4: cosmetic fixes
+ dnstap/: Remove compiled protoc-c output files
+ dnstap/dnstap.m4: Error out if required libraries are not found
+ dnstap: Fix ProtobufCBufferSimple usage that is incorrect as of
+ protobuf-c 1.0.0
+ dnstap/: Adapt to API changes in latest libfstrm (>= 0.2.0)
+
+4 November 2014: Wouter
+ - Add ub_ctx_add_ta_autr function to add a RFC5011 automatically
+ tracked trust anchor to libunbound.
+ - Redefine internal minievent symbols to unique symbols that helps
+ linking on platforms where the linker leaks names across modules.
+
+27 October 2014: Wouter
+ - Disabled use of SSLv3 in remote-control and ssl-upstream.
+ - iana portlist update.
+
+16 October 2014: Wouter
+ - Documented dns64 configuration in unbound.conf man page.
+
+13 October 2014: Wouter
+ - Fix #617: in ldns in unbound, lowercase WKS services.
+ - Fix ctype invocation casts.
+
+10 October 2014: Wouter
+ - Fix unbound-checkconf check for module config with dns64 module.
+ - Fix unbound capsforid fallback, it ignores TTLs in comparison.
+
+6 October 2014: Wouter
+ - Fix #614: man page variable substitution bug.
+6 October 2014: Willem
+ - Whitespaces after $ORIGIN are not part of the origin dname (ldns).
+ - $TTL's value starts at position 5 (ldns).
+
+1 October 2014: Wouter
+ - fix #613: Allow tab ws in var length last rdfs (in ldns str2wire).
+
+29 September 2014: Wouter
+ - Fix #612: create service with service.conf in present directory and
+ auto load it.
+ - Fix for mingw compile openssl ranlib.
+
+25 September 2014: Wouter
+ - updated configure and aclocal with newer autoconf 1.13.
+
+22 September 2014: Wouter
+ - Fix swig and python examples for Python 3.x.
+ - Fix for mingw compile with openssl-1.0.1i.
+
+19 September 2014: Wouter
+ - improve python configuration detection to build on Fedora 22.
+
+18 September 2014: Wouter
+ - patches to also build with Python 3.x (from Pavel Simerda).
+
+16 September 2014: Wouter
+ - Fix tcp timer waiting list removal code.
+ - iana portlist update.
+ - Updated the TCP_BACLOG from 5 to 256, so that the tcp accept queue
+ is longer and more tcp connections can be handled.
+
+15 September 2014: Wouter
+ - Fix unit test for CDS typecode.
+
+5 September 2014: Wouter
+ - type CDS and CDNSKEY types in sldns.
+
+25 August 2014: Wouter
+ - Fixup checklock code for log lock and its mutual initialization
+ dependency.
+ - iana portlist update.
+ - Removed necessity for pkg-config from the dnstap.m4, new are
+ the --with-libfstrm and --with-protobuf-c configure options.
+
+19 August 2014: Wouter
+ - Update unbound manpage with more explanation (from Florian Obser).
+
+18 August 2014: Wouter
+ - Fix #603: unbound-checkconf -o <option> should skip verification
+ checks.
+ - iana portlist update.
+ - Fixup doc/unbound.doxygen to remove obsolete 1.8.7 settings.
+
+5 August 2014: Wouter
+ - dnstap support, with a patch from Farsight Security, written by
+ Robert Edmonds. The --enable-dnstap needs libfstrm and protobuf-c.
+ It is BSD licensed (see dnstap/dnstap.c).
+ Building with --enable-dnstap needs pkg-config with this patch.
+ - Noted dnstap in doc/README and doc/CREDITS.
+ - Changes to the dnstap patch.
+ - lint fixes.
+ - dnstap/dnstap_config.h should not have been added to the repo,
+ because is it generated.
+
+1 August 2014: Wouter
+ - Patch add msg, rrset, infra and key cache sizes to stats command
+ from Maciej Soltysiak.
+ - iana portlist update.
+
+31 July 2014: Wouter
+ - DNS64 from Viagenie (BSD Licensed), written by Simon Perrault.
+ Initial commit of the patch from the FreeBSD base (with its fixes).
+ This adds a module (for module-config in unbound.conf) dns64 that
+ performs DNS64 processing, see README.DNS64.
+ - Changes from DNS64:
+ strcpy changed to memmove.
+ arraybound check fixed from prefix_net/8/4 to prefix_net/8+4.
+ allocation of result consistently in the correct region.
+ time_t is now used for ttl in unbound (since the patch's version).
+ - testdata/dns64_lookup.rpl for unit test for dns64 functionality.
+
+29 July 2014: Wouter
+ - Patch from Dag-Erling Smorgrav that implements feature, unbound -dd
+ does not fork in the background and also logs to stderr.
+
+21 July 2014: Wouter
+ - Fix endian.h include for OpenBSD.
+
+16 July 2014: Wouter
+ - And Fix#596: Bail out of unbound-control dump_infra when ssl
+ write fails.
+
+15 July 2014: Wouter
+ - Fix #596: Bail out of unbound-control list_local_zones when ssl
+ write fails.
+ - iana portlist update.
+
+13 July 2014: Wouter
+ - Configure tests if main can be linked to from getentropy compat.
+
+12 July 2014: Wouter
+ - Fix getentropy compat code, function refs were not portable.
+ - Fix to check openssl version number only for OpenSSL.
+ - LibreSSL provides compat items, check for that in configure.
+ - Fix bug in fix for log locks that caused deadlock in signal handler.
+ - update compat/getentropy and arc4random to the most recent ones from OpenBSD.
+
+11 July 2014: Matthijs
+ - fake-rfc2553 patch (thanks Benjamin Baier).
+
+11 July 2014: Wouter
+ - arc4random in compat/ and getentropy, explicit_bzero, chacha for
+ dependencies, from OpenBSD. arc4_lock and sha512 in compat.
+ This makes arc4random available on all platforms, except when
+ compiled with LIBNSS (it uses libNSS crypto random).
+ - fix strptime implicit declaration error on OpenBSD.
+ - arc4random, getentropy and explicit_bzero compat for Windows.
+
+4 July 2014: Wouter
+ - Fix #593: segfault or crash upon rotating logfile.
+
+3 July 2014: Wouter
+ - DLV tests added.
+ - signit tool fixup for compile with libldns library.
+ - iana portlist updated.
+
+27 June 2014: Wouter
+ - so-reuseport is available on BSDs(such as FreeBSD 10) and OS/X.
+
+26 June 2014: Wouter
+ - unbound-control status reports if so-reuseport was successful.
+ - iana portlist updated.
+
+24 June 2014: Wouter
+ - Fix caps-for-id fallback, and added fallback attempt when servers
+ drop 0x20 perturbed queries.
+ - Fixup testsetup for VM tests (run testcode/run_vm.sh).
+
+17 June 2014: Wouter
+ - iana portlist updated.
+
+3 June 2014: Wouter
+ - Add AAAA for B root server to default root hints.
+
+2 June 2014: Wouter
+ - Remove unused define from iterator.h
+
+30 May 2014: Wouter
+ - Fixup sldns_enum_edns_option typedef definition.
+
+28 May 2014: Wouter
+ - Code cleanup patch from Dag-Erling Smorgrav, with compiler issue
+ fixes from FreeBSD's copy of Unbound, he notes:
+ Generate unbound-control-setup.sh at build time so it respects
+ prefix and sysconfdir from the configure script. Also fix the
+ umask to match the comment, and the comment to match the umask.
+ Add const and static where needed. Use unions instead of
+ playing pointer poker. Move declarations that are needed in
+ multiple source files into a shared header. Move sldns_bgetc()
+ from parse.c to buffer.c where it belongs. Introduce a new
+ header file, worker.h, which declares the callbacks that
+ all workers must define. Remove those declarations from
+ libworker.h. Include the correct headers in the correct places.
+ Fix a few dummy callbacks that don't match their prototype.
+ Fix some casts. Hide the sbrk madness behind #ifdef HAVE_SBRK.
+ Remove a useless printf which breaks reproducible builds.
+ Get rid of CONFIGURE_{TARGET,DATE,BUILD_WITH} now that they're
+ no longer used. Add unbound-control-setup.sh to the list of
+ generated files. The prototype for libworker_event_done_cb()
+ needs to be moved from libunbound/libworker.h to
+ libunbound/worker.h.
+ - Fixup out-of-directory compile with unbound-control-setup.sh.in.
+ - make depend.
+
+23 May 2014: Wouter
+ - unbound-host -D enabled dnssec and reads root trust anchor from
+ the default root key file that was compiled in.
+
+20 May 2014: Wouter
+ - Feature, unblock-lan-zones: yesno that you can use to make unbound
+ perform 10.0.0.0/8 and other reverse lookups normally, for use if
+ unbound is running service for localhost on localhost.
+
16 May 2014: Wouter
- Updated create_unbound_ad_servers and unbound_cache scripts from
Yuri Voinov in the source/contrib directory. Added
http://unbound.net
This software is under BSD license, see LICENSE for details.
+The DNS64 module has BSD license in dns64/dns64.c.
+The DNSTAP code has BSD license in dnstap/dnstap.c.
* Download the latest release version of this software from
http://unbound.net
README.svn
-For a svn checkout
+For a svn checkout:
* configure script, aclocal.m4, as well as yacc/lex output files are
committed to the repository.
* use --enable-debug flag for configure to enable dependency tracking and
# 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.
+ # use SO_REUSEPORT to distribute queries over threads.
# so-reuseport: no
+
+ # use IP_TRANSPARENT so the interface: addresses can be non-local
+ # and you can config non-existing IPs that are going to work later on
+ # ip-transparent: no
# EDNS reassembly buffer to advertise to UDP peers (the actual buffer
# is set with msg-buffer-size). 1480 can solve fragmentation (timeouts).
# the time to live (TTL) value for cached roundtrip times, lameness and
# EDNS version information for hosts. In seconds.
# infra-host-ttl: 900
+
+ # minimum wait time for responses, increase if uplink is long. In msec.
+ # infra-cache-min-rtt: 50
# the number of slabs to use for the Infrastructure cache.
# the number of slabs must be a power of 2.
# implementation of draft-wijngaards-dnsext-resolver-side-mitigation.
# harden-referral-path: no
+ # Harden against algorithm downgrade when multiple algorithms are
+ # advertised in the DS record. If no, allows the weakest algorithm
+ # to validate the zone.
+ # harden-algo-downgrade: yes
+
# Use 0x20-encoded random bits in the query to foil spoof attempts.
# This feature is an experimental implementation of draft dns-0x20.
# use-caps-for-id: no
# minimal-responses: no
# module configuration of the server. A string with identifiers
- # separated by spaces. "iterator" or "validator iterator"
+ # separated by spaces. Syntax: "[dns64] [validator] iterator"
# module-config: "validator iterator"
# File with trusted keys, kept uptodate using RFC5011 probes,
# local-zone: "b.e.f.ip6.arpa." nodefault
# local-zone: "8.b.d.0.1.0.0.2.ip6.arpa." nodefault
# And for 64.100.in-addr.arpa. to 127.100.in-addr.arpa.
+
+ # 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
# a number of locally served zones can be configured.
# local-zone: <zone> <type>
# o redirect serves the zone data for any subdomain in the zone.
# o nodefault can be used to normally resolve AS112 zones.
# o typetransparent resolves normally for other types and other names
+ # o inform resolves normally, but logs client IP address
+ # o inform_deny drops queries and logs client IP address
#
# defaults are localhost address, reverse for 127.0.0.1 and ::1
# and nxdomain for AS112 zones. If you configure one of these zones
# Default is no. Can be turned on and off with unbound-control.
# ssl-upstream: no
+ # DNS64 prefix. Must be specified when DNS64 is use.
+ # Enable dns64 in module-config. Used to synthesize IPv6 from IPv4.
+ # dns64-prefix: 64:ff9b::0/96
+
+ # ratelimit for uncached, new queries, this limits recursion effort.
+ # ratelimiting is experimental, and may help against randomqueryflood.
+ # if 0(default) it is disabled, otherwise state qps allowed per zone.
+ # ratelimit: 0
+
+ # ratelimits are tracked in a cache, size in bytes of cache (or k,m).
+ # ratelimit-size: 4m
+ # ratelimit cache slabs, reduces lock contention if equal to cpucount.
+ # ratelimit-slabs: 4
+
+ # 0 blocks when ratelimited, otherwise let 1/xth traffic through
+ # ratelimit-factor: 10
+
+ # override the ratelimit for a specific domain name.
+ # give this setting multiple times to have multiple overrides.
+ # ratelimit-for-domain: example.com 100
+ # override the ratelimits for all domains below a domain name
+ # can give this multiple times, the name closest to the zone is used.
+ # ratelimit-below-domain: example 100
+
# Python config section. To enable:
# o use --with-pythonmodule to configure before compiling.
# o list python in the module-config string (above) to enable.
# set up the keys and certificates with unbound-control-setup.
# control-enable: no
+ # Set to no and use an absolute path as control-interface to use
+ # a unix local named pipe for unbound-control.
+ # control-use-cert: yes
+
# what interfaces are listened to for remote control.
# give 0.0.0.0 and ::0 to listen to all interfaces.
# control-interface: 127.0.0.1
.\"
.\"
.SH "NAME"
-.LP
.B libunbound,
.B unbound.h,
.B ub_ctx,
.B ub_ctx_resolvconf,
.B ub_ctx_hosts,
.B ub_ctx_add_ta,
+.B ub_ctx_add_ta_autr,
.B ub_ctx_add_ta_file,
.B ub_ctx_trustedkeys,
.B ub_ctx_debugout,
.B ub_ctx_data_remove
\- Unbound DNS validating resolver @version@ functions.
.SH "SYNOPSIS"
-.LP
.B #include <unbound.h>
.LP
\fIstruct ub_ctx *\fR
\fBub_ctx_add_ta\fR(\fIstruct ub_ctx*\fR ctx, \fIchar*\fR ta);
.LP
\fIint\fR
+\fBub_ctx_add_ta_autr\fR(\fIstruct ub_ctx*\fR ctx, \fIchar*\fR fname);
+.LP
+\fIint\fR
\fBub_ctx_add_ta_file\fR(\fIstruct ub_ctx*\fR ctx, \fIchar*\fR fname);
.LP
\fIint\fR
\fIint\fR
\fBub_ctx_data_remove\fR(\fIstruct ub_ctx*\fR ctx, \fIchar*\fR data);
.SH "DESCRIPTION"
-.LP
.B Unbound
is an implementation of a DNS resolver, that does caching and
DNSSEC validation. This is the library API, for using the \-lunbound library.
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).
+Openssl 1.0.0 or later uses the CRYPTO_THREADID_set_callback function.
.TP
.B ub_ctx_delete
Delete validation context and free associated resources.
The format is a string, similar to the zone\-file format,
[domainname] [type] [rdata contents]. Both DS and DNSKEY records are accepted.
.TP
+.B ub_ctx_add_ta_autr
+Add filename with automatically tracked trust anchor to the given context.
+Pass name of a file with the managed trust anchor. You can create this
+file with \fIunbound\-anchor\fR(8) for the root anchor. You can also
+create it with an initial file with one line with a DNSKEY or DS record.
+If the file is writable, it is updated when the trust anchor changes.
+At this time it is only possible to add trusted keys before the
+first resolve is done.
+.TP
.B ub_ctx_add_ta_file
Add trust anchors to the given context.
Pass name of a file with DS and DNSKEY records in zone file format.
.B ub_ctx_data_remove
Delete local authority data from the name given.
.SH "RESULT DATA STRUCTURE"
-.LP
The result of the DNS resolution and validation is returned as
\fIstruct ub_result\fR. The result structure contains the following entries.
.P
.\"
.\"
.SH "NAME"
-.LP
.B unbound\-anchor
\- Unbound anchor utility.
.SH "SYNOPSIS"
.nf
# in the init scripts.
# provide or update the root anchor (if necessary)
- unbound-anchor -a "@UNBOUND_ROOTKEY_FILE@"
+ unbound-anchor \-a "@UNBOUND_ROOTKEY_FILE@"
# Please note usage of this root anchor is at your own risk
# and under the terms of our LICENSE (see source).
#
# start validating resolver
# the unbound.conf contains:
# auto-trust-anchor-file: "@UNBOUND_ROOTKEY_FILE@"
- unbound -c unbound.conf
+ unbound \-c unbound.conf
.fi
.P
This tool provides builtin default contents for the root anchor and root
.P
You can check the exit value in this manner:
.nf
- unbound-anchor -a "root.key" || logger "Please check root.key"
+ unbound-anchor \-a "root.key" || logger "Please check root.key"
.fi
Or something more suitable for your operational environment.
.SH "TRUST"
.\"
.\"
.SH "NAME"
-.LP
unbound\-checkconf
\- Check unbound configuration file for errors.
.SH "SYNOPSIS"
.B unbound\-checkconf
.RB [ \-h ]
+.RB [ \-f ]
.RB [ \-o
.IR option ]
.RI [ cfgfile ]
.B \-h
Show the version and commandline option help.
.TP
+.B \-f
+Print full pathname, with chroot applied to it. Use with the \-o option.
+.TP
.B \-o\fI option
If given, after checking the config file the value of this option is
printed to stdout. For "" (disabled) options an empty line is printed.
.\"
.\"
.SH "NAME"
-.LP
.B unbound\-control,
.B unbound\-control\-setup
\- Unbound remote server control utility.
.B list_forwards
List the forward zones in use. These are printed zone by zone to the output.
.TP
+.B list_insecure
+List the zones with domain\-insecure.
+.TP
.B list_local_zones
List the local zones in use. These are printed one per line with zone type.
.TP
By default the forwarder information from the config file for the root "." is
used. The config file is not changed, so after a reload these changes are
gone. Other forward zones from the config file are not affected by this command.
+.TP
+.B ratelimit_list \fR[\fI+a\fR]
+List the domains that are ratelimited. Printed one per line with current
+estimated qps and qps limit from config. With +a it prints all domains, not
+just the ratelimited domains, with their estimated qps. The ratelimited
+domains return an error for uncached (new) queries, but cached queries work
+as normal.
.SH "EXIT CODE"
The unbound\-control program exits with status code 1 on error, 0 on success.
.SH "SET UP"
responsive servers), the average can be bigger than the median. This median
has been calculated by interpolation from a histogram.
.TP
+.I threadX.tcpusage
+The currently held tcp buffers for incoming connections. A spot value on
+the time of the request. This helps you spot if the incoming\-num\-tcp
+buffers are full.
+.TP
.I total.num.queries
summed over threads.
.TP
.I total.recursion.time.median
averaged over threads.
.TP
+.I total.tcpusage
+summed over threads.
+.TP
.I time.now
current time in seconds since 1970.
.TP
delayed duplicates, very late answers, or could be spoofing attempts.
Some low level of late answers and delayed duplicates are to be expected
with the UDP protocol. Very high values could indicate a threat (spoofing).
+.TP
+.I msg.cache.count
+The number of items (DNS replies) in the message cache.
+.TP
+.I rrset.cache.count
+The number of RRsets in the rrset cache. This includes rrsets used by
+the messages in the message cache, but also delegation information.
+.TP
+.I infra.cache.count
+The number of items in the infra cache. These are IP addresses with their
+timing and protocol support information.
+.TP
+.I key.cache.count
+The number of items in the key cache. These are DNSSEC keys, one item
+per delegation point, and their validation status.
.SH "FILES"
.TP
.I @ub_conf_file@
.\"
.\"
.SH "NAME"
-.LP
.B unbound\-host
\- unbound DNS lookup utility
.SH "SYNOPSIS"
-.LP
.B unbound\-host
-.RB [ \-vdhr46 ]
+.RB [ \-vdhr46D ]
.RB [ \-c
.IR class ]
.RB [ \-t
.RB [ \-C
.IR configfile ]
.SH "DESCRIPTION"
-.LP
.B Unbound\-host
uses the unbound validating resolver to query for the hostname and display
results. With the \fB\-v\fR option it displays validation
to validate the response message. Can be given as a DS or DNSKEY record.
For example \-y "example.com DS 31560 5 1 1CFED84787E6E19CCF9372C1187325972FE546CD".
.TP
+.B \-D
+Enables DNSSEC validation. Reads the root anchor from the default configured
+root anchor at the default location, \fI@UNBOUND_ROOTKEY_FILE@\fR.
+.TP
.B \-f \fIkeyfile
Reads keys from a file. Every line has a DS or DNSKEY record, in the format
as for \-y. The zone file format, the same as dig and drill produce.
.B \-6
Use solely the IPv6 network for sending packets.
.SH "EXAMPLES"
-.LP
Some examples of use. The keys shown below are fakes, thus a security failure
is encountered.
.P
.\"
.\"
.SH "NAME"
-.LP
.B unbound
\- Unbound DNS validating resolver @version@.
.SH "SYNOPSIS"
-.LP
.B unbound
.RB [ \-h ]
.RB [ \-d ]
.RB [ \-v ]
-.RB [ \-c
+.RB [ \-c
.IR cfgfile ]
.SH "DESCRIPTION"
-.LP
-.B Unbound
-is an implementation of a DNS resolver, that does caching and
-DNSSEC validation.
+.B Unbound
+is a caching DNS resolver.
+.P
+It uses a built in list of authoritative nameservers for the root zone (.),
+the so called root hints.
+On receiving a DNS query it will ask the root nameservers for
+an answer and will in almost all cases receive a delegation to a top level
+domain (TLD) authoritative nameserver.
+It will then ask that nameserver for an answer.
+It will recursively continue until an answer is found or no answer is
+available (NXDOMAIN).
+For performance and efficiency reasons that answer is cached for a
+certain time (the answer's time\-to\-live or TTL).
+A second query for the same name will then be answered from the cache.
+Unbound can also do DNSSEC validation.
+.P
+To use a locally running
+.B Unbound
+for resolving put
+.sp
+.RS 6n
+nameserver 127.0.0.1
+.RE
+.sp
+into
+.IR resolv.conf (5).
+.P
+If authoritative DNS is needed as well using
+.IR nsd (8),
+careful setup is required because authoritative nameservers and
+resolvers are using the same port number (53).
.P
The available options are:
.TP
Show the version and commandline option help.
.TP
.B \-c\fI cfgfile
-Set the config file with settings for unbound to read instead of reading the
+Set the config file with settings for unbound to read instead of reading the
file at the default location, @ub_conf_file@. The syntax is
described in \fIunbound.conf\fR(5).
.TP
.B \-d
-Debug flag, do not fork into the background, but stay attached to the
-console. This flag will also delay writing to the logfile until the
-thread\-spawn time. So that most config and setup errors appear on stderr.
+Debug flag: do not fork into the background, but stay attached to
+the console. This flag will also delay writing to the log file until
+the thread\-spawn time, so that most config and setup errors appear on
+stderr. If given twice or more, logging does not switch to the log file
+or to syslog, but the log messages are printed to stderr all the time.
.TP
.B \-v
Increase verbosity. If given multiple times, more information is logged.
This is in addition to the verbosity (if any) from the config file.
.SH "SEE ALSO"
-\fIunbound.conf\fR(5),
-\fIunbound\-checkconf\fR(8).
+\fIunbound.conf\fR(5),
+\fIunbound\-checkconf\fR(8),
+\fInsd\fR(8).
.SH "AUTHORS"
.B Unbound
developers are mentioned in the CREDITS file in the distribution.
.\"
.\"
.SH "NAME"
-.LP
.B unbound.conf
\- Unbound configuration file.
.SH "SYNOPSIS"
-.LP
.B unbound.conf
.SH "DESCRIPTION"
-.LP
.B unbound.conf
is used to configure
\fIunbound\fR(8).
access\-control: 2001:DB8::/64 allow
.fi
.SH "FILE FORMAT"
-.LP
There must be whitespace between keywords. Attribute keywords end with a colon ':'. An attribute
is followed by its containing attributes, or a value.
.P
Give a port number or a range of the form "low\-high", without spaces.
.TP
.B outgoing\-num\-tcp: \fI<number>
-Number of outgoing TCP buffers to allocate per thread. Default is 10. If set
-to 0, or if do\-tcp is "no", no TCP queries to authoritative servers are done.
+Number of outgoing TCP buffers to allocate per thread. Default is 10. If
+set to 0, or if do\-tcp is "no", no TCP queries to authoritative servers
+are done. For larger installations increasing this value is a good idea.
.TP
.B incoming\-num\-tcp: \fI<number>
-Number of incoming TCP buffers to allocate per thread. Default is 10. If set
-to 0, or if do\-tcp is "no", no TCP queries from clients are accepted.
+Number of incoming TCP buffers to allocate per thread. Default is
+10. If set to 0, or if do\-tcp is "no", no TCP queries from clients are
+accepted. For larger installations increasing this value is a good idea.
.TP
.B edns\-buffer\-size: \fI<number>
Number of bytes size to advertise as the EDNS reassembly buffer size.
.B so\-reuseport: \fI<yes or no>
If yes, then open dedicated listening sockets for incoming queries for each
thread and try to set the SO_REUSEPORT socket option on each socket. May
-distribute incoming queries to threads more evenly. Default is no. Only
-supported on Linux >= 3.9. You can enable it (on any platform and kernel),
+distribute incoming queries to threads more evenly. Default is no. On Linux
+it is supported in kernels >= 3.9. On other systems, FreeBSD, OSX it may
+also work. You can enable it (on any platform and kernel),
it then attempts to open the port and passes the option if it was available
at compile time, if that works it is used, if it fails, it continues
silently (unless verbosity 3) without the option.
.TP
+.B ip\-transparent: \fI<yes or no>
+If yes, then use IP_TRANSPARENT socket option on sockets where unbound
+is listening for incoming traffic. Default no. Allows you to bind to
+non\-local interfaces. For example for non\-existant IP addresses that
+are going to exist later on, with host failover configuration. This is
+a lot like interface\-automatic, but that one services all interfaces
+and with this option you can select which (future) interfaces unbound
+provides service on. This option needs unbound to be started with root
+permissions on some systems.
+.TP
.B rrset\-cache\-size: \fI<number>
Number of bytes size of the RRset cache. Default is 4 megabytes.
A plain number is in bytes, append 'k', 'm' or 'g' for kilobytes, megabytes
.B infra\-cache\-numhosts: \fI<number>
Number of hosts for which information is cached. Default is 10000.
.TP
+.B infra\-cache\-min\-rtt: \fI<msec>
+Lower limit for dynamic retransmit timeout calculation in infrastructure
+cache. Default is 50 milliseconds. Increase this value if using forwarders
+needing more time to do recursive name resolution.
+.TP
.B do\-ip4: \fI<yes or no>
Enable or disable whether ip4 queries are answered or issued. Default is yes.
.TP
If you enable it consider adding more numbers after the target\-fetch\-policy
to increase the max depth that is checked to.
.TP
+.B harden\-algo\-downgrade: \fI<yes or no>
+Harden against algorithm downgrade when multiple algorithms are
+advertised in the DS record. If no, allows the weakest algorithm to
+validate the zone. Default is yes. Zone signers must produce zones
+that allow this feature to work, but sometimes they do not, and turning
+this option off avoids that validation failure.
+.TP
.B use\-caps\-for\-id: \fI<yes or no>
Use 0x20\-encoded random bits in the query to foil spoof attempts.
This perturbs the lowercase and uppercase of query names sent to
A plain number is in bytes, append 'k', 'm' or 'g' for kilobytes, megabytes
or gigabytes (1024*1024 bytes in a megabyte).
.TP
+.B unblock\-lan\-zones: \fI<yesno>
+Default is disabled. If enabled, then for private address space,
+the reverse lookups are no longer filtered. This allows unbound when
+running as dns service on a host where it provides service for that host,
+to put out all of the queries for the 'lan' upstream. When enabled,
+only localhost, 127.0.0.1 reverse and ::1 reverse zones are configured
+with default local zones. Disable the option when unbound is running
+as a (DHCP-) DNS network resolver for a group of machines, where such
+lookups should be filtered (RFC compliance), this also stops potential
+data leakage about the local network to the upstream DNS servers.
+.TP
.B local\-zone: \fI<zone> <type>
Configure a local zone. The type determines the answer to give if
there is no match from local\-data. The types are deny, refuse, static,
-transparent, redirect, nodefault, typetransparent, and are explained
-below. After that the default settings are listed. Use local\-data: to
-enter data into the local zone. Answers for local zones are authoritative
-DNS answers. By default the zones are class IN.
+transparent, redirect, nodefault, typetransparent, inform, inform_deny,
+and are explained below. After that the default settings are listed. Use
+local\-data: to enter data into the local zone. Answers for local zones
+are authoritative DNS answers. By default the zones are class IN.
.IP
If you need more complicated authoritative data, with referrals, wildcards,
CNAME/DNAME support, or DNSSEC authoritative service, setup a stub\-zone for
queries for www.example.com and www.foo.example.com are redirected, so
that users with web browsers cannot access sites with suffix example.com.
.TP 10
+\h'5'\fIinform\fR
+The query is answered normally. The client IP address (@portnumber)
+is printed to the logfile. The log message is: timestamp, unbound-pid,
+info: zonename inform IP@port queryname type class. This option can be
+used for normal resolution, but machines looking up infected names are
+logged, eg. to run antivirus on them.
+.TP 10
+\h'5'\fIinform_deny\fR
+The query is dropped, like 'deny', and logged, like 'inform'. Ie. find
+infected machines without answering the queries.
+.TP 10
\h'5'\fInodefault\fR
Used to turn off default contents for AS112 zones. The other types
also turn off default contents for the zone. The 'nodefault' option
.B max\-client\-subnet\-ipv4: \fI<number>
Specifies the maximum prefix length of the client source address we
are willing to expose to third parties for IPv4. Defaults to 24.
+.TP 5
+.B ratelimit: \fI<number or 0>
+Enable ratelimiting of queries sent to nameserver for performing recursion.
+If 0, the default, it is disabled. This option is experimental at this time.
+The ratelimit is in queries per second that are allowed. More queries are
+turned away with an error (servfail). This stops recursive floods, eg. random
+query names, but not spoofed reflection floods. Cached responses are not
+ratelimited by this setting. The zone of the query is determined by examining
+the nameservers for it, the zone name is used to keep track of the rate.
+For example, 100 may be a suitable value to stop the server from being
+overloaded with random names, and keeps unbound from sending traffic to the
+nameservers for those zones.
+.TP 5
+.B ratelimit\-size: \fI<memory size>
+Give the size of the data structure in which the current ongoing rates are
+kept track in. Default 4m. In bytes or use m(mega), k(kilo), g(giga).
+The ratelimit structure is small, so this data structure likely does
+not need to be large.
+.TP 5
+.B ratelimit\-slabs: \fI<number>
+Give power of 2 number of slabs, this is used to reduce lock contention
+in the ratelimit tracking data structure. Close to the number of cpus is
+a fairly good setting.
+.TP 5
+.B ratelimit\-factor: \fI<number>
+Set the amount of queries to rate limit when the limit is exceeded.
+If set to 0, all queries are dropped for domains where the limit is
+exceeded. If set to another value, 1 in that number is allowed through
+to complete. Default is 10, allowing 1/10 traffic to flow normally.
+This can make ordinary queries complete (if repeatedly queried for),
+and enter the cache, whilst also mitigiting the traffic flow by the
+factor given.
+.TP 5
+.B ratelimit\-for\-domain: \fI<domain> <number qps>
+Override the global ratelimit for an exact match domain name with the listed
+number. You can give this for any number of names. For example, for
+a top\-level\-domain you may want to have a higher limit than other names.
+.TP 5
+.B ratelimit\-below\-domain: \fI<domain> <number qps>
+Override the global ratelimit for a domain name that ends in this name.
+You can give this multiple times, it then describes different settings
+in different parts of the namespace. The closest matching suffix is used
+to determine the qps limit. The rate for the exact matching domain name
+is not changed, use ratelimit\-for\-domain to set that, you might want
+to use different settings for a top\-level\-domain and subdomains.
.SS "Remote Control Options"
In the
.B remote\-control:
section for options. To setup the correct self\-signed certificates use the
\fIunbound\-control\-setup\fR(8) utility.
.TP 5
-.B control\-enable: \fI<yes or no>
+.B control\-enable: \fI<yes or no>
The option is used to enable remote control, default is "no".
If turned off, the server does not listen for control commands.
.TP 5
-.B control\-interface: <ip address>
-Give IPv4 or IPv6 addresses to listen on for control commands.
+.B control\-interface: \fI<ip address or path>
+Give IPv4 or IPv6 addresses or local socket path to listen on for
+control commands.
By default localhost (127.0.0.1 and ::1) is listened to.
Use 0.0.0.0 and ::0 to listen to all interfaces.
+If you change this and permissions have been dropped, you must restart
+the server for the change to take effect.
+.TP 5
+.B control\-port: \fI<port number>
+The port number to listen on for IPv4 or IPv6 control interfaces,
+default is 8953.
+If you change this and permissions have been dropped, you must restart
+the server for the change to take effect.
.TP 5
-.B control\-port: <port number>
-The port number to listen on for control commands, default is 8953.
-If you change this port number, and permissions have been dropped,
-a reload is not sufficient to open the port again, you must then restart.
+.B control\-use\-cert: \fI<yes or no>
+Whether to require certificate authentication of control connections.
+The default is "yes".
+This should not be changed unless there are other mechanisms in place
+to prevent untrusted users from accessing the remote control
+interface.
.TP 5
-.B server\-key\-file: "<private key file>"
+.B server\-key\-file: \fI<private key file>
Path to the server private key, by default unbound_server.key.
This file is generated by the \fIunbound\-control\-setup\fR utility.
This file is used by the unbound server, but not by \fIunbound\-control\fR.
.TP 5
-.B server\-cert\-file: "<certificate file.pem>"
+.B server\-cert\-file: \fI<certificate file.pem>
Path to the server self signed certificate, by default unbound_server.pem.
This file is generated by the \fIunbound\-control\-setup\fR utility.
This file is used by the unbound server, and also by \fIunbound\-control\fR.
.TP 5
-.B control\-key\-file: "<private key file>"
+.B control\-key\-file: \fI<private key file>
Path to the control client private key, by default unbound_control.key.
This file is generated by the \fIunbound\-control\-setup\fR utility.
This file is used by \fIunbound\-control\fR.
.TP 5
-.B control\-cert\-file: "<certificate file.pem>"
+.B control\-cert\-file: \fI<certificate file.pem>
Path to the control client certificate, by default unbound_control.pem.
This certificate has to be signed with the server certificate.
This file is generated by the \fIunbound\-control\-setup\fR utility.
.TP
.B python\-script: \fI<python file>\fR
The script file to load.
+.SS "DNS64 Module Options"
+.LP
+The dns64 module must be configured in the \fBmodule\-config:\fR "dns64
+validator iterator" directive and be compiled into the daemon to be
+enabled. These settings go in the \fBserver:\fR section.
+.TP
+.B dns64\-prefix: \fI<IPv6 prefix>\fR
+This sets the DNS64 prefix to use to synthesize AAAA records with.
+It must be /96 or shorter. The default prefix is 64:ff9b::/96.
+.TP
+.B dns64\-synthall: \fI<yes or no>\fR
+Debug option, default no. If enabled, synthesize all AAAA records
+despite the presence of actual AAAA records.
.SH "MEMORY CONTROL EXAMPLE"
In the example config settings below memory usage is reduced. Some service
levels are lower, notable very large data and a high TCP load are no longer
-# Doxyfile 1.8.2
+# Doxyfile 1.7.1
# This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for a project.
+# doxygen (www.doxygen.org) for a project
#
-# All text after a hash (#) is considered a comment and will be ignored.
+# All text after a hash (#) is considered a comment and will be ignored
# The format is:
# TAG = value [value, ...]
# For lists items can also be appended using:
# TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (" ").
+# Values that contain spaces should be placed between quotes (" ")
#---------------------------------------------------------------------------
# Project related configuration options
DOXYFILE_ENCODING = UTF-8
-# The PROJECT_NAME tag is a single word (or sequence of words) that should
-# identify the project. Note that if you do not use Doxywizard you need
-# to put quotes around the project name if it contains spaces.
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
PROJECT_NAME = unbound
PROJECT_NUMBER = 0.1
-# Using the PROJECT_BRIEF tag one can provide an optional one line description
-# for a project that appears at the top of each page and should give viewer
-# a quick idea about the purpose of the project. Keep the description short.
-
-PROJECT_BRIEF =
-
-# With the PROJECT_LOGO tag one can specify an logo or icon that is
-# included in the documentation. The maximum height of the logo should not
-# exceed 55 pixels and the maximum width should not exceed 200 pixels.
-# Doxygen will copy the logo to the output directory.
-
-PROJECT_LOGO =
-
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
# If a relative path is entered, it will be relative to the location
# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
-# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak,
+# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak,
# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
OUTPUT_LANGUAGE = English
# only done if one of the specified strings matches the left-hand part of
# the path. The tag can be used to show relative paths in the file list.
# If left blank the directory from which doxygen is run is used as the
-# path to strip. Note that you specify absolute paths here, but also
-# relative paths, which will be relative from the directory where doxygen is
-# started.
+# path to strip.
STRIP_FROM_PATH =
STRIP_FROM_INC_PATH =
# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
-# (but less readable) file names. This can be useful if your file system
+# (but less readable) file names. This can be useful is your file systems
# doesn't support long names like on DOS, Mac, or CD-ROM.
SHORT_NAMES = NO
ALIASES =
-# This tag can be used to specify a number of word-keyword mappings (TCL only).
-# A mapping has the form "name=value". For example adding
-# "class=itcl::class" will allow you to use the command class in the
-# itcl::class meaning.
-
-TCL_SUBST =
-
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
# sources only. Doxygen will then generate output that is more tailored for C.
# For instance, some of the names that are used will be different. The list
OPTIMIZE_OUTPUT_VHDL = NO
# Doxygen selects the parser to use depending on the extension of the files it
-# parses. With this tag you can assign which parser to use for a given
-# extension. Doxygen has a built-in mapping, but you can override or extend it
-# using this tag. The format is ext=language, where ext is a file extension,
-# and language is one of the parsers supported by doxygen: IDL, Java,
-# Javascript, CSharp, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL, C,
-# C++. For instance to make doxygen treat .inc files as Fortran files (default
-# is PHP), and .f files as C (default is Fortran), use: inc=Fortran f=C. Note
-# that for custom extensions you also need to set FILE_PATTERNS otherwise the
-# files are not read by doxygen.
+# parses. With this tag you can assign which parser to use for a given extension.
+# Doxygen has a built-in mapping, but you can override or extend it using this
+# tag. The format is ext=language, where ext is a file extension, and language
+# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C,
+# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make
+# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
+# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions
+# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
EXTENSION_MAPPING =
-# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all
-# comments according to the Markdown format, which allows for more readable
-# documentation. See http://daringfireball.net/projects/markdown/ for details.
-# The output of markdown processing is further processed by doxygen, so you
-# can mix doxygen, HTML, and XML commands with Markdown formatting.
-# Disable only in case of backward compatibilities issues.
-
-MARKDOWN_SUPPORT = YES
-
-# When enabled doxygen tries to link words that correspond to documented classes,
-# or namespaces to their corresponding documentation. Such a link can be
-# prevented in individual cases by by putting a % sign in front of the word or
-# globally by setting AUTOLINK_SUPPORT to NO.
-
-AUTOLINK_SUPPORT = YES
-
# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
# to include (a tag file for) the STL sources as input, then you should
# set this tag to YES in order to let doxygen match functions declarations and
# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
-# func(std::string) {}). This also makes the inheritance and collaboration
+# func(std::string) {}). This also make the inheritance and collaboration
# diagrams that involve STL classes more complete and accurate.
BUILTIN_STL_SUPPORT = NO
SIP_SUPPORT = NO
-# For Microsoft's IDL there are propget and propput attributes to indicate getter and setter methods for a property. Setting this option to YES (the default) will make doxygen replace the get and set methods by a property in the documentation. This will only work if the methods are indeed getting or setting a simple type. If this is not the case, or you want to show the methods anyway, you should set this option to NO.
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
IDL_PROPERTY_SUPPORT = YES
SUBGROUPING = YES
-# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and
-# unions are shown inside the group in which they are included (e.g. using
-# @ingroup) instead of on a separate page (for HTML and Man pages) or
-# section (for LaTeX and RTF).
-
-INLINE_GROUPED_CLASSES = NO
-
-# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and
-# unions with only public data fields will be shown inline in the documentation
-# of the scope in which they are defined (i.e. file, namespace, or group
-# documentation), provided this scope is documented. If set to NO (the default),
-# structs, classes, and unions are shown on a separate page (for HTML and Man
-# pages) or section (for LaTeX and RTF).
-
-INLINE_SIMPLE_STRUCTS = NO
-
# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
# is documented as struct, union, or enum with the name of the typedef. So
# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
# For small to medium size projects (<1000 input files) the default value is
# probably good enough. For larger projects a too small cache size can cause
# doxygen to be busy swapping symbols to and from disk most of the time
-# causing a significant performance penalty.
+# causing a significant performance penality.
# If the system has enough physical memory increasing the cache will improve the
# performance by keeping more symbols in memory. Note that the value works on
-# a logarithmic scale so increasing the size by one will roughly double the
+# a logarithmic scale so increasing the size by one will rougly double the
# memory usage. The cache size is given by this formula:
# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
-# corresponding to a cache size of 2^16 = 65536 symbols.
-
-SYMBOL_CACHE_SIZE = 0
-
-# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be
-# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given
-# their name and scope. Since this can be an expensive process and often the
-# same symbol appear multiple times in the code, doxygen keeps a cache of
-# pre-resolved symbols. If the cache is too small doxygen will become slower.
-# If the cache is too large, memory is wasted. The cache size is given by this
-# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0,
-# corresponding to a cache size of 2^16 = 65536 symbols.
+# corresponding to a cache size of 2^16 = 65536 symbols
-LOOKUP_CACHE_SIZE = 0
+#SYMBOL_CACHE_SIZE = 0
#---------------------------------------------------------------------------
# Build related configuration options
EXTRACT_PRIVATE = YES
-# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal
-# scope will be included in the documentation.
-
-EXTRACT_PACKAGE = NO
-
# If the EXTRACT_STATIC tag is set to YES all static members of a file
# will be included in the documentation.
# extracted and appear in the documentation as a namespace called
# 'anonymous_namespace{file}', where file will be replaced with the base
# name of the file that contains the anonymous namespace. By default
-# anonymous namespaces are hidden.
+# anonymous namespace are hidden.
EXTRACT_ANON_NSPACES = NO
SORT_BY_SCOPE_NAME = NO
-# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to
-# do proper type resolution of all parameters of a function it will reject a
-# match between the prototype and the implementation of a member function even
-# if there is only one candidate or it is obvious which candidate to choose
-# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen
-# will still accept a match between prototype and implementation in such cases.
-
-STRICT_PROTO_MATCHING = NO
-
# The GENERATE_TODOLIST tag can be used to enable (YES) or
# disable (NO) the todo list. This list is created by putting \todo
# commands in the documentation.
ENABLED_SECTIONS =
# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
-# the initial value of a variable or macro consists of for it to appear in
+# the initial value of a variable or define consists of for it to appear in
# the documentation. If the initializer consists of more lines than specified
# here it will be hidden. Use a value of 0 to hide initializers completely.
-# The appearance of the initializer of individual variables and macros in the
+# The appearance of the initializer of individual variables and defines in the
# documentation can be controlled using \showinitializer or \hideinitializer
# command in the documentation regardless of this setting.
# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
# by doxygen. The layout file controls the global structure of the generated
-# output files in an output format independent way. To create the layout file
+# output files in an output format independent way. The create the layout file
# that represents doxygen's defaults, run doxygen with the -l option.
# You can optionally specify a file name after the option, if omitted
# DoxygenLayout.xml will be used as the name of the layout file.
LAYOUT_FILE =
-# The CITE_BIB_FILES tag can be used to specify one or more bib files
-# containing the references data. This must be a list of .bib files. The
-# .bib extension is automatically appended if omitted. Using this command
-# requires the bibtex tool to be installed. See also
-# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style
-# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this
-# feature you need bibtex and perl available in the search path.
-
-CITE_BIB_FILES =
-
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
WARN_IF_DOC_ERROR = YES
-# The WARN_NO_PARAMDOC option can be enabled to get warnings for
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
# functions that are documented, but have no documentation for their parameters
# or return value. If set to NO (the default) doxygen will only warn about
# wrong or incomplete parameter documentation, but not about the absence of
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
# and *.h) to filter out the source-files in the directories. If left
# blank the following patterns are tested:
-# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh
-# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py
-# *.f90 *.f *.for *.vhd *.vhdl
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
FILE_PATTERNS =
RECURSIVE = YES
-# The EXCLUDE tag can be used to specify files and/or directories that should be
+# The EXCLUDE tag can be used to specify files and/or directories that should
# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
-# Note that relative paths are relative to the directory from which doxygen is
-# run.
EXCLUDE = ./build \
./compat \
libunbound/python/libunbound_wrap.c \
./ldns-src
-# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
-# directories that are symbolic links (a Unix file system feature) are excluded
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
# from the input.
EXCLUDE_SYMLINKS = NO
# filter if there is a match.
# The filters are a list of the form:
# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
-# info on how filters are used. If FILTER_PATTERNS is empty or if
-# non of the patterns match the file name, INPUT_FILTER is applied.
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
-# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
-# pattern. A pattern will override the setting for FILTER_PATTERN (if any)
-# and it is also possible to disable source filtering for a specific pattern
-# using *.ext= (so without naming a filter). This option only has effect when
-# FILTER_SOURCE_FILES is enabled.
-
-FILTER_SOURCE_PATTERNS =
-
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
# doxygen to hide any special comment blocks from generated source code
-# fragments. Normal C, C++ and Fortran comments will always remain visible.
+# fragments. Normal C and C++ comments will always remain visible.
STRIP_CODE_COMMENTS = YES
# The HTML_HEADER tag can be used to specify a personal HTML header for
# each generated HTML page. If it is left blank doxygen will generate a
-# standard header. Note that when using a custom header you are responsible
-# for the proper inclusion of any scripts and style sheets that doxygen
-# needs, which is dependent on the configuration options used.
-# It is advised to generate a default header using "doxygen -w html
-# header.html footer.html stylesheet.css YourConfigFile" and then modify
-# that header. Note that the header is subject to change so you typically
-# have to redo this when upgrading to a newer version of doxygen or when
-# changing the value of configuration settings such as GENERATE_TREEVIEW!
+# standard header.
HTML_HEADER =
HTML_FOOTER =
+# If the HTML_TIMESTAMP tag is set to YES then the generated HTML
+# documentation will contain the timesstamp.
+
+HTML_TIMESTAMP = NO
+
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
# style sheet that is used by each HTML page. It can be used to
-# fine-tune the look of the HTML output. If left blank doxygen will
-# generate a default style sheet. Note that it is recommended to use
-# HTML_EXTRA_STYLESHEET instead of this one, as it is more robust and this
-# tag will in the future become obsolete.
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
HTML_STYLESHEET =
-# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional
-# user-defined cascading style sheet that is included after the standard
-# style sheets created by doxygen. Using this option one can overrule
-# certain style aspects. This is preferred over using HTML_STYLESHEET
-# since it does not replace the standard style sheet and is therefor more
-# robust against future updates. Doxygen will copy the style sheet file to
-# the output directory.
-
-HTML_EXTRA_STYLESHEET =
-
-# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
-# other source files which should be copied to the HTML output directory. Note
-# that these files will be copied to the base HTML output directory. Use the
-# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
-# files. In the HTML_STYLESHEET file, use the file name only. Also note that
-# the files will be copied as-is; there are no commands or markers available.
-
-HTML_EXTRA_FILES =
-
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
-# Doxygen will adjust the colors in the style sheet and background images
+# Doxygen will adjust the colors in the stylesheet and background images
# according to this color. Hue is specified as an angle on a colorwheel,
# see http://en.wikipedia.org/wiki/Hue for more information.
# For instance the value 0 represents red, 60 is yellow, 120 is green,
# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
# The allowed range is 0 to 359.
-HTML_COLORSTYLE_HUE = 220
+#HTML_COLORSTYLE_HUE = 220
# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
# the colors in the HTML output. For a value of 0 the output will use
# grayscales only. A value of 255 will produce the most vivid colors.
-HTML_COLORSTYLE_SAT = 100
+#HTML_COLORSTYLE_SAT = 100
# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
# the luminance component of the colors in the HTML output. Values below
# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
# and 100 does not change the gamma.
-HTML_COLORSTYLE_GAMMA = 80
+#HTML_COLORSTYLE_GAMMA = 80
# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
# page will contain the date and time when the page was generated. Setting
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the
-# page has loaded.
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
HTML_DYNAMIC_SECTIONS = NO
-# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of
-# entries shown in the various tree structured indices initially; the user
-# can expand and collapse entries dynamically later on. Doxygen will expand
-# the tree to such a level that at most the specified number of entries are
-# visible (unless a fully collapsed tree already exceeds this amount).
-# So setting the number of entries 1 will produce a full collapsed tree by
-# default. 0 is a special value representing an infinite number of entries
-# and will result in a full expanded tree by default.
-
-HTML_INDEX_NUM_ENTRIES = 100
-
# If the GENERATE_DOCSET tag is set to YES, additional index files
# will be generated that can be used as input for Apple's Xcode 3
# integrated development environment, introduced with OSX 10.5 (Leopard).
DOCSET_BUNDLE_ID = org.doxygen.Project
-# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely
-# identify the documentation publisher. This should be a reverse domain-name
-# style string, e.g. com.mycompany.MyDocSet.documentation.
+# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
-DOCSET_PUBLISHER_ID = org.doxygen.Publisher
+#DOCSET_PUBLISHER_ID = org.doxygen.Publisher
# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
-DOCSET_PUBLISHER_NAME = Publisher
+#DOCSET_PUBLISHER_NAME = Publisher
# If the GENERATE_HTMLHELP tag is set to YES, additional index files
# will be generated that can be used as input for tools like the
ECLIPSE_DOC_ID = org.doxygen.Project
-# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs)
-# at top of each HTML page. The value NO (the default) enables the index and
-# the value YES disables it. Since the tabs have the same information as the
-# navigation tree you can set this option to NO if you already set
-# GENERATE_TREEVIEW to YES.
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
DISABLE_INDEX = NO
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 4
+
# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
# structure should be generated to display hierarchical information.
# If the tag value is set to YES, a side panel will be generated
# is generated for HTML Help). For this to work a browser that supports
# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
# Windows users are probably better off using the HTML help feature.
-# Since the tree basically has the same information as the tab index you
-# could consider to set DISABLE_INDEX to NO when enabling this option.
GENERATE_TREEVIEW = NO
-# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
-# (range [0,1..20]) that doxygen will group on one line in the generated HTML
-# documentation. Note that a value of 0 will completely suppress the enum
-# values from appearing in the overview section.
+# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list.
#USE_INLINE_TREES = NO
# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
# links to external symbols imported via tag files in a separate window.
-EXT_LINKS_IN_WINDOW = NO
+#EXT_LINKS_IN_WINDOW = NO
# Use this tag to change the font size of Latex formulas included
# as images in the HTML documentation. The default is 10. Note that
# Note that when changing this option you need to delete any form_*.png files
# in the HTML output before the changes have effect.
-FORMULA_TRANSPARENT = YES
-
-# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax
-# (see http://www.mathjax.org) which uses client side Javascript for the
-# rendering instead of using prerendered bitmaps. Use this if you do not
-# have LaTeX installed or if you want to formulas look prettier in the HTML
-# output. When enabled you may also need to install MathJax separately and
-# configure the path to it using the MATHJAX_RELPATH option.
-
-USE_MATHJAX = NO
-
-# When MathJax is enabled you need to specify the location relative to the
-# HTML output directory using the MATHJAX_RELPATH option. The destination
-# directory should contain the MathJax.js script. For instance, if the mathjax
-# directory is located at the same level as the HTML output directory, then
-# MATHJAX_RELPATH should be ../mathjax. The default value points to
-# the MathJax Content Delivery Network so you can quickly see the result without
-# installing MathJax.
-# However, it is strongly recommended to install a local
-# copy of MathJax from http://www.mathjax.org before deployment.
-
-MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
-
-# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension
-# names that should be enabled during MathJax rendering.
-
-MATHJAX_EXTENSIONS =
+#FORMULA_TRANSPARENT = YES
# When the SEARCHENGINE tag is enabled doxygen will generate a search box
# for the HTML output. The underlying search engine uses javascript
# using Javascript. Doxygen will generate the search PHP script and index
# file to put on the web server. The advantage of the server
# based approach is that it scales better to large projects and allows
-# full text search. The disadvantages are that it is more difficult to setup
+# full text search. The disadvances is that it is more difficult to setup
# and does not have live searching capabilities.
SERVER_BASED_SEARCH = NO
COMPACT_LATEX = NO
# The PAPER_TYPE tag can be used to set the paper type that is used
-# by the printer. Possible values are: a4, letter, legal and
+# by the printer. Possible values are: a4, a4wide, letter, legal and
# executive. If left blank a4wide will be used.
PAPER_TYPE = a4wide
LATEX_HEADER =
-# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for
-# the generated latex document. The footer should contain everything after
-# the last chapter. If it is left blank doxygen will generate a
-# standard footer. Notice: only use this tag if you know what you are doing!
-
-LATEX_FOOTER =
-
# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
# is prepared for conversion to pdf (using ps2pdf). The pdf file will
# contain links (just like the HTML output) instead of page references
LATEX_SOURCE_CODE = NO
-# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
-# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See
-# http://en.wikipedia.org/wiki/BibTeX for more info.
-
-LATEX_BIB_STYLE = plain
-
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
RTF_HYPERLINKS = NO
-# Load style sheet definitions from file. Syntax is similar to doxygen's
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
# config file, i.e. a series of assignments. You only have to provide
# replacements, missing definitions are set to their default value.
# which can be used by a validating XML parser to check the
# syntax of the XML files.
-XML_SCHEMA =
+#XML_SCHEMA =
# The XML_DTD tag can be used to specify an XML DTD,
# which can be used by a validating XML parser to check the
# syntax of the XML files.
-XML_DTD =
+#XML_DTD =
# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
# dump the program listings (including syntax highlighting
EXPAND_ONLY_PREDEF = YES
# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
-# pointed to by INCLUDE_PATH will be searched when a #include is found.
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
SEARCH_INCLUDES = YES
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded.
# The macro definition that is found in the sources will be used.
-# Use the PREDEFINED tag if you want to use a different macro definition that
-# overrules the definition found in the source code.
+# Use the PREDEFINED tag if you want to use a different macro definition.
EXPAND_AS_DEFINED = ATTR_UNUSED
# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
-# doxygen's preprocessor will remove all references to function-like macros
-# that are alone on a line, have an all uppercase name, and do not end with a
-# semicolon, because these will confuse the parser if not removed.
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
SKIP_FUNCTION_MACROS = YES
# Configuration::additions related to external references
#---------------------------------------------------------------------------
-# The TAGFILES option can be used to specify one or more tagfiles. For each
-# tag file the location of the external documentation should be added. The
-# format of a tag file without this location is as follows:
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
#
# TAGFILES = file1 file2 ...
# Adding location for the tag files is done as follows:
#
# TAGFILES = file1=loc1 "file2 = loc2" ...
-# where "loc1" and "loc2" can be relative or absolute paths
-# or URLs. Note that each tag file must have a unique name (where the name does
-# NOT include the path). If a tag file is not located in the directory in which
-# doxygen is run, you must also specify the path to the tagfile here.
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
TAGFILES =
# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
# or super classes. Setting the tag to NO turns the diagrams off. Note that
-# this option also works with HAVE_DOT disabled, but it is recommended to
-# install and use dot, since it yields more powerful graphs.
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
CLASS_DIAGRAMS = YES
# explicitly to a value larger than 0 to get control over the balance
# between CPU load and processing speed.
-DOT_NUM_THREADS = 0
+#DOT_NUM_THREADS = 0
-# By default doxygen will use the Helvetica font for all dot files that
-# doxygen generates. When you want a differently looking font you can specify
-# the font name using DOT_FONTNAME. You need to make sure dot is able to find
-# the font, which can be done by putting it in a standard location or by setting
-# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
-# directory containing the font.
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
-DOT_FONTNAME = FreeSans.ttf
+#DOT_FONTNAME = FreeSans.ttf
# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
# The default size is 10pt.
DOT_FONTSIZE = 10
-# By default doxygen will tell dot to use the Helvetica font.
-# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to
-# set the path where dot can find it.
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
DOT_FONTPATH =
# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for each documented class showing the direct and
# indirect inheritance relations. Setting this tag to YES will force the
-# CLASS_DIAGRAMS tag to NO.
+# the CLASS_DIAGRAMS tag to NO.
CLASS_GRAPH = YES
UML_LOOK = NO
-# If the UML_LOOK tag is enabled, the fields and methods are shown inside
-# the class node. If there are many fields or methods and many nodes the
-# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS
-# threshold limits the number of items for each type to make the size more
-# managable. Set this to 0 for no limit. Note that the threshold may be
-# exceeded by 50% before the limit is enforced.
-
-UML_LIMIT_NUM_FIELDS = 10
-
# If set to YES, the inheritance and collaboration graphs will show the
# relations between templates and their instances.
CALLER_GRAPH = NO
# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
-# will generate a graphical hierarchy of all classes instead of a textual one.
+# will graphical hierarchy of all classes instead of a textual one.
GRAPHICAL_HIERARCHY = YES
-# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
# then doxygen will show the dependencies a directory has on other directories
# in a graphical way. The dependency relations are determined by the #include
# relations between the files in the directories.
DIRECTORY_GRAPH = YES
# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
-# generated by dot. Possible values are svg, png, jpg, or gif.
-# If left blank png will be used. If you choose svg you need to set
-# HTML_FILE_EXTENSION to xhtml in order to make the SVG files
-# visible in IE 9+ (other browsers do not have this requirement).
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
DOT_IMAGE_FORMAT = png
-# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
-# enable generation of interactive SVG images that allow zooming and panning.
-# Note that this requires a modern browser other than Internet Explorer.
-# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you
-# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files
-# visible. Older versions of IE do not have SVG support.
-
-INTERACTIVE_SVG = NO
-
# The tag DOT_PATH can be used to specify the path where the dot tool can be
# found. If left blank, it is assumed the dot tool can be found in the path.
DOTFILE_DIRS =
-# The MSCFILE_DIRS tag can be used to specify one or more directories that
-# contain msc files that are included in the documentation (see the
-# \mscfile command).
-
-MSCFILE_DIRS =
-
# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
# nodes that will be shown in the graph. If the number of nodes in a graph
# becomes larger than this value, doxygen will truncate the graph, which is
/** We already calculated hash upon lookup */
hashvalue_t h = qstate->minfo[id] ?
((struct subnet_qstate*)qstate->minfo[id])->qinfo_hash :
- query_info_hash(&qstate->qinfo);
+ query_info_hash(&qstate->qinfo, qstate->query_flags);
/** Step 1, general qinfo lookup */
struct lruhash_entry *lru_entry = slabhash_lookup(subnet_msg_cache, h, &qstate->qinfo, 1);
int acquired_lock = (lru_entry != NULL);
edns->subnet_source_mask,
qstate->edns_server_in.subnet_scope_mask, rep, rep->ttl + *qstate->env->now,
*qstate->env->now);
- if (acquired_lock)
+ if (acquired_lock) {
lock_rw_unlock(&lru_entry->lock);
- slabhash_insert(subnet_msg_cache, h, lru_entry, lru_entry->data, NULL);
+ } else {
+ slabhash_insert(subnet_msg_cache, h, lru_entry, lru_entry->data, NULL);
+ }
}
-
/* return true iff reply is sent. */
int
lookup_and_reply(struct module_qstate *qstate, int id)
struct module_env *env = qstate->env;
struct subnet_env *sne = (struct subnet_env*)env->modinfo[id];
struct subnet_qstate *iq = (struct subnet_qstate*)qstate->minfo[id];
- hashvalue_t h = query_info_hash(&qstate->qinfo);
+ hashvalue_t h = query_info_hash(&qstate->qinfo, qstate->query_flags);
struct subnet_msg_cache_data *data;
struct edns_data *edns = &qstate->edns_client_in;
struct addrtree *tree;
#include "util/data/packed_rrset.h"
#include "util/data/msgreply.h"
#include "util/net_help.h"
-#include "ldns/rrdef.h"
-#include "ldns/sbuffer.h"
+#include "sldns/rrdef.h"
+#include "sldns/sbuffer.h"
struct delegpt*
delegpt_create(struct regional* region)
{
struct delegpt_addr* p = dp->target_list;
while(p) {
- if(sockaddr_cmp_addr(addr, addrlen, &p->addr, p->addrlen)==0) {
+ if(sockaddr_cmp_addr(addr, addrlen, &p->addr, p->addrlen)==0
+ && ((struct sockaddr_in*)addr)->sin_port ==
+ ((struct sockaddr_in*)&p->addr)->sin_port) {
return p;
}
p = p->next_target;
#include "util/config_file.h"
#include "util/net_help.h"
#include "util/data/dname.h"
-#include "ldns/rrdef.h"
-#include "ldns/str2wire.h"
+#include "sldns/rrdef.h"
+#include "sldns/str2wire.h"
int
fwd_cmp(const void* k1, const void* k2)
#include "util/config_file.h"
#include "util/net_help.h"
#include "util/data/dname.h"
-#include "ldns/rrdef.h"
-#include "ldns/str2wire.h"
-#include "ldns/wire2str.h"
+#include "sldns/rrdef.h"
+#include "sldns/str2wire.h"
+#include "sldns/wire2str.h"
struct iter_hints*
hints_create(void)
}
if(do_ip6) {
if(!ah(dp, "A.ROOT-SERVERS.NET.", "2001:503:ba3e::2:30")) goto failed;
+ if(!ah(dp, "B.ROOT-SERVERS.NET.", "2001:500:84::b")) goto failed;
if(!ah(dp, "C.ROOT-SERVERS.NET.", "2001:500:2::c")) goto failed;
if(!ah(dp, "D.ROOT-SERVERS.NET.", "2001:500:2d::d")) goto failed;
if(!ah(dp, "F.ROOT-SERVERS.NET.", "2001:500:2f::f")) goto failed;
#include "util/data/msgparse.h"
#include "util/net_help.h"
#include "util/storage/dnstree.h"
-#include "ldns/str2wire.h"
-#include "ldns/sbuffer.h"
+#include "sldns/str2wire.h"
+#include "sldns/sbuffer.h"
struct iter_priv* priv_create(void)
{
#include "services/cache/dns.h"
#include "util/net_help.h"
#include "util/data/dname.h"
-#include "ldns/rrdef.h"
-#include "ldns/pkthdr.h"
+#include "sldns/rrdef.h"
+#include "sldns/pkthdr.h"
enum response_type
response_type_from_cache(struct dns_msg* msg,
#include "util/data/dname.h"
#include "util/data/msgreply.h"
#include "util/alloc.h"
-#include "ldns/sbuffer.h"
+#include "sldns/sbuffer.h"
/** RRset flag used during scrubbing. The RRset is OK. */
#define RRSET_SCRUB_OK 0x80
* (we dont want its glue that was approved
* during the normalize action) */
del_addi = 1;
- } else if(!env->cfg->harden_glue) {
+ } else if(!env->cfg->harden_glue && (
+ rrset->type == LDNS_RR_TYPE_A ||
+ rrset->type == LDNS_RR_TYPE_AAAA)) {
/* store in cache! Since it is relevant
* (from normalize) it will be picked up
* from the cache to be used later */
#include "validator/val_kentry.h"
#include "validator/val_utils.h"
#include "validator/val_sigcrypt.h"
-#include "ldns/sbuffer.h"
+#include "sldns/sbuffer.h"
/** time when nameserver glue is said to be 'recent' */
#define SUSPICION_RECENT_EXPIRY 86400
void
iter_dns_store(struct module_env* env, struct query_info* msgqinf,
struct reply_info* msgrep, int is_referral, time_t leeway, int pside,
- struct regional* region)
+ struct regional* region, uint16_t flags)
{
if(!dns_cache_store(env, msgqinf, msgrep, is_referral, leeway,
- pside, region))
+ pside, region, flags))
log_err("out of memory: cannot store data in cache");
}
fptr_ok(fptr_whitelist_modenv_detect_cycle(
qstate->env->detect_cycle));
return (*qstate->env->detect_cycle)(qstate, &qinf,
- (uint16_t)(BIT_RD|BIT_CD), qstate->is_priming);
+ (uint16_t)(BIT_RD|BIT_CD), qstate->is_priming,
+ qstate->is_valrec);
}
void
k1->rk.rrset_class != k2->rk.rrset_class ||
query_dname_compare(k1->rk.dname, k2->rk.dname) != 0)
return 0;
- if(d1->ttl != d2->ttl ||
+ if( /* do not check ttl: d1->ttl != d2->ttl || */
d1->count != d2->count ||
d1->rrsig_count != d2->rrsig_count ||
d1->trust != d2->trust ||
t = d1->count + d1->rrsig_count;
for(i=0; i<t; i++) {
if(d1->rr_len[i] != d2->rr_len[i] ||
- d1->rr_ttl[i] != d2->rr_ttl[i] ||
+ /* no ttl check: d1->rr_ttl[i] != d2->rr_ttl[i] ||*/
memcmp(d1->rr_data[i], d2->rr_data[i],
d1->rr_len[i]) != 0)
return 0;
size_t i;
if(p->flags != q->flags ||
p->qdcount != q->qdcount ||
+ /* do not check TTL, this may differ */
+ /*
p->ttl != q->ttl ||
p->prefetch_ttl != q->prefetch_ttl ||
+ */
p->security != q->security ||
p->an_numrrsets != q->an_numrrsets ||
p->ns_numrrsets != q->ns_numrrsets ||
return 1;
}
+void
+caps_strip_reply(struct reply_info* rep)
+{
+ size_t i;
+ if(!rep) return;
+ /* see if message is a referral, in which case the additional and
+ * NS record cannot be removed */
+ /* referrals have the AA flag unset (strict check, not elsewhere in
+ * unbound, but for 0x20 this is very convenient). */
+ if(!(rep->flags&BIT_AA))
+ return;
+ /* remove the additional section from the reply */
+ if(rep->ar_numrrsets != 0) {
+ verbose(VERB_ALGO, "caps fallback: removing additional section");
+ rep->rrset_count -= rep->ar_numrrsets;
+ rep->ar_numrrsets = 0;
+ }
+ /* is there an NS set in the authority section to remove? */
+ /* the failure case (Cisco firewalls) only has one rrset in authsec */
+ for(i=rep->an_numrrsets; i<rep->an_numrrsets+rep->ns_numrrsets; i++) {
+ struct ub_packed_rrset_key* s = rep->rrsets[i];
+ if(ntohs(s->rk.type) == LDNS_RR_TYPE_NS) {
+ /* remove NS rrset and break from loop (loop limits
+ * have changed) */
+ /* move last rrset into this position (there is no
+ * additional section any more) */
+ verbose(VERB_ALGO, "caps fallback: removing NS rrset");
+ if(i < rep->rrset_count-1)
+ rep->rrsets[i]=rep->rrsets[rep->rrset_count-1];
+ rep->rrset_count --;
+ rep->ns_numrrsets --;
+ break;
+ }
+ }
+}
+
+int caps_failed_rcode(struct reply_info* rep)
+{
+ return !(FLAGS_GET_RCODE(rep->flags) == LDNS_RCODE_NOERROR ||
+ FLAGS_GET_RCODE(rep->flags) == LDNS_RCODE_NXDOMAIN);
+}
+
void
iter_store_parentside_rrset(struct module_env* env,
struct ub_packed_rrset_key* rrset)
* @param pside: true if dp is parentside, thus message is 'fresh' and NS
* can be prefetch-updates.
* @param region: to copy modified (cache is better) rrs back to.
+ * @param flags: with BIT_CD for dns64 AAAA translated queries.
* @return void, because we are not interested in alloc errors,
* the iterator and validator can operate on the results in their
* scratch space (the qstate.region) and are not dependent on the cache.
*/
void iter_dns_store(struct module_env* env, struct query_info* qinf,
struct reply_info* rep, int is_referral, time_t leeway, int pside,
- struct regional* region);
+ struct regional* region, uint16_t flags);
/**
* Select randomly with n/m probability.
*/
int reply_equal(struct reply_info* p, struct reply_info* q, struct regional* region);
+/**
+ * Remove unused bits from the reply if possible.
+ * So that caps-for-id (0x20) fallback is more likely to be successful.
+ * This removes like, the additional section, and NS record in the authority
+ * section if those records are gratuitous (not for a referral).
+ * @param rep: the reply to strip stuff out of.
+ */
+void caps_strip_reply(struct reply_info* rep);
+
+/**
+ * see if reply has a 'useful' rcode for capsforid comparison, so
+ * not SERVFAIL or REFUSED, and thus NOERROR or NXDOMAIN.
+ * @param rep: reply to check.
+ * @return true if the rcode is a bad type of message.
+ */
+int caps_failed_rcode(struct reply_info* rep);
+
/**
* Store parent-side rrset in seperate rrset cache entries for later
* last-resort * lookups in case the child-side versions of this information
#include "util/data/msgencode.h"
#include "util/fptr_wlist.h"
#include "util/config_file.h"
-#include "ldns/rrdef.h"
-#include "ldns/wire2str.h"
-#include "ldns/parseutil.h"
-#include "ldns/sbuffer.h"
+#include "util/random.h"
+#include "sldns/rrdef.h"
+#include "sldns/wire2str.h"
+#include "sldns/parseutil.h"
+#include "sldns/sbuffer.h"
int
iter_init(struct module_env* env, int id)
iq->query_restart_count = 0;
iq->referral_count = 0;
iq->sent_count = 0;
+ iq->ratelimit_ok = 0;
+ iq->target_count = NULL;
iq->wait_priming_stub = 0;
iq->refetch_glue = 0;
iq->dnssec_expected = 0;
verbose(VERB_ALGO, "error response for prefetch in cache");
/* attempt to adjust the cache entry prefetch */
if(dns_cache_prefetch_adjust(qstate->env, &qstate->qinfo,
- NORR_TTL))
+ NORR_TTL, qstate->query_flags))
return error_response(qstate, id, rcode);
/* if that fails (not in cache), fall through to store err */
}
/* do not waste time trying to validate this servfail */
err.security = sec_status_indeterminate;
verbose(VERB_ALGO, "store error response in message cache");
- iter_dns_store(qstate->env, &qstate->qinfo, &err, 0, 0, 0, NULL);
+ iter_dns_store(qstate->env, &qstate->qinfo, &err, 0, 0, 0, NULL,
+ qstate->query_flags);
return error_response(qstate, id, rcode);
}
if(num_an + num_ns == 0)
return 1;
verbose(VERB_ALGO, "prepending %d rrsets", (int)num_an + (int)num_ns);
+ if(num_an > RR_COUNT_MAX || num_ns > RR_COUNT_MAX ||
+ msg->rep->rrset_count > RR_COUNT_MAX) return 0; /* overflow */
sets = regional_alloc(region, (num_an+num_ns+msg->rep->rrset_count) *
sizeof(struct ub_packed_rrset_key*));
if(!sets)
return 1;
}
+/** create target count structure for this query */
+static void
+target_count_create(struct iter_qstate* iq)
+{
+ if(!iq->target_count) {
+ iq->target_count = (int*)calloc(2, sizeof(int));
+ /* if calloc fails we simply do not track this number */
+ if(iq->target_count)
+ iq->target_count[0] = 1;
+ }
+}
+
+static void
+target_count_increase(struct iter_qstate* iq, int num)
+{
+ target_count_create(iq);
+ if(iq->target_count)
+ iq->target_count[1] += num;
+}
+
/**
* Generate a subrequest.
* Generate a local request event. Local events are tied to this module, and
uint16_t qflags = 0; /* OPCODE QUERY, no flags */
struct query_info qinf;
int prime = (finalstate == PRIME_RESP_STATE)?1:0;
+ int valrec = 0;
qinf.qname = qname;
qinf.qname_len = qnamelen;
qinf.qtype = qtype;
* the resolution chain, which might have a validator. We are
* uninterested in validating things not on the direct resolution
* path. */
- if(!v)
+ if(!v) {
qflags |= BIT_CD;
+ valrec = 1;
+ }
/* attach subquery, lookup existing or make a new one */
fptr_ok(fptr_whitelist_modenv_attach_sub(qstate->env->attach_sub));
- if(!(*qstate->env->attach_sub)(qstate, &qinf, qflags, prime, &subq)) {
+ if(!(*qstate->env->attach_sub)(qstate, &qinf, qflags, prime, valrec,
+ &subq)) {
return 0;
}
*subq_ret = subq;
subiq = (struct iter_qstate*)subq->minfo[id];
memset(subiq, 0, sizeof(*subiq));
subiq->num_target_queries = 0;
+ target_count_create(iq);
+ subiq->target_count = iq->target_count;
+ if(iq->target_count)
+ iq->target_count[0] ++; /* extra reference */
subiq->num_current_queries = 0;
subiq->depth = iq->depth+1;
outbound_list_init(&subiq->outlist);
} else {
msg = dns_cache_lookup(qstate->env, iq->qchase.qname,
iq->qchase.qname_len, iq->qchase.qtype,
- iq->qchase.qclass, qstate->region, qstate->env->scratch);
+ iq->qchase.qclass, qstate->query_flags,
+ qstate->region, qstate->env->scratch);
if(!msg && qstate->env->neg_cache) {
/* lookup in negative cache; may result in
* NOERROR/NODATA or NXDOMAIN answers that need validation */
* results of priming. */
return 0;
}
+ if(!iq->ratelimit_ok && qstate->prefetch_leeway)
+ iq->ratelimit_ok = 1; /* allow prefetches, this keeps
+ otherwise valid data in the cache */
+ if(!iq->ratelimit_ok && infra_ratelimit_exceeded(
+ qstate->env->infra_cache, iq->dp->name,
+ iq->dp->namelen, *qstate->env->now)) {
+ /* and increment the rate, so that the rate for time
+ * now will also exceed the rate, keeping cache fresh */
+ (void)infra_ratelimit_inc(qstate->env->infra_cache,
+ iq->dp->name, iq->dp->namelen,
+ *qstate->env->now);
+ /* see if we are passed through with slip factor */
+ if(qstate->env->cfg->ratelimit_factor != 0 &&
+ ub_random_max(qstate->env->rnd,
+ qstate->env->cfg->ratelimit_factor) == 1) {
+ iq->ratelimit_ok = 1;
+ log_nametypeclass(VERB_ALGO, "ratelimit allowed through for "
+ "delegation point", iq->dp->name,
+ LDNS_RR_TYPE_NS, LDNS_RR_CLASS_IN);
+ } else {
+ log_nametypeclass(VERB_ALGO, "ratelimit exceeded with "
+ "delegation point", iq->dp->name,
+ LDNS_RR_TYPE_NS, LDNS_RR_CLASS_IN);
+ return error_response(qstate, id, LDNS_RCODE_SERVFAIL);
+ }
+ }
/* see if this dp not useless.
* It is useless if:
if(iq->depth == ie->max_dependency_depth)
return 0;
+ if(iq->depth > 0 && iq->target_count &&
+ iq->target_count[1] > MAX_TARGET_COUNT) {
+ char s[LDNS_MAX_DOMAINLEN+1];
+ dname_str(qstate->qinfo.qname, s);
+ verbose(VERB_QUERY, "request %s has exceeded the maximum "
+ "number of glue fetches %d", s, iq->target_count[1]);
+ return 0;
+ }
iter_mark_cycle_targets(qstate, iq->dp);
missing = (int)delegpt_count_missing_targets(iq->dp);
return error_response(qstate, id, LDNS_RCODE_SERVFAIL);
}
iq->num_target_queries += qs;
+ target_count_increase(iq, qs);
if(qs != 0) {
qstate->ext_state[id] = module_wait_subquery;
return 0; /* and wait for them */
verbose(VERB_QUERY, "maxdepth and need more nameservers, fail");
return error_response_cache(qstate, id, LDNS_RCODE_SERVFAIL);
}
+ if(iq->depth > 0 && iq->target_count &&
+ iq->target_count[1] > MAX_TARGET_COUNT) {
+ char s[LDNS_MAX_DOMAINLEN+1];
+ dname_str(qstate->qinfo.qname, s);
+ verbose(VERB_QUERY, "request %s has exceeded the maximum "
+ "number of glue fetches %d", s, iq->target_count[1]);
+ return error_response_cache(qstate, id, LDNS_RCODE_SERVFAIL);
+ }
/* mark cycle targets for parent-side lookups */
iter_mark_pside_cycle_targets(qstate, iq->dp);
/* see if we can issue queries to get nameserver addresses */
if(query_count != 0) { /* suspend to await results */
verbose(VERB_ALGO, "try parent-side glue lookup");
iq->num_target_queries += query_count;
+ target_count_increase(iq, query_count);
qstate->ext_state[id] = module_wait_subquery;
return 0;
}
return error_response(qstate, id, LDNS_RCODE_SERVFAIL);
}
iq->num_target_queries += extra;
+ target_count_increase(iq, extra);
if(iq->num_target_queries > 0) {
/* wait to get all targets, we want to try em */
verbose(VERB_ALGO, "wait for all targets for fallback");
* the original query is one that matched too, so we have
* caps_server+1 number of matching queries now */
if(iq->caps_server+1 >= naddr*3 ||
- iq->caps_server+1 >= MAX_SENT_COUNT) {
+ iq->caps_server*2+2 >= MAX_SENT_COUNT) {
+ /* *2 on sentcount check because ipv6 may fail */
/* we're done, process the response */
verbose(VERB_ALGO, "0x20 fallback had %d responses "
"match for %d wanted, done.",
(int)iq->caps_server+1, (int)naddr*3);
+ iq->response = iq->caps_response;
iq->caps_fallback = 0;
iter_dec_attempts(iq->dp, 3); /* space for fallback */
iq->num_current_queries++; /* RespState decrements it*/
/* errors ignored, these targets are not strictly necessary for
* this result, we do not have to reply with SERVFAIL */
iq->num_target_queries += extra;
+ target_count_increase(iq, extra);
}
/* Add the current set of unused targets to our queue. */
return 1;
}
iq->num_target_queries += qs;
+ target_count_increase(iq, qs);
}
/* Since a target query might have been made, we
* need to check again. */
if(iq->num_target_queries == 0) {
+ /* if in capsforid fallback, instead of last
+ * resort, we agree with the current reply
+ * we have (if any) (our count of addrs bad)*/
+ if(iq->caps_fallback && iq->caps_reply) {
+ /* we're done, process the response */
+ verbose(VERB_ALGO, "0x20 fallback had %d responses, "
+ "but no more servers except "
+ "last resort, done.",
+ (int)iq->caps_server+1);
+ iq->response = iq->caps_response;
+ iq->caps_fallback = 0;
+ iter_dec_attempts(iq->dp, 3); /* space for fallback */
+ iq->num_current_queries++; /* RespState decrements it*/
+ iq->referral_count++; /* make sure we don't loop */
+ iq->sent_count = 0;
+ iq->state = QUERY_RESP_STATE;
+ return 1;
+ }
return processLastResort(qstate, iq, ie, id);
}
}
return 0;
}
+ /* if not forwarding, check ratelimits per delegationpoint name */
+ if(!(iq->chase_flags & BIT_RD) && !iq->ratelimit_ok) {
+ if(!infra_ratelimit_inc(qstate->env->infra_cache, iq->dp->name,
+ iq->dp->namelen, *qstate->env->now)) {
+ verbose(VERB_ALGO, "query exceeded ratelimits");
+ return error_response(qstate, id, LDNS_RCODE_SERVFAIL);
+ }
+ }
+
/* We have a valid target. */
if(verbosity >= VERB_QUERY) {
log_query_info(VERB_QUERY, "sending query:", &iq->qchase);
iq->qchase.qname, iq->qchase.qname_len,
iq->qchase.qtype, iq->qchase.qclass,
iq->chase_flags | (iq->chase_to_rd?BIT_RD:0), EDNS_DO|BIT_CD,
- iq->dnssec_expected, &target->addr, target->addrlen,
- iq->dp->name, iq->dp->namelen, qstate);
+ iq->dnssec_expected, iq->caps_fallback, &target->addr,
+ target->addrlen, iq->dp->name, iq->dp->namelen, qstate);
if(!outq) {
log_addr(VERB_DETAIL, "error sending query to auth server",
&target->addr, target->addrlen);
+ if(!(iq->chase_flags & BIT_RD) && !iq->ratelimit_ok)
+ infra_ratelimit_dec(qstate->env->infra_cache, iq->dp->name,
+ iq->dp->namelen, *qstate->env->now);
return next_state(iq, QUERYTARGETS_STATE);
}
outbound_list_insert(&iq->outlist, outq);
iter_dns_store(qstate->env, &iq->response->qinfo,
iq->response->rep, 0, qstate->prefetch_leeway,
iq->dp&&iq->dp->has_parent_side_NS,
- qstate->region);
+ qstate->region, qstate->query_flags);
#ifdef CLIENT_SUBNET
}
#endif
* delegation point, and back to the QUERYTARGETS_STATE. */
verbose(VERB_DETAIL, "query response was REFERRAL");
+ if(!(iq->chase_flags & BIT_RD) && !iq->ratelimit_ok) {
+ /* we have a referral, no ratelimit, we can send
+ * our queries to the given name */
+ infra_ratelimit_dec(qstate->env->infra_cache,
+ iq->dp->name, iq->dp->namelen,
+ *qstate->env->now);
+ }
+
/* if hardened, only store referral if we asked for it */
if(!qstate->env->cfg->harden_referral_path ||
( qstate->qinfo.qtype == LDNS_RR_TYPE_NS
/* Store the referral under the current query */
/* no prefetch-leeway, since its not the answer */
iter_dns_store(qstate->env, &iq->response->qinfo,
- iq->response->rep, 1, 0, 0, NULL);
+ iq->response->rep, 1, 0, 0, NULL, 0);
if(iq->store_parent_NS)
iter_store_parentside_NS(qstate->env,
iq->response->rep);
/* prefetchleeway applied because this updates answer parts */
iter_dns_store(qstate->env, &iq->response->qinfo,
iq->response->rep, 1, qstate->prefetch_leeway,
- iq->dp&&iq->dp->has_parent_side_NS, NULL);
+ iq->dp&&iq->dp->has_parent_side_NS, NULL,
+ qstate->query_flags);
/* set the current request's qname to the new value. */
iq->qchase.qname = sname;
iq->qchase.qname_len = snamelen;
}
/**
- * Return priming query results to interestes super querystates.
+ * Return priming query results to interested super querystates.
*
* Sets the delegation point and delegation message (not nonRD queries).
* This is a callback from walk_supers.
/* copy appropriate rcode */
to->rep->flags = from->rep->flags;
/* copy rrsets */
+ if(from->rep->rrset_count > RR_COUNT_MAX ||
+ to->rep->rrset_count > RR_COUNT_MAX) {
+ log_err("malloc failed (too many rrsets) in collect ANY");
+ foriq->state = FINISHED_STATE;
+ return; /* integer overflow protection */
+ }
dest = regional_alloc(forq->region, sizeof(dest[0])*n);
if(!dest) {
log_err("malloc failed in collect ANY");
iter_dns_store(qstate->env, &qstate->qinfo,
iq->response->rep, 0, qstate->prefetch_leeway,
iq->dp&&iq->dp->has_parent_side_NS,
- qstate->region);
+ qstate->region, qstate->query_flags);
}
}
qstate->return_rcode = LDNS_RCODE_NOERROR;
iq->response = NULL;
iq->state = QUERY_RESP_STATE;
if(event == module_event_noreply || event == module_event_error) {
+ if(event == module_event_noreply && iq->sent_count >= 3 &&
+ qstate->env->cfg->use_caps_bits_for_id &&
+ !iq->caps_fallback) {
+ /* start fallback */
+ iq->caps_fallback = 1;
+ iq->caps_server = 0;
+ iq->caps_reply = NULL;
+ iq->caps_response = NULL;
+ iq->state = QUERYTARGETS_STATE;
+ iq->num_current_queries--;
+ /* need fresh attempts for the 0x20 fallback, if
+ * that was the cause for the failure */
+ iter_dec_attempts(iq->dp, 3);
+ verbose(VERB_DETAIL, "Capsforid: timeouts, starting fallback");
+ goto handle_it;
+ }
goto handle_it;
}
if( (event != module_event_reply && event != module_event_capsfail)
/* normalize and sanitize: easy to delete items from linked lists */
if(!scrub_message(pkt, prs, &iq->qchase, iq->dp->name,
- qstate->env->scratch, qstate->env, ie))
+ qstate->env->scratch, qstate->env, ie)) {
+ /* if 0x20 enabled, start fallback, but we have no message */
+ if(event == module_event_capsfail && !iq->caps_fallback) {
+ iq->caps_fallback = 1;
+ iq->caps_server = 0;
+ iq->caps_reply = NULL;
+ iq->caps_response = NULL;
+ iq->state = QUERYTARGETS_STATE;
+ iq->num_current_queries--;
+ verbose(VERB_DETAIL, "Capsforid: scrub failed, starting fallback with no response");
+ }
goto handle_it;
+ }
/* allocate response dns_msg in region */
iq->response = dns_alloc_msg(pkt, prs, qstate->region);
log_dns_msg("incoming scrubbed packet:", &iq->response->qinfo,
iq->response->rep);
- if(event == module_event_capsfail) {
+ if(event == module_event_capsfail || iq->caps_fallback) {
+ /* for fallback we care about main answer, not additionals */
+ /* removing that makes comparison more likely to succeed */
+ caps_strip_reply(iq->response->rep);
if(!iq->caps_fallback) {
/* start fallback */
iq->caps_fallback = 1;
iq->caps_server = 0;
iq->caps_reply = iq->response->rep;
+ iq->caps_response = iq->response;
iq->state = QUERYTARGETS_STATE;
iq->num_current_queries--;
verbose(VERB_DETAIL, "Capsforid: starting fallback");
goto handle_it;
} else {
/* check if reply is the same, otherwise, fail */
- if(!reply_equal(iq->response->rep, iq->caps_reply,
+ if(!iq->caps_reply) {
+ iq->caps_reply = iq->response->rep;
+ iq->caps_response = iq->response;
+ iq->caps_server = -1; /*become zero at ++,
+ so that we start the full set of trials */
+ } else if(caps_failed_rcode(iq->caps_reply) &&
+ !caps_failed_rcode(iq->response->rep)) {
+ /* prefer to upgrade to non-SERVFAIL */
+ iq->caps_reply = iq->response->rep;
+ iq->caps_response = iq->response;
+ } else if(!caps_failed_rcode(iq->caps_reply) &&
+ caps_failed_rcode(iq->response->rep)) {
+ /* if we have non-SERVFAIL as answer then
+ * we can ignore SERVFAILs for the equality
+ * comparison */
+ /* no instructions here, skip other else */
+ } else if(caps_failed_rcode(iq->caps_reply) &&
+ caps_failed_rcode(iq->response->rep)) {
+ /* failure is same as other failure in fallbk*/
+ /* no instructions here, skip other else */
+ } else if(!reply_equal(iq->response->rep, iq->caps_reply,
qstate->env->scratch)) {
verbose(VERB_DETAIL, "Capsforid fallback: "
"getting different replies, failed");
iq = (struct iter_qstate*)qstate->minfo[id];
if(iq) {
outbound_list_clear(&iq->outlist);
+ if(iq->target_count && --iq->target_count[0] == 0)
+ free(iq->target_count);
iq->num_current_queries = 0;
}
qstate->minfo[id] = NULL;
struct iter_prep_list;
struct iter_priv;
+/** max number of targets spawned for a query and its subqueries */
+#define MAX_TARGET_COUNT 32
/** max number of query restarts. Determines max number of CNAME chain. */
#define MAX_RESTART_COUNT 8
/** max number of referrals. Makes sure resolver does not run away */
* Equals RTT_MAX_TIMEOUT
*/
#define USEFUL_SERVER_TOP_TIMEOUT 120000
-/** Number of lost messages in a row that get a host blacklisted.
- * With 16, a couple different queries have to time out and no working
- * queries are happening */
-#define USEFUL_SERVER_MAX_LOST 16
/** number of retries on outgoing queries */
#define OUTBOUND_MSG_RETRY 5
/** RTT band, within this amount from the best, servers are chosen randomly.
int caps_fallback;
/** state for capsfail: current server number to try */
size_t caps_server;
- /** state for capsfail: stored query for comparisons */
+ /** state for capsfail: stored query for comparisons. Can be NULL if
+ * no response had been seen prior to starting the fallback. */
struct reply_info* caps_reply;
+ struct dns_msg* caps_response;
/** Current delegation message - returned for non-RD queries */
struct dns_msg* deleg_msg;
/** number of queries fired off */
int sent_count;
+
+ /** number of target queries spawned in [1], for this query and its
+ * subqueries, the malloced-array is shared, [0] refcount. */
+ int* target_count;
+
+ /** if true, already tested for ratelimiting and passed the test */
+ int ratelimit_ok;
/**
* The query must store NS records from referrals as parentside RRs
+++ /dev/null
-/*
- * keyraw.c - raw key operations and conversions
- *
- * (c) NLnet Labs, 2004-2008
- *
- * See the file LICENSE for the license
- */
-/**
- * \file
- * Implementation of raw DNSKEY functions (work on wire rdata).
- */
-
-#include "config.h"
-#include "ldns/keyraw.h"
-#include "ldns/rrdef.h"
-
-#ifdef HAVE_SSL
-#include <openssl/ssl.h>
-#include <openssl/evp.h>
-#include <openssl/rand.h>
-#include <openssl/err.h>
-#include <openssl/md5.h>
-#ifdef HAVE_OPENSSL_ENGINE_H
-# include <openssl/engine.h>
-#endif
-#endif /* HAVE_SSL */
-
-size_t
-sldns_rr_dnskey_key_size_raw(const unsigned char* keydata,
- const size_t len, int alg)
-{
- /* for DSA keys */
- uint8_t t;
-
- /* for RSA keys */
- uint16_t exp;
- uint16_t int16;
-
- switch ((sldns_algorithm)alg) {
- case LDNS_DSA:
- case LDNS_DSA_NSEC3:
- if (len > 0) {
- t = keydata[0];
- return (64 + t*8)*8;
- } else {
- return 0;
- }
- break;
- case LDNS_RSAMD5:
- case LDNS_RSASHA1:
- case LDNS_RSASHA1_NSEC3:
-#ifdef USE_SHA2
- case LDNS_RSASHA256:
- case LDNS_RSASHA512:
-#endif
- if (len > 0) {
- if (keydata[0] == 0) {
- /* big exponent */
- if (len > 3) {
- memmove(&int16, keydata + 1, 2);
- exp = ntohs(int16);
- return (len - exp - 3)*8;
- } else {
- return 0;
- }
- } else {
- exp = keydata[0];
- return (len-exp-1)*8;
- }
- } else {
- return 0;
- }
- break;
-#ifdef USE_GOST
- case LDNS_ECC_GOST:
- return 512;
-#endif
-#ifdef USE_ECDSA
- case LDNS_ECDSAP256SHA256:
- return 256;
- case LDNS_ECDSAP384SHA384:
- return 384;
-#endif
- default:
- return 0;
- }
-}
-
-uint16_t sldns_calc_keytag_raw(uint8_t* key, size_t keysize)
-{
- if(keysize < 4) {
- return 0;
- }
- /* look at the algorithm field, copied from 2535bis */
- if (key[3] == LDNS_RSAMD5) {
- uint16_t ac16 = 0;
- if (keysize > 4) {
- memmove(&ac16, key + keysize - 3, 2);
- }
- ac16 = ntohs(ac16);
- return (uint16_t) ac16;
- } else {
- size_t i;
- uint32_t ac32 = 0;
- for (i = 0; i < keysize; ++i) {
- ac32 += (i & 1) ? key[i] : key[i] << 8;
- }
- ac32 += (ac32 >> 16) & 0xFFFF;
- return (uint16_t) (ac32 & 0xFFFF);
- }
-}
-
-#ifdef HAVE_SSL
-#ifdef USE_GOST
-/** store GOST engine reference loaded into OpenSSL library */
-ENGINE* sldns_gost_engine = NULL;
-
-int
-sldns_key_EVP_load_gost_id(void)
-{
- static int gost_id = 0;
- const EVP_PKEY_ASN1_METHOD* meth;
- ENGINE* e;
-
- if(gost_id) return gost_id;
-
- /* see if configuration loaded gost implementation from other engine*/
- meth = EVP_PKEY_asn1_find_str(NULL, "gost2001", -1);
- if(meth) {
- EVP_PKEY_asn1_get0_info(&gost_id, NULL, NULL, NULL, NULL, meth);
- return gost_id;
- }
-
- /* see if engine can be loaded already */
- e = ENGINE_by_id("gost");
- if(!e) {
- /* load it ourself, in case statically linked */
- ENGINE_load_builtin_engines();
- ENGINE_load_dynamic();
- e = ENGINE_by_id("gost");
- }
- if(!e) {
- /* no gost engine in openssl */
- return 0;
- }
- if(!ENGINE_set_default(e, ENGINE_METHOD_ALL)) {
- ENGINE_finish(e);
- ENGINE_free(e);
- return 0;
- }
-
- meth = EVP_PKEY_asn1_find_str(&e, "gost2001", -1);
- if(!meth) {
- /* algo not found */
- ENGINE_finish(e);
- ENGINE_free(e);
- return 0;
- }
- /* Note: do not ENGINE_finish and ENGINE_free the acquired engine
- * on some platforms this frees up the meth and unloads gost stuff */
- sldns_gost_engine = e;
-
- EVP_PKEY_asn1_get0_info(&gost_id, NULL, NULL, NULL, NULL, meth);
- return gost_id;
-}
-
-void sldns_key_EVP_unload_gost(void)
-{
- if(sldns_gost_engine) {
- ENGINE_finish(sldns_gost_engine);
- ENGINE_free(sldns_gost_engine);
- sldns_gost_engine = NULL;
- }
-}
-#endif /* USE_GOST */
-
-DSA *
-sldns_key_buf2dsa_raw(unsigned char* key, size_t len)
-{
- uint8_t T;
- uint16_t length;
- uint16_t offset;
- DSA *dsa;
- BIGNUM *Q; BIGNUM *P;
- BIGNUM *G; BIGNUM *Y;
-
- if(len == 0)
- return NULL;
- T = (uint8_t)key[0];
- length = (64 + T * 8);
- offset = 1;
-
- if (T > 8) {
- return NULL;
- }
- if(len < (size_t)1 + SHA_DIGEST_LENGTH + 3*length)
- return NULL;
-
- Q = BN_bin2bn(key+offset, SHA_DIGEST_LENGTH, NULL);
- offset += SHA_DIGEST_LENGTH;
-
- P = BN_bin2bn(key+offset, (int)length, NULL);
- offset += length;
-
- G = BN_bin2bn(key+offset, (int)length, NULL);
- offset += length;
-
- Y = BN_bin2bn(key+offset, (int)length, NULL);
- offset += length;
-
- /* create the key and set its properties */
- if(!Q || !P || !G || !Y || !(dsa = DSA_new())) {
- BN_free(Q);
- BN_free(P);
- BN_free(G);
- BN_free(Y);
- return NULL;
- }
-#ifndef S_SPLINT_S
- dsa->p = P;
- dsa->q = Q;
- dsa->g = G;
- dsa->pub_key = Y;
-#endif /* splint */
-
- return dsa;
-}
-
-RSA *
-sldns_key_buf2rsa_raw(unsigned char* key, size_t len)
-{
- uint16_t offset;
- uint16_t exp;
- uint16_t int16;
- RSA *rsa;
- BIGNUM *modulus;
- BIGNUM *exponent;
-
- if (len == 0)
- return NULL;
- if (key[0] == 0) {
- if(len < 3)
- return NULL;
- memmove(&int16, key+1, 2);
- exp = ntohs(int16);
- offset = 3;
- } else {
- exp = key[0];
- offset = 1;
- }
-
- /* key length at least one */
- if(len < (size_t)offset + exp + 1)
- return NULL;
-
- /* Exponent */
- exponent = BN_new();
- if(!exponent) return NULL;
- (void) BN_bin2bn(key+offset, (int)exp, exponent);
- offset += exp;
-
- /* Modulus */
- modulus = BN_new();
- if(!modulus) {
- BN_free(exponent);
- return NULL;
- }
- /* length of the buffer must match the key length! */
- (void) BN_bin2bn(key+offset, (int)(len - offset), modulus);
-
- rsa = RSA_new();
- if(!rsa) {
- BN_free(exponent);
- BN_free(modulus);
- return NULL;
- }
-#ifndef S_SPLINT_S
- rsa->n = modulus;
- rsa->e = exponent;
-#endif /* splint */
-
- return rsa;
-}
-
-#ifdef USE_GOST
-EVP_PKEY*
-sldns_gost2pkey_raw(unsigned char* key, size_t keylen)
-{
- /* prefix header for X509 encoding */
- uint8_t asn[37] = { 0x30, 0x63, 0x30, 0x1c, 0x06, 0x06, 0x2a, 0x85,
- 0x03, 0x02, 0x02, 0x13, 0x30, 0x12, 0x06, 0x07, 0x2a, 0x85,
- 0x03, 0x02, 0x02, 0x23, 0x01, 0x06, 0x07, 0x2a, 0x85, 0x03,
- 0x02, 0x02, 0x1e, 0x01, 0x03, 0x43, 0x00, 0x04, 0x40};
- unsigned char encoded[37+64];
- const unsigned char* pp;
- if(keylen != 64) {
- /* key wrong size */
- return NULL;
- }
-
- /* create evp_key */
- memmove(encoded, asn, 37);
- memmove(encoded+37, key, 64);
- pp = (unsigned char*)&encoded[0];
-
- return d2i_PUBKEY(NULL, &pp, (int)sizeof(encoded));
-}
-#endif /* USE_GOST */
-
-#ifdef USE_ECDSA
-EVP_PKEY*
-sldns_ecdsa2pkey_raw(unsigned char* key, size_t keylen, uint8_t algo)
-{
- unsigned char buf[256+2]; /* sufficient for 2*384/8+1 */
- const unsigned char* pp = buf;
- EVP_PKEY *evp_key;
- EC_KEY *ec;
- /* check length, which uncompressed must be 2 bignums */
- if(algo == LDNS_ECDSAP256SHA256) {
- if(keylen != 2*256/8) return NULL;
- ec = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);
- } else if(algo == LDNS_ECDSAP384SHA384) {
- if(keylen != 2*384/8) return NULL;
- ec = EC_KEY_new_by_curve_name(NID_secp384r1);
- } else ec = NULL;
- if(!ec) return NULL;
- if(keylen+1 > sizeof(buf))
- return NULL; /* sanity check */
- /* prepend the 0x02 (from docs) (or actually 0x04 from implementation
- * of openssl) for uncompressed data */
- buf[0] = POINT_CONVERSION_UNCOMPRESSED;
- memmove(buf+1, key, keylen);
- if(!o2i_ECPublicKey(&ec, &pp, (int)keylen+1)) {
- EC_KEY_free(ec);
- return NULL;
- }
- evp_key = EVP_PKEY_new();
- if(!evp_key) {
- EC_KEY_free(ec);
- return NULL;
- }
- if (!EVP_PKEY_assign_EC_KEY(evp_key, ec)) {
- EVP_PKEY_free(evp_key);
- EC_KEY_free(ec);
- return NULL;
- }
- return evp_key;
-}
-#endif /* USE_ECDSA */
-
-int
-sldns_digest_evp(unsigned char* data, unsigned int len, unsigned char* dest,
- const EVP_MD* md)
-{
- EVP_MD_CTX* ctx;
- ctx = EVP_MD_CTX_create();
- if(!ctx)
- return 0;
- if(!EVP_DigestInit_ex(ctx, md, NULL) ||
- !EVP_DigestUpdate(ctx, data, len) ||
- !EVP_DigestFinal_ex(ctx, dest, NULL)) {
- EVP_MD_CTX_destroy(ctx);
- return 0;
- }
- EVP_MD_CTX_destroy(ctx);
- return 1;
-}
-#endif /* HAVE_SSL */
+++ /dev/null
-/*
- * keyraw.h -- raw key and signature access and conversion
- *
- * Copyright (c) 2005-2008, NLnet Labs. All rights reserved.
- *
- * See LICENSE for the license.
- *
- */
-
-/**
- * \file
- *
- * raw key and signature access and conversion
- *
- * Since those functions heavily rely op cryptographic operations,
- * this module is dependent on openssl.
- *
- */
-
-#ifndef LDNS_KEYRAW_H
-#define LDNS_KEYRAW_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-#if LDNS_BUILD_CONFIG_HAVE_SSL
-# include <openssl/ssl.h>
-# include <openssl/evp.h>
-#endif /* LDNS_BUILD_CONFIG_HAVE_SSL */
-
-/**
- * get the length of the keydata in bits
- * \param[in] keydata the raw key data
- * \param[in] len the length of the keydata
- * \param[in] alg the cryptographic algorithm this is a key for
- * \return the keysize in bits, or 0 on error
- */
-size_t sldns_rr_dnskey_key_size_raw(const unsigned char *keydata,
- const size_t len, int alg);
-
-/**
- * Calculates keytag of DNSSEC key, operates on wireformat rdata.
- * \param[in] key the key as uncompressed wireformat rdata.
- * \param[in] keysize length of key data.
- * \return the keytag
- */
-uint16_t sldns_calc_keytag_raw(uint8_t* key, size_t keysize);
-
-#if LDNS_BUILD_CONFIG_HAVE_SSL
-/**
- * Get the PKEY id for GOST, loads GOST into openssl as a side effect.
- * Only available if GOST is compiled into the library and openssl.
- * \return the gost id for EVP_CTX creation.
- */
-int sldns_key_EVP_load_gost_id(void);
-
-/** Release the engine reference held for the GOST engine. */
-void sldns_key_EVP_unload_gost(void);
-
-/**
- * Like sldns_key_buf2dsa, but uses raw buffer.
- * \param[in] key the uncompressed wireformat of the key.
- * \param[in] len length of key data
- * \return a DSA * structure with the key material
- */
-DSA *sldns_key_buf2dsa_raw(unsigned char* key, size_t len);
-
-/**
- * Converts a holding buffer with key material to EVP PKEY in openssl.
- * Only available if ldns was compiled with GOST.
- * \param[in] key data to convert
- * \param[in] keylen length of the key data
- * \return the key or NULL on error.
- */
-EVP_PKEY* sldns_gost2pkey_raw(unsigned char* key, size_t keylen);
-
-/**
- * Converts a holding buffer with key material to EVP PKEY in openssl.
- * Only available if ldns was compiled with ECDSA.
- * \param[in] key data to convert
- * \param[in] keylen length of the key data
- * \param[in] algo precise algorithm to initialize ECC group values.
- * \return the key or NULL on error.
- */
-EVP_PKEY* sldns_ecdsa2pkey_raw(unsigned char* key, size_t keylen, uint8_t algo);
-
-/**
- * Like sldns_key_buf2rsa, but uses raw buffer.
- * \param[in] key the uncompressed wireformat of the key.
- * \param[in] len length of key data
- * \return a RSA * structure with the key material
- */
-RSA *sldns_key_buf2rsa_raw(unsigned char* key, size_t len);
-
-/**
- * Utility function to calculate hash using generic EVP_MD pointer.
- * \param[in] data the data to hash.
- * \param[in] len length of data.
- * \param[out] dest the destination of the hash, must be large enough.
- * \param[in] md the message digest to use.
- * \return true if worked, false on failure.
- */
-int sldns_digest_evp(unsigned char* data, unsigned int len,
- unsigned char* dest, const EVP_MD* md);
-
-#endif /* LDNS_BUILD_CONFIG_HAVE_SSL */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* LDNS_KEYRAW_H */
+++ /dev/null
-/*
- * a generic (simple) parser. Use to parse rr's, private key
- * information and /etc/resolv.conf files
- *
- * a Net::DNS like library for C
- * LibDNS Team @ NLnet Labs
- * (c) NLnet Labs, 2005-2006
- * See the file LICENSE for the license
- */
-#include "config.h"
-#include "ldns/parse.h"
-#include "ldns/parseutil.h"
-#include "ldns/sbuffer.h"
-
-#include <limits.h>
-#include <strings.h>
-
-sldns_lookup_table sldns_directive_types[] = {
- { LDNS_DIR_TTL, "$TTL" },
- { LDNS_DIR_ORIGIN, "$ORIGIN" },
- { LDNS_DIR_INCLUDE, "$INCLUDE" },
- { 0, NULL }
-};
-
-/* add max_limit here? */
-ssize_t
-sldns_fget_token(FILE *f, char *token, const char *delim, size_t limit)
-{
- return sldns_fget_token_l(f, token, delim, limit, NULL);
-}
-
-ssize_t
-sldns_fget_token_l(FILE *f, char *token, const char *delim, size_t limit, int *line_nr)
-{
- int c, prev_c;
- int p; /* 0 -> no parenthese seen, >0 nr of ( seen */
- int com, quoted;
- char *t;
- size_t i;
- const char *d;
- const char *del;
-
- /* standard delimeters */
- if (!delim) {
- /* from isspace(3) */
- del = LDNS_PARSE_NORMAL;
- } else {
- del = delim;
- }
-
- p = 0;
- i = 0;
- com = 0;
- quoted = 0;
- prev_c = 0;
- t = token;
- if (del[0] == '"') {
- quoted = 1;
- }
- while ((c = getc(f)) != EOF) {
- if (c == '\r') /* carriage return */
- c = ' ';
- if (c == '(' && prev_c != '\\' && !quoted) {
- /* this only counts for non-comments */
- if (com == 0) {
- p++;
- }
- prev_c = c;
- continue;
- }
-
- if (c == ')' && prev_c != '\\' && !quoted) {
- /* this only counts for non-comments */
- if (com == 0) {
- p--;
- }
- prev_c = c;
- continue;
- }
-
- if (p < 0) {
- /* more ) then ( - close off the string */
- *t = '\0';
- return 0;
- }
-
- /* do something with comments ; */
- if (c == ';' && quoted == 0) {
- if (prev_c != '\\') {
- com = 1;
- }
- }
- if (c == '\"' && com == 0 && prev_c != '\\') {
- quoted = 1 - quoted;
- }
-
- if (c == '\n' && com != 0) {
- /* comments */
- com = 0;
- *t = ' ';
- if (line_nr) {
- *line_nr = *line_nr + 1;
- }
- if (p == 0 && i > 0) {
- goto tokenread;
- } else {
- prev_c = c;
- continue;
- }
- }
-
- if (com == 1) {
- *t = ' ';
- prev_c = c;
- continue;
- }
-
- if (c == '\n' && p != 0 && t > token) {
- /* in parentheses */
- if (line_nr) {
- *line_nr = *line_nr + 1;
- }
- *t++ = ' ';
- prev_c = c;
- continue;
- }
-
- /* check if we hit the delim */
- for (d = del; *d; d++) {
- if (c == *d && i > 0 && prev_c != '\\' && p == 0) {
- if (c == '\n' && line_nr) {
- *line_nr = *line_nr + 1;
- }
- goto tokenread;
- }
- }
- if (c != '\0' && c != '\n') {
- i++;
- }
- if (limit > 0 && (i >= limit || (size_t)(t-token) >= limit)) {
- *t = '\0';
- return -1;
- }
- if (c != '\0' && c != '\n') {
- *t++ = c;
- }
- if (c == '\\' && prev_c == '\\')
- prev_c = 0;
- else prev_c = c;
- }
- *t = '\0';
- if (c == EOF) {
- return (ssize_t)i;
- }
-
- if (i == 0) {
- /* nothing read */
- return -1;
- }
- if (p != 0) {
- return -1;
- }
- return (ssize_t)i;
-
-tokenread:
- if(*del == '"')
- /* do not skip over quotes after the string, they are part
- * of the next string. But skip over whitespace (if needed)*/
- sldns_fskipcs_l(f, del+1, line_nr);
- else sldns_fskipcs_l(f, del, line_nr);
- *t = '\0';
- if (p != 0) {
- return -1;
- }
-
- return (ssize_t)i;
-}
-
-ssize_t
-sldns_fget_keyword_data(FILE *f, const char *keyword, const char *k_del, char *data,
- const char *d_del, size_t data_limit)
-{
- return sldns_fget_keyword_data_l(f, keyword, k_del, data, d_del,
- data_limit, NULL);
-}
-
-ssize_t
-sldns_fget_keyword_data_l(FILE *f, const char *keyword, const char *k_del, char *data,
- const char *d_del, size_t data_limit, int *line_nr)
-{
- /* we assume: keyword|sep|data */
- char *fkeyword;
- ssize_t i;
-
- if(strlen(keyword) >= LDNS_MAX_KEYWORDLEN)
- return -1;
- fkeyword = (char*)malloc(LDNS_MAX_KEYWORDLEN);
- if(!fkeyword)
- return -1;
-
- i = sldns_fget_token(f, fkeyword, k_del, LDNS_MAX_KEYWORDLEN);
- if(i==0 || i==-1) {
- free(fkeyword);
- return -1;
- }
-
- /* case??? i instead of strlen? */
- if (strncmp(fkeyword, keyword, LDNS_MAX_KEYWORDLEN - 1) == 0) {
- /* whee! */
- /* printf("%s\n%s\n", "Matching keyword", fkeyword); */
- i = sldns_fget_token_l(f, data, d_del, data_limit, line_nr);
- free(fkeyword);
- return i;
- } else {
- /*printf("no match for %s (read: %s)\n", keyword, fkeyword);*/
- free(fkeyword);
- return -1;
- }
-}
-
-ssize_t
-sldns_bget_token(sldns_buffer *b, char *token, const char *delim, size_t limit)
-{
- return sldns_bget_token_par(b, token, delim, limit, NULL, NULL);
-}
-
-ssize_t
-sldns_bget_token_par(sldns_buffer *b, char *token, const char *delim,
- size_t limit, int* par, const char* skipw)
-{
- int c, lc;
- int p; /* 0 -> no parenthese seen, >0 nr of ( seen */
- int com, quoted;
- char *t;
- size_t i;
- const char *d;
- const char *del;
-
- /* standard delimiters */
- if (!delim) {
- /* from isspace(3) */
- del = LDNS_PARSE_NORMAL;
- } else {
- del = delim;
- }
-
- p = (par?*par:0);
- i = 0;
- com = 0;
- quoted = 0;
- t = token;
- lc = 0;
- if (del[0] == '"') {
- quoted = 1;
- }
-
- while ((c = sldns_bgetc(b)) != EOF) {
- if (c == '\r') /* carriage return */
- c = ' ';
- if (c == '(' && lc != '\\' && !quoted) {
- /* this only counts for non-comments */
- if (com == 0) {
- if(par) (*par)++;
- p++;
- }
- lc = c;
- continue;
- }
-
- if (c == ')' && lc != '\\' && !quoted) {
- /* this only counts for non-comments */
- if (com == 0) {
- if(par) (*par)--;
- p--;
- }
- lc = c;
- continue;
- }
-
- if (p < 0) {
- /* more ) then ( */
- *t = '\0';
- return 0;
- }
-
- /* do something with comments ; */
- if (c == ';' && quoted == 0) {
- if (lc != '\\') {
- com = 1;
- }
- }
- if (c == '"' && com == 0 && lc != '\\') {
- quoted = 1 - quoted;
- }
-
- if (c == '\n' && com != 0) {
- /* comments */
- com = 0;
- *t = ' ';
- lc = c;
- continue;
- }
-
- if (com == 1) {
- *t = ' ';
- lc = c;
- continue;
- }
-
- if (c == '\n' && p != 0) {
- /* in parentheses */
- /* do not write ' ' if we want to skip spaces */
- if(!(skipw && (strchr(skipw, c)||strchr(skipw, ' '))))
- *t++ = ' ';
- lc = c;
- continue;
- }
-
- /* check to skip whitespace at start, but also after ( */
- if(skipw && i==0 && !com && !quoted && lc != '\\') {
- if(strchr(skipw, c)) {
- lc = c;
- continue;
- }
- }
-
- /* check if we hit the delim */
- for (d = del; *d; d++) {
- /* we can only exit if no parens or user tracks them */
- if (c == *d && lc != '\\' && (p == 0 || par)) {
- goto tokenread;
- }
- }
-
- i++;
- if (limit > 0 && (i >= limit || (size_t)(t-token) >= limit)) {
- *t = '\0';
- return -1;
- }
- *t++ = c;
-
- if (c == '\\' && lc == '\\') {
- lc = 0;
- } else {
- lc = c;
- }
- }
- *t = '\0';
- if (i == 0) {
- /* nothing read */
- return -1;
- }
- if (!par && p != 0) {
- return -1;
- }
- return (ssize_t)i;
-
-tokenread:
- if(*del == '"')
- /* do not skip over quotes after the string, they are part
- * of the next string. But skip over whitespace (if needed)*/
- sldns_bskipcs(b, del+1);
- else sldns_bskipcs(b, del);
- *t = '\0';
-
- if (!par && p != 0) {
- return -1;
- }
- return (ssize_t)i;
-}
-
-
-void
-sldns_bskipcs(sldns_buffer *buffer, const char *s)
-{
- int found;
- char c;
- const char *d;
-
- while(sldns_buffer_available_at(buffer, buffer->_position, sizeof(char))) {
- c = (char) sldns_buffer_read_u8_at(buffer, buffer->_position);
- found = 0;
- for (d = s; *d; d++) {
- if (*d == c) {
- found = 1;
- }
- }
- if (found && buffer->_limit > buffer->_position) {
- buffer->_position += sizeof(char);
- } else {
- return;
- }
- }
-}
-
-void
-sldns_fskipcs(FILE *fp, const char *s)
-{
- sldns_fskipcs_l(fp, s, NULL);
-}
-
-void
-sldns_fskipcs_l(FILE *fp, const char *s, int *line_nr)
-{
- int found;
- int c;
- const char *d;
-
- while ((c = fgetc(fp)) != EOF) {
- if (line_nr && c == '\n') {
- *line_nr = *line_nr + 1;
- }
- found = 0;
- for (d = s; *d; d++) {
- if (*d == c) {
- found = 1;
- }
- }
- if (!found) {
- /* with getc, we've read too far */
- ungetc(c, fp);
- return;
- }
- }
-}
-
-ssize_t
-sldns_bget_keyword_data(sldns_buffer *b, const char *keyword, const char *k_del, char
-*data, const char *d_del, size_t data_limit)
-{
- /* we assume: keyword|sep|data */
- char *fkeyword;
- ssize_t i;
-
- if(strlen(keyword) >= LDNS_MAX_KEYWORDLEN)
- return -1;
- fkeyword = (char*)malloc(LDNS_MAX_KEYWORDLEN);
- if(!fkeyword)
- return -1; /* out of memory */
-
- i = sldns_bget_token(b, fkeyword, k_del, data_limit);
- if(i==0 || i==-1) {
- free(fkeyword);
- return -1; /* nothing read */
- }
-
- /* case??? */
- if (strncmp(fkeyword, keyword, strlen(keyword)) == 0) {
- free(fkeyword);
- /* whee, the match! */
- /* retrieve it's data */
- i = sldns_bget_token(b, data, d_del, 0);
- return i;
- } else {
- free(fkeyword);
- return -1;
- }
-}
-
+++ /dev/null
-/*
- * parse.h
- *
- * a Net::DNS like library for C
- * LibDNS Team @ NLnet Labs
- * (c) NLnet Labs, 2005-2006
- * See the file LICENSE for the license
- */
-
-#ifndef LDNS_PARSE_H
-#define LDNS_PARSE_H
-
-struct sldns_buffer;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define LDNS_PARSE_SKIP_SPACE "\f\n\r\v"
-#define LDNS_PARSE_NORMAL " \f\n\r\t\v"
-#define LDNS_PARSE_NO_NL " \t"
-#define LDNS_MAX_LINELEN 10230
-#define LDNS_MAX_KEYWORDLEN 32
-
-
-/**
- * \file
- *
- * Contains some low-level parsing functions, mostly used in the _frm_str
- * family of functions.
- */
-
-/**
- * different type of directives in zone files
- * We now deal with $TTL, $ORIGIN and $INCLUDE.
- * The latter is not implemented in ldns (yet)
- */
-enum sldns_enum_directive
-{
- LDNS_DIR_TTL,
- LDNS_DIR_ORIGIN,
- LDNS_DIR_INCLUDE
-};
-typedef enum sldns_enum_directive sldns_directive;
-
-/**
- * returns a token/char from the stream F.
- * This function deals with ( and ) in the stream,
- * and ignores them when encountered
- * \param[in] *f the file to read from
- * \param[out] *token the read token is put here
- * \param[in] *delim chars at which the parsing should stop
- * \param[in] *limit how much to read. If 0 the builtin maximum is used
- * \return 0 on error of EOF of the stream F. Otherwise return the length of what is read
- */
-ssize_t sldns_fget_token(FILE *f, char *token, const char *delim, size_t limit);
-
-/**
- * returns a token/char from the stream F.
- * This function deals with ( and ) in the stream,
- * and ignores when it finds them.
- * \param[in] *f the file to read from
- * \param[out] *token the token is put here
- * \param[in] *delim chars at which the parsing should stop
- * \param[in] *limit how much to read. If 0 use builtin maximum
- * \param[in] line_nr pointer to an integer containing the current line number (for debugging purposes)
- * \return 0 on error of EOF of F otherwise return the length of what is read
- */
-ssize_t sldns_fget_token_l(FILE *f, char *token, const char *delim, size_t limit, int *line_nr);
-
-/**
- * returns a token/char from the buffer b.
- * This function deals with ( and ) in the buffer,
- * and ignores when it finds them.
- * \param[in] *b the buffer to read from
- * \param[out] *token the token is put here
- * \param[in] *delim chars at which the parsing should stop
- * \param[in] *limit how much to read. If 0 the builtin maximum is used
- * \param[in] *par if you pass nonNULL, set to 0 on first call, the parenthesis
- * state is stored in it, for use on next call. User must check it is back
- * to zero after last bget in string (for parse error). If you pass NULL,
- * the entire parenthesized string is read in.
- * \param[in] skipw string with whitespace to skip before the start of the
- * token, like " ", or " \t", or NULL for none.
- * \returns 0 on error of EOF of b. Otherwise return the length of what is read
- */
-ssize_t sldns_bget_token_par(struct sldns_buffer *b, char *token, const char *delim, size_t limit, int* par, const char* skipw);
-
-/**
- * returns a token/char from the buffer b.
- * This function deals with ( and ) in the buffer,
- * and ignores when it finds them.
- * \param[in] *b the buffer to read from
- * \param[out] *token the token is put here
- * \param[in] *delim chars at which the parsing should stop
- * \param[in] *limit how much to read. If 0 the builtin maximum is used
- * \returns 0 on error of EOF of b. Otherwise return the length of what is read
- */
-ssize_t sldns_bget_token(struct sldns_buffer *b, char *token, const char *delim, size_t limit);
-
-/*
- * searches for keyword and delim in a file. Gives everything back
- * after the keyword + k_del until we hit d_del
- * \param[in] f file pointer to read from
- * \param[in] keyword keyword to look for
- * \param[in] k_del keyword delimeter
- * \param[out] data the data found
- * \param[in] d_del the data delimeter
- * \param[in] data_limit maximum size the the data buffer
- * \return the number of character read
- */
-ssize_t sldns_fget_keyword_data(FILE *f, const char *keyword, const char *k_del, char *data, const char *d_del, size_t data_limit);
-
-/*
- * searches for keyword and delim. Gives everything back
- * after the keyword + k_del until we hit d_del
- * \param[in] f file pointer to read from
- * \param[in] keyword keyword to look for
- * \param[in] k_del keyword delimeter
- * \param[out] data the data found
- * \param[in] d_del the data delimeter
- * \param[in] data_limit maximum size the the data buffer
- * \param[in] line_nr pointer to an integer containing the current line number (for
-debugging purposes)
- * \return the number of character read
- */
-ssize_t sldns_fget_keyword_data_l(FILE *f, const char *keyword, const char *k_del, char *data, const char *d_del, size_t data_limit, int *line_nr);
-
-/*
- * searches for keyword and delim in a buffer. Gives everything back
- * after the keyword + k_del until we hit d_del
- * \param[in] b buffer pointer to read from
- * \param[in] keyword keyword to look for
- * \param[in] k_del keyword delimeter
- * \param[out] data the data found
- * \param[in] d_del the data delimeter
- * \param[in] data_limit maximum size the the data buffer
- * \return the number of character read
- */
-ssize_t sldns_bget_keyword_data(struct sldns_buffer *b, const char *keyword, const char *k_del, char *data, const char *d_del, size_t data_limit);
-
-/**
- * returns the next character from a buffer. Advances the position pointer with 1.
- * When end of buffer is reached returns EOF. This is the buffer's equivalent
- * for getc().
- * \param[in] *buffer buffer to read from
- * \return EOF on failure otherwise return the character
- */
-int sldns_bgetc(struct sldns_buffer *buffer);
-
-/**
- * skips all of the characters in the given string in the buffer, moving
- * the position to the first character that is not in *s.
- * \param[in] *buffer buffer to use
- * \param[in] *s characters to skip
- * \return void
- */
-void sldns_bskipcs(struct sldns_buffer *buffer, const char *s);
-
-/**
- * skips all of the characters in the given string in the fp, moving
- * the position to the first character that is not in *s.
- * \param[in] *fp file to use
- * \param[in] *s characters to skip
- * \return void
- */
-void sldns_fskipcs(FILE *fp, const char *s);
-
-
-/**
- * skips all of the characters in the given string in the fp, moving
- * the position to the first character that is not in *s.
- * \param[in] *fp file to use
- * \param[in] *s characters to skip
- * \param[in] line_nr pointer to an integer containing the current line number (for debugging purposes)
- * \return void
- */
-void sldns_fskipcs_l(FILE *fp, const char *s, int *line_nr);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* LDNS_PARSE_H */
+++ /dev/null
-/*
- * parseutil.c - parse utilities for string and wire conversion
- *
- * (c) NLnet Labs, 2004-2006
- *
- * See the file LICENSE for the license
- */
-/**
- * \file
- *
- * Utility functions for parsing, base32(DNS variant) and base64 encoding
- * and decoding, Hex, Time units, Escape codes.
- */
-
-#include "config.h"
-#include "ldns/parseutil.h"
-#include <sys/time.h>
-#include <time.h>
-#include <ctype.h>
-
-sldns_lookup_table *
-sldns_lookup_by_name(sldns_lookup_table *table, const char *name)
-{
- while (table->name != NULL) {
- if (strcasecmp(name, table->name) == 0)
- return table;
- table++;
- }
- return NULL;
-}
-
-sldns_lookup_table *
-sldns_lookup_by_id(sldns_lookup_table *table, int id)
-{
- while (table->name != NULL) {
- if (table->id == id)
- return table;
- table++;
- }
- return NULL;
-}
-
-/* Number of days per month (except for February in leap years). */
-static const int mdays[] = {
- 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
-};
-
-#define LDNS_MOD(x,y) (((x) % (y) < 0) ? ((x) % (y) + (y)) : ((x) % (y)))
-#define LDNS_DIV(x,y) (((x) % (y) < 0) ? ((x) / (y) - 1 ) : ((x) / (y)))
-
-static int
-is_leap_year(int year)
-{
- return LDNS_MOD(year, 4) == 0 && (LDNS_MOD(year, 100) != 0
- || LDNS_MOD(year, 400) == 0);
-}
-
-static int
-leap_days(int y1, int y2)
-{
- --y1;
- --y2;
- return (LDNS_DIV(y2, 4) - LDNS_DIV(y1, 4)) -
- (LDNS_DIV(y2, 100) - LDNS_DIV(y1, 100)) +
- (LDNS_DIV(y2, 400) - LDNS_DIV(y1, 400));
-}
-
-/*
- * Code adapted from Python 2.4.1 sources (Lib/calendar.py).
- */
-time_t
-sldns_mktime_from_utc(const struct tm *tm)
-{
- int year = 1900 + tm->tm_year;
- time_t days = 365 * ((time_t) year - 1970) + leap_days(1970, year);
- time_t hours;
- time_t minutes;
- time_t seconds;
- int i;
-
- for (i = 0; i < tm->tm_mon; ++i) {
- days += mdays[i];
- }
- if (tm->tm_mon > 1 && is_leap_year(year)) {
- ++days;
- }
- days += tm->tm_mday - 1;
-
- hours = days * 24 + tm->tm_hour;
- minutes = hours * 60 + tm->tm_min;
- seconds = minutes * 60 + tm->tm_sec;
-
- return seconds;
-}
-
-#if SIZEOF_TIME_T <= 4
-
-static void
-sldns_year_and_yday_from_days_since_epoch(int64_t days, struct tm *result)
-{
- int year = 1970;
- int new_year;
-
- while (days < 0 || days >= (int64_t) (is_leap_year(year) ? 366 : 365)) {
- new_year = year + (int) LDNS_DIV(days, 365);
- days -= (new_year - year) * 365;
- days -= leap_days(year, new_year);
- year = new_year;
- }
- result->tm_year = year;
- result->tm_yday = (int) days;
-}
-
-/* Number of days per month in a leap year. */
-static const int leap_year_mdays[] = {
- 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
-};
-
-static void
-sldns_mon_and_mday_from_year_and_yday(struct tm *result)
-{
- int idays = result->tm_yday;
- const int *mon_lengths = is_leap_year(result->tm_year) ?
- leap_year_mdays : mdays;
-
- result->tm_mon = 0;
- while (idays >= mon_lengths[result->tm_mon]) {
- idays -= mon_lengths[result->tm_mon++];
- }
- result->tm_mday = idays + 1;
-}
-
-static void
-sldns_wday_from_year_and_yday(struct tm *result)
-{
- result->tm_wday = 4 /* 1-1-1970 was a thursday */
- + LDNS_MOD((result->tm_year - 1970), 7) * LDNS_MOD(365, 7)
- + leap_days(1970, result->tm_year)
- + result->tm_yday;
- result->tm_wday = LDNS_MOD(result->tm_wday, 7);
- if (result->tm_wday < 0) {
- result->tm_wday += 7;
- }
-}
-
-static struct tm *
-sldns_gmtime64_r(int64_t clock, struct tm *result)
-{
- result->tm_isdst = 0;
- result->tm_sec = (int) LDNS_MOD(clock, 60);
- clock = LDNS_DIV(clock, 60);
- result->tm_min = (int) LDNS_MOD(clock, 60);
- clock = LDNS_DIV(clock, 60);
- result->tm_hour = (int) LDNS_MOD(clock, 24);
- clock = LDNS_DIV(clock, 24);
-
- sldns_year_and_yday_from_days_since_epoch(clock, result);
- sldns_mon_and_mday_from_year_and_yday(result);
- sldns_wday_from_year_and_yday(result);
- result->tm_year -= 1900;
-
- return result;
-}
-
-#endif /* SIZEOF_TIME_T <= 4 */
-
-static int64_t
-sldns_serial_arithmitics_time(int32_t time, time_t now)
-{
- int32_t offset = time - (int32_t) now;
- return (int64_t) now + offset;
-}
-
-struct tm *
-sldns_serial_arithmitics_gmtime_r(int32_t time, time_t now, struct tm *result)
-{
-#if SIZEOF_TIME_T <= 4
- int64_t secs_since_epoch = sldns_serial_arithmitics_time(time, now);
- return sldns_gmtime64_r(secs_since_epoch, result);
-#else
- time_t secs_since_epoch = sldns_serial_arithmitics_time(time, now);
- return gmtime_r(&secs_since_epoch, result);
-#endif
-}
-
-int
-sldns_hexdigit_to_int(char ch)
-{
- switch (ch) {
- case '0': return 0;
- case '1': return 1;
- case '2': return 2;
- case '3': return 3;
- case '4': return 4;
- case '5': return 5;
- case '6': return 6;
- case '7': return 7;
- case '8': return 8;
- case '9': return 9;
- case 'a': case 'A': return 10;
- case 'b': case 'B': return 11;
- case 'c': case 'C': return 12;
- case 'd': case 'D': return 13;
- case 'e': case 'E': return 14;
- case 'f': case 'F': return 15;
- default:
- return -1;
- }
-}
-
-uint32_t
-sldns_str2period(const char *nptr, const char **endptr)
-{
- int sign = 0;
- uint32_t i = 0;
- uint32_t seconds = 0;
-
- for(*endptr = nptr; **endptr; (*endptr)++) {
- switch (**endptr) {
- case ' ':
- case '\t':
- break;
- case '-':
- if(sign == 0) {
- sign = -1;
- } else {
- return seconds;
- }
- break;
- case '+':
- if(sign == 0) {
- sign = 1;
- } else {
- return seconds;
- }
- break;
- case 's':
- case 'S':
- seconds += i;
- i = 0;
- break;
- case 'm':
- case 'M':
- seconds += i * 60;
- i = 0;
- break;
- case 'h':
- case 'H':
- seconds += i * 60 * 60;
- i = 0;
- break;
- case 'd':
- case 'D':
- seconds += i * 60 * 60 * 24;
- i = 0;
- break;
- case 'w':
- case 'W':
- seconds += i * 60 * 60 * 24 * 7;
- i = 0;
- break;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- i *= 10;
- i += (**endptr - '0');
- break;
- default:
- seconds += i;
- /* disregard signedness */
- return seconds;
- }
- }
- seconds += i;
- /* disregard signedness */
- return seconds;
-}
-
-int
-sldns_parse_escape(uint8_t *ch_p, const char** str_p)
-{
- uint16_t val;
-
- 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) {
- goto error;
- }
- *ch_p = (uint8_t)val;
- *str_p += 3;
- return 1;
-
- } else if ((*str_p)[0] && !isdigit((*str_p)[0])) {
-
- *ch_p = (uint8_t)*(*str_p)++;
- return 1;
- }
-error:
- *str_p = NULL;
- return 0; /* LDNS_WIREPARSE_ERR_SYNTAX_BAD_ESCAPE */
-}
-
-/** parse one character, with escape codes */
-int
-sldns_parse_char(uint8_t *ch_p, const char** str_p)
-{
- switch (**str_p) {
-
- case '\0': return 0;
-
- case '\\': *str_p += 1;
- return sldns_parse_escape(ch_p, str_p);
-
- default: *ch_p = (uint8_t)*(*str_p)++;
- return 1;
- }
-}
-
-size_t sldns_b32_ntop_calculate_size(size_t src_data_length)
-{
- return src_data_length == 0 ? 0 : ((src_data_length - 1) / 5 + 1) * 8;
-}
-
-size_t sldns_b32_ntop_calculate_size_no_padding(size_t src_data_length)
-{
- return ((src_data_length + 3) * 8 / 5) - 4;
-}
-
-static int
-sldns_b32_ntop_base(const uint8_t* src, size_t src_sz, char* dst, size_t dst_sz,
- int extended_hex, int 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 ? sldns_b32_ntop_calculate_size(src_sz)
- : sldns_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
-sldns_b32_ntop(const uint8_t* src, size_t src_sz, char* dst, size_t dst_sz)
-{
- return sldns_b32_ntop_base(src, src_sz, dst, dst_sz, 0, 1);
-}
-
-int
-sldns_b32_ntop_extended_hex(const uint8_t* src, size_t src_sz,
- char* dst, size_t dst_sz)
-{
- return sldns_b32_ntop_base(src, src_sz, dst, dst_sz, 1, 1);
-}
-
-size_t sldns_b32_pton_calculate_size(size_t src_text_length)
-{
- return src_text_length * 5 / 8;
-}
-
-static int
-sldns_b32_pton_base(const char* src, size_t src_sz, uint8_t* dst, size_t dst_sz,
- int extended_hex, int 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
-sldns_b32_pton(const char* src, size_t src_sz, uint8_t* dst, size_t dst_sz)
-{
- return sldns_b32_pton_base(src, src_sz, dst, dst_sz, 0, 1);
-}
-
-int
-sldns_b32_pton_extended_hex(const char* src, size_t src_sz,
- uint8_t* dst, size_t dst_sz)
-{
- return sldns_b32_pton_base(src, src_sz, dst, dst_sz, 1, 1);
-}
-
-size_t sldns_b64_ntop_calculate_size(size_t srcsize)
-{
- return ((((srcsize + 2) / 3) * 4) + 1);
-}
-
-/* RFC 1521, section 5.2.
- *
- * The encoding process represents 24-bit groups of input bits as output
- * strings of 4 encoded characters. Proceeding from left to right, a
- * 24-bit input group is formed by concatenating 3 8-bit input groups.
- * These 24 bits are then treated as 4 concatenated 6-bit groups, each
- * of which is translated into a single digit in the base64 alphabet.
- *
- * This routine does not insert spaces or linebreaks after 76 characters.
- */
-int sldns_b64_ntop(uint8_t const *src, size_t srclength,
- char *target, size_t targsize)
-{
- const char* b64 =
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
- const char pad64 = '=';
- size_t i = 0, o = 0;
- if(targsize < sldns_b64_ntop_calculate_size(srclength))
- return -1;
- /* whole chunks: xxxxxxyy yyyyzzzz zzwwwwww */
- while(i+3 <= srclength) {
- if(o+4 > targsize) return -1;
- target[o] = b64[src[i] >> 2];
- target[o+1] = b64[ ((src[i]&0x03)<<4) | (src[i+1]>>4) ];
- target[o+2] = b64[ ((src[i+1]&0x0f)<<2) | (src[i+2]>>6) ];
- target[o+3] = b64[ (src[i+2]&0x3f) ];
- i += 3;
- o += 4;
- }
- /* remainder */
- switch(srclength - i) {
- case 2:
- /* two at end, converted into A B C = */
- target[o] = b64[src[i] >> 2];
- target[o+1] = b64[ ((src[i]&0x03)<<4) | (src[i+1]>>4) ];
- target[o+2] = b64[ ((src[i+1]&0x0f)<<2) ];
- target[o+3] = pad64;
- i += 2;
- o += 4;
- break;
- case 1:
- /* one at end, converted into A B = = */
- target[o] = b64[src[i] >> 2];
- target[o+1] = b64[ ((src[i]&0x03)<<4) ];
- target[o+2] = pad64;
- target[o+3] = pad64;
- i += 1;
- o += 4;
- break;
- case 0:
- default:
- /* nothing */
- break;
- }
- /* assert: i == srclength */
- if(o+1 > targsize) return -1;
- target[o] = 0;
- return (int)o;
-}
-
-size_t sldns_b64_pton_calculate_size(size_t srcsize)
-{
- return (((((srcsize + 3) / 4) * 3)) + 1);
-}
-
-int sldns_b64_pton(char const *src, uint8_t *target, size_t targsize)
-{
- const uint8_t pad64 = 64; /* is 64th in the b64 array */
- const char* s = src;
- uint8_t in[4];
- size_t o = 0, incount = 0;
-
- while(*s) {
- /* skip any character that is not base64 */
- /* conceptually we do:
- const char* b64 = pad'=' is appended to array
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
- const char* d = strchr(b64, *s++);
- and use d-b64;
- */
- char d = *s++;
- if(d <= 'Z' && d >= 'A')
- d -= 'A';
- else if(d <= 'z' && d >= 'a')
- d = d - 'a' + 26;
- else if(d <= '9' && d >= '0')
- d = d - '0' + 52;
- else if(d == '+')
- d = 62;
- else if(d == '/')
- d = 63;
- else if(d == '=')
- d = 64;
- else continue;
- in[incount++] = (uint8_t)d;
- if(incount != 4)
- continue;
- /* process whole block of 4 characters into 3 output bytes */
- if(in[3] == pad64 && in[2] == pad64) { /* A B = = */
- if(o+1 > targsize)
- return -1;
- target[o] = (in[0]<<2) | ((in[1]&0x30)>>4);
- o += 1;
- break; /* we are done */
- } else if(in[3] == pad64) { /* A B C = */
- if(o+2 > targsize)
- return -1;
- target[o] = (in[0]<<2) | ((in[1]&0x30)>>4);
- target[o+1]= ((in[1]&0x0f)<<4) | ((in[2]&0x3c)>>2);
- o += 2;
- break; /* we are done */
- } else {
- if(o+3 > targsize)
- return -1;
- /* write xxxxxxyy yyyyzzzz zzwwwwww */
- target[o] = (in[0]<<2) | ((in[1]&0x30)>>4);
- target[o+1]= ((in[1]&0x0f)<<4) | ((in[2]&0x3c)>>2);
- target[o+2]= ((in[2]&0x03)<<6) | in[3];
- o += 3;
- }
- incount = 0;
- }
- return (int)o;
-}
+++ /dev/null
-/*
- * parseutil.h - parse utilities for string and wire conversion
- *
- * (c) NLnet Labs, 2004
- *
- * See the file LICENSE for the license
- */
-/**
- * \file
- *
- * Utility functions for parsing, base32(DNS variant) and base64 encoding
- * and decoding, Hex, Time units, Escape codes.
- */
-
-#ifndef LDNS_PARSEUTIL_H
-#define LDNS_PARSEUTIL_H
-struct tm;
-
-/**
- * A general purpose lookup table
- *
- * Lookup tables are arrays of (id, name) pairs,
- * So you can for instance lookup the RCODE 3, which is "NXDOMAIN",
- * and vice versa. The lookup tables themselves are defined wherever needed,
- * for instance in host2str.c
- */
-struct sldns_struct_lookup_table {
- int id;
- const char *name;
-};
-typedef struct sldns_struct_lookup_table sldns_lookup_table;
-
-/**
- * Looks up the table entry by name, returns NULL if not found.
- * \param[in] table the lookup table to search in
- * \param[in] name what to search for
- * \return the item found
- */
-sldns_lookup_table *sldns_lookup_by_name(sldns_lookup_table table[],
- const char *name);
-/**
- * Looks up the table entry by id, returns NULL if not found.
- * \param[in] table the lookup table to search in
- * \param[in] id what to search for
- * \return the item found
- */
-sldns_lookup_table *sldns_lookup_by_id(sldns_lookup_table table[], int id);
-
-/**
- * Convert TM to seconds since epoch (midnight, January 1st, 1970).
- * Like timegm(3), which is not always available.
- * \param[in] tm a struct tm* with the date
- * \return the seconds since epoch
- */
-time_t sldns_mktime_from_utc(const struct tm *tm);
-
-/**
- * The function interprets time as the number of seconds since epoch
- * with respect to now using serial arithmitics (rfc1982).
- * That number of seconds is then converted to broken-out time information.
- * This is especially usefull when converting the inception and expiration
- * fields of RRSIG records.
- *
- * \param[in] time number of seconds since epoch (midnight, January 1st, 1970)
- * to be intepreted as a serial arithmitics number relative to now.
- * \param[in] now number of seconds since epoch (midnight, January 1st, 1970)
- * to which the time value is compared to determine the final value.
- * \param[out] result the struct with the broken-out time information
- * \return result on success or NULL on error
- */
-struct tm * sldns_serial_arithmitics_gmtime_r(int32_t time, time_t now, struct tm *result);
-
-/**
- * converts a ttl value (like 5d2h) to a long.
- * \param[in] nptr the start of the string
- * \param[out] endptr points to the last char in case of error
- * \return the convert duration value
- */
-uint32_t sldns_str2period(const char *nptr, const char **endptr);
-
-/**
- * Returns the int value of the given (hex) digit
- * \param[in] ch the hex char to convert
- * \return the converted decimal value
- */
-int sldns_hexdigit_to_int(char ch);
-
-/**
- * calculates the size needed to store the result of b64_ntop
- */
-size_t sldns_b64_ntop_calculate_size(size_t srcsize);
-
-int sldns_b64_ntop(uint8_t const *src, size_t srclength,
- char *target, size_t targsize);
-
-/**
- * calculates the size needed to store the result of sldns_b64_pton
- */
-size_t sldns_b64_pton_calculate_size(size_t srcsize);
-
-int sldns_b64_pton(char const *src, uint8_t *target, size_t targsize);
-
-/**
- * calculates the size needed to store the result of b32_ntop
- */
-size_t sldns_b32_ntop_calculate_size(size_t src_data_length);
-
-size_t sldns_b32_ntop_calculate_size_no_padding(size_t src_data_length);
-
-int sldns_b32_ntop(const uint8_t* src_data, size_t src_data_length,
- char* target_text_buffer, size_t target_text_buffer_size);
-
-int sldns_b32_ntop_extended_hex(const uint8_t* src_data, size_t src_data_length,
- char* target_text_buffer, size_t target_text_buffer_size);
-
-/**
- * calculates the size needed to store the result of b32_pton
- */
-size_t sldns_b32_pton_calculate_size(size_t src_text_length);
-
-int sldns_b32_pton(const char* src_text, size_t src_text_length,
- uint8_t* target_data_buffer, size_t target_data_buffer_size);
-
-int sldns_b32_pton_extended_hex(const char* src_text, size_t src_text_length,
- uint8_t* target_data_buffer, size_t target_data_buffer_size);
-
-/*
- * Checks whether the escaped value at **s is an octal value or
- * a 'normally' escaped character (and not eos)
- *
- * @param ch_p: the parsed character
- * @param str_p: the string. moved along for characters read.
- * The string pointer at *s is increased by either 0 (on error), 1 (on
- * normal escapes), or 3 (on octals)
- *
- * @return 0 on error
- */
-int sldns_parse_escape(uint8_t *ch_p, const char** str_p);
-
-/**
- * Parse one character, with escape codes,
- * @param ch_p: the parsed character
- * @param str_p: the string. moved along for characters read.
- * @return 0 on error
- */
-int sldns_parse_char(uint8_t *ch_p, const char** str_p);
-
-#endif /* LDNS_PARSEUTIL_H */
+++ /dev/null
-/*
- * pkthdr.h - packet header from wire conversion routines
- *
- * a Net::DNS like library for C
- *
- * (c) NLnet Labs, 2005-2006
- *
- * See the file LICENSE for the license
- */
-
-/**
- * \file
- *
- * Contains functions that translate dns data from the wire format (as sent
- * by servers and clients) to the internal structures for the packet header.
- */
-
-#ifndef LDNS_PKTHDR_H
-#define LDNS_PKTHDR_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* The length of the header */
-#define LDNS_HEADER_SIZE 12
-
-/* First octet of flags */
-#define LDNS_RD_MASK 0x01U
-#define LDNS_RD_SHIFT 0
-#define LDNS_RD_WIRE(wirebuf) (*(wirebuf+2) & LDNS_RD_MASK)
-#define LDNS_RD_SET(wirebuf) (*(wirebuf+2) |= LDNS_RD_MASK)
-#define LDNS_RD_CLR(wirebuf) (*(wirebuf+2) &= ~LDNS_RD_MASK)
-
-#define LDNS_TC_MASK 0x02U
-#define LDNS_TC_SHIFT 1
-#define LDNS_TC_WIRE(wirebuf) (*(wirebuf+2) & LDNS_TC_MASK)
-#define LDNS_TC_SET(wirebuf) (*(wirebuf+2) |= LDNS_TC_MASK)
-#define LDNS_TC_CLR(wirebuf) (*(wirebuf+2) &= ~LDNS_TC_MASK)
-
-#define LDNS_AA_MASK 0x04U
-#define LDNS_AA_SHIFT 2
-#define LDNS_AA_WIRE(wirebuf) (*(wirebuf+2) & LDNS_AA_MASK)
-#define LDNS_AA_SET(wirebuf) (*(wirebuf+2) |= LDNS_AA_MASK)
-#define LDNS_AA_CLR(wirebuf) (*(wirebuf+2) &= ~LDNS_AA_MASK)
-
-#define LDNS_OPCODE_MASK 0x78U
-#define LDNS_OPCODE_SHIFT 3
-#define LDNS_OPCODE_WIRE(wirebuf) ((*(wirebuf+2) & LDNS_OPCODE_MASK) >> LDNS_OPCODE_SHIFT)
-#define LDNS_OPCODE_SET(wirebuf, opcode) \
- (*(wirebuf+2) = ((*(wirebuf+2)) & ~LDNS_OPCODE_MASK) | ((opcode) << LDNS_OPCODE_SHIFT))
-
-#define LDNS_QR_MASK 0x80U
-#define LDNS_QR_SHIFT 7
-#define LDNS_QR_WIRE(wirebuf) (*(wirebuf+2) & LDNS_QR_MASK)
-#define LDNS_QR_SET(wirebuf) (*(wirebuf+2) |= LDNS_QR_MASK)
-#define LDNS_QR_CLR(wirebuf) (*(wirebuf+2) &= ~LDNS_QR_MASK)
-
-/* Second octet of flags */
-#define LDNS_RCODE_MASK 0x0fU
-#define LDNS_RCODE_SHIFT 0
-#define LDNS_RCODE_WIRE(wirebuf) (*(wirebuf+3) & LDNS_RCODE_MASK)
-#define LDNS_RCODE_SET(wirebuf, rcode) \
- (*(wirebuf+3) = ((*(wirebuf+3)) & ~LDNS_RCODE_MASK) | (rcode))
-
-#define LDNS_CD_MASK 0x10U
-#define LDNS_CD_SHIFT 4
-#define LDNS_CD_WIRE(wirebuf) (*(wirebuf+3) & LDNS_CD_MASK)
-#define LDNS_CD_SET(wirebuf) (*(wirebuf+3) |= LDNS_CD_MASK)
-#define LDNS_CD_CLR(wirebuf) (*(wirebuf+3) &= ~LDNS_CD_MASK)
-
-#define LDNS_AD_MASK 0x20U
-#define LDNS_AD_SHIFT 5
-#define LDNS_AD_WIRE(wirebuf) (*(wirebuf+3) & LDNS_AD_MASK)
-#define LDNS_AD_SET(wirebuf) (*(wirebuf+3) |= LDNS_AD_MASK)
-#define LDNS_AD_CLR(wirebuf) (*(wirebuf+3) &= ~LDNS_AD_MASK)
-
-#define LDNS_Z_MASK 0x40U
-#define LDNS_Z_SHIFT 6
-#define LDNS_Z_WIRE(wirebuf) (*(wirebuf+3) & LDNS_Z_MASK)
-#define LDNS_Z_SET(wirebuf) (*(wirebuf+3) |= LDNS_Z_MASK)
-#define LDNS_Z_CLR(wirebuf) (*(wirebuf+3) &= ~LDNS_Z_MASK)
-
-#define LDNS_RA_MASK 0x80U
-#define LDNS_RA_SHIFT 7
-#define LDNS_RA_WIRE(wirebuf) (*(wirebuf+3) & LDNS_RA_MASK)
-#define LDNS_RA_SET(wirebuf) (*(wirebuf+3) |= LDNS_RA_MASK)
-#define LDNS_RA_CLR(wirebuf) (*(wirebuf+3) &= ~LDNS_RA_MASK)
-
-/* Query ID */
-#define LDNS_ID_WIRE(wirebuf) (sldns_read_uint16(wirebuf))
-#define LDNS_ID_SET(wirebuf, id) (sldns_write_uint16(wirebuf, id))
-
-/* Counter of the question section */
-#define LDNS_QDCOUNT_OFF 4
-/*
-#define QDCOUNT(wirebuf) (ntohs(*(uint16_t *)(wirebuf+QDCOUNT_OFF)))
-*/
-#define LDNS_QDCOUNT(wirebuf) (sldns_read_uint16(wirebuf+LDNS_QDCOUNT_OFF))
-
-/* Counter of the answer section */
-#define LDNS_ANCOUNT_OFF 6
-#define LDNS_ANCOUNT(wirebuf) (sldns_read_uint16(wirebuf+LDNS_ANCOUNT_OFF))
-
-/* Counter of the authority section */
-#define LDNS_NSCOUNT_OFF 8
-#define LDNS_NSCOUNT(wirebuf) (sldns_read_uint16(wirebuf+LDNS_NSCOUNT_OFF))
-
-/* Counter of the additional section */
-#define LDNS_ARCOUNT_OFF 10
-#define LDNS_ARCOUNT(wirebuf) (sldns_read_uint16(wirebuf+LDNS_ARCOUNT_OFF))
-
-/**
- * The sections of a packet
- */
-enum sldns_enum_pkt_section {
- LDNS_SECTION_QUESTION = 0,
- LDNS_SECTION_ANSWER = 1,
- LDNS_SECTION_AUTHORITY = 2,
- LDNS_SECTION_ADDITIONAL = 3,
- /** bogus section, if not interested */
- LDNS_SECTION_ANY = 4,
- /** used to get all non-question rrs from a packet */
- LDNS_SECTION_ANY_NOQUESTION = 5
-};
-typedef enum sldns_enum_pkt_section sldns_pkt_section;
-
-/* opcodes for pkt's */
-enum sldns_enum_pkt_opcode {
- LDNS_PACKET_QUERY = 0,
- LDNS_PACKET_IQUERY = 1,
- LDNS_PACKET_STATUS = 2, /* there is no 3?? DNS is weird */
- LDNS_PACKET_NOTIFY = 4,
- LDNS_PACKET_UPDATE = 5
-};
-typedef enum sldns_enum_pkt_opcode sldns_pkt_opcode;
-
-/* rcodes for pkts */
-enum sldns_enum_pkt_rcode {
- LDNS_RCODE_NOERROR = 0,
- LDNS_RCODE_FORMERR = 1,
- LDNS_RCODE_SERVFAIL = 2,
- LDNS_RCODE_NXDOMAIN = 3,
- LDNS_RCODE_NOTIMPL = 4,
- LDNS_RCODE_REFUSED = 5,
- LDNS_RCODE_YXDOMAIN = 6,
- LDNS_RCODE_YXRRSET = 7,
- LDNS_RCODE_NXRRSET = 8,
- LDNS_RCODE_NOTAUTH = 9,
- LDNS_RCODE_NOTZONE = 10
-};
-typedef enum sldns_enum_pkt_rcode sldns_pkt_rcode;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* LDNS_PKTHDR_H */
+++ /dev/null
-/* rrdef.c
- *
- * access functions to rr definitions list.
- * a Net::DNS like library for C
- * LibDNS Team @ NLnet Labs
- *
- * (c) NLnet Labs, 2004-2006
- * See the file LICENSE for the license
- */
-/**
- * \file
- *
- * Defines resource record types and constants.
- */
-#include "config.h"
-#include "ldns/rrdef.h"
-#include "ldns/parseutil.h"
-
-/* classes */
-static sldns_lookup_table sldns_rr_classes_data[] = {
- { LDNS_RR_CLASS_IN, "IN" },
- { LDNS_RR_CLASS_CH, "CH" },
- { LDNS_RR_CLASS_HS, "HS" },
- { LDNS_RR_CLASS_NONE, "NONE" },
- { LDNS_RR_CLASS_ANY, "ANY" },
- { 0, NULL }
-};
-sldns_lookup_table* sldns_rr_classes = sldns_rr_classes_data;
-
-/* types */
-static const sldns_rdf_type type_0_wireformat[] = { LDNS_RDF_TYPE_UNKNOWN };
-static const sldns_rdf_type type_a_wireformat[] = { LDNS_RDF_TYPE_A };
-static const sldns_rdf_type type_ns_wireformat[] = { LDNS_RDF_TYPE_DNAME };
-static const sldns_rdf_type type_md_wireformat[] = { LDNS_RDF_TYPE_DNAME };
-static const sldns_rdf_type type_mf_wireformat[] = { LDNS_RDF_TYPE_DNAME };
-static const sldns_rdf_type type_cname_wireformat[] = { LDNS_RDF_TYPE_DNAME };
-static const sldns_rdf_type type_soa_wireformat[] = {
- LDNS_RDF_TYPE_DNAME, LDNS_RDF_TYPE_DNAME, LDNS_RDF_TYPE_INT32,
- LDNS_RDF_TYPE_PERIOD, LDNS_RDF_TYPE_PERIOD, LDNS_RDF_TYPE_PERIOD,
- LDNS_RDF_TYPE_PERIOD
-};
-static const sldns_rdf_type type_mb_wireformat[] = { LDNS_RDF_TYPE_DNAME };
-static const sldns_rdf_type type_mg_wireformat[] = { LDNS_RDF_TYPE_DNAME };
-static const sldns_rdf_type type_mr_wireformat[] = { LDNS_RDF_TYPE_DNAME };
-static const sldns_rdf_type type_wks_wireformat[] = {
- LDNS_RDF_TYPE_A, LDNS_RDF_TYPE_WKS
-};
-static const sldns_rdf_type type_ptr_wireformat[] = { LDNS_RDF_TYPE_DNAME };
-static const sldns_rdf_type type_hinfo_wireformat[] = {
- LDNS_RDF_TYPE_STR, LDNS_RDF_TYPE_STR
-};
-static const sldns_rdf_type type_minfo_wireformat[] = {
- LDNS_RDF_TYPE_DNAME, LDNS_RDF_TYPE_DNAME
-};
-static const sldns_rdf_type type_mx_wireformat[] = {
- LDNS_RDF_TYPE_INT16, LDNS_RDF_TYPE_DNAME
-};
-static const sldns_rdf_type type_rp_wireformat[] = {
- LDNS_RDF_TYPE_DNAME, LDNS_RDF_TYPE_DNAME
-};
-static const sldns_rdf_type type_afsdb_wireformat[] = {
- LDNS_RDF_TYPE_INT16, LDNS_RDF_TYPE_DNAME
-};
-static const sldns_rdf_type type_x25_wireformat[] = { LDNS_RDF_TYPE_STR };
-static const sldns_rdf_type type_isdn_wireformat[] = {
- LDNS_RDF_TYPE_STR, LDNS_RDF_TYPE_STR
-};
-static const sldns_rdf_type type_rt_wireformat[] = {
- LDNS_RDF_TYPE_INT16, LDNS_RDF_TYPE_DNAME
-};
-static const sldns_rdf_type type_nsap_wireformat[] = {
- LDNS_RDF_TYPE_NSAP
-};
-static const sldns_rdf_type type_nsap_ptr_wireformat[] = {
- LDNS_RDF_TYPE_STR
-};
-static const sldns_rdf_type type_sig_wireformat[] = {
- LDNS_RDF_TYPE_TYPE, LDNS_RDF_TYPE_ALG, LDNS_RDF_TYPE_INT8, LDNS_RDF_TYPE_INT32,
- LDNS_RDF_TYPE_TIME, LDNS_RDF_TYPE_TIME, LDNS_RDF_TYPE_INT16,
- LDNS_RDF_TYPE_DNAME, LDNS_RDF_TYPE_B64
-};
-static const sldns_rdf_type type_key_wireformat[] = {
- LDNS_RDF_TYPE_INT16, LDNS_RDF_TYPE_INT8, LDNS_RDF_TYPE_INT8, LDNS_RDF_TYPE_B64
-};
-static const sldns_rdf_type type_px_wireformat[] = {
- LDNS_RDF_TYPE_INT16, LDNS_RDF_TYPE_DNAME, LDNS_RDF_TYPE_DNAME
-};
-static const sldns_rdf_type type_gpos_wireformat[] = {
- LDNS_RDF_TYPE_STR, LDNS_RDF_TYPE_STR, LDNS_RDF_TYPE_STR
-};
-static const sldns_rdf_type type_aaaa_wireformat[] = { LDNS_RDF_TYPE_AAAA };
-static const sldns_rdf_type type_loc_wireformat[] = { LDNS_RDF_TYPE_LOC };
-static const sldns_rdf_type type_nxt_wireformat[] = {
- LDNS_RDF_TYPE_DNAME, LDNS_RDF_TYPE_UNKNOWN
-};
-static const sldns_rdf_type type_eid_wireformat[] = {
- LDNS_RDF_TYPE_HEX
-};
-static const sldns_rdf_type type_nimloc_wireformat[] = {
- LDNS_RDF_TYPE_HEX
-};
-static const sldns_rdf_type type_srv_wireformat[] = {
- LDNS_RDF_TYPE_INT16, LDNS_RDF_TYPE_INT16, LDNS_RDF_TYPE_INT16, LDNS_RDF_TYPE_DNAME
-};
-static const sldns_rdf_type type_atma_wireformat[] = {
- LDNS_RDF_TYPE_ATMA
-};
-static const sldns_rdf_type type_naptr_wireformat[] = {
- LDNS_RDF_TYPE_INT16, LDNS_RDF_TYPE_INT16, LDNS_RDF_TYPE_STR, LDNS_RDF_TYPE_STR, LDNS_RDF_TYPE_STR, LDNS_RDF_TYPE_DNAME
-};
-static const sldns_rdf_type type_kx_wireformat[] = {
- LDNS_RDF_TYPE_INT16, LDNS_RDF_TYPE_DNAME
-};
-static const sldns_rdf_type type_cert_wireformat[] = {
- LDNS_RDF_TYPE_CERT_ALG, LDNS_RDF_TYPE_INT16, LDNS_RDF_TYPE_ALG, LDNS_RDF_TYPE_B64
-};
-static const sldns_rdf_type type_a6_wireformat[] = { LDNS_RDF_TYPE_UNKNOWN };
-static const sldns_rdf_type type_dname_wireformat[] = { LDNS_RDF_TYPE_DNAME };
-static const sldns_rdf_type type_sink_wireformat[] = { LDNS_RDF_TYPE_INT8,
- LDNS_RDF_TYPE_INT8, LDNS_RDF_TYPE_INT8, LDNS_RDF_TYPE_B64
-};
-static const sldns_rdf_type type_apl_wireformat[] = {
- LDNS_RDF_TYPE_APL
-};
-static const sldns_rdf_type type_ds_wireformat[] = {
- LDNS_RDF_TYPE_INT16, LDNS_RDF_TYPE_ALG, LDNS_RDF_TYPE_INT8, LDNS_RDF_TYPE_HEX
-};
-static const sldns_rdf_type type_sshfp_wireformat[] = {
- LDNS_RDF_TYPE_INT8, LDNS_RDF_TYPE_INT8, LDNS_RDF_TYPE_HEX
-};
-static const sldns_rdf_type type_ipseckey_wireformat[] = {
- LDNS_RDF_TYPE_IPSECKEY
-};
-static const sldns_rdf_type type_rrsig_wireformat[] = {
- LDNS_RDF_TYPE_TYPE, LDNS_RDF_TYPE_ALG, LDNS_RDF_TYPE_INT8, LDNS_RDF_TYPE_INT32,
- LDNS_RDF_TYPE_TIME, LDNS_RDF_TYPE_TIME, LDNS_RDF_TYPE_INT16, LDNS_RDF_TYPE_DNAME, LDNS_RDF_TYPE_B64
-};
-static const sldns_rdf_type type_nsec_wireformat[] = {
- LDNS_RDF_TYPE_DNAME, LDNS_RDF_TYPE_NSEC
-};
-static const sldns_rdf_type type_dhcid_wireformat[] = {
- LDNS_RDF_TYPE_B64
-};
-static const sldns_rdf_type type_talink_wireformat[] = {
- LDNS_RDF_TYPE_DNAME, LDNS_RDF_TYPE_DNAME
-};
-/* nsec3 is some vars, followed by same type of data of nsec */
-static const sldns_rdf_type type_nsec3_wireformat[] = {
-/* LDNS_RDF_TYPE_NSEC3_VARS, LDNS_RDF_TYPE_NSEC3_NEXT_OWNER, LDNS_RDF_TYPE_NSEC*/
- LDNS_RDF_TYPE_INT8, LDNS_RDF_TYPE_INT8, LDNS_RDF_TYPE_INT16, LDNS_RDF_TYPE_NSEC3_SALT, LDNS_RDF_TYPE_NSEC3_NEXT_OWNER, LDNS_RDF_TYPE_NSEC
-};
-
-static const sldns_rdf_type type_nsec3param_wireformat[] = {
-/* LDNS_RDF_TYPE_NSEC3_PARAMS_VARS*/
- LDNS_RDF_TYPE_INT8,
- LDNS_RDF_TYPE_INT8,
- LDNS_RDF_TYPE_INT16,
- LDNS_RDF_TYPE_NSEC3_SALT
-};
-
-static const sldns_rdf_type type_dnskey_wireformat[] = {
- LDNS_RDF_TYPE_INT16,
- LDNS_RDF_TYPE_INT8,
- LDNS_RDF_TYPE_ALG,
- LDNS_RDF_TYPE_B64
-};
-static const sldns_rdf_type type_tkey_wireformat[] = {
- LDNS_RDF_TYPE_DNAME,
- LDNS_RDF_TYPE_TIME,
- LDNS_RDF_TYPE_TIME,
- LDNS_RDF_TYPE_INT16,
- LDNS_RDF_TYPE_INT16,
- LDNS_RDF_TYPE_INT16_DATA,
- LDNS_RDF_TYPE_INT16_DATA,
-};
-static const sldns_rdf_type type_tsig_wireformat[] = {
- LDNS_RDF_TYPE_DNAME,
- LDNS_RDF_TYPE_TSIGTIME,
- LDNS_RDF_TYPE_INT16,
- LDNS_RDF_TYPE_INT16_DATA,
- LDNS_RDF_TYPE_INT16,
- LDNS_RDF_TYPE_INT16,
- LDNS_RDF_TYPE_INT16_DATA
-};
-static const sldns_rdf_type type_tlsa_wireformat[] = {
- LDNS_RDF_TYPE_INT8,
- LDNS_RDF_TYPE_INT8,
- LDNS_RDF_TYPE_INT8,
- LDNS_RDF_TYPE_HEX
-};
-static const sldns_rdf_type type_hip_wireformat[] = {
- LDNS_RDF_TYPE_HIP
-};
-static const sldns_rdf_type type_nid_wireformat[] = {
- LDNS_RDF_TYPE_INT16,
- LDNS_RDF_TYPE_ILNP64
-};
-static const sldns_rdf_type type_l32_wireformat[] = {
- LDNS_RDF_TYPE_INT16,
- LDNS_RDF_TYPE_A
-};
-static const sldns_rdf_type type_l64_wireformat[] = {
- LDNS_RDF_TYPE_INT16,
- LDNS_RDF_TYPE_ILNP64
-};
-static const sldns_rdf_type type_lp_wireformat[] = {
- LDNS_RDF_TYPE_INT16,
- LDNS_RDF_TYPE_DNAME
-};
-static const sldns_rdf_type type_eui48_wireformat[] = {
- LDNS_RDF_TYPE_EUI48
-};
-static const sldns_rdf_type type_eui64_wireformat[] = {
- LDNS_RDF_TYPE_EUI64
-};
-#ifdef DRAFT_RRTYPES
-static const sldns_rdf_type type_uri_wireformat[] = {
- LDNS_RDF_TYPE_INT16,
- LDNS_RDF_TYPE_INT16,
- LDNS_RDF_TYPE_LONG_STR
-};
-#endif
-static const sldns_rdf_type type_caa_wireformat[] = {
- LDNS_RDF_TYPE_INT8,
- LDNS_RDF_TYPE_TAG,
- LDNS_RDF_TYPE_LONG_STR
-};
-
-/* All RR's defined in 1035 are well known and can thus
- * be compressed. See RFC3597. These RR's are:
- * CNAME HINFO MB MD MF MG MINFO MR MX NULL NS PTR SOA TXT
- */
-static sldns_rr_descriptor rdata_field_descriptors[] = {
- /* 0 */
- { 0, NULL, 0, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
- /* 1 */
- {LDNS_RR_TYPE_A, "A", 1, 1, type_a_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
- /* 2 */
- {LDNS_RR_TYPE_NS, "NS", 1, 1, type_ns_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_COMPRESS, 1 },
- /* 3 */
- {LDNS_RR_TYPE_MD, "MD", 1, 1, type_md_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_COMPRESS, 1 },
- /* 4 */
- {LDNS_RR_TYPE_MF, "MF", 1, 1, type_mf_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_COMPRESS, 1 },
- /* 5 */
- {LDNS_RR_TYPE_CNAME, "CNAME", 1, 1, type_cname_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_COMPRESS, 1 },
- /* 6 */
- {LDNS_RR_TYPE_SOA, "SOA", 7, 7, type_soa_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_COMPRESS, 2 },
- /* 7 */
- {LDNS_RR_TYPE_MB, "MB", 1, 1, type_mb_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_COMPRESS, 1 },
- /* 8 */
- {LDNS_RR_TYPE_MG, "MG", 1, 1, type_mg_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_COMPRESS, 1 },
- /* 9 */
- {LDNS_RR_TYPE_MR, "MR", 1, 1, type_mr_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_COMPRESS, 1 },
- /* 10 */
- {LDNS_RR_TYPE_NULL, "NULL", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
- /* 11 */
- {LDNS_RR_TYPE_WKS, "WKS", 2, 2, type_wks_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
- /* 12 */
- {LDNS_RR_TYPE_PTR, "PTR", 1, 1, type_ptr_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_COMPRESS, 1 },
- /* 13 */
- {LDNS_RR_TYPE_HINFO, "HINFO", 2, 2, type_hinfo_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
- /* 14 */
- {LDNS_RR_TYPE_MINFO, "MINFO", 2, 2, type_minfo_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_COMPRESS, 2 },
- /* 15 */
- {LDNS_RR_TYPE_MX, "MX", 2, 2, type_mx_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_COMPRESS, 1 },
- /* 16 */
- {LDNS_RR_TYPE_TXT, "TXT", 1, 0, NULL, LDNS_RDF_TYPE_STR, LDNS_RR_NO_COMPRESS, 0 },
- /* 17 */
- {LDNS_RR_TYPE_RP, "RP", 2, 2, type_rp_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 2 },
- /* 18 */
- {LDNS_RR_TYPE_AFSDB, "AFSDB", 2, 2, type_afsdb_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 1 },
- /* 19 */
- {LDNS_RR_TYPE_X25, "X25", 1, 1, type_x25_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
- /* 20 */
- {LDNS_RR_TYPE_ISDN, "ISDN", 1, 2, type_isdn_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
- /* 21 */
- {LDNS_RR_TYPE_RT, "RT", 2, 2, type_rt_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 1 },
- /* 22 */
- {LDNS_RR_TYPE_NSAP, "NSAP", 1, 1, type_nsap_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
- /* 23 */
- {LDNS_RR_TYPE_NSAP_PTR, "NSAP-PTR", 1, 1, type_nsap_ptr_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
- /* 24 */
- {LDNS_RR_TYPE_SIG, "SIG", 9, 9, type_sig_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 1 },
- /* 25 */
- {LDNS_RR_TYPE_KEY, "KEY", 4, 4, type_key_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
- /* 26 */
- {LDNS_RR_TYPE_PX, "PX", 3, 3, type_px_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 2 },
- /* 27 */
- {LDNS_RR_TYPE_GPOS, "GPOS", 3, 3, type_gpos_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
- /* 28 */
- {LDNS_RR_TYPE_AAAA, "AAAA", 1, 1, type_aaaa_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
- /* 29 */
- {LDNS_RR_TYPE_LOC, "LOC", 1, 1, type_loc_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
- /* 30 */
- {LDNS_RR_TYPE_NXT, "NXT", 2, 2, type_nxt_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 1 },
- /* 31 */
- {LDNS_RR_TYPE_EID, "EID", 1, 1, type_eid_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
- /* 32 */
- {LDNS_RR_TYPE_NIMLOC, "NIMLOC", 1, 1, type_nimloc_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
- /* 33 */
- {LDNS_RR_TYPE_SRV, "SRV", 4, 4, type_srv_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 1 },
- /* 34 */
- {LDNS_RR_TYPE_ATMA, "ATMA", 1, 1, type_atma_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
- /* 35 */
- {LDNS_RR_TYPE_NAPTR, "NAPTR", 6, 6, type_naptr_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 1 },
- /* 36 */
- {LDNS_RR_TYPE_KX, "KX", 2, 2, type_kx_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 1 },
- /* 37 */
- {LDNS_RR_TYPE_CERT, "CERT", 4, 4, type_cert_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
- /* 38 */
- {LDNS_RR_TYPE_A6, "A6", 1, 1, type_a6_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
- /* 39 */
- {LDNS_RR_TYPE_DNAME, "DNAME", 1, 1, type_dname_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 1 },
- /* 40 */
- {LDNS_RR_TYPE_SINK, "SINK", 1, 1, type_sink_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
- /* 41 */
- {LDNS_RR_TYPE_OPT, "OPT", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
- /* 42 */
- {LDNS_RR_TYPE_APL, "APL", 0, 0, type_apl_wireformat, LDNS_RDF_TYPE_APL, LDNS_RR_NO_COMPRESS, 0 },
- /* 43 */
- {LDNS_RR_TYPE_DS, "DS", 4, 4, type_ds_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
- /* 44 */
- {LDNS_RR_TYPE_SSHFP, "SSHFP", 3, 3, type_sshfp_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
- /* 45 */
- {LDNS_RR_TYPE_IPSECKEY, "IPSECKEY", 1, 1, type_ipseckey_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
- /* 46 */
- {LDNS_RR_TYPE_RRSIG, "RRSIG", 9, 9, type_rrsig_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 1 },
- /* 47 */
- {LDNS_RR_TYPE_NSEC, "NSEC", 1, 2, type_nsec_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 1 },
- /* 48 */
- {LDNS_RR_TYPE_DNSKEY, "DNSKEY", 4, 4, type_dnskey_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
- /* 49 */
- {LDNS_RR_TYPE_DHCID, "DHCID", 1, 1, type_dhcid_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
- /* 50 */
- {LDNS_RR_TYPE_NSEC3, "NSEC3", 5, 6, type_nsec3_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
- /* 51 */
- {LDNS_RR_TYPE_NSEC3PARAM, "NSEC3PARAM", 4, 4, type_nsec3param_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
- /* 52 */
- {LDNS_RR_TYPE_TLSA, "TLSA", 4, 4, type_tlsa_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-
-{LDNS_RR_TYPE_NULL, "TYPE53", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE54", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
- /* 55
- * Hip ends with 0 or more Rendezvous Servers represented as dname's.
- * Hence the LDNS_RDF_TYPE_DNAME _variable field and the _maximum field
- * set to 0.
- */
- {LDNS_RR_TYPE_HIP, "HIP", 1, 1, type_hip_wireformat, LDNS_RDF_TYPE_DNAME, LDNS_RR_NO_COMPRESS, 0 },
-
-#ifdef DRAFT_RRTYPES
- /* 56 */
- {LDNS_RR_TYPE_NINFO, "NINFO", 1, 0, NULL, LDNS_RDF_TYPE_STR, LDNS_RR_NO_COMPRESS, 0 },
- /* 57 */
- {LDNS_RR_TYPE_RKEY, "RKEY", 4, 4, type_key_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-#else
-{LDNS_RR_TYPE_NULL, "TYPE56", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE57", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-#endif
- /* 58 */
- {LDNS_RR_TYPE_TALINK, "TALINK", 2, 2, type_talink_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 2 },
-
-#ifdef DRAFT_RRTYPES
- /* 59 */
- {LDNS_RR_TYPE_CDS, "CDS", 4, 4, type_ds_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-#else
-{LDNS_RR_TYPE_NULL, "TYPE59", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-#endif
-
-{LDNS_RR_TYPE_NULL, "TYPE60", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE61", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE62", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE63", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE64", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE65", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE66", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE67", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE68", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE69", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE70", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE71", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE72", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE73", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE74", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE75", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE76", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE77", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE78", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE79", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE80", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE81", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE82", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE83", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE84", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE85", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE86", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE87", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE88", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE89", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE90", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE91", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE92", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE93", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE94", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE95", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE96", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE97", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE98", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-
- /* 99 */
- {LDNS_RR_TYPE_SPF, "SPF", 1, 0, NULL, LDNS_RDF_TYPE_STR, LDNS_RR_NO_COMPRESS, 0 },
-
- /* UINFO [IANA-Reserved] */
-{LDNS_RR_TYPE_NULL, "TYPE100", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
- /* UID [IANA-Reserved] */
-{LDNS_RR_TYPE_NULL, "TYPE101", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
- /* GID [IANA-Reserved] */
-{LDNS_RR_TYPE_NULL, "TYPE102", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
- /* UNSPEC [IANA-Reserved] */
-{LDNS_RR_TYPE_NULL, "TYPE103", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-
- /* 104 */
- {LDNS_RR_TYPE_NID, "NID", 2, 2, type_nid_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
- /* 105 */
- {LDNS_RR_TYPE_L32, "L32", 2, 2, type_l32_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
- /* 106 */
- {LDNS_RR_TYPE_L64, "L64", 2, 2, type_l64_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
- /* 107 */
- {LDNS_RR_TYPE_LP, "LP", 2, 2, type_lp_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 1 },
-
- /* 108 */
- {LDNS_RR_TYPE_EUI48, "EUI48", 1, 1, type_eui48_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
- /* 109 */
- {LDNS_RR_TYPE_EUI64, "EUI64", 1, 1, type_eui64_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-
-{LDNS_RR_TYPE_NULL, "TYPE110", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE111", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE112", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE113", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE114", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE115", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE116", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE117", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE118", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE119", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE120", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE121", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE122", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE123", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE124", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE125", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE126", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE127", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE128", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE129", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE130", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE131", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE132", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE133", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE134", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE135", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE136", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE137", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE138", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE139", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE140", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE141", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE142", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE143", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE144", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE145", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE146", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE147", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE148", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE149", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE150", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE151", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE152", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE153", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE154", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE155", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE156", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE157", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE158", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE159", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE160", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE161", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE162", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE163", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE164", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE165", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE166", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE167", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE168", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE169", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE170", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE171", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE172", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE173", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE174", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE175", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE176", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE177", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE178", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE179", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE180", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE181", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE182", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE183", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE184", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE185", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE186", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE187", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE188", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE189", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE190", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE191", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE192", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE193", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE194", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE195", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE196", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE197", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE198", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE199", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE200", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE201", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE202", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE203", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE204", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE205", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE206", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE207", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE208", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE209", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE210", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE211", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE212", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE213", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE214", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE215", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE216", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE217", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE218", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE219", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE220", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE221", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE222", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE223", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE224", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE225", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE226", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE227", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE228", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE229", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE230", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE231", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE232", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE233", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE234", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE235", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE236", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE237", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE238", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE239", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE240", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE241", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE242", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE243", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE244", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE245", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE246", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE247", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-{LDNS_RR_TYPE_NULL, "TYPE248", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-
- /* LDNS_RDF_TYPE_INT16_DATA takes two fields (length and data) as one.
- * So, unlike RFC 2930 spec, we have 7 min/max rdf's i.s.o. 8/9.
- */
- /* 249 */
- {LDNS_RR_TYPE_TKEY, "TKEY", 7, 7, type_tkey_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 1 },
- /* LDNS_RDF_TYPE_INT16_DATA takes two fields (length and data) as one.
- * So, unlike RFC 2930 spec, we have 7 min/max rdf's i.s.o. 8/9.
- */
- /* 250 */
- {LDNS_RR_TYPE_TSIG, "TSIG", 7, 7, type_tsig_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 1 },
-
- /* IXFR: A request for a transfer of an incremental zone transfer */
-{LDNS_RR_TYPE_IXFR, "IXFR", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
- /* AXFR: A request for a transfer of an entire zone */
-{LDNS_RR_TYPE_AXFR, "AXFR", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
- /* MAILB: A request for mailbox-related records (MB, MG or MR) */
-{LDNS_RR_TYPE_MAILB, "MAILB", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
- /* MAILA: A request for mail agent RRs (Obsolete - see MX) */
-{LDNS_RR_TYPE_MAILA, "MAILA", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
- /* ANY: A request for all (available) records */
-{LDNS_RR_TYPE_ANY, "ANY", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-
-#ifdef DRAFT_RRTYPES
- /* 256 */
- {LDNS_RR_TYPE_URI, "URI", 3, 3, type_uri_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-#else
-{LDNS_RR_TYPE_NULL, "TYPE256", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-#endif
- /* 257 */
- {LDNS_RR_TYPE_CAA, "CAA", 3, 3, type_caa_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-
-/* split in array, no longer contiguous */
-
-#ifdef DRAFT_RRTYPES
- /* 32768 */
- {LDNS_RR_TYPE_TA, "TA", 4, 4, type_ds_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-#else
-{LDNS_RR_TYPE_NULL, "TYPE32768", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 },
-#endif
- /* 32769 */
- {LDNS_RR_TYPE_DLV, "DLV", 4, 4, type_ds_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 }
-};
-
-/**
- * \def LDNS_RDATA_FIELD_DESCRIPTORS_COUNT
- * computes the number of rdata fields
- */
-#define LDNS_RDATA_FIELD_DESCRIPTORS_COUNT \
- (sizeof(rdata_field_descriptors)/sizeof(rdata_field_descriptors[0]))
-
-const sldns_rr_descriptor *
-sldns_rr_descript(uint16_t type)
-{
- size_t i;
- if (type < LDNS_RDATA_FIELD_DESCRIPTORS_COMMON) {
- return &rdata_field_descriptors[type];
- } else {
- /* because not all array index equals type code */
- for (i = LDNS_RDATA_FIELD_DESCRIPTORS_COMMON;
- i < LDNS_RDATA_FIELD_DESCRIPTORS_COUNT;
- i++) {
- if (rdata_field_descriptors[i]._type == type) {
- return &rdata_field_descriptors[i];
- }
- }
- return &rdata_field_descriptors[0];
- }
-}
-
-size_t
-sldns_rr_descriptor_minimum(const sldns_rr_descriptor *descriptor)
-{
- if (descriptor) {
- return descriptor->_minimum;
- } else {
- return 0;
- }
-}
-
-size_t
-sldns_rr_descriptor_maximum(const sldns_rr_descriptor *descriptor)
-{
- if (descriptor) {
- if (descriptor->_variable != LDNS_RDF_TYPE_NONE) {
- return 65535; /* cannot be more than 64k */
- } else {
- return descriptor->_maximum;
- }
- } else {
- return 0;
- }
-}
-
-sldns_rdf_type
-sldns_rr_descriptor_field_type(const sldns_rr_descriptor *descriptor,
- size_t index)
-{
- assert(descriptor != NULL);
- assert(index < descriptor->_maximum
- || descriptor->_variable != LDNS_RDF_TYPE_NONE);
- if (index < descriptor->_maximum) {
- return descriptor->_wireformat[index];
- } else {
- return descriptor->_variable;
- }
-}
-
-sldns_rr_type
-sldns_get_rr_type_by_name(const char *name)
-{
- unsigned int i;
- const char *desc_name;
- const sldns_rr_descriptor *desc;
-
- /* TYPEXX representation */
- if (strlen(name) > 4 && strncasecmp(name, "TYPE", 4) == 0) {
- return atoi(name + 4);
- }
-
- /* Normal types */
- for (i = 0; i < (unsigned int) LDNS_RDATA_FIELD_DESCRIPTORS_COUNT; i++) {
- desc = &rdata_field_descriptors[i];
- desc_name = desc->_name;
- if(desc_name &&
- strlen(name) == strlen(desc_name) &&
- strncasecmp(name, desc_name, strlen(desc_name)) == 0) {
- /* because not all array index equals type code */
- return desc->_type;
- }
- }
-
- /* special cases for query types */
- if (strlen(name) == 4 && strncasecmp(name, "IXFR", 4) == 0) {
- return 251;
- } else if (strlen(name) == 4 && strncasecmp(name, "AXFR", 4) == 0) {
- return 252;
- } else if (strlen(name) == 5 && strncasecmp(name, "MAILB", 5) == 0) {
- return 253;
- } else if (strlen(name) == 5 && strncasecmp(name, "MAILA", 5) == 0) {
- return 254;
- } else if (strlen(name) == 3 && strncasecmp(name, "ANY", 3) == 0) {
- return 255;
- }
-
- return 0;
-}
-
-sldns_rr_class
-sldns_get_rr_class_by_name(const char *name)
-{
- sldns_lookup_table *lt;
-
- /* CLASSXX representation */
- if (strlen(name) > 5 && strncasecmp(name, "CLASS", 5) == 0) {
- return atoi(name + 5);
- }
-
- /* Normal types */
- lt = sldns_lookup_by_name(sldns_rr_classes, name);
- if (lt) {
- return lt->id;
- }
- return 0;
-}
+++ /dev/null
-/*
- * rrdef.h
- *
- * RR definitions
- *
- * a Net::DNS like library for C
- *
- * (c) NLnet Labs, 2005-2006
- *
- * See the file LICENSE for the license
- */
-
-/**
- * \file
- *
- * Defines resource record types and constants.
- */
-
-#ifndef LDNS_RRDEF_H
-#define LDNS_RRDEF_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** Maximum length of a dname label */
-#define LDNS_MAX_LABELLEN 63
-/** Maximum length of a complete dname */
-#define LDNS_MAX_DOMAINLEN 255
-/** Maximum number of pointers in 1 dname */
-#define LDNS_MAX_POINTERS 65535
-/** The bytes TTL, CLASS and length use up in an rr */
-#define LDNS_RR_OVERHEAD 10
-
-#define LDNS_DNSSEC_KEYPROTO 3
-#define LDNS_KEY_ZONE_KEY 0x0100 /* set for ZSK&KSK, rfc 4034 */
-#define LDNS_KEY_SEP_KEY 0x0001 /* set for KSK, rfc 4034 */
-#define LDNS_KEY_REVOKE_KEY 0x0080 /* used to revoke KSK, rfc 5011 */
-
-/* The first fields are contiguous and can be referenced instantly */
-#define LDNS_RDATA_FIELD_DESCRIPTORS_COMMON 258
-
-/** lookuptable for rr classes */
-extern struct sldns_struct_lookup_table* sldns_rr_classes;
-
-/**
- * The different RR classes.
- */
-enum sldns_enum_rr_class
-{
- /** the Internet */
- LDNS_RR_CLASS_IN = 1,
- /** Chaos class */
- LDNS_RR_CLASS_CH = 3,
- /** Hesiod (Dyer 87) */
- LDNS_RR_CLASS_HS = 4,
- /** None class, dynamic update */
- LDNS_RR_CLASS_NONE = 254,
- /** Any class */
- LDNS_RR_CLASS_ANY = 255,
-
- LDNS_RR_CLASS_FIRST = 0,
- LDNS_RR_CLASS_LAST = 65535,
- LDNS_RR_CLASS_COUNT = LDNS_RR_CLASS_LAST - LDNS_RR_CLASS_FIRST + 1
-};
-typedef enum sldns_enum_rr_class sldns_rr_class;
-
-/**
- * Used to specify whether compression is allowed.
- */
-enum sldns_enum_rr_compress
-{
- /** compression is allowed */
- LDNS_RR_COMPRESS,
- LDNS_RR_NO_COMPRESS
-};
-typedef enum sldns_enum_rr_compress sldns_rr_compress;
-
-/**
- * The different RR types.
- */
-enum sldns_enum_rr_type
-{
- /** a host address */
- LDNS_RR_TYPE_A = 1,
- /** an authoritative name server */
- LDNS_RR_TYPE_NS = 2,
- /** a mail destination (Obsolete - use MX) */
- LDNS_RR_TYPE_MD = 3,
- /** a mail forwarder (Obsolete - use MX) */
- LDNS_RR_TYPE_MF = 4,
- /** the canonical name for an alias */
- LDNS_RR_TYPE_CNAME = 5,
- /** marks the start of a zone of authority */
- LDNS_RR_TYPE_SOA = 6,
- /** a mailbox domain name (EXPERIMENTAL) */
- LDNS_RR_TYPE_MB = 7,
- /** a mail group member (EXPERIMENTAL) */
- LDNS_RR_TYPE_MG = 8,
- /** a mail rename domain name (EXPERIMENTAL) */
- LDNS_RR_TYPE_MR = 9,
- /** a null RR (EXPERIMENTAL) */
- LDNS_RR_TYPE_NULL = 10,
- /** a well known service description */
- LDNS_RR_TYPE_WKS = 11,
- /** a domain name pointer */
- LDNS_RR_TYPE_PTR = 12,
- /** host information */
- LDNS_RR_TYPE_HINFO = 13,
- /** mailbox or mail list information */
- LDNS_RR_TYPE_MINFO = 14,
- /** mail exchange */
- LDNS_RR_TYPE_MX = 15,
- /** text strings */
- LDNS_RR_TYPE_TXT = 16,
- /** RFC1183 */
- LDNS_RR_TYPE_RP = 17,
- /** RFC1183 */
- LDNS_RR_TYPE_AFSDB = 18,
- /** RFC1183 */
- LDNS_RR_TYPE_X25 = 19,
- /** RFC1183 */
- LDNS_RR_TYPE_ISDN = 20,
- /** RFC1183 */
- LDNS_RR_TYPE_RT = 21,
- /** RFC1706 */
- LDNS_RR_TYPE_NSAP = 22,
- /** RFC1348 */
- LDNS_RR_TYPE_NSAP_PTR = 23,
- /** 2535typecode */
- LDNS_RR_TYPE_SIG = 24,
- /** 2535typecode */
- LDNS_RR_TYPE_KEY = 25,
- /** RFC2163 */
- LDNS_RR_TYPE_PX = 26,
- /** RFC1712 */
- LDNS_RR_TYPE_GPOS = 27,
- /** ipv6 address */
- LDNS_RR_TYPE_AAAA = 28,
- /** LOC record RFC1876 */
- LDNS_RR_TYPE_LOC = 29,
- /** 2535typecode */
- LDNS_RR_TYPE_NXT = 30,
- /** draft-ietf-nimrod-dns-01.txt */
- LDNS_RR_TYPE_EID = 31,
- /** draft-ietf-nimrod-dns-01.txt */
- LDNS_RR_TYPE_NIMLOC = 32,
- /** SRV record RFC2782 */
- LDNS_RR_TYPE_SRV = 33,
- /** http://www.jhsoft.com/rfc/af-saa-0069.000.rtf */
- LDNS_RR_TYPE_ATMA = 34,
- /** RFC2915 */
- LDNS_RR_TYPE_NAPTR = 35,
- /** RFC2230 */
- LDNS_RR_TYPE_KX = 36,
- /** RFC2538 */
- LDNS_RR_TYPE_CERT = 37,
- /** RFC2874 */
- LDNS_RR_TYPE_A6 = 38,
- /** RFC2672 */
- LDNS_RR_TYPE_DNAME = 39,
- /** dnsind-kitchen-sink-02.txt */
- LDNS_RR_TYPE_SINK = 40,
- /** Pseudo OPT record... */
- LDNS_RR_TYPE_OPT = 41,
- /** RFC3123 */
- LDNS_RR_TYPE_APL = 42,
- /** RFC4034, RFC3658 */
- LDNS_RR_TYPE_DS = 43,
- /** SSH Key Fingerprint */
- LDNS_RR_TYPE_SSHFP = 44, /* RFC 4255 */
- /** IPsec Key */
- LDNS_RR_TYPE_IPSECKEY = 45, /* RFC 4025 */
- /** DNSSEC */
- LDNS_RR_TYPE_RRSIG = 46, /* RFC 4034 */
- LDNS_RR_TYPE_NSEC = 47, /* RFC 4034 */
- LDNS_RR_TYPE_DNSKEY = 48, /* RFC 4034 */
-
- LDNS_RR_TYPE_DHCID = 49, /* RFC 4701 */
- /* NSEC3 */
- LDNS_RR_TYPE_NSEC3 = 50, /* RFC 5155 */
- LDNS_RR_TYPE_NSEC3PARAM = 51, /* RFC 5155 */
- LDNS_RR_TYPE_NSEC3PARAMS = 51,
- 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, /* 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 */
-
- /** draft-jabley-dnsext-eui48-eui64-rrtypes */
- LDNS_RR_TYPE_EUI48 = 108,
- LDNS_RR_TYPE_EUI64 = 109,
-
- LDNS_RR_TYPE_TKEY = 249, /* RFC 2930 */
- LDNS_RR_TYPE_TSIG = 250,
- LDNS_RR_TYPE_IXFR = 251,
- LDNS_RR_TYPE_AXFR = 252,
- /** A request for mailbox-related records (MB, MG or MR) */
- LDNS_RR_TYPE_MAILB = 253,
- /** A request for mail agent RRs (Obsolete - see MX) */
- 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,
-
- /* type codes from nsec3 experimental phase
- LDNS_RR_TYPE_NSEC3 = 65324,
- LDNS_RR_TYPE_NSEC3PARAMS = 65325, */
- LDNS_RR_TYPE_FIRST = 0,
- LDNS_RR_TYPE_LAST = 65535,
- LDNS_RR_TYPE_COUNT = LDNS_RR_TYPE_LAST - LDNS_RR_TYPE_FIRST + 1
-};
-typedef enum sldns_enum_rr_type sldns_rr_type;
-
-/* RDATA */
-#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
-
-#define LDNS_APL_IP4 1
-#define LDNS_APL_IP6 2
-#define LDNS_APL_MASK 0x7f
-#define LDNS_APL_NEGATION 0x80
-
-/**
- * The different types of RDATA fields.
- */
-enum sldns_enum_rdf_type
-{
- /** none */
- LDNS_RDF_TYPE_NONE,
- /** domain name */
- LDNS_RDF_TYPE_DNAME,
- /** 8 bits */
- LDNS_RDF_TYPE_INT8,
- /** 16 bits */
- LDNS_RDF_TYPE_INT16,
- /** 32 bits */
- LDNS_RDF_TYPE_INT32,
- /** A record */
- LDNS_RDF_TYPE_A,
- /** AAAA record */
- LDNS_RDF_TYPE_AAAA,
- /** txt string */
- LDNS_RDF_TYPE_STR,
- /** apl data */
- LDNS_RDF_TYPE_APL,
- /** b32 string */
- LDNS_RDF_TYPE_B32_EXT,
- /** b64 string */
- LDNS_RDF_TYPE_B64,
- /** hex string */
- LDNS_RDF_TYPE_HEX,
- /** nsec type codes */
- LDNS_RDF_TYPE_NSEC,
- /** a RR type */
- LDNS_RDF_TYPE_TYPE,
- /** a class */
- LDNS_RDF_TYPE_CLASS,
- /** certificate algorithm */
- LDNS_RDF_TYPE_CERT_ALG,
- /** a key algorithm */
- LDNS_RDF_TYPE_ALG,
- /** unknown types */
- LDNS_RDF_TYPE_UNKNOWN,
- /** time (32 bits) */
- LDNS_RDF_TYPE_TIME,
- /** period */
- LDNS_RDF_TYPE_PERIOD,
- /** tsig time 48 bits */
- LDNS_RDF_TYPE_TSIGTIME,
- /** 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,
- /** protocol and port bitmaps */
- LDNS_RDF_TYPE_SERVICE,
- /** location data */
- LDNS_RDF_TYPE_LOC,
- /** well known services */
- LDNS_RDF_TYPE_WKS,
- /** NSAP */
- LDNS_RDF_TYPE_NSAP,
- /** ATMA */
- LDNS_RDF_TYPE_ATMA,
- /** IPSECKEY */
- LDNS_RDF_TYPE_IPSECKEY,
- /** nsec3 hash salt */
- LDNS_RDF_TYPE_NSEC3_SALT,
- /** nsec3 base32 string (with length byte on wire */
- LDNS_RDF_TYPE_NSEC3_NEXT_OWNER,
-
- /** 4 shorts represented as 4 * 16 bit hex numbers
- * seperated by colons. For NID and L64.
- */
- LDNS_RDF_TYPE_ILNP64,
-
- /** 6 * 8 bit hex numbers seperated by dashes. For EUI48. */
- LDNS_RDF_TYPE_EUI48,
- /** 8 * 8 bit hex numbers seperated 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 sldns_enum_rdf_type sldns_rdf_type;
-
-/**
- * Algorithms used in dns
- */
-enum sldns_enum_algorithm
-{
- LDNS_RSAMD5 = 1, /* RFC 4034,4035 */
- LDNS_DH = 2,
- LDNS_DSA = 3,
- LDNS_ECC = 4,
- LDNS_RSASHA1 = 5,
- LDNS_DSA_NSEC3 = 6,
- LDNS_RSASHA1_NSEC3 = 7,
- LDNS_RSASHA256 = 8, /* RFC 5702 */
- LDNS_RSASHA512 = 10, /* RFC 5702 */
- LDNS_ECC_GOST = 12, /* RFC 5933 */
- LDNS_ECDSAP256SHA256 = 13, /* RFC 6605 */
- LDNS_ECDSAP384SHA384 = 14, /* RFC 6605 */
- LDNS_INDIRECT = 252,
- LDNS_PRIVATEDNS = 253,
- LDNS_PRIVATEOID = 254
-};
-typedef enum sldns_enum_algorithm sldns_algorithm;
-
-/**
- * Hashing algorithms used in the DS record
- */
-enum sldns_enum_hash
-{
- LDNS_SHA1 = 1, /* RFC 4034 */
- LDNS_SHA256 = 2, /* RFC 4509 */
- LDNS_HASH_GOST = 3, /* RFC 5933 */
- LDNS_SHA384 = 4 /* RFC 6605 */
-};
-typedef enum sldns_enum_hash sldns_hash;
-
-/**
- * algorithms used in CERT rrs
- */
-enum sldns_enum_cert_algorithm
-{
- LDNS_CERT_PKIX = 1,
- LDNS_CERT_SPKI = 2,
- LDNS_CERT_PGP = 3,
- LDNS_CERT_IPKIX = 4,
- LDNS_CERT_ISPKI = 5,
- LDNS_CERT_IPGP = 6,
- LDNS_CERT_ACPKIX = 7,
- LDNS_CERT_IACPKIX = 8,
- LDNS_CERT_URI = 253,
- LDNS_CERT_OID = 254
-};
-typedef enum sldns_enum_cert_algorithm sldns_cert_algorithm;
-
-/**
- * EDNS option codes
- */
-enum sldns_enum_edns_option
-{
- LDNS_EDNS_LLQ = 1, /* http://files.dns-sd.org/draft-sekar-dns-llq.txt */
- LDNS_EDNS_UL = 2, /* http://files.dns-sd.org/draft-sekar-dns-ul.txt */
- LDNS_EDNS_NSID = 3, /* RFC5001 */
- /* 4 draft-cheshire-edns0-owner-option */
- LDNS_EDNS_DAU = 5, /* RFC6975 */
- LDNS_EDNS_DHU = 6, /* RFC6975 */
- LDNS_EDNS_N3U = 7, /* RFC6975 */
- LDNS_EDNS_CLIENT_SUBNET = 8 /* draft-vandergaast-edns-client-subnet */
-};
-typedef enum sldns_edns_option sldns_edns_option;
-
-#define LDNS_EDNS_MASK_DO_BIT 0x8000
-
-/**
- * Contains all information about resource record types.
- *
- * This structure contains, for all rr types, the rdata fields that are defined.
- */
-struct sldns_struct_rr_descriptor
-{
- /** Type of the RR that is described here */
- sldns_rr_type _type;
- /** Textual name of the RR type. */
- const char *_name;
- /** Minimum number of rdata fields in the RRs of this type. */
- uint8_t _minimum;
- /** Maximum number of rdata fields in the RRs of this type. */
- uint8_t _maximum;
- /** Wireformat specification for the rr, i.e. the types of rdata fields in their respective order. */
- const sldns_rdf_type *_wireformat;
- /** Special rdf types */
- sldns_rdf_type _variable;
- /** Specifies whether compression can be used for dnames in this RR type. */
- sldns_rr_compress _compress;
- /** The number of DNAMEs in the _wireformat string, for parsing. */
- uint8_t _dname_count;
-};
-typedef struct sldns_struct_rr_descriptor sldns_rr_descriptor;
-
-/**
- * returns the resource record descriptor for the given rr type.
- *
- * \param[in] type the type value of the rr type
- *\return the sldns_rr_descriptor for this type
- */
-const sldns_rr_descriptor *sldns_rr_descript(uint16_t type);
-
-/**
- * returns the minimum number of rdata fields of the rr type this descriptor describes.
- *
- * \param[in] descriptor for an rr type
- * \return the minimum number of rdata fields
- */
-size_t sldns_rr_descriptor_minimum(const sldns_rr_descriptor *descriptor);
-
-/**
- * returns the maximum number of rdata fields of the rr type this descriptor describes.
- *
- * \param[in] descriptor for an rr type
- * \return the maximum number of rdata fields
- */
-size_t sldns_rr_descriptor_maximum(const sldns_rr_descriptor *descriptor);
-
-/**
- * returns the rdf type for the given rdata field number of the rr type for the given descriptor.
- *
- * \param[in] descriptor for an rr type
- * \param[in] field the field number
- * \return the rdf type for the field
- */
-sldns_rdf_type sldns_rr_descriptor_field_type(const sldns_rr_descriptor *descriptor, size_t field);
-
-/**
- * retrieves a rrtype by looking up its name.
- * \param[in] name a string with the name
- * \return the type which corresponds with the name
- */
-sldns_rr_type sldns_get_rr_type_by_name(const char *name);
-
-/**
- * retrieves a class by looking up its name.
- * \param[in] name string with the name
- * \return the cass which corresponds with the name
- */
-sldns_rr_class sldns_get_rr_class_by_name(const char *name);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* LDNS_RRDEF_H */
+++ /dev/null
-/*
- * buffer.c -- generic memory buffer .
- *
- * Copyright (c) 2001-2008, NLnet Labs. All rights reserved.
- *
- * See LICENSE for the license.
- *
- */
-/**
- * \file
- *
- * This file contains the definition of sldns_buffer, and functions to manipulate those.
- */
-#include "config.h"
-#include "ldns/sbuffer.h"
-#include <stdarg.h>
-
-sldns_buffer *
-sldns_buffer_new(size_t capacity)
-{
- sldns_buffer *buffer = (sldns_buffer*)malloc(sizeof(sldns_buffer));
-
- if (!buffer) {
- return NULL;
- }
-
- buffer->_data = (uint8_t *) malloc(capacity);
- if (!buffer->_data) {
- free(buffer);
- return NULL;
- }
-
- buffer->_position = 0;
- buffer->_limit = buffer->_capacity = capacity;
- buffer->_fixed = 0;
- buffer->_status_err = 0;
-
- sldns_buffer_invariant(buffer);
-
- return buffer;
-}
-
-void
-sldns_buffer_new_frm_data(sldns_buffer *buffer, void *data, size_t size)
-{
- assert(data != NULL);
-
- buffer->_position = 0;
- buffer->_limit = buffer->_capacity = size;
- buffer->_fixed = 0;
- buffer->_data = malloc(size);
- if(!buffer->_data) {
- buffer->_status_err = 1;
- return;
- }
- memcpy(buffer->_data, data, size);
- buffer->_status_err = 0;
-
- sldns_buffer_invariant(buffer);
-}
-
-void
-sldns_buffer_init_frm_data(sldns_buffer *buffer, void *data, size_t size)
-{
- memset(buffer, 0, sizeof(*buffer));
- buffer->_data = data;
- buffer->_capacity = buffer->_limit = size;
- buffer->_fixed = 1;
-}
-
-int
-sldns_buffer_set_capacity(sldns_buffer *buffer, size_t capacity)
-{
- void *data;
-
- sldns_buffer_invariant(buffer);
- assert(buffer->_position <= capacity);
-
- data = (uint8_t *) realloc(buffer->_data, capacity);
- if (!data) {
- buffer->_status_err = 1;
- return 0;
- } else {
- buffer->_data = data;
- buffer->_limit = buffer->_capacity = capacity;
- return 1;
- }
-}
-
-int
-sldns_buffer_reserve(sldns_buffer *buffer, size_t amount)
-{
- sldns_buffer_invariant(buffer);
- assert(!buffer->_fixed);
- if (buffer->_capacity < buffer->_position + amount) {
- size_t new_capacity = buffer->_capacity * 3 / 2;
-
- if (new_capacity < buffer->_position + amount) {
- new_capacity = buffer->_position + amount;
- }
- if (!sldns_buffer_set_capacity(buffer, new_capacity)) {
- buffer->_status_err = 1;
- return 0;
- }
- }
- buffer->_limit = buffer->_capacity;
- return 1;
-}
-
-int
-sldns_buffer_printf(sldns_buffer *buffer, const char *format, ...)
-{
- va_list args;
- int written = 0;
- size_t remaining;
-
- if (sldns_buffer_status_ok(buffer)) {
- sldns_buffer_invariant(buffer);
- assert(buffer->_limit == buffer->_capacity);
-
- remaining = sldns_buffer_remaining(buffer);
- va_start(args, format);
- written = vsnprintf((char *) sldns_buffer_current(buffer), remaining,
- format, args);
- va_end(args);
- if (written == -1) {
- buffer->_status_err = 1;
- return -1;
- } else if ((size_t) written >= remaining) {
- if (!sldns_buffer_reserve(buffer, (size_t) written + 1)) {
- buffer->_status_err = 1;
- return -1;
- }
- va_start(args, format);
- written = vsnprintf((char *) sldns_buffer_current(buffer),
- sldns_buffer_remaining(buffer), format, args);
- va_end(args);
- if (written == -1) {
- buffer->_status_err = 1;
- return -1;
- }
- }
- buffer->_position += written;
- }
- return written;
-}
-
-void
-sldns_buffer_free(sldns_buffer *buffer)
-{
- if (!buffer) {
- return;
- }
-
- if (!buffer->_fixed)
- free(buffer->_data);
-
- free(buffer);
-}
-
-void *
-sldns_buffer_export(sldns_buffer *buffer)
-{
- buffer->_fixed = 1;
- return buffer->_data;
-}
-
-int
-sldns_bgetc(sldns_buffer *buffer)
-{
- if (!sldns_buffer_available_at(buffer, buffer->_position, sizeof(uint8_t))) {
- sldns_buffer_set_position(buffer, sldns_buffer_limit(buffer));
- /* sldns_buffer_rewind(buffer);*/
- return EOF;
- }
- return (int)sldns_buffer_read_u8(buffer);
-}
-
-void
-sldns_buffer_copy(sldns_buffer* result, sldns_buffer* from)
-{
- size_t tocopy = sldns_buffer_limit(from);
-
- if(tocopy > sldns_buffer_capacity(result))
- tocopy = sldns_buffer_capacity(result);
- sldns_buffer_clear(result);
- sldns_buffer_write(result, sldns_buffer_begin(from), tocopy);
- sldns_buffer_flip(result);
-}
+++ /dev/null
-/*
- * buffer.h -- generic memory buffer.
- *
- * Copyright (c) 2005-2008, NLnet Labs. All rights reserved.
- *
- * See LICENSE for the license.
- *
- *
- * The buffer module implements a generic buffer. The API is based on
- * the java.nio.Buffer interface.
- */
-
-#ifndef LDNS_SBUFFER_H
-#define LDNS_SBUFFER_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef S_SPLINT_S
-# define INLINE
-#else
-# ifdef SWIG
-# define INLINE static
-# else
-# define INLINE static inline
-# endif
-#endif
-
-/*
- * Copy data allowing for unaligned accesses in network byte order
- * (big endian).
- */
-INLINE uint16_t
-sldns_read_uint16(const void *src)
-{
-#ifdef ALLOW_UNALIGNED_ACCESSES
- return ntohs(*(uint16_t *) src);
-#else
- uint8_t *p = (uint8_t *) src;
- return ((uint16_t) p[0] << 8) | (uint16_t) p[1];
-#endif
-}
-
-INLINE uint32_t
-sldns_read_uint32(const void *src)
-{
-#ifdef ALLOW_UNALIGNED_ACCESSES
- return ntohl(*(uint32_t *) src);
-#else
- uint8_t *p = (uint8_t *) src;
- return ( ((uint32_t) p[0] << 24)
- | ((uint32_t) p[1] << 16)
- | ((uint32_t) p[2] << 8)
- | (uint32_t) p[3]);
-#endif
-}
-
-/*
- * Copy data allowing for unaligned accesses in network byte order
- * (big endian).
- */
-INLINE void
-sldns_write_uint16(void *dst, uint16_t data)
-{
-#ifdef ALLOW_UNALIGNED_ACCESSES
- * (uint16_t *) dst = htons(data);
-#else
- uint8_t *p = (uint8_t *) dst;
- p[0] = (uint8_t) ((data >> 8) & 0xff);
- p[1] = (uint8_t) (data & 0xff);
-#endif
-}
-
-INLINE void
-sldns_write_uint32(void *dst, uint32_t data)
-{
-#ifdef ALLOW_UNALIGNED_ACCESSES
- * (uint32_t *) dst = htonl(data);
-#else
- uint8_t *p = (uint8_t *) dst;
- p[0] = (uint8_t) ((data >> 24) & 0xff);
- p[1] = (uint8_t) ((data >> 16) & 0xff);
- p[2] = (uint8_t) ((data >> 8) & 0xff);
- p[3] = (uint8_t) (data & 0xff);
-#endif
-}
-
-
-/**
- * \file sbuffer.h
- *
- * This file contains the definition of sldns_buffer, and functions to manipulate those.
- */
-
-/**
- * implementation of buffers to ease operations
- *
- * sldns_buffers can contain arbitrary information, per octet. You can write
- * to the current end of a buffer, read from the current position, and
- * access any data within it.
- */
-struct sldns_buffer
-{
- /** The current position used for reading/writing */
- size_t _position;
-
- /** The read/write limit */
- size_t _limit;
-
- /** The amount of data the buffer can contain */
- size_t _capacity;
-
- /** The data contained in the buffer */
- uint8_t *_data;
-
- /** If the buffer is fixed it cannot be resized */
- unsigned _fixed : 1;
-
- /** The current state of the buffer. If writing to the buffer fails
- * for any reason, this value is changed. This way, you can perform
- * multiple writes in sequence and check for success afterwards. */
- unsigned _status_err : 1;
-};
-typedef struct sldns_buffer sldns_buffer;
-
-#ifdef NDEBUG
-INLINE void
-sldns_buffer_invariant(sldns_buffer *ATTR_UNUSED(buffer))
-{
-}
-#else
-INLINE void
-sldns_buffer_invariant(sldns_buffer *buffer)
-{
- assert(buffer != NULL);
- assert(buffer->_position <= buffer->_limit);
- assert(buffer->_limit <= buffer->_capacity);
- assert(buffer->_data != NULL);
-}
-#endif
-
-/**
- * creates a new buffer with the specified capacity.
- *
- * \param[in] capacity the size (in bytes) to allocate for the buffer
- * \return the created buffer
- */
-sldns_buffer *sldns_buffer_new(size_t capacity);
-
-/**
- * creates a buffer with the specified data. The data IS copied
- * and MEMORY allocations are done. The buffer is not fixed and can
- * be resized using buffer_reserve().
- *
- * \param[in] buffer pointer to the buffer to put the data in
- * \param[in] data the data to encapsulate in the buffer
- * \param[in] size the size of the data
- */
-void sldns_buffer_new_frm_data(sldns_buffer *buffer, void *data, size_t size);
-
-/**
- * Setup a buffer with the data pointed to. No data copied, no memory allocs.
- * The buffer is fixed.
- * \param[in] buffer pointer to the buffer to put the data in
- * \param[in] data the data to encapsulate in the buffer
- * \param[in] size the size of the data
- */
-void sldns_buffer_init_frm_data(sldns_buffer *buffer, void *data, size_t size);
-
-/**
- * clears the buffer and make it ready for writing. The buffer's limit
- * is set to the capacity and the position is set to 0.
- * \param[in] buffer the buffer to clear
- */
-INLINE void sldns_buffer_clear(sldns_buffer *buffer)
-{
- sldns_buffer_invariant(buffer);
-
- /* reset status here? */
-
- buffer->_position = 0;
- buffer->_limit = buffer->_capacity;
-}
-
-/**
- * makes the buffer ready for reading the data that has been written to
- * the buffer. The buffer's limit is set to the current position and
- * the position is set to 0.
- *
- * \param[in] buffer the buffer to flip
- * \return void
- */
-INLINE void sldns_buffer_flip(sldns_buffer *buffer)
-{
- sldns_buffer_invariant(buffer);
-
- buffer->_limit = buffer->_position;
- buffer->_position = 0;
-}
-
-/**
- * make the buffer ready for re-reading the data. The buffer's
- * position is reset to 0.
- * \param[in] buffer the buffer to rewind
- */
-INLINE void sldns_buffer_rewind(sldns_buffer *buffer)
-{
- sldns_buffer_invariant(buffer);
-
- buffer->_position = 0;
-}
-
-/**
- * returns the current position in the buffer (as a number of bytes)
- * \param[in] buffer the buffer
- * \return the current position
- */
-INLINE size_t
-sldns_buffer_position(sldns_buffer *buffer)
-{
- return buffer->_position;
-}
-
-/**
- * sets the buffer's position to MARK. The position must be less than
- * or equal to the buffer's limit.
- * \param[in] buffer the buffer
- * \param[in] mark the mark to use
- */
-INLINE void
-sldns_buffer_set_position(sldns_buffer *buffer, size_t mark)
-{
- assert(mark <= buffer->_limit);
- buffer->_position = mark;
-}
-
-/**
- * changes the buffer's position by COUNT bytes. The position must not
- * be moved behind the buffer's limit or before the beginning of the
- * buffer.
- * \param[in] buffer the buffer
- * \param[in] count the count to use
- */
-INLINE void
-sldns_buffer_skip(sldns_buffer *buffer, ssize_t count)
-{
- assert(buffer->_position + count <= buffer->_limit);
- buffer->_position += count;
-}
-
-/**
- * returns the maximum size of the buffer
- * \param[in] buffer
- * \return the size
- */
-INLINE size_t
-sldns_buffer_limit(sldns_buffer *buffer)
-{
- return buffer->_limit;
-}
-
-/**
- * changes the buffer's limit. If the buffer's position is greater
- * than the new limit the position is set to the limit.
- * \param[in] buffer the buffer
- * \param[in] limit the new limit
- */
-INLINE void
-sldns_buffer_set_limit(sldns_buffer *buffer, size_t limit)
-{
- assert(limit <= buffer->_capacity);
- buffer->_limit = limit;
- if (buffer->_position > buffer->_limit)
- buffer->_position = buffer->_limit;
-}
-
-/**
- * returns the number of bytes the buffer can hold.
- * \param[in] buffer the buffer
- * \return the number of bytes
- */
-INLINE size_t
-sldns_buffer_capacity(sldns_buffer *buffer)
-{
- return buffer->_capacity;
-}
-
-/**
- * changes the buffer's capacity. The data is reallocated so any
- * pointers to the data may become invalid. The buffer's limit is set
- * to the buffer's new capacity.
- * \param[in] buffer the buffer
- * \param[in] capacity the capacity to use
- * \return whether this failed or succeeded
- */
-int sldns_buffer_set_capacity(sldns_buffer *buffer, size_t capacity);
-
-/**
- * ensures BUFFER can contain at least AMOUNT more bytes. The buffer's
- * capacity is increased if necessary using buffer_set_capacity().
- *
- * The buffer's limit is always set to the (possibly increased)
- * capacity.
- * \param[in] buffer the buffer
- * \param[in] amount amount to use
- * \return whether this failed or succeeded
- */
-int sldns_buffer_reserve(sldns_buffer *buffer, size_t amount);
-
-/**
- * returns a pointer to the data at the indicated position.
- * \param[in] buffer the buffer
- * \param[in] at position
- * \return the pointer to the data
- */
-INLINE uint8_t *
-sldns_buffer_at(const sldns_buffer *buffer, size_t at)
-{
- assert(at <= buffer->_limit);
- return buffer->_data + at;
-}
-
-/**
- * returns a pointer to the beginning of the buffer (the data at
- * position 0).
- * \param[in] buffer the buffer
- * \return the pointer
- */
-INLINE uint8_t *
-sldns_buffer_begin(const sldns_buffer *buffer)
-{
- return sldns_buffer_at(buffer, 0);
-}
-
-/**
- * returns a pointer to the end of the buffer (the data at the buffer's
- * limit).
- * \param[in] buffer the buffer
- * \return the pointer
- */
-INLINE uint8_t *
-sldns_buffer_end(sldns_buffer *buffer)
-{
- return sldns_buffer_at(buffer, buffer->_limit);
-}
-
-/**
- * returns a pointer to the data at the buffer's current position.
- * \param[in] buffer the buffer
- * \return the pointer
- */
-INLINE uint8_t *
-sldns_buffer_current(sldns_buffer *buffer)
-{
- return sldns_buffer_at(buffer, buffer->_position);
-}
-
-/**
- * returns the number of bytes remaining between the indicated position and
- * the limit.
- * \param[in] buffer the buffer
- * \param[in] at indicated position
- * \return number of bytes
- */
-INLINE size_t
-sldns_buffer_remaining_at(sldns_buffer *buffer, size_t at)
-{
- sldns_buffer_invariant(buffer);
- assert(at <= buffer->_limit);
- return buffer->_limit - at;
-}
-
-/**
- * returns the number of bytes remaining between the buffer's position and
- * limit.
- * \param[in] buffer the buffer
- * \return the number of bytes
- */
-INLINE size_t
-sldns_buffer_remaining(sldns_buffer *buffer)
-{
- return sldns_buffer_remaining_at(buffer, buffer->_position);
-}
-
-/**
- * checks if the buffer has at least COUNT more bytes available.
- * Before reading or writing the caller needs to ensure enough space
- * is available!
- * \param[in] buffer the buffer
- * \param[in] at indicated position
- * \param[in] count how much is available
- * \return true or false (as int?)
- */
-INLINE int
-sldns_buffer_available_at(sldns_buffer *buffer, size_t at, size_t count)
-{
- return count <= sldns_buffer_remaining_at(buffer, at);
-}
-
-/**
- * checks if the buffer has count bytes available at the current position
- * \param[in] buffer the buffer
- * \param[in] count how much is available
- * \return true or false (as int?)
- */
-INLINE int
-sldns_buffer_available(sldns_buffer *buffer, size_t count)
-{
- return sldns_buffer_available_at(buffer, buffer->_position, count);
-}
-
-/**
- * writes the given data to the buffer at the specified position
- * \param[in] buffer the buffer
- * \param[in] at the position (in number of bytes) to write the data at
- * \param[in] data pointer to the data to write to the buffer
- * \param[in] count the number of bytes of data to write
- */
-INLINE void
-sldns_buffer_write_at(sldns_buffer *buffer, size_t at, const void *data, size_t count)
-{
- assert(sldns_buffer_available_at(buffer, at, count));
- memcpy(buffer->_data + at, data, count);
-}
-
-/**
- * writes count bytes of data to the current position of the buffer
- * \param[in] buffer the buffer
- * \param[in] data the data to write
- * \param[in] count the lenght of the data to write
- */
-INLINE void
-sldns_buffer_write(sldns_buffer *buffer, const void *data, size_t count)
-{
- sldns_buffer_write_at(buffer, buffer->_position, data, count);
- buffer->_position += count;
-}
-
-/**
- * copies the given (null-delimited) string to the specified position at the buffer
- * \param[in] buffer the buffer
- * \param[in] at the position in the buffer
- * \param[in] str the string to write
- */
-INLINE void
-sldns_buffer_write_string_at(sldns_buffer *buffer, size_t at, const char *str)
-{
- sldns_buffer_write_at(buffer, at, str, strlen(str));
-}
-
-/**
- * copies the given (null-delimited) string to the current position at the buffer
- * \param[in] buffer the buffer
- * \param[in] str the string to write
- */
-INLINE void
-sldns_buffer_write_string(sldns_buffer *buffer, const char *str)
-{
- sldns_buffer_write(buffer, str, strlen(str));
-}
-
-/**
- * writes the given byte of data at the given position in the buffer
- * \param[in] buffer the buffer
- * \param[in] at the position in the buffer
- * \param[in] data the 8 bits to write
- */
-INLINE void
-sldns_buffer_write_u8_at(sldns_buffer *buffer, size_t at, uint8_t data)
-{
- assert(sldns_buffer_available_at(buffer, at, sizeof(data)));
- buffer->_data[at] = data;
-}
-
-/**
- * writes the given byte of data at the current position in the buffer
- * \param[in] buffer the buffer
- * \param[in] data the 8 bits to write
- */
-INLINE void
-sldns_buffer_write_u8(sldns_buffer *buffer, uint8_t data)
-{
- sldns_buffer_write_u8_at(buffer, buffer->_position, data);
- buffer->_position += sizeof(data);
-}
-
-/**
- * writes the given 2 byte integer at the given position in the buffer
- * \param[in] buffer the buffer
- * \param[in] at the position in the buffer
- * \param[in] data the 16 bits to write
- */
-INLINE void
-sldns_buffer_write_u16_at(sldns_buffer *buffer, size_t at, uint16_t data)
-{
- assert(sldns_buffer_available_at(buffer, at, sizeof(data)));
- sldns_write_uint16(buffer->_data + at, data);
-}
-
-/**
- * writes the given 2 byte integer at the current position in the buffer
- * \param[in] buffer the buffer
- * \param[in] data the 16 bits to write
- */
-INLINE void
-sldns_buffer_write_u16(sldns_buffer *buffer, uint16_t data)
-{
- sldns_buffer_write_u16_at(buffer, buffer->_position, data);
- buffer->_position += sizeof(data);
-}
-
-/**
- * writes the given 4 byte integer at the given position in the buffer
- * \param[in] buffer the buffer
- * \param[in] at the position in the buffer
- * \param[in] data the 32 bits to write
- */
-INLINE void
-sldns_buffer_write_u32_at(sldns_buffer *buffer, size_t at, uint32_t data)
-{
- assert(sldns_buffer_available_at(buffer, at, sizeof(data)));
- sldns_write_uint32(buffer->_data + at, data);
-}
-
-/**
- * writes the given 4 byte integer at the current position in the buffer
- * \param[in] buffer the buffer
- * \param[in] data the 32 bits to write
- */
-INLINE void
-sldns_buffer_write_u32(sldns_buffer *buffer, uint32_t data)
-{
- sldns_buffer_write_u32_at(buffer, buffer->_position, data);
- buffer->_position += sizeof(data);
-}
-
-/**
- * copies count bytes of data at the given position to the given data-array
- * \param[in] buffer the buffer
- * \param[in] at the position in the buffer to start
- * \param[out] data buffer to copy to
- * \param[in] count the length of the data to copy
- */
-INLINE void
-sldns_buffer_read_at(sldns_buffer *buffer, size_t at, void *data, size_t count)
-{
- assert(sldns_buffer_available_at(buffer, at, count));
- memcpy(data, buffer->_data + at, count);
-}
-
-/**
- * copies count bytes of data at the current position to the given data-array
- * \param[in] buffer the buffer
- * \param[out] data buffer to copy to
- * \param[in] count the length of the data to copy
- */
-INLINE void
-sldns_buffer_read(sldns_buffer *buffer, void *data, size_t count)
-{
- sldns_buffer_read_at(buffer, buffer->_position, data, count);
- buffer->_position += count;
-}
-
-/**
- * returns the byte value at the given position in the buffer
- * \param[in] buffer the buffer
- * \param[in] at the position in the buffer
- * \return 1 byte integer
- */
-INLINE uint8_t
-sldns_buffer_read_u8_at(sldns_buffer *buffer, size_t at)
-{
- assert(sldns_buffer_available_at(buffer, at, sizeof(uint8_t)));
- return buffer->_data[at];
-}
-
-/**
- * returns the byte value at the current position in the buffer
- * \param[in] buffer the buffer
- * \return 1 byte integer
- */
-INLINE uint8_t
-sldns_buffer_read_u8(sldns_buffer *buffer)
-{
- uint8_t result = sldns_buffer_read_u8_at(buffer, buffer->_position);
- buffer->_position += sizeof(uint8_t);
- return result;
-}
-
-/**
- * returns the 2-byte integer value at the given position in the buffer
- * \param[in] buffer the buffer
- * \param[in] at position in the buffer
- * \return 2 byte integer
- */
-INLINE uint16_t
-sldns_buffer_read_u16_at(sldns_buffer *buffer, size_t at)
-{
- assert(sldns_buffer_available_at(buffer, at, sizeof(uint16_t)));
- return sldns_read_uint16(buffer->_data + at);
-}
-
-/**
- * returns the 2-byte integer value at the current position in the buffer
- * \param[in] buffer the buffer
- * \return 2 byte integer
- */
-INLINE uint16_t
-sldns_buffer_read_u16(sldns_buffer *buffer)
-{
- uint16_t result = sldns_buffer_read_u16_at(buffer, buffer->_position);
- buffer->_position += sizeof(uint16_t);
- return result;
-}
-
-/**
- * returns the 4-byte integer value at the given position in the buffer
- * \param[in] buffer the buffer
- * \param[in] at position in the buffer
- * \return 4 byte integer
- */
-INLINE uint32_t
-sldns_buffer_read_u32_at(sldns_buffer *buffer, size_t at)
-{
- assert(sldns_buffer_available_at(buffer, at, sizeof(uint32_t)));
- return sldns_read_uint32(buffer->_data + at);
-}
-
-/**
- * returns the 4-byte integer value at the current position in the buffer
- * \param[in] buffer the buffer
- * \return 4 byte integer
- */
-INLINE uint32_t
-sldns_buffer_read_u32(sldns_buffer *buffer)
-{
- uint32_t result = sldns_buffer_read_u32_at(buffer, buffer->_position);
- buffer->_position += sizeof(uint32_t);
- return result;
-}
-
-/**
- * returns the status of the buffer
- * \param[in] buffer
- * \return the status
- */
-INLINE int
-sldns_buffer_status(sldns_buffer *buffer)
-{
- return (int)buffer->_status_err;
-}
-
-/**
- * returns true if the status of the buffer is LDNS_STATUS_OK, false otherwise
- * \param[in] buffer the buffer
- * \return true or false
- */
-INLINE int
-sldns_buffer_status_ok(sldns_buffer *buffer)
-{
- if (buffer) {
- return sldns_buffer_status(buffer) == 0;
- } else {
- return 0;
- }
-}
-
-/**
- * prints to the buffer, increasing the capacity if required using
- * buffer_reserve(). The buffer's position is set to the terminating '\\0'
- * Returns the number of characters written (not including the
- * terminating '\\0') or -1 on failure.
- */
-int sldns_buffer_printf(sldns_buffer *buffer, const char *format, ...)
- ATTR_FORMAT(printf, 2, 3);
-
-/**
- * frees the buffer.
- * \param[in] *buffer the buffer to be freed
- * \return void
- */
-void sldns_buffer_free(sldns_buffer *buffer);
-
-/**
- * Makes the buffer fixed and returns a pointer to the data. The
- * caller is responsible for free'ing the result.
- * \param[in] *buffer the buffer to be exported
- * \return void
- */
-void *sldns_buffer_export(sldns_buffer *buffer);
-
-/**
- * Copy contents of the from buffer to the result buffer and then flips
- * the result buffer. Data will be silently truncated if the result buffer is
- * too small.
- * \param[out] *result resulting buffer which is copied to.
- * \param[in] *from what to copy to result.
- */
-void sldns_buffer_copy(sldns_buffer* result, sldns_buffer* from);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* LDNS_SBUFFER_H */
+++ /dev/null
-/**
- * str2wire.c - read txt presentation of RRs
- *
- * (c) NLnet Labs, 2005-2006
- *
- * See the file LICENSE for the license
- */
-
-/**
- * \file
- *
- * Parses text to wireformat.
- */
-#include "config.h"
-#include "ldns/str2wire.h"
-#include "ldns/wire2str.h"
-#include "ldns/sbuffer.h"
-#include "ldns/parse.h"
-#include "ldns/parseutil.h"
-#include <ctype.h>
-#ifdef HAVE_TIME_H
-#include <time.h>
-#endif
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-
-/** return an error */
-#define RET_ERR(e, off) ((int)((e)|((off)<<LDNS_WIREPARSE_SHIFT)))
-/** Move parse error but keep its ID */
-#define RET_ERR_SHIFT(e, move) RET_ERR(LDNS_WIREPARSE_ERROR(e), LDNS_WIREPARSE_OFFSET(e)+(move));
-#define LDNS_IP6ADDRLEN (128/8)
-
-/*
- * No special care is taken, all dots are translated into
- * label separators.
- * @param rel: true if the domain is not absolute (not terminated in .).
- * The output is then still terminated with a '0' rootlabel.
- */
-static int sldns_str2wire_dname_buf_rel(const char* str, uint8_t* buf,
- size_t* olen, int* rel)
-{
- size_t len;
-
- const char *s;
- uint8_t *q, *pq, label_len;
-
- if(rel) *rel = 0;
- len = strlen((char*)str);
- /* octet representation can make strings a lot longer than actual length */
- if (len > LDNS_MAX_DOMAINLEN * 4) {
- return RET_ERR(LDNS_WIREPARSE_ERR_DOMAINNAME_OVERFLOW, 0);
- }
- if (0 == len) {
- return RET_ERR(LDNS_WIREPARSE_ERR_DOMAINNAME_UNDERFLOW, 0);
- }
-
- /* root label */
- if (1 == len && *str == '.') {
- if(*olen < 1)
- return RET_ERR(LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL, 0);
- buf[0] = 0;
- *olen = 1;
- return LDNS_WIREPARSE_ERR_OK;
- }
-
- /* get on with the rest */
-
- /* s is on the current character in the string
- * pq points to where the labellength is going to go
- * label_len keeps track of the current label's length
- * q builds the dname inside the buf array
- */
- len = 0;
- if(*olen < 1)
- return RET_ERR(LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL, 0);
- q = buf+1;
- pq = buf;
- label_len = 0;
- for (s = str; *s; s++, q++) {
- if (q >= buf + *olen)
- return RET_ERR(LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL, q-buf);
- if (q > buf + LDNS_MAX_DOMAINLEN)
- return RET_ERR(LDNS_WIREPARSE_ERR_DOMAINNAME_OVERFLOW, q-buf);
- switch (*s) {
- case '.':
- if (label_len > LDNS_MAX_LABELLEN) {
- return RET_ERR(LDNS_WIREPARSE_ERR_LABEL_OVERFLOW, q-buf);
- }
- if (label_len == 0) {
- return RET_ERR(LDNS_WIREPARSE_ERR_EMPTY_LABEL, q-buf);
- }
- len += label_len + 1;
- *q = 0;
- *pq = label_len;
- label_len = 0;
- pq = q;
- break;
- case '\\':
- /* octet value or literal char */
- s += 1;
- if (!sldns_parse_escape(q, &s)) {
- *q = 0;
- return RET_ERR(LDNS_WIREPARSE_ERR_SYNTAX_BAD_ESCAPE, q-buf);
- }
- s -= 1;
- label_len++;
- break;
- default:
- *q = (uint8_t)*s;
- label_len++;
- }
- }
-
- /* add root label if last char was not '.' */
- if(label_len != 0) {
- if(rel) *rel = 1;
- if (q >= buf + *olen)
- return RET_ERR(LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL, q-buf);
- if (q > buf + LDNS_MAX_DOMAINLEN) {
- return RET_ERR(LDNS_WIREPARSE_ERR_DOMAINNAME_OVERFLOW, q-buf);
- }
- if (label_len > LDNS_MAX_LABELLEN) {
- return RET_ERR(LDNS_WIREPARSE_ERR_LABEL_OVERFLOW, q-buf);
- }
- if (label_len == 0) { /* label_len 0 but not . at end? */
- return RET_ERR(LDNS_WIREPARSE_ERR_EMPTY_LABEL, q-buf);
- }
- len += label_len + 1;
- *pq = label_len;
- *q = 0;
- }
- len++;
- *olen = len;
-
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-int sldns_str2wire_dname_buf(const char* str, uint8_t* buf, size_t* len)
-{
- return sldns_str2wire_dname_buf_rel(str, buf, len, NULL);
-}
-
-int sldns_str2wire_dname_buf_origin(const char* str, uint8_t* buf, size_t* len,
- uint8_t* origin, size_t origin_len)
-{
- size_t dlen = *len;
- int rel = 0;
- int s = sldns_str2wire_dname_buf_rel(str, buf, &dlen, &rel);
- if(s) return s;
-
- if(rel && origin && dlen > 0) {
- if(dlen + origin_len - 1 > LDNS_MAX_DOMAINLEN)
- return RET_ERR(LDNS_WIREPARSE_ERR_DOMAINNAME_OVERFLOW,
- LDNS_MAX_DOMAINLEN);
- if(dlen + origin_len - 1 > *len)
- return RET_ERR(LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL,
- *len);
- memmove(buf+dlen-1, origin, origin_len);
- *len = dlen + origin_len - 1;
- } else
- *len = dlen;
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-uint8_t* sldns_str2wire_dname(const char* str, size_t* len)
-{
- uint8_t dname[LDNS_MAX_DOMAINLEN+1];
- *len = sizeof(dname);
- if(sldns_str2wire_dname_buf(str, dname, len) == 0) {
- uint8_t* r = (uint8_t*)malloc(*len);
- if(r) return memcpy(r, dname, *len);
- }
- *len = 0;
- return NULL;
-}
-
-/** read owner name */
-static int
-rrinternal_get_owner(sldns_buffer* strbuf, uint8_t* rr, size_t* len,
- size_t* dname_len, uint8_t* origin, size_t origin_len, uint8_t* prev,
- size_t prev_len, char* token, size_t token_len)
-{
- /* split the rr in its parts -1 signals trouble */
- if(sldns_bget_token(strbuf, token, "\t\n ", token_len) == -1) {
- return RET_ERR(LDNS_WIREPARSE_ERR_SYNTAX,
- sldns_buffer_position(strbuf));
- }
-
- if(strcmp(token, "@") == 0) {
- uint8_t* tocopy;
- if (origin) {
- *dname_len = origin_len;
- tocopy = origin;
- } else if (prev) {
- *dname_len = prev_len;
- tocopy = prev;
- } else {
- /* default to root */
- *dname_len = 1;
- tocopy = (uint8_t*)"\0";
- }
- if(*len < *dname_len)
- return RET_ERR(LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL,
- sldns_buffer_position(strbuf));
- memmove(rr, tocopy, *dname_len);
- } else if(strlen(token) == 0) {
- /* no ownername was given, try prev, if that fails
- * origin, else default to root */
- uint8_t* tocopy;
- if(prev) {
- *dname_len = prev_len;
- tocopy = prev;
- } else if(origin) {
- *dname_len = origin_len;
- tocopy = origin;
- } else {
- *dname_len = 1;
- tocopy = (uint8_t*)"\0";
- }
- if(*len < *dname_len)
- return RET_ERR(LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL,
- sldns_buffer_position(strbuf));
- memmove(rr, tocopy, *dname_len);
- } else {
- size_t dlen = *len;
- int s = sldns_str2wire_dname_buf_origin(token, rr, &dlen,
- origin, origin_len);
- if(s) return RET_ERR_SHIFT(s,
- sldns_buffer_position(strbuf)-strlen(token));
- *dname_len = dlen;
- }
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-/** read ttl */
-static int
-rrinternal_get_ttl(sldns_buffer* strbuf, char* token, size_t token_len,
- int* not_there, uint32_t* ttl, uint32_t default_ttl)
-{
- const char* endptr;
- if(sldns_bget_token(strbuf, token, "\t\n ", token_len) == -1) {
- return RET_ERR(LDNS_WIREPARSE_ERR_SYNTAX_TTL,
- sldns_buffer_position(strbuf));
- }
- *ttl = (uint32_t) sldns_str2period(token, &endptr);
-
- if (strlen(token) > 0 && !isdigit((int)token[0])) {
- *not_there = 1;
- /* ah, it's not there or something */
- if (default_ttl == 0) {
- *ttl = LDNS_DEFAULT_TTL;
- } else {
- *ttl = default_ttl;
- }
- }
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-/** read class */
-static int
-rrinternal_get_class(sldns_buffer* strbuf, char* token, size_t token_len,
- int* not_there, uint16_t* cl)
-{
- /* if 'not_there' then we got token from previous parse routine */
- if(!*not_there) {
- /* parse new token for class */
- if(sldns_bget_token(strbuf, token, "\t\n ", token_len) == -1) {
- return RET_ERR(LDNS_WIREPARSE_ERR_SYNTAX_CLASS,
- sldns_buffer_position(strbuf));
- }
- } else *not_there = 0;
- *cl = sldns_get_rr_class_by_name(token);
- /* class can be left out too, assume IN, current token must be type */
- if(*cl == 0 && strcmp(token, "CLASS0") != 0) {
- *not_there = 1;
- *cl = LDNS_RR_CLASS_IN;
- }
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-/** read type */
-static int
-rrinternal_get_type(sldns_buffer* strbuf, char* token, size_t token_len,
- int* not_there, uint16_t* tp)
-{
- /* if 'not_there' then we got token from previous parse routine */
- if(!*not_there) {
- /* parse new token for type */
- if(sldns_bget_token(strbuf, token, "\t\n ", token_len) == -1) {
- return RET_ERR(LDNS_WIREPARSE_ERR_SYNTAX_TYPE,
- sldns_buffer_position(strbuf));
- }
- }
- *tp = sldns_get_rr_type_by_name(token);
- if(*tp == 0 && strcmp(token, "TYPE0") != 0) {
- return RET_ERR(LDNS_WIREPARSE_ERR_SYNTAX_TYPE,
- sldns_buffer_position(strbuf));
- }
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-/** put type, class, ttl into rr buffer */
-static int
-rrinternal_write_typeclassttl(sldns_buffer* strbuf, uint8_t* rr, size_t len,
- size_t dname_len, uint16_t tp, uint16_t cl, uint32_t ttl, int question)
-{
- if(question) {
- /* question is : name, type, class */
- if(dname_len + 4 > len)
- return RET_ERR(LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL,
- sldns_buffer_position(strbuf));
- sldns_write_uint16(rr+dname_len, tp);
- sldns_write_uint16(rr+dname_len+2, cl);
- return LDNS_WIREPARSE_ERR_OK;
- }
-
- /* type(2), class(2), ttl(4), rdatalen(2 (later)) = 10 */
- if(dname_len + 10 > len)
- return RET_ERR(LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL,
- sldns_buffer_position(strbuf));
- sldns_write_uint16(rr+dname_len, tp);
- sldns_write_uint16(rr+dname_len+2, cl);
- sldns_write_uint32(rr+dname_len+4, ttl);
- sldns_write_uint16(rr+dname_len+8, 0); /* rdatalen placeholder */
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-/** find delimiters for type */
-static const char*
-rrinternal_get_delims(sldns_rdf_type rdftype, uint16_t r_cnt, uint16_t r_max)
-{
- switch(rdftype) {
- case LDNS_RDF_TYPE_B64 :
- case LDNS_RDF_TYPE_HEX : /* These rdf types may con- */
- case LDNS_RDF_TYPE_LOC : /* tain whitespace, only if */
- case LDNS_RDF_TYPE_WKS : /* it is the last rd field. */
- case LDNS_RDF_TYPE_IPSECKEY :
- case LDNS_RDF_TYPE_NSEC : if (r_cnt == r_max - 1) {
- return "\n\t";
- }
- break;
- default : break;
- }
- return "\n\t ";
-}
-
-/* Syntactic sugar for sldns_rr_new_frm_str_internal */
-static int
-sldns_rdf_type_maybe_quoted(sldns_rdf_type rdf_type)
-{
- return rdf_type == LDNS_RDF_TYPE_STR ||
- rdf_type == LDNS_RDF_TYPE_LONG_STR;
-}
-
-/** see if rdata is quoted */
-static int
-rrinternal_get_quoted(sldns_buffer* strbuf, const char** delimiters,
- sldns_rdf_type rdftype)
-{
- if(sldns_rdf_type_maybe_quoted(rdftype) &&
- sldns_buffer_remaining(strbuf) > 0) {
-
- /* skip spaces */
- while(sldns_buffer_remaining(strbuf) > 0 &&
- *(sldns_buffer_current(strbuf)) == ' ') {
- sldns_buffer_skip(strbuf, 1);
- }
-
- if(sldns_buffer_remaining(strbuf) > 0 &&
- *(sldns_buffer_current(strbuf)) == '\"') {
- *delimiters = "\"\0";
- sldns_buffer_skip(strbuf, 1);
- return 1;
- }
- }
- return 0;
-}
-
-/** spool hex data into rdata */
-static int
-rrinternal_spool_hex(char* token, uint8_t* rr, size_t rr_len,
- size_t rr_cur_len, size_t* cur_hex_data_size, size_t hex_data_size)
-{
- char* p = token;
- while(*p) {
- if(isspace(*p)) {
- p++;
- continue;
- }
- if(!isxdigit(*p))
- return RET_ERR(LDNS_WIREPARSE_ERR_SYNTAX_RDATA,
- p-token);
- if(*cur_hex_data_size >= hex_data_size)
- return RET_ERR(LDNS_WIREPARSE_ERR_SYNTAX_RDATA,
- p-token);
- /* extra robust check */
- if(rr_cur_len+(*cur_hex_data_size)/2 >= rr_len)
- return RET_ERR(LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL,
- p-token);
- /* see if 16s or 1s */
- if( ((*cur_hex_data_size)&1) == 0) {
- rr[rr_cur_len+(*cur_hex_data_size)/2] =
- (uint8_t)sldns_hexdigit_to_int(*p)*16;
- } else {
- rr[rr_cur_len+(*cur_hex_data_size)/2] +=
- (uint8_t)sldns_hexdigit_to_int(*p);
- }
- p++;
- (*cur_hex_data_size)++;
- }
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-/** read unknown rr type format */
-static int
-rrinternal_parse_unknown(sldns_buffer* strbuf, char* token, size_t token_len,
- uint8_t* rr, size_t* rr_len, size_t* rr_cur_len, size_t pre_data_pos)
-{
- const char* delim = "\n\t ";
- size_t hex_data_size, cur_hex_data_size;
- /* go back to before \#
- * and skip it while setting delimiters better
- */
- sldns_buffer_set_position(strbuf, pre_data_pos);
- if(sldns_bget_token(strbuf, token, delim, token_len) == -1)
- return LDNS_WIREPARSE_ERR_GENERAL; /* should not fail */
- /* read rdata octet length */
- if(sldns_bget_token(strbuf, token, delim, token_len) == -1) {
- /* something goes very wrong here */
- return RET_ERR(LDNS_WIREPARSE_ERR_SYNTAX_RDATA,
- sldns_buffer_position(strbuf));
- }
- hex_data_size = (size_t)atoi(token);
- if(hex_data_size > LDNS_MAX_RDFLEN ||
- *rr_cur_len + hex_data_size > *rr_len) {
- return RET_ERR(LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL,
- sldns_buffer_position(strbuf));
- }
- /* copy hex chars into hex str (2 chars per byte) */
- hex_data_size *= 2;
- cur_hex_data_size = 0;
- while(cur_hex_data_size < hex_data_size) {
- int status;
- ssize_t c = sldns_bget_token(strbuf, token, delim, token_len);
- if((status = rrinternal_spool_hex(token, rr, *rr_len,
- *rr_cur_len, &cur_hex_data_size, hex_data_size)) != 0)
- return RET_ERR_SHIFT(status,
- sldns_buffer_position(strbuf)-strlen(token));
- if(c == -1) {
- if(cur_hex_data_size != hex_data_size)
- return RET_ERR(
- LDNS_WIREPARSE_ERR_SYNTAX_RDATA,
- sldns_buffer_position(strbuf));
- break;
- }
- }
- *rr_cur_len += hex_data_size/2;
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-/** parse normal RR rdata element */
-static int
-rrinternal_parse_rdf(sldns_buffer* strbuf, char* token, size_t token_len,
- uint8_t* rr, size_t rr_len, size_t* rr_cur_len, sldns_rdf_type rdftype,
- uint16_t rr_type, uint16_t r_cnt, uint16_t r_max, size_t dname_len,
- uint8_t* origin, size_t origin_len)
-{
- size_t len;
- int status;
-
- switch(rdftype) {
- case LDNS_RDF_TYPE_DNAME:
- /* check if the origin should be used or concatenated */
- if(strcmp(token, "@") == 0) {
- uint8_t* tocopy;
- size_t copylen;
- if(origin) {
- copylen = origin_len;
- tocopy = origin;
- } else if(rr_type == LDNS_RR_TYPE_SOA) {
- copylen = dname_len;
- tocopy = rr; /* copy rr owner name */
- } else {
- copylen = 1;
- tocopy = (uint8_t*)"\0";
- }
- if((*rr_cur_len) + copylen > rr_len)
- return RET_ERR(
- LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL,
- sldns_buffer_position(strbuf));
- memmove(rr+*rr_cur_len, tocopy, copylen);
- (*rr_cur_len) += copylen;
- } else {
- size_t dlen = rr_len - (*rr_cur_len);
- int s = sldns_str2wire_dname_buf_origin(token,
- rr+*rr_cur_len, &dlen, origin, origin_len);
- if(s) return RET_ERR_SHIFT(s,
- sldns_buffer_position(strbuf)-strlen(token));
- (*rr_cur_len) += dlen;
- }
- return LDNS_WIREPARSE_ERR_OK;
-
- case LDNS_RDF_TYPE_HEX:
- case LDNS_RDF_TYPE_B64:
- /* When this is the last rdata field, then the
- * rest should be read in (cause then these
- * rdf types may contain spaces). */
- if(r_cnt == r_max - 1) {
- size_t tlen = strlen(token);
- (void)sldns_bget_token(strbuf, token+tlen, "\n",
- token_len - tlen);
- }
- break;
- default:
- break;
- }
-
- len = rr_len - (*rr_cur_len);
- if((status=sldns_str2wire_rdf_buf(token, rr+(*rr_cur_len), &len,
- rdftype)) != 0)
- return RET_ERR_SHIFT(status,
- sldns_buffer_position(strbuf)-strlen(token));
- *rr_cur_len += len;
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-/**
- * Parse one rdf token. Takes care of quotes and parenthesis.
- */
-static int
-sldns_parse_rdf_token(sldns_buffer* strbuf, char* token, size_t token_len,
- int* quoted, int* parens, size_t* pre_data_pos,
- const char* delimiters, sldns_rdf_type rdftype, size_t* token_strlen)
-{
- size_t slen;
-
- /* skip spaces */
- while(sldns_buffer_remaining(strbuf) > 0 && !*quoted &&
- *(sldns_buffer_current(strbuf)) == ' ') {
- sldns_buffer_skip(strbuf, 1);
- }
-
- *pre_data_pos = sldns_buffer_position(strbuf);
- if(sldns_bget_token_par(strbuf, token, (*quoted)?"\"":delimiters,
- token_len, parens, (*quoted)?NULL:" \t") == -1) {
- return 0;
- }
- slen = strlen(token);
- /* check if not quoted yet, and we have encountered quotes */
- if(!*quoted && sldns_rdf_type_maybe_quoted(rdftype) &&
- slen >= 2 &&
- (token[0] == '"' || token[0] == '\'') &&
- (token[slen-1] == '"' || token[slen-1] == '\'')) {
- /* move token two smaller (quotes) with endnull */
- memmove(token, token+1, slen-2);
- token[slen-2] = 0;
- slen -= 2;
- *quoted = 1;
- } else if(!*quoted && sldns_rdf_type_maybe_quoted(rdftype) &&
- slen >= 2 &&
- (token[0] == '"' || token[0] == '\'')) {
- /* got the start quote (remove it) but read remainder
- * of quoted string as well into remainder of token */
- memmove(token, token+1, slen-1);
- token[slen-1] = 0;
- slen -= 1;
- *quoted = 1;
- /* rewind buffer over skipped whitespace */
- while(sldns_buffer_position(strbuf) > 0 &&
- (sldns_buffer_current(strbuf)[-1] == ' ' ||
- sldns_buffer_current(strbuf)[-1] == '\t')) {
- sldns_buffer_skip(strbuf, -1);
- }
- if(sldns_bget_token_par(strbuf, token+slen,
- "\"", token_len-slen,
- parens, NULL) == -1) {
- return 0;
- }
- slen = strlen(token);
- }
- *token_strlen = slen;
- return 1;
-}
-
-/** Add space and one more rdf token onto the existing token string. */
-static int
-sldns_affix_token(sldns_buffer* strbuf, char* token, size_t* token_len,
- int* quoted, int* parens, size_t* pre_data_pos,
- const char* delimiters, sldns_rdf_type rdftype, size_t* token_strlen)
-{
- size_t addlen = *token_len - *token_strlen;
- size_t addstrlen = 0;
-
- /* add space */
- if(addlen < 1) return 0;
- token[*token_strlen] = ' ';
- token[++(*token_strlen)] = 0;
-
- /* read another token */
- addlen = *token_len - *token_strlen;
- if(!sldns_parse_rdf_token(strbuf, token+*token_strlen, addlen, quoted,
- parens, pre_data_pos, delimiters, rdftype, &addstrlen))
- return 0;
- (*token_strlen) += addstrlen;
- return 1;
-}
-
-/** parse rdata from string into rr buffer(-remainder after dname). */
-static int
-rrinternal_parse_rdata(sldns_buffer* strbuf, char* token, size_t token_len,
- uint8_t* rr, size_t* rr_len, size_t dname_len, uint16_t rr_type,
- uint8_t* origin, size_t origin_len)
-{
- const sldns_rr_descriptor *desc = sldns_rr_descript((uint16_t)rr_type);
- uint16_t r_cnt, r_min, r_max;
- size_t rr_cur_len = dname_len + 10, pre_data_pos, token_strlen;
- int was_unknown_rr_format = 0, parens = 0, status, quoted;
- const char* delimiters;
- sldns_rdf_type rdftype;
- /* a desc is always returned */
- if(!desc) return LDNS_WIREPARSE_ERR_GENERAL;
- r_max = sldns_rr_descriptor_maximum(desc);
- r_min = sldns_rr_descriptor_minimum(desc);
- /* robust check */
- if(rr_cur_len > *rr_len)
- return RET_ERR(LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL,
- sldns_buffer_position(strbuf));
-
- /* because number of fields can be variable, we can't rely on
- * _maximum() only */
- for(r_cnt=0; r_cnt < r_max; r_cnt++) {
- rdftype = sldns_rr_descriptor_field_type(desc, r_cnt);
- delimiters = rrinternal_get_delims(rdftype, r_cnt, r_max);
- quoted = rrinternal_get_quoted(strbuf, &delimiters, rdftype);
-
- if(!sldns_parse_rdf_token(strbuf, token, token_len, "ed,
- &parens, &pre_data_pos, delimiters, rdftype,
- &token_strlen))
- break;
-
- /* rfc3597 specifies that any type can be represented
- * with \# method, which can contain spaces...
- * it does specify size though... */
-
- /* unknown RR data */
- if(token_strlen>=2 && strncmp(token, "\\#", 2) == 0 &&
- !quoted && (token_strlen == 2 || token[2]==' ')) {
- was_unknown_rr_format = 1;
- if((status=rrinternal_parse_unknown(strbuf, token,
- token_len, rr, rr_len, &rr_cur_len,
- pre_data_pos)) != 0)
- return status;
- } else if(token_strlen > 0 || quoted) {
- if(rdftype == LDNS_RDF_TYPE_HIP) {
- /* affix the HIT and PK fields, with a space */
- if(!sldns_affix_token(strbuf, token,
- &token_len, "ed, &parens,
- &pre_data_pos, delimiters,
- rdftype, &token_strlen))
- break;
- if(!sldns_affix_token(strbuf, token,
- &token_len, "ed, &parens,
- &pre_data_pos, delimiters,
- rdftype, &token_strlen))
- break;
- }
-
- /* normal RR */
- if((status=rrinternal_parse_rdf(strbuf, token,
- token_len, rr, *rr_len, &rr_cur_len, rdftype,
- rr_type, r_cnt, r_max, dname_len, origin,
- origin_len)) != 0) {
- return status;
- }
- }
- }
- if(!was_unknown_rr_format && r_cnt+1 < r_min) {
- return RET_ERR(LDNS_WIREPARSE_ERR_SYNTAX_MISSING_VALUE,
- sldns_buffer_position(strbuf));
- }
- while(parens != 0) {
- /* read remainder, must be "" */
- if(sldns_bget_token_par(strbuf, token, "\n", token_len,
- &parens, " \t") == -1) {
- if(parens != 0)
- return RET_ERR(LDNS_WIREPARSE_ERR_PARENTHESIS,
- sldns_buffer_position(strbuf));
- break;
- }
- if(strcmp(token, "") != 0)
- return RET_ERR(LDNS_WIREPARSE_ERR_PARENTHESIS,
- sldns_buffer_position(strbuf));
- }
- /* write rdata length */
- sldns_write_uint16(rr+dname_len+8, rr_cur_len-dname_len-10);
- *rr_len = rr_cur_len;
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-/*
- * trailing spaces are allowed
- * leading spaces are not allowed
- * allow ttl to be optional
- * class is optional too
- * if ttl is missing, and default_ttl is 0, use DEF_TTL
- * allow ttl to be written as 1d3h
- * So the RR should look like. e.g.
- * miek.nl. 3600 IN MX 10 elektron.atoom.net
- * or
- * miek.nl. 1h IN MX 10 elektron.atoom.net
- * or
- * miek.nl. IN MX 10 elektron.atoom.net
- */
-static int
-sldns_str2wire_rr_buf_internal(const char* str, uint8_t* rr, size_t* len,
- size_t* dname_len, uint32_t default_ttl, uint8_t* origin,
- size_t origin_len, uint8_t* prev, size_t prev_len, int question)
-{
- int status;
- int not_there = 0;
- char token[LDNS_MAX_RDFLEN+1];
- uint32_t ttl = 0;
- uint16_t tp = 0, cl = 0;
- size_t ddlen = 0;
-
- /* string in buffer */
- sldns_buffer strbuf;
- sldns_buffer_init_frm_data(&strbuf, (uint8_t*)str, strlen(str));
- if(!dname_len) dname_len = &ddlen;
-
- /* parse the owner */
- if((status=rrinternal_get_owner(&strbuf, rr, len, dname_len, origin,
- origin_len, prev, prev_len, token, sizeof(token))) != 0)
- return status;
-
- /* parse the [ttl] [class] <type> */
- if((status=rrinternal_get_ttl(&strbuf, token, sizeof(token),
- ¬_there, &ttl, default_ttl)) != 0)
- return status;
- if((status=rrinternal_get_class(&strbuf, token, sizeof(token),
- ¬_there, &cl)) != 0)
- return status;
- if((status=rrinternal_get_type(&strbuf, token, sizeof(token),
- ¬_there, &tp)) != 0)
- return status;
- /* put ttl, class, type into the rr result */
- if((status=rrinternal_write_typeclassttl(&strbuf, rr, *len, *dname_len, tp, cl,
- ttl, question)) != 0)
- return status;
- /* for a question-RR we are done, no rdata */
- if(question) {
- *len = *dname_len + 4;
- return LDNS_WIREPARSE_ERR_OK;
- }
-
- /* rdata */
- if((status=rrinternal_parse_rdata(&strbuf, token, sizeof(token),
- rr, len, *dname_len, tp, origin, origin_len)) != 0)
- return status;
-
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-int sldns_str2wire_rr_buf(const char* str, uint8_t* rr, size_t* len,
- size_t* dname_len, uint32_t default_ttl, uint8_t* origin,
- size_t origin_len, uint8_t* prev, size_t prev_len)
-{
- return sldns_str2wire_rr_buf_internal(str, rr, len, dname_len,
- default_ttl, origin, origin_len, prev, prev_len, 0);
-}
-
-int sldns_str2wire_rr_question_buf(const char* str, uint8_t* rr, size_t* len,
- size_t* dname_len, uint8_t* origin, size_t origin_len, uint8_t* prev,
- size_t prev_len)
-{
- return sldns_str2wire_rr_buf_internal(str, rr, len, dname_len,
- 0, origin, origin_len, prev, prev_len, 1);
-}
-
-uint16_t sldns_wirerr_get_type(uint8_t* rr, size_t len, size_t dname_len)
-{
- if(len < dname_len+2)
- return 0;
- return sldns_read_uint16(rr+dname_len);
-}
-
-uint16_t sldns_wirerr_get_class(uint8_t* rr, size_t len, size_t dname_len)
-{
- if(len < dname_len+4)
- return 0;
- return sldns_read_uint16(rr+dname_len+2);
-}
-
-uint32_t sldns_wirerr_get_ttl(uint8_t* rr, size_t len, size_t dname_len)
-{
- if(len < dname_len+8)
- return 0;
- return sldns_read_uint32(rr+dname_len+4);
-}
-
-uint16_t sldns_wirerr_get_rdatalen(uint8_t* rr, size_t len, size_t dname_len)
-{
- if(len < dname_len+10)
- return 0;
- return sldns_read_uint16(rr+dname_len+8);
-}
-
-uint8_t* sldns_wirerr_get_rdata(uint8_t* rr, size_t len, size_t dname_len)
-{
- if(len < dname_len+10)
- return NULL;
- return rr+dname_len+10;
-}
-
-uint8_t* sldns_wirerr_get_rdatawl(uint8_t* rr, size_t len, size_t dname_len)
-{
- if(len < dname_len+10)
- return NULL;
- return rr+dname_len+8;
-}
-
-const char* sldns_get_errorstr_parse(int e)
-{
- sldns_lookup_table *lt;
- lt = sldns_lookup_by_id(sldns_wireparse_errors, LDNS_WIREPARSE_ERROR(e));
- return lt?lt->name:"unknown error";
-}
-
-int sldns_fp2wire_rr_buf(FILE* in, uint8_t* rr, size_t* len, size_t* dname_len,
- struct sldns_file_parse_state* parse_state)
-{
- char line[LDNS_RR_BUF_SIZE+1];
- ssize_t size;
-
- /* read an entire line in from the file */
- if((size = sldns_fget_token_l(in, line, LDNS_PARSE_SKIP_SPACE,
- LDNS_RR_BUF_SIZE, parse_state?&parse_state->lineno:NULL))
- == -1) {
- /* if last line was empty, we are now at feof, which is not
- * always a parse error (happens when for instance last line
- * was a comment)
- */
- return LDNS_WIREPARSE_ERR_SYNTAX;
- }
-
- /* we can have the situation, where we've read ok, but still got
- * no bytes to play with, in this case size is 0 */
- if(size == 0) {
- *len = 0;
- *dname_len = 0;
- return LDNS_WIREPARSE_ERR_OK;
- }
-
- if(strncmp(line, "$ORIGIN", 7) == 0 && isspace(line[7])) {
- size_t off = 8;
- int s;
- *len = 0;
- *dname_len = 0;
- if(!parse_state) return LDNS_WIREPARSE_ERR_OK;
- while(isspace(line[off]))
- off++;
- parse_state->origin_len = sizeof(parse_state->origin);
- s = sldns_str2wire_dname_buf(line+off, parse_state->origin,
- &parse_state->origin_len);
- if(s) parse_state->origin_len = 0;
- return s;
- } else if(strncmp(line, "$TTL", 4) == 0 && isspace(line[4])) {
- const char* end = NULL;
- size_t off = 8;
- *len = 0;
- *dname_len = 0;
- if(!parse_state) return LDNS_WIREPARSE_ERR_OK;
- while(isspace(line[off]))
- off++;
- parse_state->default_ttl = sldns_str2period(line+off, &end);
- } else if (strncmp(line, "$INCLUDE", 8) == 0) {
- *len = 0;
- *dname_len = 0;
- return LDNS_WIREPARSE_ERR_INCLUDE;
- } else {
- return sldns_str2wire_rr_buf(line, rr, len, dname_len,
- parse_state?parse_state->default_ttl:0,
- (parse_state&&parse_state->origin_len)?
- parse_state->origin:NULL,
- parse_state->origin_len,
- (parse_state&&parse_state->prev_rr_len)?
- parse_state->prev_rr:NULL,
- parse_state->prev_rr_len);
- }
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-int sldns_str2wire_rdf_buf(const char* str, uint8_t* rd, size_t* len,
- sldns_rdf_type rdftype)
-{
- switch (rdftype) {
- case LDNS_RDF_TYPE_DNAME:
- return sldns_str2wire_dname_buf(str, rd, len);
- case LDNS_RDF_TYPE_INT8:
- return sldns_str2wire_int8_buf(str, rd, len);
- case LDNS_RDF_TYPE_INT16:
- return sldns_str2wire_int16_buf(str, rd, len);
- case LDNS_RDF_TYPE_INT32:
- return sldns_str2wire_int32_buf(str, rd, len);
- case LDNS_RDF_TYPE_A:
- return sldns_str2wire_a_buf(str, rd, len);
- case LDNS_RDF_TYPE_AAAA:
- return sldns_str2wire_aaaa_buf(str, rd, len);
- case LDNS_RDF_TYPE_STR:
- return sldns_str2wire_str_buf(str, rd, len);
- case LDNS_RDF_TYPE_APL:
- return sldns_str2wire_apl_buf(str, rd, len);
- case LDNS_RDF_TYPE_B64:
- return sldns_str2wire_b64_buf(str, rd, len);
- case LDNS_RDF_TYPE_B32_EXT:
- return sldns_str2wire_b32_ext_buf(str, rd, len);
- case LDNS_RDF_TYPE_HEX:
- return sldns_str2wire_hex_buf(str, rd, len);
- case LDNS_RDF_TYPE_NSEC:
- return sldns_str2wire_nsec_buf(str, rd, len);
- case LDNS_RDF_TYPE_TYPE:
- return sldns_str2wire_type_buf(str, rd, len);
- case LDNS_RDF_TYPE_CLASS:
- return sldns_str2wire_class_buf(str, rd, len);
- case LDNS_RDF_TYPE_CERT_ALG:
- return sldns_str2wire_cert_alg_buf(str, rd, len);
- case LDNS_RDF_TYPE_ALG:
- return sldns_str2wire_alg_buf(str, rd, len);
- case LDNS_RDF_TYPE_TIME:
- return sldns_str2wire_time_buf(str, rd, len);
- case LDNS_RDF_TYPE_PERIOD:
- return sldns_str2wire_period_buf(str, rd, len);
- case LDNS_RDF_TYPE_LOC:
- return sldns_str2wire_loc_buf(str, rd, len);
- case LDNS_RDF_TYPE_WKS:
- return sldns_str2wire_wks_buf(str, rd, len);
- case LDNS_RDF_TYPE_NSAP:
- return sldns_str2wire_nsap_buf(str, rd, len);
- case LDNS_RDF_TYPE_ATMA:
- return sldns_str2wire_atma_buf(str, rd, len);
- case LDNS_RDF_TYPE_IPSECKEY:
- return sldns_str2wire_ipseckey_buf(str, rd, len);
- case LDNS_RDF_TYPE_NSEC3_SALT:
- return sldns_str2wire_nsec3_salt_buf(str, rd, len);
- case LDNS_RDF_TYPE_NSEC3_NEXT_OWNER:
- return sldns_str2wire_b32_ext_buf(str, rd, len);
- case LDNS_RDF_TYPE_ILNP64:
- return sldns_str2wire_ilnp64_buf(str, rd, len);
- case LDNS_RDF_TYPE_EUI48:
- return sldns_str2wire_eui48_buf(str, rd, len);
- case LDNS_RDF_TYPE_EUI64:
- return sldns_str2wire_eui64_buf(str, rd, len);
- case LDNS_RDF_TYPE_TAG:
- return sldns_str2wire_tag_buf(str, rd, len);
- case LDNS_RDF_TYPE_LONG_STR:
- return sldns_str2wire_long_str_buf(str, rd, len);
- case LDNS_RDF_TYPE_HIP:
- return sldns_str2wire_hip_buf(str, rd, len);
- case LDNS_RDF_TYPE_INT16_DATA:
- return sldns_str2wire_int16_data_buf(str, rd, len);
- case LDNS_RDF_TYPE_UNKNOWN:
- case LDNS_RDF_TYPE_SERVICE:
- return LDNS_WIREPARSE_ERR_NOT_IMPL;
- case LDNS_RDF_TYPE_NONE:
- default:
- break;
- }
- return LDNS_WIREPARSE_ERR_GENERAL;
-}
-
-int sldns_str2wire_int8_buf(const char* str, uint8_t* rd, size_t* len)
-{
- char* end;
- uint8_t r = (uint8_t)strtol((char*)str, &end, 10);
- if(*end != 0)
- return RET_ERR(LDNS_WIREPARSE_ERR_SYNTAX_INT, end-(char*)str);
- if(*len < 1)
- return LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL;
- rd[0] = r;
- *len = 1;
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-int sldns_str2wire_int16_buf(const char* str, uint8_t* rd, size_t* len)
-{
- char* end;
- uint16_t r = (uint16_t)strtol((char*)str, &end, 10);
- if(*end != 0)
- return RET_ERR(LDNS_WIREPARSE_ERR_SYNTAX_INT, end-(char*)str);
- if(*len < 2)
- return LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL;
- sldns_write_uint16(rd, r);
- *len = 2;
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-int sldns_str2wire_int32_buf(const char* str, uint8_t* rd, size_t* len)
-{
- char* end;
- uint32_t r;
- errno = 0; /* must set to zero before call,
- note race condition on errno */
- if(*str == '-')
- r = (uint32_t)strtol((char*)str, &end, 10);
- else r = (uint32_t)strtoul((char*)str, &end, 10);
- if(*end != 0)
- return RET_ERR(LDNS_WIREPARSE_ERR_SYNTAX_INT, end-(char*)str);
- if(errno == ERANGE)
- return LDNS_WIREPARSE_ERR_SYNTAX_INTEGER_OVERFLOW;
- if(*len < 4)
- return LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL;
- sldns_write_uint32(rd, r);
- *len = 4;
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-int sldns_str2wire_a_buf(const char* str, uint8_t* rd, size_t* len)
-{
- struct in_addr address;
- if(inet_pton(AF_INET, (char*)str, &address) != 1)
- return LDNS_WIREPARSE_ERR_SYNTAX_IP4;
- if(*len < sizeof(address))
- return LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL;
- memmove(rd, &address, sizeof(address));
- *len = sizeof(address);
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-int sldns_str2wire_aaaa_buf(const char* str, uint8_t* rd, size_t* len)
-{
-#ifdef AF_INET6
- uint8_t address[LDNS_IP6ADDRLEN + 1];
- if(inet_pton(AF_INET6, (char*)str, address) != 1)
- return LDNS_WIREPARSE_ERR_SYNTAX_IP6;
- if(*len < LDNS_IP6ADDRLEN)
- return LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL;
- memmove(rd, address, LDNS_IP6ADDRLEN);
- *len = LDNS_IP6ADDRLEN;
- return LDNS_WIREPARSE_ERR_OK;
-#else
- return LDNS_WIREPARSE_ERR_NOT_IMPL;
-#endif
-}
-
-int sldns_str2wire_str_buf(const char* str, uint8_t* rd, size_t* len)
-{
- uint8_t ch = 0;
- size_t sl = 0;
- const char* s = str;
- /* skip length byte */
- if(*len < 1)
- return LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL;
-
- /* read characters */
- while(sldns_parse_char(&ch, &s)) {
- if(sl >= 255)
- return RET_ERR(LDNS_WIREPARSE_ERR_INVALID_STR, s-str);
- if(*len < sl+1)
- return RET_ERR(LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL,
- s-str);
- rd[++sl] = ch;
- }
- if(!s)
- return LDNS_WIREPARSE_ERR_SYNTAX_BAD_ESCAPE;
- rd[0] = (uint8_t)sl;
- *len = sl+1;
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-int sldns_str2wire_apl_buf(const char* str, uint8_t* rd, size_t* len)
-{
- const char *my_str = str;
-
- char my_ip_str[64];
- size_t ip_str_len;
-
- uint16_t family;
- int negation;
- size_t adflength = 0;
- uint8_t data[16+4];
- uint8_t prefix;
- size_t i;
-
- if(strlen(my_str) == 0) {
- /* empty APL element, no data, no string */
- *len = 0;
- return LDNS_WIREPARSE_ERR_OK;
- }
-
- /* [!]afi:address/prefix */
- if (strlen(my_str) < 2
- || strchr(my_str, ':') == NULL
- || strchr(my_str, '/') == NULL
- || strchr(my_str, ':') > strchr(my_str, '/')) {
- return LDNS_WIREPARSE_ERR_INVALID_STR;
- }
-
- if (my_str[0] == '!') {
- negation = 1;
- my_str += 1;
- } else {
- negation = 0;
- }
-
- family = (uint16_t) atoi(my_str);
-
- my_str = strchr(my_str, ':') + 1;
-
- /* need ip addr and only ip addr for inet_pton */
- ip_str_len = (size_t) (strchr(my_str, '/') - my_str);
- if(ip_str_len+1 > sizeof(my_ip_str))
- return LDNS_WIREPARSE_ERR_INVALID_STR;
- (void)strlcpy(my_ip_str, my_str, sizeof(my_ip_str));
- my_ip_str[ip_str_len] = 0;
-
- if (family == 1) {
- /* ipv4 */
- if(inet_pton(AF_INET, my_ip_str, data+4) == 0)
- return LDNS_WIREPARSE_ERR_INVALID_STR;
- for (i = 0; i < 4; i++) {
- if (data[i+4] != 0) {
- adflength = i + 1;
- }
- }
- } else if (family == 2) {
- /* ipv6 */
- if (inet_pton(AF_INET6, my_ip_str, data+4) == 0)
- return LDNS_WIREPARSE_ERR_INVALID_STR;
- for (i = 0; i < 16; i++) {
- if (data[i+4] != 0) {
- adflength = i + 1;
- }
- }
- } else {
- /* unknown family */
- return LDNS_WIREPARSE_ERR_INVALID_STR;
- }
-
- my_str = strchr(my_str, '/') + 1;
- prefix = (uint8_t) atoi(my_str);
-
- sldns_write_uint16(data, family);
- data[2] = prefix;
- data[3] = (uint8_t)adflength;
- if (negation) {
- /* set bit 1 of byte 3 */
- data[3] = data[3] | 0x80;
- }
-
- if(*len < 4+adflength)
- return LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL;
- memmove(rd, data, 4+adflength);
- *len = 4+adflength;
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-int sldns_str2wire_b64_buf(const char* str, uint8_t* rd, size_t* len)
-{
- size_t sz = sldns_b64_pton_calculate_size(strlen(str));
- int n;
- if(*len < sz)
- return LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL;
- n = sldns_b64_pton(str, rd, *len);
- if(n < 0)
- return LDNS_WIREPARSE_ERR_SYNTAX_B64;
- *len = (size_t)n;
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-int sldns_str2wire_b32_ext_buf(const char* str, uint8_t* rd, size_t* len)
-{
- size_t slen = strlen(str);
- size_t sz = sldns_b32_pton_calculate_size(slen);
- int n;
- if(*len < 1+sz)
- return LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL;
- rd[0] = (uint8_t)sz;
- n = sldns_b32_pton_extended_hex(str, slen, rd+1, *len-1);
- if(n < 0)
- return LDNS_WIREPARSE_ERR_SYNTAX_B32_EXT;
- *len = (size_t)n+1;
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-int sldns_str2wire_hex_buf(const char* str, uint8_t* rd, size_t* len)
-{
- const char* s = str;
- size_t dlen = 0; /* number of hexdigits parsed */
- while(*s) {
- if(isspace(*s)) {
- s++;
- continue;
- }
- if(!isxdigit(*s))
- return RET_ERR(LDNS_WIREPARSE_ERR_SYNTAX_HEX, s-str);
- if(*len < dlen/2 + 1)
- return RET_ERR(LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL,
- s-str);
- if((dlen&1)==0)
- rd[dlen/2] = (uint8_t)sldns_hexdigit_to_int(*s++) * 16;
- else rd[dlen/2] += (uint8_t)sldns_hexdigit_to_int(*s++);
- dlen++;
- }
- if((dlen&1)!=0)
- return RET_ERR(LDNS_WIREPARSE_ERR_SYNTAX_HEX, s-str);
- *len = dlen/2;
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-int sldns_str2wire_nsec_buf(const char* str, uint8_t* rd, size_t* len)
-{
- const char *delim = "\n\t ";
- char token[64]; /* for a type name */
- size_t type_count = 0;
- int block;
- size_t used = 0;
- uint16_t maxtype = 0;
- uint8_t typebits[8192]; /* 65536 bits */
- uint8_t window_in_use[256];
-
- /* string in buffer */
- sldns_buffer strbuf;
- sldns_buffer_init_frm_data(&strbuf, (uint8_t*)str, strlen(str));
-
- /* parse the types */
- memset(typebits, 0, sizeof(typebits));
- memset(window_in_use, 0, sizeof(window_in_use));
- while(sldns_buffer_remaining(&strbuf) > 0 &&
- sldns_bget_token(&strbuf, token, delim, sizeof(token)) != -1) {
- uint16_t t = sldns_get_rr_type_by_name(token);
- if(token[0] == 0)
- continue;
- if(t == 0 && strcmp(token, "TYPE0") != 0)
- return RET_ERR(LDNS_WIREPARSE_ERR_SYNTAX_TYPE,
- sldns_buffer_position(&strbuf));
- typebits[t/8] |= (0x80>>(t%8));
- window_in_use[t/256] = 1;
- type_count++;
- if(t > maxtype) maxtype = t;
- }
-
- /* empty NSEC bitmap */
- if(type_count == 0) {
- *len = 0;
- return LDNS_WIREPARSE_ERR_OK;
- }
-
- /* encode windows {u8 windowblock, u8 bitmaplength, 0-32u8 bitmap},
- * block is 0-255 upper octet of types, length if 0-32. */
- for(block = 0; block <= (int)maxtype/256; block++) {
- int i, blocklen = 0;
- if(!window_in_use[block])
- continue;
- for(i=0; i<32; i++) {
- if(typebits[block*32+i] != 0)
- blocklen = i+1;
- }
- if(blocklen == 0)
- continue; /* empty window should have been !in_use */
- if(used+blocklen+2 > *len)
- return LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL;
- rd[used+0] = (uint8_t)block;
- rd[used+1] = (uint8_t)blocklen;
- for(i=0; i<blocklen; i++) {
- rd[used+2+i] = typebits[block*32+i];
- }
- used += blocklen+2;
- }
- *len = used;
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-int sldns_str2wire_type_buf(const char* str, uint8_t* rd, size_t* len)
-{
- uint16_t t = sldns_get_rr_type_by_name(str);
- if(t == 0 && strcmp(str, "TYPE0") != 0)
- return LDNS_WIREPARSE_ERR_SYNTAX_TYPE;
- if(*len < 2)
- return LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL;
- sldns_write_uint16(rd, t);
- *len = 2;
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-int sldns_str2wire_class_buf(const char* str, uint8_t* rd, size_t* len)
-{
- uint16_t c = sldns_get_rr_class_by_name(str);
- if(c == 0 && strcmp(str, "CLASS0") != 0)
- return LDNS_WIREPARSE_ERR_SYNTAX_CLASS;
- if(*len < 2)
- return LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL;
- sldns_write_uint16(rd, c);
- *len = 2;
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-/* An certificate alg field can either be specified as a 8 bits number
- * or by its symbolic name. Handle both */
-int sldns_str2wire_cert_alg_buf(const char* str, uint8_t* rd, size_t* len)
-{
- sldns_lookup_table *lt = sldns_lookup_by_name(sldns_cert_algorithms,
- str);
- if(*len < 2)
- return LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL;
- if(lt) {
- sldns_write_uint16(rd, (uint16_t)lt->id);
- } else {
- int s = sldns_str2wire_int16_buf(str, rd, len);
- if(s) return s;
- if(sldns_read_uint16(rd) == 0)
- return LDNS_WIREPARSE_ERR_CERT_BAD_ALGORITHM;
- }
- *len = 2;
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-/* An alg field can either be specified as a 8 bits number
- * or by its symbolic name. Handle both */
-int sldns_str2wire_alg_buf(const char* str, uint8_t* rd, size_t* len)
-{
- sldns_lookup_table *lt = sldns_lookup_by_name(sldns_algorithms, str);
- if(*len < 1)
- return LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL;
- if(lt) {
- rd[0] = (uint8_t)lt->id;
- *len = 1;
- } else {
- /* try as-is (a number) */
- return sldns_str2wire_int8_buf(str, rd, len);
- }
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-int sldns_str2wire_time_buf(const char* str, uint8_t* rd, size_t* len)
-{
- /* convert a time YYYYDDMMHHMMSS to wireformat */
- struct tm tm;
- if(*len < 4)
- return LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL;
-
- /* Try to scan the time... */
- memset(&tm, 0, sizeof(tm));
- if (strlen(str) == 14 && sscanf(str, "%4d%2d%2d%2d%2d%2d",
- &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &tm.tm_hour,
- &tm.tm_min, &tm.tm_sec) == 6) {
- tm.tm_year -= 1900;
- tm.tm_mon--;
- /* Check values */
- if (tm.tm_year < 70)
- return LDNS_WIREPARSE_ERR_SYNTAX_TIME;
- if (tm.tm_mon < 0 || tm.tm_mon > 11)
- return LDNS_WIREPARSE_ERR_SYNTAX_TIME;
- if (tm.tm_mday < 1 || tm.tm_mday > 31)
- return LDNS_WIREPARSE_ERR_SYNTAX_TIME;
- if (tm.tm_hour < 0 || tm.tm_hour > 23)
- return LDNS_WIREPARSE_ERR_SYNTAX_TIME;
- if (tm.tm_min < 0 || tm.tm_min > 59)
- return LDNS_WIREPARSE_ERR_SYNTAX_TIME;
- if (tm.tm_sec < 0 || tm.tm_sec > 59)
- return LDNS_WIREPARSE_ERR_SYNTAX_TIME;
-
- sldns_write_uint32(rd, sldns_mktime_from_utc(&tm));
- } else {
- /* handle it as 32 bits timestamp */
- char *end;
- uint32_t l = (uint32_t)strtol((char*)str, &end, 10);
- if(*end != 0)
- return RET_ERR(LDNS_WIREPARSE_ERR_SYNTAX_TIME,
- end-(char*)str);
- sldns_write_uint32(rd, l);
- }
- *len = 4;
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-int sldns_str2wire_period_buf(const char* str, uint8_t* rd, size_t* len)
-{
- const char* end;
- uint32_t p = sldns_str2period(str, &end);
- if(*end != 0)
- return RET_ERR(LDNS_WIREPARSE_ERR_SYNTAX_PERIOD, end-str);
- if(*len < 4)
- return LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL;
- sldns_write_uint32(rd, p);
- *len = 4;
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-/** read "<digits>[.<digits>][mM]" into mantissa exponent format for LOC type */
-static int
-loc_parse_cm(char* my_str, char** endstr, uint8_t* m, uint8_t* e)
-{
- uint32_t meters = 0, cm = 0, val;
- while (isblank(*my_str)) {
- my_str++;
- }
- meters = (uint32_t)strtol(my_str, &my_str, 10);
- if (*my_str == '.') {
- my_str++;
- cm = (uint32_t)strtol(my_str, &my_str, 10);
- }
- if (meters >= 1) {
- *e = 2;
- val = meters;
- } else {
- *e = 0;
- val = cm;
- }
- while(val >= 10) {
- (*e)++;
- val /= 10;
- }
- *m = (uint8_t)val;
-
- if (*e > 9)
- return 0;
- if (*my_str == 'm' || *my_str == 'M') {
- my_str++;
- }
- *endstr = my_str;
- return 1;
-}
-
-int sldns_str2wire_loc_buf(const char* str, uint8_t* rd, size_t* len)
-{
- uint32_t latitude = 0;
- uint32_t longitude = 0;
- uint32_t altitude = 0;
-
- uint32_t equator = (uint32_t)1<<31; /* 2**31 */
-
- /* only support version 0 */
- uint32_t h = 0;
- uint32_t m = 0;
- uint8_t size_b = 1, size_e = 2;
- uint8_t horiz_pre_b = 1, horiz_pre_e = 6;
- uint8_t vert_pre_b = 1, vert_pre_e = 3;
-
- double s = 0.0;
- int northerness;
- int easterness;
-
- char *my_str = (char *) str;
-
- if (isdigit((int) *my_str)) {
- h = (uint32_t) strtol(my_str, &my_str, 10);
- } else {
- return LDNS_WIREPARSE_ERR_INVALID_STR;
- }
-
- while (isblank((int) *my_str)) {
- my_str++;
- }
-
- if (isdigit((int) *my_str)) {
- m = (uint32_t) strtol(my_str, &my_str, 10);
- } else if (*my_str == 'N' || *my_str == 'S') {
- goto north;
- } else {
- return LDNS_WIREPARSE_ERR_INVALID_STR;
- }
-
- while (isblank((int) *my_str)) {
- my_str++;
- }
-
- if (isdigit((int) *my_str)) {
- s = strtod(my_str, &my_str);
- }
-
- /* skip blanks before norterness */
- while (isblank((int) *my_str)) {
- my_str++;
- }
-
-north:
- if (*my_str == 'N') {
- northerness = 1;
- } else if (*my_str == 'S') {
- northerness = 0;
- } else {
- return LDNS_WIREPARSE_ERR_INVALID_STR;
- }
-
- my_str++;
-
- /* store number */
- s = 1000.0 * s;
- /* add a little to make floor in conversion a round */
- s += 0.0005;
- latitude = (uint32_t) s;
- latitude += 1000 * 60 * m;
- latitude += 1000 * 60 * 60 * h;
- if (northerness) {
- latitude = equator + latitude;
- } else {
- latitude = equator - latitude;
- }
- while (isblank(*my_str)) {
- my_str++;
- }
-
- if (isdigit((int) *my_str)) {
- h = (uint32_t) strtol(my_str, &my_str, 10);
- } else {
- return LDNS_WIREPARSE_ERR_INVALID_STR;
- }
-
- while (isblank((int) *my_str)) {
- my_str++;
- }
-
- if (isdigit((int) *my_str)) {
- m = (uint32_t) strtol(my_str, &my_str, 10);
- } else if (*my_str == 'E' || *my_str == 'W') {
- goto east;
- } else {
- return LDNS_WIREPARSE_ERR_INVALID_STR;
- }
-
- while (isblank(*my_str)) {
- my_str++;
- }
-
- if (isdigit((int) *my_str)) {
- s = strtod(my_str, &my_str);
- }
-
- /* skip blanks before easterness */
- while (isblank(*my_str)) {
- my_str++;
- }
-
-east:
- if (*my_str == 'E') {
- easterness = 1;
- } else if (*my_str == 'W') {
- easterness = 0;
- } else {
- return LDNS_WIREPARSE_ERR_INVALID_STR;
- }
-
- my_str++;
-
- /* store number */
- s *= 1000.0;
- /* add a little to make floor in conversion a round */
- s += 0.0005;
- longitude = (uint32_t) s;
- longitude += 1000 * 60 * m;
- longitude += 1000 * 60 * 60 * h;
-
- if (easterness) {
- longitude += equator;
- } else {
- longitude = equator - longitude;
- }
-
- altitude = (uint32_t)(strtod(my_str, &my_str)*100.0 +
- 10000000.0 + 0.5);
- if (*my_str == 'm' || *my_str == 'M') {
- my_str++;
- }
-
- if (strlen(my_str) > 0) {
- if(!loc_parse_cm(my_str, &my_str, &size_b, &size_e))
- return LDNS_WIREPARSE_ERR_INVALID_STR;
- }
-
- if (strlen(my_str) > 0) {
- if(!loc_parse_cm(my_str, &my_str, &horiz_pre_b, &horiz_pre_e))
- return LDNS_WIREPARSE_ERR_INVALID_STR;
- }
-
- if (strlen(my_str) > 0) {
- if(!loc_parse_cm(my_str, &my_str, &vert_pre_b, &vert_pre_e))
- return LDNS_WIREPARSE_ERR_INVALID_STR;
- }
-
- if(*len < 16)
- return LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL;
- rd[0] = 0;
- rd[1] = ((size_b << 4) & 0xf0) | (size_e & 0x0f);
- rd[2] = ((horiz_pre_b << 4) & 0xf0) | (horiz_pre_e & 0x0f);
- rd[3] = ((vert_pre_b << 4) & 0xf0) | (vert_pre_e & 0x0f);
- sldns_write_uint32(rd + 4, latitude);
- sldns_write_uint32(rd + 8, longitude);
- sldns_write_uint32(rd + 12, altitude);
- *len = 16;
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-int sldns_str2wire_wks_buf(const char* str, uint8_t* rd, size_t* len)
-{
- int rd_len = 1;
- int have_proto = 0;
- char token[50], proto_str[50];
- sldns_buffer strbuf;
- sldns_buffer_init_frm_data(&strbuf, (uint8_t*)str, strlen(str));
- proto_str[0]=0;
-
- /* check we have one byte for proto */
- if(*len < 1)
- return LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL;
-
- while(sldns_bget_token(&strbuf, token, "\t\n ", sizeof(token)) > 0) {
- if(!have_proto) {
- struct protoent *p = getprotobyname(token);
- have_proto = 1;
- if(p) rd[0] = (uint8_t)p->p_proto;
- else rd[0] = (uint8_t)atoi(token);
- (void)strlcpy(proto_str, token, sizeof(proto_str));
- } else {
- int serv_port;
- struct servent *serv = getservbyname(token, proto_str);
- if(serv) serv_port=(int)ntohs((uint16_t)serv->s_port);
- else {
- serv_port = atoi(token);
- if(serv_port == 0 && strcmp(token, "0") != 0) {
-#ifdef HAVE_ENDSERVENT
- endservent();
-#endif
-#ifdef HAVE_ENDPROTOENT
- endprotoent();
-#endif
- return RET_ERR(LDNS_WIREPARSE_ERR_SYNTAX,
- sldns_buffer_position(&strbuf));
- }
- if(serv_port < 0 || serv_port > 65535) {
-#ifdef HAVE_ENDSERVENT
- endservent();
-#endif
-#ifdef HAVE_ENDPROTOENT
- endprotoent();
-#endif
- return RET_ERR(LDNS_WIREPARSE_ERR_SYNTAX,
- sldns_buffer_position(&strbuf));
- }
- }
- if(rd_len < 1+serv_port/8+1) {
- /* bitmap is larger, init new bytes at 0 */
- if(*len < 1+(size_t)serv_port/8+1) {
-#ifdef HAVE_ENDSERVENT
- endservent();
-#endif
-#ifdef HAVE_ENDPROTOENT
- endprotoent();
-#endif
- return RET_ERR(
- LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL,
- sldns_buffer_position(&strbuf));
- }
- memset(rd+rd_len, 0, 1+(size_t)serv_port/8+1-rd_len);
- rd_len = 1+serv_port/8+1;
- }
- rd[1+ serv_port/8] |= (1 << (7 - serv_port % 8));
- }
- }
- *len = (size_t)rd_len;
-
-#ifdef HAVE_ENDSERVENT
- endservent();
-#endif
-#ifdef HAVE_ENDPROTOENT
- endprotoent();
-#endif
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-int sldns_str2wire_nsap_buf(const char* str, uint8_t* rd, size_t* len)
-{
- const char* s = str;
- size_t slen;
- size_t dlen = 0; /* number of hexdigits parsed */
-
- /* just a hex string with optional dots? */
- if (s[0] != '0' || s[1] != 'x')
- return LDNS_WIREPARSE_ERR_INVALID_STR;
- s += 2;
- slen = strlen(s);
- if(slen > LDNS_MAX_RDFLEN*2)
- return LDNS_WIREPARSE_ERR_LABEL_OVERFLOW;
- while(*s) {
- if(isspace(*s) || *s == '.') {
- s++;
- continue;
- }
- if(!isxdigit(*s))
- return RET_ERR(LDNS_WIREPARSE_ERR_SYNTAX_HEX, s-str);
- if(*len < dlen/2 + 1)
- return RET_ERR(LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL,
- s-str);
- if((dlen&1)==0)
- rd[dlen/2] = (uint8_t)sldns_hexdigit_to_int(*s++) * 16;
- else rd[dlen/2] += sldns_hexdigit_to_int(*s++);
- dlen++;
- }
- if((dlen&1)!=0)
- return RET_ERR(LDNS_WIREPARSE_ERR_SYNTAX_HEX, s-str);
- *len = dlen/2;
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-int sldns_str2wire_atma_buf(const char* str, uint8_t* rd, size_t* len)
-{
- const char* s = str;
- size_t slen = strlen(str);
- size_t dlen = 0; /* number of hexdigits parsed */
-
- /* just a hex string with optional dots? */
- /* notimpl e.164 format */
- if(slen > LDNS_MAX_RDFLEN*2)
- return LDNS_WIREPARSE_ERR_LABEL_OVERFLOW;
- while(*s) {
- if(isspace(*s) || *s == '.') {
- s++;
- continue;
- }
- if(!isxdigit(*s))
- return RET_ERR(LDNS_WIREPARSE_ERR_SYNTAX_HEX, s-str);
- if(*len < dlen/2 + 1)
- return RET_ERR(LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL,
- s-str);
- if((dlen&1)==0)
- rd[dlen/2] = (uint8_t)sldns_hexdigit_to_int(*s++) * 16;
- else rd[dlen/2] += sldns_hexdigit_to_int(*s++);
- dlen++;
- }
- if((dlen&1)!=0)
- return RET_ERR(LDNS_WIREPARSE_ERR_SYNTAX_HEX, s-str);
- *len = dlen/2;
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-int sldns_str2wire_ipseckey_buf(const char* str, uint8_t* rd, size_t* len)
-{
- size_t gwlen = 0, keylen = 0;
- int s;
- uint8_t gwtype;
- char token[512];
- sldns_buffer strbuf;
- sldns_buffer_init_frm_data(&strbuf, (uint8_t*)str, strlen(str));
-
- if(*len < 3)
- return LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL;
- /* precedence */
- if(sldns_bget_token(&strbuf, token, "\t\n ", sizeof(token)) <= 0)
- return RET_ERR(LDNS_WIREPARSE_ERR_INVALID_STR,
- sldns_buffer_position(&strbuf));
- rd[0] = (uint8_t)atoi(token);
- /* gateway_type */
- if(sldns_bget_token(&strbuf, token, "\t\n ", sizeof(token)) <= 0)
- return RET_ERR(LDNS_WIREPARSE_ERR_INVALID_STR,
- sldns_buffer_position(&strbuf));
- rd[1] = (uint8_t)atoi(token);
- gwtype = rd[1];
- /* algorithm */
- if(sldns_bget_token(&strbuf, token, "\t\n ", sizeof(token)) <= 0)
- return RET_ERR(LDNS_WIREPARSE_ERR_INVALID_STR,
- sldns_buffer_position(&strbuf));
- rd[2] = (uint8_t)atoi(token);
-
- /* gateway */
- if(sldns_bget_token(&strbuf, token, "\t\n ", sizeof(token)) <= 0)
- return RET_ERR(LDNS_WIREPARSE_ERR_INVALID_STR,
- sldns_buffer_position(&strbuf));
- if(gwtype == 0) {
- /* NOGATEWAY */
- if(strcmp(token, ".") != 0)
- return RET_ERR(LDNS_WIREPARSE_ERR_INVALID_STR,
- sldns_buffer_position(&strbuf));
- gwlen = 0;
- } else if(gwtype == 1) {
- /* IP4 */
- gwlen = *len - 3;
- s = sldns_str2wire_a_buf(token, rd+3, &gwlen);
- if(s) return RET_ERR_SHIFT(s, sldns_buffer_position(&strbuf));
- } else if(gwtype == 2) {
- /* IP6 */
- gwlen = *len - 3;
- s = sldns_str2wire_aaaa_buf(token, rd+3, &gwlen);
- if(s) return RET_ERR_SHIFT(s, sldns_buffer_position(&strbuf));
- } else if(gwtype == 3) {
- /* DNAME */
- gwlen = *len - 3;
- s = sldns_str2wire_dname_buf(token, rd+3, &gwlen);
- if(s) return RET_ERR_SHIFT(s, sldns_buffer_position(&strbuf));
- } else {
- /* unknown gateway type */
- return RET_ERR(LDNS_WIREPARSE_ERR_INVALID_STR,
- sldns_buffer_position(&strbuf));
- }
- /* double check for size */
- if(*len < 3 + gwlen)
- return RET_ERR(LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL,
- sldns_buffer_position(&strbuf));
-
- /* publickey in remainder of strbuf */
- keylen = *len - 3 - gwlen;
- s = sldns_str2wire_b64_buf((const char*)sldns_buffer_current(&strbuf),
- rd+3+gwlen, &keylen);
- if(s) return RET_ERR_SHIFT(s, sldns_buffer_position(&strbuf));
-
- *len = 3 + gwlen + keylen;
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-int sldns_str2wire_nsec3_salt_buf(const char* str, uint8_t* rd, size_t* len)
-{
- int i, salt_length_str = (int)strlen(str);
- if (salt_length_str == 1 && str[0] == '-') {
- salt_length_str = 0;
- } else if (salt_length_str % 2 != 0) {
- return LDNS_WIREPARSE_ERR_SYNTAX_HEX;
- }
- if (salt_length_str > 512)
- return LDNS_WIREPARSE_ERR_SYNTAX_HEX;
- if(*len < 1+(size_t)salt_length_str / 2)
- return LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL;
- rd[0] = (uint8_t) (salt_length_str / 2);
- for (i = 0; i < salt_length_str; i += 2) {
- if (isxdigit((int)str[i]) && isxdigit((int)str[i+1])) {
- rd[1+i/2] = (uint8_t)(sldns_hexdigit_to_int(str[i])*16
- + sldns_hexdigit_to_int(str[i+1]));
- } else {
- return RET_ERR(LDNS_WIREPARSE_ERR_SYNTAX_HEX, i);
- }
- }
- *len = 1 + (size_t)rd[0];
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-int sldns_str2wire_ilnp64_buf(const char* str, uint8_t* rd, size_t* len)
-{
- unsigned int a, b, c, d;
- uint16_t shorts[4];
- int l;
- if(*len < sizeof(shorts))
- return LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL;
-
- 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_WIREPARSE_ERR_SYNTAX_ILNP64;
- shorts[0] = htons(a);
- shorts[1] = htons(b);
- shorts[2] = htons(c);
- shorts[3] = htons(d);
- memmove(rd, &shorts, sizeof(shorts));
- *len = sizeof(shorts);
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-int sldns_str2wire_eui48_buf(const char* str, uint8_t* rd, size_t* len)
-{
- unsigned int a, b, c, d, e, f;
- int l;
-
- if(*len < 6)
- return LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL;
- if (sscanf(str, "%2x-%2x-%2x-%2x-%2x-%2x%n",
- &a, &b, &c, &d, &e, &f, &l) != 6 ||
- l != (int)strlen(str))
- return LDNS_WIREPARSE_ERR_SYNTAX_EUI48;
- rd[0] = a;
- rd[1] = b;
- rd[2] = c;
- rd[3] = d;
- rd[4] = e;
- rd[5] = f;
- *len = 6;
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-int sldns_str2wire_eui64_buf(const char* str, uint8_t* rd, size_t* len)
-{
- unsigned int a, b, c, d, e, f, g, h;
- int l;
-
- if(*len < 8)
- return LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL;
- 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))
- return LDNS_WIREPARSE_ERR_SYNTAX_EUI64;
- rd[0] = a;
- rd[1] = b;
- rd[2] = c;
- rd[3] = d;
- rd[4] = e;
- rd[5] = f;
- rd[6] = g;
- rd[7] = h;
- *len = 8;
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-int sldns_str2wire_tag_buf(const char* str, uint8_t* rd, size_t* len)
-{
- size_t slen = strlen(str);
- const char* ptr;
-
- if (slen > 255)
- return LDNS_WIREPARSE_ERR_SYNTAX_TAG;
- if(*len < slen+1)
- return LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL;
- for (ptr = str; *ptr; ptr++) {
- if(!isalnum(*ptr))
- return RET_ERR(LDNS_WIREPARSE_ERR_SYNTAX_TAG, ptr-str);
- }
- rd[0] = slen;
- memmove(rd+1, str, slen);
- *len = slen+1;
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-int sldns_str2wire_long_str_buf(const char* str, uint8_t* rd, size_t* len)
-{
- uint8_t ch = 0;
- const char* pstr = str;
- size_t length = 0;
-
- /* Fill data with parsed bytes */
- while (sldns_parse_char(&ch, &pstr)) {
- if(*len < length+1)
- return LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL;
- rd[length++] = ch;
- }
- if(!pstr)
- return LDNS_WIREPARSE_ERR_SYNTAX_BAD_ESCAPE;
- *len = length;
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-int sldns_str2wire_hip_buf(const char* str, uint8_t* rd, size_t* len)
-{
- char* s, *end;
- int e;
- size_t hitlen, pklen = 0;
- /* presentation format:
- * pk-algo HIThex pubkeybase64
- * wireformat:
- * hitlen[1byte] pkalgo[1byte] pubkeylen[2byte] [hit] [pubkey] */
- if(*len < 4)
- return LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL;
-
- /* read PK algorithm */
- rd[1] = (uint8_t)strtol((char*)str, &s, 10);
- if(*s != ' ')
- return RET_ERR(LDNS_WIREPARSE_ERR_SYNTAX_INT, s-(char*)str);
- s++;
- while(*s == ' ')
- s++;
-
- /* read HIT hex tag */
- /* zero terminate the tag (replace later) */
- end = strchr(s, ' ');
- if(!end) return RET_ERR(LDNS_WIREPARSE_ERR_SYNTAX, s-(char*)str);
- *end = 0;
- hitlen = *len - 4;
- if((e = sldns_str2wire_hex_buf(s, rd+4, &hitlen)) != 0) {
- *end = ' ';
- return RET_ERR_SHIFT(e, s-(char*)str);
- }
- if(hitlen > 255) {
- *end = ' ';
- return RET_ERR(LDNS_WIREPARSE_ERR_LABEL_OVERFLOW, s-(char*)str+255*2);
- }
- rd[0] = (uint8_t)hitlen;
- *end = ' ';
- s = end+1;
-
- /* read pubkey base64 sequence */
- pklen = *len - 4 - hitlen;
- if((e = sldns_str2wire_b64_buf(s, rd+4+hitlen, &pklen)) != 0)
- return RET_ERR_SHIFT(e, s-(char*)str);
- if(pklen > 65535)
- return RET_ERR(LDNS_WIREPARSE_ERR_LABEL_OVERFLOW, s-(char*)str+65535);
- sldns_write_uint16(rd+2, pklen);
-
- *len = 4 + hitlen + pklen;
- return LDNS_WIREPARSE_ERR_OK;
-}
-
-int sldns_str2wire_int16_data_buf(const char* str, uint8_t* rd, size_t* len)
-{
- size_t sz = sldns_b64_pton_calculate_size(strlen(str));
- int n;
- if(*len < sz+2)
- return LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL;
- if(sz > 65535)
- return LDNS_WIREPARSE_ERR_LABEL_OVERFLOW;
- n = sldns_b64_pton(str, rd+2, (*len)-2);
- if(n < 0)
- return LDNS_WIREPARSE_ERR_SYNTAX_B64;
- sldns_write_uint16(rd, (uint16_t)n);
- *len = (size_t)n;
- return LDNS_WIREPARSE_ERR_OK;
-}
+++ /dev/null
-/**
- * str2wire.h - read txt presentation of RRs
- *
- * (c) NLnet Labs, 2005-2006
- *
- * See the file LICENSE for the license
- */
-
-/**
- * \file
- *
- * Parses text to wireformat.
- */
-
-#ifndef LDNS_STR2WIRE_H
-#define LDNS_STR2WIRE_H
-
-/* include rrdef for MAX_DOMAINLEN constant */
-#include <ldns/rrdef.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-struct sldns_struct_lookup_table;
-
-/** buffer to read an RR, cannot be larger than 64K because of packet size */
-#define LDNS_RR_BUF_SIZE 65535 /* bytes */
-#define LDNS_DEFAULT_TTL 3600
-
-/*
- * To convert class and type to string see
- * sldns_get_rr_class_by_name(str)
- * sldns_get_rr_type_by_name(str)
- * from rrdef.h
- */
-
-/**
- * Convert text string into dname wireformat, mallocless, with user buffer.
- * @param str: the text string with the domain name.
- * @param buf: the result buffer, suggested size LDNS_MAX_DOMAINLEN+1
- * @param len: length of the buffer on input, length of the result on output.
- * @return 0 on success, otherwise an error.
- */
-int sldns_str2wire_dname_buf(const char* str, uint8_t* buf, size_t* len);
-
-/**
- * Same as sldns_str2wire_dname_buf, but concatenates origin if the domain
- * name is relative (does not end in '.').
- * @param str: the text string with the domain name.
- * @param buf: the result buffer, suggested size LDNS_MAX_DOMAINLEN+1
- * @param len: length of the buffer on input, length of the result on output.
- * @param origin: the origin to append or NULL (nothing is appended).
- * @param origin_len: length of origin.
- * @return 0 on success, otherwise an error.
- */
-int sldns_str2wire_dname_buf_origin(const char* str, uint8_t* buf, size_t* len,
- uint8_t* origin, size_t origin_len);
-
-/**
- * Convert text string into dname wireformat
- * @param str: the text string with the domain name.
- * @param len: returned length of wireformat.
- * @return wireformat dname (malloced) or NULL on failure.
- */
-uint8_t* sldns_str2wire_dname(const char* str, size_t* len);
-
-/**
- * Convert text RR to wireformat, with user buffer.
- * @param str: the RR data in text presentation format.
- * @param rr: the buffer where the result is stored into. This buffer has
- * the wire-dname(uncompressed), type, class, ttl, rdatalen, rdata.
- * These values are probably not aligned, and in network format.
- * Use the sldns_wirerr_get_xxx functions to access them safely.
- * buffer size LDNS_RR_BUF_SIZE is suggested.
- * @param len: on input the length of the buffer, on output the amount of
- * the buffer used for the rr.
- * @param dname_len: if non-NULL, filled with the dname length as result.
- * Because after the dname you find the type, class, ttl, rdatalen, rdata.
- * @param default_ttl: TTL used if no TTL available.
- * @param origin: used for origin dname (if not NULL)
- * @param origin_len: length of origin.
- * @param prev: used for prev_rr dname (if not NULL)
- * @param prev_len: length of prev.
- * @return 0 on success, an error on failure.
- */
-int sldns_str2wire_rr_buf(const char* str, uint8_t* rr, size_t* len,
- size_t* dname_len, uint32_t default_ttl, uint8_t* origin,
- size_t origin_len, uint8_t* prev, size_t prev_len);
-
-/**
- * Same as sldns_str2wire_rr_buf, but there is no rdata, it returns an RR
- * with zero rdata and no ttl. It has name, type, class.
- * You can access those with the sldns_wirerr_get_type and class functions.
- * @param str: the RR data in text presentation format.
- * @param rr: the buffer where the result is stored into.
- * @param len: on input the length of the buffer, on output the amount of
- * the buffer used for the rr.
- * @param dname_len: if non-NULL, filled with the dname length as result.
- * Because after the dname you find the type, class, ttl, rdatalen, rdata.
- * @param origin: used for origin dname (if not NULL)
- * @param origin_len: length of origin.
- * @param prev: used for prev_rr dname (if not NULL)
- * @param prev_len: length of prev.
- * @return 0 on success, an error on failure.
- */
-int sldns_str2wire_rr_question_buf(const char* str, uint8_t* rr, size_t* len,
- size_t* dname_len, uint8_t* origin, size_t origin_len, uint8_t* prev,
- size_t prev_len);
-
-/**
- * Get the type of the RR.
- * @param rr: the RR in wire format.
- * @param len: rr length.
- * @param dname_len: dname length to skip.
- * @return type in host byteorder
- */
-uint16_t sldns_wirerr_get_type(uint8_t* rr, size_t len, size_t dname_len);
-
-/**
- * Get the class of the RR.
- * @param rr: the RR in wire format.
- * @param len: rr length.
- * @param dname_len: dname length to skip.
- * @return class in host byteorder
- */
-uint16_t sldns_wirerr_get_class(uint8_t* rr, size_t len, size_t dname_len);
-
-/**
- * Get the ttl of the RR.
- * @param rr: the RR in wire format.
- * @param len: rr length.
- * @param dname_len: dname length to skip.
- * @return ttl in host byteorder
- */
-uint32_t sldns_wirerr_get_ttl(uint8_t* rr, size_t len, size_t dname_len);
-
-/**
- * Get the rdata length of the RR.
- * @param rr: the RR in wire format.
- * @param len: rr length.
- * @param dname_len: dname length to skip.
- * @return rdata length in host byteorder
- * If the rdata length is larger than the rr-len allows, it is truncated.
- * So, that it is safe to read the data length returned
- * from this function from the rdata pointer of sldns_wirerr_get_rdata.
- */
-uint16_t sldns_wirerr_get_rdatalen(uint8_t* rr, size_t len, size_t dname_len);
-
-/**
- * Get the rdata pointer of the RR.
- * @param rr: the RR in wire format.
- * @param len: rr length.
- * @param dname_len: dname length to skip.
- * @return rdata pointer
- */
-uint8_t* sldns_wirerr_get_rdata(uint8_t* rr, size_t len, size_t dname_len);
-
-/**
- * Get the rdata pointer of the RR. prefixed with rdata length.
- * @param rr: the RR in wire format.
- * @param len: rr length.
- * @param dname_len: dname length to skip.
- * @return pointer to rdatalength, followed by the rdata.
- */
-uint8_t* sldns_wirerr_get_rdatawl(uint8_t* rr, size_t len, size_t dname_len);
-
-/**
- * Parse result codes
- */
-#define LDNS_WIREPARSE_MASK 0x0fff
-#define LDNS_WIREPARSE_SHIFT 12
-#define LDNS_WIREPARSE_ERROR(e) ((e)&LDNS_WIREPARSE_MASK)
-#define LDNS_WIREPARSE_OFFSET(e) (((e)&~LDNS_WIREPARSE_MASK)>>LDNS_WIREPARSE_SHIFT)
-/* use lookuptable to get error string, sldns_wireparse_errors */
-#define LDNS_WIREPARSE_ERR_OK 0
-#define LDNS_WIREPARSE_ERR_GENERAL 342
-#define LDNS_WIREPARSE_ERR_DOMAINNAME_OVERFLOW 343
-#define LDNS_WIREPARSE_ERR_DOMAINNAME_UNDERFLOW 344
-#define LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL 345
-#define LDNS_WIREPARSE_ERR_LABEL_OVERFLOW 346
-#define LDNS_WIREPARSE_ERR_EMPTY_LABEL 347
-#define LDNS_WIREPARSE_ERR_SYNTAX_BAD_ESCAPE 348
-#define LDNS_WIREPARSE_ERR_SYNTAX 349
-#define LDNS_WIREPARSE_ERR_SYNTAX_TTL 350
-#define LDNS_WIREPARSE_ERR_SYNTAX_TYPE 351
-#define LDNS_WIREPARSE_ERR_SYNTAX_CLASS 352
-#define LDNS_WIREPARSE_ERR_SYNTAX_RDATA 353
-#define LDNS_WIREPARSE_ERR_SYNTAX_MISSING_VALUE 354
-#define LDNS_WIREPARSE_ERR_INVALID_STR 355
-#define LDNS_WIREPARSE_ERR_SYNTAX_B64 356
-#define LDNS_WIREPARSE_ERR_SYNTAX_B32_EXT 357
-#define LDNS_WIREPARSE_ERR_SYNTAX_HEX 358
-#define LDNS_WIREPARSE_ERR_CERT_BAD_ALGORITHM 359
-#define LDNS_WIREPARSE_ERR_SYNTAX_TIME 360
-#define LDNS_WIREPARSE_ERR_SYNTAX_PERIOD 361
-#define LDNS_WIREPARSE_ERR_SYNTAX_ILNP64 362
-#define LDNS_WIREPARSE_ERR_SYNTAX_EUI48 363
-#define LDNS_WIREPARSE_ERR_SYNTAX_EUI64 364
-#define LDNS_WIREPARSE_ERR_SYNTAX_TAG 365
-#define LDNS_WIREPARSE_ERR_NOT_IMPL 366
-#define LDNS_WIREPARSE_ERR_SYNTAX_INT 367
-#define LDNS_WIREPARSE_ERR_SYNTAX_IP4 368
-#define LDNS_WIREPARSE_ERR_SYNTAX_IP6 369
-#define LDNS_WIREPARSE_ERR_SYNTAX_INTEGER_OVERFLOW 370
-#define LDNS_WIREPARSE_ERR_INCLUDE 371
-#define LDNS_WIREPARSE_ERR_PARENTHESIS 372
-
-/**
- * Get reference to a constant string for the (parse) error.
- * @param e: error return value
- * @return string.
- */
-const char* sldns_get_errorstr_parse(int e);
-
-/**
- * wire parse state for parsing files
- */
-struct sldns_file_parse_state {
- /** the origin domain name, if len!=0. uncompressed wireformat */
- uint8_t origin[LDNS_MAX_DOMAINLEN+1];
- /** length of origin domain name, in bytes. 0 if not set. */
- size_t origin_len;
- /** the previous domain name, if len!=0. uncompressed wireformat*/
- uint8_t prev_rr[LDNS_MAX_DOMAINLEN+1];
- /** length of the previous domain name, in bytes. 0 if not set. */
- size_t prev_rr_len;
- /** default TTL, this is used if the text does not specify a TTL,
- * host byteorder */
- uint32_t default_ttl;
- /** line number information */
- int lineno;
-};
-
-/**
- * Read one RR from zonefile with buffer for the data.
- * @param in: file that is read from (one RR, multiple lines if it spans them).
- * @param rr: this is malloced by the user and the result is stored here,
- * if an RR is read. If no RR is read this is signalled with the
- * return len set to 0 (for ORIGIN, TTL directives).
- * @param len: on input, the length of the rr buffer. on output the rr len.
- * Buffer size of 64k should be enough.
- * @param dname_len: returns the length of the dname initial part of the rr.
- * @param parse_state: pass a pointer to user-allocated struct.
- * Contents are maintained by this function.
- * If you pass NULL then ORIGIN and TTL directives are not honored.
- * You can start out with a particular origin by pre-filling it.
- * otherwise, zero the structure before passing it.
- * lineno is incremented when a newline is passed by the parser,
- * you should initialize it at 1 at the start of the file.
- * @return 0 on success, error on failure.
- */
-int sldns_fp2wire_rr_buf(FILE* in, uint8_t* rr, size_t* len, size_t* dname_len,
- struct sldns_file_parse_state* parse_state);
-
-/**
- * Convert one rdf in rdata to wireformat and parse from string.
- * @param str: the text to convert for this rdata element.
- * @param rd: rdata buffer for the wireformat.
- * @param len: length of rd buffer on input, used length on output.
- * @param rdftype: the type of the rdf.
- * @return 0 on success, error on failure.
- */
-int sldns_str2wire_rdf_buf(const char* str, uint8_t* rd, size_t* len,
- sldns_rdf_type rdftype);
-
-/**
- * Convert rdf of type LDNS_RDF_TYPE_INT8 from string to wireformat.
- * @param str: the text to convert for this rdata element.
- * @param rd: rdata buffer for the wireformat.
- * @param len: length of rd buffer on input, used length on output.
- * @return 0 on success, error on failure.
- */
-int sldns_str2wire_int8_buf(const char* str, uint8_t* rd, size_t* len);
-
-/**
- * Convert rdf of type LDNS_RDF_TYPE_INT16 from string to wireformat.
- * @param str: the text to convert for this rdata element.
- * @param rd: rdata buffer for the wireformat.
- * @param len: length of rd buffer on input, used length on output.
- * @return 0 on success, error on failure.
- */
-int sldns_str2wire_int16_buf(const char* str, uint8_t* rd, size_t* len);
-
-/**
- * Convert rdf of type LDNS_RDF_TYPE_INT32 from string to wireformat.
- * @param str: the text to convert for this rdata element.
- * @param rd: rdata buffer for the wireformat.
- * @param len: length of rd buffer on input, used length on output.
- * @return 0 on success, error on failure.
- */
-int sldns_str2wire_int32_buf(const char* str, uint8_t* rd, size_t* len);
-
-/**
- * Convert rdf of type LDNS_RDF_TYPE_A from string to wireformat.
- * @param str: the text to convert for this rdata element.
- * @param rd: rdata buffer for the wireformat.
- * @param len: length of rd buffer on input, used length on output.
- * @return 0 on success, error on failure.
- */
-int sldns_str2wire_a_buf(const char* str, uint8_t* rd, size_t* len);
-
-/**
- * Convert rdf of type LDNS_RDF_TYPE_AAAA from string to wireformat.
- * @param str: the text to convert for this rdata element.
- * @param rd: rdata buffer for the wireformat.
- * @param len: length of rd buffer on input, used length on output.
- * @return 0 on success, error on failure.
- */
-int sldns_str2wire_aaaa_buf(const char* str, uint8_t* rd, size_t* len);
-
-/**
- * Convert rdf of type LDNS_RDF_TYPE_STR from string to wireformat.
- * @param str: the text to convert for this rdata element.
- * @param rd: rdata buffer for the wireformat.
- * @param len: length of rd buffer on input, used length on output.
- * @return 0 on success, error on failure.
- */
-int sldns_str2wire_str_buf(const char* str, uint8_t* rd, size_t* len);
-
-/**
- * Convert rdf of type LDNS_RDF_TYPE_APL from string to wireformat.
- * @param str: the text to convert for this rdata element.
- * @param rd: rdata buffer for the wireformat.
- * @param len: length of rd buffer on input, used length on output.
- * @return 0 on success, error on failure.
- */
-int sldns_str2wire_apl_buf(const char* str, uint8_t* rd, size_t* len);
-
-/**
- * Convert rdf of type LDNS_RDF_TYPE_B64 from string to wireformat.
- * @param str: the text to convert for this rdata element.
- * @param rd: rdata buffer for the wireformat.
- * @param len: length of rd buffer on input, used length on output.
- * @return 0 on success, error on failure.
- */
-int sldns_str2wire_b64_buf(const char* str, uint8_t* rd, size_t* len);
-
-/**
- * Convert rdf of type LDNS_RDF_TYPE_B32_EXT from string to wireformat.
- * And also LDNS_RDF_TYPE_NSEC3_NEXT_OWNER.
- * @param str: the text to convert for this rdata element.
- * @param rd: rdata buffer for the wireformat.
- * @param len: length of rd buffer on input, used length on output.
- * @return 0 on success, error on failure.
- */
-int sldns_str2wire_b32_ext_buf(const char* str, uint8_t* rd, size_t* len);
-
-/**
- * Convert rdf of type LDNS_RDF_TYPE_HEX from string to wireformat.
- * @param str: the text to convert for this rdata element.
- * @param rd: rdata buffer for the wireformat.
- * @param len: length of rd buffer on input, used length on output.
- * @return 0 on success, error on failure.
- */
-int sldns_str2wire_hex_buf(const char* str, uint8_t* rd, size_t* len);
-
-/**
- * Convert rdf of type LDNS_RDF_TYPE_NSEC from string to wireformat.
- * @param str: the text to convert for this rdata element.
- * @param rd: rdata buffer for the wireformat.
- * @param len: length of rd buffer on input, used length on output.
- * @return 0 on success, error on failure.
- */
-int sldns_str2wire_nsec_buf(const char* str, uint8_t* rd, size_t* len);
-
-/**
- * Convert rdf of type LDNS_RDF_TYPE_TYPE from string to wireformat.
- * @param str: the text to convert for this rdata element.
- * @param rd: rdata buffer for the wireformat.
- * @param len: length of rd buffer on input, used length on output.
- * @return 0 on success, error on failure.
- */
-int sldns_str2wire_type_buf(const char* str, uint8_t* rd, size_t* len);
-
-/**
- * Convert rdf of type LDNS_RDF_TYPE_CLASS from string to wireformat.
- * @param str: the text to convert for this rdata element.
- * @param rd: rdata buffer for the wireformat.
- * @param len: length of rd buffer on input, used length on output.
- * @return 0 on success, error on failure.
- */
-int sldns_str2wire_class_buf(const char* str, uint8_t* rd, size_t* len);
-
-/**
- * Convert rdf of type LDNS_RDF_TYPE_CERT_ALG from string to wireformat.
- * @param str: the text to convert for this rdata element.
- * @param rd: rdata buffer for the wireformat.
- * @param len: length of rd buffer on input, used length on output.
- * @return 0 on success, error on failure.
- */
-int sldns_str2wire_cert_alg_buf(const char* str, uint8_t* rd, size_t* len);
-
-/**
- * Convert rdf of type LDNS_RDF_TYPE_ALG from string to wireformat.
- * @param str: the text to convert for this rdata element.
- * @param rd: rdata buffer for the wireformat.
- * @param len: length of rd buffer on input, used length on output.
- * @return 0 on success, error on failure.
- */
-int sldns_str2wire_alg_buf(const char* str, uint8_t* rd, size_t* len);
-
-/**
- * Convert rdf of type LDNS_RDF_TYPE_TIME from string to wireformat.
- * @param str: the text to convert for this rdata element.
- * @param rd: rdata buffer for the wireformat.
- * @param len: length of rd buffer on input, used length on output.
- * @return 0 on success, error on failure.
- */
-int sldns_str2wire_time_buf(const char* str, uint8_t* rd, size_t* len);
-
-/**
- * Convert rdf of type LDNS_RDF_TYPE_PERIOD from string to wireformat.
- * @param str: the text to convert for this rdata element.
- * @param rd: rdata buffer for the wireformat.
- * @param len: length of rd buffer on input, used length on output.
- * @return 0 on success, error on failure.
- */
-int sldns_str2wire_period_buf(const char* str, uint8_t* rd, size_t* len);
-
-/**
- * Convert rdf of type LDNS_RDF_TYPE_LOC from string to wireformat.
- * @param str: the text to convert for this rdata element.
- * @param rd: rdata buffer for the wireformat.
- * @param len: length of rd buffer on input, used length on output.
- * @return 0 on success, error on failure.
- */
-int sldns_str2wire_loc_buf(const char* str, uint8_t* rd, size_t* len);
-
-/**
- * Convert rdf of type LDNS_RDF_TYPE_WKS from string to wireformat.
- * @param str: the text to convert for this rdata element.
- * @param rd: rdata buffer for the wireformat.
- * @param len: length of rd buffer on input, used length on output.
- * @return 0 on success, error on failure.
- */
-int sldns_str2wire_wks_buf(const char* str, uint8_t* rd, size_t* len);
-
-/**
- * Convert rdf of type LDNS_RDF_TYPE_NSAP from string to wireformat.
- * @param str: the text to convert for this rdata element.
- * @param rd: rdata buffer for the wireformat.
- * @param len: length of rd buffer on input, used length on output.
- * @return 0 on success, error on failure.
- */
-int sldns_str2wire_nsap_buf(const char* str, uint8_t* rd, size_t* len);
-
-/**
- * Convert rdf of type LDNS_RDF_TYPE_ATMA from string to wireformat.
- * @param str: the text to convert for this rdata element.
- * @param rd: rdata buffer for the wireformat.
- * @param len: length of rd buffer on input, used length on output.
- * @return 0 on success, error on failure.
- */
-int sldns_str2wire_atma_buf(const char* str, uint8_t* rd, size_t* len);
-
-/**
- * Convert rdf of type LDNS_RDF_TYPE_IPSECKEY from string to wireformat.
- * @param str: the text to convert for this rdata element.
- * @param rd: rdata buffer for the wireformat.
- * @param len: length of rd buffer on input, used length on output.
- * @return 0 on success, error on failure.
- */
-int sldns_str2wire_ipseckey_buf(const char* str, uint8_t* rd, size_t* len);
-
-/**
- * Convert rdf of type LDNS_RDF_TYPE_NSEC3_SALT from string to wireformat.
- * @param str: the text to convert for this rdata element.
- * @param rd: rdata buffer for the wireformat.
- * @param len: length of rd buffer on input, used length on output.
- * @return 0 on success, error on failure.
- */
-int sldns_str2wire_nsec3_salt_buf(const char* str, uint8_t* rd, size_t* len);
-
-/**
- * Convert rdf of type LDNS_RDF_TYPE_ILNP64 from string to wireformat.
- * @param str: the text to convert for this rdata element.
- * @param rd: rdata buffer for the wireformat.
- * @param len: length of rd buffer on input, used length on output.
- * @return 0 on success, error on failure.
- */
-int sldns_str2wire_ilnp64_buf(const char* str, uint8_t* rd, size_t* len);
-
-/**
- * Convert rdf of type LDNS_RDF_TYPE_EUI48 from string to wireformat.
- * @param str: the text to convert for this rdata element.
- * @param rd: rdata buffer for the wireformat.
- * @param len: length of rd buffer on input, used length on output.
- * @return 0 on success, error on failure.
- */
-int sldns_str2wire_eui48_buf(const char* str, uint8_t* rd, size_t* len);
-
-/**
- * Convert rdf of type LDNS_RDF_TYPE_EUI64 from string to wireformat.
- * @param str: the text to convert for this rdata element.
- * @param rd: rdata buffer for the wireformat.
- * @param len: length of rd buffer on input, used length on output.
- * @return 0 on success, error on failure.
- */
-int sldns_str2wire_eui64_buf(const char* str, uint8_t* rd, size_t* len);
-
-/**
- * Convert rdf of type LDNS_RDF_TYPE_TAG from string to wireformat.
- * @param str: the text to convert for this rdata element.
- * @param rd: rdata buffer for the wireformat.
- * @param len: length of rd buffer on input, used length on output.
- * @return 0 on success, error on failure.
- */
-int sldns_str2wire_tag_buf(const char* str, uint8_t* rd, size_t* len);
-
-/**
- * Convert rdf of type LDNS_RDF_TYPE_LONG_STR from string to wireformat.
- * @param str: the text to convert for this rdata element.
- * @param rd: rdata buffer for the wireformat.
- * @param len: length of rd buffer on input, used length on output.
- * @return 0 on success, error on failure.
- */
-int sldns_str2wire_long_str_buf(const char* str, uint8_t* rd, size_t* len);
-
-/**
- * Convert rdf of type LDNS_RDF_TYPE_HIP from string to wireformat.
- * @param str: the text to convert for this rdata element.
- * @param rd: rdata buffer for the wireformat.
- * @param len: length of rd buffer on input, used length on output.
- * @return 0 on success, error on failure.
- */
-int sldns_str2wire_hip_buf(const char* str, uint8_t* rd, size_t* len);
-
-/**
- * Convert rdf of type LDNS_RDF_TYPE_INT16_DATA from string to wireformat.
- * @param str: the text to convert for this rdata element.
- * @param rd: rdata buffer for the wireformat.
- * @param len: length of rd buffer on input, used length on output.
- * @return 0 on success, error on failure.
- */
-int sldns_str2wire_int16_data_buf(const char* str, uint8_t* rd, size_t* len);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* LDNS_STR2WIRE_H */
+++ /dev/null
-/*
- * wire2str.c
- *
- * conversion routines from the wire format
- * to the presentation format (strings)
- *
- * (c) NLnet Labs, 2004-2006
- *
- * See the file LICENSE for the license
- */
-/**
- * \file
- *
- * Contains functions to translate the wireformat to text
- * representation, as well as functions to print them.
- */
-#include "config.h"
-#include "ldns/wire2str.h"
-#include "ldns/str2wire.h"
-#include "ldns/rrdef.h"
-#include "ldns/pkthdr.h"
-#include "ldns/parseutil.h"
-#include "ldns/sbuffer.h"
-#include "ldns/keyraw.h"
-#ifdef HAVE_TIME_H
-#include <time.h>
-#endif
-#include <sys/time.h>
-#include <stdarg.h>
-#include <ctype.h>
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-
-/* lookup tables for standard DNS stuff */
-/* Taken from RFC 2535, section 7. */
-static sldns_lookup_table sldns_algorithms_data[] = {
- { LDNS_RSAMD5, "RSAMD5" },
- { LDNS_DH, "DH" },
- { LDNS_DSA, "DSA" },
- { LDNS_ECC, "ECC" },
- { LDNS_RSASHA1, "RSASHA1" },
- { LDNS_DSA_NSEC3, "DSA-NSEC3-SHA1" },
- { LDNS_RSASHA1_NSEC3, "RSASHA1-NSEC3-SHA1" },
- { LDNS_RSASHA256, "RSASHA256"},
- { LDNS_RSASHA512, "RSASHA512"},
- { LDNS_ECC_GOST, "ECC-GOST"},
- { LDNS_ECDSAP256SHA256, "ECDSAP256SHA256"},
- { LDNS_ECDSAP384SHA384, "ECDSAP384SHA384"},
- { LDNS_INDIRECT, "INDIRECT" },
- { LDNS_PRIVATEDNS, "PRIVATEDNS" },
- { LDNS_PRIVATEOID, "PRIVATEOID" },
- { 0, NULL }
-};
-sldns_lookup_table* sldns_algorithms = sldns_algorithms_data;
-
-/* hash algorithms in DS record */
-static sldns_lookup_table sldns_hashes_data[] = {
- { LDNS_SHA1, "SHA1" },
- { LDNS_SHA256, "SHA256" },
- { LDNS_HASH_GOST, "HASH-GOST" },
- { LDNS_SHA384, "SHA384" },
- { 0, NULL }
-};
-sldns_lookup_table* sldns_hashes = sldns_hashes_data;
-
-/* Taken from RFC 4398 */
-static sldns_lookup_table sldns_cert_algorithms_data[] = {
- { LDNS_CERT_PKIX, "PKIX" },
- { LDNS_CERT_SPKI, "SPKI" },
- { LDNS_CERT_PGP, "PGP" },
- { LDNS_CERT_IPKIX, "IPKIX" },
- { LDNS_CERT_ISPKI, "ISPKI" },
- { LDNS_CERT_IPGP, "IPGP" },
- { LDNS_CERT_ACPKIX, "ACPKIX" },
- { LDNS_CERT_IACPKIX, "IACPKIX" },
- { LDNS_CERT_URI, "URI" },
- { LDNS_CERT_OID, "OID" },
- { 0, NULL }
-};
-sldns_lookup_table* sldns_cert_algorithms = sldns_cert_algorithms_data;
-
-/* if these are used elsewhere */
-static sldns_lookup_table sldns_rcodes_data[] = {
- { LDNS_RCODE_NOERROR, "NOERROR" },
- { LDNS_RCODE_FORMERR, "FORMERR" },
- { LDNS_RCODE_SERVFAIL, "SERVFAIL" },
- { LDNS_RCODE_NXDOMAIN, "NXDOMAIN" },
- { LDNS_RCODE_NOTIMPL, "NOTIMPL" },
- { LDNS_RCODE_REFUSED, "REFUSED" },
- { LDNS_RCODE_YXDOMAIN, "YXDOMAIN" },
- { LDNS_RCODE_YXRRSET, "YXRRSET" },
- { LDNS_RCODE_NXRRSET, "NXRRSET" },
- { LDNS_RCODE_NOTAUTH, "NOTAUTH" },
- { LDNS_RCODE_NOTZONE, "NOTZONE" },
- { 0, NULL }
-};
-sldns_lookup_table* sldns_rcodes = sldns_rcodes_data;
-
-static sldns_lookup_table sldns_opcodes_data[] = {
- { LDNS_PACKET_QUERY, "QUERY" },
- { LDNS_PACKET_IQUERY, "IQUERY" },
- { LDNS_PACKET_STATUS, "STATUS" },
- { LDNS_PACKET_NOTIFY, "NOTIFY" },
- { LDNS_PACKET_UPDATE, "UPDATE" },
- { 0, NULL }
-};
-sldns_lookup_table* sldns_opcodes = sldns_opcodes_data;
-
-static sldns_lookup_table sldns_wireparse_errors_data[] = {
- { LDNS_WIREPARSE_ERR_OK, "no parse error" },
- { LDNS_WIREPARSE_ERR_GENERAL, "parse error" },
- { LDNS_WIREPARSE_ERR_DOMAINNAME_OVERFLOW, "Domainname length overflow" },
- { LDNS_WIREPARSE_ERR_DOMAINNAME_UNDERFLOW, "Domainname length underflow (zero length)" },
- { LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL, "buffer too small" },
- { LDNS_WIREPARSE_ERR_LABEL_OVERFLOW, "Label length overflow" },
- { LDNS_WIREPARSE_ERR_EMPTY_LABEL, "Empty label" },
- { LDNS_WIREPARSE_ERR_SYNTAX_BAD_ESCAPE, "Syntax error, bad escape sequence" },
- { LDNS_WIREPARSE_ERR_SYNTAX, "Syntax error, could not parse the RR" },
- { LDNS_WIREPARSE_ERR_SYNTAX_TTL, "Syntax error, could not parse the RR's TTL" },
- { LDNS_WIREPARSE_ERR_SYNTAX_TYPE, "Syntax error, could not parse the RR's type" },
- { LDNS_WIREPARSE_ERR_SYNTAX_CLASS, "Syntax error, could not parse the RR's class" },
- { LDNS_WIREPARSE_ERR_SYNTAX_RDATA, "Syntax error, could not parse the RR's rdata" },
- { LDNS_WIREPARSE_ERR_SYNTAX_MISSING_VALUE, "Syntax error, value expected" },
- { LDNS_WIREPARSE_ERR_INVALID_STR, "Conversion error, string expected" },
- { LDNS_WIREPARSE_ERR_SYNTAX_B64, "Conversion error, b64 encoding expected" },
- { LDNS_WIREPARSE_ERR_SYNTAX_B32_EXT, "Conversion error, b32 ext encoding expected" },
- { LDNS_WIREPARSE_ERR_SYNTAX_HEX, "Conversion error, hex encoding expected" },
- { LDNS_WIREPARSE_ERR_CERT_BAD_ALGORITHM, "Bad algorithm type for CERT record" },
- { LDNS_WIREPARSE_ERR_SYNTAX_TIME, "Conversion error, time encoding expected" },
- { LDNS_WIREPARSE_ERR_SYNTAX_PERIOD, "Conversion error, time period encoding expected" },
- { LDNS_WIREPARSE_ERR_SYNTAX_ILNP64, "Conversion error, 4 colon separated hex numbers expected" },
- { LDNS_WIREPARSE_ERR_SYNTAX_EUI48,
- "Conversion error, 6 two character hex numbers "
- "separated by dashes expected (i.e. xx-xx-xx-xx-xx-xx" },
- { LDNS_WIREPARSE_ERR_SYNTAX_EUI64,
- "Conversion error, 8 two character hex numbers "
- "separated by dashes expected (i.e. xx-xx-xx-xx-xx-xx-xx-xx" },
- { LDNS_WIREPARSE_ERR_SYNTAX_TAG,
- "Conversion error, a non-zero sequence of US-ASCII letters "
- "and numbers in lower case expected" },
- { LDNS_WIREPARSE_ERR_NOT_IMPL, "not implemented" },
- { LDNS_WIREPARSE_ERR_SYNTAX_INT, "Conversion error, integer expected" },
- { LDNS_WIREPARSE_ERR_SYNTAX_IP4, "Conversion error, ip4 addr expected" },
- { LDNS_WIREPARSE_ERR_SYNTAX_IP6, "Conversion error, ip6 addr expected" },
- { LDNS_WIREPARSE_ERR_SYNTAX_INTEGER_OVERFLOW, "Syntax error, integer overflow" },
- { LDNS_WIREPARSE_ERR_INCLUDE, "$INCLUDE directive was seen in the zone" },
- { LDNS_WIREPARSE_ERR_PARENTHESIS, "Parse error, parenthesis mismatch" },
- { 0, NULL }
-};
-sldns_lookup_table* sldns_wireparse_errors = sldns_wireparse_errors_data;
-
-static sldns_lookup_table sldns_edns_flags_data[] = {
- { 3600, "do"},
- { 0, NULL}
-};
-sldns_lookup_table* sldns_edns_flags = sldns_edns_flags_data;
-
-static sldns_lookup_table sldns_edns_options_data[] = {
- { 1, "LLQ" },
- { 2, "UL" },
- { 3, "NSID" },
- /* 4 draft-cheshire-edns0-owner-option */
- { 5, "DAU" },
- { 6, "DHU" },
- { 7, "N3U" },
- { 8, "edns-client-subnet" },
- { 0, NULL}
-};
-sldns_lookup_table* sldns_edns_options = sldns_edns_options_data;
-
-char* sldns_wire2str_pkt(uint8_t* data, size_t len)
-{
- size_t slen = (size_t)sldns_wire2str_pkt_buf(data, len, NULL, 0);
- char* result = (char*)malloc(slen+1);
- if(!result) return NULL;
- sldns_wire2str_pkt_buf(data, len, result, slen+1);
- return result;
-}
-
-char* sldns_wire2str_rr(uint8_t* rr, size_t len)
-{
- size_t slen = (size_t)sldns_wire2str_rr_buf(rr, len, NULL, 0);
- char* result = (char*)malloc(slen+1);
- if(!result) return NULL;
- sldns_wire2str_rr_buf(rr, len, result, slen+1);
- return result;
-}
-
-char* sldns_wire2str_type(uint16_t rrtype)
-{
- char buf[16];
- sldns_wire2str_type_buf(rrtype, buf, sizeof(buf));
- return strdup(buf);
-}
-
-char* sldns_wire2str_class(uint16_t rrclass)
-{
- char buf[16];
- sldns_wire2str_class_buf(rrclass, buf, sizeof(buf));
- return strdup(buf);
-}
-
-char* sldns_wire2str_dname(uint8_t* dname, size_t dname_len)
-{
- size_t slen=(size_t)sldns_wire2str_dname_buf(dname, dname_len, NULL, 0);
- char* result = (char*)malloc(slen+1);
- if(!result) return NULL;
- sldns_wire2str_dname_buf(dname, dname_len, result, slen+1);
- return result;
-}
-
-char* sldns_wire2str_rcode(int rcode)
-{
- char buf[16];
- sldns_wire2str_rcode_buf(rcode, buf, sizeof(buf));
- return strdup(buf);
-}
-
-int sldns_wire2str_pkt_buf(uint8_t* d, size_t dlen, char* s, size_t slen)
-{
- /* use arguments as temporary variables */
- return sldns_wire2str_pkt_scan(&d, &dlen, &s, &slen);
-}
-
-int sldns_wire2str_rr_buf(uint8_t* d, size_t dlen, char* s, size_t slen)
-{
- /* use arguments as temporary variables */
- return sldns_wire2str_rr_scan(&d, &dlen, &s, &slen, NULL, 0);
-}
-
-int sldns_wire2str_rdata_buf(uint8_t* rdata, size_t rdata_len, char* str,
- size_t str_len, uint16_t rrtype)
-{
- /* use arguments as temporary variables */
- return sldns_wire2str_rdata_scan(&rdata, &rdata_len, &str, &str_len,
- rrtype, NULL, 0);
-}
-
-int sldns_wire2str_rr_unknown_buf(uint8_t* d, size_t dlen, char* s, size_t slen)
-{
- /* use arguments as temporary variables */
- return sldns_wire2str_rr_unknown_scan(&d, &dlen, &s, &slen, NULL, 0);
-}
-
-int sldns_wire2str_rr_comment_buf(uint8_t* rr, size_t rrlen, size_t dname_len,
- char* s, size_t slen)
-{
- uint16_t rrtype = sldns_wirerr_get_type(rr, rrlen, dname_len);
- return sldns_wire2str_rr_comment_print(&s, &slen, rr, rrlen, dname_len,
- rrtype);
-}
-
-int sldns_wire2str_type_buf(uint16_t rrtype, char* s, size_t slen)
-{
- /* use arguments as temporary variables */
- return sldns_wire2str_type_print(&s, &slen, rrtype);
-}
-
-int sldns_wire2str_class_buf(uint16_t rrclass, char* s, size_t slen)
-{
- /* use arguments as temporary variables */
- return sldns_wire2str_class_print(&s, &slen, rrclass);
-}
-
-int sldns_wire2str_rcode_buf(int rcode, char* s, size_t slen)
-{
- /* use arguments as temporary variables */
- return sldns_wire2str_rcode_print(&s, &slen, rcode);
-}
-
-int sldns_wire2str_dname_buf(uint8_t* d, size_t dlen, char* s, size_t slen)
-{
- /* use arguments as temporary variables */
- return sldns_wire2str_dname_scan(&d, &dlen, &s, &slen, NULL, 0);
-}
-
-int sldns_str_vprint(char** str, size_t* slen, const char* format, va_list args)
-{
- int w = vsnprintf(*str, *slen, format, args);
- if(w < 0) {
- /* error in printout */
- return 0;
- } else if((size_t)w >= *slen) {
- *str = NULL; /* we do not want str to point outside of buffer*/
- *slen = 0;
- } else {
- *str += w;
- *slen -= w;
- }
- return w;
-}
-
-int sldns_str_print(char** str, size_t* slen, const char* format, ...)
-{
- int w;
- va_list args;
- va_start(args, format);
- w = sldns_str_vprint(str, slen, format, args);
- va_end(args);
- return w;
-}
-
-/** print hex format into text buffer for specified length */
-static int print_hex_buf(char** s, size_t* slen, uint8_t* buf, size_t len)
-{
- const char* hex = "0123456789ABCDEF";
- size_t i;
- for(i=0; i<len; i++) {
- (void)sldns_str_print(s, slen, "%c%c", hex[(buf[i]&0xf0)>>4],
- hex[buf[i]&0x0f]);
- }
- return (int)len*2;
-}
-
-/** print remainder of buffer in hex format with prefixed text */
-static int print_remainder_hex(const char* pref, uint8_t** d, size_t* dlen,
- char** s, size_t* slen)
-{
- int w = 0;
- w += sldns_str_print(s, slen, "%s", pref);
- w += print_hex_buf(s, slen, *d, *dlen);
- *d += *dlen;
- *dlen = 0;
- return w;
-}
-
-int sldns_wire2str_pkt_scan(uint8_t** d, size_t* dlen, char** s, size_t* slen)
-{
- int w = 0;
- unsigned qdcount, ancount, nscount, arcount, i;
- uint8_t* pkt = *d;
- size_t pktlen = *dlen;
- if(*dlen >= LDNS_HEADER_SIZE) {
- qdcount = (unsigned)LDNS_QDCOUNT(*d);
- ancount = (unsigned)LDNS_ANCOUNT(*d);
- nscount = (unsigned)LDNS_NSCOUNT(*d);
- arcount = (unsigned)LDNS_ARCOUNT(*d);
- } else {
- qdcount = ancount = nscount = arcount = 0;
- }
- w += sldns_wire2str_header_scan(d, dlen, s, slen);
- w += sldns_str_print(s, slen, "\n");
- w += sldns_str_print(s, slen, ";; QUESTION SECTION:\n");
- for(i=0; i<qdcount; i++) {
- w += sldns_wire2str_rrquestion_scan(d, dlen, s, slen,
- pkt, pktlen);
- if(!*dlen) break;
- }
- w += sldns_str_print(s, slen, "\n");
- w += sldns_str_print(s, slen, ";; ANSWER SECTION:\n");
- for(i=0; i<ancount; i++) {
- w += sldns_wire2str_rr_scan(d, dlen, s, slen, pkt, pktlen);
- if(!*dlen) break;
- }
- w += sldns_str_print(s, slen, "\n");
- w += sldns_str_print(s, slen, ";; AUTHORITY SECTION:\n");
- for(i=0; i<nscount; i++) {
- w += sldns_wire2str_rr_scan(d, dlen, s, slen, pkt, pktlen);
- if(!*dlen) break;
- }
- w += sldns_str_print(s, slen, "\n");
- w += sldns_str_print(s, slen, ";; ADDITIONAL SECTION:\n");
- for(i=0; i<arcount; i++) {
- w += sldns_wire2str_rr_scan(d, dlen, s, slen, pkt, pktlen);
- if(!*dlen) break;
- }
- /* other fields: WHEN(time), SERVER(IP) not available here. */
- w += sldns_str_print(s, slen, ";; MSG SIZE rcvd: %d\n", (int)pktlen);
- if(*dlen > 0) {
- w += print_remainder_hex(";; trailing garbage 0x",
- d, dlen, s, slen);
- w += sldns_str_print(s, slen, "\n");
- }
- return w;
-}
-
-/** scan type, class and ttl and printout, for rr */
-static int sldns_rr_tcttl_scan(uint8_t** d, size_t* dl, char** s, size_t* sl)
-{
- int w = 0;
- uint16_t t, c;
- uint32_t ttl;
- if(*dl < 8) {
- if(*dl < 4)
- return w + print_remainder_hex("; Error malformed 0x",
- d, dl, s, sl);
- /* these print values or 0x.. if none left */
- t = sldns_read_uint16(*d);
- c = sldns_read_uint16((*d)+2);
- (*d)+=4;
- (*dl)-=4;
- w += sldns_wire2str_class_print(s, sl, c);
- w += sldns_str_print(s, sl, "\t");
- w += sldns_wire2str_type_print(s, sl, t);
- if(*dl == 0)
- return w + sldns_str_print(s, sl, "; Error no ttl");
- return w + print_remainder_hex(
- "; Error malformed ttl 0x", d, dl, s, sl);
- }
- t = sldns_read_uint16(*d);
- c = sldns_read_uint16((*d)+2);
- ttl = sldns_read_uint32((*d)+4);
- (*d)+=8;
- (*dl)-=8;
- w += sldns_str_print(s, sl, "%lu\t", (unsigned long)ttl);
- w += sldns_wire2str_class_print(s, sl, c);
- w += sldns_str_print(s, sl, "\t");
- w += sldns_wire2str_type_print(s, sl, t);
- return w;
-}
-
-int sldns_wire2str_rr_scan(uint8_t** d, size_t* dlen, char** s, size_t* slen,
- uint8_t* pkt, size_t pktlen)
-{
- int w = 0;
- uint8_t* rr = *d;
- size_t rrlen = *dlen, dname_off, rdlen, ordlen;
- uint16_t rrtype = 0;
-
- if(*dlen >= 3 && (*d)[0]==0 &&
- sldns_read_uint16((*d)+1)==LDNS_RR_TYPE_OPT) {
- /* perform EDNS OPT processing */
- return sldns_wire2str_edns_scan(d, dlen, s, slen, pkt, pktlen);
- }
-
- /* try to scan the rdata with pretty-printing, but if that fails, then
- * scan the rdata as an unknown RR type */
- w += sldns_wire2str_dname_scan(d, dlen, s, slen, pkt, pktlen);
- w += sldns_str_print(s, slen, "\t");
- dname_off = rrlen-(*dlen);
- if(*dlen == 4) {
- /* like a question-RR */
- uint16_t t = sldns_read_uint16(*d);
- uint16_t c = sldns_read_uint16((*d)+2);
- (*d)+=4;
- (*dlen)-=4;
- w += sldns_wire2str_class_print(s, slen, c);
- w += sldns_str_print(s, slen, "\t");
- w += sldns_wire2str_type_print(s, slen, t);
- w += sldns_str_print(s, slen, " ; Error no ttl,rdata\n");
- return w;
- }
- if(*dlen < 8) {
- if(*dlen == 0)
- return w + sldns_str_print(s, slen, ";Error missing RR\n");
- w += print_remainder_hex(";Error partial RR 0x", d, dlen, s, slen);
- return w + sldns_str_print(s, slen, "\n");
- }
- rrtype = sldns_read_uint16(*d);
- w += sldns_rr_tcttl_scan(d, dlen, s, slen);
- w += sldns_str_print(s, slen, "\t");
-
- /* rdata */
- if(*dlen < 2) {
- if(*dlen == 0)
- return w + sldns_str_print(s, slen, ";Error missing rdatalen\n");
- w += print_remainder_hex(";Error missing rdatalen 0x",
- d, dlen, s, slen);
- return w + sldns_str_print(s, slen, "\n");
- }
- rdlen = sldns_read_uint16(*d);
- ordlen = rdlen;
- (*d)+=2;
- (*dlen)-=2;
- if(*dlen < rdlen) {
- w += sldns_str_print(s, slen, "\\# %u ", (unsigned)rdlen);
- if(*dlen == 0)
- return w + sldns_str_print(s, slen, ";Error missing rdata\n");
- w += print_remainder_hex(";Error partial rdata 0x", d, dlen, s, slen);
- return w + sldns_str_print(s, slen, "\n");
- }
- w += sldns_wire2str_rdata_scan(d, &rdlen, s, slen, rrtype, pkt, pktlen);
- (*dlen) -= (ordlen-rdlen);
-
- /* default comment */
- w += sldns_wire2str_rr_comment_print(s, slen, rr, rrlen, dname_off,
- rrtype);
- w += sldns_str_print(s, slen, "\n");
- return w;
-}
-
-int sldns_wire2str_rrquestion_scan(uint8_t** d, size_t* dlen, char** s,
- size_t* slen, uint8_t* pkt, size_t pktlen)
-{
- int w = 0;
- uint16_t t, c;
- w += sldns_wire2str_dname_scan(d, dlen, s, slen, pkt, pktlen);
- w += sldns_str_print(s, slen, "\t");
- if(*dlen < 4) {
- if(*dlen == 0)
- return w + sldns_str_print(s, slen, "Error malformed\n");
- w += print_remainder_hex("Error malformed 0x", d, dlen, s, slen);
- return w + sldns_str_print(s, slen, "\n");
- }
- t = sldns_read_uint16(*d);
- c = sldns_read_uint16((*d)+2);
- (*d)+=4;
- (*dlen)-=4;
- w += sldns_wire2str_class_print(s, slen, c);
- w += sldns_str_print(s, slen, "\t");
- w += sldns_wire2str_type_print(s, slen, t);
- w += sldns_str_print(s, slen, "\n");
- return w;
-}
-
-int sldns_wire2str_rr_unknown_scan(uint8_t** d, size_t* dlen, char** s,
- size_t* slen, uint8_t* pkt, size_t pktlen)
-{
- size_t rdlen, ordlen;
- int w = 0;
- w += sldns_wire2str_dname_scan(d, dlen, s, slen, pkt, pktlen);
- w += sldns_str_print(s, slen, "\t");
- w += sldns_rr_tcttl_scan(d, dlen, s, slen);
- w += sldns_str_print(s, slen, "\t");
- if(*dlen < 2) {
- if(*dlen == 0)
- return w + sldns_str_print(s, slen, ";Error missing rdatalen\n");
- w += print_remainder_hex(";Error missing rdatalen 0x",
- d, dlen, s, slen);
- return w + sldns_str_print(s, slen, "\n");
- }
- rdlen = sldns_read_uint16(*d);
- ordlen = rdlen;
- (*d) += 2;
- (*dlen) -= 2;
- if(*dlen < rdlen) {
- w += sldns_str_print(s, slen, "\\# %u ", (unsigned)rdlen);
- if(*dlen == 0)
- return w + sldns_str_print(s, slen, ";Error missing rdata\n");
- w += print_remainder_hex(";Error partial rdata 0x", d, dlen, s, slen);
- return w + sldns_str_print(s, slen, "\n");
- }
- w += sldns_wire2str_rdata_unknown_scan(d, &rdlen, s, slen);
- (*dlen) -= (ordlen-rdlen);
- w += sldns_str_print(s, slen, "\n");
- return w;
-}
-
-/** print rr comment for type DNSKEY */
-static int rr_comment_dnskey(char** s, size_t* slen, uint8_t* rr,
- size_t rrlen, size_t dname_off)
-{
- size_t rdlen;
- uint8_t* rdata;
- int flags, w = 0;
- if(rrlen < dname_off + 10) return 0;
- rdlen = sldns_read_uint16(rr+dname_off+8);
- if(rrlen < dname_off + 10 + rdlen) return 0;
- rdata = rr + dname_off + 10;
- flags = (int)sldns_read_uint16(rdata);
- w += sldns_str_print(s, slen, " ;{");
-
- /* id */
- w += sldns_str_print(s, slen, "id = %u",
- sldns_calc_keytag_raw(rdata, rdlen));
-
- /* flags */
- if((flags&LDNS_KEY_ZONE_KEY)) {
- if((flags&LDNS_KEY_SEP_KEY))
- w += sldns_str_print(s, slen, " (ksk)");
- else w += sldns_str_print(s, slen, " (zsk)");
- }
-
- /* keysize */
- if(rdlen > 4) {
- w += sldns_str_print(s, slen, ", ");
- w += sldns_str_print(s, slen, "size = %db",
- (int)sldns_rr_dnskey_key_size_raw(
- (unsigned char*)rdata+4, rdlen-4, (int)(rdata[3])));
- }
-
- w += sldns_str_print(s, slen, "}");
- return w;
-}
-
-/** print rr comment for type RRSIG */
-static int rr_comment_rrsig(char** s, size_t* slen, uint8_t* rr,
- size_t rrlen, size_t dname_off)
-{
- size_t rdlen;
- uint8_t* rdata;
- if(rrlen < dname_off + 10) return 0;
- rdlen = sldns_read_uint16(rr+dname_off+8);
- if(rrlen < dname_off + 10 + rdlen) return 0;
- rdata = rr + dname_off + 10;
- if(rdlen < 18) return 0;
- return sldns_str_print(s, slen, " ;{id = %d}",
- (int)sldns_read_uint16(rdata+16));
-}
-
-/** print rr comment for type NSEC3 */
-static int rr_comment_nsec3(char** s, size_t* slen, uint8_t* rr,
- size_t rrlen, size_t dname_off)
-{
- size_t rdlen;
- uint8_t* rdata;
- int w = 0;
- if(rrlen < dname_off + 10) return 0;
- rdlen = sldns_read_uint16(rr+dname_off+8);
- if(rrlen < dname_off + 10 + rdlen) return 0;
- rdata = rr + dname_off + 10;
- if(rdlen < 2) return 0;
- if((rdata[1] & LDNS_NSEC3_VARS_OPTOUT_MASK))
- w += sldns_str_print(s, slen, " ;{flags: optout}");
- return w;
-}
-
-int sldns_wire2str_rr_comment_print(char** s, size_t* slen, uint8_t* rr,
- size_t rrlen, size_t dname_off, uint16_t rrtype)
-{
- if(rrtype == LDNS_RR_TYPE_DNSKEY) {
- return rr_comment_dnskey(s, slen, rr, rrlen, dname_off);
- } else if(rrtype == LDNS_RR_TYPE_RRSIG) {
- return rr_comment_rrsig(s, slen, rr, rrlen, dname_off);
- } else if(rrtype == LDNS_RR_TYPE_NSEC3) {
- return rr_comment_nsec3(s, slen, rr, rrlen, dname_off);
- }
- return 0;
-}
-
-int sldns_wire2str_header_scan(uint8_t** d, size_t* dlen, char** s,
- size_t* slen)
-{
- int w = 0;
- int opcode, rcode;
- w += sldns_str_print(s, slen, ";; ->>HEADER<<- ");
- if(*dlen == 0)
- return w+sldns_str_print(s, slen, "Error empty packet");
- if(*dlen < 4)
- return w+print_remainder_hex("Error header too short 0x", d, dlen, s, slen);
- opcode = (int)LDNS_OPCODE_WIRE(*d);
- rcode = (int)LDNS_RCODE_WIRE(*d);
- w += sldns_str_print(s, slen, "opcode: ");
- w += sldns_wire2str_opcode_print(s, slen, opcode);
- w += sldns_str_print(s, slen, ", ");
- w += sldns_str_print(s, slen, "rcode: ");
- w += sldns_wire2str_rcode_print(s, slen, rcode);
- w += sldns_str_print(s, slen, ", ");
- w += sldns_str_print(s, slen, "id: %d\n", (int)LDNS_ID_WIRE(*d));
- w += sldns_str_print(s, slen, ";; flags:");
- if(LDNS_QR_WIRE(*d)) w += sldns_str_print(s, slen, " qr");
- if(LDNS_AA_WIRE(*d)) w += sldns_str_print(s, slen, " aa");
- if(LDNS_TC_WIRE(*d)) w += sldns_str_print(s, slen, " tc");
- if(LDNS_RD_WIRE(*d)) w += sldns_str_print(s, slen, " rd");
- if(LDNS_CD_WIRE(*d)) w += sldns_str_print(s, slen, " cd");
- if(LDNS_RA_WIRE(*d)) w += sldns_str_print(s, slen, " ra");
- if(LDNS_AD_WIRE(*d)) w += sldns_str_print(s, slen, " ad");
- if(LDNS_Z_WIRE(*d)) w += sldns_str_print(s, slen, " z");
- w += sldns_str_print(s, slen, " ; ");
- if(*dlen < LDNS_HEADER_SIZE)
- return w+print_remainder_hex("Error header too short 0x", d, dlen, s, slen);
- w += sldns_str_print(s, slen, "QUERY: %d, ", (int)LDNS_QDCOUNT(*d));
- w += sldns_str_print(s, slen, "ANSWER: %d, ", (int)LDNS_ANCOUNT(*d));
- w += sldns_str_print(s, slen, "AUTHORITY: %d, ", (int)LDNS_NSCOUNT(*d));
- w += sldns_str_print(s, slen, "ADDITIONAL: %d ", (int)LDNS_ARCOUNT(*d));
- *d += LDNS_HEADER_SIZE;
- *dlen -= LDNS_HEADER_SIZE;
- return w;
-}
-
-int sldns_wire2str_rdata_scan(uint8_t** d, size_t* dlen, char** s,
- size_t* slen, uint16_t rrtype, uint8_t* pkt, size_t pktlen)
-{
- /* try to prettyprint, but if that fails, use unknown format */
- uint8_t* origd = *d;
- char* origs = *s;
- size_t origdlen = *dlen, origslen = *slen;
- uint16_t r_cnt, r_max;
- sldns_rdf_type rdftype;
- int w = 0, n;
-
- const sldns_rr_descriptor *desc = sldns_rr_descript(rrtype);
- if(!desc) /* unknown format */
- return sldns_wire2str_rdata_unknown_scan(d, dlen, s, slen);
- /* dlen equals the rdatalen for the rdata */
-
- r_max = sldns_rr_descriptor_maximum(desc);
- for(r_cnt=0; r_cnt < r_max; r_cnt++) {
- if(*dlen == 0) {
- if(r_cnt < sldns_rr_descriptor_minimum(desc))
- goto failed;
- break; /* nothing more to print */
- }
- rdftype = sldns_rr_descriptor_field_type(desc, r_cnt);
- if(r_cnt != 0)
- w += sldns_str_print(s, slen, " ");
- n = sldns_wire2str_rdf_scan(d, dlen, s, slen, rdftype,
- pkt, pktlen);
- if(n == -1) {
- failed:
- /* failed, use unknown format */
- *d = origd; *s = origs;
- *dlen = origdlen; *slen = origslen;
- return sldns_wire2str_rdata_unknown_scan(d, dlen,
- s, slen);
- }
- w += n;
- }
- return w;
-}
-
-int sldns_wire2str_rdata_unknown_scan(uint8_t** d, size_t* dlen, char** s,
- size_t* slen)
-{
- int w = 0;
-
- /* print length */
- w += sldns_str_print(s, slen, "\\# %u", (unsigned)*dlen);
-
- /* print rdlen in hex */
- if(*dlen != 0)
- w += sldns_str_print(s, slen, " ");
- w += print_hex_buf(s, slen, *d, *dlen);
- (*d) += *dlen;
- (*dlen) = 0;
- return w;
-}
-
-/** print and escape one character for a domain dname */
-static int dname_char_print(char** s, size_t* slen, uint8_t c)
-{
- if(c == '.' || c == ';' || c == '(' || c == ')' || c == '\\')
- return sldns_str_print(s, slen, "\\%c", c);
- else if(!(isascii((int)c) && isgraph((int)c)))
- return sldns_str_print(s, slen, "\\%03u", (unsigned)c);
- /* plain printout */
- if(*slen) {
- **s = (char)c;
- (*s)++;
- (*slen)--;
- }
- return 1;
-}
-
-int sldns_wire2str_dname_scan(uint8_t** d, size_t* dlen, char** s, size_t* slen,
- uint8_t* pkt, size_t pktlen)
-{
- int w = 0;
- /* spool labels onto the string, use compression if its there */
- uint8_t* pos = *d;
- unsigned i, counter=0;
- const unsigned maxcompr = 1000; /* loop detection, max compr ptrs */
- int in_buf = 1;
- if(*dlen == 0) return sldns_str_print(s, slen, "ErrorMissingDname");
- if(*pos == 0) {
- (*d)++;
- (*dlen)--;
- return sldns_str_print(s, slen, ".");
- }
- while(*pos) {
- /* read label length */
- uint8_t labellen = *pos++;
- if(in_buf) { (*d)++; (*dlen)--; }
-
- /* find out what sort of label we have */
- if((labellen&0xc0) == 0xc0) {
- /* compressed */
- uint16_t target = 0;
- if(in_buf && *dlen == 0)
- return w + sldns_str_print(s, slen,
- "ErrorPartialDname");
- else if(!in_buf && pos+1 > pkt+pktlen)
- return w + sldns_str_print(s, slen,
- "ErrorPartialDname");
- target = ((labellen&0x3f)<<8) | *pos;
- if(in_buf) { (*d)++; (*dlen)--; }
- /* move to target, if possible */
- if(!pkt || target >= pktlen)
- return w + sldns_str_print(s, slen,
- "ErrorComprPtrOutOfBounds");
- if(counter++ > maxcompr)
- return w + sldns_str_print(s, slen,
- "ErrorComprPtrLooped");
- in_buf = 0;
- pos = pkt+target;
- continue;
- } else if((labellen&0xc0)) {
- /* notimpl label type */
- w += sldns_str_print(s, slen,
- "ErrorLABELTYPE%xIsUnknown",
- (int)(labellen&0xc0));
- return w;
- }
-
- /* spool label characters, end with '.' */
- if(in_buf && *dlen < labellen) labellen = *dlen;
- else if(!in_buf && pos+labellen > pkt+pktlen)
- labellen = (uint8_t)(pkt + pktlen - pos);
- for(i=0; i<(unsigned)labellen; i++) {
- w += dname_char_print(s, slen, *pos++);
- }
- if(in_buf) {
- (*d) += labellen;
- (*dlen) -= labellen;
- if(*dlen == 0) break;
- }
- w += sldns_str_print(s, slen, ".");
- }
- /* skip over final root label */
- if(in_buf && *dlen > 0) { (*d)++; (*dlen)--; }
- /* in case we printed no labels, terminate dname */
- if(w == 0) w += sldns_str_print(s, slen, ".");
- return w;
-}
-
-int sldns_wire2str_opcode_print(char** s, size_t* slen, int opcode)
-{
- sldns_lookup_table *lt = sldns_lookup_by_id(sldns_opcodes, opcode);
- if (lt && lt->name) {
- return sldns_str_print(s, slen, "%s", lt->name);
- }
- return sldns_str_print(s, slen, "OPCODE%u", (unsigned)opcode);
-}
-
-int sldns_wire2str_rcode_print(char** s, size_t* slen, int rcode)
-{
- sldns_lookup_table *lt = sldns_lookup_by_id(sldns_rcodes, rcode);
- if (lt && lt->name) {
- return sldns_str_print(s, slen, "%s", lt->name);
- }
- return sldns_str_print(s, slen, "RCODE%u", (unsigned)rcode);
-}
-
-int sldns_wire2str_class_print(char** s, size_t* slen, uint16_t rrclass)
-{
- sldns_lookup_table *lt = sldns_lookup_by_id(sldns_rr_classes,
- (int)rrclass);
- if (lt && lt->name) {
- return sldns_str_print(s, slen, "%s", lt->name);
- }
- return sldns_str_print(s, slen, "CLASS%u", (unsigned)rrclass);
-}
-
-int sldns_wire2str_type_print(char** s, size_t* slen, uint16_t rrtype)
-{
- const sldns_rr_descriptor *descriptor = sldns_rr_descript(rrtype);
- if (descriptor && descriptor->_name) {
- return sldns_str_print(s, slen, "%s", descriptor->_name);
- }
- return sldns_str_print(s, slen, "TYPE%u", (unsigned)rrtype);
-}
-
-int sldns_wire2str_edns_option_code_print(char** s, size_t* slen,
- uint16_t opcode)
-{
- sldns_lookup_table *lt = sldns_lookup_by_id(sldns_edns_options,
- (int)opcode);
- if (lt && lt->name) {
- return sldns_str_print(s, slen, "%s", lt->name);
- }
- return sldns_str_print(s, slen, "OPT%u", (unsigned)opcode);
-}
-
-int sldns_wire2str_class_scan(uint8_t** d, size_t* dlen, char** s, size_t* slen)
-{
- uint16_t c;
- if(*dlen == 0) return 0;
- if(*dlen < 2) return print_remainder_hex("Error malformed 0x", d, dlen, s, slen);
- c = sldns_read_uint16(*d);
- (*d)+=2;
- (*dlen)-=2;
- return sldns_wire2str_class_print(s, slen, c);
-}
-
-int sldns_wire2str_type_scan(uint8_t** d, size_t* dlen, char** s, size_t* slen)
-{
- uint16_t t;
- if(*dlen == 0) return 0;
- if(*dlen < 2) return print_remainder_hex("Error malformed 0x", d, dlen, s, slen);
- t = sldns_read_uint16(*d);
- (*d)+=2;
- (*dlen)-=2;
- return sldns_wire2str_type_print(s, slen, t);
-}
-
-int sldns_wire2str_ttl_scan(uint8_t** d, size_t* dlen, char** s, size_t* slen)
-{
- uint32_t ttl;
- if(*dlen == 0) return 0;
- if(*dlen < 4) return print_remainder_hex("Error malformed 0x", d, dlen, s, slen);
- ttl = sldns_read_uint32(*d);
- (*d)+=4;
- (*dlen)-=4;
- return sldns_str_print(s, slen, "%u", (unsigned)ttl);
-}
-
-int sldns_wire2str_rdf_scan(uint8_t** d, size_t* dlen, char** s, size_t* slen,
- int rdftype, uint8_t* pkt, size_t pktlen)
-{
- if(*dlen == 0) return 0;
- switch(rdftype) {
- case LDNS_RDF_TYPE_NONE:
- return 0;
- case LDNS_RDF_TYPE_DNAME:
- return sldns_wire2str_dname_scan(d, dlen, s, slen, pkt, pktlen);
- case LDNS_RDF_TYPE_INT8:
- return sldns_wire2str_int8_scan(d, dlen, s, slen);
- case LDNS_RDF_TYPE_INT16:
- return sldns_wire2str_int16_scan(d, dlen, s, slen);
- case LDNS_RDF_TYPE_INT32:
- return sldns_wire2str_int32_scan(d, dlen, s, slen);
- case LDNS_RDF_TYPE_PERIOD:
- return sldns_wire2str_period_scan(d, dlen, s, slen);
- case LDNS_RDF_TYPE_TSIGTIME:
- return sldns_wire2str_tsigtime_scan(d, dlen, s, slen);
- case LDNS_RDF_TYPE_A:
- return sldns_wire2str_a_scan(d, dlen, s, slen);
- case LDNS_RDF_TYPE_AAAA:
- return sldns_wire2str_aaaa_scan(d, dlen, s, slen);
- case LDNS_RDF_TYPE_STR:
- return sldns_wire2str_str_scan(d, dlen, s, slen);
- case LDNS_RDF_TYPE_APL:
- return sldns_wire2str_apl_scan(d, dlen, s, slen);
- case LDNS_RDF_TYPE_B32_EXT:
- return sldns_wire2str_b32_ext_scan(d, dlen, s, slen);
- case LDNS_RDF_TYPE_B64:
- return sldns_wire2str_b64_scan(d, dlen, s, slen);
- case LDNS_RDF_TYPE_HEX:
- return sldns_wire2str_hex_scan(d, dlen, s, slen);
- case LDNS_RDF_TYPE_NSEC:
- return sldns_wire2str_nsec_scan(d, dlen, s, slen);
- case LDNS_RDF_TYPE_NSEC3_SALT:
- return sldns_wire2str_nsec3_salt_scan(d, dlen, s, slen);
- case LDNS_RDF_TYPE_TYPE:
- return sldns_wire2str_type_scan(d, dlen, s, slen);
- case LDNS_RDF_TYPE_CLASS:
- return sldns_wire2str_class_scan(d, dlen, s, slen);
- case LDNS_RDF_TYPE_CERT_ALG:
- return sldns_wire2str_cert_alg_scan(d, dlen, s, slen);
- case LDNS_RDF_TYPE_ALG:
- return sldns_wire2str_alg_scan(d, dlen, s, slen);
- case LDNS_RDF_TYPE_UNKNOWN:
- return sldns_wire2str_unknown_scan(d, dlen, s, slen);
- case LDNS_RDF_TYPE_TIME:
- return sldns_wire2str_time_scan(d, dlen, s, slen);
- case LDNS_RDF_TYPE_LOC:
- return sldns_wire2str_loc_scan(d, dlen, s, slen);
- case LDNS_RDF_TYPE_WKS:
- case LDNS_RDF_TYPE_SERVICE:
- return sldns_wire2str_wks_scan(d, dlen, s, slen);
- case LDNS_RDF_TYPE_NSAP:
- return sldns_wire2str_nsap_scan(d, dlen, s, slen);
- case LDNS_RDF_TYPE_ATMA:
- return sldns_wire2str_atma_scan(d, dlen, s, slen);
- case LDNS_RDF_TYPE_IPSECKEY:
- return sldns_wire2str_ipseckey_scan(d, dlen, s, slen, pkt,
- pktlen);
- case LDNS_RDF_TYPE_HIP:
- return sldns_wire2str_hip_scan(d, dlen, s, slen);
- case LDNS_RDF_TYPE_INT16_DATA:
- return sldns_wire2str_int16_data_scan(d, dlen, s, slen);
- case LDNS_RDF_TYPE_NSEC3_NEXT_OWNER:
- return sldns_wire2str_b32_ext_scan(d, dlen, s, slen);
- case LDNS_RDF_TYPE_ILNP64:
- return sldns_wire2str_ilnp64_scan(d, dlen, s, slen);
- case LDNS_RDF_TYPE_EUI48:
- return sldns_wire2str_eui48_scan(d, dlen, s, slen);
- case LDNS_RDF_TYPE_EUI64:
- return sldns_wire2str_eui64_scan(d, dlen, s, slen);
- case LDNS_RDF_TYPE_TAG:
- return sldns_wire2str_tag_scan(d, dlen, s, slen);
- case LDNS_RDF_TYPE_LONG_STR:
- return sldns_wire2str_long_str_scan(d, dlen, s, slen);
- }
- /* unknown rdf type */
- return -1;
-}
-
-int sldns_wire2str_int8_scan(uint8_t** d, size_t* dl, char** s, size_t* sl)
-{
- int w;
- if(*dl < 1) return -1;
- w = sldns_str_print(s, sl, "%u", (unsigned)**d);
- (*d)++;
- (*dl)--;
- return w;
-}
-
-int sldns_wire2str_int16_scan(uint8_t** d, size_t* dl, char** s, size_t* sl)
-{
- int w;
- if(*dl < 2) return -1;
- w = sldns_str_print(s, sl, "%lu", (unsigned long)sldns_read_uint16(*d));
- (*d)+=2;
- (*dl)-=2;
- return w;
-}
-
-int sldns_wire2str_int32_scan(uint8_t** d, size_t* dl, char** s, size_t* sl)
-{
- int w;
- if(*dl < 4) return -1;
- w = sldns_str_print(s, sl, "%lu", (unsigned long)sldns_read_uint32(*d));
- (*d)+=4;
- (*dl)-=4;
- return w;
-}
-
-int sldns_wire2str_period_scan(uint8_t** d, size_t* dl, char** s, size_t* sl)
-{
- int w;
- if(*dl < 4) return -1;
- w = sldns_str_print(s, sl, "%u", (unsigned)sldns_read_uint32(*d));
- (*d)+=4;
- (*dl)-=4;
- return w;
-}
-
-int sldns_wire2str_tsigtime_scan(uint8_t** d, size_t* dl, char** s, size_t* sl)
-{
- /* tsigtime is 48 bits network order unsigned integer */
- int w;
- uint64_t tsigtime = 0;
- uint64_t d0, d1, d2, d3, d4, d5;
- if(*dl < 6) return -1;
- d0 = (*d)[0]; /* cast to uint64 for shift operations */
- d1 = (*d)[1];
- d2 = (*d)[2];
- d3 = (*d)[3];
- d4 = (*d)[4];
- d5 = (*d)[5];
- tsigtime = (d0<<40) | (d1<<32) | (d2<<24) | (d3<<16) | (d4<<8) | d5;
-#ifndef USE_WINSOCK
- w = sldns_str_print(s, sl, "%llu", (long long)tsigtime);
-#else
- w = sldns_str_print(s, sl, "%I64u", (long long)tsigtime);
-#endif
- (*d)+=6;
- (*dl)-=6;
- return w;
-}
-
-int sldns_wire2str_a_scan(uint8_t** d, size_t* dl, char** s, size_t* sl)
-{
- char buf[32];
- int w;
- if(*dl < 4) return -1;
- if(!inet_ntop(AF_INET, *d, buf, (socklen_t)sizeof(buf)))
- return -1;
- w = sldns_str_print(s, sl, "%s", buf);
- (*d)+=4;
- (*dl)-=4;
- return w;
-}
-
-int sldns_wire2str_aaaa_scan(uint8_t** d, size_t* dl, char** s, size_t* sl)
-{
-#ifdef AF_INET6
- char buf[64];
- int w;
- if(*dl < 16) return -1;
- if(!inet_ntop(AF_INET6, *d, buf, (socklen_t)sizeof(buf)))
- return -1;
- w = sldns_str_print(s, sl, "%s", buf);
- (*d)+=16;
- (*dl)-=16;
- return w;
-#else
- return -1;
-#endif
-}
-
-/** printout escaped TYPE_STR character */
-static int str_char_print(char** s, size_t* sl, uint8_t c)
-{
- if(isprint((int)c) || c == '\t') {
- if(c == '\"' || c == '\\')
- return sldns_str_print(s, sl, "\\%c", c);
- if(*sl) {
- **s = (char)c;
- (*s)++;
- (*sl)--;
- }
- return 1;
- }
- return sldns_str_print(s, sl, "\\%03u", (unsigned)c);
-}
-
-int sldns_wire2str_str_scan(uint8_t** d, size_t* dl, char** s, size_t* sl)
-{
- int w = 0;
- size_t i, len;
- if(*dl < 1) return -1;
- len = **d;
- if(*dl < 1+len) return -1;
- (*d)++;
- (*dl)--;
- w += sldns_str_print(s, sl, "\"");
- for(i=0; i<len; i++)
- w += str_char_print(s, sl, (*d)[i]);
- w += sldns_str_print(s, sl, "\"");
- (*d)+=len;
- (*dl)-=len;
- return w;
-}
-
-int sldns_wire2str_apl_scan(uint8_t** d, size_t* dl, char** s, size_t* sl)
-{
- int i, w = 0;
- uint16_t family;
- uint8_t negation, prefix, adflength;
- if(*dl < 4) return -1;
- family = sldns_read_uint16(*d);
- prefix = (*d)[2];
- negation = ((*d)[3] & LDNS_APL_NEGATION);
- adflength = ((*d)[3] & LDNS_APL_MASK);
- if(*dl < 4+(size_t)adflength) return -1;
- if(family != LDNS_APL_IP4 && family != LDNS_APL_IP6)
- return -1; /* unknown address family */
- if(negation)
- w += sldns_str_print(s, sl, "!");
- w += sldns_str_print(s, sl, "%u:", (unsigned)family);
- if(family == LDNS_APL_IP4) {
- /* check if prefix <32 ? */
- /* address is variable length 0 - 4 */
- for(i=0; i<4; i++) {
- if(i > 0)
- w += sldns_str_print(s, sl, ".");
- if(i < (int)adflength)
- w += sldns_str_print(s, sl, "%d", (*d)[4+i]);
- else w += sldns_str_print(s, sl, "0");
- }
- } else if(family == LDNS_APL_IP6) {
- /* check if prefix <128 ? */
- /* address is variable length 0 - 16 */
- for(i=0; i<16; i++) {
- if(i%2 == 0 && i>0)
- w += sldns_str_print(s, sl, ":");
- if(i < (int)adflength)
- w += sldns_str_print(s, sl, "%02x", (*d)[4+i]);
- else w += sldns_str_print(s, sl, "00");
- }
- }
- w += sldns_str_print(s, sl, "/%u", (unsigned)prefix);
- (*d) += 4+adflength;
- (*dl) -= 4+adflength;
- return w;
-}
-
-int sldns_wire2str_b32_ext_scan(uint8_t** d, size_t* dl, char** s, size_t* sl)
-{
- size_t datalen;
- size_t sz;
- if(*dl < 1) return -1;
- datalen = (*d)[0];
- if(*dl < 1+datalen) return -1;
- sz = sldns_b32_ntop_calculate_size(datalen);
- if(*sl < sz+1) {
- (*d) += datalen+1;
- (*dl) -= (datalen+1);
- return (int)sz; /* out of space really, but would need buffer
- in order to truncate the output */
- }
- sldns_b32_ntop_extended_hex((*d)+1, datalen, *s, *sl);
- (*d) += datalen+1;
- (*dl) -= (datalen+1);
- (*s) += sz;
- (*sl) -= sz;
- return (int)sz;
-}
-
-/** scan number of bytes from wire into b64 presentation format */
-static int sldns_wire2str_b64_scan_num(uint8_t** d, size_t* dl, char** s,
- size_t* sl, size_t num)
-{
- /* b64_ntop_calculate size includes null at the end */
- size_t sz = sldns_b64_ntop_calculate_size(num)-1;
- if(*sl < sz+1) {
- (*d) += num;
- (*dl) -= num;
- return (int)sz; /* out of space really, but would need buffer
- in order to truncate the output */
- }
- sldns_b64_ntop(*d, num, *s, *sl);
- (*d) += num;
- (*dl) -= num;
- (*s) += sz;
- (*sl) -= sz;
- return (int)sz;
-}
-
-int sldns_wire2str_b64_scan(uint8_t** d, size_t* dl, char** s, size_t* sl)
-{
- return sldns_wire2str_b64_scan_num(d, dl, s, sl, *dl);
-}
-
-int sldns_wire2str_hex_scan(uint8_t** d, size_t* dl, char** s, size_t* sl)
-{
- return print_remainder_hex("", d, dl, s, sl);
-}
-
-int sldns_wire2str_nsec_scan(uint8_t** d, size_t* dl, char** s, size_t* sl)
-{
- uint8_t* p = *d;
- size_t pl = *dl;
- unsigned i, bit, window, block_len;
- uint16_t t;
- int w = 0;
-
- /* check for errors */
- while(pl) {
- if(pl < 2) return -1;
- block_len = (unsigned)p[1];
- if(pl < 2+block_len) return -1;
- p += block_len+2;
- pl -= block_len+2;
- }
-
- /* do it */
- p = *d;
- pl = *dl;
- while(pl) {
- if(pl < 2) return -1; /* cannot happen */
- window = (unsigned)p[0];
- block_len = (unsigned)p[1];
- if(pl < 2+block_len) return -1; /* cannot happen */
- p += 2;
- for(i=0; i<block_len; i++) {
- if(p[i] == 0) continue;
- /* base type number for this octet */
- t = ((window)<<8) | (i << 3);
- for(bit=0; bit<8; bit++) {
- if((p[i]&(0x80>>bit))) {
- if(w) w += sldns_str_print(s, sl, " ");
- w += sldns_wire2str_type_print(s, sl,
- t+bit);
- }
- }
- }
- p += block_len;
- pl -= block_len+2;
- }
- (*d) += *dl;
- (*dl) = 0;
- return w;
-}
-
-int sldns_wire2str_nsec3_salt_scan(uint8_t** d, size_t* dl, char** s, size_t* sl)
-{
- size_t salt_len;
- int w;
- if(*dl < 1) return -1;
- salt_len = (size_t)(*d)[0];
- if(*dl < 1+salt_len) return -1;
- (*d)++;
- (*dl)--;
- if(salt_len == 0) {
- return sldns_str_print(s, sl, "-");
- }
- w = print_hex_buf(s, sl, *d, salt_len);
- (*dl)-=salt_len;
- (*d)+=salt_len;
- return w;
-}
-
-int sldns_wire2str_cert_alg_scan(uint8_t** d, size_t* dl, char** s, size_t* sl)
-{
- sldns_lookup_table *lt;
- int data, w;
- if(*dl < 2) return -1;
- data = (int)sldns_read_uint16(*d);
- lt = sldns_lookup_by_id(sldns_cert_algorithms, data);
- if(lt && lt->name)
- w = sldns_str_print(s, sl, "%s", lt->name);
- else w = sldns_str_print(s, sl, "%d", data);
- (*dl)-=2;
- (*d)+=2;
- return w;
-}
-
-int sldns_wire2str_alg_scan(uint8_t** d, size_t* dl, char** s, size_t* sl)
-{
- /* don't use algorithm mnemonics in the presentation format
- * this kind of got sneaked into the rfc's */
- return sldns_wire2str_int8_scan(d, dl, s, sl);
-}
-
-int sldns_wire2str_unknown_scan(uint8_t** d, size_t* dl, char** s, size_t* sl)
-{
- return sldns_wire2str_rdata_unknown_scan(d, dl, s, sl);
-}
-
-int sldns_wire2str_time_scan(uint8_t** d, size_t* dl, char** s, size_t* sl)
-{
- /* create a YYYYMMDDHHMMSS string if possible */
- struct tm tm;
- char date_buf[16];
- uint32_t t;
- memset(&tm, 0, sizeof(tm));
- if(*dl < 4) return -1;
- t = sldns_read_uint32(*d);
- date_buf[15]=0;
- if(sldns_serial_arithmitics_gmtime_r(t, time(NULL), &tm) &&
- strftime(date_buf, 15, "%Y%m%d%H%M%S", &tm)) {
- (*d) += 4;
- (*dl) -= 4;
- return sldns_str_print(s, sl, "%s", date_buf);
- }
- return -1;
-}
-
-static int
-loc_cm_print(char** str, size_t* sl, uint8_t mantissa, uint8_t exponent)
-{
- int w = 0;
- uint8_t i;
- /* is it 0.<two digits> ? */
- if(exponent < 2) {
- if(exponent == 1)
- mantissa *= 10;
- return sldns_str_print(str, sl, "0.%02ld", (long)mantissa);
- }
- /* always <digit><string of zeros> */
- w += sldns_str_print(str, sl, "%d", (int)mantissa);
- for(i=0; i<exponent-2; i++)
- w += sldns_str_print(str, sl, "0");
- return w;
-}
-
-int sldns_wire2str_loc_scan(uint8_t** d, size_t* dl, char** str, size_t* sl)
-{
- /* we could do checking (ie degrees < 90 etc)? */
- uint8_t version;
- uint8_t size;
- uint8_t horizontal_precision;
- uint8_t vertical_precision;
- uint32_t longitude;
- uint32_t latitude;
- uint32_t altitude;
- char northerness;
- char easterness;
- uint32_t h;
- uint32_t m;
- double s;
- uint32_t equator = (uint32_t)1 << 31; /* 2**31 */
- int w = 0;
-
- if(*dl < 16) return -1;
- version = (*d)[0];
- if(version != 0)
- return sldns_wire2str_hex_scan(d, dl, str, sl);
- size = (*d)[1];
- horizontal_precision = (*d)[2];
- vertical_precision = (*d)[3];
-
- latitude = sldns_read_uint32((*d)+4);
- longitude = sldns_read_uint32((*d)+8);
- altitude = sldns_read_uint32((*d)+12);
-
- if (latitude > equator) {
- northerness = 'N';
- latitude = latitude - equator;
- } else {
- northerness = 'S';
- latitude = equator - latitude;
- }
- h = latitude / (1000 * 60 * 60);
- latitude = latitude % (1000 * 60 * 60);
- m = latitude / (1000 * 60);
- latitude = latitude % (1000 * 60);
- s = (double) latitude / 1000.0;
- w += sldns_str_print(str, sl, "%02u %02u %06.3f %c ",
- h, m, s, northerness);
-
- if (longitude > equator) {
- easterness = 'E';
- longitude = longitude - equator;
- } else {
- easterness = 'W';
- longitude = equator - longitude;
- }
- h = longitude / (1000 * 60 * 60);
- longitude = longitude % (1000 * 60 * 60);
- m = longitude / (1000 * 60);
- longitude = longitude % (1000 * 60);
- s = (double) longitude / (1000.0);
- w += sldns_str_print(str, sl, "%02u %02u %06.3f %c ",
- h, m, s, easterness);
-
- s = ((double) altitude) / 100;
- s -= 100000;
-
- if(altitude%100 != 0)
- w += sldns_str_print(str, sl, "%.2f", s);
- else
- w += sldns_str_print(str, sl, "%.0f", s);
-
- w += sldns_str_print(str, sl, "m ");
-
- w += loc_cm_print(str, sl, (size & 0xf0) >> 4, size & 0x0f);
- w += sldns_str_print(str, sl, "m ");
-
- w += loc_cm_print(str, sl, (horizontal_precision & 0xf0) >> 4,
- horizontal_precision & 0x0f);
- w += sldns_str_print(str, sl, "m ");
-
- w += loc_cm_print(str, sl, (vertical_precision & 0xf0) >> 4,
- vertical_precision & 0x0f);
- w += sldns_str_print(str, sl, "m");
-
- (*d)+=16;
- (*dl)-=16;
- return w;
-}
-
-int sldns_wire2str_wks_scan(uint8_t** d, size_t* dl, char** s, size_t* sl)
-{
- /* protocol, followed by bitmap of services */
- const char* proto_name = NULL;
- struct protoent *protocol;
- struct servent *service;
- uint8_t protocol_nr;
- int bit, port, w = 0;
- size_t i;
- /* we cannot print with strings because they
- * are not portable, the presentation format may
- * not be able to be read in on another computer. */
- int print_symbols = 0;
-
- /* protocol */
- if(*dl < 1) return -1;
- protocol_nr = (*d)[0];
- (*d)++;
- (*dl)--;
- protocol = getprotobynumber((int)protocol_nr);
- if(protocol && (protocol->p_name != NULL)) {
- w += sldns_str_print(s, sl, "%s", protocol->p_name);
- proto_name = protocol->p_name;
- } else {
- w += sldns_str_print(s, sl, "%u", (unsigned)protocol_nr);
- }
-
- for(i=0; i<*dl; i++) {
- if((*d)[i] == 0)
- continue;
- for(bit=0; bit<8; bit++) {
- if(!(((*d)[i])&(0x80>>bit)))
- continue;
- port = (int)i*8 + bit;
-
- if(!print_symbols)
- service = NULL;
- else
- service = getservbyport(
- (int)htons((uint16_t)port), proto_name);
- if(service && service->s_name)
- w += sldns_str_print(s, sl, " %s",
- service->s_name);
- else w += sldns_str_print(s, sl, " %u",
- (unsigned)port);
- }
- }
-
-#ifdef HAVE_ENDSERVENT
- endservent();
-#endif
-#ifdef HAVE_ENDPROTOENT
- endprotoent();
-#endif
- (*d) += *dl;
- (*dl) = 0;
- return w;
-}
-
-int sldns_wire2str_nsap_scan(uint8_t** d, size_t* dl, char** s, size_t* sl)
-{
- return print_remainder_hex("0x", d, dl, s, sl);
-}
-
-int sldns_wire2str_atma_scan(uint8_t** d, size_t* dl, char** s, size_t* sl)
-{
- return print_remainder_hex("", d, dl, s, sl);
-}
-
-/* internal scan routine that can modify arguments on failure */
-static int sldns_wire2str_ipseckey_scan_internal(uint8_t** d, size_t* dl,
- char** s, size_t* sl, uint8_t* pkt, size_t pktlen)
-{
- /* http://www.ietf.org/internet-drafts/draft-ietf-ipseckey-rr-12.txt*/
- uint8_t precedence, gateway_type, algorithm;
- int w = 0;
-
- if(*dl < 3) return -1;
- precedence = (*d)[0];
- gateway_type = (*d)[1];
- algorithm = (*d)[2];
- if(gateway_type > 3)
- return -1; /* unknown */
- (*d)+=3;
- (*dl)-=3;
- w += sldns_str_print(s, sl, "%d %d %d ",
- (int)precedence, (int)gateway_type, (int)algorithm);
-
- switch(gateway_type) {
- case 0: /* no gateway */
- w += sldns_str_print(s, sl, ".");
- break;
- case 1: /* ip4 */
- w += sldns_wire2str_a_scan(d, dl, s, sl);
- break;
- case 2: /* ip6 */
- w += sldns_wire2str_aaaa_scan(d, dl, s, sl);
- break;
- case 3: /* dname */
- w += sldns_wire2str_dname_scan(d, dl, s, sl, pkt, pktlen);
- break;
- default: /* unknown */
- return -1;
- }
-
- if(*dl < 1)
- return -1;
- w += sldns_str_print(s, sl, " ");
- w += sldns_wire2str_b64_scan_num(d, dl, s, sl, *dl);
- return w;
-}
-
-int sldns_wire2str_ipseckey_scan(uint8_t** d, size_t* dl, char** s, size_t* sl,
- uint8_t* pkt, size_t pktlen)
-{
- uint8_t* od = *d;
- char* os = *s;
- size_t odl = *dl, osl = *sl;
- int w=sldns_wire2str_ipseckey_scan_internal(d, dl, s, sl, pkt, pktlen);
- if(w == -1) {
- *d = od;
- *s = os;
- *dl = odl;
- *sl = osl;
- return -1;
- }
- return w;
-}
-
-int sldns_wire2str_hip_scan(uint8_t** d, size_t* dl, char** s, size_t* sl)
-{
- int w;
- uint8_t algo, hitlen;
- uint16_t pklen;
-
- /* read lengths */
- if(*dl < 4)
- return -1;
- hitlen = (*d)[0];
- algo = (*d)[1];
- pklen = sldns_read_uint16((*d)+2);
- if(*dl < (size_t)4 + (size_t)hitlen + (size_t)pklen)
- return -1;
-
- /* write: algo hit pubkey */
- w = sldns_str_print(s, sl, "%u ", (unsigned)algo);
- w += print_hex_buf(s, sl, (*d)+4, hitlen);
- w += sldns_str_print(s, sl, " ");
- (*d)+=4+hitlen;
- (*dl)-= (4+hitlen);
- w += sldns_wire2str_b64_scan_num(d, dl, s, sl, pklen);
- return w;
-}
-
-int sldns_wire2str_int16_data_scan(uint8_t** d, size_t* dl, char** s, size_t* sl)
-{
- uint16_t n;
- if(*dl < 2)
- return -1;
- n = sldns_read_uint16(*d);
- if(*dl < 2+(size_t)n)
- return -1;
- (*d)+=2;
- (*dl)-=2;
- return sldns_wire2str_b64_scan_num(d, dl, s, sl, n);
-}
-
-int sldns_wire2str_nsec3_next_owner_scan(uint8_t** d, size_t* dl, char** s,
- size_t* sl)
-{
- return sldns_wire2str_b32_ext_scan(d, dl, s, sl);
-}
-
-int sldns_wire2str_ilnp64_scan(uint8_t** d, size_t* dl, char** s, size_t* sl)
-{
- int w;
- if(*dl < 8)
- return -1;
- w = sldns_str_print(s, sl, "%.4x:%.4x:%.4x:%.4x",
- sldns_read_uint16(*d), sldns_read_uint16((*d)+2),
- sldns_read_uint16((*d)+4), sldns_read_uint16((*d)+6));
- (*d)+=8;
- (*dl)-=8;
- return w;
-}
-
-int sldns_wire2str_eui48_scan(uint8_t** d, size_t* dl, char** s, size_t* sl)
-{
- int w;
- if(*dl < 6)
- return -1;
- w = sldns_str_print(s, sl, "%.2x-%.2x-%.2x-%.2x-%.2x-%.2x",
- (*d)[0], (*d)[1], (*d)[2], (*d)[3], (*d)[4], (*d)[5]);
- (*d)+=6;
- (*dl)-=6;
- return w;
-}
-
-int sldns_wire2str_eui64_scan(uint8_t** d, size_t* dl, char** s, size_t* sl)
-{
- int w;
- if(*dl < 8)
- return -1;
- w = sldns_str_print(s, sl, "%.2x-%.2x-%.2x-%.2x-%.2x-%.2x-%.2x-%.2x",
- (*d)[0], (*d)[1], (*d)[2], (*d)[3], (*d)[4], (*d)[5],
- (*d)[6], (*d)[7]);
- (*d)+=8;
- (*dl)-=8;
- return w;
-}
-
-int sldns_wire2str_tag_scan(uint8_t** d, size_t* dl, char** s, size_t* sl)
-{
- size_t i, n;
- int w = 0;
- if(*dl < 1)
- return -1;
- n = (size_t)((*d)[0]);
- if(*dl < 1+n)
- return -1;
- for(i=0; i<n; i++)
- if(!isalnum((int)(*d)[i]))
- return -1;
- for(i=0; i<n; i++)
- w += sldns_str_print(s, sl, "%c", (char)(*d)[i]);
- (*d)+=n+1;
- (*dl)-=(n+1);
- return w;
-}
-
-int sldns_wire2str_long_str_scan(uint8_t** d, size_t* dl, char** s, size_t* sl)
-{
- size_t i;
- int w = 0;
- w += sldns_str_print(s, sl, "\"");
- for(i=0; i<*dl; i++)
- w += str_char_print(s, sl, (*d)[i]);
- w += sldns_str_print(s, sl, "\"");
- (*d)+=*dl;
- (*dl)=0;
- return w;
-}
-
-int sldns_wire2str_edns_llq_print(char** s, size_t* sl, uint8_t* data,
- size_t len)
-{
- /* LLQ constants */
- const char* llq_errors[] = {"NO-ERROR", "SERV-FULL", "STATIC",
- "FORMAT-ERR", "NO-SUCH-LLQ", "BAD-VERS", "UNKNOWN_ERR"};
- const unsigned int llq_errors_num = 7;
- const char* llq_opcodes[] = {"LLQ-SETUP", "LLQ-REFRESH", "LLQ-EVENT"};
- const unsigned int llq_opcodes_num = 3;
- uint16_t version, llq_opcode, error_code;
- uint64_t llq_id;
- uint32_t lease_life; /* Requested or granted life of LLQ, in seconds */
- int w = 0;
-
- /* read the record */
- if(len != 18) {
- w += sldns_str_print(s, sl, "malformed LLQ ");
- w += print_hex_buf(s, sl, data, len);
- return w;
- }
- version = sldns_read_uint16(data);
- llq_opcode = sldns_read_uint16(data+2);
- error_code = sldns_read_uint16(data+4);
- memmove(&llq_id, data+6, sizeof(llq_id));
- lease_life = sldns_read_uint32(data+14);
-
- /* print it */
- w += sldns_str_print(s, sl, "v%d ", (int)version);
- if(llq_opcode < llq_opcodes_num)
- w += sldns_str_print(s, sl, "%s", llq_opcodes[llq_opcode]);
- else w += sldns_str_print(s, sl, "opcode %d", (int)llq_opcode);
- if(error_code < llq_errors_num)
- w += sldns_str_print(s, sl, " %s", llq_errors[error_code]);
- else w += sldns_str_print(s, sl, " error %d", (int)error_code);
-#ifndef USE_WINSOCK
- w += sldns_str_print(s, sl, " id %llx lease-life %lu",
- (unsigned long long)llq_id, (unsigned long)lease_life);
-#else
- w += sldns_str_print(s, sl, " id %I64x lease-life %lu",
- (unsigned long long)llq_id, (unsigned long)lease_life);
-#endif
- return w;
-}
-
-int sldns_wire2str_edns_ul_print(char** s, size_t* sl, uint8_t* data,
- size_t len)
-{
- uint32_t lease;
- int w = 0;
- if(len != 4) {
- w += sldns_str_print(s, sl, "malformed UL ");
- w += print_hex_buf(s, sl, data, len);
- return w;
- }
- lease = sldns_read_uint32(data);
- w += sldns_str_print(s, sl, "lease %lu", (unsigned long)lease);
- return w;
-}
-
-int sldns_wire2str_edns_nsid_print(char** s, size_t* sl, uint8_t* data,
- size_t len)
-{
- int w = 0;
- size_t i, printed=0;
- w += print_hex_buf(s, sl, data, len);
- for(i=0; i<len; i++) {
- if(isprint((int)data[i]) || data[i] == '\t') {
- if(!printed) {
- w += sldns_str_print(s, sl, " (");
- printed = 1;
- }
- w += sldns_str_print(s, sl, "%c", (char)data[i]);
- }
- }
- if(printed)
- w += sldns_str_print(s, sl, ")");
- return w;
-}
-
-int sldns_wire2str_edns_dau_print(char** s, size_t* sl, uint8_t* data,
- size_t len)
-{
- sldns_lookup_table *lt;
- size_t i;
- int w = 0;
- for(i=0; i<len; i++) {
- lt = sldns_lookup_by_id(sldns_algorithms, (int)data[i]);
- if(lt && lt->name)
- w += sldns_str_print(s, sl, " %s", lt->name);
- else w += sldns_str_print(s, sl, " %d", (int)data[i]);
- }
- return w;
-}
-
-int sldns_wire2str_edns_dhu_print(char** s, size_t* sl, uint8_t* data,
- size_t len)
-{
- sldns_lookup_table *lt;
- size_t i;
- int w = 0;
- for(i=0; i<len; i++) {
- lt = sldns_lookup_by_id(sldns_hashes, (int)data[i]);
- if(lt && lt->name)
- w += sldns_str_print(s, sl, " %s", lt->name);
- else w += sldns_str_print(s, sl, " %d", (int)data[i]);
- }
- return w;
-}
-
-int sldns_wire2str_edns_n3u_print(char** s, size_t* sl, uint8_t* data,
- size_t len)
-{
- size_t i;
- int w = 0;
- for(i=0; i<len; i++) {
- if(data[i] == 1)
- w += sldns_str_print(s, sl, " SHA1");
- else w += sldns_str_print(s, sl, " %d", (int)data[i]);
- }
- return w;
-}
-
-int sldns_wire2str_edns_subnet_print(char** s, size_t* sl, uint8_t* data,
- size_t len)
-{
- int w = 0;
- uint16_t family;
- uint8_t source, scope;
- if(len < 4) {
- w += sldns_str_print(s, sl, "malformed subnet ");
- w += print_hex_buf(s, sl, data, len);
- return w;
- }
- family = sldns_read_uint16(data);
- source = data[2];
- scope = data[3];
- if(family == 1) {
- /* IP4 */
- char buf[64];
- uint8_t ip4[4];
- memset(ip4, 0, sizeof(ip4));
- if(len-4 > 4) {
- w += sldns_str_print(s, sl, "trailingdata:");
- w += print_hex_buf(s, sl, data+4+4, len-4-4);
- w += sldns_str_print(s, sl, " ");
- len = 4+4;
- }
- memmove(ip4, data+4, len-4);
- if(!inet_ntop(AF_INET, ip4, buf, (socklen_t)sizeof(buf))) {
- w += sldns_str_print(s, sl, "ip4ntoperror ");
- w += print_hex_buf(s, sl, data+4+4, len-4-4);
- } else {
- w += sldns_str_print(s, sl, "%s", buf);
- }
- } else if(family == 2) {
- /* IP6 */
- char buf[64];
- uint8_t ip6[16];
- memset(ip6, 0, sizeof(ip6));
- if(len-4 > 16) {
- w += sldns_str_print(s, sl, "trailingdata:");
- w += print_hex_buf(s, sl, data+4+16, len-4-16);
- w += sldns_str_print(s, sl, " ");
- len = 4+16;
- }
- memmove(ip6, data+4, len-4);
-#ifdef AF_INET6
- if(!inet_ntop(AF_INET6, ip6, buf, (socklen_t)sizeof(buf))) {
- w += sldns_str_print(s, sl, "ip6ntoperror ");
- w += print_hex_buf(s, sl, data+4+4, len-4-4);
- } else {
- w += sldns_str_print(s, sl, "%s", buf);
- }
-#else
- w += print_hex_buf(s, sl, data+4+4, len-4-4);
-#endif
- } else {
- /* unknown */
- w += sldns_str_print(s, sl, "family %d ",
- (int)family);
- w += print_hex_buf(s, sl, data, len);
- }
- w += sldns_str_print(s, sl, "/%d scope /%d", (int)source, (int)scope);
- return w;
-}
-
-int sldns_wire2str_edns_option_print(char** s, size_t* sl,
- uint16_t option_code, uint8_t* optdata, size_t optlen)
-{
- int w = 0;
- w += sldns_wire2str_edns_option_code_print(s, sl, option_code);
- w += sldns_str_print(s, sl, ": ");
- switch(option_code) {
- case LDNS_EDNS_LLQ:
- w += sldns_wire2str_edns_llq_print(s, sl, optdata, optlen);
- break;
- case LDNS_EDNS_UL:
- w += sldns_wire2str_edns_ul_print(s, sl, optdata, optlen);
- break;
- case LDNS_EDNS_NSID:
- w += sldns_wire2str_edns_nsid_print(s, sl, optdata, optlen);
- break;
- case LDNS_EDNS_DAU:
- w += sldns_wire2str_edns_dau_print(s, sl, optdata, optlen);
- break;
- case LDNS_EDNS_DHU:
- w += sldns_wire2str_edns_dhu_print(s, sl, optdata, optlen);
- break;
- case LDNS_EDNS_N3U:
- w += sldns_wire2str_edns_n3u_print(s, sl, optdata, optlen);
- break;
- case LDNS_EDNS_CLIENT_SUBNET:
- w += sldns_wire2str_edns_subnet_print(s, sl, optdata, optlen);
- break;
- default:
- /* unknown option code */
- w += print_hex_buf(s, sl, optdata, optlen);
- break;
- }
- return w;
-}
-
-/** print the edns options to string */
-static int
-print_edns_opts(char** s, size_t* sl, uint8_t* rdata, size_t rdatalen)
-{
- uint16_t option_code, option_len;
- int w = 0;
- while(rdatalen > 0) {
- /* option name */
- if(rdatalen < 4) {
- w += sldns_str_print(s, sl, " ; malformed: ");
- w += print_hex_buf(s, sl, rdata, rdatalen);
- return w;
- }
- option_code = sldns_read_uint16(rdata);
- option_len = sldns_read_uint16(rdata+2);
- rdata += 4;
- rdatalen -= 4;
-
- /* option value */
- if(rdatalen < (size_t)option_len) {
- w += sldns_str_print(s, sl, " ; malformed ");
- w += sldns_wire2str_edns_option_code_print(s, sl,
- option_code);
- w += sldns_str_print(s, sl, ": ");
- w += print_hex_buf(s, sl, rdata, rdatalen);
- return w;
- }
- w += sldns_str_print(s, sl, " ; ");
- w += sldns_wire2str_edns_option_print(s, sl, option_code,
- rdata, option_len);
- rdata += option_len;
- rdatalen -= option_len;
- }
- return w;
-}
-
-int sldns_wire2str_edns_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len, uint8_t* pkt, size_t pktlen)
-{
- int w = 0;
- uint8_t ext_rcode, edns_version;
- uint16_t udpsize, edns_bits, rdatalen;
- w += sldns_str_print(str, str_len, "; EDNS:");
-
- /* some input checks, domain name */
- if(*data_len < 1+10)
- return w + print_remainder_hex("Error malformed 0x",
- data, data_len, str, str_len);
- if(*data[0] != 0) {
- return w + print_remainder_hex("Error nonrootdname 0x",
- data, data_len, str, str_len);
- }
- (*data)++;
- (*data_len)--;
-
- /* check type and read fixed contents */
- if(sldns_read_uint16((*data)) != LDNS_RR_TYPE_OPT) {
- return w + print_remainder_hex("Error nottypeOPT 0x",
- data, data_len, str, str_len);
- }
- udpsize = sldns_read_uint16((*data)+2);
- ext_rcode = (*data)[4];
- edns_version = (*data)[5];
- edns_bits = sldns_read_uint16((*data)+6);
- rdatalen = sldns_read_uint16((*data)+8);
- (*data)+=10;
- (*data_len)-=10;
-
- w += sldns_str_print(str, str_len, " version: %u;",
- (unsigned)edns_version);
- w += sldns_str_print(str, str_len, " flags:");
- if((edns_bits & LDNS_EDNS_MASK_DO_BIT))
- w += sldns_str_print(str, str_len, " do");
- /* the extended rcode is the value set, shifted four bits,
- * and or'd with the original rcode */
- if(ext_rcode) {
- int rc = ((int)ext_rcode)<<4;
- if(pkt && pktlen >= LDNS_HEADER_SIZE)
- rc |= LDNS_RCODE_WIRE(pkt);
- w += sldns_str_print(str, str_len, " ; ext-rcode: %d", rc);
- }
- w += sldns_str_print(str, str_len, " ; udp: %u", (unsigned)udpsize);
-
- if(rdatalen) {
- if(*data_len < rdatalen) {
- w += sldns_str_print(str, str_len,
- " ; Error EDNS rdata too short; ");
- rdatalen = *data_len;
- }
- w += print_edns_opts(str, str_len, *data, rdatalen);
- (*data) += rdatalen;
- (*data_len) -= rdatalen;
- }
- w += sldns_str_print(str, str_len, "\n");
- return w;
-}
+++ /dev/null
-/**
- * wire2str.h - txt presentation of RRs
- *
- * (c) NLnet Labs, 2005-2006
- *
- * See the file LICENSE for the license
- */
-
-/**
- * \file
- *
- * Contains functions to translate the wireformat to text
- * representation, as well as functions to print them.
- */
-
-#ifndef LDNS_WIRE2STR_H
-#define LDNS_WIRE2STR_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-struct sldns_struct_lookup_table;
-
-/* lookup tables for standard DNS stuff */
-/** Taken from RFC 2535, section 7. */
-extern struct sldns_struct_lookup_table* sldns_algorithms;
-/** DS record hash algorithms */
-extern struct sldns_struct_lookup_table* sldns_hashes;
-/** Taken from RFC 2538, section 2.1. */
-extern struct sldns_struct_lookup_table* sldns_cert_algorithms;
-/** Response codes */
-extern struct sldns_struct_lookup_table* sldns_rcodes;
-/** Operation codes */
-extern struct sldns_struct_lookup_table* sldns_opcodes;
-/** EDNS flags */
-extern struct sldns_struct_lookup_table* sldns_edns_flags;
-/** EDNS option codes */
-extern struct sldns_struct_lookup_table* sldns_edns_options;
-/** error string from wireparse */
-extern struct sldns_struct_lookup_table* sldns_wireparse_errors;
-
-/**
- * Convert wireformat packet to a string representation
- * @param data: wireformat packet data (starting at ID bytes).
- * @param len: length of packet.
- * @return string(malloced) or NULL on failure.
- */
-char* sldns_wire2str_pkt(uint8_t* data, size_t len);
-
-/**
- * Convert wireformat RR to a string representation.
- * @param rr: the wireformat RR, in uncompressed form. Starts at the domain
- * name start, ends with the rdata of the RR.
- * @param len: length of the rr wireformat.
- * @return string(malloced) or NULL on failure.
- */
-char* sldns_wire2str_rr(uint8_t* rr, size_t len);
-
-/**
- * Conver wire dname to a string.
- * @param dname: the dname in uncompressed wireformat.
- * @param dname_len: length of the dname.
- * @return string or NULL on failure.
- */
-char* sldns_wire2str_dname(uint8_t* dname, size_t dname_len);
-
-/**
- * Convert wire RR type to a string, 'MX', 'TYPE1234'...
- * @param rrtype: the RR type in host order.
- * @return malloced string with the RR type or NULL on malloc failure.
- */
-char* sldns_wire2str_type(uint16_t rrtype);
-
-/**
- * Convert wire RR class to a string, 'IN', 'CLASS1'.
- * @param rrclass: the RR class in host order.
- * @return malloced string with the RR class or NULL on malloc failure.
- */
-char* sldns_wire2str_class(uint16_t rrclass);
-
-/**
- * Convert wire packet rcode to a string, 'NOERROR', 'NXDOMAIN'...
- * @param rcode: as integer, host order
- * @return malloced string with the rcode or NULL on malloc failure.
- */
-char* sldns_wire2str_rcode(int rcode);
-
-/**
- * Print to string, move string along for next content. With va_list.
- * @param str: string buffer. Adjusted at end to after the output.
- * @param slen: length of the string buffer. Adjusted at end.
- * @param format: printf format string.
- * @param args: arguments for printf.
- * @return number of characters needed. Can be larger than slen.
- */
-int sldns_str_vprint(char** str, size_t* slen, const char* format, va_list args);
-
-/**
- * Print to string, move string along for next content.
- * @param str: string buffer. Adjusted at end to after the output.
- * @param slen: length of the string buffer. Adjusted at end.
- * @param format: printf format string and arguments for it.
- * @return number of characters needed. Can be larger than slen.
- */
-int sldns_str_print(char** str, size_t* slen, const char* format, ...)
- ATTR_FORMAT(printf, 3, 4);
-
-/**
- * Convert wireformat packet to a string representation with user buffer
- * It appends every RR with default comments.
- * For more formatter options use the function: TBD(TODO)
- * @param data: wireformat packet data (starting at ID bytes).
- * @param data_len: length of packet.
- * @param str: the string buffer for the output.
- * If you pass NULL as the str the return value of the function is
- * the str_len you need for the entire packet. It does not include
- * the 0 byte at the end.
- * @param str_len: the size of the string buffer. If more is needed, it'll
- * silently truncate the output to fit in the buffer.
- * @return the number of characters for this element, excluding zerobyte.
- * Is larger than str_len if output was truncated.
- */
-int sldns_wire2str_pkt_buf(uint8_t* data, size_t data_len, char* str,
- size_t str_len);
-
-/**
- * Scan wireformat packet to a string representation with user buffer
- * It appends every RR with default comments.
- * For more formatter options use the function: TBD(TODO)
- * @param data: wireformat packet data (starting at ID bytes).
- * @param data_len: length of packet.
- * @param str: the string buffer for the output.
- * @param str_len: the size of the string buffer.
- * @return number of characters for string.
- * returns the number of characters that are needed (except terminating null),
- * so it may return a value larger than str_len.
- * On error you get less output (i.e. shorter output in str (null terminated))
- * On exit the data, data_len, str and str_len values are adjusted to move them
- * from their original position along the input and output for the content
- * that has been consumed (and produced) by this function. If the end of the
- * output string is reached, *str_len is set to 0. The output string is null
- * terminated (shortening the output if necessary). If the end of the input
- * is reached *data_len is set to 0.
- */
-int sldns_wire2str_pkt_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len);
-
-/**
- * Scan wireformat rr to string, with user buffers. It shifts the arguments
- * to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @param pkt: packet for decompression, if NULL no decompression.
- * @param pktlen: length of packet buffer.
- * @return number of characters (except null) needed to print.
- */
-int sldns_wire2str_rr_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len, uint8_t* pkt, size_t pktlen);
-
-/**
- * Scan wireformat question rr to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @param pkt: packet for decompression, if NULL no decompression.
- * @param pktlen: length of packet buffer.
- * @return number of characters (except null) needed to print.
- */
-int sldns_wire2str_rrquestion_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len, uint8_t* pkt, size_t pktlen);
-
-/**
- * Scan wireformat RR to string in unknown RR format, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @param pkt: packet for decompression, if NULL no decompression.
- * @param pktlen: length of packet buffer.
- * @return number of characters (except null) needed to print.
- */
-int sldns_wire2str_rr_unknown_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len, uint8_t* pkt, size_t pktlen);
-
-/**
- * Print to string the RR-information comment in default format,
- * with user buffers. Moves string along.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @param rr: wireformat data.
- * @param rrlen: length of data buffer.
- * @param dname_off: offset in buffer behind owner dname, the compressed size
- * of the owner name.
- * @param rrtype: type of the RR, host format.
- * @return number of characters (except null) needed to print.
- */
-int sldns_wire2str_rr_comment_print(char** str, size_t* str_len, uint8_t* rr,
- size_t rrlen, size_t dname_off, uint16_t rrtype);
-
-/**
- * Scan wireformat packet header to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @return number of characters (except null) needed to print.
- */
-int sldns_wire2str_header_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len);
-
-/**
- * Scan wireformat rdata to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer. The length of the rdata in the
- * buffer. The rdatalen itself has already been scanned, the data
- * points to the rdata after the rdatalen.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @param rrtype: RR type of Rdata, host format.
- * @param pkt: packet for decompression, if NULL no decompression.
- * @param pktlen: length of packet buffer.
- * @return number of characters (except null) needed to print.
- */
-int sldns_wire2str_rdata_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len, uint16_t rrtype, uint8_t* pkt, size_t pktlen);
-
-/**
- * Scan wireformat rdata to string in unknown format, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer, the length of the rdata in buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @return number of characters (except null) needed to print.
- */
-int sldns_wire2str_rdata_unknown_scan(uint8_t** data, size_t* data_len,
- char** str, size_t* str_len);
-
-/**
- * Scan wireformat domain name to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @param pkt: packet for decompression, if NULL no decompression.
- * @param pktlen: length of packet buffer.
- * @return number of characters (except null) needed to print.
- */
-int sldns_wire2str_dname_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len, uint8_t* pkt, size_t pktlen);
-
-/**
- * Scan wireformat rr type to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @return number of characters (except null) needed to print.
- */
-int sldns_wire2str_type_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len);
-
-/**
- * Scan wireformat rr class to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @return number of characters (except null) needed to print.
- */
-int sldns_wire2str_class_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len);
-
-/**
- * Scan wireformat rr ttl to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @return number of characters (except null) needed to print.
- */
-int sldns_wire2str_ttl_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len);
-
-
-/**
- * Print host format rr type to string. Moves string along, user buffers.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @param rrtype: host format rr type.
- * @return number of characters (except null) needed to print.
- */
-int sldns_wire2str_type_print(char** str, size_t* str_len, uint16_t rrtype);
-
-/**
- * Print host format rr class to string. Moves string along, user buffers.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @param rrclass: host format rr class.
- * @return number of characters (except null) needed to print.
- */
-int sldns_wire2str_class_print(char** str, size_t* str_len, uint16_t rrclass);
-
-/**
- * Print host format rcode to string. Moves string along, user buffers.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @param rcode: host format rcode number.
- * @return number of characters (except null) needed to print.
- */
-int sldns_wire2str_rcode_print(char** str, size_t* str_len, int rcode);
-
-/**
- * Print host format opcode to string. Moves string along, user buffers.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @param opcode: host format opcode number.
- * @return number of characters (except null) needed to print.
- */
-int sldns_wire2str_opcode_print(char** str, size_t* str_len, int opcode);
-
-/**
- * Print host format EDNS0 option to string. Moves string along, user buffers.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @param opcode: host format option number.
- * @return number of characters (except null) needed to print.
- */
-int sldns_wire2str_edns_option_code_print(char** str, size_t* str_len,
- uint16_t opcode);
-
-/**
- * Convert RR to string presentation format, on one line. User buffer.
- * @param rr: wireformat RR data
- * @param rr_len: length of the rr wire data.
- * @param str: the string buffer to write to.
- * If you pass NULL as the str, the return value of the function is
- * the str_len you need for the entire packet. It does not include
- * the 0 byte at the end.
- * @param str_len: the size of the string buffer. If more is needed, it'll
- * silently truncate the output to fit in the buffer.
- * @return the number of characters for this element, excluding zerobyte.
- * Is larger than str_len if output was truncated.
- */
-int sldns_wire2str_rr_buf(uint8_t* rr, size_t rr_len, char* str,
- size_t str_len);
-
-/**
- * 3597 printout of an RR in unknown rr format.
- * There are more format and comment options available for printout
- * with the function: TBD(TODO)
- * @param rr: wireformat RR data
- * @param rr_len: length of the rr wire data.
- * @param str: the string buffer to write to.
- * If you pass NULL as the str, the return value of the function is
- * the str_len you need for the entire rr. It does not include
- * the 0 byte at the end.
- * @param str_len: the size of the string buffer. If more is needed, it'll
- * silently truncate the output to fit in the buffer.
- * @return the number of characters for this element, excluding zerobyte.
- * Is larger than str_len if output was truncated.
- */
-int sldns_wire2str_rr_unknown_buf(uint8_t* rr, size_t rr_len, char* str,
- size_t str_len);
-
-/**
- * This creates the comment to print after the RR. ; keytag=... , and other
- * basic comments for RRs.
- * There are more format and comment options available for printout
- * with the function: TBD(TODO)
- * @param rr: wireformat RR data
- * @param rr_len: length of the rr wire data.
- * @param dname_len: length of the dname in front of the RR.
- * @param str: the string buffer to write to.
- * If you pass NULL as the str, the return value of the function is
- * the str_len you need for the entire comment. It does not include
- * the 0 byte at the end.
- * @param str_len: the size of the string buffer. If more is needed, it'll
- * silently truncate the output to fit in the buffer.
- * @return the number of characters for this element, excluding zerobyte.
- * Is larger than str_len if output was truncated.
- */
-int sldns_wire2str_rr_comment_buf(uint8_t* rr, size_t rr_len, size_t dname_len,
- char* str, size_t str_len);
-
-/**
- * Convert RDATA to string presentation format, on one line. User buffer.
- * @param rdata: wireformat rdata part of an RR.
- * @param rdata_len: length of the rr wire data.
- * @param str: the string buffer to write to.
- * If you pass NULL as the str, the return value of the function is
- * the str_len you need for the entire packet. It does not include
- * the 0 byte at the end.
- * @param str_len: the size of the string buffer. If more is needed, it'll
- * silently truncate the output to fit in the buffer.
- * @param rrtype: rr type of the data
- * @return the number of characters for this element, excluding zerobyte.
- * Is larger than str_len if output was truncated.
- */
-int sldns_wire2str_rdata_buf(uint8_t* rdata, size_t rdata_len, char* str,
- size_t str_len, uint16_t rrtype);
-
-/**
- * Convert wire RR type to a string, 'MX', 'TYPE12'. With user buffer.
- * @param rrtype: the RR type in host order.
- * @param str: the string to write to.
- * @param len: length of str.
- * @return the number of characters for this element, excluding zerobyte.
- * Is larger than str_len if output was truncated.
- */
-int sldns_wire2str_type_buf(uint16_t rrtype, char* str, size_t len);
-
-/**
- * Convert wire RR class to a string, 'IN', 'CLASS12'. With user buffer.
- * @param rrclass: the RR class in host order.
- * @param str: the string to write to.
- * @param len: length of str.
- * @return the number of characters for this element, excluding zerobyte.
- * Is larger than str_len if output was truncated.
- */
-int sldns_wire2str_class_buf(uint16_t rrclass, char* str, size_t len);
-
-/**
- * Convert wire RR rcode to a string, 'NOERROR', 'NXDOMAIN'. With user buffer.
- * @param rcode: rcode as integer in host order
- * @param str: the string to write to.
- * @param len: length of str.
- * @return the number of characters for this element, excluding zerobyte.
- * Is larger than str_len if output was truncated.
- */
-int sldns_wire2str_rcode_buf(int rcode, char* str, size_t len);
-
-/**
- * Convert wire dname to a string, "example.com.". With user buffer.
- * @param dname: the dname in uncompressed wireformat.
- * @param dname_len: length of the dname.
- * @param str: the string to write to.
- * @param len: length of string.
- * @return the number of characters for this element, excluding zerobyte.
- * Is larger than str_len if output was truncated.
- */
-int sldns_wire2str_dname_buf(uint8_t* dname, size_t dname_len, char* str,
- size_t len);
-
-/**
- * Scan wireformat rdf field to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @param rdftype: the type of the rdata field, enum sldns_rdf_type.
- * @param pkt: packet for decompression, if NULL no decompression.
- * @param pktlen: length of packet buffer.
- * @return number of characters (except null) needed to print.
- * Can return -1 on failure.
- */
-int sldns_wire2str_rdf_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len, int rdftype, uint8_t* pkt, size_t pktlen);
-
-/**
- * Scan wireformat int8 field to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @return number of characters (except null) needed to print.
- * Can return -1 on failure.
- */
-int sldns_wire2str_int8_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len);
-
-/**
- * Scan wireformat int16 field to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @return number of characters (except null) needed to print.
- * Can return -1 on failure.
- */
-int sldns_wire2str_int16_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len);
-
-/**
- * Scan wireformat int32 field to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @return number of characters (except null) needed to print.
- * Can return -1 on failure.
- */
-int sldns_wire2str_int32_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len);
-
-/**
- * Scan wireformat period field to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @return number of characters (except null) needed to print.
- * Can return -1 on failure.
- */
-int sldns_wire2str_period_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len);
-
-/**
- * Scan wireformat tsigtime field to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @return number of characters (except null) needed to print.
- * Can return -1 on failure.
- */
-int sldns_wire2str_tsigtime_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len);
-
-/**
- * Scan wireformat ip4 A field to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @return number of characters (except null) needed to print.
- * Can return -1 on failure.
- */
-int sldns_wire2str_a_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len);
-
-/**
- * Scan wireformat ip6 AAAA field to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @return number of characters (except null) needed to print.
- * Can return -1 on failure.
- */
-int sldns_wire2str_aaaa_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len);
-
-/**
- * Scan wireformat str field to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @return number of characters (except null) needed to print.
- * Can return -1 on failure.
- */
-int sldns_wire2str_str_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len);
-
-/**
- * Scan wireformat apl field to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @return number of characters (except null) needed to print.
- * Can return -1 on failure.
- */
-int sldns_wire2str_apl_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len);
-
-/**
- * Scan wireformat b32_ext field to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @return number of characters (except null) needed to print.
- * Can return -1 on failure.
- */
-int sldns_wire2str_b32_ext_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len);
-
-/**
- * Scan wireformat b64 field to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @return number of characters (except null) needed to print.
- * Can return -1 on failure.
- */
-int sldns_wire2str_b64_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len);
-
-/**
- * Scan wireformat hex field to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @return number of characters (except null) needed to print.
- * Can return -1 on failure.
- */
-int sldns_wire2str_hex_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len);
-
-/**
- * Scan wireformat nsec bitmap field to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @return number of characters (except null) needed to print.
- * Can return -1 on failure.
- */
-int sldns_wire2str_nsec_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len);
-
-/**
- * Scan wireformat nsec3_salt field to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @return number of characters (except null) needed to print.
- * Can return -1 on failure.
- */
-int sldns_wire2str_nsec3_salt_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len);
-
-/**
- * Scan wireformat cert_alg field to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @return number of characters (except null) needed to print.
- * Can return -1 on failure.
- */
-int sldns_wire2str_cert_alg_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len);
-
-/**
- * Scan wireformat alg field to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @return number of characters (except null) needed to print.
- * Can return -1 on failure.
- */
-int sldns_wire2str_alg_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len);
-
-/**
- * Scan wireformat type unknown field to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @return number of characters (except null) needed to print.
- * Can return -1 on failure.
- */
-int sldns_wire2str_unknown_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len);
-
-/**
- * Scan wireformat time field to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @return number of characters (except null) needed to print.
- * Can return -1 on failure.
- */
-int sldns_wire2str_time_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len);
-
-/**
- * Scan wireformat LOC field to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @return number of characters (except null) needed to print.
- * Can return -1 on failure.
- */
-int sldns_wire2str_loc_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len);
-
-/**
- * Scan wireformat WKS field to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @return number of characters (except null) needed to print.
- * Can return -1 on failure.
- */
-int sldns_wire2str_wks_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len);
-
-/**
- * Scan wireformat NSAP field to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @return number of characters (except null) needed to print.
- * Can return -1 on failure.
- */
-int sldns_wire2str_nsap_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len);
-
-/**
- * Scan wireformat ATMA field to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @return number of characters (except null) needed to print.
- * Can return -1 on failure.
- */
-int sldns_wire2str_atma_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len);
-
-/**
- * Scan wireformat IPSECKEY field to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @param pkt: packet for decompression, if NULL no decompression.
- * @param pktlen: length of packet buffer.
- * @return number of characters (except null) needed to print.
- * Can return -1 on failure.
- */
-int sldns_wire2str_ipseckey_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len, uint8_t* pkt, size_t pktlen);
-
-/**
- * Scan wireformat HIP (algo, HIT, pubkey) field to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @return number of characters (except null) needed to print.
- * Can return -1 on failure.
- */
-int sldns_wire2str_hip_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len);
-
-/**
- * Scan wireformat int16_data field to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @return number of characters (except null) needed to print.
- * Can return -1 on failure.
- */
-int sldns_wire2str_int16_data_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len);
-
-/**
- * Scan wireformat nsec3_next_owner field to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @return number of characters (except null) needed to print.
- * Can return -1 on failure.
- */
-int sldns_wire2str_nsec3_next_owner_scan(uint8_t** data, size_t* data_len,
- char** str, size_t* str_len);
-
-/**
- * Scan wireformat ILNP64 field to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @return number of characters (except null) needed to print.
- * Can return -1 on failure.
- */
-int sldns_wire2str_ilnp64_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len);
-
-/**
- * Scan wireformat EUI48 field to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @return number of characters (except null) needed to print.
- * Can return -1 on failure.
- */
-int sldns_wire2str_eui48_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len);
-
-/**
- * Scan wireformat EUI64 field to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @return number of characters (except null) needed to print.
- * Can return -1 on failure.
- */
-int sldns_wire2str_eui64_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len);
-
-/**
- * Scan wireformat TAG field to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @return number of characters (except null) needed to print.
- * Can return -1 on failure.
- */
-int sldns_wire2str_tag_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len);
-
-/**
- * Scan wireformat long_str field to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @return number of characters (except null) needed to print.
- * Can return -1 on failure.
- */
-int sldns_wire2str_long_str_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len);
-
-/**
- * Print EDNS LLQ option data to string. User buffers, moves string pointers.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @param option_data: buffer with EDNS option code data.
- * @param option_len: length of the data for this option.
- * @return number of characters (except null) needed to print.
- */
-int sldns_wire2str_edns_llq_print(char** str, size_t* str_len,
- uint8_t* option_data, size_t option_len);
-
-/**
- * Print EDNS UL option data to string. User buffers, moves string pointers.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @param option_data: buffer with EDNS option code data.
- * @param option_len: length of the data for this option.
- * @return number of characters (except null) needed to print.
- */
-int sldns_wire2str_edns_ul_print(char** str, size_t* str_len,
- uint8_t* option_data, size_t option_len);
-
-/**
- * Print EDNS NSID option data to string. User buffers, moves string pointers.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @param option_data: buffer with EDNS option code data.
- * @param option_len: length of the data for this option.
- * @return number of characters (except null) needed to print.
- */
-int sldns_wire2str_edns_nsid_print(char** str, size_t* str_len,
- uint8_t* option_data, size_t option_len);
-
-/**
- * Print EDNS DAU option data to string. User buffers, moves string pointers.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @param option_data: buffer with EDNS option code data.
- * @param option_len: length of the data for this option.
- * @return number of characters (except null) needed to print.
- */
-int sldns_wire2str_edns_dau_print(char** str, size_t* str_len,
- uint8_t* option_data, size_t option_len);
-
-/**
- * Print EDNS DHU option data to string. User buffers, moves string pointers.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @param option_data: buffer with EDNS option code data.
- * @param option_len: length of the data for this option.
- * @return number of characters (except null) needed to print.
- */
-int sldns_wire2str_edns_dhu_print(char** str, size_t* str_len,
- uint8_t* option_data, size_t option_len);
-
-/**
- * Print EDNS N3U option data to string. User buffers, moves string pointers.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @param option_data: buffer with EDNS option code data.
- * @param option_len: length of the data for this option.
- * @return number of characters (except null) needed to print.
- */
-int sldns_wire2str_edns_n3u_print(char** str, size_t* str_len,
- uint8_t* option_data, size_t option_len);
-
-/**
- * Print EDNS SUBNET option data to string. User buffers, moves string pointers.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @param option_data: buffer with EDNS option code data.
- * @param option_len: length of the data for this option.
- * @return number of characters (except null) needed to print.
- */
-int sldns_wire2str_edns_subnet_print(char** str, size_t* str_len,
- uint8_t* option_data, size_t option_len);
-
-/**
- * Print an EDNS option as OPT: VALUE. User buffers, moves string pointers.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @param option_code: host format EDNS option code.
- * @param option_data: buffer with EDNS option code data.
- * @param option_len: length of the data for this option.
- * @return number of characters (except null) needed to print.
- */
-int sldns_wire2str_edns_option_print(char** str, size_t* str_len,
- uint16_t option_code, uint8_t* option_data, size_t option_len);
-
-/**
- * Scan wireformat EDNS OPT to string, with user buffers.
- * It shifts the arguments to move along (see sldns_wire2str_pkt_scan).
- * @param data: wireformat data.
- * @param data_len: length of data buffer.
- * @param str: string buffer.
- * @param str_len: length of string buffer.
- * @param pkt: packet with header and other info (may be NULL)
- * @param pktlen: length of packet buffer.
- * @return number of characters (except null) needed to print.
- */
-int sldns_wire2str_edns_scan(uint8_t** data, size_t* data_len, char** str,
- size_t* str_len, uint8_t* pkt, size_t pktlen);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* LDNS_WIRE2STR_H */
#include "services/cache/infra.h"
#include "util/data/msgreply.h"
#include "util/storage/slabhash.h"
-#include "ldns/sbuffer.h"
+#include "sldns/sbuffer.h"
int
context_finalize(struct ub_ctx* ctx)
/* format of cancel:
* o uint32 cmd
* o uint32 async-id */
- uint8_t* p = (uint8_t*)malloc(2*sizeof(uint32_t));
+ uint8_t* p = (uint8_t*)reallocarray(NULL, sizeof(uint32_t), 2);
if(!p) return NULL;
*len = 2*sizeof(uint32_t);
sldns_write_uint32(p, UB_LIBCMD_CANCEL);
#include "services/localzone.h"
#include "services/cache/infra.h"
#include "services/cache/rrset.h"
-#include "ldns/sbuffer.h"
+#include "sldns/sbuffer.h"
#ifdef HAVE_PTHREAD
#include <signal.h>
#endif
return UB_NOERROR;
}
+int ub_ctx_add_ta_autr(struct ub_ctx* ctx, const char* fname)
+{
+ char* dup = strdup(fname);
+ if(!dup) return UB_NOMEM;
+ lock_basic_lock(&ctx->cfglock);
+ if(ctx->finalized) {
+ lock_basic_unlock(&ctx->cfglock);
+ free(dup);
+ return UB_AFTERFINAL;
+ }
+ if(!cfg_strlist_insert(&ctx->env->cfg->auto_trust_anchor_file_list,
+ dup)) {
+ lock_basic_unlock(&ctx->cfglock);
+ free(dup);
+ return UB_NOMEM;
+ }
+ lock_basic_unlock(&ctx->cfglock);
+ return UB_NOERROR;
+}
+
int
ub_ctx_trustedkeys(struct ub_ctx* ctx, const char* fname)
{
parse++;
addr = parse;
/* skip [0-9a-fA-F.:]*, i.e. IP4 and IP6 address */
- while(isxdigit(*parse) || *parse=='.' || *parse==':')
+ while(isxdigit((unsigned char)*parse) || *parse=='.' || *parse==':')
parse++;
/* terminate after the address, remove newline */
*parse = 0;
/* format: <addr> spaces <name> spaces <name> ... */
addr = parse;
/* skip addr */
- while(isxdigit(*parse) || *parse == '.' || *parse == ':')
+ while(isxdigit((unsigned char)*parse) || *parse == '.' || *parse == ':')
+ parse++;
+ if(*parse == '\r')
parse++;
if(*parse == '\n' || *parse == 0)
continue;
*parse++ = 0; /* end delimiter for addr ... */
/* go to names and add them */
while(*parse) {
- while(*parse == ' ' || *parse == '\t' || *parse=='\n')
+ while(*parse == ' ' || *parse == '\t' || *parse=='\n'
+ || *parse=='\r')
parse++;
if(*parse == 0 || *parse == '#')
break;
#include "libunbound/libworker.h"
#include "libunbound/context.h"
#include "libunbound/unbound.h"
+#include "libunbound/worker.h"
#include "libunbound/unbound-event.h"
#include "services/outside_network.h"
#include "services/mesh.h"
#include "services/localzone.h"
#include "services/cache/rrset.h"
#include "services/outbound_list.h"
+#include "util/fptr_wlist.h"
#include "util/module.h"
#include "util/regional.h"
#include "util/random.h"
#include "util/tube.h"
#include "iterator/iter_fwd.h"
#include "iterator/iter_hints.h"
-#include "ldns/sbuffer.h"
-#include "ldns/str2wire.h"
+#include "sldns/sbuffer.h"
+#include "sldns/str2wire.h"
/** handle new query command for bg worker */
static void handle_newq(struct libworker* w, uint8_t* buf, uint32_t len);
w->env->infra_cache, w->env->rnd, cfg->use_caps_bits_for_id,
ports, numports, cfg->unwanted_threshold,
&libworker_alloc_cleanup, w, cfg->do_udp, w->sslctx,
- cfg->delay_close
+ cfg->delay_close, NULL
#ifdef CLIENT_SUBNET
, NULL
#endif
edns->ext_rcode = 0;
edns->edns_version = 0;
edns->bits = EDNS_DO;
-#ifdef CLIENT_SUBNET
- edns->subnet_validdata = 0;
-#endif
if(sldns_buffer_capacity(w->back->udp_buff) < 65535)
edns->udp_size = (uint16_t)sldns_buffer_capacity(
w->back->udp_buff);
sldns_buffer_write_u16_at(w->back->udp_buff, 0, qid);
sldns_buffer_write_u16_at(w->back->udp_buff, 2, qflags);
if(local_zones_answer(ctx->local_zones, &qinfo, &edns,
- w->back->udp_buff, w->env->scratch)) {
+ w->back->udp_buff, w->env->scratch, NULL)) {
regional_free_all(w->env->scratch);
libworker_fillup_fg(q, LDNS_RCODE_NOERROR,
w->back->udp_buff, sec_status_insecure, NULL);
sldns_buffer_write_u16_at(w->back->udp_buff, 0, qid);
sldns_buffer_write_u16_at(w->back->udp_buff, 2, qflags);
if(local_zones_answer(ctx->local_zones, &qinfo, &edns,
- w->back->udp_buff, w->env->scratch)) {
+ w->back->udp_buff, w->env->scratch, NULL)) {
regional_free_all(w->env->scratch);
free(qinfo.qname);
libworker_event_done_cb(q, LDNS_RCODE_NOERROR,
sldns_buffer_write_u16_at(w->back->udp_buff, 0, qid);
sldns_buffer_write_u16_at(w->back->udp_buff, 2, qflags);
if(local_zones_answer(w->ctx->local_zones, &qinfo, &edns,
- w->back->udp_buff, w->env->scratch)) {
+ w->back->udp_buff, w->env->scratch, NULL)) {
regional_free_all(w->env->scratch);
q->msg_security = sec_status_insecure;
add_bg_result(w, q, w->back->udp_buff, UB_NOERROR, NULL);
struct outbound_entry* libworker_send_query(uint8_t* qname, size_t qnamelen,
uint16_t qtype, uint16_t qclass, uint16_t flags, int dnssec,
- int want_dnssec, struct sockaddr_storage* addr, socklen_t addrlen,
- uint8_t* zone, size_t zonelen, struct module_qstate* q)
+ int want_dnssec, int nocaps, struct sockaddr_storage* addr,
+ socklen_t addrlen, uint8_t* zone, size_t zonelen,
+ struct module_qstate* q)
{
struct libworker* w = (struct libworker*)q->env->worker;
struct outbound_entry* e = (struct outbound_entry*)regional_alloc(
if(!e)
return NULL;
e->qstate = q;
-
e->qsent = outnet_serviced_query(w->back, qname,
- qnamelen, qtype, qclass, flags, dnssec, want_dnssec,
+ qnamelen, qtype, qclass, flags, dnssec, want_dnssec, nocaps,
q->env->cfg->tcp_upstream, q->env->cfg->ssl_upstream, addr,
addrlen, zone, zonelen, libworker_handle_service_reply, e,
w->back->udp_buff
, &q->edns_server_out
#endif
);
-
if(!e->qsent) {
return NULL;
}
size_t ATTR_UNUSED(qnamelen), uint16_t ATTR_UNUSED(qtype),
uint16_t ATTR_UNUSED(qclass), uint16_t ATTR_UNUSED(flags),
int ATTR_UNUSED(dnssec), int ATTR_UNUSED(want_dnssec),
- struct sockaddr_storage* ATTR_UNUSED(addr),
- socklen_t ATTR_UNUSED(addrlen), struct module_qstate* ATTR_UNUSED(q))
+ int ATTR_UNUSED(nocaps), struct sockaddr_storage* ATTR_UNUSED(addr),
+ socklen_t ATTR_UNUSED(addrlen), uint8_t* ATTR_UNUSED(zone),
+ size_t ATTR_UNUSED(zonelen), struct module_qstate* ATTR_UNUSED(q))
{
log_assert(0);
return 0;
* and if in the background continues until exit, if in the foreground
* returns from the procedure when done.
*/
-#ifndef LIBUNBOUND_WORKER_H
-#define LIBUNBOUND_WORKER_H
+#ifndef LIBUNBOUND_LIBWORKER_H
+#define LIBUNBOUND_LIBWORKER_H
#include "util/data/packed_rrset.h"
struct ub_ctx;
struct ub_result;
/** cleanup the cache to remove all rrset IDs from it, arg is libworker */
void libworker_alloc_cleanup(void* arg);
-/**
- * Worker service routine to send serviced queries to authoritative servers.
- * @param qname: query name. (host order)
- * @param qnamelen: length in bytes of qname, including trailing 0.
- * @param qtype: query type. (host order)
- * @param qclass: query class. (host order)
- * @param flags: host order flags word, with opcode and CD bit.
- * @param dnssec: if set, EDNS record will have DO bit set.
- * @param want_dnssec: signatures needed.
- * @param addr: where to.
- * @param addrlen: length of addr.
- * @param zone: delegation point name.
- * @param zonelen: length of zone name wireformat dname.
- * @param q: wich query state to reactivate upon return.
- * @return: false on failure (memory or socket related). no query was
- * sent.
- */
-struct outbound_entry* libworker_send_query(uint8_t* qname, size_t qnamelen,
- uint16_t qtype, uint16_t qclass, uint16_t flags, int dnssec,
- int want_dnssec, struct sockaddr_storage* addr, socklen_t addrlen,
- uint8_t* zone, size_t zonelen, struct module_qstate* q);
-
-/** process incoming replies from the network */
-int libworker_handle_reply(struct comm_point* c, void* arg, int error,
- struct comm_reply* reply_info);
-
-/** process incoming serviced query replies from the network */
-int libworker_handle_service_reply(struct comm_point* c, void* arg, int error,
- struct comm_reply* reply_info);
-
-/** handle control command coming into server */
-void libworker_handle_control_cmd(struct tube* tube, uint8_t* msg, size_t len,
- int err, void* arg);
-
-/** handle opportunity to write result back */
-void libworker_handle_result_write(struct tube* tube, uint8_t* msg, size_t len,
- int err, void* arg);
-
-/** mesh callback with fg results */
-void libworker_fg_done_cb(void* arg, int rcode, struct sldns_buffer* buf,
- enum sec_status s, char* why_bogus);
-
-/** mesh callback with bg results */
-void libworker_bg_done_cb(void* arg, int rcode, struct sldns_buffer* buf,
- enum sec_status s, char* why_bogus);
-
-/** mesh callback with event results */
-void libworker_event_done_cb(void* arg, int rcode, struct sldns_buffer* buf,
- enum sec_status s, char* why_bogus);
-
/**
* fill result from parsed message, on error fills servfail
* @param res: is clear at start, filled in at end.
void libworker_enter_result(struct ub_result* res, struct sldns_buffer* buf,
struct regional* temp, enum sec_status msg_security);
-#endif /* LIBUNBOUND_WORKER_H */
+#endif /* LIBUNBOUND_LIBWORKER_H */
#../../.libs/libunbound.so.0: ../../Makefile
#$(MAKE) -C ../..
-#../../ldns-src/lib/libldns.so: ../../ldns-src/Makefile
- #$(MAKE) -C ../../ldns-src
-
clean:
rm -rdf examples/unbound
rm -f _unbound.so libunbound_wrap.o
$(MAKE) -C ../.. clean
-testenv: ../../.libs/libunbound.so.2 ../../ldns-src/lib/libldns.so ../../.libs/_unbound.so
+testenv: ../../.libs/libunbound.so.2 ../../.libs/_unbound.so
rm -rdf examples/unbound
- cd examples && mkdir unbound && ln -s ../../unbound.py unbound/__init__.py && ln -s ../../_unbound.so unbound/_unbound.so && ln -s ../../../../.libs/libunbound.so.2 unbound/libunbound.so.2 && ln -s ../../../../ldns-src/lib/libldns.so.1 unbound/libldns.so.1 && ls -la
+ cd examples && mkdir unbound && ln -s ../../unbound.py unbound/__init__.py && ln -s ../../_unbound.so unbound/_unbound.so && ln -s ../../../../.libs/libunbound.so.2 unbound/libunbound.so.2 && ls -la
cd examples && if test -f ../../../.libs/_unbound.so; then cp ../../../.libs/_unbound.so . ; fi
@echo "Run a script by typing ./script_name.py"
cd examples && LD_LIBRARY_PATH=unbound bash
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
'''
+from __future__ import print_function
import unbound
import time
ctx.resolvconf("/etc/resolv.conf")
def call_back(my_data,status,result):
- print "Call_back:", my_data
+ print("Call_back:", sorted(my_data))
if status == 0 and result.havedata:
- print "Result:", result.data.address_list
+ print("Result:", sorted(result.data.address_list))
my_data['done_flag'] = True
time.sleep(0.1)
if (status != 0):
- print "Resolve error:", unbound.ub_strerror(status)
+ print("Resolve error:", unbound.ub_strerror(status))
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
'''
+from __future__ import print_function
import unbound
ctx = unbound.ub_ctx()
status, result = ctx.resolve("www.nic.cz", unbound.RR_TYPE_A, unbound.RR_CLASS_IN)
if status == 0 and result.havedata:
- print "Result:", result.data.address_list
+ print("Result:", sorted(result.data.address_list))
elif status != 0:
- print "Error:", unbound.ub_strerror(status)
+ print("Error:", unbound.ub_strerror(status))
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
'''
+from __future__ import print_function
import os
from unbound import ub_ctx,RR_TYPE_A,RR_CLASS_IN
status, result = ctx.resolve("www.nic.cz", RR_TYPE_A, RR_CLASS_IN)
if status == 0 and result.havedata:
- print "Result:", result.data.address_list
+ print("Result:", sorted(result.data.address_list))
if result.secure:
- print "Result is secure"
+ print("Result is secure")
elif result.bogus:
- print "Result is bogus"
+ print("Result is bogus")
else:
- print "Result is insecure"
+ print("Result is insecure")
#!/usr/bin/env python
+from __future__ import print_function
from unbound import ub_ctx, RR_TYPE_A, RR_TYPE_RRSIG, RR_TYPE_NSEC, RR_TYPE_NSEC3
import ldns
def dnssecParse(domain, rrType=RR_TYPE_A):
- print "Resolving domain", domain
+ print("Resolving domain", domain)
s, r = resolver.resolve(domain)
- print "status: %s, secure: %s, rcode: %s, havedata: %s, answer_len; %s" % (s, r.secure, r.rcode_str, r.havedata, r.answer_len)
+ print("status: %s, secure: %s, rcode: %s, havedata: %s, answer_len; %s" % (s, r.secure, r.rcode_str, r.havedata, r.answer_len))
s, pkt = ldns.ldns_wire2pkt(r.packet)
if s != 0:
raise RuntimeError("Error parsing DNS packet")
rrsigs = pkt.rr_list_by_type(RR_TYPE_RRSIG, ldns.LDNS_SECTION_ANSWER)
- print "RRSIGs from answer:", rrsigs
+ print("RRSIGs from answer:", sorted(rrsigs))
rrsigs = pkt.rr_list_by_type(RR_TYPE_RRSIG, ldns.LDNS_SECTION_AUTHORITY)
- print "RRSIGs from authority:", rrsigs
+ print("RRSIGs from authority:", sorted(rrsigs))
nsecs = pkt.rr_list_by_type(RR_TYPE_NSEC, ldns.LDNS_SECTION_AUTHORITY)
- print "NSECs:", nsecs
+ print("NSECs:", sorted(nsecs))
nsec3s = pkt.rr_list_by_type(RR_TYPE_NSEC3, ldns.LDNS_SECTION_AUTHORITY)
- print "NSEC3s:", nsec3s
+ print("NSEC3s:", sorted(nsec3s))
- print "---"
+ print("---")
resolver = ub_ctx()
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
'''
+from __future__ import print_function
import unbound
ctx = unbound.ub_ctx()
status, result = ctx.resolve("nic.cz", unbound.RR_TYPE_MX, unbound.RR_CLASS_IN)
if status == 0 and result.havedata:
- print "Result:"
- print " raw data:", result.data
- for k in result.data.mx_list:
- print " priority:%d address:%s" % k
+ print("Result:")
+ print(" raw data:", result.data)
+ for k in sorted(result.data.mx_list):
+ print(" priority:%d address:%s" % k)
status, result = ctx.resolve("nic.cz", unbound.RR_TYPE_A, unbound.RR_CLASS_IN)
if status == 0 and result.havedata:
- print "Result:"
- print " raw data:", result.data
- for k in result.data.address_list:
- print " address:%s" % k
+ print("Result:")
+ print(" raw data:", result.data)
+ for k in sorted(result.data.address_list):
+ print(" address:%s" % k)
status, result = ctx.resolve("nic.cz", unbound.RR_TYPE_NS, unbound.RR_CLASS_IN)
if status == 0 and result.havedata:
- print "Result:"
- print " raw data:", result.data
- for k in result.data.domain_list:
- print " host: %s" % k
+ print("Result:")
+ print(" raw data:", result.data)
+ for k in sorted(result.data.domain_list):
+ print(" host: %s" % k)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
'''
+from __future__ import print_function
import unbound
import locale
#The unicode IDN string is automatically converted (if necessary)
status, result = ctx.resolve(u"www.háčkyčárky.cz", unbound.RR_TYPE_A, unbound.RR_CLASS_IN)
if status == 0 and result.havedata:
- print "Result:"
- print " raw data:", result.data
- for k in result.data.address_list:
- print " address:%s" % k
+ print("Result:")
+ print(" raw data:", result.data)
+ for k in sorted(result.data.address_list):
+ print(" address:%s" % k)
status, result = ctx.resolve(u"háčkyčárky.cz", unbound.RR_TYPE_MX, unbound.RR_CLASS_IN)
if status == 0 and result.havedata:
- print "Result:"
- print " raw data:", result.data
- for k in result.data.mx_list_idn:
- print " priority:%d address:%s" % k
+ print("Result:")
+ print(" raw data:", result.data)
+ for k in sorted(result.data.mx_list_idn):
+ print(" priority:%d address:%s" % k)
status, result = ctx.resolve(unbound.reverse('217.31.204.66')+'.in-addr.arpa', unbound.RR_TYPE_PTR, unbound.RR_CLASS_IN)
if status == 0 and result.havedata:
- print "Result.data:", result.data
- for k in result.data.domain_list_idn:
- print " dname:%s" % k
+ print("Result.data:", result.data)
+ for k in sorted(result.data.domain_list_idn):
+ print(" dname:%s" % k)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
'''
+from __future__ import print_function
import unbound
ctx = unbound.ub_ctx()
status, result = ctx.resolve("nic.cz", unbound.RR_TYPE_MX, unbound.RR_CLASS_IN)
if status == 0 and result.havedata:
- print "Result:"
- print " raw data:", result.data
- for k in result.data.mx_list:
- print " priority:%d address:%s" % k
+ print("Result:")
+ print(" raw data:", result.data)
+ for k in sorted(result.data.mx_list):
+ print(" priority:%d address:%s" % k)
status, result = ctx.resolve("nic.cz", unbound.RR_TYPE_A, unbound.RR_CLASS_IN)
if status == 0 and result.havedata:
- print "Result:"
- print " raw data:", result.data
- for k in result.data.address_list:
- print " address:%s" % k
+ print("Result:")
+ print(" raw data:", result.data)
+ for k in sorted(result.data.address_list):
+ print(" address:%s" % k)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
'''
+from __future__ import print_function
import unbound
ctx = unbound.ub_ctx()
status, result = ctx.resolve("vutbr.cz", unbound.RR_TYPE_NS, unbound.RR_CLASS_IN)
if status == 0 and result.havedata:
- print "Result:"
- print " raw data:", result.data
- for k in result.data.domain_list:
- print " host: %s" % k
+ print("Result:")
+ print(" raw data:", result.data)
+ for k in sorted(result.data.domain_list):
+ print(" host: %s" % k)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
'''
+from __future__ import print_function
import unbound
ctx = unbound.ub_ctx()
status, result = ctx.resolve(unbound.reverse("74.125.43.147") + ".in-addr.arpa.", unbound.RR_TYPE_PTR, unbound.RR_CLASS_IN)
if status == 0 and result.havedata:
- print "Result.data:", result.data, result.data.domain_list
+ print("Result.data:", result.data, sorted(result.data.domain_list))
%pythoncode %{
import encodings.idna
+ try:
+ import builtins
+ except ImportError:
+ import __builtin__ as builtins
+
+ # Ensure compatibility with older python versions
+ if 'bytes' not in vars():
+ bytes = str
+
+ def ord(s):
+ if isinstance(s, int):
+ return s
+ return builtins.ord(s)
%}
//%include "doc.i"
+#if PY_MAJOR_VERSION >= 3
+%include "file_py3.i" // python 3 FILE *
+#else
%include "file.i"
+#endif
%feature("docstring") strerror "Convert error value to a human readable string."
:returns: * (int) 0 if OK, else error.
* (:class:`ub_result`) the result data is returned in a newly allocated result structure. May be None on return, return value is set to an error in that case (out of memory).
"""
- if isinstance(name, unicode): #probably IDN
- return _unbound.ub_resolve(self,idn2dname(name),rrtype,rrclass)
- else:
+ if isinstance(name, bytes): #probably IDN
return _unbound.ub_resolve(self,name,rrtype,rrclass)
+ else:
+ return _unbound.ub_resolve(self,idn2dname(name),rrtype,rrclass)
#parameters: struct ub_ctx *,char *,int,int,
#retvals: int,struct ub_result **
* `result` - the result structure. The result may be None, in that case err is set.
"""
- if isinstance(name, unicode): #probably IDN
- return _unbound._ub_resolve_async(self,idn2dname(name),rrtype,rrclass,mydata,callback)
- else:
+ if isinstance(name, bytes): #probably IDN
return _unbound._ub_resolve_async(self,name,rrtype,rrclass,mydata,callback)
+ else:
+ return _unbound._ub_resolve_async(self,idn2dname(name),rrtype,rrclass,mydata,callback)
#parameters: struct ub_ctx *,char *,int,int,void *,ub_callback_t,
#retvals: int, int
idx = ofs
while (idx < slen):
complen = ord(s[idx])
- res.append(s[idx+1:idx+1+complen])
+ # In python 3.x `str()` converts the string to unicode which is the expected text string type
+ res.append(str(s[idx+1:idx+1+complen].decode()))
idx += complen + 1
return res
list = PyList_New(cnt);
for (i=0;i<cnt;i++)
- PyList_SetItem(list, i, PyString_FromStringAndSize(result->data[i],result->len[i]));
+ PyList_SetItem(list, i, PyBytes_FromStringAndSize(result->data[i],result->len[i]));
return list;
}
PyObject* _packet() {
- return PyString_FromStringAndSize($self->answer_packet, $self->answer_len);
+ return PyBytes_FromStringAndSize($self->answer_packet, $self->answer_len);
}
%pythoncode %{
ub_ctx_resolvconf
ub_ctx_hosts
ub_ctx_add_ta
+ub_ctx_add_ta_autr
ub_ctx_add_ta_file
ub_ctx_trustedkeys
ub_ctx_debugout
*/
int ub_ctx_add_ta_file(struct ub_ctx* ctx, const char* fname);
+/**
+ * Add trust anchor to the given context that is tracked with RFC5011
+ * automated trust anchor maintenance. The file is written to when the
+ * trust anchor is changed.
+ * Pass the name of a file that was output from eg. unbound-anchor,
+ * or you can start it by providing a trusted DNSKEY or DS record on one
+ * line in the file.
+ * @param ctx: context.
+ * At this time it is only possible to add trusted keys before the
+ * first resolve is done.
+ * @param fname: filename of file with trust anchor.
+ * @return 0 if OK, else error.
+ */
+int ub_ctx_add_ta_autr(struct ub_ctx* ctx, const char* fname);
+
/**
* Add trust anchors to the given context.
* Pass the name of a bind-style config file with trusted-keys{}.
/**
* Convert error value to a human readable string.
- * @param err: error code from one of the ub_val* functions.
+ * @param err: error code from one of the libunbound functions.
* @return pointer to constant text string, zero terminated.
*/
const char* ub_strerror(int err);
# compiler: $LTCC
# compiler flags: $LTCFLAGS
# linker: $LD (gnu? $with_gnu_ld)
-# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.7
+# $progname: (GNU libtool) 2.4.2
# automake: $automake_version
# autoconf: $autoconf_version
#
PROGRAM=libtool
PACKAGE=libtool
-VERSION="2.4.2 Debian-2.4.2-1.7"
+VERSION=2.4.2
TIMESTAMP=""
package_revision=1.3337
case $pass in
dlopen) libs="$dlfiles" ;;
dlpreopen) libs="$dlprefiles" ;;
- link)
- libs="$deplibs %DEPLIBS%"
- test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
- ;;
+ link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
esac
fi
if test "$linkmode,$pass" = "lib,dlpreopen"; then
# It is a libtool convenience library, so add in its objects.
func_append convenience " $ladir/$objdir/$old_library"
func_append old_convenience " $ladir/$objdir/$old_library"
- tmp_libs=
- for deplib in $dependency_libs; do
- deplibs="$deplib $deplibs"
- if $opt_preserve_dup_deps ; then
- case "$tmp_libs " in
- *" $deplib "*) func_append specialdeplibs " $deplib" ;;
- esac
- fi
- func_append tmp_libs " $deplib"
- done
elif test "$linkmode" != prog && test "$linkmode" != lib; then
func_fatal_error "\`$lib' is not a convenience library"
fi
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ deplibs="$deplib $deplibs"
+ if $opt_preserve_dup_deps ; then
+ case "$tmp_libs " in
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+ func_append tmp_libs " $deplib"
+ done
continue
fi # $pass = conv
revision="$number_minor"
lt_irix_increment=no
;;
- *)
- func_fatal_configuration "$modename: unknown library version type \`$version_type'"
- ;;
esac
;;
no)
cd openssl-* || error_cleanup "no openssl-X dir in tarball"
# configure for crosscompile, without CAPI because it fails
# cross-compilation and it is not used anyway
- sslflags="no-asm --cross-compile-prefix=i686-w64-mingw32- -DOPENSSL_NO_CAPIENG mingw"
+ # before 1.0.1i need --cross-compile-prefix=i686-w64-mingw32-
+ sslflags="no-asm -DOPENSSL_NO_CAPIENG mingw"
info "winssl: Configure $sslflags"
- ./Configure --prefix="$sslinstall" $sslflags || error_cleanup "OpenSSL Configure failed"
+ CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar RANLIB=i686-w64-mingw32-ranlib ./Configure --prefix="$sslinstall" $sslflags || error_cleanup "OpenSSL Configure failed"
info "winssl: make"
make || error_cleanup "OpenSSL crosscompile failed"
# only install sw not docs, which take a long time.
cd ..
fi
+ info "SVNROOT is $SVNROOT"
info "Exporting source from SVN."
svn export "$SVNROOT" unbound || error_cleanup "SVN command failed"
cd unbound || error_cleanup "Unbound not exported correctly from SVN"
#include "util/storage/lruhash.h"
#include "services/cache/dns.h"
#include "services/mesh.h"
- #include "ldns/wire2str.h"
- #include "ldns/str2wire.h"
- #include "ldns/pkthdr.h"
+ #include "iterator/iter_delegpt.h"
+ #include "iterator/iter_hints.h"
+ #include "iterator/iter_utils.h"
+ #include "sldns/wire2str.h"
+ #include "sldns/str2wire.h"
+ #include "sldns/pkthdr.h"
%}
%include "stdint.i" // uint_16_t can be known type now
%inline %{
- //converts [len][data][len][data][0] string to a List of labels (PyStrings)
+ //converts [len][data][len][data][0] string to a List of labels (PyBytes)
PyObject* GetNameAsLabelList(const char* name, int len) {
PyObject* list;
int cnt=0, i;
list = PyList_New(cnt);
i = 0; cnt = 0;
while (i < len) {
- PyList_SetItem(list, cnt, PyString_FromStringAndSize(name + i + 1, name[i]));
+ PyList_SetItem(list, cnt, PyBytes_FromStringAndSize(name + i + 1, name[i]));
i += name[i] + 1;
cnt++;
}
%inline %{
enum enum_rr_class {
RR_CLASS_IN = 1,
- RR_CLASS_CH = 3,
- RR_CLASS_HS = 4,
+ RR_CLASS_CH = 3,
+ RR_CLASS_HS = 4,
RR_CLASS_NONE = 254,
RR_CLASS_ANY = 255,
};
};
PyObject* _get_qname(struct query_info* q) {
- return PyString_FromStringAndSize((char*)q->qname, q->qname_len);
+ return PyBytes_FromStringAndSize((char*)q->qname, q->qname_len);
}
PyObject* _get_qname_components(struct query_info* q) {
char buf[LDNS_MAX_DOMAINLEN+1];
buf[0] = '\0';
dname_str((uint8_t*)dname, buf);
- return PyString_FromString(buf);
+ return PyBytes_FromString(buf);
}
%}
%inline %{
PyObject* _get_dname(struct packed_rrset_key* k) {
- return PyString_FromStringAndSize((char*)k->dname, k->dname_len);
+ return PyBytes_FromStringAndSize((char*)k->dname, k->dname_len);
}
PyObject* _get_dname_components(struct packed_rrset_key* k) {
return GetNameAsLabelList((char*)k->dname, k->dname_len);
PyObject* _get_data_rr_data(struct packed_rrset_data* d, int idx) {
if ((d != NULL) && (idx >= 0) &&
((size_t)idx < (d->count+d->rrsig_count)))
- return PyString_FromStringAndSize((char*)d->rr_data[idx],
+ return PyBytes_FromStringAndSize((char*)d->rr_data[idx],
d->rr_len[idx]);
return Py_None;
}
reply_addr2str(reply, dest, 64);
if (dest[0] == 0)
return Py_None;
- return PyString_FromString(dest);
+ return PyBytes_FromString(dest);
}
PyObject* _comm_reply_family_get(struct comm_reply* reply) {
int af = (int)((struct sockaddr_in*) &(reply->addr))->sin_family;
switch(af) {
- case AF_INET: return PyString_FromString("ip4");
- case AF_INET6: return PyString_FromString("ip6");
- case AF_UNIX: return PyString_FromString("unix");
+ case AF_INET: return PyBytes_FromString("ip4");
+ case AF_INET6: return PyBytes_FromString("ip6");
+ case AF_UNIX: return PyBytes_FromString("unix");
}
return Py_None;
char* python_script;
};
+/* ************************************************************************************ *
+ ASN: Adding structures related to forwards_lookup and dns_cache_find_delegation
+ * ************************************************************************************ */
+struct delegpt_ns {
+ struct delegpt_ns* next;
+ int resolved;
+ uint8_t got4;
+ uint8_t got6;
+ uint8_t lame;
+ uint8_t done_pside4;
+ uint8_t done_pside6;
+};
+
+struct delegpt_addr {
+ struct delegpt_addr* next_result;
+ struct delegpt_addr* next_usable;
+ struct delegpt_addr* next_target;
+ int attempts;
+ int sel_rtt;
+ int bogus;
+ int lame;
+};
+
+struct delegpt {
+ int namelabs;
+ struct delegpt_ns* nslist;
+ struct delegpt_addr* target_list;
+ struct delegpt_addr* usable_list;
+ struct delegpt_addr* result_list;
+ int bogus;
+ uint8_t has_parent_side_NS;
+ uint8_t dp_type_mlc;
+};
+
+
+%inline %{
+ PyObject* _get_dp_dname(struct delegpt* dp) {
+ return PyBytes_FromStringAndSize((char*)dp->name, dp->namelen);
+ }
+ PyObject* _get_dp_dname_components(struct delegpt* dp) {
+ return GetNameAsLabelList((char*)dp->name, dp->namelen);
+ }
+ PyObject* _get_dpns_dname(struct delegpt_ns* dpns) {
+ return PyBytes_FromStringAndSize((char*)dpns->name, dpns->namelen);
+ }
+ PyObject* _get_dpns_dname_components(struct delegpt_ns* dpns) {
+ return GetNameAsLabelList((char*)dpns->name, dpns->namelen);
+ }
+
+ PyObject* _delegpt_addr_addr_get(struct delegpt_addr* target) {
+ char dest[64];
+ delegpt_addr_addr2str(target, dest, 64);
+ if (dest[0] == 0)
+ return Py_None;
+ return PyBytes_FromString(dest);
+ }
+
+%}
+
+%extend delegpt {
+ %pythoncode %{
+ __swig_getmethods__["dname"] = _unboundmodule._get_dp_dname
+ if _newclass:dname = _swig_property(_unboundmodule._get_dp_dname)
+
+ __swig_getmethods__["dname_list"] = _unboundmodule._get_dp_dname_components
+ if _newclass:dname_list = _swig_property(_unboundmodule._get_dp_dname_components)
+
+ def _get_dname_str(self): return dnameAsStr(self.dname)
+ __swig_getmethods__["dname_str"] = _get_dname_str
+ if _newclass:dname_str = _swig_property(_get_dname_str)
+ %}
+}
+%extend delegpt_ns {
+ %pythoncode %{
+ __swig_getmethods__["dname"] = _unboundmodule._get_dpns_dname
+ if _newclass:dname = _swig_property(_unboundmodule._get_dpns_dname)
+
+ __swig_getmethods__["dname_list"] = _unboundmodule._get_dpns_dname_components
+ if _newclass:dname_list = _swig_property(_unboundmodule._get_dpns_dname_components)
+
+ def _get_dname_str(self): return dnameAsStr(self.dname)
+ __swig_getmethods__["dname_str"] = _get_dname_str
+ if _newclass:dname_str = _swig_property(_get_dname_str)
+ %}
+}
+%extend delegpt_addr {
+ %pythoncode %{
+ def _addr_get(self): return _delegpt_addr_addr_get(self)
+ __swig_getmethods__["addr"] = _addr_get
+ if _newclass:addr = _swig_property(_addr_get)
+ %}
+}
+
/* ************************************************************************************ *
Enums
* ************************************************************************************ */
for (i=0; i < PyList_Size(l); i++)
{
item = PyList_GetItem(l, i);
- if (!PyString_Check(item))
+ if (!PyBytes_Check(item))
return 0;
}
return 1;
len = sldns_buffer_remaining(qb);
if(qsec) {
- if(sldns_str2wire_rr_question_buf(PyString_AsString(item),
+ if(sldns_str2wire_rr_question_buf(PyBytes_AsString(item),
sldns_buffer_current(qb), &len, NULL, NULL, 0, NULL, 0)
!= 0)
return 0;
} else {
- if(sldns_str2wire_rr_buf(PyString_AsString(item),
+ if(sldns_str2wire_rr_buf(PyBytes_AsString(item),
sldns_buffer_current(qb), &len, NULL, default_ttl,
NULL, 0, NULL, 0) != 0)
return 0;
return status
%}
+/* ************************************************************************************ *
+ ASN: Delegation pointer related functions
+ * ************************************************************************************ */
+
+/* Functions which we will need to lookup delegations */
+struct delegpt* dns_cache_find_delegation(struct module_env* env,
+ uint8_t* qname, size_t qnamelen, uint16_t qtype, uint16_t qclass,
+ struct regional* region, struct dns_msg** msg, uint32_t timenow);
+int iter_dp_is_useless(struct query_info* qinfo, uint16_t qflags,
+ struct delegpt* dp);
+struct iter_hints_stub* hints_lookup_stub(struct iter_hints* hints,
+ uint8_t* qname, uint16_t qclass, struct delegpt* dp);
+
+/* Custom function to perform logic similar to the one in daemon/cachedump.c */
+struct delegpt* find_delegation(struct module_qstate* qstate, char *nm, size_t nmlen);
+
+%{
+#define BIT_RD 0x100
+
+struct delegpt* find_delegation(struct module_qstate* qstate, char *nm, size_t nmlen)
+{
+ struct delegpt *dp;
+ struct dns_msg *msg = NULL;
+ struct regional* region = qstate->env->scratch;
+ char b[260];
+ struct query_info qinfo;
+ struct iter_hints_stub* stub;
+ uint32_t timenow = *qstate->env->now;
+
+ regional_free_all(region);
+ qinfo.qname = (uint8_t*)nm;
+ qinfo.qname_len = nmlen;
+ qinfo.qtype = LDNS_RR_TYPE_A;
+ qinfo.qclass = LDNS_RR_CLASS_IN;
+
+ while(1) {
+ dp = dns_cache_find_delegation(qstate->env, (uint8_t*)nm, nmlen, qinfo.qtype, qinfo.qclass, region, &msg, timenow);
+ if(!dp)
+ return NULL;
+ if(iter_dp_is_useless(&qinfo, BIT_RD, dp)) {
+ if (dname_is_root((uint8_t*)nm))
+ return NULL;
+ nm = (char*)dp->name;
+ nmlen = dp->namelen;
+ dname_remove_label((uint8_t**)&nm, &nmlen);
+ dname_str((uint8_t*)nm, b);
+ continue;
+ }
+ stub = hints_lookup_stub(qstate->env->hints, qinfo.qname, qinfo.qclass, dp);
+ if (stub) {
+ return stub->dp;
+ } else {
+ return dp;
+ }
+ }
+ return NULL;
+}
+%}
+
/* ************************************************************************************ *
Functions
* ************************************************************************************ */
#endif
#include "config.h"
-#include "ldns/sbuffer.h"
+#include "sldns/sbuffer.h"
#undef _POSIX_C_SOURCE
#undef _XOPEN_SOURCE
/* Initialize Python libraries */
if (!Py_IsInitialized())
{
- Py_SetProgramName("unbound");
+#if PY_MAJOR_VERSION >= 3
+ wchar_t progname[8];
+ mbstowcs(progname, "unbound", 8);
+#else
+ char *progname = "unbound";
+#endif
+ Py_SetProgramName(progname);
Py_NoSiteFlag = 1;
Py_Initialize();
PyEval_InitThreads();
#include "util/data/msgreply.h"
#include "util/storage/slabhash.h"
#include "util/regional.h"
-#include "ldns/sbuffer.h"
+#include "iterator/iter_delegpt.h"
+#include "sldns/sbuffer.h"
#undef _POSIX_C_SOURCE
#undef _XOPEN_SOURCE
}
return dns_cache_store(qstate->env, qinfo, msgrep, is_referral,
- qstate->prefetch_leeway, 0, NULL);
+ qstate->prefetch_leeway, 0, NULL, qstate->query_flags);
}
/* Invalidate the message associated with query_info stored in message cache */
struct reply_info *r;
size_t i, j;
- h = query_info_hash(qinfo);
+ h = query_info_hash(qinfo, qstate->query_flags);
if ((e=slabhash_lookup(qstate->env->msg_cache, h, qinfo, 0)))
{
r = (struct reply_info*)(e->data);
return;
dest[maxlen-1] = 0;
}
+
+/* Convert target->addr to string */
+void delegpt_addr_addr2str(struct delegpt_addr* target, char *dest, int maxlen)
+{
+ int af = (int)((struct sockaddr_in*) &(target->addr))->sin_family;
+ void* sinaddr = &((struct sockaddr_in*) &(target->addr))->sin_addr;
+
+ if(af == AF_INET6)
+ sinaddr = &((struct sockaddr_in6*)&(target->addr))->sin6_addr;
+ dest[0] = 0;
+ if (inet_ntop(af, sinaddr, dest, (socklen_t)maxlen) == 0)
+ return;
+ dest[maxlen-1] = 0;
+}
#define PYTHONMOD_UTILS_H
#include "util/module.h"
+struct delegpt_addr;
/**
* Store the reply_info and query_info pair in message cache (qstate->msg_cache)
*/
void reply_addr2str(struct comm_reply* reply, char* dest, int maxlen);
+/* Convert target->addr to string */
+void delegpt_addr_addr2str(struct delegpt_addr* target, char *dest, int maxlen);
+
#endif /* PYTHONMOD_UTILS_H */
#include "util/net_help.h"
#include "util/regional.h"
#include "util/config_file.h"
-#include "ldns/sbuffer.h"
+#include "sldns/sbuffer.h"
/** store rrsets in the rrset cache.
* @param env: module environment with caches.
/** lookup message in message cache */
static struct msgreply_entry*
msg_cache_lookup(struct module_env* env, uint8_t* qname, size_t qnamelen,
- uint16_t qtype, uint16_t qclass, time_t now, int wr)
+ uint16_t qtype, uint16_t qclass, uint16_t flags, time_t now, int wr)
{
struct lruhash_entry* e;
struct query_info k;
k.qname_len = qnamelen;
k.qtype = qtype;
k.qclass = qclass;
- h = query_info_hash(&k);
+ h = query_info_hash(&k, flags);
e = slabhash_lookup(env->msg_cache, h, &k, wr);
if(!e) return NULL;
addr_to_additional(akey, region, *msg, now);
lock_rw_unlock(&akey->entry.lock);
} else {
+ /* BIT_CD on false because delegpt lookup does
+ * not use dns64 translation */
neg = msg_cache_lookup(env, ns->name, ns->namelen,
- LDNS_RR_TYPE_A, qclass, now, 0);
+ LDNS_RR_TYPE_A, qclass, 0, now, 0);
if(neg) {
delegpt_add_neg_msg(dp, neg);
lock_rw_unlock(&neg->entry.lock);
addr_to_additional(akey, region, *msg, now);
lock_rw_unlock(&akey->entry.lock);
} else {
+ /* BIT_CD on false because delegpt lookup does
+ * not use dns64 translation */
neg = msg_cache_lookup(env, ns->name, ns->namelen,
- LDNS_RR_TYPE_AAAA, qclass, now, 0);
+ LDNS_RR_TYPE_AAAA, qclass, 0, now, 0);
if(neg) {
delegpt_add_neg_msg(dp, neg);
lock_rw_unlock(&neg->entry.lock);
ns->name, LDNS_RR_TYPE_A, qclass);
lock_rw_unlock(&akey->entry.lock);
} else {
+ /* BIT_CD on false because delegpt lookup does
+ * not use dns64 translation */
neg = msg_cache_lookup(env, ns->name, ns->namelen,
- LDNS_RR_TYPE_A, qclass, now, 0);
+ LDNS_RR_TYPE_A, qclass, 0, now, 0);
if(neg) {
delegpt_add_neg_msg(dp, neg);
lock_rw_unlock(&neg->entry.lock);
ns->name, LDNS_RR_TYPE_AAAA, qclass);
lock_rw_unlock(&akey->entry.lock);
} else {
+ /* BIT_CD on false because delegpt lookup does
+ * not use dns64 translation */
neg = msg_cache_lookup(env, ns->name, ns->namelen,
- LDNS_RR_TYPE_AAAA, qclass, now, 0);
+ LDNS_RR_TYPE_AAAA, qclass, 0, now, 0);
if(neg) {
delegpt_add_neg_msg(dp, neg);
lock_rw_unlock(&neg->entry.lock);
sizeof(struct reply_info)-sizeof(struct rrset_ref));
if(!msg->rep)
return NULL;
+ if(capacity > RR_COUNT_MAX)
+ return NULL; /* integer overflow protection */
msg->rep->flags = BIT_QR; /* with QR, no AA */
msg->rep->qdcount = 1;
msg->rep->rrsets = (struct ub_packed_rrset_key**)
return 1;
}
+/** add rrset to answer section */
+static int
+dns_msg_ansadd(struct dns_msg* msg, struct regional* region,
+ struct ub_packed_rrset_key* rrset, time_t now)
+{
+ if(!(msg->rep->rrsets[msg->rep->rrset_count++] =
+ packed_rrset_copy_region(rrset, region, now)))
+ return 0;
+ msg->rep->an_numrrsets++;
+ return 1;
+}
+
struct delegpt*
dns_cache_find_delegation(struct module_env* env, uint8_t* qname,
size_t qnamelen, uint16_t qtype, uint16_t qclass,
sizeof(struct reply_info) - sizeof(struct rrset_ref));
if(!msg->rep)
return NULL;
+ if(num > RR_COUNT_MAX)
+ return NULL; /* integer overflow protection */
msg->rep->rrsets = (struct ub_packed_rrset_key**)
regional_alloc(region,
num * sizeof(struct ub_packed_rrset_key*));
return msg;
}
+/** Fill TYPE_ANY response with some data from cache */
+static struct dns_msg*
+fill_any(struct module_env* env,
+ uint8_t* qname, size_t qnamelen, uint16_t qtype, uint16_t qclass,
+ struct regional* region)
+{
+ time_t now = *env->now;
+ struct dns_msg* msg = NULL;
+ uint16_t lookup[] = {LDNS_RR_TYPE_A, LDNS_RR_TYPE_AAAA,
+ LDNS_RR_TYPE_MX, LDNS_RR_TYPE_SOA, LDNS_RR_TYPE_NS, 0};
+ int i, num=5; /* number of RR types to look up */
+ log_assert(lookup[num] == 0);
+
+ for(i=0; i<num; i++) {
+ /* look up this RR for inclusion in type ANY response */
+ struct ub_packed_rrset_key* rrset = rrset_cache_lookup(
+ env->rrset_cache, qname, qnamelen, lookup[i],
+ qclass, 0, now, 0);
+ struct packed_rrset_data *d;
+ if(!rrset)
+ continue;
+
+ /* only if rrset from answer section */
+ d = (struct packed_rrset_data*)rrset->entry.data;
+ if(d->trust == rrset_trust_add_noAA ||
+ d->trust == rrset_trust_auth_noAA ||
+ d->trust == rrset_trust_add_AA ||
+ d->trust == rrset_trust_auth_AA) {
+ lock_rw_unlock(&rrset->entry.lock);
+ continue;
+ }
+
+ /* create msg if none */
+ if(!msg) {
+ msg = dns_msg_create(qname, qnamelen, qtype, qclass,
+ region, (size_t)(num-i));
+ if(!msg) {
+ lock_rw_unlock(&rrset->entry.lock);
+ return NULL;
+ }
+ }
+
+ /* add RRset to response */
+ if(!dns_msg_ansadd(msg, region, rrset, now)) {
+ lock_rw_unlock(&rrset->entry.lock);
+ return NULL;
+ }
+ lock_rw_unlock(&rrset->entry.lock);
+ }
+ return msg;
+}
+
struct dns_msg*
dns_cache_lookup(struct module_env* env,
uint8_t* qname, size_t qnamelen, uint16_t qtype, uint16_t qclass,
- struct regional* region, struct regional* scratch)
+ uint16_t flags, struct regional* region, struct regional* scratch)
{
struct lruhash_entry* e;
struct query_info k;
k.qname_len = qnamelen;
k.qtype = qtype;
k.qclass = qclass;
- h = query_info_hash(&k);
+ h = query_info_hash(&k, flags);
e = slabhash_lookup(env->msg_cache, h, &k, 0);
if(e) {
struct msgreply_entry* key = (struct msgreply_entry*)e->key;
if(env->cfg->harden_below_nxdomain)
while(!dname_is_root(k.qname)) {
dname_remove_label(&k.qname, &k.qname_len);
- h = query_info_hash(&k);
+ h = query_info_hash(&k, flags);
e = slabhash_lookup(env->msg_cache, h, &k, 0);
if(e) {
struct reply_info* data = (struct reply_info*)e->data;
}
}
+ /* fill common RR types for ANY response to avoid requery */
+ if(qtype == LDNS_RR_TYPE_ANY) {
+ return fill_any(env, qname, qnamelen, qtype, qclass, region);
+ }
+
return NULL;
}
int
dns_cache_store(struct module_env* env, struct query_info* msgqinf,
struct reply_info* msgrep, int is_referral, time_t leeway, int pside,
- struct regional* region)
+ struct regional* region, uint16_t flags)
{
struct reply_info* rep = NULL;
/* alloc, malloc properly (not in region, like msg is) */
* Not AA from cache. Not CD in cache (depends on client bit). */
rep->flags |= (BIT_RA | BIT_QR);
rep->flags &= ~(BIT_AA | BIT_CD);
- h = query_info_hash(&qinf);
+ h = query_info_hash(&qinf, flags);
dns_cache_store_msg(env, &qinf, h, rep, leeway, pside, msgrep,
region);
/* qname is used inside query_info_entrysetup, and set to
int
dns_cache_prefetch_adjust(struct module_env* env, struct query_info* qinfo,
- time_t adjust)
+ time_t adjust, uint16_t flags)
{
struct msgreply_entry* msg;
msg = msg_cache_lookup(env, qinfo->qname, qinfo->qname_len,
- qinfo->qtype, qinfo->qclass, *env->now, 1);
+ qinfo->qtype, qinfo->qclass, flags, *env->now, 1);
if(msg) {
struct reply_info* rep = (struct reply_info*)msg->entry.data;
if(rep) {
* can be updated to full TTL even in prefetch situations.
* @param region: region to allocate better entries from cache into.
* (used when is_referral is false).
+ * @param flags: flags with BIT_CD for AAAA queries in dns64 translation.
* @return 0 on alloc error (out of memory).
*/
int dns_cache_store(struct module_env* env, struct query_info* qinf,
struct reply_info* rep, int is_referral, time_t leeway, int pside,
- struct regional* region);
+ struct regional* region, uint16_t flags);
/**
* Store message in the cache. Stores in message cache and rrset cache.
struct reply_info* r, struct regional* region, time_t now,
struct regional* scratch);
#endif
-
/**
* Find cached message
* @param env: module environment with the DNS cache.
* @param qnamelen: length of qname.
* @param qtype: query type.
* @param qclass: query class.
+ * @param flags: flags with BIT_CD for AAAA queries in dns64 translation.
* @param region: where to allocate result.
* @param scratch: where to allocate temporary data.
* @return new response message (alloced in region, rrsets do not have IDs).
*/
struct dns_msg* dns_cache_lookup(struct module_env* env,
uint8_t* qname, size_t qnamelen, uint16_t qtype, uint16_t qclass,
- struct regional* region, struct regional* scratch);
+ uint16_t flags, struct regional* region, struct regional* scratch);
/**
* find and add A and AAAA records for missing nameservers in delegpt
* @param env: module environment with caches and time.
* @param qinfo: query info for the query that needs adjustment.
* @param adjust: time in seconds to add to the prefetch_leeway.
+ * @param flags: flags with BIT_CD for AAAA queries in dns64 translation.
* @return false if not in cache. true if added.
*/
int dns_cache_prefetch_adjust(struct module_env* env, struct query_info* qinfo,
- time_t adjust);
+ time_t adjust, uint16_t flags);
#endif /* SERVICES_CACHE_DNS_H */
* This file contains the infrastructure cache.
*/
#include "config.h"
-#include "ldns/rrdef.h"
+#include "sldns/rrdef.h"
+#include "sldns/str2wire.h"
#include "services/cache/infra.h"
#include "util/storage/slabhash.h"
#include "util/storage/lookup3.h"
* can do this number of packets (until those all timeout too) */
#define TIMEOUT_COUNT_MAX 3
+/** ratelimit value for delegation point */
+int infra_dp_ratelimit = 0;
+
size_t
infra_sizefunc(void* k, void* ATTR_UNUSED(d))
{
free(data);
}
+size_t
+rate_sizefunc(void* k, void* ATTR_UNUSED(d))
+{
+ struct rate_key* key = (struct rate_key*)k;
+ return sizeof(*key) + sizeof(struct rate_data) + key->namelen
+ + lock_get_mem(&key->entry.lock);
+}
+
+int
+rate_compfunc(void* key1, void* key2)
+{
+ struct rate_key* k1 = (struct rate_key*)key1;
+ struct rate_key* k2 = (struct rate_key*)key2;
+ if(k1->namelen != k2->namelen) {
+ if(k1->namelen < k2->namelen)
+ return -1;
+ return 1;
+ }
+ return query_dname_compare(k1->name, k2->name);
+}
+
+void
+rate_delkeyfunc(void* k, void* ATTR_UNUSED(arg))
+{
+ struct rate_key* key = (struct rate_key*)k;
+ if(!key)
+ return;
+ lock_rw_destroy(&key->entry.lock);
+ free(key->name);
+ free(key);
+}
+
+void
+rate_deldatafunc(void* d, void* ATTR_UNUSED(arg))
+{
+ struct rate_data* data = (struct rate_data*)d;
+ free(data);
+}
+
+/** find or create element in domainlimit tree */
+static struct domain_limit_data* domain_limit_findcreate(
+ struct infra_cache* infra, char* name)
+{
+ uint8_t* nm;
+ int labs;
+ size_t nmlen;
+ struct domain_limit_data* d;
+
+ /* parse name */
+ nm = sldns_str2wire_dname(name, &nmlen);
+ if(!nm) {
+ log_err("could not parse %s", name);
+ return NULL;
+ }
+ labs = dname_count_labels(nm);
+
+ /* can we find it? */
+ d = (struct domain_limit_data*)name_tree_find(&infra->domain_limits,
+ nm, nmlen, labs, LDNS_RR_CLASS_IN);
+ if(d) {
+ free(nm);
+ return d;
+ }
+
+ /* create it */
+ d = (struct domain_limit_data*)calloc(1, sizeof(*d));
+ if(!d) {
+ free(nm);
+ return NULL;
+ }
+ d->node.node.key = &d->node;
+ d->node.name = nm;
+ d->node.len = nmlen;
+ d->node.labs = labs;
+ d->node.dclass = LDNS_RR_CLASS_IN;
+ d->lim = -1;
+ d->below = -1;
+ if(!name_tree_insert(&infra->domain_limits, &d->node, nm, nmlen,
+ labs, LDNS_RR_CLASS_IN)) {
+ log_err("duplicate element in domainlimit tree");
+ free(nm);
+ free(d);
+ return NULL;
+ }
+ return d;
+}
+
+/** insert rate limit configuration into lookup tree */
+static int infra_ratelimit_cfg_insert(struct infra_cache* infra,
+ struct config_file* cfg)
+{
+ struct config_str2list* p;
+ struct domain_limit_data* d;
+ for(p = cfg->ratelimit_for_domain; p; p = p->next) {
+ d = domain_limit_findcreate(infra, p->str);
+ if(!d)
+ return 0;
+ d->lim = atoi(p->str2);
+ }
+ for(p = cfg->ratelimit_below_domain; p; p = p->next) {
+ d = domain_limit_findcreate(infra, p->str);
+ if(!d)
+ return 0;
+ d->below = atoi(p->str2);
+ }
+ return 1;
+}
+
struct infra_cache*
infra_create(struct config_file* cfg)
{
return NULL;
}
infra->host_ttl = cfg->host_ttl;
+ name_tree_init(&infra->domain_limits);
+ infra_dp_ratelimit = cfg->ratelimit;
+ if(cfg->ratelimit != 0) {
+ infra->domain_rates = slabhash_create(cfg->ratelimit_slabs,
+ INFRA_HOST_STARTSIZE, cfg->ratelimit_size,
+ &rate_sizefunc, &rate_compfunc, &rate_delkeyfunc,
+ &rate_deldatafunc, NULL);
+ if(!infra->domain_rates) {
+ infra_delete(infra);
+ return NULL;
+ }
+ /* insert config data into ratelimits */
+ if(!infra_ratelimit_cfg_insert(infra, cfg)) {
+ infra_delete(infra);
+ return NULL;
+ }
+ name_tree_init_parents(&infra->domain_limits);
+ }
return infra;
}
+/** delete domain_limit entries */
+static void domain_limit_free(rbnode_t* n, void* ATTR_UNUSED(arg))
+{
+ if(n) {
+ free(((struct domain_limit_data*)n)->node.name);
+ free(n);
+ }
+}
+
void
infra_delete(struct infra_cache* infra)
{
if(!infra)
return;
slabhash_delete(infra->hosts);
+ slabhash_delete(infra->domain_rates);
+ traverse_postorder(&infra->domain_limits, domain_limit_free, NULL);
free(infra);
}
return 1;
}
+int infra_find_ratelimit(struct infra_cache* infra, uint8_t* name,
+ size_t namelen)
+{
+ int labs = dname_count_labels(name);
+ struct domain_limit_data* d = (struct domain_limit_data*)
+ name_tree_lookup(&infra->domain_limits, name, namelen, labs,
+ LDNS_RR_CLASS_IN);
+ if(!d) return infra_dp_ratelimit;
+
+ if(d->node.labs == labs && d->lim != -1)
+ return d->lim; /* exact match */
+
+ /* find 'below match' */
+ if(d->node.labs == labs)
+ d = (struct domain_limit_data*)d->node.parent;
+ while(d) {
+ if(d->below != -1)
+ return d->below;
+ d = (struct domain_limit_data*)d->node.parent;
+ }
+ return infra_dp_ratelimit;
+}
+
+/** find data item in array, for write access, caller unlocks */
+static struct lruhash_entry* infra_find_ratedata(struct infra_cache* infra,
+ uint8_t* name, size_t namelen, int wr)
+{
+ struct rate_key key;
+ hashvalue_t h = dname_query_hash(name, 0xab);
+ memset(&key, 0, sizeof(key));
+ key.name = name;
+ key.namelen = namelen;
+ key.entry.hash = h;
+ return slabhash_lookup(infra->domain_rates, h, &key, wr);
+}
+
+/** create rate data item for name, number 1 in now */
+static void infra_create_ratedata(struct infra_cache* infra,
+ uint8_t* name, size_t namelen, time_t timenow)
+{
+ hashvalue_t h = dname_query_hash(name, 0xab);
+ struct rate_key* k = (struct rate_key*)calloc(1, sizeof(*k));
+ struct rate_data* d = (struct rate_data*)calloc(1, sizeof(*d));
+ if(!k || !d) {
+ free(k);
+ free(d);
+ return; /* alloc failure */
+ }
+ k->namelen = namelen;
+ k->name = memdup(name, namelen);
+ if(!k->name) {
+ free(k);
+ free(d);
+ return; /* alloc failure */
+ }
+ lock_rw_init(&k->entry.lock);
+ k->entry.hash = h;
+ k->entry.key = k;
+ k->entry.data = d;
+ d->qps[0] = 1;
+ d->timestamp[0] = timenow;
+ slabhash_insert(infra->domain_rates, h, &k->entry, d, NULL);
+}
+
+/** find the second and return its rate counter, if none, remove oldest */
+static int* infra_rate_find_second(void* data, time_t t)
+{
+ struct rate_data* d = (struct rate_data*)data;
+ int i, oldest;
+ for(i=0; i<RATE_WINDOW; i++) {
+ if(d->timestamp[i] == t)
+ return &(d->qps[i]);
+ }
+ /* remove oldest timestamp, and insert it at t with 0 qps */
+ oldest = 0;
+ for(i=0; i<RATE_WINDOW; i++) {
+ if(d->timestamp[i] < d->timestamp[oldest])
+ oldest = i;
+ }
+ d->timestamp[oldest] = t;
+ d->qps[oldest] = 0;
+ return &(d->qps[oldest]);
+}
+
+int infra_rate_max(void* data, time_t now)
+{
+ struct rate_data* d = (struct rate_data*)data;
+ int i, max = 0;
+ for(i=0; i<RATE_WINDOW; i++) {
+ if(now-d->timestamp[i] <= RATE_WINDOW) {
+ if(d->qps[i] > max)
+ max = d->qps[i];
+ }
+ }
+ return max;
+}
+
+int infra_ratelimit_inc(struct infra_cache* infra, uint8_t* name,
+ size_t namelen, time_t timenow)
+{
+ int lim, max;
+ struct lruhash_entry* entry;
+
+ if(!infra_dp_ratelimit)
+ return 1; /* not enabled */
+
+ /* find ratelimit */
+ lim = infra_find_ratelimit(infra, name, namelen);
+
+ /* find or insert ratedata */
+ entry = infra_find_ratedata(infra, name, namelen, 1);
+ if(entry) {
+ int premax = infra_rate_max(entry->data, timenow);
+ int* cur = infra_rate_find_second(entry->data, timenow);
+ (*cur)++;
+ max = infra_rate_max(entry->data, timenow);
+ lock_rw_unlock(&entry->lock);
+
+ if(premax < lim && max >= lim) {
+ char buf[257];
+ dname_str(name, buf);
+ verbose(VERB_OPS, "ratelimit exceeded %s %d", buf, lim);
+ }
+ return (max < lim);
+ }
+
+ /* create */
+ infra_create_ratedata(infra, name, namelen, timenow);
+ return (1 < lim);
+}
+
+void infra_ratelimit_dec(struct infra_cache* infra, uint8_t* name,
+ size_t namelen, time_t timenow)
+{
+ struct lruhash_entry* entry;
+ int* cur;
+ if(!infra_dp_ratelimit)
+ return; /* not enabled */
+ entry = infra_find_ratedata(infra, name, namelen, 1);
+ if(!entry) return; /* not cached */
+ cur = infra_rate_find_second(entry->data, timenow);
+ if((*cur) > 0)
+ (*cur)--;
+ lock_rw_unlock(&entry->lock);
+}
+
+int infra_ratelimit_exceeded(struct infra_cache* infra, uint8_t* name,
+ size_t namelen, time_t timenow)
+{
+ struct lruhash_entry* entry;
+ int lim, max;
+ if(!infra_dp_ratelimit)
+ return 0; /* not enabled */
+
+ /* find ratelimit */
+ lim = infra_find_ratelimit(infra, name, namelen);
+
+ /* find current rate */
+ entry = infra_find_ratedata(infra, name, namelen, 0);
+ if(!entry)
+ return 0; /* not cached */
+ max = infra_rate_max(entry->data, timenow);
+ lock_rw_unlock(&entry->lock);
+
+ return (max >= lim);
+}
+
size_t
infra_get_mem(struct infra_cache* infra)
{
- return sizeof(*infra) + slabhash_get_mem(infra->hosts);
+ size_t s = sizeof(*infra) + slabhash_get_mem(infra->hosts);
+ if(infra->domain_rates) s += slabhash_get_mem(infra->domain_rates);
+ /* ignore domain_limits because walk through tree is big */
+ return s;
}
#ifndef SERVICES_CACHE_INFRA_H
#define SERVICES_CACHE_INFRA_H
#include "util/storage/lruhash.h"
+#include "util/storage/dnstree.h"
#include "util/rtt.h"
struct slabhash;
struct config_file;
struct slabhash* hosts;
/** TTL value for host information, in seconds */
int host_ttl;
+ /** hash table with query rates per name: rate_key, rate_data */
+ struct slabhash* domain_rates;
+ /** ratelimit settings for domains, struct domain_limit_data */
+ rbtree_t domain_limits;
+};
+
+/** ratelimit, unless overridden by domain_limits, 0 is off */
+extern int infra_dp_ratelimit;
+
+/**
+ * ratelimit settings for domains
+ */
+struct domain_limit_data {
+ /** key for rbtree, must be first in struct, name of domain */
+ struct name_tree_node node;
+ /** ratelimit for exact match with this name, -1 if not set */
+ int lim;
+ /** ratelimit for names below this name, -1 if not set */
+ int below;
+};
+
+/**
+ * key for ratelimit lookups, a domain name
+ */
+struct rate_key {
+ /** lruhash key entry */
+ struct lruhash_entry entry;
+ /** domain name in uncompressed wireformat */
+ uint8_t* name;
+ /** length of name */
+ size_t namelen;
+};
+
+/** number of seconds to track qps rate */
+#define RATE_WINDOW 2
+
+/**
+ * Data for ratelimits per domain name
+ * It is incremented when a non-cache-lookup happens for that domain name.
+ * The name is the delegation point we have for the name.
+ * If a new delegation point is found (a referral reply), the previous
+ * delegation point is decremented, and the new one is charged with the query.
+ */
+struct rate_data {
+ /** queries counted, for that second. 0 if not in use. */
+ int qps[RATE_WINDOW];
+ /** what the timestamp is of the qps array members, counter is
+ * valid for that timestamp. Usually now and now-1. */
+ time_t timestamp[RATE_WINDOW];
};
/** infra host cache default hash lookup size */
size_t namelen, struct rtt_info* rtt, int* delay, time_t timenow,
int* tA, int* tAAAA, int* tother);
+/**
+ * Increment the query rate counter for a delegation point.
+ * @param infra: infra cache.
+ * @param name: zone name
+ * @param namelen: zone name length
+ * @param timenow: what time it is now.
+ * @return 1 if it could be incremented. 0 if the increment overshot the
+ * ratelimit or if in the previous second the ratelimit was exceeded.
+ * Failures like alloc failures are not returned (probably as 1).
+ */
+int infra_ratelimit_inc(struct infra_cache* infra, uint8_t* name,
+ size_t namelen, time_t timenow);
+
+/**
+ * Decrement the query rate counter for a delegation point.
+ * Because the reply received for the delegation point was pleasant,
+ * we do not charge this delegation point with it (i.e. it was a referral).
+ * Should call it with same second as when inc() was called.
+ * @param infra: infra cache.
+ * @param name: zone name
+ * @param namelen: zone name length
+ * @param timenow: what time it is now.
+ */
+void infra_ratelimit_dec(struct infra_cache* infra, uint8_t* name,
+ size_t namelen, time_t timenow);
+
+/**
+ * See if the query rate counter for a delegation point is exceeded.
+ * So, no queries are going to be allowed.
+ * @param infra: infra cache.
+ * @param name: zone name
+ * @param namelen: zone name length
+ * @param timenow: what time it is now.
+ * @return true if exceeded.
+ */
+int infra_ratelimit_exceeded(struct infra_cache* infra, uint8_t* name,
+ size_t namelen, time_t timenow);
+
+/** find the maximum rate stored, not too old. 0 if no information. */
+int infra_rate_max(void* data, time_t now);
+
+/** find the ratelimit in qps for a domain */
+int infra_find_ratelimit(struct infra_cache* infra, uint8_t* name,
+ size_t namelen);
+
/**
* Get memory used by the infra cache.
* @param infra: infrastructure cache.
/** delete data and destroy the lameness hashtable */
void infra_deldatafunc(void* d, void* arg);
+/** calculate size for the hashtable */
+size_t rate_sizefunc(void* k, void* d);
+
+/** compare two names, returns -1, 0, or +1 */
+int rate_compfunc(void* key1, void* key2);
+
+/** delete key, and destroy the lock */
+void rate_delkeyfunc(void* k, void* arg);
+
+/** delete data */
+void rate_deldatafunc(void* d, void* arg);
+
#endif /* SERVICES_CACHE_INFRA_H */
*/
#include "config.h"
#include "services/cache/rrset.h"
-#include "ldns/rrdef.h"
+#include "sldns/rrdef.h"
#include "util/storage/slabhash.h"
#include "util/config_file.h"
#include "util/data/packed_rrset.h"
{
hashvalue_t* h;
size_t i;
- if(!(h = (hashvalue_t*)regional_alloc(scratch,
- sizeof(hashvalue_t)*count)))
+ if(count > RR_COUNT_MAX || !(h = (hashvalue_t*)regional_alloc(scratch,
+ sizeof(hashvalue_t)*count))) {
log_warn("rrset LRU: memory allocation failed");
- else /* store hash values */
+ h = NULL;
+ } else /* store hash values */
for(i=0; i<count; i++)
h[i] = ref[i].key->entry.hash;
/* unlock */
#include "util/log.h"
#include "util/config_file.h"
#include "util/net_help.h"
-#include "ldns/sbuffer.h"
+#include "sldns/sbuffer.h"
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
#include <fcntl.h>
+#ifdef HAVE_SYS_UN_H
+#include <sys/un.h>
+#endif
+
/** number of queued TCP connections for listen() */
-#define TCP_BACKLOG 5
+#define TCP_BACKLOG 256
/**
* Debug print of the getaddrinfo returned address.
int
create_udp_sock(int family, int socktype, struct sockaddr* addr,
socklen_t addrlen, int v6only, int* inuse, int* noproto,
- int rcv, int snd, int listen, int* reuseport)
+ int rcv, int snd, int listen, int* reuseport, int transparent)
{
int s;
-#if defined(SO_REUSEADDR) || defined(SO_REUSEPORT) || defined(IPV6_USE_MIN_MTU)
+#if defined(SO_REUSEADDR) || defined(SO_REUSEPORT) || defined(IPV6_USE_MIN_MTU) || defined(IP_TRANSPARENT)
int on=1;
#endif
#ifdef IPV6_MTU
#endif
#ifndef IPV6_V6ONLY
(void)v6only;
+#endif
+#ifndef IP_TRANSPARENT
+ (void)transparent;
#endif
if((s = socket(family, socktype, 0)) == -1) {
*inuse = 0;
#endif
}
#endif /* SO_REUSEADDR */
-#if defined(__linux__) && defined(SO_REUSEPORT)
- /* Linux specific: try to set SO_REUSEPORT so that incoming
+#ifdef SO_REUSEPORT
+ /* try to set SO_REUSEPORT so that incoming
* queries are distributed evenly among the receiving threads.
* Each thread must have its own socket bound to the same port,
* with SO_REUSEPORT set on each socket.
}
#else
(void)reuseport;
-#endif /* defined(__linux__) && defined(SO_REUSEPORT) */
+#endif /* defined(SO_REUSEPORT) */
+#ifdef IP_TRANSPARENT
+ if (transparent &&
+ setsockopt(s, IPPROTO_IP, IP_TRANSPARENT, (void*)&on,
+ (socklen_t)sizeof(on)) < 0) {
+ log_warn("setsockopt(.. IP_TRANSPARENT ..) failed: %s",
+ strerror(errno));
+ }
+#endif /* IP_TRANSPARENT */
}
if(rcv) {
#ifdef SO_RCVBUF
* (and also uses the interface mtu to determine the size of the packets).
* So there won't be any EMSGSIZE error. Against DNS fragmentation attacks.
* FreeBSD already has same semantics without setting the option. */
-# if defined(IP_PMTUDISC_OMIT)
- int action = IP_PMTUDISC_OMIT;
-# else
- int action = IP_PMTUDISC_DONT;
-# endif
+ int omit_set = 0;
+ int action;
+# if defined(IP_PMTUDISC_OMIT)
+ action = IP_PMTUDISC_OMIT;
if (setsockopt(s, IPPROTO_IP, IP_MTU_DISCOVER,
&action, (socklen_t)sizeof(action)) < 0) {
- log_err("setsockopt(..., IP_MTU_DISCOVER, "
-# if defined(IP_PMTUDISC_OMIT)
- "IP_PMTUDISC_OMIT"
+
+ if (errno != EINVAL) {
+ log_err("setsockopt(..., IP_MTU_DISCOVER, IP_PMTUDISC_OMIT...) failed: %s",
+ strerror(errno));
+
+# ifndef USE_WINSOCK
+ close(s);
# else
- "IP_PMTUDISC_DONT"
+ closesocket(s);
# endif
- "...) failed: %s",
- strerror(errno));
+ *noproto = 0;
+ *inuse = 0;
+ return -1;
+ }
+ }
+ else
+ {
+ omit_set = 1;
+ }
+# endif
+ if (omit_set == 0) {
+ action = IP_PMTUDISC_DONT;
+ if (setsockopt(s, IPPROTO_IP, IP_MTU_DISCOVER,
+ &action, (socklen_t)sizeof(action)) < 0) {
+ log_err("setsockopt(..., IP_MTU_DISCOVER, IP_PMTUDISC_DONT...) failed: %s",
+ strerror(errno));
# ifndef USE_WINSOCK
- close(s);
+ close(s);
# else
- closesocket(s);
+ closesocket(s);
# endif
- *noproto = 0;
- *inuse = 0;
- return -1;
+ *noproto = 0;
+ *inuse = 0;
+ return -1;
+ }
}
# elif defined(IP_DONTFRAG)
int off = 0;
int
create_tcp_accept_sock(struct addrinfo *addr, int v6only, int* noproto,
- int* reuseport)
+ int* reuseport, int transparent)
{
int s;
-#if defined(SO_REUSEADDR) || defined(SO_REUSEPORT) || defined(IPV6_V6ONLY)
+#if defined(SO_REUSEADDR) || defined(SO_REUSEPORT) || defined(IPV6_V6ONLY) || defined(IP_TRANSPARENT)
int on = 1;
-#endif /* SO_REUSEADDR || IPV6_V6ONLY */
+#endif
+#ifndef IP_TRANSPARENT
+ (void)transparent;
+#endif
verbose_print_addr(addr);
*noproto = 0;
if((s = socket(addr->ai_family, addr->ai_socktype, 0)) == -1) {
return -1;
}
#endif /* SO_REUSEADDR */
-#if defined(__linux__) && defined(SO_REUSEPORT)
- /* Linux specific: try to set SO_REUSEPORT so that incoming
+#ifdef SO_REUSEPORT
+ /* try to set SO_REUSEPORT so that incoming
* connections are distributed evenly among the receiving threads.
* Each thread must have its own socket bound to the same port,
* with SO_REUSEPORT set on each socket.
}
#else
(void)reuseport;
-#endif /* defined(__linux__) && defined(SO_REUSEPORT) */
+#endif /* defined(SO_REUSEPORT) */
#if defined(IPV6_V6ONLY)
if(addr->ai_family == AF_INET6 && v6only) {
if(setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY,
#else
(void)v6only;
#endif /* IPV6_V6ONLY */
+#ifdef IP_TRANSPARENT
+ if (transparent &&
+ setsockopt(s, IPPROTO_IP, IP_TRANSPARENT, (void*)&on,
+ (socklen_t)sizeof(on)) < 0) {
+ log_warn("setsockopt(.. IP_TRANSPARENT ..) failed: %s",
+ strerror(errno));
+ }
+#endif /* IP_TRANSPARENT */
if(bind(s, addr->ai_addr, addr->ai_addrlen) != 0) {
#ifndef USE_WINSOCK
/* detect freebsd jail with no ipv6 permission */
return s;
}
+int
+create_local_accept_sock(const char *path, int* noproto)
+{
+#ifdef HAVE_SYS_UN_H
+ int s;
+ struct sockaddr_un usock;
+
+ verbose(VERB_ALGO, "creating unix socket %s", path);
+#ifdef HAVE_STRUCT_SOCKADDR_UN_SUN_LEN
+ /* this member exists on BSDs, not Linux */
+ usock.sun_len = (socklen_t)sizeof(usock);
+#endif
+ usock.sun_family = AF_LOCAL;
+ /* length is 92-108, 104 on FreeBSD */
+ (void)strlcpy(usock.sun_path, path, sizeof(usock.sun_path));
+
+ if ((s = socket(AF_LOCAL, SOCK_STREAM, 0)) == -1) {
+ log_err("Cannot create local socket %s (%s)",
+ path, strerror(errno));
+ return -1;
+ }
+
+ if (unlink(path) && errno != ENOENT) {
+ /* The socket already exists and cannot be removed */
+ log_err("Cannot remove old local socket %s (%s)",
+ path, strerror(errno));
+ return -1;
+ }
+
+ if (bind(s, (struct sockaddr *)&usock,
+ (socklen_t)sizeof(struct sockaddr_un)) == -1) {
+ log_err("Cannot bind local socket %s (%s)",
+ path, strerror(errno));
+ return -1;
+ }
+
+ if (!fd_set_nonblock(s)) {
+ log_err("Cannot set non-blocking mode");
+ return -1;
+ }
+
+ if (listen(s, TCP_BACKLOG) == -1) {
+ log_err("can't listen: %s", strerror(errno));
+ return -1;
+ }
+
+ (void)noproto; /*unused*/
+ return s;
+#else
+ (void)path;
+ log_err("Local sockets are not supported");
+ *noproto = 1;
+ return -1;
+#endif
+}
+
+
/**
* Create socket from getaddrinfo results
*/
static int
make_sock(int stype, const char* ifname, const char* port,
struct addrinfo *hints, int v6only, int* noip6, size_t rcv, size_t snd,
- int* reuseport)
+ int* reuseport, int transparent)
{
struct addrinfo *res = NULL;
int r, s, inuse, noproto;
s = create_udp_sock(res->ai_family, res->ai_socktype,
(struct sockaddr*)res->ai_addr, res->ai_addrlen,
v6only, &inuse, &noproto, (int)rcv, (int)snd, 1,
- reuseport);
+ reuseport, transparent);
if(s == -1 && inuse) {
log_err("bind: address already in use");
} else if(s == -1 && noproto && hints->ai_family == AF_INET6){
*noip6 = 1;
}
} else {
- s = create_tcp_accept_sock(res, v6only, &noproto, reuseport);
+ s = create_tcp_accept_sock(res, v6only, &noproto, reuseport,
+ transparent);
if(s == -1 && noproto && hints->ai_family == AF_INET6){
*noip6 = 1;
}
static int
make_sock_port(int stype, const char* ifname, const char* port,
struct addrinfo *hints, int v6only, int* noip6, size_t rcv, size_t snd,
- int* reuseport)
+ int* reuseport, int transparent)
{
char* s = strchr(ifname, '@');
if(s) {
(void)strlcpy(p, s+1, sizeof(p));
p[strlen(s+1)]=0;
return make_sock(stype, newif, p, hints, v6only, noip6,
- rcv, snd, reuseport);
+ rcv, snd, reuseport, transparent);
}
return make_sock(stype, ifname, port, hints, v6only, noip6, rcv, snd,
- reuseport);
+ reuseport, transparent);
}
/**
* @param ssl_port: ssl service port number
* @param reuseport: try to set SO_REUSEPORT if nonNULL and true.
* set to false on exit if reuseport failed due to no kernel support.
+ * @param transparent: set IP_TRANSPARENT socket option.
* @return: returns false on error.
*/
static int
ports_create_if(const char* ifname, int do_auto, int do_udp, int do_tcp,
struct addrinfo *hints, const char* port, struct listen_port** list,
- size_t rcv, size_t snd, int ssl_port, int* reuseport)
+ size_t rcv, size_t snd, int ssl_port, int* reuseport, int transparent)
{
int s, noip6=0;
if(!do_udp && !do_tcp)
return 0;
if(do_auto) {
if((s = make_sock_port(SOCK_DGRAM, ifname, port, hints, 1,
- &noip6, rcv, snd, reuseport)) == -1) {
+ &noip6, rcv, snd, reuseport, transparent)) == -1) {
if(noip6) {
log_warn("IPv6 protocol not available");
return 1;
} else if(do_udp) {
/* regular udp socket */
if((s = make_sock_port(SOCK_DGRAM, ifname, port, hints, 1,
- &noip6, rcv, snd, reuseport)) == -1) {
+ &noip6, rcv, snd, reuseport, transparent)) == -1) {
if(noip6) {
log_warn("IPv6 protocol not available");
return 1;
atoi(strchr(ifname, '@')+1) == ssl_port) ||
(!strchr(ifname, '@') && atoi(port) == ssl_port));
if((s = make_sock_port(SOCK_STREAM, ifname, port, hints, 1,
- &noip6, 0, 0, reuseport)) == -1) {
+ &noip6, 0, 0, reuseport, transparent)) == -1) {
if(noip6) {
/*log_warn("IPv6 protocol not available");*/
return 1;
struct listen_dnsport*
listen_create(struct comm_base* base, struct listen_port* ports,
size_t bufsize, int tcp_accept_count, void* sslctx,
- comm_point_callback_t* cb, void *cb_arg)
+ struct dt_env* dtenv, comm_point_callback_t* cb, void *cb_arg)
{
struct listen_dnsport* front = (struct listen_dnsport*)
malloc(sizeof(struct listen_dnsport));
listen_delete(front);
return NULL;
}
+ cp->dtenv = dtenv;
cp->do_not_close = 1;
if(!listen_cp_insert(cp, front)) {
log_err("malloc failed");
do_auto, cfg->do_udp, do_tcp,
&hints, portbuf, &list,
cfg->so_rcvbuf, cfg->so_sndbuf,
- cfg->ssl_port, reuseport)) {
+ cfg->ssl_port, reuseport,
+ cfg->ip_transparent)) {
listening_ports_free(list);
return NULL;
}
do_auto, cfg->do_udp, do_tcp,
&hints, portbuf, &list,
cfg->so_rcvbuf, cfg->so_sndbuf,
- cfg->ssl_port, reuseport)) {
+ cfg->ssl_port, reuseport,
+ cfg->ip_transparent)) {
listening_ports_free(list);
return NULL;
}
if(!ports_create_if(cfg->ifs[i], 0, cfg->do_udp,
do_tcp, &hints, portbuf, &list,
cfg->so_rcvbuf, cfg->so_sndbuf,
- cfg->ssl_port, reuseport)) {
+ cfg->ssl_port, reuseport,
+ cfg->ip_transparent)) {
listening_ports_free(list);
return NULL;
}
if(!ports_create_if(cfg->ifs[i], 0, cfg->do_udp,
do_tcp, &hints, portbuf, &list,
cfg->so_rcvbuf, cfg->so_sndbuf,
- cfg->ssl_port, reuseport)) {
+ cfg->ssl_port, reuseport,
+ cfg->ip_transparent)) {
listening_ports_free(list);
return NULL;
}
* @param tcp_accept_count: max number of simultaneous TCP connections
* from clients.
* @param sslctx: nonNULL if ssl context.
+ * @param dtenv: nonNULL if dnstap enabled.
* @param cb: callback function when a request arrives. It is passed
* the packet and user argument. Return true to send a reply.
* @param cb_arg: user data argument for callback function.
*/
struct listen_dnsport* listen_create(struct comm_base* base,
struct listen_port* ports, size_t bufsize, int tcp_accept_count,
- void* sslctx, comm_point_callback_t* cb, void* cb_arg);
+ void* sslctx, struct dt_env *dtenv, comm_point_callback_t* cb,
+ void* cb_arg);
/**
* delete the listening structure
* set SO_REUSEADDR on it.
* @param reuseport: if nonNULL and true, try to set SO_REUSEPORT on
* listening UDP port. Set to false on return if it failed to do so.
+ * @param transparent: set IP_TRANSPARENT socket option.
* @return: the socket. -1 on error.
*/
int create_udp_sock(int family, int socktype, struct sockaddr* addr,
socklen_t addrlen, int v6only, int* inuse, int* noproto, int rcv,
- int snd, int listen, int* reuseport);
+ int snd, int listen, int* reuseport, int transparent);
/**
* Create and bind TCP listening socket
* @param noproto: if error caused by lack of protocol support.
* @param reuseport: if nonNULL and true, try to set SO_REUSEPORT on
* listening UDP port. Set to false on return if it failed to do so.
+ * @param transparent: set IP_TRANSPARENT socket option.
* @return: the socket. -1 on error.
*/
int create_tcp_accept_sock(struct addrinfo *addr, int v6only, int* noproto,
- int* reuseport);
+ int* reuseport, int transparent);
+
+/**
+ * Create and bind local listening socket
+ * @param path: path to the socket.
+ * @param noproto: on error, this is set true if cause is that local sockets
+ * are not supported.
+ * @return: the socket. -1 on error.
+ */
+int create_local_accept_sock(const char* path, int* noproto);
#endif /* LISTEN_DNSPORT_H */
*/
#include "config.h"
#include "services/localzone.h"
-#include "ldns/str2wire.h"
-#include "ldns/sbuffer.h"
+#include "sldns/str2wire.h"
+#include "sldns/sbuffer.h"
#include "util/regional.h"
#include "util/config_file.h"
#include "util/data/dname.h"
#include "util/data/packed_rrset.h"
#include "util/data/msgencode.h"
#include "util/net_help.h"
+#include "util/netevent.h"
#include "util/data/msgreply.h"
#include "util/data/msgparse.h"
/* this list of zones is from RFC 6303 */
+ /* block localhost level zones, first, later the LAN zones */
+
/* localhost. zone */
if(!lz_exists(zones, "localhost.") &&
!lz_nodefault(cfg, "localhost.")) {
}
lock_rw_unlock(&z->lock);
}
+
+ /* if unblock lan-zones, then do not add the zones below.
+ * we do add the zones above, about 127.0.0.1, because localhost is
+ * not on the lan. */
+ if(cfg->unblock_lan_zones)
+ return 1;
+
+ /* block LAN level zones */
if ( !add_as112_default(zones, cfg, "10.in-addr.arpa.") ||
!add_as112_default(zones, cfg, "16.172.in-addr.arpa.") ||
!add_as112_default(zones, cfg, "17.172.in-addr.arpa.") ||
log_nametypeclass(0, "static zone",
z->name, 0, z->dclass);
break;
+ case local_zone_inform:
+ log_nametypeclass(0, "inform zone",
+ z->name, 0, z->dclass);
+ break;
+ case local_zone_inform_deny:
+ log_nametypeclass(0, "inform_deny zone",
+ z->name, 0, z->dclass);
+ break;
default:
log_nametypeclass(0, "badtyped zone",
z->name, 0, z->dclass);
struct edns_data* edns, sldns_buffer* buf, struct regional* temp,
struct local_data* ld)
{
- if(z->type == local_zone_deny) {
+ if(z->type == local_zone_deny || z->type == local_zone_inform_deny) {
/** no reply at all, signal caller by clearing buffer. */
sldns_buffer_clear(buf);
sldns_buffer_flip(buf);
return 0;
}
+/** print log information for an inform zone query */
+static void
+lz_inform_print(struct local_zone* z, struct query_info* qinfo,
+ struct comm_reply* repinfo)
+{
+ char ip[128], txt[512];
+ char zname[LDNS_MAX_DOMAINLEN+1];
+ uint16_t port = ntohs(((struct sockaddr_in*)&repinfo->addr)->sin_port);
+ dname_str(z->name, zname);
+ addr_to_str(&repinfo->addr, repinfo->addrlen, ip, sizeof(ip));
+ snprintf(txt, sizeof(txt), "%s inform %s@%u", zname, ip,
+ (unsigned)port);
+ log_nametypeclass(0, txt, qinfo->qname, qinfo->qtype, qinfo->qclass);
+}
+
int
local_zones_answer(struct local_zones* zones, struct query_info* qinfo,
- struct edns_data* edns, sldns_buffer* buf, struct regional* temp)
+ struct edns_data* edns, sldns_buffer* buf, struct regional* temp,
+ struct comm_reply* repinfo)
{
/* see if query is covered by a zone,
* if so: - try to match (exact) local data
lock_rw_rdlock(&z->lock);
lock_rw_unlock(&zones->lock);
+ if((z->type == local_zone_inform || z->type == local_zone_inform_deny)
+ && repinfo)
+ lz_inform_print(z, qinfo, repinfo);
+
if(local_data_answer(z, qinfo, edns, buf, temp, labs, &ld)) {
lock_rw_unlock(&z->lock);
return 1;
case local_zone_typetransparent: return "typetransparent";
case local_zone_static: return "static";
case local_zone_nodefault: return "nodefault";
+ case local_zone_inform: return "inform";
+ case local_zone_inform_deny: return "inform_deny";
}
return "badtyped";
}
*t = local_zone_typetransparent;
else if(strcmp(type, "redirect") == 0)
*t = local_zone_redirect;
+ else if(strcmp(type, "inform") == 0)
+ *t = local_zone_inform;
+ else if(strcmp(type, "inform_deny") == 0)
+ *t = local_zone_inform_deny;
else return 0;
return 1;
}
struct edns_data;
struct query_info;
struct sldns_buffer;
+struct comm_reply;
/**
* Local zone type
local_zone_redirect,
/** remove default AS112 blocking contents for zone
* nodefault is used in config not during service. */
- local_zone_nodefault
+ local_zone_nodefault,
+ /** log client address, but no block (transparent) */
+ local_zone_inform,
+ /** log client address, and block (drop) */
+ local_zone_inform_deny
};
/**
* @param edns: edns info (parsed).
* @param buf: buffer with query ID and flags, also for reply.
* @param temp: temporary storage region.
+ * @param repinfo: source address for checks. may be NULL.
* @return true if answer is in buffer. false if query is not answered
* by authority data. If the reply should be dropped altogether, the return
* value is true, but the buffer is cleared (empty).
*/
int local_zones_answer(struct local_zones* zones, struct query_info* qinfo,
- struct edns_data* edns, struct sldns_buffer* buf, struct regional* temp);
+ struct edns_data* edns, struct sldns_buffer* buf, struct regional* temp,
+ struct comm_reply* repinfo);
/**
* Parse the string into localzone type.
#ifdef CLIENT_SUBNET
#include "edns-subnet/edns-subnet.h"
#endif
-#include "ldns/sbuffer.h"
+#include "sldns/sbuffer.h"
/** subtract timers and the values do not overflow or become negative */
static void
memcpy(&s->s.edns_client_in, edns, sizeof(struct edns_data));
}
#endif /* CLIENT_SUBNET */
-
int
mesh_state_compare(const void* ap, const void* bp)
{
if(!a->s.is_priming && b->s.is_priming)
return 1;
+ if(a->s.is_valrec && !b->s.is_valrec)
+ return -1;
+ if(!a->s.is_valrec && b->s.is_valrec)
+ return 1;
+
if((a->s.query_flags&BIT_RD) && !(b->s.query_flags&BIT_RD))
return -1;
if(!(a->s.query_flags&BIT_RD) && (b->s.query_flags&BIT_RD))
uint16_t qflags, struct edns_data* edns, struct comm_reply* rep,
uint16_t qid)
{
- /* do not use CD flag from user for mesh state, we want the CD-query
- * to receive validation anyway, to protect out cache contents and
- * avoid bad-data in this cache that a downstream validator cannot
- * remove from this cache */
- struct mesh_state* s = mesh_area_find(mesh, qinfo, qflags&BIT_RD, 0);
+ struct mesh_state* s = mesh_area_find(mesh, qinfo, qflags&(BIT_RD|BIT_CD), 0, 0);
int was_detached = 0;
int was_noreply = 0;
int added = 0;
#ifdef UNBOUND_DEBUG
struct rbnode_t* n;
#endif
- s = mesh_state_create(mesh->env, qinfo, qflags&BIT_RD, 0);
+ s = mesh_state_create(mesh->env, qinfo, qflags&(BIT_RD|BIT_CD), 0, 0);
if(!s) {
log_err("mesh_state_create: out of memory; SERVFAIL");
error_encode(rep->c->buffer, LDNS_RCODE_SERVFAIL,
#ifdef CLIENT_SUBNET
populate_edns_subnet(edns, s);
#endif /* CLIENT_SUBNET */
-
/* update statistics */
if(was_detached) {
log_assert(mesh->num_detached_states > 0);
uint16_t qflags, struct edns_data* edns, sldns_buffer* buf,
uint16_t qid, mesh_cb_func_t cb, void* cb_arg)
{
- struct mesh_state* s = mesh_area_find(mesh, qinfo, qflags&BIT_RD, 0);
+ struct mesh_state* s = mesh_area_find(mesh, qinfo, qflags&(BIT_RD|BIT_CD), 0, 0);
int was_detached = 0;
int was_noreply = 0;
int added = 0;
#ifdef UNBOUND_DEBUG
struct rbnode_t* n;
#endif
- s = mesh_state_create(mesh->env, qinfo, qflags&BIT_RD, 0);
+ s = mesh_state_create(mesh->env, qinfo, qflags&(BIT_RD|BIT_CD), 0, 0);
if(!s) {
return 0;
}
void mesh_new_prefetch(struct mesh_area* mesh, struct query_info* qinfo,
uint16_t qflags, time_t leeway)
{
- struct mesh_state* s = mesh_area_find(mesh, qinfo, qflags&BIT_RD, 0);
+ struct mesh_state* s = mesh_area_find(mesh, qinfo, qflags&(BIT_RD|BIT_CD), 0, 0);
#ifdef UNBOUND_DEBUG
struct rbnode_t* n;
#endif
mesh->stats_dropped ++;
return;
}
- s = mesh_state_create(mesh->env, qinfo, qflags&BIT_RD, 0);
+ s = mesh_state_create(mesh->env, qinfo, qflags&(BIT_RD|BIT_CD), 0, 0);
if(!s) {
log_err("prefetch mesh_state_create: out of memory");
return;
struct mesh_state*
mesh_state_create(struct module_env* env, struct query_info* qinfo,
- uint16_t qflags, int prime)
+ uint16_t qflags, int prime, int valrec)
{
struct regional* region = alloc_reg_obtain(env->alloc);
struct mesh_state* mstate;
/* remove all weird bits from qflags */
mstate->s.query_flags = (qflags & (BIT_RD|BIT_CD));
mstate->s.is_priming = prime;
+ mstate->s.is_valrec = valrec;
mstate->s.reply = NULL;
mstate->s.region = region;
mstate->s.curmod = 0;
}
int mesh_attach_sub(struct module_qstate* qstate, struct query_info* qinfo,
- uint16_t qflags, int prime, struct module_qstate** newq)
+ uint16_t qflags, int prime, int valrec, struct module_qstate** newq)
{
/* find it, if not, create it */
struct mesh_area* mesh = qstate->env->mesh;
- struct mesh_state* sub = mesh_area_find(mesh, qinfo, qflags, prime);
+ struct mesh_state* sub = mesh_area_find(mesh, qinfo, qflags, prime,
+ valrec);
int was_detached;
if(mesh_detect_cycle_found(qstate, sub)) {
verbose(VERB_ALGO, "attach failed, cycle detected");
struct rbnode_t* n;
#endif
/* create a new one */
- sub = mesh_state_create(qstate->env, qinfo, qflags, prime);
+ sub = mesh_state_create(qstate->env, qinfo, qflags, prime,
+ valrec);
if(!sub) {
log_err("mesh_attach_sub: out of memory");
return 0;
}
struct mesh_state* mesh_area_find(struct mesh_area* mesh,
- struct query_info* qinfo, uint16_t qflags, int prime)
+ struct query_info* qinfo, uint16_t qflags, int prime, int valrec)
{
struct mesh_state key;
struct mesh_state* result;
key.node.key = &key;
key.s.is_priming = prime;
+ key.s.is_valrec = valrec;
key.s.qinfo = *qinfo;
key.s.query_flags = qflags;
#ifdef CLIENT_SUBNET
key.s.edns_client_in.edns_present = 0;
key.s.edns_client_in.subnet_validdata = 0;
#endif
-
+
result = (struct mesh_state*)rbtree_search(&mesh->all, &key);
return result;
}
struct mesh_state* m;
int num = 0;
RBTREE_FOR(m, struct mesh_state*, &mesh->all) {
- snprintf(buf, sizeof(buf), "%d%s%s%s%s%s mod%d %s%s",
+ snprintf(buf, sizeof(buf), "%d%s%s%s%s%s%s mod%d %s%s",
num++, (m->s.is_priming)?"p":"", /* prime */
+ (m->s.is_valrec)?"v":"", /* prime */
(m->s.query_flags&BIT_RD)?"RD":"",
(m->s.query_flags&BIT_CD)?"CD":"",
(m->super_set.count==0)?"d":"", /* detached */
int
mesh_detect_cycle(struct module_qstate* qstate, struct query_info* qinfo,
- uint16_t flags, int prime)
+ uint16_t flags, int prime, int valrec)
{
struct mesh_area* mesh = qstate->env->mesh;
- struct mesh_state* dep_m = mesh_area_find(mesh, qinfo, flags, prime);
+ struct mesh_state* dep_m = mesh_area_find(mesh, qinfo, flags, prime,
+ valrec);
return mesh_detect_cycle_found(qstate, dep_m);
}
* @param qinfo: what to query for (copied).
* @param qflags: what flags to use (RD / CD flag or not).
* @param prime: if it is a (stub) priming query.
+ * @param valrec: if it is a validation recursion query (lookup of key, DS).
* @param newq: If the new subquery needs initialisation, it is returned,
* otherwise NULL is returned.
* @return: false on error, true if success (and init may be needed).
*/
int mesh_attach_sub(struct module_qstate* qstate, struct query_info* qinfo,
- uint16_t qflags, int prime, struct module_qstate** newq);
+ uint16_t qflags, int prime, int valrec, struct module_qstate** newq);
/**
* Query state is done, send messages to reply entries.
* @param qinfo: query info that the mesh is for.
* @param qflags: flags for query (RD / CD flag).
* @param prime: if true, it is a priming query, set is_priming on mesh state.
+ * @param valrec: if true, it is a validation recursion query, and sets
+ * is_valrec on the mesh state.
* @return: new mesh state or NULL on allocation error.
*/
struct mesh_state* mesh_state_create(struct module_env* env,
- struct query_info* qinfo, uint16_t qflags, int prime);
+ struct query_info* qinfo, uint16_t qflags, int prime, int valrec);
/**
* Cleanup a mesh state and its query state. Does not do rbtree or
* @param qinfo: what query
* @param qflags: if RD / CD bit is set or not.
* @param prime: if it is a priming query.
+ * @param valrec: if it is a validation-recursion query.
* @return: mesh state or NULL if not found.
*/
struct mesh_state* mesh_area_find(struct mesh_area* mesh,
- struct query_info* qinfo, uint16_t qflags, int prime);
+ struct query_info* qinfo, uint16_t qflags, int prime, int valrec);
/**
* Setup attachment super/sub relation between super and sub mesh state.
* @param qinfo: query info for dependency.
* @param flags: query flags of dependency.
* @param prime: if dependency is a priming query or not.
+ * @param valrec: if it is a validation recursion query (lookup of key, DS).
* @return true if the name,type,class exists and the given qstate mesh exists
* as a dependency of that name. Thus if qstate becomes dependent on
* name,type,class then a cycle is created, this is return value 1.
* Too large to search is value 2 (also true).
*/
int mesh_detect_cycle(struct module_qstate* qstate, struct query_info* qinfo,
- uint16_t flags, int prime);
+ uint16_t flags, int prime, int valrec);
/** compare two mesh_states */
int mesh_state_compare(const void* ap, const void* bp);
#include "services/modstack.h"
#include "util/module.h"
#include "util/fptr_wlist.h"
+#include "dns64/dns64.h"
#include "iterator/iterator.h"
#include "validator/validator.h"
return 0;
while(*s) {
/* skip whitespace */
- while(*s && isspace((int)*s))
+ while(*s && isspace((unsigned char)*s))
s++;
- if(*s && !isspace((int)*s)) {
+ if(*s && !isspace((unsigned char)*s)) {
/* skip identifier */
num++;
- while(*s && !isspace((int)*s))
+ while(*s && !isspace((unsigned char)*s))
s++;
}
}
{
/* these are the modules available */
static const char* names[] = {
+ "dns64",
#ifdef WITH_PYTHONMODULE
"python",
#endif
module_funcs_avail(void)
{
static struct module_func_block* (*fb[])(void) = {
+ &dns64_get_funcblock,
#ifdef WITH_PYTHONMODULE
&pythonmod_get_funcblock,
#endif
const char* s = *str;
const char** names = module_list_avail();
fbgetfunctype* fb = module_funcs_avail();
- while(*s && isspace((int)*s))
+ while(*s && isspace((unsigned char)*s))
s++;
while(names[i]) {
if(strncmp(names[i], s, strlen(names[i])) == 0) {
*/
#include "config.h"
#include <sys/time.h>
-#include "ldns/sbuffer.h"
#include "services/outbound_list.h"
#include "services/outside_network.h"
#include "util/net_help.h"
#include "util/random.h"
#include "util/fptr_wlist.h"
-#include "ldns/sbuffer.h"
+#include "sldns/sbuffer.h"
#ifdef CLIENT_SUBNET
#include "edns-subnet/subnet-whitelist.h"
#endif
+#include "dnstap/dnstap.h"
#ifdef HAVE_OPENSSL_SSL_H
#include <openssl/ssl.h>
#endif
#define OUTBOUND_UDP_RETRY 1
/** initiate TCP transaction for serviced query */
-static void serviced_tcp_initiate(struct outside_network* outnet,
- struct serviced_query* sq, sldns_buffer* buff);
+static void serviced_tcp_initiate(struct serviced_query* sq, sldns_buffer* buff);
/** with a fd available, randomize and send UDP */
-static int randomize_and_send_udp(struct outside_network* outnet,
- struct pending* pend, sldns_buffer* packet, int timeout);
+static int randomize_and_send_udp(struct pending* pend, sldns_buffer* packet,
+ int timeout);
+
+/** remove waiting tcp from the outnet waiting list */
+static void waiting_list_remove(struct outside_network* outnet,
+ struct waiting_tcp* w);
int
pending_cmp(const void* key1, const void* key2)
free(pend->pkt); /* freeing now makes get_mem correct */
pend->pkt = NULL;
pend->pkt_len = 0;
- if(!randomize_and_send_udp(outnet, pend, outnet->udp_buff,
+ if(!randomize_and_send_udp(pend, outnet->udp_buff,
pend->timeout)) {
/* callback error on pending */
if(pend->cb) {
struct ub_randstate* rnd, int use_caps_for_id, int* availports,
int numavailports, size_t unwanted_threshold,
void (*unwanted_action)(void*), void* unwanted_param, int do_udp,
- void* sslctx, int delayclose
+ void* sslctx, int delayclose, struct dt_env* dtenv
#ifdef CLIENT_SUBNET
, struct ednssubnet_upstream* edns_subnet_upstreams
#endif
outnet->infra = infra;
outnet->rnd = rnd;
outnet->sslctx = sslctx;
+#ifdef USE_DNSTAP
+ outnet->dtenv = dtenv;
+#else
+ (void)dtenv;
+#endif
outnet->svcd_overhead = 0;
outnet->want_to_quit = 0;
outnet->unwanted_threshold = unwanted_threshold;
sa->sin6_port = (in_port_t)htons((uint16_t)port);
fd = create_udp_sock(AF_INET6, SOCK_DGRAM,
(struct sockaddr*)addr, addrlen, 1, inuse, &noproto,
- 0, 0, 0, NULL);
+ 0, 0, 0, NULL, 0);
} else {
struct sockaddr_in* sa = (struct sockaddr_in*)addr;
sa->sin_port = (in_port_t)htons((uint16_t)port);
fd = create_udp_sock(AF_INET, SOCK_DGRAM,
(struct sockaddr*)addr, addrlen, 1, inuse, &noproto,
- 0, 0, 0, NULL);
+ 0, 0, 0, NULL, 0);
}
return fd;
}
}
static int
-randomize_and_send_udp(struct outside_network* outnet, struct pending* pend,
- sldns_buffer* packet, int timeout)
+randomize_and_send_udp(struct pending* pend, sldns_buffer* packet, int timeout)
{
struct timeval tv;
+ struct outside_network* outnet = pend->sq->outnet;
/* select id */
if(!select_id(outnet, pend, packet)) {
tv.tv_usec = (timeout%1000)*1000;
#endif
comm_timer_set(pend->timer, &tv);
+
+#ifdef USE_DNSTAP
+ if(outnet->dtenv &&
+ (outnet->dtenv->log_resolver_query_messages ||
+ outnet->dtenv->log_forwarder_query_messages))
+ dt_msg_send_outside_query(outnet->dtenv, &pend->addr, comm_udp,
+ pend->sq->zone, pend->sq->zonelen, packet);
+#endif
return 1;
}
struct pending*
-pending_udp_query(struct outside_network* outnet, sldns_buffer* packet,
- struct sockaddr_storage* addr, socklen_t addrlen, int timeout,
- comm_point_callback_t* cb, void* cb_arg)
+pending_udp_query(struct serviced_query* sq, struct sldns_buffer* packet,
+ int timeout, comm_point_callback_t* cb, void* cb_arg)
{
struct pending* pend = (struct pending*)calloc(1, sizeof(*pend));
if(!pend) return NULL;
- pend->outnet = outnet;
- pend->addrlen = addrlen;
- memmove(&pend->addr, addr, addrlen);
+ pend->outnet = sq->outnet;
+ pend->sq = sq;
+ pend->addrlen = sq->addrlen;
+ memmove(&pend->addr, &sq->addr, sq->addrlen);
pend->cb = cb;
pend->cb_arg = cb_arg;
pend->node.key = pend;
- pend->timer = comm_timer_create(outnet->base, pending_udp_timer_cb,
+ pend->timer = comm_timer_create(sq->outnet->base, pending_udp_timer_cb,
pend);
if(!pend->timer) {
free(pend);
return NULL;
}
- if(outnet->unused_fds == NULL) {
+ if(sq->outnet->unused_fds == NULL) {
/* no unused fd, cannot create a new port (randomly) */
verbose(VERB_ALGO, "no fds available, udp query waiting");
pend->timeout = timeout;
return NULL;
}
/* put at end of waiting list */
- if(outnet->udp_wait_last)
- outnet->udp_wait_last->next_waiting = pend;
+ if(sq->outnet->udp_wait_last)
+ sq->outnet->udp_wait_last->next_waiting = pend;
else
- outnet->udp_wait_first = pend;
- outnet->udp_wait_last = pend;
+ sq->outnet->udp_wait_first = pend;
+ sq->outnet->udp_wait_last = pend;
return pend;
}
- if(!randomize_and_send_udp(outnet, pend, packet, timeout)) {
- pending_delete(outnet, pend);
+ if(!randomize_and_send_udp(pend, packet, timeout)) {
+ pending_delete(sq->outnet, pend);
return NULL;
}
return pend;
void* cb_arg;
if(w->pkt) {
/* it is on the waiting list */
- struct waiting_tcp* p=outnet->tcp_wait_first, *prev=NULL;
- while(p) {
- if(p == w) {
- if(prev) prev->next_waiting = w->next_waiting;
- else outnet->tcp_wait_first=w->next_waiting;
- outnet->tcp_wait_last = prev;
- break;
- }
- prev = p;
- p=p->next_waiting;
- }
+ waiting_list_remove(outnet, w);
} else {
/* it was in use */
struct pending_tcp* pend=(struct pending_tcp*)w->next_waiting;
use_free_buffer(outnet);
}
-struct waiting_tcp*
-pending_tcp_query(struct outside_network* outnet, sldns_buffer* packet,
- struct sockaddr_storage* addr, socklen_t addrlen, int timeout,
- comm_point_callback_t* callback, void* callback_arg, int ssl_upstream)
+struct waiting_tcp*
+pending_tcp_query(struct serviced_query* sq, sldns_buffer* packet,
+ int timeout, comm_point_callback_t* callback, void* callback_arg)
{
- struct pending_tcp* pend = outnet->tcp_free;
+ struct pending_tcp* pend = sq->outnet->tcp_free;
struct waiting_tcp* w;
struct timeval tv;
uint16_t id;
if(!w) {
return NULL;
}
- if(!(w->timer = comm_timer_create(outnet->base, outnet_tcptimer, w))) {
+ if(!(w->timer = comm_timer_create(sq->outnet->base, outnet_tcptimer, w))) {
free(w);
return NULL;
}
w->pkt = NULL;
w->pkt_len = 0;
- id = ((unsigned)ub_random(outnet->rnd)>>8) & 0xffff;
+ id = ((unsigned)ub_random(sq->outnet->rnd)>>8) & 0xffff;
LDNS_ID_SET(sldns_buffer_begin(packet), id);
- memcpy(&w->addr, addr, addrlen);
- w->addrlen = addrlen;
- w->outnet = outnet;
+ memcpy(&w->addr, &sq->addr, sq->addrlen);
+ w->addrlen = sq->addrlen;
+ w->outnet = sq->outnet;
w->cb = callback;
w->cb_arg = callback_arg;
- w->ssl_upstream = ssl_upstream;
+ w->ssl_upstream = sq->ssl_upstream;
#ifndef S_SPLINT_S
tv.tv_sec = timeout;
tv.tv_usec = 0;
waiting_tcp_delete(w);
return NULL;
}
+#ifdef USE_DNSTAP
+ if(sq->outnet->dtenv &&
+ (sq->outnet->dtenv->log_resolver_query_messages ||
+ sq->outnet->dtenv->log_forwarder_query_messages))
+ dt_msg_send_outside_query(sq->outnet->dtenv, &sq->addr,
+ comm_tcp, sq->zone, sq->zonelen, packet);
+#endif
} else {
/* queue up */
w->pkt = (uint8_t*)w + sizeof(struct waiting_tcp);
w->pkt_len = sldns_buffer_limit(packet);
memmove(w->pkt, sldns_buffer_begin(packet), w->pkt_len);
w->next_waiting = NULL;
- if(outnet->tcp_wait_last)
- outnet->tcp_wait_last->next_waiting = w;
- else outnet->tcp_wait_first = w;
- outnet->tcp_wait_last = w;
+ if(sq->outnet->tcp_wait_last)
+ sq->outnet->tcp_wait_last->next_waiting = w;
+ else sq->outnet->tcp_wait_first = w;
+ sq->outnet->tcp_wait_last = w;
}
return w;
}
/** Create new serviced entry */
static struct serviced_query*
serviced_create(struct outside_network* outnet, sldns_buffer* buff, int dnssec,
- int want_dnssec, int tcp_upstream, int ssl_upstream,
+ int want_dnssec, int nocaps, int tcp_upstream, int ssl_upstream,
struct sockaddr_storage* addr, socklen_t addrlen, uint8_t* zone,
size_t zonelen, int qtype)
{
sq->qtype = qtype;
sq->dnssec = dnssec;
sq->want_dnssec = want_dnssec;
+ sq->nocaps = nocaps;
sq->tcp_upstream = tcp_upstream;
sq->ssl_upstream = ssl_upstream;
memcpy(&sq->addr, addr, addrlen);
while(lablen) {
while(lablen--) {
/* only perturb A-Z, a-z */
- if(isalpha((int)*d)) {
+ if(isalpha((unsigned char)*d)) {
/* get a random bit */
if(bits == 0) {
random = ub_random(rnd);
bits = 30;
}
if(random & 0x1) {
- *d = (uint8_t)toupper((int)*d);
+ *d = (uint8_t)toupper((unsigned char)*d);
} else {
- *d = (uint8_t)tolower((int)*d);
+ *d = (uint8_t)tolower((unsigned char)*d);
}
random >>= 1;
bits--;
serviced_encode(struct serviced_query* sq, sldns_buffer* buff, int with_edns)
{
/* if we are using 0x20 bits for ID randomness, perturb them */
- if(sq->outnet->use_caps_for_id) {
+ if(sq->outnet->use_caps_for_id && !sq->nocaps) {
serviced_perturb_qname(sq->outnet->rnd, sq->qbuf, sq->qbuflen);
}
/* generate query */
sq->last_sent_time = *sq->outnet->now_tv;
sq->edns_lame_known = (int)edns_lame_known;
verbose(VERB_ALGO, "serviced query UDP timeout=%d msec", rtt);
- sq->pending = pending_udp_query(sq->outnet, buff, &sq->addr,
- sq->addrlen, rtt, serviced_udp_callback, sq);
+ sq->pending = pending_udp_query(sq, buff, rtt,
+ serviced_udp_callback, sq);
if(!sq->pending)
return 0;
return 1;
if(error==NETEVENT_NOERROR)
infra_update_tcp_works(sq->outnet->infra, &sq->addr,
sq->addrlen, sq->zone, sq->zonelen);
+#ifdef USE_DNSTAP
+ if(error==NETEVENT_NOERROR && sq->outnet->dtenv &&
+ (sq->outnet->dtenv->log_resolver_response_messages ||
+ sq->outnet->dtenv->log_forwarder_response_messages))
+ dt_msg_send_outside_response(sq->outnet->dtenv, &sq->addr,
+ c->type, sq->zone, sq->zonelen, sq->qbuf, sq->qbuflen,
+ &sq->last_sent_time, sq->outnet->now_tv, c->buffer);
+#endif
if(error==NETEVENT_NOERROR && sq->status == serviced_query_TCP_EDNS &&
(LDNS_RCODE_WIRE(sldns_buffer_begin(c->buffer)) ==
LDNS_RCODE_FORMERR || LDNS_RCODE_WIRE(sldns_buffer_begin(
c->buffer)) == LDNS_RCODE_NOTIMPL) ) {
/* attempt to fallback to nonEDNS */
sq->status = serviced_query_TCP_EDNS_fallback;
- serviced_tcp_initiate(sq->outnet, sq, c->buffer);
+ serviced_tcp_initiate(sq, c->buffer);
return 0;
} else if(error==NETEVENT_NOERROR &&
sq->status == serviced_query_TCP_EDNS_fallback &&
}
static void
-serviced_tcp_initiate(struct outside_network* outnet,
- struct serviced_query* sq, sldns_buffer* buff)
+serviced_tcp_initiate(struct serviced_query* sq, sldns_buffer* buff)
{
verbose(VERB_ALGO, "initiate TCP query %s",
sq->status==serviced_query_TCP_EDNS?"EDNS":"");
serviced_encode(sq, buff, sq->status == serviced_query_TCP_EDNS);
sq->last_sent_time = *sq->outnet->now_tv;
- sq->pending = pending_tcp_query(outnet, buff, &sq->addr,
- sq->addrlen, TCP_AUTH_QUERY_TIMEOUT, serviced_tcp_callback,
- sq, sq->ssl_upstream);
+ sq->pending = pending_tcp_query(sq, buff, TCP_AUTH_QUERY_TIMEOUT,
+ serviced_tcp_callback, sq);
if(!sq->pending) {
/* delete from tree so that a retry by above layer does not
* clash with this entry */
else sq->status = serviced_query_TCP;
serviced_encode(sq, buff, sq->status == serviced_query_TCP_EDNS);
sq->last_sent_time = *sq->outnet->now_tv;
- sq->pending = pending_tcp_query(sq->outnet, buff, &sq->addr,
- sq->addrlen, TCP_AUTH_QUERY_TIMEOUT, serviced_tcp_callback,
- sq, sq->ssl_upstream);
+ sq->pending = pending_tcp_query(sq, buff, TCP_AUTH_QUERY_TIMEOUT,
+ serviced_tcp_callback, sq);
return sq->pending != NULL;
}
serviced_callbacks(sq, error, c, rep);
return 0;
}
+#ifdef USE_DNSTAP
+ if(outnet->dtenv &&
+ (outnet->dtenv->log_resolver_response_messages ||
+ outnet->dtenv->log_forwarder_response_messages))
+ dt_msg_send_outside_response(outnet->dtenv, &sq->addr, c->type,
+ sq->zone, sq->zonelen, sq->qbuf, sq->qbuflen,
+ &sq->last_sent_time, sq->outnet->now_tv, c->buffer);
+#endif
if(!fallback_tcp) {
if( (sq->status == serviced_query_UDP_EDNS
||sq->status == serviced_query_UDP_EDNS_FRAG)
/* if we have unfinished EDNS_fallback, start again */
sq->status = serviced_query_TCP_EDNS;
else sq->status = serviced_query_TCP;
- serviced_tcp_initiate(outnet, sq, c->buffer);
+ serviced_tcp_initiate(sq, c->buffer);
return 0;
}
/* yay! an answer */
struct serviced_query*
outnet_serviced_query(struct outside_network* outnet,
uint8_t* qname, size_t qnamelen, uint16_t qtype, uint16_t qclass,
- uint16_t flags, int dnssec, int want_dnssec, int tcp_upstream,
- int ssl_upstream, struct sockaddr_storage* addr, socklen_t addrlen,
- uint8_t* zone, size_t zonelen, comm_point_callback_t* callback,
- void* callback_arg, sldns_buffer* buff
+ uint16_t flags, int dnssec, int want_dnssec, int nocaps,
+ int tcp_upstream, int ssl_upstream, struct sockaddr_storage* addr,
+ socklen_t addrlen, uint8_t* zone, size_t zonelen,
+ comm_point_callback_t* callback, void* callback_arg,
+ sldns_buffer* buff
#ifdef CLIENT_SUBNET
, struct edns_data* edns
#endif
return NULL;
if(!sq) {
/* make new serviced query entry */
- sq = serviced_create(outnet, buff, dnssec, want_dnssec,
+ sq = serviced_create(outnet, buff, dnssec, want_dnssec, nocaps,
tcp_upstream, ssl_upstream, addr, addrlen, zone,
zonelen, (int)qtype);
if(!sq) {
#include "util/rbtree.h"
#include "util/netevent.h"
-#include "ldns/sbuffer.h"
+#include "dnstap/dnstap_config.h"
struct pending;
struct pending_timeout;
struct ub_randstate;
struct port_comm;
struct port_if;
struct sldns_buffer;
+struct serviced_query;
+struct dt_env;
/**
* Send queries to outside servers and wait for answers from servers.
/** hosts we send client prefix, not owned by outnet. */
struct ednssubnet_upstream* edns_subnet_upstreams;
#endif
+#ifdef USE_DNSTAP
+ /** dnstap environment */
+ struct dt_env* dtenv;
+#endif
+
/**
* Array of tcp pending used for outgoing TCP connections.
* Each can be used to establish a TCP connection with a server.
void* cb_arg;
/** the outside network it is part of */
struct outside_network* outnet;
+ /** the corresponding serviced_query */
+ struct serviced_query* sq;
/*---- filled if udp pending is waiting -----*/
/** next in waiting list. */
int dnssec;
/** We want signatures, or else the answer is likely useless */
int want_dnssec;
+ /** ignore capsforid */
+ int nocaps;
/** tcp upstream used, use tcp, or ssl_upstream for SSL */
int tcp_upstream, ssl_upstream;
/** where to send it */
#endif
};
-
/**
* Create outside_network structure with N udp ports.
* @param base: the communication base to use for event handling.
struct ub_randstate* rnd, int use_caps_for_id, int* availports,
int numavailports, size_t unwanted_threshold,
void (*unwanted_action)(void*), void* unwanted_param, int do_udp,
- void* sslctx, int delayclose
+ void* sslctx, int delayclose, struct dt_env *dtenv
#ifdef CLIENT_SUBNET
, struct ednssubnet_upstream* edns_subnet_upstreams
#endif
/**
* Send UDP query, create pending answer.
* Changes the ID for the query to be random and unique for that destination.
- * @param outnet: provides the event handling
+ * @param sq: serviced query.
* @param packet: wireformat query to send to destination.
- * @param addr: address to send to.
- * @param addrlen: length of addr.
* @param timeout: in milliseconds from now.
* @param callback: function to call on error, timeout or reply.
* @param callback_arg: user argument for callback function.
* @return: NULL on error for malloc or socket. Else the pending query object.
*/
-struct pending* pending_udp_query(struct outside_network* outnet,
- struct sldns_buffer* packet, struct sockaddr_storage* addr,
- socklen_t addrlen, int timeout, comm_point_callback_t* callback,
+struct pending* pending_udp_query(struct serviced_query* sq,
+ struct sldns_buffer* packet, int timeout, comm_point_callback_t* callback,
void* callback_arg);
/**
* Send TCP query. May wait for TCP buffer. Selects ID to be random, and
* checks id.
- * @param outnet: provides the event handling.
+ * @param sq: serviced query.
* @param packet: wireformat query to send to destination. copied from.
- * @param addr: address to send to.
- * @param addrlen: length of addr.
* @param timeout: in seconds from now.
* Timer starts running now. Timer may expire if all buffers are used,
* without any query been sent to the server yet.
* @param callback: function to call on error, timeout or reply.
* @param callback_arg: user argument for callback function.
- * @param ssl_upstream: if the tcp connection must use SSL.
* @return: false on error for malloc or socket. Else the pending TCP object.
*/
-struct waiting_tcp* pending_tcp_query(struct outside_network* outnet,
- struct sldns_buffer* packet, struct sockaddr_storage* addr,
- socklen_t addrlen, int timeout, comm_point_callback_t* callback,
- void* callback_arg, int ssl_upstream);
+struct waiting_tcp* pending_tcp_query(struct serviced_query* sq,
+ struct sldns_buffer* packet, int timeout, comm_point_callback_t* callback,
+ void* callback_arg);
/**
* Delete pending answer.
* If the value includes BIT_DO, DO bit is set when in EDNS queries.
* @param want_dnssec: signatures are needed, without EDNS the answer is
* likely to be useless.
+ * @param nocaps: ignore use_caps_for_id and use unperturbed qname.
* @param tcp_upstream: use TCP for upstream queries.
* @param ssl_upstream: use SSL for upstream queries.
* @param callback: callback function.
*/
struct serviced_query* outnet_serviced_query(struct outside_network* outnet,
uint8_t* qname, size_t qnamelen, uint16_t qtype, uint16_t qclass,
- uint16_t flags, int dnssec, int want_dnssec, int tcp_upstream,
- int ssl_upstream, struct sockaddr_storage* addr, socklen_t addrlen,
- uint8_t* zone, size_t zonelen, comm_point_callback_t* callback,
- void* callback_arg, sldns_buffer* buff
+ uint16_t flags, int dnssec, int want_dnssec, int nocaps,
+ int tcp_upstream, int ssl_upstream, struct sockaddr_storage* addr,
+ socklen_t addrlen, uint8_t* zone, size_t zonelen,
+ comm_point_callback_t* callback, void* callback_arg,
+ struct sldns_buffer* buff
#ifdef CLIENT_SUBNET
, struct edns_data* edns
#endif
#include "config.h"
#include "libunbound/unbound.h"
-#include "ldns/rrdef.h"
+#include "sldns/rrdef.h"
#include <expat.h>
#ifndef HAVE_EXPAT_H
#error "need libexpat to parse root-anchors.xml file."
/** print hex data */
static void
-print_data(char* msg, char* data, int len)
+print_data(const char* msg, const char* data, int len)
{
int i;
printf("%s: ", msg);
* Create a new unbound context with the commandline settings applied
*/
static struct ub_ctx*
-create_unbound_context(char* res_conf, char* root_hints, char* debugconf,
- int ip4only, int ip6only)
+create_unbound_context(const char* res_conf, const char* root_hints,
+ const char* debugconf, int ip4only, int ip6only)
{
int r;
struct ub_ctx* ctx = ub_ctx_create();
/** printout certificate in detail */
static void
-verb_cert(char* msg, X509* x)
+verb_cert(const char* msg, X509* x)
{
if(verb == 0 || verb == 1) return;
if(verb == 2) {
/** printout certificates in detail */
static void
-verb_certs(char* msg, STACK_OF(X509)* sk)
+verb_certs(const char* msg, STACK_OF(X509)* sk)
{
int i, num = sk_X509_num(sk);
if(verb == 0 || verb == 1) return;
/* read the certificate file */
static STACK_OF(X509)*
-read_cert_file(char* file)
+read_cert_file(const char* file)
{
STACK_OF(X509)* sk;
FILE* in;
/** read update cert file or use builtin */
static STACK_OF(X509)*
-read_cert_or_builtin(char* file)
+read_cert_or_builtin(const char* file)
{
STACK_OF(X509) *sk = read_cert_file(file);
if(!sk) {
/** printout IP address with message */
static void
-verb_addr(char* msg, struct ip_list* ip)
+verb_addr(const char* msg, struct ip_list* ip)
{
if(verb) {
char out[100];
/** Resolve name, type, class and add addresses to iplist */
static void
-resolve_host_ip(struct ub_ctx* ctx, char* host, int port, int tp, int cl,
+resolve_host_ip(struct ub_ctx* ctx, const char* host, int port, int tp, int cl,
struct ip_list** head)
{
struct ub_result* res = NULL;
/** parse a text IP address into a sockaddr */
static struct ip_list*
-parse_ip_addr(char* str, int port)
+parse_ip_addr(const char* str, int port)
{
socklen_t len = 0;
- struct sockaddr_storage* addr = NULL;
- struct sockaddr_in6 a6;
- struct sockaddr_in a;
+ union {
+ struct sockaddr_in6 a6;
+ struct sockaddr_in a;
+ } addr;
struct ip_list* ip;
uint16_t p = (uint16_t)port;
- memset(&a6, 0, sizeof(a6));
- memset(&a, 0, sizeof(a));
+ memset(&addr, 0, sizeof(addr));
- if(inet_pton(AF_INET6, str, &a6.sin6_addr) > 0) {
+ if(inet_pton(AF_INET6, str, &addr.a6.sin6_addr) > 0) {
/* it is an IPv6 */
- a6.sin6_family = AF_INET6;
- a6.sin6_port = (in_port_t)htons(p);
- addr = (struct sockaddr_storage*)&a6;
- len = (socklen_t)sizeof(struct sockaddr_in6);
+ addr.a6.sin6_family = AF_INET6;
+ addr.a6.sin6_port = (in_port_t)htons(p);
+ len = (socklen_t)sizeof(addr.a6);
}
- if(inet_pton(AF_INET, str, &a.sin_addr) > 0) {
+ if(inet_pton(AF_INET, str, &addr.a.sin_addr) > 0) {
/* it is an IPv4 */
- a.sin_family = AF_INET;
- a.sin_port = (in_port_t)htons(p);
- addr = (struct sockaddr_storage*)&a;
+ addr.a.sin_family = AF_INET;
+ addr.a.sin_port = (in_port_t)htons(p);
len = (socklen_t)sizeof(struct sockaddr_in);
}
if(!len) return NULL;
exit(0);
}
ip->len = len;
- memmove(&ip->addr, addr, len);
+ memmove(&ip->addr, &addr, len);
if(verb) printf("server address is %s\n", str);
return ip;
}
* @return list of IP addresses.
*/
static struct ip_list*
-resolve_name(char* host, int port, char* res_conf, char* root_hints,
- char* debugconf, int ip4only, int ip6only)
+resolve_name(const char* host, int port, const char* res_conf,
+ const char* root_hints, const char* debugconf, int ip4only, int ip6only)
{
struct ub_ctx* ctx;
struct ip_list* list = NULL;
return num;
}
-static int get_random(void)
-{
- int r;
- if (RAND_bytes((unsigned char*)&r, (int)sizeof(r)) == 1) {
- return r;
- }
- return (int)random();
-}
-
/** pick random unused element from IP list */
static struct ip_list*
pick_random_ip(struct ip_list* list)
int sel;
if(num == 0) return NULL;
/* not perfect, but random enough */
- sel = get_random() % num;
+ sel = (int)arc4random_uniform((uint32_t)num);
/* skip over unused elements that we did not select */
while(sel > 0 && p) {
if(!p->used) sel--;
/** write a line over SSL */
static int
-write_ssl_line(SSL* ssl, char* str, char* sec)
+write_ssl_line(SSL* ssl, const char* str, const char* sec)
{
char buf[1024];
size_t l;
{
size_t got = 0;
int r;
- char* data = malloc(len+1);
+ char* data;
+ if(len >= 0xfffffff0)
+ return NULL; /* to protect against integer overflow in malloc*/
+ data = malloc(len+1);
if(!data) {
if(verb) printf("out of memory\n");
return NULL;
/** start HTTP1.1 transaction on SSL */
static int
-write_http_get(SSL* ssl, char* pathname, char* urlname)
+write_http_get(SSL* ssl, const char* pathname, const char* urlname)
{
if(write_ssl_line(ssl, "GET /%s HTTP/1.1", pathname) &&
write_ssl_line(ssl, "Host: %s", urlname) &&
/** https to an IP addr, return BIO with pathname or NULL */
static BIO*
-https_to_ip(struct ip_list* ip, char* pathname, char* urlname)
+https_to_ip(struct ip_list* ip, const char* pathname, const char* urlname)
{
int fd;
SSL* ssl;
* @return a memory BIO with the file in it.
*/
static BIO*
-https(struct ip_list* ip_list, char* pathname, char* urlname)
+https(struct ip_list* ip_list, const char* pathname, const char* urlname)
{
struct ip_list* ip;
BIO* bio = NULL;
* NOT zero terminated.
* @param len: length of this part of the data.
*/
-void
+static void
xml_charhandle(void *userData, const XML_Char *s, int len)
{
struct xml_data* data = (struct xml_data*)userData;
* @return the value or NULL. (ptr into atts).
*/
static const XML_Char*
-find_att(const XML_Char **atts, XML_Char* name)
+find_att(const XML_Char **atts, const XML_Char* name)
{
int i;
for(i=0; atts[i]; i+=2) {
/** See if XML element equals the zone name */
static int
-xml_is_zone_name(BIO* zone, char* name)
+xml_is_zone_name(BIO* zone, const char* name)
{
char buf[1024];
char* z = NULL;
XML_ParserFree(parser);
if(verb >= 4) {
- char* pp = NULL;
- int len;
(void)BIO_seek(data.ds, 0);
len = BIO_get_mem_data(data.ds, &pp);
printf("got DS bio %d: '", len);
/** get valid signers from the list of signers in the signature */
static STACK_OF(X509)*
-get_valid_signers(PKCS7* p7, char* p7signer)
+get_valid_signers(PKCS7* p7, const char* p7signer)
{
int i;
STACK_OF(X509)* validsigners = sk_X509_new_null();
/** verify a PKCS7 signature, false on failure */
static int
-verify_p7sig(BIO* data, BIO* p7s, STACK_OF(X509)* trust, char* p7signer)
+verify_p7sig(BIO* data, BIO* p7s, STACK_OF(X509)* trust, const char* p7signer)
{
PKCS7* p7;
X509_STORE *store = X509_STORE_new();
/** write unsigned root anchor file, a 5011 revoked tp */
static void
-write_unsigned_root(char* root_anchor_file)
+write_unsigned_root(const char* root_anchor_file)
{
FILE* out;
time_t now = time(NULL);
/** write root anchor file */
static void
-write_root_anchor(char* root_anchor_file, BIO* ds)
+write_root_anchor(const char* root_anchor_file, BIO* ds)
{
char* pp = NULL;
int len;
/** Perform the verification and update of the trustanchor file */
static void
-verify_and_update_anchor(char* root_anchor_file, BIO* xml, BIO* p7s,
- STACK_OF(X509)* cert, char* p7signer)
+verify_and_update_anchor(const char* root_anchor_file, BIO* xml, BIO* p7s,
+ STACK_OF(X509)* cert, const char* p7signer)
{
BIO* ds;
/** perform actual certupdate work */
static int
-do_certupdate(char* root_anchor_file, char* root_cert_file,
- char* urlname, char* xmlname, char* p7sname, char* p7signer,
- char* res_conf, char* root_hints, char* debugconf,
- int ip4only, int ip6only, int port, struct ub_result* dnskey)
+do_certupdate(const char* root_anchor_file, const char* root_cert_file,
+ const char* urlname, const char* xmlname, const char* p7sname,
+ const char* p7signer, const char* res_conf, const char* root_hints,
+ const char* debugconf, int ip4only, int ip6only, int port,
+ struct ub_result* dnskey)
{
STACK_OF(X509)* cert;
BIO *xml, *p7s;
* 2 if it is OK.
*/
static int
-try_read_anchor(char* file)
+try_read_anchor(const char* file)
{
int empty = 1;
char line[10240];
/** Write the builtin root anchor to a file */
static void
-write_builtin_anchor(char* file)
+write_builtin_anchor(const char* file)
{
const char* builtin_root_anchor = get_builtin_ds();
FILE* out = fopen(file, "w");
* @return 0 if trustpoint is insecure, 1 on success. Exit on failure.
*/
static int
-provide_builtin(char* root_anchor_file, int* used_builtin)
+provide_builtin(const char* root_anchor_file, int* used_builtin)
{
/* try to read it */
switch(try_read_anchor(root_anchor_file))
* add an autotrust anchor for the root to the context
*/
static void
-add_5011_probe_root(struct ub_ctx* ctx, char* root_anchor_file)
+add_5011_probe_root(struct ub_ctx* ctx, const char* root_anchor_file)
{
int r;
r = ub_ctx_set_option(ctx, "auto-trust-anchor-file:", root_anchor_file);
/** see if ADDPEND keys exist in autotrust file (if possible) */
static int
-read_if_pending_keys(char* file)
+read_if_pending_keys(const char* file)
{
FILE* in = fopen(file, "r");
char line[8192];
/** read last successful probe time from autotrust file (if possible) */
static int32_t
-read_last_success_time(char* file)
+read_last_success_time(const char* file)
{
FILE* in = fopen(file, "r");
char line[1024];
* @return true if certupdate is ok.
*/
static int
-probe_date_allows_certupdate(char* root_anchor_file)
+probe_date_allows_certupdate(const char* root_anchor_file)
{
int has_pending_keys = read_if_pending_keys(root_anchor_file);
int32_t last_success = read_last_success_time(root_anchor_file);
/** perform the unbound-anchor work */
static int
-do_root_update_work(char* root_anchor_file, char* root_cert_file,
- char* urlname, char* xmlname, char* p7sname, char* p7signer,
- char* res_conf, char* root_hints, char* debugconf,
- int ip4only, int ip6only, int force, int port)
+do_root_update_work(const char* root_anchor_file, const char* root_cert_file,
+ const char* urlname, const char* xmlname, const char* p7sname,
+ const char* p7signer, const char* res_conf, const char* root_hints,
+ const char* debugconf, int ip4only, int ip6only, int force, int port)
{
struct ub_ctx* ctx;
struct ub_result* dnskey;
int main(int argc, char* argv[])
{
int c;
- char* root_anchor_file = ROOT_ANCHOR_FILE;
- char* root_cert_file = ROOT_CERT_FILE;
- char* urlname = URLNAME;
- char* xmlname = XMLNAME;
- char* p7sname = P7SNAME;
- char* p7signer = P7SIGNER;
- char* res_conf = NULL;
- char* root_hints = NULL;
- char* debugconf = NULL;
+ const char* root_anchor_file = ROOT_ANCHOR_FILE;
+ const char* root_cert_file = ROOT_CERT_FILE;
+ const char* urlname = URLNAME;
+ const char* xmlname = XMLNAME;
+ const char* p7sname = P7SNAME;
+ const char* p7signer = P7SIGNER;
+ const char* res_conf = NULL;
+ const char* root_hints = NULL;
+ const char* debugconf = NULL;
int dolist=0, ip4only=0, ip6only=0, force=0, port = HTTPS_PORT;
/* parse the options */
while( (c=getopt(argc, argv, "46C:FP:a:c:f:hln:r:s:u:vx:")) != -1) {
#include "iterator/iter_hints.h"
#include "validator/validator.h"
#include "services/localzone.h"
-#include "ldns/sbuffer.h"
+#include "sldns/sbuffer.h"
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#endif
printf(" Checks unbound configuration file for errors.\n");
printf("file if omitted %s is used.\n", CONFIGFILE);
printf("-o option print value of option to stdout.\n");
+ printf("-f output full pathname with chroot applied, eg. with -o pidfile.\n");
printf("-h show this usage help.\n");
printf("Version %s\n", PACKAGE_VERSION);
printf("BSD licensed, see LICENSE in source package for details.\n");
* @param cfg: config
* @param opt: option name without trailing :.
* This is different from config_set_option.
+ * @param final: if final pathname with chroot applied has to be printed.
*/
static void
-print_option(struct config_file* cfg, const char* opt)
+print_option(struct config_file* cfg, const char* opt, int final)
{
+ if(strcmp(opt, "pidfile") == 0 && final) {
+ printf("%s\n", fname_after_chroot(cfg->pidfile, cfg, 1));
+ return;
+ }
if(!config_get_option(cfg, opt, config_print_func, stdout))
fatal_exit("cannot print option '%s'", opt);
}
if(strcmp(cfg->module_conf, "iterator") != 0
&& strcmp(cfg->module_conf, "validator iterator") != 0
+ && strcmp(cfg->module_conf, "dns64 validator iterator") != 0
+ && strcmp(cfg->module_conf, "dns64 iterator") != 0
#ifdef WITH_PYTHONMODULE
&& strcmp(cfg->module_conf, "python iterator") != 0
&& strcmp(cfg->module_conf, "python validator iterator") != 0
&& strcmp(cfg->module_conf, "validator python iterator") != 0
+ && strcmp(cfg->module_conf, "dns64 python iterator") != 0
+ && strcmp(cfg->module_conf, "dns64 python validator iterator") != 0
+ && strcmp(cfg->module_conf, "dns64 validator python iterator") != 0
+ && strcmp(cfg->module_conf, "python dns64 iterator") != 0
+ && strcmp(cfg->module_conf, "python dns64 validator iterator") != 0
#endif
#ifdef CLIENT_SUBNET
&& strcmp(cfg->module_conf, "subnetcache iterator") != 0
- && strcmp(cfg->module_conf, "subnetcache validator iterator") != 0
+ && strcmp(cfg->module_conf, "subnetcache validator iterator") != 0
#endif
) {
fatal_exit("module conf '%s' is not known to work",
endpwent();
}
#endif
- if(cfg->remote_control_enable) {
+ if(cfg->remote_control_enable && cfg->remote_control_use_cert) {
check_chroot_string("server-key-file", &cfg->server_key_file,
cfg->chrootdir, cfg);
check_chroot_string("server-cert-file", &cfg->server_cert_file,
/** check config file */
static void
-checkconf(const char* cfgfile, const char* opt)
+checkconf(const char* cfgfile, const char* opt, int final)
{
struct config_file* cfg = config_create();
if(!cfg)
config_delete(cfg);
exit(1);
}
+ if(opt) {
+ print_option(cfg, opt, final);
+ config_delete(cfg);
+ return;
+ }
morechecks(cfg, cfgfile);
check_mod(cfg, iter_get_funcblock());
check_mod(cfg, val_get_funcblock());
#endif
check_fwd(cfg);
check_hints(cfg);
- if(opt) print_option(cfg, opt);
- else printf("unbound-checkconf: no errors in %s\n", cfgfile);
+ printf("unbound-checkconf: no errors in %s\n", cfgfile);
config_delete(cfg);
}
int main(int argc, char* argv[])
{
int c;
+ int final = 0;
const char* f;
const char* opt = NULL;
const char* cfgfile = CONFIGFILE;
cfgfile = CONFIGFILE;
#endif /* USE_WINSOCK */
/* parse the options */
- while( (c=getopt(argc, argv, "ho:")) != -1) {
+ while( (c=getopt(argc, argv, "fho:")) != -1) {
switch(c) {
+ case 'f':
+ final = 1;
+ break;
case 'o':
opt = optarg;
break;
if(argc == 1)
f = argv[0];
else f = cfgfile;
- checkconf(f, opt);
+ checkconf(f, opt, final);
checklock_stop();
return 0;
}
DAYS=7200
# size of keys in bits
-BITS=1536
+BITS=3072
# hash algorithm
HASH=sha256
# base name for unbound-control keys
CTL_BASE=unbound_control
-# we want -rw-r--- access (say you run this as root: grp=yes (server), all=no).
-umask 0026
+# we want -rw-r----- access (say you run this as root: grp=yes (server), all=no).
+umask 0027
# end of options
#include "util/locks.h"
#include "util/net_help.h"
+#ifdef HAVE_SYS_UN_H
+#include <sys/un.h>
+#endif
+
/** Give unbound-control usage, and exit (1). */
static void
usage()
printf(" get_option opt get option value\n");
printf(" list_stubs list stub-zones and root hints in use\n");
printf(" list_forwards list forward-zones in use\n");
+ printf(" list_insecure list domain-insecure zones\n");
printf(" list_local_zones list local-zones in use\n");
printf(" list_local_data list local-data RRs in use\n");
printf(" insecure_add zone add domain-insecure zone\n");
printf(" forward [off | addr ...] without arg show forward setup\n");
printf(" or off to turn off root forwarding\n");
printf(" or give list of ip addresses\n");
+ printf(" ratelimit_list [+a] list ratelimited domains\n");
+ printf(" +a list all, also not ratelimited\n");
printf("Version %s\n", PACKAGE_VERSION);
printf("BSD licensed, see LICENSE in source package for details.\n");
printf("Report bugs to %s\n", PACKAGE_BUGREPORT);
static SSL_CTX*
setup_ctx(struct config_file* cfg)
{
- char* s_cert, *c_key, *c_cert;
+ char* s_cert=NULL, *c_key=NULL, *c_cert=NULL;
SSL_CTX* ctx;
- s_cert = fname_after_chroot(cfg->server_cert_file, cfg, 1);
- c_key = fname_after_chroot(cfg->control_key_file, cfg, 1);
- c_cert = fname_after_chroot(cfg->control_cert_file, cfg, 1);
- if(!s_cert || !c_key || !c_cert)
- fatal_exit("out of memory");
+ if(cfg->remote_control_use_cert) {
+ s_cert = fname_after_chroot(cfg->server_cert_file, cfg, 1);
+ c_key = fname_after_chroot(cfg->control_key_file, cfg, 1);
+ c_cert = fname_after_chroot(cfg->control_cert_file, cfg, 1);
+ if(!s_cert || !c_key || !c_cert)
+ fatal_exit("out of memory");
+ }
ctx = SSL_CTX_new(SSLv23_client_method());
if(!ctx)
ssl_err("could not allocate SSL_CTX pointer");
if(!(SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2) & SSL_OP_NO_SSLv2))
ssl_err("could not set SSL_OP_NO_SSLv2");
- if(!SSL_CTX_use_certificate_file(ctx,c_cert,SSL_FILETYPE_PEM) ||
- !SSL_CTX_use_PrivateKey_file(ctx,c_key,SSL_FILETYPE_PEM)
- || !SSL_CTX_check_private_key(ctx))
- ssl_err("Error setting up SSL_CTX client key and cert");
- if (SSL_CTX_load_verify_locations(ctx, s_cert, NULL) != 1)
- ssl_err("Error setting up SSL_CTX verify, server cert");
- SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, NULL);
+ if(cfg->remote_control_use_cert) {
+ if(!(SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv3) & SSL_OP_NO_SSLv3))
+ ssl_err("could not set SSL_OP_NO_SSLv3");
+ if(!SSL_CTX_use_certificate_file(ctx,c_cert,SSL_FILETYPE_PEM) ||
+ !SSL_CTX_use_PrivateKey_file(ctx,c_key,SSL_FILETYPE_PEM)
+ || !SSL_CTX_check_private_key(ctx))
+ ssl_err("Error setting up SSL_CTX client key and cert");
+ if (SSL_CTX_load_verify_locations(ctx, s_cert, NULL) != 1)
+ ssl_err("Error setting up SSL_CTX verify, server cert");
+ SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, NULL);
- free(s_cert);
- free(c_key);
- free(c_cert);
+ free(s_cert);
+ free(c_key);
+ free(c_cert);
+ } else {
+ /* Use ciphers that don't require authentication */
+ if(!SSL_CTX_set_cipher_list(ctx, "aNULL"))
+ ssl_err("Error setting NULL cipher!");
+ }
return ctx;
}
{
struct sockaddr_storage addr;
socklen_t addrlen;
+ int addrfamily = 0;
int fd;
/* use svr or the first config entry */
if(!svr) {
if(strchr(svr, '@')) {
if(!extstrtoaddr(svr, &addr, &addrlen))
fatal_exit("could not parse IP@port: %s", svr);
+#ifdef HAVE_SYS_UN_H
+ } else if(svr[0] == '/') {
+ struct sockaddr_un* usock = (struct sockaddr_un *) &addr;
+ usock->sun_family = AF_LOCAL;
+#ifdef HAVE_STRUCT_SOCKADDR_UN_SUN_LEN
+ usock->sun_len = (socklen_t)sizeof(usock);
+#endif
+ (void)strlcpy(usock->sun_path, svr, sizeof(usock->sun_path));
+ addrlen = (socklen_t)sizeof(struct sockaddr_un);
+ addrfamily = AF_LOCAL;
+#endif
} else {
if(!ipstrtoaddr(svr, cfg->control_port, &addr, &addrlen))
fatal_exit("could not parse IP: %s", svr);
}
- fd = socket(addr_is_ip6(&addr, addrlen)?AF_INET6:AF_INET,
- SOCK_STREAM, 0);
+
+ if(addrfamily == 0)
+ addrfamily = addr_is_ip6(&addr, addrlen)?AF_INET6:AF_INET;
+ fd = socket(addrfamily, SOCK_STREAM, 0);
if(fd == -1) {
#ifndef USE_WINSOCK
fatal_exit("socket: %s", strerror(errno));
/** setup SSL on the connection */
static SSL*
-setup_ssl(SSL_CTX* ctx, int fd)
+setup_ssl(SSL_CTX* ctx, int fd, struct config_file* cfg)
{
SSL* ssl;
X509* x;
/* check authenticity of server */
if(SSL_get_verify_result(ssl) != X509_V_OK)
ssl_err("SSL verification failed");
- x = SSL_get_peer_certificate(ssl);
- if(!x)
- ssl_err("Server presented no peer certificate");
- X509_free(x);
+ if(cfg->remote_control_use_cert) {
+ x = SSL_get_peer_certificate(ssl);
+ if(!x)
+ ssl_err("Server presented no peer certificate");
+ X509_free(x);
+ }
+
return ssl;
}
if(!cfg->remote_control_enable)
log_warn("control-enable is 'no' in the config file.");
ctx = setup_ctx(cfg);
-
+
/* contact server */
fd = contact_server(svr, cfg, argc>0&&strcmp(argv[0],"status")==0);
- ssl = setup_ssl(ctx, fd);
-
+ ssl = setup_ssl(ctx, fd, cfg);
+
/* send command */
ret = go_cmd(ssl, quiet, argc, argv);
#define unbound_lite_wrapstr(s) s
#endif
#include "libunbound/unbound.h"
-#include "ldns/rrdef.h"
-#include "ldns/wire2str.h"
+#include "sldns/rrdef.h"
+#include "sldns/wire2str.h"
#ifdef HAVE_NSS
/* nss3 */
#include "nss.h"
printf(" -c class what class to look for, if not class IN.\n");
printf(" -y 'keystring' specify trust anchor, DS or DNSKEY, like\n");
printf(" -y 'example.com DS 31560 5 1 1CFED8478...'\n");
+ printf(" -D DNSSEC enable with default root anchor\n");
+ printf(" from %s\n", ROOT_ANCHOR_FILE);
printf(" -f keyfile read trust anchors from file, with lines as -y.\n");
printf(" -F keyfile read named.conf-style trust anchors.\n");
printf(" -C config use the specified unbound.conf (none read by default)\n");
/** getopt global, in case header files fail to declare it. */
extern char* optarg;
-/** Main routine for checkconf */
+/** Main routine for unbound-host */
int main(int argc, char* argv[])
{
int c;
fprintf(stderr, "error: out of memory\n");
exit(1);
}
+ /* no need to fetch additional targets, we only do few lookups */
+ check_ub_res(ub_ctx_set_option(ctx, "target-fetch-policy:", "0 0 0 0 0"));
/* parse the options */
- while( (c=getopt(argc, argv, "46F:c:df:hrt:vy:C:")) != -1) {
+ while( (c=getopt(argc, argv, "46DF:c:df:hrt:vy:C:")) != -1) {
switch(c) {
case '4':
check_ub_res(ub_ctx_set_option(ctx, "do-ip6:", "no"));
case 'C':
check_ub_res(ub_ctx_config(ctx, optarg));
break;
+ case 'D':
+ check_ub_res(ub_ctx_add_ta_file(ctx, ROOT_ANCHOR_FILE));
+ break;
case 'd':
debuglevel++;
if(debuglevel < 2)
* linked into the resulting program.
*/
#include "config.h"
+#include "libunbound/context.h"
+#include "libunbound/worker.h"
+#include "util/fptr_wlist.h"
#include "util/log.h"
#include "services/mesh.h"
-struct comm_reply;
-struct comm_point;
-struct module_qstate;
-struct tube;
void worker_handle_control_cmd(struct tube* ATTR_UNUSED(tube),
uint8_t* ATTR_UNUSED(buffer), size_t ATTR_UNUSED(len),
struct outbound_entry* worker_send_query(uint8_t* ATTR_UNUSED(qname),
size_t ATTR_UNUSED(qnamelen), uint16_t ATTR_UNUSED(qtype),
uint16_t ATTR_UNUSED(qclass), uint16_t ATTR_UNUSED(flags),
- int ATTR_UNUSED(dnssec), int ATTR_UNUSED(want_dnssec),
- struct sockaddr_storage* ATTR_UNUSED(addr),
- socklen_t ATTR_UNUSED(addrlen), struct module_qstate* ATTR_UNUSED(q))
+ int ATTR_UNUSED(dnssec), int ATTR_UNUSED(want_dnssec),
+ int ATTR_UNUSED(nocaps), struct sockaddr_storage* ATTR_UNUSED(addr),
+ socklen_t ATTR_UNUSED(addrlen), uint8_t* ATTR_UNUSED(zone),
+ size_t ATTR_UNUSED(zonelen), struct module_qstate* ATTR_UNUSED(q))
{
log_assert(0);
return 0;
size_t ATTR_UNUSED(qnamelen), uint16_t ATTR_UNUSED(qtype),
uint16_t ATTR_UNUSED(qclass), uint16_t ATTR_UNUSED(flags),
int ATTR_UNUSED(dnssec), int ATTR_UNUSED(want_dnssec),
- struct sockaddr_storage* ATTR_UNUSED(addr),
- socklen_t ATTR_UNUSED(addrlen), struct module_qstate* ATTR_UNUSED(q))
+ int ATTR_UNUSED(nocaps), struct sockaddr_storage* ATTR_UNUSED(addr),
+ socklen_t ATTR_UNUSED(addrlen), uint8_t* ATTR_UNUSED(zone),
+ size_t ATTR_UNUSED(zonelen), struct module_qstate* ATTR_UNUSED(q))
{
log_assert(0);
return 0;
#include "libunbound/context.h"
#include "util/locks.h"
#include "util/log.h"
-#include "ldns/rrdef.h"
+#include "sldns/rrdef.h"
#ifdef UNBOUND_ALLOC_LITE
#undef malloc
#undef calloc
/** if key has been created */
static int key_created = 0;
+/** if the key was deleted, i.e. we have quit */
+static int key_deleted = 0;
/** we hide the thread debug info with this key. */
static ub_thread_key_t thr_debug_key;
/** the list of threads, so all threads can be examined. NULL if unused. */
thr_debug_key);
if(!e)
fatal_exit("%s %s %d: out of memory", func, file, line);
+ if(!thr) {
+ /* this is called when log_init() calls lock_init()
+ * functions, and the test check code has not yet
+ * been initialised. But luckily, the checklock_start()
+ * routine can be called multiple times without ill effect.
+ */
+ checklock_start();
+ thr = (struct thr_check*)pthread_getspecific(thr_debug_key);
+ }
if(!thr)
fatal_exit("%s %s %d: lock_init no thread info", func, file,
line);
/** init the main thread */
void checklock_start(void)
{
+ if(key_deleted)
+ return;
if(!key_created) {
struct thr_check* thisthr = (struct thr_check*)calloc(1,
sizeof(struct thr_check));
{
if(key_created) {
int i;
+ key_deleted = 1;
if(check_locking_order)
fclose(thread_infos[0]->order_info);
free(thread_infos[0]);
#include <sys/time.h>
#include "util/net_help.h"
#include "util/config_file.h"
-#include "ldns/sbuffer.h"
+#include "sldns/sbuffer.h"
#include <signal.h>
/** number of reads per select for delayer */
test_tool_avail "dig"
test_tool_avail "ldns-testns"
-# test for ipv6, uses streamptcp peculiarity.
+# test for ipv6, uses streamtcp peculiarity.
if ./streamtcp -f ::1 2>&1 | grep "not supported" >/dev/null 2>&1; then
HAVE_IPV6=no
else
fi
fi
if test $SKIP -eq 0; then
- #echo -n "$test "
+ echo $test
sh ../testcode/mini_tpkg.sh -a ../.. exe $test
else
echo "skip $test"
#include "testcode/testpkts.h"
#include "util/log.h"
#include "util/fptr_wlist.h"
-#include "ldns/sbuffer.h"
-#include "ldns/wire2str.h"
-#include "ldns/str2wire.h"
+#include "sldns/sbuffer.h"
+#include "sldns/wire2str.h"
+#include "sldns/str2wire.h"
#ifdef CLIENT_SUBNET
#include "edns-subnet/subnet-whitelist.h"
#endif
struct listen_dnsport*
listen_create(struct comm_base* base, struct listen_port* ATTR_UNUSED(ports),
size_t bufsize, int ATTR_UNUSED(tcp_accept_count),
- void* ATTR_UNUSED(sslctx), comm_point_callback_t* cb, void* cb_arg)
+ void* ATTR_UNUSED(sslctx), struct dt_env* ATTR_UNUSED(dtenv),
+ comm_point_callback_t* cb, void* cb_arg)
{
struct replay_runtime* runtime = (struct replay_runtime*)base;
struct listen_dnsport* l= calloc(1, sizeof(struct listen_dnsport));
free(repinfo->c);
}
}
+
#ifdef CLIENT_SUBNET
struct outside_network*
outside_network_create(struct comm_base* base, size_t bufsize,
int ATTR_UNUSED(numavailports), size_t ATTR_UNUSED(unwanted_threshold),
void (*unwanted_action)(void*), void* ATTR_UNUSED(unwanted_param),
int ATTR_UNUSED(do_udp), void* ATTR_UNUSED(sslctx),
- int ATTR_UNUSED(delayclose),
+ int ATTR_UNUSED(delayclose), struct dt_env* ATTR_UNUSED(dtenv),
struct ednssubnet_upstream* edns_subnet_upstreams)
#else
struct outside_network*
int ATTR_UNUSED(numavailports), size_t ATTR_UNUSED(unwanted_threshold),
void (*unwanted_action)(void*), void* ATTR_UNUSED(unwanted_param),
int ATTR_UNUSED(do_udp), void* ATTR_UNUSED(sslctx),
- int ATTR_UNUSED(delayclose))
+ int ATTR_UNUSED(delayclose), struct dt_env* ATTR_UNUSED(dtenv))
#endif
{
struct replay_runtime* runtime = (struct replay_runtime*)base;
}
struct pending*
-pending_udp_query(struct outside_network* outnet, sldns_buffer* packet,
- struct sockaddr_storage* addr, socklen_t addrlen, int timeout,
- comm_point_callback_t* callback, void* callback_arg)
+pending_udp_query(struct serviced_query* sq, sldns_buffer* packet,
+ int timeout, comm_point_callback_t* callback, void* callback_arg)
{
- struct replay_runtime* runtime = (struct replay_runtime*)outnet->base;
+ struct replay_runtime* runtime = (struct replay_runtime*)
+ sq->outnet->base;
struct fake_pending* pend = (struct fake_pending*)calloc(1,
sizeof(struct fake_pending));
log_assert(pend);
sldns_buffer_write(pend->buffer, sldns_buffer_begin(packet),
sldns_buffer_limit(packet));
sldns_buffer_flip(pend->buffer);
- memcpy(&pend->addr, addr, addrlen);
- pend->addrlen = addrlen;
+ memcpy(&pend->addr, &sq->addr, sq->addrlen);
+ pend->addrlen = sq->addrlen;
pend->callback = callback;
pend->cb_arg = callback_arg;
pend->timeout = timeout/1000;
return (struct pending*)pend;
}
-struct waiting_tcp*
-pending_tcp_query(struct outside_network* outnet, sldns_buffer* packet,
- struct sockaddr_storage* addr, socklen_t addrlen, int timeout,
- comm_point_callback_t* callback, void* callback_arg,
- int ATTR_UNUSED(ssl_upstream))
+struct waiting_tcp*
+pending_tcp_query(struct serviced_query* sq, sldns_buffer* packet,
+ int timeout, comm_point_callback_t* callback, void* callback_arg)
{
- struct replay_runtime* runtime = (struct replay_runtime*)outnet->base;
+ struct replay_runtime* runtime = (struct replay_runtime*)
+ sq->outnet->base;
struct fake_pending* pend = (struct fake_pending*)calloc(1,
sizeof(struct fake_pending));
log_assert(pend);
sldns_buffer_write(pend->buffer, sldns_buffer_begin(packet),
sldns_buffer_limit(packet));
sldns_buffer_flip(pend->buffer);
- memcpy(&pend->addr, addr, addrlen);
- pend->addrlen = addrlen;
+ memcpy(&pend->addr, &sq->addr, sq->addrlen);
+ pend->addrlen = sq->addrlen;
pend->callback = callback;
pend->cb_arg = callback_arg;
pend->timeout = timeout;
runtime->pending_list = pend;
return (struct waiting_tcp*)pend;
}
+
#ifdef CLIENT_SUBNET
struct serviced_query* outnet_serviced_query(struct outside_network* outnet,
uint8_t* qname, size_t qnamelen, uint16_t qtype, uint16_t qclass,
uint16_t flags, int dnssec, int ATTR_UNUSED(want_dnssec),
- int ATTR_UNUSED(tcp_upstream), int ATTR_UNUSED(ssl_upstream),
- struct sockaddr_storage* addr, socklen_t addrlen, uint8_t* zone,
- size_t zonelen, comm_point_callback_t* callback, void* callback_arg,
+ int ATTR_UNUSED(nocaps), int ATTR_UNUSED(tcp_upstream),
+ int ATTR_UNUSED(ssl_upstream), struct sockaddr_storage* addr,
+ socklen_t addrlen, uint8_t* zone, size_t zonelen,
+ comm_point_callback_t* callback, void* callback_arg,
sldns_buffer* ATTR_UNUSED(buff), struct edns_data* edns_out)
#else
struct serviced_query* outnet_serviced_query(struct outside_network* outnet,
uint8_t* qname, size_t qnamelen, uint16_t qtype, uint16_t qclass,
uint16_t flags, int dnssec, int ATTR_UNUSED(want_dnssec),
- int ATTR_UNUSED(tcp_upstream), int ATTR_UNUSED(ssl_upstream),
- struct sockaddr_storage* addr, socklen_t addrlen, uint8_t* zone,
- size_t zonelen, comm_point_callback_t* callback, void* callback_arg,
+ int ATTR_UNUSED(nocaps), int ATTR_UNUSED(tcp_upstream),
+ int ATTR_UNUSED(ssl_upstream), struct sockaddr_storage* addr,
+ socklen_t addrlen, uint8_t* zone, size_t zonelen,
+ comm_point_callback_t* callback, void* callback_arg,
sldns_buffer* ATTR_UNUSED(buff))
#endif
{
+++ /dev/null
-/*
- * ldns-testpkts. Data file parse for test packets, and query matching.
- *
- * Data storage for specially crafted replies for testing purposes.
- *
- * (c) NLnet Labs, 2005, 2006, 2007, 2008
- * See the file LICENSE for the license
- */
-
-/**
- * \file
- * This is a debugging aid. It is not efficient, especially
- * with a long config file, but it can give any reply to any query.
- * This can help the developer pre-script replies for queries.
- *
- * You can specify a packet RR by RR with header flags to return.
- *
- * Missing features:
- * - matching content different from reply content.
- * - find way to adjust mangled packets?
- */
-
-#include "config.h"
-struct sockaddr_storage;
-#include <ldns/ldns.h>
-#include <errno.h>
-#include "ldns-testpkts.h"
-
-/** max line length */
-#define MAX_LINE 10240
-/** string to show in warnings and errors */
-static const char* prog_name = "ldns-testpkts";
-
-#ifndef UTIL_LOG_H
-/** verbosity definition for compat */
-enum verbosity_value { NO_VERBOSE=0 };
-#endif
-/** logging routine, provided by caller */
-void verbose(enum verbosity_value lvl, const char* msg, ...) ATTR_FORMAT(printf, 2, 3);
-
-/** print error and exit */
-static void error(const char* msg, ...)
-{
- va_list args;
- va_start(args, msg);
- fprintf(stderr, "%s error: ", prog_name);
- vfprintf(stderr, msg, args);
- fprintf(stderr, "\n");
- fflush(stderr);
- va_end(args);
- exit(EXIT_FAILURE);
-}
-
-/** return if string is empty or comment */
-static bool isendline(char c)
-{
- if(c == ';' || c == '#'
- || c == '\n' || c == 0)
- return true;
- return false;
-}
-
-/** true if the string starts with the keyword given. Moves the str ahead.
- * @param str: before keyword, afterwards after keyword and spaces.
- * @param keyword: the keyword to match
- * @return: true if keyword present. False otherwise, and str unchanged.
-*/
-static bool str_keyword(char** str, const char* keyword)
-{
- size_t len = strlen(keyword);
- assert(str && keyword);
- if(strncmp(*str, keyword, len) != 0)
- return false;
- *str += len;
- while(isspace((int)**str))
- (*str)++;
- return true;
-}
-
-/** Add reply packet to entry */
-static struct reply_packet*
-entry_add_reply(struct entry* entry)
-{
- struct reply_packet* pkt = (struct reply_packet*)malloc(
- sizeof(struct reply_packet));
- struct reply_packet ** p = &entry->reply_list;
- pkt->next = NULL;
- pkt->packet_sleep = 0;
- pkt->reply = ldns_pkt_new();
- pkt->reply_from_hex = NULL;
- pkt->raw_ednsdata = NULL;
- /* link at end */
- while(*p)
- p = &((*p)->next);
- *p = pkt;
- return pkt;
-}
-
-/** parse MATCH line */
-static void matchline(char* line, struct entry* e)
-{
- char* parse = line;
- while(*parse) {
- if(isendline(*parse))
- return;
- if(str_keyword(&parse, "opcode")) {
- e->match_opcode = true;
- } else if(str_keyword(&parse, "qtype")) {
- e->match_qtype = true;
- } else if(str_keyword(&parse, "qname")) {
- e->match_qname = true;
- } else if(str_keyword(&parse, "subdomain")) {
- e->match_subdomain = true;
- } else if(str_keyword(&parse, "all")) {
- e->match_all = true;
- } else if(str_keyword(&parse, "ttl")) {
- e->match_ttl = true;
- } else if(str_keyword(&parse, "DO")) {
- e->match_do = true;
- } else if(str_keyword(&parse, "noedns")) {
- e->match_noedns = true;
- } else if(str_keyword(&parse, "ednsdata")) {
- e->match_ednsdata_raw = true;
- } else if(str_keyword(&parse, "UDP")) {
- e->match_transport = transport_udp;
- } else if(str_keyword(&parse, "TCP")) {
- e->match_transport = transport_tcp;
- } else if(str_keyword(&parse, "serial")) {
- e->match_serial = true;
- if(*parse != '=' && *parse != ':')
- error("expected = or : in MATCH: %s", line);
- parse++;
- e->ixfr_soa_serial = (uint32_t)strtol(parse, (char**)&parse, 10);
- while(isspace((int)*parse))
- parse++;
- } else {
- error("could not parse MATCH: '%s'", parse);
- }
- }
-}
-
-/** parse REPLY line */
-static void replyline(char* line, ldns_pkt *reply)
-{
- char* parse = line;
- while(*parse) {
- if(isendline(*parse))
- return;
- /* opcodes */
- if(str_keyword(&parse, "QUERY")) {
- ldns_pkt_set_opcode(reply, LDNS_PACKET_QUERY);
- } else if(str_keyword(&parse, "IQUERY")) {
- ldns_pkt_set_opcode(reply, LDNS_PACKET_IQUERY);
- } else if(str_keyword(&parse, "STATUS")) {
- ldns_pkt_set_opcode(reply, LDNS_PACKET_STATUS);
- } else if(str_keyword(&parse, "NOTIFY")) {
- ldns_pkt_set_opcode(reply, LDNS_PACKET_NOTIFY);
- } else if(str_keyword(&parse, "UPDATE")) {
- ldns_pkt_set_opcode(reply, LDNS_PACKET_UPDATE);
- /* rcodes */
- } else if(str_keyword(&parse, "NOERROR")) {
- ldns_pkt_set_rcode(reply, LDNS_RCODE_NOERROR);
- } else if(str_keyword(&parse, "FORMERR")) {
- ldns_pkt_set_rcode(reply, LDNS_RCODE_FORMERR);
- } else if(str_keyword(&parse, "SERVFAIL")) {
- ldns_pkt_set_rcode(reply, LDNS_RCODE_SERVFAIL);
- } else if(str_keyword(&parse, "NXDOMAIN")) {
- ldns_pkt_set_rcode(reply, LDNS_RCODE_NXDOMAIN);
- } else if(str_keyword(&parse, "NOTIMPL")) {
- ldns_pkt_set_rcode(reply, LDNS_RCODE_NOTIMPL);
- } else if(str_keyword(&parse, "REFUSED")) {
- ldns_pkt_set_rcode(reply, LDNS_RCODE_REFUSED);
- } else if(str_keyword(&parse, "YXDOMAIN")) {
- ldns_pkt_set_rcode(reply, LDNS_RCODE_YXDOMAIN);
- } else if(str_keyword(&parse, "YXRRSET")) {
- ldns_pkt_set_rcode(reply, LDNS_RCODE_YXRRSET);
- } else if(str_keyword(&parse, "NXRRSET")) {
- ldns_pkt_set_rcode(reply, LDNS_RCODE_NXRRSET);
- } else if(str_keyword(&parse, "NOTAUTH")) {
- ldns_pkt_set_rcode(reply, LDNS_RCODE_NOTAUTH);
- } else if(str_keyword(&parse, "NOTZONE")) {
- ldns_pkt_set_rcode(reply, LDNS_RCODE_NOTZONE);
- /* flags */
- } else if(str_keyword(&parse, "QR")) {
- ldns_pkt_set_qr(reply, true);
- } else if(str_keyword(&parse, "AA")) {
- ldns_pkt_set_aa(reply, true);
- } else if(str_keyword(&parse, "TC")) {
- ldns_pkt_set_tc(reply, true);
- } else if(str_keyword(&parse, "RD")) {
- ldns_pkt_set_rd(reply, true);
- } else if(str_keyword(&parse, "CD")) {
- ldns_pkt_set_cd(reply, true);
- } else if(str_keyword(&parse, "RA")) {
- ldns_pkt_set_ra(reply, true);
- } else if(str_keyword(&parse, "AD")) {
- ldns_pkt_set_ad(reply, true);
- } else if(str_keyword(&parse, "DO")) {
- ldns_pkt_set_edns_udp_size(reply, 4096);
- ldns_pkt_set_edns_do(reply, true);
- } else {
- error("could not parse REPLY: '%s'", parse);
- }
- }
-}
-
-/** parse ADJUST line */
-static void adjustline(char* line, struct entry* e,
- struct reply_packet* pkt)
-{
- char* parse = line;
- while(*parse) {
- if(isendline(*parse))
- return;
- if(str_keyword(&parse, "copy_id")) {
- e->copy_id = true;
- } else if(str_keyword(&parse, "copy_query")) {
- e->copy_query = true;
- } else if(str_keyword(&parse, "copy_ednsdata_assume_clientsubnet")) {
- e->copy_ednsdata_assume_clientsubnet = true;
- } else if(str_keyword(&parse, "sleep=")) {
- e->sleeptime = (unsigned int) strtol(parse, (char**)&parse, 10);
- while(isspace((int)*parse))
- parse++;
- } else if(str_keyword(&parse, "packet_sleep=")) {
- pkt->packet_sleep = (unsigned int) strtol(parse, (char**)&parse, 10);
- while(isspace((int)*parse))
- parse++;
- } else {
- error("could not parse ADJUST: '%s'", parse);
- }
- }
-}
-
-/** create new entry */
-static struct entry* new_entry()
-{
- struct entry* e = LDNS_MALLOC(struct entry);
- memset(e, 0, sizeof(*e));
- e->match_opcode = false;
- e->match_qtype = false;
- e->match_qname = false;
- e->match_subdomain = false;
- e->match_all = false;
- e->match_ttl = false;
- e->match_do = false;
- e->match_noedns = false;
- e->match_serial = false;
- e->ixfr_soa_serial = 0;
- e->match_transport = transport_any;
- e->reply_list = NULL;
- e->copy_id = false;
- e->copy_query = false;
- e->copy_ednsdata_assume_clientsubnet = false;
- e->sleeptime = 0;
- e->next = NULL;
- return e;
-}
-
-/**
- * Converts a hex string to binary data
- * @param hexstr: string of hex.
- * @param len: is the length of the string
- * @param buf: is the buffer to store the result in
- * @param offset: is the starting position in the result buffer
- * @param buf_len: is the length of buf.
- * @return This function returns the length of the result
- */
-static size_t
-hexstr2bin(char *hexstr, int len, uint8_t *buf, size_t offset, size_t buf_len)
-{
- char c;
- int i;
- uint8_t int8 = 0;
- int sec = 0;
- size_t bufpos = 0;
-
- if (len % 2 != 0) {
- return 0;
- }
-
- for (i=0; i<len; i++) {
- c = hexstr[i];
-
- /* case insensitive, skip spaces */
- if (c != ' ') {
- if (c >= '0' && c <= '9') {
- int8 += c & 0x0f;
- } else if (c >= 'a' && c <= 'z') {
- int8 += (c & 0x0f) + 9;
- } else if (c >= 'A' && c <= 'Z') {
- int8 += (c & 0x0f) + 9;
- } else {
- return 0;
- }
-
- if (sec == 0) {
- int8 = int8 << 4;
- sec = 1;
- } else {
- if (bufpos + offset + 1 <= buf_len) {
- buf[bufpos+offset] = int8;
- int8 = 0;
- sec = 0;
- bufpos++;
- } else {
- fprintf(stderr, "Buffer too small in hexstr2bin");
- }
- }
- }
- }
- return bufpos;
-}
-
-/** convert hex buffer to binary buffer */
-static ldns_buffer *
-data_buffer2wire(ldns_buffer *data_buffer)
-{
- ldns_buffer *wire_buffer = NULL;
- int c;
-
- /* stat hack
- * 0 = normal
- * 1 = comment (skip to end of line)
- * 2 = unprintable character found, read binary data directly
- */
- size_t data_buf_pos = 0;
- int state = 0;
- uint8_t *hexbuf;
- int hexbufpos = 0;
- size_t wirelen;
- uint8_t *data_wire = (uint8_t *) ldns_buffer_begin(data_buffer);
- uint8_t *wire = LDNS_XMALLOC(uint8_t, LDNS_MAX_PACKETLEN);
-
- hexbuf = LDNS_XMALLOC(uint8_t, LDNS_MAX_PACKETLEN);
- for (data_buf_pos = 0; data_buf_pos < ldns_buffer_position(data_buffer); data_buf_pos++) {
- c = (int) data_wire[data_buf_pos];
-
- if (state < 2 && !isascii(c)) {
- /*verbose("non ascii character found in file: (%d) switching to raw mode\n", c);*/
- state = 2;
- }
- switch (state) {
- case 0:
- if ( (c >= '0' && c <= '9') ||
- (c >= 'a' && c <= 'f') ||
- (c >= 'A' && c <= 'F') )
- {
- if (hexbufpos >= LDNS_MAX_PACKETLEN) {
- error("buffer overflow");
- LDNS_FREE(hexbuf);
- return 0;
-
- }
- hexbuf[hexbufpos] = (uint8_t) c;
- hexbufpos++;
- } else if (c == ';') {
- state = 1;
- } else if (c == ' ' || c == '\t' || c == '\n') {
- /* skip whitespace */
- }
- break;
- case 1:
- if (c == '\n' || c == EOF) {
- state = 0;
- }
- break;
- case 2:
- if (hexbufpos >= LDNS_MAX_PACKETLEN) {
- error("buffer overflow");
- LDNS_FREE(hexbuf);
- return 0;
- }
- hexbuf[hexbufpos] = (uint8_t) c;
- hexbufpos++;
- break;
- }
- }
-
- if (hexbufpos >= LDNS_MAX_PACKETLEN) {
- /*verbose("packet size reached\n");*/
- }
-
- /* lenient mode: length must be multiple of 2 */
- if (hexbufpos % 2 != 0) {
- if (hexbufpos >= LDNS_MAX_PACKETLEN) {
- error("buffer overflow");
- LDNS_FREE(hexbuf);
- return 0;
- }
- hexbuf[hexbufpos] = (uint8_t) '0';
- hexbufpos++;
- }
-
- if (state < 2) {
- if (!(wire_buffer = LDNS_MALLOC(ldns_buffer)))
- error("Could not allocate buffer for hex data\n");
- wirelen = hexstr2bin((char *) hexbuf, hexbufpos, wire, 0, LDNS_MAX_PACKETLEN);
- ldns_buffer_new_frm_data(wire_buffer, wire, wirelen);
- } else {
- error("Incomplete hex data, not at byte boundary\n");
- }
- LDNS_FREE(wire);
- LDNS_FREE(hexbuf);
- return wire_buffer;
-}
-
-/** parse ORIGIN */
-static void
-get_origin(const char* name, int lineno, ldns_rdf** origin, char* parse)
-{
- /* snip off rest of the text so as to make the parse work in ldns */
- char* end;
- char store;
- ldns_status status;
-
- ldns_rdf_free(*origin);
- *origin = NULL;
-
- end=parse;
- while(!isspace((int)*end) && !isendline(*end))
- end++;
- store = *end;
- *end = 0;
- verbose(3, "parsing '%s'\n", parse);
- status = ldns_str2rdf_dname(origin, parse);
- *end = store;
- if (status != LDNS_STATUS_OK)
- error("%s line %d:\n\t%s: %s", name, lineno,
- ldns_get_errorstr_by_id(status), parse);
-}
-
-/* Reads one entry from file. Returns entry or NULL on error. */
-struct entry*
-read_entry(FILE* in, const char* name, int *lineno, uint32_t* default_ttl,
- ldns_rdf** origin, ldns_rdf** prev_rr, int skip_whitespace)
-{
- struct entry* current = NULL;
- char line[MAX_LINE];
- char* parse;
- ldns_pkt_section add_section = LDNS_SECTION_QUESTION;
- struct reply_packet *cur_reply = NULL;
- bool reading_hex = false;
- bool reading_hex_ednsdata = false;
- ldns_buffer* hex_data_buffer = NULL;
- ldns_buffer* hex_ednsdata_buffer = NULL;
-
- while(fgets(line, (int)sizeof(line), in) != NULL) {
- line[MAX_LINE-1] = 0;
- parse = line;
- (*lineno) ++;
-
- while(isspace((int)*parse))
- parse++;
- /* test for keywords */
- if(isendline(*parse))
- continue; /* skip comment and empty lines */
- if(str_keyword(&parse, "ENTRY_BEGIN")) {
- if(current) {
- error("%s line %d: previous entry does not ENTRY_END",
- name, *lineno);
- }
- current = new_entry();
- current->lineno = *lineno;
- cur_reply = entry_add_reply(current);
- continue;
- } else if(str_keyword(&parse, "$ORIGIN")) {
- get_origin(name, *lineno, origin, parse);
- continue;
- } else if(str_keyword(&parse, "$TTL")) {
- *default_ttl = (uint32_t)atoi(parse);
- continue;
- }
-
- /* working inside an entry */
- if(!current) {
- error("%s line %d: expected ENTRY_BEGIN but got %s",
- name, *lineno, line);
- }
- if(str_keyword(&parse, "MATCH")) {
- matchline(parse, current);
- } else if(str_keyword(&parse, "REPLY")) {
- replyline(parse, cur_reply->reply);
- } else if(str_keyword(&parse, "ADJUST")) {
- adjustline(parse, current, cur_reply);
- } else if(str_keyword(&parse, "EXTRA_PACKET")) {
- cur_reply = entry_add_reply(current);
- } else if(str_keyword(&parse, "SECTION")) {
- if(str_keyword(&parse, "QUESTION"))
- add_section = LDNS_SECTION_QUESTION;
- else if(str_keyword(&parse, "ANSWER"))
- add_section = LDNS_SECTION_ANSWER;
- else if(str_keyword(&parse, "AUTHORITY"))
- add_section = LDNS_SECTION_AUTHORITY;
- else if(str_keyword(&parse, "ADDITIONAL"))
- add_section = LDNS_SECTION_ADDITIONAL;
- else error("%s line %d: bad section %s", name, *lineno, parse);
- } else if(str_keyword(&parse, "HEX_ANSWER_BEGIN")) {
- hex_data_buffer = ldns_buffer_new(LDNS_MAX_PACKETLEN);
- reading_hex = true;
- } else if(str_keyword(&parse, "HEX_ANSWER_END")) {
- if (!reading_hex) {
- error("%s line %d: HEX_ANSWER_END read but no HEX_ANSWER_BEGIN keyword seen", name, *lineno);
- }
- reading_hex = false;
- cur_reply->reply_from_hex = data_buffer2wire(hex_data_buffer);
- ldns_buffer_free(hex_data_buffer);
- hex_data_buffer = NULL;
- } else if(reading_hex) {
- ldns_buffer_printf(hex_data_buffer, line);
- } else if(str_keyword(&parse, "HEX_EDNSDATA_BEGIN")) {
- hex_ednsdata_buffer = ldns_buffer_new(LDNS_MAX_PACKETLEN);
- reading_hex_ednsdata = true;
- } else if(str_keyword(&parse, "HEX_EDNSDATA_END")) {
- if (!reading_hex_ednsdata) {
- error("%s line %d: HEX_EDNSDATA_END read but no"
- "HEX_EDNSDATA_BEGIN keyword seen", name, *lineno);
- }
- reading_hex_ednsdata = false;
- cur_reply->raw_ednsdata = data_buffer2wire(hex_ednsdata_buffer);
- ldns_buffer_free(hex_ednsdata_buffer);
- hex_ednsdata_buffer = NULL;
- } else if(reading_hex_ednsdata) {
- ldns_buffer_printf(hex_ednsdata_buffer, line);
- } else if(str_keyword(&parse, "ENTRY_END")) {
- if (hex_data_buffer)
- ldns_buffer_free(hex_data_buffer);
- return current;
- } else {
- /* it must be a RR, parse and add to packet. */
- ldns_rr* n = NULL;
- ldns_status status;
- char* rrstr = line;
- if (skip_whitespace)
- rrstr = parse;
- if(add_section == LDNS_SECTION_QUESTION)
- status = ldns_rr_new_question_frm_str(
- &n, rrstr, *origin, prev_rr);
- else status = ldns_rr_new_frm_str(&n, rrstr,
- *default_ttl, *origin, prev_rr);
- if(status != LDNS_STATUS_OK)
- error("%s line %d:\n\t%s: %s", name, *lineno,
- ldns_get_errorstr_by_id(status), rrstr);
- ldns_pkt_push_rr(cur_reply->reply, add_section, n);
- }
-
- }
- if (reading_hex) {
- error("%s: End of file reached while still reading hex, "
- "missing HEX_ANSWER_END\n", name);
- }
- if(current) {
- error("%s: End of file reached while reading entry. "
- "missing ENTRY_END\n", name);
- }
- return 0;
-}
-
-/* reads the canned reply file and returns a list of structs */
-struct entry*
-read_datafile(const char* name, int skip_whitespace)
-{
- struct entry* list = NULL;
- struct entry* last = NULL;
- struct entry* current = NULL;
- FILE *in;
- int lineno = 0;
- uint32_t default_ttl = 0;
- ldns_rdf* origin = NULL;
- ldns_rdf* prev_rr = NULL;
- int entry_num = 0;
-
- if((in=fopen(name, "r")) == NULL) {
- error("could not open file %s: %s", name, strerror(errno));
- }
-
- while((current = read_entry(in, name, &lineno, &default_ttl,
- &origin, &prev_rr, skip_whitespace)))
- {
- if(last)
- last->next = current;
- else list = current;
- last = current;
- entry_num ++;
- }
- verbose(1, "%s: Read %d entries\n", prog_name, entry_num);
-
- fclose(in);
- ldns_rdf_deep_free(origin);
- ldns_rdf_deep_free(prev_rr);
- return list;
-}
-
-/** get qtype from rr */
-static ldns_rr_type get_qtype(ldns_pkt* p)
-{
- if(!ldns_rr_list_rr(ldns_pkt_question(p), 0))
- return 0;
- return ldns_rr_get_type(ldns_rr_list_rr(ldns_pkt_question(p), 0));
-}
-
-/** returns owner from rr */
-static ldns_rdf* get_owner(ldns_pkt* p)
-{
- if(!ldns_rr_list_rr(ldns_pkt_question(p), 0))
- return NULL;
- return ldns_rr_owner(ldns_rr_list_rr(ldns_pkt_question(p), 0));
-}
-
-/** get authority section SOA serial value */
-static uint32_t get_serial(ldns_pkt* p)
-{
- ldns_rr *rr = ldns_rr_list_rr(ldns_pkt_authority(p), 0);
- ldns_rdf *rdf;
- uint32_t val;
- if(!rr) return 0;
- rdf = ldns_rr_rdf(rr, 2);
- if(!rdf) return 0;
- val = ldns_rdf2native_int32(rdf);
- verbose(3, "found serial %u in msg. ", (int)val);
- return val;
-}
-
-/** match two rr lists */
-static int
-match_list(ldns_rr_list* q, ldns_rr_list *p, bool mttl)
-{
- size_t i;
- if(ldns_rr_list_rr_count(q) != ldns_rr_list_rr_count(p))
- return 0;
- for(i=0; i<ldns_rr_list_rr_count(q); i++)
- {
- if(ldns_rr_compare(ldns_rr_list_rr(q, i),
- ldns_rr_list_rr(p, i)) != 0) {
- verbose(3, "rr %d different", (int)i);
- return 0;
- }
- if(mttl && ldns_rr_ttl(ldns_rr_list_rr(q, i)) !=
- ldns_rr_ttl(ldns_rr_list_rr(p, i))) {
- verbose(3, "rr %d ttl different", (int)i);
- return 0;
- }
- }
- return 1;
-}
-
-/** compare two booleans */
-static int
-cmp_bool(int x, int y)
-{
- if(!x && !y) return 0;
- if(x && y) return 0;
- if(!x) return -1;
- return 1;
-}
-
-/** match all of the packet */
-static int
-match_all(ldns_pkt* q, ldns_pkt* p, bool mttl)
-{
- if(ldns_pkt_get_opcode(q) != ldns_pkt_get_opcode(p))
- { verbose(3, "allmatch: opcode different"); return 0;}
- if(ldns_pkt_get_rcode(q) != ldns_pkt_get_rcode(p))
- { verbose(3, "allmatch: rcode different"); return 0;}
- if(ldns_pkt_id(q) != ldns_pkt_id(p))
- { verbose(3, "allmatch: id different"); return 0;}
- if(cmp_bool(ldns_pkt_qr(q), ldns_pkt_qr(p)) != 0)
- { verbose(3, "allmatch: qr different"); return 0;}
- if(cmp_bool(ldns_pkt_aa(q), ldns_pkt_aa(p)) != 0)
- { verbose(3, "allmatch: aa different"); return 0;}
- if(cmp_bool(ldns_pkt_tc(q), ldns_pkt_tc(p)) != 0)
- { verbose(3, "allmatch: tc different"); return 0;}
- if(cmp_bool(ldns_pkt_rd(q), ldns_pkt_rd(p)) != 0)
- { verbose(3, "allmatch: rd different"); return 0;}
- if(cmp_bool(ldns_pkt_cd(q), ldns_pkt_cd(p)) != 0)
- { verbose(3, "allmatch: cd different"); return 0;}
- if(cmp_bool(ldns_pkt_ra(q), ldns_pkt_ra(p)) != 0)
- { verbose(3, "allmatch: ra different"); return 0;}
- if(cmp_bool(ldns_pkt_ad(q), ldns_pkt_ad(p)) != 0)
- { verbose(3, "allmatch: ad different"); return 0;}
- if(ldns_pkt_qdcount(q) != ldns_pkt_qdcount(p))
- { verbose(3, "allmatch: qdcount different"); return 0;}
- if(ldns_pkt_ancount(q) != ldns_pkt_ancount(p))
- { verbose(3, "allmatch: ancount different"); return 0;}
- if(ldns_pkt_nscount(q) != ldns_pkt_nscount(p))
- { verbose(3, "allmatch: nscount different"); return 0;}
- if(ldns_pkt_arcount(q) != ldns_pkt_arcount(p))
- { verbose(3, "allmatch: arcount different"); return 0;}
- if(!match_list(ldns_pkt_question(q), ldns_pkt_question(p), 0))
- { verbose(3, "allmatch: qd section different"); return 0;}
- if(!match_list(ldns_pkt_answer(q), ldns_pkt_answer(p), mttl))
- { verbose(3, "allmatch: an section different"); return 0;}
- if(!match_list(ldns_pkt_authority(q), ldns_pkt_authority(p), mttl))
- { verbose(3, "allmatch: ar section different"); return 0;}
- if(!match_list(ldns_pkt_additional(q), ldns_pkt_additional(p), mttl))
- { verbose(3, "allmatch: ns section different"); return 0;}
- return 1;
-}
-
-/** Convert to hexstring and call verbose(), prepend with header */
-void
-verbose_hex(int lvl, uint8_t *data, size_t datalen, char *header)
-{
- size_t i, hlen, dlen;
- char *errmsg, *ptr;
- int wr;
- hlen = strlen(header);
- dlen = datalen * 3 + 1;
- errmsg = (char*) malloc(sizeof(char) * (hlen + dlen));
- strlcpy(errmsg, header, hlen+1);
- for(i = 0, ptr = errmsg + hlen; i < datalen; i++, ptr += 3, dlen -= 3) {
- wr = snprintf(ptr, dlen, "%02x ", (unsigned int)data[i]);
- if (wr < 0 || wr >= (int)dlen) break;
- }
- verbose(lvl, errmsg);
- free(errmsg);
-}
-
-/** Match q edns data to p raw edns data */
-static int
-match_ednsdata(ldns_pkt* q, struct reply_packet* p)
-{
- size_t qdlen, pdlen = 0;
- uint8_t *qd, *pd = NULL;
- int q_set = ldns_pkt_edns(q) && ldns_pkt_edns_data(q);
- int p_set = p->raw_ednsdata != NULL;
-
- if (p_set) {
- pdlen = ldns_buffer_limit(p->raw_ednsdata);
- pd = ldns_buffer_begin(p->raw_ednsdata);
- verbose_hex(3, pd, pdlen, "edns expect: ");
- } else {
- verbose(3, "edns expect: <NULL>");
- }
- if (q_set) {
- qdlen = ldns_rdf_size(ldns_pkt_edns_data(q));
- qd = ldns_rdf_data(ldns_pkt_edns_data(q));
- verbose_hex(3, qd, qdlen, "edns got : ");
- } else {
- verbose(3, "edns got : <NULL>");
- }
- if ((!p_set || pdlen == 0) && !q_set)
- return 1;
- else if (!p_set || !q_set)
- return 0;
- else
- return qdlen == pdlen && memcmp(qd, pd, qdlen) == 0;
-}
-
-/* finds entry in list, or returns NULL */
-struct entry*
-find_match(struct entry* entries, ldns_pkt* query_pkt,
- enum transport_type transport)
-{
- struct entry* p = entries;
- ldns_pkt* reply = NULL;
- for(p=entries; p; p=p->next) {
- verbose(3, "comparepkt: ");
- reply = p->reply_list->reply;
- if(p->match_opcode && ldns_pkt_get_opcode(query_pkt) !=
- ldns_pkt_get_opcode(reply)) {
- verbose(3, "bad opcode\n");
- continue;
- }
- if(p->match_qtype && get_qtype(query_pkt) != get_qtype(reply)) {
- verbose(3, "bad qtype\n");
- continue;
- }
- if(p->match_qname) {
- if(!get_owner(query_pkt) || !get_owner(reply) ||
- ldns_dname_compare(
- get_owner(query_pkt), get_owner(reply)) != 0) {
- verbose(3, "bad qname\n");
- continue;
- }
- }
- if(p->match_subdomain) {
- if(!get_owner(query_pkt) || !get_owner(reply) ||
- (ldns_dname_compare(get_owner(query_pkt),
- get_owner(reply)) != 0 &&
- !ldns_dname_is_subdomain(
- get_owner(query_pkt), get_owner(reply))))
- {
- verbose(3, "bad subdomain\n");
- continue;
- }
- }
- if(p->match_serial && get_serial(query_pkt) != p->ixfr_soa_serial) {
- verbose(3, "bad serial\n");
- continue;
- }
- if(p->match_do && !ldns_pkt_edns_do(query_pkt)) {
- verbose(3, "no DO bit set\n");
- continue;
- }
- if(p->match_noedns && ldns_pkt_edns(query_pkt)) {
- verbose(3, "bad; EDNS OPT present\n");
- continue;
- }
- if(p->match_ednsdata_raw &&
- !match_ednsdata(query_pkt, p->reply_list)) {
- verbose(3, "bad EDNS data match.\n");
- continue;
- }
- if(p->match_transport != transport_any && p->match_transport != transport) {
- verbose(3, "bad transport\n");
- continue;
- }
- if(p->match_all && !match_all(query_pkt, reply, p->match_ttl)) {
- verbose(3, "bad allmatch\n");
- continue;
- }
- verbose(3, "match!\n");
- return p;
- }
- return NULL;
-}
-
-void
-adjust_packet(struct entry* match, ldns_pkt* answer_pkt, ldns_pkt* query_pkt)
-{
- /* copy & adjust packet */
- if(match->copy_id)
- ldns_pkt_set_id(answer_pkt, ldns_pkt_id(query_pkt));
- if(match->copy_query) {
- ldns_rr_list* list = ldns_pkt_get_section_clone(query_pkt,
- LDNS_SECTION_QUESTION);
- ldns_rr_list_deep_free(ldns_pkt_question(answer_pkt));
- ldns_pkt_set_question(answer_pkt, list);
- }
- if(match->copy_ednsdata_assume_clientsubnet) {
- /** copy ednsdata to reply, assume it is vandergaast and
- * adjust scopemask to match sourcemask */
- ldns_rdf* edns_rdf;
- if (ldns_rdf_size(ldns_pkt_edns_data(query_pkt)) >= 8) {
- edns_rdf = ldns_rdf_clone(ldns_pkt_edns_data(query_pkt));
- ldns_rdf_data(edns_rdf)[7] = ldns_rdf_data(edns_rdf)[6];
- ldns_pkt_set_edns_data(answer_pkt, edns_rdf);
- }
- }
- if(match->sleeptime > 0) {
- verbose(3, "sleeping for %d seconds\n", match->sleeptime);
-#ifdef HAVE_SLEEP
- sleep(match->sleeptime);
-#else
- Sleep(match->sleeptime * 1000);
-#endif
- }
-}
-
-/*
- * Parses data buffer to a query, finds the correct answer
- * and calls the given function for every packet to send.
- */
-void
-handle_query(uint8_t* inbuf, ssize_t inlen, struct entry* entries, int* count,
- enum transport_type transport, void (*sendfunc)(uint8_t*, size_t, void*),
- void* userdata, FILE* verbose_out)
-{
- ldns_status status;
- ldns_pkt *query_pkt = NULL;
- ldns_pkt *answer_pkt = NULL;
- struct reply_packet *p;
- ldns_rr *query_rr = NULL;
- uint8_t *outbuf = NULL;
- size_t answer_size = 0;
- struct entry* entry = NULL;
- ldns_rdf *stop_command = ldns_dname_new_frm_str("server.stop.");
-
- status = ldns_wire2pkt(&query_pkt, inbuf, (size_t)inlen);
- if (status != LDNS_STATUS_OK) {
- verbose(1, "Got bad packet: %s\n", ldns_get_errorstr_by_id(status));
- ldns_rdf_free(stop_command);
- return;
- }
-
- query_rr = ldns_rr_list_rr(ldns_pkt_question(query_pkt), 0);
- verbose(1, "query %d: id %d: %s %d bytes: ", ++(*count), (int)ldns_pkt_id(query_pkt),
- (transport==transport_tcp)?"TCP":"UDP", (int)inlen);
- if(verbose_out) ldns_rr_print(verbose_out, query_rr);
- if(verbose_out) ldns_pkt_print(verbose_out, query_pkt);
-
- if (ldns_rr_get_type(query_rr) == LDNS_RR_TYPE_TXT &&
- ldns_rr_get_class(query_rr) == LDNS_RR_CLASS_CH &&
- ldns_dname_compare(ldns_rr_owner(query_rr), stop_command) == 0) {
- exit(0);
- }
-
- /* fill up answer packet */
- entry = find_match(entries, query_pkt, transport);
- if(!entry || !entry->reply_list) {
- verbose(1, "no answer packet for this query, no reply.\n");
- ldns_pkt_free(query_pkt);
- ldns_rdf_free(stop_command);
- return;
- }
- for(p = entry->reply_list; p; p = p->next)
- {
- verbose(3, "Answer pkt:\n");
- if (p->reply_from_hex) {
- /* try to parse the hex packet, if it can be
- * parsed, we can use adjust rules. if not,
- * send packet literally */
- status = ldns_buffer2pkt_wire(&answer_pkt, p->reply_from_hex);
- if (status == LDNS_STATUS_OK) {
- adjust_packet(entry, answer_pkt, query_pkt);
- if(verbose_out) ldns_pkt_print(verbose_out, answer_pkt);
- status = ldns_pkt2wire(&outbuf, answer_pkt, &answer_size);
- verbose(2, "Answer packet size: %u bytes.\n", (unsigned int)answer_size);
- if (status != LDNS_STATUS_OK) {
- verbose(1, "Error creating answer: %s\n", ldns_get_errorstr_by_id(status));
- ldns_pkt_free(query_pkt);
- ldns_rdf_free(stop_command);
- return;
- }
- ldns_pkt_free(answer_pkt);
- answer_pkt = NULL;
- } else {
- verbose(3, "Could not parse hex data (%s), sending hex data directly.\n", ldns_get_errorstr_by_id(status));
- /* still try to adjust ID */
- answer_size = ldns_buffer_capacity(p->reply_from_hex);
- outbuf = LDNS_XMALLOC(uint8_t, answer_size);
- memcpy(outbuf, ldns_buffer_begin(p->reply_from_hex), answer_size);
- if(entry->copy_id) {
- ldns_write_uint16(outbuf,
- ldns_pkt_id(query_pkt));
- }
- }
- } else {
- answer_pkt = ldns_pkt_clone(p->reply);
- adjust_packet(entry, answer_pkt, query_pkt);
- if(verbose_out) ldns_pkt_print(verbose_out, answer_pkt);
- status = ldns_pkt2wire(&outbuf, answer_pkt, &answer_size);
- verbose(1, "Answer packet size: %u bytes.\n", (unsigned int)answer_size);
- if (status != LDNS_STATUS_OK) {
- verbose(1, "Error creating answer: %s\n", ldns_get_errorstr_by_id(status));
- ldns_pkt_free(query_pkt);
- ldns_rdf_free(stop_command);
- return;
- }
- ldns_pkt_free(answer_pkt);
- answer_pkt = NULL;
- }
- if(p->packet_sleep) {
- verbose(3, "sleeping for next packet %d secs\n",
- p->packet_sleep);
-#ifdef HAVE_SLEEP
- sleep(p->packet_sleep);
-#else
- Sleep(p->packet_sleep * 1000);
-#endif
- verbose(3, "wakeup for next packet "
- "(slept %d secs)\n", p->packet_sleep);
- }
- sendfunc(outbuf, answer_size, userdata);
- LDNS_FREE(outbuf);
- outbuf = NULL;
- answer_size = 0;
- }
- ldns_pkt_free(query_pkt);
- ldns_rdf_free(stop_command);
-}
-
-/** delete the list of reply packets */
-void delete_replylist(struct reply_packet* replist)
-{
- struct reply_packet *p=replist, *np;
- while(p) {
- np = p->next;
- ldns_pkt_free(p->reply);
- ldns_buffer_free(p->reply_from_hex);
- ldns_buffer_free(p->raw_ednsdata);
- free(p);
- p=np;
- }
-}
-
-void delete_entry(struct entry* list)
-{
- struct entry *p=list, *np;
- while(p) {
- np = p->next;
- delete_replylist(p->reply_list);
- free(p);
- p = np;
- }
-}
+++ /dev/null
-/*
- * ldns-testpkts. Data file parse for test packets, and query matching.
- *
- * Data storage for specially crafted replies for testing purposes.
- *
- * (c) NLnet Labs, 2005, 2006, 2007
- * See the file LICENSE for the license
- */
-
-#ifndef LDNS_TESTPKTS_H
-#define LDNS_TESTPKTS_H
-
-/**
- * \file
- *
- * This is a debugging aid. It is not efficient, especially
- * with a long config file, but it can give any reply to any query.
- * This can help the developer pre-script replies for queries.
- *
- * You can specify a packet RR by RR with header flags to return.
- *
- * Missing features:
- * - matching content different from reply content.
- * - find way to adjust mangled packets?
- *
- */
-
- /*
- The data file format is as follows:
-
- ; comment.
- ; a number of entries, these are processed first to last.
- ; a line based format.
-
- $ORIGIN origin
- $TTL default_ttl
-
- ENTRY_BEGIN
- ; first give MATCH lines, that say what queries are matched
- ; by this entry.
- ; 'opcode' makes the query match the opcode from the reply
- ; if you leave it out, any opcode matches this entry.
- ; 'qtype' makes the query match the qtype from the reply
- ; 'qname' makes the query match the qname from the reply
- ; 'subdomain' makes the query match subdomains of qname from the reply
- ; 'serial=1023' makes the query match if ixfr serial is 1023.
- ; 'all' has to match header byte for byte and all rrs in packet.
- ; 'ttl' used with all, rrs in packet must also have matching TTLs.
- ; 'DO' will match only queries with DO bit set.
- ; 'noedns' matches queries without EDNS OPT records.
- ; 'ednsdata' matches queries to HEX_EDNS section.
- MATCH [opcode] [qtype] [qname] [serial=<value>] [all] [ttl]
- MATCH [UDP|TCP] DO
- MATCH ...
- ; Then the REPLY header is specified.
- REPLY opcode, rcode or flags.
- (opcode) QUERY IQUERY STATUS NOTIFY UPDATE
- (rcode) NOERROR FORMERR SERVFAIL NXDOMAIN NOTIMPL YXDOMAIN
- YXRRSET NXRRSET NOTAUTH NOTZONE
- (flags) QR AA TC RD CD RA AD DO
- REPLY ...
- ; any additional actions to do.
- ; 'copy_id' copies the ID from the query to the answer.
- ADJUST copy_id
- ; 'copy_query' copies the query name, type and class to the answer.
- ADJUST copy_query
- ; 'sleep=10' sleeps for 10 seconds before giving the answer (TCP is open)
- ADJUST [sleep=<num>] ; sleep before giving any reply
- ADJUST [packet_sleep=<num>] ; sleep before this packet in sequence
- SECTION QUESTION
- <RRs, one per line> ; the RRcount is determined automatically.
- SECTION ANSWER
- <RRs, one per line>
- SECTION AUTHORITY
- <RRs, one per line>
- SECTION ADDITIONAL
- <RRs, one per line>
- EXTRA_PACKET ; follow with SECTION, REPLY for more packets.
- HEX_ANSWER_BEGIN ; follow with hex data
- ; this replaces any answer packet constructed
- ; with the SECTION keywords (only SECTION QUERY
- ; is used to match queries). If the data cannot
- ; be parsed, ADJUST rules for the answer packet
- ; are ignored. Only copy_id is done.
- HEX_ANSWER_END
- HEX_EDNS_BEGIN ; follow with hex data.
- ; Raw EDNS data to match against. It must be an
- ; exact match (all options are matched) and will be
- ; evaluated only when 'MATCH ednsdata' given.
- HEX_EDNS_END
- ENTRY_END
-
-
- Example data file:
-$ORIGIN nlnetlabs.nl
-$TTL 3600
-
-ENTRY_BEGIN
-MATCH qname
-REPLY NOERROR
-ADJUST copy_id
-SECTION QUESTION
-www.nlnetlabs.nl. IN A
-SECTION ANSWER
-www.nlnetlabs.nl. IN A 195.169.215.155
-SECTION AUTHORITY
-nlnetlabs.nl. IN NS www.nlnetlabs.nl.
-ENTRY_END
-
-ENTRY_BEGIN
-MATCH qname
-REPLY NOERROR
-ADJUST copy_id
-SECTION QUESTION
-www2.nlnetlabs.nl. IN A
-HEX_ANSWER_BEGIN
-; 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
-;-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
- 00 bf 81 80 00 01 00 01 00 02 00 02 03 77 77 77 0b 6b 61 6e ; 1- 20
- 61 72 69 65 70 69 65 74 03 63 6f 6d 00 00 01 00 01 03 77 77 ; 21- 40
- 77 0b 6b 61 6e 61 72 69 65 70 69 65 74 03 63 6f 6d 00 00 01 ; 41- 60
- 00 01 00 01 50 8b 00 04 52 5e ed 32 0b 6b 61 6e 61 72 69 65 ; 61- 80
- 70 69 65 74 03 63 6f 6d 00 00 02 00 01 00 01 50 8b 00 11 03 ; 81- 100
- 6e 73 31 08 68 65 78 6f 6e 2d 69 73 02 6e 6c 00 0b 6b 61 6e ; 101- 120
- 61 72 69 65 70 69 65 74 03 63 6f 6d 00 00 02 00 01 00 01 50 ; 121- 140
- 8b 00 11 03 6e 73 32 08 68 65 78 6f 6e 2d 69 73 02 6e 6c 00 ; 141- 160
- 03 6e 73 31 08 68 65 78 6f 6e 2d 69 73 02 6e 6c 00 00 01 00 ; 161- 180
- 01 00 00 46 53 00 04 52 5e ed 02 03 6e 73 32 08 68 65 78 6f ; 181- 200
- 6e 2d 69 73 02 6e 6c 00 00 01 00 01 00 00 46 53 00 04 d4 cc ; 201- 220
- db 5b
-HEX_ANSWER_END
-ENTRY_END
-
-
-
- note that this file will link with your
- void verbose(int level, char* format, ...); output function.
-*/
-
-#include <ldns/ldns.h>
-
-/** Type of transport, since some entries match based on UDP or TCP of query */
-enum transport_type {transport_any = 0, transport_udp, transport_tcp };
-
-/** struct to keep a linked list of reply packets for a query */
-struct reply_packet {
- /** next in list of reply packets, for TCP multiple pkts on wire */
- struct reply_packet* next;
- /** the reply pkt */
- ldns_pkt* reply;
- /** Additional EDNS data for matching queries. */
- ldns_buffer* raw_ednsdata;
- /** or reply pkt in hex if not parsable */
- ldns_buffer* reply_from_hex;
- /** seconds to sleep before giving packet */
- unsigned int packet_sleep;
-};
-
-/** data structure to keep the canned queries in.
- format is the 'matching query' and the 'canned answer' */
-struct entry {
- /* match */
- /* How to match an incoming query with this canned reply */
- /** match query opcode with answer opcode */
- bool match_opcode;
- /** match qtype with answer qtype */
- bool match_qtype;
- /** match qname with answer qname */
- bool match_qname;
- /** match qname as subdomain of answer qname */
- bool match_subdomain;
- /** match SOA serial number, from auth section */
- bool match_serial;
- /** match all of the packet */
- bool match_all;
- /** match ttls in the packet */
- bool match_ttl;
- /** match DO bit */
- bool match_do;
- /** match absence of EDNS OPT record in query */
- bool match_noedns;
- /** match edns data field given in hex */
- bool match_ednsdata_raw;
- /** match query serial with this value. */
- uint32_t ixfr_soa_serial;
- /** match on UDP/TCP */
- enum transport_type match_transport;
-
- /** pre canned reply */
- struct reply_packet *reply_list;
-
- /** how to adjust the reply packet */
- /** copy over the ID from the query into the answer */
- bool copy_id;
- /** copy the query nametypeclass from query into the answer */
- bool copy_query;
- /** copy ednsdata to reply, assume it is vandergaast and
- * adjust scopemask to match sourcemask */
- bool copy_ednsdata_assume_clientsubnet;
- /** in seconds */
- unsigned int sleeptime;
-
- /** some number that names this entry, line number in file or so */
- int lineno;
-
- /** next in list */
- struct entry* next;
-};
-
-/**
- * reads the canned reply file and returns a list of structs
- * does an exit on error.
- * @param name: name of the file to read.
- * @param skip_whitespace: skip leftside whitespace.
- */
-struct entry* read_datafile(const char* name, int skip_whitespace);
-
-/**
- * Delete linked list of entries.
- */
-void delete_entry(struct entry* list);
-
-/**
- * Read one entry from the data file.
- * @param in: file to read from. Filepos must be at the start of a new line.
- * @param name: name of the file for prettier errors.
- * @param lineno: line number in file, incremented as lines are read.
- * for prettier errors.
- * @param default_ttl: on first call set to default TTL for entries,
- * later it stores the $TTL value last seen. Try 3600 first call.
- * @param origin: domain name for origin appending. Can be &NULL on first call.
- * later it stores the $ORIGIN value last seen. Often &NULL or the zone
- * name on first call.
- * @param prev_rr: previous rr name for correcter parsing. &NULL on first call.
- * @param skip_whitespace: skip leftside whitespace.
- * @return: The entry read (malloced) or NULL if no entry could be read.
- */
-struct entry* read_entry(FILE* in, const char* name, int *lineno,
- uint32_t* default_ttl, ldns_rdf** origin, ldns_rdf** prev_rr,
- int skip_whitespace);
-
-/**
- * finds entry in list, or returns NULL.
- */
-struct entry* find_match(struct entry* entries, ldns_pkt* query_pkt,
- enum transport_type transport);
-
-/**
- * copy & adjust packet
- */
-void adjust_packet(struct entry* match, ldns_pkt* answer_pkt,
- ldns_pkt* query_pkt);
-
-/**
- * Parses data buffer to a query, finds the correct answer
- * and calls the given function for every packet to send.
- * if verbose_out filename is given, packets are dumped there.
- * @param inbuf: the packet that came in
- * @param inlen: length of packet.
- * @param entries: entries read in from datafile.
- * @param count: is increased to count number of queries answered.
- * @param transport: set to UDP or TCP to match some types of entries.
- * @param sendfunc: called to send answer (buffer, size, userarg).
- * @param userdata: userarg to give to sendfunc.
- * @param verbose_out: if not NULL, verbose messages are printed there.
- */
-void handle_query(uint8_t* inbuf, ssize_t inlen, struct entry* entries,
- int* count, enum transport_type transport,
- void (*sendfunc)(uint8_t*, size_t, void*), void* userdata,
- FILE* verbose_out);
-
-#endif /* LDNS_TESTPKTS_H */
rbtree_t* all_locks;
int i;
time_t starttime = time(NULL);
+#ifdef USE_THREAD_DEBUG
+ /* do not overwrite the ublocktrace files with the ones generated
+ * by this program (i.e. when the log code creates a lock) */
+ check_locking_order = 0;
+#endif
if(argc <= 1) {
usage();
return 1;
name=`basename $result .tpkg`
if test -f ".done-$name"; then
if test "$1" != "-q"; then
- echo "** PASSED ** : $name"
+ echo "** PASSED ** : $name"
fi
else
if test -f "result.$name"; then
shell="sh"
fi
-echo -n "$name: \t"
-
# check already done
if test -f .done-$name; then
echo "minitpkg .done-$name exists. skip test."
fi
# Extract
-#echo "minitpkg extract $1 to $dir"
+echo "minitpkg extract $1 to $dir"
mkdir $dir
gzip -cd $name.tpkg | (cd $dir; tar xf -)
cd $dir
grep "Description:" $name.dsc >> $result 2>&1
echo "DateRunStart: "`date "+%s" 2>/dev/null` >> $result
if test -f $name.pre; then
- #echo "minitpkg exe $name.pre"
+ echo "minitpkg exe $name.pre"
echo "minitpkg exe $name.pre" >> $result
$shell $name.pre $args >> $result
if test $? -ne 0; then
fi
fi
if test -f $name.test; then
- #echo "minitpkg exe $name.test"
+ echo "minitpkg exe $name.test"
echo "minitpkg exe $name.test" >> $result
$shell $name.test $args >>$result 2>&1
if test $? -ne 0; then
echo "$name: FAILED" >> $result
- echo "FAILED"
+ echo "$name: FAILED"
success="no"
else
echo "$name: PASSED" >> $result
echo "$name: PASSED" > ../.done-$name
- echo "PASSED"
+ echo "$name: PASSED"
success="yes"
fi
fi
if test -f $name.post; then
- #echo "minitpkg exe $name.post"
+ echo "minitpkg exe $name.post"
echo "minitpkg exe $name.post" >> $result
$shell $name.post $args >> $result
if test $? -ne 0; then
#include "util/data/msgencode.h"
#include "util/data/msgreply.h"
#include "util/data/msgparse.h"
-#include "ldns/sbuffer.h"
-#include "ldns/wire2str.h"
-#include "ldns/str2wire.h"
+#include "sldns/sbuffer.h"
+#include "sldns/wire2str.h"
+#include "sldns/str2wire.h"
#include <sys/time.h>
/** usage information for perf */
SSL_CTX* ctx = SSL_CTX_new(SSLv23_server_method());
if(!ctx) print_exit("out of memory");
(void)SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2);
+ (void)SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv3);
if(!SSL_CTX_use_certificate_file(ctx, cert, SSL_FILETYPE_PEM))
print_exit("cannot read cert");
if(!SSL_CTX_use_PrivateKey_file(ctx, key, SSL_FILETYPE_PEM))
#include "util/data/msgparse.h"
#include "testcode/unitmain.h"
#include "testcode/readhex.h"
-#include "ldns/sbuffer.h"
-#include "ldns/parseutil.h"
+#include "sldns/sbuffer.h"
+#include "sldns/parseutil.h"
/** usage information for pktview */
static void usage(char* argv[])
#include <ctype.h>
#include "testcode/readhex.h"
#include "util/log.h"
-#include "ldns/sbuffer.h"
-#include "ldns/parseutil.h"
+#include "sldns/sbuffer.h"
+#include "sldns/parseutil.h"
/** skip whitespace */
static void
skip_whites(const char** p)
{
while(1) {
- while(isspace((int)**p))
+ while(isspace((unsigned char)**p))
(*p)++;
if(**p == ';') {
/* comment, skip until newline */
skip_whites(&p);
if(sldns_buffer_position(pkt) == sldns_buffer_limit(pkt))
fatal_exit("hex_to_buf: buffer too small");
- if(!isalnum((int)*p))
+ if(!isalnum((unsigned char)*p))
break;
val = sldns_hexdigit_to_int(*p++) << 4;
skip_whites(&p);
- log_assert(*p && isalnum((int)*p));
+ log_assert(*p && isalnum((unsigned char)*p));
val |= sldns_hexdigit_to_int(*p++);
sldns_buffer_write_u8(pkt, (uint8_t)val);
skip_whites(&p);
#include "testcode/replay.h"
#include "testcode/testpkts.h"
#include "testcode/fake_event.h"
-#include "ldns/str2wire.h"
+#include "sldns/str2wire.h"
/** max length of lines in file */
#define MAX_LINE_LEN 10240
{
size_t i;
for(i = strlen(p); i > 0; i--) {
- if(isspace((int)p[i-1]))
+ if(isspace((unsigned char)p[i-1]))
p[i-1] = 0;
else return;
}
while(fgets(line, MAX_LINE_LEN-1, in)) {
pstate->lineno++;
parse = line;
- while(isspace((int)*parse))
+ while(isspace((unsigned char)*parse))
parse++;
if(!*parse || *parse == ';') {
pos = ftello(in);
continue;
}
if(parse_keyword(&parse, "ADDRESS")) {
- while(isspace((int)*parse))
+ while(isspace((unsigned char)*parse))
parse++;
strip_end_white(parse);
if(!extstrtoaddr(parse, &rng->addr, &rng->addrlen)) {
return NULL;
}
remain += skip;
- while(isspace((int)*remain))
+ while(isspace((unsigned char)*remain))
remain++;
if(parse_keyword(&remain, "NOTHING")) {
mom->evt_type = repevt_nothing;
mom->evt_type = repevt_timeout;
} else if(parse_keyword(&remain, "TIME_PASSES")) {
mom->evt_type = repevt_time_passes;
- while(isspace((int)*remain))
+ while(isspace((unsigned char)*remain))
remain++;
if(parse_keyword(&remain, "EVAL")) {
- while(isspace((int)*remain))
+ while(isspace((unsigned char)*remain))
remain++;
mom->string = strdup(remain);
if(!mom->string) fatal_exit("out of memory");
}
} else if(parse_keyword(&remain, "CHECK_AUTOTRUST")) {
mom->evt_type = repevt_autotrust_check;
- while(isspace((int)*remain))
+ while(isspace((unsigned char)*remain))
remain++;
if(strlen(remain)>0 && remain[strlen(remain)-1]=='\n')
remain[strlen(remain)-1] = 0;
} else if(parse_keyword(&remain, "INFRA_RTT")) {
char *s, *m;
mom->evt_type = repevt_infra_rtt;
- while(isspace((int)*remain))
+ while(isspace((unsigned char)*remain))
remain++;
s = remain;
remain = strchr(s, ' ');
if(!remain) fatal_exit("expected three args for INFRA_RTT");
remain[0] = 0;
remain++;
- while(isspace((int)*remain))
+ while(isspace((unsigned char)*remain))
remain++;
m = strchr(remain, ' ');
if(!m) fatal_exit("expected three args for INFRA_RTT");
m[0] = 0;
m++;
- while(isspace((int)*m))
+ while(isspace((unsigned char)*m))
m++;
if(!extstrtoaddr(s, &mom->addr, &mom->addrlen))
fatal_exit("bad infra_rtt address %s", s);
free(mom);
return NULL;
}
- while(isspace((int)*remain))
+ while(isspace((unsigned char)*remain))
remain++;
if(parse_keyword(&remain, "ADDRESS")) {
- while(isspace((int)*remain))
+ while(isspace((unsigned char)*remain))
remain++;
if(strlen(remain) > 0) /* remove \n */
remain[strlen(remain)-1] = 0;
make_scenario(char* line)
{
struct replay_scenario* scen;
- while(isspace((int)*line))
+ while(isspace((unsigned char)*line))
line++;
if(!*line) {
log_err("scenario: no title given");
parse=line;
pstate.lineno++;
(*lineno)++;
- while(isspace((int)*parse))
+ while(isspace((unsigned char)*parse))
parse++;
if(!*parse)
continue; /* empty line */
char sv;
if(at[0]==0)
return NULL; /* no variable name after $ */
- while(*at && (isalnum((int)*at) || *at=='_')) {
+ while(*at && (isalnum((unsigned char)*at) || *at=='_')) {
at++;
}
/* terminator, we are working in macro_expand() buffer */
/* remember start pos of expr, skip the first number */
at = orig;
*arithstart = at;
- while(*at && (isdigit((int)*at) || *at == '.'))
+ while(*at && (isdigit((unsigned char)*at) || *at == '.'))
at++;
return at;
}
*arithstart = NULL;
return do_macro_arith(orig, remain, arithstart);
}
- if(isdigit((int)operator)) {
+ if(isdigit((unsigned char)operator)) {
*arithstart = orig;
return at+skip; /* do nothing, but setup for later number */
}
at = do_macro_recursion(store, runtime, at, remain);
} else if(*at == '$') {
at = do_macro_variable(store, at, remain);
- } else if(isdigit((int)*at)) {
+ } else if(isdigit((unsigned char)*at)) {
at = do_macro_arith(at, remain, &arithstart);
} else {
/* copy until whitespace or operator */
- if(*at && (isalnum((int)*at) || *at=='_')) {
+ if(*at && (isalnum((unsigned char)*at) || *at=='_')) {
at++;
- while(*at && (isalnum((int)*at) || *at=='_'))
+ while(*at && (isalnum((unsigned char)*at) || *at=='_'))
at++;
} else at++;
}
if (tm.tm_min < 0 || tm.tm_min > 59) return 0;
if (tm.tm_sec < 0 || tm.tm_sec > 59) return 0;
/* call ldns conversion function */
- t = sldns_mktime_from_utc(&tm);
+ t = ldns_mktime_from_utc(&tm);
return t;
}
}
/** read all key files, exit on error */
-static sldns_key_list*
+static ldns_key_list*
read_keys(int num, char* names[], struct keysets* set)
{
int i;
- sldns_key_list* keys = sldns_key_list_new();
- sldns_key* k;
- sldns_rdf* rdf;
- sldns_status s;
+ ldns_key_list* keys = ldns_key_list_new();
+ ldns_key* k;
+ ldns_rdf* rdf;
+ ldns_status s;
int b;
FILE* in;
in = fopen(names[i], "r");
if(!in) fatal_exit("could not open %s: %s", names[i],
strerror(errno));
- s = sldns_key_new_frm_fp(&k, in);
+ s = ldns_key_new_frm_fp(&k, in);
fclose(in);
if(s != LDNS_STATUS_OK)
fatal_exit("bad keyfile %s: %s", names[i],
- sldns_get_errorstr_by_id(s));
- sldns_key_set_expiration(k, set->expi);
- sldns_key_set_inception(k, set->incep);
- s = sldns_str2rdf_dname(&rdf, set->owner);
+ ldns_get_errorstr_by_id(s));
+ ldns_key_set_expiration(k, set->expi);
+ ldns_key_set_inception(k, set->incep);
+ s = ldns_str2rdf_dname(&rdf, set->owner);
if(s != LDNS_STATUS_OK)
fatal_exit("bad owner name %s: %s", set->owner,
- sldns_get_errorstr_by_id(s));
- sldns_key_set_pubkey_owner(k, rdf);
- sldns_key_set_flags(k, set->flags);
- sldns_key_set_keytag(k, set->keytag);
- b = sldns_key_list_push_key(keys, k);
+ ldns_get_errorstr_by_id(s));
+ ldns_key_set_pubkey_owner(k, rdf);
+ ldns_key_set_flags(k, set->flags);
+ ldns_key_set_keytag(k, set->keytag);
+ b = ldns_key_list_push_key(keys, k);
assert(b);
}
return keys;
}
/** read list of rrs from the file */
-static sldns_rr_list*
+static ldns_rr_list*
read_rrs(FILE* in)
{
uint32_t my_ttl = 3600;
- sldns_rdf *my_origin = NULL;
- sldns_rdf *my_prev = NULL;
- sldns_status s;
+ ldns_rdf *my_origin = NULL;
+ ldns_rdf *my_prev = NULL;
+ ldns_status s;
int line_nr = 1;
int b;
- sldns_rr_list* list;
- sldns_rr *rr;
+ ldns_rr_list* list;
+ ldns_rr *rr;
- list = sldns_rr_list_new();
+ list = ldns_rr_list_new();
if(!list) fatal_exit("alloc error");
while(!feof(in)) {
- s = sldns_rr_new_frm_fp_l(&rr, in, &my_ttl, &my_origin,
+ s = ldns_rr_new_frm_fp_l(&rr, in, &my_ttl, &my_origin,
&my_prev, &line_nr);
if(s == LDNS_STATUS_SYNTAX_TTL ||
s == LDNS_STATUS_SYNTAX_ORIGIN ||
continue;
else if(s != LDNS_STATUS_OK)
fatal_exit("parse error in line %d: %s", line_nr,
- sldns_get_errorstr_by_id(s));
- b = sldns_rr_list_push_rr(list, rr);
+ ldns_get_errorstr_by_id(s));
+ b = ldns_rr_list_push_rr(list, rr);
assert(b);
}
printf("read %d lines\n", line_nr);
/** sign the rrs with the keys */
static void
-signit(sldns_rr_list* rrs, sldns_key_list* keys)
+signit(ldns_rr_list* rrs, ldns_key_list* keys)
{
- sldns_rr_list* rrset;
- sldns_rr_list* sigs;
+ ldns_rr_list* rrset;
+ ldns_rr_list* sigs;
- while(sldns_rr_list_rr_count(rrs) > 0) {
- rrset = sldns_rr_list_pop_rrset(rrs);
+ while(ldns_rr_list_rr_count(rrs) > 0) {
+ rrset = ldns_rr_list_pop_rrset(rrs);
if(!rrset) fatal_exit("copy alloc failure");
- sigs = sldns_sign_public(rrset, keys);
+ sigs = ldns_sign_public(rrset, keys);
if(!sigs) fatal_exit("failed to sign");
- sldns_rr_list_print(stdout, rrset);
- sldns_rr_list_print(stdout, sigs);
+ ldns_rr_list_print(stdout, rrset);
+ ldns_rr_list_print(stdout, sigs);
printf("\n");
- sldns_rr_list_free(rrset);
- sldns_rr_list_free(sigs);
+ ldns_rr_list_free(rrset);
+ ldns_rr_list_free(sigs);
}
}
static void
process_keys(int argc, char* argv[])
{
- sldns_rr_list* rrs;
- sldns_key_list* keys;
+ ldns_rr_list* rrs;
+ ldns_key_list* keys;
struct keysets settings;
assert(argc == 6);
rrs = read_rrs(stdin);
signit(rrs, keys);
- sldns_rr_list_deep_free(rrs);
- sldns_key_list_free(keys);
+ ldns_rr_list_deep_free(rrs);
+ ldns_key_list_free(keys);
}
/** process nsec3 params and perform hashing */
process_nsec3(int argc, char* argv[])
{
char line[10240];
- sldns_rdf* salt;
- sldns_rdf* in, *out;
- sldns_status status;
- status = sldns_str2rdf_nsec3_salt(&salt, argv[5]);
+ ldns_rdf* salt;
+ ldns_rdf* in, *out;
+ ldns_status status;
+ status = ldns_str2rdf_nsec3_salt(&salt, argv[5]);
if(status != LDNS_STATUS_OK)
fatal_exit("Could not parse salt %s: %s", argv[5],
- sldns_get_errorstr_by_id(status));
+ ldns_get_errorstr_by_id(status));
assert(argc == 6);
while(fgets(line, (int)sizeof(line), stdin)) {
if(strlen(line) > 0)
line[strlen(line)-1] = 0; /* remove trailing newline */
if(line[0]==0)
continue;
- status = sldns_str2rdf_dname(&in, line);
+ status = ldns_str2rdf_dname(&in, line);
if(status != LDNS_STATUS_OK)
fatal_exit("Could not parse name %s: %s", line,
- sldns_get_errorstr_by_id(status));
- sldns_rdf_print(stdout, in);
+ ldns_get_errorstr_by_id(status));
+ ldns_rdf_print(stdout, in);
printf(" -> ");
/* arg 3 is flags, unused */
- out = sldns_nsec3_hash_name(in, (uint8_t)atoi(argv[2]),
+ out = ldns_nsec3_hash_name(in, (uint8_t)atoi(argv[2]),
(uint16_t)atoi(argv[4]),
- sldns_rdf_data(salt)[0], sldns_rdf_data(salt)+1);
+ ldns_rdf_data(salt)[0], ldns_rdf_data(salt)+1);
if(!out)
fatal_exit("Could not hash %s", line);
- sldns_rdf_print(stdout, out);
+ ldns_rdf_print(stdout, out);
printf("\n");
- sldns_rdf_deep_free(in);
- sldns_rdf_deep_free(out);
+ ldns_rdf_deep_free(in);
+ ldns_rdf_deep_free(out);
}
- sldns_rdf_deep_free(salt);
+ ldns_rdf_deep_free(salt);
}
/** main program */
#include "util/data/msgparse.h"
#include "util/data/msgreply.h"
#include "util/data/dname.h"
-#include "ldns/sbuffer.h"
-#include "ldns/str2wire.h"
-#include "ldns/wire2str.h"
+#include "sldns/sbuffer.h"
+#include "sldns/str2wire.h"
+#include "sldns/wire2str.h"
#include <openssl/ssl.h>
#include <openssl/rand.h>
#include <openssl/err.h>
+++ /dev/null
-#!/usr/bin/env bash
-# Testbed for NSD.
-# By Wouter Wijngaards, NLnet Labs, 2006.
-# BSD License.
-
-# this version prefers gmake if available.
-# adds variable LDNS for the LDNS path to use.
-
-# global settings
-CONFIGURE_FLAGS=""
-REPORT_FILE=testdata/testbed.report
-LOG_FILE=testdata/testbed.log
-HOST_FILE=testdata/host_file.$USER
-
-if test ! -f $HOST_FILE; then
- echo "No such file: $HOST_FILE"
- exit 1
-fi
-
-function echossh() # like ssh but echos.
-{
- echo "> ssh $*"
- ssh $*
-}
-
-# Compile and run NSD on platforms
-function dotest()
-# parameters: <host> <dir>
-# host is name of ssh host
-# dir is directory of nsd trunk on host
-{
- echo "$1 begin on "`date` | tee -a $REPORT_FILE
-
- DISABLE=""
- if test $IP6 = no; then
- DISABLE="--disable-ipv6"
- fi
- if test x$LDNS != x; then
- DISABLE="--with-ldns=$LDNS $DISABLE"
- fi
- if test x$LIBEVENT != x; then
- DISABLE="--with-libevent=$LIBEVENT $DISABLE"
- fi
-
- cat >makeconf.mak.$$ << EOF
-#configure: configure.ac
-# $AC_CMD
-# touch configure
-Makefile: Makefile.in #configure
- ./configure $CONFIGURE_FLAGS $DISABLE
- touch Makefile
-EOF
- scp makeconf.mak.$$ $1:$2
- # determine make to use
- tempx=`ssh $1 "cd $2; which gmake"`
- MAKE_CMD=`ssh $1 "cd $2; if test -f '$tempx'; then echo $tempx; else echo $MAKE_CMD; fi"`
-
- if test $SVN = yes; then
- echossh $1 "cd $2; svn up"
- echossh $1 "cd $2; $MAKE_CMD -f makeconf.mak.$$ configure"
- else
- # svn and autoconf locally
- echo "fake svn via svnexport, tar, autoconf, bison, flex."
- svn export svn+ssh://open.nlnetlabs.nl/svn/nsd/trunk unbound_ttt
- (cd unbound_ttt; $AC_CMD; rm -r autom4te* .c-mode-rc.el .cvsignore)
- if test $FIXCONFIGURE = yes; then
- echo fixing up configure length test.
- (cd unbound_ttt; mv configure oldconf; sed -e 's?while (test "X"?lt_cv_sys_max_cmd_len=65500; echo skip || while (test "X"?' <oldconf >configure; chmod +x ./configure)
- fi
- du unbound_ttt
- rsync -vrcpz --rsync-path=/home/wouter/bin/rsync unbound_ttt $1:unbound_ttt
- # tar czf unbound_ttt.tgz unbound_ttt
- rm -rf unbound_ttt
- # ls -al unbound_ttt.tgz
- # scp unbound_ttt.tgz $1:unbound_ttt.tar.gz
- # rm unbound_ttt.tgz
- # echossh $1 "gtar xzf unbound_ttt.tar.gz && rm unbound_ttt.tar.gz"
- fi
- echossh $1 "cd $2; $MAKE_CMD -f makeconf.mak.$$ Makefile"
- echossh $1 "cd $2; $MAKE_CMD all tests"
- echossh $1 "cd $2; $MAKE_CMD doc"
- if test $RUN_TEST = yes; then
- echossh $1 "cd $2; bash testcode/do-tests.sh"
- echossh $1 "cd $2/testdata; sh ../testcode/mini_tpkg.sh -q report" | tee -a $REPORT_FILE
- fi
- echossh $1 "cd $2; rm -f makeconf.mak.$$"
- rm -f makeconf.mak.$$
- echo "$1 end on "`date` | tee -a $REPORT_FILE
-}
-
-echo "on "`date`" by $USER." > $REPORT_FILE
-echo "on "`date`" by $USER." > $LOG_FILE
-
-# read host names
-declare -a hostname desc dir vars
-IFS=' '
-i=0
-while read a b c d; do
- if echo $a | grep "^#" >/dev/null; then
- continue # skip it
- fi
- # append after arrays
- hostname[$i]=$a
- desc[$i]=$b
- dir[$i]=$c
- vars[$i]=$d
- i=$(($i+1))
-done <$HOST_FILE
-echo "testing on $i hosts"
-
-# do the test
-for((i=0; i<${#hostname[*]}; i=$i+1)); do
- if echo ${hostname[$i]} | grep "^#" >/dev/null; then
- continue # skip it
- fi
- # echo "hostname=[${hostname[$i]}]"
- # echo "desc=[${desc[$i]}]"
- # echo "dir=[${dir[$i]}]"
- # echo "vars=[${vars[$i]}]"
- AC_CMD="libtoolize -c --force; autoconf && autoheader"
- MAKE_CMD="make"
- SVN=yes
- IP6=yes
- FIXCONFIGURE=no
- RUN_TEST=yes
- LDNS=
- LIBEVENT=
- eval ${vars[$i]}
- echo "*** ${hostname[$i]} ${desc[$i]} ***" | tee -a $LOG_FILE | tee -a $REPORT_FILE
- dotest ${hostname[$i]} ${dir[$i]} 2>&1 | tee -a $LOG_FILE
-done
-
-echo "done"
+++ /dev/null
-Testbed.sh help page.
-
-Testbed helps in running the test packages (using tpkg(1)) on several systems.
-The script is specially written for unbound (edit it to change to different
-software). It is licensed BSD.
-
-The hosts to run on are listed in host_file.<username>. You need to have
-public-key authorized ssh access to these systems (or type your password lots
-and lots of times). The host_file describes the directories and environment
-of each host. You need only user-level access to the host.
-
-The host_file is very restrictive in formatting. Comments are lines starting
-with the # mark. The entries must be separated by tabs. Please list the
-hostname<tab>description<tab>checkoutdir<tab>variables
-
-hostname: network hostname to ssh to.
-desc: pretty text to describe the machine architecture.
-checkoutdir: directory on the remote host where a svn checkout is present.
-variables: zero or more variables separated by spaces. BLA=value BAR=val.
-
-Only important variable for unbound is the LDNS=<dir> variable that if present
-forces --with-ldns=<dir> to be passed to ./configure. In case LDNS is not
-installed on the system itself, but present somewhere else.
-
-You can also set LIBEVENT=<dir> for the libevent directory, if it is
-installed in a nonstandard location.
-
-*** Running the testbed
-
-Run by executing the script. It will take all the hosts from the file in
-turn and update the svn directory there, possible autoreconf if necessary,
-possibly ./configure <args> if necessary, make the executables.
-Then it will run the testcode/do-tests script. This script should execute
-the tests that this host is capable of running.
-
-in testdata/testbed.log has a line-by-line log. See your make errors here.
-in testdata/testbed.report has only the tpkg reports. Summary.
-
#include "testcode/fake_event.h"
#include "daemon/remote.h"
#include "util/config_file.h"
-#include "ldns/keyraw.h"
+#include "sldns/keyraw.h"
#include <ctype.h>
/** signal that this is a testbound compile */
{
const char *p = args, *np;
size_t len;
- while(p && isspace((int)*p))
+ while(p && isspace((unsigned char)*p))
p++;
while(p && *p) {
/* find location of next string and length of this one */
(*pass_argc)++;
/* go to next option */
p = np;
- while(p && isspace((int)*p))
+ while(p && isspace((unsigned char)*p))
p++;
}
}
char* parse;
FILE* spool;
/* find filename for new file */
- while(isspace((int)*id))
+ while(isspace((unsigned char)*id))
id++;
if(strlen(id)==0)
fatal_exit("AUTROTRUST_FILE must have id, line %d", *lineno);
while(fgets(line, MAX_LINE_LEN-1, in)) {
parse = line;
(*lineno)++;
- while(isspace((int)*parse))
+ while(isspace((unsigned char)*parse))
parse++;
if(strncmp(parse, "AUTOTRUST_END", 13) == 0) {
fclose(spool);
while(fgets(line, MAX_LINE_LEN-1, in)) {
parse = line;
(*lineno)++;
- while(isspace((int)*parse))
+ while(isspace((unsigned char)*parse))
parse++;
if(!*parse || parse[0] == ';')
continue;
case 'h':
default:
testbound_usage();
- for(c=1; c<pass_argc; c++)
- free(pass_argv[c]);
return 1;
}
}
argv += optind;
if(argc != 0) {
testbound_usage();
- for(c=1; c<pass_argc; c++)
- free(pass_argv[c]);
return 1;
}
log_info("Start of %s testbound program.", PACKAGE_STRING);
#include <ctype.h>
#include "testcode/testpkts.h"
#include "util/net_help.h"
-#include "ldns/sbuffer.h"
-#include "ldns/rrdef.h"
-#include "ldns/pkthdr.h"
-#include "ldns/str2wire.h"
-#include "ldns/wire2str.h"
+#include "sldns/sbuffer.h"
+#include "sldns/rrdef.h"
+#include "sldns/pkthdr.h"
+#include "sldns/str2wire.h"
+#include "sldns/wire2str.h"
/** max size of a packet */
#define MAX_PACKETLEN 65536
if(strncmp(*str, keyword, len) != 0)
return 0;
*str += len;
- while(isspace((int)**str))
+ while(isspace((unsigned char)**str))
(*str)++;
return 1;
}
error("expected = or : in MATCH: %s", line);
parse++;
e->ixfr_soa_serial = (uint32_t)strtol(parse, (char**)&parse, 10);
- while(isspace((int)*parse))
+ while(isspace((unsigned char)*parse))
parse++;
} else {
error("could not parse MATCH: '%s'", parse);
e->copy_query = 1;
} else if(str_keyword(&parse, "sleep=")) {
e->sleeptime = (unsigned int) strtol(parse, (char**)&parse, 10);
- while(isspace((int)*parse))
+ while(isspace((unsigned char)*parse))
parse++;
} else if(str_keyword(&parse, "packet_sleep=")) {
pkt->packet_sleep = (unsigned int) strtol(parse, (char**)&parse, 10);
- while(isspace((int)*parse))
+ while(isspace((unsigned char)*parse))
parse++;
} else {
error("could not parse ADJUST: '%s'", parse);
for (data_buf_pos = 0; data_buf_pos < sldns_buffer_position(data_buffer); data_buf_pos++) {
c = (int) data_wire[data_buf_pos];
- if (state < 2 && !isascii(c)) {
+ if (state < 2 && !isascii((unsigned char)c)) {
/*verbose("non ascii character found in file: (%d) switching to raw mode\n", c);*/
state = 2;
}
int status;
end=parse;
- while(!isspace((int)*end) && !isendline(*end))
+ while(!isspace((unsigned char)*end) && !isendline(*end))
end++;
store = *end;
*end = 0;
parse = line;
pstate->lineno++;
- while(isspace((int)*parse))
+ while(isspace((unsigned char)*parse))
parse++;
/* test for keywords */
if(isendline(*parse))
#include "util/data/dname.h"
#include "testcode/unitmain.h"
#include "validator/val_anchor.h"
-#include "ldns/sbuffer.h"
-#include "ldns/rrdef.h"
+#include "sldns/sbuffer.h"
+#include "sldns/rrdef.h"
/** test empty set */
static void
#include "util/log.h"
#include "testcode/unitmain.h"
#include "util/data/dname.h"
-#include "ldns/sbuffer.h"
-#include "ldns/str2wire.h"
+#include "sldns/sbuffer.h"
+#include "sldns/str2wire.h"
/** put dname into buffer */
static sldns_buffer*
#include "config.h"
#include "util/log.h"
#include "testcode/unitmain.h"
-#include "ldns/sbuffer.h"
-#include "ldns/str2wire.h"
-#include "ldns/wire2str.h"
+#include "sldns/sbuffer.h"
+#include "sldns/str2wire.h"
+#include "sldns/wire2str.h"
/** verbose this unit test */
static int vbmp = 0;
#include "nss.h"
#endif
-#include "ldns/rrdef.h"
-#include "ldns/keyraw.h"
+#include "sldns/rrdef.h"
+#include "sldns/keyraw.h"
#include "util/log.h"
#include "testcode/unitmain.h"
#include "util/net_help.h"
#include "testcode/readhex.h"
#include "testcode/testpkts.h"
-#include "ldns/sbuffer.h"
-#include "ldns/str2wire.h"
-#include "ldns/wire2str.h"
+#include "sldns/sbuffer.h"
+#include "sldns/str2wire.h"
+#include "sldns/wire2str.h"
/** verbose message parse unit test */
static int vbmp = 0;
#include "util/data/dname.h"
#include "testcode/unitmain.h"
#include "validator/val_neg.h"
-#include "ldns/rrdef.h"
+#include "sldns/rrdef.h"
/** verbose unit test for negative cache */
static int negverbose = 0;
static int addrtree_inconsistent(struct addrtree* tree)
{
struct addredge* edge;
- int i, r, md;
+ int i, r;
if (!tree) return 0;
if (!tree->root) return 1;
static void elemfree(void *envptr, void *elemptr)
{
struct reply_info *elem = (struct reply_info *)elemptr;
- struct module_env *env = (struct module_env *)envptr;
+ (void)envptr;
free(elem);
}
static void consistency_test(void)
{
- int i, l, r;
+ int i, l;
unsigned int count;
addrkey_t *k;
struct addrtree* t;
static void issub_test(void)
{
- unit_show_func("edns-subnet/addrtree.h", "issub");
addrkey_t k1[] = {0x55, 0x55, 0x5A};
addrkey_t k2[] = {0x55, 0x5D, 0x5A};
+ unit_show_func("edns-subnet/addrtree.h", "issub");
unit_assert( !unittest_wrapper_addrtree_issub(k1, 24, k2, 24, 0) );
unit_assert( unittest_wrapper_addrtree_issub(k1, 8, k2, 16, 0) );
unit_assert( unittest_wrapper_addrtree_issub(k2, 12, k1, 13, 0) );
static void getbit_test(void)
{
- unit_show_func("edns-subnet/addrtree.h", "getbit");
addrkey_t k1[] = {0x55, 0x55, 0x5A};
int i;
+ unit_show_func("edns-subnet/addrtree.h", "getbit");
for(i = 0; i<20; i++) {
unit_assert( unittest_wrapper_addrtree_getbit(k1, 20, i) == (i&1) );
}
static void bits_common_test(void)
{
- unit_show_func("edns-subnet/addrtree.h", "bits_common");
addrkey_t k1[] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0};
addrkey_t k2[] = {0,0,0,0,0,0,0,0};
int i;
+ unit_show_func("edns-subnet/addrtree.h", "bits_common");
for(i = 0; i<64; i++) {
unit_assert( unittest_wrapper_addrtree_bits_common(k1, 64, k1, 64, i) == 64 );
}
static void cmpbit_test(void)
{
- unit_show_func("edns-subnet/addrtree.h", "cmpbit");
addrkey_t k1[] = {0xA5, 0x0F};
addrkey_t k2[] = {0x5A, 0xF0};
int i;
+ unit_show_func("edns-subnet/addrtree.h", "cmpbit");
for(i = 0; i<16; i++) {
unit_assert( !unittest_wrapper_addrtree_cmpbit(k1,k1,i) );
unit_assert( unittest_wrapper_addrtree_cmpbit(k1,k2,i) );
#include "util/net_help.h"
#include "util/module.h"
#include "util/config_file.h"
-#include "ldns/sbuffer.h"
-#include "ldns/keyraw.h"
-#include "ldns/str2wire.h"
-#include "ldns/wire2str.h"
+#include "sldns/sbuffer.h"
+#include "sldns/keyraw.h"
+#include "sldns/str2wire.h"
+#include "sldns/wire2str.h"
/** verbose signature test */
static int vsig = 0;
07616673646230320C74797065732D7369676E6564027762087369646E6C616273026E6C00002E000100000E1000AF002F080500000E1052EC3900524963DCF35A0C74797065732D7369676E6564027762087369646E6C616273026E6C00786146DC4D929A6DB5EA3DC641C39B1DD80CDAFC32B271DD0D295C90DE49C4A310F4F9E6865DC058DDCB470A6056974E6C660B8A725A4646FF7DE59496069E98921E153699CDDDD95F9406FDE81E68EA22E10D290FBBB075E796A5C6DEA65B46AF7683E2A83B5A405403106C78A9C04BD8EBBDB0B7885EF3D17CDF376AC24865
afsdb02.types-signed.wb.sidnlabs.nl. 3600 IN RRSIG NSEC 8 5 3600 20140201000000 20130930114324 62298 types-signed.wb.sidnlabs.nl. eGFG3E2Smm216j3GQcObHdgM2vwysnHdDSlckN5JxKMQ9Pnmhl3AWN3LRwpgVpdObGYLinJaRkb/feWUlgaemJIeFTaZzd3ZX5QG/egeaOoi4Q0pD7uwdeeWpcbepltGr3aD4qg7WkBUAxBseKnAS9jrvbC3iF7z0XzfN2rCSGU= ;{id = 62298}
036364730C74797065732D7369676E6564027762087369646E6C616273026E6C00003B00010000003C0024FCB2080286632F83494B1D7037E72949FD6CD8689C5DAAF4DF1E5D7E6EF3BA28ECE1E3C8
-cds.types-signed.wb.sidnlabs.nl. 60 IN TYPE59 \# 36 FCB2080286632F83494B1D7037E72949FD6CD8689C5DAAF4DF1E5D7E6EF3BA28ECE1E3C8
+cds.types-signed.wb.sidnlabs.nl. 60 IN CDS 64690 8 2 86632F83494B1D7037E72949FD6CD8689C5DAAF4DF1E5D7E6EF3BA28ECE1E3C8
036364730C74797065732D7369676E6564027762087369646E6C616273026E6C00002E00010000003C00AF003B08050000003C52EC3900524963DCF35A0C74797065732D7369676E6564027762087369646E6C616273026E6C007BAC8D49E16C3744DE3C9EF198C05480F5238C4962012D61912CE532C41509C770A89F55624352BD7F31D772D4CF76D4E02041D658904ED3F4F3A85BA34F372444D336BC8CD7FBEE808B5D371571B4B4C1419E4723091939D3475279C031C5BADB9DD224927755309AE05A1893653A63A9F21CE5249A721AC6415BEE683099A8
-cds.types-signed.wb.sidnlabs.nl. 60 IN RRSIG TYPE59 8 5 60 20140201000000 20130930114324 62298 types-signed.wb.sidnlabs.nl. e6yNSeFsN0TePJ7xmMBUgPUjjEliAS1hkSzlMsQVCcdwqJ9VYkNSvX8x13LUz3bU4CBB1liQTtP086hbo083JETTNryM1/vugItdNxVxtLTBQZ5HIwkZOdNHUnnAMcW6253SJJJ3VTCa4FoYk2U6Y6nyHOUkmnIaxkFb7mgwmag= ;{id = 62298}
+cds.types-signed.wb.sidnlabs.nl. 60 IN RRSIG CDS 8 5 60 20140201000000 20130930114324 62298 types-signed.wb.sidnlabs.nl. e6yNSeFsN0TePJ7xmMBUgPUjjEliAS1hkSzlMsQVCcdwqJ9VYkNSvX8x13LUz3bU4CBB1liQTtP086hbo083JETTNryM1/vugItdNxVxtLTBQZ5HIwkZOdNHUnnAMcW6253SJJJ3VTCa4FoYk2U6Y6nyHOUkmnIaxkFb7mgwmag= ;{id = 62298}
036364730C74797065732D7369676E6564027762087369646E6C616273026E6C00002F000100000E10002C04636572740C74797065732D7369676E6564027762087369646E6C616273026E6C0000080000000000030010
-cds.types-signed.wb.sidnlabs.nl. 3600 IN NSEC cert.types-signed.wb.sidnlabs.nl. RRSIG NSEC TYPE59
+cds.types-signed.wb.sidnlabs.nl. 3600 IN NSEC cert.types-signed.wb.sidnlabs.nl. RRSIG NSEC CDS
036364730C74797065732D7369676E6564027762087369646E6C616273026E6C00002E000100000E1000AF002F080500000E1052EC3900524963DCF35A0C74797065732D7369676E6564027762087369646E6C616273026E6C0039771AE91719DEF01A03D67B508F84D1C51D98A99CADDA4D0A125A54F5195AA2ACFDC37586F081E0FD0C7EC316B0EE6AE159483A0C877D252C233D4718578D0DE2BD8E776363152D13B1EF4473EB97E3E082B5639082D01DF02CD27D7CEF4EDB297A6D2A1B42148465CDE9C445D3FECFCDD2935E40A0D05E8CA520BE51623A21
cds.types-signed.wb.sidnlabs.nl. 3600 IN RRSIG NSEC 8 5 3600 20140201000000 20130930114324 62298 types-signed.wb.sidnlabs.nl. OXca6RcZ3vAaA9Z7UI+E0cUdmKmcrdpNChJaVPUZWqKs/cN1hvCB4P0MfsMWsO5q4VlIOgyHfSUsIz1HGFeNDeK9jndjYxUtE7HvRHPrl+PggrVjkILQHfAs0n18707bKXptKhtCFIRlzenERdP+z83Sk15AoNBejKUgvlFiOiE= ;{id = 62298}
04636572740C74797065732D7369676E6564027762087369646E6C616273026E6C00002500010000003C0055FFFEFFFFFE33115C6F2F64FF2BDE74C7D080ACE11F97ABD0CBBFBC82F3E39224B2471E1468225829FF1B11E16A2E9502E1C0A0D533E18A14D6D55F4824AA4189FAFFFD7553A36577CD2311E0BC693ACEF8A2A609A6
067479706535380C74797065732D7369676E6564027762087369646E6C616273026E6C00002E000100000E1000AF002F080500000E1052EC3900524963DCF35A0C74797065732D7369676E6564027762087369646E6C616273026E6C000ED11D2F06C798CE081095580E53DB40D30033ACF692C58CB5B617E489C8B89DBCB1129A028EE1C8D74231AC812385203C062629DFE7112874A97EA2DD20031113673D5ADEB9F2643F519D3F76AEE7DA95F82E880C6F0290CE7F3759C545189DE13FA0CE9A2A5B1A252AEDD57E582111479390F7A6E5ED742950453EDD6A6A78
type58.types-signed.wb.sidnlabs.nl. 3600 IN RRSIG NSEC 8 5 3600 20140201000000 20130930114324 62298 types-signed.wb.sidnlabs.nl. DtEdLwbHmM4IEJVYDlPbQNMAM6z2ksWMtbYX5InIuJ28sRKaAo7hyNdCMayBI4UgPAYmKd/nESh0qX6i3SADERNnPVreufJkP1GdP3au59qV+C6IDG8CkM5/N1nFRRid4T+gzpoqWxolKu3VflghEUeTkPem5e10KVBFPt1qang= ;{id = 62298}
067479706535390C74797065732D7369676E6564027762087369646E6C616273026E6C00003B00010000003C0024FCB2080286632F83494B1D7037E72949FD6CD8689C5DAAF4DF1E5D7E6EF3BA28ECE1E3C8
-type59.types-signed.wb.sidnlabs.nl. 60 IN TYPE59 \# 36 FCB2080286632F83494B1D7037E72949FD6CD8689C5DAAF4DF1E5D7E6EF3BA28ECE1E3C8
+type59.types-signed.wb.sidnlabs.nl. 60 IN CDS 64690 8 2 86632F83494B1D7037E72949FD6CD8689C5DAAF4DF1E5D7E6EF3BA28ECE1E3C8
067479706535390C74797065732D7369676E6564027762087369646E6C616273026E6C00002E00010000003C00AF003B08050000003C52EC3900524963DCF35A0C74797065732D7369676E6564027762087369646E6C616273026E6C0073997BF33E9EECBCAAA6D07C08024AD8358CC26974167BCD432802FB68E6CD1C361539D098FCC57D43B8D104D27AAD32070BEBFC60F002E5D998B615E76580EEFB74F2E8B0E155C0D5782C9E15D89DA036B770C2ACBAD21EE3453D0070C386BD2A154EC7F6481CF69B226E2E12873DE0F753B16F7B5220CDDD13A93C9240F8E2
-type59.types-signed.wb.sidnlabs.nl. 60 IN RRSIG TYPE59 8 5 60 20140201000000 20130930114324 62298 types-signed.wb.sidnlabs.nl. c5l78z6e7LyqptB8CAJK2DWMwml0FnvNQygC+2jmzRw2FTnQmPzFfUO40QTSeq0yBwvr/GDwAuXZmLYV52WA7vt08uiw4VXA1XgsnhXYnaA2t3DCrLrSHuNFPQBww4a9KhVOx/ZIHPabIm4uEoc94PdTsW97UiDN3ROpPJJA+OI= ;{id = 62298}
+type59.types-signed.wb.sidnlabs.nl. 60 IN RRSIG CDS 8 5 60 20140201000000 20130930114324 62298 types-signed.wb.sidnlabs.nl. c5l78z6e7LyqptB8CAJK2DWMwml0FnvNQygC+2jmzRw2FTnQmPzFfUO40QTSeq0yBwvr/GDwAuXZmLYV52WA7vt08uiw4VXA1XgsnhXYnaA2t3DCrLrSHuNFPQBww4a9KhVOx/ZIHPabIm4uEoc94PdTsW97UiDN3ROpPJJA+OI= ;{id = 62298}
067479706535390C74797065732D7369676E6564027762087369646E6C616273026E6C00002F000100000E10002D0574797065370C74797065732D7369676E6564027762087369646E6C616273026E6C0000080000000000030010
-type59.types-signed.wb.sidnlabs.nl. 3600 IN NSEC type7.types-signed.wb.sidnlabs.nl. RRSIG NSEC TYPE59
+type59.types-signed.wb.sidnlabs.nl. 3600 IN NSEC type7.types-signed.wb.sidnlabs.nl. RRSIG NSEC CDS
067479706535390C74797065732D7369676E6564027762087369646E6C616273026E6C00002E000100000E1000AF002F080500000E1052EC3900524963DCF35A0C74797065732D7369676E6564027762087369646E6C616273026E6C000766B940EAFF1131A7869B0754EC734F0DD15D485109FE7858BF2AD6247B913536FD5BFF72ED4769EA290BF047ED143B0FB6751FE50B5BFA4168F3EFD8C7A8C228C17AFC31C404FC6D6B5697CA7853F9B007A9109BAB891ADD3275E93CB7629097CE4B04EB2ACAF7EF9C32BD724835BCF8CB34F63A44BEC4C747347B694C1537
type59.types-signed.wb.sidnlabs.nl. 3600 IN RRSIG NSEC 8 5 3600 20140201000000 20130930114324 62298 types-signed.wb.sidnlabs.nl. B2a5QOr/ETGnhpsHVOxzTw3RXUhRCf54WL8q1iR7kTU2/Vv/cu1HaeopC/BH7RQ7D7Z1H+ULW/pBaPPv2MeowijBevwxxAT8bWtWl8p4U/mwB6kQm6uJGt0ydek8t2KQl85LBOsqyvfvnDK9ckg1vPjLNPY6RL7Ex0c0e2lMFTc= ;{id = 62298}
0574797065370C74797065732D7369676E6564027762087369646E6C616273026E6C00000700010000003C0025076D61696C626F780C74797065732D7369676E6564027762087369646E6C616273026E6C00
/** calloc with stats */
void *unbound_stat_calloc(size_t nmemb, size_t size)
{
- size_t s = (nmemb*size==0)?(size_t)1:nmemb*size;
- void* res = calloc(1, s+16);
+ size_t s;
+ void* res;
+ if(nmemb != 0 && INT_MAX/nmemb < size)
+ return NULL; /* integer overflow check */
+ s = (nmemb*size==0)?(size_t)1:nmemb*size;
+ res = calloc(1, s+16);
if(!res) return NULL;
log_info("stat %p=calloc(%u, %u)", res+16, (unsigned)nmemb, (unsigned)size);
unbound_mem_alloc += s;
void *unbound_stat_calloc_lite(size_t nmemb, size_t size, const char* file,
int line, const char* func)
{
- size_t req = nmemb * size;
- void* res = malloc(req+lite_pad*2+sizeof(size_t));
+ size_t req;
+ void* res;
+ if(nmemb != 0 && INT_MAX/nmemb < size)
+ return NULL; /* integer overflow check */
+ req = nmemb * size;
+ res = malloc(req+lite_pad*2+sizeof(size_t));
if(!res) return NULL;
memmove(res, lite_pre, lite_pad);
memmove(res+lite_pad, &req, sizeof(size_t));
void* arg);
#ifdef UNBOUND_ALLOC_LITE
-# include <ldns/ldns.h>
-# include <ldns/packet.h>
+# include <sldns/ldns.h>
+# include <sldns/packet.h>
# ifdef HAVE_OPENSSL_SSL_H
# include <openssl/ssl.h>
# endif
#include "util/regional.h"
#include "util/fptr_wlist.h"
#include "util/data/dname.h"
-#include "ldns/wire2str.h"
-#include "ldns/parseutil.h"
+#include "util/rtt.h"
+#include "services/cache/infra.h"
+#include "sldns/wire2str.h"
+#include "sldns/parseutil.h"
#ifdef HAVE_GLOB_H
# include <glob.h>
#endif
#if CLIENT_SUBNET
#include "edns-subnet/edns-subnet.h"
#endif
+#ifdef HAVE_PWD_H
+#include <pwd.h>
+#endif
+
+/** from cfg username, after daemonise setup performed */
+uid_t cfg_uid = (uid_t)-1;
+/** from cfg username, after daemonise setup performed */
+gid_t cfg_gid = (gid_t)-1;
/** global config during parsing */
struct config_parser_state* cfg_parser = 0;
-/** lex in file */
-extern FILE* ub_c_in;
-/** lex out file */
-extern FILE* ub_c_out;
-/** the yacc lex generated parse function */
-int ub_c_parse(void);
-/** the lexer function */
-int ub_c_lex(void);
-/** wrap function */
-int ub_c_wrap(void);
-/** init lex state */
-void init_cfg_parse(void);
/** init ports possible for use */
static void init_outgoing_availports(int* array, int num);
cfg->prefetch_key = 0;
cfg->infra_cache_slabs = 4;
cfg->infra_cache_numhosts = 10000;
+ cfg->infra_cache_min_rtt = 50;
cfg->delay_close = 0;
if(!(cfg->outgoing_avail_ports = (int*)calloc(65536, sizeof(int))))
goto error_exit;
cfg->so_rcvbuf = 0;
cfg->so_sndbuf = 0;
cfg->so_reuseport = 0;
+ cfg->ip_transparent = 0;
cfg->num_ifs = 0;
cfg->ifs = NULL;
cfg->num_out_ifs = 0;
cfg->harden_dnssec_stripped = 1;
cfg->harden_below_nxdomain = 0;
cfg->harden_referral_path = 0;
+ cfg->harden_algo_downgrade = 1;
cfg->use_caps_bits_for_id = 0;
cfg->private_address = NULL;
cfg->private_domain = NULL;
cfg->local_zones = NULL;
cfg->local_zones_nodefault = NULL;
cfg->local_data = NULL;
+ cfg->unblock_lan_zones = 0;
cfg->python_script = NULL;
cfg->remote_control_enable = 0;
cfg->control_ifs = NULL;
cfg->control_port = UNBOUND_CONTROL_PORT;
+ cfg->remote_control_use_cert = 1;
cfg->minimal_responses = 0;
cfg->rrset_roundrobin = 0;
cfg->max_udp_size = 4096;
#endif
if(!(cfg->val_nsec3_key_iterations =
strdup("1024 150 2048 500 4096 2500"))) goto error_exit;
+#if defined(DNSTAP_SOCKET_PATH)
+ if(!(cfg->dnstap_socket_path = strdup(DNSTAP_SOCKET_PATH)))
+ goto error_exit;
+#endif
+ cfg->ratelimit = 0;
+ cfg->ratelimit_slabs = 4;
+ cfg->ratelimit_size = 4*1024*1024;
+ cfg->ratelimit_for_domain = NULL;
+ cfg->ratelimit_below_domain = NULL;
+ cfg->ratelimit_factor = 10;
return cfg;
error_exit:
config_delete(cfg);
else S_MEMSIZE("so-rcvbuf:", so_rcvbuf)
else S_MEMSIZE("so-sndbuf:", so_sndbuf)
else S_YNO("so-reuseport:", so_reuseport)
+ else S_YNO("ip-transparent:", ip_transparent)
else S_MEMSIZE("rrset-cache-size:", rrset_cache_size)
else S_POW2("rrset-cache-slabs:", rrset_cache_slabs)
else S_YNO("prefetch:", prefetch)
{ IS_NUMBER_OR_ZERO; cfg->max_ttl = atoi(val); MAX_TTL=(time_t)cfg->max_ttl;}
else if(strcmp(opt, "cache-min-ttl:") == 0)
{ IS_NUMBER_OR_ZERO; cfg->min_ttl = atoi(val); MIN_TTL=(time_t)cfg->min_ttl;}
+ else if(strcmp(opt, "infra-cache-min-rtt:") == 0) {
+ IS_NUMBER_OR_ZERO; cfg->infra_cache_min_rtt = atoi(val);
+ RTT_MIN_TIMEOUT=cfg->infra_cache_min_rtt;
+ }
else S_NUMBER_OR_ZERO("infra-host-ttl:", host_ttl)
else S_POW2("infra-cache-slabs:", infra_cache_slabs)
else S_SIZET_NONZERO("infra-cache-numhosts:", infra_cache_numhosts)
else S_YNO("harden-dnssec-stripped:", harden_dnssec_stripped)
else S_YNO("harden-below-nxdomain:", harden_below_nxdomain)
else S_YNO("harden-referral-path:", harden_referral_path)
+ else S_YNO("harden-algo-downgrade:", harden_algo_downgrade)
else S_YNO("use-caps-for-id", use_caps_bits_for_id)
else S_SIZET_OR_ZERO("unwanted-reply-threshold:", unwanted_threshold)
else S_STRLIST("private-address:", private_address)
else S_YNO("minimal-responses:", minimal_responses)
else S_YNO("rrset-roundrobin:", rrset_roundrobin)
else S_STRLIST("local-data:", local_data)
+ else S_YNO("unblock-lan-zones:", unblock_lan_zones)
else S_YNO("control-enable:", remote_control_enable)
else S_STRLIST("control-interface:", control_ifs)
else S_NUMBER_NONZERO("control-port:", control_port)
else S_NUMBER_OR_ZERO("max-client-subnet-ipv6:", max_client_subnet_ipv6)
else S_NUMBER_OR_ZERO("client-subnet-opcode:", client_subnet_opcode)
#endif
+ else if(strcmp(opt, "ratelimit:") == 0) {
+ IS_NUMBER_OR_ZERO; cfg->ratelimit = atoi(val);
+ infra_dp_ratelimit=cfg->ratelimit;
+ }
+ else S_MEMSIZE("ratelimit-size:", ratelimit_size)
+ else S_POW2("ratelimit-slabs:", ratelimit_slabs)
+ else S_NUMBER_OR_ZERO("ratelimit-factor:", ratelimit_factor)
/* val_sig_skew_min and max are copied into val_env during init,
* so this does not update val_env with set_option */
else if(strcmp(opt, "val-sig-skew-min:") == 0)
{ IS_NUMBER_OR_ZERO; cfg->val_sig_skew_max = (int32_t)atoi(val); }
else if (strcmp(opt, "outgoing-interface:") == 0) {
char* d = strdup(val);
- char** oi = (char**)malloc((cfg->num_out_ifs+1)*sizeof(char*));
+ char** oi =
+ (char**)reallocarray(NULL, (size_t)cfg->num_out_ifs+1, sizeof(char*));
if(!d || !oi) { free(d); free(oi); return -1; }
if(cfg->out_ifs && cfg->num_out_ifs) {
memmove(oi, cfg->out_ifs, cfg->num_out_ifs*sizeof(char*));
* interface, outgoing-interface, access-control,
* stub-zone, name, stub-addr, stub-host, stub-prime
* forward-first, stub-first,
- * forward-zone, name, forward-addr, forward-host */
+ * forward-zone, name, forward-addr, forward-host,
+ * ratelimit-for-domain, ratelimit-below-domain */
return 0;
}
return 1;
#define O_MEM(opt, str, var) if(strcmp(opt, str)==0) { \
if(cfg->var > 1024*1024*1024) { \
size_t f=cfg->var/(size_t)1000000, b=cfg->var%(size_t)1000000; \
- snprintf(buf, len, "%u%6.6u\n", (unsigned)f, (unsigned)b); \
- } else snprintf(buf, len, "%u\n", (unsigned)cfg->var); \
+ snprintf(buf, len, "%u%6.6u", (unsigned)f, (unsigned)b); \
+ } else snprintf(buf, len, "%u", (unsigned)cfg->var); \
func(buf, arg);}
/** compare and print list option */
#define O_LST(opt, name, lst) if(strcmp(opt, name)==0) { \
else O_MEM(opt, "so-rcvbuf", so_rcvbuf)
else O_MEM(opt, "so-sndbuf", so_sndbuf)
else O_YNO(opt, "so-reuseport", so_reuseport)
+ else O_YNO(opt, "ip-transparent", ip_transparent)
else O_MEM(opt, "rrset-cache-size", rrset_cache_size)
else O_DEC(opt, "rrset-cache-slabs", rrset_cache_slabs)
else O_YNO(opt, "prefetch-key", prefetch_key)
else O_DEC(opt, "cache-min-ttl", min_ttl)
else O_DEC(opt, "infra-host-ttl", host_ttl)
else O_DEC(opt, "infra-cache-slabs", infra_cache_slabs)
+ else O_DEC(opt, "infra-cache-min-rtt", infra_cache_min_rtt)
else O_MEM(opt, "infra-cache-numhosts", infra_cache_numhosts)
else O_UNS(opt, "delay-close", delay_close)
else O_YNO(opt, "do-ip4", do_ip4)
else O_YNO(opt, "harden-dnssec-stripped", harden_dnssec_stripped)
else O_YNO(opt, "harden-below-nxdomain", harden_below_nxdomain)
else O_YNO(opt, "harden-referral-path", harden_referral_path)
+ else O_YNO(opt, "harden-algo-downgrade", harden_algo_downgrade)
else O_YNO(opt, "use-caps-for-id", use_caps_bits_for_id)
else O_DEC(opt, "unwanted-reply-threshold", unwanted_threshold)
else O_YNO(opt, "do-not-query-localhost", donotquery_localhost)
else O_DEC(opt, "max-client-subnet-ipv6", max_client_subnet_ipv6)
else O_DEC(opt, "client-subnet-opcode", client_subnet_opcode)
#endif
+ else O_YNO(opt, "unblock-lan-zones", unblock_lan_zones)
else O_DEC(opt, "max-udp-size", max_udp_size)
else O_STR(opt, "python-script", python_script)
+ else O_DEC(opt, "ratelimit", ratelimit)
+ else O_MEM(opt, "ratelimit-size", ratelimit_size)
+ else O_DEC(opt, "ratelimit-slabs", ratelimit_slabs)
+ else O_LS2(opt, "ratelimit-for-domain", ratelimit_for_domain)
+ else O_LS2(opt, "ratelimit-below-domain", ratelimit_below_domain)
+ else O_DEC(opt, "ratelimit-factor", ratelimit_factor)
else O_DEC(opt, "val-sig-skew-min", val_sig_skew_min)
else O_DEC(opt, "val-sig-skew-max", val_sig_skew_max)
/* not here:
errno=EINVAL;
return 0;
}
+
return 1;
}
free(cfg->server_cert_file);
free(cfg->control_key_file);
free(cfg->control_cert_file);
+ free(cfg->dns64_prefix);
+ free(cfg->dnstap_socket_path);
+ free(cfg->dnstap_identity);
+ free(cfg->dnstap_version);
+ config_deldblstrlist(cfg->ratelimit_for_domain);
+ config_deldblstrlist(cfg->ratelimit_below_domain);
free(cfg);
}
*avail = NULL;
if(num == 0)
return 0;
- *avail = (int*)malloc(sizeof(int)*num);
+ *avail = (int*)reallocarray(NULL, (size_t)num, sizeof(int));
if(!*avail)
return 0;
for(i=0; i<65536; i++) {
/* sp ::= (space|tab)* */
int num = 0;
while(*s) {
- while(*s && isspace((int)*s))
+ while(*s && isspace((unsigned char)*s))
s++;
if(!*s) /* end of string */
break;
s++;
if(!*s) /* only - not allowed */
return 0;
- if(!isdigit((int)*s)) /* bad character */
+ if(!isdigit((unsigned char)*s)) /* bad character */
return 0;
- while(*s && isdigit((int)*s))
+ while(*s && isdigit((unsigned char)*s))
s++;
num++;
}
{
size_t i;
for(i=0; i<l; i++)
- if(!isdigit(str[i]))
+ if(!isdigit((unsigned char)str[i]))
return 0;
return 1;
}
else if(len > 1 && str[len-1] == 'B')
len--;
- if(len > 1 && tolower(str[len-1]) == 'g')
+ if(len > 1 && tolower((unsigned char)str[len-1]) == 'g')
mult = 1024*1024*1024;
- else if(len > 1 && tolower(str[len-1]) == 'm')
+ else if(len > 1 && tolower((unsigned char)str[len-1]) == 'm')
mult = 1024*1024;
- else if(len > 1 && tolower(str[len-1]) == 'k')
+ else if(len > 1 && tolower((unsigned char)str[len-1]) == 'k')
mult = 1024;
- else if(len > 0 && isdigit(str[len-1]))
+ else if(len > 0 && isdigit((unsigned char)str[len-1]))
mult = 1;
else {
log_err("unknown size specifier: '%s'", str);
{
MAX_TTL = (time_t)config->max_ttl;
MIN_TTL = (time_t)config->min_ttl;
+ RTT_MIN_TIMEOUT = config->infra_cache_min_rtt;
EDNS_ADVERTISED_SIZE = (uint16_t)config->edns_buffer_size;
#ifdef CLIENT_SUBNET
EDNSSUBNET_OPCODE = (uint16_t)config->client_subnet_opcode;
log_set_time_asc(config->log_time_ascii);
}
+void config_lookup_uid(struct config_file* cfg)
+{
+#ifdef HAVE_GETPWNAM
+ /* translate username into uid and gid */
+ if(cfg->username && cfg->username[0]) {
+ struct passwd *pwd;
+ if((pwd = getpwnam(cfg->username)) != NULL) {
+ cfg_uid = pwd->pw_uid;
+ cfg_gid = pwd->pw_gid;
+ }
+ }
+#else
+ (void)cfg;
+#endif
+}
+
/**
* Calculate string length of full pathname in original filesys
* @param fname: the path name to convert.
/* parse it as: [zone_name] [between stuff] [zone_type] */
name = val;
- while(*name && isspace(*name))
+ while(*name && isspace((unsigned char)*name))
name++;
if(!*name) {
log_err("syntax error: too short: %s", val);
buf[name_end-name] = '\0';
type = last_space_pos(name_end);
- while(type && *type && isspace(*type))
+ while(type && *type && isspace((unsigned char)*type))
type++;
if(!type || !*type) {
log_err("syntax error: expected zone type: %s", val);
/* parse it as: [IP] [between stuff] [name] */
ip = str;
- while(*ip && isspace(*ip))
+ while(*ip && isspace((unsigned char)*ip))
ip++;
if(!*ip) {
log_err("syntax error: too short: %s", str);
}
/* printed the reverse address, now the between goop and name on end */
- while(*ip_end && isspace(*ip_end))
+ while(*ip_end && isspace((unsigned char)*ip_end))
ip_end++;
if(name>ip_end) {
snprintf(buf+strlen(buf), sizeof(buf)-strlen(buf), "%.*s",
size_t infra_cache_slabs;
/** max number of hosts in the infra cache */
size_t infra_cache_numhosts;
+ /** min value for infra cache rtt */
+ int infra_cache_min_rtt;
/** delay close of udp-timeouted ports, if 0 no delayclose. in msec */
int delay_close;
size_t so_sndbuf;
/** SO_REUSEPORT requested on port 53 sockets */
int so_reuseport;
+ /** IP_TRANSPARENT socket option requested on port 53 sockets */
+ int ip_transparent;
/** number of interfaces to open. If 0 default all interfaces. */
int num_ifs;
int harden_below_nxdomain;
/** harden the referral path, query for NS,A,AAAA and validate */
int harden_referral_path;
+ /** harden against algorithm downgrade */
+ int harden_algo_downgrade;
/** use 0x20 bits in query as random ID bits */
int use_caps_bits_for_id;
/** strip away these private addrs from answers, no DNS Rebinding */
struct config_strlist* local_zones_nodefault;
/** local data RRs configged */
struct config_strlist* local_data;
+ /** unblock lan zones (reverse lookups for 10/8 and so on) */
+ int unblock_lan_zones;
/** remote control section. enable toggle. */
int remote_control_enable;
struct config_strlist* control_ifs;
/** port number for the control port */
int control_port;
+ /** use certificates for remote control */
+ int remote_control_use_cert;
/** private key file for server */
char* server_key_file;
/** certificate file for server */
/* maximum UDP response size */
size_t max_udp_size;
+
+ /* DNS64 prefix */
+ char* dns64_prefix;
+
+ /* Synthetize all AAAA record despite the presence of an authoritative one */
+ int dns64_synthall;
+
+ /** true to enable dnstap support */
+ int dnstap;
+ /** dnstap socket path */
+ char* dnstap_socket_path;
+ /** true to send "identity" via dnstap */
+ int dnstap_send_identity;
+ /** true to send "version" via dnstap */
+ int dnstap_send_version;
+ /** dnstap "identity", hostname is used if "". */
+ char* dnstap_identity;
+ /** dnstap "version", package version is used if "". */
+ char* dnstap_version;
+
+ /** true to log dnstap RESOLVER_QUERY message events */
+ int dnstap_log_resolver_query_messages;
+ /** true to log dnstap RESOLVER_RESPONSE message events */
+ int dnstap_log_resolver_response_messages;
+ /** true to log dnstap CLIENT_QUERY message events */
+ int dnstap_log_client_query_messages;
+ /** true to log dnstap CLIENT_RESPONSE message events */
+ int dnstap_log_client_response_messages;
+ /** true to log dnstap FORWARDER_QUERY message events */
+ int dnstap_log_forwarder_query_messages;
+ /** true to log dnstap FORWARDER_RESPONSE message events */
+ int dnstap_log_forwarder_response_messages;
+
+ /** ratelimit 0 is off, otherwise qps (unless overridden) */
+ int ratelimit;
+ /** number of slabs for ratelimit cache */
+ size_t ratelimit_slabs;
+ /** memory size in bytes for ratelimit cache */
+ size_t ratelimit_size;
+ /** ratelimits for domain (exact match) */
+ struct config_str2list* ratelimit_for_domain;
+ /** ratelimits below domain */
+ struct config_str2list* ratelimit_below_domain;
+ /** ratelimit factor, 0 blocks all, 10 allows 1/10 of traffic */
+ int ratelimit_factor;
};
+/** from cfg username, after daemonise setup performed */
+extern uid_t cfg_uid;
+/** from cfg username, after daemonise setup performed */
+extern gid_t cfg_gid;
+
/**
* Stub config options
*/
*/
void config_apply(struct config_file* config);
+/**
+ * Find username, sets cfg_uid and cfg_gid.
+ * @param config: the config structure.
+ */
+void config_lookup_uid(struct config_file* config);
+
/**
* Set the given keyword to the given value.
* @param config: where to store config
/** global config parser object used during config parsing */
extern struct config_parser_state* cfg_parser;
+/** init lex state */
+void init_cfg_parse(void);
+/** lex in file */
+extern FILE* ub_c_in;
+/** lex out file */
+extern FILE* ub_c_out;
+/** the yacc lex generated parse function */
+int ub_c_parse(void);
+/** the lexer function */
+int ub_c_lex(void);
+/** wrap function */
+int ub_c_wrap(void);
/** parsing helpers: print error with file and line numbers */
void ub_c_error(const char* msg);
/** parsing helpers: print error with file and line numbers */
*yy_cp = '\0'; \
(yy_c_buf_p) = yy_cp;
-#define YY_NUM_RULES 150
-#define YY_END_OF_BUFFER 151
+#define YY_NUM_RULES 176
+#define YY_END_OF_BUFFER 177
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
-static yyconst flex_int16_t yy_accept[1441] =
+static yyconst flex_int16_t yy_accept[1763] =
{ 0,
- 1, 1, 132, 132, 136, 136, 140, 140, 144, 144,
- 1, 1, 151, 148, 1, 130, 130, 149, 2, 149,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 132,
- 133, 133, 134, 149, 136, 137, 137, 138, 149, 143,
- 140, 141, 141, 142, 149, 144, 145, 145, 146, 149,
- 147, 131, 2, 135, 149, 147, 148, 0, 1, 2,
- 2, 2, 2, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
-
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 132, 0, 136, 0, 143, 0, 140, 144,
- 0, 147, 0, 2, 2, 147, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 147, 148, 148, 148, 148, 148, 148,
-
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 147, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
-
- 148, 148, 148, 148, 65, 148, 148, 148, 148, 148,
- 6, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 147, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
-
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 147, 148, 148, 148, 148, 29, 148, 148, 148, 148,
- 148, 148, 148, 12, 13, 148, 15, 14, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 125, 148, 148, 148,
- 148, 148, 148, 3, 148, 148, 148, 148, 148, 148,
-
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 147, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 139, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 32, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 33, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
-
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 84, 139, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 83,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 63, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 20,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
-
- 148, 148, 148, 148, 148, 30, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 31, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 22, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 26, 148, 27, 148, 148,
- 148, 66, 148, 67, 148, 64, 148, 148, 148, 148,
-
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 5, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 86, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 23,
- 148, 148, 148, 148, 111, 110, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 34, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 69, 68, 148, 148,
- 148, 148, 148, 148, 107, 148, 148, 148, 148, 148,
-
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 50, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 54, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 109, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 4, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 104,
- 148, 148, 148, 148, 148, 148, 148, 148, 119, 105,
-
- 148, 21, 148, 148, 148, 148, 71, 148, 72, 70,
- 148, 148, 148, 148, 148, 148, 82, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 106, 148, 148, 148,
- 148, 148, 129, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 62, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 28, 148, 148, 17, 148, 148,
- 148, 16, 148, 91, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 41, 42, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 73,
- 148, 148, 148, 148, 148, 81, 148, 148, 148, 148,
-
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 85, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 124, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 95, 148, 99, 148, 148, 148, 148, 76, 148, 148,
- 148, 117, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 98, 148, 148, 148, 148,
- 43, 44, 148, 49, 100, 148, 112, 108, 148, 148,
- 148, 37, 148, 102, 148, 148, 148, 148, 148, 7,
- 148, 61, 116, 148, 148, 148, 148, 148, 148, 148,
-
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 87,
- 148, 148, 126, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 101, 148, 148, 36, 38,
- 148, 148, 148, 148, 148, 60, 148, 148, 148, 148,
- 148, 120, 18, 19, 148, 148, 148, 148, 148, 148,
- 58, 148, 148, 148, 148, 148, 148, 148, 148, 148,
- 148, 122, 148, 148, 35, 148, 148, 148, 148, 148,
- 148, 11, 148, 148, 148, 148, 148, 148, 148, 148,
- 10, 148, 148, 39, 148, 128, 148, 121, 148, 148,
-
- 148, 148, 148, 148, 148, 148, 148, 148, 94, 93,
- 148, 148, 123, 118, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 45, 148, 148, 127, 148, 148,
- 148, 148, 40, 148, 148, 148, 148, 88, 90, 148,
- 148, 148, 92, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 148, 148, 148, 148, 148, 24,
- 148, 148, 77, 148, 148, 148, 148, 148, 148, 148,
- 148, 148, 148, 148, 115, 148, 148, 148, 148, 148,
- 148, 148, 25, 148, 148, 9, 148, 148, 113, 51,
- 148, 148, 148, 97, 148, 78, 74, 148, 148, 148,
-
- 53, 57, 52, 148, 46, 148, 148, 8, 148, 148,
- 96, 148, 148, 148, 56, 148, 47, 148, 148, 148,
- 114, 148, 148, 89, 75, 55, 79, 80, 48, 148,
- 148, 148, 148, 59, 148, 148, 148, 148, 103, 0
+ 1, 1, 158, 158, 162, 162, 166, 166, 170, 170,
+ 1, 1, 177, 174, 1, 156, 156, 175, 2, 175,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 158,
+ 159, 159, 160, 175, 162, 163, 163, 164, 175, 169,
+ 166, 167, 167, 168, 175, 170, 171, 171, 172, 175,
+ 173, 157, 2, 161, 175, 173, 174, 0, 1, 2,
+ 2, 2, 2, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 158, 0, 162, 0, 169, 0,
+ 166, 170, 0, 173, 0, 2, 2, 173, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 173, 174,
+
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 173, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 68, 174, 174,
+ 174, 174, 174, 6, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 173, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 173, 174, 174, 174, 174, 30, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 137, 174, 12, 13, 174,
+ 15, 14, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 130, 174, 174, 174, 174, 174, 174, 174, 3,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 173, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 165, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+
+ 174, 33, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 34, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 87, 165, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 86, 174, 174,
+
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 66, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 20,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 31, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 32,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 22, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 150, 174, 174, 174, 174, 174, 174, 174, 26,
+ 174, 27, 174, 174, 174, 69, 174, 70, 174, 67,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 5, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 89, 174, 174, 174, 174, 174, 174, 174, 174,
+
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 23, 174, 174, 174, 174, 174,
+ 114, 113, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 35, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 72, 71, 174, 174, 174,
+ 174, 174, 174, 174, 110, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 52, 174, 174, 174, 174,
+
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 56,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 112, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 4, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 107, 174,
+ 174, 174, 174, 174, 174, 174, 174, 123, 174, 108,
+
+ 174, 135, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 21, 174, 174, 174, 174, 74, 174, 75,
+ 73, 174, 174, 174, 174, 174, 174, 174, 85, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 109, 174, 174, 174, 174, 174, 134, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 65, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 28, 174, 174, 17, 174, 174, 174,
+ 16, 174, 94, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 42, 43, 174, 174,
+
+ 174, 174, 174, 174, 174, 174, 138, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 76, 174, 174, 174, 174, 174, 174, 84, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 88, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 129, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 98, 174, 102, 174, 174, 174, 174, 79, 174, 174,
+ 174, 121, 174, 174, 174, 174, 136, 174, 174, 174,
+
+ 174, 174, 174, 174, 143, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 101, 174, 174, 174,
+ 174, 174, 44, 45, 174, 29, 51, 103, 174, 115,
+ 111, 174, 174, 174, 38, 174, 105, 174, 174, 174,
+ 174, 174, 7, 174, 64, 174, 174, 174, 152, 174,
+ 120, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 90,
+ 142, 174, 174, 174, 174, 174, 174, 174, 174, 131,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+
+ 174, 174, 174, 174, 104, 174, 174, 37, 39, 174,
+ 174, 174, 174, 174, 63, 174, 174, 174, 151, 174,
+ 174, 174, 174, 174, 125, 18, 19, 174, 174, 174,
+ 174, 174, 174, 174, 61, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 127, 124, 174, 174, 174,
+ 174, 174, 174, 174, 174, 36, 174, 174, 174, 174,
+ 174, 174, 174, 11, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 10, 174, 174, 174, 155, 174, 40,
+ 174, 133, 174, 126, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 97, 96, 174, 174, 128,
+
+ 122, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 46,
+ 174, 174, 132, 174, 174, 174, 174, 174, 174, 41,
+ 174, 174, 174, 174, 91, 93, 116, 174, 174, 174,
+ 95, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 139, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 24, 174, 174, 174,
+ 174, 80, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 141, 174, 174, 119,
+ 174, 174, 174, 174, 174, 174, 174, 49, 174, 25,
+
+ 174, 174, 9, 174, 174, 174, 174, 117, 53, 174,
+ 174, 174, 100, 174, 81, 174, 174, 174, 174, 174,
+ 140, 77, 174, 174, 174, 174, 55, 59, 54, 174,
+ 47, 174, 174, 8, 174, 153, 174, 174, 99, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 60, 58,
+ 174, 48, 174, 174, 174, 174, 118, 174, 174, 92,
+ 174, 174, 174, 174, 174, 174, 78, 57, 82, 83,
+ 50, 154, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 62, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 106, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 146, 174, 174, 174,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 144, 174, 147, 148, 174, 174, 174, 174, 174, 145,
+ 149, 0
} ;
static yyconst flex_int32_t yy_ec[256] =
1, 1, 1, 1, 1, 1, 1, 1, 1
} ;
-static yyconst flex_int16_t yy_base[1455] =
+static yyconst flex_int16_t yy_base[1777] =
{ 0,
0, 0, 37, 40, 44, 51, 63, 75, 56, 68,
- 87, 108, 2536, 2287, 50, 2876, 2876, 2876, 129, 94,
- 70, 104, 122, 90, 92, 124, 132, 95, 84, 111,
- 140, 142, 50, 135, 151, 152, 161, 154, 175, 2028,
- 2876, 2876, 2876, 70, 1997, 2876, 2876, 2876, 42, 1627,
- 1461, 2876, 2876, 2876, 192, 1390, 2876, 2876, 2876, 186,
- 1313, 2876, 196, 2876, 200, 193, 1226, 206, 120, 0,
- 219, 0, 0, 103, 170, 138, 199, 203, 206, 209,
- 204, 212, 214, 222, 220, 145, 224, 225, 227, 228,
- 226, 238, 237, 182, 245, 246, 239, 247, 248, 255,
-
- 251, 259, 254, 256, 265, 257, 268, 260, 271, 115,
- 272, 274, 283, 281, 285, 279, 282, 287, 49, 289,
- 290, 295, 1146, 308, 1029, 310, 870, 318, 845, 762,
- 323, 375, 327, 331, 0, 324, 328, 334, 296, 330,
- 317, 335, 326, 341, 339, 348, 349, 350, 337, 347,
- 345, 355, 357, 360, 361, 365, 354, 366, 378, 364,
- 367, 386, 387, 390, 394, 373, 391, 397, 393, 400,
- 404, 401, 403, 402, 405, 406, 407, 410, 413, 414,
- 416, 417, 418, 426, 423, 303, 424, 432, 429, 434,
- 445, 446, 442, 438, 430, 447, 456, 452, 453, 458,
-
- 459, 454, 460, 464, 465, 469, 471, 473, 475, 476,
- 474, 484, 481, 489, 486, 497, 482, 493, 494, 496,
- 498, 500, 501, 504, 508, 507, 512, 506, 513, 514,
- 519, 521, 525, 530, 531, 520, 536, 538, 542, 539,
- 545, 543, 548, 554, 550, 557, 555, 556, 553, 562,
- 563, 569, 566, 565, 573, 574, 576, 575, 596, 577,
- 582, 580, 584, 585, 587, 602, 594, 604, 590, 606,
- 618, 609, 616, 617, 628, 619, 620, 627, 623, 631,
- 634, 632, 635, 642, 644, 640, 648, 646, 659, 641,
- 656, 657, 658, 665, 668, 661, 667, 669, 672, 670,
-
- 677, 675, 673, 685, 2876, 687, 679, 683, 689, 690,
- 2876, 692, 693, 695, 696, 697, 704, 703, 707, 708,
- 710, 711, 714, 716, 717, 718, 738, 720, 719, 727,
- 723, 741, 724, 747, 736, 745, 750, 734, 752, 755,
- 758, 756, 761, 759, 771, 768, 769, 770, 773, 782,
- 778, 779, 781, 785, 786, 788, 793, 795, 802, 799,
- 804, 810, 796, 806, 808, 814, 815, 813, 807, 821,
- 820, 822, 823, 828, 824, 837, 830, 838, 840, 843,
- 833, 845, 847, 849, 851, 857, 853, 855, 861, 862,
- 854, 860, 868, 875, 871, 882, 884, 880, 883, 885,
-
- 892, 726, 869, 893, 890, 894, 896, 898, 899, 900,
- 902, 904, 905, 911, 907, 913, 919, 916, 924, 910,
- 925, 927, 928, 930, 931, 939, 932, 935, 943, 941,
- 946, 945, 949, 947, 956, 2876, 954, 963, 960, 959,
- 961, 962, 966, 2876, 2876, 967, 2876, 2876, 969, 974,
- 972, 982, 985, 983, 975, 986, 991, 996, 998, 999,
- 1001, 1006, 1009, 1008, 990, 1002, 1014, 1017, 1015, 1019,
- 1020, 1024, 1026, 1032, 1033, 1035, 1034, 1036, 1039, 1041,
- 1043, 1042, 1046, 1050, 1056, 1052, 2876, 1054, 1053, 1060,
- 1055, 1063, 1062, 2876, 1064, 1069, 1066, 1068, 1075, 1076,
-
- 1077, 1078, 1080, 1081, 1083, 1079, 1084, 1089, 1091, 1099,
- 1102, 1095, 1101, 1103, 1104, 1110, 1112, 1115, 1116, 1117,
- 1124, 1120, 1122, 1127, 1123, 1128, 1129, 1131, 1133, 1135,
- 1157, 1137, 1136, 1139, 1143, 1145, 1142, 1153, 1144, 1154,
- 1169, 1171, 1165, 1172, 1180, 1178, 1174, 1185, 1186, 1188,
- 1189, 2876, 1196, 1194, 1190, 1198, 1201, 1200, 1152, 1202,
- 1203, 1192, 1204, 1207, 1215, 2876, 1213, 1214, 1217, 1222,
- 1220, 1223, 1224, 1230, 1231, 1241, 2876, 1243, 1244, 1246,
- 1240, 1234, 1247, 1251, 1252, 1253, 1256, 1259, 1260, 1262,
- 1264, 1266, 1267, 1270, 1269, 1271, 1274, 1278, 1277, 1279,
-
- 1280, 1283, 1281, 1293, 1300, 1289, 1297, 1299, 1301, 1302,
- 1307, 1305, 1308, 1306, 1309, 2876, 229, 1310, 1311, 1312,
- 1321, 1327, 1328, 1331, 1319, 1329, 1335, 1337, 1338, 1320,
- 1342, 1344, 1345, 1346, 1347, 1350, 1348, 1356, 1349, 1357,
- 1359, 1361, 1363, 1364, 1365, 1369, 1371, 1368, 1370, 2876,
- 1381, 1377, 1384, 1378, 1389, 1400, 1387, 1380, 1396, 1402,
- 1403, 1407, 1408, 1409, 1401, 1411, 1414, 1415, 1416, 1422,
- 1423, 1425, 1424, 1426, 1427, 2876, 1432, 1431, 1433, 1439,
- 1437, 1441, 1443, 1445, 1447, 1448, 1455, 1452, 1461, 2876,
- 1463, 1464, 1458, 1471, 1462, 1475, 1476, 1479, 1468, 1480,
-
- 1483, 1484, 1472, 1486, 1487, 2876, 1498, 1500, 1496, 1502,
- 1499, 1503, 1504, 1506, 1507, 1509, 1516, 1510, 1513, 1512,
- 1517, 1518, 1514, 1520, 1521, 1523, 1524, 2876, 1541, 1525,
- 1531, 1537, 1538, 1528, 1543, 1544, 1550, 1552, 1553, 1554,
- 1555, 1557, 1558, 1559, 1561, 1565, 1572, 1567, 1571, 1579,
- 1586, 1582, 2876, 1585, 1587, 1575, 1590, 1596, 1594, 1597,
- 1598, 1604, 1600, 1601, 1602, 1610, 1603, 1606, 1611, 1612,
- 1607, 1613, 1614, 1618, 1623, 1632, 1624, 1633, 1615, 1639,
- 1640, 1643, 1641, 1644, 1651, 2876, 1648, 2876, 1649, 1652,
- 1655, 2876, 1657, 2876, 1659, 2876, 1660, 1667, 1662, 1665,
-
- 1669, 1670, 1672, 1673, 1675, 1678, 1680, 1679, 1682, 1681,
- 2876, 1684, 1689, 1687, 1692, 1694, 1699, 1695, 1696, 1705,
- 1711, 1697, 1707, 1709, 1713, 2876, 1718, 1716, 1722, 1729,
- 1726, 1720, 1728, 1730, 1731, 1732, 1734, 1743, 1735, 1733,
- 1737, 1744, 1745, 1746, 1748, 1754, 1752, 1753, 1756, 2876,
- 1760, 1762, 1767, 1765, 2876, 2876, 1771, 1763, 1768, 1778,
- 1774, 1780, 1782, 1784, 1785, 1791, 1798, 1788, 1792, 1795,
- 1800, 1799, 1802, 1803, 1806, 1807, 2876, 1815, 1809, 1816,
- 1817, 1823, 1818, 1826, 1819, 1828, 2876, 2876, 1833, 1830,
- 1834, 1835, 1839, 1840, 2876, 1836, 1842, 1844, 1845, 1848,
-
- 1851, 1847, 1857, 1862, 1859, 1863, 1864, 1865, 1871, 1867,
- 1868, 1874, 1878, 1882, 2876, 1883, 1888, 1889, 1869, 1891,
- 1893, 1895, 1896, 1898, 1900, 1906, 1902, 2876, 1908, 1904,
- 1912, 1909, 1915, 1917, 1924, 1911, 1920, 1921, 1926, 1927,
- 1929, 1931, 1932, 1935, 2876, 1936, 1937, 1939, 1944, 1942,
- 1943, 1947, 1950, 1953, 1954, 2876, 1956, 1965, 1962, 1964,
- 1967, 1963, 1969, 1972, 1974, 1975, 1976, 1977, 1980, 1981,
- 1984, 1987, 2000, 1985, 1988, 2009, 2008, 2015, 2016, 1993,
- 2017, 2001, 2018, 2019, 1995, 2026, 2023, 2029, 2025, 2876,
- 2027, 2033, 2035, 2041, 2038, 2042, 2040, 2039, 2876, 2876,
-
- 2043, 2876, 2049, 2051, 2053, 2054, 2876, 2057, 2876, 2876,
- 2052, 2064, 2058, 2067, 2070, 2074, 2876, 2071, 2060, 2076,
- 2065, 2079, 2081, 2082, 2083, 2084, 2876, 2085, 2087, 2088,
- 2092, 2095, 2876, 2096, 2100, 2102, 2103, 2105, 2109, 2111,
- 2112, 2113, 2120, 2117, 2876, 2118, 2121, 2124, 2119, 2127,
- 2132, 2125, 2129, 2140, 2876, 2142, 2143, 2876, 2141, 2144,
- 2145, 2876, 2149, 2876, 2150, 2126, 2153, 2158, 2159, 2166,
- 2160, 2163, 2169, 2170, 2172, 2173, 2876, 2876, 2175, 2176,
- 2178, 2186, 2180, 2184, 2191, 2182, 2188, 2194, 2196, 2876,
- 2198, 2199, 2200, 2201, 2202, 2876, 2204, 2205, 2206, 2211,
-
- 2209, 2217, 2226, 2214, 2229, 2231, 2232, 2234, 2236, 2238,
- 2237, 2876, 2207, 2240, 2241, 2243, 2244, 2247, 2245, 2249,
- 2255, 2257, 2259, 2876, 2264, 2246, 2266, 2261, 2269, 2268,
- 2273, 2274, 2275, 2277, 2279, 2281, 2282, 2283, 2290, 2289,
- 2876, 2286, 2876, 2294, 2300, 2302, 2304, 2876, 2295, 2307,
- 2308, 2876, 2309, 2311, 2315, 2317, 2319, 2325, 2326, 2318,
- 2328, 2327, 2329, 2335, 2333, 2876, 2336, 2337, 2340, 2341,
- 2876, 2876, 2344, 2876, 2876, 2350, 2876, 2876, 2346, 2353,
- 2355, 2876, 2357, 2876, 2364, 2360, 2362, 2363, 2365, 2876,
- 2367, 2876, 2876, 2368, 2369, 2372, 2374, 2375, 2377, 2382,
-
- 2384, 2379, 2387, 2389, 2390, 2392, 2393, 2395, 2397, 2396,
- 2398, 2399, 2400, 2403, 2407, 2408, 2409, 2410, 2420, 2876,
- 2416, 2426, 2876, 2429, 2421, 2423, 2431, 2432, 2435, 2433,
- 2437, 2444, 2440, 2441, 2442, 2876, 2443, 2445, 2876, 2876,
- 2446, 2453, 2448, 2454, 2457, 2876, 2459, 2461, 2468, 2465,
- 2472, 2876, 2876, 2876, 2473, 2476, 2477, 2478, 2479, 2481,
- 2876, 2482, 2485, 2487, 2488, 2494, 2496, 2504, 2491, 2501,
- 2508, 2876, 2505, 2502, 2876, 2509, 2511, 2513, 2516, 2517,
- 2519, 2876, 2515, 2520, 2527, 2521, 2536, 2533, 2529, 2535,
- 2876, 2538, 2541, 2876, 2543, 2876, 2544, 2876, 2545, 2548,
-
- 2550, 2552, 2556, 2557, 2546, 2563, 2562, 2566, 2876, 2876,
- 2567, 2568, 2876, 2876, 2559, 2569, 2571, 2579, 2576, 2581,
- 2574, 2582, 2584, 2583, 2876, 2585, 2587, 2876, 2589, 2598,
- 2591, 2600, 2876, 2602, 2604, 2599, 2605, 2876, 2876, 2610,
- 2616, 2612, 2876, 2614, 2618, 2620, 2622, 2623, 2629, 2624,
- 2626, 2631, 2632, 2634, 2635, 2636, 2644, 2637, 2646, 2876,
- 2648, 2645, 2876, 2649, 2657, 2659, 2654, 2652, 2660, 2663,
- 2666, 2668, 2670, 2672, 2876, 2674, 2676, 2683, 2685, 2687,
- 2689, 2693, 2876, 2675, 2695, 2876, 2699, 2700, 2876, 2876,
- 2701, 2703, 2706, 2876, 2707, 2876, 2876, 2690, 2714, 2704,
-
- 2876, 2876, 2876, 2716, 2876, 2720, 2719, 2876, 2722, 2724,
- 2876, 2725, 2727, 2729, 2876, 2731, 2876, 2733, 2735, 2737,
- 2876, 2738, 2740, 2876, 2876, 2876, 2876, 2876, 2876, 2742,
- 2744, 2748, 2745, 2876, 2751, 2749, 2752, 2756, 2876, 2876,
- 2784, 2791, 2798, 2805, 2812, 94, 2819, 2826, 2833, 2840,
- 2847, 2854, 2861, 2868
+ 87, 108, 2432, 2240, 50, 3498, 3498, 3498, 129, 94,
+ 70, 104, 130, 90, 92, 124, 127, 95, 84, 111,
+ 137, 148, 50, 150, 161, 158, 154, 167, 182, 2050,
+ 3498, 3498, 3498, 70, 1873, 3498, 3498, 3498, 42, 1765,
+ 1607, 3498, 3498, 3498, 199, 1509, 3498, 3498, 3498, 179,
+ 1316, 3498, 203, 3498, 207, 122, 1209, 213, 120, 0,
+ 224, 0, 0, 103, 147, 140, 206, 208, 180, 200,
+ 210, 211, 217, 219, 230, 220, 164, 227, 228, 231,
+ 232, 233, 248, 241, 221, 244, 250, 242, 256, 255,
+
+ 258, 260, 264, 261, 252, 263, 262, 276, 275, 277,
+ 278, 279, 282, 284, 288, 287, 289, 286, 292, 293,
+ 303, 306, 300, 307, 1046, 324, 917, 326, 879, 330,
+ 630, 480, 336, 441, 340, 344, 0, 337, 313, 346,
+ 330, 339, 342, 343, 349, 355, 353, 359, 362, 383,
+ 351, 361, 363, 49, 366, 367, 309, 364, 373, 371,
+ 376, 374, 378, 377, 391, 395, 405, 406, 390, 402,
+ 412, 408, 414, 415, 417, 416, 418, 419, 420, 421,
+ 426, 428, 427, 430, 432, 433, 434, 444, 437, 446,
+ 449, 445, 365, 450, 458, 465, 466, 467, 451, 454,
+
+ 464, 475, 471, 474, 468, 477, 479, 478, 481, 490,
+ 488, 492, 496, 494, 498, 499, 500, 505, 506, 507,
+ 508, 511, 517, 515, 518, 519, 520, 522, 524, 525,
+ 526, 527, 537, 528, 534, 530, 543, 538, 545, 548,
+ 551, 556, 561, 549, 557, 562, 568, 565, 573, 563,
+ 575, 576, 582, 579, 585, 581, 588, 583, 584, 589,
+ 595, 601, 592, 594, 602, 604, 607, 608, 627, 609,
+ 611, 612, 615, 616, 625, 628, 632, 635, 621, 638,
+ 649, 637, 640, 656, 647, 659, 668, 650, 658, 660,
+ 648, 667, 671, 661, 672, 673, 678, 680, 677, 683,
+
+ 689, 688, 693, 690, 696, 698, 699, 707, 703, 704,
+ 705, 706, 708, 709, 714, 715, 720, 3498, 722, 716,
+ 725, 726, 727, 3498, 728, 729, 730, 731, 738, 734,
+ 746, 747, 745, 732, 751, 752, 753, 755, 757, 758,
+ 778, 761, 759, 769, 762, 767, 770, 766, 782, 780,
+ 776, 785, 789, 790, 792, 793, 796, 798, 799, 806,
+ 805, 807, 809, 811, 819, 816, 818, 820, 821, 824,
+ 826, 834, 831, 838, 840, 846, 848, 850, 856, 832,
+ 852, 854, 860, 859, 861, 862, 869, 865, 867, 868,
+ 872, 874, 875, 883, 877, 884, 890, 888, 885, 891,
+
+ 895, 897, 899, 905, 901, 903, 909, 910, 902, 908,
+ 914, 918, 923, 930, 924, 931, 927, 932, 933, 939,
+ 940, 941, 944, 943, 947, 948, 949, 951, 953, 956,
+ 952, 957, 959, 958, 963, 974, 174, 968, 966, 975,
+ 976, 979, 980, 981, 987, 990, 983, 984, 993, 996,
+ 998, 997, 1004, 999, 1005, 3498, 1007, 1016, 1009, 1012,
+ 1015, 835, 1017, 1018, 1044, 3498, 1019, 3498, 3498, 115,
+ 3498, 3498, 1021, 1022, 1023, 1036, 1067, 1032, 1029, 1025,
+ 1038, 1040, 1045, 1054, 1042, 1058, 1048, 1060, 1061, 1062,
+ 1064, 1070, 1072, 1075, 1076, 1084, 1088, 1091, 1097, 1098,
+
+ 1099, 1095, 1100, 1103, 1104, 1105, 1106, 1115, 1109, 1112,
+ 1116, 3498, 1118, 1120, 1119, 1124, 1121, 1128, 1129, 3498,
+ 1126, 1134, 1130, 1138, 1131, 1141, 1143, 1077, 1142, 1144,
+ 1145, 1148, 1149, 1146, 1150, 1170, 1172, 1169, 1156, 1159,
+ 1174, 1157, 1176, 1185, 1181, 1168, 1182, 1188, 1187, 1190,
+ 1192, 1193, 1194, 1196, 1197, 1199, 1201, 1223, 1200, 1202,
+ 1205, 1203, 1206, 1210, 1219, 1212, 1214, 1220, 1231, 1227,
+ 1237, 1238, 1240, 1247, 1248, 1243, 1245, 1251, 1257, 1259,
+ 1261, 1262, 1253, 1263, 1272, 1264, 3498, 1278, 1276, 1275,
+ 1277, 1280, 1281, 1283, 1284, 1286, 1287, 1288, 1289, 1295,
+
+ 1296, 3498, 1297, 1298, 1301, 1306, 1302, 1309, 1310, 1313,
+ 1323, 1325, 3498, 1331, 1328, 1333, 1318, 1312, 1334, 1337,
+ 1335, 1339, 1341, 1342, 1343, 1345, 1351, 1353, 1350, 1348,
+ 1355, 1360, 1362, 1363, 1364, 1365, 1367, 1368, 1371, 1369,
+ 1373, 1384, 1387, 1375, 1389, 1376, 1391, 1392, 1397, 1394,
+ 1398, 1396, 1399, 3498, 296, 1400, 1401, 1402, 1408, 1411,
+ 1417, 1413, 1409, 1420, 1421, 1410, 1427, 1428, 1429, 1431,
+ 1432, 1433, 1435, 1436, 1440, 1442, 1438, 1441, 1447, 1451,
+ 1453, 1454, 1456, 1457, 1459, 1462, 1464, 1466, 1467, 1468,
+ 1469, 1470, 1472, 1477, 1478, 1475, 1485, 3498, 1487, 1484,
+
+ 1489, 1486, 1496, 1504, 1492, 1507, 1500, 1505, 1515, 1516,
+ 1518, 1519, 1520, 1502, 1525, 1526, 1527, 1512, 1533, 1537,
+ 1535, 1538, 1536, 1544, 3498, 1539, 1546, 1529, 1558, 1548,
+ 1549, 1551, 1556, 1560, 1563, 1564, 1566, 1567, 1572, 3498,
+ 1573, 1575, 1569, 1578, 1579, 1584, 1585, 1587, 1591, 1592,
+ 1593, 1595, 1602, 1594, 1598, 1606, 3498, 1610, 1614, 1615,
+ 1621, 1608, 1607, 1618, 1623, 1619, 1624, 1630, 1628, 1631,
+ 1627, 1632, 1633, 1635, 1636, 1638, 1637, 1640, 1644, 3498,
+ 1658, 1643, 1646, 1660, 1645, 1669, 1666, 1665, 1667, 1668,
+ 1671, 1672, 1673, 1675, 1674, 1679, 1680, 1682, 1683, 1685,
+
+ 1684, 1687, 1681, 1701, 1690, 1693, 1704, 1705, 1707, 1709,
+ 1715, 1717, 1720, 3498, 1723, 1713, 1724, 1716, 1718, 1739,
+ 1726, 1727, 1732, 1740, 1733, 1736, 1741, 1748, 1742, 1744,
+ 1745, 1749, 1752, 1750, 1754, 1756, 1753, 1770, 1760, 1767,
+ 1775, 3498, 1762, 1779, 1780, 1783, 1772, 1784, 1791, 3498,
+ 1788, 3498, 1790, 1796, 1798, 3498, 1800, 3498, 1802, 3498,
+ 1805, 1809, 1803, 1789, 1807, 1811, 1812, 1820, 1813, 1822,
+ 1815, 1817, 1825, 1824, 1826, 3498, 1830, 1832, 1834, 1836,
+ 1838, 1839, 1840, 1845, 1849, 1855, 1841, 1857, 1851, 1863,
+ 1853, 3498, 1842, 1867, 1864, 1869, 1872, 1879, 1877, 1871,
+
+ 1881, 1870, 1884, 1888, 1891, 1885, 1893, 1894, 1896, 1902,
+ 1898, 1899, 1906, 1908, 1900, 1907, 1909, 1910, 1911, 1915,
+ 1922, 1916, 1919, 1920, 3498, 1925, 1931, 1926, 1935, 1932,
+ 3498, 3498, 1938, 1940, 1934, 1945, 1942, 1951, 1949, 1952,
+ 1954, 1962, 1956, 1959, 1965, 1966, 1967, 1969, 1970, 1971,
+ 1973, 1975, 1976, 1974, 1982, 3498, 1990, 1987, 1997, 1998,
+ 1995, 1996, 2004, 2002, 2003, 3498, 3498, 2009, 2007, 2008,
+ 2010, 2018, 2011, 2014, 3498, 2019, 2021, 2023, 2030, 2031,
+ 2024, 2022, 2034, 2038, 2040, 2041, 2043, 2042, 2051, 2044,
+ 2047, 2052, 2060, 2061, 2067, 3498, 2048, 2069, 2063, 2071,
+
+ 2070, 2072, 2073, 2077, 2074, 2078, 2080, 2086, 2092, 2081,
+ 2089, 2090, 2094, 2091, 2100, 2104, 2097, 2112, 2106, 3498,
+ 2118, 2105, 2119, 2115, 2117, 2120, 2127, 2124, 2125, 2126,
+ 2128, 2130, 2129, 2132, 2133, 2134, 2141, 3498, 2142, 2139,
+ 2153, 2147, 2149, 2154, 2155, 2157, 2164, 2166, 3498, 2165,
+ 2172, 2168, 2169, 2174, 2175, 2177, 2171, 2183, 2184, 2178,
+ 2179, 2192, 2185, 2189, 2194, 2197, 2198, 2201, 2203, 2206,
+ 2212, 2199, 2207, 2218, 2215, 2224, 2230, 2226, 2227, 2233,
+ 2229, 2231, 2232, 2234, 2242, 2236, 2243, 2245, 3498, 2246,
+ 2248, 2251, 2260, 2256, 2261, 2263, 2264, 3498, 2265, 3498,
+
+ 2267, 3498, 2268, 2254, 2271, 2272, 2274, 2275, 2278, 2283,
+ 2289, 2276, 3498, 2285, 2277, 2287, 2293, 3498, 2299, 3498,
+ 3498, 2300, 2303, 2306, 2304, 2307, 2309, 2313, 3498, 2316,
+ 2305, 2318, 2320, 2310, 2314, 2322, 2324, 2327, 2328, 2330,
+ 3498, 2332, 2333, 2338, 2340, 2339, 3498, 2343, 2345, 2346,
+ 2347, 2351, 2354, 2355, 2358, 2361, 2367, 2363, 3498, 2364,
+ 2365, 2370, 2371, 2373, 2380, 2377, 2385, 2366, 2388, 2389,
+ 2374, 2390, 2384, 3498, 2398, 2401, 3498, 2392, 2394, 2402,
+ 3498, 2404, 3498, 2407, 2408, 2409, 2411, 2416, 2412, 2425,
+ 2417, 2422, 2427, 2428, 2430, 2431, 3498, 3498, 2433, 2435,
+
+ 2438, 2442, 2440, 2445, 2446, 2450, 3498, 2447, 2453, 2454,
+ 2455, 2456, 2457, 2460, 2465, 2462, 2459, 2468, 2467, 2469,
+ 3498, 2471, 2478, 2479, 2480, 2483, 2482, 3498, 2485, 2486,
+ 2487, 2490, 2492, 2496, 2507, 2509, 2499, 2511, 2514, 2516,
+ 2517, 2519, 2521, 2523, 2522, 3498, 2524, 2526, 2527, 2531,
+ 2532, 2528, 2535, 2539, 2543, 2533, 2545, 3498, 2547, 2548,
+ 2549, 2557, 2554, 2559, 2551, 2560, 2562, 2564, 2567, 2569,
+ 2565, 2568, 2572, 2575, 2576, 2578, 2583, 2582, 2589, 2594,
+ 3498, 2585, 3498, 2586, 2599, 2602, 2603, 3498, 2601, 2606,
+ 2607, 3498, 2608, 2609, 2610, 2618, 3498, 2621, 2613, 2623,
+
+ 2625, 2615, 2626, 2631, 3498, 2634, 2633, 2640, 2641, 2628,
+ 2635, 2643, 2642, 2650, 2656, 2652, 3498, 2644, 2654, 2666,
+ 2657, 2667, 3498, 3498, 2663, 3498, 3498, 3498, 2671, 3498,
+ 3498, 2668, 2672, 2675, 3498, 2679, 3498, 2681, 2682, 2680,
+ 2684, 2685, 3498, 2687, 3498, 2693, 2689, 2694, 3498, 2692,
+ 3498, 2695, 2697, 2698, 2701, 2703, 2705, 2711, 2714, 2716,
+ 2702, 2717, 2718, 2719, 2721, 2722, 2724, 2725, 2727, 2732,
+ 2733, 2735, 2736, 2737, 2738, 2739, 2740, 2748, 2757, 3498,
+ 3498, 2743, 2749, 2751, 2754, 2760, 2758, 2761, 2764, 3498,
+ 2771, 2766, 2776, 2762, 2768, 2772, 2780, 2781, 2785, 2787,
+
+ 2788, 2789, 2791, 2792, 3498, 2793, 2795, 3498, 3498, 2797,
+ 2798, 2803, 2794, 2805, 3498, 2807, 2816, 2808, 3498, 2819,
+ 2820, 2825, 2822, 2829, 3498, 3498, 3498, 2830, 2826, 2832,
+ 2833, 2835, 2834, 2836, 3498, 2837, 2842, 2845, 2843, 2855,
+ 2857, 2851, 2849, 2860, 2862, 3498, 3498, 2868, 2865, 2866,
+ 2867, 2870, 2872, 2873, 2874, 3498, 2879, 2875, 2877, 2883,
+ 2887, 2888, 2891, 3498, 2884, 2881, 2894, 2898, 2895, 2907,
+ 2906, 2908, 2909, 3498, 2910, 2899, 2911, 3498, 2917, 3498,
+ 2921, 3498, 2915, 3498, 2922, 2923, 2925, 2930, 2932, 2934,
+ 2927, 2936, 2943, 2940, 2937, 3498, 3498, 2946, 2944, 3498,
+
+ 3498, 2947, 2949, 2951, 2953, 2956, 2958, 2955, 2959, 2960,
+ 2961, 2971, 2966, 2963, 2975, 2976, 2977, 2978, 2980, 3498,
+ 2981, 2983, 3498, 2985, 2988, 2989, 2990, 2991, 2996, 3498,
+ 3007, 3001, 2997, 2994, 3498, 3498, 3498, 3008, 3011, 3014,
+ 3498, 3015, 3016, 3017, 3018, 3021, 3024, 3032, 3028, 3030,
+ 3498, 3031, 3033, 3035, 3036, 3037, 3038, 3041, 3043, 3044,
+ 3045, 3056, 3047, 3058, 3052, 3059, 3498, 3062, 3063, 3069,
+ 3065, 3498, 3067, 3073, 3075, 3076, 3078, 3077, 3081, 3082,
+ 3085, 3086, 3087, 3093, 3092, 3099, 3498, 3101, 3096, 3498,
+ 3102, 3103, 3108, 3105, 3112, 3119, 3116, 3498, 3123, 3498,
+
+ 3114, 3124, 3498, 3127, 3120, 3131, 3128, 3498, 3498, 3132,
+ 3135, 3137, 3498, 3138, 3498, 3139, 3144, 3141, 3145, 3146,
+ 3498, 3498, 3147, 3149, 3153, 3150, 3498, 3498, 3498, 3156,
+ 3498, 3164, 3165, 3498, 3163, 3498, 3171, 3168, 3498, 3172,
+ 3174, 3175, 3176, 3178, 3179, 3180, 3182, 3187, 3498, 3498,
+ 3189, 3498, 3193, 3195, 3197, 3203, 3498, 3198, 3204, 3498,
+ 3211, 3207, 3208, 3209, 3212, 3215, 3498, 3498, 3498, 3498,
+ 3498, 3498, 3214, 3216, 3219, 3220, 3217, 3222, 3223, 3225,
+ 3227, 3224, 3229, 3237, 3241, 3243, 3249, 3245, 3498, 3246,
+ 3250, 3252, 3256, 3253, 3255, 3254, 3257, 3260, 3262, 3263,
+
+ 3264, 3265, 3272, 3274, 3280, 3282, 3284, 3285, 3278, 3291,
+ 3295, 3292, 3288, 3296, 3303, 3300, 3301, 3498, 3304, 3302,
+ 3305, 3310, 3311, 3308, 3306, 3316, 3326, 3328, 3322, 3318,
+ 3331, 3332, 3334, 3335, 3338, 3336, 3498, 3340, 3342, 3344,
+ 3346, 3348, 3350, 3351, 3352, 3357, 3359, 3361, 3368, 3364,
+ 3498, 3372, 3498, 3498, 3373, 3362, 3374, 3376, 3380, 3498,
+ 3498, 3498, 3406, 3413, 3420, 3427, 3434, 94, 3441, 3448,
+ 3455, 3462, 3469, 3476, 3483, 3490
} ;
-static yyconst flex_int16_t yy_def[1455] =
+static yyconst flex_int16_t yy_def[1777] =
{ 0,
- 1440, 1, 1441, 1441, 1442, 1442, 1443, 1443, 1444, 1444,
- 1445, 1445, 1440, 1446, 1440, 1440, 1440, 1440, 1447, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1448,
- 1440, 1440, 1440, 1448, 1449, 1440, 1440, 1440, 1449, 1450,
- 1440, 1440, 1440, 1440, 1450, 1451, 1440, 1440, 1440, 1451,
- 1452, 1440, 1453, 1440, 1452, 1452, 1446, 1446, 1440, 1454,
- 1447, 1454, 1447, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
-
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1448, 1448, 1449, 1449, 1450, 1450, 1440, 1451,
- 1451, 1452, 1452, 1453, 1453, 1452, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1452, 1446, 1446, 1446, 1446, 1446, 1446,
-
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1452, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
-
- 1446, 1446, 1446, 1446, 1440, 1446, 1446, 1446, 1446, 1446,
- 1440, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1452, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
-
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1452, 1446, 1446, 1446, 1446, 1440, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1440, 1440, 1446, 1440, 1440, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1440, 1446, 1446, 1446,
- 1446, 1446, 1446, 1440, 1446, 1446, 1446, 1446, 1446, 1446,
-
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1452, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1440, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1440, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1440, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
-
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1440, 1452, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1440,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1440, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1440,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
-
- 1446, 1446, 1446, 1446, 1446, 1440, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1440, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1440, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1440, 1446, 1440, 1446, 1446,
- 1446, 1440, 1446, 1440, 1446, 1440, 1446, 1446, 1446, 1446,
-
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1440, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1440, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1440,
- 1446, 1446, 1446, 1446, 1440, 1440, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1440, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1440, 1440, 1446, 1446,
- 1446, 1446, 1446, 1446, 1440, 1446, 1446, 1446, 1446, 1446,
-
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1440, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1440, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1440, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1440, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1440,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1440, 1440,
-
- 1446, 1440, 1446, 1446, 1446, 1446, 1440, 1446, 1440, 1440,
- 1446, 1446, 1446, 1446, 1446, 1446, 1440, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1440, 1446, 1446, 1446,
- 1446, 1446, 1440, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1440, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1440, 1446, 1446, 1440, 1446, 1446,
- 1446, 1440, 1446, 1440, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1440, 1440, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1440,
- 1446, 1446, 1446, 1446, 1446, 1440, 1446, 1446, 1446, 1446,
-
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1440, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1440, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1440, 1446, 1440, 1446, 1446, 1446, 1446, 1440, 1446, 1446,
- 1446, 1440, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1440, 1446, 1446, 1446, 1446,
- 1440, 1440, 1446, 1440, 1440, 1446, 1440, 1440, 1446, 1446,
- 1446, 1440, 1446, 1440, 1446, 1446, 1446, 1446, 1446, 1440,
- 1446, 1440, 1440, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
-
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1440,
- 1446, 1446, 1440, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1440, 1446, 1446, 1440, 1440,
- 1446, 1446, 1446, 1446, 1446, 1440, 1446, 1446, 1446, 1446,
- 1446, 1440, 1440, 1440, 1446, 1446, 1446, 1446, 1446, 1446,
- 1440, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1440, 1446, 1446, 1440, 1446, 1446, 1446, 1446, 1446,
- 1446, 1440, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1440, 1446, 1446, 1440, 1446, 1440, 1446, 1440, 1446, 1446,
-
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1440, 1440,
- 1446, 1446, 1440, 1440, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1440, 1446, 1446, 1440, 1446, 1446,
- 1446, 1446, 1440, 1446, 1446, 1446, 1446, 1440, 1440, 1446,
- 1446, 1446, 1440, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1440,
- 1446, 1446, 1440, 1446, 1446, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1446, 1446, 1440, 1446, 1446, 1446, 1446, 1446,
- 1446, 1446, 1440, 1446, 1446, 1440, 1446, 1446, 1440, 1440,
- 1446, 1446, 1446, 1440, 1446, 1440, 1440, 1446, 1446, 1446,
-
- 1440, 1440, 1440, 1446, 1440, 1446, 1446, 1440, 1446, 1446,
- 1440, 1446, 1446, 1446, 1440, 1446, 1440, 1446, 1446, 1446,
- 1440, 1446, 1446, 1440, 1440, 1440, 1440, 1440, 1440, 1446,
- 1446, 1446, 1446, 1440, 1446, 1446, 1446, 1446, 1440, 0,
- 1440, 1440, 1440, 1440, 1440, 1440, 1440, 1440, 1440, 1440,
- 1440, 1440, 1440, 1440
+ 1762, 1, 1763, 1763, 1764, 1764, 1765, 1765, 1766, 1766,
+ 1767, 1767, 1762, 1768, 1762, 1762, 1762, 1762, 1769, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1770,
+ 1762, 1762, 1762, 1770, 1771, 1762, 1762, 1762, 1771, 1772,
+ 1762, 1762, 1762, 1762, 1772, 1773, 1762, 1762, 1762, 1773,
+ 1774, 1762, 1775, 1762, 1774, 1774, 1768, 1768, 1762, 1776,
+ 1769, 1776, 1769, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1770, 1770, 1771, 1771, 1772, 1772,
+ 1762, 1773, 1773, 1774, 1774, 1775, 1775, 1774, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1774, 1768,
+
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1774, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1762, 1768, 1768,
+ 1768, 1768, 1768, 1762, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1774, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1774, 1768, 1768, 1768, 1768, 1762, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1762, 1768, 1762, 1762, 1768,
+ 1762, 1762, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1762, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1762,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1774, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1762, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+
+ 1768, 1762, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1762, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1762, 1774, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1762, 1768, 1768,
+
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1762, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1762,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1762, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1762,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1762, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1762, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1762,
+ 1768, 1762, 1768, 1768, 1768, 1762, 1768, 1762, 1768, 1762,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1762, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1762, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1762, 1768, 1768, 1768, 1768, 1768,
+ 1762, 1762, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1762, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1762, 1762, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1762, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1762, 1768, 1768, 1768, 1768,
+
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1762,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1762, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1762, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1762, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1762, 1768, 1762,
+
+ 1768, 1762, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1762, 1768, 1768, 1768, 1768, 1762, 1768, 1762,
+ 1762, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1762, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1762, 1768, 1768, 1768, 1768, 1768, 1762, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1762, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1762, 1768, 1768, 1762, 1768, 1768, 1768,
+ 1762, 1768, 1762, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1762, 1762, 1768, 1768,
+
+ 1768, 1768, 1768, 1768, 1768, 1768, 1762, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1762, 1768, 1768, 1768, 1768, 1768, 1768, 1762, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1762, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1762, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1762, 1768, 1762, 1768, 1768, 1768, 1768, 1762, 1768, 1768,
+ 1768, 1762, 1768, 1768, 1768, 1768, 1762, 1768, 1768, 1768,
+
+ 1768, 1768, 1768, 1768, 1762, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1762, 1768, 1768, 1768,
+ 1768, 1768, 1762, 1762, 1768, 1762, 1762, 1762, 1768, 1762,
+ 1762, 1768, 1768, 1768, 1762, 1768, 1762, 1768, 1768, 1768,
+ 1768, 1768, 1762, 1768, 1762, 1768, 1768, 1768, 1762, 1768,
+ 1762, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1762,
+ 1762, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1762,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+
+ 1768, 1768, 1768, 1768, 1762, 1768, 1768, 1762, 1762, 1768,
+ 1768, 1768, 1768, 1768, 1762, 1768, 1768, 1768, 1762, 1768,
+ 1768, 1768, 1768, 1768, 1762, 1762, 1762, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1762, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1762, 1762, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1762, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1762, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1762, 1768, 1768, 1768, 1762, 1768, 1762,
+ 1768, 1762, 1768, 1762, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1762, 1762, 1768, 1768, 1762,
+
+ 1762, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1762,
+ 1768, 1768, 1762, 1768, 1768, 1768, 1768, 1768, 1768, 1762,
+ 1768, 1768, 1768, 1768, 1762, 1762, 1762, 1768, 1768, 1768,
+ 1762, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1762, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1762, 1768, 1768, 1768,
+ 1768, 1762, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1762, 1768, 1768, 1762,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1762, 1768, 1762,
+
+ 1768, 1768, 1762, 1768, 1768, 1768, 1768, 1762, 1762, 1768,
+ 1768, 1768, 1762, 1768, 1762, 1768, 1768, 1768, 1768, 1768,
+ 1762, 1762, 1768, 1768, 1768, 1768, 1762, 1762, 1762, 1768,
+ 1762, 1768, 1768, 1762, 1768, 1762, 1768, 1768, 1762, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1762, 1762,
+ 1768, 1762, 1768, 1768, 1768, 1768, 1762, 1768, 1768, 1762,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1762, 1762, 1762, 1762,
+ 1762, 1762, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1762, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1762, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1762, 1768, 1768, 1768,
+ 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768, 1768,
+ 1762, 1768, 1762, 1762, 1768, 1768, 1768, 1768, 1768, 1762,
+ 1762, 0, 1762, 1762, 1762, 1762, 1762, 1762, 1762, 1762,
+ 1762, 1762, 1762, 1762, 1762, 1762
} ;
-static yyconst flex_int16_t yy_nxt[2916] =
+static yyconst flex_int16_t yy_nxt[3538] =
{ 0,
14, 15, 16, 17, 18, 19, 18, 14, 14, 14,
14, 18, 20, 21, 14, 22, 23, 24, 25, 14,
26, 27, 28, 29, 30, 31, 32, 33, 34, 14,
35, 36, 37, 38, 39, 14, 14, 14, 14, 41,
- 42, 43, 41, 42, 43, 125, 46, 47, 125, 44,
+ 42, 43, 41, 42, 43, 127, 46, 47, 127, 44,
48, 69, 44, 46, 47, 70, 49, 48, 57, 58,
59, 68, 68, 49, 51, 52, 53, 54, 60, 18,
- 57, 58, 59, 123, 123, 55, 51, 52, 53, 54,
- 60, 18, 68, 104, 190, 74, 75, 55, 15, 16,
+ 57, 58, 59, 125, 125, 55, 51, 52, 53, 54,
+ 60, 18, 68, 105, 221, 74, 75, 55, 15, 16,
17, 62, 63, 64, 67, 67, 68, 67, 67, 65,
- 67, 95, 68, 76, 68, 67, 85, 68, 66, 15,
- 16, 17, 62, 63, 64, 68, 68, 77, 137, 87,
- 65, 69, 94, 68, 78, 70, 86, 68, 79, 66,
- 72, 80, 72, 72, 68, 72, 68, 88, 96, 81,
- 72, 73, 179, 82, 68, 89, 83, 68, 90, 84,
- 68, 91, 68, 97, 68, 101, 105, 68, 92, 102,
- 93, 98, 106, 68, 68, 107, 68, 99, 109, 112,
- 139, 100, 108, 68, 116, 103, 117, 150, 110, 113,
- 119, 111, 68, 114, 115, 120, 138, 68, 121, 130,
- 130, 118, 122, 127, 68, 127, 127, 72, 127, 72,
-
- 72, 132, 72, 132, 132, 133, 132, 67, 135, 67,
- 67, 68, 67, 160, 140, 68, 68, 67, 68, 136,
- 72, 68, 72, 72, 68, 72, 68, 142, 144, 147,
- 72, 73, 68, 141, 68, 143, 68, 68, 68, 68,
- 68, 133, 145, 153, 159, 154, 149, 148, 146, 68,
- 68, 68, 155, 156, 151, 152, 157, 68, 68, 68,
- 68, 163, 161, 68, 167, 164, 68, 68, 68, 68,
- 158, 68, 68, 166, 168, 165, 169, 68, 170, 171,
- 68, 173, 162, 68, 68, 175, 68, 174, 172, 176,
- 183, 68, 177, 68, 68, 68, 178, 68, 185, 68,
-
- 181, 68, 68, 180, 182, 184, 191, 68, 68, 187,
- 188, 123, 123, 125, 192, 68, 125, 252, 186, 127,
- 189, 127, 127, 197, 127, 193, 130, 130, 132, 68,
- 132, 132, 72, 132, 72, 72, 133, 72, 68, 194,
- 68, 196, 68, 135, 199, 195, 68, 68, 202, 68,
- 198, 68, 200, 68, 203, 205, 204, 68, 201, 68,
- 68, 68, 68, 211, 213, 206, 68, 68, 212, 68,
- 207, 215, 68, 68, 216, 208, 68, 68, 68, 68,
- 214, 209, 210, 222, 221, 68, 217, 133, 218, 219,
- 68, 223, 220, 226, 231, 225, 224, 228, 68, 68,
-
- 227, 230, 68, 68, 233, 68, 68, 235, 229, 68,
- 234, 236, 68, 68, 68, 68, 68, 68, 68, 68,
- 237, 238, 68, 240, 232, 68, 68, 242, 68, 68,
- 68, 245, 246, 250, 239, 68, 68, 243, 68, 254,
- 241, 68, 68, 253, 68, 244, 68, 256, 248, 249,
- 133, 247, 257, 259, 68, 251, 260, 68, 68, 68,
- 255, 263, 262, 265, 68, 68, 68, 264, 68, 266,
- 68, 68, 68, 261, 270, 258, 68, 68, 273, 272,
- 267, 68, 274, 68, 268, 68, 68, 68, 68, 269,
- 277, 280, 278, 68, 68, 279, 68, 271, 68, 275,
-
- 276, 68, 282, 283, 284, 68, 68, 281, 68, 68,
- 68, 289, 68, 68, 285, 293, 68, 291, 68, 68,
- 68, 288, 294, 286, 68, 68, 68, 287, 292, 299,
- 290, 68, 68, 68, 298, 296, 295, 68, 297, 303,
- 304, 305, 68, 68, 301, 302, 306, 300, 68, 307,
- 68, 68, 308, 311, 68, 68, 312, 68, 313, 310,
- 68, 316, 68, 309, 318, 68, 68, 68, 68, 68,
- 314, 320, 319, 321, 68, 68, 327, 68, 68, 322,
- 315, 68, 317, 328, 326, 68, 68, 68, 68, 68,
- 323, 332, 133, 324, 68, 325, 68, 68, 329, 68,
-
- 331, 334, 68, 343, 342, 330, 68, 333, 68, 348,
- 335, 336, 346, 344, 68, 345, 68, 351, 68, 347,
- 337, 68, 338, 339, 340, 353, 349, 341, 68, 68,
- 68, 68, 68, 352, 356, 68, 350, 357, 358, 68,
- 68, 354, 355, 68, 68, 363, 68, 68, 360, 362,
- 364, 359, 68, 68, 68, 361, 68, 370, 68, 374,
- 68, 366, 365, 367, 371, 369, 373, 372, 68, 68,
- 68, 68, 375, 68, 376, 379, 368, 68, 378, 68,
- 68, 68, 68, 377, 68, 68, 384, 68, 381, 68,
- 385, 68, 386, 382, 380, 68, 383, 68, 388, 68,
-
- 389, 68, 68, 391, 68, 68, 387, 68, 68, 68,
- 392, 399, 390, 397, 393, 68, 68, 398, 400, 68,
- 68, 396, 68, 68, 394, 395, 68, 404, 68, 68,
- 68, 68, 68, 406, 416, 68, 68, 401, 68, 68,
- 495, 405, 402, 403, 417, 407, 68, 415, 68, 408,
- 68, 409, 414, 68, 419, 418, 410, 68, 411, 68,
- 421, 420, 68, 422, 68, 425, 412, 68, 68, 423,
- 68, 133, 427, 68, 131, 431, 413, 424, 432, 428,
- 68, 68, 68, 68, 436, 68, 426, 429, 430, 437,
- 68, 68, 433, 68, 68, 435, 440, 68, 68, 434,
-
- 68, 442, 438, 439, 444, 68, 445, 68, 68, 446,
- 447, 68, 441, 443, 68, 448, 68, 449, 68, 68,
- 68, 453, 68, 451, 452, 68, 68, 68, 457, 450,
- 455, 454, 68, 68, 68, 68, 68, 458, 460, 456,
- 68, 463, 68, 461, 465, 68, 129, 462, 459, 68,
- 68, 466, 68, 467, 464, 68, 468, 68, 471, 68,
- 470, 68, 472, 68, 476, 68, 68, 68, 473, 68,
- 478, 477, 68, 68, 68, 475, 479, 474, 469, 480,
- 68, 68, 128, 68, 481, 483, 482, 68, 485, 486,
- 484, 488, 68, 487, 68, 68, 68, 68, 490, 493,
-
- 496, 489, 68, 494, 68, 68, 68, 497, 68, 492,
- 68, 68, 68, 491, 68, 502, 68, 68, 507, 68,
- 498, 503, 68, 68, 499, 68, 509, 500, 68, 504,
- 501, 68, 506, 511, 505, 510, 68, 68, 508, 68,
- 68, 513, 68, 68, 68, 516, 515, 68, 518, 517,
- 514, 68, 512, 68, 521, 68, 519, 68, 133, 68,
- 525, 68, 520, 524, 522, 526, 68, 523, 68, 528,
- 531, 68, 68, 68, 68, 68, 532, 529, 68, 68,
- 527, 68, 535, 533, 68, 530, 68, 68, 540, 541,
- 538, 534, 539, 536, 68, 68, 537, 68, 68, 542,
-
- 548, 543, 68, 68, 544, 549, 551, 552, 68, 545,
- 68, 68, 554, 68, 68, 546, 547, 553, 68, 556,
- 68, 68, 559, 550, 557, 558, 68, 68, 555, 68,
- 562, 68, 68, 560, 561, 566, 68, 565, 68, 568,
- 569, 126, 563, 567, 68, 68, 68, 68, 68, 564,
- 570, 68, 571, 68, 68, 68, 572, 577, 68, 573,
- 575, 576, 68, 579, 68, 68, 68, 68, 68, 581,
- 578, 574, 68, 583, 68, 68, 68, 586, 68, 582,
- 68, 68, 584, 580, 585, 587, 589, 68, 68, 68,
- 68, 68, 68, 68, 595, 68, 68, 588, 594, 590,
-
- 591, 68, 600, 68, 598, 599, 603, 68, 593, 592,
- 596, 68, 597, 68, 68, 68, 68, 602, 604, 610,
- 607, 601, 68, 609, 68, 606, 605, 68, 68, 68,
- 611, 614, 68, 616, 68, 68, 68, 608, 617, 133,
- 68, 68, 613, 68, 619, 68, 612, 68, 68, 68,
- 618, 68, 615, 629, 68, 68, 68, 68, 124, 622,
- 620, 637, 636, 630, 68, 68, 68, 621, 623, 68,
- 632, 633, 624, 658, 625, 634, 631, 68, 626, 635,
- 627, 68, 638, 68, 68, 628, 68, 639, 642, 640,
- 68, 643, 68, 645, 647, 646, 644, 68, 68, 650,
-
- 68, 68, 68, 652, 68, 651, 68, 641, 68, 653,
- 68, 648, 68, 68, 68, 68, 68, 649, 656, 68,
- 660, 654, 664, 655, 661, 68, 68, 68, 663, 68,
- 662, 657, 68, 659, 68, 68, 68, 669, 68, 665,
- 670, 671, 68, 68, 673, 666, 68, 667, 674, 668,
- 675, 672, 68, 68, 676, 68, 68, 677, 68, 68,
- 678, 679, 682, 68, 68, 68, 681, 680, 68, 684,
- 685, 68, 68, 686, 68, 690, 68, 687, 68, 68,
- 689, 68, 68, 68, 683, 693, 68, 691, 688, 68,
- 68, 68, 68, 68, 698, 68, 699, 692, 701, 694,
-
- 703, 68, 695, 697, 702, 68, 696, 704, 706, 68,
- 700, 68, 68, 68, 68, 710, 705, 68, 68, 68,
- 68, 68, 68, 68, 68, 133, 709, 708, 718, 712,
- 707, 68, 68, 68, 719, 711, 715, 713, 716, 68,
- 68, 68, 720, 68, 717, 722, 714, 68, 721, 68,
- 68, 727, 724, 728, 68, 723, 68, 68, 68, 68,
- 68, 68, 68, 731, 725, 726, 730, 733, 68, 68,
- 736, 68, 735, 68, 729, 68, 68, 68, 732, 734,
- 68, 68, 68, 68, 737, 739, 738, 743, 747, 68,
- 68, 746, 68, 68, 740, 742, 68, 741, 744, 68,
-
- 745, 68, 131, 748, 749, 755, 751, 752, 68, 757,
- 750, 753, 68, 68, 68, 68, 758, 756, 754, 68,
- 68, 68, 761, 68, 759, 760, 68, 68, 68, 767,
- 768, 764, 763, 762, 68, 68, 68, 68, 68, 68,
- 770, 765, 769, 68, 68, 68, 766, 771, 776, 68,
- 775, 68, 772, 68, 773, 68, 774, 68, 777, 68,
- 68, 781, 129, 778, 68, 779, 786, 68, 780, 782,
- 68, 783, 788, 68, 68, 68, 68, 784, 789, 787,
- 68, 790, 792, 68, 68, 785, 794, 68, 68, 791,
- 796, 68, 68, 795, 793, 68, 68, 798, 68, 68,
-
- 797, 800, 801, 799, 802, 804, 803, 805, 68, 807,
- 68, 68, 68, 806, 68, 68, 68, 811, 68, 68,
- 808, 68, 68, 814, 68, 68, 68, 810, 68, 68,
- 68, 819, 68, 68, 809, 68, 68, 68, 817, 812,
- 68, 824, 815, 68, 813, 816, 820, 818, 825, 68,
- 68, 822, 826, 68, 829, 68, 68, 821, 823, 832,
- 831, 828, 68, 827, 68, 68, 68, 68, 830, 68,
- 68, 68, 838, 68, 833, 840, 839, 68, 835, 68,
- 836, 834, 842, 68, 68, 837, 847, 68, 846, 841,
- 844, 68, 843, 848, 68, 849, 850, 68, 68, 68,
-
- 845, 852, 68, 854, 851, 856, 68, 855, 68, 68,
- 68, 859, 68, 68, 68, 68, 68, 863, 68, 68,
- 862, 853, 68, 68, 68, 68, 68, 68, 857, 858,
- 68, 871, 861, 868, 864, 68, 68, 865, 860, 128,
- 872, 870, 866, 867, 68, 68, 869, 876, 873, 874,
- 877, 68, 68, 68, 875, 68, 68, 878, 882, 879,
- 68, 68, 886, 68, 68, 885, 884, 68, 887, 68,
- 888, 68, 68, 880, 68, 889, 881, 68, 883, 68,
- 890, 68, 68, 895, 68, 68, 893, 68, 897, 891,
- 68, 68, 68, 68, 68, 900, 68, 894, 902, 68,
-
- 905, 68, 892, 899, 68, 896, 68, 68, 68, 68,
- 910, 68, 898, 901, 903, 904, 908, 68, 912, 68,
- 915, 68, 911, 68, 906, 68, 907, 909, 68, 913,
- 68, 916, 68, 914, 68, 917, 920, 919, 68, 921,
- 68, 68, 68, 68, 68, 68, 68, 68, 925, 68,
- 922, 927, 929, 918, 928, 68, 68, 68, 68, 923,
- 68, 936, 924, 930, 68, 68, 68, 926, 68, 931,
- 934, 933, 68, 935, 68, 68, 932, 68, 946, 68,
- 68, 941, 945, 68, 937, 938, 68, 940, 942, 939,
- 68, 943, 68, 944, 68, 948, 68, 68, 955, 947,
-
- 68, 950, 949, 68, 68, 952, 954, 68, 953, 956,
- 68, 68, 68, 951, 68, 68, 963, 958, 68, 68,
- 957, 68, 966, 968, 969, 959, 960, 68, 68, 68,
- 68, 68, 962, 972, 964, 68, 961, 965, 68, 967,
- 68, 970, 68, 974, 973, 68, 68, 68, 68, 975,
- 971, 68, 68, 976, 68, 977, 68, 68, 983, 68,
- 68, 984, 985, 68, 978, 986, 979, 980, 982, 68,
- 981, 68, 987, 990, 68, 68, 68, 68, 995, 68,
- 68, 68, 988, 68, 989, 991, 68, 992, 993, 999,
- 68, 996, 998, 1000, 68, 68, 1003, 994, 997, 1002,
-
- 68, 68, 1004, 68, 1001, 68, 1007, 68, 68, 1009,
- 68, 1010, 68, 1011, 68, 1013, 68, 1012, 68, 1015,
- 68, 68, 1005, 68, 68, 1006, 1017, 68, 1008, 68,
- 1018, 1019, 68, 68, 1014, 1020, 68, 1021, 68, 68,
- 1027, 68, 1022, 68, 68, 1029, 1016, 68, 68, 68,
- 1033, 68, 1023, 1024, 68, 68, 68, 1031, 1025, 68,
- 1026, 1035, 68, 1038, 1036, 68, 68, 1030, 68, 1028,
- 1032, 1034, 1042, 1041, 68, 68, 68, 68, 1045, 68,
- 1046, 68, 1040, 1044, 68, 1037, 68, 68, 68, 68,
- 1047, 1039, 68, 68, 1043, 1055, 68, 68, 1053, 68,
-
- 68, 1049, 1054, 1051, 1048, 68, 1050, 68, 1052, 126,
- 1056, 1058, 68, 68, 1060, 1057, 1061, 1066, 1059, 1062,
- 68, 68, 1063, 1065, 1067, 1068, 1064, 68, 68, 68,
- 68, 68, 1071, 1072, 1069, 68, 1074, 68, 68, 68,
- 124, 68, 1076, 1070, 1077, 68, 1078, 68, 1079, 1075,
- 68, 68, 68, 68, 68, 68, 1080, 1073, 1082, 1081,
- 1083, 68, 1085, 68, 68, 68, 68, 1084, 1090, 68,
- 68, 1092, 68, 1086, 1088, 1089, 68, 68, 1091, 68,
- 1094, 1087, 68, 68, 1095, 1096, 68, 1093, 68, 1099,
- 1097, 68, 1098, 68, 68, 68, 68, 68, 1100, 68,
-
- 68, 1107, 1106, 1101, 68, 1102, 1103, 68, 68, 1110,
- 1104, 1112, 68, 1109, 68, 68, 1105, 68, 1108, 1115,
- 1114, 68, 1111, 68, 68, 68, 1116, 1120, 1117, 68,
- 68, 68, 68, 68, 1121, 1124, 68, 68, 68, 68,
- 1113, 68, 1118, 1125, 68, 1119, 1128, 1123, 1126, 1122,
- 1130, 1127, 68, 68, 68, 68, 68, 68, 1129, 1132,
- 1133, 68, 68, 1139, 1131, 68, 1134, 1137, 1138, 1141,
- 68, 68, 68, 1136, 1140, 68, 1135, 1143, 68, 1145,
- 1142, 68, 68, 1148, 68, 68, 1146, 68, 68, 1152,
- 68, 1144, 68, 1149, 68, 1147, 68, 1151, 68, 1153,
-
- 68, 1155, 1150, 68, 1154, 1158, 68, 1156, 68, 1157,
- 68, 68, 68, 68, 68, 1166, 68, 68, 68, 68,
- 1167, 68, 1170, 68, 1181, 1164, 68, 1160, 1171, 68,
- 1162, 1168, 1159, 1163, 1161, 1165, 1169, 1172, 68, 1173,
- 1174, 68, 1175, 68, 68, 1177, 68, 1178, 68, 68,
- 68, 1182, 68, 68, 1184, 68, 68, 68, 68, 68,
- 1187, 68, 1188, 1176, 1179, 1186, 1190, 68, 1180, 68,
- 1192, 68, 1183, 68, 1185, 1193, 68, 1189, 68, 1195,
- 68, 68, 1196, 1197, 1194, 68, 68, 68, 1191, 68,
- 1199, 68, 1198, 68, 68, 68, 1203, 1207, 68, 68,
-
- 1201, 68, 68, 1205, 1206, 1208, 68, 68, 1204, 1212,
- 1202, 1200, 68, 1211, 68, 1210, 68, 1213, 1209, 68,
- 68, 68, 1215, 68, 1218, 1214, 1220, 68, 1219, 68,
- 68, 68, 1217, 1221, 1222, 1216, 1223, 68, 68, 68,
- 68, 68, 1229, 1224, 1226, 68, 1228, 68, 68, 68,
- 1225, 1230, 68, 68, 1232, 1234, 68, 1235, 68, 1227,
- 1233, 1236, 68, 1237, 1231, 68, 1239, 68, 1240, 68,
- 1238, 1241, 68, 1242, 68, 68, 68, 68, 1246, 68,
- 68, 68, 1245, 1248, 68, 1247, 68, 68, 1252, 68,
- 1243, 68, 1251, 1253, 68, 1254, 68, 1244, 1249, 68,
-
- 1250, 68, 68, 1255, 68, 68, 1261, 68, 68, 68,
- 68, 68, 68, 1257, 1258, 68, 1259, 1256, 1262, 68,
- 68, 68, 68, 1269, 1265, 1260, 1270, 1271, 68, 1267,
- 1264, 1272, 68, 68, 1263, 68, 1266, 1268, 68, 1274,
- 1275, 68, 1276, 68, 68, 68, 1273, 68, 1282, 68,
- 1277, 1283, 68, 68, 68, 68, 68, 68, 68, 1291,
- 68, 1278, 1279, 1280, 1281, 68, 68, 1284, 1290, 68,
- 1294, 68, 1285, 68, 1286, 1287, 1288, 68, 1289, 1296,
- 68, 1292, 1297, 1298, 68, 68, 1299, 1293, 68, 68,
- 68, 68, 1295, 68, 68, 1302, 1303, 68, 1301, 68,
-
- 68, 1304, 1306, 68, 1307, 1309, 68, 1310, 68, 1305,
- 1300, 1311, 1313, 68, 68, 1308, 68, 68, 1312, 1314,
- 68, 68, 1315, 68, 1317, 68, 1316, 68, 68, 68,
- 1321, 68, 68, 68, 1319, 1440, 1318, 1320, 1325, 68,
- 1322, 68, 1326, 1327, 1328, 68, 1323, 68, 68, 1329,
- 68, 1324, 1330, 68, 1333, 68, 68, 68, 68, 1331,
- 68, 1336, 68, 1338, 68, 1337, 1332, 1339, 68, 68,
- 1342, 68, 1341, 1343, 68, 68, 1334, 1335, 68, 68,
- 68, 68, 1344, 68, 1346, 1345, 68, 1340, 68, 1348,
- 1347, 68, 1350, 68, 68, 68, 68, 68, 1352, 68,
-
- 1357, 68, 1349, 68, 1351, 1355, 1353, 1361, 1358, 1360,
- 68, 68, 68, 1363, 68, 1356, 68, 68, 1440, 1359,
- 1354, 1362, 68, 1365, 68, 1364, 68, 1367, 68, 1368,
- 68, 1370, 68, 1369, 68, 68, 68, 1372, 68, 1371,
- 1375, 68, 1366, 68, 68, 1376, 68, 68, 68, 68,
- 1374, 1380, 1379, 1373, 1377, 1383, 68, 68, 68, 1386,
- 68, 68, 1378, 1385, 68, 1384, 68, 1382, 1389, 68,
- 1390, 68, 68, 1381, 1394, 68, 1392, 1387, 68, 1396,
- 68, 1397, 68, 1388, 68, 1391, 68, 68, 68, 1440,
- 1395, 1440, 1393, 1400, 1401, 68, 1402, 68, 1403, 68,
-
- 1399, 68, 68, 1398, 1405, 68, 1404, 68, 1407, 1406,
- 1408, 68, 68, 68, 1411, 68, 68, 1409, 68, 68,
- 1416, 1410, 1414, 1412, 1413, 1415, 68, 1417, 68, 1418,
- 1419, 68, 68, 1421, 68, 1420, 68, 68, 1424, 68,
- 1425, 68, 1426, 68, 1427, 68, 1428, 68, 1429, 68,
- 68, 1422, 68, 1431, 68, 1423, 68, 68, 1432, 1434,
- 68, 68, 1430, 68, 68, 1440, 1435, 1439, 68, 1440,
- 1440, 1440, 1440, 1440, 1440, 1437, 1433, 1440, 1436, 1440,
- 1440, 1440, 1440, 1438, 40, 40, 40, 40, 40, 40,
- 40, 45, 45, 45, 45, 45, 45, 45, 50, 50,
-
- 50, 50, 50, 50, 50, 56, 56, 56, 56, 56,
- 56, 56, 61, 61, 61, 61, 61, 61, 61, 71,
- 71, 1440, 71, 71, 71, 71, 123, 123, 1440, 1440,
- 1440, 123, 123, 125, 125, 1440, 1440, 125, 1440, 125,
- 127, 1440, 1440, 1440, 1440, 1440, 127, 130, 130, 1440,
- 1440, 1440, 130, 130, 132, 1440, 1440, 1440, 1440, 1440,
- 132, 134, 134, 1440, 134, 134, 134, 134, 72, 72,
- 1440, 72, 72, 72, 72, 13, 1440, 1440, 1440, 1440,
- 1440, 1440, 1440, 1440, 1440, 1440, 1440, 1440, 1440, 1440,
- 1440, 1440, 1440, 1440, 1440, 1440, 1440, 1440, 1440, 1440,
-
- 1440, 1440, 1440, 1440, 1440, 1440, 1440, 1440, 1440, 1440,
- 1440, 1440, 1440, 1440, 1440
+ 67, 96, 68, 76, 68, 67, 86, 68, 66, 15,
+ 16, 17, 62, 63, 64, 68, 68, 77, 139, 88,
+ 65, 69, 95, 68, 78, 70, 87, 68, 79, 66,
+ 72, 80, 72, 72, 135, 72, 68, 89, 97, 68,
+ 72, 73, 68, 91, 571, 90, 92, 81, 138, 68,
+ 98, 82, 68, 93, 83, 94, 84, 85, 99, 68,
+ 68, 102, 68, 140, 100, 103, 68, 118, 101, 119,
+ 68, 106, 141, 68, 110, 114, 68, 107, 111, 68,
+ 108, 104, 132, 132, 120, 115, 68, 109, 112, 116,
+ 117, 113, 68, 121, 68, 123, 153, 537, 122, 124,
+
+ 129, 144, 129, 129, 72, 129, 72, 72, 134, 72,
+ 134, 134, 68, 134, 67, 137, 67, 67, 68, 67,
+ 68, 142, 68, 68, 67, 72, 145, 72, 72, 68,
+ 72, 68, 68, 68, 146, 72, 73, 150, 143, 68,
+ 68, 147, 68, 68, 68, 68, 152, 156, 162, 157,
+ 149, 148, 163, 68, 68, 151, 68, 154, 155, 158,
+ 68, 164, 68, 159, 68, 166, 160, 68, 68, 167,
+ 68, 170, 68, 68, 68, 68, 68, 171, 168, 176,
+ 161, 165, 169, 173, 175, 172, 174, 68, 68, 68,
+ 68, 68, 177, 178, 68, 187, 68, 179, 68, 68,
+
+ 68, 68, 189, 182, 68, 68, 183, 180, 135, 181,
+ 185, 188, 68, 184, 186, 68, 191, 194, 68, 68,
+ 192, 68, 190, 196, 197, 68, 193, 125, 125, 127,
+ 200, 129, 127, 129, 129, 224, 129, 198, 195, 132,
+ 132, 134, 68, 134, 134, 72, 134, 72, 72, 135,
+ 72, 68, 199, 201, 68, 68, 137, 202, 68, 203,
+ 205, 68, 207, 68, 218, 68, 210, 68, 208, 204,
+ 209, 68, 211, 68, 68, 68, 68, 68, 68, 68,
+ 220, 206, 222, 68, 223, 68, 68, 230, 68, 68,
+ 68, 225, 219, 229, 212, 68, 264, 226, 234, 213,
+
+ 227, 228, 68, 68, 214, 233, 231, 68, 235, 215,
+ 232, 239, 236, 238, 68, 216, 217, 68, 68, 241,
+ 68, 243, 244, 237, 68, 242, 68, 68, 68, 68,
+ 68, 68, 68, 68, 246, 240, 245, 248, 68, 68,
+ 68, 250, 68, 251, 68, 68, 68, 254, 255, 68,
+ 247, 259, 263, 135, 249, 252, 68, 68, 68, 253,
+ 261, 68, 68, 135, 257, 258, 68, 256, 262, 260,
+ 68, 266, 267, 269, 265, 272, 68, 68, 68, 68,
+ 68, 270, 275, 68, 274, 273, 68, 68, 276, 68,
+ 68, 68, 133, 68, 278, 268, 282, 284, 271, 280,
+
+ 68, 277, 68, 283, 68, 285, 68, 279, 68, 286,
+ 68, 68, 68, 292, 289, 281, 290, 68, 68, 68,
+ 68, 294, 287, 68, 296, 288, 291, 68, 295, 68,
+ 68, 68, 68, 293, 68, 301, 68, 68, 68, 68,
+ 68, 303, 68, 307, 306, 300, 68, 297, 298, 68,
+ 68, 305, 299, 312, 302, 68, 304, 68, 308, 309,
+ 68, 68, 310, 68, 311, 316, 317, 318, 68, 68,
+ 314, 313, 315, 68, 68, 68, 319, 68, 320, 324,
+ 68, 321, 325, 323, 322, 68, 326, 68, 68, 330,
+ 327, 68, 332, 68, 68, 68, 68, 68, 333, 328,
+
+ 68, 68, 341, 334, 68, 335, 68, 68, 329, 336,
+ 340, 331, 337, 68, 68, 338, 68, 339, 342, 68,
+ 68, 68, 347, 68, 135, 343, 344, 68, 68, 345,
+ 346, 131, 358, 68, 349, 363, 357, 68, 348, 68,
+ 68, 350, 351, 361, 68, 359, 360, 68, 366, 68,
+ 68, 352, 68, 353, 354, 355, 368, 362, 356, 68,
+ 68, 68, 68, 371, 364, 367, 370, 365, 68, 369,
+ 68, 68, 68, 68, 379, 372, 373, 374, 375, 68,
+ 68, 380, 376, 68, 68, 68, 377, 381, 378, 68,
+ 68, 382, 68, 388, 384, 68, 390, 387, 383, 386,
+
+ 68, 68, 68, 393, 389, 68, 391, 385, 68, 392,
+ 68, 68, 396, 394, 397, 68, 68, 68, 68, 68,
+ 68, 68, 403, 395, 402, 399, 68, 68, 68, 400,
+ 401, 404, 68, 406, 68, 407, 398, 68, 68, 68,
+ 68, 68, 68, 68, 68, 409, 68, 410, 405, 408,
+ 68, 411, 415, 418, 417, 416, 414, 68, 68, 68,
+ 412, 413, 419, 68, 68, 68, 421, 68, 423, 68,
+ 68, 68, 425, 68, 68, 420, 435, 437, 68, 68,
+ 424, 68, 68, 439, 422, 426, 436, 434, 68, 427,
+ 68, 428, 68, 433, 68, 441, 429, 68, 430, 438,
+
+ 443, 68, 68, 440, 68, 68, 431, 442, 68, 447,
+ 68, 135, 444, 452, 448, 451, 432, 68, 68, 68,
+ 445, 68, 456, 68, 446, 450, 457, 449, 68, 453,
+ 68, 68, 68, 68, 455, 460, 68, 454, 68, 462,
+ 458, 465, 459, 68, 68, 466, 68, 68, 461, 468,
+ 68, 469, 68, 470, 463, 562, 467, 464, 68, 471,
+ 68, 472, 68, 473, 68, 474, 68, 477, 68, 475,
+ 476, 68, 68, 68, 68, 478, 481, 68, 479, 68,
+ 68, 68, 482, 484, 68, 487, 68, 68, 485, 68,
+ 490, 130, 486, 483, 480, 68, 68, 68, 491, 492,
+
+ 68, 489, 68, 68, 488, 495, 493, 68, 497, 68,
+ 496, 68, 501, 68, 68, 68, 498, 68, 503, 502,
+ 68, 68, 68, 500, 504, 499, 68, 505, 494, 128,
+ 68, 508, 506, 509, 507, 68, 68, 511, 514, 68,
+ 510, 512, 68, 68, 68, 68, 519, 516, 515, 513,
+ 520, 68, 68, 68, 521, 68, 68, 518, 523, 68,
+ 68, 68, 517, 68, 68, 68, 533, 528, 68, 68,
+ 68, 68, 522, 524, 529, 68, 535, 525, 68, 526,
+ 68, 527, 531, 530, 532, 538, 68, 68, 68, 534,
+ 536, 68, 68, 68, 539, 68, 68, 543, 542, 68,
+
+ 544, 541, 68, 548, 545, 68, 540, 546, 68, 68,
+ 135, 68, 552, 547, 549, 551, 68, 68, 555, 68,
+ 553, 68, 550, 558, 68, 559, 556, 68, 68, 68,
+ 68, 68, 554, 68, 68, 68, 560, 68, 557, 574,
+ 573, 68, 572, 575, 68, 561, 570, 563, 68, 583,
+ 68, 587, 68, 586, 68, 564, 68, 68, 126, 584,
+ 68, 565, 585, 592, 588, 566, 68, 589, 567, 590,
+ 68, 591, 68, 68, 68, 568, 68, 593, 569, 68,
+ 576, 577, 68, 578, 68, 598, 579, 68, 68, 68,
+ 597, 580, 594, 632, 595, 596, 68, 581, 582, 602,
+
+ 68, 601, 599, 68, 604, 605, 600, 68, 603, 68,
+ 68, 68, 68, 607, 606, 68, 68, 68, 68, 615,
+ 608, 68, 611, 609, 68, 612, 613, 68, 68, 614,
+ 68, 68, 68, 68, 610, 618, 68, 620, 68, 617,
+ 68, 68, 68, 68, 623, 619, 68, 616, 621, 622,
+ 68, 626, 624, 68, 68, 68, 68, 68, 68, 625,
+ 68, 68, 68, 627, 631, 629, 635, 637, 68, 68,
+ 628, 68, 633, 630, 636, 634, 639, 640, 638, 641,
+ 68, 68, 68, 644, 68, 642, 68, 643, 68, 647,
+ 646, 645, 648, 68, 68, 652, 649, 68, 650, 68,
+
+ 68, 654, 68, 655, 135, 68, 68, 651, 68, 68,
+ 657, 68, 68, 68, 68, 68, 668, 68, 68, 653,
+ 656, 68, 68, 672, 68, 660, 68, 658, 675, 669,
+ 671, 68, 68, 659, 661, 68, 673, 677, 662, 68,
+ 663, 676, 670, 68, 664, 674, 665, 678, 679, 68,
+ 68, 666, 68, 680, 684, 68, 667, 68, 683, 68,
+ 68, 685, 690, 68, 682, 68, 686, 689, 687, 68,
+ 681, 68, 693, 68, 68, 68, 68, 691, 694, 696,
+ 699, 692, 695, 698, 68, 700, 688, 68, 68, 68,
+ 68, 701, 68, 68, 697, 68, 68, 704, 68, 68,
+
+ 68, 68, 703, 713, 709, 707, 702, 68, 68, 68,
+ 68, 706, 705, 68, 68, 711, 712, 708, 68, 718,
+ 710, 68, 68, 714, 68, 68, 719, 720, 135, 715,
+ 68, 716, 723, 717, 721, 68, 722, 68, 724, 730,
+ 68, 726, 725, 68, 727, 68, 68, 68, 728, 68,
+ 729, 68, 732, 68, 68, 68, 734, 68, 735, 736,
+ 68, 737, 68, 68, 740, 68, 731, 68, 733, 739,
+ 743, 741, 68, 738, 68, 68, 68, 68, 742, 68,
+ 68, 68, 748, 68, 749, 68, 751, 68, 68, 747,
+ 744, 754, 752, 745, 755, 746, 68, 753, 750, 68,
+
+ 757, 68, 756, 68, 68, 761, 68, 758, 68, 68,
+ 68, 68, 68, 68, 68, 769, 760, 759, 770, 763,
+ 68, 68, 68, 68, 762, 68, 766, 764, 767, 68,
+ 772, 771, 68, 68, 768, 773, 765, 776, 775, 68,
+ 68, 68, 780, 68, 68, 68, 774, 68, 68, 784,
+ 68, 782, 68, 68, 68, 778, 788, 785, 777, 68,
+ 779, 786, 781, 68, 787, 68, 68, 783, 68, 68,
+ 791, 68, 790, 793, 68, 795, 68, 789, 68, 68,
+ 68, 68, 68, 796, 68, 792, 799, 68, 794, 68,
+ 68, 797, 800, 798, 808, 804, 68, 68, 68, 68,
+
+ 801, 68, 803, 802, 68, 805, 807, 806, 68, 810,
+ 809, 813, 68, 812, 68, 814, 68, 68, 811, 68,
+ 816, 133, 819, 815, 68, 817, 818, 68, 68, 820,
+ 68, 68, 68, 823, 824, 821, 822, 68, 68, 68,
+ 829, 68, 828, 826, 830, 68, 825, 68, 68, 68,
+ 68, 68, 831, 827, 832, 838, 68, 833, 68, 840,
+ 68, 68, 834, 68, 835, 841, 836, 837, 68, 842,
+ 68, 845, 68, 839, 843, 68, 68, 850, 68, 68,
+ 844, 68, 846, 852, 68, 68, 847, 68, 853, 856,
+ 68, 68, 854, 848, 851, 858, 68, 68, 860, 68,
+
+ 855, 849, 859, 68, 68, 68, 68, 68, 131, 862,
+ 68, 857, 864, 863, 68, 865, 867, 869, 68, 68,
+ 68, 870, 68, 861, 866, 868, 68, 68, 872, 873,
+ 68, 68, 871, 68, 876, 68, 68, 879, 874, 68,
+ 68, 875, 68, 68, 68, 68, 884, 68, 68, 68,
+ 68, 877, 68, 882, 888, 68, 68, 68, 68, 878,
+ 880, 890, 883, 881, 893, 891, 894, 885, 887, 892,
+ 68, 896, 68, 886, 895, 889, 897, 68, 68, 68,
+ 68, 68, 898, 68, 68, 68, 68, 68, 899, 903,
+ 906, 68, 68, 68, 68, 68, 68, 68, 900, 68,
+
+ 914, 902, 68, 904, 913, 68, 901, 905, 909, 907,
+ 910, 908, 911, 68, 917, 912, 68, 68, 915, 68,
+ 916, 68, 922, 919, 923, 68, 921, 68, 68, 68,
+ 68, 918, 68, 924, 925, 68, 68, 932, 68, 68,
+ 920, 927, 928, 926, 68, 68, 930, 935, 68, 929,
+ 931, 68, 68, 68, 68, 939, 68, 68, 933, 938,
+ 68, 68, 68, 934, 68, 68, 68, 937, 68, 947,
+ 948, 936, 68, 940, 68, 941, 942, 130, 944, 68,
+ 943, 946, 68, 945, 68, 950, 949, 68, 951, 952,
+ 956, 68, 68, 953, 955, 68, 68, 957, 961, 958,
+
+ 68, 68, 68, 68, 959, 965, 954, 963, 68, 964,
+ 68, 966, 68, 967, 68, 68, 960, 68, 962, 68,
+ 968, 68, 969, 68, 68, 68, 971, 68, 973, 68,
+ 970, 975, 68, 972, 68, 977, 68, 68, 68, 974,
+ 979, 980, 68, 982, 68, 976, 68, 985, 68, 978,
+ 68, 68, 68, 68, 68, 981, 988, 68, 984, 990,
+ 983, 68, 992, 68, 994, 68, 991, 68, 986, 68,
+ 987, 997, 989, 993, 996, 68, 68, 995, 998, 68,
+ 999, 68, 68, 68, 68, 128, 1005, 1002, 1000, 68,
+ 1003, 68, 1007, 68, 1006, 1011, 68, 68, 1008, 1010,
+
+ 68, 1001, 1004, 68, 1012, 68, 68, 1009, 68, 1017,
+ 68, 68, 68, 1016, 68, 1013, 1019, 1020, 68, 68,
+ 68, 68, 68, 68, 1014, 1021, 1015, 68, 68, 1028,
+ 1022, 68, 68, 1018, 68, 1026, 1025, 68, 68, 1023,
+ 1027, 1024, 1032, 68, 68, 1034, 68, 68, 1029, 1038,
+ 68, 1030, 68, 1031, 68, 1039, 1035, 68, 1033, 1036,
+ 1037, 68, 1041, 68, 68, 1040, 68, 1049, 68, 1048,
+ 1042, 68, 1043, 1045, 68, 1047, 1046, 68, 68, 68,
+ 1044, 68, 68, 68, 1056, 68, 68, 68, 68, 1059,
+ 1051, 1050, 1058, 1053, 68, 1061, 1052, 1064, 1062, 68,
+
+ 1055, 1057, 68, 1060, 1066, 1067, 1054, 68, 68, 68,
+ 68, 1070, 1063, 1068, 68, 68, 68, 1065, 1072, 68,
+ 68, 68, 68, 68, 1073, 1078, 68, 1071, 1069, 1074,
+ 68, 68, 1075, 68, 68, 68, 68, 1082, 1076, 1079,
+ 1083, 1077, 68, 68, 1080, 1086, 68, 1084, 1085, 1089,
+ 68, 1081, 68, 68, 68, 68, 68, 1087, 1094, 68,
+ 68, 1088, 126, 68, 68, 1091, 1090, 1092, 1095, 1101,
+ 1097, 1098, 68, 68, 1093, 68, 1099, 1096, 1100, 68,
+ 1102, 68, 68, 68, 68, 68, 68, 1103, 1104, 68,
+ 68, 1105, 68, 68, 1108, 1109, 1106, 1113, 68, 1114,
+
+ 1107, 68, 68, 68, 68, 1118, 68, 1112, 1110, 68,
+ 1111, 1120, 68, 1122, 1115, 1121, 68, 68, 68, 1123,
+ 1116, 1124, 1117, 1119, 68, 1125, 1127, 68, 1129, 68,
+ 68, 68, 68, 1130, 1131, 1126, 68, 68, 68, 68,
+ 68, 68, 68, 1141, 68, 68, 68, 1143, 1132, 1133,
+ 1134, 68, 1128, 68, 68, 1135, 1139, 1136, 1137, 68,
+ 1138, 68, 1140, 1145, 1147, 68, 68, 68, 1149, 68,
+ 1152, 1142, 1146, 1144, 1148, 1150, 68, 68, 68, 1156,
+ 68, 68, 1155, 68, 68, 1159, 68, 68, 1158, 68,
+ 68, 68, 1160, 1151, 1154, 68, 68, 68, 1161, 1164,
+
+ 1157, 68, 1153, 1162, 68, 1167, 68, 1163, 1165, 68,
+ 68, 68, 1168, 68, 1174, 68, 1172, 1166, 68, 68,
+ 1169, 1170, 1173, 1177, 68, 1180, 1181, 68, 1171, 1175,
+ 68, 1182, 1178, 1179, 1176, 1183, 68, 1184, 68, 68,
+ 1187, 68, 68, 68, 68, 68, 68, 1189, 68, 1192,
+ 1194, 1186, 68, 1188, 68, 68, 1190, 68, 68, 1197,
+ 68, 1196, 1198, 68, 1185, 1207, 68, 1199, 68, 1195,
+ 1193, 1191, 68, 68, 1200, 68, 68, 68, 1201, 68,
+ 68, 1202, 1204, 68, 68, 1203, 68, 68, 68, 68,
+ 68, 1205, 1206, 1209, 1212, 68, 1214, 68, 1216, 68,
+
+ 1213, 68, 1215, 1208, 1210, 68, 1211, 1218, 1219, 1217,
+ 1221, 68, 68, 1224, 1220, 68, 68, 68, 68, 68,
+ 1226, 68, 68, 1227, 1228, 68, 68, 1222, 68, 1223,
+ 68, 1231, 68, 1225, 68, 1229, 68, 1230, 1234, 68,
+ 68, 1232, 68, 1233, 68, 68, 1235, 1241, 1236, 1240,
+ 68, 68, 68, 1244, 1237, 68, 1246, 68, 68, 68,
+ 1238, 1243, 1239, 68, 1248, 1249, 68, 68, 1242, 1245,
+ 68, 1250, 1251, 68, 1254, 68, 68, 68, 68, 68,
+ 1255, 1258, 68, 68, 1247, 68, 68, 1261, 1252, 68,
+ 1264, 1257, 68, 1253, 1262, 1256, 68, 68, 1259, 1263,
+
+ 68, 68, 68, 1267, 68, 1260, 68, 1268, 1270, 1265,
+ 68, 1269, 1266, 68, 68, 1271, 68, 1273, 1272, 68,
+ 68, 68, 1276, 68, 68, 1277, 1274, 1281, 68, 68,
+ 1275, 1762, 1280, 1282, 68, 1278, 1283, 68, 1285, 68,
+ 68, 1288, 68, 68, 1286, 68, 1279, 68, 1284, 1292,
+ 68, 1289, 68, 1287, 68, 1293, 1291, 68, 68, 68,
+ 1290, 1297, 68, 1296, 1294, 68, 68, 68, 68, 68,
+ 1299, 68, 68, 1302, 68, 1295, 1305, 68, 1306, 68,
+ 68, 68, 1301, 68, 1298, 1308, 1307, 1303, 1304, 1300,
+ 68, 68, 68, 1762, 68, 68, 1317, 68, 68, 68,
+
+ 1310, 1318, 68, 1762, 68, 1309, 1311, 1315, 68, 1322,
+ 1313, 68, 1319, 1314, 1312, 1316, 1320, 1321, 1323, 68,
+ 1324, 68, 1326, 68, 1325, 1327, 68, 1328, 68, 68,
+ 1330, 68, 1331, 68, 68, 68, 68, 1335, 68, 68,
+ 68, 1334, 1337, 68, 68, 68, 1339, 68, 1329, 1332,
+ 1340, 68, 1341, 1333, 1343, 68, 1345, 68, 1336, 68,
+ 68, 68, 1338, 68, 1344, 1348, 68, 1342, 1349, 68,
+ 1351, 68, 68, 1353, 68, 1347, 68, 68, 1355, 68,
+ 68, 68, 1346, 1354, 68, 1350, 1357, 68, 68, 1352,
+ 68, 1356, 1361, 1359, 68, 68, 1366, 68, 68, 1363,
+
+ 1762, 68, 1358, 1362, 1364, 1360, 68, 1369, 1365, 1371,
+ 1367, 68, 1370, 68, 68, 68, 1372, 1368, 68, 68,
+ 68, 68, 68, 1377, 1373, 68, 1378, 68, 1374, 1380,
+ 68, 1376, 1381, 68, 1375, 68, 1383, 68, 68, 1382,
+ 68, 1385, 1379, 68, 1387, 68, 68, 68, 1389, 1384,
+ 1388, 1390, 68, 68, 68, 68, 68, 1386, 1391, 1394,
+ 1392, 1393, 68, 1397, 68, 1762, 68, 1396, 68, 68,
+ 1398, 1400, 1399, 1401, 1395, 68, 1404, 1402, 68, 68,
+ 68, 1403, 1405, 68, 68, 1406, 1408, 68, 1410, 1407,
+ 1409, 68, 68, 68, 68, 1411, 68, 68, 1415, 68,
+
+ 1416, 68, 1414, 1419, 68, 68, 68, 68, 1412, 68,
+ 68, 1421, 1420, 68, 68, 68, 1425, 68, 1413, 1417,
+ 1424, 1418, 1426, 68, 1422, 1427, 68, 1423, 68, 68,
+ 68, 68, 1429, 68, 68, 1435, 68, 68, 1433, 68,
+ 1428, 1430, 1431, 1432, 68, 68, 1436, 68, 68, 68,
+ 68, 68, 68, 1443, 1434, 68, 1444, 1445, 1439, 1446,
+ 68, 68, 1441, 68, 1438, 1437, 68, 1442, 1447, 68,
+ 68, 1440, 68, 68, 68, 1448, 68, 1455, 68, 1449,
+ 68, 1452, 1456, 68, 68, 1450, 1451, 1457, 68, 1459,
+ 1453, 1454, 68, 68, 1465, 1458, 1464, 68, 1460, 68,
+
+ 68, 68, 1461, 68, 68, 68, 68, 68, 1462, 68,
+ 68, 1762, 1463, 1473, 1474, 68, 1467, 68, 1466, 68,
+ 68, 1475, 1468, 1477, 1469, 1470, 1471, 1478, 68, 1472,
+ 1480, 68, 68, 1479, 68, 1476, 1482, 68, 68, 1483,
+ 1484, 68, 68, 1485, 68, 68, 68, 68, 68, 68,
+ 1488, 1481, 1489, 1487, 68, 68, 1491, 68, 1498, 1493,
+ 1486, 68, 1494, 68, 1492, 1490, 1496, 68, 1497, 68,
+ 1495, 1500, 68, 1501, 68, 1502, 1499, 68, 68, 68,
+ 68, 1503, 68, 1504, 68, 68, 68, 68, 1505, 68,
+ 1508, 68, 1507, 68, 1510, 68, 68, 1506, 1509, 68,
+
+ 68, 1515, 1512, 68, 1513, 1511, 68, 68, 1514, 1520,
+ 68, 68, 1516, 1518, 1522, 1517, 1521, 1523, 68, 68,
+ 68, 68, 68, 68, 1527, 1519, 1525, 68, 1524, 68,
+ 1529, 1526, 1530, 68, 68, 68, 1533, 68, 1528, 68,
+ 1534, 1535, 68, 1536, 68, 1537, 68, 1531, 68, 68,
+ 1540, 1541, 68, 1542, 1532, 68, 68, 1538, 68, 68,
+ 1544, 68, 1539, 68, 1543, 68, 1547, 68, 68, 1551,
+ 68, 68, 68, 68, 1555, 68, 1545, 1546, 68, 1553,
+ 1558, 1548, 1550, 68, 1556, 1549, 1552, 68, 68, 68,
+ 68, 1554, 68, 68, 1557, 68, 1564, 68, 1561, 1567,
+
+ 68, 68, 68, 68, 1565, 1568, 68, 1559, 68, 68,
+ 1562, 1569, 1563, 68, 1560, 1566, 1570, 1571, 1572, 68,
+ 68, 1574, 1573, 68, 1577, 1576, 68, 68, 68, 68,
+ 68, 1575, 1579, 68, 1581, 1578, 68, 1580, 1583, 1585,
+ 68, 1587, 68, 68, 68, 68, 1590, 68, 68, 68,
+ 68, 1582, 1591, 68, 1584, 68, 68, 68, 1592, 68,
+ 1589, 1596, 1588, 1595, 68, 1586, 1593, 1598, 68, 1600,
+ 68, 68, 1594, 1603, 68, 68, 1602, 68, 1599, 68,
+ 1601, 68, 1605, 1597, 1608, 68, 1609, 68, 68, 68,
+ 68, 1606, 1613, 68, 68, 1604, 1615, 68, 68, 68,
+
+ 1618, 1607, 1611, 1616, 68, 68, 1614, 1610, 68, 1612,
+ 1621, 68, 1622, 68, 68, 68, 1627, 68, 1617, 1624,
+ 68, 1619, 1620, 1628, 68, 1626, 68, 1623, 68, 1625,
+ 1629, 68, 68, 1630, 1631, 68, 68, 1633, 1634, 68,
+ 68, 1635, 1636, 68, 68, 1637, 1639, 68, 1632, 68,
+ 68, 68, 1638, 68, 1640, 1641, 68, 68, 68, 68,
+ 1649, 68, 68, 1647, 1650, 68, 1651, 1652, 68, 1642,
+ 1644, 1645, 1643, 1653, 1654, 68, 68, 68, 1646, 1648,
+ 68, 1655, 1657, 68, 68, 1660, 68, 68, 68, 1656,
+ 68, 68, 68, 1762, 68, 1658, 1664, 1665, 1667, 68,
+
+ 1668, 68, 1659, 1662, 1669, 68, 1670, 68, 1671, 68,
+ 68, 1663, 1661, 1666, 1672, 68, 68, 1674, 1675, 68,
+ 68, 68, 1673, 68, 68, 1677, 68, 68, 68, 68,
+ 1681, 68, 68, 1676, 68, 68, 68, 68, 1689, 68,
+ 1678, 68, 1679, 1680, 1683, 1690, 1691, 1685, 1682, 68,
+ 1686, 1684, 1688, 68, 1692, 68, 1695, 68, 68, 1699,
+ 1687, 68, 68, 1700, 68, 68, 68, 68, 68, 68,
+ 1694, 1696, 68, 1697, 68, 68, 68, 68, 1693, 1701,
+ 1702, 1698, 1709, 1704, 68, 1703, 68, 1706, 1707, 1710,
+ 68, 1705, 68, 1712, 68, 1708, 68, 68, 1717, 1713,
+
+ 68, 1714, 1715, 68, 68, 1711, 1718, 68, 68, 1716,
+ 1722, 1719, 68, 68, 68, 68, 68, 68, 68, 1720,
+ 68, 1725, 68, 68, 1729, 1730, 1724, 1721, 68, 1732,
+ 68, 1723, 1762, 1726, 68, 1728, 1727, 1731, 68, 1733,
+ 68, 1735, 1737, 68, 68, 1734, 68, 68, 68, 1736,
+ 68, 1738, 68, 1739, 68, 1741, 68, 1743, 68, 1744,
+ 68, 1747, 68, 68, 68, 1750, 1740, 1742, 1751, 68,
+ 1762, 68, 1753, 68, 68, 1745, 68, 1746, 1752, 1754,
+ 68, 1748, 1749, 1755, 68, 68, 68, 1760, 68, 1756,
+ 1757, 1761, 68, 1758, 1762, 1762, 1762, 1762, 1762, 1762,
+
+ 1762, 1762, 1762, 1762, 1762, 1759, 40, 40, 40, 40,
+ 40, 40, 40, 45, 45, 45, 45, 45, 45, 45,
+ 50, 50, 50, 50, 50, 50, 50, 56, 56, 56,
+ 56, 56, 56, 56, 61, 61, 61, 61, 61, 61,
+ 61, 71, 71, 1762, 71, 71, 71, 71, 125, 125,
+ 1762, 1762, 1762, 125, 125, 127, 127, 1762, 1762, 127,
+ 1762, 127, 129, 1762, 1762, 1762, 1762, 1762, 129, 132,
+ 132, 1762, 1762, 1762, 132, 132, 134, 1762, 1762, 1762,
+ 1762, 1762, 134, 136, 136, 1762, 136, 136, 136, 136,
+ 72, 72, 1762, 72, 72, 72, 72, 13, 1762, 1762,
+
+ 1762, 1762, 1762, 1762, 1762, 1762, 1762, 1762, 1762, 1762,
+ 1762, 1762, 1762, 1762, 1762, 1762, 1762, 1762, 1762, 1762,
+ 1762, 1762, 1762, 1762, 1762, 1762, 1762, 1762, 1762, 1762,
+ 1762, 1762, 1762, 1762, 1762, 1762, 1762
} ;
-static yyconst flex_int16_t yy_chk[2916] =
+static yyconst flex_int16_t yy_chk[3538] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
3, 3, 4, 4, 4, 49, 5, 5, 49, 3,
5, 15, 4, 6, 6, 15, 5, 6, 9, 9,
- 9, 119, 33, 6, 7, 7, 7, 7, 9, 7,
+ 9, 154, 33, 6, 7, 7, 7, 7, 9, 7,
10, 10, 10, 44, 44, 7, 8, 8, 8, 8,
- 10, 8, 21, 33, 119, 21, 21, 8, 11, 11,
- 11, 11, 11, 11, 1446, 20, 29, 20, 20, 11,
+ 10, 8, 21, 33, 154, 21, 21, 8, 11, 11,
+ 11, 11, 11, 11, 1768, 20, 29, 20, 20, 11,
20, 29, 24, 21, 25, 20, 24, 28, 11, 12,
12, 12, 12, 12, 12, 74, 22, 22, 74, 25,
- 12, 69, 28, 30, 22, 69, 24, 110, 22, 12,
- 19, 22, 19, 19, 23, 19, 26, 26, 30, 23,
- 19, 19, 110, 23, 27, 26, 23, 34, 27, 23,
- 76, 27, 31, 31, 32, 32, 34, 86, 27, 32,
- 27, 31, 34, 35, 36, 34, 38, 31, 35, 36,
- 76, 31, 34, 37, 37, 32, 37, 86, 35, 36,
- 38, 35, 75, 36, 36, 38, 75, 39, 39, 60,
- 60, 37, 39, 55, 94, 55, 55, 63, 55, 63,
-
- 63, 65, 63, 65, 65, 66, 65, 68, 63, 68,
- 68, 77, 68, 94, 77, 78, 81, 68, 79, 66,
- 71, 80, 71, 71, 82, 71, 83, 79, 81, 84,
- 71, 71, 85, 78, 84, 80, 87, 88, 91, 89,
- 90, 617, 82, 89, 93, 90, 85, 84, 83, 93,
- 92, 97, 91, 92, 87, 88, 92, 95, 96, 98,
- 99, 96, 95, 101, 99, 96, 103, 100, 104, 106,
- 92, 102, 108, 98, 100, 97, 101, 105, 102, 103,
- 107, 105, 95, 109, 111, 107, 112, 106, 104, 107,
- 113, 116, 108, 114, 117, 113, 109, 115, 115, 118,
-
- 112, 120, 121, 111, 112, 114, 120, 122, 139, 116,
- 117, 124, 124, 126, 121, 186, 126, 186, 115, 128,
- 118, 128, 128, 139, 128, 122, 131, 131, 133, 141,
- 133, 133, 134, 133, 134, 134, 136, 134, 143, 136,
- 137, 138, 140, 134, 141, 137, 138, 142, 144, 149,
- 140, 145, 142, 144, 144, 146, 145, 151, 143, 150,
- 146, 147, 148, 148, 150, 147, 157, 152, 149, 153,
- 147, 152, 154, 155, 153, 147, 160, 156, 158, 161,
- 151, 147, 147, 158, 157, 166, 154, 132, 155, 156,
- 159, 159, 156, 162, 166, 161, 160, 164, 162, 163,
-
- 163, 165, 164, 167, 168, 169, 165, 170, 164, 168,
- 169, 171, 170, 172, 174, 173, 171, 175, 176, 177,
- 172, 173, 178, 175, 167, 179, 180, 177, 181, 182,
- 183, 180, 181, 184, 174, 185, 187, 178, 184, 188,
- 176, 189, 195, 187, 188, 179, 190, 190, 183, 183,
- 194, 182, 191, 192, 193, 185, 193, 191, 192, 196,
- 189, 195, 194, 197, 198, 199, 202, 196, 197, 198,
- 200, 201, 203, 193, 202, 191, 204, 205, 205, 204,
- 199, 206, 206, 207, 200, 208, 211, 209, 210, 201,
- 209, 212, 210, 213, 217, 211, 212, 203, 215, 207,
-
- 208, 214, 214, 215, 216, 218, 219, 213, 220, 216,
- 221, 221, 222, 223, 217, 225, 224, 223, 228, 226,
- 225, 220, 226, 218, 227, 229, 230, 219, 224, 230,
- 222, 231, 236, 232, 229, 228, 227, 233, 228, 233,
- 233, 234, 234, 235, 231, 232, 235, 230, 237, 236,
- 238, 240, 236, 239, 239, 242, 240, 241, 241, 238,
- 243, 244, 245, 237, 246, 249, 244, 247, 248, 246,
- 242, 248, 247, 248, 250, 251, 252, 254, 253, 249,
- 243, 252, 245, 253, 251, 255, 256, 258, 257, 260,
- 250, 257, 262, 250, 261, 250, 263, 264, 254, 265,
-
- 256, 258, 269, 261, 260, 255, 267, 257, 259, 266,
- 259, 259, 264, 262, 266, 263, 268, 269, 270, 265,
- 259, 272, 259, 259, 259, 271, 267, 259, 273, 274,
- 271, 276, 277, 270, 274, 279, 268, 275, 275, 278,
- 275, 272, 273, 280, 282, 280, 281, 283, 277, 279,
- 281, 276, 286, 290, 284, 278, 285, 286, 288, 290,
- 287, 283, 282, 284, 287, 285, 289, 288, 291, 292,
- 293, 289, 291, 296, 292, 295, 284, 294, 294, 297,
- 295, 298, 300, 293, 299, 303, 300, 302, 297, 301,
- 301, 307, 302, 298, 296, 308, 299, 304, 304, 306,
-
- 306, 309, 310, 308, 312, 313, 303, 314, 315, 316,
- 309, 317, 307, 315, 310, 318, 317, 316, 318, 319,
- 320, 314, 321, 322, 312, 313, 323, 322, 324, 325,
- 326, 329, 328, 324, 330, 331, 333, 319, 402, 330,
- 402, 323, 320, 321, 330, 325, 338, 329, 335, 326,
- 327, 327, 328, 332, 332, 331, 327, 336, 327, 334,
- 334, 333, 337, 335, 339, 338, 327, 340, 342, 336,
- 341, 344, 340, 343, 130, 344, 327, 337, 345, 341,
- 346, 347, 348, 345, 349, 349, 339, 342, 343, 350,
- 351, 352, 346, 353, 350, 348, 353, 354, 355, 347,
-
- 356, 355, 351, 352, 357, 357, 358, 358, 363, 359,
- 360, 360, 354, 356, 359, 361, 361, 362, 364, 369,
- 365, 366, 362, 364, 365, 368, 366, 367, 370, 363,
- 368, 367, 371, 370, 372, 373, 375, 371, 373, 369,
- 374, 374, 377, 373, 376, 381, 129, 373, 372, 376,
- 378, 377, 379, 378, 375, 380, 379, 382, 381, 383,
- 380, 384, 382, 385, 386, 387, 391, 388, 383, 386,
- 388, 387, 392, 389, 390, 385, 389, 384, 379, 390,
- 393, 403, 127, 395, 391, 393, 392, 394, 395, 396,
- 394, 397, 398, 396, 396, 399, 397, 400, 399, 401,
-
- 403, 398, 405, 401, 401, 404, 406, 404, 407, 400,
- 408, 409, 410, 399, 411, 409, 412, 413, 414, 415,
- 405, 410, 420, 414, 406, 416, 416, 407, 418, 411,
- 408, 417, 413, 418, 412, 417, 419, 421, 415, 422,
- 423, 420, 424, 425, 427, 423, 422, 428, 425, 424,
- 421, 426, 419, 430, 428, 429, 426, 432, 431, 434,
- 432, 433, 427, 431, 429, 433, 437, 430, 435, 435,
- 438, 440, 439, 441, 442, 438, 439, 435, 443, 446,
- 434, 449, 442, 440, 451, 437, 450, 455, 451, 452,
- 449, 441, 450, 443, 452, 454, 446, 453, 456, 453,
-
- 454, 453, 465, 457, 453, 455, 457, 458, 458, 453,
- 459, 460, 460, 461, 466, 453, 453, 459, 462, 462,
- 464, 463, 465, 456, 463, 464, 467, 469, 461, 468,
- 468, 470, 471, 466, 467, 472, 472, 471, 473, 474,
- 475, 125, 469, 473, 474, 475, 477, 476, 478, 470,
- 476, 479, 477, 480, 482, 481, 478, 483, 483, 479,
- 481, 482, 484, 485, 486, 489, 488, 491, 485, 488,
- 484, 480, 490, 490, 493, 492, 495, 493, 497, 489,
- 498, 496, 491, 486, 492, 493, 496, 499, 500, 501,
- 502, 506, 503, 504, 502, 505, 507, 495, 501, 497,
-
- 498, 508, 507, 509, 505, 506, 510, 512, 500, 499,
- 503, 510, 504, 513, 511, 514, 515, 509, 511, 517,
- 514, 508, 516, 516, 517, 513, 512, 518, 519, 520,
- 518, 521, 522, 523, 523, 525, 521, 515, 524, 524,
- 526, 527, 520, 528, 526, 529, 519, 530, 533, 532,
- 525, 534, 522, 532, 537, 535, 539, 536, 123, 529,
- 527, 540, 539, 533, 559, 538, 540, 528, 530, 531,
- 535, 536, 531, 559, 531, 537, 534, 543, 531, 538,
- 531, 541, 541, 542, 544, 531, 547, 541, 542, 541,
- 546, 543, 545, 545, 547, 546, 544, 548, 549, 550,
-
- 550, 551, 555, 553, 562, 551, 554, 541, 553, 554,
- 556, 548, 558, 557, 560, 561, 563, 549, 557, 564,
- 561, 555, 565, 556, 562, 567, 568, 565, 564, 569,
- 563, 558, 571, 560, 570, 572, 573, 571, 67, 567,
- 572, 573, 574, 575, 575, 568, 582, 569, 576, 570,
- 578, 574, 581, 576, 578, 578, 579, 579, 580, 583,
- 579, 580, 583, 584, 585, 586, 582, 581, 587, 585,
- 586, 588, 589, 587, 590, 591, 591, 588, 592, 593,
- 590, 595, 594, 596, 584, 594, 597, 592, 589, 599,
- 598, 600, 601, 603, 599, 602, 600, 593, 602, 595,
-
- 604, 606, 596, 598, 603, 604, 597, 605, 607, 607,
- 601, 608, 605, 609, 610, 611, 606, 612, 614, 611,
- 613, 615, 618, 619, 620, 61, 610, 609, 621, 613,
- 608, 625, 630, 621, 622, 612, 618, 614, 619, 622,
- 623, 626, 623, 624, 620, 625, 615, 627, 624, 628,
- 629, 630, 627, 631, 631, 626, 632, 633, 634, 635,
- 637, 639, 636, 634, 628, 629, 633, 636, 638, 640,
- 639, 641, 638, 642, 632, 643, 644, 645, 635, 637,
- 648, 646, 649, 647, 640, 642, 641, 646, 651, 652,
- 654, 649, 658, 651, 643, 645, 653, 644, 647, 657,
-
- 648, 655, 56, 652, 653, 658, 655, 656, 659, 660,
- 654, 656, 656, 665, 660, 661, 661, 659, 657, 662,
- 663, 664, 664, 666, 662, 663, 667, 668, 669, 670,
- 671, 667, 666, 665, 670, 671, 673, 672, 674, 675,
- 673, 668, 672, 678, 677, 679, 669, 674, 677, 681,
- 675, 680, 674, 682, 674, 683, 674, 684, 678, 685,
- 686, 682, 51, 679, 688, 680, 687, 687, 681, 683,
- 693, 684, 689, 689, 695, 691, 692, 685, 691, 688,
- 699, 692, 694, 694, 703, 686, 696, 696, 697, 693,
- 698, 698, 700, 697, 695, 701, 702, 700, 704, 705,
-
- 699, 702, 703, 701, 704, 707, 705, 708, 709, 710,
- 707, 711, 708, 709, 710, 712, 713, 714, 714, 715,
- 711, 716, 718, 717, 720, 719, 723, 713, 717, 721,
- 722, 722, 724, 725, 712, 726, 727, 730, 720, 715,
- 734, 727, 718, 731, 716, 719, 723, 721, 729, 732,
- 733, 725, 729, 729, 732, 735, 736, 724, 726, 735,
- 734, 731, 737, 730, 738, 739, 740, 741, 733, 742,
- 743, 744, 741, 745, 736, 743, 742, 746, 738, 748,
- 739, 737, 745, 749, 747, 740, 750, 756, 749, 744,
- 747, 750, 746, 751, 752, 752, 754, 754, 751, 755,
-
- 748, 756, 757, 758, 755, 759, 759, 758, 758, 760,
- 761, 762, 763, 764, 765, 767, 762, 766, 768, 771,
- 765, 757, 766, 769, 770, 772, 773, 779, 760, 761,
- 774, 774, 764, 771, 767, 775, 777, 768, 763, 50,
- 775, 773, 769, 770, 776, 778, 772, 779, 776, 777,
- 780, 780, 781, 783, 778, 782, 784, 781, 785, 782,
- 787, 789, 791, 785, 790, 790, 789, 791, 793, 793,
- 795, 795, 797, 783, 799, 797, 784, 800, 787, 798,
- 798, 801, 802, 803, 803, 804, 801, 805, 805, 799,
- 806, 808, 807, 810, 809, 808, 812, 802, 810, 814,
-
- 814, 813, 800, 807, 815, 804, 816, 818, 819, 822,
- 819, 817, 806, 809, 812, 813, 817, 820, 821, 823,
- 824, 824, 820, 821, 815, 825, 816, 818, 828, 822,
- 827, 825, 832, 823, 829, 827, 830, 829, 831, 831,
- 833, 830, 834, 835, 836, 840, 837, 839, 835, 841,
- 832, 837, 839, 828, 838, 838, 842, 843, 844, 833,
- 845, 846, 834, 840, 847, 848, 846, 836, 849, 841,
- 844, 843, 851, 845, 852, 858, 842, 854, 858, 853,
- 859, 852, 857, 857, 847, 848, 861, 851, 853, 849,
- 860, 853, 862, 854, 863, 860, 864, 865, 866, 859,
-
- 868, 862, 861, 866, 869, 864, 865, 870, 864, 867,
- 867, 872, 871, 863, 873, 874, 874, 869, 875, 876,
- 868, 879, 878, 880, 881, 870, 871, 878, 880, 881,
- 883, 885, 873, 884, 875, 882, 872, 876, 884, 879,
- 886, 882, 890, 886, 885, 889, 891, 892, 896, 886,
- 883, 893, 894, 889, 897, 890, 898, 899, 897, 902,
- 900, 898, 899, 901, 891, 900, 892, 893, 896, 903,
- 894, 905, 901, 904, 904, 906, 907, 908, 909, 910,
- 911, 919, 902, 909, 903, 905, 912, 906, 907, 913,
- 913, 910, 912, 914, 914, 916, 918, 908, 911, 917,
-
- 917, 918, 919, 920, 916, 921, 922, 922, 923, 924,
- 924, 925, 925, 926, 927, 929, 930, 927, 926, 931,
- 929, 932, 920, 936, 931, 921, 933, 933, 923, 934,
- 934, 935, 937, 938, 930, 936, 935, 936, 939, 940,
- 941, 941, 936, 942, 943, 943, 932, 944, 946, 947,
- 948, 948, 937, 938, 950, 951, 949, 946, 939, 952,
- 940, 950, 953, 953, 951, 954, 955, 944, 957, 942,
- 947, 949, 958, 957, 959, 962, 960, 958, 961, 961,
- 962, 963, 955, 960, 964, 952, 965, 966, 967, 968,
- 963, 954, 969, 970, 959, 971, 971, 974, 969, 972,
-
- 975, 965, 970, 967, 964, 980, 966, 985, 968, 45,
- 972, 973, 973, 982, 975, 972, 976, 980, 974, 977,
- 977, 976, 978, 979, 981, 982, 978, 978, 979, 981,
- 983, 984, 985, 986, 983, 987, 988, 989, 986, 991,
- 40, 988, 991, 984, 992, 992, 993, 993, 994, 989,
- 995, 998, 997, 994, 996, 1001, 995, 987, 997, 996,
- 998, 1003, 1003, 1004, 1011, 1005, 1006, 1001, 1008, 1008,
- 1013, 1012, 1019, 1003, 1005, 1006, 1012, 1021, 1011, 1014,
- 1014, 1004, 1015, 1018, 1015, 1016, 1016, 1013, 1020, 1020,
- 1018, 1022, 1019, 1023, 1024, 1025, 1026, 1028, 1021, 1029,
-
- 1030, 1029, 1028, 1022, 1031, 1023, 1024, 1032, 1034, 1032,
- 1025, 1035, 1035, 1031, 1036, 1037, 1026, 1038, 1030, 1038,
- 1037, 1039, 1034, 1040, 1041, 1042, 1039, 1043, 1040, 1044,
- 1046, 1049, 1043, 1047, 1044, 1048, 1048, 1052, 1066, 1050,
- 1036, 1053, 1041, 1049, 1051, 1042, 1051, 1047, 1050, 1046,
- 1053, 1050, 1054, 1059, 1056, 1057, 1060, 1061, 1052, 1056,
- 1057, 1063, 1065, 1066, 1054, 1067, 1059, 1063, 1065, 1068,
- 1068, 1069, 1071, 1061, 1067, 1072, 1060, 1070, 1070, 1072,
- 1069, 1073, 1074, 1075, 1075, 1076, 1073, 1079, 1080, 1081,
- 1081, 1071, 1083, 1076, 1086, 1074, 1084, 1080, 1082, 1082,
-
- 1087, 1084, 1079, 1085, 1083, 1087, 1088, 1085, 1089, 1086,
- 1091, 1092, 1093, 1094, 1095, 1097, 1097, 1098, 1099, 1113,
- 1098, 1101, 1101, 1100, 1113, 1094, 1104, 1089, 1102, 1102,
- 1092, 1099, 1088, 1093, 1091, 1095, 1100, 1103, 1103, 1104,
- 1105, 1105, 1106, 1106, 1107, 1108, 1108, 1109, 1109, 1111,
- 1110, 1114, 1114, 1115, 1116, 1116, 1117, 1119, 1126, 1118,
- 1119, 1120, 1120, 1107, 1110, 1118, 1121, 1121, 1111, 1122,
- 1123, 1123, 1115, 1128, 1117, 1125, 1125, 1120, 1127, 1127,
- 1130, 1129, 1128, 1129, 1126, 1131, 1132, 1133, 1122, 1134,
- 1131, 1135, 1130, 1136, 1137, 1138, 1135, 1139, 1142, 14,
-
- 1133, 1140, 1139, 1137, 1138, 1140, 1144, 1149, 1136, 1146,
- 1134, 1132, 1145, 1145, 1146, 1144, 1147, 1147, 1142, 1150,
- 1151, 1153, 1149, 1154, 1153, 1147, 1155, 1155, 1154, 1156,
- 1160, 1157, 1151, 1156, 1157, 1150, 1158, 1158, 1159, 1162,
- 1161, 1163, 1164, 1159, 1161, 1165, 1163, 1164, 1167, 1168,
- 1160, 1165, 1169, 1170, 1168, 1170, 1173, 1173, 1179, 1162,
- 1169, 1176, 1176, 1179, 1167, 1180, 1181, 1181, 1183, 1183,
- 1180, 1185, 1186, 1186, 1187, 1188, 1185, 1189, 1191, 1191,
- 1194, 1195, 1189, 1195, 1196, 1194, 1197, 1198, 1199, 1199,
- 1187, 1202, 1198, 1200, 1200, 1201, 1201, 1188, 1196, 1203,
-
- 1197, 1204, 1205, 1202, 1206, 1207, 1208, 1208, 1210, 1209,
- 1211, 1212, 1213, 1204, 1205, 1214, 1206, 1203, 1209, 1215,
- 1216, 1217, 1218, 1216, 1212, 1207, 1217, 1218, 1221, 1214,
- 1211, 1219, 1219, 1225, 1210, 1226, 1213, 1215, 1222, 1222,
- 1224, 1224, 1225, 1227, 1228, 1230, 1221, 1229, 1231, 1231,
- 1226, 1232, 1233, 1234, 1235, 1237, 1232, 1238, 1241, 1243,
- 1243, 1227, 1228, 1229, 1230, 1242, 1244, 1233, 1242, 1245,
- 1247, 1247, 1234, 1248, 1235, 1237, 1238, 1250, 1241, 1249,
- 1249, 1244, 1250, 1251, 1251, 1255, 1255, 1245, 1256, 1257,
- 1258, 1259, 1248, 1260, 1262, 1258, 1259, 1263, 1257, 1264,
-
- 1265, 1260, 1263, 1269, 1264, 1266, 1266, 1267, 1267, 1262,
- 1256, 1268, 1270, 1270, 1274, 1265, 1268, 1273, 1269, 1271,
- 1271, 1276, 1273, 1277, 1276, 1278, 1274, 1283, 1279, 1280,
- 1280, 1281, 1284, 1286, 1278, 13, 1277, 1279, 1285, 1285,
- 1281, 1289, 1286, 1287, 1288, 1288, 1283, 1290, 1287, 1289,
- 1292, 1284, 1290, 1293, 1295, 1295, 1297, 1299, 1305, 1292,
- 1300, 1300, 1301, 1302, 1302, 1301, 1293, 1303, 1303, 1304,
- 1306, 1315, 1305, 1307, 1307, 1306, 1297, 1299, 1308, 1311,
- 1312, 1316, 1308, 1317, 1312, 1311, 1321, 1304, 1319, 1316,
- 1315, 1318, 1318, 1320, 1322, 1324, 1323, 1326, 1320, 1327,
-
- 1326, 1329, 1317, 1331, 1319, 1323, 1321, 1331, 1327, 1330,
- 1330, 1336, 1332, 1334, 1334, 1324, 1335, 1337, 0, 1329,
- 1322, 1332, 1340, 1336, 1342, 1335, 1344, 1340, 1341, 1341,
- 1345, 1344, 1346, 1342, 1347, 1348, 1350, 1346, 1351, 1345,
- 1349, 1349, 1337, 1352, 1353, 1350, 1354, 1355, 1356, 1358,
- 1348, 1354, 1353, 1347, 1351, 1357, 1357, 1362, 1359, 1361,
- 1361, 1364, 1352, 1359, 1368, 1358, 1367, 1356, 1365, 1365,
- 1366, 1366, 1369, 1355, 1370, 1370, 1368, 1362, 1371, 1372,
- 1372, 1373, 1373, 1364, 1374, 1367, 1376, 1384, 1377, 0,
- 1371, 0, 1369, 1377, 1378, 1378, 1379, 1379, 1380, 1380,
-
- 1376, 1381, 1398, 1374, 1382, 1382, 1381, 1385, 1385, 1384,
- 1387, 1387, 1388, 1391, 1392, 1392, 1400, 1388, 1393, 1395,
- 1400, 1391, 1398, 1393, 1395, 1399, 1399, 1404, 1404, 1406,
- 1406, 1407, 1406, 1409, 1409, 1407, 1410, 1412, 1413, 1413,
- 1414, 1414, 1416, 1416, 1418, 1418, 1419, 1419, 1420, 1420,
- 1422, 1410, 1423, 1423, 1430, 1412, 1431, 1433, 1430, 1432,
- 1432, 1436, 1422, 1435, 1437, 0, 1433, 1438, 1438, 0,
- 0, 0, 0, 0, 0, 1436, 1431, 0, 1435, 0,
- 0, 0, 0, 1437, 1441, 1441, 1441, 1441, 1441, 1441,
- 1441, 1442, 1442, 1442, 1442, 1442, 1442, 1442, 1443, 1443,
-
- 1443, 1443, 1443, 1443, 1443, 1444, 1444, 1444, 1444, 1444,
- 1444, 1444, 1445, 1445, 1445, 1445, 1445, 1445, 1445, 1447,
- 1447, 0, 1447, 1447, 1447, 1447, 1448, 1448, 0, 0,
- 0, 1448, 1448, 1449, 1449, 0, 0, 1449, 0, 1449,
- 1450, 0, 0, 0, 0, 0, 1450, 1451, 1451, 0,
- 0, 0, 1451, 1451, 1452, 0, 0, 0, 0, 0,
- 1452, 1453, 1453, 0, 1453, 1453, 1453, 1453, 1454, 1454,
- 0, 1454, 1454, 1454, 1454, 1440, 1440, 1440, 1440, 1440,
- 1440, 1440, 1440, 1440, 1440, 1440, 1440, 1440, 1440, 1440,
- 1440, 1440, 1440, 1440, 1440, 1440, 1440, 1440, 1440, 1440,
-
- 1440, 1440, 1440, 1440, 1440, 1440, 1440, 1440, 1440, 1440,
- 1440, 1440, 1440, 1440, 1440
+ 12, 69, 28, 30, 22, 69, 24, 470, 22, 12,
+ 19, 22, 19, 19, 66, 19, 26, 26, 30, 27,
+ 19, 19, 23, 27, 470, 26, 27, 23, 66, 31,
+ 31, 23, 76, 27, 23, 27, 23, 23, 31, 75,
+ 32, 32, 34, 75, 31, 32, 37, 37, 31, 37,
+ 36, 34, 76, 35, 35, 36, 87, 34, 35, 38,
+ 34, 32, 60, 60, 37, 36, 437, 34, 35, 36,
+ 36, 35, 79, 38, 39, 39, 87, 437, 38, 39,
+
+ 55, 79, 55, 55, 63, 55, 63, 63, 65, 63,
+ 65, 65, 80, 65, 68, 63, 68, 68, 77, 68,
+ 78, 77, 81, 82, 68, 71, 80, 71, 71, 83,
+ 71, 84, 86, 95, 81, 71, 71, 85, 78, 88,
+ 89, 82, 85, 90, 91, 92, 86, 90, 94, 91,
+ 84, 83, 95, 94, 98, 85, 96, 88, 89, 92,
+ 93, 96, 97, 93, 105, 97, 93, 100, 99, 97,
+ 101, 100, 102, 104, 107, 106, 103, 101, 98, 106,
+ 93, 96, 99, 103, 105, 102, 104, 109, 108, 110,
+ 111, 112, 107, 108, 113, 115, 114, 108, 118, 116,
+
+ 115, 117, 117, 111, 119, 120, 112, 109, 655, 110,
+ 114, 116, 123, 113, 114, 121, 118, 121, 122, 124,
+ 119, 157, 117, 122, 123, 139, 120, 126, 126, 128,
+ 139, 130, 128, 130, 130, 157, 130, 124, 121, 133,
+ 133, 135, 141, 135, 135, 136, 135, 136, 136, 138,
+ 136, 142, 138, 140, 143, 144, 136, 141, 140, 142,
+ 144, 145, 146, 151, 151, 147, 148, 146, 146, 143,
+ 147, 148, 149, 152, 149, 153, 158, 193, 155, 156,
+ 153, 145, 155, 160, 156, 159, 162, 162, 161, 164,
+ 163, 158, 152, 161, 149, 150, 193, 159, 165, 150,
+
+ 159, 160, 169, 165, 150, 164, 162, 166, 166, 150,
+ 163, 169, 167, 168, 170, 150, 150, 167, 168, 171,
+ 172, 173, 174, 167, 171, 172, 173, 174, 176, 175,
+ 177, 178, 179, 180, 176, 170, 175, 178, 181, 183,
+ 182, 180, 184, 181, 185, 186, 187, 184, 185, 189,
+ 177, 188, 192, 134, 179, 182, 188, 192, 190, 183,
+ 190, 191, 194, 199, 187, 187, 200, 186, 191, 189,
+ 195, 195, 196, 197, 194, 199, 201, 196, 197, 198,
+ 205, 198, 202, 203, 201, 200, 204, 202, 203, 206,
+ 208, 207, 132, 209, 205, 196, 209, 211, 198, 207,
+
+ 211, 204, 210, 210, 212, 212, 214, 206, 213, 213,
+ 215, 216, 217, 219, 216, 208, 217, 218, 219, 220,
+ 221, 221, 214, 222, 223, 215, 218, 224, 222, 223,
+ 225, 226, 227, 220, 228, 228, 229, 230, 231, 232,
+ 234, 230, 236, 234, 233, 227, 235, 224, 225, 233,
+ 238, 232, 226, 238, 229, 237, 231, 239, 235, 236,
+ 240, 244, 236, 241, 237, 241, 241, 242, 242, 245,
+ 239, 238, 240, 243, 246, 250, 243, 248, 244, 247,
+ 247, 244, 248, 246, 245, 249, 249, 251, 252, 253,
+ 250, 254, 255, 256, 253, 258, 259, 255, 256, 251,
+
+ 257, 260, 261, 257, 263, 257, 264, 261, 252, 258,
+ 260, 254, 259, 262, 265, 259, 266, 259, 262, 267,
+ 268, 270, 267, 271, 272, 263, 264, 273, 274, 265,
+ 266, 131, 271, 279, 268, 276, 270, 275, 267, 269,
+ 276, 269, 269, 274, 277, 272, 273, 278, 279, 282,
+ 280, 269, 283, 269, 269, 269, 281, 275, 269, 285,
+ 291, 281, 288, 284, 277, 280, 283, 278, 284, 282,
+ 289, 286, 290, 294, 291, 285, 286, 287, 287, 292,
+ 287, 292, 288, 293, 295, 296, 289, 293, 290, 299,
+ 297, 294, 298, 299, 296, 300, 301, 298, 295, 297,
+
+ 302, 301, 304, 304, 300, 303, 302, 296, 305, 303,
+ 306, 307, 307, 305, 308, 309, 310, 311, 312, 308,
+ 313, 314, 314, 306, 313, 310, 315, 316, 320, 311,
+ 312, 315, 317, 317, 319, 319, 309, 321, 322, 323,
+ 325, 326, 327, 328, 334, 321, 330, 322, 316, 320,
+ 329, 323, 328, 331, 330, 329, 327, 333, 331, 332,
+ 325, 326, 332, 335, 336, 337, 334, 338, 336, 339,
+ 340, 343, 338, 342, 345, 333, 344, 345, 348, 346,
+ 337, 344, 347, 347, 335, 339, 344, 343, 351, 340,
+ 341, 341, 350, 342, 349, 349, 341, 352, 341, 346,
+
+ 351, 353, 354, 348, 355, 356, 341, 350, 357, 355,
+ 358, 359, 352, 360, 356, 359, 341, 361, 360, 362,
+ 353, 363, 364, 364, 354, 358, 365, 357, 366, 361,
+ 367, 365, 368, 369, 363, 368, 370, 362, 371, 370,
+ 366, 372, 367, 373, 380, 372, 372, 462, 369, 374,
+ 374, 375, 375, 376, 371, 462, 373, 371, 376, 377,
+ 377, 378, 378, 379, 381, 380, 382, 383, 379, 381,
+ 382, 384, 383, 385, 386, 384, 387, 388, 385, 389,
+ 390, 387, 388, 390, 391, 391, 392, 393, 390, 395,
+ 394, 129, 390, 389, 386, 394, 396, 399, 395, 396,
+
+ 398, 393, 397, 400, 392, 398, 397, 401, 400, 402,
+ 399, 403, 404, 405, 409, 406, 401, 404, 406, 405,
+ 410, 407, 408, 403, 407, 402, 411, 408, 397, 127,
+ 412, 411, 409, 412, 410, 413, 415, 414, 416, 417,
+ 413, 414, 414, 416, 418, 419, 420, 418, 417, 415,
+ 420, 420, 421, 422, 421, 424, 423, 419, 423, 425,
+ 426, 427, 418, 428, 431, 429, 433, 428, 430, 432,
+ 434, 433, 422, 424, 429, 435, 435, 425, 439, 426,
+ 438, 427, 431, 430, 432, 438, 436, 440, 441, 434,
+ 436, 442, 443, 444, 439, 447, 448, 443, 442, 445,
+
+ 444, 441, 446, 448, 445, 449, 440, 446, 450, 452,
+ 451, 454, 452, 447, 449, 451, 453, 455, 455, 457,
+ 453, 459, 450, 458, 460, 459, 455, 461, 458, 463,
+ 464, 467, 454, 473, 474, 475, 460, 480, 457, 475,
+ 474, 479, 473, 476, 478, 461, 467, 463, 476, 478,
+ 481, 482, 482, 481, 485, 464, 465, 483, 125, 479,
+ 487, 465, 480, 487, 483, 465, 484, 484, 465, 485,
+ 486, 486, 488, 489, 490, 465, 491, 488, 465, 477,
+ 477, 477, 492, 477, 493, 493, 477, 494, 495, 528,
+ 492, 477, 489, 528, 490, 491, 496, 477, 477, 497,
+
+ 497, 496, 494, 498, 499, 500, 495, 502, 498, 499,
+ 500, 501, 503, 502, 501, 504, 505, 506, 507, 510,
+ 503, 509, 506, 504, 510, 507, 508, 508, 511, 509,
+ 513, 515, 514, 517, 505, 514, 516, 516, 521, 513,
+ 518, 519, 523, 525, 519, 515, 522, 511, 517, 518,
+ 524, 522, 519, 526, 529, 527, 530, 531, 534, 521,
+ 532, 533, 535, 523, 527, 525, 531, 533, 539, 542,
+ 524, 540, 529, 526, 532, 530, 535, 536, 534, 537,
+ 546, 538, 536, 540, 537, 538, 541, 539, 543, 543,
+ 542, 541, 544, 545, 547, 548, 545, 544, 546, 549,
+
+ 548, 550, 550, 551, 551, 552, 553, 547, 554, 555,
+ 553, 556, 559, 557, 560, 562, 559, 561, 563, 549,
+ 552, 67, 564, 563, 566, 556, 567, 554, 566, 560,
+ 562, 565, 568, 555, 557, 558, 564, 568, 558, 570,
+ 558, 567, 561, 569, 558, 565, 558, 568, 569, 571,
+ 572, 558, 573, 570, 574, 576, 558, 577, 573, 574,
+ 575, 575, 577, 578, 572, 583, 575, 576, 575, 579,
+ 571, 580, 580, 581, 582, 584, 586, 578, 581, 583,
+ 586, 579, 582, 585, 585, 588, 575, 590, 589, 591,
+ 588, 589, 592, 593, 584, 594, 595, 592, 596, 597,
+
+ 598, 599, 591, 601, 597, 595, 590, 600, 601, 603,
+ 604, 594, 593, 605, 607, 599, 600, 596, 606, 607,
+ 598, 608, 609, 603, 618, 610, 608, 609, 61, 604,
+ 617, 605, 612, 606, 610, 611, 611, 612, 614, 618,
+ 615, 615, 614, 614, 615, 616, 619, 621, 616, 620,
+ 617, 622, 620, 623, 624, 625, 622, 626, 623, 624,
+ 630, 625, 629, 627, 628, 628, 619, 631, 621, 627,
+ 631, 629, 632, 626, 633, 634, 635, 636, 630, 637,
+ 638, 640, 636, 639, 637, 641, 639, 644, 646, 635,
+ 632, 642, 640, 633, 643, 634, 642, 641, 638, 643,
+
+ 645, 645, 644, 647, 648, 649, 650, 646, 652, 649,
+ 651, 653, 656, 657, 658, 659, 648, 647, 660, 651,
+ 659, 663, 666, 660, 650, 662, 656, 652, 657, 661,
+ 662, 661, 664, 665, 658, 663, 653, 666, 665, 667,
+ 668, 669, 670, 670, 671, 672, 664, 673, 674, 674,
+ 677, 672, 675, 678, 676, 668, 678, 675, 667, 679,
+ 669, 676, 671, 680, 677, 681, 682, 673, 683, 684,
+ 681, 685, 680, 683, 686, 685, 687, 679, 688, 689,
+ 690, 691, 692, 686, 693, 682, 689, 696, 684, 694,
+ 695, 687, 690, 688, 699, 694, 700, 697, 702, 699,
+
+ 691, 701, 693, 692, 705, 695, 697, 696, 703, 701,
+ 700, 704, 707, 703, 714, 704, 704, 708, 702, 706,
+ 706, 56, 709, 705, 718, 707, 708, 709, 710, 710,
+ 711, 712, 713, 713, 714, 711, 712, 715, 716, 717,
+ 719, 728, 718, 716, 720, 719, 715, 721, 723, 720,
+ 722, 726, 721, 717, 722, 726, 724, 723, 727, 728,
+ 730, 731, 723, 732, 723, 729, 723, 724, 733, 729,
+ 729, 732, 734, 727, 730, 735, 736, 737, 737, 738,
+ 731, 743, 733, 739, 739, 741, 734, 742, 741, 744,
+ 744, 745, 742, 735, 738, 746, 746, 747, 748, 748,
+
+ 743, 736, 747, 749, 750, 751, 754, 752, 51, 750,
+ 755, 745, 752, 751, 753, 753, 755, 758, 756, 763,
+ 762, 759, 758, 749, 754, 756, 759, 760, 761, 762,
+ 764, 766, 760, 761, 765, 765, 767, 768, 763, 771,
+ 769, 764, 768, 770, 772, 773, 773, 774, 775, 777,
+ 776, 766, 778, 771, 777, 782, 779, 785, 783, 767,
+ 769, 779, 772, 770, 782, 781, 783, 774, 776, 781,
+ 781, 785, 784, 775, 784, 778, 786, 788, 787, 789,
+ 790, 786, 787, 791, 792, 793, 795, 794, 788, 792,
+ 795, 796, 797, 803, 798, 799, 801, 800, 789, 802,
+
+ 803, 791, 805, 793, 802, 806, 790, 794, 798, 796,
+ 799, 797, 800, 804, 806, 801, 807, 808, 804, 809,
+ 805, 810, 811, 808, 812, 816, 810, 811, 818, 812,
+ 819, 807, 813, 813, 815, 815, 817, 821, 821, 822,
+ 809, 817, 818, 816, 823, 825, 820, 824, 826, 819,
+ 820, 820, 824, 827, 829, 828, 830, 831, 822, 827,
+ 828, 832, 834, 823, 833, 837, 835, 826, 836, 836,
+ 837, 825, 839, 829, 843, 830, 831, 50, 833, 840,
+ 832, 835, 838, 834, 847, 839, 838, 841, 840, 841,
+ 844, 844, 845, 841, 843, 846, 848, 845, 849, 846,
+
+ 851, 864, 853, 849, 847, 855, 841, 853, 854, 854,
+ 855, 857, 857, 859, 859, 863, 848, 861, 851, 865,
+ 861, 862, 862, 866, 867, 869, 864, 871, 866, 872,
+ 863, 868, 868, 865, 870, 870, 874, 873, 875, 867,
+ 872, 873, 877, 875, 878, 869, 879, 879, 880, 871,
+ 881, 882, 883, 887, 893, 874, 882, 884, 878, 884,
+ 877, 885, 886, 889, 888, 891, 885, 886, 880, 888,
+ 881, 891, 883, 887, 890, 890, 895, 889, 893, 894,
+ 894, 896, 902, 900, 897, 45, 898, 897, 895, 899,
+ 897, 898, 900, 901, 899, 904, 903, 906, 901, 903,
+
+ 904, 896, 897, 905, 905, 907, 908, 902, 909, 910,
+ 911, 912, 915, 909, 910, 906, 912, 913, 913, 916,
+ 914, 917, 918, 919, 907, 914, 908, 920, 922, 921,
+ 915, 923, 924, 911, 921, 919, 918, 926, 928, 916,
+ 920, 917, 926, 927, 930, 928, 935, 929, 922, 933,
+ 933, 923, 934, 924, 937, 934, 929, 936, 927, 929,
+ 930, 939, 936, 938, 940, 935, 941, 943, 943, 942,
+ 937, 944, 938, 940, 942, 941, 940, 945, 946, 947,
+ 939, 948, 949, 950, 950, 951, 954, 952, 953, 953,
+ 945, 944, 952, 947, 955, 954, 946, 957, 954, 958,
+
+ 949, 951, 957, 953, 959, 960, 948, 961, 962, 959,
+ 960, 963, 955, 961, 964, 965, 963, 958, 965, 969,
+ 970, 968, 971, 973, 965, 972, 974, 964, 962, 968,
+ 972, 976, 969, 977, 982, 978, 981, 977, 970, 973,
+ 978, 971, 979, 980, 974, 981, 983, 979, 980, 984,
+ 984, 976, 985, 986, 988, 987, 990, 982, 989, 991,
+ 997, 983, 40, 989, 992, 986, 985, 987, 990, 997,
+ 992, 993, 993, 994, 988, 999, 994, 991, 995, 995,
+ 998, 998, 1001, 1000, 1002, 1003, 1005, 999, 1000, 1004,
+ 1006, 1001, 1007, 1010, 1004, 1005, 1002, 1008, 1008, 1009,
+
+ 1003, 1011, 1012, 1014, 1009, 1013, 1013, 1007, 1005, 1017,
+ 1006, 1015, 1015, 1017, 1010, 1016, 1016, 1022, 1019, 1018,
+ 1011, 1019, 1012, 1014, 1018, 1021, 1023, 1024, 1025, 1025,
+ 1021, 1023, 1026, 1026, 1027, 1022, 1028, 1029, 1030, 1027,
+ 1031, 1033, 1032, 1034, 1034, 1035, 1036, 1036, 1028, 1028,
+ 1028, 1040, 1024, 1037, 1039, 1028, 1032, 1029, 1030, 1042,
+ 1031, 1043, 1033, 1039, 1041, 1041, 1044, 1045, 1043, 1046,
+ 1046, 1035, 1040, 1037, 1042, 1044, 1047, 1050, 1048, 1051,
+ 1052, 1053, 1050, 1057, 1051, 1054, 1054, 1055, 1053, 1056,
+ 1060, 1061, 1055, 1045, 1048, 1058, 1059, 1063, 1056, 1059,
+
+ 1052, 1064, 1047, 1057, 1062, 1062, 1065, 1058, 1060, 1066,
+ 1067, 1072, 1063, 1068, 1069, 1069, 1067, 1061, 1070, 1073,
+ 1064, 1065, 1068, 1071, 1071, 1074, 1075, 1075, 1066, 1070,
+ 1074, 1076, 1072, 1073, 1070, 1076, 1076, 1077, 1078, 1079,
+ 1080, 1081, 1077, 1082, 1083, 1080, 1084, 1082, 1086, 1085,
+ 1087, 1079, 14, 1081, 1085, 1087, 1083, 1088, 1090, 1091,
+ 1091, 1090, 1092, 1092, 1078, 1104, 1104, 1093, 1094, 1088,
+ 1086, 1084, 1093, 1095, 1094, 1096, 1097, 1099, 1095, 1101,
+ 1103, 1096, 1099, 1105, 1106, 1097, 1107, 1108, 1112, 1115,
+ 1109, 1101, 1103, 1106, 1109, 1110, 1111, 1114, 1114, 1116,
+
+ 1110, 1111, 1112, 1105, 1107, 1117, 1108, 1115, 1116, 1114,
+ 1119, 1119, 1122, 1124, 1117, 1123, 1125, 1131, 1124, 1126,
+ 1126, 1127, 1134, 1127, 1128, 1128, 1135, 1122, 1130, 1123,
+ 1132, 1132, 1133, 1125, 1136, 1130, 1137, 1131, 1135, 1138,
+ 1139, 1133, 1140, 1134, 1142, 1143, 1136, 1143, 1137, 1142,
+ 1144, 1146, 1145, 1146, 1138, 1148, 1149, 1149, 1150, 1151,
+ 1139, 1145, 1140, 1152, 1151, 1152, 1153, 1154, 1144, 1148,
+ 1155, 1153, 1154, 1156, 1157, 1158, 1160, 1161, 1168, 1157,
+ 1158, 1162, 1162, 1163, 1150, 1164, 1171, 1165, 1155, 1166,
+ 1168, 1161, 1165, 1156, 1166, 1160, 1173, 1167, 1163, 1167,
+
+ 1169, 1170, 1172, 1170, 1178, 1164, 1179, 1171, 1173, 1169,
+ 1175, 1172, 1169, 1176, 1180, 1175, 1182, 1178, 1176, 1184,
+ 1185, 1186, 1182, 1187, 1189, 1184, 1179, 1188, 1188, 1191,
+ 1180, 13, 1187, 1189, 1192, 1185, 1190, 1190, 1192, 1193,
+ 1194, 1195, 1195, 1196, 1193, 1199, 1186, 1200, 1191, 1201,
+ 1201, 1196, 1203, 1194, 1202, 1202, 1200, 1204, 1205, 1208,
+ 1199, 1206, 1206, 1205, 1203, 1209, 1210, 1211, 1212, 1213,
+ 1209, 1217, 1214, 1212, 1216, 1204, 1215, 1215, 1216, 1219,
+ 1218, 1220, 1211, 1222, 1208, 1218, 1217, 1213, 1214, 1210,
+ 1223, 1224, 1225, 0, 1227, 1226, 1229, 1229, 1230, 1231,
+
+ 1220, 1230, 1232, 0, 1233, 1219, 1222, 1226, 1234, 1234,
+ 1224, 1237, 1231, 1225, 1223, 1227, 1232, 1233, 1235, 1235,
+ 1236, 1236, 1238, 1238, 1237, 1239, 1239, 1240, 1240, 1241,
+ 1242, 1242, 1243, 1243, 1245, 1244, 1247, 1248, 1248, 1249,
+ 1252, 1247, 1250, 1250, 1251, 1256, 1252, 1253, 1241, 1244,
+ 1253, 1254, 1254, 1245, 1255, 1255, 1257, 1257, 1249, 1259,
+ 1260, 1261, 1251, 1265, 1256, 1261, 1263, 1254, 1262, 1262,
+ 1264, 1264, 1266, 1266, 1267, 1260, 1268, 1271, 1268, 1269,
+ 1272, 1270, 1259, 1267, 1273, 1263, 1270, 1274, 1275, 1265,
+ 1276, 1269, 1274, 1272, 1278, 1277, 1279, 1282, 1284, 1276,
+
+ 0, 1279, 1271, 1275, 1277, 1273, 1280, 1284, 1278, 1286,
+ 1280, 1285, 1285, 1289, 1286, 1287, 1287, 1282, 1290, 1291,
+ 1293, 1294, 1295, 1293, 1287, 1299, 1294, 1302, 1289, 1296,
+ 1296, 1291, 1298, 1298, 1290, 1300, 1300, 1301, 1303, 1299,
+ 1310, 1302, 1295, 1304, 1304, 1307, 1306, 1311, 1307, 1301,
+ 1306, 1308, 1308, 1309, 1313, 1312, 1318, 1303, 1309, 1312,
+ 1310, 1311, 1314, 1315, 1316, 0, 1319, 1314, 1315, 1321,
+ 1316, 1319, 1318, 1320, 1313, 1325, 1325, 1321, 1320, 1322,
+ 1332, 1322, 1329, 1329, 1333, 1332, 1334, 1334, 1338, 1333,
+ 1336, 1336, 1340, 1338, 1339, 1339, 1341, 1342, 1344, 1344,
+
+ 1346, 1347, 1342, 1350, 1350, 1346, 1348, 1352, 1340, 1353,
+ 1354, 1353, 1352, 1355, 1361, 1356, 1357, 1357, 1341, 1347,
+ 1356, 1348, 1358, 1358, 1354, 1359, 1359, 1355, 1360, 1362,
+ 1363, 1364, 1361, 1365, 1366, 1367, 1367, 1368, 1365, 1369,
+ 1360, 1362, 1363, 1364, 1370, 1371, 1368, 1372, 1373, 1374,
+ 1375, 1376, 1377, 1375, 1366, 1382, 1376, 1377, 1371, 1378,
+ 1378, 1383, 1373, 1384, 1370, 1369, 1385, 1374, 1379, 1379,
+ 1387, 1372, 1386, 1388, 1394, 1382, 1389, 1389, 1392, 1383,
+ 1395, 1386, 1391, 1391, 1396, 1384, 1385, 1392, 1393, 1394,
+ 1387, 1388, 1397, 1398, 1400, 1393, 1399, 1399, 1395, 1400,
+
+ 1401, 1402, 1396, 1403, 1404, 1406, 1413, 1407, 1397, 1410,
+ 1411, 0, 1398, 1411, 1412, 1412, 1402, 1414, 1401, 1416,
+ 1418, 1413, 1403, 1416, 1404, 1406, 1407, 1417, 1417, 1410,
+ 1420, 1420, 1421, 1418, 1423, 1414, 1422, 1422, 1429, 1423,
+ 1424, 1424, 1428, 1428, 1430, 1431, 1433, 1432, 1434, 1436,
+ 1431, 1421, 1432, 1430, 1437, 1439, 1434, 1438, 1442, 1437,
+ 1429, 1443, 1438, 1442, 1436, 1433, 1440, 1440, 1441, 1441,
+ 1439, 1444, 1444, 1445, 1445, 1448, 1443, 1449, 1450, 1451,
+ 1448, 1449, 1452, 1450, 1453, 1454, 1455, 1458, 1451, 1459,
+ 1454, 1457, 1453, 1466, 1457, 1460, 1465, 1452, 1455, 1461,
+
+ 1462, 1462, 1459, 1463, 1460, 1458, 1467, 1469, 1461, 1468,
+ 1468, 1476, 1463, 1466, 1470, 1465, 1469, 1471, 1471, 1470,
+ 1472, 1473, 1475, 1477, 1476, 1467, 1473, 1483, 1472, 1479,
+ 1479, 1475, 1481, 1481, 1485, 1486, 1486, 1487, 1477, 1491,
+ 1487, 1488, 1488, 1489, 1489, 1490, 1490, 1483, 1492, 1495,
+ 1493, 1494, 1494, 1495, 1485, 1493, 1499, 1491, 1498, 1502,
+ 1499, 1503, 1492, 1504, 1498, 1505, 1503, 1508, 1506, 1507,
+ 1507, 1509, 1510, 1511, 1511, 1514, 1502, 1502, 1513, 1509,
+ 1514, 1504, 1506, 1512, 1512, 1505, 1508, 1515, 1516, 1517,
+ 1518, 1510, 1519, 1521, 1513, 1522, 1521, 1524, 1517, 1525,
+
+ 1525, 1526, 1527, 1528, 1522, 1526, 1534, 1515, 1529, 1533,
+ 1518, 1527, 1519, 1532, 1516, 1524, 1528, 1529, 1531, 1531,
+ 1538, 1533, 1532, 1539, 1539, 1538, 1540, 1542, 1543, 1544,
+ 1545, 1534, 1542, 1546, 1544, 1540, 1547, 1543, 1546, 1548,
+ 1549, 1550, 1550, 1552, 1548, 1553, 1554, 1554, 1555, 1556,
+ 1557, 1545, 1555, 1558, 1547, 1559, 1560, 1561, 1556, 1563,
+ 1553, 1560, 1552, 1559, 1565, 1549, 1557, 1562, 1562, 1564,
+ 1564, 1566, 1558, 1568, 1568, 1569, 1566, 1571, 1563, 1573,
+ 1565, 1570, 1570, 1561, 1574, 1574, 1575, 1575, 1576, 1578,
+ 1577, 1571, 1579, 1579, 1580, 1569, 1581, 1581, 1582, 1583,
+
+ 1584, 1573, 1577, 1582, 1585, 1584, 1580, 1576, 1589, 1578,
+ 1586, 1586, 1588, 1588, 1591, 1592, 1594, 1594, 1583, 1591,
+ 1593, 1585, 1585, 1595, 1595, 1593, 1601, 1589, 1597, 1592,
+ 1596, 1596, 1605, 1597, 1599, 1599, 1602, 1602, 1604, 1604,
+ 1607, 1605, 1606, 1606, 1610, 1607, 1611, 1611, 1601, 1612,
+ 1614, 1616, 1610, 1618, 1612, 1614, 1617, 1619, 1620, 1623,
+ 1624, 1624, 1626, 1620, 1625, 1625, 1626, 1630, 1630, 1616,
+ 1618, 1618, 1617, 1632, 1632, 1635, 1632, 1633, 1619, 1623,
+ 1638, 1633, 1637, 1637, 1640, 1641, 1641, 1642, 1643, 1635,
+ 1644, 1645, 1646, 0, 1647, 1638, 1645, 1646, 1648, 1648,
+
+ 1651, 1651, 1640, 1643, 1653, 1653, 1654, 1654, 1655, 1655,
+ 1658, 1644, 1642, 1647, 1656, 1656, 1659, 1659, 1661, 1662,
+ 1663, 1664, 1658, 1661, 1665, 1663, 1673, 1666, 1674, 1677,
+ 1673, 1675, 1676, 1662, 1678, 1679, 1682, 1680, 1681, 1681,
+ 1664, 1683, 1665, 1666, 1675, 1682, 1683, 1677, 1674, 1684,
+ 1678, 1676, 1680, 1685, 1684, 1686, 1687, 1688, 1690, 1692,
+ 1679, 1687, 1691, 1693, 1692, 1694, 1696, 1695, 1693, 1697,
+ 1686, 1688, 1698, 1690, 1699, 1700, 1701, 1702, 1685, 1694,
+ 1695, 1691, 1702, 1697, 1703, 1696, 1704, 1699, 1700, 1703,
+ 1709, 1698, 1705, 1705, 1706, 1701, 1707, 1708, 1710, 1706,
+
+ 1713, 1707, 1708, 1710, 1712, 1704, 1711, 1711, 1714, 1709,
+ 1715, 1712, 1716, 1717, 1720, 1715, 1719, 1721, 1725, 1713,
+ 1724, 1719, 1722, 1723, 1723, 1724, 1717, 1714, 1726, 1726,
+ 1730, 1716, 0, 1720, 1729, 1722, 1721, 1725, 1727, 1727,
+ 1728, 1729, 1731, 1731, 1732, 1728, 1733, 1734, 1736, 1730,
+ 1735, 1732, 1738, 1733, 1739, 1735, 1740, 1738, 1741, 1739,
+ 1742, 1742, 1743, 1744, 1745, 1745, 1734, 1736, 1746, 1746,
+ 0, 1747, 1748, 1748, 1756, 1740, 1750, 1741, 1747, 1749,
+ 1749, 1743, 1744, 1750, 1752, 1755, 1757, 1758, 1758, 1752,
+ 1755, 1759, 1759, 1756, 0, 0, 0, 0, 0, 0,
+
+ 0, 0, 0, 0, 0, 1757, 1763, 1763, 1763, 1763,
+ 1763, 1763, 1763, 1764, 1764, 1764, 1764, 1764, 1764, 1764,
+ 1765, 1765, 1765, 1765, 1765, 1765, 1765, 1766, 1766, 1766,
+ 1766, 1766, 1766, 1766, 1767, 1767, 1767, 1767, 1767, 1767,
+ 1767, 1769, 1769, 0, 1769, 1769, 1769, 1769, 1770, 1770,
+ 0, 0, 0, 1770, 1770, 1771, 1771, 0, 0, 1771,
+ 0, 1771, 1772, 0, 0, 0, 0, 0, 1772, 1773,
+ 1773, 0, 0, 0, 1773, 1773, 1774, 0, 0, 0,
+ 0, 0, 1774, 1775, 1775, 0, 1775, 1775, 1775, 1775,
+ 1776, 1776, 0, 1776, 1776, 1776, 1776, 1762, 1762, 1762,
+
+ 1762, 1762, 1762, 1762, 1762, 1762, 1762, 1762, 1762, 1762,
+ 1762, 1762, 1762, 1762, 1762, 1762, 1762, 1762, 1762, 1762,
+ 1762, 1762, 1762, 1762, 1762, 1762, 1762, 1762, 1762, 1762,
+ 1762, 1762, 1762, 1762, 1762, 1762, 1762
} ;
static yy_state_type yy_last_accepting_state;
* See LICENSE for the license.
*
*/
-
#include <ctype.h>
#include <string.h>
#include <strings.h>
#endif
#define YY_NO_INPUT 1
-#line 178 "./util/configlexer.lex"
+#line 177 "./util/configlexer.lex"
#ifndef YY_NO_UNPUT
#define YY_NO_UNPUT 1
#endif
#define YY_NO_INPUT 1
#endif
-#line 1762 "<stdout>"
+#line 2003 "<stdout>"
#define INITIAL 0
#define quotedstring 1
}
{
-#line 198 "./util/configlexer.lex"
+#line 197 "./util/configlexer.lex"
-#line 1981 "<stdout>"
+#line 2222 "<stdout>"
while ( 1 ) /* loops until end-of-file is reached */
{
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 1441 )
+ if ( yy_current_state >= 1763 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp;
}
- while ( yy_base[yy_current_state] != 2876 );
+ while ( yy_base[yy_current_state] != 3498 );
yy_find_action:
yy_act = yy_accept[yy_current_state];
case 1:
YY_RULE_SETUP
-#line 199 "./util/configlexer.lex"
+#line 198 "./util/configlexer.lex"
{
LEXOUT(("SP ")); /* ignore */ }
YY_BREAK
case 2:
YY_RULE_SETUP
-#line 201 "./util/configlexer.lex"
+#line 200 "./util/configlexer.lex"
{
/* note that flex makes the longest match and '.' is any but not nl */
LEXOUT(("comment(%s) ", yytext)); /* ignore */ }
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 204 "./util/configlexer.lex"
+#line 203 "./util/configlexer.lex"
{ YDVAR(0, VAR_SERVER) }
YY_BREAK
case 4:
YY_RULE_SETUP
-#line 205 "./util/configlexer.lex"
+#line 204 "./util/configlexer.lex"
{ YDVAR(1, VAR_NUM_THREADS) }
YY_BREAK
case 5:
YY_RULE_SETUP
-#line 206 "./util/configlexer.lex"
+#line 205 "./util/configlexer.lex"
{ YDVAR(1, VAR_VERBOSITY) }
YY_BREAK
case 6:
YY_RULE_SETUP
-#line 207 "./util/configlexer.lex"
+#line 206 "./util/configlexer.lex"
{ YDVAR(1, VAR_PORT) }
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 208 "./util/configlexer.lex"
+#line 207 "./util/configlexer.lex"
{ YDVAR(1, VAR_OUTGOING_RANGE) }
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 209 "./util/configlexer.lex"
+#line 208 "./util/configlexer.lex"
{ YDVAR(1, VAR_OUTGOING_PORT_PERMIT) }
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 210 "./util/configlexer.lex"
+#line 209 "./util/configlexer.lex"
{ YDVAR(1, VAR_OUTGOING_PORT_AVOID) }
YY_BREAK
case 10:
YY_RULE_SETUP
-#line 211 "./util/configlexer.lex"
+#line 210 "./util/configlexer.lex"
{ YDVAR(1, VAR_OUTGOING_NUM_TCP) }
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 212 "./util/configlexer.lex"
+#line 211 "./util/configlexer.lex"
{ YDVAR(1, VAR_INCOMING_NUM_TCP) }
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 213 "./util/configlexer.lex"
+#line 212 "./util/configlexer.lex"
{ YDVAR(1, VAR_DO_IP4) }
YY_BREAK
case 13:
YY_RULE_SETUP
-#line 214 "./util/configlexer.lex"
+#line 213 "./util/configlexer.lex"
{ YDVAR(1, VAR_DO_IP6) }
YY_BREAK
case 14:
YY_RULE_SETUP
-#line 215 "./util/configlexer.lex"
+#line 214 "./util/configlexer.lex"
{ YDVAR(1, VAR_DO_UDP) }
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 216 "./util/configlexer.lex"
+#line 215 "./util/configlexer.lex"
{ YDVAR(1, VAR_DO_TCP) }
YY_BREAK
case 16:
YY_RULE_SETUP
-#line 217 "./util/configlexer.lex"
+#line 216 "./util/configlexer.lex"
{ YDVAR(1, VAR_TCP_UPSTREAM) }
YY_BREAK
case 17:
YY_RULE_SETUP
-#line 218 "./util/configlexer.lex"
+#line 217 "./util/configlexer.lex"
{ YDVAR(1, VAR_SSL_UPSTREAM) }
YY_BREAK
case 18:
YY_RULE_SETUP
-#line 219 "./util/configlexer.lex"
+#line 218 "./util/configlexer.lex"
{ YDVAR(1, VAR_SSL_SERVICE_KEY) }
YY_BREAK
case 19:
YY_RULE_SETUP
-#line 220 "./util/configlexer.lex"
+#line 219 "./util/configlexer.lex"
{ YDVAR(1, VAR_SSL_SERVICE_PEM) }
YY_BREAK
case 20:
YY_RULE_SETUP
-#line 221 "./util/configlexer.lex"
+#line 220 "./util/configlexer.lex"
{ YDVAR(1, VAR_SSL_PORT) }
YY_BREAK
case 21:
YY_RULE_SETUP
-#line 222 "./util/configlexer.lex"
+#line 221 "./util/configlexer.lex"
{ YDVAR(1, VAR_DO_DAEMONIZE) }
YY_BREAK
case 22:
YY_RULE_SETUP
-#line 223 "./util/configlexer.lex"
+#line 222 "./util/configlexer.lex"
{ YDVAR(1, VAR_INTERFACE) }
YY_BREAK
case 23:
YY_RULE_SETUP
-#line 224 "./util/configlexer.lex"
+#line 223 "./util/configlexer.lex"
{ YDVAR(1, VAR_INTERFACE) }
YY_BREAK
case 24:
YY_RULE_SETUP
-#line 225 "./util/configlexer.lex"
+#line 224 "./util/configlexer.lex"
{ YDVAR(1, VAR_OUTGOING_INTERFACE) }
YY_BREAK
case 25:
YY_RULE_SETUP
-#line 226 "./util/configlexer.lex"
+#line 225 "./util/configlexer.lex"
{ YDVAR(1, VAR_INTERFACE_AUTOMATIC) }
YY_BREAK
case 26:
YY_RULE_SETUP
-#line 227 "./util/configlexer.lex"
+#line 226 "./util/configlexer.lex"
{ YDVAR(1, VAR_SO_RCVBUF) }
YY_BREAK
case 27:
YY_RULE_SETUP
-#line 228 "./util/configlexer.lex"
+#line 227 "./util/configlexer.lex"
{ YDVAR(1, VAR_SO_SNDBUF) }
YY_BREAK
case 28:
YY_RULE_SETUP
-#line 229 "./util/configlexer.lex"
+#line 228 "./util/configlexer.lex"
{ YDVAR(1, VAR_SO_REUSEPORT) }
YY_BREAK
case 29:
YY_RULE_SETUP
+#line 229 "./util/configlexer.lex"
+{ YDVAR(1, VAR_IP_TRANSPARENT) }
+ YY_BREAK
+case 30:
+YY_RULE_SETUP
#line 230 "./util/configlexer.lex"
{ YDVAR(1, VAR_CHROOT) }
YY_BREAK
-case 30:
+case 31:
YY_RULE_SETUP
#line 231 "./util/configlexer.lex"
{ YDVAR(1, VAR_USERNAME) }
YY_BREAK
-case 31:
+case 32:
YY_RULE_SETUP
#line 232 "./util/configlexer.lex"
{ YDVAR(1, VAR_DIRECTORY) }
YY_BREAK
-case 32:
+case 33:
YY_RULE_SETUP
#line 233 "./util/configlexer.lex"
{ YDVAR(1, VAR_LOGFILE) }
YY_BREAK
-case 33:
+case 34:
YY_RULE_SETUP
#line 234 "./util/configlexer.lex"
{ YDVAR(1, VAR_PIDFILE) }
YY_BREAK
-case 34:
+case 35:
YY_RULE_SETUP
#line 235 "./util/configlexer.lex"
{ YDVAR(1, VAR_ROOT_HINTS) }
YY_BREAK
-case 35:
+case 36:
YY_RULE_SETUP
#line 236 "./util/configlexer.lex"
{ YDVAR(1, VAR_EDNS_BUFFER_SIZE) }
YY_BREAK
-case 36:
+case 37:
YY_RULE_SETUP
#line 237 "./util/configlexer.lex"
{ YDVAR(1, VAR_MSG_BUFFER_SIZE) }
YY_BREAK
-case 37:
+case 38:
YY_RULE_SETUP
#line 238 "./util/configlexer.lex"
{ YDVAR(1, VAR_MSG_CACHE_SIZE) }
YY_BREAK
-case 38:
+case 39:
YY_RULE_SETUP
#line 239 "./util/configlexer.lex"
{ YDVAR(1, VAR_MSG_CACHE_SLABS) }
YY_BREAK
-case 39:
+case 40:
YY_RULE_SETUP
#line 240 "./util/configlexer.lex"
{ YDVAR(1, VAR_RRSET_CACHE_SIZE) }
YY_BREAK
-case 40:
+case 41:
YY_RULE_SETUP
#line 241 "./util/configlexer.lex"
{ YDVAR(1, VAR_RRSET_CACHE_SLABS) }
YY_BREAK
-case 41:
+case 42:
YY_RULE_SETUP
#line 242 "./util/configlexer.lex"
{ YDVAR(1, VAR_CACHE_MAX_TTL) }
YY_BREAK
-case 42:
+case 43:
YY_RULE_SETUP
#line 243 "./util/configlexer.lex"
{ YDVAR(1, VAR_CACHE_MIN_TTL) }
YY_BREAK
-case 43:
+case 44:
YY_RULE_SETUP
#line 244 "./util/configlexer.lex"
{ YDVAR(1, VAR_INFRA_HOST_TTL) }
YY_BREAK
-case 44:
+case 45:
YY_RULE_SETUP
#line 245 "./util/configlexer.lex"
{ YDVAR(1, VAR_INFRA_LAME_TTL) }
YY_BREAK
-case 45:
+case 46:
YY_RULE_SETUP
#line 246 "./util/configlexer.lex"
{ YDVAR(1, VAR_INFRA_CACHE_SLABS) }
YY_BREAK
-case 46:
+case 47:
YY_RULE_SETUP
#line 247 "./util/configlexer.lex"
{ YDVAR(1, VAR_INFRA_CACHE_NUMHOSTS) }
YY_BREAK
-case 47:
+case 48:
YY_RULE_SETUP
#line 248 "./util/configlexer.lex"
{ YDVAR(1, VAR_INFRA_CACHE_LAME_SIZE) }
YY_BREAK
-case 48:
+case 49:
YY_RULE_SETUP
#line 249 "./util/configlexer.lex"
-{ YDVAR(1, VAR_NUM_QUERIES_PER_THREAD) }
+{ YDVAR(1, VAR_INFRA_CACHE_MIN_RTT) }
YY_BREAK
-case 49:
+case 50:
YY_RULE_SETUP
#line 250 "./util/configlexer.lex"
-{ YDVAR(1, VAR_JOSTLE_TIMEOUT) }
+{ YDVAR(1, VAR_NUM_QUERIES_PER_THREAD) }
YY_BREAK
-case 50:
+case 51:
YY_RULE_SETUP
#line 251 "./util/configlexer.lex"
-{ YDVAR(1, VAR_DELAY_CLOSE) }
+{ YDVAR(1, VAR_JOSTLE_TIMEOUT) }
YY_BREAK
-case 51:
+case 52:
YY_RULE_SETUP
#line 252 "./util/configlexer.lex"
-{ YDVAR(1, VAR_TARGET_FETCH_POLICY) }
+{ YDVAR(1, VAR_DELAY_CLOSE) }
YY_BREAK
-case 52:
+case 53:
YY_RULE_SETUP
#line 253 "./util/configlexer.lex"
-{ YDVAR(1, VAR_HARDEN_SHORT_BUFSIZE) }
+{ YDVAR(1, VAR_TARGET_FETCH_POLICY) }
YY_BREAK
-case 53:
+case 54:
YY_RULE_SETUP
#line 254 "./util/configlexer.lex"
-{ YDVAR(1, VAR_HARDEN_LARGE_QUERIES) }
+{ YDVAR(1, VAR_HARDEN_SHORT_BUFSIZE) }
YY_BREAK
-case 54:
+case 55:
YY_RULE_SETUP
#line 255 "./util/configlexer.lex"
-{ YDVAR(1, VAR_HARDEN_GLUE) }
+{ YDVAR(1, VAR_HARDEN_LARGE_QUERIES) }
YY_BREAK
-case 55:
+case 56:
YY_RULE_SETUP
#line 256 "./util/configlexer.lex"
-{ YDVAR(1, VAR_HARDEN_DNSSEC_STRIPPED) }
+{ YDVAR(1, VAR_HARDEN_GLUE) }
YY_BREAK
-case 56:
+case 57:
YY_RULE_SETUP
#line 257 "./util/configlexer.lex"
-{ YDVAR(1, VAR_HARDEN_BELOW_NXDOMAIN) }
+{ YDVAR(1, VAR_HARDEN_DNSSEC_STRIPPED) }
YY_BREAK
-case 57:
+case 58:
YY_RULE_SETUP
#line 258 "./util/configlexer.lex"
-{ YDVAR(1, VAR_HARDEN_REFERRAL_PATH) }
+{ YDVAR(1, VAR_HARDEN_BELOW_NXDOMAIN) }
YY_BREAK
-case 58:
+case 59:
YY_RULE_SETUP
#line 259 "./util/configlexer.lex"
-{ YDVAR(1, VAR_USE_CAPS_FOR_ID) }
+{ YDVAR(1, VAR_HARDEN_REFERRAL_PATH) }
YY_BREAK
-case 59:
+case 60:
YY_RULE_SETUP
#line 260 "./util/configlexer.lex"
-{ YDVAR(1, VAR_UNWANTED_REPLY_THRESHOLD) }
+{ YDVAR(1, VAR_HARDEN_ALGO_DOWNGRADE) }
YY_BREAK
-case 60:
+case 61:
YY_RULE_SETUP
#line 261 "./util/configlexer.lex"
-{ YDVAR(1, VAR_PRIVATE_ADDRESS) }
+{ YDVAR(1, VAR_USE_CAPS_FOR_ID) }
YY_BREAK
-case 61:
+case 62:
YY_RULE_SETUP
#line 262 "./util/configlexer.lex"
-{ YDVAR(1, VAR_PRIVATE_DOMAIN) }
+{ YDVAR(1, VAR_UNWANTED_REPLY_THRESHOLD) }
YY_BREAK
-case 62:
+case 63:
YY_RULE_SETUP
#line 263 "./util/configlexer.lex"
-{ YDVAR(1, VAR_PREFETCH_KEY) }
+{ YDVAR(1, VAR_PRIVATE_ADDRESS) }
YY_BREAK
-case 63:
+case 64:
YY_RULE_SETUP
#line 264 "./util/configlexer.lex"
-{ YDVAR(1, VAR_PREFETCH) }
+{ YDVAR(1, VAR_PRIVATE_DOMAIN) }
YY_BREAK
-case 64:
+case 65:
YY_RULE_SETUP
#line 265 "./util/configlexer.lex"
-{ YDVAR(0, VAR_STUB_ZONE) }
+{ YDVAR(1, VAR_PREFETCH_KEY) }
YY_BREAK
-case 65:
+case 66:
YY_RULE_SETUP
#line 266 "./util/configlexer.lex"
-{ YDVAR(1, VAR_NAME) }
+{ YDVAR(1, VAR_PREFETCH) }
YY_BREAK
-case 66:
+case 67:
YY_RULE_SETUP
#line 267 "./util/configlexer.lex"
-{ YDVAR(1, VAR_STUB_ADDR) }
+{ YDVAR(0, VAR_STUB_ZONE) }
YY_BREAK
-case 67:
+case 68:
YY_RULE_SETUP
#line 268 "./util/configlexer.lex"
-{ YDVAR(1, VAR_STUB_HOST) }
+{ YDVAR(1, VAR_NAME) }
YY_BREAK
-case 68:
+case 69:
YY_RULE_SETUP
#line 269 "./util/configlexer.lex"
-{ YDVAR(1, VAR_STUB_PRIME) }
+{ YDVAR(1, VAR_STUB_ADDR) }
YY_BREAK
-case 69:
+case 70:
YY_RULE_SETUP
#line 270 "./util/configlexer.lex"
-{ YDVAR(1, VAR_STUB_FIRST) }
+{ YDVAR(1, VAR_STUB_HOST) }
YY_BREAK
-case 70:
+case 71:
YY_RULE_SETUP
#line 271 "./util/configlexer.lex"
-{ YDVAR(0, VAR_FORWARD_ZONE) }
+{ YDVAR(1, VAR_STUB_PRIME) }
YY_BREAK
-case 71:
+case 72:
YY_RULE_SETUP
#line 272 "./util/configlexer.lex"
-{ YDVAR(1, VAR_FORWARD_ADDR) }
+{ YDVAR(1, VAR_STUB_FIRST) }
YY_BREAK
-case 72:
+case 73:
YY_RULE_SETUP
#line 273 "./util/configlexer.lex"
-{ YDVAR(1, VAR_FORWARD_HOST) }
+{ YDVAR(0, VAR_FORWARD_ZONE) }
YY_BREAK
-case 73:
+case 74:
YY_RULE_SETUP
#line 274 "./util/configlexer.lex"
-{ YDVAR(1, VAR_FORWARD_FIRST) }
+{ YDVAR(1, VAR_FORWARD_ADDR) }
YY_BREAK
-case 74:
+case 75:
YY_RULE_SETUP
#line 275 "./util/configlexer.lex"
-{ YDVAR(1, VAR_DO_NOT_QUERY_ADDRESS) }
+{ YDVAR(1, VAR_FORWARD_HOST) }
YY_BREAK
-case 75:
+case 76:
YY_RULE_SETUP
#line 276 "./util/configlexer.lex"
-{ YDVAR(1, VAR_DO_NOT_QUERY_LOCALHOST) }
+{ YDVAR(1, VAR_FORWARD_FIRST) }
YY_BREAK
-case 76:
+case 77:
YY_RULE_SETUP
#line 277 "./util/configlexer.lex"
-{ YDVAR(2, VAR_ACCESS_CONTROL) }
+{ YDVAR(1, VAR_DO_NOT_QUERY_ADDRESS) }
YY_BREAK
-case 77:
+case 78:
YY_RULE_SETUP
#line 278 "./util/configlexer.lex"
-{ YDVAR(1, VAR_SEND_CLIENT_SUBNET) }
+{ YDVAR(1, VAR_DO_NOT_QUERY_LOCALHOST) }
YY_BREAK
-case 78:
+case 79:
YY_RULE_SETUP
#line 279 "./util/configlexer.lex"
-{ YDVAR(1, VAR_CLIENT_SUBNET_OPCODE) }
+{ YDVAR(2, VAR_ACCESS_CONTROL) }
YY_BREAK
-case 79:
+case 80:
YY_RULE_SETUP
#line 280 "./util/configlexer.lex"
-{ YDVAR(1, VAR_MAX_CLIENT_SUBNET_IPV4) }
+{ YDVAR(1, VAR_SEND_CLIENT_SUBNET) }
YY_BREAK
-case 80:
+case 81:
YY_RULE_SETUP
#line 281 "./util/configlexer.lex"
-{ YDVAR(1, VAR_MAX_CLIENT_SUBNET_IPV6) }
+{ YDVAR(1, VAR_CLIENT_SUBNET_OPCODE) }
YY_BREAK
-case 81:
+case 82:
YY_RULE_SETUP
#line 282 "./util/configlexer.lex"
-{ YDVAR(1, VAR_HIDE_IDENTITY) }
+{ YDVAR(1, VAR_MAX_CLIENT_SUBNET_IPV4) }
YY_BREAK
-case 82:
+case 83:
YY_RULE_SETUP
#line 283 "./util/configlexer.lex"
-{ YDVAR(1, VAR_HIDE_VERSION) }
+{ YDVAR(1, VAR_MAX_CLIENT_SUBNET_IPV6) }
YY_BREAK
-case 83:
+case 84:
YY_RULE_SETUP
#line 284 "./util/configlexer.lex"
-{ YDVAR(1, VAR_IDENTITY) }
+{ YDVAR(1, VAR_HIDE_IDENTITY) }
YY_BREAK
-case 84:
+case 85:
YY_RULE_SETUP
#line 285 "./util/configlexer.lex"
-{ YDVAR(1, VAR_VERSION) }
+{ YDVAR(1, VAR_HIDE_VERSION) }
YY_BREAK
-case 85:
+case 86:
YY_RULE_SETUP
#line 286 "./util/configlexer.lex"
-{ YDVAR(1, VAR_MODULE_CONF) }
+{ YDVAR(1, VAR_IDENTITY) }
YY_BREAK
-case 86:
+case 87:
YY_RULE_SETUP
#line 287 "./util/configlexer.lex"
-{ YDVAR(1, VAR_DLV_ANCHOR) }
+{ YDVAR(1, VAR_VERSION) }
YY_BREAK
-case 87:
+case 88:
YY_RULE_SETUP
#line 288 "./util/configlexer.lex"
-{ YDVAR(1, VAR_DLV_ANCHOR_FILE) }
+{ YDVAR(1, VAR_MODULE_CONF) }
YY_BREAK
-case 88:
+case 89:
YY_RULE_SETUP
#line 289 "./util/configlexer.lex"
-{ YDVAR(1, VAR_TRUST_ANCHOR_FILE) }
+{ YDVAR(1, VAR_DLV_ANCHOR) }
YY_BREAK
-case 89:
+case 90:
YY_RULE_SETUP
#line 290 "./util/configlexer.lex"
-{ YDVAR(1, VAR_AUTO_TRUST_ANCHOR_FILE) }
+{ YDVAR(1, VAR_DLV_ANCHOR_FILE) }
YY_BREAK
-case 90:
+case 91:
YY_RULE_SETUP
#line 291 "./util/configlexer.lex"
-{ YDVAR(1, VAR_TRUSTED_KEYS_FILE) }
+{ YDVAR(1, VAR_TRUST_ANCHOR_FILE) }
YY_BREAK
-case 91:
+case 92:
YY_RULE_SETUP
#line 292 "./util/configlexer.lex"
-{ YDVAR(1, VAR_TRUST_ANCHOR) }
+{ YDVAR(1, VAR_AUTO_TRUST_ANCHOR_FILE) }
YY_BREAK
-case 92:
+case 93:
YY_RULE_SETUP
#line 293 "./util/configlexer.lex"
-{ YDVAR(1, VAR_VAL_OVERRIDE_DATE) }
+{ YDVAR(1, VAR_TRUSTED_KEYS_FILE) }
YY_BREAK
-case 93:
+case 94:
YY_RULE_SETUP
#line 294 "./util/configlexer.lex"
+{ YDVAR(1, VAR_TRUST_ANCHOR) }
+ YY_BREAK
+case 95:
+YY_RULE_SETUP
+#line 295 "./util/configlexer.lex"
+{ YDVAR(1, VAR_VAL_OVERRIDE_DATE) }
+ YY_BREAK
+case 96:
+YY_RULE_SETUP
+#line 296 "./util/configlexer.lex"
{ YDVAR(1, VAR_VAL_SIG_SKEW_MIN) }
YY_BREAK
-case 94:
+case 97:
YY_RULE_SETUP
-#line 295 "./util/configlexer.lex"
+#line 297 "./util/configlexer.lex"
{ YDVAR(1, VAR_VAL_SIG_SKEW_MAX) }
YY_BREAK
-case 95:
+case 98:
YY_RULE_SETUP
-#line 296 "./util/configlexer.lex"
+#line 298 "./util/configlexer.lex"
{ YDVAR(1, VAR_BOGUS_TTL) }
YY_BREAK
-case 96:
+case 99:
YY_RULE_SETUP
-#line 297 "./util/configlexer.lex"
+#line 299 "./util/configlexer.lex"
{ YDVAR(1, VAR_VAL_CLEAN_ADDITIONAL) }
YY_BREAK
-case 97:
+case 100:
YY_RULE_SETUP
-#line 298 "./util/configlexer.lex"
+#line 300 "./util/configlexer.lex"
{ YDVAR(1, VAR_VAL_PERMISSIVE_MODE) }
YY_BREAK
-case 98:
+case 101:
YY_RULE_SETUP
-#line 299 "./util/configlexer.lex"
+#line 301 "./util/configlexer.lex"
{ YDVAR(1, VAR_IGNORE_CD_FLAG) }
YY_BREAK
-case 99:
+case 102:
YY_RULE_SETUP
-#line 300 "./util/configlexer.lex"
+#line 302 "./util/configlexer.lex"
{ YDVAR(1, VAR_VAL_LOG_LEVEL) }
YY_BREAK
-case 100:
+case 103:
YY_RULE_SETUP
-#line 301 "./util/configlexer.lex"
+#line 303 "./util/configlexer.lex"
{ YDVAR(1, VAR_KEY_CACHE_SIZE) }
YY_BREAK
-case 101:
+case 104:
YY_RULE_SETUP
-#line 302 "./util/configlexer.lex"
+#line 304 "./util/configlexer.lex"
{ YDVAR(1, VAR_KEY_CACHE_SLABS) }
YY_BREAK
-case 102:
+case 105:
YY_RULE_SETUP
-#line 303 "./util/configlexer.lex"
+#line 305 "./util/configlexer.lex"
{ YDVAR(1, VAR_NEG_CACHE_SIZE) }
YY_BREAK
-case 103:
+case 106:
YY_RULE_SETUP
-#line 304 "./util/configlexer.lex"
+#line 306 "./util/configlexer.lex"
{
YDVAR(1, VAR_VAL_NSEC3_KEYSIZE_ITERATIONS) }
YY_BREAK
-case 104:
+case 107:
YY_RULE_SETUP
-#line 306 "./util/configlexer.lex"
+#line 308 "./util/configlexer.lex"
{ YDVAR(1, VAR_ADD_HOLDDOWN) }
YY_BREAK
-case 105:
+case 108:
YY_RULE_SETUP
-#line 307 "./util/configlexer.lex"
+#line 309 "./util/configlexer.lex"
{ YDVAR(1, VAR_DEL_HOLDDOWN) }
YY_BREAK
-case 106:
+case 109:
YY_RULE_SETUP
-#line 308 "./util/configlexer.lex"
+#line 310 "./util/configlexer.lex"
{ YDVAR(1, VAR_KEEP_MISSING) }
YY_BREAK
-case 107:
+case 110:
YY_RULE_SETUP
-#line 309 "./util/configlexer.lex"
+#line 311 "./util/configlexer.lex"
{ YDVAR(1, VAR_USE_SYSLOG) }
YY_BREAK
-case 108:
+case 111:
YY_RULE_SETUP
-#line 310 "./util/configlexer.lex"
+#line 312 "./util/configlexer.lex"
{ YDVAR(1, VAR_LOG_TIME_ASCII) }
YY_BREAK
-case 109:
+case 112:
YY_RULE_SETUP
-#line 311 "./util/configlexer.lex"
+#line 313 "./util/configlexer.lex"
{ YDVAR(1, VAR_LOG_QUERIES) }
YY_BREAK
-case 110:
+case 113:
YY_RULE_SETUP
-#line 312 "./util/configlexer.lex"
+#line 314 "./util/configlexer.lex"
{ YDVAR(2, VAR_LOCAL_ZONE) }
YY_BREAK
-case 111:
+case 114:
YY_RULE_SETUP
-#line 313 "./util/configlexer.lex"
+#line 315 "./util/configlexer.lex"
{ YDVAR(1, VAR_LOCAL_DATA) }
YY_BREAK
-case 112:
+case 115:
YY_RULE_SETUP
-#line 314 "./util/configlexer.lex"
+#line 316 "./util/configlexer.lex"
{ YDVAR(1, VAR_LOCAL_DATA_PTR) }
YY_BREAK
-case 113:
+case 116:
YY_RULE_SETUP
-#line 315 "./util/configlexer.lex"
+#line 317 "./util/configlexer.lex"
+{ YDVAR(1, VAR_UNBLOCK_LAN_ZONES) }
+ YY_BREAK
+case 117:
+YY_RULE_SETUP
+#line 318 "./util/configlexer.lex"
{ YDVAR(1, VAR_STATISTICS_INTERVAL) }
YY_BREAK
-case 114:
+case 118:
YY_RULE_SETUP
-#line 316 "./util/configlexer.lex"
+#line 319 "./util/configlexer.lex"
{ YDVAR(1, VAR_STATISTICS_CUMULATIVE) }
YY_BREAK
-case 115:
+case 119:
YY_RULE_SETUP
-#line 317 "./util/configlexer.lex"
+#line 320 "./util/configlexer.lex"
{ YDVAR(1, VAR_EXTENDED_STATISTICS) }
YY_BREAK
-case 116:
+case 120:
YY_RULE_SETUP
-#line 318 "./util/configlexer.lex"
+#line 321 "./util/configlexer.lex"
{ YDVAR(0, VAR_REMOTE_CONTROL) }
YY_BREAK
-case 117:
+case 121:
YY_RULE_SETUP
-#line 319 "./util/configlexer.lex"
+#line 322 "./util/configlexer.lex"
{ YDVAR(1, VAR_CONTROL_ENABLE) }
YY_BREAK
-case 118:
+case 122:
YY_RULE_SETUP
-#line 320 "./util/configlexer.lex"
+#line 323 "./util/configlexer.lex"
{ YDVAR(1, VAR_CONTROL_INTERFACE) }
YY_BREAK
-case 119:
+case 123:
YY_RULE_SETUP
-#line 321 "./util/configlexer.lex"
+#line 324 "./util/configlexer.lex"
{ YDVAR(1, VAR_CONTROL_PORT) }
YY_BREAK
-case 120:
+case 124:
YY_RULE_SETUP
-#line 322 "./util/configlexer.lex"
+#line 325 "./util/configlexer.lex"
+{ YDVAR(1, VAR_CONTROL_USE_CERT) }
+ YY_BREAK
+case 125:
+YY_RULE_SETUP
+#line 326 "./util/configlexer.lex"
{ YDVAR(1, VAR_SERVER_KEY_FILE) }
YY_BREAK
-case 121:
+case 126:
YY_RULE_SETUP
-#line 323 "./util/configlexer.lex"
+#line 327 "./util/configlexer.lex"
{ YDVAR(1, VAR_SERVER_CERT_FILE) }
YY_BREAK
-case 122:
+case 127:
YY_RULE_SETUP
-#line 324 "./util/configlexer.lex"
+#line 328 "./util/configlexer.lex"
{ YDVAR(1, VAR_CONTROL_KEY_FILE) }
YY_BREAK
-case 123:
+case 128:
YY_RULE_SETUP
-#line 325 "./util/configlexer.lex"
+#line 329 "./util/configlexer.lex"
{ YDVAR(1, VAR_CONTROL_CERT_FILE) }
YY_BREAK
-case 124:
+case 129:
YY_RULE_SETUP
-#line 326 "./util/configlexer.lex"
+#line 330 "./util/configlexer.lex"
{ YDVAR(1, VAR_PYTHON_SCRIPT) }
YY_BREAK
-case 125:
+case 130:
YY_RULE_SETUP
-#line 327 "./util/configlexer.lex"
+#line 331 "./util/configlexer.lex"
{ YDVAR(0, VAR_PYTHON) }
YY_BREAK
-case 126:
+case 131:
YY_RULE_SETUP
-#line 328 "./util/configlexer.lex"
+#line 332 "./util/configlexer.lex"
{ YDVAR(1, VAR_DOMAIN_INSECURE) }
YY_BREAK
-case 127:
+case 132:
YY_RULE_SETUP
-#line 329 "./util/configlexer.lex"
+#line 333 "./util/configlexer.lex"
{ YDVAR(1, VAR_MINIMAL_RESPONSES) }
YY_BREAK
-case 128:
+case 133:
YY_RULE_SETUP
-#line 330 "./util/configlexer.lex"
+#line 334 "./util/configlexer.lex"
{ YDVAR(1, VAR_RRSET_ROUNDROBIN) }
YY_BREAK
-case 129:
+case 134:
YY_RULE_SETUP
-#line 331 "./util/configlexer.lex"
+#line 335 "./util/configlexer.lex"
{ YDVAR(1, VAR_MAX_UDP_SIZE) }
YY_BREAK
-case 130:
-/* rule 130 can match eol */
+case 135:
YY_RULE_SETUP
-#line 332 "./util/configlexer.lex"
+#line 336 "./util/configlexer.lex"
+{ YDVAR(1, VAR_DNS64_PREFIX) }
+ YY_BREAK
+case 136:
+YY_RULE_SETUP
+#line 337 "./util/configlexer.lex"
+{ YDVAR(1, VAR_DNS64_SYNTHALL) }
+ YY_BREAK
+case 137:
+YY_RULE_SETUP
+#line 338 "./util/configlexer.lex"
+{ YDVAR(0, VAR_DNSTAP) }
+ YY_BREAK
+case 138:
+YY_RULE_SETUP
+#line 339 "./util/configlexer.lex"
+{ YDVAR(1, VAR_DNSTAP_ENABLE) }
+ YY_BREAK
+case 139:
+YY_RULE_SETUP
+#line 340 "./util/configlexer.lex"
+{ YDVAR(1, VAR_DNSTAP_SOCKET_PATH) }
+ YY_BREAK
+case 140:
+YY_RULE_SETUP
+#line 341 "./util/configlexer.lex"
+{ YDVAR(1, VAR_DNSTAP_SEND_IDENTITY) }
+ YY_BREAK
+case 141:
+YY_RULE_SETUP
+#line 342 "./util/configlexer.lex"
+{ YDVAR(1, VAR_DNSTAP_SEND_VERSION) }
+ YY_BREAK
+case 142:
+YY_RULE_SETUP
+#line 343 "./util/configlexer.lex"
+{ YDVAR(1, VAR_DNSTAP_IDENTITY) }
+ YY_BREAK
+case 143:
+YY_RULE_SETUP
+#line 344 "./util/configlexer.lex"
+{ YDVAR(1, VAR_DNSTAP_VERSION) }
+ YY_BREAK
+case 144:
+YY_RULE_SETUP
+#line 345 "./util/configlexer.lex"
+{
+ YDVAR(1, VAR_DNSTAP_LOG_RESOLVER_QUERY_MESSAGES) }
+ YY_BREAK
+case 145:
+YY_RULE_SETUP
+#line 347 "./util/configlexer.lex"
+{
+ YDVAR(1, VAR_DNSTAP_LOG_RESOLVER_RESPONSE_MESSAGES) }
+ YY_BREAK
+case 146:
+YY_RULE_SETUP
+#line 349 "./util/configlexer.lex"
+{
+ YDVAR(1, VAR_DNSTAP_LOG_CLIENT_QUERY_MESSAGES) }
+ YY_BREAK
+case 147:
+YY_RULE_SETUP
+#line 351 "./util/configlexer.lex"
+{
+ YDVAR(1, VAR_DNSTAP_LOG_CLIENT_RESPONSE_MESSAGES) }
+ YY_BREAK
+case 148:
+YY_RULE_SETUP
+#line 353 "./util/configlexer.lex"
+{
+ YDVAR(1, VAR_DNSTAP_LOG_FORWARDER_QUERY_MESSAGES) }
+ YY_BREAK
+case 149:
+YY_RULE_SETUP
+#line 355 "./util/configlexer.lex"
+{
+ YDVAR(1, VAR_DNSTAP_LOG_FORWARDER_RESPONSE_MESSAGES) }
+ YY_BREAK
+case 150:
+YY_RULE_SETUP
+#line 357 "./util/configlexer.lex"
+{ YDVAR(1, VAR_RATELIMIT) }
+ YY_BREAK
+case 151:
+YY_RULE_SETUP
+#line 358 "./util/configlexer.lex"
+{ YDVAR(1, VAR_RATELIMIT_SLABS) }
+ YY_BREAK
+case 152:
+YY_RULE_SETUP
+#line 359 "./util/configlexer.lex"
+{ YDVAR(1, VAR_RATELIMIT_SIZE) }
+ YY_BREAK
+case 153:
+YY_RULE_SETUP
+#line 360 "./util/configlexer.lex"
+{ YDVAR(2, VAR_RATELIMIT_FOR_DOMAIN) }
+ YY_BREAK
+case 154:
+YY_RULE_SETUP
+#line 361 "./util/configlexer.lex"
+{ YDVAR(2, VAR_RATELIMIT_BELOW_DOMAIN) }
+ YY_BREAK
+case 155:
+YY_RULE_SETUP
+#line 362 "./util/configlexer.lex"
+{ YDVAR(1, VAR_RATELIMIT_FACTOR) }
+ YY_BREAK
+case 156:
+/* rule 156 can match eol */
+YY_RULE_SETUP
+#line 363 "./util/configlexer.lex"
{ LEXOUT(("NL\n")); cfg_parser->line++; }
YY_BREAK
/* Quoted strings. Strip leading and ending quotes */
-case 131:
+case 157:
YY_RULE_SETUP
-#line 335 "./util/configlexer.lex"
+#line 366 "./util/configlexer.lex"
{ BEGIN(quotedstring); LEXOUT(("QS ")); }
YY_BREAK
case YY_STATE_EOF(quotedstring):
-#line 336 "./util/configlexer.lex"
+#line 367 "./util/configlexer.lex"
{
yyerror("EOF inside quoted string");
if(--num_args == 0) { BEGIN(INITIAL); }
else { BEGIN(val); }
}
YY_BREAK
-case 132:
+case 158:
YY_RULE_SETUP
-#line 341 "./util/configlexer.lex"
+#line 372 "./util/configlexer.lex"
{ LEXOUT(("STR(%s) ", yytext)); yymore(); }
YY_BREAK
-case 133:
-/* rule 133 can match eol */
+case 159:
+/* rule 159 can match eol */
YY_RULE_SETUP
-#line 342 "./util/configlexer.lex"
+#line 373 "./util/configlexer.lex"
{ yyerror("newline inside quoted string, no end \"");
cfg_parser->line++; BEGIN(INITIAL); }
YY_BREAK
-case 134:
+case 160:
YY_RULE_SETUP
-#line 344 "./util/configlexer.lex"
+#line 375 "./util/configlexer.lex"
{
LEXOUT(("QE "));
if(--num_args == 0) { BEGIN(INITIAL); }
}
YY_BREAK
/* Single Quoted strings. Strip leading and ending quotes */
-case 135:
+case 161:
YY_RULE_SETUP
-#line 356 "./util/configlexer.lex"
+#line 387 "./util/configlexer.lex"
{ BEGIN(singlequotedstr); LEXOUT(("SQS ")); }
YY_BREAK
case YY_STATE_EOF(singlequotedstr):
-#line 357 "./util/configlexer.lex"
+#line 388 "./util/configlexer.lex"
{
yyerror("EOF inside quoted string");
if(--num_args == 0) { BEGIN(INITIAL); }
else { BEGIN(val); }
}
YY_BREAK
-case 136:
+case 162:
YY_RULE_SETUP
-#line 362 "./util/configlexer.lex"
+#line 393 "./util/configlexer.lex"
{ LEXOUT(("STR(%s) ", yytext)); yymore(); }
YY_BREAK
-case 137:
-/* rule 137 can match eol */
+case 163:
+/* rule 163 can match eol */
YY_RULE_SETUP
-#line 363 "./util/configlexer.lex"
+#line 394 "./util/configlexer.lex"
{ yyerror("newline inside quoted string, no end '");
cfg_parser->line++; BEGIN(INITIAL); }
YY_BREAK
-case 138:
+case 164:
YY_RULE_SETUP
-#line 365 "./util/configlexer.lex"
+#line 396 "./util/configlexer.lex"
{
LEXOUT(("SQE "));
if(--num_args == 0) { BEGIN(INITIAL); }
}
YY_BREAK
/* include: directive */
-case 139:
+case 165:
YY_RULE_SETUP
-#line 377 "./util/configlexer.lex"
+#line 408 "./util/configlexer.lex"
{
LEXOUT(("v(%s) ", yytext)); inc_prev = YYSTATE; BEGIN(include); }
YY_BREAK
case YY_STATE_EOF(include):
-#line 379 "./util/configlexer.lex"
+#line 410 "./util/configlexer.lex"
{
yyerror("EOF inside include directive");
BEGIN(inc_prev);
}
YY_BREAK
-case 140:
+case 166:
YY_RULE_SETUP
-#line 383 "./util/configlexer.lex"
+#line 414 "./util/configlexer.lex"
{ LEXOUT(("ISP ")); /* ignore */ }
YY_BREAK
-case 141:
-/* rule 141 can match eol */
+case 167:
+/* rule 167 can match eol */
YY_RULE_SETUP
-#line 384 "./util/configlexer.lex"
+#line 415 "./util/configlexer.lex"
{ LEXOUT(("NL\n")); cfg_parser->line++;}
YY_BREAK
-case 142:
+case 168:
YY_RULE_SETUP
-#line 385 "./util/configlexer.lex"
+#line 416 "./util/configlexer.lex"
{ LEXOUT(("IQS ")); BEGIN(include_quoted); }
YY_BREAK
-case 143:
+case 169:
YY_RULE_SETUP
-#line 386 "./util/configlexer.lex"
+#line 417 "./util/configlexer.lex"
{
LEXOUT(("Iunquotedstr(%s) ", yytext));
config_start_include_glob(yytext);
}
YY_BREAK
case YY_STATE_EOF(include_quoted):
-#line 391 "./util/configlexer.lex"
+#line 422 "./util/configlexer.lex"
{
yyerror("EOF inside quoted string");
BEGIN(inc_prev);
}
YY_BREAK
-case 144:
+case 170:
YY_RULE_SETUP
-#line 395 "./util/configlexer.lex"
+#line 426 "./util/configlexer.lex"
{ LEXOUT(("ISTR(%s) ", yytext)); yymore(); }
YY_BREAK
-case 145:
-/* rule 145 can match eol */
+case 171:
+/* rule 171 can match eol */
YY_RULE_SETUP
-#line 396 "./util/configlexer.lex"
+#line 427 "./util/configlexer.lex"
{ yyerror("newline before \" in include name");
cfg_parser->line++; BEGIN(inc_prev); }
YY_BREAK
-case 146:
+case 172:
YY_RULE_SETUP
-#line 398 "./util/configlexer.lex"
+#line 429 "./util/configlexer.lex"
{
LEXOUT(("IQE "));
yytext[yyleng - 1] = '\0';
YY_BREAK
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(val):
-#line 404 "./util/configlexer.lex"
+#line 435 "./util/configlexer.lex"
{
LEXOUT(("LEXEOF "));
yy_set_bol(1); /* Set beginning of line, so "^" rules match. */
}
}
YY_BREAK
-case 147:
+case 173:
YY_RULE_SETUP
-#line 415 "./util/configlexer.lex"
+#line 446 "./util/configlexer.lex"
{ LEXOUT(("unquotedstr(%s) ", yytext));
if(--num_args == 0) { BEGIN(INITIAL); }
yylval.str = strdup(yytext); return STRING_ARG; }
YY_BREAK
-case 148:
+case 174:
YY_RULE_SETUP
-#line 419 "./util/configlexer.lex"
+#line 450 "./util/configlexer.lex"
{
ub_c_error_msg("unknown keyword '%s'", yytext);
}
YY_BREAK
-case 149:
+case 175:
YY_RULE_SETUP
-#line 423 "./util/configlexer.lex"
+#line 454 "./util/configlexer.lex"
{
ub_c_error_msg("stray '%s'", yytext);
}
YY_BREAK
-case 150:
+case 176:
YY_RULE_SETUP
-#line 427 "./util/configlexer.lex"
+#line 458 "./util/configlexer.lex"
ECHO;
YY_BREAK
-#line 2887 "<stdout>"
+#line 3264 "<stdout>"
case YY_END_OF_BUFFER:
{
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 1441 )
+ if ( yy_current_state >= 1763 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 1441 )
+ if ( yy_current_state >= 1763 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- yy_is_jam = (yy_current_state == 1440);
+ yy_is_jam = (yy_current_state == 1762);
return yy_is_jam ? 0 : yy_current_state;
}
#define YYTABLES_NAME "yytables"
-#line 426 "./util/configlexer.lex"
+#line 457 "./util/configlexer.lex"
* See LICENSE for the license.
*
*/
-
#include <ctype.h>
#include <string.h>
#include <strings.h>
so-rcvbuf{COLON} { YDVAR(1, VAR_SO_RCVBUF) }
so-sndbuf{COLON} { YDVAR(1, VAR_SO_SNDBUF) }
so-reuseport{COLON} { YDVAR(1, VAR_SO_REUSEPORT) }
+ip-transparent{COLON} { YDVAR(1, VAR_IP_TRANSPARENT) }
chroot{COLON} { YDVAR(1, VAR_CHROOT) }
username{COLON} { YDVAR(1, VAR_USERNAME) }
directory{COLON} { YDVAR(1, VAR_DIRECTORY) }
infra-cache-slabs{COLON} { YDVAR(1, VAR_INFRA_CACHE_SLABS) }
infra-cache-numhosts{COLON} { YDVAR(1, VAR_INFRA_CACHE_NUMHOSTS) }
infra-cache-lame-size{COLON} { YDVAR(1, VAR_INFRA_CACHE_LAME_SIZE) }
+infra-cache-min-rtt{COLON} { YDVAR(1, VAR_INFRA_CACHE_MIN_RTT) }
num-queries-per-thread{COLON} { YDVAR(1, VAR_NUM_QUERIES_PER_THREAD) }
jostle-timeout{COLON} { YDVAR(1, VAR_JOSTLE_TIMEOUT) }
delay-close{COLON} { YDVAR(1, VAR_DELAY_CLOSE) }
harden-dnssec-stripped{COLON} { YDVAR(1, VAR_HARDEN_DNSSEC_STRIPPED) }
harden-below-nxdomain{COLON} { YDVAR(1, VAR_HARDEN_BELOW_NXDOMAIN) }
harden-referral-path{COLON} { YDVAR(1, VAR_HARDEN_REFERRAL_PATH) }
+harden-algo-downgrade{COLON} { YDVAR(1, VAR_HARDEN_ALGO_DOWNGRADE) }
use-caps-for-id{COLON} { YDVAR(1, VAR_USE_CAPS_FOR_ID) }
unwanted-reply-threshold{COLON} { YDVAR(1, VAR_UNWANTED_REPLY_THRESHOLD) }
private-address{COLON} { YDVAR(1, VAR_PRIVATE_ADDRESS) }
local-zone{COLON} { YDVAR(2, VAR_LOCAL_ZONE) }
local-data{COLON} { YDVAR(1, VAR_LOCAL_DATA) }
local-data-ptr{COLON} { YDVAR(1, VAR_LOCAL_DATA_PTR) }
+unblock-lan-zones{COLON} { YDVAR(1, VAR_UNBLOCK_LAN_ZONES) }
statistics-interval{COLON} { YDVAR(1, VAR_STATISTICS_INTERVAL) }
statistics-cumulative{COLON} { YDVAR(1, VAR_STATISTICS_CUMULATIVE) }
extended-statistics{COLON} { YDVAR(1, VAR_EXTENDED_STATISTICS) }
control-enable{COLON} { YDVAR(1, VAR_CONTROL_ENABLE) }
control-interface{COLON} { YDVAR(1, VAR_CONTROL_INTERFACE) }
control-port{COLON} { YDVAR(1, VAR_CONTROL_PORT) }
+control-use-cert{COLON} { YDVAR(1, VAR_CONTROL_USE_CERT) }
server-key-file{COLON} { YDVAR(1, VAR_SERVER_KEY_FILE) }
server-cert-file{COLON} { YDVAR(1, VAR_SERVER_CERT_FILE) }
control-key-file{COLON} { YDVAR(1, VAR_CONTROL_KEY_FILE) }
minimal-responses{COLON} { YDVAR(1, VAR_MINIMAL_RESPONSES) }
rrset-roundrobin{COLON} { YDVAR(1, VAR_RRSET_ROUNDROBIN) }
max-udp-size{COLON} { YDVAR(1, VAR_MAX_UDP_SIZE) }
+dns64-prefix{COLON} { YDVAR(1, VAR_DNS64_PREFIX) }
+dns64-synthall{COLON} { YDVAR(1, VAR_DNS64_SYNTHALL) }
+dnstap{COLON} { YDVAR(0, VAR_DNSTAP) }
+dnstap-enable{COLON} { YDVAR(1, VAR_DNSTAP_ENABLE) }
+dnstap-socket-path{COLON} { YDVAR(1, VAR_DNSTAP_SOCKET_PATH) }
+dnstap-send-identity{COLON} { YDVAR(1, VAR_DNSTAP_SEND_IDENTITY) }
+dnstap-send-version{COLON} { YDVAR(1, VAR_DNSTAP_SEND_VERSION) }
+dnstap-identity{COLON} { YDVAR(1, VAR_DNSTAP_IDENTITY) }
+dnstap-version{COLON} { YDVAR(1, VAR_DNSTAP_VERSION) }
+dnstap-log-resolver-query-messages{COLON} {
+ YDVAR(1, VAR_DNSTAP_LOG_RESOLVER_QUERY_MESSAGES) }
+dnstap-log-resolver-response-messages{COLON} {
+ YDVAR(1, VAR_DNSTAP_LOG_RESOLVER_RESPONSE_MESSAGES) }
+dnstap-log-client-query-messages{COLON} {
+ YDVAR(1, VAR_DNSTAP_LOG_CLIENT_QUERY_MESSAGES) }
+dnstap-log-client-response-messages{COLON} {
+ YDVAR(1, VAR_DNSTAP_LOG_CLIENT_RESPONSE_MESSAGES) }
+dnstap-log-forwarder-query-messages{COLON} {
+ YDVAR(1, VAR_DNSTAP_LOG_FORWARDER_QUERY_MESSAGES) }
+dnstap-log-forwarder-response-messages{COLON} {
+ YDVAR(1, VAR_DNSTAP_LOG_FORWARDER_RESPONSE_MESSAGES) }
+ratelimit{COLON} { YDVAR(1, VAR_RATELIMIT) }
+ratelimit-slabs{COLON} { YDVAR(1, VAR_RATELIMIT_SLABS) }
+ratelimit-size{COLON} { YDVAR(1, VAR_RATELIMIT_SIZE) }
+ratelimit-for-domain{COLON} { YDVAR(2, VAR_RATELIMIT_FOR_DOMAIN) }
+ratelimit-below-domain{COLON} { YDVAR(2, VAR_RATELIMIT_BELOW_DOMAIN) }
+ratelimit-factor{COLON} { YDVAR(1, VAR_RATELIMIT_FACTOR) }
<INITIAL,val>{NEWLINE} { LEXOUT(("NL\n")); cfg_parser->line++; }
/* Quoted strings. Strip leading and ending quotes */
VAR_SERVER_CERT_FILE = 348,
VAR_CONTROL_KEY_FILE = 349,
VAR_CONTROL_CERT_FILE = 350,
- VAR_EXTENDED_STATISTICS = 351,
- VAR_LOCAL_DATA_PTR = 352,
- VAR_JOSTLE_TIMEOUT = 353,
- VAR_STUB_PRIME = 354,
- VAR_UNWANTED_REPLY_THRESHOLD = 355,
- VAR_LOG_TIME_ASCII = 356,
- VAR_DOMAIN_INSECURE = 357,
- VAR_PYTHON = 358,
- VAR_PYTHON_SCRIPT = 359,
- VAR_VAL_SIG_SKEW_MIN = 360,
- VAR_VAL_SIG_SKEW_MAX = 361,
- VAR_CACHE_MIN_TTL = 362,
- VAR_VAL_LOG_LEVEL = 363,
- VAR_AUTO_TRUST_ANCHOR_FILE = 364,
- VAR_KEEP_MISSING = 365,
- VAR_ADD_HOLDDOWN = 366,
- VAR_DEL_HOLDDOWN = 367,
- VAR_SO_RCVBUF = 368,
- VAR_EDNS_BUFFER_SIZE = 369,
- VAR_PREFETCH = 370,
- VAR_PREFETCH_KEY = 371,
- VAR_SO_SNDBUF = 372,
- VAR_SO_REUSEPORT = 373,
- VAR_HARDEN_BELOW_NXDOMAIN = 374,
- VAR_IGNORE_CD_FLAG = 375,
- VAR_LOG_QUERIES = 376,
- VAR_TCP_UPSTREAM = 377,
- VAR_SSL_UPSTREAM = 378,
- VAR_SSL_SERVICE_KEY = 379,
- VAR_SSL_SERVICE_PEM = 380,
- VAR_SSL_PORT = 381,
- VAR_FORWARD_FIRST = 382,
- VAR_STUB_FIRST = 383,
- VAR_MINIMAL_RESPONSES = 384,
- VAR_RRSET_ROUNDROBIN = 385,
- VAR_MAX_UDP_SIZE = 386,
- VAR_DELAY_CLOSE = 387,
- VAR_SEND_CLIENT_SUBNET = 388,
- VAR_CLIENT_SUBNET_OPCODE = 389,
- VAR_MAX_CLIENT_SUBNET_IPV4 = 390,
- VAR_MAX_CLIENT_SUBNET_IPV6 = 391
+ VAR_CONTROL_USE_CERT = 351,
+ VAR_EXTENDED_STATISTICS = 352,
+ VAR_LOCAL_DATA_PTR = 353,
+ VAR_JOSTLE_TIMEOUT = 354,
+ VAR_STUB_PRIME = 355,
+ VAR_UNWANTED_REPLY_THRESHOLD = 356,
+ VAR_LOG_TIME_ASCII = 357,
+ VAR_DOMAIN_INSECURE = 358,
+ VAR_PYTHON = 359,
+ VAR_PYTHON_SCRIPT = 360,
+ VAR_VAL_SIG_SKEW_MIN = 361,
+ VAR_VAL_SIG_SKEW_MAX = 362,
+ VAR_CACHE_MIN_TTL = 363,
+ VAR_VAL_LOG_LEVEL = 364,
+ VAR_AUTO_TRUST_ANCHOR_FILE = 365,
+ VAR_KEEP_MISSING = 366,
+ VAR_ADD_HOLDDOWN = 367,
+ VAR_DEL_HOLDDOWN = 368,
+ VAR_SO_RCVBUF = 369,
+ VAR_EDNS_BUFFER_SIZE = 370,
+ VAR_PREFETCH = 371,
+ VAR_PREFETCH_KEY = 372,
+ VAR_SO_SNDBUF = 373,
+ VAR_SO_REUSEPORT = 374,
+ VAR_HARDEN_BELOW_NXDOMAIN = 375,
+ VAR_IGNORE_CD_FLAG = 376,
+ VAR_LOG_QUERIES = 377,
+ VAR_TCP_UPSTREAM = 378,
+ VAR_SSL_UPSTREAM = 379,
+ VAR_SSL_SERVICE_KEY = 380,
+ VAR_SSL_SERVICE_PEM = 381,
+ VAR_SSL_PORT = 382,
+ VAR_FORWARD_FIRST = 383,
+ VAR_STUB_FIRST = 384,
+ VAR_MINIMAL_RESPONSES = 385,
+ VAR_RRSET_ROUNDROBIN = 386,
+ VAR_MAX_UDP_SIZE = 387,
+ VAR_DELAY_CLOSE = 388,
+ VAR_UNBLOCK_LAN_ZONES = 389,
+ VAR_INFRA_CACHE_MIN_RTT = 390,
+ VAR_DNS64_PREFIX = 391,
+ VAR_DNS64_SYNTHALL = 392,
+ VAR_DNSTAP = 393,
+ VAR_DNSTAP_ENABLE = 394,
+ VAR_DNSTAP_SOCKET_PATH = 395,
+ VAR_DNSTAP_SEND_IDENTITY = 396,
+ VAR_DNSTAP_SEND_VERSION = 397,
+ VAR_DNSTAP_IDENTITY = 398,
+ VAR_DNSTAP_VERSION = 399,
+ VAR_DNSTAP_LOG_RESOLVER_QUERY_MESSAGES = 400,
+ VAR_DNSTAP_LOG_RESOLVER_RESPONSE_MESSAGES = 401,
+ VAR_DNSTAP_LOG_CLIENT_QUERY_MESSAGES = 402,
+ VAR_DNSTAP_LOG_CLIENT_RESPONSE_MESSAGES = 403,
+ VAR_DNSTAP_LOG_FORWARDER_QUERY_MESSAGES = 404,
+ VAR_DNSTAP_LOG_FORWARDER_RESPONSE_MESSAGES = 405,
+ VAR_HARDEN_ALGO_DOWNGRADE = 406,
+ VAR_IP_TRANSPARENT = 407,
+ VAR_RATELIMIT = 408,
+ VAR_RATELIMIT_SLABS = 409,
+ VAR_RATELIMIT_SIZE = 410,
+ VAR_RATELIMIT_FOR_DOMAIN = 411,
+ VAR_RATELIMIT_BELOW_DOMAIN = 412,
+ VAR_RATELIMIT_FACTOR = 413,
+ VAR_SEND_CLIENT_SUBNET = 414,
+ VAR_CLIENT_SUBNET_OPCODE = 415,
+ VAR_MAX_CLIENT_SUBNET_IPV4 = 416,
+ VAR_MAX_CLIENT_SUBNET_IPV6 = 417
};
#endif
/* Tokens. */
#define VAR_SERVER_CERT_FILE 348
#define VAR_CONTROL_KEY_FILE 349
#define VAR_CONTROL_CERT_FILE 350
-#define VAR_EXTENDED_STATISTICS 351
-#define VAR_LOCAL_DATA_PTR 352
-#define VAR_JOSTLE_TIMEOUT 353
-#define VAR_STUB_PRIME 354
-#define VAR_UNWANTED_REPLY_THRESHOLD 355
-#define VAR_LOG_TIME_ASCII 356
-#define VAR_DOMAIN_INSECURE 357
-#define VAR_PYTHON 358
-#define VAR_PYTHON_SCRIPT 359
-#define VAR_VAL_SIG_SKEW_MIN 360
-#define VAR_VAL_SIG_SKEW_MAX 361
-#define VAR_CACHE_MIN_TTL 362
-#define VAR_VAL_LOG_LEVEL 363
-#define VAR_AUTO_TRUST_ANCHOR_FILE 364
-#define VAR_KEEP_MISSING 365
-#define VAR_ADD_HOLDDOWN 366
-#define VAR_DEL_HOLDDOWN 367
-#define VAR_SO_RCVBUF 368
-#define VAR_EDNS_BUFFER_SIZE 369
-#define VAR_PREFETCH 370
-#define VAR_PREFETCH_KEY 371
-#define VAR_SO_SNDBUF 372
-#define VAR_SO_REUSEPORT 373
-#define VAR_HARDEN_BELOW_NXDOMAIN 374
-#define VAR_IGNORE_CD_FLAG 375
-#define VAR_LOG_QUERIES 376
-#define VAR_TCP_UPSTREAM 377
-#define VAR_SSL_UPSTREAM 378
-#define VAR_SSL_SERVICE_KEY 379
-#define VAR_SSL_SERVICE_PEM 380
-#define VAR_SSL_PORT 381
-#define VAR_FORWARD_FIRST 382
-#define VAR_STUB_FIRST 383
-#define VAR_MINIMAL_RESPONSES 384
-#define VAR_RRSET_ROUNDROBIN 385
-#define VAR_MAX_UDP_SIZE 386
-#define VAR_DELAY_CLOSE 387
-#define VAR_SEND_CLIENT_SUBNET 388
-#define VAR_CLIENT_SUBNET_OPCODE 389
-#define VAR_MAX_CLIENT_SUBNET_IPV4 390
-#define VAR_MAX_CLIENT_SUBNET_IPV6 391
+#define VAR_CONTROL_USE_CERT 351
+#define VAR_EXTENDED_STATISTICS 352
+#define VAR_LOCAL_DATA_PTR 353
+#define VAR_JOSTLE_TIMEOUT 354
+#define VAR_STUB_PRIME 355
+#define VAR_UNWANTED_REPLY_THRESHOLD 356
+#define VAR_LOG_TIME_ASCII 357
+#define VAR_DOMAIN_INSECURE 358
+#define VAR_PYTHON 359
+#define VAR_PYTHON_SCRIPT 360
+#define VAR_VAL_SIG_SKEW_MIN 361
+#define VAR_VAL_SIG_SKEW_MAX 362
+#define VAR_CACHE_MIN_TTL 363
+#define VAR_VAL_LOG_LEVEL 364
+#define VAR_AUTO_TRUST_ANCHOR_FILE 365
+#define VAR_KEEP_MISSING 366
+#define VAR_ADD_HOLDDOWN 367
+#define VAR_DEL_HOLDDOWN 368
+#define VAR_SO_RCVBUF 369
+#define VAR_EDNS_BUFFER_SIZE 370
+#define VAR_PREFETCH 371
+#define VAR_PREFETCH_KEY 372
+#define VAR_SO_SNDBUF 373
+#define VAR_SO_REUSEPORT 374
+#define VAR_HARDEN_BELOW_NXDOMAIN 375
+#define VAR_IGNORE_CD_FLAG 376
+#define VAR_LOG_QUERIES 377
+#define VAR_TCP_UPSTREAM 378
+#define VAR_SSL_UPSTREAM 379
+#define VAR_SSL_SERVICE_KEY 380
+#define VAR_SSL_SERVICE_PEM 381
+#define VAR_SSL_PORT 382
+#define VAR_FORWARD_FIRST 383
+#define VAR_STUB_FIRST 384
+#define VAR_MINIMAL_RESPONSES 385
+#define VAR_RRSET_ROUNDROBIN 386
+#define VAR_MAX_UDP_SIZE 387
+#define VAR_DELAY_CLOSE 388
+#define VAR_UNBLOCK_LAN_ZONES 389
+#define VAR_INFRA_CACHE_MIN_RTT 390
+#define VAR_DNS64_PREFIX 391
+#define VAR_DNS64_SYNTHALL 392
+#define VAR_DNSTAP 393
+#define VAR_DNSTAP_ENABLE 394
+#define VAR_DNSTAP_SOCKET_PATH 395
+#define VAR_DNSTAP_SEND_IDENTITY 396
+#define VAR_DNSTAP_SEND_VERSION 397
+#define VAR_DNSTAP_IDENTITY 398
+#define VAR_DNSTAP_VERSION 399
+#define VAR_DNSTAP_LOG_RESOLVER_QUERY_MESSAGES 400
+#define VAR_DNSTAP_LOG_RESOLVER_RESPONSE_MESSAGES 401
+#define VAR_DNSTAP_LOG_CLIENT_QUERY_MESSAGES 402
+#define VAR_DNSTAP_LOG_CLIENT_RESPONSE_MESSAGES 403
+#define VAR_DNSTAP_LOG_FORWARDER_QUERY_MESSAGES 404
+#define VAR_DNSTAP_LOG_FORWARDER_RESPONSE_MESSAGES 405
+#define VAR_HARDEN_ALGO_DOWNGRADE 406
+#define VAR_IP_TRANSPARENT 407
+#define VAR_RATELIMIT 408
+#define VAR_RATELIMIT_SLABS 409
+#define VAR_RATELIMIT_SIZE 410
+#define VAR_RATELIMIT_FOR_DOMAIN 411
+#define VAR_RATELIMIT_BELOW_DOMAIN 412
+#define VAR_RATELIMIT_FACTOR 413
+#define VAR_SEND_CLIENT_SUBNET 414
+#define VAR_CLIENT_SUBNET_OPCODE 415
+#define VAR_MAX_CLIENT_SUBNET_IPV4 416
+#define VAR_MAX_CLIENT_SUBNET_IPV6 417
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
char* str;
-#line 409 "util/configparser.c" /* yacc.c:355 */
+#line 461 "util/configparser.c" /* yacc.c:355 */
};
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
/* Copy the second part of user declarations. */
-#line 424 "util/configparser.c" /* yacc.c:358 */
+#line 476 "util/configparser.c" /* yacc.c:358 */
#ifdef short
# undef short
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 2
/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 252
+#define YYLAST 305
/* YYNTOKENS -- Number of terminals. */
-#define YYNTOKENS 137
+#define YYNTOKENS 163
/* YYNNTS -- Number of nonterminals. */
-#define YYNNTS 140
+#define YYNNTS 168
/* YYNRULES -- Number of rules. */
-#define YYNRULES 267
+#define YYNRULES 321
/* YYNSTATES -- Number of states. */
-#define YYNSTATES 392
+#define YYNSTATES 473
/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
by yylex, with out-of-bounds checking. */
#define YYUNDEFTOK 2
-#define YYMAXUTOK 391
+#define YYMAXUTOK 417
#define YYTRANSLATE(YYX) \
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
- 135, 136
+ 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
+ 145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
+ 155, 156, 157, 158, 159, 160, 161, 162
};
#if YYDEBUG
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 113, 113, 113, 114, 114, 115, 115, 116, 120,
- 125, 126, 127, 127, 127, 128, 128, 129, 129, 129,
- 130, 130, 130, 131, 131, 131, 132, 132, 133, 133,
- 134, 134, 135, 135, 136, 136, 137, 137, 138, 138,
- 139, 139, 140, 140, 140, 141, 141, 141, 142, 142,
- 142, 143, 143, 144, 144, 145, 145, 146, 146, 147,
- 147, 147, 148, 148, 149, 149, 150, 150, 150, 151,
- 151, 152, 152, 153, 153, 154, 154, 154, 155, 155,
- 156, 156, 157, 157, 158, 158, 159, 159, 160, 160,
- 160, 161, 161, 162, 162, 162, 163, 163, 163, 164,
- 164, 164, 165, 165, 165, 166, 166, 166, 167, 167,
- 167, 168, 168, 169, 169, 170, 170, 172, 184, 185,
- 186, 186, 186, 186, 186, 188, 200, 201, 202, 202,
- 202, 202, 204, 213, 222, 233, 242, 251, 260, 271,
- 286, 303, 320, 333, 348, 357, 366, 375, 384, 393,
- 402, 411, 420, 429, 438, 447, 456, 463, 470, 479,
- 488, 502, 511, 520, 527, 534, 541, 549, 556, 563,
- 570, 577, 585, 593, 601, 608, 615, 624, 633, 640,
- 647, 655, 663, 673, 686, 697, 705, 718, 727, 736,
- 745, 753, 766, 775, 783, 792, 800, 813, 820, 830,
- 840, 850, 860, 870, 880, 890, 897, 904, 913, 922,
- 931, 938, 948, 965, 972, 990, 1003, 1016, 1025, 1034,
- 1043, 1053, 1063, 1072, 1081, 1088, 1097, 1106, 1115, 1123,
- 1136, 1144, 1166, 1173, 1188, 1198, 1208, 1215, 1225, 1232,
- 1239, 1248, 1258, 1268, 1275, 1282, 1291, 1296, 1297, 1298,
- 1298, 1298, 1299, 1299, 1299, 1300, 1302, 1312, 1321, 1328,
- 1335, 1342, 1349, 1356, 1361, 1362, 1363, 1365
+ 0, 129, 129, 129, 130, 130, 131, 131, 132, 132,
+ 136, 141, 142, 143, 143, 143, 144, 144, 145, 145,
+ 145, 146, 146, 146, 147, 147, 147, 148, 148, 149,
+ 149, 150, 150, 151, 151, 152, 152, 153, 153, 154,
+ 154, 155, 155, 156, 156, 156, 157, 157, 157, 158,
+ 158, 158, 159, 159, 160, 160, 161, 161, 162, 162,
+ 163, 163, 163, 164, 164, 165, 165, 166, 166, 166,
+ 167, 167, 168, 168, 169, 169, 170, 170, 170, 171,
+ 171, 172, 172, 173, 173, 174, 174, 175, 175, 176,
+ 176, 176, 177, 177, 178, 178, 178, 179, 179, 179,
+ 180, 180, 180, 181, 181, 181, 182, 182, 182, 183,
+ 183, 183, 184, 184, 184, 185, 185, 186, 186, 187,
+ 187, 187, 188, 188, 189, 189, 190, 190, 191, 191,
+ 193, 205, 206, 207, 207, 207, 207, 207, 209, 221,
+ 222, 223, 223, 223, 223, 225, 234, 243, 254, 263,
+ 272, 281, 292, 307, 324, 341, 354, 369, 378, 387,
+ 396, 405, 414, 423, 432, 441, 450, 459, 468, 477,
+ 484, 491, 500, 509, 523, 532, 541, 548, 555, 562,
+ 570, 577, 584, 591, 598, 606, 614, 622, 629, 636,
+ 645, 654, 661, 668, 676, 684, 694, 704, 717, 728,
+ 736, 749, 758, 767, 776, 786, 794, 807, 816, 824,
+ 833, 841, 854, 863, 870, 880, 890, 900, 910, 920,
+ 930, 940, 950, 957, 964, 973, 982, 991, 998, 1008,
+ 1025, 1032, 1050, 1063, 1076, 1085, 1094, 1103, 1113, 1123,
+ 1132, 1141, 1148, 1157, 1166, 1175, 1183, 1196, 1204, 1228,
+ 1235, 1250, 1260, 1270, 1277, 1284, 1293, 1302, 1310, 1323,
+ 1336, 1349, 1358, 1368, 1375, 1382, 1391, 1401, 1411, 1418,
+ 1425, 1434, 1439, 1440, 1441, 1441, 1441, 1442, 1442, 1442,
+ 1443, 1443, 1445, 1455, 1464, 1471, 1481, 1488, 1495, 1502,
+ 1509, 1514, 1515, 1516, 1516, 1517, 1517, 1518, 1518, 1519,
+ 1520, 1521, 1522, 1523, 1524, 1526, 1534, 1541, 1549, 1557,
+ 1564, 1571, 1580, 1589, 1598, 1607, 1616, 1625, 1630, 1631,
+ 1632, 1634
};
#endif
"VAR_PRIVATE_DOMAIN", "VAR_REMOTE_CONTROL", "VAR_CONTROL_ENABLE",
"VAR_CONTROL_INTERFACE", "VAR_CONTROL_PORT", "VAR_SERVER_KEY_FILE",
"VAR_SERVER_CERT_FILE", "VAR_CONTROL_KEY_FILE", "VAR_CONTROL_CERT_FILE",
- "VAR_EXTENDED_STATISTICS", "VAR_LOCAL_DATA_PTR", "VAR_JOSTLE_TIMEOUT",
- "VAR_STUB_PRIME", "VAR_UNWANTED_REPLY_THRESHOLD", "VAR_LOG_TIME_ASCII",
- "VAR_DOMAIN_INSECURE", "VAR_PYTHON", "VAR_PYTHON_SCRIPT",
- "VAR_VAL_SIG_SKEW_MIN", "VAR_VAL_SIG_SKEW_MAX", "VAR_CACHE_MIN_TTL",
- "VAR_VAL_LOG_LEVEL", "VAR_AUTO_TRUST_ANCHOR_FILE", "VAR_KEEP_MISSING",
- "VAR_ADD_HOLDDOWN", "VAR_DEL_HOLDDOWN", "VAR_SO_RCVBUF",
- "VAR_EDNS_BUFFER_SIZE", "VAR_PREFETCH", "VAR_PREFETCH_KEY",
- "VAR_SO_SNDBUF", "VAR_SO_REUSEPORT", "VAR_HARDEN_BELOW_NXDOMAIN",
- "VAR_IGNORE_CD_FLAG", "VAR_LOG_QUERIES", "VAR_TCP_UPSTREAM",
- "VAR_SSL_UPSTREAM", "VAR_SSL_SERVICE_KEY", "VAR_SSL_SERVICE_PEM",
- "VAR_SSL_PORT", "VAR_FORWARD_FIRST", "VAR_STUB_FIRST",
- "VAR_MINIMAL_RESPONSES", "VAR_RRSET_ROUNDROBIN", "VAR_MAX_UDP_SIZE",
- "VAR_DELAY_CLOSE", "VAR_SEND_CLIENT_SUBNET", "VAR_CLIENT_SUBNET_OPCODE",
+ "VAR_CONTROL_USE_CERT", "VAR_EXTENDED_STATISTICS", "VAR_LOCAL_DATA_PTR",
+ "VAR_JOSTLE_TIMEOUT", "VAR_STUB_PRIME", "VAR_UNWANTED_REPLY_THRESHOLD",
+ "VAR_LOG_TIME_ASCII", "VAR_DOMAIN_INSECURE", "VAR_PYTHON",
+ "VAR_PYTHON_SCRIPT", "VAR_VAL_SIG_SKEW_MIN", "VAR_VAL_SIG_SKEW_MAX",
+ "VAR_CACHE_MIN_TTL", "VAR_VAL_LOG_LEVEL", "VAR_AUTO_TRUST_ANCHOR_FILE",
+ "VAR_KEEP_MISSING", "VAR_ADD_HOLDDOWN", "VAR_DEL_HOLDDOWN",
+ "VAR_SO_RCVBUF", "VAR_EDNS_BUFFER_SIZE", "VAR_PREFETCH",
+ "VAR_PREFETCH_KEY", "VAR_SO_SNDBUF", "VAR_SO_REUSEPORT",
+ "VAR_HARDEN_BELOW_NXDOMAIN", "VAR_IGNORE_CD_FLAG", "VAR_LOG_QUERIES",
+ "VAR_TCP_UPSTREAM", "VAR_SSL_UPSTREAM", "VAR_SSL_SERVICE_KEY",
+ "VAR_SSL_SERVICE_PEM", "VAR_SSL_PORT", "VAR_FORWARD_FIRST",
+ "VAR_STUB_FIRST", "VAR_MINIMAL_RESPONSES", "VAR_RRSET_ROUNDROBIN",
+ "VAR_MAX_UDP_SIZE", "VAR_DELAY_CLOSE", "VAR_UNBLOCK_LAN_ZONES",
+ "VAR_INFRA_CACHE_MIN_RTT", "VAR_DNS64_PREFIX", "VAR_DNS64_SYNTHALL",
+ "VAR_DNSTAP", "VAR_DNSTAP_ENABLE", "VAR_DNSTAP_SOCKET_PATH",
+ "VAR_DNSTAP_SEND_IDENTITY", "VAR_DNSTAP_SEND_VERSION",
+ "VAR_DNSTAP_IDENTITY", "VAR_DNSTAP_VERSION",
+ "VAR_DNSTAP_LOG_RESOLVER_QUERY_MESSAGES",
+ "VAR_DNSTAP_LOG_RESOLVER_RESPONSE_MESSAGES",
+ "VAR_DNSTAP_LOG_CLIENT_QUERY_MESSAGES",
+ "VAR_DNSTAP_LOG_CLIENT_RESPONSE_MESSAGES",
+ "VAR_DNSTAP_LOG_FORWARDER_QUERY_MESSAGES",
+ "VAR_DNSTAP_LOG_FORWARDER_RESPONSE_MESSAGES",
+ "VAR_HARDEN_ALGO_DOWNGRADE", "VAR_IP_TRANSPARENT", "VAR_RATELIMIT",
+ "VAR_RATELIMIT_SLABS", "VAR_RATELIMIT_SIZE", "VAR_RATELIMIT_FOR_DOMAIN",
+ "VAR_RATELIMIT_BELOW_DOMAIN", "VAR_RATELIMIT_FACTOR",
+ "VAR_SEND_CLIENT_SUBNET", "VAR_CLIENT_SUBNET_OPCODE",
"VAR_MAX_CLIENT_SUBNET_IPV4", "VAR_MAX_CLIENT_SUBNET_IPV6", "$accept",
"toplevelvars", "toplevelvar", "serverstart", "contents_server",
"content_server", "stubstart", "contents_stub", "content_stub",
"server_trust_anchor", "server_domain_insecure", "server_hide_identity",
"server_hide_version", "server_identity", "server_version",
"server_so_rcvbuf", "server_so_sndbuf", "server_so_reuseport",
- "server_edns_buffer_size", "server_msg_buffer_size",
- "server_msg_cache_size", "server_msg_cache_slabs",
- "server_num_queries_per_thread", "server_jostle_timeout",
- "server_delay_close", "server_rrset_cache_size",
+ "server_ip_transparent", "server_edns_buffer_size",
+ "server_msg_buffer_size", "server_msg_cache_size",
+ "server_msg_cache_slabs", "server_num_queries_per_thread",
+ "server_jostle_timeout", "server_delay_close",
+ "server_unblock_lan_zones", "server_rrset_cache_size",
"server_rrset_cache_slabs", "server_infra_host_ttl",
"server_infra_lame_ttl", "server_infra_cache_numhosts",
"server_infra_cache_lame_size", "server_infra_cache_slabs",
- "server_target_fetch_policy", "server_harden_short_bufsize",
- "server_harden_large_queries", "server_harden_glue",
- "server_harden_dnssec_stripped", "server_harden_below_nxdomain",
- "server_harden_referral_path", "server_use_caps_for_id",
+ "server_infra_cache_min_rtt", "server_target_fetch_policy",
+ "server_harden_short_bufsize", "server_harden_large_queries",
+ "server_harden_glue", "server_harden_dnssec_stripped",
+ "server_harden_below_nxdomain", "server_harden_referral_path",
+ "server_harden_algo_downgrade", "server_use_caps_for_id",
"server_private_address", "server_private_domain", "server_prefetch",
"server_prefetch_key", "server_unwanted_reply_threshold",
"server_do_not_query_address", "server_do_not_query_localhost",
"server_del_holddown", "server_keep_missing", "server_key_cache_size",
"server_key_cache_slabs", "server_neg_cache_size", "server_local_zone",
"server_local_data", "server_local_data_ptr", "server_minimal_responses",
- "server_rrset_roundrobin", "server_max_udp_size", "stub_name",
+ "server_rrset_roundrobin", "server_max_udp_size", "server_dns64_prefix",
+ "server_dns64_synthall", "server_ratelimit", "server_ratelimit_size",
+ "server_ratelimit_slabs", "server_ratelimit_for_domain",
+ "server_ratelimit_below_domain", "server_ratelimit_factor", "stub_name",
"stub_host", "stub_addr", "stub_first", "stub_prime", "forward_name",
"forward_host", "forward_addr", "forward_first", "rcstart",
"contents_rc", "content_rc", "rc_control_enable", "rc_control_port",
- "rc_control_interface", "rc_server_key_file", "rc_server_cert_file",
- "rc_control_key_file", "rc_control_cert_file", "pythonstart",
+ "rc_control_interface", "rc_control_use_cert", "rc_server_key_file",
+ "rc_server_cert_file", "rc_control_key_file", "rc_control_cert_file",
+ "dtstart", "contents_dt", "content_dt", "dt_dnstap_enable",
+ "dt_dnstap_socket_path", "dt_dnstap_send_identity",
+ "dt_dnstap_send_version", "dt_dnstap_identity", "dt_dnstap_version",
+ "dt_dnstap_log_resolver_query_messages",
+ "dt_dnstap_log_resolver_response_messages",
+ "dt_dnstap_log_client_query_messages",
+ "dt_dnstap_log_client_response_messages",
+ "dt_dnstap_log_forwarder_query_messages",
+ "dt_dnstap_log_forwarder_response_messages", "pythonstart",
"contents_py", "content_py", "py_script", YY_NULLPTR
};
#endif
355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
- 385, 386, 387, 388, 389, 390, 391
+ 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
+ 395, 396, 397, 398, 399, 400, 401, 402, 403, 404,
+ 405, 406, 407, 408, 409, 410, 411, 412, 413, 414,
+ 415, 416, 417
};
# endif
-#define YYPACT_NINF -80
+#define YYPACT_NINF -81
#define yypact_value_is_default(Yystate) \
- (!!((Yystate) == (-80)))
+ (!!((Yystate) == (-81)))
#define YYTABLE_NINF -1
STATE-NUM. */
static const yytype_int16 yypact[] =
{
- -80, 115, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -12, 39, 46, 38, -79, 16,
- 17, 18, 22, 23, 24, 67, 70, 71, 72, 77,
- 106, 124, 125, 126, 127, 129, 130, 131, 132, 133,
- 134, 135, 136, 137, 138, 139, 140, 141, 142, 144,
- 145, 146, 147, 148, 150, 151, 152, 153, 154, 155,
- 156, 158, 159, 160, 161, 162, 164, 165, 166, 167,
+ -81, 116, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -12, 89, 47, -13,
+ 22, -80, 16, 17, 18, 23, 24, 78, 107, 120,
+ 121, 122, 123, 124, 125, 126, 127, 128, 141, 142,
+ 143, 145, 146, 147, 148, 149, 163, 164, 166, 167,
168, 169, 170, 171, 172, 173, 174, 175, 176, 177,
- 178, 179, 180, 181, 182, 183, 184, 185, 186, 187,
- 188, 189, 190, 191, 192, 194, 195, 196, 197, 198,
- 199, 200, 201, 202, 203, 204, 205, 206, 207, 209,
- 210, 211, 212, 213, 214, 215, 216, 217, 218, 219,
- 220, 221, 222, 223, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- 224, 225, 226, 227, 228, -80, -80, -80, -80, -80,
- -80, 229, 230, 231, 232, -80, -80, -80, -80, -80,
- 233, 234, 235, 236, 237, 238, 239, -80, -80, -80,
- -80, -80, -80, -80, -80, 240, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, 241, 242, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80
+ 178, 180, 181, 182, 183, 184, 185, 186, 187, 188,
+ 189, 190, 191, 192, 193, 195, 196, 197, 198, 199,
+ 200, 201, 202, 203, 204, 205, 206, 207, 209, 211,
+ 212, 213, 214, 215, 216, 217, 218, 219, 220, 221,
+ 222, 223, 224, 225, 226, 227, 228, 229, 230, 231,
+ 232, 233, 234, 235, 236, 237, 238, 239, 240, 241,
+ 242, 243, 245, 246, 247, 248, 249, 250, 251, 252,
+ 253, 254, 255, 256, 257, 258, 259, 260, 261, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, 262, 263, 264,
+ 265, 266, -81, -81, -81, -81, -81, -81, 267, 268,
+ 269, 270, -81, -81, -81, -81, -81, 271, 272, 273,
+ 274, 275, 276, 277, 278, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, 279, 280, 281, 282, 283, 284,
+ 285, 286, 287, 288, 289, 290, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, 291,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, 292, 293, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, 294, 295, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81
};
/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
means the default is an error. */
static const yytype_uint16 yydefact[] =
{
- 2, 0, 1, 9, 117, 125, 246, 263, 3, 11,
- 119, 127, 248, 265, 4, 5, 6, 8, 7, 0,
+ 2, 0, 1, 10, 130, 138, 271, 317, 290, 3,
+ 12, 132, 140, 273, 292, 319, 4, 5, 6, 8,
+ 9, 7, 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, 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, 0, 0, 0, 0,
- 0, 0, 0, 0, 10, 12, 13, 69, 72, 81,
- 14, 113, 114, 115, 116, 20, 60, 15, 73, 74,
- 31, 53, 68, 16, 17, 18, 19, 103, 104, 105,
- 106, 107, 70, 59, 85, 102, 21, 22, 23, 24,
- 25, 61, 75, 76, 91, 47, 57, 48, 86, 41,
- 42, 43, 44, 95, 99, 111, 96, 54, 26, 27,
- 28, 83, 112, 29, 30, 32, 33, 35, 36, 34,
- 37, 38, 39, 45, 64, 100, 78, 71, 79, 80,
- 97, 98, 84, 40, 62, 65, 46, 49, 87, 88,
- 63, 89, 50, 51, 52, 101, 90, 58, 92, 93,
- 94, 55, 56, 77, 66, 67, 82, 108, 109, 110,
- 0, 0, 0, 0, 0, 118, 120, 121, 122, 124,
- 123, 0, 0, 0, 0, 126, 128, 129, 130, 131,
- 0, 0, 0, 0, 0, 0, 0, 247, 249, 251,
- 250, 252, 253, 254, 255, 0, 264, 266, 133, 132,
- 137, 144, 142, 150, 151, 152, 153, 163, 164, 165,
- 166, 167, 185, 186, 187, 190, 191, 147, 192, 193,
- 196, 194, 195, 197, 198, 199, 210, 176, 177, 178,
- 179, 200, 213, 172, 174, 214, 219, 220, 221, 148,
- 184, 228, 229, 173, 224, 160, 143, 168, 211, 217,
- 201, 0, 0, 232, 149, 134, 159, 204, 135, 145,
- 146, 169, 170, 230, 203, 205, 206, 136, 233, 188,
- 209, 161, 175, 215, 216, 218, 223, 171, 227, 225,
- 226, 180, 183, 207, 208, 181, 182, 202, 222, 162,
- 154, 155, 156, 157, 158, 234, 235, 236, 189, 138,
- 139, 140, 141, 237, 238, 239, 241, 240, 242, 243,
- 244, 245, 256, 258, 257, 259, 260, 261, 262, 267,
- 212, 231
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 11,
+ 13, 14, 70, 73, 82, 15, 126, 127, 128, 129,
+ 21, 61, 16, 74, 75, 32, 54, 69, 17, 18,
+ 19, 20, 104, 105, 106, 107, 108, 71, 60, 86,
+ 103, 22, 23, 24, 25, 26, 62, 76, 77, 92,
+ 48, 58, 49, 87, 42, 43, 44, 45, 96, 100,
+ 112, 119, 97, 55, 27, 28, 29, 84, 113, 114,
+ 30, 31, 33, 34, 36, 37, 35, 117, 38, 39,
+ 40, 46, 65, 101, 79, 118, 72, 80, 81, 98,
+ 99, 85, 41, 63, 66, 47, 50, 88, 89, 64,
+ 90, 51, 52, 53, 102, 91, 59, 93, 94, 95,
+ 56, 57, 78, 67, 68, 83, 109, 110, 111, 115,
+ 116, 120, 122, 121, 123, 124, 125, 0, 0, 0,
+ 0, 0, 131, 133, 134, 135, 137, 136, 0, 0,
+ 0, 0, 139, 141, 142, 143, 144, 0, 0, 0,
+ 0, 0, 0, 0, 0, 272, 274, 276, 275, 281,
+ 277, 278, 279, 280, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 291, 293, 294, 295,
+ 296, 297, 298, 299, 300, 301, 302, 303, 304, 0,
+ 318, 320, 146, 145, 150, 157, 155, 163, 164, 165,
+ 166, 176, 177, 178, 179, 180, 199, 200, 201, 205,
+ 206, 160, 207, 208, 211, 209, 210, 213, 214, 215,
+ 227, 189, 190, 191, 192, 216, 230, 185, 187, 231,
+ 236, 237, 238, 161, 198, 245, 246, 186, 241, 173,
+ 156, 181, 228, 234, 217, 0, 0, 249, 162, 147,
+ 172, 221, 148, 158, 159, 182, 183, 247, 219, 222,
+ 223, 149, 250, 202, 226, 174, 188, 232, 233, 235,
+ 240, 184, 244, 242, 243, 193, 197, 224, 225, 194,
+ 195, 218, 239, 175, 167, 168, 169, 170, 171, 251,
+ 252, 253, 203, 204, 212, 254, 255, 220, 196, 256,
+ 258, 257, 0, 0, 261, 151, 152, 153, 154, 262,
+ 263, 264, 266, 265, 267, 268, 269, 270, 282, 284,
+ 283, 286, 287, 288, 289, 285, 305, 306, 307, 308,
+ 309, 310, 311, 312, 313, 314, 315, 316, 321, 229,
+ 248, 259, 260
};
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int8 yypgoto[] =
{
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
+ -81, -81, -81, -81, -81, -81, -81, -81
};
/* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int16 yydefgoto[] =
{
- -1, 1, 8, 9, 14, 124, 10, 15, 235, 11,
- 16, 245, 125, 126, 127, 128, 129, 130, 131, 132,
- 133, 134, 135, 136, 137, 138, 139, 140, 141, 142,
- 143, 144, 145, 146, 147, 148, 149, 150, 151, 152,
- 153, 154, 155, 156, 157, 158, 159, 160, 161, 162,
- 163, 164, 165, 166, 167, 168, 169, 170, 171, 172,
- 173, 174, 175, 176, 177, 178, 179, 180, 181, 182,
- 183, 184, 185, 186, 187, 188, 189, 190, 191, 192,
- 193, 194, 195, 196, 197, 198, 199, 200, 201, 202,
- 203, 204, 205, 206, 207, 208, 209, 210, 211, 212,
- 213, 214, 215, 216, 217, 218, 219, 220, 221, 222,
- 223, 224, 225, 226, 227, 228, 229, 236, 237, 238,
- 239, 240, 246, 247, 248, 249, 12, 17, 257, 258,
- 259, 260, 261, 262, 263, 264, 13, 18, 266, 267
+ -1, 1, 9, 10, 16, 139, 11, 17, 262, 12,
+ 18, 272, 140, 141, 142, 143, 144, 145, 146, 147,
+ 148, 149, 150, 151, 152, 153, 154, 155, 156, 157,
+ 158, 159, 160, 161, 162, 163, 164, 165, 166, 167,
+ 168, 169, 170, 171, 172, 173, 174, 175, 176, 177,
+ 178, 179, 180, 181, 182, 183, 184, 185, 186, 187,
+ 188, 189, 190, 191, 192, 193, 194, 195, 196, 197,
+ 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
+ 208, 209, 210, 211, 212, 213, 214, 215, 216, 217,
+ 218, 219, 220, 221, 222, 223, 224, 225, 226, 227,
+ 228, 229, 230, 231, 232, 233, 234, 235, 236, 237,
+ 238, 239, 240, 241, 242, 243, 244, 245, 246, 247,
+ 248, 249, 250, 251, 252, 253, 254, 255, 256, 263,
+ 264, 265, 266, 267, 273, 274, 275, 276, 13, 19,
+ 285, 286, 287, 288, 289, 290, 291, 292, 293, 14,
+ 20, 306, 307, 308, 309, 310, 311, 312, 313, 314,
+ 315, 316, 317, 318, 15, 21, 320, 321
};
/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
number is the opposite. If YYTABLE_NINF, syntax error. */
static const yytype_uint16 yytable[] =
{
- 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
- 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
- 39, 40, 41, 42, 43, 265, 268, 269, 270, 44,
- 45, 46, 271, 272, 273, 47, 48, 49, 50, 51,
- 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
- 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
- 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
- 82, 83, 84, 85, 86, 87, 230, 274, 231, 232,
- 275, 276, 277, 241, 88, 89, 90, 278, 91, 92,
- 93, 242, 243, 94, 95, 96, 97, 98, 99, 100,
- 101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
- 111, 112, 113, 114, 115, 2, 279, 116, 117, 118,
- 119, 120, 121, 122, 123, 0, 3, 250, 251, 252,
- 253, 254, 255, 256, 280, 281, 282, 283, 233, 284,
- 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
- 295, 296, 297, 4, 298, 299, 300, 301, 302, 5,
- 303, 304, 305, 306, 307, 308, 309, 234, 310, 311,
- 312, 313, 314, 244, 315, 316, 317, 318, 319, 320,
- 321, 322, 323, 324, 325, 326, 327, 328, 329, 330,
- 331, 332, 333, 334, 335, 336, 337, 338, 339, 340,
- 341, 342, 343, 6, 344, 345, 346, 347, 348, 349,
- 350, 351, 352, 353, 354, 355, 356, 357, 7, 358,
- 359, 360, 361, 362, 363, 364, 365, 366, 367, 368,
- 369, 370, 371, 372, 373, 374, 375, 376, 377, 378,
- 379, 380, 381, 382, 383, 384, 385, 386, 387, 388,
- 389, 390, 391
+ 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
+ 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
+ 42, 43, 44, 45, 46, 319, 322, 323, 324, 47,
+ 48, 49, 0, 325, 326, 50, 51, 52, 53, 54,
+ 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
+ 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
+ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
+ 85, 86, 87, 88, 89, 90, 277, 278, 279, 280,
+ 281, 282, 283, 284, 268, 91, 92, 93, 327, 94,
+ 95, 96, 269, 270, 97, 98, 99, 100, 101, 102,
+ 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
+ 113, 114, 115, 116, 117, 118, 2, 328, 119, 120,
+ 121, 122, 123, 124, 125, 126, 257, 3, 258, 259,
+ 329, 330, 331, 332, 333, 334, 335, 336, 337, 127,
+ 128, 129, 130, 131, 132, 133, 134, 135, 136, 137,
+ 138, 338, 339, 340, 4, 341, 342, 343, 344, 345,
+ 5, 294, 295, 296, 297, 298, 299, 300, 301, 302,
+ 303, 304, 305, 346, 347, 271, 348, 349, 350, 351,
+ 352, 353, 354, 355, 356, 357, 358, 359, 360, 260,
+ 361, 362, 363, 364, 365, 366, 367, 368, 369, 370,
+ 371, 372, 373, 374, 6, 375, 376, 377, 378, 379,
+ 380, 381, 382, 383, 384, 385, 386, 387, 261, 388,
+ 7, 389, 390, 391, 392, 393, 394, 395, 396, 397,
+ 398, 399, 400, 401, 402, 403, 404, 405, 406, 407,
+ 408, 409, 410, 411, 412, 413, 414, 415, 416, 417,
+ 418, 419, 420, 421, 8, 422, 423, 424, 425, 426,
+ 427, 428, 429, 430, 431, 432, 433, 434, 435, 436,
+ 437, 438, 439, 440, 441, 442, 443, 444, 445, 446,
+ 447, 448, 449, 450, 451, 452, 453, 454, 455, 456,
+ 457, 458, 459, 460, 461, 462, 463, 464, 465, 466,
+ 467, 468, 469, 470, 471, 472
};
static const yytype_int16 yycheck[] =
{
12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
- 32, 33, 34, 35, 36, 104, 10, 10, 10, 41,
- 42, 43, 10, 10, 10, 47, 48, 49, 50, 51,
+ 32, 33, 34, 35, 36, 105, 10, 10, 10, 41,
+ 42, 43, -1, 10, 10, 47, 48, 49, 50, 51,
52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
- 82, 83, 84, 85, 86, 87, 37, 10, 39, 40,
- 10, 10, 10, 37, 96, 97, 98, 10, 100, 101,
- 102, 45, 46, 105, 106, 107, 108, 109, 110, 111,
+ 82, 83, 84, 85, 86, 87, 89, 90, 91, 92,
+ 93, 94, 95, 96, 37, 97, 98, 99, 10, 101,
+ 102, 103, 45, 46, 106, 107, 108, 109, 110, 111,
112, 113, 114, 115, 116, 117, 118, 119, 120, 121,
- 122, 123, 124, 125, 126, 0, 10, 129, 130, 131,
- 132, 133, 134, 135, 136, -1, 11, 89, 90, 91,
- 92, 93, 94, 95, 10, 10, 10, 10, 99, 10,
+ 122, 123, 124, 125, 126, 127, 0, 10, 130, 131,
+ 132, 133, 134, 135, 136, 137, 37, 11, 39, 40,
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 151,
+ 152, 153, 154, 155, 156, 157, 158, 159, 160, 161,
+ 162, 10, 10, 10, 38, 10, 10, 10, 10, 10,
+ 44, 139, 140, 141, 142, 143, 144, 145, 146, 147,
+ 148, 149, 150, 10, 10, 128, 10, 10, 10, 10,
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 100,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 38, 10, 10, 10, 10, 10, 44,
- 10, 10, 10, 10, 10, 10, 10, 128, 10, 10,
- 10, 10, 10, 127, 10, 10, 10, 10, 10, 10,
+ 10, 10, 10, 10, 88, 10, 10, 10, 10, 10,
+ 10, 10, 10, 10, 10, 10, 10, 10, 129, 10,
+ 104, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 88, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 103, 10,
+ 10, 10, 10, 10, 138, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
+ 10, 10, 10, 10, 10, 10
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
symbol of state STATE-NUM. */
static const yytype_uint16 yystos[] =
{
- 0, 138, 0, 11, 38, 44, 88, 103, 139, 140,
- 143, 146, 263, 273, 141, 144, 147, 264, 274, 12,
- 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
- 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
- 33, 34, 35, 36, 41, 42, 43, 47, 48, 49,
- 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
- 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
- 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
- 80, 81, 82, 83, 84, 85, 86, 87, 96, 97,
- 98, 100, 101, 102, 105, 106, 107, 108, 109, 110,
- 111, 112, 113, 114, 115, 116, 117, 118, 119, 120,
- 121, 122, 123, 124, 125, 126, 129, 130, 131, 132,
- 133, 134, 135, 136, 142, 149, 150, 151, 152, 153,
- 154, 155, 156, 157, 158, 159, 160, 161, 162, 163,
- 164, 165, 166, 167, 168, 169, 170, 171, 172, 173,
- 174, 175, 176, 177, 178, 179, 180, 181, 182, 183,
- 184, 185, 186, 187, 188, 189, 190, 191, 192, 193,
- 194, 195, 196, 197, 198, 199, 200, 201, 202, 203,
- 204, 205, 206, 207, 208, 209, 210, 211, 212, 213,
- 214, 215, 216, 217, 218, 219, 220, 221, 222, 223,
- 224, 225, 226, 227, 228, 229, 230, 231, 232, 233,
- 234, 235, 236, 237, 238, 239, 240, 241, 242, 243,
- 244, 245, 246, 247, 248, 249, 250, 251, 252, 253,
- 37, 39, 40, 99, 128, 145, 254, 255, 256, 257,
- 258, 37, 45, 46, 127, 148, 259, 260, 261, 262,
- 89, 90, 91, 92, 93, 94, 95, 265, 266, 267,
- 268, 269, 270, 271, 272, 104, 275, 276, 10, 10,
+ 0, 164, 0, 11, 38, 44, 88, 104, 138, 165,
+ 166, 169, 172, 301, 312, 327, 167, 170, 173, 302,
+ 313, 328, 12, 13, 14, 15, 16, 17, 18, 19,
+ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
+ 30, 31, 32, 33, 34, 35, 36, 41, 42, 43,
+ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
+ 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
+ 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
+ 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
+ 87, 97, 98, 99, 101, 102, 103, 106, 107, 108,
+ 109, 110, 111, 112, 113, 114, 115, 116, 117, 118,
+ 119, 120, 121, 122, 123, 124, 125, 126, 127, 130,
+ 131, 132, 133, 134, 135, 136, 137, 151, 152, 153,
+ 154, 155, 156, 157, 158, 159, 160, 161, 162, 168,
+ 175, 176, 177, 178, 179, 180, 181, 182, 183, 184,
+ 185, 186, 187, 188, 189, 190, 191, 192, 193, 194,
+ 195, 196, 197, 198, 199, 200, 201, 202, 203, 204,
+ 205, 206, 207, 208, 209, 210, 211, 212, 213, 214,
+ 215, 216, 217, 218, 219, 220, 221, 222, 223, 224,
+ 225, 226, 227, 228, 229, 230, 231, 232, 233, 234,
+ 235, 236, 237, 238, 239, 240, 241, 242, 243, 244,
+ 245, 246, 247, 248, 249, 250, 251, 252, 253, 254,
+ 255, 256, 257, 258, 259, 260, 261, 262, 263, 264,
+ 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
+ 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
+ 285, 286, 287, 288, 289, 290, 291, 37, 39, 40,
+ 100, 129, 171, 292, 293, 294, 295, 296, 37, 45,
+ 46, 128, 174, 297, 298, 299, 300, 89, 90, 91,
+ 92, 93, 94, 95, 96, 303, 304, 305, 306, 307,
+ 308, 309, 310, 311, 139, 140, 141, 142, 143, 144,
+ 145, 146, 147, 148, 149, 150, 314, 315, 316, 317,
+ 318, 319, 320, 321, 322, 323, 324, 325, 326, 105,
+ 329, 330, 10, 10, 10, 10, 10, 10, 10, 10,
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
+ 10, 10, 10
};
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const yytype_uint16 yyr1[] =
{
- 0, 137, 138, 138, 139, 139, 139, 139, 139, 140,
- 141, 141, 142, 142, 142, 142, 142, 142, 142, 142,
- 142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
- 142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
- 142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
- 142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
- 142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
- 142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
- 142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
- 142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
- 142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
- 142, 142, 142, 142, 142, 142, 142, 143, 144, 144,
- 145, 145, 145, 145, 145, 146, 147, 147, 148, 148,
- 148, 148, 149, 150, 151, 152, 153, 154, 155, 156,
- 157, 158, 159, 160, 161, 162, 163, 164, 165, 166,
- 167, 168, 169, 170, 171, 172, 173, 174, 175, 176,
- 177, 178, 179, 180, 181, 182, 183, 184, 185, 186,
- 187, 188, 189, 190, 191, 192, 193, 194, 195, 196,
- 197, 198, 199, 200, 201, 202, 203, 204, 205, 206,
- 207, 208, 209, 210, 211, 212, 213, 214, 215, 216,
- 217, 218, 219, 220, 221, 222, 223, 224, 225, 226,
- 227, 228, 229, 230, 231, 232, 233, 234, 235, 236,
- 237, 238, 239, 240, 241, 242, 243, 244, 245, 246,
- 247, 248, 249, 250, 251, 252, 253, 254, 255, 256,
- 257, 258, 259, 260, 261, 262, 263, 264, 264, 265,
- 265, 265, 265, 265, 265, 265, 266, 267, 268, 269,
- 270, 271, 272, 273, 274, 274, 275, 276
+ 0, 163, 164, 164, 165, 165, 165, 165, 165, 165,
+ 166, 167, 167, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 169, 170, 170, 171, 171, 171, 171, 171, 172, 173,
+ 173, 174, 174, 174, 174, 175, 176, 177, 178, 179,
+ 180, 181, 182, 183, 184, 185, 186, 187, 188, 189,
+ 190, 191, 192, 193, 194, 195, 196, 197, 198, 199,
+ 200, 201, 202, 203, 204, 205, 206, 207, 208, 209,
+ 210, 211, 212, 213, 214, 215, 216, 217, 218, 219,
+ 220, 221, 222, 223, 224, 225, 226, 227, 228, 229,
+ 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
+ 240, 241, 242, 243, 244, 245, 246, 247, 248, 249,
+ 250, 251, 252, 253, 254, 255, 256, 257, 258, 259,
+ 260, 261, 262, 263, 264, 265, 266, 267, 268, 269,
+ 270, 271, 272, 273, 274, 275, 276, 277, 278, 279,
+ 280, 281, 282, 283, 284, 285, 286, 287, 288, 289,
+ 290, 291, 292, 293, 294, 295, 296, 297, 298, 299,
+ 300, 301, 302, 302, 303, 303, 303, 303, 303, 303,
+ 303, 303, 304, 305, 306, 307, 308, 309, 310, 311,
+ 312, 313, 313, 314, 314, 314, 314, 314, 314, 314,
+ 314, 314, 314, 314, 314, 315, 316, 317, 318, 319,
+ 320, 321, 322, 323, 324, 325, 326, 327, 328, 328,
+ 329, 330
};
/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
static const yytype_uint8 yyr2[] =
{
- 0, 2, 0, 2, 2, 2, 2, 2, 2, 1,
- 2, 0, 1, 1, 1, 1, 1, 1, 1, 1,
+ 0, 2, 0, 2, 2, 2, 2, 2, 2, 2,
+ 1, 2, 0, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 2, 0,
- 1, 1, 1, 1, 1, 1, 2, 0, 1, 1,
- 1, 1, 2, 2, 2, 2, 2, 2, 2, 2,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 2, 0, 1, 1, 1, 1, 1, 1, 2,
+ 0, 1, 1, 1, 1, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 3, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 3,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 3, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 1, 2, 0, 1,
- 1, 1, 1, 1, 1, 1, 2, 2, 2, 2,
- 2, 2, 2, 1, 2, 0, 1, 2
+ 2, 2, 2, 2, 2, 2, 2, 2, 3, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 3,
+ 3, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 1, 2, 0, 1, 1, 1, 1, 1, 1,
+ 1, 1, 2, 2, 2, 2, 2, 2, 2, 2,
+ 1, 2, 0, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 1, 2, 0,
+ 1, 2
};
YY_REDUCE_PRINT (yyn);
switch (yyn)
{
- case 9:
-#line 121 "./util/configparser.y" /* yacc.c:1646 */
+ case 10:
+#line 137 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("\nP(server:)\n"));
}
-#line 1885 "util/configparser.c" /* yacc.c:1646 */
+#line 2028 "util/configparser.c" /* yacc.c:1646 */
break;
- case 117:
-#line 173 "./util/configparser.y" /* yacc.c:1646 */
+ case 130:
+#line 194 "./util/configparser.y" /* yacc.c:1646 */
{
struct config_stub* s;
OUTYY(("\nP(stub_zone:)\n"));
} else
yyerror("out of memory");
}
-#line 1900 "util/configparser.c" /* yacc.c:1646 */
+#line 2043 "util/configparser.c" /* yacc.c:1646 */
break;
- case 125:
-#line 189 "./util/configparser.y" /* yacc.c:1646 */
+ case 138:
+#line 210 "./util/configparser.y" /* yacc.c:1646 */
{
struct config_stub* s;
OUTYY(("\nP(forward_zone:)\n"));
} else
yyerror("out of memory");
}
-#line 1915 "util/configparser.c" /* yacc.c:1646 */
+#line 2058 "util/configparser.c" /* yacc.c:1646 */
break;
- case 132:
-#line 205 "./util/configparser.y" /* yacc.c:1646 */
+ case 145:
+#line 226 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_num_threads:%s)\n", (yyvsp[0].str)));
if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0)
else cfg_parser->cfg->num_threads = atoi((yyvsp[0].str));
free((yyvsp[0].str));
}
-#line 1927 "util/configparser.c" /* yacc.c:1646 */
+#line 2070 "util/configparser.c" /* yacc.c:1646 */
break;
- case 133:
-#line 214 "./util/configparser.y" /* yacc.c:1646 */
+ case 146:
+#line 235 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_verbosity:%s)\n", (yyvsp[0].str)));
if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0)
else cfg_parser->cfg->verbosity = atoi((yyvsp[0].str));
free((yyvsp[0].str));
}
-#line 1939 "util/configparser.c" /* yacc.c:1646 */
+#line 2082 "util/configparser.c" /* yacc.c:1646 */
break;
- case 134:
-#line 223 "./util/configparser.y" /* yacc.c:1646 */
+ case 147:
+#line 244 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_statistics_interval:%s)\n", (yyvsp[0].str)));
if(strcmp((yyvsp[0].str), "") == 0 || strcmp((yyvsp[0].str), "0") == 0)
else cfg_parser->cfg->stat_interval = atoi((yyvsp[0].str));
free((yyvsp[0].str));
}
-#line 1953 "util/configparser.c" /* yacc.c:1646 */
+#line 2096 "util/configparser.c" /* yacc.c:1646 */
break;
- case 135:
-#line 234 "./util/configparser.y" /* yacc.c:1646 */
+ case 148:
+#line 255 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_statistics_cumulative:%s)\n", (yyvsp[0].str)));
if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
else cfg_parser->cfg->stat_cumulative = (strcmp((yyvsp[0].str), "yes")==0);
free((yyvsp[0].str));
}
-#line 1965 "util/configparser.c" /* yacc.c:1646 */
+#line 2108 "util/configparser.c" /* yacc.c:1646 */
break;
- case 136:
-#line 243 "./util/configparser.y" /* yacc.c:1646 */
+ case 149:
+#line 264 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_extended_statistics:%s)\n", (yyvsp[0].str)));
if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
else cfg_parser->cfg->stat_extended = (strcmp((yyvsp[0].str), "yes")==0);
free((yyvsp[0].str));
}
-#line 1977 "util/configparser.c" /* yacc.c:1646 */
+#line 2120 "util/configparser.c" /* yacc.c:1646 */
break;
- case 137:
-#line 252 "./util/configparser.y" /* yacc.c:1646 */
+ case 150:
+#line 273 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_port:%s)\n", (yyvsp[0].str)));
if(atoi((yyvsp[0].str)) == 0)
else cfg_parser->cfg->port = atoi((yyvsp[0].str));
free((yyvsp[0].str));
}
-#line 1989 "util/configparser.c" /* yacc.c:1646 */
+#line 2132 "util/configparser.c" /* yacc.c:1646 */
break;
- case 138:
-#line 261 "./util/configparser.y" /* yacc.c:1646 */
+ case 151:
+#line 282 "./util/configparser.y" /* yacc.c:1646 */
{
#ifdef CLIENT_SUBNET
OUTYY(("P(server_send_client_subnet:%s)\n", (yyvsp[0].str)));
OUTYY(("P(Compiled without edns subnet option, ignoring)\n"));
#endif
}
-#line 2003 "util/configparser.c" /* yacc.c:1646 */
+#line 2146 "util/configparser.c" /* yacc.c:1646 */
break;
- case 139:
-#line 272 "./util/configparser.y" /* yacc.c:1646 */
+ case 152:
+#line 293 "./util/configparser.y" /* yacc.c:1646 */
{
#ifdef CLIENT_SUBNET
OUTYY(("P(client_subnet_opcode:%s)\n", (yyvsp[0].str)));
#endif
free((yyvsp[0].str));
}
-#line 2021 "util/configparser.c" /* yacc.c:1646 */
+#line 2164 "util/configparser.c" /* yacc.c:1646 */
break;
- case 140:
-#line 287 "./util/configparser.y" /* yacc.c:1646 */
+ case 153:
+#line 308 "./util/configparser.y" /* yacc.c:1646 */
{
#ifdef CLIENT_SUBNET
OUTYY(("P(max_client_subnet_ipv4:%s)\n", (yyvsp[0].str)));
#endif
free((yyvsp[0].str));
}
-#line 2041 "util/configparser.c" /* yacc.c:1646 */
+#line 2184 "util/configparser.c" /* yacc.c:1646 */
break;
- case 141:
-#line 304 "./util/configparser.y" /* yacc.c:1646 */
+ case 154:
+#line 325 "./util/configparser.y" /* yacc.c:1646 */
{
#ifdef CLIENT_SUBNET
OUTYY(("P(max_client_subnet_ipv6:%s)\n", (yyvsp[0].str)));
#endif
free((yyvsp[0].str));
}
-#line 2061 "util/configparser.c" /* yacc.c:1646 */
+#line 2204 "util/configparser.c" /* yacc.c:1646 */
break;
- case 142:
-#line 321 "./util/configparser.y" /* yacc.c:1646 */
+ case 155:
+#line 342 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_interface:%s)\n", (yyvsp[0].str)));
if(cfg_parser->cfg->num_ifs == 0)
else
cfg_parser->cfg->ifs[cfg_parser->cfg->num_ifs++] = (yyvsp[0].str);
}
-#line 2077 "util/configparser.c" /* yacc.c:1646 */
+#line 2220 "util/configparser.c" /* yacc.c:1646 */
break;
- case 143:
-#line 334 "./util/configparser.y" /* yacc.c:1646 */
+ case 156:
+#line 355 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_outgoing_interface:%s)\n", (yyvsp[0].str)));
if(cfg_parser->cfg->num_out_ifs == 0)
cfg_parser->cfg->out_ifs[
cfg_parser->cfg->num_out_ifs++] = (yyvsp[0].str);
}
-#line 2095 "util/configparser.c" /* yacc.c:1646 */
+#line 2238 "util/configparser.c" /* yacc.c:1646 */
break;
- case 144:
-#line 349 "./util/configparser.y" /* yacc.c:1646 */
+ case 157:
+#line 370 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_outgoing_range:%s)\n", (yyvsp[0].str)));
if(atoi((yyvsp[0].str)) == 0)
else cfg_parser->cfg->outgoing_num_ports = atoi((yyvsp[0].str));
free((yyvsp[0].str));
}
-#line 2107 "util/configparser.c" /* yacc.c:1646 */
+#line 2250 "util/configparser.c" /* yacc.c:1646 */
break;
- case 145:
-#line 358 "./util/configparser.y" /* yacc.c:1646 */
+ case 158:
+#line 379 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_outgoing_port_permit:%s)\n", (yyvsp[0].str)));
if(!cfg_mark_ports((yyvsp[0].str), 1,
yyerror("port number or range (\"low-high\") expected");
free((yyvsp[0].str));
}
-#line 2119 "util/configparser.c" /* yacc.c:1646 */
+#line 2262 "util/configparser.c" /* yacc.c:1646 */
break;
- case 146:
-#line 367 "./util/configparser.y" /* yacc.c:1646 */
+ case 159:
+#line 388 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_outgoing_port_avoid:%s)\n", (yyvsp[0].str)));
if(!cfg_mark_ports((yyvsp[0].str), 0,
yyerror("port number or range (\"low-high\") expected");
free((yyvsp[0].str));
}
-#line 2131 "util/configparser.c" /* yacc.c:1646 */
+#line 2274 "util/configparser.c" /* yacc.c:1646 */
break;
- case 147:
-#line 376 "./util/configparser.y" /* yacc.c:1646 */
+ case 160:
+#line 397 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_outgoing_num_tcp:%s)\n", (yyvsp[0].str)));
if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0)
else cfg_parser->cfg->outgoing_num_tcp = atoi((yyvsp[0].str));
free((yyvsp[0].str));
}
-#line 2143 "util/configparser.c" /* yacc.c:1646 */
+#line 2286 "util/configparser.c" /* yacc.c:1646 */
break;
- case 148:
-#line 385 "./util/configparser.y" /* yacc.c:1646 */
+ case 161:
+#line 406 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_incoming_num_tcp:%s)\n", (yyvsp[0].str)));
if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0)
else cfg_parser->cfg->incoming_num_tcp = atoi((yyvsp[0].str));
free((yyvsp[0].str));
}
-#line 2155 "util/configparser.c" /* yacc.c:1646 */
+#line 2298 "util/configparser.c" /* yacc.c:1646 */
break;
- case 149:
-#line 394 "./util/configparser.y" /* yacc.c:1646 */
+ case 162:
+#line 415 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_interface_automatic:%s)\n", (yyvsp[0].str)));
if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
else cfg_parser->cfg->if_automatic = (strcmp((yyvsp[0].str), "yes")==0);
free((yyvsp[0].str));
}
-#line 2167 "util/configparser.c" /* yacc.c:1646 */
+#line 2310 "util/configparser.c" /* yacc.c:1646 */
break;
- case 150:
-#line 403 "./util/configparser.y" /* yacc.c:1646 */
+ case 163:
+#line 424 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_do_ip4:%s)\n", (yyvsp[0].str)));
if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
else cfg_parser->cfg->do_ip4 = (strcmp((yyvsp[0].str), "yes")==0);
free((yyvsp[0].str));
}
-#line 2179 "util/configparser.c" /* yacc.c:1646 */
+#line 2322 "util/configparser.c" /* yacc.c:1646 */
break;
- case 151:
-#line 412 "./util/configparser.y" /* yacc.c:1646 */
+ case 164:
+#line 433 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_do_ip6:%s)\n", (yyvsp[0].str)));
if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
else cfg_parser->cfg->do_ip6 = (strcmp((yyvsp[0].str), "yes")==0);
free((yyvsp[0].str));
}
-#line 2191 "util/configparser.c" /* yacc.c:1646 */
+#line 2334 "util/configparser.c" /* yacc.c:1646 */
break;
- case 152:
-#line 421 "./util/configparser.y" /* yacc.c:1646 */
+ case 165:
+#line 442 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_do_udp:%s)\n", (yyvsp[0].str)));
if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
else cfg_parser->cfg->do_udp = (strcmp((yyvsp[0].str), "yes")==0);
free((yyvsp[0].str));
}
-#line 2203 "util/configparser.c" /* yacc.c:1646 */
+#line 2346 "util/configparser.c" /* yacc.c:1646 */
break;
- case 153:
-#line 430 "./util/configparser.y" /* yacc.c:1646 */
+ case 166:
+#line 451 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_do_tcp:%s)\n", (yyvsp[0].str)));
if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
else cfg_parser->cfg->do_tcp = (strcmp((yyvsp[0].str), "yes")==0);
free((yyvsp[0].str));
}
-#line 2215 "util/configparser.c" /* yacc.c:1646 */
+#line 2358 "util/configparser.c" /* yacc.c:1646 */
break;
- case 154:
-#line 439 "./util/configparser.y" /* yacc.c:1646 */
+ case 167:
+#line 460 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_tcp_upstream:%s)\n", (yyvsp[0].str)));
if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
else cfg_parser->cfg->tcp_upstream = (strcmp((yyvsp[0].str), "yes")==0);
free((yyvsp[0].str));
}
-#line 2227 "util/configparser.c" /* yacc.c:1646 */
+#line 2370 "util/configparser.c" /* yacc.c:1646 */
break;
- case 155:
-#line 448 "./util/configparser.y" /* yacc.c:1646 */
+ case 168:
+#line 469 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_ssl_upstream:%s)\n", (yyvsp[0].str)));
if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
else cfg_parser->cfg->ssl_upstream = (strcmp((yyvsp[0].str), "yes")==0);
free((yyvsp[0].str));
}
-#line 2239 "util/configparser.c" /* yacc.c:1646 */
+#line 2382 "util/configparser.c" /* yacc.c:1646 */
break;
- case 156:
-#line 457 "./util/configparser.y" /* yacc.c:1646 */
+ case 169:
+#line 478 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_ssl_service_key:%s)\n", (yyvsp[0].str)));
free(cfg_parser->cfg->ssl_service_key);
cfg_parser->cfg->ssl_service_key = (yyvsp[0].str);
}
-#line 2249 "util/configparser.c" /* yacc.c:1646 */
+#line 2392 "util/configparser.c" /* yacc.c:1646 */
break;
- case 157:
-#line 464 "./util/configparser.y" /* yacc.c:1646 */
+ case 170:
+#line 485 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_ssl_service_pem:%s)\n", (yyvsp[0].str)));
free(cfg_parser->cfg->ssl_service_pem);
cfg_parser->cfg->ssl_service_pem = (yyvsp[0].str);
}
-#line 2259 "util/configparser.c" /* yacc.c:1646 */
+#line 2402 "util/configparser.c" /* yacc.c:1646 */
break;
- case 158:
-#line 471 "./util/configparser.y" /* yacc.c:1646 */
+ case 171:
+#line 492 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_ssl_port:%s)\n", (yyvsp[0].str)));
if(atoi((yyvsp[0].str)) == 0)
else cfg_parser->cfg->ssl_port = atoi((yyvsp[0].str));
free((yyvsp[0].str));
}
-#line 2271 "util/configparser.c" /* yacc.c:1646 */
+#line 2414 "util/configparser.c" /* yacc.c:1646 */
break;
- case 159:
-#line 480 "./util/configparser.y" /* yacc.c:1646 */
+ case 172:
+#line 501 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_do_daemonize:%s)\n", (yyvsp[0].str)));
if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
else cfg_parser->cfg->do_daemonize = (strcmp((yyvsp[0].str), "yes")==0);
free((yyvsp[0].str));
}
-#line 2283 "util/configparser.c" /* yacc.c:1646 */
+#line 2426 "util/configparser.c" /* yacc.c:1646 */
break;
- case 160:
-#line 489 "./util/configparser.y" /* yacc.c:1646 */
+ case 173:
+#line 510 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_use_syslog:%s)\n", (yyvsp[0].str)));
if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
#endif
free((yyvsp[0].str));
}
-#line 2300 "util/configparser.c" /* yacc.c:1646 */
+#line 2443 "util/configparser.c" /* yacc.c:1646 */
break;
- case 161:
-#line 503 "./util/configparser.y" /* yacc.c:1646 */
+ case 174:
+#line 524 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_log_time_ascii:%s)\n", (yyvsp[0].str)));
if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
else cfg_parser->cfg->log_time_ascii = (strcmp((yyvsp[0].str), "yes")==0);
free((yyvsp[0].str));
}
-#line 2312 "util/configparser.c" /* yacc.c:1646 */
+#line 2455 "util/configparser.c" /* yacc.c:1646 */
break;
- case 162:
-#line 512 "./util/configparser.y" /* yacc.c:1646 */
+ case 175:
+#line 533 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_log_queries:%s)\n", (yyvsp[0].str)));
if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
else cfg_parser->cfg->log_queries = (strcmp((yyvsp[0].str), "yes")==0);
free((yyvsp[0].str));
}
-#line 2324 "util/configparser.c" /* yacc.c:1646 */
+#line 2467 "util/configparser.c" /* yacc.c:1646 */
break;
- case 163:
-#line 521 "./util/configparser.y" /* yacc.c:1646 */
+ case 176:
+#line 542 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_chroot:%s)\n", (yyvsp[0].str)));
free(cfg_parser->cfg->chrootdir);
cfg_parser->cfg->chrootdir = (yyvsp[0].str);
}
-#line 2334 "util/configparser.c" /* yacc.c:1646 */
+#line 2477 "util/configparser.c" /* yacc.c:1646 */
break;
- case 164:
-#line 528 "./util/configparser.y" /* yacc.c:1646 */
+ case 177:
+#line 549 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_username:%s)\n", (yyvsp[0].str)));
free(cfg_parser->cfg->username);
cfg_parser->cfg->username = (yyvsp[0].str);
}
-#line 2344 "util/configparser.c" /* yacc.c:1646 */
+#line 2487 "util/configparser.c" /* yacc.c:1646 */
break;
- case 165:
-#line 535 "./util/configparser.y" /* yacc.c:1646 */
+ case 178:
+#line 556 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_directory:%s)\n", (yyvsp[0].str)));
free(cfg_parser->cfg->directory);
cfg_parser->cfg->directory = (yyvsp[0].str);
}
-#line 2354 "util/configparser.c" /* yacc.c:1646 */
+#line 2497 "util/configparser.c" /* yacc.c:1646 */
break;
- case 166:
-#line 542 "./util/configparser.y" /* yacc.c:1646 */
+ case 179:
+#line 563 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_logfile:%s)\n", (yyvsp[0].str)));
free(cfg_parser->cfg->logfile);
cfg_parser->cfg->logfile = (yyvsp[0].str);
cfg_parser->cfg->use_syslog = 0;
}
-#line 2365 "util/configparser.c" /* yacc.c:1646 */
+#line 2508 "util/configparser.c" /* yacc.c:1646 */
break;
- case 167:
-#line 550 "./util/configparser.y" /* yacc.c:1646 */
+ case 180:
+#line 571 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_pidfile:%s)\n", (yyvsp[0].str)));
free(cfg_parser->cfg->pidfile);
cfg_parser->cfg->pidfile = (yyvsp[0].str);
}
-#line 2375 "util/configparser.c" /* yacc.c:1646 */
+#line 2518 "util/configparser.c" /* yacc.c:1646 */
break;
- case 168:
-#line 557 "./util/configparser.y" /* yacc.c:1646 */
+ case 181:
+#line 578 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_root_hints:%s)\n", (yyvsp[0].str)));
if(!cfg_strlist_insert(&cfg_parser->cfg->root_hints, (yyvsp[0].str)))
yyerror("out of memory");
}
-#line 2385 "util/configparser.c" /* yacc.c:1646 */
+#line 2528 "util/configparser.c" /* yacc.c:1646 */
break;
- case 169:
-#line 564 "./util/configparser.y" /* yacc.c:1646 */
+ case 182:
+#line 585 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_dlv_anchor_file:%s)\n", (yyvsp[0].str)));
free(cfg_parser->cfg->dlv_anchor_file);
cfg_parser->cfg->dlv_anchor_file = (yyvsp[0].str);
}
-#line 2395 "util/configparser.c" /* yacc.c:1646 */
+#line 2538 "util/configparser.c" /* yacc.c:1646 */
break;
- case 170:
-#line 571 "./util/configparser.y" /* yacc.c:1646 */
+ case 183:
+#line 592 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_dlv_anchor:%s)\n", (yyvsp[0].str)));
if(!cfg_strlist_insert(&cfg_parser->cfg->dlv_anchor_list, (yyvsp[0].str)))
yyerror("out of memory");
}
-#line 2405 "util/configparser.c" /* yacc.c:1646 */
+#line 2548 "util/configparser.c" /* yacc.c:1646 */
break;
- case 171:
-#line 578 "./util/configparser.y" /* yacc.c:1646 */
+ case 184:
+#line 599 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_auto_trust_anchor_file:%s)\n", (yyvsp[0].str)));
if(!cfg_strlist_insert(&cfg_parser->cfg->
auto_trust_anchor_file_list, (yyvsp[0].str)))
yyerror("out of memory");
}
-#line 2416 "util/configparser.c" /* yacc.c:1646 */
+#line 2559 "util/configparser.c" /* yacc.c:1646 */
break;
- case 172:
-#line 586 "./util/configparser.y" /* yacc.c:1646 */
+ case 185:
+#line 607 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_trust_anchor_file:%s)\n", (yyvsp[0].str)));
if(!cfg_strlist_insert(&cfg_parser->cfg->
trust_anchor_file_list, (yyvsp[0].str)))
yyerror("out of memory");
}
-#line 2427 "util/configparser.c" /* yacc.c:1646 */
+#line 2570 "util/configparser.c" /* yacc.c:1646 */
break;
- case 173:
-#line 594 "./util/configparser.y" /* yacc.c:1646 */
+ case 186:
+#line 615 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_trusted_keys_file:%s)\n", (yyvsp[0].str)));
if(!cfg_strlist_insert(&cfg_parser->cfg->
trusted_keys_file_list, (yyvsp[0].str)))
yyerror("out of memory");
}
-#line 2438 "util/configparser.c" /* yacc.c:1646 */
+#line 2581 "util/configparser.c" /* yacc.c:1646 */
break;
- case 174:
-#line 602 "./util/configparser.y" /* yacc.c:1646 */
+ case 187:
+#line 623 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_trust_anchor:%s)\n", (yyvsp[0].str)));
if(!cfg_strlist_insert(&cfg_parser->cfg->trust_anchor_list, (yyvsp[0].str)))
yyerror("out of memory");
}
-#line 2448 "util/configparser.c" /* yacc.c:1646 */
+#line 2591 "util/configparser.c" /* yacc.c:1646 */
break;
- case 175:
-#line 609 "./util/configparser.y" /* yacc.c:1646 */
+ case 188:
+#line 630 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_domain_insecure:%s)\n", (yyvsp[0].str)));
if(!cfg_strlist_insert(&cfg_parser->cfg->domain_insecure, (yyvsp[0].str)))
yyerror("out of memory");
}
-#line 2458 "util/configparser.c" /* yacc.c:1646 */
+#line 2601 "util/configparser.c" /* yacc.c:1646 */
break;
- case 176:
-#line 616 "./util/configparser.y" /* yacc.c:1646 */
+ case 189:
+#line 637 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_hide_identity:%s)\n", (yyvsp[0].str)));
if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
else cfg_parser->cfg->hide_identity = (strcmp((yyvsp[0].str), "yes")==0);
free((yyvsp[0].str));
}
-#line 2470 "util/configparser.c" /* yacc.c:1646 */
+#line 2613 "util/configparser.c" /* yacc.c:1646 */
break;
- case 177:
-#line 625 "./util/configparser.y" /* yacc.c:1646 */
+ case 190:
+#line 646 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_hide_version:%s)\n", (yyvsp[0].str)));
if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
else cfg_parser->cfg->hide_version = (strcmp((yyvsp[0].str), "yes")==0);
free((yyvsp[0].str));
}
-#line 2482 "util/configparser.c" /* yacc.c:1646 */
+#line 2625 "util/configparser.c" /* yacc.c:1646 */
break;
- case 178:
-#line 634 "./util/configparser.y" /* yacc.c:1646 */
+ case 191:
+#line 655 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_identity:%s)\n", (yyvsp[0].str)));
free(cfg_parser->cfg->identity);
cfg_parser->cfg->identity = (yyvsp[0].str);
}
-#line 2492 "util/configparser.c" /* yacc.c:1646 */
+#line 2635 "util/configparser.c" /* yacc.c:1646 */
break;
- case 179:
-#line 641 "./util/configparser.y" /* yacc.c:1646 */
+ case 192:
+#line 662 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_version:%s)\n", (yyvsp[0].str)));
free(cfg_parser->cfg->version);
cfg_parser->cfg->version = (yyvsp[0].str);
}
-#line 2502 "util/configparser.c" /* yacc.c:1646 */
+#line 2645 "util/configparser.c" /* yacc.c:1646 */
break;
- case 180:
-#line 648 "./util/configparser.y" /* yacc.c:1646 */
+ case 193:
+#line 669 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_so_rcvbuf:%s)\n", (yyvsp[0].str)));
if(!cfg_parse_memsize((yyvsp[0].str), &cfg_parser->cfg->so_rcvbuf))
yyerror("buffer size expected");
free((yyvsp[0].str));
}
-#line 2513 "util/configparser.c" /* yacc.c:1646 */
+#line 2656 "util/configparser.c" /* yacc.c:1646 */
break;
- case 181:
-#line 656 "./util/configparser.y" /* yacc.c:1646 */
+ case 194:
+#line 677 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_so_sndbuf:%s)\n", (yyvsp[0].str)));
if(!cfg_parse_memsize((yyvsp[0].str), &cfg_parser->cfg->so_sndbuf))
yyerror("buffer size expected");
free((yyvsp[0].str));
}
-#line 2524 "util/configparser.c" /* yacc.c:1646 */
+#line 2667 "util/configparser.c" /* yacc.c:1646 */
break;
- case 182:
-#line 664 "./util/configparser.y" /* yacc.c:1646 */
+ case 195:
+#line 685 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_so_reuseport:%s)\n", (yyvsp[0].str)));
if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
(strcmp((yyvsp[0].str), "yes")==0);
free((yyvsp[0].str));
}
-#line 2537 "util/configparser.c" /* yacc.c:1646 */
+#line 2680 "util/configparser.c" /* yacc.c:1646 */
break;
- case 183:
-#line 674 "./util/configparser.y" /* yacc.c:1646 */
+ case 196:
+#line 695 "./util/configparser.y" /* yacc.c:1646 */
+ {
+ OUTYY(("P(server_ip_transparent:%s)\n", (yyvsp[0].str)));
+ if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
+ yyerror("expected yes or no.");
+ else cfg_parser->cfg->ip_transparent =
+ (strcmp((yyvsp[0].str), "yes")==0);
+ free((yyvsp[0].str));
+ }
+#line 2693 "util/configparser.c" /* yacc.c:1646 */
+ break;
+
+ case 197:
+#line 705 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_edns_buffer_size:%s)\n", (yyvsp[0].str)));
if(atoi((yyvsp[0].str)) == 0)
else cfg_parser->cfg->edns_buffer_size = atoi((yyvsp[0].str));
free((yyvsp[0].str));
}
-#line 2553 "util/configparser.c" /* yacc.c:1646 */
+#line 2709 "util/configparser.c" /* yacc.c:1646 */
break;
- case 184:
-#line 687 "./util/configparser.y" /* yacc.c:1646 */
+ case 198:
+#line 718 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_msg_buffer_size:%s)\n", (yyvsp[0].str)));
if(atoi((yyvsp[0].str)) == 0)
else cfg_parser->cfg->msg_buffer_size = atoi((yyvsp[0].str));
free((yyvsp[0].str));
}
-#line 2567 "util/configparser.c" /* yacc.c:1646 */
+#line 2723 "util/configparser.c" /* yacc.c:1646 */
break;
- case 185:
-#line 698 "./util/configparser.y" /* yacc.c:1646 */
+ case 199:
+#line 729 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_msg_cache_size:%s)\n", (yyvsp[0].str)));
if(!cfg_parse_memsize((yyvsp[0].str), &cfg_parser->cfg->msg_cache_size))
yyerror("memory size expected");
free((yyvsp[0].str));
}
-#line 2578 "util/configparser.c" /* yacc.c:1646 */
+#line 2734 "util/configparser.c" /* yacc.c:1646 */
break;
- case 186:
-#line 706 "./util/configparser.y" /* yacc.c:1646 */
+ case 200:
+#line 737 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_msg_cache_slabs:%s)\n", (yyvsp[0].str)));
if(atoi((yyvsp[0].str)) == 0)
}
free((yyvsp[0].str));
}
-#line 2594 "util/configparser.c" /* yacc.c:1646 */
+#line 2750 "util/configparser.c" /* yacc.c:1646 */
break;
- case 187:
-#line 719 "./util/configparser.y" /* yacc.c:1646 */
+ case 201:
+#line 750 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_num_queries_per_thread:%s)\n", (yyvsp[0].str)));
if(atoi((yyvsp[0].str)) == 0)
else cfg_parser->cfg->num_queries_per_thread = atoi((yyvsp[0].str));
free((yyvsp[0].str));
}
-#line 2606 "util/configparser.c" /* yacc.c:1646 */
+#line 2762 "util/configparser.c" /* yacc.c:1646 */
break;
- case 188:
-#line 728 "./util/configparser.y" /* yacc.c:1646 */
+ case 202:
+#line 759 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_jostle_timeout:%s)\n", (yyvsp[0].str)));
if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0)
else cfg_parser->cfg->jostle_time = atoi((yyvsp[0].str));
free((yyvsp[0].str));
}
-#line 2618 "util/configparser.c" /* yacc.c:1646 */
+#line 2774 "util/configparser.c" /* yacc.c:1646 */
break;
- case 189:
-#line 737 "./util/configparser.y" /* yacc.c:1646 */
+ case 203:
+#line 768 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_delay_close:%s)\n", (yyvsp[0].str)));
if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0)
else cfg_parser->cfg->delay_close = atoi((yyvsp[0].str));
free((yyvsp[0].str));
}
-#line 2630 "util/configparser.c" /* yacc.c:1646 */
+#line 2786 "util/configparser.c" /* yacc.c:1646 */
break;
- case 190:
-#line 746 "./util/configparser.y" /* yacc.c:1646 */
+ case 204:
+#line 777 "./util/configparser.y" /* yacc.c:1646 */
+ {
+ OUTYY(("P(server_unblock_lan_zones:%s)\n", (yyvsp[0].str)));
+ if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
+ yyerror("expected yes or no.");
+ else cfg_parser->cfg->unblock_lan_zones =
+ (strcmp((yyvsp[0].str), "yes")==0);
+ free((yyvsp[0].str));
+ }
+#line 2799 "util/configparser.c" /* yacc.c:1646 */
+ break;
+
+ case 205:
+#line 787 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_rrset_cache_size:%s)\n", (yyvsp[0].str)));
if(!cfg_parse_memsize((yyvsp[0].str), &cfg_parser->cfg->rrset_cache_size))
yyerror("memory size expected");
free((yyvsp[0].str));
}
-#line 2641 "util/configparser.c" /* yacc.c:1646 */
+#line 2810 "util/configparser.c" /* yacc.c:1646 */
break;
- case 191:
-#line 754 "./util/configparser.y" /* yacc.c:1646 */
+ case 206:
+#line 795 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_rrset_cache_slabs:%s)\n", (yyvsp[0].str)));
if(atoi((yyvsp[0].str)) == 0)
}
free((yyvsp[0].str));
}
-#line 2657 "util/configparser.c" /* yacc.c:1646 */
+#line 2826 "util/configparser.c" /* yacc.c:1646 */
break;
- case 192:
-#line 767 "./util/configparser.y" /* yacc.c:1646 */
+ case 207:
+#line 808 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_infra_host_ttl:%s)\n", (yyvsp[0].str)));
if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0)
else cfg_parser->cfg->host_ttl = atoi((yyvsp[0].str));
free((yyvsp[0].str));
}
-#line 2669 "util/configparser.c" /* yacc.c:1646 */
+#line 2838 "util/configparser.c" /* yacc.c:1646 */
break;
- case 193:
-#line 776 "./util/configparser.y" /* yacc.c:1646 */
+ case 208:
+#line 817 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_infra_lame_ttl:%s)\n", (yyvsp[0].str)));
verbose(VERB_DETAIL, "ignored infra-lame-ttl: %s (option "
"removed, use infra-host-ttl)", (yyvsp[0].str));
free((yyvsp[0].str));
}
-#line 2680 "util/configparser.c" /* yacc.c:1646 */
+#line 2849 "util/configparser.c" /* yacc.c:1646 */
break;
- case 194:
-#line 784 "./util/configparser.y" /* yacc.c:1646 */
+ case 209:
+#line 825 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_infra_cache_numhosts:%s)\n", (yyvsp[0].str)));
if(atoi((yyvsp[0].str)) == 0)
else cfg_parser->cfg->infra_cache_numhosts = atoi((yyvsp[0].str));
free((yyvsp[0].str));
}
-#line 2692 "util/configparser.c" /* yacc.c:1646 */
+#line 2861 "util/configparser.c" /* yacc.c:1646 */
break;
- case 195:
-#line 793 "./util/configparser.y" /* yacc.c:1646 */
+ case 210:
+#line 834 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_infra_cache_lame_size:%s)\n", (yyvsp[0].str)));
verbose(VERB_DETAIL, "ignored infra-cache-lame-size: %s "
"(option removed, use infra-cache-numhosts)", (yyvsp[0].str));
free((yyvsp[0].str));
}
-#line 2703 "util/configparser.c" /* yacc.c:1646 */
+#line 2872 "util/configparser.c" /* yacc.c:1646 */
break;
- case 196:
-#line 801 "./util/configparser.y" /* yacc.c:1646 */
+ case 211:
+#line 842 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_infra_cache_slabs:%s)\n", (yyvsp[0].str)));
if(atoi((yyvsp[0].str)) == 0)
}
free((yyvsp[0].str));
}
-#line 2719 "util/configparser.c" /* yacc.c:1646 */
+#line 2888 "util/configparser.c" /* yacc.c:1646 */
break;
- case 197:
-#line 814 "./util/configparser.y" /* yacc.c:1646 */
+ case 212:
+#line 855 "./util/configparser.y" /* yacc.c:1646 */
+ {
+ OUTYY(("P(server_infra_cache_min_rtt:%s)\n", (yyvsp[0].str)));
+ if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0)
+ yyerror("number expected");
+ else cfg_parser->cfg->infra_cache_min_rtt = atoi((yyvsp[0].str));
+ free((yyvsp[0].str));
+ }
+#line 2900 "util/configparser.c" /* yacc.c:1646 */
+ break;
+
+ case 213:
+#line 864 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_target_fetch_policy:%s)\n", (yyvsp[0].str)));
free(cfg_parser->cfg->target_fetch_policy);
cfg_parser->cfg->target_fetch_policy = (yyvsp[0].str);
}
-#line 2729 "util/configparser.c" /* yacc.c:1646 */
+#line 2910 "util/configparser.c" /* yacc.c:1646 */
break;
- case 198:
-#line 821 "./util/configparser.y" /* yacc.c:1646 */
+ case 214:
+#line 871 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_harden_short_bufsize:%s)\n", (yyvsp[0].str)));
if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
(strcmp((yyvsp[0].str), "yes")==0);
free((yyvsp[0].str));
}
-#line 2742 "util/configparser.c" /* yacc.c:1646 */
+#line 2923 "util/configparser.c" /* yacc.c:1646 */
break;
- case 199:
-#line 831 "./util/configparser.y" /* yacc.c:1646 */
+ case 215:
+#line 881 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_harden_large_queries:%s)\n", (yyvsp[0].str)));
if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
(strcmp((yyvsp[0].str), "yes")==0);
free((yyvsp[0].str));
}
-#line 2755 "util/configparser.c" /* yacc.c:1646 */
+#line 2936 "util/configparser.c" /* yacc.c:1646 */
break;
- case 200:
-#line 841 "./util/configparser.y" /* yacc.c:1646 */
+ case 216:
+#line 891 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_harden_glue:%s)\n", (yyvsp[0].str)));
if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
(strcmp((yyvsp[0].str), "yes")==0);
free((yyvsp[0].str));
}
-#line 2768 "util/configparser.c" /* yacc.c:1646 */
+#line 2949 "util/configparser.c" /* yacc.c:1646 */
break;
- case 201:
-#line 851 "./util/configparser.y" /* yacc.c:1646 */
+ case 217:
+#line 901 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_harden_dnssec_stripped:%s)\n", (yyvsp[0].str)));
if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
(strcmp((yyvsp[0].str), "yes")==0);
free((yyvsp[0].str));
}
-#line 2781 "util/configparser.c" /* yacc.c:1646 */
+#line 2962 "util/configparser.c" /* yacc.c:1646 */
break;
- case 202:
-#line 861 "./util/configparser.y" /* yacc.c:1646 */
+ case 218:
+#line 911 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_harden_below_nxdomain:%s)\n", (yyvsp[0].str)));
if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
(strcmp((yyvsp[0].str), "yes")==0);
free((yyvsp[0].str));
}
-#line 2794 "util/configparser.c" /* yacc.c:1646 */
+#line 2975 "util/configparser.c" /* yacc.c:1646 */
break;
- case 203:
-#line 871 "./util/configparser.y" /* yacc.c:1646 */
+ case 219:
+#line 921 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_harden_referral_path:%s)\n", (yyvsp[0].str)));
if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
(strcmp((yyvsp[0].str), "yes")==0);
free((yyvsp[0].str));
}
-#line 2807 "util/configparser.c" /* yacc.c:1646 */
+#line 2988 "util/configparser.c" /* yacc.c:1646 */
break;
- case 204:
-#line 881 "./util/configparser.y" /* yacc.c:1646 */
+ case 220:
+#line 931 "./util/configparser.y" /* yacc.c:1646 */
+ {
+ OUTYY(("P(server_harden_algo_downgrade:%s)\n", (yyvsp[0].str)));
+ if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
+ yyerror("expected yes or no.");
+ else cfg_parser->cfg->harden_algo_downgrade =
+ (strcmp((yyvsp[0].str), "yes")==0);
+ free((yyvsp[0].str));
+ }
+#line 3001 "util/configparser.c" /* yacc.c:1646 */
+ break;
+
+ case 221:
+#line 941 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_use_caps_for_id:%s)\n", (yyvsp[0].str)));
if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
(strcmp((yyvsp[0].str), "yes")==0);
free((yyvsp[0].str));
}
-#line 2820 "util/configparser.c" /* yacc.c:1646 */
+#line 3014 "util/configparser.c" /* yacc.c:1646 */
break;
- case 205:
-#line 891 "./util/configparser.y" /* yacc.c:1646 */
+ case 222:
+#line 951 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_private_address:%s)\n", (yyvsp[0].str)));
if(!cfg_strlist_insert(&cfg_parser->cfg->private_address, (yyvsp[0].str)))
yyerror("out of memory");
}
-#line 2830 "util/configparser.c" /* yacc.c:1646 */
+#line 3024 "util/configparser.c" /* yacc.c:1646 */
break;
- case 206:
-#line 898 "./util/configparser.y" /* yacc.c:1646 */
+ case 223:
+#line 958 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_private_domain:%s)\n", (yyvsp[0].str)));
if(!cfg_strlist_insert(&cfg_parser->cfg->private_domain, (yyvsp[0].str)))
yyerror("out of memory");
}
-#line 2840 "util/configparser.c" /* yacc.c:1646 */
+#line 3034 "util/configparser.c" /* yacc.c:1646 */
break;
- case 207:
-#line 905 "./util/configparser.y" /* yacc.c:1646 */
+ case 224:
+#line 965 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_prefetch:%s)\n", (yyvsp[0].str)));
if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
else cfg_parser->cfg->prefetch = (strcmp((yyvsp[0].str), "yes")==0);
free((yyvsp[0].str));
}
-#line 2852 "util/configparser.c" /* yacc.c:1646 */
+#line 3046 "util/configparser.c" /* yacc.c:1646 */
break;
- case 208:
-#line 914 "./util/configparser.y" /* yacc.c:1646 */
+ case 225:
+#line 974 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_prefetch_key:%s)\n", (yyvsp[0].str)));
if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
else cfg_parser->cfg->prefetch_key = (strcmp((yyvsp[0].str), "yes")==0);
free((yyvsp[0].str));
}
-#line 2864 "util/configparser.c" /* yacc.c:1646 */
+#line 3058 "util/configparser.c" /* yacc.c:1646 */
break;
- case 209:
-#line 923 "./util/configparser.y" /* yacc.c:1646 */
+ case 226:
+#line 983 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_unwanted_reply_threshold:%s)\n", (yyvsp[0].str)));
if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0)
else cfg_parser->cfg->unwanted_threshold = atoi((yyvsp[0].str));
free((yyvsp[0].str));
}
-#line 2876 "util/configparser.c" /* yacc.c:1646 */
+#line 3070 "util/configparser.c" /* yacc.c:1646 */
break;
- case 210:
-#line 932 "./util/configparser.y" /* yacc.c:1646 */
+ case 227:
+#line 992 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_do_not_query_address:%s)\n", (yyvsp[0].str)));
if(!cfg_strlist_insert(&cfg_parser->cfg->donotqueryaddrs, (yyvsp[0].str)))
yyerror("out of memory");
}
-#line 2886 "util/configparser.c" /* yacc.c:1646 */
+#line 3080 "util/configparser.c" /* yacc.c:1646 */
break;
- case 211:
-#line 939 "./util/configparser.y" /* yacc.c:1646 */
+ case 228:
+#line 999 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_do_not_query_localhost:%s)\n", (yyvsp[0].str)));
if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
(strcmp((yyvsp[0].str), "yes")==0);
free((yyvsp[0].str));
}
-#line 2899 "util/configparser.c" /* yacc.c:1646 */
+#line 3093 "util/configparser.c" /* yacc.c:1646 */
break;
- case 212:
-#line 949 "./util/configparser.y" /* yacc.c:1646 */
+ case 229:
+#line 1009 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_access_control:%s %s)\n", (yyvsp[-1].str), (yyvsp[0].str)));
if(strcmp((yyvsp[0].str), "deny")!=0 && strcmp((yyvsp[0].str), "refuse")!=0 &&
fatal_exit("out of memory adding acl");
}
}
-#line 2919 "util/configparser.c" /* yacc.c:1646 */
+#line 3113 "util/configparser.c" /* yacc.c:1646 */
break;
- case 213:
-#line 966 "./util/configparser.y" /* yacc.c:1646 */
+ case 230:
+#line 1026 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_module_conf:%s)\n", (yyvsp[0].str)));
free(cfg_parser->cfg->module_conf);
cfg_parser->cfg->module_conf = (yyvsp[0].str);
}
-#line 2929 "util/configparser.c" /* yacc.c:1646 */
+#line 3123 "util/configparser.c" /* yacc.c:1646 */
break;
- case 214:
-#line 973 "./util/configparser.y" /* yacc.c:1646 */
+ case 231:
+#line 1033 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_val_override_date:%s)\n", (yyvsp[0].str)));
if(strlen((yyvsp[0].str)) == 0 || strcmp((yyvsp[0].str), "0") == 0) {
}
free((yyvsp[0].str));
}
-#line 2950 "util/configparser.c" /* yacc.c:1646 */
+#line 3144 "util/configparser.c" /* yacc.c:1646 */
break;
- case 215:
-#line 991 "./util/configparser.y" /* yacc.c:1646 */
+ case 232:
+#line 1051 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_val_sig_skew_min:%s)\n", (yyvsp[0].str)));
if(strlen((yyvsp[0].str)) == 0 || strcmp((yyvsp[0].str), "0") == 0) {
}
free((yyvsp[0].str));
}
-#line 2966 "util/configparser.c" /* yacc.c:1646 */
+#line 3160 "util/configparser.c" /* yacc.c:1646 */
break;
- case 216:
-#line 1004 "./util/configparser.y" /* yacc.c:1646 */
+ case 233:
+#line 1064 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_val_sig_skew_max:%s)\n", (yyvsp[0].str)));
if(strlen((yyvsp[0].str)) == 0 || strcmp((yyvsp[0].str), "0") == 0) {
}
free((yyvsp[0].str));
}
-#line 2982 "util/configparser.c" /* yacc.c:1646 */
+#line 3176 "util/configparser.c" /* yacc.c:1646 */
break;
- case 217:
-#line 1017 "./util/configparser.y" /* yacc.c:1646 */
+ case 234:
+#line 1077 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_cache_max_ttl:%s)\n", (yyvsp[0].str)));
if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0)
else cfg_parser->cfg->max_ttl = atoi((yyvsp[0].str));
free((yyvsp[0].str));
}
-#line 2994 "util/configparser.c" /* yacc.c:1646 */
+#line 3188 "util/configparser.c" /* yacc.c:1646 */
break;
- case 218:
-#line 1026 "./util/configparser.y" /* yacc.c:1646 */
+ case 235:
+#line 1086 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_cache_min_ttl:%s)\n", (yyvsp[0].str)));
if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0)
else cfg_parser->cfg->min_ttl = atoi((yyvsp[0].str));
free((yyvsp[0].str));
}
-#line 3006 "util/configparser.c" /* yacc.c:1646 */
+#line 3200 "util/configparser.c" /* yacc.c:1646 */
break;
- case 219:
-#line 1035 "./util/configparser.y" /* yacc.c:1646 */
+ case 236:
+#line 1095 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_bogus_ttl:%s)\n", (yyvsp[0].str)));
if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0)
else cfg_parser->cfg->bogus_ttl = atoi((yyvsp[0].str));
free((yyvsp[0].str));
}
-#line 3018 "util/configparser.c" /* yacc.c:1646 */
+#line 3212 "util/configparser.c" /* yacc.c:1646 */
break;
- case 220:
-#line 1044 "./util/configparser.y" /* yacc.c:1646 */
+ case 237:
+#line 1104 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_val_clean_additional:%s)\n", (yyvsp[0].str)));
if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
(strcmp((yyvsp[0].str), "yes")==0);
free((yyvsp[0].str));
}
-#line 3031 "util/configparser.c" /* yacc.c:1646 */
+#line 3225 "util/configparser.c" /* yacc.c:1646 */
break;
- case 221:
-#line 1054 "./util/configparser.y" /* yacc.c:1646 */
+ case 238:
+#line 1114 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_val_permissive_mode:%s)\n", (yyvsp[0].str)));
if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
(strcmp((yyvsp[0].str), "yes")==0);
free((yyvsp[0].str));
}
-#line 3044 "util/configparser.c" /* yacc.c:1646 */
+#line 3238 "util/configparser.c" /* yacc.c:1646 */
break;
- case 222:
-#line 1064 "./util/configparser.y" /* yacc.c:1646 */
+ case 239:
+#line 1124 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_ignore_cd_flag:%s)\n", (yyvsp[0].str)));
if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
else cfg_parser->cfg->ignore_cd = (strcmp((yyvsp[0].str), "yes")==0);
free((yyvsp[0].str));
}
-#line 3056 "util/configparser.c" /* yacc.c:1646 */
+#line 3250 "util/configparser.c" /* yacc.c:1646 */
break;
- case 223:
-#line 1073 "./util/configparser.y" /* yacc.c:1646 */
+ case 240:
+#line 1133 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_val_log_level:%s)\n", (yyvsp[0].str)));
if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0)
else cfg_parser->cfg->val_log_level = atoi((yyvsp[0].str));
free((yyvsp[0].str));
}
-#line 3068 "util/configparser.c" /* yacc.c:1646 */
+#line 3262 "util/configparser.c" /* yacc.c:1646 */
break;
- case 224:
-#line 1082 "./util/configparser.y" /* yacc.c:1646 */
+ case 241:
+#line 1142 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_val_nsec3_keysize_iterations:%s)\n", (yyvsp[0].str)));
free(cfg_parser->cfg->val_nsec3_key_iterations);
cfg_parser->cfg->val_nsec3_key_iterations = (yyvsp[0].str);
}
-#line 3078 "util/configparser.c" /* yacc.c:1646 */
+#line 3272 "util/configparser.c" /* yacc.c:1646 */
break;
- case 225:
-#line 1089 "./util/configparser.y" /* yacc.c:1646 */
+ case 242:
+#line 1149 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_add_holddown:%s)\n", (yyvsp[0].str)));
if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0)
else cfg_parser->cfg->add_holddown = atoi((yyvsp[0].str));
free((yyvsp[0].str));
}
-#line 3090 "util/configparser.c" /* yacc.c:1646 */
+#line 3284 "util/configparser.c" /* yacc.c:1646 */
break;
- case 226:
-#line 1098 "./util/configparser.y" /* yacc.c:1646 */
+ case 243:
+#line 1158 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_del_holddown:%s)\n", (yyvsp[0].str)));
if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0)
else cfg_parser->cfg->del_holddown = atoi((yyvsp[0].str));
free((yyvsp[0].str));
}
-#line 3102 "util/configparser.c" /* yacc.c:1646 */
+#line 3296 "util/configparser.c" /* yacc.c:1646 */
break;
- case 227:
-#line 1107 "./util/configparser.y" /* yacc.c:1646 */
+ case 244:
+#line 1167 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_keep_missing:%s)\n", (yyvsp[0].str)));
if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0)
else cfg_parser->cfg->keep_missing = atoi((yyvsp[0].str));
free((yyvsp[0].str));
}
-#line 3114 "util/configparser.c" /* yacc.c:1646 */
+#line 3308 "util/configparser.c" /* yacc.c:1646 */
break;
- case 228:
-#line 1116 "./util/configparser.y" /* yacc.c:1646 */
+ case 245:
+#line 1176 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_key_cache_size:%s)\n", (yyvsp[0].str)));
if(!cfg_parse_memsize((yyvsp[0].str), &cfg_parser->cfg->key_cache_size))
yyerror("memory size expected");
free((yyvsp[0].str));
}
-#line 3125 "util/configparser.c" /* yacc.c:1646 */
+#line 3319 "util/configparser.c" /* yacc.c:1646 */
break;
- case 229:
-#line 1124 "./util/configparser.y" /* yacc.c:1646 */
+ case 246:
+#line 1184 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_key_cache_slabs:%s)\n", (yyvsp[0].str)));
if(atoi((yyvsp[0].str)) == 0)
}
free((yyvsp[0].str));
}
-#line 3141 "util/configparser.c" /* yacc.c:1646 */
+#line 3335 "util/configparser.c" /* yacc.c:1646 */
break;
- case 230:
-#line 1137 "./util/configparser.y" /* yacc.c:1646 */
+ case 247:
+#line 1197 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_neg_cache_size:%s)\n", (yyvsp[0].str)));
if(!cfg_parse_memsize((yyvsp[0].str), &cfg_parser->cfg->neg_cache_size))
yyerror("memory size expected");
free((yyvsp[0].str));
}
-#line 3152 "util/configparser.c" /* yacc.c:1646 */
+#line 3346 "util/configparser.c" /* yacc.c:1646 */
break;
- case 231:
-#line 1145 "./util/configparser.y" /* yacc.c:1646 */
+ case 248:
+#line 1205 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_local_zone:%s %s)\n", (yyvsp[-1].str), (yyvsp[0].str)));
if(strcmp((yyvsp[0].str), "static")!=0 && strcmp((yyvsp[0].str), "deny")!=0 &&
strcmp((yyvsp[0].str), "refuse")!=0 && strcmp((yyvsp[0].str), "redirect")!=0 &&
strcmp((yyvsp[0].str), "transparent")!=0 && strcmp((yyvsp[0].str), "nodefault")!=0
- && strcmp((yyvsp[0].str), "typetransparent")!=0)
+ && strcmp((yyvsp[0].str), "typetransparent")!=0 &&
+ strcmp((yyvsp[0].str), "inform")!=0 && strcmp((yyvsp[0].str), "inform_deny")!=0)
yyerror("local-zone type: expected static, deny, "
"refuse, redirect, transparent, "
- "typetransparent or nodefault");
+ "typetransparent, inform, inform_deny "
+ "or nodefault");
else if(strcmp((yyvsp[0].str), "nodefault")==0) {
if(!cfg_strlist_insert(&cfg_parser->cfg->
local_zones_nodefault, (yyvsp[-1].str)))
fatal_exit("out of memory adding local-zone");
}
}
-#line 3177 "util/configparser.c" /* yacc.c:1646 */
+#line 3373 "util/configparser.c" /* yacc.c:1646 */
break;
- case 232:
-#line 1167 "./util/configparser.y" /* yacc.c:1646 */
+ case 249:
+#line 1229 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_local_data:%s)\n", (yyvsp[0].str)));
if(!cfg_strlist_insert(&cfg_parser->cfg->local_data, (yyvsp[0].str)))
fatal_exit("out of memory adding local-data");
}
-#line 3187 "util/configparser.c" /* yacc.c:1646 */
+#line 3383 "util/configparser.c" /* yacc.c:1646 */
break;
- case 233:
-#line 1174 "./util/configparser.y" /* yacc.c:1646 */
+ case 250:
+#line 1236 "./util/configparser.y" /* yacc.c:1646 */
{
char* ptr;
OUTYY(("P(server_local_data_ptr:%s)\n", (yyvsp[0].str)));
yyerror("local-data-ptr could not be reversed");
}
}
-#line 3205 "util/configparser.c" /* yacc.c:1646 */
+#line 3401 "util/configparser.c" /* yacc.c:1646 */
break;
- case 234:
-#line 1189 "./util/configparser.y" /* yacc.c:1646 */
+ case 251:
+#line 1251 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_minimal_responses:%s)\n", (yyvsp[0].str)));
if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
(strcmp((yyvsp[0].str), "yes")==0);
free((yyvsp[0].str));
}
-#line 3218 "util/configparser.c" /* yacc.c:1646 */
+#line 3414 "util/configparser.c" /* yacc.c:1646 */
break;
- case 235:
-#line 1199 "./util/configparser.y" /* yacc.c:1646 */
+ case 252:
+#line 1261 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_rrset_roundrobin:%s)\n", (yyvsp[0].str)));
if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
(strcmp((yyvsp[0].str), "yes")==0);
free((yyvsp[0].str));
}
-#line 3231 "util/configparser.c" /* yacc.c:1646 */
+#line 3427 "util/configparser.c" /* yacc.c:1646 */
break;
- case 236:
-#line 1209 "./util/configparser.y" /* yacc.c:1646 */
+ case 253:
+#line 1271 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(server_max_udp_size:%s)\n", (yyvsp[0].str)));
cfg_parser->cfg->max_udp_size = atoi((yyvsp[0].str));
free((yyvsp[0].str));
}
-#line 3241 "util/configparser.c" /* yacc.c:1646 */
+#line 3437 "util/configparser.c" /* yacc.c:1646 */
break;
- case 237:
-#line 1216 "./util/configparser.y" /* yacc.c:1646 */
+ case 254:
+#line 1278 "./util/configparser.y" /* yacc.c:1646 */
+ {
+ OUTYY(("P(dns64_prefix:%s)\n", (yyvsp[0].str)));
+ free(cfg_parser->cfg->dns64_prefix);
+ cfg_parser->cfg->dns64_prefix = (yyvsp[0].str);
+ }
+#line 3447 "util/configparser.c" /* yacc.c:1646 */
+ break;
+
+ case 255:
+#line 1285 "./util/configparser.y" /* yacc.c:1646 */
+ {
+ OUTYY(("P(server_dns64_synthall:%s)\n", (yyvsp[0].str)));
+ if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
+ yyerror("expected yes or no.");
+ else cfg_parser->cfg->dns64_synthall = (strcmp((yyvsp[0].str), "yes")==0);
+ free((yyvsp[0].str));
+ }
+#line 3459 "util/configparser.c" /* yacc.c:1646 */
+ break;
+
+ case 256:
+#line 1294 "./util/configparser.y" /* yacc.c:1646 */
+ {
+ OUTYY(("P(server_ratelimit:%s)\n", (yyvsp[0].str)));
+ if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0)
+ yyerror("number expected");
+ else cfg_parser->cfg->ratelimit = atoi((yyvsp[0].str));
+ free((yyvsp[0].str));
+ }
+#line 3471 "util/configparser.c" /* yacc.c:1646 */
+ break;
+
+ case 257:
+#line 1303 "./util/configparser.y" /* yacc.c:1646 */
+ {
+ OUTYY(("P(server_ratelimit_size:%s)\n", (yyvsp[0].str)));
+ if(!cfg_parse_memsize((yyvsp[0].str), &cfg_parser->cfg->ratelimit_size))
+ yyerror("memory size expected");
+ free((yyvsp[0].str));
+ }
+#line 3482 "util/configparser.c" /* yacc.c:1646 */
+ break;
+
+ case 258:
+#line 1311 "./util/configparser.y" /* yacc.c:1646 */
+ {
+ OUTYY(("P(server_ratelimit_slabs:%s)\n", (yyvsp[0].str)));
+ if(atoi((yyvsp[0].str)) == 0)
+ yyerror("number expected");
+ else {
+ cfg_parser->cfg->ratelimit_slabs = atoi((yyvsp[0].str));
+ if(!is_pow2(cfg_parser->cfg->ratelimit_slabs))
+ yyerror("must be a power of 2");
+ }
+ free((yyvsp[0].str));
+ }
+#line 3498 "util/configparser.c" /* yacc.c:1646 */
+ break;
+
+ case 259:
+#line 1324 "./util/configparser.y" /* yacc.c:1646 */
+ {
+ OUTYY(("P(server_ratelimit_for_domain:%s %s)\n", (yyvsp[-1].str), (yyvsp[0].str)));
+ if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0) {
+ yyerror("number expected");
+ } else {
+ if(!cfg_str2list_insert(&cfg_parser->cfg->
+ ratelimit_for_domain, (yyvsp[-1].str), (yyvsp[0].str)))
+ fatal_exit("out of memory adding "
+ "ratelimit-for-domain");
+ }
+ }
+#line 3514 "util/configparser.c" /* yacc.c:1646 */
+ break;
+
+ case 260:
+#line 1337 "./util/configparser.y" /* yacc.c:1646 */
+ {
+ OUTYY(("P(server_ratelimit_below_domain:%s %s)\n", (yyvsp[-1].str), (yyvsp[0].str)));
+ if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0) {
+ yyerror("number expected");
+ } else {
+ if(!cfg_str2list_insert(&cfg_parser->cfg->
+ ratelimit_below_domain, (yyvsp[-1].str), (yyvsp[0].str)))
+ fatal_exit("out of memory adding "
+ "ratelimit-below-domain");
+ }
+ }
+#line 3530 "util/configparser.c" /* yacc.c:1646 */
+ break;
+
+ case 261:
+#line 1350 "./util/configparser.y" /* yacc.c:1646 */
+ {
+ OUTYY(("P(server_ratelimit_factor:%s)\n", (yyvsp[0].str)));
+ if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0)
+ yyerror("number expected");
+ else cfg_parser->cfg->ratelimit_factor = atoi((yyvsp[0].str));
+ free((yyvsp[0].str));
+ }
+#line 3542 "util/configparser.c" /* yacc.c:1646 */
+ break;
+
+ case 262:
+#line 1359 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(name:%s)\n", (yyvsp[0].str)));
if(cfg_parser->cfg->stubs->name)
free(cfg_parser->cfg->stubs->name);
cfg_parser->cfg->stubs->name = (yyvsp[0].str);
}
-#line 3254 "util/configparser.c" /* yacc.c:1646 */
+#line 3555 "util/configparser.c" /* yacc.c:1646 */
break;
- case 238:
-#line 1226 "./util/configparser.y" /* yacc.c:1646 */
+ case 263:
+#line 1369 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(stub-host:%s)\n", (yyvsp[0].str)));
if(!cfg_strlist_insert(&cfg_parser->cfg->stubs->hosts, (yyvsp[0].str)))
yyerror("out of memory");
}
-#line 3264 "util/configparser.c" /* yacc.c:1646 */
+#line 3565 "util/configparser.c" /* yacc.c:1646 */
break;
- case 239:
-#line 1233 "./util/configparser.y" /* yacc.c:1646 */
+ case 264:
+#line 1376 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(stub-addr:%s)\n", (yyvsp[0].str)));
if(!cfg_strlist_insert(&cfg_parser->cfg->stubs->addrs, (yyvsp[0].str)))
yyerror("out of memory");
}
-#line 3274 "util/configparser.c" /* yacc.c:1646 */
+#line 3575 "util/configparser.c" /* yacc.c:1646 */
break;
- case 240:
-#line 1240 "./util/configparser.y" /* yacc.c:1646 */
+ case 265:
+#line 1383 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(stub-first:%s)\n", (yyvsp[0].str)));
if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
else cfg_parser->cfg->stubs->isfirst=(strcmp((yyvsp[0].str), "yes")==0);
free((yyvsp[0].str));
}
-#line 3286 "util/configparser.c" /* yacc.c:1646 */
+#line 3587 "util/configparser.c" /* yacc.c:1646 */
break;
- case 241:
-#line 1249 "./util/configparser.y" /* yacc.c:1646 */
+ case 266:
+#line 1392 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(stub-prime:%s)\n", (yyvsp[0].str)));
if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
(strcmp((yyvsp[0].str), "yes")==0);
free((yyvsp[0].str));
}
-#line 3299 "util/configparser.c" /* yacc.c:1646 */
+#line 3600 "util/configparser.c" /* yacc.c:1646 */
break;
- case 242:
-#line 1259 "./util/configparser.y" /* yacc.c:1646 */
+ case 267:
+#line 1402 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(name:%s)\n", (yyvsp[0].str)));
if(cfg_parser->cfg->forwards->name)
free(cfg_parser->cfg->forwards->name);
cfg_parser->cfg->forwards->name = (yyvsp[0].str);
}
-#line 3312 "util/configparser.c" /* yacc.c:1646 */
+#line 3613 "util/configparser.c" /* yacc.c:1646 */
break;
- case 243:
-#line 1269 "./util/configparser.y" /* yacc.c:1646 */
+ case 268:
+#line 1412 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(forward-host:%s)\n", (yyvsp[0].str)));
if(!cfg_strlist_insert(&cfg_parser->cfg->forwards->hosts, (yyvsp[0].str)))
yyerror("out of memory");
}
-#line 3322 "util/configparser.c" /* yacc.c:1646 */
+#line 3623 "util/configparser.c" /* yacc.c:1646 */
break;
- case 244:
-#line 1276 "./util/configparser.y" /* yacc.c:1646 */
+ case 269:
+#line 1419 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(forward-addr:%s)\n", (yyvsp[0].str)));
if(!cfg_strlist_insert(&cfg_parser->cfg->forwards->addrs, (yyvsp[0].str)))
yyerror("out of memory");
}
-#line 3332 "util/configparser.c" /* yacc.c:1646 */
+#line 3633 "util/configparser.c" /* yacc.c:1646 */
break;
- case 245:
-#line 1283 "./util/configparser.y" /* yacc.c:1646 */
+ case 270:
+#line 1426 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(forward-first:%s)\n", (yyvsp[0].str)));
if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
else cfg_parser->cfg->forwards->isfirst=(strcmp((yyvsp[0].str), "yes")==0);
free((yyvsp[0].str));
}
-#line 3344 "util/configparser.c" /* yacc.c:1646 */
+#line 3645 "util/configparser.c" /* yacc.c:1646 */
break;
- case 246:
-#line 1292 "./util/configparser.y" /* yacc.c:1646 */
+ case 271:
+#line 1435 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("\nP(remote-control:)\n"));
}
-#line 3352 "util/configparser.c" /* yacc.c:1646 */
+#line 3653 "util/configparser.c" /* yacc.c:1646 */
break;
- case 256:
-#line 1303 "./util/configparser.y" /* yacc.c:1646 */
+ case 282:
+#line 1446 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(control_enable:%s)\n", (yyvsp[0].str)));
if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
(strcmp((yyvsp[0].str), "yes")==0);
free((yyvsp[0].str));
}
-#line 3365 "util/configparser.c" /* yacc.c:1646 */
+#line 3666 "util/configparser.c" /* yacc.c:1646 */
break;
- case 257:
-#line 1313 "./util/configparser.y" /* yacc.c:1646 */
+ case 283:
+#line 1456 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(control_port:%s)\n", (yyvsp[0].str)));
if(atoi((yyvsp[0].str)) == 0)
else cfg_parser->cfg->control_port = atoi((yyvsp[0].str));
free((yyvsp[0].str));
}
-#line 3377 "util/configparser.c" /* yacc.c:1646 */
+#line 3678 "util/configparser.c" /* yacc.c:1646 */
break;
- case 258:
-#line 1322 "./util/configparser.y" /* yacc.c:1646 */
+ case 284:
+#line 1465 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(control_interface:%s)\n", (yyvsp[0].str)));
if(!cfg_strlist_insert(&cfg_parser->cfg->control_ifs, (yyvsp[0].str)))
yyerror("out of memory");
}
-#line 3387 "util/configparser.c" /* yacc.c:1646 */
+#line 3688 "util/configparser.c" /* yacc.c:1646 */
break;
- case 259:
-#line 1329 "./util/configparser.y" /* yacc.c:1646 */
+ case 285:
+#line 1472 "./util/configparser.y" /* yacc.c:1646 */
+ {
+ OUTYY(("P(control_use_cert:%s)\n", (yyvsp[0].str)));
+ if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
+ yyerror("expected yes or no.");
+ else cfg_parser->cfg->remote_control_use_cert =
+ (strcmp((yyvsp[0].str), "yes")==0);
+ free((yyvsp[0].str));
+ }
+#line 3701 "util/configparser.c" /* yacc.c:1646 */
+ break;
+
+ case 286:
+#line 1482 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(rc_server_key_file:%s)\n", (yyvsp[0].str)));
free(cfg_parser->cfg->server_key_file);
cfg_parser->cfg->server_key_file = (yyvsp[0].str);
}
-#line 3397 "util/configparser.c" /* yacc.c:1646 */
+#line 3711 "util/configparser.c" /* yacc.c:1646 */
break;
- case 260:
-#line 1336 "./util/configparser.y" /* yacc.c:1646 */
+ case 287:
+#line 1489 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(rc_server_cert_file:%s)\n", (yyvsp[0].str)));
free(cfg_parser->cfg->server_cert_file);
cfg_parser->cfg->server_cert_file = (yyvsp[0].str);
}
-#line 3407 "util/configparser.c" /* yacc.c:1646 */
+#line 3721 "util/configparser.c" /* yacc.c:1646 */
break;
- case 261:
-#line 1343 "./util/configparser.y" /* yacc.c:1646 */
+ case 288:
+#line 1496 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(rc_control_key_file:%s)\n", (yyvsp[0].str)));
free(cfg_parser->cfg->control_key_file);
cfg_parser->cfg->control_key_file = (yyvsp[0].str);
}
-#line 3417 "util/configparser.c" /* yacc.c:1646 */
+#line 3731 "util/configparser.c" /* yacc.c:1646 */
break;
- case 262:
-#line 1350 "./util/configparser.y" /* yacc.c:1646 */
+ case 289:
+#line 1503 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(rc_control_cert_file:%s)\n", (yyvsp[0].str)));
free(cfg_parser->cfg->control_cert_file);
cfg_parser->cfg->control_cert_file = (yyvsp[0].str);
}
-#line 3427 "util/configparser.c" /* yacc.c:1646 */
+#line 3741 "util/configparser.c" /* yacc.c:1646 */
break;
- case 263:
-#line 1357 "./util/configparser.y" /* yacc.c:1646 */
+ case 290:
+#line 1510 "./util/configparser.y" /* yacc.c:1646 */
+ {
+ OUTYY(("\nP(dnstap:)\n"));
+ }
+#line 3749 "util/configparser.c" /* yacc.c:1646 */
+ break;
+
+ case 305:
+#line 1527 "./util/configparser.y" /* yacc.c:1646 */
+ {
+ OUTYY(("P(dt_dnstap_enable:%s)\n", (yyvsp[0].str)));
+ if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
+ yyerror("expected yes or no.");
+ else cfg_parser->cfg->dnstap = (strcmp((yyvsp[0].str), "yes")==0);
+ }
+#line 3760 "util/configparser.c" /* yacc.c:1646 */
+ break;
+
+ case 306:
+#line 1535 "./util/configparser.y" /* yacc.c:1646 */
+ {
+ OUTYY(("P(dt_dnstap_socket_path:%s)\n", (yyvsp[0].str)));
+ free(cfg_parser->cfg->dnstap_socket_path);
+ cfg_parser->cfg->dnstap_socket_path = (yyvsp[0].str);
+ }
+#line 3770 "util/configparser.c" /* yacc.c:1646 */
+ break;
+
+ case 307:
+#line 1542 "./util/configparser.y" /* yacc.c:1646 */
+ {
+ OUTYY(("P(dt_dnstap_send_identity:%s)\n", (yyvsp[0].str)));
+ if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
+ yyerror("expected yes or no.");
+ else cfg_parser->cfg->dnstap_send_identity = (strcmp((yyvsp[0].str), "yes")==0);
+ }
+#line 3781 "util/configparser.c" /* yacc.c:1646 */
+ break;
+
+ case 308:
+#line 1550 "./util/configparser.y" /* yacc.c:1646 */
+ {
+ OUTYY(("P(dt_dnstap_send_version:%s)\n", (yyvsp[0].str)));
+ if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
+ yyerror("expected yes or no.");
+ else cfg_parser->cfg->dnstap_send_version = (strcmp((yyvsp[0].str), "yes")==0);
+ }
+#line 3792 "util/configparser.c" /* yacc.c:1646 */
+ break;
+
+ case 309:
+#line 1558 "./util/configparser.y" /* yacc.c:1646 */
+ {
+ OUTYY(("P(dt_dnstap_identity:%s)\n", (yyvsp[0].str)));
+ free(cfg_parser->cfg->dnstap_identity);
+ cfg_parser->cfg->dnstap_identity = (yyvsp[0].str);
+ }
+#line 3802 "util/configparser.c" /* yacc.c:1646 */
+ break;
+
+ case 310:
+#line 1565 "./util/configparser.y" /* yacc.c:1646 */
+ {
+ OUTYY(("P(dt_dnstap_version:%s)\n", (yyvsp[0].str)));
+ free(cfg_parser->cfg->dnstap_version);
+ cfg_parser->cfg->dnstap_version = (yyvsp[0].str);
+ }
+#line 3812 "util/configparser.c" /* yacc.c:1646 */
+ break;
+
+ case 311:
+#line 1572 "./util/configparser.y" /* yacc.c:1646 */
+ {
+ OUTYY(("P(dt_dnstap_log_resolver_query_messages:%s)\n", (yyvsp[0].str)));
+ if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
+ yyerror("expected yes or no.");
+ else cfg_parser->cfg->dnstap_log_resolver_query_messages =
+ (strcmp((yyvsp[0].str), "yes")==0);
+ }
+#line 3824 "util/configparser.c" /* yacc.c:1646 */
+ break;
+
+ case 312:
+#line 1581 "./util/configparser.y" /* yacc.c:1646 */
+ {
+ OUTYY(("P(dt_dnstap_log_resolver_response_messages:%s)\n", (yyvsp[0].str)));
+ if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
+ yyerror("expected yes or no.");
+ else cfg_parser->cfg->dnstap_log_resolver_response_messages =
+ (strcmp((yyvsp[0].str), "yes")==0);
+ }
+#line 3836 "util/configparser.c" /* yacc.c:1646 */
+ break;
+
+ case 313:
+#line 1590 "./util/configparser.y" /* yacc.c:1646 */
+ {
+ OUTYY(("P(dt_dnstap_log_client_query_messages:%s)\n", (yyvsp[0].str)));
+ if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
+ yyerror("expected yes or no.");
+ else cfg_parser->cfg->dnstap_log_client_query_messages =
+ (strcmp((yyvsp[0].str), "yes")==0);
+ }
+#line 3848 "util/configparser.c" /* yacc.c:1646 */
+ break;
+
+ case 314:
+#line 1599 "./util/configparser.y" /* yacc.c:1646 */
+ {
+ OUTYY(("P(dt_dnstap_log_client_response_messages:%s)\n", (yyvsp[0].str)));
+ if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
+ yyerror("expected yes or no.");
+ else cfg_parser->cfg->dnstap_log_client_response_messages =
+ (strcmp((yyvsp[0].str), "yes")==0);
+ }
+#line 3860 "util/configparser.c" /* yacc.c:1646 */
+ break;
+
+ case 315:
+#line 1608 "./util/configparser.y" /* yacc.c:1646 */
+ {
+ OUTYY(("P(dt_dnstap_log_forwarder_query_messages:%s)\n", (yyvsp[0].str)));
+ if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
+ yyerror("expected yes or no.");
+ else cfg_parser->cfg->dnstap_log_forwarder_query_messages =
+ (strcmp((yyvsp[0].str), "yes")==0);
+ }
+#line 3872 "util/configparser.c" /* yacc.c:1646 */
+ break;
+
+ case 316:
+#line 1617 "./util/configparser.y" /* yacc.c:1646 */
+ {
+ OUTYY(("P(dt_dnstap_log_forwarder_response_messages:%s)\n", (yyvsp[0].str)));
+ if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0)
+ yyerror("expected yes or no.");
+ else cfg_parser->cfg->dnstap_log_forwarder_response_messages =
+ (strcmp((yyvsp[0].str), "yes")==0);
+ }
+#line 3884 "util/configparser.c" /* yacc.c:1646 */
+ break;
+
+ case 317:
+#line 1626 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("\nP(python:)\n"));
}
-#line 3435 "util/configparser.c" /* yacc.c:1646 */
+#line 3892 "util/configparser.c" /* yacc.c:1646 */
break;
- case 267:
-#line 1366 "./util/configparser.y" /* yacc.c:1646 */
+ case 321:
+#line 1635 "./util/configparser.y" /* yacc.c:1646 */
{
OUTYY(("P(python-script:%s)\n", (yyvsp[0].str)));
free(cfg_parser->cfg->python_script);
cfg_parser->cfg->python_script = (yyvsp[0].str);
}
-#line 3445 "util/configparser.c" /* yacc.c:1646 */
+#line 3902 "util/configparser.c" /* yacc.c:1646 */
break;
-#line 3449 "util/configparser.c" /* yacc.c:1646 */
+#line 3906 "util/configparser.c" /* yacc.c:1646 */
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
#endif
return yyresult;
}
-#line 1371 "./util/configparser.y" /* yacc.c:1906 */
+#line 1640 "./util/configparser.y" /* yacc.c:1906 */
/* parse helper routines could be here */
VAR_SERVER_CERT_FILE = 348,
VAR_CONTROL_KEY_FILE = 349,
VAR_CONTROL_CERT_FILE = 350,
- VAR_EXTENDED_STATISTICS = 351,
- VAR_LOCAL_DATA_PTR = 352,
- VAR_JOSTLE_TIMEOUT = 353,
- VAR_STUB_PRIME = 354,
- VAR_UNWANTED_REPLY_THRESHOLD = 355,
- VAR_LOG_TIME_ASCII = 356,
- VAR_DOMAIN_INSECURE = 357,
- VAR_PYTHON = 358,
- VAR_PYTHON_SCRIPT = 359,
- VAR_VAL_SIG_SKEW_MIN = 360,
- VAR_VAL_SIG_SKEW_MAX = 361,
- VAR_CACHE_MIN_TTL = 362,
- VAR_VAL_LOG_LEVEL = 363,
- VAR_AUTO_TRUST_ANCHOR_FILE = 364,
- VAR_KEEP_MISSING = 365,
- VAR_ADD_HOLDDOWN = 366,
- VAR_DEL_HOLDDOWN = 367,
- VAR_SO_RCVBUF = 368,
- VAR_EDNS_BUFFER_SIZE = 369,
- VAR_PREFETCH = 370,
- VAR_PREFETCH_KEY = 371,
- VAR_SO_SNDBUF = 372,
- VAR_SO_REUSEPORT = 373,
- VAR_HARDEN_BELOW_NXDOMAIN = 374,
- VAR_IGNORE_CD_FLAG = 375,
- VAR_LOG_QUERIES = 376,
- VAR_TCP_UPSTREAM = 377,
- VAR_SSL_UPSTREAM = 378,
- VAR_SSL_SERVICE_KEY = 379,
- VAR_SSL_SERVICE_PEM = 380,
- VAR_SSL_PORT = 381,
- VAR_FORWARD_FIRST = 382,
- VAR_STUB_FIRST = 383,
- VAR_MINIMAL_RESPONSES = 384,
- VAR_RRSET_ROUNDROBIN = 385,
- VAR_MAX_UDP_SIZE = 386,
- VAR_DELAY_CLOSE = 387,
- VAR_SEND_CLIENT_SUBNET = 388,
- VAR_CLIENT_SUBNET_OPCODE = 389,
- VAR_MAX_CLIENT_SUBNET_IPV4 = 390,
- VAR_MAX_CLIENT_SUBNET_IPV6 = 391
+ VAR_CONTROL_USE_CERT = 351,
+ VAR_EXTENDED_STATISTICS = 352,
+ VAR_LOCAL_DATA_PTR = 353,
+ VAR_JOSTLE_TIMEOUT = 354,
+ VAR_STUB_PRIME = 355,
+ VAR_UNWANTED_REPLY_THRESHOLD = 356,
+ VAR_LOG_TIME_ASCII = 357,
+ VAR_DOMAIN_INSECURE = 358,
+ VAR_PYTHON = 359,
+ VAR_PYTHON_SCRIPT = 360,
+ VAR_VAL_SIG_SKEW_MIN = 361,
+ VAR_VAL_SIG_SKEW_MAX = 362,
+ VAR_CACHE_MIN_TTL = 363,
+ VAR_VAL_LOG_LEVEL = 364,
+ VAR_AUTO_TRUST_ANCHOR_FILE = 365,
+ VAR_KEEP_MISSING = 366,
+ VAR_ADD_HOLDDOWN = 367,
+ VAR_DEL_HOLDDOWN = 368,
+ VAR_SO_RCVBUF = 369,
+ VAR_EDNS_BUFFER_SIZE = 370,
+ VAR_PREFETCH = 371,
+ VAR_PREFETCH_KEY = 372,
+ VAR_SO_SNDBUF = 373,
+ VAR_SO_REUSEPORT = 374,
+ VAR_HARDEN_BELOW_NXDOMAIN = 375,
+ VAR_IGNORE_CD_FLAG = 376,
+ VAR_LOG_QUERIES = 377,
+ VAR_TCP_UPSTREAM = 378,
+ VAR_SSL_UPSTREAM = 379,
+ VAR_SSL_SERVICE_KEY = 380,
+ VAR_SSL_SERVICE_PEM = 381,
+ VAR_SSL_PORT = 382,
+ VAR_FORWARD_FIRST = 383,
+ VAR_STUB_FIRST = 384,
+ VAR_MINIMAL_RESPONSES = 385,
+ VAR_RRSET_ROUNDROBIN = 386,
+ VAR_MAX_UDP_SIZE = 387,
+ VAR_DELAY_CLOSE = 388,
+ VAR_UNBLOCK_LAN_ZONES = 389,
+ VAR_INFRA_CACHE_MIN_RTT = 390,
+ VAR_DNS64_PREFIX = 391,
+ VAR_DNS64_SYNTHALL = 392,
+ VAR_DNSTAP = 393,
+ VAR_DNSTAP_ENABLE = 394,
+ VAR_DNSTAP_SOCKET_PATH = 395,
+ VAR_DNSTAP_SEND_IDENTITY = 396,
+ VAR_DNSTAP_SEND_VERSION = 397,
+ VAR_DNSTAP_IDENTITY = 398,
+ VAR_DNSTAP_VERSION = 399,
+ VAR_DNSTAP_LOG_RESOLVER_QUERY_MESSAGES = 400,
+ VAR_DNSTAP_LOG_RESOLVER_RESPONSE_MESSAGES = 401,
+ VAR_DNSTAP_LOG_CLIENT_QUERY_MESSAGES = 402,
+ VAR_DNSTAP_LOG_CLIENT_RESPONSE_MESSAGES = 403,
+ VAR_DNSTAP_LOG_FORWARDER_QUERY_MESSAGES = 404,
+ VAR_DNSTAP_LOG_FORWARDER_RESPONSE_MESSAGES = 405,
+ VAR_HARDEN_ALGO_DOWNGRADE = 406,
+ VAR_IP_TRANSPARENT = 407,
+ VAR_RATELIMIT = 408,
+ VAR_RATELIMIT_SLABS = 409,
+ VAR_RATELIMIT_SIZE = 410,
+ VAR_RATELIMIT_FOR_DOMAIN = 411,
+ VAR_RATELIMIT_BELOW_DOMAIN = 412,
+ VAR_RATELIMIT_FACTOR = 413,
+ VAR_SEND_CLIENT_SUBNET = 414,
+ VAR_CLIENT_SUBNET_OPCODE = 415,
+ VAR_MAX_CLIENT_SUBNET_IPV4 = 416,
+ VAR_MAX_CLIENT_SUBNET_IPV6 = 417
};
#endif
/* Tokens. */
#define VAR_SERVER_CERT_FILE 348
#define VAR_CONTROL_KEY_FILE 349
#define VAR_CONTROL_CERT_FILE 350
-#define VAR_EXTENDED_STATISTICS 351
-#define VAR_LOCAL_DATA_PTR 352
-#define VAR_JOSTLE_TIMEOUT 353
-#define VAR_STUB_PRIME 354
-#define VAR_UNWANTED_REPLY_THRESHOLD 355
-#define VAR_LOG_TIME_ASCII 356
-#define VAR_DOMAIN_INSECURE 357
-#define VAR_PYTHON 358
-#define VAR_PYTHON_SCRIPT 359
-#define VAR_VAL_SIG_SKEW_MIN 360
-#define VAR_VAL_SIG_SKEW_MAX 361
-#define VAR_CACHE_MIN_TTL 362
-#define VAR_VAL_LOG_LEVEL 363
-#define VAR_AUTO_TRUST_ANCHOR_FILE 364
-#define VAR_KEEP_MISSING 365
-#define VAR_ADD_HOLDDOWN 366
-#define VAR_DEL_HOLDDOWN 367
-#define VAR_SO_RCVBUF 368
-#define VAR_EDNS_BUFFER_SIZE 369
-#define VAR_PREFETCH 370
-#define VAR_PREFETCH_KEY 371
-#define VAR_SO_SNDBUF 372
-#define VAR_SO_REUSEPORT 373
-#define VAR_HARDEN_BELOW_NXDOMAIN 374
-#define VAR_IGNORE_CD_FLAG 375
-#define VAR_LOG_QUERIES 376
-#define VAR_TCP_UPSTREAM 377
-#define VAR_SSL_UPSTREAM 378
-#define VAR_SSL_SERVICE_KEY 379
-#define VAR_SSL_SERVICE_PEM 380
-#define VAR_SSL_PORT 381
-#define VAR_FORWARD_FIRST 382
-#define VAR_STUB_FIRST 383
-#define VAR_MINIMAL_RESPONSES 384
-#define VAR_RRSET_ROUNDROBIN 385
-#define VAR_MAX_UDP_SIZE 386
-#define VAR_DELAY_CLOSE 387
-#define VAR_SEND_CLIENT_SUBNET 388
-#define VAR_CLIENT_SUBNET_OPCODE 389
-#define VAR_MAX_CLIENT_SUBNET_IPV4 390
-#define VAR_MAX_CLIENT_SUBNET_IPV6 391
+#define VAR_CONTROL_USE_CERT 351
+#define VAR_EXTENDED_STATISTICS 352
+#define VAR_LOCAL_DATA_PTR 353
+#define VAR_JOSTLE_TIMEOUT 354
+#define VAR_STUB_PRIME 355
+#define VAR_UNWANTED_REPLY_THRESHOLD 356
+#define VAR_LOG_TIME_ASCII 357
+#define VAR_DOMAIN_INSECURE 358
+#define VAR_PYTHON 359
+#define VAR_PYTHON_SCRIPT 360
+#define VAR_VAL_SIG_SKEW_MIN 361
+#define VAR_VAL_SIG_SKEW_MAX 362
+#define VAR_CACHE_MIN_TTL 363
+#define VAR_VAL_LOG_LEVEL 364
+#define VAR_AUTO_TRUST_ANCHOR_FILE 365
+#define VAR_KEEP_MISSING 366
+#define VAR_ADD_HOLDDOWN 367
+#define VAR_DEL_HOLDDOWN 368
+#define VAR_SO_RCVBUF 369
+#define VAR_EDNS_BUFFER_SIZE 370
+#define VAR_PREFETCH 371
+#define VAR_PREFETCH_KEY 372
+#define VAR_SO_SNDBUF 373
+#define VAR_SO_REUSEPORT 374
+#define VAR_HARDEN_BELOW_NXDOMAIN 375
+#define VAR_IGNORE_CD_FLAG 376
+#define VAR_LOG_QUERIES 377
+#define VAR_TCP_UPSTREAM 378
+#define VAR_SSL_UPSTREAM 379
+#define VAR_SSL_SERVICE_KEY 380
+#define VAR_SSL_SERVICE_PEM 381
+#define VAR_SSL_PORT 382
+#define VAR_FORWARD_FIRST 383
+#define VAR_STUB_FIRST 384
+#define VAR_MINIMAL_RESPONSES 385
+#define VAR_RRSET_ROUNDROBIN 386
+#define VAR_MAX_UDP_SIZE 387
+#define VAR_DELAY_CLOSE 388
+#define VAR_UNBLOCK_LAN_ZONES 389
+#define VAR_INFRA_CACHE_MIN_RTT 390
+#define VAR_DNS64_PREFIX 391
+#define VAR_DNS64_SYNTHALL 392
+#define VAR_DNSTAP 393
+#define VAR_DNSTAP_ENABLE 394
+#define VAR_DNSTAP_SOCKET_PATH 395
+#define VAR_DNSTAP_SEND_IDENTITY 396
+#define VAR_DNSTAP_SEND_VERSION 397
+#define VAR_DNSTAP_IDENTITY 398
+#define VAR_DNSTAP_VERSION 399
+#define VAR_DNSTAP_LOG_RESOLVER_QUERY_MESSAGES 400
+#define VAR_DNSTAP_LOG_RESOLVER_RESPONSE_MESSAGES 401
+#define VAR_DNSTAP_LOG_CLIENT_QUERY_MESSAGES 402
+#define VAR_DNSTAP_LOG_CLIENT_RESPONSE_MESSAGES 403
+#define VAR_DNSTAP_LOG_FORWARDER_QUERY_MESSAGES 404
+#define VAR_DNSTAP_LOG_FORWARDER_RESPONSE_MESSAGES 405
+#define VAR_HARDEN_ALGO_DOWNGRADE 406
+#define VAR_IP_TRANSPARENT 407
+#define VAR_RATELIMIT 408
+#define VAR_RATELIMIT_SLABS 409
+#define VAR_RATELIMIT_SIZE 410
+#define VAR_RATELIMIT_FOR_DOMAIN 411
+#define VAR_RATELIMIT_BELOW_DOMAIN 412
+#define VAR_RATELIMIT_FACTOR 413
+#define VAR_SEND_CLIENT_SUBNET 414
+#define VAR_CLIENT_SUBNET_OPCODE 415
+#define VAR_MAX_CLIENT_SUBNET_IPV4 416
+#define VAR_MAX_CLIENT_SUBNET_IPV6 417
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
char* str;
-#line 330 "util/configparser.h" /* yacc.c:1909 */
+#line 382 "util/configparser.h" /* yacc.c:1909 */
};
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
%token VAR_PRIVATE_DOMAIN VAR_REMOTE_CONTROL VAR_CONTROL_ENABLE
%token VAR_CONTROL_INTERFACE VAR_CONTROL_PORT VAR_SERVER_KEY_FILE
%token VAR_SERVER_CERT_FILE VAR_CONTROL_KEY_FILE VAR_CONTROL_CERT_FILE
+%token VAR_CONTROL_USE_CERT
%token VAR_EXTENDED_STATISTICS VAR_LOCAL_DATA_PTR VAR_JOSTLE_TIMEOUT
%token VAR_STUB_PRIME VAR_UNWANTED_REPLY_THRESHOLD VAR_LOG_TIME_ASCII
%token VAR_DOMAIN_INSECURE VAR_PYTHON VAR_PYTHON_SCRIPT VAR_VAL_SIG_SKEW_MIN
%token VAR_IGNORE_CD_FLAG VAR_LOG_QUERIES VAR_TCP_UPSTREAM VAR_SSL_UPSTREAM
%token VAR_SSL_SERVICE_KEY VAR_SSL_SERVICE_PEM VAR_SSL_PORT VAR_FORWARD_FIRST
%token VAR_STUB_FIRST VAR_MINIMAL_RESPONSES VAR_RRSET_ROUNDROBIN
-%token VAR_MAX_UDP_SIZE VAR_DELAY_CLOSE
+%token VAR_MAX_UDP_SIZE VAR_DELAY_CLOSE VAR_UNBLOCK_LAN_ZONES
+%token VAR_INFRA_CACHE_MIN_RTT
+%token VAR_DNS64_PREFIX VAR_DNS64_SYNTHALL
+%token VAR_DNSTAP VAR_DNSTAP_ENABLE VAR_DNSTAP_SOCKET_PATH
+%token VAR_DNSTAP_SEND_IDENTITY VAR_DNSTAP_SEND_VERSION
+%token VAR_DNSTAP_IDENTITY VAR_DNSTAP_VERSION
+%token VAR_DNSTAP_LOG_RESOLVER_QUERY_MESSAGES
+%token VAR_DNSTAP_LOG_RESOLVER_RESPONSE_MESSAGES
+%token VAR_DNSTAP_LOG_CLIENT_QUERY_MESSAGES
+%token VAR_DNSTAP_LOG_CLIENT_RESPONSE_MESSAGES
+%token VAR_DNSTAP_LOG_FORWARDER_QUERY_MESSAGES
+%token VAR_DNSTAP_LOG_FORWARDER_RESPONSE_MESSAGES
+%token VAR_HARDEN_ALGO_DOWNGRADE VAR_IP_TRANSPARENT
+%token VAR_RATELIMIT VAR_RATELIMIT_SLABS VAR_RATELIMIT_SIZE
+%token VAR_RATELIMIT_FOR_DOMAIN VAR_RATELIMIT_BELOW_DOMAIN VAR_RATELIMIT_FACTOR
%token VAR_SEND_CLIENT_SUBNET VAR_CLIENT_SUBNET_OPCODE
%token VAR_MAX_CLIENT_SUBNET_IPV4 VAR_MAX_CLIENT_SUBNET_IPV6
+
%%
toplevelvars: /* empty */ | toplevelvars toplevelvar ;
toplevelvar: serverstart contents_server | stubstart contents_stub |
forwardstart contents_forward | pythonstart contents_py |
- rcstart contents_rc
+ rcstart contents_rc | dtstart contents_dt
;
/* server: declaration */
server_log_queries | server_tcp_upstream | server_ssl_upstream |
server_ssl_service_key | server_ssl_service_pem | server_ssl_port |
server_minimal_responses | server_rrset_roundrobin | server_max_udp_size |
- server_so_reuseport | server_delay_close |
+ server_so_reuseport | server_delay_close | server_unblock_lan_zones |
+ server_dns64_prefix | server_dns64_synthall |
+ server_infra_cache_min_rtt | server_harden_algo_downgrade |
+ server_ip_transparent | server_ratelimit | server_ratelimit_slabs |
+ server_ratelimit_size | server_ratelimit_for_domain |
+ server_ratelimit_below_domain | server_ratelimit_factor |
server_send_client_subnet | server_client_subnet_opcode |
server_max_client_subnet_ipv4 | server_max_client_subnet_ipv6
;
free($2);
}
;
+server_ip_transparent: VAR_IP_TRANSPARENT STRING_ARG
+ {
+ OUTYY(("P(server_ip_transparent:%s)\n", $2));
+ if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
+ yyerror("expected yes or no.");
+ else cfg_parser->cfg->ip_transparent =
+ (strcmp($2, "yes")==0);
+ free($2);
+ }
+ ;
server_edns_buffer_size: VAR_EDNS_BUFFER_SIZE STRING_ARG
{
OUTYY(("P(server_edns_buffer_size:%s)\n", $2));
free($2);
}
;
+server_unblock_lan_zones: VAR_UNBLOCK_LAN_ZONES STRING_ARG
+ {
+ OUTYY(("P(server_unblock_lan_zones:%s)\n", $2));
+ if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
+ yyerror("expected yes or no.");
+ else cfg_parser->cfg->unblock_lan_zones =
+ (strcmp($2, "yes")==0);
+ free($2);
+ }
+ ;
server_rrset_cache_size: VAR_RRSET_CACHE_SIZE STRING_ARG
{
OUTYY(("P(server_rrset_cache_size:%s)\n", $2));
free($2);
}
;
+server_infra_cache_min_rtt: VAR_INFRA_CACHE_MIN_RTT STRING_ARG
+ {
+ OUTYY(("P(server_infra_cache_min_rtt:%s)\n", $2));
+ if(atoi($2) == 0 && strcmp($2, "0") != 0)
+ yyerror("number expected");
+ else cfg_parser->cfg->infra_cache_min_rtt = atoi($2);
+ free($2);
+ }
+ ;
server_target_fetch_policy: VAR_TARGET_FETCH_POLICY STRING_ARG
{
OUTYY(("P(server_target_fetch_policy:%s)\n", $2));
free($2);
}
;
+server_harden_algo_downgrade: VAR_HARDEN_ALGO_DOWNGRADE STRING_ARG
+ {
+ OUTYY(("P(server_harden_algo_downgrade:%s)\n", $2));
+ if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
+ yyerror("expected yes or no.");
+ else cfg_parser->cfg->harden_algo_downgrade =
+ (strcmp($2, "yes")==0);
+ free($2);
+ }
+ ;
server_use_caps_for_id: VAR_USE_CAPS_FOR_ID STRING_ARG
{
OUTYY(("P(server_use_caps_for_id:%s)\n", $2));
if(strcmp($3, "static")!=0 && strcmp($3, "deny")!=0 &&
strcmp($3, "refuse")!=0 && strcmp($3, "redirect")!=0 &&
strcmp($3, "transparent")!=0 && strcmp($3, "nodefault")!=0
- && strcmp($3, "typetransparent")!=0)
+ && strcmp($3, "typetransparent")!=0 &&
+ strcmp($3, "inform")!=0 && strcmp($3, "inform_deny")!=0)
yyerror("local-zone type: expected static, deny, "
"refuse, redirect, transparent, "
- "typetransparent or nodefault");
+ "typetransparent, inform, inform_deny "
+ "or nodefault");
else if(strcmp($3, "nodefault")==0) {
if(!cfg_strlist_insert(&cfg_parser->cfg->
local_zones_nodefault, $2))
free($2);
}
;
+server_dns64_prefix: VAR_DNS64_PREFIX STRING_ARG
+ {
+ OUTYY(("P(dns64_prefix:%s)\n", $2));
+ free(cfg_parser->cfg->dns64_prefix);
+ cfg_parser->cfg->dns64_prefix = $2;
+ }
+ ;
+server_dns64_synthall: VAR_DNS64_SYNTHALL STRING_ARG
+ {
+ OUTYY(("P(server_dns64_synthall:%s)\n", $2));
+ if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
+ yyerror("expected yes or no.");
+ else cfg_parser->cfg->dns64_synthall = (strcmp($2, "yes")==0);
+ free($2);
+ }
+ ;
+server_ratelimit: VAR_RATELIMIT STRING_ARG
+ {
+ OUTYY(("P(server_ratelimit:%s)\n", $2));
+ if(atoi($2) == 0 && strcmp($2, "0") != 0)
+ yyerror("number expected");
+ else cfg_parser->cfg->ratelimit = atoi($2);
+ free($2);
+ }
+ ;
+server_ratelimit_size: VAR_RATELIMIT_SIZE STRING_ARG
+ {
+ OUTYY(("P(server_ratelimit_size:%s)\n", $2));
+ if(!cfg_parse_memsize($2, &cfg_parser->cfg->ratelimit_size))
+ yyerror("memory size expected");
+ free($2);
+ }
+ ;
+server_ratelimit_slabs: VAR_RATELIMIT_SLABS STRING_ARG
+ {
+ OUTYY(("P(server_ratelimit_slabs:%s)\n", $2));
+ if(atoi($2) == 0)
+ yyerror("number expected");
+ else {
+ cfg_parser->cfg->ratelimit_slabs = atoi($2);
+ if(!is_pow2(cfg_parser->cfg->ratelimit_slabs))
+ yyerror("must be a power of 2");
+ }
+ free($2);
+ }
+ ;
+server_ratelimit_for_domain: VAR_RATELIMIT_FOR_DOMAIN STRING_ARG STRING_ARG
+ {
+ OUTYY(("P(server_ratelimit_for_domain:%s %s)\n", $2, $3));
+ if(atoi($3) == 0 && strcmp($3, "0") != 0) {
+ yyerror("number expected");
+ } else {
+ if(!cfg_str2list_insert(&cfg_parser->cfg->
+ ratelimit_for_domain, $2, $3))
+ fatal_exit("out of memory adding "
+ "ratelimit-for-domain");
+ }
+ }
+ ;
+server_ratelimit_below_domain: VAR_RATELIMIT_BELOW_DOMAIN STRING_ARG STRING_ARG
+ {
+ OUTYY(("P(server_ratelimit_below_domain:%s %s)\n", $2, $3));
+ if(atoi($3) == 0 && strcmp($3, "0") != 0) {
+ yyerror("number expected");
+ } else {
+ if(!cfg_str2list_insert(&cfg_parser->cfg->
+ ratelimit_below_domain, $2, $3))
+ fatal_exit("out of memory adding "
+ "ratelimit-below-domain");
+ }
+ }
+ ;
+server_ratelimit_factor: VAR_RATELIMIT_FACTOR STRING_ARG
+ {
+ OUTYY(("P(server_ratelimit_factor:%s)\n", $2));
+ if(atoi($2) == 0 && strcmp($2, "0") != 0)
+ yyerror("number expected");
+ else cfg_parser->cfg->ratelimit_factor = atoi($2);
+ free($2);
+ }
+ ;
stub_name: VAR_NAME STRING_ARG
{
OUTYY(("P(name:%s)\n", $2));
| ;
content_rc: rc_control_enable | rc_control_interface | rc_control_port |
rc_server_key_file | rc_server_cert_file | rc_control_key_file |
- rc_control_cert_file
+ rc_control_cert_file | rc_control_use_cert
;
rc_control_enable: VAR_CONTROL_ENABLE STRING_ARG
{
yyerror("out of memory");
}
;
+rc_control_use_cert: VAR_CONTROL_USE_CERT STRING_ARG
+ {
+ OUTYY(("P(control_use_cert:%s)\n", $2));
+ if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
+ yyerror("expected yes or no.");
+ else cfg_parser->cfg->remote_control_use_cert =
+ (strcmp($2, "yes")==0);
+ free($2);
+ }
+ ;
rc_server_key_file: VAR_SERVER_KEY_FILE STRING_ARG
{
OUTYY(("P(rc_server_key_file:%s)\n", $2));
cfg_parser->cfg->control_cert_file = $2;
}
;
+dtstart: VAR_DNSTAP
+ {
+ OUTYY(("\nP(dnstap:)\n"));
+ }
+ ;
+contents_dt: contents_dt content_dt
+ | ;
+content_dt: dt_dnstap_enable | dt_dnstap_socket_path |
+ dt_dnstap_send_identity | dt_dnstap_send_version |
+ dt_dnstap_identity | dt_dnstap_version |
+ dt_dnstap_log_resolver_query_messages |
+ dt_dnstap_log_resolver_response_messages |
+ dt_dnstap_log_client_query_messages |
+ dt_dnstap_log_client_response_messages |
+ dt_dnstap_log_forwarder_query_messages |
+ dt_dnstap_log_forwarder_response_messages
+ ;
+dt_dnstap_enable: VAR_DNSTAP_ENABLE STRING_ARG
+ {
+ OUTYY(("P(dt_dnstap_enable:%s)\n", $2));
+ if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
+ yyerror("expected yes or no.");
+ else cfg_parser->cfg->dnstap = (strcmp($2, "yes")==0);
+ }
+ ;
+dt_dnstap_socket_path: VAR_DNSTAP_SOCKET_PATH STRING_ARG
+ {
+ OUTYY(("P(dt_dnstap_socket_path:%s)\n", $2));
+ free(cfg_parser->cfg->dnstap_socket_path);
+ cfg_parser->cfg->dnstap_socket_path = $2;
+ }
+ ;
+dt_dnstap_send_identity: VAR_DNSTAP_SEND_IDENTITY STRING_ARG
+ {
+ OUTYY(("P(dt_dnstap_send_identity:%s)\n", $2));
+ if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
+ yyerror("expected yes or no.");
+ else cfg_parser->cfg->dnstap_send_identity = (strcmp($2, "yes")==0);
+ }
+ ;
+dt_dnstap_send_version: VAR_DNSTAP_SEND_VERSION STRING_ARG
+ {
+ OUTYY(("P(dt_dnstap_send_version:%s)\n", $2));
+ if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
+ yyerror("expected yes or no.");
+ else cfg_parser->cfg->dnstap_send_version = (strcmp($2, "yes")==0);
+ }
+ ;
+dt_dnstap_identity: VAR_DNSTAP_IDENTITY STRING_ARG
+ {
+ OUTYY(("P(dt_dnstap_identity:%s)\n", $2));
+ free(cfg_parser->cfg->dnstap_identity);
+ cfg_parser->cfg->dnstap_identity = $2;
+ }
+ ;
+dt_dnstap_version: VAR_DNSTAP_VERSION STRING_ARG
+ {
+ OUTYY(("P(dt_dnstap_version:%s)\n", $2));
+ free(cfg_parser->cfg->dnstap_version);
+ cfg_parser->cfg->dnstap_version = $2;
+ }
+ ;
+dt_dnstap_log_resolver_query_messages: VAR_DNSTAP_LOG_RESOLVER_QUERY_MESSAGES STRING_ARG
+ {
+ OUTYY(("P(dt_dnstap_log_resolver_query_messages:%s)\n", $2));
+ if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
+ yyerror("expected yes or no.");
+ else cfg_parser->cfg->dnstap_log_resolver_query_messages =
+ (strcmp($2, "yes")==0);
+ }
+ ;
+dt_dnstap_log_resolver_response_messages: VAR_DNSTAP_LOG_RESOLVER_RESPONSE_MESSAGES STRING_ARG
+ {
+ OUTYY(("P(dt_dnstap_log_resolver_response_messages:%s)\n", $2));
+ if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
+ yyerror("expected yes or no.");
+ else cfg_parser->cfg->dnstap_log_resolver_response_messages =
+ (strcmp($2, "yes")==0);
+ }
+ ;
+dt_dnstap_log_client_query_messages: VAR_DNSTAP_LOG_CLIENT_QUERY_MESSAGES STRING_ARG
+ {
+ OUTYY(("P(dt_dnstap_log_client_query_messages:%s)\n", $2));
+ if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
+ yyerror("expected yes or no.");
+ else cfg_parser->cfg->dnstap_log_client_query_messages =
+ (strcmp($2, "yes")==0);
+ }
+ ;
+dt_dnstap_log_client_response_messages: VAR_DNSTAP_LOG_CLIENT_RESPONSE_MESSAGES STRING_ARG
+ {
+ OUTYY(("P(dt_dnstap_log_client_response_messages:%s)\n", $2));
+ if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
+ yyerror("expected yes or no.");
+ else cfg_parser->cfg->dnstap_log_client_response_messages =
+ (strcmp($2, "yes")==0);
+ }
+ ;
+dt_dnstap_log_forwarder_query_messages: VAR_DNSTAP_LOG_FORWARDER_QUERY_MESSAGES STRING_ARG
+ {
+ OUTYY(("P(dt_dnstap_log_forwarder_query_messages:%s)\n", $2));
+ if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
+ yyerror("expected yes or no.");
+ else cfg_parser->cfg->dnstap_log_forwarder_query_messages =
+ (strcmp($2, "yes")==0);
+ }
+ ;
+dt_dnstap_log_forwarder_response_messages: VAR_DNSTAP_LOG_FORWARDER_RESPONSE_MESSAGES STRING_ARG
+ {
+ OUTYY(("P(dt_dnstap_log_forwarder_response_messages:%s)\n", $2));
+ if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0)
+ yyerror("expected yes or no.");
+ else cfg_parser->cfg->dnstap_log_forwarder_response_messages =
+ (strcmp($2, "yes")==0);
+ }
+ ;
pythonstart: VAR_PYTHON
{
OUTYY(("\nP(python:)\n"));
#include "util/data/msgparse.h"
#include "util/log.h"
#include "util/storage/lookup3.h"
-#include "ldns/sbuffer.h"
+#include "sldns/sbuffer.h"
/* determine length of a dname in buffer, no compression pointers allowed */
size_t
while(lab1--) {
/* compare bytes first for speed */
if(*d1 != *d2 &&
- tolower((int)*d1) != tolower((int)*d2)) {
- if(tolower((int)*d1) < tolower((int)*d2))
+ tolower((unsigned char)*d1) != tolower((unsigned char)*d2)) {
+ if(tolower((unsigned char)*d1) < tolower((unsigned char)*d2))
return -1;
return 1;
}
while(labellen) {
dname++;
while(labellen--) {
- *dname = (uint8_t)tolower((int)*dname);
+ *dname = (uint8_t)tolower((unsigned char)*dname);
dname++;
}
labellen = *dname;
if(dname+lablen >= sldns_buffer_end(pkt))
return;
while(lablen--) {
- *dname = (uint8_t)tolower((int)*dname);
+ *dname = (uint8_t)tolower((unsigned char)*dname);
dname++;
}
if(dname >= sldns_buffer_end(pkt))
log_assert(len1 == len2 && len1 != 0);
/* compare labels */
while(len1--) {
- if(tolower((int)*d1++) != tolower((int)*d2++)) {
- if(tolower((int)d1[-1]) < tolower((int)d2[-1]))
+ if(tolower((unsigned char)*d1++) != tolower((unsigned char)*d2++)) {
+ if(tolower((unsigned char)d1[-1]) < tolower((unsigned char)d2[-1]))
return -1;
return 1;
}
labuf[0] = lablen;
i=0;
while(lablen--)
- labuf[++i] = (uint8_t)tolower((int)*dname++);
+ labuf[++i] = (uint8_t)tolower((unsigned char)*dname++);
h = hashlittle(labuf, labuf[0] + 1, h);
lablen = *dname++;
}
labuf[0] = lablen;
i=0;
while(lablen--)
- labuf[++i] = (uint8_t)tolower((int)*dname++);
+ labuf[++i] = (uint8_t)tolower((unsigned char)*dname++);
h = hashlittle(labuf, labuf[0] + 1, h);
lablen = *dname++;
}
memlowercmp(uint8_t* p1, uint8_t* p2, uint8_t len)
{
while(len--) {
- if(*p1 != *p2 && tolower((int)*p1) != tolower((int)*p2)) {
- if(tolower((int)*p1) < tolower((int)*p2))
+ if(*p1 != *p2 && tolower((unsigned char)*p1) != tolower((unsigned char)*p2)) {
+ if(tolower((unsigned char)*p1) < tolower((unsigned char)*p2))
return -1;
return 1;
}
* lastdiff = c;
* lastmlabs = atlabel; } apart from d1++,d2++ */
while(len1) {
- if(*d1 != *d2 && tolower((int)*d1)
- != tolower((int)*d2)) {
- if(tolower((int)*d1) <
- tolower((int)*d2)) {
+ if(*d1 != *d2 && tolower((unsigned char)*d1)
+ != tolower((unsigned char)*d2)) {
+ if(tolower((unsigned char)*d1) <
+ tolower((unsigned char)*d2)) {
lastdiff = -1;
lastmlabs = atlabel;
d1 += len1;
return;
}
while(lablen--) {
- if(isalnum((int)*dname)
+ if(isalnum((unsigned char)*dname)
|| *dname == '-' || *dname == '_'
|| *dname == '*')
*s++ = *(char*)dname++;
#include "util/data/msgparse.h"
#include "util/data/dname.h"
#include "util/log.h"
-#include "util/net_help.h"
#include "util/regional.h"
#if CLIENT_SUBNET
#include "edns-subnet/edns-subnet.h"
#endif
-#include "ldns/sbuffer.h"
+#include "util/net_help.h"
+#include "sldns/sbuffer.h"
/** return code that means the function ran out of memory. negative so it does
* not conflict with DNS rcodes. */
#include "util/data/packed_rrset.h"
#include "util/storage/lookup3.h"
#include "util/regional.h"
-#include "ldns/rrdef.h"
-#include "ldns/sbuffer.h"
-#include "ldns/parseutil.h"
-#include "ldns/wire2str.h"
+#include "sldns/rrdef.h"
+#include "sldns/sbuffer.h"
+#include "sldns/parseutil.h"
+#include "sldns/wire2str.h"
#if CLIENT_SUBNET
#include "edns-subnet/edns-subnet.h"
#endif
/* take the data ! */
edns->edns_present = 1;
- edns->udp_size = ntohs(found->rrset_class);
edns->ext_rcode = found->rr_last->ttl_data[0];
edns->edns_version = found->rr_last->ttl_data[1];
edns->bits = sldns_read_uint16(&found->rr_last->ttl_data[2]);
+ edns->udp_size = ntohs(found->rrset_class);
+ /* ignore rdata and rrsigs */
#ifdef CLIENT_SUBNET
/* silently continue without ednsdata on parse error */
(void) parse_ednsdata(found->rr_last->ttl_data + 4, edns);
#ifndef UTIL_DATA_MSGPARSE_H
#define UTIL_DATA_MSGPARSE_H
#include "util/storage/lruhash.h"
-#include "ldns/pkthdr.h"
-#include "ldns/rrdef.h"
+#include "sldns/pkthdr.h"
+#include "sldns/rrdef.h"
#ifdef CLIENT_SUBNET
#include "util/net_help.h"
#endif
#include "util/regional.h"
#include "util/data/msgparse.h"
#include "util/data/msgencode.h"
-#include "ldns/sbuffer.h"
-#include "ldns/wire2str.h"
+#include "sldns/sbuffer.h"
+#include "sldns/wire2str.h"
/** MAX TTL default for messages and rrsets */
time_t MAX_TTL = 3600 * 24 * 10; /* ten days */
}
/** constructor for replyinfo */
-static struct reply_info*
+struct reply_info*
construct_reply_info_base(struct regional* region, uint16_t flags, size_t qd,
time_t ttl, time_t prettl, size_t an, size_t ns, size_t ar,
size_t total, enum sec_status sec)
/* rrset_count-1 because the first ref is part of the struct. */
size_t s = sizeof(struct reply_info) - sizeof(struct rrset_ref) +
sizeof(struct ub_packed_rrset_key*) * total;
+ if(total >= RR_COUNT_MAX) return NULL; /* sanity check on numRRS*/
if(region)
rep = (struct reply_info*)regional_alloc(region, s);
else rep = (struct reply_info*)malloc(s +
struct packed_rrset_data** data, struct regional* region)
{
/* allocate */
- size_t s = sizeof(struct packed_rrset_data) +
+ size_t s;
+ if(pset->rr_count > RR_COUNT_MAX || pset->rrsig_count > RR_COUNT_MAX ||
+ pset->size > RR_COUNT_MAX)
+ return 0; /* protect against integer overflow */
+ s = sizeof(struct packed_rrset_data) +
(pset->rr_count + pset->rrsig_count) *
(sizeof(size_t)+sizeof(uint8_t*)+sizeof(time_t)) +
pset->size;
}
hashvalue_t
-query_info_hash(struct query_info *q)
+query_info_hash(struct query_info *q, uint16_t flags)
{
hashvalue_t h = 0xab;
h = hashlittle(&q->qtype, sizeof(q->qtype), h);
+ if(q->qtype == LDNS_RR_TYPE_AAAA && (flags&BIT_CD))
+ h++;
h = hashlittle(&q->qclass, sizeof(q->qclass), h);
h = dname_query_hash(q->qname, h);
return h;
region, 65535, 1)) {
log_info("%s: log_dns_msg: out of memory", str);
} else {
- char* str = sldns_wire2str_pkt(sldns_buffer_begin(buf),
+ char* s = sldns_wire2str_pkt(sldns_buffer_begin(buf),
sldns_buffer_limit(buf));
- if(!str) {
+ if(!s) {
log_info("%s: log_dns_msg: ldns tostr failed", str);
} else {
- log_info("%s %s",
- str, (char*)sldns_buffer_begin(buf));
+ log_info("%s %s", str, s);
}
- free(str);
+ free(s);
}
sldns_buffer_free(buf);
regional_destroy(region);
struct lruhash_entry entry;
};
+/**
+ * Constructor for replyinfo.
+ * @param region: where to allocate the results, pass NULL to use malloc.
+ * @param flags: flags for the replyinfo.
+ * @param qd: qd count
+ * @param ttl: TTL of replyinfo
+ * @param prettl: prefetch ttl
+ * @param an: an count
+ * @param ns: ns count
+ * @param ar: ar count
+ * @param total: total rrset count (presumably an+ns+ar).
+ * @param sec: security status of the reply info.
+ * @return the reply_info base struct with the array for putting the rrsets
+ * in. The array has been zeroed. Returns NULL on malloc failure.
+ */
+struct reply_info*
+construct_reply_info_base(struct regional* region, uint16_t flags, size_t qd,
+ time_t ttl, time_t prettl, size_t an, size_t ns, size_t ar,
+ size_t total, enum sec_status sec);
+
/**
* Parse wire query into a queryinfo structure, return 0 on parse error.
* initialises the (prealloced) queryinfo structure as well.
/** delete reply_info data structure */
void reply_info_delete(void* d, void* arg);
-/** calculate hash value of query_info, lowercases the qname */
-hashvalue_t query_info_hash(struct query_info *q);
+/** calculate hash value of query_info, lowercases the qname,
+ * uses CD flag for AAAA qtype */
+hashvalue_t query_info_hash(struct query_info *q, uint16_t flags);
/**
* Setup query info entry
#include "util/alloc.h"
#include "util/regional.h"
#include "util/net_help.h"
-#include "ldns/rrdef.h"
-#include "ldns/sbuffer.h"
-#include "ldns/wire2str.h"
+#include "sldns/rrdef.h"
+#include "sldns/sbuffer.h"
+#include "sldns/wire2str.h"
void
ub_packed_rrset_parsedelete(struct ub_packed_rrset_key* pkey,
* from the SOA in the answer section from a direct SOA query or ANY query. */
#define PACKED_RRSET_SOA_NEG 0x4
+/** number of rrs and rrsets for integer overflow protection. More than
+ * this is not really possible (64K packet has much less RRs and RRsets) in
+ * a message. And this is small enough that also multiplied there is no
+ * integer overflow. */
+#define RR_COUNT_MAX 0xffffff
+
/**
* The identifying information for an RRset.
*/
* o base struct
* o rr_len size_t array
* o rr_data uint8_t* array
- * o rr_ttl uint32_t array (after size_t and ptrs because those may be
+ * o rr_ttl time_t array (after size_t and ptrs because those may be
* 64bit and this array before those would make them unaligned).
* Since the stuff before is 32/64bit, rr_ttl is 32 bit aligned.
* o rr_data rdata wireformats
#include "config.h"
#include "util/fptr_wlist.h"
#include "util/mini_event.h"
-#include "daemon/worker.h"
-#include "daemon/remote.h"
#include "services/outside_network.h"
#include "services/mesh.h"
#include "services/localzone.h"
#include "services/cache/infra.h"
#include "services/cache/rrset.h"
+#include "dns64/dns64.h"
#include "iterator/iterator.h"
#include "iterator/iter_fwd.h"
#include "validator/validator.h"
#include "util/locks.h"
#include "libunbound/libworker.h"
#include "libunbound/context.h"
+#include "libunbound/worker.h"
#include "util/tube.h"
#include "util/config_file.h"
#ifdef UB_ON_WINDOWS
else if(fptr == &ub_rrset_sizefunc) return 1;
else if(fptr == &infra_sizefunc) return 1;
else if(fptr == &key_entry_sizefunc) return 1;
+ else if(fptr == &rate_sizefunc) return 1;
else if(fptr == &test_slabhash_sizefunc) return 1;
#ifdef CLIENT_SUBNET
else if(fptr == &msg_cache_sizefunc) return 1;
else if(fptr == &ub_rrset_compare) return 1;
else if(fptr == &infra_compfunc) return 1;
else if(fptr == &key_entry_compfunc) return 1;
+ else if(fptr == &rate_compfunc) return 1;
else if(fptr == &test_slabhash_compfunc) return 1;
return 0;
}
else if(fptr == &ub_rrset_key_delete) return 1;
else if(fptr == &infra_delkeyfunc) return 1;
else if(fptr == &key_entry_delkeyfunc) return 1;
+ else if(fptr == &rate_delkeyfunc) return 1;
else if(fptr == &test_slabhash_delkey) return 1;
return 0;
}
else if(fptr == &rrset_data_delete) return 1;
else if(fptr == &infra_deldatafunc) return 1;
else if(fptr == &key_entry_deldatafunc) return 1;
+ else if(fptr == &rate_deldatafunc) return 1;
else if(fptr == &test_slabhash_deldata) return 1;
#ifdef CLIENT_SUBNET
else if(fptr == &subnet_data_delete) return 1;
int
fptr_whitelist_modenv_send_query(struct outbound_entry* (*fptr)(
uint8_t* qname, size_t qnamelen, uint16_t qtype, uint16_t qclass,
- uint16_t flags, int dnssec, int want_dnssec,
+ uint16_t flags, int dnssec, int want_dnssec, int nocaps,
struct sockaddr_storage* addr, socklen_t addrlen,
uint8_t* zone, size_t zonelen,
struct module_qstate* q))
int
fptr_whitelist_modenv_attach_sub(int (*fptr)(
struct module_qstate* qstate, struct query_info* qinfo,
- uint16_t qflags, int prime, struct module_qstate** newq))
+ uint16_t qflags, int prime, int valrec, struct module_qstate** newq))
{
if(fptr == &mesh_attach_sub) return 1;
return 0;
int
fptr_whitelist_modenv_detect_cycle(int (*fptr)(
struct module_qstate* qstate, struct query_info* qinfo,
- uint16_t flags, int prime))
+ uint16_t flags, int prime, int valrec))
{
if(fptr == &mesh_detect_cycle) return 1;
return 0;
{
if(fptr == &iter_init) return 1;
else if(fptr == &val_init) return 1;
+ else if(fptr == &dns64_init) return 1;
#ifdef WITH_PYTHONMODULE
else if(fptr == &pythonmod_init) return 1;
#endif
{
if(fptr == &iter_deinit) return 1;
else if(fptr == &val_deinit) return 1;
+ else if(fptr == &dns64_deinit) return 1;
#ifdef WITH_PYTHONMODULE
else if(fptr == &pythonmod_deinit) return 1;
#endif
{
if(fptr == &iter_operate) return 1;
else if(fptr == &val_operate) return 1;
+ else if(fptr == &dns64_operate) return 1;
#ifdef WITH_PYTHONMODULE
else if(fptr == &pythonmod_operate) return 1;
#endif
{
if(fptr == &iter_inform_super) return 1;
else if(fptr == &val_inform_super) return 1;
+ else if(fptr == &dns64_inform_super) return 1;
#ifdef WITH_PYTHONMODULE
else if(fptr == &pythonmod_inform_super) return 1;
#endif
{
if(fptr == &iter_clear) return 1;
else if(fptr == &val_clear) return 1;
+ else if(fptr == &dns64_clear) return 1;
#ifdef WITH_PYTHONMODULE
else if(fptr == &pythonmod_clear) return 1;
#endif
{
if(fptr == &iter_get_mem) return 1;
else if(fptr == &val_get_mem) return 1;
+ else if(fptr == &dns64_get_mem) return 1;
#ifdef WITH_PYTHONMODULE
else if(fptr == &pythonmod_get_mem) return 1;
#endif
*/
int fptr_whitelist_modenv_send_query(struct outbound_entry* (*fptr)(
uint8_t* qname, size_t qnamelen, uint16_t qtype, uint16_t qclass,
- uint16_t flags, int dnssec, int want_dnssec,
+ uint16_t flags, int dnssec, int want_dnssec, int nocaps,
struct sockaddr_storage* addr, socklen_t addrlen,
uint8_t* zone, size_t zonelen,
struct module_qstate* q));
*/
int fptr_whitelist_modenv_attach_sub(int (*fptr)(
struct module_qstate* qstate, struct query_info* qinfo,
- uint16_t qflags, int prime, struct module_qstate** newq));
+ uint16_t qflags, int prime, int valrec, struct module_qstate** newq));
/**
* Check function pointer whitelist for module_env kill_sub callback values.
*/
int fptr_whitelist_modenv_detect_cycle(int (*fptr)(
struct module_qstate* qstate, struct query_info* qinfo,
- uint16_t flags, int prime));
+ uint16_t flags, int prime, int valrec));
/**
* Check function pointer whitelist for module init call values.
780,
800,
801,
+802,
810,
828,
829,
1273,
1274,
1275,
-1276,
1277,
1278,
1279,
2423,
2424,
2425,
+2426,
2427,
2428,
2429,
3838,
3839,
3840,
-3841,
3842,
3843,
3844,
4359,
4361,
4362,
+4366,
4368,
4369,
4370,
4784,
4785,
4789,
+4790,
+4791,
4800,
4801,
4802,
4899,
4900,
4914,
+4936,
4937,
4940,
4941,
4952,
4969,
4970,
+4980,
4986,
4987,
4988,
5072,
5073,
5074,
+5078,
5079,
5080,
5081,
5315,
5343,
5344,
+5349,
5350,
5351,
5352,
5463,
5464,
5465,
+5474,
5500,
5501,
5502,
5682,
5683,
5684,
+5687,
5688,
5689,
5713,
6072,
6073,
6074,
+6080,
6081,
6082,
6083,
6163,
6200,
6201,
+6209,
6222,
6241,
6242,
6628,
6633,
6634,
+6635,
+6636,
6653,
6657,
6670,
7560,
7566,
7570,
+7574,
7588,
7624,
7627,
7778,
7779,
7781,
+7784,
7786,
7787,
7789,
8912,
8913,
8954,
+8980,
+8981,
8989,
8990,
8991,
9000,
9001,
9002,
+9006,
9007,
9009,
9020,
22005,
22273,
22305,
+22335,
22343,
22347,
22350,
24386,
24465,
24554,
+24577,
24676,
24677,
24678,
35004,
35355,
36001,
+36411,
36865,
37475,
37654,
+38002,
38201,
38202,
38203,
* Also thread creation and deletion functions are defined here.
*/
+/* if you define your own LOCKRET before including locks.h, you can get most
+ * locking functions without the dependency on log_err. */
+#ifndef LOCKRET
#include "util/log.h"
-
/**
* The following macro is used to check the return value of the
* pthread calls. They return 0 on success and an errno on error.
log_err("%s at %d could not " #func ": %s", \
__FILE__, __LINE__, strerror(lockret_err)); \
} while(0)
+#endif
/** DEBUG: use thread debug whenever possible */
#if defined(HAVE_PTHREAD) && defined(HAVE_PTHREAD_SPINLOCK_T) && defined(ENABLE_LOCK_CHECKS)
#include "config.h"
#include "util/log.h"
#include "util/locks.h"
-#include "ldns/sbuffer.h"
+#include "sldns/sbuffer.h"
#include <stdarg.h>
#ifdef HAVE_TIME_H
#include <time.h>
static int key_created = 0;
/** pthread key for thread ids in logfile */
static ub_thread_key_t logkey;
+#ifndef THREADS_DISABLED
+/** pthread mutex to protect FILE* */
+static lock_quick_t log_lock;
+#endif
/** the identity of this executable/process */
static const char* ident="unbound";
#if defined(HAVE_SYSLOG_H) || defined(UB_ON_WINDOWS)
if(!key_created) {
key_created = 1;
ub_thread_key_create(&logkey, NULL);
+ lock_quick_init(&log_lock);
}
+ lock_quick_lock(&log_lock);
if(logfile
#if defined(HAVE_SYSLOG_H) || defined(UB_ON_WINDOWS)
|| logging_to_syslog
#endif
- )
- verbose(VERB_QUERY, "switching log to %s",
- use_syslog?"syslog":(filename&&filename[0]?filename:"stderr"));
+ ) {
+ lock_quick_unlock(&log_lock); /* verbose() needs the lock */
+ verbose(VERB_QUERY, "switching log to %s",
+ use_syslog?"syslog":(filename&&filename[0]?filename:"stderr"));
+ lock_quick_lock(&log_lock);
+ }
if(logfile && logfile != stderr)
fclose(logfile);
#ifdef HAVE_SYSLOG_H
* chroot and no longer be able to access dev/log and so on */
openlog(ident, LOG_NDELAY, LOG_DAEMON);
logging_to_syslog = 1;
+ lock_quick_unlock(&log_lock);
return;
}
#elif defined(UB_ON_WINDOWS)
}
if(use_syslog) {
logging_to_syslog = 1;
+ lock_quick_unlock(&log_lock);
return;
}
#endif /* HAVE_SYSLOG_H */
if(!filename || !filename[0]) {
logfile = stderr;
+ lock_quick_unlock(&log_lock);
return;
}
/* open the file for logging */
filename += strlen(chrootdir);
f = fopen(filename, "a");
if(!f) {
+ lock_quick_unlock(&log_lock);
log_err("Could not open logfile %s: %s", filename,
strerror(errno));
return;
setvbuf(f, NULL, (int)_IOLBF, 0);
#endif
logfile = f;
+ lock_quick_unlock(&log_lock);
}
void log_file(FILE *f)
{
+ lock_quick_lock(&log_lock);
logfile = f;
+ lock_quick_unlock(&log_lock);
}
void log_thread_set(int* num)
ub_thread_key_set(logkey, num);
}
+int log_thread_get(void)
+{
+ unsigned int* tid;
+ if(!key_created) return 0;
+ tid = (unsigned int*)ub_thread_key_get(logkey);
+ return (int)(tid?*tid:0);
+}
+
void log_ident_set(const char* id)
{
ident = id;
return;
}
#endif /* HAVE_SYSLOG_H */
- if(!logfile) return;
+ lock_quick_lock(&log_lock);
+ if(!logfile) {
+ lock_quick_unlock(&log_lock);
+ return;
+ }
if(log_now)
now = (time_t)*log_now;
else now = (time_t)time(NULL);
/* line buffering does not work on windows */
fflush(logfile);
#endif
+ lock_quick_unlock(&log_lock);
}
/**
*/
void log_thread_set(int* num);
+/**
+ * Get the thread id from logging system. Set after log_init is
+ * initialised, or log_thread_set for newly created threads.
+ * This initialisation happens in unbound as a daemon, in daemon
+ * startup code, when that spawns threads.
+ * @return thread number, from 0 and up. Before initialised, returns 0.
+ */
+int log_thread_get(void);
+
/**
* Set identity to print, default is 'unbound'.
* @param id: string to print. Name of executable.
#define HAVE_EVENT_BASE_FREE
#endif
+/* redefine to use our own namespace so that on platforms where
+ * linkers crosslink library-private symbols with other symbols, it works */
+#define event_init minievent_init
+#define event_get_version minievent_get_version
+#define event_get_method minievent_get_method
+#define event_base_dispatch minievent_base_dispatch
+#define event_base_loopexit minievent_base_loopexit
+#define event_base_free minievent_base_free
+#define event_set minievent_set
+#define event_base_set minievent_base_set
+#define event_add minievent_add
+#define event_del minievent_del
+#define signal_add minisignal_add
+#define signal_del minisignal_del
+
/** event timeout */
#define EV_TIMEOUT 0x01
/** event fd readable */
* If BIT_CD is set, CD bit is set in queries with EDNS records.
* @param want_dnssec: if set, the validator wants DNSSEC. Without
* EDNS, the answer is likely to be useless for this domain.
+ * @param nocaps: do not use caps_for_id, use the qname as given.
+ * (ignored if caps_for_id is disabled).
* @param addr: where to.
* @param addrlen: length of addr.
* @param zone: delegation point name.
*/
struct outbound_entry* (*send_query)(uint8_t* qname, size_t qnamelen,
uint16_t qtype, uint16_t qclass, uint16_t flags, int dnssec,
- int want_dnssec, struct sockaddr_storage* addr,
+ int want_dnssec, int nocaps, struct sockaddr_storage* addr,
socklen_t addrlen, uint8_t* zone, size_t zonelen,
struct module_qstate* q);
* @param qinfo: what to query for (copied).
* @param qflags: what flags to use (RD, CD flag or not).
* @param prime: if it is a (stub) priming query.
+ * @param valrec: validation lookup recursion, does not need validation
* @param newq: If the new subquery needs initialisation, it is
* returned, otherwise NULL is returned.
* @return: false on error, true if success (and init may be needed).
*/
int (*attach_sub)(struct module_qstate* qstate,
struct query_info* qinfo, uint16_t qflags, int prime,
- struct module_qstate** newq);
+ int valrec, struct module_qstate** newq);
/**
* Kill newly attached sub. If attach_sub returns newq for
* @param qinfo: query info for dependency.
* @param flags: query flags of dependency, RD/CD flags.
* @param prime: if dependency is a priming query or not.
+ * @param valrec: validation lookup recursion, does not need validation
* @return true if the name,type,class exists and the given
* qstate mesh exists as a dependency of that name. Thus
* if qstate becomes dependent on name,type,class then a
* cycle is created.
*/
int (*detect_cycle)(struct module_qstate* qstate,
- struct query_info* qinfo, uint16_t flags, int prime);
+ struct query_info* qinfo, uint16_t flags, int prime,
+ int valrec);
/** region for temporary usage. May be cleared after operate() call. */
struct regional* scratch;
uint16_t query_flags;
/** if this is a (stub or root) priming query (with hints) */
int is_priming;
+ /** if this is a validation recursion query that does not get
+ * validation itself */
+ int is_valrec;
/** comm_reply contains server replies */
struct comm_reply* reply;
#include "util/data/dname.h"
#include "util/module.h"
#include "util/regional.h"
-#include "ldns/parseutil.h"
-#include "ldns/wire2str.h"
+#include "sldns/parseutil.h"
+#include "sldns/wire2str.h"
#include <fcntl.h>
#ifdef HAVE_OPENSSL_SSL_H
#include <openssl/ssl.h>
case AF_INET6: family="ip6";
sinaddr = &((struct sockaddr_in6*)addr)->sin6_addr;
break;
- case AF_UNIX: family="unix"; break;
+ case AF_LOCAL:
+ dest[0]=0;
+ (void)inet_ntop(af, sinaddr, dest,
+ (socklen_t)sizeof(dest));
+ verbose(v, "%s local %s", str, dest);
+ return; /* do not continue and try to get port */
default: break;
}
if(inet_ntop(af, sinaddr, dest, (socklen_t)sizeof(dest)) == 0) {
case AF_INET6: family="";
sinaddr = &((struct sockaddr_in6*)addr)->sin6_addr;
break;
- case AF_UNIX: family="unix_family "; break;
+ case AF_LOCAL: family="local "; break;
default: break;
}
if(inet_ntop(af, sinaddr, dest, (socklen_t)sizeof(dest)) == 0) {
log_crypto_err("could not SSL_CTX_new");
return NULL;
}
- /* no SSLv2 because has defects */
+ /* no SSLv2, SSLv3 because has defects */
if(!(SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2) & SSL_OP_NO_SSLv2)){
log_crypto_err("could not set SSL_OP_NO_SSLv2");
SSL_CTX_free(ctx);
return NULL;
}
+ if(!(SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv3) & SSL_OP_NO_SSLv3)){
+ log_crypto_err("could not set SSL_OP_NO_SSLv3");
+ SSL_CTX_free(ctx);
+ return NULL;
+ }
if(!SSL_CTX_use_certificate_file(ctx, pem, SSL_FILETYPE_PEM)) {
log_err("error for cert file: %s", pem);
log_crypto_err("error in SSL_CTX use_certificate_file");
SSL_CTX_free(ctx);
return NULL;
}
+ if(!(SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv3) & SSL_OP_NO_SSLv3)) {
+ log_crypto_err("could not set SSL_OP_NO_SSLv3");
+ SSL_CTX_free(ctx);
+ return NULL;
+ }
if(key && key[0]) {
if(!SSL_CTX_use_certificate_file(ctx, pem, SSL_FILETYPE_PEM)) {
log_err("error in client certificate %s", pem);
}
}
if(verifypem && verifypem[0]) {
- if(!SSL_CTX_load_verify_locations(ctx, verifypem, NULL) != 1) {
+ if(!SSL_CTX_load_verify_locations(ctx, verifypem, NULL)) {
log_crypto_err("error in SSL_CTX verify");
SSL_CTX_free(ctx);
return NULL;
static unsigned long
ub_crypto_id_cb(void)
{
- return (unsigned long)ub_thread_self();
+ return (unsigned long)log_thread_get();
}
static void
{
#if defined(HAVE_SSL) && defined(OPENSSL_THREADS) && !defined(THREADS_DISABLED)
int i;
- ub_openssl_locks = (lock_basic_t*)malloc(
- sizeof(lock_basic_t)*CRYPTO_num_locks());
+ ub_openssl_locks = (lock_basic_t*)reallocarray(
+ NULL, (size_t)CRYPTO_num_locks(), sizeof(lock_basic_t));
if(!ub_openssl_locks)
return 0;
for(i=0; i<CRYPTO_num_locks(); i++) {
#include "util/log.h"
#include "util/net_help.h"
#include "util/fptr_wlist.h"
-#include "ldns/pkthdr.h"
-#include "ldns/sbuffer.h"
+#include "sldns/pkthdr.h"
+#include "sldns/sbuffer.h"
+#include "dnstap/dnstap.h"
#ifdef HAVE_OPENSSL_SSL_H
#include <openssl/ssl.h>
#endif
cmsg = CMSG_FIRSTHDR(&msg);
if(r->srctype == 4) {
#ifdef IP_PKTINFO
+ void* cmsg_data;
msg.msg_controllen = CMSG_SPACE(sizeof(struct in_pktinfo));
log_assert(msg.msg_controllen <= sizeof(control));
cmsg->cmsg_level = IPPROTO_IP;
cmsg->cmsg_type = IP_PKTINFO;
memmove(CMSG_DATA(cmsg), &r->pktinfo.v4info,
sizeof(struct in_pktinfo));
+ /* unset the ifindex to not bypass the routing tables */
+ cmsg_data = CMSG_DATA(cmsg);
+ ((struct in_pktinfo *) cmsg_data)->ipi_ifindex = 0;
cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_pktinfo));
#elif defined(IP_SENDSRCADDR)
msg.msg_controllen = CMSG_SPACE(sizeof(struct in_addr));
msg.msg_control = NULL;
#endif /* IP_PKTINFO or IP_SENDSRCADDR */
} else if(r->srctype == 6) {
+ void* cmsg_data;
msg.msg_controllen = CMSG_SPACE(sizeof(struct in6_pktinfo));
log_assert(msg.msg_controllen <= sizeof(control));
cmsg->cmsg_level = IPPROTO_IPV6;
cmsg->cmsg_type = IPV6_PKTINFO;
memmove(CMSG_DATA(cmsg), &r->pktinfo.v6info,
sizeof(struct in6_pktinfo));
+ /* unset the ifindex to not bypass the routing tables */
+ cmsg_data = CMSG_DATA(cmsg);
+ ((struct in6_pktinfo *) cmsg_data)->ipi6_ifindex = 0;
cmsg->cmsg_len = CMSG_LEN(sizeof(struct in6_pktinfo));
} else {
/* try to pass all 0 to use default route */
}
/* grab the tcp handler buffers */
+ c->cur_tcp_count++;
c->tcp_free = c_hdl->tcp_free;
if(!c->tcp_free) {
/* stop accepting incoming queries for now. */
comm_point_stop_listening(c);
}
- /* addr is dropped. Not needed for tcp reply. */
setup_tcp_handler(c_hdl, new_fd);
}
}
comm_point_close(c);
if(c->tcp_parent) {
+ c->tcp_parent->cur_tcp_count--;
c->tcp_free = c->tcp_parent->tcp_free;
c->tcp_parent->tcp_free = c;
if(!c->tcp_free) {
c->tcp_byte_count = 0;
c->tcp_parent = NULL;
c->max_tcp_count = 0;
+ c->cur_tcp_count = 0;
c->tcp_handlers = NULL;
c->tcp_free = NULL;
c->type = comm_udp;
c->tcp_byte_count = 0;
c->tcp_parent = NULL;
c->max_tcp_count = 0;
+ c->cur_tcp_count = 0;
c->tcp_handlers = NULL;
c->tcp_free = NULL;
c->type = comm_udp;
c->tcp_byte_count = 0;
c->tcp_parent = parent;
c->max_tcp_count = 0;
+ c->cur_tcp_count = 0;
c->tcp_handlers = NULL;
c->tcp_free = NULL;
c->type = comm_tcp;
c->tcp_byte_count = 0;
c->tcp_parent = NULL;
c->max_tcp_count = num;
+ c->cur_tcp_count = 0;
c->tcp_handlers = (struct comm_point**)calloc((size_t)num,
sizeof(struct comm_point*));
if(!c->tcp_handlers) {
c->tcp_byte_count = 0;
c->tcp_parent = NULL;
c->max_tcp_count = 0;
+ c->cur_tcp_count = 0;
c->tcp_handlers = NULL;
c->tcp_free = NULL;
c->type = comm_tcp;
c->tcp_byte_count = 0;
c->tcp_parent = NULL;
c->max_tcp_count = 0;
+ c->cur_tcp_count = 0;
c->tcp_handlers = NULL;
c->tcp_free = NULL;
c->type = comm_local;
c->tcp_byte_count = 0;
c->tcp_parent = NULL;
c->max_tcp_count = 0;
+ c->cur_tcp_count = 0;
c->tcp_handlers = NULL;
c->tcp_free = NULL;
c->type = comm_raw;
else
comm_point_send_udp_msg(repinfo->c, repinfo->c->buffer,
(struct sockaddr*)&repinfo->addr, repinfo->addrlen);
+#ifdef USE_DNSTAP
+ if(repinfo->c->dtenv != NULL &&
+ repinfo->c->dtenv->log_client_response_messages)
+ dt_msg_send_client_response(repinfo->c->dtenv,
+ &repinfo->addr, repinfo->c->type, repinfo->c->buffer);
+#endif
} else {
+#ifdef USE_DNSTAP
+ if(repinfo->c->tcp_parent->dtenv != NULL &&
+ repinfo->c->tcp_parent->dtenv->log_client_response_messages)
+ dt_msg_send_client_response(repinfo->c->tcp_parent->dtenv,
+ &repinfo->addr, repinfo->c->type, repinfo->c->buffer);
+#endif
comm_point_start_listening(repinfo->c, -1, TCP_QUERY_TIMEOUT);
}
}
/* -------- TCP Accept -------- */
/** the number of TCP handlers for this tcp-accept socket */
int max_tcp_count;
+ /** current number of tcp handler in-use for this accept socket */
+ int cur_tcp_count;
/** malloced array of tcp handlers for a tcp-accept,
of size max_tcp_count. */
struct comm_point** tcp_handlers;
comm_ssl_shake_hs_write
} ssl_shake_state;
+ /* -------- dnstap ------- */
+ /** the dnstap environment */
+ struct dt_env* dtenv;
+
/** is this a UDP, TCP-accept or TCP socket. */
enum comm_point_type {
/** UDP socket - handle datagrams. */
#include "util/log.h"
#include <time.h>
-#ifdef HAVE_ARC4RANDOM_UNIFORM
-/* no include for arc4_uniform */
-#elif defined(HAVE_SSL)
-#include <openssl/rand.h>
-#include <openssl/rc4.h>
-#include <openssl/err.h>
-#elif defined(HAVE_NSS)
+#ifdef HAVE_NSS
/* nspr4 */
#include "prerror.h"
/* nss3 */
*/
#define MAX_VALUE 0x7fffffff
-#ifdef HAVE_ARC4RANDOM_UNIFORM
-
+#ifndef HAVE_NSS
void
ub_systemseed(unsigned int ATTR_UNUSED(seed))
{
return (long)arc4random() & MAX_VALUE;
}
-#elif defined(HAVE_SSL)
-/**
- * Struct with per-thread random state.
- * Keeps SSL types away from the header file.
- */
-struct ub_randstate {
- /** key used for arc4random generation */
- RC4_KEY rc4;
- /** keeps track of key usage */
- int rc4_ready;
-};
-
-/** Size of key to use (must be multiple of 8) */
-#define SEED_SIZE 24
-
-/** Number of bytes to reseed after */
-#define REKEY_BYTES (1 << 24)
-
-/* (re)setup system seed */
-void
-ub_systemseed(unsigned int seed)
-{
- /* RAND_ is threadsafe, by the way */
- if(!RAND_status()) {
- /* try to seed it */
- unsigned char buf[256];
- unsigned int v = seed;
- size_t i;
- for(i=0; i<256/sizeof(seed); i++) {
- memmove(buf+i*sizeof(seed), &v, sizeof(seed));
- v = v*seed + (unsigned int)i;
- }
- RAND_seed(buf, 256);
- if(!RAND_status()) {
- log_err("Random generator has no entropy "
- "(error %ld)", ERR_get_error());
- } else {
- verbose(VERB_OPS, "openssl has no entropy, "
- "seeding with time and pid");
- }
- }
-}
-
-/** reseed random generator */
-static void
-ub_arc4random_stir(struct ub_randstate* s, struct ub_randstate* from)
-{
- /* not as unsigned char, but longerint so that it is
- aligned properly on alignment sensitive platforms */
- uint64_t rand_buf[SEED_SIZE/sizeof(uint64_t)];
- int i;
-
- memset(&s->rc4, 0, sizeof(s->rc4));
- memset(rand_buf, 0xc, sizeof(rand_buf));
- if (from) {
- uint8_t* rbuf = (uint8_t*)rand_buf;
- for(i=0; i<SEED_SIZE; i++)
- rbuf[i] = (uint8_t)ub_random(from);
- } else {
- if(!RAND_status())
- ub_systemseed((unsigned)getpid()^(unsigned)time(NULL));
- if (RAND_bytes((unsigned char*)rand_buf,
- (int)sizeof(rand_buf)) <= 0) {
- /* very unlikely that this happens, since we seeded
- * above, if it does; complain and keep going */
- log_err("Couldn't obtain random bytes (error %ld)",
- ERR_get_error());
- s->rc4_ready = 256;
- return;
- }
- }
-#ifdef HAVE_FIPS_MODE
- if(FIPS_mode()) {
- /* RC4 is not allowed, get some trustworthy randomness */
- /* double certainty here, this routine should not be
- * called in FIPS_mode */
- memset(rand_buf, 0, sizeof(rand_buf));
- s->rc4_ready = REKEY_BYTES;
- return;
- }
-#endif /* FIPS_MODE */
- RC4_set_key(&s->rc4, SEED_SIZE, (unsigned char*)rand_buf);
-
- /*
- * Discard early keystream, as per recommendations in:
- * http://www.wisdom.weizmann.ac.il/~itsik/RC4/Papers/Rc4_ksa.ps
- */
- for(i = 0; i <= 256; i += sizeof(rand_buf))
- RC4(&s->rc4, sizeof(rand_buf), (unsigned char*)rand_buf,
- (unsigned char*)rand_buf);
-
- memset(rand_buf, 0, sizeof(rand_buf));
-
- s->rc4_ready = REKEY_BYTES;
-}
-
-struct ub_randstate*
-ub_initstate(unsigned int seed, struct ub_randstate* from)
-{
- struct ub_randstate* s = (struct ub_randstate*)calloc(1, sizeof(*s));
- if(!s) {
- log_err("malloc failure in random init");
- return NULL;
- }
- ub_systemseed(seed);
-#ifdef HAVE_FIPS_MODE
- if(!FIPS_mode())
-#endif
- ub_arc4random_stir(s, from);
- return s;
-}
-
-long int
-ub_random(struct ub_randstate* s)
+long int
+ub_random_max(struct ub_randstate* state, long int x)
{
- unsigned int r = 0;
-#ifdef HAVE_FIPS_MODE
- if(FIPS_mode()) {
- /* RC4 is not allowed, get some trustworthy randomness */
- /* we use pseudo bytes: it tries to return secure randomness
- * but returns 'something' if that fails. We need something
- * else if it fails, because we cannot block here */
- if(RAND_pseudo_bytes((unsigned char*)&r, (int)sizeof(r))
- == -1) {
- log_err("FIPSmode, no arc4random but RAND failed "
- "(error %ld)", ERR_get_error());
- }
- return (long int)((r) % (((unsigned)MAX_VALUE + 1)));
- }
-#endif /* FIPS_MODE */
- if (s->rc4_ready <= 0) {
- ub_arc4random_stir(s, NULL);
- }
-
- RC4(&s->rc4, sizeof(r),
- (unsigned char *)&r, (unsigned char *)&r);
- s->rc4_ready -= sizeof(r);
- return (long int)((r) % (((unsigned)MAX_VALUE + 1)));
+ (void)state;
+ /* on OpenBSD, this does not need _seed(), or _stir() calls */
+ return (long)arc4random_uniform((uint32_t)x);
}
-#elif defined(HAVE_NSS)
+#else
/* not much to remember for NSS since we use its pk11_random, placeholder */
struct ub_randstate {
return x & MAX_VALUE;
}
-#endif /* HAVE_ARC4RANDOM_UNIFORM or HAVE_SSL or HAVE_NSS */
-
long int
ub_random_max(struct ub_randstate* state, long int x)
{
-#ifndef HAVE_ARC4RANDOM_UNIFORM
/* make sure we fetch in a range that is divisible by x. ignore
* values from d .. MAX_VALUE, instead draw a new number */
long int d = MAX_VALUE - (MAX_VALUE % x); /* d is divisible by x */
while(d <= v)
v = ub_random(state);
return (v % x);
-#else
- (void)state;
- /* on OpenBSD, this does not need _seed(), or _stir() calls */
- return (long)arc4random_uniform(x);
-#endif
}
+#endif /* HAVE_NSS */
void
ub_randfree(struct ub_randstate* s)
#include "config.h"
#include "util/rtt.h"
+/* overwritten by config: infra_cache_min_rtt: */
+int RTT_MIN_TIMEOUT = 50;
/** calculate RTO from rtt information */
static int
calc_rto(const struct rtt_info* rtt)
};
/** min retransmit timeout value, in milliseconds */
-#define RTT_MIN_TIMEOUT 50
+extern int RTT_MIN_TIMEOUT;
/** max retransmit timeout value, in milliseconds */
#define RTT_MAX_TIMEOUT 120000
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h> /* attempt to define endianness (solaris) */
#endif
-#ifdef linux
-# include <endian.h> /* attempt to define endianness */
+#if defined(linux) || defined(__OpenBSD__)
+# ifdef HAVE_ENDIAN_H
+# include <endian.h> /* attempt to define endianness */
+# else
+# include <machine/endian.h> /* on older OpenBSD */
+# endif
#endif
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
#include <sys/endian.h> /* attempt to define endianness */
#endif
-#ifdef __OpenBSD__
-#include <machine/endian.h> /* attempt to define endianness */
-#endif
/* random initial value */
static uint32_t raninit = (uint32_t)0xdeadbeef;
raninit = v;
}
+#define VALGRIND
+
/*
* My best guess at if you are big-endian or little-endian. This may
* need adjustment.
table->space_used += need_size;
} else {
/* if so: update data - needs a writelock */
- /* A+=B-C; works because A will wrap around when B<C */
table->space_used += need_size -
(*table->sizefunc)(found->key, found->data);
- if (found->key != entry->key) {
- (*table->delkeyfunc)(entry->key, cb_arg);
- }
+ (*table->delkeyfunc)(entry->key, cb_arg);
lru_touch(table, found);
lock_rw_wrlock(&found->lock);
- if (found->data != data) {
- (*table->deldatafunc)(found->data, cb_arg);
- found->data = data;
- }
+ (*table->deldatafunc)(found->data, cb_arg);
+ found->data = data;
lock_rw_unlock(&found->lock);
}
lock_quick_unlock(&bin->lock);
}
void slabhash_traverse(struct slabhash* sh, int wr,
- void (*func)(struct lruhash_entry*, void*), void* arg)
+ void (*func)(struct lruhash_entry*, void*), void* arg)
{
size_t i;
for(i=0; i<sh->size; i++)
lruhash_traverse(sh->array[i], wr, func, arg);
}
+
+size_t count_slabhash_entries(struct slabhash* sh)
+{
+ size_t slab, cnt = 0;
+
+ for(slab=0; slab<sh->size; slab++) {
+ lock_quick_lock(&sh->array[slab]->lock);
+ cnt += sh->array[slab]->num;
+ lock_quick_unlock(&sh->array[slab]->lock);
+ }
+ return cnt;
+}
void slabhash_traverse(struct slabhash* table, int wr,
void (*func)(struct lruhash_entry*, void*), void* arg);
+/*
+ * Count entries in slabhash.
+ * @param table: slabbed hash table;
+ * @return the number of items
+ */
+size_t count_slabhash_entries(struct slabhash* table);
+
/* --- test representation --- */
/** test structure contains test key */
struct slabhash_testkey {
#define HAVE_EVENT_BASE_FREE
#endif
+/* redefine the calls to different names so that there is no name
+ * collision with other code that uses libevent names. (that uses libunbound)*/
+#define event_init winsockevent_init
+#define event_get_version winsockevent_get_version
+#define event_get_method winsockevent_get_method
+#define event_base_dispatch winsockevent_base_dispatch
+#define event_base_loopexit winsockevent_base_loopexit
+#define event_base_free winsockevent_base_free
+#define event_set winsockevent_set
+#define event_base_set winsockevent_base_set
+#define event_add winsockevent_add
+#define event_del winsockevent_del
+#define signal_add winsocksignal_add
+#define signal_del winsocksignal_del
+
/** event timeout */
#define EV_TIMEOUT 0x01
/** event fd readable */
#include "services/mesh.h"
#include "services/cache/rrset.h"
#include "validator/val_kcache.h"
-#include "ldns/sbuffer.h"
-#include "ldns/wire2str.h"
-#include "ldns/str2wire.h"
-#include "ldns/keyraw.h"
-#include "ldns/rrdef.h"
+#include "sldns/sbuffer.h"
+#include "sldns/wire2str.h"
+#include "sldns/str2wire.h"
+#include "sldns/keyraw.h"
+#include "sldns/rrdef.h"
#include <stdarg.h>
#include <ctype.h>
* @param anchors: all points.
* @param str: comments line
* @param fname: filename
- * @param origin: \$ORIGIN.
+ * @param origin: the $ORIGIN.
* @param origin_len: length of origin
* @param prev: passed to ldns.
* @param prev_len: length of prev
handle_origin(char* line, uint8_t** origin, size_t* origin_len)
{
size_t len = 0;
- while(isspace((int)*line))
+ while(isspace((unsigned char)*line))
line++;
if(strncmp(line, "$ORIGIN", 7) != 0)
return 0;
free(*origin);
line += 7;
- while(isspace((int)*line))
+ while(isspace((unsigned char)*line))
line++;
*origin = sldns_str2wire_dname(line, &len);
*origin_len = len;
verbose(VERB_ALGO, "autotrust: write to disk: %s", tempf);
out = fopen(tempf, "w");
if(!out) {
- log_err("could not open autotrust file for writing, %s: %s",
+ fatal_exit("could not open autotrust file for writing, %s: %s",
tempf, strerror(errno));
return;
}
/* failed to write contents (completely) */
fclose(out);
unlink(tempf);
- log_err("could not completely write: %s", fname);
+ fatal_exit("could not completely write: %s", fname);
return;
}
if(fclose(out) != 0) {
- log_err("could not complete write: %s: %s",
+ fatal_exit("could not complete write: %s: %s",
fname, strerror(errno));
unlink(tempf);
return;
(void)unlink(fname); /* windows does not replace file with rename() */
#endif
if(rename(tempf, fname) < 0) {
- log_err("rename(%s to %s): %s", tempf, fname, strerror(errno));
+ fatal_exit("rename(%s to %s): %s", tempf, fname, strerror(errno));
}
}
#include "util/log.h"
#include "util/net_help.h"
#include "util/config_file.h"
-#include "ldns/sbuffer.h"
-#include "ldns/rrdef.h"
-#include "ldns/str2wire.h"
+#include "sldns/sbuffer.h"
+#include "sldns/rrdef.h"
+#include "sldns/str2wire.h"
#ifdef HAVE_GLOB_H
#include <glob.h>
#endif
/* not a comment, complete the keyword */
if(numdone > 0) {
/* check same type */
- if(isspace(c)) {
+ if(isspace((unsigned char)c)) {
ungetc(c, in);
return numdone;
}
}
sldns_buffer_write_u8(buf, (uint8_t)c);
numdone++;
- if(isspace(c)) {
+ if(isspace((unsigned char)c)) {
/* collate whitespace into ' ' */
while((c = getc(in)) != EOF ) {
if(c == '\n')
(*line)++;
- if(!isspace(c)) {
+ if(!isspace((unsigned char)c)) {
ungetc(c, in);
break;
}
int rdlen;
sldns_buffer_clear(buf);
while((rdlen=readkeyword_bindfile(in, buf, line, 1))) {
- if(rdlen == 1 && isspace((int)*sldns_buffer_begin(buf))) {
+ if(rdlen == 1 && isspace((unsigned char)*sldns_buffer_begin(buf))) {
sldns_buffer_clear(buf);
continue;
}
sldns_buffer_clear(buf);
while((rdlen=readkeyword_bindfile(in, buf, line, comments))) {
if(rdlen == 1 && sldns_buffer_position(buf) == 1
- && isspace((int)*sldns_buffer_begin(buf))) {
+ && isspace((unsigned char)*sldns_buffer_begin(buf))) {
/* starting whitespace is removed */
sldns_buffer_clear(buf);
continue;
}
return 1;
} else if(rdlen == 1 &&
- isspace((int)sldns_buffer_current(buf)[-1])) {
+ isspace((unsigned char)sldns_buffer_current(buf)[-1])) {
/* leave whitespace here */
} else {
/* not space or whatnot, so actual content */
memset(pd, 0, sizeof(*pd));
pd->count = num;
pd->trust = rrset_trust_ultimate;
- pd->rr_len = (size_t*)malloc(num*sizeof(size_t));
+ pd->rr_len = (size_t*)reallocarray(NULL, num, sizeof(size_t));
if(!pd->rr_len) {
free(pd);
free(pkey->rk.dname);
free(pkey);
return NULL;
}
- pd->rr_ttl = (time_t*)malloc(num*sizeof(time_t));
+ pd->rr_ttl = (time_t*)reallocarray(NULL, num, sizeof(time_t));
if(!pd->rr_ttl) {
free(pd->rr_len);
free(pd);
free(pkey);
return NULL;
}
- pd->rr_data = (uint8_t**)malloc(num*sizeof(uint8_t*));
+ pd->rr_data = (uint8_t**)reallocarray(NULL, num, sizeof(uint8_t*));
if(!pd->rr_data) {
free(pd->rr_ttl);
free(pd->rr_len);
dname_str(ta->name, b);
log_warn("trust anchor %s has no supported algorithms,"
" the anchor is ignored (check if you need to"
- " upgrade unbound and openssl)", b);
+ " upgrade unbound and "
+#ifdef HAVE_LIBRESSL
+ "libressl"
+#else
+ "openssl"
+#endif
+ ")", b);
(void)rbtree_delete(anchors->tree, &ta->node);
lock_basic_unlock(&ta->lock);
anchors_delfunc(&ta->node, NULL);
#include "util/storage/lookup3.h"
#include "util/regional.h"
#include "util/net_help.h"
-#include "ldns/rrdef.h"
-#include "ldns/keyraw.h"
+#include "sldns/rrdef.h"
+#include "sldns/keyraw.h"
size_t
key_entry_sizefunc(void* key, void* data)
#include "util/config_file.h"
#include "services/cache/rrset.h"
#include "services/cache/dns.h"
-#include "ldns/rrdef.h"
-#include "ldns/sbuffer.h"
+#include "sldns/rrdef.h"
+#include "sldns/sbuffer.h"
int val_neg_data_compare(const void* a, const void* b)
{
#include "util/data/msgreply.h"
/* we include nsec.h for the bitmap_has_type function */
#include "validator/val_nsec.h"
-#include "ldns/sbuffer.h"
+#include "sldns/sbuffer.h"
/**
* This function we get from ldns-compat or from base system
{
size_t i;
for(i=0; i<lablen; i++) {
- if(tolower((int)*lab1) != tolower((int)*lab2)) {
- if(tolower((int)*lab1) < tolower((int)*lab2))
+ if(tolower((unsigned char)*lab1) != tolower((unsigned char)*lab2)) {
+ if(tolower((unsigned char)*lab1) < tolower((unsigned char)*lab2))
return -1;
return 1;
}
* and do the library calls (for the crypto library in use).
*/
#include "config.h"
-#include "validator/val_secalgo.h"
+/* packed_rrset on top to define enum types (forced by c99 standard) */
#include "util/data/packed_rrset.h"
+#include "validator/val_secalgo.h"
#include "util/log.h"
-#include "ldns/rrdef.h"
-#include "ldns/keyraw.h"
-#include "ldns/sbuffer.h"
+#include "sldns/rrdef.h"
+#include "sldns/keyraw.h"
+#include "sldns/sbuffer.h"
#if !defined(HAVE_SSL) && !defined(HAVE_NSS)
#error "Need crypto library to do digital signature cryptography"
#include "util/module.h"
#include "util/net_help.h"
#include "util/regional.h"
-#include "ldns/keyraw.h"
-#include "ldns/sbuffer.h"
-#include "ldns/parseutil.h"
-#include "ldns/wire2str.h"
+#include "sldns/keyraw.h"
+#include "sldns/sbuffer.h"
+#include "sldns/parseutil.h"
+#include "sldns/wire2str.h"
#include <ctype.h>
#if !defined(HAVE_SSL) && !defined(HAVE_NSS)
fd.rr_data = fdata;
rbtree_init(&sortree1, &canonical_tree_compare);
rbtree_init(&sortree2, &canonical_tree_compare);
+ if(d1->count > RR_COUNT_MAX || d2->count > RR_COUNT_MAX)
+ return 1; /* protection against integer overflow */
rrs1 = regional_alloc(region, sizeof(struct canon_rr)*d1->count);
rrs2 = regional_alloc(region, sizeof(struct canon_rr)*d2->count);
if(!rrs1 || !rrs2) return 1; /* alloc failure */
sizeof(rbtree_t));
if(!*sortree)
return 0;
+ if(d->count > RR_COUNT_MAX)
+ return 0; /* integer overflow protection */
rrs = regional_alloc(region, sizeof(struct canon_rr)*d->count);
if(!rrs) {
*sortree = NULL;
chase->ar_numrrsets;
}
+void val_reply_remove_auth(struct reply_info* rep, size_t index)
+{
+ log_assert(index < rep->rrset_count);
+ log_assert(index >= rep->an_numrrsets);
+ log_assert(index < rep->an_numrrsets+rep->ns_numrrsets);
+ memmove(rep->rrsets+index, rep->rrsets+index+1,
+ sizeof(struct ub_packed_rrset_key*)*
+ (rep->rrset_count - index - 1));
+ rep->ns_numrrsets--;
+ rep->rrset_count--;
+}
+
void
val_check_nonsecure(struct val_env* ve, struct reply_info* rep)
{
void val_fill_reply(struct reply_info* chase, struct reply_info* orig,
size_t cname_skip, uint8_t* name, size_t len, uint8_t* signer);
+/**
+ * Remove rrset with index from reply, from the authority section.
+ * @param rep: reply to remove it from.
+ * @param index: rrset to remove, must be in the authority section.
+ */
+void val_reply_remove_auth(struct reply_info* rep, size_t index);
+
/**
* Remove all unsigned or non-secure status rrsets from NS and AR sections.
* So that unsigned data does not get let through to clients, when we have
#include "util/regional.h"
#include "util/config_file.h"
#include "util/fptr_wlist.h"
-#include "ldns/rrdef.h"
-#include "ldns/wire2str.h"
+#include "sldns/rrdef.h"
+#include "sldns/wire2str.h"
/* forward decl for cache response and normal super inform calls of a DS */
static void process_ds_response(struct module_qstate* qstate,
sizeof(struct reply_info) - sizeof(struct rrset_ref));
if(!vq->chase_reply)
return NULL;
+ if(vq->orig_msg->rep->rrset_count > RR_COUNT_MAX)
+ return NULL; /* protect against integer overflow */
vq->chase_reply->rrsets = regional_alloc_init(qstate->region,
vq->orig_msg->rep->rrsets, sizeof(struct ub_packed_rrset_key*)
* vq->orig_msg->rep->rrset_count);
{
int rcode;
- /* If the CD bit is on in the original request, then we don't bother to
- * validate anything.*/
+ /* If the CD bit is on in the original request, then you could think
+ * that we don't bother to validate anything.
+ * But this is signalled internally with the valrec flag.
+ * User queries are validated with BIT_CD to make our cache clean
+ * so that bogus messages get retried by the upstream also for
+ * downstream validators that set BIT_CD.
+ * For DNS64 bit_cd signals no dns64 processing, but we want to
+ * provide validation there too */
+ /*
if(qstate->query_flags & BIT_CD) {
verbose(VERB_ALGO, "not validating response due to CD bit");
return 0;
}
+ */
+ if(qstate->is_valrec) {
+ verbose(VERB_ALGO, "not validating response, is valrec"
+ "(validation recursion lookup)");
+ return 0;
+ }
if(ret_rc != LDNS_RCODE_NOERROR || !ret_msg)
rcode = ret_rc;
struct val_qstate* vq = (struct val_qstate*)qstate->minfo[id];
struct module_qstate* newq;
struct query_info ask;
+ int valrec;
ask.qname = name;
ask.qname_len = namelen;
ask.qtype = qtype;
ask.qclass = qclass;
log_query_info(VERB_ALGO, "generate request", &ask);
fptr_ok(fptr_whitelist_modenv_attach_sub(qstate->env->attach_sub));
+ /* enable valrec flag to avoid recursion to the same validation
+ * routine, this lookup is simply a lookup. DLVs need validation */
+ if(qtype == LDNS_RR_TYPE_DLV)
+ valrec = 0;
+ else valrec = 1;
if(!(*qstate->env->attach_sub)(qstate, &ask,
- (uint16_t)(BIT_RD|flags), 0, &newq)){
+ (uint16_t)(BIT_RD|flags), 0, valrec, &newq)){
log_err("Could not generate request: out of memory");
return 0;
}
return 1;
}
+/**
+ * For messages that are not referrals, if the chase reply contains an
+ * unsigned NS record in the authority section it could have been
+ * inserted by a (BIND) forwarder that thinks the zone is insecure, and
+ * that has an NS record without signatures in cache. Remove the NS
+ * record since the reply does not hinge on that record (in the authority
+ * section), but do not remove it if it removes the last record from the
+ * answer+authority sections.
+ * @param chase_reply: the chased reply, we have a key for this contents,
+ * so we should have signatures for these rrsets and not having
+ * signatures means it will be bogus.
+ * @param orig_reply: original reply, remove NS from there as well because
+ * we cannot mark the NS record as DNSSEC valid because it is not
+ * validated by signatures.
+ */
+static void
+remove_spurious_authority(struct reply_info* chase_reply,
+ struct reply_info* orig_reply)
+{
+ size_t i, found = 0;
+ int remove = 0;
+ /* if no answer and only 1 auth RRset, do not remove that one */
+ if(chase_reply->an_numrrsets == 0 && chase_reply->ns_numrrsets == 1)
+ return;
+ /* search authority section for unsigned NS records */
+ for(i = chase_reply->an_numrrsets;
+ i < chase_reply->an_numrrsets+chase_reply->ns_numrrsets; i++) {
+ struct packed_rrset_data* d = (struct packed_rrset_data*)
+ chase_reply->rrsets[i]->entry.data;
+ if(ntohs(chase_reply->rrsets[i]->rk.type) == LDNS_RR_TYPE_NS
+ && d->rrsig_count == 0) {
+ found = i;
+ remove = 1;
+ break;
+ }
+ }
+ /* see if we found the entry */
+ if(!remove) return;
+ log_rrset_key(VERB_ALGO, "Removing spurious unsigned NS record "
+ "(likely inserted by forwarder)", chase_reply->rrsets[found]);
+
+ /* find rrset in orig_reply */
+ for(i = orig_reply->an_numrrsets;
+ i < orig_reply->an_numrrsets+orig_reply->ns_numrrsets; i++) {
+ if(ntohs(orig_reply->rrsets[i]->rk.type) == LDNS_RR_TYPE_NS
+ && query_dname_compare(orig_reply->rrsets[i]->rk.dname,
+ chase_reply->rrsets[found]->rk.dname) == 0) {
+ /* remove from orig_msg */
+ val_reply_remove_auth(orig_reply, i);
+ break;
+ }
+ }
+ /* remove rrset from chase_reply */
+ val_reply_remove_auth(chase_reply, found);
+}
/**
* Given a "positive" response -- a response that contains an answer to the
}
subtype = val_classify_response(qstate->query_flags, &qstate->qinfo,
&vq->qchase, vq->orig_msg->rep, vq->rrset_skip);
+ if(subtype != VAL_CLASS_REFERRAL)
+ remove_spurious_authority(vq->chase_reply, vq->orig_msg->rep);
/* check signatures in the message;
* answer and authority must be valid, additional is only checked. */
/* if secure, this will override cache anyway, no need
* to check if from parentNS */
if(!dns_cache_store(qstate->env, &vq->orig_msg->qinfo,
- vq->orig_msg->rep, 0, qstate->prefetch_leeway, 0, NULL)) {
+ vq->orig_msg->rep, 0, qstate->prefetch_leeway, 0, NULL,
+ qstate->query_flags)) {
log_err("out of memory caching validator results");
}
} else {
/* for a referral, store the verified RRsets */
/* and this does not get prefetched, so no leeway */
if(!dns_cache_store(qstate->env, &vq->orig_msg->qinfo,
- vq->orig_msg->rep, 1, 0, 0, NULL)) {
+ vq->orig_msg->rep, 1, 0, 0, NULL,
+ qstate->query_flags)) {
log_err("out of memory caching validator results");
}
}
struct key_entry_key* kkey = NULL;
enum sec_status sec = sec_status_unchecked;
char* reason = NULL;
- int downprot = 1;
+ int downprot = qstate->env->cfg->harden_algo_downgrade;
if(!dnskey_rrset) {
log_nametypeclass(VERB_OPS, "failed to prime trust anchor -- "
Unbound is a recursive DNS server. It does caching, full recursion, stub\r
recursion, DNSSEC validation, NSEC3, IPv6. More information can be found \r
at the http://unbound.net site. Unbound has been built and tested on \r
-Windows XP, Vista and 7.\r
+Windows XP, Vista, 7 and 8.\r
\r
At http://unbound.net/documentation is an install and configuration manual\r
for windows.\r
*/
#include "config.h"
#include "libunbound/unbound.h"
-#include "ldns/rrdef.h"
-#include "ldns/pkthdr.h"
-#include "ldns/wire2str.h"
+#include "sldns/rrdef.h"
+#include "sldns/pkthdr.h"
+#include "sldns/wire2str.h"
/** usage */
static void
{
SC_HANDLE scm;
SC_HANDLE sv;
- TCHAR path[MAX_PATH+2+256];
+ TCHAR path[2*MAX_PATH+4+256];
+ TCHAR path_config[2*MAX_PATH+4+256];
if(out) fprintf(out, "installing unbound service\n");
if(!GetModuleFileName(NULL, path+1, MAX_PATH))
fatal_win(out, "could not GetModuleFileName");
/* change 'unbound-service-install' to 'unbound' */
- if(rename)
+ if(rename) {
change(out, path+1, sizeof(path)-1, rename, "unbound.exe");
+ memmove(path_config+1, path+1, sizeof(path)-1);
+ change(out, path_config+1, sizeof(path_config)-1,
+ "unbound.exe", "service.conf");
+ }
event_reg_install(out, path+1);
/* have to quote it because of spaces in directory names */
/* could append arguments to be sent to ServiceMain */
quote_it(out, path, sizeof(path));
+
+ /* if we started in a different directory, also read config from it. */
+ if(rename) {
+ quote_it(out, path_config, sizeof(path_config));
+ strcat(path, " -c ");
+ strcat(path, path_config);
+ }
+
strcat(path, " -w service");
scm = OpenSCManager(NULL, NULL, (int)SC_MANAGER_CREATE_SERVICE);
if(!scm) fatal_win(out, "could not OpenSCManager");