From: Otto Moerbeek Date: Tue, 26 Feb 2019 12:14:07 +0000 (+0100) Subject: Autotool scaffolding for using dnstap messages in recursor X-Git-Tag: dnsdist-1.4.0-beta1~13^2~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7badc3660adad14744ce68dc6512f61ed5ff483a;p=thirdparty%2Fpdns.git Autotool scaffolding for using dnstap messages in recursor --- diff --git a/pdns/recursordist/.gitignore b/pdns/recursordist/.gitignore index b7636f11b6..4f3f8a2199 100644 --- a/pdns/recursordist/.gitignore +++ b/pdns/recursordist/.gitignore @@ -52,3 +52,5 @@ html-docs doctrees latex PowerDNS-Recursor.pdf +/*.pb.cc +/*.pb.h diff --git a/pdns/recursordist/Makefile.am b/pdns/recursordist/Makefile.am index 92c8ae5a27..191abb19f3 100644 --- a/pdns/recursordist/Makefile.am +++ b/pdns/recursordist/Makefile.am @@ -352,11 +352,23 @@ if HAVE_PROTOC dnsmessage.pb.cc: dnsmessage.proto $(AM_V_GEN)$(PROTOC) --cpp_out=./ $< +if DNSTAP_ENABLED +dnstap.pb.cc: dnstap.proto + $(AM_V_GEN)$(PROTOC) -I$(srcdir) --cpp_out=./ $< +endif + + BUILT_SOURCES += dnsmessage.pb.cc pdns_recursor_LDADD += $(PROTOBUF_LIBS) nodist_pdns_recursor_SOURCES = dnsmessage.pb.cc dnsmessage.pb.h pdns_recursor.$(OBJEXT): dnsmessage.pb.cc +if DNSTAP_ENABLED +BUILT_SOURCES += dnsmessage.pb.cc +nodist_pdns_recursor_SOURCES += dnstap.pb.cc dnstap.pb.h +pdns_recursor.$(OBJEXT): dnstap.pb.cc +endif + nodist_testrunner_SOURCES = dnsmessage.pb.cc dnsmessage.pb.h testrunner_LDADD += $(PROTOBUF_LIBS) testrunner$(OBJEXT): dnsmessage.pb.cc @@ -368,6 +380,11 @@ pdns_recursor_SOURCES += \ endif +if DNSTAP_ENABLED +pdns_recursor_SOURCES += \ + dnstap.cc dnstap.hh +endif + rec_control_SOURCES = \ arguments.cc arguments.hh \ dnsname.hh dnsname.cc \ diff --git a/pdns/recursordist/configure.ac b/pdns/recursordist/configure.ac index ce066fb7a3..3d75936d3e 100644 --- a/pdns/recursordist/configure.ac +++ b/pdns/recursordist/configure.ac @@ -155,6 +155,8 @@ AC_ARG_WITH([nod-cache-dir], [nodcachedir="$withval"] ) +PDNS_ENABLE_DNSTAP + AC_MSG_CHECKING([whether we will enable compiler security checks]) AC_ARG_ENABLE([hardening], [AS_HELP_STRING([--disable-hardening], [disable compiler security checks @<:@default=no@:>@])], @@ -251,5 +253,9 @@ AM_COND_IF([NOD_ENABLED], [AC_MSG_NOTICE([nod: yes])], [AC_MSG_NOTICE([nod: no])] ) +AM_COND_IF([DNSTAP_ENABLED], + [AC_MSG_NOTICE([dnstap: yes])], + [AC_MSG_NOTICE([dnstap: no])] +) AC_MSG_NOTICE([Context library: $pdns_context_library]) AC_MSG_NOTICE([]) diff --git a/pdns/recursordist/dnstap.cc b/pdns/recursordist/dnstap.cc new file mode 120000 index 0000000000..06c8e377ab --- /dev/null +++ b/pdns/recursordist/dnstap.cc @@ -0,0 +1 @@ +../dnstap.cc \ No newline at end of file diff --git a/pdns/recursordist/dnstap.hh b/pdns/recursordist/dnstap.hh new file mode 120000 index 0000000000..9fd70f0c00 --- /dev/null +++ b/pdns/recursordist/dnstap.hh @@ -0,0 +1 @@ +../dnstap.hh \ No newline at end of file diff --git a/pdns/recursordist/dnstap.proto b/pdns/recursordist/dnstap.proto new file mode 120000 index 0000000000..6b6dfbd10e --- /dev/null +++ b/pdns/recursordist/dnstap.proto @@ -0,0 +1 @@ +../dnstap.proto \ No newline at end of file diff --git a/pdns/recursordist/m4/pdns_enable_dnstap.m4 b/pdns/recursordist/m4/pdns_enable_dnstap.m4 new file mode 100644 index 0000000000..d20f468ce2 --- /dev/null +++ b/pdns/recursordist/m4/pdns_enable_dnstap.m4 @@ -0,0 +1,19 @@ +AC_DEFUN([PDNS_ENABLE_DNSTAP],[ + AC_MSG_CHECKING([whether to enable logging of outgoing queries using dnstap]) + + AC_ARG_ENABLE([dnstap], + AS_HELP_STRING([--enable-dnstap], + [enable logging of outgoing queries using dnstap @<:@default=no@:>@] + ), + [enable_dnstap=$enableval], + [enable_dnstap=no] + ) + + AS_IF([test "x$enable_dnstap" != "xno"], + [AC_DEFINE([DNSTAP_ENABLED], [1], [Define to 1 if dnstap is enabled])] + ) + + AM_CONDITIONAL([DNSTAP_ENABLED], [test "x$enable_dnstap" != "xno"]) + + AC_MSG_RESULT([$enable_dnstap]) +])