sliplib


Namesliplib JSON
Version 0.6.3 PyPI version JSON
download
home_pageNone
SummarySlip package
upload_time2024-12-04 21:15:19
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT
keywords rfc1055 framing message protocol slip
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            
.. image:: https://readthedocs.org/projects/sliplib/badge/?version=latest
   :target: http://sliplib.readthedocs.org/en/master/?badge=master
   :alt: ReadTheDocs Documentation Status

.. image:: https://travis-ci.org/rhjdjong/SlipLib.svg
   :target: https://travis-ci.org/rhjdjong/SlipLib
   :alt: Travis Test Status

.. image:: https://ci.appveyor.com/api/projects/status/d1nwwn34xoaxh3tt/branch/master?svg=true
   :target: https://ci.appveyor.com/project/RuuddeJong/sliplib/branch/master
   :alt: AppVeyor Test Status


==============================================
``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 <http://sliplib.readthedocs.org/en/master/>`_
for detailed information.

Background
==========

The SLIP protocol is described in :rfc:`1055` (:title:`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

.. code::

    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.

The `Driver` class offers the methods
`send` and `receive` to handle
the conversion between messages and SLIP-encoded packets.

High-level usage
----------------

The module 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
use a `ProtocolError` exception
to indicate protocol errors, i.e. SLIP packets with invalid byte sequences.
The `Driver` class raises the `ProtocolError` exception
as soon as a complete SLIP packet with an invalid byte sequence is received.
The `SlipWrapper` class and its subclasses catch the `ProtocolError`\s
raised by the `Driver` class, and re-raise them when
an attempt is made to read the contents of a SLIP packet that contained
invalid data.

            

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/7a/5a/a653d588e7dfc21701be7c1dbf239d55c80f78a3e144423f697d4601ce02/sliplib-0.6.3.tar.gz",
    "platform": null,
    "description": "\n.. image:: https://readthedocs.org/projects/sliplib/badge/?version=latest\n   :target: http://sliplib.readthedocs.org/en/master/?badge=master\n   :alt: ReadTheDocs Documentation Status\n\n.. image:: https://travis-ci.org/rhjdjong/SlipLib.svg\n   :target: https://travis-ci.org/rhjdjong/SlipLib\n   :alt: Travis Test Status\n\n.. image:: https://ci.appveyor.com/api/projects/status/d1nwwn34xoaxh3tt/branch/master?svg=true\n   :target: https://ci.appveyor.com/project/RuuddeJong/sliplib/branch/master\n   :alt: AppVeyor Test Status\n\n\n==============================================\n``sliplib`` --- A module for the SLIP protocol\n==============================================\n\n\nThe `sliplib` module implements the encoding and decoding\nfunctionality for SLIP packets, as described in :rfc:`1055`.\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/master/>`_\nfor detailed information.\n\nBackground\n==========\n\nThe SLIP protocol is described in :rfc:`1055` (:title:`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\nUsage\n=====\n\nInstallation\n------------\n\nTo install the `sliplib` module, use\n\n.. code::\n\n    pip install sliplib\n\nLow-level usage\n---------------\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\nThe `Driver` class offers the methods\n`send` and `receive` to handle\nthe conversion between messages and SLIP-encoded packets.\n\nHigh-level usage\n----------------\n\nThe module 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\nError Handling\n==============\n\nContrary to the reference implementation described in :rfc:`1055`,\nwhich chooses to essentially ignore protocol errors,\nthe functions and classes in the `sliplib` module\nuse a `ProtocolError` exception\nto indicate protocol errors, i.e. SLIP packets with invalid byte sequences.\nThe `Driver` class raises the `ProtocolError` exception\nas soon as a complete SLIP packet with an invalid byte sequence is received.\nThe `SlipWrapper` class and its subclasses catch the `ProtocolError`\\s\nraised by the `Driver` class, and re-raise them when\nan attempt is made to read the contents of a SLIP packet that contained\ninvalid data.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Slip package",
    "version": "0.6.3",
    "project_urls": {
        "Source code": "https://github.com/rhjdjong/SlipLib"
    },
    "split_keywords": [
        "rfc1055",
        " framing",
        " message",
        " protocol",
        " slip"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f4cf7056240c062bdffa88e267f979d768c4a6107034304ccb9bf820a259df8b",
                "md5": "9ea06d9eebd3fed60cf6c2e6abd8b23e",
                "sha256": "49830488342188fb54f478d79b7abc754676a05fd4c5522161a15d9ddf698ee0"
            },
            "downloads": -1,
            "filename": "sliplib-0.6.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9ea06d9eebd3fed60cf6c2e6abd8b23e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 17245,
            "upload_time": "2024-12-04T21:15:17",
            "upload_time_iso_8601": "2024-12-04T21:15:17.554117Z",
            "url": "https://files.pythonhosted.org/packages/f4/cf/7056240c062bdffa88e267f979d768c4a6107034304ccb9bf820a259df8b/sliplib-0.6.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7a5aa653d588e7dfc21701be7c1dbf239d55c80f78a3e144423f697d4601ce02",
                "md5": "32e4e5ea4e37ccc7c0355c77f51c8c8c",
                "sha256": "e8f0846ade29d763a67d0ca39bc18e627c8f32813fcbdf0065fb80eb7bf1b727"
            },
            "downloads": -1,
            "filename": "sliplib-0.6.3.tar.gz",
            "has_sig": false,
            "md5_digest": "32e4e5ea4e37ccc7c0355c77f51c8c8c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 14127,
            "upload_time": "2024-12-04T21:15:19",
            "upload_time_iso_8601": "2024-12-04T21:15:19.525651Z",
            "url": "https://files.pythonhosted.org/packages/7a/5a/a653d588e7dfc21701be7c1dbf239d55c80f78a3e144423f697d4601ce02/sliplib-0.6.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-04 21:15:19",
    "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"
}
        
Elapsed time: 0.37437s