public abstract class TransportProtocolCommon extends java.lang.Object implements TransportProtocol, java.lang.Runnable
| Modifier and Type | Field and Description |
|---|---|
protected TransportProtocolAlgorithmSync |
algorithmsIn |
protected TransportProtocolAlgorithmSync |
algorithmsOut |
protected java.lang.String |
clientIdent |
protected SshMsgKexInit |
clientKexInit |
protected java.lang.Boolean |
completeOnNewKeys |
static int |
EOL_CRLF |
static int |
EOL_LF |
protected byte[] |
hostKey |
protected HostKeyVerification |
hosts |
protected java.math.BigInteger |
k |
protected java.util.Map |
kexs |
protected static org.apache.commons.logging.Log |
log |
protected SshMessageStore |
messageStore |
protected SshConnectionProperties |
properties |
static java.lang.String |
PROTOCOL_VERSION |
protected java.lang.String |
serverIdent |
protected SshMsgKexInit |
serverKexInit |
protected byte[] |
sessionIdentifier |
protected byte[] |
signature |
static java.lang.String |
SOFTWARE_VERSION_COMMENTS |
protected com.sshtools.j2ssh.transport.TransportProtocolInputStream |
sshIn |
protected com.sshtools.j2ssh.transport.TransportProtocolOutputStream |
sshOut |
protected TransportProtocolState |
state |
| Constructor and Description |
|---|
TransportProtocolCommon()
Creates a new TransportProtocolCommon object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addEventHandler(TransportProtocolEventHandler eventHandler) |
void |
addMessageStore(SshMessageStore store) |
protected void |
beginKeyExchange() |
protected void |
completeKeyExchange() |
protected SshMsgKexInit |
createLocalKexInit() |
protected java.lang.String |
determineAlgorithm(java.util.List clientAlgorithms,
java.util.List serverAlgorithms) |
void |
disconnect(java.lang.String description) |
int |
getConnectionId() |
protected abstract java.lang.String |
getDecryptionAlgorithm() |
protected abstract java.lang.String |
getEncryptionAlgorithm() |
protected java.util.List |
getEventHandlers() |
long |
getIncomingByteCount() |
protected abstract java.lang.String |
getInputStreamCompAlgortihm() |
protected abstract java.lang.String |
getInputStreamMacAlgorithm() |
protected java.lang.String |
getKexAlgorithm() |
abstract java.lang.String |
getLocalId() |
protected abstract SshMsgKexInit |
getLocalKexInit() |
long |
getOutgoingByteCount() |
protected abstract java.lang.String |
getOutputStreamCompAlgorithm() |
protected abstract java.lang.String |
getOutputStreamMacAlgorithm() |
SshConnectionProperties |
getProperties() |
int |
getRemoteEOL() |
abstract java.lang.String |
getRemoteId() |
protected abstract SshMsgKexInit |
getRemoteKexInit() |
byte[] |
getSessionIdentifier() |
TransportProtocolState |
getState() |
java.lang.String |
getUnderlyingProviderDetail() |
boolean |
isConnected() |
protected void |
onCorruptMac() |
protected abstract void |
onDisconnect() |
protected abstract void |
onMessageReceived(SshMessage msg) |
protected abstract void |
onStartTransportProtocol() |
protected abstract void |
performKeyExchange(SshKeyExchange kex) |
protected SshMessage |
processMessages() |
SshMessage |
readMessage(int[] filter) |
abstract void |
registerTransportMessages() |
void |
removeMessageStore(SshMessageStore ms) |
void |
run() |
protected void |
sendDisconnect(int reason,
java.lang.String description) |
protected void |
sendDisconnect(int reason,
java.lang.String description,
java.io.IOException error) |
protected void |
sendKeyExchangeInit() |
void |
sendMessage(SshMessage msg,
java.lang.Object sender) |
protected void |
sendNewKeys() |
void |
setKexTimeout(long seconds) |
void |
setKexTransferLimit(long kilobytes) |
protected abstract void |
setLocalIdent() |
protected abstract void |
setLocalKexInit(SshMsgKexInit msg) |
protected abstract void |
setRemoteIdent(java.lang.String ident) |
protected abstract void |
setRemoteKexInit(SshMsgKexInit msg) |
void |
setSendIgnore(boolean sendIgnore) |
protected abstract void |
setupNewKeys(byte[] encryptCSKey,
byte[] encryptCSIV,
byte[] encryptSCKey,
byte[] encryptSCIV,
byte[] macCSKey,
byte[] macSCKey) |
protected void |
startBinaryPacketProtocol() |
void |
startTransportProtocol(TransportProvider provider,
SshConnectionProperties properties) |
protected void |
stop() |
void |
unregisterMessage(java.lang.Integer messageId,
SshMessageStore store) |
protected static org.apache.commons.logging.Log log
public static final int EOL_CRLF
public static final int EOL_LF
public static final java.lang.String PROTOCOL_VERSION
public static java.lang.String SOFTWARE_VERSION_COMMENTS
protected java.math.BigInteger k
protected java.lang.Boolean completeOnNewKeys
protected HostKeyVerification hosts
protected java.util.Map kexs
protected SshConnectionProperties properties
protected SshMessageStore messageStore
protected SshMsgKexInit clientKexInit
protected SshMsgKexInit serverKexInit
protected java.lang.String clientIdent
protected java.lang.String serverIdent
protected TransportProtocolAlgorithmSync algorithmsIn
protected TransportProtocolAlgorithmSync algorithmsOut
protected TransportProtocolState state
protected byte[] sessionIdentifier
protected byte[] hostKey
protected byte[] signature
protected com.sshtools.j2ssh.transport.TransportProtocolInputStream sshIn
protected com.sshtools.j2ssh.transport.TransportProtocolOutputStream sshOut
public TransportProtocolCommon()
public int getConnectionId()
getConnectionId in interface TransportProtocolpublic int getRemoteEOL()
public TransportProtocolState getState()
getState in interface TransportProtocolpublic SshConnectionProperties getProperties()
protected abstract void onDisconnect()
public void disconnect(java.lang.String description)
disconnect in interface TransportProtocoldescription - public void setSendIgnore(boolean sendIgnore)
sendIgnore - public void setKexTimeout(long seconds)
throws TransportProtocolException
seconds - TransportProtocolExceptionpublic void setKexTransferLimit(long kilobytes)
throws TransportProtocolException
kilobytes - TransportProtocolExceptionpublic long getOutgoingByteCount()
public long getIncomingByteCount()
public void addEventHandler(TransportProtocolEventHandler eventHandler)
eventHandler - public abstract void registerTransportMessages()
throws MessageAlreadyRegisteredException
public byte[] getSessionIdentifier()
getSessionIdentifier in interface TransportProtocolpublic void run()
run in interface java.lang.Runnablepublic void sendMessage(SshMessage msg, java.lang.Object sender) throws java.io.IOException
sendMessage in interface TransportProtocolmsg - sender - java.io.IOExceptionTransportProtocolExceptionprotected abstract void onStartTransportProtocol()
throws java.io.IOException
java.io.IOExceptionpublic void startTransportProtocol(TransportProvider provider, SshConnectionProperties properties) throws java.io.IOException
provider - properties - java.io.IOExceptionpublic java.lang.String getUnderlyingProviderDetail()
getUnderlyingProviderDetail in interface TransportProtocolpublic void unregisterMessage(java.lang.Integer messageId,
SshMessageStore store)
throws MessageNotRegisteredException
messageId - store - MessageNotRegisteredExceptionprotected abstract java.lang.String getDecryptionAlgorithm()
throws AlgorithmNotAgreedException
AlgorithmNotAgreedExceptionprotected abstract java.lang.String getEncryptionAlgorithm()
throws AlgorithmNotAgreedException
AlgorithmNotAgreedExceptionprotected abstract java.lang.String getInputStreamCompAlgortihm()
throws AlgorithmNotAgreedException
AlgorithmNotAgreedExceptionprotected abstract java.lang.String getInputStreamMacAlgorithm()
throws AlgorithmNotAgreedException
AlgorithmNotAgreedExceptionprotected abstract void setLocalIdent()
public abstract java.lang.String getLocalId()
protected abstract void setLocalKexInit(SshMsgKexInit msg)
msg - protected abstract SshMsgKexInit getLocalKexInit()
protected abstract java.lang.String getOutputStreamCompAlgorithm()
throws AlgorithmNotAgreedException
AlgorithmNotAgreedExceptionprotected abstract java.lang.String getOutputStreamMacAlgorithm()
throws AlgorithmNotAgreedException
AlgorithmNotAgreedExceptionprotected abstract void setRemoteIdent(java.lang.String ident)
ident - public abstract java.lang.String getRemoteId()
protected abstract void setRemoteKexInit(SshMsgKexInit msg)
msg - protected abstract SshMsgKexInit getRemoteKexInit()
protected abstract void performKeyExchange(SshKeyExchange kex) throws java.io.IOException, KeyExchangeException
kex - java.io.IOExceptionKeyExchangeExceptionprotected java.lang.String getKexAlgorithm()
throws AlgorithmNotAgreedException
AlgorithmNotAgreedExceptionpublic boolean isConnected()
isConnected in interface TransportProtocolprotected void beginKeyExchange()
throws java.io.IOException,
KeyExchangeException
java.io.IOExceptionKeyExchangeExceptionprotected SshMsgKexInit createLocalKexInit() throws java.io.IOException
java.io.IOExceptionprotected void onCorruptMac()
protected abstract void onMessageReceived(SshMessage msg) throws java.io.IOException
msg - java.io.IOExceptionprotected void sendDisconnect(int reason,
java.lang.String description)
reason - description - protected void sendDisconnect(int reason,
java.lang.String description,
java.io.IOException error)
reason - description - error - protected void sendKeyExchangeInit()
throws java.io.IOException
java.io.IOExceptionprotected void sendNewKeys()
throws java.io.IOException
java.io.IOExceptionprotected abstract void setupNewKeys(byte[] encryptCSKey,
byte[] encryptCSIV,
byte[] encryptSCKey,
byte[] encryptSCIV,
byte[] macCSKey,
byte[] macSCKey)
throws AlgorithmNotAgreedException,
AlgorithmOperationException,
AlgorithmNotSupportedException,
AlgorithmInitializationException
encryptCSKey - encryptCSIV - encryptSCKey - encryptSCIV - macCSKey - macSCKey - AlgorithmNotAgreedExceptionAlgorithmOperationExceptionAlgorithmNotSupportedExceptionAlgorithmInitializationExceptionprotected void completeKeyExchange()
throws java.io.IOException
java.io.IOExceptionTransportProtocolExceptionprotected java.util.List getEventHandlers()
protected java.lang.String determineAlgorithm(java.util.List clientAlgorithms,
java.util.List serverAlgorithms)
throws AlgorithmNotAgreedException
clientAlgorithms - serverAlgorithms - AlgorithmNotAgreedExceptionprotected void startBinaryPacketProtocol()
throws java.io.IOException
java.io.IOExceptionprotected final void stop()
public SshMessage readMessage(int[] filter) throws java.io.IOException
readMessage in interface TransportProtocolfilter - java.io.IOExceptionprotected SshMessage processMessages() throws java.io.IOException
java.io.IOExceptionpublic void addMessageStore(SshMessageStore store) throws MessageAlreadyRegisteredException
addMessageStore in interface TransportProtocolstore - MessageAlreadyRegisteredExceptionpublic void removeMessageStore(SshMessageStore ms)
ms - Copyright © 2002-2003 Lee David Painter & Contributors. All Rights Reserved.