diff options
author | Maximilian Hils <git@maximilianhils.com> | 2014-06-25 21:16:47 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2014-06-25 21:16:47 +0200 |
commit | e69133f98c513a99c017ad561ea9195280e3f7c5 (patch) | |
tree | bc74a103593173eb170c71734f6844a22b0a6372 /netlib/utils.py | |
parent | 6405595ae8593a52f6b81d7f311044f113476d82 (diff) | |
download | mitmproxy-e69133f98c513a99c017ad561ea9195280e3f7c5.tar.gz mitmproxy-e69133f98c513a99c017ad561ea9195280e3f7c5.tar.bz2 mitmproxy-e69133f98c513a99c017ad561ea9195280e3f7c5.zip |
remove ntop windows workaround
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 |