Skip to main content

wintun (WireGuard) wrapper for Python

Project description

Wintun wrapper for Python 3

Example

import pywintunx_pmd3

def log(level: int, timestamp: Int64, message: str):
  pass

pywintunx_pmd3.set_logger(log)
pywintunx_pmd3.install_wetest_driver()

tun_dev = pywintunx_pmd3.TunTapDevice()
# Avaliable constructor include
# or TunTapDevice(name='XX')
# or TunTapDevice(name='XX', type='xxx')
# or TunTapDevice(name='XX', type='xxx', guid='xxxs')
# or TunTapDevice(name='XX', type='xxx', proto_aware=True)
# tundev.name, readonly property
tundev.ring_capacity = 8*1024*1024
tun_dev.mtu4 = 1460             # set ipv4 subinterface mtu
tun_dev.mtu = 1452              # set ipv6 subinterface mtu
tundev.addr4 = '10.2.3.4'       # set ipv4 subinterface address
tundev.addr = 'ffee:aadf:8877:2'# set ipv6 subinterface mtu
tundev.up()

packet = tundev.read() # receive a packet
tundev.wait_read_event()

tundev.write(b'\x00') # send a packet..

tundev.down()

...
tundev.close()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

pywintunx_pmd3-1.0.2-cp313-cp313-win_amd64.whl (271.0 kB view hashes)

Uploaded CPython 3.13 Windows x86-64

pywintunx_pmd3-1.0.2-cp312-cp312-win_amd64.whl (271.0 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

pywintunx_pmd3-1.0.2-cp311-cp311-win_amd64.whl (270.9 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

pywintunx_pmd3-1.0.2-cp310-cp310-win_amd64.whl (275.6 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

pywintunx_pmd3-1.0.2-cp39-cp39-win_amd64.whl (275.7 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

pywintunx_pmd3-1.0.2-cp38-cp38-win_amd64.whl (275.6 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

pywintunx_pmd3-1.0.2-cp37-cp37m-win_amd64.whl (275.6 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page