[](https://pypi.org/project/sliplib/)
[](https://github.com/pypa/hatch)
[](https://github.com/psf/black)
[](https://pycqa.github.io/isort/)
[](https://mypy-lang.org/)


[](https://sliplib.readthedocs.io/en/main/?badge=main)
# `sliplib` — A module for the SLIP protocol
The `sliplib` module implements the encoding and decoding
functionality for SLIP packets, as described in
[RFC 1055][rfc1055].
It defines encoding, decoding, and validation functions,
as well as a driver class that can be used to implement
a SLIP protocol stack, and higher-level classes that
apply the SLIP protocol to TCP connections or IO streams.
Read the [documentation](http://sliplib.readthedocs.org/en/main/)
for detailed information.
## Background
The SLIP protocol is described in [RFC 1055][rfc1055] (*A Nonstandard for
Transmission of IP Datagrams over Serial Lines: SLIP*, J. Romkey,
June 1988). The original purpose of the protocol is
to provide a mechanism to indicate the boundaries of IP packets,
in particular when the IP packets are sent over a connection that
does not provide a framing mechanism, such as serial lines or
dial-up connections.
There is, however, nothing specific to IP in the SLIP protocol.
SLIP offers a generic framing method that can be used for any
type of data that must be transmitted over a (continuous) byte stream.
In fact, the main reason for creating this module
was the need to communicate with a third-party application that
used SLIP over TCP (which is a continuous byte stream)
to frame variable length data structures.
## Usage
### Installation
To install the `sliplib` module, use
```
pip install sliplib
```
### Low-level usage
The recommended basic usage is to run all encoding and decoding operations
through an instantiation `driver` of the `Driver` class, in combination
with the appropriate I/O code.
The `Driver` class itself works without any I/O, and can therefore be used with
any networking code, or any bytestream like pipes, serial I/O, etc.
It can work in synchronous as well as in asynchronous environments.
### High-level usage
The `sliplib` package also provides a `SlipWrapper` abstract baseclass
that provides the methods `send_msg` and `recv_msg` to send
and receive single SLIP-encoded messages. This base class
wraps an instance of the `Driver` class with a user-provided stream.
Two concrete subclasses of `SlipWrapper` are provided:
* `SlipStream` allows the wrapping of a byte IO stream.
* `SlipSocket` allows the wrapping of a TCP socket.
In addition, the module also provides a `SlipRequestHandler`
to facilitate the creation of TCP servers that can handle
SLIP-encoded messages.
## Error Handling
Contrary to the reference implementation described in [RFC 1055][rfc1055],
which chooses to essentially ignore protocol errors,
the functions and classes in the `sliplib` module
raise a `ProtocolError` exception
when handling a SLIP packet with invalid contents.
[rfc1055]: http://tools.ietf.org/html/rfc1055.html
Raw data
{
"_id": null,
"home_page": null,
"name": "sliplib",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "RFC1055, framing, message, protocol, slip",
"author": null,
"author_email": "Ruud de Jong <ruud.de.jong@xs4all.nl>",
"download_url": "https://files.pythonhosted.org/packages/20/1a/02c4d06dcb142399c5fca5af52b9c45e1762ca53e0bb8f6ad09f606b48d4/sliplib-0.7.0.tar.gz",
"platform": null,
"description": "[](https://pypi.org/project/sliplib/)\n[](https://github.com/pypa/hatch)\n[](https://github.com/psf/black)\n[](https://pycqa.github.io/isort/)\n[](https://mypy-lang.org/)\n\n\n[](https://sliplib.readthedocs.io/en/main/?badge=main)\n\n# `sliplib` — A module for the SLIP protocol\n\nThe `sliplib` module implements the encoding and decoding\nfunctionality for SLIP packets, as described in\n[RFC 1055][rfc1055].\nIt defines encoding, decoding, and validation functions,\nas well as a driver class that can be used to implement\na SLIP protocol stack, and higher-level classes that\napply the SLIP protocol to TCP connections or IO streams.\nRead the [documentation](http://sliplib.readthedocs.org/en/main/)\nfor detailed information.\n\n## Background\n\nThe SLIP protocol is described in [RFC 1055][rfc1055] (*A Nonstandard for\nTransmission of IP Datagrams over Serial Lines: SLIP*, J. Romkey,\nJune 1988). The original purpose of the protocol is\nto provide a mechanism to indicate the boundaries of IP packets,\nin particular when the IP packets are sent over a connection that\ndoes not provide a framing mechanism, such as serial lines or\ndial-up connections.\n\nThere is, however, nothing specific to IP in the SLIP protocol.\nSLIP offers a generic framing method that can be used for any\ntype of data that must be transmitted over a (continuous) byte stream.\nIn fact, the main reason for creating this module\nwas the need to communicate with a third-party application that\nused SLIP over TCP (which is a continuous byte stream)\nto frame variable length data structures.\n\n\n## Usage\n\n### Installation\n\nTo install the `sliplib` module, use\n\n```\npip install sliplib\n```\n\n### Low-level usage\n\nThe recommended basic usage is to run all encoding and decoding operations\nthrough an instantiation `driver` of the `Driver` class, in combination\nwith the appropriate I/O code.\nThe `Driver` class itself works without any I/O, and can therefore be used with\nany networking code, or any bytestream like pipes, serial I/O, etc.\nIt can work in synchronous as well as in asynchronous environments.\n\n### High-level usage\n\nThe `sliplib` package also provides a `SlipWrapper` abstract baseclass\nthat provides the methods `send_msg` and `recv_msg` to send\nand receive single SLIP-encoded messages. This base class\nwraps an instance of the `Driver` class with a user-provided stream.\n\nTwo concrete subclasses of `SlipWrapper` are provided:\n\n* `SlipStream` allows the wrapping of a byte IO stream.\n* `SlipSocket` allows the wrapping of a TCP socket.\n\nIn addition, the module also provides a `SlipRequestHandler`\nto facilitate the creation of TCP servers that can handle\nSLIP-encoded messages.\n\n\n## Error Handling\n\nContrary to the reference implementation described in [RFC 1055][rfc1055],\nwhich chooses to essentially ignore protocol errors,\nthe functions and classes in the `sliplib` module\nraise a `ProtocolError` exception\nwhen handling a SLIP packet with invalid contents.\n\n[rfc1055]: http://tools.ietf.org/html/rfc1055.html\n",
"bugtrack_url": null,
"license": null,
"summary": "Slip package",
"version": "0.7.0",
"project_urls": {
"Source code": "https://github.com/rhjdjong/SlipLib"
},
"split_keywords": [
"rfc1055",
" framing",
" message",
" protocol",
" slip"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e18420c39797d9b21c7a0f2401110f369fb8a12e0834c5bdf8eb773f26562216",
"md5": "2206e3456a5def00179e4d8ace02a9f9",
"sha256": "40d9a2b230ea4e41df69de58e1b8899127aae152fd35d3f27b9a877662bf542a"
},
"downloads": -1,
"filename": "sliplib-0.7.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2206e3456a5def00179e4d8ace02a9f9",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 20997,
"upload_time": "2024-12-22T17:42:40",
"upload_time_iso_8601": "2024-12-22T17:42:40.774216Z",
"url": "https://files.pythonhosted.org/packages/e1/84/20c39797d9b21c7a0f2401110f369fb8a12e0834c5bdf8eb773f26562216/sliplib-0.7.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "201a02c4d06dcb142399c5fca5af52b9c45e1762ca53e0bb8f6ad09f606b48d4",
"md5": "0dc2a35e7ea6fce3d0585b788ade3535",
"sha256": "ec1ea9bad58844636977f1f0f45a7a0a3eecbf6ada8baadd4026d43145a737ff"
},
"downloads": -1,
"filename": "sliplib-0.7.0.tar.gz",
"has_sig": false,
"md5_digest": "0dc2a35e7ea6fce3d0585b788ade3535",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 17006,
"upload_time": "2024-12-22T17:42:43",
"upload_time_iso_8601": "2024-12-22T17:42:43.111145Z",
"url": "https://files.pythonhosted.org/packages/20/1a/02c4d06dcb142399c5fca5af52b9c45e1762ca53e0bb8f6ad09f606b48d4/sliplib-0.7.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-22 17:42:43",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "rhjdjong",
"github_project": "SlipLib",
"travis_ci": true,
"coveralls": false,
"github_actions": true,
"appveyor": true,
"lcname": "sliplib"
}