channel: Fix the name scheme of the forward functions.

This commit is contained in:
Andreas Schneider
2014-01-16 09:06:56 +01:00
parent a1c4fc07d4
commit 5229253f86
5 changed files with 40 additions and 24 deletions

View File

@@ -2251,7 +2251,11 @@ error:
* SSH_AGAIN if in nonblocking mode and call has
* to be done again.
**/
int ssh_forward_listen(ssh_session session, const char *address, int port, int *bound_port) {
int ssh_channel_listen_forward(ssh_session session,
const char *address,
int port,
int *bound_port)
{
ssh_buffer buffer = NULL;
ssh_string addr = NULL;
int rc = SSH_ERROR;
@@ -2293,16 +2297,7 @@ error:
return rc;
}
/**
* @brief Accept an incoming TCP/IP forwarding channel.
*
* @param[in] session The ssh session to use.
*
* @param[in] timeout_ms A timeout in milliseconds.
*
* @return Newly created channel, or NULL if no incoming channel request from
* the server
*/
/* DEPRECATED */
ssh_channel ssh_forward_accept(ssh_session session, int timeout_ms) {
return ssh_channel_accept(session, SSH_CHANNEL_FORWARDED_TCPIP, timeout_ms, NULL);
}
@@ -2338,7 +2333,10 @@ ssh_channel ssh_channel_accept_forward(ssh_session session, int timeout_ms, int*
* SSH_AGAIN if in nonblocking mode and call has
* to be done again.
*/
int ssh_forward_cancel(ssh_session session, const char *address, int port) {
int ssh_channel_cancel_forward(ssh_session session,
const char *address,
int port)
{
ssh_buffer buffer = NULL;
ssh_string addr = NULL;
int rc = SSH_ERROR;
@@ -2372,6 +2370,10 @@ error:
return rc;
}
int ssh_forward_cancel(ssh_session session, const char *address, int port) {
return ssh_channel_cancel_forward(session, address, port);
}
/**
* @brief Set environment variables.
*

View File

@@ -163,7 +163,7 @@ int channel_change_pty_size(ssh_channel channel,int cols,int rows){
}
ssh_channel channel_forward_accept(ssh_session session, int timeout_ms){
return ssh_forward_accept(session,timeout_ms);
return ssh_channel_accept_forward(session, timeout_ms, NULL);
}
int channel_close(ssh_channel channel){
@@ -171,12 +171,12 @@ int channel_close(ssh_channel channel){
}
int channel_forward_cancel(ssh_session session, const char *address, int port){
return ssh_forward_cancel(session, address, port);
return ssh_channel_cancel_forward(session, address, port);
}
int channel_forward_listen(ssh_session session, const char *address,
int port, int *bound_port){
return ssh_forward_listen(session, address, port, bound_port);
return ssh_channel_listen_forward(session, address, port, bound_port);
}
void channel_free(ssh_channel channel){