From db6aa88bc4edcfb14663140db1ee25f5b2a47952 Mon Sep 17 00:00:00 2001 From: Vic Lee Date: Sun, 16 Aug 2009 18:24:25 +0800 Subject: Add forward listening feature Signed-off-by: Andreas Schneider --- include/libssh/libssh.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/libssh/libssh.h') diff --git a/include/libssh/libssh.h b/include/libssh/libssh.h index 62a74ff..6daf02a 100644 --- a/include/libssh/libssh.h +++ b/include/libssh/libssh.h @@ -336,6 +336,9 @@ LIBSSH_API int channel_request_sftp(ssh_channel channel); LIBSSH_API int channel_request_x11(ssh_channel channel, int single_connection, const char *protocol, const char *cookie, int screen_number); LIBSSH_API ssh_channel channel_accept_x11(ssh_channel channel, int timeout_ms); +LIBSSH_API int channel_forward_listen(ssh_session session, const char *address, int port, int *bound_port); +LIBSSH_API ssh_channel channel_forward_accept(ssh_session session, int timeout_ms); +LIBSSH_API int channel_forward_cancel(ssh_session session, const char *address, int port); LIBSSH_API int channel_write(ssh_channel channel, const void *data, uint32_t len); LIBSSH_API int channel_send_eof(ssh_channel channel); LIBSSH_API int channel_is_eof(ssh_channel channel); -- cgit From 0b10493e900cca26ee07d68a3c3f35b467364be5 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Fri, 21 Aug 2009 10:16:36 +0200 Subject: Added ssh_basename() and ssh_dirname(). --- include/libssh/libssh.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/libssh/libssh.h') diff --git a/include/libssh/libssh.h b/include/libssh/libssh.h index 6daf02a..faee16b 100644 --- a/include/libssh/libssh.h +++ b/include/libssh/libssh.h @@ -443,6 +443,10 @@ LIBSSH_API int ssh_userauth_kbdint_setanswer(SSH_SESSION *session, unsigned int LIBSSH_API int ssh_init(void); LIBSSH_API int ssh_finalize(void); +/* misc.c */ +char *ssh_dirname (const char *path); +char *ssh_basename (const char *path); + /* messages.c */ typedef struct ssh_message SSH_MESSAGE; -- cgit From 330c2004a181f7ad3566aa980a8a501348358439 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Fri, 21 Aug 2009 10:17:58 +0200 Subject: Make the functions public. --- include/libssh/libssh.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/libssh/libssh.h') diff --git a/include/libssh/libssh.h b/include/libssh/libssh.h index faee16b..3bb8261 100644 --- a/include/libssh/libssh.h +++ b/include/libssh/libssh.h @@ -444,8 +444,8 @@ LIBSSH_API int ssh_init(void); LIBSSH_API int ssh_finalize(void); /* misc.c */ -char *ssh_dirname (const char *path); -char *ssh_basename (const char *path); +LIBSSH_API char *ssh_dirname (const char *path); +LIBSSH_API char *ssh_basename (const char *path); /* messages.c */ typedef struct ssh_message SSH_MESSAGE; -- cgit From 049c62098cbd0d8efc342150a194fe72c9bdf6b0 Mon Sep 17 00:00:00 2001 From: Aris Adamantiadis Date: Sun, 23 Aug 2009 14:57:03 +0200 Subject: add ssh_scp_push_directory,ssh_scp_leave_directory Not yet carefully tested --- include/libssh/libssh.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/libssh/libssh.h') diff --git a/include/libssh/libssh.h b/include/libssh/libssh.h index 3bb8261..5dca6c1 100644 --- a/include/libssh/libssh.h +++ b/include/libssh/libssh.h @@ -471,6 +471,8 @@ LIBSSH_API ssh_scp ssh_scp_new(ssh_session session, int mode, const char *locati LIBSSH_API int ssh_scp_init(ssh_scp scp); LIBSSH_API int ssh_scp_close(ssh_scp scp); LIBSSH_API void ssh_scp_free(ssh_scp scp); +LIBSSH_API int ssh_scp_push_directory(ssh_scp scp, const char *dirname, const char *perms); +LIBSSH_API int ssh_scp_leave_directory(ssh_scp scp); LIBSSH_API int ssh_scp_push_file(ssh_scp scp, const char *filename, size_t size, const char *perms); LIBSSH_API int ssh_scp_write(ssh_scp scp, const void *buffer, size_t len); -- cgit From 6a04b43a45896822732dedec1a4a2d972fbb9b80 Mon Sep 17 00:00:00 2001 From: Aris Adamantiadis Date: Sun, 23 Aug 2009 15:23:48 +0200 Subject: added ssh_scp_request_new,ssh_scp_request_struct --- include/libssh/libssh.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/libssh/libssh.h') diff --git a/include/libssh/libssh.h b/include/libssh/libssh.h index 5dca6c1..dcdb4a0 100644 --- a/include/libssh/libssh.h +++ b/include/libssh/libssh.h @@ -120,6 +120,7 @@ typedef struct ssh_agent_struct* ssh_agent; typedef struct ssh_session_struct* ssh_session; typedef struct ssh_kbdint_struct* ssh_kbdint; typedef struct ssh_scp_struct* ssh_scp; +typedef struct ssh_scp_request_struct* ssh_scp_request; /* Socket type */ #ifdef _WIN32 @@ -467,6 +468,12 @@ enum { SSH_SCP_READ }; +enum ssh_scp_request_types { + /** A new directory is going to be pulled */ + SSH_SCP_REQUEST_NEWDIR, + /** A new file is going to be pulled */ + SSH_SCP_REQUEST_NEWFILE +}; LIBSSH_API ssh_scp ssh_scp_new(ssh_session session, int mode, const char *location); LIBSSH_API int ssh_scp_init(ssh_scp scp); LIBSSH_API int ssh_scp_close(ssh_scp scp); -- cgit From fbfea94559aa776bca7983ef989d024c2d3b72fe Mon Sep 17 00:00:00 2001 From: Aris Adamantiadis Date: Sun, 23 Aug 2009 16:29:31 +0200 Subject: Pending work --- include/libssh/libssh.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/libssh/libssh.h') diff --git a/include/libssh/libssh.h b/include/libssh/libssh.h index dcdb4a0..2650830 100644 --- a/include/libssh/libssh.h +++ b/include/libssh/libssh.h @@ -482,6 +482,8 @@ LIBSSH_API int ssh_scp_push_directory(ssh_scp scp, const char *dirname, const ch LIBSSH_API int ssh_scp_leave_directory(ssh_scp scp); LIBSSH_API int ssh_scp_push_file(ssh_scp scp, const char *filename, size_t size, const char *perms); LIBSSH_API int ssh_scp_write(ssh_scp scp, const void *buffer, size_t len); +LIBSSH_API ssh_scp_request ssh_scp_pull_request(ssh_scp scp); +LIBSSH_API int ssh_scp_deny_request(ssh_scp scp, ssh_scp_request request, const char *reason); #ifdef __cplusplus } -- cgit