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)
  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
str buf
str comment
NoneType currentEncryptions
int gotVersion
int ignoreNextPacket
NoneType incomingCompression
int incomingPacketSequence
int isAuthorized
str ourVersionString
NoneType outgoingCompression
int outgoingPacketSequence
str protocolVersion
NoneType service
NoneType sessionID
list supportedCiphers
list supportedCompressions
list supportedKeyExchanges
tuple supportedLanguages
list supportedMACs
list supportedPublicKeys
str version

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

Generated by Epydoc 1.2 prerelease on Wed Jan 29 06:25:33 2003 http://epydoc.sf.net