class TuntapPort(abstract.FileDescriptor): (source)
Implements interfaces: twisted.internet.interfaces.IListeningPort
Method | __init__ |
|
Method | __repr__ |
Undocumented |
Method | connectionLost |
Cleans up my socket. |
Method | doRead |
Called when my socket is ready for reading. |
Method | fileno |
File Descriptor number for select(). |
Method | getHost |
Get the local address of this TuntapPort . |
Method | logPrefix |
Returns the name of my class, to prefix log entries with. |
Method | loseConnection |
Close this tunnel. Use TuntapPort.stopListening instead. |
Method | startListening |
Create and bind my socket, and begin listening on it. |
Method | stopListening |
Stop accepting connections on this port. |
Method | write |
Write the given data as a single datagram. |
Method | writeSequence |
Write a datagram constructed from a list of bytes . |
Class Variable | maxThroughput |
Undocumented |
Instance Variable | connected |
Undocumented |
Instance Variable | ethernet |
Undocumented |
Instance Variable | interface |
Undocumented |
Instance Variable | logstr |
Undocumented |
Instance Variable | maxPacketSize |
Undocumented |
Instance Variable | protocol |
Undocumented |
Method | _bindSocket |
Open the tunnel. |
Method | _openTunnel |
Open the named tunnel using the given mode. |
Instance Variable | _fileno |
Undocumented |
Instance Variable | _mode |
Undocumented |
Instance Variable | _system |
Undocumented |
Inherited from FileDescriptor
:
Method | doWrite |
Called when data can be written. |
Method | getPeer |
Get the remote address of this connection. |
Method | loseWriteConnection |
Undocumented |
Method | pauseProducing |
Pause producing data. |
Method | readConnectionLost |
Indicates read connection was lost. |
Method | resumeProducing |
Resume producing data. |
Method | startReading |
Start waiting for read availability. |
Method | startWriting |
Start waiting for write availability. |
Method | stopConsuming |
Stop consuming data. |
Method | stopProducing |
Stop producing data. |
Method | stopReading |
Stop waiting for read availability. |
Method | stopWriting |
Stop waiting for write availability. |
Method | writeConnectionLost |
Indicates write connection was lost. |
Method | writeSomeData |
Write as much as possible of the given data, immediately. |
Constant | SEND_LIMIT |
Undocumented |
Class Variable | bufferSize |
Undocumented |
Class Variable | disconnecting |
Undocumented |
Instance Variable | dataBuffer |
Undocumented |
Instance Variable | disconnected |
Undocumented |
Instance Variable | offset |
Undocumented |
Instance Variable | producer |
Undocumented |
Instance Variable | producerPaused |
Undocumented |
Instance Variable | reactor |
Undocumented |
Method | _closeWriteConnection |
Undocumented |
Method | _isSendBufferFull |
Determine whether the user-space send buffer for this transport is full or not. |
Method | _maybePauseProducer |
Possibly pause a producer, if there is one and the send buffer is full. |
Method | _postLoseConnection |
Called after a loseConnection(), when all data has been written. |
Class Variable | _writeDisconnected |
Undocumented |
Instance Variable | _tempDataBuffer |
Undocumented |
Instance Variable | _tempDataLen |
Undocumented |
Instance Variable | _writeDisconnecting |
Undocumented |
Inherited from _ConsumerMixin
(via FileDescriptor
):
Method | registerProducer |
Register to receive data from a producer. |
Method | unregisterProducer |
Stop consuming data from a producer, without disconnecting. |
Instance Variable | streamingProducer |
bool or int |
Inherited from _LogOwner
(via FileDescriptor
):
Method | _getLogPrefix |
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 |
maxPacketSize | 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.
TuntapPort
.Returns | |
TunnelAddress | A TunnelAddress which describes the tunnel device to which this object is bound. |
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. |
Parameters | |
datagram:bytes | The data that will make up the complete datagram to be written. |
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. |