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

Method Summary
  connectionLost(self, reason)
  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"]
  loseConnection(self)
  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
str buf = ''
str comment = ''
NoneType currentEncryptions = None                                                                  
int gotVersion = 0                                                                     
int ignoreNextPacket = 0                                                                     
NoneType incomingCompression = None                                                                  
int incomingPacketSequence = 0                                                                     
int isAuthorized = 0                                                                     
str ourVersionString = 'SSH-2.0-Twisted'
NoneType outgoingCompression = None                                                                  
int outgoingPacketSequence = 0                                                                     
str protocolVersion = '2.0'
NoneType service = None                                                                  
NoneType sessionID = None                                                                  
list supportedCiphers = ['aes256-ctr', 'aes256-cbc', 'aes192-...
list supportedCompressions = ['none', 'zlib']
list supportedKeyExchanges = ['diffie-hellman-group-exchange-...
tuple supportedLanguages = ()
list supportedMACs = ['hmac-sha1', 'hmac-md5']
list supportedPublicKeys = ['ssh-rsa', 'ssh-dss']
str version = 'Twisted'
Inherited from Protocol: __implemented__, __provides__

Method Details

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:
str
Value:
''                                                                     

comment

Type:
str
Value:
''                                                                     

currentEncryptions

Type:
NoneType
Value:
None                                                                  

gotVersion

Type:
int
Value:
0                                                                     

ignoreNextPacket

Type:
int
Value:
0                                                                     

incomingCompression

Type:
NoneType
Value:
None                                                                  

incomingPacketSequence

Type:
int
Value:
0                                                                     

isAuthorized

Type:
int
Value:
0                                                                     

ourVersionString

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

outgoingCompression

Type:
NoneType
Value:
None                                                                  

outgoingPacketSequence

Type:
int
Value:
0                                                                     

protocolVersion

Type:
str
Value:
'2.0'                                                                  

service

Type:
NoneType
Value:
None                                                                  

sessionID

Type:
NoneType
Value:
None                                                                  

supportedCiphers

Type:
list
Value:
['aes256-ctr',
 'aes256-cbc',
 'aes192-ctr',
 'aes192-cbc',
 'aes128-ctr',
 'aes128-cbc',
 'cast128-ctr',
 'cast128-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:
str
Value:
'Twisted'                                                              

Generated by Epydoc 2.1 on Thu Aug 16 09:55:11 2007 http://epydoc.sf.net