diff options
Diffstat (limited to 'src')
39 files changed, 1141 insertions, 1260 deletions
diff --git a/src/Makefile.in b/src/Makefile.in index b6494fd..16f757f 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.6 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -59,17 +58,18 @@ noinst_PROGRAMS = zscanner-tool$(EXEEXT) @HAVE_RAGEL_TRUE@am__append_2 = zscanner/scanner.c subdir = src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(srcdir)/config.h.in knot/conf/libknotd_la-cf-lex.c \ + $(srcdir)/config.h.in $(top_srcdir)/depcomp \ + $(top_srcdir)/ylwrap knot/conf/libknotd_la-cf-lex.c \ knot/conf/libknotd_la-cf-parse.c \ knot/conf/libknotd_la-cf-parse.h ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_ext.m4 \ $(top_srcdir)/m4/ax_gcc_x86_cpuid.m4 \ - $(top_srcdir)/m4/ax_recvmmsg.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/visibility.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/visibility.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -97,6 +97,7 @@ libknot_la_OBJECTS = $(am_libknot_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent +am__v_lt_1 = libknotd_la_DEPENDENCIES = libknot.la libknots.la @LIBOBJS@ am_libknotd_la_OBJECTS = knot/stat/gatherer.lo knot/stat/stat.lo \ knot/conf/libknotd_la-cf-lex.lo \ @@ -165,6 +166,18 @@ am_zscanner_tool_OBJECTS = zscanner/test/zscanner-tool.$(OBJEXT) \ zscanner_tool_OBJECTS = $(am_zscanner_tool_OBJECTS) zscanner_tool_DEPENDENCIES = libknots.la libknot.la libknotd.la \ libzscanner.la @LIBOBJS@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -177,33 +190,33 @@ LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS) LTLEXCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(LEX) $(AM_LFLAGS) $(LFLAGS) AM_V_LEX = $(am__v_LEX_@AM_V@) am__v_LEX_ = $(am__v_LEX_@AM_DEFAULT_V@) -am__v_LEX_0 = @echo " LEX " $@; +am__v_LEX_0 = @echo " LEX " $@; +am__v_LEX_1 = YLWRAP = $(top_srcdir)/ylwrap +am__yacc_c2h = sed -e s/cc$$/hh/ -e s/cpp$$/hpp/ -e s/cxx$$/hxx/ \ + -e s/c++$$/h++/ -e s/c$$/h/ YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS) LTYACCCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(YACC) $(AM_YFLAGS) $(YFLAGS) AM_V_YACC = $(am__v_YACC_@AM_V@) am__v_YACC_ = $(am__v_YACC_@AM_DEFAULT_V@) -am__v_YACC_0 = @echo " YACC " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; +am__v_YACC_0 = @echo " YACC " $@; +am__v_YACC_1 = SOURCES = $(libknot_la_SOURCES) $(libknotd_la_SOURCES) \ $(libknots_la_SOURCES) $(libzscanner_la_SOURCES) \ $(kdig_SOURCES) $(khost_SOURCES) $(knotc_SOURCES) \ @@ -738,12 +751,14 @@ distclean-hdr: clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } libknot/$(am__dirstamp): @$(MKDIR_P) libknot @: > libknot/$(am__dirstamp) @@ -1251,191 +1266,46 @@ zscanner-tool$(EXEEXT): $(zscanner_tool_OBJECTS) $(zscanner_tool_DEPENDENCIES) $ mostlyclean-compile: -rm -f *.$(OBJEXT) - -rm -f common/acl.$(OBJEXT) - -rm -f common/acl.lo - -rm -f common/base32hex.$(OBJEXT) - -rm -f common/base32hex.lo - -rm -f common/base64.$(OBJEXT) - -rm -f common/base64.lo - -rm -f common/dSFMT.$(OBJEXT) - -rm -f common/dSFMT.lo - -rm -f common/descriptor.$(OBJEXT) - -rm -f common/descriptor.lo - -rm -f common/errcode.$(OBJEXT) - -rm -f common/errcode.lo - -rm -f common/errors.$(OBJEXT) - -rm -f common/errors.lo - -rm -f common/evqueue.$(OBJEXT) - -rm -f common/evqueue.lo - -rm -f common/evsched.$(OBJEXT) - -rm -f common/evsched.lo - -rm -f common/fdset.$(OBJEXT) - -rm -f common/fdset.lo - -rm -f common/getline.$(OBJEXT) - -rm -f common/getline.lo - -rm -f common/hattrie/ahtable.$(OBJEXT) - -rm -f common/hattrie/ahtable.lo - -rm -f common/hattrie/hat-trie.$(OBJEXT) - -rm -f common/hattrie/hat-trie.lo - -rm -f common/hattrie/murmurhash3.$(OBJEXT) - -rm -f common/hattrie/murmurhash3.lo - -rm -f common/heap.$(OBJEXT) - -rm -f common/heap.lo - -rm -f common/libtap/tap.$(OBJEXT) - -rm -f common/libtap/tap.lo - -rm -f common/lists.$(OBJEXT) - -rm -f common/lists.lo - -rm -f common/log.$(OBJEXT) - -rm -f common/log.lo - -rm -f common/mempattern.$(OBJEXT) - -rm -f common/mempattern.lo - -rm -f common/mempool.$(OBJEXT) - -rm -f common/mempool.lo - -rm -f common/print.$(OBJEXT) - -rm -f common/print.lo - -rm -f common/prng.$(OBJEXT) - -rm -f common/prng.lo - -rm -f common/ref.$(OBJEXT) - -rm -f common/ref.lo - -rm -f common/skip-list.$(OBJEXT) - -rm -f common/skip-list.lo - -rm -f common/slab/slab.$(OBJEXT) - -rm -f common/slab/slab.lo - -rm -f common/sockaddr.$(OBJEXT) - -rm -f common/sockaddr.lo - -rm -f knot/conf/conf.$(OBJEXT) - -rm -f knot/conf/conf.lo - -rm -f knot/conf/extra.$(OBJEXT) - -rm -f knot/conf/extra.lo - -rm -f knot/conf/includes.$(OBJEXT) - -rm -f knot/conf/includes.lo - -rm -f knot/conf/libknotd_la-cf-lex.$(OBJEXT) - -rm -f knot/conf/libknotd_la-cf-lex.lo - -rm -f knot/conf/libknotd_la-cf-parse.$(OBJEXT) - -rm -f knot/conf/libknotd_la-cf-parse.lo - -rm -f knot/conf/logconf.$(OBJEXT) - -rm -f knot/conf/logconf.lo - -rm -f knot/ctl/knotc_main.$(OBJEXT) - -rm -f knot/ctl/process.$(OBJEXT) - -rm -f knot/ctl/process.lo - -rm -f knot/ctl/remote.$(OBJEXT) - -rm -f knot/ctl/remote.lo - -rm -f knot/main.$(OBJEXT) - -rm -f knot/server/dthreads.$(OBJEXT) - -rm -f knot/server/dthreads.lo - -rm -f knot/server/journal.$(OBJEXT) - -rm -f knot/server/journal.lo - -rm -f knot/server/notify.$(OBJEXT) - -rm -f knot/server/notify.lo - -rm -f knot/server/rrl.$(OBJEXT) - -rm -f knot/server/rrl.lo - -rm -f knot/server/server.$(OBJEXT) - -rm -f knot/server/server.lo - -rm -f knot/server/socket.$(OBJEXT) - -rm -f knot/server/socket.lo - -rm -f knot/server/tcp-handler.$(OBJEXT) - -rm -f knot/server/tcp-handler.lo - -rm -f knot/server/udp-handler.$(OBJEXT) - -rm -f knot/server/udp-handler.lo - -rm -f knot/server/xfr-handler.$(OBJEXT) - -rm -f knot/server/xfr-handler.lo - -rm -f knot/server/zones.$(OBJEXT) - -rm -f knot/server/zones.lo - -rm -f knot/stat/gatherer.$(OBJEXT) - -rm -f knot/stat/gatherer.lo - -rm -f knot/stat/stat.$(OBJEXT) - -rm -f knot/stat/stat.lo - -rm -f knot/zone/estimator.$(OBJEXT) - -rm -f knot/zone/estimator.lo - -rm -f knot/zone/semantic-check.$(OBJEXT) - -rm -f knot/zone/semantic-check.lo - -rm -f knot/zone/zone-dump.$(OBJEXT) - -rm -f knot/zone/zone-dump.lo - -rm -f knot/zone/zone-load.$(OBJEXT) - -rm -f knot/zone/zone-load.lo - -rm -f libknot/binary.$(OBJEXT) - -rm -f libknot/binary.lo - -rm -f libknot/consts.$(OBJEXT) - -rm -f libknot/consts.lo - -rm -f libknot/dname.$(OBJEXT) - -rm -f libknot/dname.lo - -rm -f libknot/edns.$(OBJEXT) - -rm -f libknot/edns.lo - -rm -f libknot/nameserver/chaos.$(OBJEXT) - -rm -f libknot/nameserver/chaos.lo - -rm -f libknot/nameserver/name-server.$(OBJEXT) - -rm -f libknot/nameserver/name-server.lo - -rm -f libknot/nsec3.$(OBJEXT) - -rm -f libknot/nsec3.lo - -rm -f libknot/packet/packet.$(OBJEXT) - -rm -f libknot/packet/packet.lo - -rm -f libknot/packet/query.$(OBJEXT) - -rm -f libknot/packet/query.lo - -rm -f libknot/packet/response.$(OBJEXT) - -rm -f libknot/packet/response.lo - -rm -f libknot/rrset-dump.$(OBJEXT) - -rm -f libknot/rrset-dump.lo - -rm -f libknot/rrset.$(OBJEXT) - -rm -f libknot/rrset.lo - -rm -f libknot/sign/bnutils.$(OBJEXT) - -rm -f libknot/sign/bnutils.lo - -rm -f libknot/sign/dnssec.$(OBJEXT) - -rm -f libknot/sign/dnssec.lo - -rm -f libknot/sign/key.$(OBJEXT) - -rm -f libknot/sign/key.lo - -rm -f libknot/sign/sig0.$(OBJEXT) - -rm -f libknot/sign/sig0.lo - -rm -f libknot/tsig-op.$(OBJEXT) - -rm -f libknot/tsig-op.lo - -rm -f libknot/tsig.$(OBJEXT) - -rm -f libknot/tsig.lo - -rm -f libknot/updates/changesets.$(OBJEXT) - -rm -f libknot/updates/changesets.lo - -rm -f libknot/updates/ddns.$(OBJEXT) - -rm -f libknot/updates/ddns.lo - -rm -f libknot/updates/xfr-in.$(OBJEXT) - -rm -f libknot/updates/xfr-in.lo - -rm -f libknot/util/debug.$(OBJEXT) - -rm -f libknot/util/debug.lo - -rm -f libknot/util/tolower.$(OBJEXT) - -rm -f libknot/util/tolower.lo - -rm -f libknot/util/utils.$(OBJEXT) - -rm -f libknot/util/utils.lo - -rm -f libknot/zone/node.$(OBJEXT) - -rm -f libknot/zone/node.lo - -rm -f libknot/zone/zone-contents.$(OBJEXT) - -rm -f libknot/zone/zone-contents.lo - -rm -f libknot/zone/zone-diff.$(OBJEXT) - -rm -f libknot/zone/zone-diff.lo - -rm -f libknot/zone/zone-tree.$(OBJEXT) - -rm -f libknot/zone/zone-tree.lo - -rm -f libknot/zone/zone.$(OBJEXT) - -rm -f libknot/zone/zone.lo - -rm -f libknot/zone/zonedb.$(OBJEXT) - -rm -f libknot/zone/zonedb.lo - -rm -f utils/common/exec.$(OBJEXT) - -rm -f utils/common/msg.$(OBJEXT) - -rm -f utils/common/netio.$(OBJEXT) - -rm -f utils/common/params.$(OBJEXT) - -rm -f utils/common/resolv.$(OBJEXT) - -rm -f utils/common/token.$(OBJEXT) - -rm -f utils/dig/dig_exec.$(OBJEXT) - -rm -f utils/dig/dig_main.$(OBJEXT) - -rm -f utils/dig/dig_params.$(OBJEXT) - -rm -f utils/host/host_main.$(OBJEXT) - -rm -f utils/host/host_params.$(OBJEXT) - -rm -f utils/nsupdate/nsupdate_exec.$(OBJEXT) - -rm -f utils/nsupdate/nsupdate_main.$(OBJEXT) - -rm -f utils/nsupdate/nsupdate_params.$(OBJEXT) - -rm -f zscanner/file_loader.$(OBJEXT) - -rm -f zscanner/file_loader.lo - -rm -f zscanner/scanner.$(OBJEXT) - -rm -f zscanner/scanner.lo - -rm -f zscanner/scanner_functions.$(OBJEXT) - -rm -f zscanner/scanner_functions.lo - -rm -f zscanner/test/processing.$(OBJEXT) - -rm -f zscanner/test/tests.$(OBJEXT) - -rm -f zscanner/test/zscanner-tool.$(OBJEXT) + -rm -f common/*.$(OBJEXT) + -rm -f common/*.lo + -rm -f common/hattrie/*.$(OBJEXT) + -rm -f common/hattrie/*.lo + -rm -f common/libtap/*.$(OBJEXT) + -rm -f common/libtap/*.lo + -rm -f common/slab/*.$(OBJEXT) + -rm -f common/slab/*.lo + -rm -f knot/*.$(OBJEXT) + -rm -f knot/conf/*.$(OBJEXT) + -rm -f knot/conf/*.lo + -rm -f knot/ctl/*.$(OBJEXT) + -rm -f knot/ctl/*.lo + -rm -f knot/server/*.$(OBJEXT) + -rm -f knot/server/*.lo + -rm -f knot/stat/*.$(OBJEXT) + -rm -f knot/stat/*.lo + -rm -f knot/zone/*.$(OBJEXT) + -rm -f knot/zone/*.lo + -rm -f libknot/*.$(OBJEXT) + -rm -f libknot/*.lo + -rm -f libknot/nameserver/*.$(OBJEXT) + -rm -f libknot/nameserver/*.lo + -rm -f libknot/packet/*.$(OBJEXT) + -rm -f libknot/packet/*.lo + -rm -f libknot/sign/*.$(OBJEXT) + -rm -f libknot/sign/*.lo + -rm -f libknot/updates/*.$(OBJEXT) + -rm -f libknot/updates/*.lo + -rm -f libknot/util/*.$(OBJEXT) + -rm -f libknot/util/*.lo + -rm -f libknot/zone/*.$(OBJEXT) + -rm -f libknot/zone/*.lo + -rm -f utils/common/*.$(OBJEXT) + -rm -f utils/dig/*.$(OBJEXT) + -rm -f utils/host/*.$(OBJEXT) + -rm -f utils/nsupdate/*.$(OBJEXT) + -rm -f zscanner/*.$(OBJEXT) + -rm -f zscanner/*.lo + -rm -f zscanner/test/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @@ -1576,12 +1446,12 @@ knot/conf/libknotd_la-cf-lex.c: knot/conf/cf-lex.l $(SHELL) $(YLWRAP) `test -f 'knot/conf/cf-lex.l' || echo '$(srcdir)/'`knot/conf/cf-lex.l $(LEX_OUTPUT_ROOT).c knot/conf/libknotd_la-cf-lex.c -- $(LEX) $(libknotd_la_LFLAGS) $(LFLAGS) .y.c: - $(AM_V_YACC)$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h y.output $*.output -- $(YACCCOMPILE) + $(AM_V_YACC)$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h `echo $@ | $(am__yacc_c2h)` y.output $*.output -- $(YACCCOMPILE) knot/conf/libknotd_la-cf-parse.c: knot/conf/cf-parse.y $(AM_V_YACC) \ $(am__skipyacc) \ - $(SHELL) $(YLWRAP) `test -f 'knot/conf/cf-parse.y' || echo '$(srcdir)/'`knot/conf/cf-parse.y y.tab.c knot/conf/libknotd_la-cf-parse.c y.tab.h knot/conf/libknotd_la-cf-parse.h y.output knot/conf/libknotd_la-cf-parse.output -- $(YACC) $(libknotd_la_YFLAGS) $(YFLAGS) + $(SHELL) $(YLWRAP) `test -f 'knot/conf/cf-parse.y' || echo '$(srcdir)/'`knot/conf/cf-parse.y y.tab.c knot/conf/libknotd_la-cf-parse.c y.tab.h `echo knot/conf/libknotd_la-cf-parse.c | $(am__yacc_c2h)` y.output knot/conf/libknotd_la-cf-parse.output -- $(YACC) $(libknotd_la_YFLAGS) $(YFLAGS) mostlyclean-libtool: -rm -f *.lo @@ -1607,12 +1477,12 @@ clean-libtool: -rm -rf zscanner/.libs zscanner/_libs # This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ @@ -1622,7 +1492,11 @@ $(RECURSIVE_TARGETS): done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ @@ -1636,37 +1510,6 @@ $(RECURSIVE_TARGETS): if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" - -$(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ @@ -1675,6 +1518,10 @@ ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done +cscopelist-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \ + done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -1738,6 +1585,20 @@ GTAGS: && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags @@ -1961,14 +1822,15 @@ ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-sbinPROGRAMS .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \ - ctags-recursive install install-am install-data-am \ - install-strip tags-recursive + cscopelist-recursive ctags-recursive install install-am \ + install-data-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ - clean-noinstPROGRAMS clean-sbinPROGRAMS ctags ctags-recursive \ - distclean distclean-compile distclean-generic distclean-hdr \ + clean-noinstPROGRAMS clean-sbinPROGRAMS cscopelist \ + cscopelist-recursive ctags ctags-recursive distclean \ + distclean-compile distclean-generic distclean-hdr \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-data-hook install-dvi \ diff --git a/src/common/acl.c b/src/common/acl.c index 26d3847..fa20d62 100644 --- a/src/common/acl.c +++ b/src/common/acl.c @@ -19,88 +19,99 @@ #include <assert.h> #include <sys/types.h> #include <sys/socket.h> +#include <limits.h> #include "common/acl.h" +#include "libknot/util/endian.h" -static inline uint32_t acl_sa_ipv4(sockaddr_t *a) { +static inline uint32_t ipv4_chunk(sockaddr_t *a) +{ + /* Stored as big end first. */ return a->addr4.sin_addr.s_addr; } -static inline uint32_t acl_fill_mask32(short c) { - /*! \todo Consider optimizing using LUT. */ - assert(c >= 0 && c <= 32); - unsigned r = 0; - /*! This actually builds big-endian mask - * as we will match against addresses in - * network byte-order (big-endian). - * Otherwise it should be built from - * HO bit -> LO bit. - */ - for (char i = 0; i < c; ++i) { - r |= (1 << i); - } - return r; +static inline uint32_t ipv6_chunk(sockaddr_t *a, uint8_t idx) +{ + /* Is byte array, 4x 32bit value. */ + return ((uint32_t *)&a->addr6.sin6_addr)[idx]; } -static int acl_compare(void *k1, void *k2) +static inline uint32_t ip_chunk(sockaddr_t *a, uint8_t idx) { - sockaddr_t* a1 = (sockaddr_t *)k1; - sockaddr_t* a2 = (sockaddr_t *)k2; + if (sockaddr_family(a) == AF_INET) + return ipv4_chunk(a); - /* Check different length, IPv4 goes first. */ - int ldiff = a1->len - a2->len; - if (ldiff != 0) { - return ldiff < 0 ? -1 : 1; - } + return ipv6_chunk(a, idx); +} - /* Compare integers if IPv4. */ - if (sockaddr_family(a1) == AF_INET) { +/*! \brief Compare chunks using given mask. */ +static int cmp_chunk(sockaddr_t *a, sockaddr_t *b, uint8_t idx, uint32_t mask) +{ + const uint32_t c1 = ip_chunk(a, idx) & mask; + const uint32_t c2 = ip_chunk(b, idx) & mask; - /* Compute mask .*/ - uint32_t mask = acl_fill_mask32(a1->prefix); + if (c1 > c2) + return 1; + if (c1 < c2) + return -1; + return 0; +} - /* Compare address. */ - int cmp1 = (acl_sa_ipv4(a1) & mask); - int cmp2 = (acl_sa_ipv4(a2) & mask); - if (cmp1 > cmp2) return 1; - if (cmp1 < cmp2) return -1; - return 0; +/*! + * \brief Calculate bitmask for byte array from the MSB. + * + * \note i.e. 8 means top 8 bits set, 11111111000000000000000000000000 + * + * \param nbits number of bits set to 1 + * \return mask + */ +static uint32_t acl_fill_mask32(short nbits) +{ + assert(nbits >= 0 && nbits <= 32); + uint32_t r = 0; + for (char i = 0; i < nbits; ++i) { + r |= 1 << (31 - i); } - /* IPv6 matching. */ -#ifndef DISABLE_IPV6 - if (sockaddr_family(a1) == AF_INET6) { - - /* Get mask .*/ - short chunk = a1->prefix; - - /* Compare address by 32bit chunks. */ - uint32_t* a1p = (uint32_t *)(&a1->addr6.sin6_addr); - uint32_t* a2p = (uint32_t *)(&a2->addr6.sin6_addr); - - /* Mask 0 = 0 bits to compare from LO->HO (in big-endian). - * Mask 128 = 128 bits to compare. - */ - while (chunk > 0) { - uint32_t mask = 0xffffffff; - if ((size_t)chunk > sizeof(mask) << 3) { - chunk -= sizeof(mask) << 3; - } else { - mask = acl_fill_mask32(chunk); - chunk = 0; - } - - int cmp1 = (*(a1p++) & mask); - int cmp2 = (*(a2p++) & mask); - if (cmp1 > cmp2) return 1; - if (cmp1 < cmp2) return -1; + /* Make sure the mask is in network byte order. */ + return htonl(r); +} + +static int acl_compare(void *k1, void *k2) +{ + int ret = 0; + sockaddr_t* a1 = (sockaddr_t *)k1; + sockaddr_t* a2 = (sockaddr_t *)k2; + uint32_t mask = 0xffffffff; + short mask_bits = a1->prefix; + const short chunk_bits = sizeof(mask) * CHAR_BIT; + + /* Check different length, IPv4 goes first. */ + if (a1->len != a2->len) { + if (a1->len < a2->len) + return -1; + else + return 1; + } + + /* At most 4xchunk_bits for IPv6 */ + unsigned i = 0; + while (ret == 0 && mask_bits > 0) { + /* Compute mask for current chunk. */ + if (mask_bits <= chunk_bits) { + mask = acl_fill_mask32(mask_bits); + mask_bits = 0; /* Last chunk */ + } else { + mask_bits -= chunk_bits; } - return 0; + /* Empty mask - shortcut, we're done. */ + if (mask > 0) + ret = cmp_chunk(a1, a2, i, mask); + ++i; } -#endif - return 0; + return ret; } acl_t *acl_new(acl_rule_t default_rule, const char *name) diff --git a/src/common/descriptor.c b/src/common/descriptor.c index 233a995..5f2af94 100644 --- a/src/common/descriptor.c +++ b/src/common/descriptor.c @@ -76,12 +76,12 @@ static const rdata_descriptor_t rdata_descriptors[] = { KNOT_RDATA_WF_END }, "KEY" }, [KNOT_RRTYPE_AAAA] = { { 16, KNOT_RDATA_WF_END }, "AAAA" }, [KNOT_RRTYPE_LOC] = { { 16, KNOT_RDATA_WF_END }, "LOC" }, - [KNOT_RRTYPE_SRV] = { { 6, KNOT_RDATA_WF_UNCOMPRESSED_DNAME, + [KNOT_RRTYPE_SRV] = { { 6, KNOT_RDATA_WF_COMPRESSED_DNAME, KNOT_RDATA_WF_END }, "SRV" }, [KNOT_RRTYPE_NAPTR] = { { KNOT_RDATA_WF_NAPTR_HEADER, - KNOT_RDATA_WF_UNCOMPRESSED_DNAME, + KNOT_RDATA_WF_COMPRESSED_DNAME, KNOT_RDATA_WF_END }, "NAPTR" }, - [KNOT_RRTYPE_KX] = { { 2, KNOT_RDATA_WF_COMPRESSED_DNAME, + [KNOT_RRTYPE_KX] = { { 2, KNOT_RDATA_WF_UNCOMPRESSED_DNAME, KNOT_RDATA_WF_END }, "KX" }, [KNOT_RRTYPE_CERT] = { { KNOT_RDATA_WF_REMAINDER, KNOT_RDATA_WF_END }, "CERT" }, @@ -97,10 +97,10 @@ static const rdata_descriptor_t rdata_descriptors[] = { KNOT_RDATA_WF_END }, "SSHFP" }, [KNOT_RRTYPE_IPSECKEY] = { { KNOT_RDATA_WF_REMAINDER, KNOT_RDATA_WF_END }, "IPSECKEY" }, - [KNOT_RRTYPE_RRSIG] = { { 18, KNOT_RDATA_WF_LITERAL_DNAME, + [KNOT_RRTYPE_RRSIG] = { { 18, KNOT_RDATA_WF_UNCOMPRESSED_DNAME, KNOT_RDATA_WF_REMAINDER, KNOT_RDATA_WF_END }, "RRSIG" }, - [KNOT_RRTYPE_NSEC] = { { KNOT_RDATA_WF_LITERAL_DNAME, + [KNOT_RRTYPE_NSEC] = { { KNOT_RDATA_WF_UNCOMPRESSED_DNAME, KNOT_RDATA_WF_REMAINDER, KNOT_RDATA_WF_END }, "NSEC" }, [KNOT_RRTYPE_DNSKEY] = { { KNOT_RDATA_WF_REMAINDER, @@ -118,7 +118,7 @@ static const rdata_descriptor_t rdata_descriptors[] = { [KNOT_RRTYPE_NID] = { { 10 }, "NID" }, [KNOT_RRTYPE_L32] = { { 6 }, "L32" }, [KNOT_RRTYPE_L64] = { { 10 }, "L64" }, - [KNOT_RRTYPE_LP] = { { 2, KNOT_RDATA_WF_COMPRESSED_DNAME }, + [KNOT_RRTYPE_LP] = { { 2, KNOT_RDATA_WF_UNCOMPRESSED_DNAME }, "LP" }, [KNOT_RRTYPE_EUI48] = { { 6, KNOT_RDATA_WF_END }, "EUI48" }, [KNOT_RRTYPE_EUI64] = { { 8, KNOT_RDATA_WF_END }, "EUI64" }, @@ -136,6 +136,30 @@ static const rdata_descriptor_t rdata_descriptors[] = { KNOT_RDATA_WF_END }, "ANY" }, }; +/*! + * \brief Some (OBSOLETE) RR type descriptors. + */ +static const rdata_descriptor_t obsolete_rdata_descriptors[] = { + [0] = { { KNOT_RDATA_WF_REMAINDER, + KNOT_RDATA_WF_END }, NULL }, + [KNOT_RRTYPE_MD] = { { KNOT_RDATA_WF_COMPRESSED_DNAME, + KNOT_RDATA_WF_END }, "MD" }, + [KNOT_RRTYPE_MF] = { { KNOT_RDATA_WF_COMPRESSED_DNAME, + KNOT_RDATA_WF_END }, "MF" }, + [KNOT_RRTYPE_MB] = { { KNOT_RDATA_WF_COMPRESSED_DNAME, + KNOT_RDATA_WF_END }, "MB" }, + [KNOT_RRTYPE_MG] = { { KNOT_RDATA_WF_COMPRESSED_DNAME, + KNOT_RDATA_WF_END }, "MG" }, + [KNOT_RRTYPE_MR] = { { KNOT_RDATA_WF_COMPRESSED_DNAME, + KNOT_RDATA_WF_END }, "MR" }, + [KNOT_RRTYPE_PX] = { { 2, KNOT_RDATA_WF_COMPRESSED_DNAME, + KNOT_RDATA_WF_COMPRESSED_DNAME, + KNOT_RDATA_WF_END }, "PX" }, + [KNOT_RRTYPE_NXT] = { { KNOT_RDATA_WF_COMPRESSED_DNAME, + KNOT_RDATA_WF_REMAINDER, + KNOT_RDATA_WF_END }, "NXT" }, +}; + const rdata_descriptor_t *get_rdata_descriptor(const uint16_t type) { if (type <= KNOT_RRTYPE_ANY && rdata_descriptors[type].type_name != 0) { @@ -145,6 +169,16 @@ const rdata_descriptor_t *get_rdata_descriptor(const uint16_t type) } } +const rdata_descriptor_t *get_obsolete_rdata_descriptor(const uint16_t type) +{ + if (type <= KNOT_RRTYPE_NXT && + obsolete_rdata_descriptors[type].type_name != 0) { + return &obsolete_rdata_descriptors[type]; + } else { + return &obsolete_rdata_descriptors[0]; + } +} + int knot_rrtype_to_string(const uint16_t rrtype, char *out, const size_t out_len) @@ -251,8 +285,7 @@ int knot_rrclass_from_string(const char *name, uint16_t *num) int descriptor_item_is_dname(const int item) { - return item == KNOT_RDATA_WF_LITERAL_DNAME || - item == KNOT_RDATA_WF_COMPRESSED_DNAME || + return item == KNOT_RDATA_WF_COMPRESSED_DNAME || item == KNOT_RDATA_WF_UNCOMPRESSED_DNAME; } diff --git a/src/common/descriptor.h b/src/common/descriptor.h index d7938cb..f7c2327 100644 --- a/src/common/descriptor.h +++ b/src/common/descriptor.h @@ -110,6 +110,25 @@ enum knot_rr_type { }; /*! + * \brief Some (OBSOLETE) resource record type constants. + * + * http://www.iana.org/assignments/dns-parameters/dns-parameters.xml + * + * \note These records can contain compressed domain name in rdata so + * it is important to know the position of it during transfers. + * See RFC 3597#4. + */ +enum knot_obsolete_rr_type { + KNOT_RRTYPE_MD = 3, + KNOT_RRTYPE_MF = 4, + KNOT_RRTYPE_MB = 7, + KNOT_RRTYPE_MG = 8, + KNOT_RRTYPE_MR = 9, + KNOT_RRTYPE_PX = 26, + KNOT_RRTYPE_NXT = 30 +}; + +/*! * \brief Constants characterising the wire format of RDATA items. */ enum knot_rdata_wireformat { @@ -117,8 +136,6 @@ enum knot_rdata_wireformat { KNOT_RDATA_WF_COMPRESSED_DNAME = -10, /*!< Uncompressed dname. */ KNOT_RDATA_WF_UNCOMPRESSED_DNAME, - /*!< Dname with preserved letter cases. */ - KNOT_RDATA_WF_LITERAL_DNAME, /*!< Initial part of NAPTR record before dname. */ KNOT_RDATA_WF_NAPTR_HEADER, /*!< Uninteresting final part of a record. */ @@ -140,7 +157,7 @@ typedef struct { /*! * \brief Gets rdata descriptor for given RR name. * - * \param name Mnemonic of RR type whose descriptor should be retvaled. + * \param name Mnemonic of RR type whose descriptor should be returned. * * \retval RR descriptor for given name, NULL descriptor if * unknown type. @@ -148,6 +165,16 @@ typedef struct { const rdata_descriptor_t *get_rdata_descriptor(const uint16_t type); /*! + * \brief Gets rdata descriptor for given RR name (obsolete version). + * + * \param name Mnemonic of RR type whose descriptor should be returned. + * + * \retval RR descriptor for given name, NULL descriptor if + * unknown type. + */ +const rdata_descriptor_t *get_obsolete_rdata_descriptor(const uint16_t type); + +/*! * \brief Converts numeric type representation to mnemonic string. * * \param rrtype Type RR type code to be converted. diff --git a/src/common/errcode.c b/src/common/errcode.c index b555805..50b37dd 100644 --- a/src/common/errcode.c +++ b/src/common/errcode.c @@ -52,7 +52,7 @@ const error_table_t knot_error_msgs[] = { { KNOT_ECRYPTO, "Error in crypto library." }, { KNOT_ENSEC3PAR, "Missing or wrong NSEC3PARAM record." }, { KNOT_ENSEC3CHAIN, "Missing or wrong NSEC3 chain in the zone." }, - { KNOT_EBADZONE, "Name does not belong to the zone." }, + { KNOT_EOUTOFZONE, "Name does not belong to the zone." }, { KNOT_EHASH, "Error in hash table." }, { KNOT_EZONEINVAL, "Invalid zone file." }, { KNOT_ENOZONE, "No such zone found." }, diff --git a/src/common/errcode.h b/src/common/errcode.h index 69f6ed5..c29a433 100644 --- a/src/common/errcode.h +++ b/src/common/errcode.h @@ -71,7 +71,7 @@ enum knot_error { KNOT_ECRYPTO, /*!< Error in crypto library. */ KNOT_ENSEC3PAR, /*!< Missing or wrong NSEC3PARAM record. */ KNOT_ENSEC3CHAIN, /*!< Missing or wrong NSEC3 chain in the zone. */ - KNOT_EBADZONE, /*!< Domain name does not belong to the zone. */ + KNOT_EOUTOFZONE, /*!< Domain name does not belong to the zone. */ KNOT_EHASH, /*!< Error in hash table. */ KNOT_EZONEINVAL, /*!< Invalid zone file. */ KNOT_ENOZONE, /*!< No such zone found. */ diff --git a/src/config.h.in b/src/config.h.in index 73c4e3f..763a1a5 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -15,9 +15,6 @@ /* microseconds in log messages */ #undef ENABLE_MICROSECONDS_LOG -/* recvmmsg enabled */ -#undef ENABLE_RECVMMSG - /* Define to 1 if you have the <arpa/nameser.h> header file. */ #undef HAVE_ARPA_NAMESER_H @@ -84,6 +81,9 @@ /* Define to 1 if you have the `pthread_setaffinity_np' function. */ #undef HAVE_PTHREAD_SETAFFINITY_NP +/* Define if struct mmsghdr and recvmmsg() exists. */ +#undef HAVE_RECVMMSG + /* Define to 1 if you have the `regcomp' function. */ #undef HAVE_REGCOMP diff --git a/src/knot/conf/conf.c b/src/knot/conf/conf.c index 9830c04..fae998b 100644 --- a/src/knot/conf/conf.c +++ b/src/knot/conf/conf.c @@ -37,7 +37,7 @@ /*! \brief Default config paths. */ static const char *DEFAULT_CONFIG[] = { - SYSCONFDIR "/" "knot.conf", + CONFIG_DIR "/" "knot.conf", }; #define DEFAULT_CONF_COUNT 1 /*!< \brief Number of default config paths. */ @@ -295,7 +295,7 @@ static int conf_process(conf_t *conf) // Default zone file if (zone->file == NULL) { - zone->file = strcdup(zone->name, ".zone"); + zone->file = strcdup(zone->name, "zone"); if (!zone->file) { ret = KNOT_ENOMEM; continue; diff --git a/src/knot/conf/conf.h b/src/knot/conf/conf.h index 30075c3..dd61e52 100644 --- a/src/knot/conf/conf.h +++ b/src/knot/conf/conf.h @@ -50,7 +50,7 @@ #define CONFIG_REPLY_WD 10 /*!< SOA/NOTIFY query timeout [s]. */ #define CONFIG_HANDSHAKE_WD 10 /*!< [secs] for connection to make a request.*/ #define CONFIG_IDLE_WD 60 /*!< [secs] of allowed inactivity between requests */ -#define CONFIG_RRL_SLIP 2 /*!< Default slip value. */ +#define CONFIG_RRL_SLIP 1 /*!< Default slip value. */ #define CONFIG_RRL_SIZE 393241 /*!< Htable default size. */ #define CONFIG_XFERS 10 diff --git a/src/knot/conf/libknotd_la-cf-lex.c b/src/knot/conf/libknotd_la-cf-lex.c index d3683ec..cf3e9b0 100644 --- a/src/knot/conf/libknotd_la-cf-lex.c +++ b/src/knot/conf/libknotd_la-cf-lex.c @@ -9,7 +9,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 +#define YY_FLEX_SUBMINOR_VERSION 37 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -159,15 +159,7 @@ typedef void* yyscan_t; /* Size of default input buffer. */ #ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else #define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -179,6 +171,11 @@ typedef void* yyscan_t; typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 @@ -214,11 +211,6 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state @@ -236,7 +228,7 @@ struct yy_buffer_state /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - int yy_n_chars; + yy_size_t yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -315,7 +307,7 @@ static void cf__init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner ); YY_BUFFER_STATE cf__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); YY_BUFFER_STATE cf__scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); -YY_BUFFER_STATE cf__scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner ); +YY_BUFFER_STATE cf__scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner ); void *cf_alloc (yy_size_t ,yyscan_t yyscanner ); void *cf_realloc (void *,yy_size_t ,yyscan_t yyscanner ); @@ -347,7 +339,7 @@ void cf_free (void * ,yyscan_t yyscanner ); /* Begin user sect3 */ -#define cf_wrap(n) 1 +#define cf_wrap(yyscanner) 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; @@ -768,7 +760,7 @@ static yyconst flex_int32_t yy_rule_can_match_eol[84] = #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET -#line 1 "cf-lex.l" +#line 1 "knot/conf/cf-lex.l" /* Copyright (C) 2011 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz> This program is free software: you can redistribute it and/or modify @@ -793,7 +785,7 @@ static yyconst flex_int32_t yy_rule_can_match_eol[84] = * * IP address conversions from BIRD, (c) 1998--2000 Martin Mares <mj@ucw.cz> */ -#line 26 "cf-lex.l" +#line 26 "knot/conf/cf-lex.l" #include <config.h> #include <errno.h> @@ -836,7 +828,7 @@ int hex2bin(const char* src, char *dst, size_t len) { #define YY_NO_INPUT 1 -#line 840 "knot/conf/libknotd_la-cf-lex.c" +#line 832 "knot/conf/libknotd_la-cf-lex.c" #define INITIAL 0 #define include 1 @@ -864,8 +856,8 @@ struct yyguts_t size_t yy_buffer_stack_max; /**< capacity of stack. */ YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ char yy_hold_char; - int yy_n_chars; - int yyleng_r; + yy_size_t yy_n_chars; + yy_size_t yyleng_r; char *yy_c_buf_p; int yy_init; int yy_start; @@ -918,7 +910,7 @@ FILE *cf_get_out (yyscan_t yyscanner ); void cf_set_out (FILE * out_str ,yyscan_t yyscanner ); -int cf_get_leng (yyscan_t yyscanner ); +yy_size_t cf_get_leng (yyscan_t yyscanner ); char *cf_get_text (yyscan_t yyscanner ); @@ -966,12 +958,7 @@ static int input (yyscan_t yyscanner ); /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else #define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -1075,9 +1062,9 @@ YY_DECL register int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; -#line 87 "cf-lex.l" +#line 87 "knot/conf/cf-lex.l" -#line 1081 "knot/conf/libknotd_la-cf-lex.c" +#line 1068 "knot/conf/libknotd_la-cf-lex.c" yylval = yylval_param; @@ -1177,303 +1164,303 @@ do_action: /* This label is used only to access EOF actions. */ case 1: /* rule 1 can match eol */ YY_RULE_SETUP -#line 88 "cf-lex.l" +#line 88 "knot/conf/cf-lex.l" /* Ignore comments */; YY_BREAK case 2: /* rule 2 can match eol */ YY_RULE_SETUP -#line 89 "cf-lex.l" +#line 89 "knot/conf/cf-lex.l" /* Ignore whitespace */; YY_BREAK case 3: YY_RULE_SETUP -#line 90 "cf-lex.l" +#line 90 "knot/conf/cf-lex.l" { return yytext[0]; } YY_BREAK case 4: YY_RULE_SETUP -#line 91 "cf-lex.l" +#line 91 "knot/conf/cf-lex.l" { lval.t = yytext; return SYSTEM; } YY_BREAK case 5: YY_RULE_SETUP -#line 92 "cf-lex.l" +#line 92 "knot/conf/cf-lex.l" { lval.t = yytext; return IDENTITY; } YY_BREAK case 6: YY_RULE_SETUP -#line 93 "cf-lex.l" +#line 93 "knot/conf/cf-lex.l" { lval.t = yytext; return HOSTNAME; } YY_BREAK case 7: YY_RULE_SETUP -#line 94 "cf-lex.l" +#line 94 "knot/conf/cf-lex.l" { lval.t = yytext; return SVERSION; } YY_BREAK case 8: YY_RULE_SETUP -#line 95 "cf-lex.l" +#line 95 "knot/conf/cf-lex.l" { lval.t = yytext; return NSID; } YY_BREAK case 9: YY_RULE_SETUP -#line 96 "cf-lex.l" +#line 96 "knot/conf/cf-lex.l" { lval.t = yytext; return STORAGE; } YY_BREAK case 10: YY_RULE_SETUP -#line 97 "cf-lex.l" +#line 97 "knot/conf/cf-lex.l" { lval.t = yytext; return KEY; } YY_BREAK case 11: YY_RULE_SETUP -#line 98 "cf-lex.l" +#line 98 "knot/conf/cf-lex.l" { lval.t = yytext; return KEYS; } YY_BREAK case 12: YY_RULE_SETUP -#line 99 "cf-lex.l" +#line 99 "knot/conf/cf-lex.l" { lval.t = yytext; return REMOTES; } YY_BREAK case 13: YY_RULE_SETUP -#line 100 "cf-lex.l" +#line 100 "knot/conf/cf-lex.l" { lval.t = yytext; return GROUPS; } YY_BREAK case 14: YY_RULE_SETUP -#line 102 "cf-lex.l" +#line 102 "knot/conf/cf-lex.l" { lval.t = yytext; return ZONES; } YY_BREAK case 15: YY_RULE_SETUP -#line 103 "cf-lex.l" +#line 103 "knot/conf/cf-lex.l" { lval.t = yytext; return FILENAME; } YY_BREAK case 16: YY_RULE_SETUP -#line 104 "cf-lex.l" +#line 104 "knot/conf/cf-lex.l" { lval.t = yytext; return DISABLE_ANY; } YY_BREAK case 17: YY_RULE_SETUP -#line 105 "cf-lex.l" +#line 105 "knot/conf/cf-lex.l" { lval.t = yytext; return SEMANTIC_CHECKS; } YY_BREAK case 18: YY_RULE_SETUP -#line 106 "cf-lex.l" +#line 106 "knot/conf/cf-lex.l" { lval.t = yytext; return NOTIFY_RETRIES; } YY_BREAK case 19: YY_RULE_SETUP -#line 107 "cf-lex.l" +#line 107 "knot/conf/cf-lex.l" { lval.t = yytext; return NOTIFY_TIMEOUT; } YY_BREAK case 20: YY_RULE_SETUP -#line 108 "cf-lex.l" +#line 108 "knot/conf/cf-lex.l" { lval.t = yytext; return DBSYNC_TIMEOUT; } YY_BREAK case 21: YY_RULE_SETUP -#line 109 "cf-lex.l" +#line 109 "knot/conf/cf-lex.l" { lval.t = yytext; return IXFR_FSLIMIT; } YY_BREAK case 22: YY_RULE_SETUP -#line 110 "cf-lex.l" +#line 110 "knot/conf/cf-lex.l" { lval.t = yytext; return XFR_IN; } YY_BREAK case 23: YY_RULE_SETUP -#line 111 "cf-lex.l" +#line 111 "knot/conf/cf-lex.l" { lval.t = yytext; return XFR_OUT; } YY_BREAK case 24: YY_RULE_SETUP -#line 112 "cf-lex.l" +#line 112 "knot/conf/cf-lex.l" { lval.t = yytext; return UPDATE_IN; } YY_BREAK case 25: YY_RULE_SETUP -#line 113 "cf-lex.l" +#line 113 "knot/conf/cf-lex.l" { lval.t = yytext; return NOTIFY_IN; } YY_BREAK case 26: YY_RULE_SETUP -#line 114 "cf-lex.l" +#line 114 "knot/conf/cf-lex.l" { lval.t = yytext; return NOTIFY_OUT; } YY_BREAK case 27: YY_RULE_SETUP -#line 115 "cf-lex.l" +#line 115 "knot/conf/cf-lex.l" { lval.t = yytext; return WORKERS; } YY_BREAK case 28: YY_RULE_SETUP -#line 116 "cf-lex.l" +#line 116 "knot/conf/cf-lex.l" { lval.t = yytext; return USER; } YY_BREAK case 29: YY_RULE_SETUP -#line 117 "cf-lex.l" +#line 117 "knot/conf/cf-lex.l" { lval.t = yytext; return PIDFILE; } YY_BREAK case 30: YY_RULE_SETUP -#line 118 "cf-lex.l" +#line 118 "knot/conf/cf-lex.l" { lval.t = yytext; return RUNDIR; } YY_BREAK case 31: YY_RULE_SETUP -#line 119 "cf-lex.l" +#line 119 "knot/conf/cf-lex.l" { lval.t = yytext; return BUILD_DIFFS; } YY_BREAK case 32: YY_RULE_SETUP -#line 120 "cf-lex.l" +#line 120 "knot/conf/cf-lex.l" { lval.t = yytext; return MAX_CONN_IDLE; } YY_BREAK case 33: YY_RULE_SETUP -#line 121 "cf-lex.l" +#line 121 "knot/conf/cf-lex.l" { lval.t = yytext; return MAX_CONN_HS; } YY_BREAK case 34: YY_RULE_SETUP -#line 122 "cf-lex.l" +#line 122 "knot/conf/cf-lex.l" { lval.t = yytext; return MAX_CONN_REPLY; } YY_BREAK case 35: YY_RULE_SETUP -#line 123 "cf-lex.l" +#line 123 "knot/conf/cf-lex.l" { lval.t = yytext; return RATE_LIMIT; } YY_BREAK case 36: YY_RULE_SETUP -#line 124 "cf-lex.l" +#line 124 "knot/conf/cf-lex.l" { lval.t = yytext; return RATE_LIMIT_SIZE; } YY_BREAK case 37: YY_RULE_SETUP -#line 125 "cf-lex.l" +#line 125 "knot/conf/cf-lex.l" { lval.t = yytext; return RATE_LIMIT_SLIP; } YY_BREAK case 38: YY_RULE_SETUP -#line 126 "cf-lex.l" +#line 126 "knot/conf/cf-lex.l" { lval.t = yytext; return TRANSFERS; } YY_BREAK case 39: YY_RULE_SETUP -#line 128 "cf-lex.l" +#line 128 "knot/conf/cf-lex.l" { lval.t = yytext; return INTERFACES; } YY_BREAK case 40: YY_RULE_SETUP -#line 129 "cf-lex.l" +#line 129 "knot/conf/cf-lex.l" { lval.t = yytext; return ADDRESS; } YY_BREAK case 41: YY_RULE_SETUP -#line 130 "cf-lex.l" +#line 130 "knot/conf/cf-lex.l" { lval.t = yytext; return PORT; } YY_BREAK case 42: YY_RULE_SETUP -#line 131 "cf-lex.l" +#line 131 "knot/conf/cf-lex.l" { lval.t = yytext; return VIA; } YY_BREAK case 43: YY_RULE_SETUP -#line 133 "cf-lex.l" +#line 133 "knot/conf/cf-lex.l" { lval.t = yytext; return CONTROL; } YY_BREAK case 44: YY_RULE_SETUP -#line 134 "cf-lex.l" +#line 134 "knot/conf/cf-lex.l" { lval.t = yytext; return ALLOW; } YY_BREAK case 45: YY_RULE_SETUP -#line 135 "cf-lex.l" +#line 135 "knot/conf/cf-lex.l" { lval.t = yytext; return LISTEN_ON; } YY_BREAK case 46: YY_RULE_SETUP -#line 137 "cf-lex.l" +#line 137 "knot/conf/cf-lex.l" { lval.t = yytext; return LOG; } YY_BREAK case 47: YY_RULE_SETUP -#line 139 "cf-lex.l" +#line 139 "knot/conf/cf-lex.l" { lval.t = yytext; lval.i = LOG_ANY; return LOG_SRC; } YY_BREAK case 48: YY_RULE_SETUP -#line 140 "cf-lex.l" +#line 140 "knot/conf/cf-lex.l" { lval.t = yytext; lval.i = LOG_SERVER; return LOG_SRC; } YY_BREAK case 49: YY_RULE_SETUP -#line 141 "cf-lex.l" +#line 141 "knot/conf/cf-lex.l" { lval.t = yytext; lval.i = LOG_ANSWER; return LOG_SRC; } YY_BREAK case 50: YY_RULE_SETUP -#line 142 "cf-lex.l" +#line 142 "knot/conf/cf-lex.l" { lval.t = yytext; lval.i = LOG_ZONE; return LOG_SRC; } YY_BREAK case 51: YY_RULE_SETUP -#line 143 "cf-lex.l" +#line 143 "knot/conf/cf-lex.l" { lval.t = yytext; lval.i = LOGT_STDOUT; return LOG_DEST; } YY_BREAK case 52: YY_RULE_SETUP -#line 144 "cf-lex.l" +#line 144 "knot/conf/cf-lex.l" { lval.t = yytext; lval.i = LOGT_STDERR; return LOG_DEST; } YY_BREAK case 53: YY_RULE_SETUP -#line 145 "cf-lex.l" +#line 145 "knot/conf/cf-lex.l" { lval.t = yytext; lval.i = LOGT_SYSLOG; return LOG_DEST; } YY_BREAK case 54: YY_RULE_SETUP -#line 146 "cf-lex.l" +#line 146 "knot/conf/cf-lex.l" { lval.t = yytext; lval.i = LOG_UPTO(LOG_DEBUG); return LOG_LEVEL; } YY_BREAK case 55: YY_RULE_SETUP -#line 147 "cf-lex.l" +#line 147 "knot/conf/cf-lex.l" { lval.t = yytext; lval.i = LOG_MASK(LOG_DEBUG); return LOG_LEVEL; } YY_BREAK case 56: YY_RULE_SETUP -#line 148 "cf-lex.l" +#line 148 "knot/conf/cf-lex.l" { lval.t = yytext; lval.i = LOG_MASK(LOG_INFO); return LOG_LEVEL; } YY_BREAK case 57: YY_RULE_SETUP -#line 149 "cf-lex.l" +#line 149 "knot/conf/cf-lex.l" { lval.t = yytext; lval.i = LOG_MASK(LOG_NOTICE); return LOG_LEVEL; } YY_BREAK case 58: YY_RULE_SETUP -#line 150 "cf-lex.l" +#line 150 "knot/conf/cf-lex.l" { lval.t = yytext; lval.i = LOG_MASK(LOG_WARNING); return LOG_LEVEL; } YY_BREAK case 59: YY_RULE_SETUP -#line 151 "cf-lex.l" +#line 151 "knot/conf/cf-lex.l" { lval.t = yytext; lval.i = LOG_MASK(LOG_ERR); return LOG_LEVEL; } YY_BREAK case 60: YY_RULE_SETUP -#line 153 "cf-lex.l" +#line 153 "knot/conf/cf-lex.l" { lval.t = yytext; lval.i = 0; @@ -1485,12 +1472,12 @@ YY_RULE_SETUP YY_BREAK case 61: YY_RULE_SETUP -#line 162 "cf-lex.l" +#line 162 "knot/conf/cf-lex.l" BEGIN(include); YY_BREAK case 62: YY_RULE_SETUP -#line 164 "cf-lex.l" +#line 164 "knot/conf/cf-lex.l" { size_t mpos = strlen(yytext) - 1; char multiplier = yytext[mpos]; @@ -1515,7 +1502,7 @@ YY_RULE_SETUP YY_BREAK case 63: YY_RULE_SETUP -#line 186 "cf-lex.l" +#line 186 "knot/conf/cf-lex.l" { size_t mpos = strlen(yytext) - 1; char multiplier = yytext[mpos]; @@ -1539,7 +1526,7 @@ YY_RULE_SETUP YY_BREAK case 64: YY_RULE_SETUP -#line 207 "cf-lex.l" +#line 207 "knot/conf/cf-lex.l" { lval.i = atol(yytext); return NUM; @@ -1547,7 +1534,7 @@ YY_RULE_SETUP YY_BREAK case 65: YY_RULE_SETUP -#line 212 "cf-lex.l" +#line 212 "knot/conf/cf-lex.l" { unsigned char buf[sizeof(struct in_addr)]; if (inet_pton(AF_INET, yytext, buf)) { @@ -1559,7 +1546,7 @@ YY_RULE_SETUP YY_BREAK case 66: YY_RULE_SETUP -#line 221 "cf-lex.l" +#line 221 "knot/conf/cf-lex.l" { #ifdef DISABLE_IPV6 lval.t = strdup(yytext); @@ -1578,7 +1565,7 @@ YY_RULE_SETUP YY_BREAK case 67: YY_RULE_SETUP -#line 237 "cf-lex.l" +#line 237 "knot/conf/cf-lex.l" { #ifdef DISABLE_IPV6 lval.t = strdup(yytext); @@ -1596,7 +1583,7 @@ YY_RULE_SETUP YY_BREAK case 68: YY_RULE_SETUP -#line 252 "cf-lex.l" +#line 252 "knot/conf/cf-lex.l" { lval.t = NULL; lval.l = 0; @@ -1624,42 +1611,42 @@ YY_RULE_SETUP YY_BREAK case 69: YY_RULE_SETUP -#line 277 "cf-lex.l" +#line 277 "knot/conf/cf-lex.l" { lval.alg = KNOT_TSIG_ALG_GSS_TSIG; return TSIG_ALGO_NAME; } YY_BREAK case 70: YY_RULE_SETUP -#line 278 "cf-lex.l" +#line 278 "knot/conf/cf-lex.l" { lval.alg = KNOT_TSIG_ALG_HMAC_MD5; return TSIG_ALGO_NAME; } YY_BREAK case 71: YY_RULE_SETUP -#line 279 "cf-lex.l" +#line 279 "knot/conf/cf-lex.l" { lval.alg = KNOT_TSIG_ALG_HMAC_SHA1; return TSIG_ALGO_NAME; } YY_BREAK case 72: YY_RULE_SETUP -#line 280 "cf-lex.l" +#line 280 "knot/conf/cf-lex.l" { lval.alg = KNOT_TSIG_ALG_HMAC_SHA224; return TSIG_ALGO_NAME; } YY_BREAK case 73: YY_RULE_SETUP -#line 281 "cf-lex.l" +#line 281 "knot/conf/cf-lex.l" { lval.alg = KNOT_TSIG_ALG_HMAC_SHA256; return TSIG_ALGO_NAME; } YY_BREAK case 74: YY_RULE_SETUP -#line 282 "cf-lex.l" +#line 282 "knot/conf/cf-lex.l" { lval.alg = KNOT_TSIG_ALG_HMAC_SHA384; return TSIG_ALGO_NAME; } YY_BREAK case 75: YY_RULE_SETUP -#line 283 "cf-lex.l" +#line 283 "knot/conf/cf-lex.l" { lval.alg = KNOT_TSIG_ALG_HMAC_SHA512; return TSIG_ALGO_NAME; } YY_BREAK case 76: YY_RULE_SETUP -#line 285 "cf-lex.l" +#line 285 "knot/conf/cf-lex.l" { yytext[yyleng-1] = 0; lval.t = strdup(yytext + 1); @@ -1669,12 +1656,12 @@ YY_RULE_SETUP case 77: /* rule 77 can match eol */ YY_RULE_SETUP -#line 291 "cf-lex.l" +#line 291 "knot/conf/cf-lex.l" cf_error(yyscanner, "Unterminated string."); YY_BREAK case 78: YY_RULE_SETUP -#line 293 "cf-lex.l" +#line 293 "knot/conf/cf-lex.l" { lval.t = strdup(yytext); return TEXT /* Last resort, alphanumeric word. */; @@ -1682,12 +1669,12 @@ YY_RULE_SETUP YY_BREAK case 79: YY_RULE_SETUP -#line 298 "cf-lex.l" +#line 298 "knot/conf/cf-lex.l" /* Optional : in assignments. */; YY_BREAK case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(include): -#line 300 "cf-lex.l" +#line 300 "knot/conf/cf-lex.l" { char *name = conf_includes_pop(yyextra->includes); free(name); @@ -1699,12 +1686,12 @@ case YY_STATE_EOF(include): case 80: /* rule 80 can match eol */ YY_RULE_SETUP -#line 308 "cf-lex.l" +#line 308 "knot/conf/cf-lex.l" YY_BREAK case 81: YY_RULE_SETUP -#line 309 "cf-lex.l" +#line 309 "knot/conf/cf-lex.l" { BEGIN(INITIAL); @@ -1741,15 +1728,15 @@ YY_RULE_SETUP case 82: /* rule 82 can match eol */ YY_RULE_SETUP -#line 342 "cf-lex.l" +#line 342 "knot/conf/cf-lex.l" cf_error(yyscanner, "Unterminated string."); YY_BREAK case 83: YY_RULE_SETUP -#line 344 "cf-lex.l" +#line 344 "knot/conf/cf-lex.l" ECHO; YY_BREAK -#line 1753 "knot/conf/libknotd_la-cf-lex.c" +#line 1740 "knot/conf/libknotd_la-cf-lex.c" case YY_END_OF_BUFFER: { @@ -1934,21 +1921,21 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else { - int num_to_read = + yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) (yyg->yy_c_buf_p - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { - int new_size = b->yy_buf_size * 2; + yy_size_t new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -1979,7 +1966,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - yyg->yy_n_chars, (size_t) num_to_read ); + yyg->yy_n_chars, num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; } @@ -2076,6 +2063,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 445); + (void)yyg; return yy_is_jam ? 0 : yy_current_state; } @@ -2104,7 +2092,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else { /* need more input */ - int offset = yyg->yy_c_buf_p - yyg->yytext_ptr; + yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr; ++yyg->yy_c_buf_p; switch ( yy_get_next_buffer( yyscanner ) ) @@ -2275,10 +2263,6 @@ static void cf__load_buffer_state (yyscan_t yyscanner) cf_free((void *) b ,yyscanner ); } -#ifndef __cplusplus -extern int isatty (int ); -#endif /* __cplusplus */ - /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a cf_restart() or at EOF. @@ -2395,7 +2379,7 @@ void cf_pop_buffer_state (yyscan_t yyscanner) */ static void cf_ensure_buffer_stack (yyscan_t yyscanner) { - int num_to_alloc; + yy_size_t num_to_alloc; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (!yyg->yy_buffer_stack) { @@ -2493,7 +2477,7 @@ YY_BUFFER_STATE cf__scan_string (yyconst char * yystr , yyscan_t yyscanner) * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE cf__scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner) +YY_BUFFER_STATE cf__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner) { YY_BUFFER_STATE b; char *buf; @@ -2608,7 +2592,7 @@ FILE *cf_get_out (yyscan_t yyscanner) /** Get the length of the current token. * @param yyscanner The scanner object. */ -int cf_get_leng (yyscan_t yyscanner) +yy_size_t cf_get_leng (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyleng; @@ -2644,7 +2628,7 @@ void cf_set_lineno (int line_number , yyscan_t yyscanner) /* lineno is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "cf_set_lineno called with no buffer" , yyscanner); + YY_FATAL_ERROR( "cf_set_lineno called with no buffer" ); yylineno = line_number; } @@ -2659,7 +2643,7 @@ void cf_set_column (int column_no , yyscan_t yyscanner) /* column is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "cf_set_column called with no buffer" , yyscanner); + YY_FATAL_ERROR( "cf_set_column called with no buffer" ); yycolumn = column_no; } @@ -2883,7 +2867,7 @@ void cf_free (void * ptr , yyscan_t yyscanner) #define YYTABLES_NAME "yytables" -#line 344 "cf-lex.l" +#line 344 "knot/conf/cf-lex.l" diff --git a/src/knot/conf/libknotd_la-cf-parse.c b/src/knot/conf/libknotd_la-cf-parse.c index 2cea00d..53a29a6 100644 --- a/src/knot/conf/libknotd_la-cf-parse.c +++ b/src/knot/conf/libknotd_la-cf-parse.c @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 2.5. */ +/* A Bison parser, made by GNU Bison 2.7.12-4996. */ /* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -44,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.5" +#define YYBISON_VERSION "2.7.12-4996" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -58,8 +58,6 @@ /* Pull parsers. */ #define YYPULL 1 -/* Using locations. */ -#define YYLSP_NEEDED 0 /* Substitute the variable and function names. */ #define yyparse cf_parse @@ -70,11 +68,9 @@ #define yydebug cf_debug #define yynerrs cf_nerrs - /* Copy the first part of user declarations. */ - -/* Line 268 of yacc.c */ -#line 23 "cf-parse.y" +/* Line 371 of yacc.c */ +#line 23 "knot/conf/cf-parse.y" /* Headers */ #include <config.h> @@ -432,14 +428,16 @@ static int conf_mask(void* scanner, int nval, int prefixlen) { } +/* Line 371 of yacc.c */ +#line 433 "knot/conf/libknotd_la-cf-parse.c" -/* Line 268 of yacc.c */ -#line 438 "knot/conf/libknotd_la-cf-parse.c" - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif +# ifndef YY_NULL +# if defined __cplusplus && 201103L <= __cplusplus +# define YY_NULL nullptr +# else +# define YY_NULL 0 +# endif +# endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE @@ -449,11 +447,17 @@ static int conf_mask(void* scanner, int nval, int prefixlen) { # define YYERROR_VERBOSE 0 #endif -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 +/* In a future release of Bison, this section will be replaced + by #include "y.tab.h". */ +#ifndef YY_CF_Y_TAB_H_INCLUDED +# define YY_CF_Y_TAB_H_INCLUDED +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif +#if YYDEBUG +extern int cf_debug; #endif - /* Tokens. */ #ifndef YYTOKENTYPE @@ -581,13 +585,11 @@ static int conf_mask(void* scanner, int nval, int prefixlen) { - #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE { - -/* Line 293 of yacc.c */ -#line 386 "cf-parse.y" +/* Line 387 of yacc.c */ +#line 386 "knot/conf/cf-parse.y" struct { char *t; @@ -597,9 +599,8 @@ typedef union YYSTYPE } tok; - -/* Line 293 of yacc.c */ -#line 603 "knot/conf/libknotd_la-cf-parse.c" +/* Line 387 of yacc.c */ +#line 604 "knot/conf/libknotd_la-cf-parse.c" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -607,11 +608,26 @@ typedef union YYSTYPE #endif -/* Copy the second part of user declarations. */ +#ifdef YYPARSE_PARAM +#if defined __STDC__ || defined __cplusplus +int cf_parse (void *YYPARSE_PARAM); +#else +int cf_parse (); +#endif +#else /* ! YYPARSE_PARAM */ +#if defined __STDC__ || defined __cplusplus +int cf_parse (void *scanner); +#else +int cf_parse (); +#endif +#endif /* ! YYPARSE_PARAM */ + +#endif /* !YY_CF_Y_TAB_H_INCLUDED */ +/* Copy the second part of user declarations. */ -/* Line 343 of yacc.c */ -#line 615 "knot/conf/libknotd_la-cf-parse.c" +/* Line 390 of yacc.c */ +#line 631 "knot/conf/libknotd_la-cf-parse.c" #ifdef short # undef short @@ -664,24 +680,33 @@ typedef short int yytype_int16; # if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) +# define YY_(Msgid) dgettext ("bison-runtime", Msgid) # endif # endif # ifndef YY_ -# define YY_(msgid) msgid +# define YY_(Msgid) Msgid +# endif +#endif + +#ifndef __attribute__ +/* This feature is available in gcc versions 2.5 and later. */ +# if (! defined __GNUC__ || __GNUC__ < 2 \ + || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)) +# define __attribute__(Spec) /* empty */ # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ -# define YYUSE(e) ((void) (e)) +# define YYUSE(E) ((void) (E)) #else -# define YYUSE(e) /* empty */ +# define YYUSE(E) /* empty */ #endif + /* Identity function, used to suppress warnings about constant conditions. */ #ifndef lint -# define YYID(n) (n) +# define YYID(N) (N) #else #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) @@ -717,6 +742,7 @@ YYID (yyi) # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ + /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif @@ -808,20 +834,20 @@ union yyalloc #endif #if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from FROM to TO. The source and destination do +/* Copy COUNT objects from SRC to DST. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# define YYCOPY(Dst, Src, Count) \ + __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) # else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ +# define YYCOPY(Dst, Src, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (Dst)[yyi] = (Src)[yyi]; \ + } \ while (YYID (0)) # endif # endif @@ -987,7 +1013,7 @@ static const yytype_uint16 yyrline[] = }; #endif -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +#if YYDEBUG || YYERROR_VERBOSE || 0 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = @@ -1009,7 +1035,7 @@ static const char *const yytname[] = "zone_acl_item", "zone_acl_list", "zone_acl", "zone_start", "zone", "zones", "log_prios_start", "log_prios", "log_src", "log_dest", "log_file", "log_end", "log_start", "log", "$@1", "ctl_listen_start", - "ctl_allow_start", "control", "conf", 0 + "ctl_allow_start", "control", "conf", YY_NULL }; #endif @@ -1197,10 +1223,10 @@ static const yytype_int16 yytable[] = 286, 287 }; -#define yypact_value_is_default(yystate) \ - ((yystate) == (-47)) +#define yypact_value_is_default(Yystate) \ + (!!((Yystate) == (-47))) -#define yytable_value_is_error(yytable_value) \ +#define yytable_value_is_error(Yytable_value) \ YYID (0) static const yytype_int16 yycheck[] = @@ -1299,62 +1325,35 @@ static const yytype_uint8 yystos[] = #define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (1); \ - goto yybackup; \ - } \ - else \ - { \ +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ yyerror (scanner, YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (YYID (0)) - +/* Error token number */ #define YYTERROR 1 #define YYERRCODE 256 -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (YYID (N)) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (YYID (0)) -#endif - - /* This macro is provided for backward compatibility. */ - #ifndef YY_LOCATION_PRINT # define YY_LOCATION_PRINT(File, Loc) ((void) 0) #endif /* YYLEX -- calling `yylex' with the right arguments. */ - #ifdef YYLEX_PARAM # define YYLEX yylex (&yylval, YYLEX_PARAM) #else @@ -1405,6 +1404,8 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner) void *scanner; #endif { + FILE *yyo = yyoutput; + YYUSE (yyo); if (!yyvaluep) return; YYUSE (scanner); @@ -1414,11 +1415,7 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner) # else YYUSE (yyoutput); # endif - switch (yytype) - { - default: - break; - } + YYUSE (yytype); } @@ -1659,12 +1656,11 @@ static int yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken) { - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); + YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ - const char *yyformat = 0; + const char *yyformat = YY_NULL; /* Arguments of yyformat. */ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Number of reported tokens (one for the "unexpected", one per @@ -1724,11 +1720,13 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, break; } yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; + { + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); + if (! (yysize <= yysize1 + && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } } } } @@ -1748,10 +1746,12 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, # undef YYCASE_ } - yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; + { + YYSIZE_T yysize1 = yysize + yystrlen (yyformat); + if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } if (*yymsg_alloc < yysize) { @@ -1809,29 +1809,10 @@ yydestruct (yymsg, yytype, yyvaluep, scanner) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - switch (yytype) - { - - default: - break; - } + YYUSE (yytype); } -/* Prevent warnings from -Wmissing-prototypes. */ -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse (void *scanner); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ /*----------. @@ -1863,8 +1844,31 @@ yyparse (scanner) /* The lookahead symbol. */ int yychar; + +#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") +#else +/* Default value used for initialization, for pacifying older GCCs + or non-GCC compilers. */ +static YYSTYPE yyval_default; +# define YY_INITIAL_VALUE(Value) = Value +#endif +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + /* The semantic value of the lookahead symbol. */ -YYSTYPE yylval; +YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); /* Number of syntax errors so far. */ int yynerrs; @@ -1877,7 +1881,7 @@ YYSTYPE yylval; `yyss': related to states. `yyvs': related to semantic values. - Refer to the stacks thru separate pointers, to allow yyoverflow + Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ @@ -1895,7 +1899,7 @@ YYSTYPE yylval; int yyn; int yyresult; /* Lookahead token as an internal (translated) token number. */ - int yytoken; + int yytoken = 0; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; @@ -1913,9 +1917,8 @@ YYSTYPE yylval; Keep to zero when no symbol should be popped. */ int yylen = 0; - yytoken = 0; - yyss = yyssa; - yyvs = yyvsa; + yyssp = yyss = yyssa; + yyvsp = yyvs = yyvsa; yystacksize = YYINITDEPTH; YYDPRINTF ((stderr, "Starting parse\n")); @@ -1924,14 +1927,6 @@ YYSTYPE yylval; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - yyssp = yyss; - yyvsp = yyvs; - goto yysetstate; /*------------------------------------------------------------. @@ -2072,7 +2067,9 @@ yybackup: yychar = YYEMPTY; yystate = yyn; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END goto yynewstate; @@ -2109,58 +2106,50 @@ yyreduce: switch (yyn) { case 2: - -/* Line 1806 of yacc.c */ -#line 448 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 448 "knot/conf/cf-parse.y" { return 0; } break; case 6: - -/* Line 1806 of yacc.c */ -#line 456 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 456 "knot/conf/cf-parse.y" { conf_start_iface(scanner, (yyvsp[(1) - (1)].tok).t); } break; case 7: - -/* Line 1806 of yacc.c */ -#line 457 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 457 "knot/conf/cf-parse.y" { conf_start_iface(scanner, strdup((yyvsp[(1) - (1)].tok).t)); } break; case 8: - -/* Line 1806 of yacc.c */ -#line 458 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 458 "knot/conf/cf-parse.y" { conf_start_iface(scanner, strdup((yyvsp[(1) - (1)].tok).t)); } break; case 9: - -/* Line 1806 of yacc.c */ -#line 459 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 459 "knot/conf/cf-parse.y" { conf_start_iface(scanner, strdup((yyvsp[(1) - (1)].tok).t)); } break; case 10: - -/* Line 1806 of yacc.c */ -#line 460 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 460 "knot/conf/cf-parse.y" { conf_start_iface(scanner, strdup((yyvsp[(1) - (1)].tok).t)); } break; case 11: - -/* Line 1806 of yacc.c */ -#line 461 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 461 "knot/conf/cf-parse.y" { conf_start_iface(scanner, strdup((yyvsp[(1) - (1)].tok).t)); } break; case 13: - -/* Line 1806 of yacc.c */ -#line 465 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 465 "knot/conf/cf-parse.y" { if (this_iface->port > 0) { cf_error(scanner, "only one port definition is allowed in interface section\n"); @@ -2171,9 +2160,8 @@ yyreduce: break; case 14: - -/* Line 1806 of yacc.c */ -#line 472 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 472 "knot/conf/cf-parse.y" { if (this_iface->address != 0) { cf_error(scanner, "only one address is allowed in interface section\n"); @@ -2185,9 +2173,8 @@ yyreduce: break; case 15: - -/* Line 1806 of yacc.c */ -#line 480 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 480 "knot/conf/cf-parse.y" { if (this_iface->address != 0) { cf_error(scanner, "only one address is allowed in interface section\n"); @@ -2204,9 +2191,8 @@ yyreduce: break; case 16: - -/* Line 1806 of yacc.c */ -#line 493 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 493 "knot/conf/cf-parse.y" { if (this_iface->address != 0) { cf_error(scanner, "only one address is allowed in interface section\n"); @@ -2218,9 +2204,8 @@ yyreduce: break; case 17: - -/* Line 1806 of yacc.c */ -#line 501 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 501 "knot/conf/cf-parse.y" { if (this_iface->address != 0) { cf_error(scanner, "only one address is allowed in interface section\n"); @@ -2237,9 +2222,8 @@ yyreduce: break; case 19: - -/* Line 1806 of yacc.c */ -#line 518 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 518 "knot/conf/cf-parse.y" { if (this_iface->address == 0) { cf_error(scanner, "interface '%s' has no defined address", this_iface->name); @@ -2248,65 +2232,56 @@ yyreduce: break; case 21: - -/* Line 1806 of yacc.c */ -#line 527 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 527 "knot/conf/cf-parse.y" { new_config->version = (yyvsp[(3) - (4)].tok).t; } break; case 22: - -/* Line 1806 of yacc.c */ -#line 528 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 528 "knot/conf/cf-parse.y" { new_config->identity = (yyvsp[(3) - (4)].tok).t; } break; case 23: - -/* Line 1806 of yacc.c */ -#line 529 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 529 "knot/conf/cf-parse.y" { new_config->hostname = (yyvsp[(3) - (4)].tok).t; } break; case 24: - -/* Line 1806 of yacc.c */ -#line 530 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 530 "knot/conf/cf-parse.y" { new_config->nsid = (yyvsp[(3) - (4)].tok).t; new_config->nsid_len = (yyvsp[(3) - (4)].tok).l; } break; case 25: - -/* Line 1806 of yacc.c */ -#line 531 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 531 "knot/conf/cf-parse.y" { new_config->nsid = (yyvsp[(3) - (4)].tok).t; new_config->nsid_len = strlen(new_config->nsid); } break; case 26: - -/* Line 1806 of yacc.c */ -#line 532 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 532 "knot/conf/cf-parse.y" { new_config->storage = (yyvsp[(3) - (4)].tok).t; } break; case 27: - -/* Line 1806 of yacc.c */ -#line 533 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 533 "knot/conf/cf-parse.y" { new_config->rundir = (yyvsp[(3) - (4)].tok).t; } break; case 28: - -/* Line 1806 of yacc.c */ -#line 534 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 534 "knot/conf/cf-parse.y" { new_config->pidfile = (yyvsp[(3) - (4)].tok).t; } break; case 29: - -/* Line 1806 of yacc.c */ -#line 535 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 535 "knot/conf/cf-parse.y" { fprintf(stderr, "warning: Config option 'system.key' is deprecated " "and has no effect.\n"); @@ -2315,9 +2290,8 @@ yyreduce: break; case 30: - -/* Line 1806 of yacc.c */ -#line 540 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 540 "knot/conf/cf-parse.y" { if ((yyvsp[(3) - (4)].tok).i <= 0) { cf_error(scanner, "worker count must be greater than 0\n"); @@ -2328,9 +2302,8 @@ yyreduce: break; case 31: - -/* Line 1806 of yacc.c */ -#line 547 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 547 "knot/conf/cf-parse.y" { new_config->uid = new_config->gid = -1; // Invalidate char* dpos = strchr((yyvsp[(3) - (4)].tok).t, '.'); // Find uid.gid format @@ -2355,65 +2328,56 @@ yyreduce: break; case 32: - -/* Line 1806 of yacc.c */ -#line 568 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 568 "knot/conf/cf-parse.y" { new_config->max_conn_idle = (yyvsp[(3) - (4)].tok).i; } break; case 33: - -/* Line 1806 of yacc.c */ -#line 569 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 569 "knot/conf/cf-parse.y" { new_config->max_conn_hs = (yyvsp[(3) - (4)].tok).i; } break; case 34: - -/* Line 1806 of yacc.c */ -#line 570 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 570 "knot/conf/cf-parse.y" { new_config->max_conn_reply = (yyvsp[(3) - (4)].tok).i; } break; case 35: - -/* Line 1806 of yacc.c */ -#line 571 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 571 "knot/conf/cf-parse.y" { new_config->rrl = (yyvsp[(3) - (4)].tok).i; } break; case 36: - -/* Line 1806 of yacc.c */ -#line 572 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 572 "knot/conf/cf-parse.y" { new_config->rrl_size = (yyvsp[(3) - (4)].tok).l; } break; case 37: - -/* Line 1806 of yacc.c */ -#line 573 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 573 "knot/conf/cf-parse.y" { new_config->rrl_size = (yyvsp[(3) - (4)].tok).i; } break; case 38: - -/* Line 1806 of yacc.c */ -#line 574 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 574 "knot/conf/cf-parse.y" { new_config->rrl_slip = (yyvsp[(3) - (4)].tok).i; } break; case 39: - -/* Line 1806 of yacc.c */ -#line 575 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 575 "knot/conf/cf-parse.y" { new_config->xfers = (yyvsp[(3) - (4)].tok).i; } break; case 41: - -/* Line 1806 of yacc.c */ -#line 580 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 580 "knot/conf/cf-parse.y" { /* Check algorithm length. */ if (knot_tsig_digest_length((yyvsp[(3) - (5)].tok).alg) == 0) { @@ -2467,44 +2431,38 @@ yyreduce: break; case 43: - -/* Line 1806 of yacc.c */ -#line 632 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 632 "knot/conf/cf-parse.y" { conf_start_remote(scanner, (yyvsp[(1) - (1)].tok).t); } break; case 44: - -/* Line 1806 of yacc.c */ -#line 633 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 633 "knot/conf/cf-parse.y" { conf_start_remote(scanner, strdup((yyvsp[(1) - (1)].tok).t)); } break; case 45: - -/* Line 1806 of yacc.c */ -#line 634 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 634 "knot/conf/cf-parse.y" { conf_start_remote(scanner, strdup((yyvsp[(1) - (1)].tok).t)); } break; case 46: - -/* Line 1806 of yacc.c */ -#line 635 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 635 "knot/conf/cf-parse.y" { conf_start_remote(scanner, strdup((yyvsp[(1) - (1)].tok).t)); } break; case 47: - -/* Line 1806 of yacc.c */ -#line 636 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 636 "knot/conf/cf-parse.y" { conf_start_remote(scanner, strdup((yyvsp[(1) - (1)].tok).t)); } break; case 49: - -/* Line 1806 of yacc.c */ -#line 640 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 640 "knot/conf/cf-parse.y" { if (this_remote->port != 0) { cf_error(scanner, "only one port definition is allowed in remote section\n"); @@ -2515,9 +2473,8 @@ yyreduce: break; case 50: - -/* Line 1806 of yacc.c */ -#line 647 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 647 "knot/conf/cf-parse.y" { if (this_remote->address != 0) { cf_error(scanner, "only one address is allowed in remote section\n"); @@ -2530,9 +2487,8 @@ yyreduce: break; case 51: - -/* Line 1806 of yacc.c */ -#line 656 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 656 "knot/conf/cf-parse.y" { if (this_remote->address != 0) { cf_error(scanner, "only one address is allowed in remote section\n"); @@ -2545,9 +2501,8 @@ yyreduce: break; case 52: - -/* Line 1806 of yacc.c */ -#line 665 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 665 "knot/conf/cf-parse.y" { if (this_remote->address != 0) { cf_error(scanner, "only one address is allowed in remote section\n"); @@ -2565,9 +2520,8 @@ yyreduce: break; case 53: - -/* Line 1806 of yacc.c */ -#line 679 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 679 "knot/conf/cf-parse.y" { if (this_remote->address != 0) { cf_error(scanner, "only one address is allowed in remote section\n"); @@ -2580,9 +2534,8 @@ yyreduce: break; case 54: - -/* Line 1806 of yacc.c */ -#line 688 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 688 "knot/conf/cf-parse.y" { if (this_remote->address != 0) { cf_error(scanner, "only one address is allowed in remote section\n"); @@ -2595,9 +2548,8 @@ yyreduce: break; case 55: - -/* Line 1806 of yacc.c */ -#line 697 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 697 "knot/conf/cf-parse.y" { if (this_remote->address != 0) { cf_error(scanner, "only one address is allowed in remote section\n"); @@ -2615,9 +2567,8 @@ yyreduce: break; case 56: - -/* Line 1806 of yacc.c */ -#line 711 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 711 "knot/conf/cf-parse.y" { if (this_remote->key != 0) { cf_error(scanner, "only one TSIG key definition is allowed in remote section\n"); @@ -2629,9 +2580,8 @@ yyreduce: break; case 57: - -/* Line 1806 of yacc.c */ -#line 719 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 719 "knot/conf/cf-parse.y" { sockaddr_set(&this_remote->via, AF_INET, (yyvsp[(3) - (4)].tok).t, 0); free((yyvsp[(3) - (4)].tok).t); @@ -2639,9 +2589,8 @@ yyreduce: break; case 58: - -/* Line 1806 of yacc.c */ -#line 723 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 723 "knot/conf/cf-parse.y" { sockaddr_set(&this_remote->via, AF_INET6, (yyvsp[(3) - (4)].tok).t, 0); free((yyvsp[(3) - (4)].tok).t); @@ -2649,9 +2598,8 @@ yyreduce: break; case 59: - -/* Line 1806 of yacc.c */ -#line 727 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 727 "knot/conf/cf-parse.y" { conf_remote_set_via(scanner, (yyvsp[(3) - (4)].tok).t); free((yyvsp[(3) - (4)].tok).t); @@ -2659,9 +2607,8 @@ yyreduce: break; case 61: - -/* Line 1806 of yacc.c */ -#line 735 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 735 "knot/conf/cf-parse.y" { if (this_remote->address == 0) { cf_error(scanner, "remote '%s' has no defined address", this_remote->name); @@ -2670,103 +2617,90 @@ yyreduce: break; case 62: - -/* Line 1806 of yacc.c */ -#line 743 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 743 "knot/conf/cf-parse.y" { conf_add_member_into_group(scanner, (yyvsp[(1) - (1)].tok).t); } break; case 66: - -/* Line 1806 of yacc.c */ -#line 753 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 753 "knot/conf/cf-parse.y" { conf_start_group(scanner, (yyvsp[(1) - (1)].tok).t); } break; case 69: - -/* Line 1806 of yacc.c */ -#line 762 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 762 "knot/conf/cf-parse.y" { this_list = &this_zone->acl.xfr_in; } break; case 70: - -/* Line 1806 of yacc.c */ -#line 765 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 765 "knot/conf/cf-parse.y" { this_list = &this_zone->acl.xfr_out; } break; case 71: - -/* Line 1806 of yacc.c */ -#line 768 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 768 "knot/conf/cf-parse.y" { this_list = &this_zone->acl.notify_in; } break; case 72: - -/* Line 1806 of yacc.c */ -#line 771 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 771 "knot/conf/cf-parse.y" { this_list = &this_zone->acl.notify_out; } break; case 73: - -/* Line 1806 of yacc.c */ -#line 774 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 774 "knot/conf/cf-parse.y" { this_list = &this_zone->acl.update_in; } break; case 75: - -/* Line 1806 of yacc.c */ -#line 780 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 780 "knot/conf/cf-parse.y" { conf_acl_item(scanner, (yyvsp[(1) - (1)].tok).t); } break; case 76: - -/* Line 1806 of yacc.c */ -#line 781 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 781 "knot/conf/cf-parse.y" { conf_acl_item(scanner, strdup((yyvsp[(1) - (1)].tok).t)); } break; case 77: - -/* Line 1806 of yacc.c */ -#line 782 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 782 "knot/conf/cf-parse.y" { conf_acl_item(scanner, strdup((yyvsp[(1) - (1)].tok).t)); } break; case 78: - -/* Line 1806 of yacc.c */ -#line 783 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 783 "knot/conf/cf-parse.y" { conf_acl_item(scanner, strdup((yyvsp[(1) - (1)].tok).t)); } break; case 79: - -/* Line 1806 of yacc.c */ -#line 784 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 784 "knot/conf/cf-parse.y" { conf_acl_item(scanner, strdup((yyvsp[(1) - (1)].tok).t)); } break; case 84: - -/* Line 1806 of yacc.c */ -#line 793 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 793 "knot/conf/cf-parse.y" { /* Find existing node in remotes. */ node* r = 0; conf_iface_t* found = 0; @@ -2796,51 +2730,44 @@ yyreduce: break; case 86: - -/* Line 1806 of yacc.c */ -#line 822 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 822 "knot/conf/cf-parse.y" { conf_zone_start(scanner, strdup((yyvsp[(1) - (1)].tok).t)); } break; case 87: - -/* Line 1806 of yacc.c */ -#line 823 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 823 "knot/conf/cf-parse.y" { conf_zone_start(scanner, strdup((yyvsp[(1) - (1)].tok).t)); } break; case 88: - -/* Line 1806 of yacc.c */ -#line 824 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 824 "knot/conf/cf-parse.y" { conf_zone_start(scanner, strdup((yyvsp[(1) - (1)].tok).t)); } break; case 89: - -/* Line 1806 of yacc.c */ -#line 825 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 825 "knot/conf/cf-parse.y" { conf_zone_start(scanner, strdup((yyvsp[(1) - (1)].tok).t)); } break; case 90: - -/* Line 1806 of yacc.c */ -#line 826 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 826 "knot/conf/cf-parse.y" { conf_zone_start(scanner, strdup((yyvsp[(1) - (1)].tok).t)); } break; case 91: - -/* Line 1806 of yacc.c */ -#line 827 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 827 "knot/conf/cf-parse.y" { conf_zone_start(scanner, strdup((yyvsp[(1) - (1)].tok).t)); } break; case 92: - -/* Line 1806 of yacc.c */ -#line 828 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 828 "knot/conf/cf-parse.y" { if ((yyvsp[(1) - (3)].tok).i < 0 || (yyvsp[(1) - (3)].tok).i > 255) { cf_error(scanner, "rfc2317 origin prefix '%ld' out of bounds", (yyvsp[(1) - (3)].tok).i); @@ -2861,72 +2788,62 @@ yyreduce: break; case 93: - -/* Line 1806 of yacc.c */ -#line 845 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 845 "knot/conf/cf-parse.y" { conf_zone_start(scanner, (yyvsp[(1) - (1)].tok).t); } break; case 97: - -/* Line 1806 of yacc.c */ -#line 852 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 852 "knot/conf/cf-parse.y" { this_zone->file = (yyvsp[(3) - (4)].tok).t; } break; case 98: - -/* Line 1806 of yacc.c */ -#line 853 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 853 "knot/conf/cf-parse.y" { this_zone->build_diffs = (yyvsp[(3) - (4)].tok).i; } break; case 99: - -/* Line 1806 of yacc.c */ -#line 854 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 854 "knot/conf/cf-parse.y" { this_zone->enable_checks = (yyvsp[(3) - (4)].tok).i; } break; case 100: - -/* Line 1806 of yacc.c */ -#line 855 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 855 "knot/conf/cf-parse.y" { this_zone->disable_any = (yyvsp[(3) - (4)].tok).i; } break; case 101: - -/* Line 1806 of yacc.c */ -#line 856 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 856 "knot/conf/cf-parse.y" { this_zone->dbsync_timeout = (yyvsp[(3) - (4)].tok).i; } break; case 102: - -/* Line 1806 of yacc.c */ -#line 857 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 857 "knot/conf/cf-parse.y" { this_zone->dbsync_timeout = (yyvsp[(3) - (4)].tok).i; } break; case 103: - -/* Line 1806 of yacc.c */ -#line 858 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 858 "knot/conf/cf-parse.y" { new_config->ixfr_fslimit = (yyvsp[(3) - (4)].tok).l; } break; case 104: - -/* Line 1806 of yacc.c */ -#line 859 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 859 "knot/conf/cf-parse.y" { this_zone->ixfr_fslimit = (yyvsp[(3) - (4)].tok).i; } break; case 105: - -/* Line 1806 of yacc.c */ -#line 860 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 860 "knot/conf/cf-parse.y" { if ((yyvsp[(3) - (4)].tok).i < 1) { cf_error(scanner, "notify retries must be positive integer"); @@ -2937,9 +2854,8 @@ yyreduce: break; case 106: - -/* Line 1806 of yacc.c */ -#line 867 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 867 "knot/conf/cf-parse.y" { if ((yyvsp[(3) - (4)].tok).i < 1) { cf_error(scanner, "notify timeout must be positive integer"); @@ -2950,44 +2866,38 @@ yyreduce: break; case 109: - -/* Line 1806 of yacc.c */ -#line 879 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 879 "knot/conf/cf-parse.y" { new_config->disable_any = (yyvsp[(3) - (4)].tok).i; } break; case 110: - -/* Line 1806 of yacc.c */ -#line 880 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 880 "knot/conf/cf-parse.y" { new_config->build_diffs = (yyvsp[(3) - (4)].tok).i; } break; case 111: - -/* Line 1806 of yacc.c */ -#line 881 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 881 "knot/conf/cf-parse.y" { new_config->zone_checks = (yyvsp[(3) - (4)].tok).i; } break; case 112: - -/* Line 1806 of yacc.c */ -#line 882 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 882 "knot/conf/cf-parse.y" { new_config->ixfr_fslimit = (yyvsp[(3) - (4)].tok).l; } break; case 113: - -/* Line 1806 of yacc.c */ -#line 883 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 883 "knot/conf/cf-parse.y" { new_config->ixfr_fslimit = (yyvsp[(3) - (4)].tok).i; } break; case 114: - -/* Line 1806 of yacc.c */ -#line 884 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 884 "knot/conf/cf-parse.y" { if ((yyvsp[(3) - (4)].tok).i < 1) { cf_error(scanner, "notify retries must be positive integer"); @@ -2998,9 +2908,8 @@ yyreduce: break; case 115: - -/* Line 1806 of yacc.c */ -#line 891 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 891 "knot/conf/cf-parse.y" { if ((yyvsp[(3) - (4)].tok).i < 1) { cf_error(scanner, "notify timeout must be positive integer"); @@ -3011,9 +2920,8 @@ yyreduce: break; case 116: - -/* Line 1806 of yacc.c */ -#line 898 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 898 "knot/conf/cf-parse.y" { if ((yyvsp[(3) - (4)].tok).i < 1) { cf_error(scanner, "zonefile sync timeout must be positive integer"); @@ -3024,16 +2932,14 @@ yyreduce: break; case 117: - -/* Line 1806 of yacc.c */ -#line 905 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 905 "knot/conf/cf-parse.y" { new_config->dbsync_timeout = (yyvsp[(3) - (4)].tok).i; } break; case 118: - -/* Line 1806 of yacc.c */ -#line 908 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 908 "knot/conf/cf-parse.y" { this_logmap = malloc(sizeof(conf_log_map_t)); this_logmap->source = 0; @@ -3043,23 +2949,20 @@ yyreduce: break; case 120: - -/* Line 1806 of yacc.c */ -#line 918 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 918 "knot/conf/cf-parse.y" { this_logmap->prios |= (yyvsp[(2) - (3)].tok).i; } break; case 121: - -/* Line 1806 of yacc.c */ -#line 919 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 919 "knot/conf/cf-parse.y" { this_logmap->prios |= (yyvsp[(2) - (3)].tok).i; } break; case 123: - -/* Line 1806 of yacc.c */ -#line 923 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 923 "knot/conf/cf-parse.y" { this_logmap->source = (yyvsp[(2) - (3)].tok).i; this_logmap = 0; @@ -3067,9 +2970,8 @@ yyreduce: break; case 124: - -/* Line 1806 of yacc.c */ -#line 929 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 929 "knot/conf/cf-parse.y" { /* Find already existing rule. */ this_log = 0; @@ -3094,9 +2996,8 @@ yyreduce: break; case 125: - -/* Line 1806 of yacc.c */ -#line 952 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 952 "knot/conf/cf-parse.y" { /* Find already existing rule. */ this_log = 0; @@ -3125,47 +3026,41 @@ yyreduce: break; case 126: - -/* Line 1806 of yacc.c */ -#line 979 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 979 "knot/conf/cf-parse.y" { } break; case 130: - -/* Line 1806 of yacc.c */ -#line 988 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 988 "knot/conf/cf-parse.y" { new_config->logs_count = 0; } break; case 132: - -/* Line 1806 of yacc.c */ -#line 992 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 992 "knot/conf/cf-parse.y" { conf_init_iface(scanner, NULL, -1); } break; case 133: - -/* Line 1806 of yacc.c */ -#line 996 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 996 "knot/conf/cf-parse.y" { this_list = &new_config->ctl.allow; } break; case 134: - -/* Line 1806 of yacc.c */ -#line 1002 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 1002 "knot/conf/cf-parse.y" { new_config->ctl.have = true; } break; case 135: - -/* Line 1806 of yacc.c */ -#line 1003 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 1003 "knot/conf/cf-parse.y" { if (this_iface->address == 0) { cf_error(scanner, "control interface has no defined address"); @@ -3176,9 +3071,8 @@ yyreduce: break; case 136: - -/* Line 1806 of yacc.c */ -#line 1010 "cf-parse.y" +/* Line 1787 of yacc.c */ +#line 1010 "knot/conf/cf-parse.y" { this_iface->address = (yyvsp[(3) - (4)].tok).t; this_iface->family = AF_UNIX; @@ -3188,9 +3082,8 @@ yyreduce: break; - -/* Line 1806 of yacc.c */ -#line 3194 "knot/conf/libknotd_la-cf-parse.c" +/* Line 1787 of yacc.c */ +#line 3087 "knot/conf/libknotd_la-cf-parse.c" default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -3353,7 +3246,9 @@ yyerrlab1: YY_STACK_PRINT (yyss, yyssp); } + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END /* Shift the error token. */ @@ -3377,7 +3272,7 @@ yyabortlab: yyresult = 1; goto yyreturn; -#if !defined(yyoverflow) || YYERROR_VERBOSE +#if !defined yyoverflow || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ @@ -3419,8 +3314,6 @@ yyreturn: } - -/* Line 2067 of yacc.c */ -#line 1022 "cf-parse.y" - +/* Line 2050 of yacc.c */ +#line 1022 "knot/conf/cf-parse.y" diff --git a/src/knot/conf/libknotd_la-cf-parse.h b/src/knot/conf/libknotd_la-cf-parse.h index d95ad8c..b90709e 100644 --- a/src/knot/conf/libknotd_la-cf-parse.h +++ b/src/knot/conf/libknotd_la-cf-parse.h @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 2.5. */ +/* A Bison parser, made by GNU Bison 2.7.12-4996. */ /* Bison interface for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,6 +30,15 @@ This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ +#ifndef YY_CF_Y_TAB_H_INCLUDED +# define YY_CF_Y_TAB_H_INCLUDED +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif +#if YYDEBUG +extern int cf_debug; +#endif /* Tokens. */ #ifndef YYTOKENTYPE @@ -157,13 +166,11 @@ - #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE { - -/* Line 2068 of yacc.c */ -#line 386 "cf-parse.y" +/* Line 2053 of yacc.c */ +#line 386 "knot/conf/cf-parse.y" struct { char *t; @@ -173,9 +180,8 @@ typedef union YYSTYPE } tok; - -/* Line 2068 of yacc.c */ -#line 179 "knot/conf/libknotd_la-cf-parse.h" +/* Line 2053 of yacc.c */ +#line 185 "knot/conf/libknotd_la-cf-parse.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -183,5 +189,18 @@ typedef union YYSTYPE #endif +#ifdef YYPARSE_PARAM +#if defined __STDC__ || defined __cplusplus +int cf_parse (void *YYPARSE_PARAM); +#else +int cf_parse (); +#endif +#else /* ! YYPARSE_PARAM */ +#if defined __STDC__ || defined __cplusplus +int cf_parse (void *scanner); +#else +int cf_parse (); +#endif +#endif /* ! YYPARSE_PARAM */ - +#endif /* !YY_CF_Y_TAB_H_INCLUDED */ diff --git a/src/knot/ctl/knotc_main.c b/src/knot/ctl/knotc_main.c index e2c42a1..23d49ee 100644 --- a/src/knot/ctl/knotc_main.c +++ b/src/knot/ctl/knotc_main.c @@ -25,12 +25,6 @@ #ifdef HAVE_SYS_STAT_H #include <sys/stat.h> #endif -#ifdef HAVE_SYS_SELECT_H -#include <sys/select.h> -#endif -#ifdef HAVE_SYS_WAIT_H -#include <sys/wait.h> -#endif #include "knot/knot.h" #include "common/descriptor.h" @@ -51,9 +45,7 @@ enum knotc_flag_t { F_NULL = 0 << 0, F_FORCE = 1 << 0, F_VERBOSE = 1 << 1, - F_WAIT = 1 << 2, F_INTERACTIVE = 1 << 3, - F_AUTO = 1 << 4, F_UNPRIVILEGED = 1 << 5, F_NOCONF = 1 << 6, F_DRYRUN = 1 << 7 @@ -415,7 +407,6 @@ int main(int argc, char **argv) /* Long options. */ struct option opts[] = { - {"wait", no_argument, 0, 'w'}, {"force", no_argument, 0, 'f'}, {"config", required_argument, 0, 'c'}, {"verbose", no_argument, 0, 'v'}, @@ -429,7 +420,7 @@ int main(int argc, char **argv) {0, 0, 0, 0} }; - while ((c = getopt_long(argc, argv, "s:p:y:k:wfc:viVh", opts, &li)) != -1) { + while ((c = getopt_long(argc, argv, "s:p:y:k:fc:viVh", opts, &li)) != -1) { switch (c) { case 's': r_addr = optarg; @@ -453,9 +444,6 @@ int main(int argc, char **argv) goto exit; } break; - case 'w': - flags |= F_WAIT; - break; case 'f': flags |= F_FORCE; break; diff --git a/src/knot/server/dthreads.c b/src/knot/server/dthreads.c index 759faf2..0f9235f 100644 --- a/src/knot/server/dthreads.c +++ b/src/knot/server/dthreads.c @@ -88,7 +88,6 @@ static inline int dt_update_thread(dthread_t *thread, int state) unlock_thread_rw(thread); // Notify thread - dt_signalize(thread, SIGALRM); pthread_cond_broadcast(&unit->_notify); pthread_mutex_unlock(&unit->_notify_mx); } else { @@ -134,7 +133,7 @@ static void *thread_ep(void *data) sigaddset(&ignset, SIGHUP); sigaddset(&ignset, SIGPIPE); sigaddset(&ignset, SIGUSR1); - pthread_sigmask(SIG_BLOCK, &ignset, 0); /*! \todo Review under BSD (issue #1441). */ + pthread_sigmask(SIG_BLOCK, &ignset, 0); rcu_register_thread(); dbg_dt("dthreads: [%p] entered ep\n", thread); diff --git a/src/knot/server/server.c b/src/knot/server/server.c index 7244d3c..2e9b4c5 100644 --- a/src/knot/server/server.c +++ b/src/knot/server/server.c @@ -592,7 +592,10 @@ int server_conf_hook(const struct conf_t *conf, void *data) if (udp_size < 2) udp_size = 2; dt_unit_t *tu = dt_create_coherent(udp_size, &udp_master, NULL); server_init_handler(server->h + IO_UDP, server, tu, NULL); - tu = dt_create(tu_size * 2); + + /* Create at least CONFIG_XFERS threads for TCP for faster + * processing of massive bootstrap queries. */ + tu = dt_create(MAX(tu_size * 2, CONFIG_XFERS)); server_init_handler(server->h + IO_TCP, server, tu, NULL); tcp_loop_unit(server->h + IO_TCP, tu); if (server->state & ServerRunning) { diff --git a/src/knot/server/tcp-handler.c b/src/knot/server/tcp-handler.c index 1f18abf..3ebdfe4 100644 --- a/src/knot/server/tcp-handler.c +++ b/src/knot/server/tcp-handler.c @@ -25,6 +25,9 @@ #include <netinet/in.h> #include <stdio.h> #include <stdlib.h> +#ifdef HAVE_SYS_UIO_H // struct iovec (OpenBSD) +#include <sys/uio.h> +#endif // HAVE_SYS_UIO_H #ifdef HAVE_CAP_NG_H #include <cap-ng.h> #endif /* HAVE_CAP_NG_H */ @@ -403,44 +406,22 @@ static void tcp_loop_free(void *data) int tcp_send(int fd, uint8_t *msg, size_t msglen) { - - /*! \brief TCP corking. - * \see http://vger.kernel.org/~acme/unbehaved.txt - */ -#ifdef TCP_CORK - int cork = 1; - int uncork = setsockopt(fd, SOL_TCP, TCP_CORK, &cork, sizeof(cork)); -#endif - - /* Flags. */ - int flags = 0; -#ifdef MSG_NOSIGNAL - flags |= MSG_NOSIGNAL; -#endif - - /* Send message size. */ - unsigned short pktsize = htons(msglen); - int sent = send(fd, &pktsize, sizeof(pktsize), flags); - if (sent < 0) { - return KNOT_ERROR; - } - - /* Send message data. */ - sent = send(fd, msg, msglen, flags); - if (sent < 0) { + /* Create iovec for gathered write. */ + struct iovec iov[2]; + uint16_t pktsize = htons(msglen); + iov[0].iov_base = &pktsize; + iov[0].iov_len = sizeof(uint16_t); + iov[1].iov_base = msg; + iov[1].iov_len = msglen; + + /* Send. */ + int total_len = iov[0].iov_len + iov[1].iov_len; + int sent = writev(fd, iov, 2); + if (sent != total_len) { return KNOT_ERROR; } -#ifdef TCP_CORK - /* Uncork only if corked successfuly. */ - if (uncork == 0) { - cork = 0; - if (setsockopt(fd, SOL_TCP, TCP_CORK, &cork, sizeof(cork)) < 0) { - dbg_net("tcp: failed to uncork socket\n"); - } - } -#endif - return sent; + return msglen; /* Do not count the size prefix. */ } int tcp_recv(int fd, uint8_t *buf, size_t len, sockaddr_t *addr) @@ -543,7 +524,16 @@ int tcp_loop_master(dthread_t *thread) } for (unsigned i = 0; nfds > 0 && i < set.n; ++i) { - /* Skip inactive. */ + + /* Error events. */ + if (set.pfd[i].revents & (POLLERR|POLLHUP|POLLNVAL)) { + socket_close(set.pfd[i].fd); + fdset_remove(&set, i); + --nfds; /* Treat error event as activity. */ + continue; /* Stay on the same index. */ + } + + /* Accept POLLIN events. */ if (!(set.pfd[i].revents & POLLIN)) continue; @@ -611,6 +601,15 @@ int tcp_loop_worker(dthread_t *thread) unsigned i = 0; while (nfds > 0 && i < set->n) { + /* Terminate faulty connections. */ + int fd = set->pfd[i].fd; + if (set->pfd[i].revents & (POLLERR|POLLHUP|POLLNVAL)) { + fdset_remove(set, i); + close(fd); + --nfds; /* Treat error event as activity. */ + continue; /* Stay on the same index. */ + } + if (!(set->pfd[i].revents & set->pfd[i].events)) { /* Skip inactive. */ ++i; @@ -621,7 +620,6 @@ int tcp_loop_worker(dthread_t *thread) } /* Register new TCP client or process a query. */ - int fd = set->pfd[i].fd; if (fd == w->pipe[0]) { tcp_loop_assign(fd, set); } else { diff --git a/src/knot/server/udp-handler.c b/src/knot/server/udp-handler.c index 259ac5a..b57f902 100644 --- a/src/knot/server/udp-handler.c +++ b/src/knot/server/udp-handler.c @@ -340,7 +340,7 @@ static int udp_recvfrom_send(void *d) return 0; } -#ifdef ENABLE_RECVMMSG +#ifdef HAVE_RECVMMSG /*! \brief Pointer to selected UDP send implementation. */ static int (*_send_mmsg)(int, sockaddr_t *, struct mmsghdr *, size_t) = 0; @@ -370,7 +370,7 @@ static inline int sendmmsg(int fd, struct mmsghdr *mmsg, unsigned vlen, { return syscall(SYS_sendmmsg, fd, mmsg, vlen, flags, NULL); } -#endif +#endif /* HAVE_SENDMMSG */ /*! * \brief Send multiple packets. @@ -382,7 +382,7 @@ int udp_sendmmsg(int sock, sockaddr_t *_, struct mmsghdr *msgs, size_t count) UNUSED(_); return sendmmsg(sock, msgs, count, 0); } -#endif +#endif /* ENABLE_SENDMMSG */ /* UDP recvmmsg() request struct. */ struct udp_recvmmsg { @@ -483,7 +483,7 @@ static int udp_recvmmsg_send(void *d) } return rc; } -#endif +#endif /* HAVE_RECVMMSG */ /*! \brief Initialize UDP master routine on run-time. */ void __attribute__ ((constructor)) udp_master_init() @@ -496,7 +496,7 @@ void __attribute__ ((constructor)) udp_master_init() _udp_handle = udp_recvfrom_handle; /* Optimized functions. */ -#ifdef ENABLE_RECVMMSG +#ifdef HAVE_RECVMMSG /* Check for recvmmsg() support. */ if (dlsym(RTLD_DEFAULT, "recvmmsg") != 0) { recvmmsg(0, NULL, 0, 0, 0); @@ -517,7 +517,7 @@ void __attribute__ ((constructor)) udp_master_init() _send_mmsg = udp_sendmmsg; } #endif /* ENABLE_SENDMMSG */ -#endif /* ENABLE_RECVMMSG */ +#endif /* HAVE_RECVMMSG */ } int udp_reader(iohandler_t *h, dthread_t *thread) diff --git a/src/knot/server/xfr-handler.c b/src/knot/server/xfr-handler.c index 90b0a42..04a0669 100644 --- a/src/knot/server/xfr-handler.c +++ b/src/knot/server/xfr-handler.c @@ -1101,21 +1101,19 @@ int xfr_worker(dthread_t *thread) unsigned i = 0; while (nfds > 0 && i < set.n && !dt_is_cancelled(thread)) { - if (!(set.pfd[i].revents & set.pfd[i].events)) { - /* Skip inactive. */ - ++i; - continue; - } else { + knot_ns_xfr_t *rq = (knot_ns_xfr_t *)set.ctx[i]; + if (set.pfd[i].revents & (POLLERR|POLLHUP|POLLNVAL)) { + /* Error events. */ + --nfds; /* Treat error event as activity. */ + ret = KNOT_ECONN; /* Force disconnect */ + } else if (set.pfd[i].revents & set.pfd[i].events) { /* One less active event. */ --nfds; - } - - /* Process pending tasks. */ - knot_ns_xfr_t *rq = (knot_ns_xfr_t *)set.ctx[i]; - if (rq->flags & XFR_FLAG_CONNECTING) { - ret = xfr_async_finish(&set, i); - } else { - ret = xfr_process_event(w, rq); + /* Process pending tasks. */ + if (rq->flags & XFR_FLAG_CONNECTING) + ret = xfr_async_finish(&set, i); + else + ret = xfr_process_event(w, rq); } /* Check task state. */ @@ -1126,6 +1124,9 @@ int xfr_worker(dthread_t *thread) socket_close(set.pfd[i].fd); fdset_remove(&set, i); continue; /* Stay on the same index. */ + } else { + /* Connection is active, update watchdog. */ + fdset_set_watchdog(&set, i, conf()->max_conn_idle); } /* Next active. */ diff --git a/src/knot/zone/semantic-check.c b/src/knot/zone/semantic-check.c index efbe953..8a043d0 100644 --- a/src/knot/zone/semantic-check.c +++ b/src/knot/zone/semantic-check.c @@ -42,6 +42,8 @@ static char *error_messages[(-ZC_ERR_UNKNOWN) + 1] = { "RRSIG: Type covered rdata field is wrong!", [-ZC_ERR_RRSIG_RDATA_TTL] = "RRSIG: TTL rdata field is wrong!", + [-ZC_ERR_RRSIG_RDATA_EXPIRATION] = + "RRSIG: Expired signature!", [-ZC_ERR_RRSIG_RDATA_LABELS] = "RRSIG: Labels rdata field is wrong!", [-ZC_ERR_RRSIG_RDATA_DNSKEY_OWNER] = @@ -289,9 +291,17 @@ static int check_rrsig_rdata(err_handler_t *handler, const knot_rrset_t *rrset, const knot_rrset_t *dnskey_rrset) { + /* Prepare additional info string. */ + char info_str[50]; + int ret = snprintf(info_str, sizeof(info_str), "Record type: %d.", + knot_rrset_type(rrset)); + if (ret < 0 || ret >= sizeof(info_str)) { + return KNOT_ENOMEM; + } + if (knot_rrset_rdata_rr_count(rrsig) == 0) { err_handler_handle_error(handler, node, ZC_ERR_RRSIG_NO_RRSIG, - NULL); + info_str); return KNOT_EOK; } @@ -302,7 +312,7 @@ static int check_rrsig_rdata(err_handler_t *handler, */ err_handler_handle_error(handler, node, ZC_ERR_RRSIG_RDATA_TYPE_COVERED, - NULL); + info_str); } /* label number at the 2nd index should be same as owner's */ @@ -316,12 +326,12 @@ static int check_rrsig_rdata(err_handler_t *handler, if (!knot_dname_is_wildcard(knot_rrset_owner(rrset))) { err_handler_handle_error(handler, node, ZC_ERR_RRSIG_RDATA_LABELS, - NULL); + info_str); } else { if (abs(tmp) != 1) { err_handler_handle_error(handler, node, ZC_ERR_RRSIG_RDATA_LABELS, - NULL); + info_str); } } } @@ -332,7 +342,14 @@ static int check_rrsig_rdata(err_handler_t *handler, if (original_ttl != knot_rrset_ttl(rrset)) { err_handler_handle_error(handler, node, ZC_ERR_RRSIG_RDATA_TTL, - NULL); + info_str); + } + + /* Check for expired signature. */ + if (knot_rrset_rdata_rrsig_sig_expiration(rrsig, rr_pos) < time(NULL)) { + err_handler_handle_error(handler, node, + ZC_ERR_RRSIG_RDATA_EXPIRATION, + info_str); } /* signer's name is same as in the zone apex */ @@ -344,7 +361,7 @@ static int check_rrsig_rdata(err_handler_t *handler, knot_rrset_owner(dnskey_rrset)) != 0) { err_handler_handle_error(handler, node, ZC_ERR_RRSIG_RDATA_DNSKEY_OWNER, - NULL); + info_str); } /* Compare algorithm, key tag and signer's name with DNSKEY rrset @@ -381,14 +398,6 @@ static int check_rrsig_rdata(err_handler_t *handler, } if (!match) { - /* Prepare additional info string. */ - char info_str[50]; - int ret = snprintf(info_str, sizeof(info_str), - "Record type: %d.", - knot_rrset_type(rrset)); - if (ret < 0 || ret >= sizeof(info_str)) { - return KNOT_ENOMEM; - } err_handler_handle_error(handler, node, ZC_ERR_RRSIG_NO_RRSIG, info_str); } @@ -410,8 +419,7 @@ static int check_rrsig_rdata(err_handler_t *handler, static int check_rrsig_in_rrset(err_handler_t *handler, const knot_node_t *node, const knot_rrset_t *rrset, - const knot_rrset_t *dnskey_rrset, - char nsec3) + const knot_rrset_t *dnskey_rrset) { if (handler == NULL || node == NULL || rrset == NULL || dnskey_rrset == NULL) { @@ -460,7 +468,7 @@ static int check_rrsig_in_rrset(err_handler_t *handler, info_str); } - if (knot_rrset_ttl(rrset) != knot_rrset_ttl(rrset)) { + if (knot_rrset_ttl(rrset) != knot_rrset_ttl(rrsigs)) { err_handler_handle_error(handler, node, ZC_ERR_RRSIG_TTL, info_str); @@ -985,11 +993,10 @@ int sem_check_node_plain(knot_zone_contents_t *zone, } /*! - * \brief Run semantic checks for node without DNSSEC-related types. + * \brief Run semantic checks for node with DNSSEC-related types. * * \param zone Current zone. * \param node Node to be checked. - * \param first_node First node in canonical order. * \param last_node Last node in canonical order. * \param handler Error handler. * \param nsec3 NSEC3 used. @@ -1000,7 +1007,6 @@ int sem_check_node_plain(knot_zone_contents_t *zone, */ static int semantic_checks_dnssec(knot_zone_contents_t *zone, knot_node_t *node, - knot_node_t *first_node, knot_node_t **last_node, err_handler_t *handler, char nsec3) @@ -1021,8 +1027,7 @@ static int semantic_checks_dnssec(knot_zone_contents_t *zone, const knot_rrset_t *rrset = rrsets[i]; if (auth && !deleg && (ret = check_rrsig_in_rrset(handler, node, - rrset, dnskey_rrset, - nsec3)) != 0) { + rrset, dnskey_rrset)) != 0) { err_handler_handle_error(handler, node, ret, NULL); } @@ -1148,7 +1153,6 @@ static void do_checks_in_tree(knot_node_t *node, void *data) assert(zone); - knot_node_t *first_node = (knot_node_t *)args->arg4; knot_node_t **last_node = (knot_node_t **)args->arg5; err_handler_t *handler = (err_handler_t *)args->arg6; @@ -1170,7 +1174,7 @@ static void do_checks_in_tree(knot_node_t *node, void *data) } if (do_checks > 1) { - semantic_checks_dnssec(zone, node, first_node, last_node, + semantic_checks_dnssec(zone, node, last_node, handler, do_checks == 3); } @@ -1188,7 +1192,7 @@ int zone_do_sem_checks(knot_zone_contents_t *zone, int do_checks, arg_t arguments; arguments.arg1 = zone; arguments.arg3 = &do_checks; - arguments.arg4 = NULL; + arguments.arg4 = NULL; // UNUSED arguments.arg5 = &last_node; arguments.arg6 = handler; int fatal_error = 0; diff --git a/src/knot/zone/semantic-check.h b/src/knot/zone/semantic-check.h index 819c9ff..53c2589 100644 --- a/src/knot/zone/semantic-check.h +++ b/src/knot/zone/semantic-check.h @@ -44,6 +44,7 @@ enum zonechecks_errors { ZC_ERR_RRSIG_RDATA_TYPE_COVERED, ZC_ERR_RRSIG_RDATA_TTL, + ZC_ERR_RRSIG_RDATA_EXPIRATION, ZC_ERR_RRSIG_RDATA_LABELS, ZC_ERR_RRSIG_RDATA_DNSKEY_OWNER, ZC_ERR_RRSIG_RDATA_SIGNED_WRONG, diff --git a/src/knot/zone/zone-load.c b/src/knot/zone/zone-load.c index ec8375a..8f45798 100644 --- a/src/knot/zone/zone-load.c +++ b/src/knot/zone/zone-load.c @@ -395,7 +395,7 @@ static void process_rr(const scanner_t *scanner) return; } else { log_zone_warning("encountered identical " - "extra SOA record"); + "extra SOA record\n"); knot_rrset_deep_free(¤t_rrset, 1, 1); parser->ret = KNOT_EOK; return; @@ -411,7 +411,7 @@ static void process_rr(const scanner_t *scanner) "in config! \n"); /* Such SOA cannot even be added, because * it would not be in the zone apex. */ - parser->ret = KNOT_EBADZONE; + parser->ret = KNOT_EOUTOFZONE; return; } } diff --git a/src/libknot/nameserver/name-server.c b/src/libknot/nameserver/name-server.c index ee956e7..db42d9a 100644 --- a/src/libknot/nameserver/name-server.c +++ b/src/libknot/nameserver/name-server.c @@ -2180,7 +2180,7 @@ dbg_ns_exec_verb( dbg_ns_verb(" and previous node: (nil).\n"); } ); - if (find_ret == KNOT_EBADZONE) { + if (find_ret == KNOT_EOUTOFZONE) { // possible only if we followed CNAME or DNAME assert(cname != 0); knot_response_set_rcode(resp, KNOT_RCODE_NOERROR); diff --git a/src/libknot/rrset.c b/src/libknot/rrset.c index 24ddb88..74b9158 100644 --- a/src/libknot/rrset.c +++ b/src/libknot/rrset.c @@ -1144,6 +1144,8 @@ int knot_rrset_rdata_from_wire_one(knot_rrset_t *rrset, const uint8_t *wire, size_t *pos, size_t total_size, size_t rdlength) { + int obsolete = 0; + /* [code-review] Missing parameter checks. */ if (rdlength == 0) { @@ -1158,15 +1160,24 @@ int knot_rrset_rdata_from_wire_one(knot_rrset_t *rrset, size_t extra_dname_size = 0; const rdata_descriptor_t *desc = get_rdata_descriptor(rrset->type); + /* Check for obsolete record. */ + if (desc->type_name == NULL) { + desc = get_obsolete_rdata_descriptor(rrset->type); + if (desc->type_name != NULL) { + obsolete = 1; + } + } + for (int i = 0; desc->block_types[i] != KNOT_RDATA_WF_END; ++i) { if (descriptor_item_is_dname(desc->block_types[i])) { - extra_dname_size += sizeof(knot_dname_t *) - 1; + if (obsolete) { + extra_dname_size += KNOT_MAX_DNAME_LENGTH; + } else { + extra_dname_size += sizeof(knot_dname_t *); + } } } - /* [code-review] Isn't this invalid? You cannot do static allocation - * with dynamic data (parameter, local variable). - */ uint8_t rdata_buffer[rdlength + extra_dname_size]; memset(rdata_buffer, 0, rdlength + extra_dname_size); dbg_rrset_detail("rr: parse_rdata_wire: Added %zu bytes to buffer to " @@ -1188,9 +1199,7 @@ int knot_rrset_rdata_from_wire_one(knot_rrset_t *rrset, return KNOT_EMALF; } knot_dname_to_lower(dname); - memcpy(rdata_buffer + offset, &dname, - sizeof(knot_dname_t *)); - parsed += pos2 - *pos; + dbg_rrset_detail("rr: parse_rdata_wire: Parsed DNAME, " "length=%zu.\n", pos2 - *pos); dbg_rrset_exec_detail( @@ -1199,8 +1208,19 @@ dbg_rrset_exec_detail( "DNAME=%s\n", name); free(name); ); + if (obsolete) { + memcpy(rdata_buffer + offset, + knot_dname_name(dname), + knot_dname_size(dname)); + offset += knot_dname_size(dname); + knot_dname_free(&dname); + } else { + memcpy(rdata_buffer + offset, &dname, + sizeof(knot_dname_t *)); + offset += sizeof(knot_dname_t *); + } + parsed += pos2 - *pos; *pos = pos2; - offset += sizeof(knot_dname_t *); } else if (descriptor_item_is_fixed(item)) { dbg_rrset_detail("rr: parse_rdata_wire: Saving static " "chunk of size=%u\n", item); @@ -1605,6 +1625,19 @@ dbg_rrset_exec_detail( /*----------------------------------------------------------------------------*/ +bool knot_rrset_is_nsec3rel(const knot_rrset_t *rr) +{ + assert(rr != NULL); + + /* Is NSEC3 or non-empty RRSIG covering NSEC3. */ + return ((knot_rrset_type(rr) == KNOT_RRTYPE_NSEC3) + || (knot_rrset_type(rr) == KNOT_RRTYPE_RRSIG + && knot_rrset_rdata_rrsig_type_covered(rr) + == KNOT_RRTYPE_NSEC3)); +} + +/*----------------------------------------------------------------------------*/ + const knot_dname_t *knot_rrset_rdata_cname_name(const knot_rrset_t *rrset) { if (rrset == NULL) { diff --git a/src/libknot/rrset.h b/src/libknot/rrset.h index 2b0cb6b..05deb37 100644 --- a/src/libknot/rrset.h +++ b/src/libknot/rrset.h @@ -29,6 +29,7 @@ #define _KNOT_RRSET_H_ #include <stdint.h> +#include <stdbool.h> #include "dname.h" @@ -361,6 +362,13 @@ int knot_rrset_merge(knot_rrset_t *rrset1, const knot_rrset_t *rrset2); */ int knot_rrset_merge_no_dupl(knot_rrset_t *rrset1, const knot_rrset_t *rrset2, int *merged, int *deleted_rrs); +/*! + * \brief Return true if the RRSet is an NSEC3 related type. + * + * \param rr RRSet. + */ +bool knot_rrset_is_nsec3rel(const knot_rrset_t *rr); + //TODO test const knot_dname_t *knot_rrset_rdata_cname_name(const knot_rrset_t *rrset); diff --git a/src/libknot/updates/ddns.c b/src/libknot/updates/ddns.c index 7f4f14f..93ec342 100644 --- a/src/libknot/updates/ddns.c +++ b/src/libknot/updates/ddns.c @@ -322,7 +322,7 @@ static int knot_ddns_check_exist(const knot_zone_contents_t *zone, if (!knot_dname_is_subdomain(knot_rrset_owner(rrset), knot_node_owner(knot_zone_contents_apex(zone)))) { *rcode = KNOT_RCODE_NOTZONE; - return KNOT_EBADZONE; + return KNOT_EOUTOFZONE; } const knot_node_t *node; @@ -355,7 +355,7 @@ static int knot_ddns_check_exist_full(const knot_zone_contents_t *zone, if (!knot_dname_is_subdomain(knot_rrset_owner(rrset), knot_node_owner(knot_zone_contents_apex(zone)))) { *rcode = KNOT_RCODE_NOTZONE; - return KNOT_EBADZONE; + return KNOT_EOUTOFZONE; } const knot_node_t *node; @@ -400,7 +400,7 @@ static int knot_ddns_check_not_exist(const knot_zone_contents_t *zone, if (!knot_dname_is_subdomain(knot_rrset_owner(rrset), knot_node_owner(knot_zone_contents_apex(zone)))) { *rcode = KNOT_RCODE_NOTZONE; - return KNOT_EBADZONE; + return KNOT_EOUTOFZONE; } const knot_node_t *node; @@ -431,7 +431,7 @@ static int knot_ddns_check_in_use(const knot_zone_contents_t *zone, if (!knot_dname_is_subdomain(dname, knot_node_owner(knot_zone_contents_apex(zone)))) { *rcode = KNOT_RCODE_NOTZONE; - return KNOT_EBADZONE; + return KNOT_EOUTOFZONE; } const knot_node_t *node; @@ -461,7 +461,7 @@ static int knot_ddns_check_not_in_use(const knot_zone_contents_t *zone, if (!knot_dname_is_subdomain(dname, knot_node_owner(knot_zone_contents_apex(zone)))) { *rcode = KNOT_RCODE_NOTZONE; - return KNOT_EBADZONE; + return KNOT_EOUTOFZONE; } const knot_node_t *node; @@ -618,7 +618,7 @@ static int knot_ddns_check_update(const knot_rrset_t *rrset, int is_sub = knot_dname_is_subdomain(owner, qname); if (!is_sub && knot_dname_compare(owner, qname) != 0) { *rcode = KNOT_RCODE_NOTZONE; - return KNOT_EBADZONE; + return KNOT_EOUTOFZONE; } if (knot_rrset_class(rrset) == knot_packet_qclass(query)) { @@ -897,65 +897,6 @@ static void knot_ddns_check_add_rr(knot_changeset_t *changeset, /*----------------------------------------------------------------------------*/ -static int knot_ddns_rr_is_nsec3(const knot_rrset_t *rr) -{ - assert(rr != NULL); - - if ((knot_rrset_type(rr) == KNOT_RRTYPE_NSEC3) - || (knot_rrset_type(rr) == KNOT_RRTYPE_RRSIG - && knot_rrset_rdata_rr_count(rr) - && knot_rrset_rdata_rrsig_type_covered(rr) - == KNOT_RRTYPE_NSEC3)) - { - dbg_ddns_detail("This is NSEC3-related RRSet.\n"); - return 1; - } else { - return 0; - } -} - -/*----------------------------------------------------------------------------*/ -/*! \note Copied from xfrin_add_new_node(). */ -static knot_node_t *knot_ddns_add_new_node(knot_zone_contents_t *zone, - knot_dname_t *owner, int is_nsec3) -{ - assert(zone != NULL); - assert(owner != NULL); - - knot_node_t *node = knot_node_new(owner, NULL, 0); - if (node == NULL) { - dbg_xfrin("Failed to create a new node.\n"); - return NULL; - } - - int ret = 0; - - // insert the node into zone structures and create parents if - // necessary - if (is_nsec3) { - ret = knot_zone_contents_add_nsec3_node(zone, node, 1, 0); - } else { - ret = knot_zone_contents_add_node(zone, node, 1, 0); - } - if (ret != KNOT_EOK) { - dbg_xfrin("Failed to add new node to zone contents.\n"); - knot_node_free(&node); - return NULL; - } - - /*! - * \note It is not needed to set the previous node, we will do this - * in adjusting after the transfer. - */ - assert(zone->zone != NULL); - //knot_node_set_zone(node, zone->zone); - assert(node->zone == zone->zone); - - return node; -} - -/*----------------------------------------------------------------------------*/ - static knot_node_t *knot_ddns_get_node(knot_zone_contents_t *zone, const knot_rrset_t *rr) { @@ -966,7 +907,7 @@ static knot_node_t *knot_ddns_get_node(knot_zone_contents_t *zone, knot_dname_t *owner = knot_rrset_get_owner(rr); dbg_ddns_detail("Searching for node...\n"); - if (knot_ddns_rr_is_nsec3(rr)) { + if (knot_rrset_is_nsec3rel(rr)) { node = knot_zone_contents_get_nsec3_node(zone, owner); } else { node = knot_zone_contents_get_node(zone, owner); @@ -1548,14 +1489,12 @@ static int knot_ddns_process_add(const knot_rrset_t *rr, dbg_ddns_verb("Adding RR.\n"); if (node == NULL) { - // create new node, connect it properly to the - // zone nodes + // create new node, connect it to the zone nodes dbg_ddns_detail("Node not found. Creating new.\n"); - node = knot_ddns_add_new_node(zone, knot_rrset_get_owner(rr), - knot_ddns_rr_is_nsec3(rr)); - if (node == NULL) { + int ret = knot_zone_contents_create_node(zone, rr, &node); + if (ret != KNOT_EOK) { dbg_xfrin("Failed to create new node in zone.\n"); - return KNOT_ERROR; + return ret; } } diff --git a/src/libknot/updates/xfr-in.c b/src/libknot/updates/xfr-in.c index 78d12a9..ac70be0 100644 --- a/src/libknot/updates/xfr-in.c +++ b/src/libknot/updates/xfr-in.c @@ -321,6 +321,28 @@ static int xfrin_insert_rrset_dnames_to_table(knot_rrset_t *rrset, return KNOT_EOK; } +static void xfrin_log_error(const knot_dname_t *zone_owner, + const knot_dname_t *rr_owner, + int ret) +{ + char *zonename = knot_dname_to_str(zone_owner); + if (ret == KNOT_EOUTOFZONE) { + // Out-of-zone data, ignore + char *rrname = knot_dname_to_str(rr_owner); + log_zone_warning("Zone %s: Ignoring " + "out-of-zone RR owned by %s\n", + zonename, rrname); + free(zonename); + free(rrname); + } else { + log_zone_error("Zone %s: Failed to process " + "incoming RR, transfer " + "is probably malformed. (Reason: %s)\n", + zonename, knot_strerror(ret)); + free(zonename); + } +} + void xfrin_free_orphan_rrsigs(xfrin_orphan_rrsig_t **rrsigs) { xfrin_orphan_rrsig_t *r = *rrsigs; @@ -479,7 +501,7 @@ int xfrin_process_axfr_packet(knot_ns_xfr_t *xfr) /*! \todo Cleanup. */ return KNOT_EMALF; } - + if (rr == NULL) { dbg_xfrin("No RRs in the packet.\n"); knot_packet_free(&packet); @@ -525,8 +547,8 @@ int xfrin_process_axfr_packet(knot_ns_xfr_t *xfr) return KNOT_EOK; } - if (knot_dname_compare(knot_rrset_owner(rr), - knot_packet_qname(packet)) != 0) { + if (knot_dname_compare_non_canon(knot_rrset_owner(rr), + knot_packet_qname(packet)) != 0) { dbg_xfrin_exec( char *rr_owner = knot_dname_to_str(knot_rrset_owner(rr)); @@ -613,6 +635,15 @@ dbg_xfrin_exec( while (ret == KNOT_EOK && rr != NULL) { // process the parsed RR + if (!knot_dname_is_subdomain(rr->owner, xfr->zone->name) && + knot_dname_compare_non_canon(rr->owner, xfr->zone->name) != 0) { + // Out-of-zone data + xfrin_log_error(xfr->zone->name, rr->owner, + KNOT_EOUTOFZONE); + knot_rrset_deep_free(&rr, 1, 1); + ret = knot_packet_parse_next_rr_answer(packet, &rr); + continue; + } dbg_rrset_detail("\nNext RR:\n\n"); knot_rrset_dump(rr); @@ -799,14 +830,12 @@ dbg_xfrin_exec_verb( ret = add_node(zone, node, 1, 0); assert(node != NULL); if (ret != KNOT_EOK) { - dbg_xfrin("Failed to add node to zone (%s).\n", - knot_strerror(ret)); + // Fatal error, free packet knot_packet_free(&packet); - knot_node_free(&node); // ??? knot_rrset_deep_free(&rr, 1, 1); - return KNOT_ERROR; + knot_node_free(&node); + return ret; } - in_zone = 1; } else { assert(in_zone); @@ -822,7 +851,6 @@ dbg_xfrin_exec_verb( // merged, free the RRSet knot_rrset_deep_free(&rr, 1, 0); } - } rr = NULL; @@ -856,9 +884,10 @@ dbg_xfrin_exec_verb( if (ret != KNOT_EOK) { dbg_xfrin("Failed to add last node into zone (%s).\n", knot_strerror(ret)); - knot_packet_free(&packet); - knot_node_free(&node); - return KNOT_ERROR; /*! \todo Other error */ + knot_packet_free(&packet); + knot_node_free(&node); + knot_rrset_deep_free(&rr, 1, 1); + return ret; } } @@ -1096,6 +1125,20 @@ dbg_xfrin_exec_verb( knot_rrset_type(rr)); free(name); ); + if (!knot_dname_is_subdomain(rr->owner, xfr->zone->name) && + knot_dname_compare_non_canon(rr->owner, xfr->zone->name) != 0) { + // out-of-zone domain + xfrin_log_error(xfr->zone->name, rr->owner, + KNOT_EOUTOFZONE); + knot_rrset_deep_free(&rr, 1, 1); + // Skip this rr + ret = knot_packet_parse_next_rr_answer(packet, &rr); + continue; + } + + // Handle duplications + xfrin_insert_rrset_dnames_to_table(rr, xfr->lookup_tree); + switch (state) { case -1: // a SOA is expected @@ -1833,43 +1876,6 @@ dbg_xfrin_exec_verb( /*----------------------------------------------------------------------------*/ -static knot_node_t *xfrin_add_new_node(knot_zone_contents_t *contents, - knot_rrset_t *rrset, int is_nsec3) -{ - knot_node_t *node = knot_node_new(knot_rrset_get_owner(rrset), - NULL, 0); - if (node == NULL) { - dbg_xfrin("Failed to create a new node.\n"); - return NULL; - } - - int ret = 0; - - // insert the node into zone structures and create parents if - // necessary - if (is_nsec3) { - ret = knot_zone_contents_add_nsec3_node(contents, node, 1, 0); - } else { - ret = knot_zone_contents_add_node(contents, node, 1, 0); - } - if (ret != KNOT_EOK) { - dbg_xfrin("Failed to add new node to zone contents.\n"); - return NULL; - } - - /*! - * \note It is not needed to set the previous node, we will do this - * in adjusting after the transfer. - */ - - assert(contents->zone != NULL); - knot_node_set_zone(node, contents->zone); - - return node; -} - -/*----------------------------------------------------------------------------*/ - int xfrin_replace_rrset_in_node(knot_node_t *node, knot_rrset_t *rrset_new, knot_changes_t *changes, @@ -2563,8 +2569,6 @@ static int xfrin_apply_remove(knot_zone_contents_t *contents, knot_node_t *node = NULL; knot_rrset_t *rrset = NULL, *rrsigs = NULL; - int is_nsec3 = 0; - for (int i = 0; i < chset->remove_count; ++i) { dbg_xfrin_exec_verb( char *name = knot_dname_to_str( @@ -2577,17 +2581,8 @@ dbg_xfrin_exec_detail( knot_rrset_dump(chset->remove[i]); ); - is_nsec3 = 0; - // check if the RRSet belongs to the NSEC3 tree - if ((knot_rrset_type(chset->remove[i]) == KNOT_RRTYPE_NSEC3) - || (knot_rrset_type(chset->remove[i]) == KNOT_RRTYPE_RRSIG - && knot_rrset_rdata_rrsig_type_covered(chset->remove[i]) - == KNOT_RRTYPE_NSEC3)) - { - dbg_xfrin_verb("Removed RRSet belongs to NSEC3 tree.\n"); - is_nsec3 = 1; - } + int is_nsec3 = knot_rrset_is_nsec3rel(chset->remove[i]); // check if the old node is not the one we should use dbg_xfrin_verb("Node:%p Owner: %p Node owner: %p\n", @@ -2656,8 +2651,6 @@ static int xfrin_apply_add(knot_zone_contents_t *contents, knot_rrset_t *rrset = NULL; knot_rrset_t *rrsigs = NULL; - int is_nsec3 = 0; - for (int i = 0; i < chset->add_count; ++i) { dbg_xfrin_exec_verb( char *name = knot_dname_to_str( @@ -2670,17 +2663,8 @@ dbg_xfrin_exec_detail( knot_rrset_dump(chset->add[i]); ); - is_nsec3 = 0; - // check if the RRSet belongs to the NSEC3 tree - if ((knot_rrset_type(chset->add[i]) == KNOT_RRTYPE_NSEC3) - || (knot_rrset_type(chset->add[i]) == KNOT_RRTYPE_RRSIG - && knot_rrset_rdata_rrsig_type_covered(chset->add[i]) - == KNOT_RRTYPE_NSEC3)) - { - dbg_xfrin_detail("This is NSEC3-related RRSet.\n"); - is_nsec3 = 1; - } + int is_nsec3 = knot_rrset_is_nsec3rel(chset->add[i]); // check if the old node is not the one we should use if (!node || knot_rrset_owner(chset->add[i]) @@ -2699,13 +2683,13 @@ dbg_xfrin_exec_detail( // zone nodes dbg_xfrin_detail("Node not found. Creating new." "\n"); - node = xfrin_add_new_node(contents, - chset->add[i], - is_nsec3); - if (node == NULL) { + ret = knot_zone_contents_create_node(contents, + chset->add[i], + &node); + if (ret != KNOT_EOK) { dbg_xfrin("Failed to create new node " "in zone.\n"); - return KNOT_ERROR; + return ret; } } } diff --git a/src/libknot/zone/zone-contents.c b/src/libknot/zone/zone-contents.c index fbf4ab3..584e6cb 100644 --- a/src/libknot/zone/zone-contents.c +++ b/src/libknot/zone/zone-contents.c @@ -78,7 +78,7 @@ static void tree_apply_cb(knot_node_t **node, * \retval KNOT_EOK if both arguments are non-NULL and the node belongs to the * zone. * \retval KNOT_EINVAL if either of the arguments is NULL. - * \retval KNOT_EBADZONE if the node does not belong to the zone. + * \retval KNOT_EOUTOFZONE if the node does not belong to the zone. */ static int knot_zone_contents_check_node( const knot_zone_contents_t *contents, const knot_node_t *node) @@ -101,7 +101,7 @@ dbg_zone_exec( free(node_owner); free(apex_owner); ); - return KNOT_EBADZONE; + return KNOT_EOUTOFZONE; } return KNOT_EOK; } @@ -240,7 +240,7 @@ static void knot_zone_contents_adjust_rdata_dname(knot_zone_contents_t *zone, int ret = knot_zone_contents_find_dname(zone, dname, &n, &closest_encloser, &prev); - if (ret == KNOT_EINVAL || ret == KNOT_EBADZONE) { + if (ret == KNOT_EINVAL || ret == KNOT_EOUTOFZONE) { // TODO: do some cleanup if needed dbg_zone_detail("Failed to find the name in zone: %s\n", knot_strerror(ret)); @@ -1036,6 +1036,38 @@ dbg_zone_exec_detail( /*----------------------------------------------------------------------------*/ +int knot_zone_contents_create_node(knot_zone_contents_t *contents, + const knot_rrset_t *rr, + knot_node_t **node) +{ + if (contents == NULL || rr == NULL || node == NULL) { + return KNOT_EINVAL; + } + + *node = knot_node_new(rr->owner, NULL, 0); + if (*node == NULL) { + return KNOT_ENOMEM; + } + + /* Add to the proper tree. */ + int ret = KNOT_EOK; + if (knot_rrset_is_nsec3rel(rr)) { + ret = knot_zone_contents_add_nsec3_node(contents, *node, 1, 0); + } else { + ret = knot_zone_contents_add_node(contents, *node, 1, 0); + } + + if (ret != KNOT_EOK) { + dbg_xfrin("Failed to add new node to zone contents.\n"); + knot_node_free(node); + return ret; + } + + return ret; +} + +/*----------------------------------------------------------------------------*/ + int knot_zone_contents_add_rrset(knot_zone_contents_t *zone, knot_rrset_t *rrset, knot_node_t **node, knot_rrset_dupl_handling_t dupl) @@ -1057,7 +1089,7 @@ dbg_zone_exec_detail( zone->apex->owner) != 0 && !knot_dname_is_subdomain(knot_rrset_owner(rrset), zone->apex->owner)) { - return KNOT_EBADZONE; + return KNOT_EOUTOFZONE; } if ((*node) == NULL @@ -1121,7 +1153,7 @@ dbg_zone_exec( zone->apex->owner) != 0 && !knot_dname_is_subdomain(knot_rrset_owner(*rrset), zone->apex->owner)) { - return KNOT_EBADZONE; + return KNOT_EOUTOFZONE; } // check if the RRSIGs belong to the RRSet @@ -1238,7 +1270,7 @@ int knot_zone_contents_add_nsec3_rrset(knot_zone_contents_t *zone, zone->apex->owner) != 0 && !knot_dname_is_subdomain(knot_rrset_owner(rrset), zone->apex->owner)) { - return KNOT_EBADZONE; + return KNOT_EOUTOFZONE; } if ((*node) == NULL @@ -1395,7 +1427,7 @@ dbg_zone_exec_verb( if (!knot_dname_is_subdomain(name, zone->apex->owner)) { *node = NULL; *closest_encloser = NULL; - return KNOT_EBADZONE; + return KNOT_EOUTOFZONE; } knot_node_t *found = NULL, *prev = NULL; @@ -1425,7 +1457,7 @@ dbg_zone_detail("Search function returned %d, node %s (%p) and prev: %s (%p)\n", // there must be at least one node with domain name less or equal to // the searched name if the name belongs to the zone (the root) if (*node == NULL && *previous == NULL) { - return KNOT_EBADZONE; + return KNOT_EOUTOFZONE; } /* This function was quite out of date. The find_in_tree() function diff --git a/src/libknot/zone/zone-contents.h b/src/libknot/zone/zone-contents.h index 19ba512..ab33d5f 100644 --- a/src/libknot/zone/zone-contents.h +++ b/src/libknot/zone/zone-contents.h @@ -110,7 +110,7 @@ uint16_t knot_zone_contents_class(const knot_zone_contents_t *contents); * * \retval KNOT_EOK * \retval KNOT_EINVAL - * \retval KNOT_EBADZONE + * \retval KNOT_EOUTOFZONE * \retval KNOT_EHASH */ int knot_zone_contents_add_node(knot_zone_contents_t *contents, @@ -118,6 +118,18 @@ int knot_zone_contents_add_node(knot_zone_contents_t *contents, uint8_t flags); /*! + * \brief Create new node in the zone contents for given RRSet. + * + * \param contents Zone to add the node into. + * \param rr Given RRSet. + * \param node Returns created node. + * \return + */ +int knot_zone_contents_create_node(knot_zone_contents_t *contents, + const knot_rrset_t *rr, + knot_node_t **node); + +/*! * \brief Adds a RRSet to the given zone. * * Checks if the RRSet belongs to the zone, i.e. if its owner is a subdomain of @@ -137,7 +149,7 @@ int knot_zone_contents_add_node(knot_zone_contents_t *contents, * * \retval KNOT_EOK * \retval KNOT_EINVAL - * \retval KNOT_EBADZONE + * \retval KNOT_EOUTOFZONE */ int knot_zone_contents_add_rrset(knot_zone_contents_t *contents, knot_rrset_t *rrset, @@ -162,7 +174,7 @@ int knot_zone_contents_add_rrsigs(knot_zone_contents_t *contents, * * \retval KNOT_EOK * \retval KNOT_EINVAL - * \retval KNOT_EBADZONE + * \retval KNOT_EOUTOFZONE */ int knot_zone_contents_add_nsec3_node(knot_zone_contents_t *contents, knot_node_t *node, int create_parents, @@ -229,7 +241,7 @@ const knot_node_t *knot_zone_contents_find_node( * \retval KNOT_ZONE_NAME_FOUND if node with owner \a name was found. * \retval KNOT_ZONE_NAME_NOT_FOUND if it was not found. * \retval KNOT_EINVAL - * \retval KNOT_EBADZONE + * \retval KNOT_EOUTOFZONE */ int knot_zone_contents_find_dname(const knot_zone_contents_t *contents, const knot_dname_t *name, diff --git a/src/tests/Makefile.in b/src/tests/Makefile.in index fefb224..1f0e87d 100644 --- a/src/tests/Makefile.in +++ b/src/tests/Makefile.in @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.6 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -53,15 +52,16 @@ host_triplet = @host@ check_PROGRAMS = unittests$(EXEEXT) TESTS = unittests$(EXEEXT) subdir = src/tests -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_ext.m4 \ $(top_srcdir)/m4/ax_gcc_x86_cpuid.m4 \ - $(top_srcdir)/m4/ax_recvmmsg.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/visibility.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/visibility.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -88,6 +88,19 @@ unittests_DEPENDENCIES = ../libknotd.la ../libknots.la @LIBOBJS@ AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent +am__v_lt_1 = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -100,20 +113,16 @@ LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = SOURCES = $(unittests_SOURCES) $(nodist_unittests_SOURCES) DIST_SOURCES = $(unittests_SOURCES) am__can_run_installinfo = \ @@ -123,8 +132,10 @@ am__can_run_installinfo = \ esac ETAGS = etags CTAGS = ctags -am__tty_colors = \ -red=; grn=; lgn=; blu=; std= +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = $(am__tty_colors_dummy) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -433,26 +444,10 @@ unittests$(EXEEXT): $(unittests_OBJECTS) $(unittests_DEPENDENCIES) $(EXTRA_unitt mostlyclean-compile: -rm -f *.$(OBJEXT) - -rm -f common/acl_tests.$(OBJEXT) - -rm -f common/base32hex_tests.$(OBJEXT) - -rm -f common/base64_tests.$(OBJEXT) - -rm -f common/descriptor_tests.$(OBJEXT) - -rm -f common/events_tests.$(OBJEXT) - -rm -f common/fdset_tests.$(OBJEXT) - -rm -f common/hattrie_tests.$(OBJEXT) - -rm -f common/skiplist_tests.$(OBJEXT) - -rm -f common/slab_tests.$(OBJEXT) - -rm -f knot/conf_tests.$(OBJEXT) - -rm -f knot/dthreads_tests.$(OBJEXT) - -rm -f knot/journal_tests.$(OBJEXT) - -rm -f knot/rrl_tests.$(OBJEXT) - -rm -f knot/server_tests.$(OBJEXT) - -rm -f libknot/dname_tests.$(OBJEXT) - -rm -f libknot/rrset_tests.$(OBJEXT) - -rm -f libknot/sign_tests.$(OBJEXT) - -rm -f libknot/wire_tests.$(OBJEXT) - -rm -f libknot/ztree_tests.$(OBJEXT) - -rm -f zscanner/zscanner_tests.$(OBJEXT) + -rm -f common/*.$(OBJEXT) + -rm -f knot/*.$(OBJEXT) + -rm -f libknot/*.$(OBJEXT) + -rm -f zscanner/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @@ -558,6 +553,20 @@ GTAGS: && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags @@ -571,7 +580,7 @@ check-TESTS: $(TESTS) if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ - if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ @@ -806,8 +815,8 @@ uninstall-am: .MAKE: all check check-am install install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ - clean-checkPROGRAMS clean-generic clean-libtool ctags \ - distclean distclean-compile distclean-generic \ + clean-checkPROGRAMS clean-generic clean-libtool cscopelist \ + ctags distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ diff --git a/src/tests/common/acl_tests.c b/src/tests/common/acl_tests.c index f8ab106..e115dc4 100644 --- a/src/tests/common/acl_tests.c +++ b/src/tests/common/acl_tests.c @@ -145,7 +145,7 @@ static int acl_tests_run(int argc, char *argv[]) acl_create(acl, &match_pf4, ACL_ACCEPT, 0, 0); /* Make decoy. */ acl_key_t *rval = NULL; ret = acl_match(acl, &test_pf4, &rval); - ok(rval->val == sval, "acl: search for preferred node"); + ok(rval && rval->val == sval, "acl: search for preferred node"); // 19. Scenario after truncating ok(acl_truncate(acl) == ACL_ACCEPT, "acl: truncate"); diff --git a/src/tests/common/descriptor_tests.c b/src/tests/common/descriptor_tests.c index 9d752f5..4f1fb6c 100644 --- a/src/tests/common/descriptor_tests.c +++ b/src/tests/common/descriptor_tests.c @@ -36,7 +36,7 @@ unit_api descriptor_tests_api = { static int descriptor_tests_count(int argc, char *argv[]) { - return 68; + return 81; } static int descriptor_tests_run(int argc, char *argv[]) @@ -230,5 +230,40 @@ static int descriptor_tests_run(int argc, char *argv[]) ret = knot_rrclass_from_string("CLASS65536", &num); cmp_ok(ret, "==", -1, "get CLASS65536 num ret"); + // Get obsolete descriptor: + // 30. TYPE0 + descr = get_obsolete_rdata_descriptor(0); + ok(descr->type_name == 0, "get TYPE0 descriptor name"); + cmp_ok(descr->block_types[0], "==", KNOT_RDATA_WF_REMAINDER, + "get TYPE0 descriptor 1. item type"); + cmp_ok(descr->block_types[1], "==", KNOT_RDATA_WF_END, + "get TYPE0 descriptor 2. item type"); + + // 31. MD + descr = get_obsolete_rdata_descriptor(3); + ok(strcmp(descr->type_name, "MD") == 0, "get MD descriptor name"); + cmp_ok(descr->block_types[0], "==", KNOT_RDATA_WF_COMPRESSED_DNAME, + "get A descriptor 1. item type"); + cmp_ok(descr->block_types[1], "==", KNOT_RDATA_WF_END, + "get A descriptor 2. item type"); + + // 32. NXT + descr = get_obsolete_rdata_descriptor(30); + ok(strcmp(descr->type_name, "NXT") == 0, "get NXT descriptor name"); + cmp_ok(descr->block_types[0], "==", KNOT_RDATA_WF_COMPRESSED_DNAME, + "get CNAME descriptor 1. item type"); + cmp_ok(descr->block_types[1], "==", KNOT_RDATA_WF_REMAINDER, + "get CNAME descriptor 2. item type"); + cmp_ok(descr->block_types[2], "==", KNOT_RDATA_WF_END, + "get CNAME descriptor 3. item type"); + + // 33. TYPE38 (A6) + descr = get_obsolete_rdata_descriptor(38); + ok(descr->type_name == 0, "get TYPE38 descriptor name"); + cmp_ok(descr->block_types[0], "==", KNOT_RDATA_WF_REMAINDER, + "get TYPE38 descriptor 1. item type"); + cmp_ok(descr->block_types[1], "==", KNOT_RDATA_WF_END, + "get TYPE38 descriptor 2. item type"); + return 0; } diff --git a/src/tests/common/events_tests.c b/src/tests/common/events_tests.c index 713bb5a..6ceb17a 100644 --- a/src/tests/common/events_tests.c +++ b/src/tests/common/events_tests.c @@ -51,7 +51,11 @@ void* term_thr(void *arg) static int events_tests_count(int argc, char *argv[]) { - return 9 + 11; + int count = 9 + 10; +#ifdef ENABLE_TIMED_TESTS + count += 1; +#endif + return count; } static int events_tests_run(int argc, char *argv[]) @@ -137,6 +141,7 @@ static int events_tests_run(int argc, char *argv[]) gettimeofday(&rt, 0); ok(e != 0, "evsched: received valid event"); +#ifdef ENABLE_TIMED_TESTS // 4. Check receive time double passed = (rt.tv_sec - st.tv_sec) * 1000; passed += (rt.tv_usec - st.tv_usec) / 1000; @@ -145,6 +150,7 @@ static int events_tests_run(int argc, char *argv[]) int in_bounds = (passed >= lb) && (passed <= ub); ok(in_bounds, "evsched: receive time %.1lfms is in <%.1lf,%.1lf>", passed, lb, ub); +#endif // 5. Check data ok(e->data == (void*)0xcafe, "evsched: received data is valid"); diff --git a/src/tests/common/fdset_tests.c b/src/tests/common/fdset_tests.c index e8b9d73..f5d351c 100644 --- a/src/tests/common/fdset_tests.c +++ b/src/tests/common/fdset_tests.c @@ -121,12 +121,11 @@ static int fdset_tests_run(int argc, char *argv[]) pthread_create(&t, 0, thr_action, &fds[1]); /* 4. Watch fdset. */ - int nfds = poll(set.pfd, set.n, 2000); + int nfds = poll(set.pfd, set.n, 60 * 1000); gettimeofday(&te, 0); size_t diff = timeval_diff(&ts, &te); - ok(nfds > 0 && diff > 99 && diff < 10000, - "fdset: poll returned %d events in %zu ms", nfds, diff); + ok(nfds > 0, "fdset: poll returned %d events in %zu ms", nfds, diff); /* 5. Prepare event set. */ ok(set.pfd[0].revents & POLLIN, "fdset: pipe is active"); diff --git a/src/tests/knot/dthreads_tests.c b/src/tests/knot/dthreads_tests.c index 247f66e..e562648 100644 --- a/src/tests/knot/dthreads_tests.c +++ b/src/tests/knot/dthreads_tests.c @@ -107,7 +107,9 @@ static inline int dt_test_repurpose(dt_unit_t *unit, int id) /*! \brief Cancel single thread. */ static inline int dt_test_cancel(dt_unit_t *unit, int id) { - return dt_cancel(unit->threads[id]) == 0; + int ret = dt_cancel(unit->threads[id]); + ret |= dt_signalize(unit->threads[id], SIGALRM); + return ret == 0; /* Both succeeded. */ } /*! \brief Reanimate dead threads. */ diff --git a/src/zscanner/scanner_functions.c b/src/zscanner/scanner_functions.c index 94a42da..7c68348 100644 --- a/src/zscanner/scanner_functions.c +++ b/src/zscanner/scanner_functions.c @@ -920,7 +920,6 @@ static int32_t get_block_length(const uint8_t *data, switch (type) { case KNOT_RDATA_WF_COMPRESSED_DNAME: case KNOT_RDATA_WF_UNCOMPRESSED_DNAME: - case KNOT_RDATA_WF_LITERAL_DNAME: ret = get_dname_length(data + offset, data_len - offset); if (ret > 0) { diff --git a/src/zscanner/test/cases/06-0_INCLUDE.in b/src/zscanner/test/cases/06-0_INCLUDE.in index d8f4d27..2b85692 100644 --- a/src/zscanner/test/cases/06-0_INCLUDE.in +++ b/src/zscanner/test/cases/06-0_INCLUDE.in @@ -19,10 +19,10 @@ $INCLUDE \./includes/include2 _a_.-b-c-./d/. ; Slashed character in file name, $INCLUDE ./includes/include2 \0320\ \\\"\.\@\*.tld. ; Origin with special chars 5. NS @ -$INCLUDE /home/ondrej/Projects/knot/src/zscanner/test/cases/includes/include2 ; Absolute path without origin +$INCLUDE /home/vavrusam/knot/src/zscanner/test/cases/includes/include2 ; Absolute path without origin 6. NS @ -$INCLUDE /home/ondrej/Projects/knot/src/zscanner/test/cases/includes/include2 tld. ; Absolute path with origin +$INCLUDE /home/vavrusam/knot/src/zscanner/test/cases/includes/include2 tld. ; Absolute path with origin 7. NS @ ; KO diff --git a/src/zscanner/test/cases/06-3_INCLUDE.in b/src/zscanner/test/cases/06-3_INCLUDE.in index 3dc9ba8..0f59e45 100644 --- a/src/zscanner/test/cases/06-3_INCLUDE.in +++ b/src/zscanner/test/cases/06-3_INCLUDE.in @@ -2,4 +2,4 @@ $ORIGIN . $TTL 1 ; KO -$INCLUDE /home/ondrej/Projects/knot/src/zscanner/test/cases/ ; Given file is a directory +$INCLUDE /home/vavrusam/knot/src/zscanner/test/cases/ ; Given file is a directory diff --git a/src/zscanner/test/cases/06-4_INCLUDE.in b/src/zscanner/test/cases/06-4_INCLUDE.in index f4e3c51..80b9ef1 100644 --- a/src/zscanner/test/cases/06-4_INCLUDE.in +++ b/src/zscanner/test/cases/06-4_INCLUDE.in @@ -2,4 +2,4 @@ $ORIGIN . $TTL 1 ; KO -$INCLUDE /home/ondrej/Projects/knot/src/zscanner/test/cases/zscanner_tests/file-doesnt-exist ; File doesn't exist +$INCLUDE /home/vavrusam/knot/src/zscanner/test/cases/zscanner_tests/file-doesnt-exist ; File doesn't exist diff --git a/src/zscanner/test/run_tests.sh b/src/zscanner/test/run_tests.sh index ccac549..682d50a 100644 --- a/src/zscanner/test/run_tests.sh +++ b/src/zscanner/test/run_tests.sh @@ -1,7 +1,7 @@ #!/bin/sh -TESTS_DIR="/home/ondrej/Projects/knot/src/zscanner/test/cases" -OUTS_DIR="/home/ondrej/Projects/knot/src/zscanner/test/.out" +TESTS_DIR="/home/vavrusam/knot/src/zscanner/test/cases" +OUTS_DIR="/home/vavrusam/knot/src/zscanner/test/.out" TEST_BIN="./../zscanner-tool -m 2" # Delete temporary output directory at exit. |