diff --git a/util/__init__.py b/dnsdiag/__init__.py similarity index 100% rename from util/__init__.py rename to dnsdiag/__init__.py diff --git a/util/dns.py b/dnsdiag/dns.py similarity index 100% rename from util/dns.py rename to dnsdiag/dns.py diff --git a/util/shared.py b/dnsdiag/shared.py similarity index 100% rename from util/shared.py rename to dnsdiag/shared.py diff --git a/util/whois.py b/dnsdiag/whois.py similarity index 100% rename from util/whois.py rename to dnsdiag/whois.py diff --git a/dnseval.py b/dnseval.py index 9ac84d2..2d8cd87 100755 --- a/dnseval.py +++ b/dnseval.py @@ -37,14 +37,14 @@ import dns.rdatatype import dns.resolver -import util.dns +import dnsdiag.dns __author__ = 'Babak Farrokhi (babak@farrokhi.net)' __license__ = 'BSD' __progname__ = os.path.basename(sys.argv[0]) -from util.dns import PROTO_UDP, PROTO_TCP, PROTO_TLS, PROTO_HTTPS, setup_signal_handler, flags_to_text -from util.shared import __version__, Colors +from dnsdiag.dns import PROTO_UDP, PROTO_TCP, PROTO_TLS, PROTO_HTTPS, setup_signal_handler, flags_to_text +from dnsdiag.shared import __version__, Colors def usage(): @@ -156,7 +156,7 @@ def main(): usage() # validate RR type - if not util.dns.valid_rdatatype(rdatatype): + if not dnsdiag.dns.valid_rdatatype(rdatatype): print('Error: Invalid record type "%s" ' % rdatatype) sys.exit(1) @@ -214,7 +214,7 @@ def main(): continue try: - retval = util.dns.ping(qname, resolver, dst_port, rdatatype, waittime, count, proto, src_ip, + retval = dnsdiag.dns.ping(qname, resolver, dst_port, rdatatype, waittime, count, proto, src_ip, use_edns=use_edns, force_miss=force_miss, want_dnssec=want_dnssec) except SystemExit: diff --git a/dnsping.py b/dnsping.py index 721c170..d46e75f 100755 --- a/dnsping.py +++ b/dnsping.py @@ -39,9 +39,9 @@ import dns.resolver import httpx -from util.dns import PROTO_UDP, PROTO_TCP, PROTO_TLS, PROTO_HTTPS, PROTO_QUIC, PROTO_HTTP3, proto_to_text, \ +from dnsdiag.dns import PROTO_UDP, PROTO_TCP, PROTO_TLS, PROTO_HTTPS, PROTO_QUIC, PROTO_HTTP3, proto_to_text, \ unsupported_feature, random_string, getDefaultPort, valid_rdatatype -from util.shared import __version__ +from dnsdiag.shared import __version__ __author__ = 'Babak Farrokhi (babak@farrokhi.net)' __license__ = 'BSD' diff --git a/dnstraceroute.py b/dnstraceroute.py index 05b7d32..256b75b 100755 --- a/dnstraceroute.py +++ b/dnstraceroute.py @@ -37,9 +37,9 @@ import dns.rdatatype import dns.resolver -import util.whois -from util.dns import PROTO_UDP, PROTO_TCP, setup_signal_handler -from util.shared import __version__, Colors +import dnsdiag.whois +from dnsdiag.dns import PROTO_UDP, PROTO_TCP, setup_signal_handler +from dnsdiag.shared import __version__, Colors # Global Variables quiet = False @@ -116,7 +116,7 @@ def ping(qname, server, rdtype, proto, port, ttl, timeout, src_ip, use_edns): resp_time = None try: - resp = util.dns.ping(qname, server, port, rdtype, timeout, 1, proto, src_ip, use_edns, force_miss=False, + resp = dnsdiag.dns.ping(qname, server, port, rdtype, timeout, 1, proto, src_ip, use_edns, force_miss=False, want_dnssec=False, socket_ttl=ttl) except SystemExit: @@ -205,7 +205,7 @@ def main(): color = Colors(color_mode) # validate RR type - if not util.dns.valid_rdatatype(rdatatype): + if not dnsdiag.dns.valid_rdatatype(rdatatype): print('Error: Invalid record type "%s" ' % rdatatype) sys.exit(1) @@ -299,7 +299,7 @@ def main(): if curr_addr: as_name = "" if as_lookup: - asn, whois_cache = util.whois.asn_lookup(curr_addr, whois_cache) + asn, whois_cache = dnsdiag.whois.asn_lookup(curr_addr, whois_cache) as_name = '' try: if asn and asn.asn != "NA": @@ -338,7 +338,7 @@ def main(): if __name__ == '__main__': try: - whois_cache = util.whois.restore() + whois_cache = dnsdiag.whois.restore() main() finally: - util.whois.save(whois_cache) + dnsdiag.whois.save(whois_cache) diff --git a/setup.py b/setup.py index ec0c9cc..a7b6c47 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,5 @@ from setuptools import setup, find_packages -from util.shared import __version__ +from dnsdiag.shared import __version__ setup( name="dnsdiag",