Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
com.sshtools.j2ssh.transport.TransportProtocolCommon
public abstract class TransportProtocolCommon
extends java.lang.Object
implements TransportProtocol, Runnable
Field Summary | |
static int | |
static int | |
static String | |
static String | |
protected TransportProtocolAlgorithmSync | |
protected TransportProtocolAlgorithmSync | |
protected String | |
protected SshMsgKexInit | |
protected Boolean | |
protected byte[] | |
protected HostKeyVerification | |
protected BigInteger | |
protected Map | |
protected static Log | |
protected SshMessageStore | |
protected SshConnectionProperties | |
protected String | |
protected SshMsgKexInit | |
protected byte[] | |
protected byte[] | |
protected com.sshtools.j2ssh.transport.TransportProtocolInputStream | |
protected com.sshtools.j2ssh.transport.TransportProtocolOutputStream | |
protected TransportProtocolState |
Constructor Summary | |
|
Method Summary | |
void |
|
void |
|
protected void | |
protected void | |
protected SshMsgKexInit | |
protected String |
|
void |
|
int | |
protected abstract String | |
protected abstract String | |
protected List | |
long | |
protected abstract String | |
protected abstract String | |
protected String | |
abstract String | |
protected abstract SshMsgKexInit | |
long | |
protected abstract String | |
protected abstract String | |
SshConnectionProperties | |
int | |
abstract String | |
protected abstract SshMsgKexInit | |
byte[] | |
TransportProtocolState |
|
String | |
boolean | |
protected void | |
protected abstract void | |
protected abstract void | |
protected abstract void | |
protected abstract void | |
protected SshMessage | |
SshMessage |
|
abstract void | |
void | |
void |
|
protected void |
|
protected void |
|
protected void | |
void |
|
protected void | |
void |
|
void |
|
protected abstract void | |
protected abstract void | |
protected abstract void |
|
protected abstract void | |
void |
|
protected abstract void |
|
protected void | |
void |
|
protected void |
|
void |
|
public static final int EOL_CRLF
- Field Value:
- 1
public static final int EOL_LF
- Field Value:
- 2
public static final String PROTOCOL_VERSION
public static String SOFTWARE_VERSION_COMMENTS
protected String clientIdent
protected Boolean completeOnNewKeys
protected byte[] hostKey
protected BigInteger k
protected Map kexs
protected static Log log
protected String serverIdent
protected byte[] sessionIdentifier
protected byte[] signature
protected com.sshtools.j2ssh.transport.TransportProtocolInputStream sshIn
protected com.sshtools.j2ssh.transport.TransportProtocolOutputStream sshOut
public TransportProtocolCommon()
Creates a new TransportProtocolCommon object.
public void addEventHandler(TransportProtocolEventHandler eventHandler)
- Parameters:
eventHandler
-
public void addMessageStore(SshMessageStore store) throws MessageAlreadyRegisteredException
- Specified by:
- addMessageStore in interface TransportProtocol
- Parameters:
store
-
- Throws:
MessageAlreadyRegisteredException
-
protected void beginKeyExchange() throws IOException, KeyExchangeException
- Throws:
KeyExchangeException
-
protected void completeKeyExchange() throws IOException
protected String determineAlgorithm(List clientAlgorithms, List serverAlgorithms) throws AlgorithmNotAgreedException
- Parameters:
clientAlgorithms
-serverAlgorithms
-
- Returns:
- Throws:
AlgorithmNotAgreedException
-
public void disconnect(String description)
- Specified by:
- disconnect in interface TransportProtocol
- Parameters:
description
-
public int getConnectionId()
- Specified by:
- getConnectionId in interface TransportProtocol
- Returns:
protected abstract String getDecryptionAlgorithm() throws AlgorithmNotAgreedException
- Returns:
- Throws:
AlgorithmNotAgreedException
-
protected abstract String getEncryptionAlgorithm() throws AlgorithmNotAgreedException
- Returns:
- Throws:
AlgorithmNotAgreedException
-
protected List getEventHandlers()
- Returns:
public long getIncomingByteCount()
- Returns:
protected abstract String getInputStreamCompAlgortihm() throws AlgorithmNotAgreedException
- Returns:
- Throws:
AlgorithmNotAgreedException
-
protected abstract String getInputStreamMacAlgorithm() throws AlgorithmNotAgreedException
- Returns:
- Throws:
AlgorithmNotAgreedException
-
protected String getKexAlgorithm() throws AlgorithmNotAgreedException
- Returns:
- Throws:
AlgorithmNotAgreedException
-
public abstract String getLocalId()
- Returns:
public long getOutgoingByteCount()
protected abstract String getOutputStreamCompAlgorithm() throws AlgorithmNotAgreedException
- Returns:
- Throws:
AlgorithmNotAgreedException
-
protected abstract String getOutputStreamMacAlgorithm() throws AlgorithmNotAgreedException
- Returns:
- Throws:
AlgorithmNotAgreedException
-
public int getRemoteEOL()
- Returns:
public abstract String getRemoteId()
- Returns:
public byte[] getSessionIdentifier()
- Specified by:
- getSessionIdentifier in interface TransportProtocol
- Returns:
public TransportProtocolState getState()
- Specified by:
- getState in interface TransportProtocol
- Returns:
public String getUnderlyingProviderDetail()
- Specified by:
- getUnderlyingProviderDetail in interface TransportProtocol
- Returns:
protected void onCorruptMac()
protected abstract void onDisconnect()
protected abstract void onMessageReceived(SshMessage msg) throws IOException
- Parameters:
msg
-
protected abstract void onStartTransportProtocol() throws IOException
protected abstract void performKeyExchange(SshKeyExchange kex) throws IOException, KeyExchangeException
- Parameters:
kex
-
- Throws:
KeyExchangeException
-
public SshMessage readMessage(int[] filter) throws IOException
- Specified by:
- readMessage in interface TransportProtocol
- Parameters:
filter
-
- Returns:
public abstract void registerTransportMessages() throws MessageAlreadyRegisteredException
- Throws:
MessageAlreadyRegisteredException
-
public void run()
protected void sendDisconnect(int reason, String description)
- Parameters:
reason
-description
-
protected void sendDisconnect(int reason, String description, IOException error)
- Parameters:
reason
-description
-error
-
protected void sendKeyExchangeInit() throws IOException
public void sendMessage(SshMessage msg, Object sender) throws IOException
- Specified by:
- sendMessage in interface TransportProtocol
- Parameters:
msg
-sender
-
protected void sendNewKeys() throws IOException
public void setKexTimeout(long seconds) throws TransportProtocolException
- Parameters:
seconds
-
- Throws:
TransportProtocolException
-
public void setKexTransferLimit(long kilobytes) throws TransportProtocolException
- Parameters:
kilobytes
-
- Throws:
TransportProtocolException
-
protected abstract void setLocalIdent()
protected abstract void setRemoteIdent(String ident)
- Parameters:
ident
-
public void setSendIgnore(boolean sendIgnore)
- Parameters:
sendIgnore
-
protected abstract void setupNewKeys(byte[] encryptCSKey, byte[] encryptCSIV, byte[] encryptSCKey, byte[] encryptSCIV, byte[] macCSKey, byte[] macSCKey) throws AlgorithmNotAgreedException, AlgorithmOperationException, AlgorithmNotSupportedException, AlgorithmInitializationException
- Parameters:
encryptCSKey
-encryptCSIV
-encryptSCKey
-encryptSCIV
-macCSKey
-macSCKey
-
protected void startBinaryPacketProtocol() throws IOException
public void startTransportProtocol(TransportProvider provider, SshConnectionProperties properties) throws IOException
- Parameters:
provider
-properties
-
protected final void stop()
public void unregisterMessage(Integer messageId, SshMessageStore store) throws MessageNotRegisteredException
- Parameters:
messageId
-store
-
- Throws:
MessageNotRegisteredException
-