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:

ie

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

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: sockaddr-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 eda06b38974e6d1c4052adf215411c16c37263da7b6571c8ad2477fc95a55c89
MD5 fdf558be8bb1508c7ca54f9c74ddd99d
BLAKE2b-256 b056248a6b96d0c74eaf6ac3bbecc4bd2b12e6487ae708e3b80cdbf58d63190a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sockaddr-0.1.1-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.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 767ac16f72edc4af8a9928b39b266a32a607a016cafbf4a5a9bb1b96bad70958
MD5 626985a5771db80e77f310c589d199d8
BLAKE2b-256 fa2058137602bfc911f4392230a70de5c5d16ac7a18bbe64892c90f194ebe36f

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