From 5b902269d6231f38aad34b5756d0acca5578b5da Mon Sep 17 00:00:00 2001 From: Peter van Dijk Date: Thu, 5 Nov 2015 10:53:11 +0100 Subject: [PATCH] hack graphviz back in --- pdns/toysdig.cc | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/pdns/toysdig.cc b/pdns/toysdig.cc index feb11a3a8..740b8d43d 100644 --- a/pdns/toysdig.cc +++ b/pdns/toysdig.cc @@ -286,40 +286,38 @@ dState getDenial(rrsetmap_t &validrrsets, DNSName qname, uint16_t qtype) dState ret; return ret; } -/* string dotEscape(string name) { return "\"" + boost::replace_all_copy(name, "\"", "\\\"") + "\""; } -string dotName(string type, string name, string tag) +string dotName(string type, DNSName name, string tag) { if(tag == "") - return type+" "+name; + return type+" "+name.toStringNoDot(); else - return type+" "+name+"/"+tag; + return type+" "+name.toStringNoDot()+"/"+tag; } -void dotNode(string type, string name, string tag, string content) +void dotNode(string type, DNSName name, string tag, string content) { cout<<" " < " <first.first<<"/"<(rrc.d_tag), DNSRecordContent::NumberToType(rrc.d_type), j->first.first, "", isValid ? "green" : "red"); - */ + } // FIXME: break out enough levels } @@ -419,7 +417,7 @@ vState getKeysFor(TCPResolver& tr, const DNSName& zone, keymap_t &keyset) { DNSKEYRecordContent drc=dynamic_cast (*(i->first.d_content)); tkeymap.insert(make_pair(drc.getTag(), drc)); - // dotNode("DNSKEY", qname, lexical_cast(drc.getTag()), (boost::format("tag=%d, algo=%d") % drc.getTag() % static_cast(drc.d_algorithm)).str()); + dotNode("DNSKEY", qname, lexical_cast(drc.getTag()), (boost::format("tag=%d, algo=%d") % drc.getTag() % static_cast(drc.d_algorithm)).str()); toSign.push_back(i->first.d_content); toSignTags.push_back(drc.getTag()); @@ -440,10 +438,10 @@ vState getKeysFor(TCPResolver& tr, const DNSName& zone, keymap_t &keyset) if(isValid) { cerr<<"got valid DNSKEY"<(dsrc.d_tag)*/, (boost::format("tag=%d, digest algo=%d, algo=%d") % dsrc.d_tag % static_cast(dsrc.d_digesttype) % static_cast(dsrc.d_algorithm)).str()); + dotNode("DS", qname, "" /*lexical_cast(dsrc.d_tag)*/, (boost::format("tag=%d, digest algo=%d, algo=%d") % dsrc.d_tag % static_cast(dsrc.d_digesttype) % static_cast(dsrc.d_algorithm)).str()); } // cout<<" subgraph "< "<(dsrc.d_digesttype)<<"\" ]; label = \"zone: "<(dsrc.d_tag)*/, "DNSKEY", qname, lexical_cast(drc.getTag()), isValid ? "green" : "red"); + dotEdge(DNSName("."), "DS", qname, "" /*lexical_cast(dsrc.d_tag)*/, "DNSKEY", qname, lexical_cast(drc.getTag()), isValid ? "green" : "red"); // dotNode("DNSKEY", qname, (boost::format("tag=%d, algo=%d") % drc.getTag() % static_cast(drc.d_algorithm)).str()); } } @@ -465,11 +463,11 @@ vState getKeysFor(TCPResolver& tr, const DNSName& zone, keymap_t &keyset) for(keymap_t::const_iterator j=r.first; j!=r.second; j++) { cerr<<"validating"<second.d_algorithm, j->second.d_key)->verify(msg, i->d_signature); - // for(uint16_t tag : toSignTags) { - // dotEdge(qname, - // "DNSKEY", qname, lexical_cast(i->d_tag), - // "DNSKEY", qname, lexical_cast(tag), isValid ? "green" : "red"); - // } + for(uint16_t tag : toSignTags) { + dotEdge(qname, + "DNSKEY", qname, lexical_cast(i->d_tag), + "DNSKEY", qname, lexical_cast(tag), isValid ? "green" : "red"); + } if(isValid) { -- 2.40.0