From: Peter van Dijk Date: Wed, 14 Dec 2022 10:29:26 +0000 (+0100) Subject: remove toysdig X-Git-Tag: dnsdist-1.8.0-rc1~158^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77b35ca93a573af0d7b84e4a5acec0c3a279a7ba;p=thirdparty%2Fpdns.git remove toysdig --- diff --git a/.github/actions/spell-check/allow.txt b/.github/actions/spell-check/allow.txt index bde902cd4e..28db49a9a5 100644 --- a/.github/actions/spell-check/allow.txt +++ b/.github/actions/spell-check/allow.txt @@ -3728,7 +3728,6 @@ totremove tottime toupper toxml -toysdig tozero TPL tpl diff --git a/.not-formatted b/.not-formatted index e2be06d1a1..e4c9ad9bc1 100644 --- a/.not-formatted +++ b/.not-formatted @@ -307,7 +307,6 @@ ./pdns/testrunner.cc ./pdns/threadname.cc ./pdns/tkey.cc -./pdns/toysdig.cc ./pdns/trusted-notification-proxy.cc ./pdns/trusted-notification-proxy.hh ./pdns/tsig-tests.cc diff --git a/pdns/.gitignore b/pdns/.gitignore index c8d6f27aa7..98d5c5cf55 100644 --- a/pdns/.gitignore +++ b/pdns/.gitignore @@ -37,7 +37,6 @@ /nproxy /speedtest /tcpbench -/toysdig /tsig-tests version_generated.h /zone2ldap diff --git a/pdns/Makefile.am b/pdns/Makefile.am index 4fea89c11c..131b2dd4b9 100644 --- a/pdns/Makefile.am +++ b/pdns/Makefile.am @@ -184,7 +184,6 @@ EXTRA_PROGRAMS = \ sdig \ speedtest \ testrunner \ - toysdig \ tsig-tests \ zone2ldap @@ -887,48 +886,6 @@ nsec3dig_SOURCES += pkcs11signers.cc pkcs11signers.hh nsec3dig_LDADD += $(P11KIT1_LIBS) endif -toysdig_SOURCES = \ - base32.cc \ - base64.cc base64.hh \ - dns_random_urandom.cc \ - dnslabeltext.cc \ - dnsname.cc dnsname.hh \ - dnsparser.cc dnsparser.hh \ - dnsrecords.cc \ - dnssecinfra.cc \ - dnswriter.cc dnswriter.hh \ - ednssubnet.cc ednssubnet.hh \ - filterpo.hh \ - iputils.cc \ - logger.cc \ - misc.cc misc.hh \ - nsecrecords.cc \ - opensslsigners.cc opensslsigners.hh \ - qtype.cc \ - rcpgenerator.cc rcpgenerator.hh \ - rec-lua-conf.hh \ - recursor_cache.hh \ - root-dnssec.hh \ - sholder.hh \ - sillyrecords.cc \ - sortlist.hh \ - sstuff.hh \ - statbag.cc \ - svc-records.cc svc-records.hh \ - toysdig.cc \ - unix_utility.cc \ - validate.cc validate.hh - - -toysdig_LDFLAGS = $(AM_LDFLAGS) \ - $(LIBCRYPTO_LDFLAGS) -toysdig_LDADD = $(LIBCRYPTO_LIBS) - -if PKCS11 -toysdig_SOURCES += pkcs11signers.cc pkcs11signers.hh -toysdig_LDADD += $(P11KIT1_LIBS) -endif - tsig_tests_SOURCES = \ arguments.cc \ axfr-retriever.cc \ @@ -963,10 +920,6 @@ tsig_tests_SOURCES = \ tsig_tests_LDADD = $(LIBCRYPTO_LIBS) tsig_tests_LDFLAGS = $(AM_LDFLAGS) $(LIBCRYPTO_LDFLAGS) -if GSS_TSIG -toysdig_LDADD += $(GSS_LIBS) -endif - if PKCS11 tsig_tests_SOURCES += pkcs11signers.cc pkcs11signers.hh tsig_tests_LDADD += $(P11KIT1_LIBS) diff --git a/pdns/toysdig.cc b/pdns/toysdig.cc deleted file mode 100644 index 80a63291c2..0000000000 --- a/pdns/toysdig.cc +++ /dev/null @@ -1,181 +0,0 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#include "dnsparser.hh" -#include "rec-lua-conf.hh" -#include "sstuff.hh" -#include "misc.hh" -#include "dnswriter.hh" -#include "dnsrecords.hh" -#include "statbag.hh" -#include "ednssubnet.hh" -#include "dnssecinfra.hh" -#include "recursor_cache.hh" -#include "base32.hh" -#include "root-dnssec.hh" - -#include "validate.hh" -StatBag S; - -class TCPResolver : public boost::noncopyable -{ -public: - TCPResolver(ComboAddress addr) : d_rsock(AF_INET, SOCK_STREAM) - { - d_rsock.connect(addr); - } - - string query(const DNSName& qname, uint16_t qtype) - { - cerr<<"Q "< packet; - DNSPacketWriter pw(packet, qname, qtype); - - // recurse - pw.getHeader()->rd=true; - - // we'll do the validation - pw.getHeader()->cd=true; - pw.getHeader()->ad=true; - - // we do require DNSSEC records to do that! - pw.addOpt(2800, 0, EDNSOpts::DNSSECOK); - pw.commit(); - - uint16_t len; - len = htons(packet.size()); - if(d_rsock.write((char *) &len, 2) != 2) - throw PDNSException("tcp write failed"); - - d_rsock.writen(string(packet.begin(), packet.end())); - - int bread=d_rsock.read((char *) &len, 2); - if( bread <0) - throw PDNSException("tcp read failed: "+stringerror()); - if(bread != 2) - throw PDNSException("EOF on TCP read"); - - len=ntohs(len); - auto creply = std::make_unique(len); - int n=0; - int numread; - while(n get(const DNSName& qname, uint16_t qtype) override - { - TCPResolver tr(d_dest); - string resp=tr.query(qname, qtype); - MOADNSParser mdp(false, resp); - vector ret; - ret.reserve(mdp.d_answers.size()); - for(const auto& a : mdp.d_answers) { - ret.push_back(a.first); - } - return ret; - } -private: - ComboAddress d_dest; -}; - -GlobalStateHolder g_luaconfs; -LuaConfigItems::LuaConfigItems() -{ - for (const auto &dsRecord : rootDSs) { - auto ds=std::dynamic_pointer_cast(DSRecordContent::make(dsRecord)); - dsAnchors[g_rootdnsname].insert(*ds); - } -} - -DNSFilterEngine::DNSFilterEngine() {} - -int main(int argc, char** argv) -try -{ - reportAllTypes(); -// g_rootDS = "19036 8 2 49aac11d7b6f6446702e54a1607371607a1a41855200fd2ce1cdde32f24e8fb5"; - -// if(argv[5]) -// g_rootDS = argv[5]; - - // g_anchors.insert(DSRecordContent("19036 8 2 49aac11d7b6f6446702e54a1607371607a1a41855200fd2ce1cdde32f24e8fb5")); - if(argc < 4) { - cerr<<"Syntax: toysdig IP-address port question question-type [rootDS]\n"; - exit(EXIT_FAILURE); - } - ComboAddress dest(argv[1] + (*argv[1]=='@'), atoi(argv[2])); - TCPRecordOracle tro(dest); - DNSName qname(argv[3]); - uint16_t qtype=DNSRecordContent::TypeToNumber(argv[4]); - cout<<"digraph oneshot {"<d_signer<<"/"<d_tag<d_signer, keys); - cerr<<"! state = "<first.first<<"/"<first.second)<second.records.begin(); j!=i->second.records.end(); j++) { - cerr<<"\t% > "<<(*j)->getZoneRepresentation()<