sockaddr


Namesockaddr JSON
Version 0.1.3 PyPI version JSON
download
home_pageNone
SummaryPrepopulated sockaddr helpers for Python using ctypes
upload_time2024-04-30 14:14:39
maintainerNone
docs_urlNone
authorNone
requires_pythonNone
licenseNone
keywords sockaddr saddr auditd
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# sockaddr

Sockaddr helpers for Python.

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

```python3
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

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


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "sockaddr",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "sockaddr, saddr, auditd",
    "author": null,
    "author_email": "tedk <tedk@kpn-cert.nl>",
    "download_url": "https://files.pythonhosted.org/packages/27/ab/fc0a0dc1dafadd721d4d2965fab22178155807d41404f26800ba0b6d3a02/sockaddr-0.1.3.tar.gz",
    "platform": null,
    "description": "\n# sockaddr\n\nSockaddr helpers for Python.\n\nFor example, auditd logs log the socket address in hex form. This should help in decoding them: \n\n```python3\ns_in = sockaddr.from_hex(\"02000035898A1005000000000000000030BED20858D83A0010000000\")\nprint(type(s_in))\n# <class 'sockaddr.addr.sockaddr_in'>\n\n# Using some helper functions for IPv4/6\nprint(sockaddr.inet_addr(s_in))\n# '137.138.16.5'\nprint(sockaddr.inet_port(s_in))\n# 13568\n```\n\n\n# Or unix sockets\n\n```python3\ns_un = sockaddr.from_hex(\"01002F7661722F72756E2F646F636B65722E736F636B00\")\nprint(s_un.sun_path.decode(\"utf-8\"))\n# /var/run/docker.sock\n```\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Prepopulated sockaddr helpers for Python using ctypes",
    "version": "0.1.3",
    "project_urls": {
        "Github": "https://github.com/Kalkran/sockaddr"
    },
    "split_keywords": [
        "sockaddr",
        " saddr",
        " auditd"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "893ab6e8cb9b318deb1ab15cf8eecf04455c20d538e13d7845a708e1d54b61f9",
                "md5": "6b4c4e872b2459d4970c795a3a1173bd",
                "sha256": "4329e94140e1820227520f89757ad4d3a65e0b9c2315af85adf6d0f58506a898"
            },
            "downloads": -1,
            "filename": "sockaddr-0.1.3-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6b4c4e872b2459d4970c795a3a1173bd",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 14895,
            "upload_time": "2024-04-30T14:14:08",
            "upload_time_iso_8601": "2024-04-30T14:14:08.398785Z",
            "url": "https://files.pythonhosted.org/packages/89/3a/b6e8cb9b318deb1ab15cf8eecf04455c20d538e13d7845a708e1d54b61f9/sockaddr-0.1.3-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "27abfc0a0dc1dafadd721d4d2965fab22178155807d41404f26800ba0b6d3a02",
                "md5": "133afa45d5353598376a570b565d52f2",
                "sha256": "ce2e70326fd45b2c21cf12e9f43ae667af5240ecc42087d2d5137af51fde84b0"
            },
            "downloads": -1,
            "filename": "sockaddr-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "133afa45d5353598376a570b565d52f2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 14302,
            "upload_time": "2024-04-30T14:14:39",
            "upload_time_iso_8601": "2024-04-30T14:14:39.224572Z",
            "url": "https://files.pythonhosted.org/packages/27/ab/fc0a0dc1dafadd721d4d2965fab22178155807d41404f26800ba0b6d3a02/sockaddr-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-30 14:14:39",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Kalkran",
    "github_project": "sockaddr",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "sockaddr"
}
        
Elapsed time: 0.22432s