BuildRequires: lua-devel
BuildRequires: bison
BuildRequires: openssl-devel
+BuildRequires: protobuf-devel
+BuildRequires: protobuf-compiler
Provides: powerdns = %{version}-%{release}
%global backends %{backends} bind
--with-lua \
--with-dynmodules='%{backends} random' \
--enable-tools \
- --without-protobuf \
--enable-unit-tests \
--enable-systemd
%{_bindir}/calidns
%{_bindir}/dnsbulktest
%{_bindir}/dnsgram
+%{_bindir}/dnspcap2protobuf
%{_bindir}/dnsreplay
%{_bindir}/dnsscan
%{_bindir}/dnsscope
%{_mandir}/man1/calidns.1.gz
%{_mandir}/man1/dnsbulktest.1.gz
%{_mandir}/man1/dnsgram.1.gz
+%{_mandir}/man1/dnspcap2protobuf.1.gz
%{_mandir}/man1/dnsreplay.1.gz
%{_mandir}/man1/dnsscan.1.gz
%{_mandir}/man1/dnsscope.1.gz
Standards-Version: 3.9.8
Maintainer: PowerDNS Autobuilder <powerdns.support@powerdns.com>
Origin: PowerDNS
-Build-Depends: debhelper (>= 9~), dh-autoreconf, dh-systemd, po-debconf, libtool, flex, bison, libmysqlclient-dev, libpq-dev, libssl-dev, libgdbm-dev, libldap2-dev, libsqlite3-dev, dpkg-dev (>= 1.17.0~), libboost-dev, libboost-serialization-dev, libboost-program-options-dev, libboost-test-dev, autotools-dev, automake, autoconf, liblua5.2-dev, pkg-config, ragel, libgmp-dev, libbotan1.10-dev, libcurl4-openssl-dev, libzmq-dev, libyaml-cpp-dev (>= 0.5), libgeoip-dev, libopendbx1-dev, libcdb-dev, unixodbc-dev (>= 2.3.1) @LIBSYSTEMDDEV@
+Build-Depends: debhelper (>= 9~), dh-autoreconf, dh-systemd, po-debconf, libtool, flex, bison, libmysqlclient-dev, libpq-dev, libssl-dev, libgdbm-dev, libldap2-dev, libsqlite3-dev, dpkg-dev (>= 1.17.0~), libboost-dev, libboost-serialization-dev, libboost-program-options-dev, libboost-test-dev, autotools-dev, automake, autoconf, liblua5.2-dev, pkg-config, ragel, libgmp-dev, libbotan1.10-dev, libcurl4-openssl-dev, libzmq-dev, libyaml-cpp-dev (>= 0.5), libgeoip-dev, libopendbx1-dev, libcdb-dev, unixodbc-dev (>= 2.3.1), libprotobuf-dev, protobuf-compiler @LIBSYSTEMDDEV@
Homepage: http://www.powerdns.com/
Package: pdns-server
usr/bin/calidns
usr/bin/dnsbulktest
usr/bin/dnsgram
+usr/bin/dnspcap2protobuf
usr/bin/dnsreplay
usr/bin/dnsscan
usr/bin/dnsscope
debian/tmp/usr/share/man/man1/calidns.1
debian/tmp/usr/share/man/man1/dnsbulktest.1
debian/tmp/usr/share/man/man1/dnsgram.1
+debian/tmp/usr/share/man/man1/dnspcap2protobuf.1
debian/tmp/usr/share/man/man1/dnsreplay.1
debian/tmp/usr/share/man/man1/dnsscan.1
debian/tmp/usr/share/man/man1/dnsscope.1
--with-pgsql-includes=`pg_config --includedir` \
--enable-botan1.10 \
--enable-tools \
- --without-protobuf \
--enable-unit-tests \
$(ENABLE_SYSTEMD)
dnswasher.1 \
dumresp.1 \
ixplore.1 \
- pdns_notify.1 \
nproxy.1 \
nsec3dig.1 \
+ pdns_notify.1 \
saxfr.1 \
sdig.1
dnstcpbench.1
endif
+
+if HAVE_PROTOBUF
+if HAVE_PROTOC
+MANPAGES_TARGET_TOOLS += dnspcap2protobuf.1
+endif
+endif
+
MANPAGES_TARGET_DNSDIST = dnsdist.1
MANPAGES_TARGET_RECURSOR = pdns_recursor.1 \
--- /dev/null
+% DNSPCAP2PROTOBUF(1)
+% PowerDNS.com BV
+% June 2016
+
+# NAME
+**dnspcap2protobuf** - A tool to convert PCAPs of DNS traffic to PowerDNS Protobuf
+
+# SYNOPSIS
+**dnspcap2protobuf** *PCAPFILE* *OUTFILE*
+
+# DESCRIPTION
+**dnspcap2protobuf** reads the PCAP file *PCAPFILE* for DNS queries and responses
+and writes these in the PowerDNS protobuf format to *OUTFILE*.
+
+# OPTIONS
+--help
+: Show a summary of options.
+
+--version
+: Display the version of dnspcap2protobuf
if HAVE_PROTOBUF
if HAVE_PROTOC
-EXTRA_PROGRAMS += dnspcap2protobuf
+bin_PROGRAMS += dnspcap2protobuf
dnsmessage.pb.cc: dnsmessage.proto
$(AM_V_GEN)$(PROTOC) --cpp_out=./ $<
$(LIBDL)
if HAVE_PROTOBUF
+if HAVE_PROTOC
nodist_testrunner_SOURCES = \
dnsmessage.pb.cc dnsmessage.pb.h
testrunner_LDADD += \
$(PROTOBUF_LIBS)
endif
+endif
if PKCS11
testrunner_SOURCES += pkcs11signers.cc pkcs11signers.hh
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include <boost/uuid/uuid.hpp>
#include <boost/uuid/uuid_generators.hpp>
{
cerr<<"Error parsing response records: "<<e.what()<<endl;
}
+
+void usage()
+{
+ cerr<<"This program reads DNS queries and responses from a PCAP file and stores them into our protobuf format."<<endl;
+ cerr<<"Usage: dnspcap2protobuf PCAPFILE OUTFILE"<<endl;
+}
+
int main(int argc, char **argv)
{
+ for(int n=1 ; n < argc; ++n) {
+ if ((string) argv[n] == "--help") {
+ usage();
+ return EXIT_SUCCESS;
+ }
+
+ if ((string) argv[n] == "--version") {
+ cerr<<"dnspcap2protobuf "<<VERSION<<endl;
+ return EXIT_SUCCESS;
+ }
+ }
+
if(argc < 3) {
- cerr<<"This program reads DNS queries and responses from a PCAP file and stores them into our protobuf format."<<endl;
- cerr<<"Usage: "<<argv[0]<<" <PCAP file> <out file>"<<endl;
+ usage();
exit(EXIT_FAILURE);
}
+
PcapPacketReader pr(argv[1]);
FILE* fp = fopen(argv[2], "w");