Skip to main content

Prepopulated sockaddr helpers for Python using ctypes

Project description

sockaddr

Sockaddr helpers for Python.

For example, auditd logs log the socket address in hex form. This should help in decoding them:

s_in = sockaddr.from_hex("02000035898A1005000000000000000030BED20858D83A0010000000")
print(type(s_in))
# <class 'sockaddr.addr.sockaddr_in'>

# Using some helper functions for IPv4/6
print(sockaddr.inet_addr(s_in))
# '137.138.16.5'
print(sockaddr.inet_port(s_in))
# 13568

Or unix sockets

s_un = sockaddr.from_hex("01002F7661722F72756E2F646F636B65722E736F636B00")
print(s_un.sun_path.decode("utf-8"))
# /var/run/docker.sock

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sockaddr-0.1.3.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sockaddr-0.1.3-py2.py3-none-any.whl (14.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file sockaddr-0.1.3.tar.gz.

File metadata

  • Download URL: sockaddr-0.1.3.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.31.0

File hashes

Hashes for sockaddr-0.1.3.tar.gz
Algorithm Hash digest
SHA256 ce2e70326fd45b2c21cf12e9f43ae667af5240ecc42087d2d5137af51fde84b0
MD5 133afa45d5353598376a570b565d52f2
BLAKE2b-256 27abfc0a0dc1dafadd721d4d2965fab22178155807d41404f26800ba0b6d3a02

See more details on using hashes here.

File details

Details for the file sockaddr-0.1.3-py2.py3-none-any.whl.

File metadata

  • Download URL: sockaddr-0.1.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 14.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.31.0

File hashes

Hashes for sockaddr-0.1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4329e94140e1820227520f89757ad4d3a65e0b9c2315af85adf6d0f58506a898
MD5 6b4c4e872b2459d4970c795a3a1173bd
BLAKE2b-256 893ab6e8cb9b318deb1ab15cf8eecf04455c20d538e13d7845a708e1d54b61f9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page