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)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce2e70326fd45b2c21cf12e9f43ae667af5240ecc42087d2d5137af51fde84b0
|
|
| MD5 |
133afa45d5353598376a570b565d52f2
|
|
| BLAKE2b-256 |
27abfc0a0dc1dafadd721d4d2965fab22178155807d41404f26800ba0b6d3a02
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4329e94140e1820227520f89757ad4d3a65e0b9c2315af85adf6d0f58506a898
|
|
| MD5 |
6b4c4e872b2459d4970c795a3a1173bd
|
|
| BLAKE2b-256 |
893ab6e8cb9b318deb1ab15cf8eecf04455c20d538e13d7845a708e1d54b61f9
|