aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2013-06-02 18:40:13 +0200
committerAndreas Schneider <asn@cryptomilk.org>2013-07-13 15:01:17 +0200
commit31a129ee9e0626d3230bea46d93bde2e2738119c (patch)
tree0346b0e26898b1a74745f04b62e12fd00a0d1cfe /include
parent7e7910a1ca35c069864bafc200d7ba593a73a1f2 (diff)
downloadlibssh-31a129ee9e0626d3230bea46d93bde2e2738119c.tar.gz
libssh-31a129ee9e0626d3230bea46d93bde2e2738119c.tar.xz
libssh-31a129ee9e0626d3230bea46d93bde2e2738119c.zip
sftp: more flexibility on channels
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'include')
-rw-r--r--include/libssh/sftp.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/include/libssh/sftp.h b/include/libssh/sftp.h
index 5a21a959..d370f0ec 100644
--- a/include/libssh/sftp.h
+++ b/include/libssh/sftp.h
@@ -133,6 +133,7 @@ struct sftp_client_message_struct {
ssh_buffer attrbuf; /* used by sftp_reply_attrs */
ssh_string data; /* can be newpath of rename() */
ssh_buffer complete_message; /* complete message in case of retransmission*/
+ char *str_data; /* cstring version of data */
};
struct sftp_request_queue_struct {
@@ -204,6 +205,19 @@ struct sftp_statvfs_struct {
LIBSSH_API sftp_session sftp_new(ssh_session session);
/**
+ * @brief Start a new sftp session with an existing channel.
+ *
+ * @param session The ssh session to use.
+ * @param channel An open session channel with subsystem already allocated
+ *
+ * @return A new sftp session or NULL on error.
+ *
+ * @see sftp_free()
+ */
+LIBSSH_API sftp_session sftp_new_channel(ssh_session session, ssh_channel channel);
+
+
+/**
* @brief Close and deallocate a sftp session.
*
* @param sftp The sftp session handle to free.
@@ -830,7 +844,7 @@ LIBSSH_API void sftp_client_message_free(sftp_client_message msg);
LIBSSH_API uint8_t sftp_client_message_get_type(sftp_client_message msg);
LIBSSH_API const char *sftp_client_message_get_filename(sftp_client_message msg);
LIBSSH_API void sftp_client_message_set_filename(sftp_client_message msg, const char *newname);
-LIBSSH_API char *sftp_client_message_get_data(sftp_client_message msg);
+LIBSSH_API const char *sftp_client_message_get_data(sftp_client_message msg);
LIBSSH_API uint32_t sftp_client_message_get_flags(sftp_client_message msg);
LIBSSH_API int sftp_send_client_message(sftp_session sftp, sftp_client_message msg);
int sftp_reply_name(sftp_client_message msg, const char *name,