Implements interfaces: twisted.pair.tuntap._IInputOutputSystem

Add extra skipping logic so tests that try to create real tunnel devices on platforms where those are not supported automatically get skipped.

Method open Attempt an open, but if the file is /dev/net/tun and it does not exist, translate the error into SkipTest so that tests that require platform support for tuntap devices are skipped instead of failed.
Method ioctl Attempt an ioctl, but translate permission denied errors into SkipTest so that tests that require elevated system privileges and do not have them are skipped instead of failed.
Method sendUDP Use the platform network stack to send a datagram to the given address.
Method receiveUDP Use the platform network stack to receive a datagram sent to the given address.
def open(self, filename, *args, **kwargs):

Attempt an open, but if the file is /dev/net/tun and it does not exist, translate the error into SkipTest so that tests that require platform support for tuntap devices are skipped instead of failed.

def ioctl(self, *args, **kwargs):

Attempt an ioctl, but translate permission denied errors into SkipTest so that tests that require elevated system privileges and do not have them are skipped instead of failed.

def sendUDP(self, datagram, address):

Use the platform network stack to send a datagram to the given address.

ParametersdatagramA UDP datagram payload to send. (type: bytes)
addressThe destination to which to send the datagram. (type: tuple of (bytes, int))
ReturnsThe address from which the UDP datagram was sent. (type: tuple of (bytes, int))
def receiveUDP(self, fileno, host, port):

Use the platform network stack to receive a datagram sent to the given address.

ParametersfilenoThe file descriptor of the tunnel used to send the datagram. This is ignored because a real socket is used to receive the datagram. (type: int)
hostThe IPv4 address at which the datagram will be received. (type: bytes)
portThe UDP port number at which the datagram will be received. (type: int)
ReturnsA socket.socket which can be used to receive the specified datagram.
API Documentation for twisted, generated by pydoctor at 2020-03-25 17:34:30.