From: Kees Monshouwer Date: Wed, 23 Oct 2013 19:39:06 +0000 (+0200) Subject: move bindbackend to modules X-Git-Tag: rec-3.6.0-rc1~363^2~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e53a4bf6a310db4d414ce2e7d0d026db45417b6e;p=pdns move bindbackend to modules --- diff --git a/.travis.yml b/.travis.yml index f1304370c..b82bf7d33 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ before_script: - cd ../.. script: - ./bootstrap - - ./configure --with-modules='gmysql gpgsql gsqlite3 mydns tinydns remote random' --enable-unit-tests --enable-remotebackend-http --enable-tools + - ./configure --with-modules='bind gmysql gpgsql gsqlite3 mydns tinydns remote random' --enable-unit-tests --enable-remotebackend-http --enable-tools - make dist - make -j 4 - make -j 4 check diff --git a/configure.ac b/configure.ac index 75a740bde..5e9a73eca 100644 --- a/configure.ac +++ b/configure.ac @@ -302,7 +302,7 @@ fi -modules="gmysql geo random" +modules="bind gmysql geo random" AC_ARG_WITH(modules, AS_HELP_STRING([--with-modules],[which backends to compile with]), [ modules="$withval" @@ -699,7 +699,7 @@ AC_SUBST(LIBS) export moduledirs moduleobjects modulelibs AC_CONFIG_FILES([Makefile modules/Makefile pdns/Makefile codedocs/Makefile \ -pdns/backends/Makefile pdns/backends/bind/Makefile pdns/pdns \ +pdns/pdns modules/bindbackend/Makefile modules/gmysqlbackend/Makefile modules/db2backend/Makefile \ modules/geobackend/Makefile modules/opendbxbackend/Makefile \ modules/pipebackend/Makefile modules/oraclebackend/Makefile \ diff --git a/modules/Makefile.am b/modules/Makefile.am index 8ab7ead98..089b4c3b3 100644 --- a/modules/Makefile.am +++ b/modules/Makefile.am @@ -1,2 +1,2 @@ SUBDIRS=@moduledirs@ -DIST_SUBDIRS=db2backend geobackend gmysqlbackend goraclebackend gpgsqlbackend gsqlite3backend ldapbackend luabackend mydnsbackend opendbxbackend oraclebackend pipebackend tinydnsbackend remotebackend randombackend +DIST_SUBDIRS=bindbackend db2backend geobackend gmysqlbackend goraclebackend gpgsqlbackend gsqlite3backend ldapbackend luabackend mydnsbackend opendbxbackend oraclebackend pipebackend tinydnsbackend remotebackend randombackend diff --git a/pdns/backends/bind/.gitignore b/modules/bindbackend/.gitignore similarity index 100% rename from pdns/backends/bind/.gitignore rename to modules/bindbackend/.gitignore diff --git a/modules/bindbackend/Makefile.am b/modules/bindbackend/Makefile.am new file mode 100644 index 000000000..4cc7483cd --- /dev/null +++ b/modules/bindbackend/Makefile.am @@ -0,0 +1,17 @@ +lib_LTLIBRARIES = libbindbackend.la +AM_CPPFLAGS=-I../../pdns $(BOOST_CPPFLAGS) $(POLARSSL_CFLAGS) @THREADFLAGS@ + +AM_LFLAGS = -s -i +AM_YFLAGS = -d --verbose --debug + +BUILT_SOURCES=bind-dnssec.schema.sqlite3.sql.h + +EXTRA_DIST=OBJECTFILES OBJECTLIBS + +libbindbackend_la_SOURCES=bindbackend2.cc bindbackend2.hh binddnssec.cc ../../pdns/bindparser.yy ../../pdns/bindlexer.l + +libbindbackend_la_LDFLAGS=-module -avoid-version + +bind-dnssec.schema.sqlite3.sql.h: ../../pdns/bind-dnssec.schema.sqlite3.sql + ( echo 'static char sqlCreate[] __attribute__((unused))=' ; sed 's/$$/"/g' ../../pdns/bind-dnssec.schema.sqlite3.sql | sed 's/^/"/g' ; echo ';' ) > $@ + diff --git a/modules/bindbackend/OBJECTFILES b/modules/bindbackend/OBJECTFILES new file mode 100644 index 000000000..e76b37698 --- /dev/null +++ b/modules/bindbackend/OBJECTFILES @@ -0,0 +1 @@ +bindbackend2.lo binddnssec.lo diff --git a/modules/bindbackend/OBJECTLIBS b/modules/bindbackend/OBJECTLIBS new file mode 100644 index 000000000..e69de29bb diff --git a/pdns/backends/bind/TODO b/modules/bindbackend/TODO similarity index 100% rename from pdns/backends/bind/TODO rename to modules/bindbackend/TODO diff --git a/pdns/backends/bind/bindbackend2.cc b/modules/bindbackend/bindbackend2.cc similarity index 98% rename from pdns/backends/bind/bindbackend2.cc rename to modules/bindbackend/bindbackend2.cc index 9369d2a3d..ad1056952 100644 --- a/pdns/backends/bind/bindbackend2.cc +++ b/modules/bindbackend/bindbackend2.cc @@ -33,24 +33,24 @@ #include #include #include -#include "dnsseckeeper.hh" -#include "dnssecinfra.hh" -#include "base32.hh" -#include "namespaces.hh" +#include "pdns/dnsseckeeper.hh" +#include "pdns/dnssecinfra.hh" +#include "pdns/base32.hh" +#include "pdns/namespaces.hh" -#include "dns.hh" -#include "dnsbackend.hh" +#include "pdns/dns.hh" +#include "pdns/dnsbackend.hh" #include "bindbackend2.hh" -#include "dnspacket.hh" -#include "zoneparser-tng.hh" -#include "bindparserclasses.hh" -#include "logger.hh" -#include "arguments.hh" -#include "qtype.hh" -#include "misc.hh" -#include "dynlistener.hh" -#include "lock.hh" -#include "namespaces.hh" +#include "pdns/dnspacket.hh" +#include "pdns/zoneparser-tng.hh" +#include "pdns/bindparserclasses.hh" +#include "pdns/logger.hh" +#include "pdns/arguments.hh" +#include "pdns/qtype.hh" +#include "pdns/misc.hh" +#include "pdns/dynlistener.hh" +#include "pdns/lock.hh" +#include "pdns/namespaces.hh" /** new scheme of things: we have zone-id map diff --git a/pdns/backends/bind/bindbackend2.hh b/modules/bindbackend/bindbackend2.hh similarity index 99% rename from pdns/backends/bind/bindbackend2.hh rename to modules/bindbackend/bindbackend2.hh index 2b6d61542..67e5df5d1 100644 --- a/pdns/backends/bind/bindbackend2.hh +++ b/modules/bindbackend/bindbackend2.hh @@ -36,10 +36,10 @@ #include #include #include -#include "misc.hh" -#include "dnsbackend.hh" +#include "pdns/misc.hh" +#include "pdns/dnsbackend.hh" -#include "namespaces.hh" +#include "pdns/namespaces.hh" using namespace ::boost::multi_index; /** This struct is used within the Bind2Backend to store DNS information. diff --git a/pdns/backends/bind/binddnssec.cc b/modules/bindbackend/binddnssec.cc similarity index 99% rename from pdns/backends/bind/binddnssec.cc rename to modules/bindbackend/binddnssec.cc index 75aa09bd2..5dc7557f5 100644 --- a/pdns/backends/bind/binddnssec.cc +++ b/modules/bindbackend/binddnssec.cc @@ -20,7 +20,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "bindbackend2.hh" -#include "dnsrecords.hh" +#include "pdns/dnsrecords.hh" #include "bind-dnssec.schema.sqlite3.sql.h" #include #include "config.h" diff --git a/pdns/.gitignore b/pdns/.gitignore index 88b21c41b..8bdc80c39 100644 --- a/pdns/.gitignore +++ b/pdns/.gitignore @@ -33,3 +33,12 @@ /tsig-tests /tcpbench version_generated.h +/zone2ldap +/zone2sql +/zone2json +/bindlexer.c +/bindparser.cc +/bindparser.h +/bindparser.hh +/bindparser.output +/dnslabeltext.cc diff --git a/pdns/Makefile.am b/pdns/Makefile.am index 1530b18fd..df72292cd 100644 --- a/pdns/Makefile.am +++ b/pdns/Makefile.am @@ -1,7 +1,11 @@ -AM_CXXFLAGS=-DSYSCONFDIR=\"@sysconfdir@\" -DLIBDIR=\"@libdir@\" -DLOCALSTATEDIR=\"@socketdir@\" -Ibackends/bind @THREADFLAGS@ $(LUA_CFLAGS) $(SQLITE3_CFLAGS) $(POLARSSL_CFLAGS) -Iext/rapidjson/include +AM_CXXFLAGS=-DSYSCONFDIR=\"@sysconfdir@\" -DLIBDIR=\"@libdir@\" -DLOCALSTATEDIR=\"@socketdir@\" @THREADFLAGS@ $(LUA_CFLAGS) $(SQLITE3_CFLAGS) $(POLARSSL_CFLAGS) -Iext/rapidjson/include + +AM_CPPFLAGS=$(BOOST_CPPFLAGS) @THREADFLAGS@ $(LIBCURL_CFLAGS) + +AM_LFLAGS = -s -i +AM_YFLAGS = -d --verbose --debug -AM_CPPFLAGS=-Ibackends/bind $(BOOST_CPPFLAGS) @THREADFLAGS@ $(LIBCURL_CFLAGS) if BOTAN110 AM_CPPFLAGS += $(BOTAN110_CFLAGS) endif @@ -17,16 +21,16 @@ EXTRA_DIST = dnslabeltext.rl dnslabeltext.cc mtasker.cc inflighter.cc docs/pdns_ no-dnssec.schema.mysql.sql no-dnssec.schema.pgsql.sql no-dnssec.schema.sqlite3.sql \ bind-dnssec.schema.sqlite3.sql -SUBDIRS= $(POLARSSL_SUBDIR) backends +SUBDIRS= $(POLARSSL_SUBDIR) -BUILT_SOURCES=bind-dnssec.schema.sqlite3.sql.h version_generated.h +BUILT_SOURCES=version_generated.h CLEANFILES=version_generated.h noinst_SCRIPTS = pdns sysconf_DATA = pdns.conf-dist sbin_PROGRAMS = pdns_server -bin_PROGRAMS = pdns_control pdnssec +bin_PROGRAMS = pdns_control pdnssec zone2sql zone2ldap zone2json if TOOLS bin_PROGRAMS += dnsbulktest dnsreplay dnsscan dnsscope dnstcpbench dnswasher nproxy dnsdist nsec3dig @@ -47,8 +51,7 @@ dynlistener.cc dynlistener.hh dynhandler.cc dynhandler.hh \ resolver.hh resolver.cc slavecommunicator.cc mastercommunicator.cc communicator.cc communicator.hh dnsproxy.cc \ dnsproxy.hh unix_utility.cc common_startup.cc \ utility.hh iputils.hh common_startup.hh unix_semaphore.cc \ -backends/bind/bindbackend2.cc backends/bind/binddnssec.cc bind-dnssec.schema.sqlite3.sql.h \ -backends/bind/bindparser.cc backends/bind/bindlexer.c \ +bindparser.cc bindlexer.c \ backends/gsql/gsqlbackend.cc \ backends/gsql/gsqlbackend.hh backends/gsql/ssql.hh \ base64.cc sillyrecords.cc \ @@ -93,8 +96,7 @@ pdnssec_SOURCES=pdnssec.cc dbdnsseckeeper.cc sstuff.hh dnsparser.cc dnsparser.hh misc.cc misc.hh rcpgenerator.cc rcpgenerator.hh base64.cc base64.hh unix_utility.cc \ logger.cc statbag.cc qtype.cc sillyrecords.cc nsecrecords.cc dnssecinfra.cc dnssecinfra.hh \ base32.cc ueberbackend.cc dnsbackend.cc arguments.cc packetcache.cc dnspacket.cc \ - backends/bind/bindbackend2.cc backends/bind/binddnssec.cc bind-dnssec.schema.sqlite3.sql.h\ - backends/bind/bindparser.cc backends/bind/bindlexer.c \ + bindparser.cc bindlexer.c \ backends/gsql/gsqlbackend.cc \ backends/gsql/gsqlbackend.hh backends/gsql/ssql.hh zoneparser-tng.cc \ dynlistener.cc dns.cc dnssecsigner.cc polarrsakeyinfra.cc \ @@ -107,6 +109,38 @@ pdnssec_SOURCES=pdnssec.cc dbdnsseckeeper.cc sstuff.hh dnsparser.cc dnsparser.hh pdnssec_LDFLAGS=@moduleobjects@ @modulelibs@ @DYNLINKFLAGS@ @LIBDL@ @THREADFLAGS@ $(BOOST_PROGRAM_OPTIONS_LDFLAGS) $(BOOST_SERIALIZATION_LDFLAGS) pdnssec_LDADD= $(POLARSSL_LIBS) $(BOOST_PROGRAM_OPTIONS_LIBS) $(BOOST_SERIALIZATION_LIBS) $(SQLITE3_LIBS) $(LIBCURL_LIBS) +zone2sql_SOURCES=bindparser.yy bindlexer.l bind-dnssec.schema.sqlite3.sql.h \ + arguments.cc logger.cc zone2sql.cc statbag.cc misc.cc \ + unix_utility.cc qtype.cc dns.cc \ + zoneparser-tng.cc dnsrecords.cc sillyrecords.cc \ + dnswriter.cc dnslabeltext.cc rcpgenerator.cc dnsparser.cc base64.cc \ + nsecrecords.cc dnssecinfra.cc base32.cc bindparserclasses.hh \ + aes/dns_random.cc aes/aescpp.h aes/aescrypt.c aes/aes.h aes/aeskey.c aes/aes_modes.c aes/aesopt.h \ + aes/aestab.c aes/aestab.h aes/brg_endian.h aes/brg_types.h # dbdnsseckeeper.cc + +zone2sql_LDFLAGS=@THREADFLAGS@ +zone2sql_LDADD= $(POLARSSL_LIBS) + +zone2json_SOURCES=bindparser.yy bindlexer.l bind-dnssec.schema.sqlite3.sql.h \ + arguments.cc logger.cc zone2json.cc statbag.cc misc.cc \ + unix_utility.cc qtype.cc zoneparser-tng.cc dnsrecords.cc \ + dnswriter.cc dnslabeltext.cc rcpgenerator.cc dnsparser.cc base64.cc sillyrecords.cc \ + nsecrecords.cc dnssecinfra.cc base32.cc bindparserclasses.hh + +zone2json_LDFLAGS=@THREADFLAGS@ +zone2json_LDADD= $(POLARSSL_LIBS) + +zone2ldap_SOURCES=bindparser.yy bindlexer.l bind-dnssec.schema.sqlite3.sql.h \ + arguments.cc logger.cc zone2ldap.cc statbag.cc misc.cc \ + unix_utility.cc qtype.cc zoneparser-tng.cc dnsrecords.cc \ + dnswriter.cc dnslabeltext.cc rcpgenerator.cc dnsparser.cc base64.cc sillyrecords.cc \ + nsecrecords.cc dnssecinfra.cc base32.cc bindparserclasses.hh \ + aes/dns_random.cc aes/aescpp.h aes/aescrypt.c aes/aes.h aes/aeskey.c aes/aes_modes.c aes/aesopt.h \ + aes/aestab.c aes/aestab.h aes/brg_endian.h aes/brg_types.h # dbdnsseckeeper.cc + +zone2ldap_LDFLAGS=@THREADFLAGS@ +zone2ldap_LDADD= $(POLARSSL_LIBS) + if BOTAN110 pdnssec_SOURCES += botan110signers.cc botansigners.cc pdnssec_LDADD += $(BOTAN110_LIBS) -lgmp -lrt @@ -286,16 +320,6 @@ TESTS=testrunner dnslabeltext.cc: dnslabeltext.rl ragel dnslabeltext.rl -o dnslabeltext.cc -bind-dnssec.schema.sqlite3.sql.h: bind-dnssec.schema.sqlite3.sql - ( echo 'static char sqlCreate[] __attribute__((unused))=' ; sed 's/$$/"/g' bind-dnssec.schema.sqlite3.sql | sed 's/^/"/g' ; echo ';' ) > $@ - -backends/bind/bindlexer.c: - cd backends/bind && $(MAKE) bindlexer.c - -backends/bind/bindparser.cc: - cd backends/bind && $(MAKE) bindparser.cc - - build_date=$(shell LC_TIME=C date '+%Y%m%d%H%M%S') build_host=$(shell id -u -n)@$(shell hostname -f) if RELEASE_BUILD diff --git a/pdns/backends/.gitignore b/pdns/backends/.gitignore deleted file mode 100644 index 9ee645401..000000000 --- a/pdns/backends/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/Makefile.in -/Makefile diff --git a/pdns/backends/Makefile.am b/pdns/backends/Makefile.am deleted file mode 100644 index 58dca5853..000000000 --- a/pdns/backends/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS=bind diff --git a/pdns/backends/bind/Makefile.am b/pdns/backends/bind/Makefile.am deleted file mode 100644 index bb03083cb..000000000 --- a/pdns/backends/bind/Makefile.am +++ /dev/null @@ -1,61 +0,0 @@ -noinst_LTLIBRARIES = libbind2backend.la -AM_CPPFLAGS=-I../.. $(BOOST_CPPFLAGS) $(POLARSSL_CFLAGS) @THREADFLAGS@ - -BUILT_SOURCES=bind-dnssec.schema.sqlite3.sql.h bindparser.h - -bind-dnssec.schema.sqlite3.sql.h: ../../bind-dnssec.schema.sqlite3.sql - ( echo 'static char sqlCreate[] __attribute__((unused))=' ; sed 's/$$/"/g' ../../bind-dnssec.schema.sqlite3.sql | sed 's/^/"/g' ; echo ';' ) > $@ - - -libbind2backend_la_SOURCES=bindbackend2.cc bindbackend2.hh bindparser.yy \ -bindlexer.l ../../zoneparser-tng.cc ../../misc.cc \ -bindparserclasses.hh ../../unix_utility.cc binddnssec.cc bind-dnssec.schema.sqlite3.sql.h - -libbind2backend_la_CXXFLAGS=$(AM_CXXFLAGS) -libbind2backend_la_CFLAGS=$(AM_CFLAGS) -libbind2backend_la_LDFLAGS=-module -avoid-version - -bin_PROGRAMS = zone2sql zone2ldap zone2json - -EXTRA_DIST=dnslabeltext.cc bindparser.cc bindparser.h bind-dnssec.schema.sqlite3.sql.h - -zone2sql_SOURCES=bindparser.yy bindlexer.l bind-dnssec.schema.sqlite3.sql.h \ -../../arguments.cc ../../logger.cc zone2sql.cc ../../statbag.cc ../../misc.cc \ -../../unix_utility.cc ../../qtype.cc ../../dns.cc \ -../../zoneparser-tng.cc ../../dnsrecords.cc ../../sillyrecords.cc \ -../../dnswriter.cc dnslabeltext.cc ../../rcpgenerator.cc ../../dnsparser.cc ../../base64.cc \ -../../nsecrecords.cc ../../dnssecinfra.cc ../../base32.cc ../../aes/dns_random.cc \ -../../aes/aescpp.h ../../aes/aescrypt.c ../../aes/aes.h ../../aes/aeskey.c ../../aes/aes_modes.c ../../aes/aesopt.h \ -../../aes/aestab.c ../../aes/aestab.h ../../aes/brg_endian.h ../../aes/brg_types.h # ../../dbdnsseckeeper.cc - -zone2json_SOURCES=bindparser.yy bindlexer.l bind-dnssec.schema.sqlite3.sql.h \ -../../arguments.cc ../../logger.cc zone2json.cc ../../statbag.cc ../../misc.cc \ -../../unix_utility.cc ../../qtype.cc ../../zoneparser-tng.cc ../../dnsrecords.cc \ -../../dnswriter.cc dnslabeltext.cc ../../rcpgenerator.cc ../../dnsparser.cc ../../base64.cc ../../sillyrecords.cc \ -../../nsecrecords.cc ../../dnssecinfra.cc ../../base32.cc - -zone2ldap_SOURCES=bindparser.yy bindlexer.l bind-dnssec.schema.sqlite3.sql.h \ -../../arguments.cc ../../logger.cc zone2ldap.cc ../../statbag.cc ../../misc.cc \ -../../unix_utility.cc ../../qtype.cc ../../zoneparser-tng.cc ../../dnsrecords.cc \ -../../dnswriter.cc dnslabeltext.cc ../../rcpgenerator.cc ../../dnsparser.cc ../../base64.cc ../../sillyrecords.cc \ -../../nsecrecords.cc ../../dnssecinfra.cc ../../base32.cc ../../aes/dns_random.cc \ -../../aes/aescpp.h ../../aes/aescrypt.c ../../aes/aes.h ../../aes/aeskey.c ../../aes/aes_modes.c ../../aes/aesopt.h \ -../../aes/aestab.c ../../aes/aestab.h ../../aes/brg_endian.h ../../aes/brg_types.h # ../../dbdnsseckeeper.cc - -zone2ldap_LDFLAGS=@THREADFLAGS@ -zone2ldap_LDADD= $(POLARSSL_LIBS) - -zone2sql_LDFLAGS=@THREADFLAGS@ -zone2sql_LDADD= $(POLARSSL_LIBS) - -zone2json_LDFLAGS=@THREADFLAGS@ -zone2json_LDADD= $(POLARSSL_LIBS) - -AM_LFLAGS = -s -i -AM_YFLAGS = -d --verbose --debug - -dnslabeltext.cc: ../../dnslabeltext.rl - ragel ../../dnslabeltext.rl -o dnslabeltext.cc - -.hh.h: - cp $< $@ diff --git a/pdns/backends/bind/bindlexer.l b/pdns/bindlexer.l similarity index 99% rename from pdns/backends/bind/bindlexer.l rename to pdns/bindlexer.l index 2f783eade..6a35dd944 100644 --- a/pdns/backends/bind/bindlexer.l +++ b/pdns/bindlexer.l @@ -1,4 +1,5 @@ %{ + #include #include #include diff --git a/pdns/backends/bind/bindparser.yy b/pdns/bindparser.yy similarity index 100% rename from pdns/backends/bind/bindparser.yy rename to pdns/bindparser.yy diff --git a/pdns/backends/bind/bindparserclasses.hh b/pdns/bindparserclasses.hh similarity index 100% rename from pdns/backends/bind/bindparserclasses.hh rename to pdns/bindparserclasses.hh diff --git a/pdns/pdnssec.cc b/pdns/pdnssec.cc index 0f3633b6f..ef09fbdc7 100644 --- a/pdns/pdnssec.cc +++ b/pdns/pdnssec.cc @@ -12,7 +12,6 @@ #include "zoneparser-tng.hh" #include "signingpipe.hh" #include -#include "bindbackend2.hh" #include "dns_random.hh" StatBag S; @@ -1085,21 +1084,6 @@ try loadMainConfig(g_vm["config-dir"].as()); reportAllTypes(); - if(cmds[0] == "create-bind-db") { - if(cmds.size() != 2) { - cerr << "Syntax: pdnssec create-bind-db fname"< /dev/null - ../pdns/backends/bind/zone2sql --transactions --$1 --named-conf=./named.conf + make -C ../pdns zone2sql > /dev/null + ../pdns/zone2sql --transactions --$1 --named-conf=./named.conf } bindwait ()