class MemoryIOSystem: (source)
Implements interfaces: twisted.pair.tuntap._IInputOutputSystem
| Method | __init__ |
Undocumented |
| Method | close |
Discard the in-memory buffer and other in-memory state for the given file descriptor. |
| Method | getTunnel |
Get the Tunnel object associated with the given TuntapPort. |
| Method | ioctl |
Perform some configuration change to the in-memory state for the given file descriptor. |
| Method | open |
No summary |
| Method | read |
Try to read some bytes out of one of the in-memory buffers which may previously have been populated by write. |
| Method | receiveUDP |
Get a socket-like object which can be used to receive a datagram sent from the given address. |
| Method | registerSpecialDevice |
Specify a class which will be used to handle I/O to a device of a particular name. |
| Method | sendUDP |
Write an ethernet frame containing an ip datagram containing a udp datagram containing the given payload, addressed to the given address, to a tunnel device previously opened on this I/O system. |
| Method | write |
Try to add some bytes to one of the in-memory buffers to be accessed by a later read call. |
| Constant | O_CLOEXEC |
|
| Constant | O_NONBLOCK |
|
| Constant | O_RDWR |
|
| Instance Variable | permissions |
|
| Instance Variable | _counter |
|
| Instance Variable | _devices |
|
| Instance Variable | _openFiles |
| See Also | |
os.close |
Tunnel object associated with the given TuntapPort.| Parameters | |
| port | A TuntapPort previously initialized using this MemoryIOSystem. |
| Returns | |
Tunnel | The tunnel object created by a prior use of open on this object on the tunnel special device file. |
| See Also | |
fcntl.ioctl |
MemoryIOSystem which will be reflected in the behavior of the other file descriptor-related methods (eg MemoryIOSystem.read, MemoryIOSystem.write, etc).| Parameters | |
| name:bytes | A string giving the name of the file to open. |
| flags:int | The flags with which to open the file. |
| mode:int | The mode with which to open the file. |
| Returns | |
int | A file descriptor associated with the newly opened file description. |
| Raises | |
OSError | With ENOSYS if the file is not a recognized special device file. |
| See Also | |
os.read |
| Parameters | |
fileno:int | A file descriptor representing a tunnel device which the datagram will be received via. |
host:bytes | The IPv4 address to which the datagram was sent. |
port:int | The UDP port number to which the datagram was sent. received. |
| Returns | |
A socket.socket-like object which can be used to receive the specified datagram. | |
| Parameters | |
datagram:bytes | A UDP datagram payload to send. |
address:tuple of (bytes, int) | The destination to which to send the datagram. |
| Returns | |
tuple of (bytes, int) | A two-tuple giving the address from which gives the address from which the datagram was sent. |
| See Also | |
os.write |