Tundra-NAT64 external address translation library for Python
Project description
tundra-xaxlib-python
tundra-xaxlib-python
, or Tundra-NAT64 external address translation library for Python, enables one to easily
parse and constructs wireformat messages used by Tundra-NAT64 external address translation protocol
(specification)
in Python programs. Although this library will probably be most commonly used to implement servers, it is also
able to construct request messages and parse response messages, which are actions that only the client, i.e.
Tundra-NAT64, needs to perform.
NOTE: Some links in this README may not work if the file is not viewed through GitHub.
Installation
This library targets Python 3.9 and above. It might work in older Python 3 versions, but nothing is guaranteed.
tundra-xaxlib-python
may be installed from PyPI using pip
:
python3 -m pip install --upgrade tundra-xaxlib-python
Usage
Classes and variables try to reflect the protocol specification as closely as possible in terms of both names and functionality, so I would recommend to start there.
This library's central (data)classes are RequestMessage,
SuccessfulResponseMessage and
ErroneousResponseMessage. Each of them can be instantiated the
usual way, or by using the from_wireformat()
classmethod for parsing wireformat. The instances then have the
to_wireformat()
method for constructing wireformat. The RequestMessage
class has additional methods for constructing response message objects which use existing data from the request:
generate_successful_response()
and generate_erroneous_response()
. Methods which have it documented in their
docstrings raise InvalidMessageDataExc (or a subclass thereof) in
case an error occurs. If you, for some reason, needed to detect the appropriate message class from wireformat or
instantiate it straightaway, the WireformatParsingHelpers class
is there to help with that.
Examples
- 001_nat64.py – An example external address translation server which works almost exactly
the same as Tundra-NAT64's built-in
nat64
addressing mode, i.e. it is able to, without the help of a NAT66, statelessly translate packets from one source IPv6 to one source IPv4 and do the inverse process for packets going the other way.
Licensing
This project is licensed under the 3-clause BSD license – see the LICENSE file.
Programmed by Vít Labuda.
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
File details
Details for the file tundra-xaxlib-python-1.0.2.tar.gz
.
File metadata
- Download URL: tundra-xaxlib-python-1.0.2.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.5 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39f7b9749ba26fcb5e0351d576e2cd1bf32a8e0baa81f52d47ac6ae1ffc6d96f |
|
MD5 | 61bc59539115669770dc66e042f7c9fe |
|
BLAKE2b-256 | a5778521bdedea7384d9946cba5e41be62fda06253e4b2ccd7f3fc90555488a5 |