twisted.pair.testing.Tunnel(object) class documentationtwisted.pair.testing
(View In Hierarchy)
An in-memory implementation of a tun or tap device.
| Method | __init__ | |
| Method | blocking | If the file descriptor for this tunnel is open in blocking mode, True.Falseotherwise. | 
| Method | closeOnExec | If the file descriptor for this tunnel is marked as close-on-exec, True.Falseotherwise. | 
| Method | addToReadBuffer | Deliver a datagram to this tunnel's read buffer.  This makes it 
available to be read later using the readmethod. | 
| 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. (type: bytes) | 
bytes)
  | Parameters | system | An _IInputOutputSystemprovider to use to perform I/O. | 
| openFlags | Any flags to apply when opening the tunnel device. See os.O_*. (type:int) | |
| fileMode | ignored | 
If the file descriptor for this tunnel is open in blocking mode, 
True.  False otherwise.
If the file descriptor for this tunnel is marked as close-on-exec, 
True.  False otherwise.
Deliver a datagram to this tunnel's read buffer.  This makes it 
available to be read later using the read method.
| Parameters | datagram | The IPv4 datagram to deliver.  If the mode of this tunnel is TAP then 
ethernet framing will be added automatically. (type: bytes) | 
Read a datagram out of this tunnel.
| Parameters | limit | The 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) | 
| Returns | The datagram which was read from the tunnel.  If the tunnel mode does not 
include TunnelFlags.IFF_NO_PIthen the datagram is prefixed with a 4 byte PI header. (type:bytes) | |
| Raises | OSError | Any of the usual I/O problems can result in this exception being raised with some particular error number set. | 
| IOError | Any of the usual I/O problems can result in this exception being raised with some particular error number set. | |