Part of twisted.conch.ssh.connection View Source View In Hierarchy
Known subclasses: twisted.conch.scripts.cftp.SSHConnection, twisted.conch.scripts.conch.SSHConnection, twisted.conch.scripts.tkconch.SSHConnection
Instance Variables | localChannelID | the next number to use as a local channel ID.
(type: int
) |
channels | a dict mapping a local channel ID to SSHChannel
subclasses.
(type: dict
) | |
localToRemoteChannel | a dict mapping a local channel ID to a remote channel ID.
(type: dict
) | |
channelsToRemoteChannel | a dict mapping a SSHChannel subclass to remote
channel ID.
(type: dict
) | |
deferreds | a dict mapping a local channel ID to a list of
Deferreds for outstanding channel requests. Also, the
'global' key stores the list of pending global request
Deferred s.
|
Method | __init__ | Undocumented |
Method | serviceStarted | called when the service is active on the transport. |
Method | serviceStopped | called when the service is stopped, either by the connection ending |
Method | ssh_GLOBAL_REQUEST | The other side has made a global request. Payload: |
Method | ssh_REQUEST_SUCCESS | Our global request succeeded. Get the appropriate Deferred and call |
Method | ssh_REQUEST_FAILURE | Our global request failed. Get the appropriate Deferred and errback |
Method | ssh_CHANNEL_OPEN | The other side wants to get a channel. Payload: |
Method | ssh_CHANNEL_OPEN_CONFIRMATION | The other side accepted our MSG_CHANNEL_OPEN request. Payload: |
Method | ssh_CHANNEL_OPEN_FAILURE | The other side did not accept our MSG_CHANNEL_OPEN request. Payload: |
Method | ssh_CHANNEL_WINDOW_ADJUST | The other side is adding bytes to its window. Payload: |
Method | ssh_CHANNEL_DATA | The other side is sending us data. Payload: |
Method | ssh_CHANNEL_EXTENDED_DATA | The other side is sending us exteneded data. Payload: |
Method | ssh_CHANNEL_EOF | The other side is not sending any more data. Payload: |
Method | ssh_CHANNEL_CLOSE | The other side is closing its end; it does not want to receive any |
Method | ssh_CHANNEL_REQUEST | The other side is sending a request to a channel. Payload: |
Method | ssh_CHANNEL_SUCCESS | Our channel request to the other other side succeeded. Payload: |
Method | ssh_CHANNEL_FAILURE | Our channel request to the other side failed. Payload: |
Method | sendGlobalRequest | Send a global request for this connection. Current this is only used |
Method | openChannel | Open a new channel on this connection. |
Method | sendRequest | Send a request to a channel. |
Method | adjustWindow | Tell the other side that we will receive more data. This should not |
Method | sendData | Send data to a channel. This should not normally be used: instead use |
Method | sendExtendedData | Send extended data to a channel. This should not normally be used: |
Method | sendEOF | Send an EOF (End of File) for a channel. |
Method | sendClose | Close a channel. |
Method | getChannel | The other side requested a channel of some sort. |
Method | gotGlobalRequest | We got a global request. pretty much, this is just used by the client |
Method | channelClosed | Called when a channel is closed. |
Method | _cbChannelRequest | Called back if the other side wanted a reply to a channel request. If |
Method | _ebChannelRequest | Called if the other wisde wanted a reply to the channel requeset and |
Inherited from SSHService:
Method | logPrefix | Override this method to insert custom logging behavior. Its |
Method | packetReceived | called when we receive a packet on the transport |
string request type bool want reply <request specific data>
This dispatches to self.gotGlobalRequest.
string channel name uint32 remote channel number uint32 remote window size uint32 remote maximum packet size <channel specific data>
We get a channel from self.getChannel(), give it a local channel number and notify the other side. Then notify the channel by calling its channelOpen method.
uint32 local channel number uint32 remote channel number uint32 remote window size uint32 remote maximum packet size <channel specific data>
Find the channel using the local channel number and notify its channelOpen method.
uint32 local channel number uint32 reason code string reason description
Find the channel using the local channel number and notify it by calling its openFailed() method.
uint32 local channel number uint32 bytes to add
Call the channel's addWindowBytes() method to add new bytes to the remote window.
uint32 local channel number string data
Check to make sure the other side hasn't sent too much data (more than what's in the window, or more than the maximum packet size). If they have, close the channel. Otherwise, decrease the available window and pass the data to the channel's dataReceived().
uint32 local channel number uint32 type code string data
Check to make sure the other side hasn't sent too much data (more than what's in the window, or or than the maximum packet size). If they have, close the channel. Otherwise, decrease the available window and pass the data and type code to the channel's extReceived().
uint32 local channel number
Notify the channel by calling its eofReceived() method.
uint32 local channel number
Notify the channnel by calling its closeReceived() method. If the channel has also sent a close message, call self.channelClosed().
uint32 local channel number string request name bool want reply <request specific data>
Pass the message to the channel's requestReceived method. If the other side wants a reply, add callbacks which will send the reply.
error.ConchError
Parameters | result | the value returned from the channel's requestReceived() method. If it's
False, the request failed.
(type: bool
) |
localChannel | the local channel ID of the channel to which the request was made.
(type: int
) | |
Raises | ConchError | if the result is False. |
Parameters | result | a Failure, but it's not used. |
localChannel | the local channel ID of the channel to which the request was made.
(type: int
) |
uint32 local channel number
Get the Deferred
out of self.deferreds and call it
back.
uint32 local channel number
Get the Deferred
out of self.deferreds and errback it with
a error.ConchError
.
Parameters | request | (type: str
) |
data | (type: str
) | |
wantReply | (type: bool @rtype
Deferred /None
) |
Parameters | channel | (type: subclass of SSHChannel
) |
extra | (type: str
) |
Parameters | channel | (type: subclass of SSHChannel
) |
requestType | (type: str
) | |
data | (type: str
) | |
wantReply | (type: bool @rtype
Deferred /None
) |
Parameters | channel | (type: subclass of SSHChannel
) |
bytesToAdd | (type: int
) |
Parameters | channel | (type: subclass of SSHChannel
) |
data | (type: str
) |
Parameters | channel | (type: subclass of SSHChannel
) |
dataType | (type: int
) | |
data | (type: str
) |
Parameters | channel | (type: subclass of SSHChannel
) |
Parameters | channel | (type: subclass of SSHChannel
) |
We return a subclass of SSHChannel
.
By default, this dispatches to a method 'channel_channelType' with any non-alphanumerics in the channelType replace with _'s. If it cannot find a suitable method, it returns an OPEN_UNKNOWN_CHANNEL_TYPE error. The method is called with arguments of windowSize, maxPacket, data.
Parameters | channelType | (type: str
) |
windowSize | (type: int
) | |
maxPacket | (type: int
) | |
data | (type: str
) | |
Returns | (type: subclass of SSHChannel /tuple
) |
By default, this dispatches to a method 'global_requestType' with -'s in requestType replaced with _'s. The found method is passed data. If this method cannot be found, this method returns 0. Otherwise, it returns the return value of that method.
Parameters | requestType | (type: str
) |
data | (type: str
) | |
Returns | (type: int /tuple
) |
SSHConnection
.
If you don't, things will break mysteriously.