|
libssh 0.12.0
The SSH library
|
the ssh::Channel class describes the state of an SSH channel. More...
#include <libsshpp.hpp>
Public Member Functions | |
| Channel (Session &ssh_session) | |
| Channel * | acceptX11 (int timeout_ms) |
| accept an incoming X11 connection | |
| void_throwable | changePtySize (int cols, int rows) |
| change the size of a pseudoterminal | |
| void_throwable | close () |
| closes a channel | |
| int | getExitStatus () |
| void_throwable | getExitState (uint32_t &pexit_code, char **pexit_signal, int &pcore_dumped) |
| Session & | getSession () |
| bool | isClosed () |
| returns true if channel is in closed state | |
| bool | isEof () |
| returns true if channel is in EOF state | |
| bool | isOpen () |
| returns true if channel is in open state | |
| int | openForward (const char *remotehost, int remoteport, const char *sourcehost, int localport=0) |
| Open a TCP forward channel. | |
| void_throwable | openSession () |
| int | poll (bool is_stderr=false) |
| Poll the channel for available data. | |
| int | read (void *dest, size_t count) |
| Read data from the channel (blocking). | |
| int | read (void *dest, size_t count, int timeout) |
| Read data from the channel with a timeout. | |
| int | read (void *dest, size_t count, bool is_stderr=false, int timeout=-1) |
| Read data from the channel with optional stderr selection and timeout. | |
| int | readNonblocking (void *dest, size_t count, bool is_stderr=false) |
| Read data from the channel without blocking. | |
| void_throwable | requestEnv (const char *name, const char *value) |
| void_throwable | requestExec (const char *cmd) |
| void_throwable | requestPty (const char *term=NULL, int cols=0, int rows=0, const unsigned char *modes=NULL, size_t modes_len=0) |
| void_throwable | requestShell () |
| void_throwable | requestSendSignal (const char *signum) |
| void_throwable | requestSubsystem (const char *subsystem) |
| int | requestX11 (bool single_connection, const char *protocol, const char *cookie, int screen_number) |
| Request X11 forwarding for this channel. | |
| void_throwable | sendEof () |
| int | write (const void *data, size_t len, bool is_stderr=false) |
| Writes on a channel. | |
| ssh_session | getCSession () |
| ssh_channel | getCChannel () |
Protected Attributes | |
| Session * | session |
| ssh_channel | channel |
Friends | |
| class | Session |
the ssh::Channel class describes the state of an SSH channel.
|
inline |
accept an incoming X11 connection
| [in] | timeout_ms | timeout for waiting, in ms |
|
inline |
change the size of a pseudoterminal
| [in] | cols | number of columns |
| [in] | rows | number of rows |
| SshException | on error |
|
inline |
|
inline |
returns true if channel is in closed state
|
inline |
returns true if channel is in EOF state
|
inline |
returns true if channel is in open state
|
inline |
Open a TCP forward channel.
| [in] | remotehost | Remote host to connect to. |
| [in] | remoteport | Remote port to connect to. |
| [in] | sourcehost | Source address to report (can be NULL depending on server policy). |
| [in] | localport | Local port to report (0 lets the server pick if applicable). |
| SshException | on error (exception-enabled builds). |
|
inline |
Poll the channel for available data.
| [in] | is_stderr | If true, poll stderr stream; otherwise stdout. |
| SshException | on error (exception-enabled builds). |
|
inline |
Read data from the channel (blocking).
| [out] | dest | Destination buffer. |
| [in] | count | Maximum number of bytes to read. |
| SshException | on error (exception-enabled builds). |
|
inline |
Read data from the channel with optional stderr selection and timeout.
| [out] | dest | Destination buffer. |
| [in] | count | Maximum number of bytes to read. |
| [in] | is_stderr | If true, read from the stderr stream; otherwise read from stdout. |
| [in] | timeout | Timeout in milliseconds. A negative value means infinite timeout. |
| SshException | on error (exception-enabled builds). |
|
inline |
Read data from the channel with a timeout.
| [out] | dest | Destination buffer. |
| [in] | count | Maximum number of bytes to read. |
| [in] | timeout | Timeout in milliseconds. A negative value means infinite timeout. |
| SshException | on error (exception-enabled builds). |
|
inline |
Read data from the channel without blocking.
| [out] | dest | Destination buffer. |
| [in] | count | Maximum number of bytes to read. |
| [in] | is_stderr | If true, read from the stderr stream; otherwise read from stdout. |
| SshException | on error (exception-enabled builds). |
|
inline |
Request X11 forwarding for this channel.
| [in] | single_connection | If true, allow only a single X11 connection for this channel; further X11 connections are refused after the first is accepted. |
| [in] | protocol | X11 authentication protocol. |
| [in] | cookie | X11 authentication cookie. |
| [in] | screen_number | X11 screen number. |
|
inline |
Writes on a channel.
| [in] | data | data to write. |
| [in] | len | number of bytes to write. |
| [in] | is_stderr | write should be done on the stderr channel (server only) |
| SshException | in case of error |