diff options
Diffstat (limited to 'netlib/utils.py')
-rw-r--r-- | netlib/utils.py | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/netlib/utils.py b/netlib/utils.py index 00e1cd12..69ba456a 100644 --- a/netlib/utils.py +++ b/netlib/utils.py @@ -43,25 +43,4 @@ def hexdump(s): parts.append( (o, x, cleanBin(part, True)) ) - return parts - - -def inet_ntop(address_family, packed_ip): - if hasattr(socket, "inet_ntop"): - return socket.inet_ntop(address_family, packed_ip) - # Windows Fallbacks - if address_family == socket.AF_INET: - return socket.inet_ntoa(packed_ip) - if address_family == socket.AF_INET6: - ip = packed_ip.encode("hex") - return ":".join([ip[i:i + 4] for i in range(0, len(ip), 4)]) - - -def inet_pton(address_family, ip_string): - if hasattr(socket, "inet_pton"): - return socket.inet_pton(address_family, ip_string) - # Windows Fallbacks - if address_family == socket.AF_INET: - return socket.inet_aton(ip_string) - if address_family == socket.AF_INET6: - return ip_string.replace(":", "").decode("hex")
\ No newline at end of file + return parts
\ No newline at end of file |