aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
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,