Slip package
Project description
sliplib
— A module for the SLIP protocol
The sliplib
module implements the encoding and decoding
functionality for SLIP packets, as described in
RFC 1055.
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
for detailed information.
Background
The SLIP protocol is described in RFC 1055 (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,
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file sliplib-0.7.1.tar.gz
.
File metadata
- Download URL: sliplib-0.7.1.tar.gz
- Upload date:
- Size: 17.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
a109f4413adc72612750fbbf0d35b13e2a28f12332ce4ca3c106f9064c310053
|
|
MD5 |
749859865682ec58f25ffc6a4300db7f
|
|
BLAKE2b-256 |
d85974e2b1ba62c30af2b1ce1fcb51344be977d9b95a769df79b65a06556c590
|
Provenance
The following attestation bundles were made for sliplib-0.7.1.tar.gz
:
Publisher:
release.yml
on rhjdjong/SlipLib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
sliplib-0.7.1.tar.gz
-
Subject digest:
a109f4413adc72612750fbbf0d35b13e2a28f12332ce4ca3c106f9064c310053
- Sigstore transparency entry: 219303689
- Sigstore integration time:
-
Permalink:
rhjdjong/SlipLib@fd7117d59fc60b1c434d6da5c5b890bc1ed4c99f
-
Branch / Tag:
refs/heads/release/0.7.1
- Owner: https://github.com/rhjdjong
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
release.yml@fd7117d59fc60b1c434d6da5c5b890bc1ed4c99f
-
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file sliplib-0.7.1-py3-none-any.whl
.
File metadata
- Download URL: sliplib-0.7.1-py3-none-any.whl
- Upload date:
- Size: 21.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
b0cbddd3ad9abc4d004dba47e5d85cc1e899c2c52d385c52cb36b41e0b298d50
|
|
MD5 |
ea821fa9d6dd301e09ba58c56c674ae6
|
|
BLAKE2b-256 |
cfebc0dc4e5da99663c25e80c49987258f0703eb2634d35db0339f152b3b5519
|
Provenance
The following attestation bundles were made for sliplib-0.7.1-py3-none-any.whl
:
Publisher:
release.yml
on rhjdjong/SlipLib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
sliplib-0.7.1-py3-none-any.whl
-
Subject digest:
b0cbddd3ad9abc4d004dba47e5d85cc1e899c2c52d385c52cb36b41e0b298d50
- Sigstore transparency entry: 219303697
- Sigstore integration time:
-
Permalink:
rhjdjong/SlipLib@fd7117d59fc60b1c434d6da5c5b890bc1ed4c99f
-
Branch / Tag:
refs/heads/release/0.7.1
- Owner: https://github.com/rhjdjong
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
release.yml@fd7117d59fc60b1c434d6da5c5b890bc1ed4c99f
-
Trigger Event:
workflow_dispatch
-
Statement type: