class TuntapPort(abstract.FileDescriptor): (source)
Constructor: TuntapPort(interface, proto, maxPacketSize, reactor, system)
Implements interfaces: twisted.internet.interfaces.IListeningPort
A Port that reads and writes packets from/to a TUN/TAP-device.
Method | __init__ |
No summary |
Method | __repr__ |
Undocumented |
Method | connection |
Cleans up my socket. |
Method | do |
Called when my socket is ready for reading. |
Method | fileno |
File Descriptor number for select(). |
Method | get |
Get the local address of this TuntapPort . |
Method | log |
Returns the name of my class, to prefix log entries with. |
Method | lose |
Close this tunnel. Use TuntapPort.stopListening instead. |
Method | start |
Create and bind my socket, and begin listening on it. |
Method | stop |
Stop accepting connections on this port. |
Method | write |
Write the given data as a single datagram. |
Method | write |
Write a datagram constructed from a list of bytes . |
Class Variable | max |
Undocumented |
Instance Variable | connected |
Undocumented |
Instance Variable | ethernet |
Undocumented |
Instance Variable | interface |
Undocumented |
Instance Variable | logstr |
Undocumented |
Instance Variable | max |
Undocumented |
Instance Variable | protocol |
Undocumented |
Method | _bind |
Open the tunnel. |
Method | _open |
Open the named tunnel using the given mode. |
Instance Variable | _fileno |
Undocumented |
Instance Variable | _mode |
Undocumented |
Instance Variable | _system |
Undocumented |
Inherited from FileDescriptor
:
Method | do |
Called when data can be written. |
Method | get |
Get the remote address of this connection. |
Method | lose |
Undocumented |
Method | pause |
Pause producing data. |
Method | read |
Indicates read connection was lost. |
Method | resume |
Resume producing data. |
Method | start |
Start waiting for read availability. |
Method | start |
Start waiting for write availability. |
Method | stop |
Stop consuming data. |
Method | stop |
Stop producing data. |
Method | stop |
Stop waiting for read availability. |
Method | stop |
Stop waiting for write availability. |
Method | write |
Indicates write connection was lost. |
Method | write |
Write as much as possible of the given data, immediately. |
Constant | SEND |
Undocumented |
Class Variable | buffer |
Undocumented |
Class Variable | disconnecting |
Undocumented |
Instance Variable | data |
Undocumented |
Instance Variable | disconnected |
Undocumented |
Instance Variable | offset |
Undocumented |
Instance Variable | producer |
Undocumented |
Instance Variable | producer |
Undocumented |
Instance Variable | reactor |
Undocumented |
Method | _close |
Undocumented |
Method | _is |
Determine whether the user-space send buffer for this transport is full or not. |
Method | _maybe |
Possibly pause a producer, if there is one and the send buffer is full. |
Method | _post |
Called after a loseConnection(), when all data has been written. |
Class Variable | _write |
Undocumented |
Instance Variable | _temp |
Undocumented |
Instance Variable | _temp |
Undocumented |
Instance Variable | _write |
Undocumented |
Inherited from _ConsumerMixin
(via FileDescriptor
):
Method | register |
Register to receive data from a producer. |
Method | unregister |
Stop consuming data from a producer, without disconnecting. |
Instance Variable | streaming |
bool or int |
Inherited from _LogOwner
(via FileDescriptor
, _ConsumerMixin
):
Method | _get |
Determine the log prefix to use for messages related to applicationObject, which may or may not be an interfaces.ILoggingContext provider. |
Parameters | |
interface | Undocumented |
proto | Undocumented |
max | Undocumented |
reactor | An IReactorFDSet provider which this descriptor will use to get readable and writeable event notifications. If no value is given, the global reactor will be used. |
system | Undocumented |
File Descriptor number for select().
This method must be overridden or assigned in subclasses to indicate a valid file descriptor for the operating system.
Get the local address of this TuntapPort
.
Returns | |
TunnelAddress | A TunnelAddress which describes the tunnel device to which this object is bound. |
twisted.pair.tuntap.TuntapPort.stopListening
instead.Close this tunnel. Use TuntapPort.stopListening
instead.
Create and bind my socket, and begin listening on it.
This must be called after creating a server to begin listening on the specified tunnel.
Stop accepting connections on this port.
This will shut down my socket and call self.connectionLost().
Returns | |
A Deferred that fires when this port has stopped. |
Write the given data as a single datagram.
Parameters | |
datagram:bytes | The data that will make up the complete datagram to be written. |
Open the named tunnel using the given mode.
Parameters | |
name:bytes | The name of the tunnel to open. |
mode | Flags from TunnelFlags with exactly one of TunnelFlags.IFF_TUN or TunnelFlags.IFF_TAP set. |
Returns | |
A _TunnelDescription representing the newly opened tunnel. |