From: bert hubert Date: Thu, 22 Oct 2015 12:37:06 +0000 (+0200) Subject: hook up ixplore tool X-Git-Tag: dnsdist-1.0.0-alpha1~252^2~6^2~21 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=aea0480ef2be5ec1f08347b16e602f0b1ed8ed8f;p=pdns hook up ixplore tool --- diff --git a/pdns/Makefile.am b/pdns/Makefile.am index d31fe56ad..ead56997a 100644 --- a/pdns/Makefile.am +++ b/pdns/Makefile.am @@ -89,6 +89,7 @@ bin_PROGRAMS += \ nproxy \ nsec3dig \ saxfr \ + ixplore \ sdig if HAVE_RECVMMSG @@ -109,6 +110,7 @@ EXTRA_PROGRAMS = \ dnstcpbench \ dnswasher \ dumresp \ + ixplore \ notify \ nproxy \ nsec3dig \ @@ -567,6 +569,34 @@ if GSS_TSIG saxfr_LDADD += $(GSS_LIBS) endif + +ixplore_SOURCES = \ + base32.cc \ + base64.cc base64.hh \ + dns_random.cc dns_random.hh \ + dnslabeltext.cc \ + dnsname.cc dnsname.hh \ + dnsparser.cc dnsparser.hh \ + dnsrecords.cc \ + dnssecinfra.cc \ + dnswriter.cc dnswriter.hh \ + gss_context.cc gss_context.hh \ + logger.cc \ + mbedtlscompat.hh \ + misc.cc misc.hh \ + nsecrecords.cc \ + qtype.cc \ + rcpgenerator.cc rcpgenerator.hh \ + ixplore.cc \ + sillyrecords.cc \ + sstuff.hh \ + statbag.cc \ + unix_utility.cc + +ixplore_LDADD = $(MBEDTLS_LIBS) + + + dnstcpbench_SOURCES = \ base32.cc \ base64.cc base64.hh \ diff --git a/pdns/ixplore.cc b/pdns/ixplore.cc new file mode 100644 index 000000000..f4f6cafc7 --- /dev/null +++ b/pdns/ixplore.cc @@ -0,0 +1,68 @@ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include "base64.hh" +#include "dnsparser.hh" +#include "sstuff.hh" +#include "misc.hh" +#include "dnswriter.hh" +#include "dnsrecords.hh" +#include "statbag.hh" +#include "base32.hh" +#include "dnssecinfra.hh" +#include +#include "dns_random.hh" +#include "gss_context.hh" + +StatBag S; + + +int main(int argc, char** argv) +try +{ + if(argc < 4) { + cerr<<"Syntax: saxfr IP-address port zone directory"< packet; + DNSPacketWriter pw(packet, zone, QType::SOA); + ComboAddress master(argv[1], atoi(argv[2])); + + Socket s(master.sin4.sin_family, SOCK_DGRAM); + s.connect(master); + string msg((const char*)&packet[0], packet.size()); + s.writen(msg); + + string reply; + s.read(reply); + MOADNSParser mdp(reply); + for(const auto& r: mdp.d_answers) { + if(r.first.d_type == QType::SOA) { + auto sr = std::dynamic_pointer_cast(r.first.d_content); + cout<<"Current serial number: "<d_st.serial<