diff options
author | Casey Deccio <casey@deccio.net> | 2017-05-17 01:37:59 +0300 |
---|---|---|
committer | Casey Deccio <casey@deccio.net> | 2017-06-02 17:26:28 +0300 |
commit | e9a40153a295992ed2065c20b5d661b4283c441e (patch) | |
tree | 6bed31881228f7cee5d97f56d24a096e0c50f6dc /contrib | |
parent | 32ad081a6bdd8a6941906ba12680df662f2b3a9f (diff) |
Add +nsid option
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/digviz | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/contrib/digviz b/contrib/digviz index 19c9182..df4def4 100755 --- a/contrib/digviz +++ b/contrib/digviz @@ -200,7 +200,14 @@ class DigCommandLineQuery: elif arg == '+nomultiline': self.multiline = False #TODO +ndots=D - #TODO +[no]nsid + elif arg == '+nsid': + if self.edns < 0: + self.edns = 0 + if not [x for x in filter(lambda x: x.otype == dns.edns.NSID, self.edns_options)]: + self.edns_options.append(dns.edns.GenericOption(dns.edns.NSID, b'')) + elif arg == '+nonsid': + l = [x for x in filter(lambda x: x.otype == dns.edns.NSID, self.edns_options)] + self.edns_options.remove(dns.edns.GenericOption(dns.edns.NSID, b'')) #TODO +[no]nssearch #TODO +[no]onesoa #TODO +[no]qr @@ -427,6 +434,17 @@ class DigCommandLineQuery: s += ';; OPT PSEUDOSECTION:\n' s += '; EDNS: version: %d, flags: %s; udp: %d\n' % (response.message.edns, dns.flags.edns_to_text(response.message.ednsflags).lower(), response.message.payload) + for opt in response.message.options: + chars = [] + if opt.otype == dns.edns.NSID: + s += '; NSID:' + for b in opt.data: + s += ' %02x' % b + chars.append(chr(b)) + for c in chars: + s += ' (%s)' % c + s += '\n' + if response.message.question and self.show_question: if self.show_comments: s += ';; QUESTION SECTION:\n' |