class documentation

class twisted.pair.testing.Tunnel: (source)

View In Hierarchy

An in-memory implementation of a tun or tap device.

Class Variable EAGAIN_STYLE Undocumented
Class Variable EWOULDBLOCK_STYLE Undocumented
Class Variable EINTR_STYLE Undocumented
Class Variable SEND_BUFFER_SIZE Undocumented
Method __init__
Instance Variable system Undocumented
Instance Variable openFlags Undocumented
Instance Variable tunnelMode Undocumented
Instance Variable requestedName Undocumented
Instance Variable name Undocumented
Instance Variable readBuffer Undocumented
Instance Variable writeBuffer Undocumented
Instance Variable pendingSignals Undocumented
Property blocking If the file descriptor for this tunnel is open in blocking mode, True. False otherwise.
Property closeOnExec If the file descriptor for this tunnel is marked as close-on-exec, True. False otherwise.
Method addToReadBuffer Deliver a datagram to this tunnel's read buffer. This makes it available to be read later using the read method.
Method read Read a datagram out of this tunnel.
Method write Write a datagram into this tunnel.
Class Variable _DEVICE_NAME A string representing the conventional filesystem entry for the tunnel factory character special device.
_DEVICE_NAME = (source)
A string representing the conventional filesystem entry for the tunnel factory character special device.
(type: bytes)
EAGAIN_STYLE = (source)

Undocumented

EWOULDBLOCK_STYLE = (source)

Undocumented

EINTR_STYLE = (source)

Undocumented

SEND_BUFFER_SIZE = (source)

Undocumented

(type: int)
def __init__(self, system, openFlags, fileMode): (source)
ParameterssystemAn _IInputOutputSystem provider to use to perform I/O.
openFlagsAny flags to apply when opening the tunnel device. See os.O_*. (type: int)
fileModeignored
system = (source)

Undocumented

openFlags = (source)

Undocumented

tunnelMode = (source)

Undocumented

requestedName = (source)

Undocumented

name = (source)

Undocumented

readBuffer = (source)

Undocumented

writeBuffer = (source)

Undocumented

pendingSignals = (source)

Undocumented

@property
blocking = (source)

If the file descriptor for this tunnel is open in blocking mode, True. False otherwise.

@property
closeOnExec = (source)

If the file descriptor for this tunnel is marked as close-on-exec, True. False otherwise.

def addToReadBuffer(self, datagram): (source)

Deliver a datagram to this tunnel's read buffer. This makes it available to be read later using the read method.

ParametersdatagramThe IPv4 datagram to deliver. If the mode of this tunnel is TAP then ethernet framing will be added automatically. (type: bytes)
def read(self, limit): (source)

Read a datagram out of this tunnel.

ParameterslimitThe maximum number of bytes from the datagram to return. If the next datagram is larger than this, extra bytes are dropped and lost forever. (type: int)
ReturnsThe datagram which was read from the tunnel. If the tunnel mode does not include TunnelFlags.IFF_NO_PI then the datagram is prefixed with a 4 byte PI header. (type: bytes)
RaisesOSErrorAny of the usual I/O problems can result in this exception being raised with some particular error number set.
IOErrorAny of the usual I/O problems can result in this exception being raised with some particular error number set.
def write(self, datagram): (source)

Write a datagram into this tunnel.

ParametersdatagramThe datagram to write. (type: bytes)
ReturnsThe number of bytes of the datagram which were written. (type: int)
RaisesIOErrorAny of the usual I/O problems can result in this exception being raised with some particular error number set.
API Documentation for Twisted, generated by pydoctor 20.12.1 at 2021-02-28 19:53:36.