class documentation
An in-memory implementation of a tun or tap device.
Method | __init__ |
No summary |
Method | add |
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. |
Constant | EAGAIN |
Undocumented |
Constant | EINTR |
Undocumented |
Constant | EWOULDBLOCK |
Undocumented |
Constant | SEND |
Undocumented |
Instance Variable | name |
Undocumented |
Instance Variable | open |
Undocumented |
Instance Variable | pending |
Undocumented |
Instance Variable | read |
Undocumented |
Instance Variable | requested |
Undocumented |
Instance Variable | system |
Undocumented |
Instance Variable | tunnel |
Undocumented |
Instance Variable | write |
Undocumented |
Property | blocking |
If the file descriptor for this tunnel is open in blocking mode, True. False otherwise. |
Property | close |
If the file descriptor for this tunnel is marked as close-on-exec, True. False otherwise. |
Constant | _DEVICE |
A string representing the conventional filesystem entry for the tunnel factory character special device. |
Parameters | |
system | An _IInputOutputSystem provider to use to perform I/O. |
openint | Any flags to apply when opening the tunnel device. See os.O_*. |
file | ignored |
Deliver a datagram to this tunnel's read buffer. This makes it available to be read later using the read method.
Parameters | |
datagram:bytes | The IPv4 datagram to deliver. If the mode of this tunnel is TAP then ethernet framing will be added automatically. |
Read a datagram out of this tunnel.
Parameters | |
limit:int | 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. |
Returns | |
bytes | The 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. |
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. |