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.2.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.2-py2.py3-none-any.whl (14.9 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: sockaddr-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 8376ce289cfe3afa6de791a13cac8a4955217a38e1db5c260a91e144ebfed751
MD5 af0db35517800772d66716879d22fd3f
BLAKE2b-256 14de36e79d3d6330ec05b0cc3d7a0c3e54fcc54c15841022fd3caeb62e7d46a0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sockaddr-0.1.2-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.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8b05bcd653fe96b14291693837b32b219e414a024f2b8a49d5a3d80da7411a18
MD5 325a528ea75391a4d5cb27fd7ed6491a
BLAKE2b-256 ce10ab9e7e6da0764578b462d940c4a78497e61bf31b5d8fbb3091774e28e703

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