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 |
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
IOExceptionpublic void sendEOF(Channel c) throws IOException
IOExceptionpublic void sendOpenConfirmation(Channel c) throws IOException
IOExceptionpublic void sendData(Channel c, byte[] buffer, int pos, int len) throws IOException
IOExceptionpublic int requestGlobalForward(String bindAddress, int bindPort, String targetAddress, int targetPort) throws IOException
IOExceptionpublic void requestCancelGlobalForward(int bindPort)
throws IOException
IOExceptionpublic void registerThread(com.trilead.ssh2.channel.IChannelWorkerThread thr)
throws IOException
IOExceptionpublic Channel openDirectTCPIPChannel(String host_to_connect, int port_to_connect, String originator_IP_address, int originator_port) throws IOException
IOExceptionpublic Channel openSessionChannel() throws IOException
IOExceptionpublic void requestGlobalTrileadPing()
throws IOException
IOExceptionpublic void requestChannelTrileadPing(Channel c) throws IOException
IOExceptionpublic 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
IOExceptionpublic void requestX11(Channel c, boolean singleConnection, String x11AuthenticationProtocol, String x11AuthenticationCookie, int x11ScreenNumber) throws IOException
IOExceptionpublic void requestSubSystem(Channel c, String subSystemName) throws IOException
IOExceptionpublic void requestExecCommand(Channel c, String cmd) throws IOException
IOExceptionpublic void requestShell(Channel c) throws IOException
IOExceptionpublic void msgChannelExtendedData(byte[] msg,
int msglen)
throws IOException
IOExceptionpublic int waitForCondition(Channel c, long timeout, int condition_mask) throws InterruptedException
c - Channeltimeout - in ms, 0 means no timeout.condition_mask - minimum event maskInterruptedExceptionpublic int getAvailable(Channel c, boolean extended) throws IOException
IOExceptionpublic int getChannelData(Channel c, boolean extended, byte[] target, int off, int len) throws IOException
IOExceptionpublic void msgChannelData(byte[] msg,
int msglen)
throws IOException
IOExceptionpublic void msgChannelWindowAdjust(byte[] msg,
int msglen)
throws IOException
IOExceptionpublic void msgChannelOpen(byte[] msg,
int msglen)
throws IOException
IOExceptionpublic void msgChannelRequest(byte[] msg,
int msglen)
throws IOException
IOExceptionpublic void msgChannelEOF(byte[] msg,
int msglen)
throws IOException
IOExceptionpublic void msgChannelClose(byte[] msg,
int msglen)
throws IOException
IOExceptionpublic void msgChannelSuccess(byte[] msg,
int msglen)
throws IOException
IOExceptionpublic void msgChannelFailure(byte[] msg,
int msglen)
throws IOException
IOExceptionpublic void msgChannelOpenConfirmation(byte[] msg,
int msglen)
throws IOException
IOExceptionpublic void msgChannelOpenFailure(byte[] msg,
int msglen)
throws IOException
IOExceptionpublic void msgGlobalRequest(byte[] msg,
int msglen)
throws IOException
IOExceptionpublic void msgGlobalSuccess()
throws IOException
IOExceptionpublic void msgGlobalFailure()
throws IOException
IOExceptionpublic void handleMessage(byte[] msg,
int msglen)
throws IOException
handleMessage in interface MessageHandlerIOExceptionCopyright © 2013. All Rights Reserved.