родитель
adcd2e38e9
Коммит
1fa9409554
@ -316,10 +316,7 @@ enum ssh_scp_request_types {
|
|||||||
|
|
||||||
LIBSSH_API ssh_channel ssh_channel_accept_x11(ssh_channel channel, int timeout_ms);
|
LIBSSH_API ssh_channel ssh_channel_accept_x11(ssh_channel channel, int timeout_ms);
|
||||||
LIBSSH_API int ssh_channel_change_pty_size(ssh_channel channel,int cols,int rows);
|
LIBSSH_API int ssh_channel_change_pty_size(ssh_channel channel,int cols,int rows);
|
||||||
LIBSSH_API ssh_channel ssh_channel_forward_accept(ssh_session session, int timeout_ms);
|
|
||||||
LIBSSH_API int ssh_channel_close(ssh_channel channel);
|
LIBSSH_API int ssh_channel_close(ssh_channel channel);
|
||||||
LIBSSH_API int ssh_channel_forward_cancel(ssh_session session, const char *address, int port);
|
|
||||||
LIBSSH_API int ssh_channel_forward_listen(ssh_session session, const char *address, int port, int *bound_port);
|
|
||||||
LIBSSH_API void ssh_channel_free(ssh_channel channel);
|
LIBSSH_API void ssh_channel_free(ssh_channel channel);
|
||||||
LIBSSH_API int ssh_channel_get_exit_status(ssh_channel channel);
|
LIBSSH_API int ssh_channel_get_exit_status(ssh_channel channel);
|
||||||
LIBSSH_API ssh_session ssh_channel_get_session(ssh_channel channel);
|
LIBSSH_API ssh_session ssh_channel_get_session(ssh_channel channel);
|
||||||
@ -362,6 +359,9 @@ LIBSSH_API const char *ssh_copyright(void);
|
|||||||
LIBSSH_API void ssh_disconnect(ssh_session session);
|
LIBSSH_API void ssh_disconnect(ssh_session session);
|
||||||
LIBSSH_API char *ssh_dirname (const char *path);
|
LIBSSH_API char *ssh_dirname (const char *path);
|
||||||
LIBSSH_API int ssh_finalize(void);
|
LIBSSH_API int ssh_finalize(void);
|
||||||
|
LIBSSH_API ssh_channel ssh_forward_accept(ssh_session session, int timeout_ms);
|
||||||
|
LIBSSH_API int ssh_forward_cancel(ssh_session session, const char *address, int port);
|
||||||
|
LIBSSH_API int ssh_forward_listen(ssh_session session, const char *address, int port, int *bound_port);
|
||||||
LIBSSH_API void ssh_free(ssh_session session);
|
LIBSSH_API void ssh_free(ssh_session session);
|
||||||
LIBSSH_API const char *ssh_get_disconnect_message(ssh_session session);
|
LIBSSH_API const char *ssh_get_disconnect_message(ssh_session session);
|
||||||
LIBSSH_API const char *ssh_get_error(void *error);
|
LIBSSH_API const char *ssh_get_error(void *error);
|
||||||
|
@ -365,13 +365,13 @@ public:
|
|||||||
/* acceptForward is implemented later in this file */
|
/* acceptForward is implemented later in this file */
|
||||||
|
|
||||||
void_throwable cancelForward(const char *address, int port){
|
void_throwable cancelForward(const char *address, int port){
|
||||||
int err=ssh_channel_forward_cancel(c_session, address, port);
|
int err=ssh_forward_cancel(c_session, address, port);
|
||||||
ssh_throw(err);
|
ssh_throw(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
void_throwable listenForward(const char *address, int port,
|
void_throwable listenForward(const char *address, int port,
|
||||||
int &boundport){
|
int &boundport){
|
||||||
int err=ssh_channel_forward_listen(c_session, address, port, &boundport);
|
int err=ssh_forward_listen(c_session, address, port, &boundport);
|
||||||
ssh_throw(err);
|
ssh_throw(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -570,7 +570,7 @@ private:
|
|||||||
|
|
||||||
/* This code cannot be put inline due to references to Channel */
|
/* This code cannot be put inline due to references to Channel */
|
||||||
Channel *Session::acceptForward(int timeout_ms){
|
Channel *Session::acceptForward(int timeout_ms){
|
||||||
ssh_channel forward = ssh_channel_forward_accept(c_session,
|
ssh_channel forward = ssh_forward_accept(c_session,
|
||||||
timeout_ms);
|
timeout_ms);
|
||||||
ssh_throw_null(c_session,forward);
|
ssh_throw_null(c_session,forward);
|
||||||
Channel *newchan = new Channel(*this,forward);
|
Channel *newchan = new Channel(*this,forward);
|
||||||
|
@ -1479,7 +1479,7 @@ error:
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssh_channel channel_accept(ssh_session session, int channeltype,
|
static ssh_channel ssh_channel_accept(ssh_session session, int channeltype,
|
||||||
int timeout_ms) {
|
int timeout_ms) {
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
static const struct timespec ts = {
|
static const struct timespec ts = {
|
||||||
@ -1531,7 +1531,7 @@ static ssh_channel channel_accept(ssh_session session, int channeltype,
|
|||||||
* the server.
|
* the server.
|
||||||
*/
|
*/
|
||||||
ssh_channel ssh_channel_accept_x11(ssh_channel channel, int timeout_ms) {
|
ssh_channel ssh_channel_accept_x11(ssh_channel channel, int timeout_ms) {
|
||||||
return channel_accept(channel->session, SSH_CHANNEL_X11, timeout_ms);
|
return ssh_channel_accept(channel->session, SSH_CHANNEL_X11, timeout_ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1698,7 +1698,7 @@ error:
|
|||||||
*
|
*
|
||||||
* @return SSH_OK on success, SSH_ERROR if an error occured.
|
* @return SSH_OK on success, SSH_ERROR if an error occured.
|
||||||
*/
|
*/
|
||||||
int ssh_channel_forward_listen(ssh_session session, const char *address, int port, int *bound_port) {
|
int ssh_forward_listen(ssh_session session, const char *address, int port, int *bound_port) {
|
||||||
ssh_buffer buffer = NULL;
|
ssh_buffer buffer = NULL;
|
||||||
ssh_string addr = NULL;
|
ssh_string addr = NULL;
|
||||||
int rc = SSH_ERROR;
|
int rc = SSH_ERROR;
|
||||||
@ -1742,8 +1742,8 @@ error:
|
|||||||
* @return Newly created channel, or NULL if no incoming channel request from
|
* @return Newly created channel, or NULL if no incoming channel request from
|
||||||
* the server
|
* the server
|
||||||
*/
|
*/
|
||||||
ssh_channel ssh_channel_forward_accept(ssh_session session, int timeout_ms) {
|
ssh_channel ssh_forward_accept(ssh_session session, int timeout_ms) {
|
||||||
return channel_accept(session, SSH_CHANNEL_FORWARDED_TCPIP, timeout_ms);
|
return ssh_channel_accept(session, SSH_CHANNEL_FORWARDED_TCPIP, timeout_ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1758,7 +1758,7 @@ ssh_channel ssh_channel_forward_accept(ssh_session session, int timeout_ms) {
|
|||||||
*
|
*
|
||||||
* @return SSH_OK on success, SSH_ERROR if an error occured.
|
* @return SSH_OK on success, SSH_ERROR if an error occured.
|
||||||
*/
|
*/
|
||||||
int ssh_channel_forward_cancel(ssh_session session, const char *address, int port) {
|
int ssh_forward_cancel(ssh_session session, const char *address, int port) {
|
||||||
ssh_buffer buffer = NULL;
|
ssh_buffer buffer = NULL;
|
||||||
ssh_string addr = NULL;
|
ssh_string addr = NULL;
|
||||||
int rc = SSH_ERROR;
|
int rc = SSH_ERROR;
|
||||||
|
@ -50,7 +50,7 @@ int channel_change_pty_size(ssh_channel channel,int cols,int rows){
|
|||||||
}
|
}
|
||||||
|
|
||||||
ssh_channel channel_forward_accept(ssh_session session, int timeout_ms){
|
ssh_channel channel_forward_accept(ssh_session session, int timeout_ms){
|
||||||
return ssh_channel_forward_accept(session,timeout_ms);
|
return ssh_forward_accept(session,timeout_ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
int channel_close(ssh_channel channel){
|
int channel_close(ssh_channel channel){
|
||||||
@ -58,12 +58,12 @@ int channel_close(ssh_channel channel){
|
|||||||
}
|
}
|
||||||
|
|
||||||
int channel_forward_cancel(ssh_session session, const char *address, int port){
|
int channel_forward_cancel(ssh_session session, const char *address, int port){
|
||||||
return ssh_channel_forward_cancel(session, address, port);
|
return ssh_forward_cancel(session, address, port);
|
||||||
}
|
}
|
||||||
|
|
||||||
int channel_forward_listen(ssh_session session, const char *address,
|
int channel_forward_listen(ssh_session session, const char *address,
|
||||||
int port, int *bound_port){
|
int port, int *bound_port){
|
||||||
return ssh_channel_forward_listen(session, address, port, bound_port);
|
return ssh_forward_listen(session, address, port, bound_port);
|
||||||
}
|
}
|
||||||
|
|
||||||
void channel_free(ssh_channel channel){
|
void channel_free(ssh_channel channel){
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user