public class ChannelManager extends Object implements MessageHandler
Besides the crypto part, this is the core of the library.
Constructor and Description |
---|
ChannelManager(TransportManager tm) |
Modifier and Type | Method and Description |
---|---|
X11ServerData |
checkX11Cookie(String hexFakeCookie) |
void |
closeAllChannels() |
void |
closeChannel(Channel c,
String reason,
boolean force) |
int |
getAvailable(Channel c,
boolean extended) |
int |
getChannelData(Channel c,
boolean extended,
byte[] target,
int off,
int len) |
void |
handleEndMessage(Throwable cause)
Called to inform that no more messages will be delivered.
|
void |
handleMessage(byte[] msg,
int msglen) |
void |
msgChannelClose(byte[] msg,
int msglen) |
void |
msgChannelData(byte[] msg,
int msglen) |
void |
msgChannelEOF(byte[] msg,
int msglen) |
void |
msgChannelExtendedData(byte[] msg,
int msglen) |
void |
msgChannelFailure(byte[] msg,
int msglen) |
void |
msgChannelOpen(byte[] msg,
int msglen) |
void |
msgChannelOpenConfirmation(byte[] msg,
int msglen) |
void |
msgChannelOpenFailure(byte[] msg,
int msglen) |
void |
msgChannelRequest(byte[] msg,
int msglen) |
void |
msgChannelSuccess(byte[] msg,
int msglen) |
void |
msgChannelWindowAdjust(byte[] msg,
int msglen) |
void |
msgGlobalFailure() |
void |
msgGlobalRequest(byte[] msg,
int msglen) |
void |
msgGlobalSuccess() |
Channel |
openDirectTCPIPChannel(String host_to_connect,
int port_to_connect,
String originator_IP_address,
int originator_port) |
Channel |
openSessionChannel() |
void |
registerThread(com.trilead.ssh2.channel.IChannelWorkerThread thr) |
void |
registerX11Cookie(String hexFakeCookie,
X11ServerData data) |
void |
requestCancelGlobalForward(int bindPort) |
void |
requestChannelTrileadPing(Channel c) |
void |
requestExecCommand(Channel c,
String cmd) |
int |
requestGlobalForward(String bindAddress,
int bindPort,
String targetAddress,
int targetPort) |
void |
requestGlobalTrileadPing() |
void |
requestPTY(Channel c,
String term,
int term_width_characters,
int term_height_characters,
int term_width_pixels,
int term_height_pixels,
byte[] terminal_modes) |
void |
requestShell(Channel c) |
void |
requestSubSystem(Channel c,
String subSystemName) |
void |
requestX11(Channel c,
boolean singleConnection,
String x11AuthenticationProtocol,
String x11AuthenticationCookie,
int x11ScreenNumber) |
void |
sendData(Channel c,
byte[] buffer,
int pos,
int len) |
void |
sendEOF(Channel c) |
void |
sendOpenConfirmation(Channel c) |
void |
unRegisterX11Cookie(String hexFakeCookie,
boolean killChannels) |
int |
waitForCondition(Channel c,
long timeout,
int condition_mask)
Wait until for a condition.
|
public ChannelManager(TransportManager tm)
public void registerX11Cookie(String hexFakeCookie, X11ServerData data)
public void unRegisterX11Cookie(String hexFakeCookie, boolean killChannels)
public X11ServerData checkX11Cookie(String hexFakeCookie)
public void closeAllChannels()
public void closeChannel(Channel c, String reason, boolean force) throws IOException
IOException
public void sendEOF(Channel c) throws IOException
IOException
public void sendOpenConfirmation(Channel c) throws IOException
IOException
public void sendData(Channel c, byte[] buffer, int pos, int len) throws IOException
IOException
public int requestGlobalForward(String bindAddress, int bindPort, String targetAddress, int targetPort) throws IOException
IOException
public void requestCancelGlobalForward(int bindPort) throws IOException
IOException
public void registerThread(com.trilead.ssh2.channel.IChannelWorkerThread thr) throws IOException
IOException
public Channel openDirectTCPIPChannel(String host_to_connect, int port_to_connect, String originator_IP_address, int originator_port) throws IOException
IOException
public Channel openSessionChannel() throws IOException
IOException
public void requestGlobalTrileadPing() throws IOException
IOException
public void requestChannelTrileadPing(Channel c) throws IOException
IOException
public void requestPTY(Channel c, String term, int term_width_characters, int term_height_characters, int term_width_pixels, int term_height_pixels, byte[] terminal_modes) throws IOException
IOException
public void requestX11(Channel c, boolean singleConnection, String x11AuthenticationProtocol, String x11AuthenticationCookie, int x11ScreenNumber) throws IOException
IOException
public void requestSubSystem(Channel c, String subSystemName) throws IOException
IOException
public void requestExecCommand(Channel c, String cmd) throws IOException
IOException
public void requestShell(Channel c) throws IOException
IOException
public void msgChannelExtendedData(byte[] msg, int msglen) throws IOException
IOException
public int waitForCondition(Channel c, long timeout, int condition_mask) throws InterruptedException
c
- Channeltimeout
- in ms, 0 means no timeout.condition_mask
- minimum event maskInterruptedException
public int getAvailable(Channel c, boolean extended) throws IOException
IOException
public int getChannelData(Channel c, boolean extended, byte[] target, int off, int len) throws IOException
IOException
public void msgChannelData(byte[] msg, int msglen) throws IOException
IOException
public void msgChannelWindowAdjust(byte[] msg, int msglen) throws IOException
IOException
public void msgChannelOpen(byte[] msg, int msglen) throws IOException
IOException
public void msgChannelRequest(byte[] msg, int msglen) throws IOException
IOException
public void msgChannelEOF(byte[] msg, int msglen) throws IOException
IOException
public void msgChannelClose(byte[] msg, int msglen) throws IOException
IOException
public void msgChannelSuccess(byte[] msg, int msglen) throws IOException
IOException
public void msgChannelFailure(byte[] msg, int msglen) throws IOException
IOException
public void msgChannelOpenConfirmation(byte[] msg, int msglen) throws IOException
IOException
public void msgChannelOpenFailure(byte[] msg, int msglen) throws IOException
IOException
public void msgGlobalRequest(byte[] msg, int msglen) throws IOException
IOException
public void msgGlobalSuccess() throws IOException
IOException
public void msgGlobalFailure() throws IOException
IOException
public void handleMessage(byte[] msg, int msglen) throws IOException
handleMessage
in interface MessageHandler
IOException
public void handleEndMessage(Throwable cause) throws IOException
MessageHandler
handleEndMessage
in interface MessageHandler
cause
- For diagnosis, the reason that caused the transport to close down.IOException
Copyright © 2019. All rights reserved.