]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Remove left-over protobuf from build files, CI, documentation
authorRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 9 Dec 2020 10:48:30 +0000 (11:48 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 5 Jan 2021 09:25:41 +0000 (10:25 +0100)
40 files changed:
.circleci/config.yml
.github/workflows/codeql-analysis.yml
Dockerfile-recursor
build-scripts/travis.sh
builder-support/debian/authoritative/debian-buster/control
builder-support/debian/authoritative/debian-buster/rules
builder-support/debian/authoritative/debian-jessie/control
builder-support/debian/authoritative/debian-jessie/rules
builder-support/debian/authoritative/debian-stretch/control
builder-support/debian/authoritative/debian-stretch/rules
builder-support/debian/dnsdist/debian-buster/control
builder-support/debian/dnsdist/debian-buster/rules
builder-support/debian/dnsdist/debian-jessie/control
builder-support/debian/dnsdist/debian-jessie/rules
builder-support/debian/dnsdist/debian-stretch/control
builder-support/debian/dnsdist/debian-stretch/rules
builder-support/debian/recursor/debian-buster/control
builder-support/debian/recursor/debian-buster/rules
builder-support/debian/recursor/debian-jessie/control
builder-support/debian/recursor/debian-jessie/rules
builder-support/debian/recursor/debian-stretch/control
builder-support/debian/recursor/debian-stretch/rules
builder-support/specs/dnsdist.spec
builder-support/specs/pdns-recursor.spec
builder-support/specs/pdns.spec
configure.ac
docs/Makefile.am
m4/pdns_with_protobuf.m4 [deleted file]
pdns/Makefile.am
pdns/dnsdistdist/docs/install.rst
pdns/protobuf.cc [deleted file]
pdns/protobuf.hh [deleted file]
pdns/rec-protobuf.cc [deleted file]
pdns/rec-protobuf.hh [deleted file]
pdns/recursordist/Makefile.am
pdns/recursordist/docs/appendices/compiling.rst
pdns/recursordist/protobuf.cc [deleted symlink]
pdns/recursordist/protobuf.hh [deleted symlink]
pdns/recursordist/rec-protobuf.cc [deleted symlink]
pdns/recursordist/rec-protobuf.hh [deleted symlink]

index 6437a12270350657a533ba913eefeb1ba2af2a9e..e31b470fc2224e17ba33ac1135a6164c6472c3bc 100644 (file)
@@ -181,8 +181,7 @@ commands:
               libssl1.1 \
               libsystemd0 \
               libsodium23 \
-              libfstrm0 \
-              libprotobuf17
+              libfstrm0
 
   install-auth-deps:
     description: Install all libraries needed to run the auth
@@ -223,13 +222,11 @@ commands:
               libfstrm0 \
               libh2o-evloop0.13 \
               liblmdb0 \
-              libprotobuf17 \
               libre2-5 \
               libssl-dev \
               libsystemd0 \
               libsodium23 \
               patch \
-              protobuf-compiler \
               python3-venv
 
   install-ixfrdist-deps:
@@ -441,8 +438,7 @@ commands:
           name: configure
           command: |
             ./configure \
-              --disable-unit-tests \
-              --disable-protobuf
+              --disable-unit-tests
           working_directory: ~/project/pdns/recursordist
       - run:
           name: build docs
@@ -477,8 +473,7 @@ commands:
           name: configure
           command: |
             ./configure \
-              --disable-unit-tests \
-              --disable-protobuf
+              --disable-unit-tests
           working_directory: ~/project/pdns/dnsdistdist
       - run:
           name: build docs
@@ -1051,14 +1046,12 @@ jobs:
             libcap-dev \
             libluajit-5.1-dev \
             libfstrm-dev \
-            libprotobuf-dev \
             libsodium-dev \
             libssl-dev \
             libsystemd-dev \
             libtool \
             make \
             pkg-config \
-            protobuf-compiler \
             ragel \
             systemd \
             python3-venv
@@ -1080,7 +1073,6 @@ jobs:
             --with-libsodium \
             --with-lua=luajit \
             --with-libcap \
-            --with-protobuf=yes \
             --without-net-snmp
           working_directory: ~/project/pdns/recursordist
       - run:
@@ -1112,7 +1104,7 @@ jobs:
           password: $DOCKERHUB_PASSWORD
     steps:
       - add-auth-repo
-      - run: apt-get --no-install-recommends install -qq -y pdns-server pdns-backend-bind pdns-tools daemontools authbind jq libfaketime lua-posix lua-socket moreutils bc python3-venv protobuf-compiler
+      - run: apt-get --no-install-recommends install -qq -y pdns-server pdns-backend-bind pdns-tools daemontools authbind jq libfaketime lua-posix lua-socket moreutils bc python3-venv
       - install-recursor-deps
       - run:
           name: Set up authbind
@@ -1516,7 +1508,6 @@ jobs:
             libfstrm-dev \
             liblmdb-dev \
             libluajit-5.1-dev \
-            libprotobuf-dev \
             libre2-dev \
             libsnmp-dev \
             libsodium-dev \
@@ -1525,7 +1516,6 @@ jobs:
             libtool \
             make \
             pkg-config \
-            protobuf-compiler \
             ragel \
             python3-venv
       - install-coverity-tools
@@ -1549,7 +1539,6 @@ jobs:
             --with-libsodium \
             --with-lua=luajit \
             --with-libcap \
-            --with-protobuf=yes \
             --with-re2
           working_directory: /opt/project/pdns/dnsdistdist
       - run:
@@ -1595,14 +1584,12 @@ jobs:
             libcap-dev \
             libluajit-5.1-dev \
             libfstrm-dev \
-            libprotobuf-dev \
             libsodium-dev \
             libssl-dev \
             libsystemd-dev \
             libtool \
             make \
             pkg-config \
-            protobuf-compiler \
             ragel \
             python3-venv
       - install-coverity-tools
@@ -1623,7 +1610,6 @@ jobs:
             --with-libsodium \
             --with-lua=luajit \
             --with-libcap \
-            --with-protobuf=yes \
             --without-net-snmp
           working_directory: /opt/project/pdns/recursordist
       - run:
@@ -1672,7 +1658,6 @@ jobs:
             libh2o-evloop-dev \
             liblmdb-dev \
             libluajit-5.1-dev \
-            libprotobuf-dev \
             libre2-dev \
             libsnmp-dev \
             libsodium-dev \
@@ -1681,7 +1666,6 @@ jobs:
             libtool \
             make \
             pkg-config \
-            protobuf-compiler \
             ragel \
             systemd \
             python3-venv
@@ -1706,7 +1690,6 @@ jobs:
             --with-libsodium \
             --with-lua=luajit \
             --with-libcap \
-            --with-protobuf=yes \
             --with-re2 \
             --enable-asan \
             --enable-ubsan
index a4ed3ee5779b43f93eff8982beb454d625550c55..041737071dd22c190af64d4a2d598ee8960f10a5 100644 (file)
@@ -88,7 +88,6 @@ jobs:
                 libmaxminddb-dev \
                 libp11-kit-dev \
                 libpq-dev \
-                libprotobuf-dev \
                 libre2-dev \
                 libsnmp-dev \
                 libsodium-dev \
@@ -97,14 +96,13 @@ jobs:
                 libsystemd-dev \
                 libwslay-dev \
                 libyaml-cpp-dev \
-                protobuf-compiler \
                 ragel \
                 unixodbc-dev
 
     - name: Build auth
       run: |
         autoreconf -vfi
-        ./configure --with-modules='bind geoip gmysql godbc gpgsql gsqlite3 ldap lmdb lua2 pipe random remote tinydns' --enable-tools --enable-ixfrdist --enable-dns-over-tls --enable-experimental-pkcs11 --with-libsodium --with-protobuf --enable-lua-records CFLAGS='-O0' CXXFLAGS='-O0'
+        ./configure --with-modules='bind geoip gmysql godbc gpgsql gsqlite3 ldap lmdb lua2 pipe random remote tinydns' --enable-tools --enable-ixfrdist --enable-dns-over-tls --enable-experimental-pkcs11 --with-libsodium --enable-lua-records CFLAGS='-O0' CXXFLAGS='-O0'
         make -j8 -C ext
         make -j8 -C modules
         make -j8 -C pdns
@@ -116,7 +114,6 @@ jobs:
         ./configure --enable-unit-tests --enable-dnstap --enable-dnscrypt --enable-dns-over-tls --enable-dns-over-https LIBS=-lwslay CFLAGS='-O0' CXXFLAGS='-O0'
         make -j8 -C ext/ipcrypt
         make -j8 -C ext/yahttp
-        make dnsmessage.pb.cc dnstap.pb.cc
         make -j4 dnsdist
 
     - name: Build recursor
@@ -125,7 +122,7 @@ jobs:
         autoreconf -vfi
         ./configure --enable-unit-tests --enable-nod --enable-dnstap CFLAGS='-O0' CXXFLAGS='-O0'
         make -j8 -C ext
-        make dnsmessage.pb.cc dnstap.pb.cc htmlfiles.h
+        make htmlfiles.h
         make -j8 pdns_recursor rec_control
 
     - name: Perform CodeQL Analysis
index ccebb237a8892839b8df9c83ef88bd2c14d788fb..6e291c2cd23a16efad0bad3c880927eec41954b8 100644 (file)
@@ -18,7 +18,6 @@ COPY builder-support /source/builder-support
 # TODO: control file is not in tarballs at all right now
 RUN mk-build-deps -i -t 'apt-get -y -o Debug::pkgProblemResolver=yes --no-install-recommends' /source/builder-support/debian/recursor/debian-buster/control && \
     apt-get clean
-# RUN apt-get -y install protobuf-compiler && apt-get clean
 
 COPY pdns /source/pdns
 COPY build-aux /source/build-aux
index d42fe9c7afd117e9dc91a891cf6dd0ebae0a0fd3..512ed945804a6e464ad50a763593c377db6ede87 100755 (executable)
@@ -643,9 +643,7 @@ test_repo(){
 run "sudo apt-get -qq --no-install-recommends install \
   libboost-all-dev \
   libluajit-5.1-dev \
-  libedit-dev \
-  libprotobuf-dev \
-  protobuf-compiler"
+  libedit-dev"
 
 run "cd .."
 run "wget http://ppa.launchpad.net/kalon33/gamesgiroll/ubuntu/pool/main/libs/libsodium/libsodium-dev_1.0.3-1~ppa14.04+1_amd64.deb"
index 4e64ed676da35d5145b165c813f9a37fd3f10d47..803b97b2b09005d6d28623194bc37db9ddfa17fc 100644 (file)
@@ -29,7 +29,6 @@ Build-Depends: autoconf,
                libmaxminddb-dev,
                libp11-kit-dev,
                libpq-dev,
-               libprotobuf-dev,
                libsodium-dev,
                libsqlite3-dev,
                libssl-dev,
@@ -38,7 +37,6 @@ Build-Depends: autoconf,
                libyaml-cpp-dev (>= 0.5),
                pkg-config,
                po-debconf,
-               protobuf-compiler,
                ragel,
                systemd [linux-any],
                unixodbc-dev (>= 2.3.1)
index 600e7412b7fe9f5522042961b47fd342ee60c10a..f49a64bf6d4a9e9f7bf270d45f5e91d7b81775b2 100755 (executable)
@@ -41,7 +41,6 @@ override_dh_auto_configure:
                --enable-tools \
                --with-libsodium \
                --with-lua=luajit \
-               --with-protobuf \
                --enable-unit-tests \
                --enable-experimental-pkcs11 \
                --enable-lua-records \
index dad415498515a438162c2b4b7718404ac82914d3..a5dbd201c583c84882e905dc4b1168166e7b863f 100644 (file)
@@ -27,7 +27,6 @@ Build-Depends: autoconf,
                libmysqlclient-dev,
                libp11-kit-dev,
                libpq-dev,
-               libprotobuf-dev,
                libsodium-dev,
                libsqlite3-dev,
                libssl-dev,
@@ -36,7 +35,6 @@ Build-Depends: autoconf,
                libyaml-cpp-dev (>= 0.5),
                pkg-config,
                po-debconf,
-               protobuf-compiler,
                ragel,
                systemd [linux-any],
                unixodbc-dev (>= 2.3.1)
index 5cc5cbb7c92d5194476907e021c1e06bdf101d17..ee04b0e9eceed2c69e09fb8b135f78a4ecf90594 100755 (executable)
@@ -30,7 +30,6 @@ override_dh_auto_configure:
                --enable-tools \
                --with-libsodium \
                --with-lua=luajit \
-               --with-protobuf \
                --enable-unit-tests \
                --enable-experimental-pkcs11 \
                --enable-lua-records \
index 4e64ed676da35d5145b165c813f9a37fd3f10d47..803b97b2b09005d6d28623194bc37db9ddfa17fc 100644 (file)
@@ -29,7 +29,6 @@ Build-Depends: autoconf,
                libmaxminddb-dev,
                libp11-kit-dev,
                libpq-dev,
-               libprotobuf-dev,
                libsodium-dev,
                libsqlite3-dev,
                libssl-dev,
@@ -38,7 +37,6 @@ Build-Depends: autoconf,
                libyaml-cpp-dev (>= 0.5),
                pkg-config,
                po-debconf,
-               protobuf-compiler,
                ragel,
                systemd [linux-any],
                unixodbc-dev (>= 2.3.1)
index 221f7a98779a09bb956650f52ed2502df7294258..41c7f83b7f2d6543020553f39e355dd5804bb576 100755 (executable)
@@ -40,7 +40,6 @@ override_dh_auto_configure:
                --with-modules="" \
                --enable-tools \
                --with-libsodium \
-               --with-protobuf \
                --enable-unit-tests \
                --enable-experimental-pkcs11 \
                --enable-lua-records \
index 3467f11e896ec3e5b0454e103c79b90107c9e449..deb19af48600502bc002f0f97fc75bc7039295c5 100644 (file)
@@ -14,7 +14,6 @@ Build-Depends: debhelper (>= 10),
                liblmdb-dev,
                libluajit-5.1-dev [!arm64],
                liblua5.3-dev [arm64],
-               libprotobuf-dev,
                libre2-dev,
                libsnmp-dev,
                libsodium-dev,
@@ -22,7 +21,6 @@ Build-Depends: debhelper (>= 10),
                libsystemd-dev [linux-any],
                libwslay-dev,
                pkg-config,
-               protobuf-compiler,
                ragel,
                systemd [linux-any]
 Standards-Version: 4.1.5
index 2f2d0e303e14b789b3978a5096f497e62d9176ac..3207e619bde2a09a04f98540563fd9596ab9a64a 100755 (executable)
@@ -57,7 +57,6 @@ override_dh_auto_configure:
          --with-libsodium \
          --with-re2 \
          --with-ebpf \
-         --with-protobuf \
          --with-service-user='_dnsdist' \
          --with-service-group='_dnsdist' \
          $(CONFIGURE_ARGS)
index 9200f31df80ac97d02334b13683ab0da15108724..5845006dd099c5318a1415ed84a65af4c0b9952f 100644 (file)
@@ -10,13 +10,11 @@ Build-Depends: debhelper (>= 9~),
                libcdb-dev,
                libedit-dev,
                libluajit-5.1-dev,
-               libprotobuf-dev,
                libre2-dev,
                libsodium-dev,
                libssl-dev,
                libsystemd-dev [linux-any],
                pkg-config,
-               protobuf-compiler,
                ragel,
                systemd [linux-any]
 Standards-Version: 4.1.0
index 053c23e5ccb8a20d3f48829c3346cee4033f9b10..9677fb2d02189619c3ee5f8d3d998499297d6b33 100755 (executable)
@@ -46,7 +46,6 @@ override_dh_auto_configure:
          --with-re2 \
          --with-ebpf \
          --with-lua=luajit \
-         --with-protobuf \
          --with-service-user='_dnsdist' \
          --with-service-group='_dnsdist' \
          $(CONFIGURE_ARGS)
index 63d7b00f4174a9b0887bbd84ea13d4e47136e6bc..cba9cc1439eeadb8de85cfd967b695422b8116ea 100644 (file)
@@ -13,13 +13,11 @@ Build-Depends: debhelper (>= 10),
                liblmdb-dev,
                libluajit-5.1-dev [!arm64],
                liblua5.3-dev [arm64],
-               libprotobuf-dev,
                libre2-dev,
                libsodium-dev,
                libssl-dev,
                libsystemd-dev [linux-any],
                pkg-config,
-               protobuf-compiler,
                ragel,
                systemd [linux-any]
 Standards-Version: 4.1.0
index 55eebc3dcfcb3c63d70bb3d5bd6618ebdd79681b..004cb4042ac40fefed938fb79e1e7654143aca9d 100755 (executable)
@@ -56,7 +56,6 @@ override_dh_auto_configure:
          --with-libsodium \
          --with-re2 \
          --with-ebpf \
-         --with-protobuf \
          --with-service-user='_dnsdist' \
          --with-service-group='_dnsdist' \
          $(CONFIGURE_ARGS)
index df21562b1fc617f9ce326362ba5eb854decc27f0..8634bf4a701f505b7dca6a7a921d5d6547a36f6d 100644 (file)
@@ -10,13 +10,11 @@ Build-Depends: debhelper (>= 10),
                libcap-dev,
                libluajit-5.1-dev [!arm64],
                liblua5.3-dev [arm64],
-               libprotobuf-dev,
                libfstrm-dev,
                libsodium-dev,
                libssl-dev,
                libsystemd-dev [linux-any],
                pkg-config,
-               protobuf-compiler,
                ragel,
                systemd [linux-any]
 Vcs-Git: https://anonscm.debian.org/git/pkg-dns/pdns-recursor.git
index 8e48f3eb44fb7bb4871982f7f6b67ff94aaafefc..7a92e43e53f26ae9b98a55e3c5a746f916fc5bf3 100755 (executable)
@@ -36,7 +36,6 @@ override_dh_auto_configure:
                --enable-unit-tests \
                --with-libcap \
                --with-libsodium \
-               --with-protobuf=yes \
                --enable-dnstap \
                --without-net-snmp \
                --disable-silent-rules \
index f2fa238e38b5f03d03e296420bbd8dfbe1e2d459..31ffc2c90cef00360cd2f72a2130103b410efa74 100644 (file)
@@ -9,13 +9,11 @@ Build-Depends: debhelper (>= 9~),
                libboost-all-dev,
                libcap-dev,
                libluajit-5.1-dev,
-               libprotobuf-dev,
                libsnmp-dev,
                libsodium-dev,
                libssl-dev,
                libsystemd-dev [linux-any],
                pkg-config,
-               protobuf-compiler,
                ragel,
                systemd [linux-any]
 Homepage: https://www.powerdns.com/
index 9f8872b027a6d7e839f10af7ba5143af837fc765..1e36211f41909c9d7050797090d62081e822cfb6 100755 (executable)
@@ -30,7 +30,6 @@ override_dh_auto_configure:
                --with-lua=luajit \
                --with-libcap \
                --with-libsodium \
-               --with-protobuf=yes \
                --with-net-snmp \
                --disable-silent-rules \
                --with-service-user=pdns \
index df21562b1fc617f9ce326362ba5eb854decc27f0..8634bf4a701f505b7dca6a7a921d5d6547a36f6d 100644 (file)
@@ -10,13 +10,11 @@ Build-Depends: debhelper (>= 10),
                libcap-dev,
                libluajit-5.1-dev [!arm64],
                liblua5.3-dev [arm64],
-               libprotobuf-dev,
                libfstrm-dev,
                libsodium-dev,
                libssl-dev,
                libsystemd-dev [linux-any],
                pkg-config,
-               protobuf-compiler,
                ragel,
                systemd [linux-any]
 Vcs-Git: https://anonscm.debian.org/git/pkg-dns/pdns-recursor.git
index 8e48f3eb44fb7bb4871982f7f6b67ff94aaafefc..7a92e43e53f26ae9b98a55e3c5a746f916fc5bf3 100755 (executable)
@@ -36,7 +36,6 @@ override_dh_auto_configure:
                --enable-unit-tests \
                --with-libcap \
                --with-libsodium \
-               --with-protobuf=yes \
                --enable-dnstap \
                --without-net-snmp \
                --disable-silent-rules \
index 9ca9884d357af0e6f715e3ff8fcbef9f5a6bdbb3..1a4f0a7ed786887d265c778ca5276549df46017d 100644 (file)
@@ -13,8 +13,6 @@ BuildRequires: openssl-devel
 %if 0%{?el6}
 BuildRequires: boost148-devel
 BuildRequires: lua-devel
-BuildRequires: protobuf-compiler
-BuildRequires: protobuf-devel
 BuildRequires: re2-devel
 %endif
 %if 0%{?suse_version}
@@ -38,8 +36,6 @@ BuildRequires: luajit-devel
 %define lua_implementation luajit
 %endif
 BuildRequires: net-snmp-devel
-BuildRequires: protobuf-compiler
-BuildRequires: protobuf-devel
 BuildRequires: re2-devel
 BuildRequires: systemd
 BuildRequires: systemd-devel
@@ -87,7 +83,6 @@ sed -i '/^ExecStart/ s/dnsdist/dnsdist -u dnsdist -g dnsdist/' dnsdist.service.i
   --without-libsodium \
   --with-re2 \
   --with-net-snmp \
-  --with-protobuf \
   --with-boost=/usr/include/boost148 LIBRARY_PATH=/usr/lib64/boost148
 %endif
 %if 0%{?suse_version}
@@ -95,12 +90,10 @@ sed -i '/^ExecStart/ s/dnsdist/dnsdist -u dnsdist -g dnsdist/' dnsdist.service.i
   --without-libsodium \
   --without-re2 \
   --enable-systemd --with-systemd=/lib/systemd/system \
-  --without-protobuf \
   --without-net-snmp
 %endif
 %if 0%{?rhel} >= 7
   --with-gnutls \
-  --with-protobuf \
   --enable-dnstap \
   --with-lua=%{lua_implementation} \
   --with-libcap \
index 4b033b21349957a720351a5e4d41f1a583ccf0ce..069ce9d245ebfb0649e5cbc7f0e670521362e307 100644 (file)
@@ -33,8 +33,6 @@ BuildRequires: libatomic
 %endif
 
 %if 0%{?rhel} >= 7
-BuildRequires: protobuf-compiler
-BuildRequires: protobuf-devel
 BuildRequires: fstrm-devel
 %endif
 
@@ -73,13 +71,11 @@ package if you need a dns cache for your network.
     --disable-static \
     --enable-unit-tests \
 %if 0%{?rhel} == 6
-    --without-protobuf \
     --with-boost=/usr/include/boost148 LIBRARY_PATH=/usr/lib64/boost148 \
     CPPFLAGS=-D__STDC_FORMAT_MACROS
 
 make %{?_smp_mflags} LIBRARY_PATH=/usr/lib64/boost148
 %else
-    --with-protobuf \
     --enable-dnstap \
     --with-libcap \
     --with-lua=%{lua_implementation} \
index d043b5ffda53c02b9fb5bd170e77885f7c9a7c7b..1475f41e0f07194ea63b93c6e38fb5dc8abad035 100644 (file)
@@ -27,8 +27,6 @@ BuildRequires: systemd
 BuildRequires: systemd-units
 BuildRequires: systemd-devel
 
-BuildRequires: protobuf-devel
-BuildRequires: protobuf-compiler
 BuildRequires: p11-kit-devel
 BuildRequires: libcurl-devel
 BuildRequires: boost-devel
@@ -221,7 +219,6 @@ export CPPFLAGS="-DLDAP_DEPRECATED"
   --enable-ixfrdist
 %else
   --disable-lua-records \
-  --without-protobuf \
   --with-boost=/usr/include/boost148/ LDFLAGS=-L/usr/lib64/boost148 \
   CXXFLAGS=-std=gnu++11 \
   CPPFLAGS="${CPPFLAGS} -D__STDC_FORMAT_MACROS"
@@ -363,14 +360,12 @@ fi
 %{_mandir}/man1/sdig.1.gz
 %{_bindir}/dnsbulktest
 %{_bindir}/dnspcap2calidns
+%{_bindir}/dnspcap2protobuf
 %{_bindir}/dnstcpbench
 %{_mandir}/man1/dnsbulktest.1.gz
 %{_mandir}/man1/dnspcap2calidns.1.gz
-%{_mandir}/man1/dnstcpbench.1.gz
-%if 0%{?rhel} >= 7
-%{_bindir}/dnspcap2protobuf
 %{_mandir}/man1/dnspcap2protobuf.1.gz
-%endif
+%{_mandir}/man1/dnstcpbench.1.gz
 
 %files backend-mysql
 %doc modules/gmysqlbackend/schema.mysql.sql
index 02b76692c41832fc382a2b3be864f67133eae72e..b8e060920af3e3f87c8c41d5924440179d153381 100644 (file)
@@ -234,8 +234,6 @@ PDNS_ENABLE_REMOTEBACKEND_ZEROMQ
 PDNS_ENABLE_TOOLS
 PDNS_ENABLE_IXFRDIST
 
-PDNS_WITH_PROTOBUF
-
 PDNS_WITH_LUA_RECORDS
 
 AM_CONDITIONAL([LDAP], [test "x$needldap" = "xyes"])
index 3a2954be5f69711bc868aaaa19d18fa5f253cc9e..fd55913bfcf2a29e97a333dabac0f5afa3f485ea 100644 (file)
@@ -14,6 +14,7 @@ endif
 
 MANPAGES_TARGET_TOOLS = calidns.1 \
        dnspcap2calidns.1 \
+       dnspcap2protobuf.1 \
        dnsgram.1 \
        dnsreplay.1 \
        dnsscan.1 \
@@ -33,20 +34,13 @@ MANPAGES_TARGET_IXFRDIST = ixfrdist.1 \
 MANPAGES_DIST += $(MANPAGES_TARGET_TOOLS) \
        $(MANPAGES_TARGET_IXFRDIST) \
        dnsbulktest.1 \
-       dnstcpbench.1 \
-       dnspcap2protobuf.1
+       dnstcpbench.1
 
 if HAVE_BOOST_GE_148
 MANPAGES_INSTALL += dnsbulktest.1 \
        dnstcpbench.1
 endif
 
-if HAVE_PROTOBUF
-if HAVE_PROTOC
-MANPAGES_INSTALL += dnspcap2protobuf.1
-endif
-endif
-
 if TOOLS
 MANPAGES_INSTALL += $(MANPAGES_TARGET_TOOLS)
 endif
diff --git a/m4/pdns_with_protobuf.m4 b/m4/pdns_with_protobuf.m4
deleted file mode 100644 (file)
index f106c58..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-AC_DEFUN([PDNS_WITH_PROTOBUF], [
-  AC_MSG_CHECKING([if we need to link in protobuf])
-  AC_ARG_WITH([protobuf],
-    AS_HELP_STRING([--with-protobuf],[enable protobuf support @<:@default=auto@:>@]),
-    [with_protobuf=$withval],
-    [with_protobuf=auto],
-  )
-  AC_MSG_RESULT([$with_protobuf])
-
-  AS_IF([test "x$with_protobuf" != "xno"], [
-    AS_IF([test "x$with_protobuf" = "xyes" -o "x$with_protobuf" = "xauto"], [
-      PKG_CHECK_MODULES([PROTOBUF], [protobuf], [ : ], [ : ])
-      AC_CHECK_PROG([PROTOC], [protoc], [protoc])
-    ])
-  ])
-  AS_IF([test "x$with_protobuf" = "xyes"], [
-    AS_IF([test x"$PROTOBUF_LIBS" = "x"], [
-      AC_MSG_ERROR([Protobuf requested but libraries were not found])
-    ])
-    AS_IF([test x"$PROTOC" = "x"], [
-      AC_MSG_ERROR([Protobuf requested but the protobuf compiler was not found])
-    ])
-  ])
-  AM_CONDITIONAL([HAVE_PROTOBUF], [test x"$PROTOBUF_LIBS" != "x"])
-  AM_CONDITIONAL([HAVE_PROTOC], [test x"$PROTOC" != "x"])
-  AS_IF([test x"$PROTOBUF_LIBS" != "x"], [AC_DEFINE([HAVE_PROTOBUF], [1], [Define if using protobuf.])])
-])
index 6a0c436a1d12fbafd77cce8f375e6fa45b598e63..f2cc0a5dc90762fbda3ceb69f9805db89bbfe2c9 100644 (file)
@@ -70,7 +70,6 @@ CLEANFILES = \
        backends/gsql/gsqlbackend.gcda \
        backends/gsql/gsqlbackend.gcno \
        backends/gsql/gsqlbackend.gcov \
-       dnsmessage.pb.cc dnsmessage.pb.h \
        pdns.conf-dist \
        apidocfiles.h \
        api-swagger.yaml \
index 85344c6df6c89380db094b3c4b83b4c7a7f20ddd..fe299b4b130947459e004f4f6f37ac2ebad40334 100644 (file)
@@ -49,7 +49,7 @@ dnsdist depends on the following libraries:
 * `Lua <http://www.lua.org/>`_ 5.1+ or `LuaJit <http://luajit.org/>`_
 * `Editline (libedit) <http://thrysoee.dk/editline/>`_
 * `libsodium <https://download.libsodium.org/doc/>`_ (optional)
-* `protobuf <https://developers.google.com/protocol-buffers/>`_ (optional)
+* `protobuf <https://developers.google.com/protocol-buffers/>`_ (optional, not needed as of 1.6.0)
 * `re2 <https://github.com/google/re2>`_ (optional)
 
 Should :program:`dnsdist` be run on a system with systemd, it is highly recommended to have
diff --git a/pdns/protobuf.cc b/pdns/protobuf.cc
deleted file mode 100644 (file)
index 31fe67e..0000000
+++ /dev/null
@@ -1,383 +0,0 @@
-
-#include "gettime.hh"
-#include "dnsparser.hh"
-#include "protobuf.hh"
-#include "dnsparser.hh"
-#include "gettime.hh"
-
-void DNSProtoBufMessage::setType(DNSProtoBufMessageType type)
-{
-#ifdef HAVE_PROTOBUF
-  switch(type) {
-  case DNSProtoBufMessage::DNSProtoBufMessageType::Query:
-    d_message.set_type(PBDNSMessage_Type_DNSQueryType);
-    break;
-  case DNSProtoBufMessage::DNSProtoBufMessageType::Response:
-    d_message.set_type(PBDNSMessage_Type_DNSResponseType);
-    break;
-  case DNSProtoBufMessage::DNSProtoBufMessageType::OutgoingQuery:
-    d_message.set_type(PBDNSMessage_Type_DNSOutgoingQueryType);
-    break;
-  case DNSProtoBufMessage::DNSProtoBufMessageType::IncomingResponse:
-    d_message.set_type(PBDNSMessage_Type_DNSIncomingResponseType);
-    break;
-  default:
-    throw std::runtime_error("Unsupported protobuf type: "+std::to_string(type));
-  }
-#endif /* HAVE_PROTOBUF */
-}
-
-DNSProtoBufMessage::DNSProtoBufMessage(DNSProtoBufMessageType type)
-{
-  setType(type);
-}
-
-void DNSProtoBufMessage::setQuestion(const DNSName& qname, uint16_t qtype, uint16_t qclass)
-{
-#ifdef HAVE_PROTOBUF
-  PBDNSMessage_DNSQuestion* question = d_message.mutable_question();
-  if (question) {
-    if(!qname.empty())
-      question->set_qname(qname.toString());
-    question->set_qtype(qtype);
-    question->set_qclass(qclass);
-  }
-#endif /* HAVE_PROTOBUF */
-}
-
-void DNSProtoBufMessage::setBytes(size_t bytes)
-{
-#ifdef HAVE_PROTOBUF
-  d_message.set_inbytes(bytes);
-#endif /* HAVE_PROTOBUF */
-}
-
-void DNSProtoBufMessage::setResponseCode(uint8_t rcode)
-{
-#ifdef HAVE_PROTOBUF
-  PBDNSMessage_DNSResponse* response = d_message.mutable_response();
-  if (response) {
-    response->set_rcode(rcode);
-  }
-#endif /* HAVE_PROTOBUF */
-}
-
-void DNSProtoBufMessage::setNetworkErrorResponseCode()
-{
-#ifdef HAVE_PROTOBUF
-  PBDNSMessage_DNSResponse* response = d_message.mutable_response();
-  if (response) {
-    /* special code meaning 'network error', like a timeout */
-    response->set_rcode(65536);
-  }
-#endif /* HAVE_PROTOBUF */
-}
-
-void DNSProtoBufMessage::setTime(time_t sec, uint32_t usec)
-{
-#ifdef HAVE_PROTOBUF
-  d_message.set_timesec(sec);
-  d_message.set_timeusec(usec);
-#endif /* HAVE_PROTOBUF */
-}
-
-void DNSProtoBufMessage::setQueryTime(time_t sec, uint32_t usec)
-{
-#ifdef HAVE_PROTOBUF
-  PBDNSMessage_DNSResponse* response = d_message.mutable_response();
-  if (response) {
-    response->set_querytimesec(sec);
-    response->set_querytimeusec(usec);
-  }
-#endif /* HAVE_PROTOBUF */
-}
-
-void DNSProtoBufMessage::setEDNSSubnet(const Netmask& subnet, uint8_t mask)
-{
-#ifdef HAVE_PROTOBUF
-  if (!subnet.empty()) {
-    ComboAddress ca(subnet.getNetwork());
-    ca.truncate(mask);
-    if (ca.sin4.sin_family == AF_INET) {
-      d_message.set_originalrequestorsubnet(&ca.sin4.sin_addr.s_addr, sizeof(ca.sin4.sin_addr.s_addr));
-    }
-    else if (ca.sin4.sin_family == AF_INET6) {
-      d_message.set_originalrequestorsubnet(&ca.sin6.sin6_addr.s6_addr, sizeof(ca.sin6.sin6_addr.s6_addr));
-    }
-  }
-#endif /* HAVE_PROTOBUF */
-}
-
-void DNSProtoBufMessage::addTag(const std::string& strValue)
-{
-#ifdef HAVE_PROTOBUF
-
-  PBDNSMessage_DNSResponse* response = d_message.mutable_response();
-  if (!response)
-    return;
-
-  response->add_tags(strValue);
-
-#endif /* HAVE_PROTOBUF */
-}
-
-void DNSProtoBufMessage::addRR(const DNSName& qname, uint16_t uType, uint16_t uClass, uint32_t uTTL, const std::string& strBlob)
-{
-#ifdef HAVE_PROTOBUF
-
-  PBDNSMessage_DNSResponse* response = d_message.mutable_response();
-  if (!response)
-    return;
-  PBDNSMessage_DNSResponse_DNSRR* rr = response->add_rrs();
-  if (rr) {
-    rr->set_name(qname.toString());
-    rr->set_type(uType);
-    rr->set_class_(uClass);
-    rr->set_ttl(uTTL);
-    rr->set_rdata(strBlob.c_str(), strBlob.size());
-  }
-
-#endif /* HAVE_PROTOBUF */
-}
-
-void DNSProtoBufMessage::addRRsFromPacket(const char* packet, const size_t len, bool includeCNAME)
-{
-#ifdef HAVE_PROTOBUF
-  if (len < sizeof(struct dnsheader))
-    return;
-
-  const struct dnsheader* dh = (const struct dnsheader*) packet;
-
-  if (ntohs(dh->ancount) == 0)
-    return;
-
-  if (ntohs(dh->qdcount) == 0)
-    return;
-
-  PBDNSMessage_DNSResponse* response = d_message.mutable_response();
-  if (!response)
-    return;
-
-  std::string packetStr(packet, len);
-  PacketReader pr(packetStr);
-
-  size_t idx = 0;
-  DNSName rrname;
-  uint16_t qdcount = ntohs(dh->qdcount);
-  uint16_t ancount = ntohs(dh->ancount);
-  uint16_t rrtype;
-  uint16_t rrclass;
-  string blob;
-  struct dnsrecordheader ah;
-
-  rrname = pr.getName();
-  rrtype = pr.get16BitInt();
-  rrclass = pr.get16BitInt();
-
-  /* consume remaining qd if any */
-  if (qdcount > 1) {
-    for(idx = 1; idx < qdcount; idx++) {
-      rrname = pr.getName();
-      rrtype = pr.get16BitInt();
-      rrclass = pr.get16BitInt();
-      (void) rrtype;
-      (void) rrclass;
-    }
-  }
-
-  /* parse AN */
-  for (idx = 0; idx < ancount; idx++) {
-    rrname = pr.getName();
-    pr.getDnsrecordheader(ah);
-
-    if (ah.d_type == QType::A || ah.d_type == QType::AAAA) {
-      pr.xfrBlob(blob);
-
-      PBDNSMessage_DNSResponse_DNSRR* rr = response->add_rrs();
-      if (rr) {
-        rr->set_name(rrname.toString());
-        rr->set_type(ah.d_type);
-        rr->set_class_(ah.d_class);
-        rr->set_ttl(ah.d_ttl);
-        rr->set_rdata(blob.c_str(), blob.length());
-      }
-    } else if (ah.d_type == QType::CNAME && includeCNAME) {
-      PBDNSMessage_DNSResponse_DNSRR* rr = response->add_rrs();
-      if (rr) {
-        rr->set_name(rrname.toString());
-        rr->set_type(ah.d_type);
-        rr->set_class_(ah.d_class);
-        rr->set_ttl(ah.d_ttl);
-        DNSName target;
-        pr.xfrName(target, true);
-        rr->set_rdata(target.toString());
-      }
-    }
-    else {
-      pr.xfrBlob(blob);
-    }
-  }
-#endif /* HAVE_PROTOBUF */
-}
-
-void DNSProtoBufMessage::setRequestor(const std::string& requestor)
-{
-#ifdef HAVE_PROTOBUF
-  d_message.set_from(requestor);
-#endif /* HAVE_PROTOBUF */
-}
-
-void DNSProtoBufMessage::setRequestor(const ComboAddress& requestor)
-{
-#ifdef HAVE_PROTOBUF
-  if (requestor.sin4.sin_family == AF_INET) {
-    d_message.set_from(&requestor.sin4.sin_addr.s_addr, sizeof(requestor.sin4.sin_addr.s_addr));
-  }
-  else if (requestor.sin4.sin_family == AF_INET6) {
-    d_message.set_from(&requestor.sin6.sin6_addr.s6_addr, sizeof(requestor.sin6.sin6_addr.s6_addr));
-  }
-#endif /* HAVE_PROTOBUF */
-}
-
-void DNSProtoBufMessage::setRequestorPort(uint16_t port)
-{
-#ifdef HAVE_PROTOBUF
-  d_message.set_fromport(port);
-#endif /* HAVE_PROTOBUF */
-}
-
-void DNSProtoBufMessage::setRequestorId(const std::string& requestorId)
-{
-#ifdef HAVE_PROTOBUF
-  d_message.set_requestorid(requestorId);
-#endif /* HAVE_PROTOBUF */
-}
-
-void DNSProtoBufMessage::setDeviceId(const std::string& deviceId)
-{
-#ifdef HAVE_PROTOBUF
-  d_message.set_deviceid(deviceId);
-#endif /* HAVE_PROTOBUF */
-}
-
-void DNSProtoBufMessage::setDeviceName(const std::string& deviceName)
-{
-#ifdef HAVE_PROTOBUF
-  d_message.set_devicename(deviceName);
-#endif /* HAVE_PROTOBUF */
-}
-
-void DNSProtoBufMessage::setServerIdentity(const std::string& serverId)
-{
-#ifdef HAVE_PROTOBUF
-  d_message.set_serveridentity(serverId);
-#endif /* HAVE_PROTOBUF */
-}
-
-void DNSProtoBufMessage::setResponder(const std::string& responder)
-{
-#ifdef HAVE_PROTOBUF
-  d_message.set_to(responder);
-#endif /* HAVE_PROTOBUF */
-}
-
-void DNSProtoBufMessage::setResponder(const ComboAddress& responder)
-{
-#ifdef HAVE_PROTOBUF
-  if (responder.sin4.sin_family == AF_INET) {
-    d_message.set_to(&responder.sin4.sin_addr.s_addr, sizeof(responder.sin4.sin_addr.s_addr));
-  }
-  else if (responder.sin4.sin_family == AF_INET6) {
-    d_message.set_to(&responder.sin6.sin6_addr.s6_addr, sizeof(responder.sin6.sin6_addr.s6_addr));
-  }
-#endif /* HAVE_PROTOBUF */
-}
-
-void DNSProtoBufMessage::setResponderPort(uint16_t port)
-{
-#ifdef HAVE_PROTOBUF
-  d_message.set_toport(port);
-#endif /* HAVE_PROTOBUF */
-}
-
-void DNSProtoBufMessage::serialize(std::string& data) const
-{
-#ifdef HAVE_PROTOBUF
-  d_message.SerializeToString(&data);
-#endif /* HAVE_PROTOBUF */
-}
-
-std::string DNSProtoBufMessage::toDebugString() const
-{
-#ifdef HAVE_PROTOBUF
-  return d_message.DebugString();
-#else
-  return std::string();
-#endif /* HAVE_PROTOBUF */
-}
-
-#ifdef HAVE_PROTOBUF
-
-void DNSProtoBufMessage::setUUID(const boost::uuids::uuid& uuid)
-{
-  std::string* messageId = d_message.mutable_messageid();
-  messageId->resize(uuid.size());
-  std::copy(uuid.begin(), uuid.end(), messageId->begin());
-}
-
-void DNSProtoBufMessage::setInitialRequestID(const boost::uuids::uuid& uuid)
-{
-  std::string* messageId = d_message.mutable_initialrequestid();
-  messageId->resize(uuid.size());
-  std::copy(uuid.begin(), uuid.end(), messageId->begin());
-}
-
-void DNSProtoBufMessage::updateTime()
-{
-  struct timespec ts;
-  gettime(&ts, true);
-  setTime(ts.tv_sec, ts.tv_nsec / 1000);
-}
-
-void DNSProtoBufMessage::update(const boost::uuids::uuid& uuid, const ComboAddress* requestor, const ComboAddress* responder, bool isTCP, uint16_t id)
-{
-  updateTime();
-  setUUID(uuid);
-  d_message.set_id(ntohs(id));
-
-  if (requestor) {
-    d_message.set_socketfamily(requestor->sin4.sin_family == AF_INET ? PBDNSMessage_SocketFamily_INET : PBDNSMessage_SocketFamily_INET6);
-  }
-  else if (responder) {
-    d_message.set_socketfamily(responder->sin4.sin_family == AF_INET ? PBDNSMessage_SocketFamily_INET : PBDNSMessage_SocketFamily_INET6);
-  }
-
-  d_message.set_socketprotocol(isTCP ? PBDNSMessage_SocketProtocol_TCP : PBDNSMessage_SocketProtocol_UDP);
-
-  if (responder) {
-    setResponder(*responder);
-    setResponderPort(responder->getPort());
-  }
-  if (requestor) {
-    setRequestor(*requestor);
-    setRequestorPort(requestor->getPort());
-  }
-}
-
-
-DNSProtoBufMessage::DNSProtoBufMessage(DNSProtoBufMessageType type, const boost::uuids::uuid& uuid, const ComboAddress* requestor, const ComboAddress* responder, const DNSName& domain, int qtype, uint16_t qclass, uint16_t qid, bool isTCP, size_t bytes)
-{
-  update(uuid, requestor, responder, isTCP, qid);
-
-  setType(type);
-
-  setBytes(bytes);
-  setQuestion(domain, qtype, qclass);
-}
-
-void DNSProtoBufMessage::copyFrom(const DNSProtoBufMessage& msg)
-{
-  d_message.CopyFrom(msg.d_message);
-}
-
-#endif /* HAVE_PROTOBUF */
diff --git a/pdns/protobuf.hh b/pdns/protobuf.hh
deleted file mode 100644 (file)
index 0df3ee6..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * This file is part of PowerDNS or dnsdist.
- * Copyright -- PowerDNS.COM B.V. and its contributors
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * In addition, for the avoidance of any doubt, permission is granted to
- * link this program with OpenSSL and to (re)distribute the binaries
- * produced as the result of such linking.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-#pragma once
-
-#include <cstddef>
-#include <string>
-
-#include "config.h"
-
-#include "dnsname.hh"
-#include "iputils.hh"
-
-#ifdef HAVE_PROTOBUF
-#include <boost/uuid/uuid.hpp>
-#include "dnsmessage.pb.h"
-#endif /* HAVE_PROTOBUF */
-
-class DNSProtoBufMessage
-{
-public:
-  enum DNSProtoBufMessageType {
-    Query,
-    Response,
-    OutgoingQuery,
-    IncomingResponse
-  };
-
-  DNSProtoBufMessage()
-  {
-  }
-
-  DNSProtoBufMessage(DNSProtoBufMessage::DNSProtoBufMessageType type);
-
-  ~DNSProtoBufMessage()
-  {
-  }
-
-  void setType(DNSProtoBufMessage::DNSProtoBufMessageType type);
-  void setQuestion(const DNSName& qname, uint16_t qtype, uint16_t qclass);
-  void setEDNSSubnet(const Netmask& subnet, uint8_t mask=128);
-  void setBytes(size_t bytes);
-  void setTime(time_t sec, uint32_t usec);
-  void updateTime();
-  void setQueryTime(time_t sec, uint32_t usec);
-  void setResponseCode(uint8_t rcode);
-  void setNetworkErrorResponseCode();
-  void addRRsFromPacket(const char* packet, const size_t len, bool includeCNAME=false);
-  void serialize(std::string& data) const;
-  void setRequestor(const std::string& requestor);
-  void setRequestor(const ComboAddress& requestor);
-  void setRequestorPort(uint16_t port);
-  void setResponder(const std::string& responder);
-  void setResponder(const ComboAddress& responder);
-  void setResponderPort(uint16_t port);
-  void setRequestorId(const std::string& requestorId);
-  void setDeviceId(const std::string& deviceId);
-  void setDeviceName(const std::string& deviceName);
-  void setServerIdentity(const std::string& serverId);
-  std::string toDebugString() const;
-  void addTag(const std::string& strValue);
-  void addRR(const DNSName& qame, uint16_t utype, uint16_t uClass, uint32_t uTTl, const std::string& strBlob);
-
-#ifdef HAVE_PROTOBUF
-  DNSProtoBufMessage(DNSProtoBufMessage::DNSProtoBufMessageType type, const boost::uuids::uuid& uuid, const ComboAddress* requestor, const ComboAddress* responder, const DNSName& domain, int qtype, uint16_t qclass, uint16_t qid, bool isTCP, size_t bytes);
-  void update(const boost::uuids::uuid& uuid, const ComboAddress* requestor, const ComboAddress* responder, bool isTCP, uint16_t id);
-  void setUUID(const boost::uuids::uuid& uuid);
-  void setInitialRequestID(const boost::uuids::uuid& uuid);
-  void copyFrom(const DNSProtoBufMessage& msg);
-
-protected:
-  PBDNSMessage d_message;
-#endif /* HAVE_PROTOBUF */
-};
diff --git a/pdns/rec-protobuf.cc b/pdns/rec-protobuf.cc
deleted file mode 100644 (file)
index e5a7f4e..0000000
+++ /dev/null
@@ -1,259 +0,0 @@
-
-#include "config.h"
-#include "rec-protobuf.hh"
-
-#ifdef NOD_ENABLED
-void RecProtoBufMessage::setNOD(bool nod)
-{
-#ifdef HAVE_PROTOBUF
-  d_message.set_newlyobserveddomain(nod);
-#endif /* HAVE_PROTOBUF */  
-}
-
-void RecProtoBufMessage::clearUDR() 
-{
-#ifdef HAVE_PROTOBUF
-  auto response = d_message.mutable_response();
-  if (!response) {
-    return;
-  }
-  const int count = response->rrs_size();
-  for (int idx = 0; idx < count; idx++) {
-    auto rr = response->mutable_rrs(idx);
-    rr->set_udr(false);
-  }
-#endif /* HAVE_PROTOBUF */
-}
-#endif /* NOD_ENABLED */
-
-#ifdef NOD_ENABLED
-void RecProtoBufMessage::addRR(const DNSRecord& record, const std::set<uint16_t>& exportTypes, bool udr)
-#else
-void RecProtoBufMessage::addRR(const DNSRecord& record, const std::set<uint16_t>& exportTypes)
-#endif /* NOD_ENABLED */
-{
-#ifdef HAVE_PROTOBUF
-  PBDNSMessage_DNSResponse* response = d_message.mutable_response();
-  if (!response) {
-    return;
-  }
-
-  if (record.d_place != DNSResourceRecord::ANSWER || record.d_class != QClass::IN) {
-    return;
-  }
-
-  if (exportTypes.count(record.d_type) == 0) {
-    return;
-  }
-
-  PBDNSMessage_DNSResponse_DNSRR* pbRR = response->add_rrs();
-  if (!pbRR) {
-    return;
-  }
-
-  pbRR->set_name(record.d_name.toString());
-  pbRR->set_type(record.d_type);
-  pbRR->set_class_(record.d_class);
-  pbRR->set_ttl(record.d_ttl);
-#ifdef NOD_ENABLED
-  pbRR->set_udr(udr);
-#endif
-
-  switch(record.d_type) {
-  case QType::A:
-  {
-    const auto& content = dynamic_cast<const ARecordContent&>(*(record.d_content));
-    ComboAddress data = content.getCA();
-    pbRR->set_rdata(&data.sin4.sin_addr.s_addr, sizeof(data.sin4.sin_addr.s_addr));
-    break;
-  }
-  case QType::AAAA:
-  {
-    const auto& content = dynamic_cast<const AAAARecordContent&>(*(record.d_content));
-    ComboAddress data = content.getCA();
-    pbRR->set_rdata(&data.sin6.sin6_addr.s6_addr, sizeof(data.sin6.sin6_addr.s6_addr));
-    break;
-  }
-  case QType::CNAME:
-  {
-    const auto& content = dynamic_cast<const CNAMERecordContent&>(*(record.d_content));
-    pbRR->set_rdata(content.getTarget().toString());
-    break;
-  }
-  case QType::TXT:
-  {
-    const auto& content = dynamic_cast<const TXTRecordContent&>(*(record.d_content));
-    pbRR->set_rdata(content.d_text);
-    break;
-  }
-  case QType::NS:
-  {
-    const auto& content = dynamic_cast<const NSRecordContent&>(*(record.d_content));
-    pbRR->set_rdata(content.getNS().toString());
-    break;
-  }
-  case QType::PTR:
-  {
-    const auto& content = dynamic_cast<const PTRRecordContent&>(*(record.d_content));
-    pbRR->set_rdata(content.getContent().toString());
-    break;
-  }
-  case QType::MX:
-  {
-    const auto& content = dynamic_cast<const MXRecordContent&>(*(record.d_content));
-    pbRR->set_rdata(content.d_mxname.toString());
-    break;
-  }
-  case QType::SPF:
-  {
-    const auto& content = dynamic_cast<const SPFRecordContent&>(*(record.d_content));
-    pbRR->set_rdata(content.getText());
-    break;
-  }
-  case QType::SRV:
-  {
-    const auto& content = dynamic_cast<const SRVRecordContent&>(*(record.d_content));
-    pbRR->set_rdata(content.d_target.toString());
-    break;
-  }
-  default:
-    break;
-  }
-#endif /* HAVE_PROTOBUF */
-}
-
-void RecProtoBufMessage::addRRs(const std::vector<DNSRecord>& records, const std::set<uint16_t>& exportTypes)
-{
-  for (const auto& record : records) {
-    addRR(record, exportTypes);
-  }
-}
-
-void RecProtoBufMessage::setAppliedPolicy(const std::string& policy)
-{
-#ifdef HAVE_PROTOBUF
-  PBDNSMessage_DNSResponse* response = d_message.mutable_response();
-  if (response && !policy.empty()) {
-    response->set_appliedpolicy(policy);
-  }
-#endif /* HAVE_PROTOBUF */
-}
-
-void RecProtoBufMessage::setAppliedPolicyType(const DNSFilterEngine::PolicyType& type)
-{
-#ifdef HAVE_PROTOBUF
-  PBDNSMessage_DNSResponse* response = d_message.mutable_response();
-  if (response) {
-    switch(type) {
-    case DNSFilterEngine::PolicyType::None:
-      response->set_appliedpolicytype(PBDNSMessage_PolicyType_UNKNOWN);
-      break;
-    case DNSFilterEngine::PolicyType::QName:
-      response->set_appliedpolicytype(PBDNSMessage_PolicyType_QNAME);
-      break;
-    case DNSFilterEngine::PolicyType::ClientIP:
-      response->set_appliedpolicytype(PBDNSMessage_PolicyType_CLIENTIP);
-      break;
-    case DNSFilterEngine::PolicyType::ResponseIP:
-      response->set_appliedpolicytype(PBDNSMessage_PolicyType_RESPONSEIP);
-      break;
-    case DNSFilterEngine::PolicyType::NSDName:
-      response->set_appliedpolicytype(PBDNSMessage_PolicyType_NSDNAME);
-      break;
-    case DNSFilterEngine::PolicyType::NSIP:
-      response->set_appliedpolicytype(PBDNSMessage_PolicyType_NSIP);
-      break;
-    default:
-      throw std::runtime_error("Unsupported protobuf policy type");
-    }
-  }
-#endif /* HAVE_PROTOBUF */
-}
-
-void RecProtoBufMessage::setAppliedPolicyTrigger(const DNSName& trigger)
-{
-#ifdef HAVE_PROTOBUF
-  PBDNSMessage_DNSResponse* response = d_message.mutable_response();
-  if (response && !trigger.empty()) {
-    response->set_appliedpolicytrigger(trigger.toString());
-  }
-#endif /* HAVE_PROTOBUF */
-}
-
-void RecProtoBufMessage::setAppliedPolicyHit(const string& hit)
-{
-#ifdef HAVE_PROTOBUF
-  PBDNSMessage_DNSResponse* response = d_message.mutable_response();
-  if (response && !hit.empty()) {
-    response->set_appliedpolicyhit(hit);
-  }
-#endif /* HAVE_PROTOBUF */
-}
-
-void RecProtoBufMessage::setPolicyTags(const std::unordered_set<std::string>& policyTags)
-{
-#ifdef HAVE_PROTOBUF
-  PBDNSMessage_DNSResponse* response = d_message.mutable_response();
-  if (response) {
-    for (const auto& tag : policyTags) {
-      response->add_tags(tag);
-    }
-  }
-#endif /* HAVE_PROTOBUF */
-}
-
-void RecProtoBufMessage::addPolicyTag(const std::string& policyTag)
-{
-#ifdef HAVE_PROTOBUF
-  PBDNSMessage_DNSResponse* response = d_message.mutable_response();
-  if (response) {
-    response->add_tags(policyTag);
-  }
-#endif
-}
-
-void RecProtoBufMessage::removePolicyTag(const std::string& policyTag)
-{
-#ifdef HAVE_PROTOBUF
-  PBDNSMessage_DNSResponse* response = d_message.mutable_response();
-  if (response) {
-    const int count = response->tags_size();
-    int keep = 0;
-    for (int idx = 0; idx < count; ++idx) {
-      auto tagp = response->mutable_tags(idx);
-      if (tagp->compare(policyTag) == 0) {        
-      }
-      else {
-        if (keep < idx) {
-          response->mutable_tags()->SwapElements(idx, keep);
-        }
-        ++keep;
-      }
-    }
-    response->mutable_tags()->DeleteSubrange(keep, count - keep);
-  }  
-#endif
-}
-
-std::string RecProtoBufMessage::getAppliedPolicy() const
-{
-  std::string result;
-#ifdef HAVE_PROTOBUF
-  const PBDNSMessage_DNSResponse& response = d_message.response();
-  result = response.appliedpolicy();
-#endif /* HAVE_PROTOBUF */
-  return result;
-}
-
-std::vector<std::string> RecProtoBufMessage::getPolicyTags() const
-{
-  std::vector<std::string> result;
-#ifdef HAVE_PROTOBUF
-  const PBDNSMessage_DNSResponse& response = d_message.response();
-  const int count = response.tags_size();
-  for (int idx = 0; idx < count; idx++) {
-    result.push_back(response.tags(idx));
-  }
-#endif /* HAVE_PROTOBUF */
-  return result;
-}
diff --git a/pdns/rec-protobuf.hh b/pdns/rec-protobuf.hh
deleted file mode 100644 (file)
index c5ec2f0..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * This file is part of PowerDNS or dnsdist.
- * Copyright -- PowerDNS.COM B.V. and its contributors
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * In addition, for the avoidance of any doubt, permission is granted to
- * link this program with OpenSSL and to (re)distribute the binaries
- * produced as the result of such linking.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-#pragma once
-
-#include "protobuf.hh"
-#include "filterpo.hh"
-#include "dnsrecords.hh"
-
-class RecProtoBufMessage: public DNSProtoBufMessage
-{
-public:
-  RecProtoBufMessage(): DNSProtoBufMessage()
-  {
-  }
-
-  RecProtoBufMessage(DNSProtoBufMessage::DNSProtoBufMessageType type): DNSProtoBufMessage(type)
-  {
-  }
-
-#ifdef HAVE_PROTOBUF
-  RecProtoBufMessage(DNSProtoBufMessage::DNSProtoBufMessageType type, const boost::uuids::uuid& uuid, const ComboAddress* requestor, const ComboAddress* responder, const DNSName& domain, int qtype, uint16_t qclass, uint16_t qid, bool isTCP, size_t bytes): DNSProtoBufMessage(type, uuid, requestor, responder, domain, qtype, qclass, qid, isTCP, bytes)
-  {
-  }
-#endif /* HAVE_PROTOBUF */
-
-  void addRRs(const std::vector<DNSRecord>& records, const std::set<uint16_t>& exportTypes);
-#ifdef NOD_ENABLED
-  void setNOD(bool nod);
-  void addRR(const DNSRecord& record, const std::set<uint16_t>& exportTypes, bool udr=false);
-  void clearUDR();
-#else
-  void addRR(const DNSRecord& record, const std::set<uint16_t>& exportTypes);
-#endif /* NOD_ENABLED */
-  void setAppliedPolicy(const std::string& policy);
-  void setAppliedPolicyType(const DNSFilterEngine::PolicyType& policyType);
-  void setAppliedPolicyTrigger(const DNSName& trigger);
-  void setAppliedPolicyHit(const string& hit);
-  void setPolicyTags(const std::unordered_set<std::string>& policyTags);
-  void addPolicyTag(const std::string& policyTag);
-  void removePolicyTag(const std::string& policyTag);
-  std::string getAppliedPolicy() const;
-  std::vector<std::string> getPolicyTags() const;
-};
index 8f7f0ac05a5381f05ad1ca174e0517c94804400f..725cf5c3cbdaed5cac4a6739622c13336c251e39 100644 (file)
@@ -33,8 +33,6 @@ BUILT_SOURCES=htmlfiles.h \
        dnslabeltext.cc
 
 CLEANFILES = htmlfiles.h \
-       dnsmessage.pb.cc \
-       dnsmessage.pb.h \
        recursor.conf-dist
 
 htmlfiles.h: html/*
index 8c1eade07c9e7414188a27257b37d87acd781d1a..6158be4d8fb49a03d7abf5297879fcde79fad4fb 100644 (file)
@@ -64,10 +64,8 @@ Protobuf to emit DNS logs
 ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 The PowerDNS Recursor can log DNS query information over :doc:`Protocol Buffers <../lua-config/protobuf>`.
-To enable this functionality, install the  `protobuf <https://developers.google.com/protocol-buffers/>`_ library and compiler.
-The configure script will automatically detect this and bump the Boost version dependency to 1.42.
 
-To disable building this functionality, use ``--without-protobuf``.
+This functionality from 4.5.0 and upwards, without needing any external library. Before 4.5.0, installing the  `protobuf <https://developers.google.com/protocol-buffers/>`_ library and compiler is required to enable this functionality. The configure script will automatically detect this and bump the Boost version dependency to 1.42. To disable building this functionality before 4.5.0, use ``--without-protobuf``.
 
 systemd notify support
 ^^^^^^^^^^^^^^^^^^^^^^
diff --git a/pdns/recursordist/protobuf.cc b/pdns/recursordist/protobuf.cc
deleted file mode 120000 (symlink)
index 088ecc8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../protobuf.cc
\ No newline at end of file
diff --git a/pdns/recursordist/protobuf.hh b/pdns/recursordist/protobuf.hh
deleted file mode 120000 (symlink)
index c7def8e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../protobuf.hh
\ No newline at end of file
diff --git a/pdns/recursordist/rec-protobuf.cc b/pdns/recursordist/rec-protobuf.cc
deleted file mode 120000 (symlink)
index 1bab3e4..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../rec-protobuf.cc
\ No newline at end of file
diff --git a/pdns/recursordist/rec-protobuf.hh b/pdns/recursordist/rec-protobuf.hh
deleted file mode 120000 (symlink)
index 93a7607..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../rec-protobuf.hh
\ No newline at end of file