|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.maverick.sshd.TransportProtocol
public class TransportProtocol
This class implements the SSH Transport Protocol for the SSHD server.
| Field Summary | |
|---|---|
static int |
AUTH_CANCELLED_BY_USER
Disconnect reason: Authentication was cancelled |
static int |
BY_APPLICATION
Disconnect reason: The application disconnected |
static String |
CHARSET_ENCODING
Character set encoding. |
static int |
COMPRESSION_ERROR
Disconnect reason: A compression error occurred |
static int |
CONNECTION_LOST
Disconnect reason: The connection was lost |
static int |
HOST_KEY_NOT_VERIFIABLE
Disconnect reason: The host key supplied could not be verified |
static int |
HOST_NOT_ALLOWED
Disconnect reason: The host is not allowed |
static int |
ILLEGAL_USER_NAME
Disconnect reason: The user's name is illegal |
static int |
KEY_EXCHANGE_FAILED
Disconnect reason: Key exchange failed |
static Object |
lock
|
static int |
MAC_ERROR
Disconnect reason: An error occurred verifying the MAC |
static int |
NO_MORE_AUTH_METHODS_AVAILABLE
Disconnect reason: No more authentication methods are available |
static int |
numberOfConnections
|
static int |
PROTOCOL_ERROR
Disconnect reason: A protocol error occurred |
static int |
PROTOCOL_VERSION_NOT_SUPPORTED
Disconnect reason: The protocol version is not supported |
static int |
RESERVED
Disconnect reason: Reserved |
static int |
SERVICE_NOT_AVAILABLE
Disconnect reason: The requested service is not available |
static int |
TOO_MANY_CONNECTIONS
Disconnect reason: Too many connections, try later |
| Constructor Summary | |
|---|---|
TransportProtocol(SshContext sshContext)
Create a default transport protocol instance in CLIENT_MODE. |
|
| Method Summary | |
|---|---|
void |
addEventListener(TransportProtocolListener listener)
|
void |
disconnect(int reason,
String description)
Disconnect from the remote host. |
SshContext |
getContext()
|
SocketAddress |
getLocalAddress()
Returns the local address to which the remote socket is connected. |
int |
getLocalPort()
Returns the local port to which the remote socket is connected. |
int |
getQueueSizes()
|
SocketAddress |
getRemoteAddress()
|
String |
getRemoteIdentification()
|
int |
getRemotePort()
Returns the remote port of the connected socket. |
SecureRandom |
getRND()
Gets the secure random number generator for this transport. |
byte[] |
getSessionKey()
|
SocketConnection |
getSocketConnection()
|
SshContext |
getSshContext()
|
com.maverick.sshd.TransportProtocol.TransportState |
getState()
|
String |
getUUID()
|
boolean |
idle()
Called when the selector framework is idle. |
boolean |
isConnected()
Determine if the protocol is still connected |
void |
onSocketClose()
Disconnects everything internally |
void |
onSocketConnect(SocketConnection connection)
|
boolean |
onSocketRead(ByteBuffer incomingData)
Called when the socket channel is reported to be ready for reading. |
SocketWriteCallback |
onSocketWrite(ByteBuffer outgoingMessage)
Called when the socket channel is reported to be ready for writing. |
void |
postMessage(SshMessage msg)
|
void |
postMessage(SshMessage msg,
boolean kex)
|
void |
sendMessage(SshMessage msg)
Deprecated. use #postMessage() instead. |
void |
sendNewKeys()
|
boolean |
wantsToWrite()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static String CHARSET_ENCODING
public static final int HOST_NOT_ALLOWED
public static final int PROTOCOL_ERROR
public static final int KEY_EXCHANGE_FAILED
public static final int RESERVED
public static final int MAC_ERROR
public static final int COMPRESSION_ERROR
public static final int SERVICE_NOT_AVAILABLE
public static final int PROTOCOL_VERSION_NOT_SUPPORTED
public static final int HOST_KEY_NOT_VERIFIABLE
public static final int CONNECTION_LOST
public static final int BY_APPLICATION
public static final int TOO_MANY_CONNECTIONS
public static final int AUTH_CANCELLED_BY_USER
public static final int NO_MORE_AUTH_METHODS_AVAILABLE
public static final int ILLEGAL_USER_NAME
public static int numberOfConnections
public static Object lock
| Constructor Detail |
|---|
public TransportProtocol(SshContext sshContext)
IOException| Method Detail |
|---|
public SocketConnection getSocketConnection()
getSocketConnection in interface ProtocolEnginepublic void addEventListener(TransportProtocolListener listener)
public SocketAddress getRemoteAddress()
public int getRemotePort()
public SshContext getContext()
public void onSocketConnect(SocketConnection connection)
onSocketConnect in interface ProtocolEnginepublic boolean onSocketRead(ByteBuffer incomingData)
onSocketRead in interface ProtocolEnginepublic boolean isConnected()
isConnected in interface ProtocolEnginepublic boolean wantsToWrite()
wantsToWrite in interface ProtocolEnginepublic int getQueueSizes()
public boolean idle()
idle in interface IdleStateListenerpublic void sendMessage(SshMessage msg)
#postMessage() instead.
SshMessage.
msg - SshMessagepublic SocketWriteCallback onSocketWrite(ByteBuffer outgoingMessage)
onSocketWrite in interface ProtocolEnginepublic com.maverick.sshd.TransportProtocol.TransportState getState()
public byte[] getSessionKey()
public SocketAddress getLocalAddress()
public int getLocalPort()
public String getRemoteIdentification()
public String getUUID()
public void disconnect(int reason,
String description)
disconnect in interface ProtocolEnginereason - description -
IOExceptionpublic void onSocketClose()
onSocketClose in interface ProtocolEnginepublic SecureRandom getRND()
public void sendNewKeys()
public SshContext getSshContext()
public void postMessage(SshMessage msg)
public void postMessage(SshMessage msg,
boolean kex)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||