]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Autotool scaffolding for using dnstap messages in recursor
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 26 Feb 2019 12:14:07 +0000 (13:14 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 26 Feb 2019 12:14:07 +0000 (13:14 +0100)
pdns/recursordist/.gitignore
pdns/recursordist/Makefile.am
pdns/recursordist/configure.ac
pdns/recursordist/dnstap.cc [new symlink]
pdns/recursordist/dnstap.hh [new symlink]
pdns/recursordist/dnstap.proto [new symlink]
pdns/recursordist/m4/pdns_enable_dnstap.m4 [new file with mode: 0644]

index b7636f11b6c8379277ff20e97b344a8a97004713..4f3f8a2199f2db6ec07d1071eab4b489fcfc6512 100644 (file)
@@ -52,3 +52,5 @@ html-docs
 doctrees
 latex
 PowerDNS-Recursor.pdf
+/*.pb.cc
+/*.pb.h
index 92c8ae5a27ed0b0eb3ae11fd64c662c64771f1e7..191abb19f3457b206d0f77f8b6c6ab69098c193b 100644 (file)
@@ -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 \
index ce066fb7a31c9e139f60106c3ae3ec472e5b34b8..3d75936d3e49b88ca44febc98bd76bb7fc16eded 100644 (file)
@@ -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 (symlink)
index 0000000..06c8e37
--- /dev/null
@@ -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 (symlink)
index 0000000..9fd70f0
--- /dev/null
@@ -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 (symlink)
index 0000000..6b6dfbd
--- /dev/null
@@ -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 (file)
index 0000000..d20f468
--- /dev/null
@@ -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])
+])