Package twisted :: Package conch :: Package ssh :: Module transport :: Class SSHTransportBase
[show private | hide private]
[frames | no frames]

Class SSHTransportBase

BaseProtocol --+    
               |    
        Protocol --+
                   |
                  SSHTransportBase

Known Subclasses:
SSHClientTransport, SSHServerTransport

Method Summary
  connectionFailed(self)
(Deprecated) (inherited from Protocol)
  connectionLost(self, reason)
Called when the connection is shut down.
  connectionMade(self)
Called when a connection is made.
  dataReceived(self, data)
Called whenever data is received.
  getPacket(self)
  isEncrypted(self, direction)
direction must be in ["out", "in", "both"]
  isVerified(self, direction)
direction must be in ["out", "in", "both"]
  receiveDebug(self, alwaysDisplay, message, lang)
  receiveError(self, reasonCode, description)
  receiveUnimplemented(self, seqnum)
  sendDebug(self, message, alwaysDisplay, language)
  sendDisconnect(self, reason, desc)
  sendIgnore(self, message)
  sendKexInit(self)
  sendPacket(self, messageType, payload)
  sendUnimplemented(self)
  setService(self, service)
  ssh_DEBUG(self, packet)
  ssh_DISCONNECT(self, packet)
  ssh_IGNORE(self, packet)
  ssh_UNIMPLEMENTED(self, packet)

Class Variable Summary
string buf
string comment
None currentEncryptions
int gotVersion
int ignoreNextPacket
None incomingCompression
int incomingPacketSequence
int isAuthorized
string ourVersionString
None outgoingCompression
int outgoingPacketSequence
string protocolVersion
None service
None sessionID
list supportedCiphers
list supportedCompressions
list supportedKeyExchanges
tuple supportedLanguages
list supportedMACs
list supportedPublicKeys
string version

Method Details

connectionLost(self, reason)

Called when the connection is shut down.

Clear any circular references here, and any external references to this Protocol. The connection has been closed.
Parameters:
reason
           (type=twisted.python.failure.Failure)
Overrides:
twisted.internet.protocol.Protocol.connectionLost (inherited documentation)

connectionMade(self)

Called when a connection is made.

This may be considered the initializer of the protocol, because it is called when the connection is completed. For clients, this is called once the connection to the server has been established; for servers, this is called after an accept() call stops blocking and a socket has been received. If you need to send any greeting or initial message, do it here.
Overrides:
twisted.internet.protocol.BaseProtocol.connectionMade (inherited documentation)

dataReceived(self, data)

Called whenever data is received.

Use this method to translate to a higher-level message. Usually, some callback will be made upon the receipt of each complete protocol message.
Parameters:
data - a string of indeterminate length. Please keep in mind that you will probably need to buffer some data, as partial (or multiple) protocol messages may be received! I recommend that unit tests for protocols call through to this method with differing chunk sizes, down to one byte at a time.
Overrides:
twisted.internet.protocol.Protocol.dataReceived (inherited documentation)

isEncrypted(self, direction='out')

direction must be in ["out", "in", "both"]

isVerified(self, direction='out')

direction must be in ["out", "in", "both"]

Class Variable Details

buf

Type:
string
Value:
''                                                                     

comment

Type:
string
Value:
''                                                                     

currentEncryptions

Type:
None
Value:
None                                                                   

gotVersion

Type:
int
Value:
0                                                                      

ignoreNextPacket

Type:
int
Value:
0                                                                      

incomingCompression

Type:
None
Value:
None                                                                   

incomingPacketSequence

Type:
int
Value:
0                                                                      

isAuthorized

Type:
int
Value:
0                                                                      

ourVersionString

Type:
string
Value:
'SSH-2.0-Twisted'                                                      

outgoingCompression

Type:
None
Value:
None                                                                   

outgoingPacketSequence

Type:
int
Value:
0                                                                      

protocolVersion

Type:
string
Value:
'2.0'                                                                  

service

Type:
None
Value:
None                                                                   

sessionID

Type:
None
Value:
None                                                                   

supportedCiphers

Type:
list
Value:
['aes256-cbc',
 'aes192-cbc',
 'aes128-cbc',
 'cast128-cbc',
 'blowfish',
 'idea-cbc',
 '3des-cbc']                                                           

supportedCompressions

Type:
list
Value:
['none', 'zlib']                                                       

supportedKeyExchanges

Type:
list
Value:
['diffie-hellman-group-exchange-sha1', 'diffie-hellman-group1-sha1']   

supportedLanguages

Type:
tuple
Value:
()                                                                     

supportedMACs

Type:
list
Value:
['hmac-sha1', 'hmac-md5']                                              

supportedPublicKeys

Type:
list
Value:
['ssh-rsa', 'ssh-dss']                                                 

version

Type:
string
Value:
'Twisted'                                                              

Generated by Epydoc 1.1 on Sat Feb 15 21:17:49 2003 http://epydoc.sf.net