]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
remove toysdig
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Wed, 14 Dec 2022 10:29:26 +0000 (11:29 +0100)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Wed, 14 Dec 2022 10:29:26 +0000 (11:29 +0100)
.github/actions/spell-check/allow.txt
.not-formatted
pdns/.gitignore
pdns/Makefile.am
pdns/toysdig.cc [deleted file]

index bde902cd4e845a27842bb52019e4215648ab6517..28db49a9a5b80fc1eab0130eb76bcd7c0a88c4da 100644 (file)
@@ -3728,7 +3728,6 @@ totremove
 tottime
 toupper
 toxml
-toysdig
 tozero
 TPL
 tpl
index e2be06d1a11c2c3d6f0cf994961d230439f89b3c..e4c9ad9bc151a5604577efe95467f2ab564a57b4 100644 (file)
 ./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
index c8d6f27aa7895f21a39949884a85f00beb63c5ed..98d5c5cf5554a757efc85c795616bdbf31610c4b 100644 (file)
@@ -37,7 +37,6 @@
 /nproxy
 /speedtest
 /tcpbench
-/toysdig
 /tsig-tests
 version_generated.h
 /zone2ldap
index 4fea89c11c0ca2a16debafa35c8f63de5deab450..131b2dd4b90a7145a5ff9cb9dfdaa29186e20c88 100644 (file)
@@ -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 (file)
index 80a6329..0000000
+++ /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 "<<qname<<"/"<<DNSRecordContent::NumberToType(qtype)<<endl;
-    vector<uint8_t> 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<char[]>(len);
-    int n=0;
-    int numread;
-    while(n<len) {
-      numread=d_rsock.read(creply.get()+n, len-n);
-      if(numread<0) {
-        throw PDNSException("tcp read failed: "+stringerror());
-      }
-      n+=numread;
-    }
-
-    string reply(creply.get(), len);
-
-    return reply;
-  }
-
-  Socket d_rsock;
-};
-
-
-class TCPRecordOracle : public DNSRecordOracle
-{
-public:
-  TCPRecordOracle(const ComboAddress& dest) : d_dest(dest) {}
-  vector<DNSRecord> get(const DNSName& qname, uint16_t qtype) override
-  {
-    TCPResolver tr(d_dest);
-    string resp=tr.query(qname, qtype);
-    MOADNSParser mdp(false, resp);
-    vector<DNSRecord> 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<LuaConfigItems> g_luaconfs;
-LuaConfigItems::LuaConfigItems()
-{
-  for (const auto &dsRecord : rootDSs) {
-    auto ds=std::dynamic_pointer_cast<DSRecordContent>(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 {"<<endl;
-
-  auto recs=tro.get(qname, qtype);
-
-  cspmap_t cspmap=harvestCSPFromRecs(recs);
-  cerr<<"Got "<<cspmap.size()<<" RRSETs: ";
-  int numsigs=0;
-  for(const auto& csp : cspmap) {
-    cerr<<" "<<csp.first.first<<'/'<<DNSRecordContent::NumberToType(csp.first.second)<<": "<<csp.second.signatures.size()<<" sigs for "<<csp.second.records.size()<<" records"<<endl;
-    numsigs+= csp.second.signatures.size();
-  }
-   
-  skeyset_t keys;
-  cspmap_t validrrsets;
-
-  if(numsigs) {
-    for(const auto& csp : cspmap) {
-      for(const auto& sig : csp.second.signatures) {
-       cerr<<"got rrsig "<<sig->d_signer<<"/"<<sig->d_tag<<endl;
-       vState state = getKeysFor(tro, sig->d_signer, keys);
-       cerr<<"! state = "<<state<<", now have "<<keys.size()<<" keys at "<<qname<<endl;
-        // dsmap.emplace(dsrc.d_tag, dsrc);
-      }
-    }
-
-    validateWithKeySet(cspmap, validrrsets, keys);
-  }
-  else {
-    cerr<<"no sigs, hoping for Insecure"<<endl;
-    vState state = getKeysFor(tro, qname, keys);
-    cerr<<"! state = "<<state<<", now have "<<keys.size()<<" keys at "<<qname<<endl;
-  }
-  cerr<<"! validated "<<validrrsets.size()<<" RRsets out of "<<cspmap.size()<<endl;
-
-  cerr<<"% validated RRs:"<<endl;
-  for(auto i=validrrsets.begin(); i!=validrrsets.end(); i++) {
-    cerr<<"% "<<i->first.first<<"/"<<DNSRecordContent::NumberToType(i->first.second)<<endl;
-    for(auto j=i->second.records.begin(); j!=i->second.records.end(); j++) {
-      cerr<<"\t% > "<<(*j)->getZoneRepresentation()<<endl;
-    }
-  }
-
-  cout<<"}"<<endl;
-  exit(0);
-}
-catch(std::exception &e)
-{
-  cerr<<"Fatal: "<<e.what()<<endl;
-}
-catch(PDNSException &pe)
-{
-  cerr<<"Fatal: "<<pe.reason<<endl;
-}
-