Object-oriented wrapper around the Linux Tun/Tap device
Project description
Fork of PyTap that supports Python 2 & 3.
Installation
You can install, upgrade, and uninstall pytap2 with these commands:
$ pip install pytap2
$ pip install --upgrade pytap2
$ pip uninstall pytap2
Usage
Using as a context manager automatically brings up the device and closes it at the end of the with block.
from pytap2 import TapDevice
with TapDevice() as device:
device.ifconfig(mtu=1300)
device.write(b'0000')
Or manually call up() and close().
from pytap2 import TapDevice
device = TapDevice()
device.up()
device.ifconfig(mtu=1300)
device.write(b'0000')
device.close()
Releases
1.2.0 - 2017-06-19
Context manager support added.
1.1.0 - 2017-06-17
Allow read() to be called with a specific number of bytes to read.
1.0.0 - 2017-06-16
Initial release that supports Python 2 and 3.
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
pytap2-1.2.0.tar.gz
(4.0 kB
view details)
File details
Details for the file pytap2-1.2.0.tar.gz
.
File metadata
- Download URL: pytap2-1.2.0.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63e29f7166f5618dae3f100e08f6d3227135e9446d3c88ea0de5968084c8d2cc |
|
MD5 | 9fe778c661bd05b4e6fe7108cf369c96 |
|
BLAKE2b-256 | 88c6a899c4fa028941456df76838712419198247297c7119fd1e29e96db83d83 |