From 6953c8ec91c1358a72bfb85795177f9bf9bbc0ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Fri, 25 Sep 2015 01:43:47 +0200 Subject: [PATCH] buffer: expose ssh_buffer_{add,get}_data() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fabiano FidĂȘncio Reviewed-by: Andreas Schneider --- include/libssh/buffer.h | 2 -- include/libssh/libssh.h | 2 ++ src/buffer.c | 4 ---- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/include/libssh/buffer.h b/include/libssh/buffer.h index 3bdd6753..abfcc74e 100644 --- a/include/libssh/buffer.h +++ b/include/libssh/buffer.h @@ -47,7 +47,6 @@ int ssh_buffer_add_u8(ssh_buffer buffer, uint8_t data); int ssh_buffer_add_u16(ssh_buffer buffer, uint16_t data); int ssh_buffer_add_u32(ssh_buffer buffer, uint32_t data); int ssh_buffer_add_u64(ssh_buffer buffer, uint64_t data); -int ssh_buffer_add_data(ssh_buffer buffer, const void *data, uint32_t len); int ssh_buffer_pack_va(struct ssh_buffer_struct *buffer, const char *format, @@ -81,7 +80,6 @@ int ssh_buffer_get_u8(ssh_buffer buffer, uint8_t *data); int ssh_buffer_get_u32(ssh_buffer buffer, uint32_t *data); int ssh_buffer_get_u64(ssh_buffer buffer, uint64_t *data); -uint32_t ssh_buffer_get_data(ssh_buffer buffer, void *data, uint32_t requestedlen); /* ssh_buffer_get_ssh_string() is an exception. if the String read is too large or invalid, it will answer NULL. */ ssh_string ssh_buffer_get_ssh_string(ssh_buffer buffer); /* ssh_gets a string out of a SSH-1 mpint */ diff --git a/include/libssh/libssh.h b/include/libssh/libssh.h index 635e015f..6ef63225 100644 --- a/include/libssh/libssh.h +++ b/include/libssh/libssh.h @@ -682,6 +682,8 @@ LIBSSH_API const char* ssh_get_hmac_out(ssh_session session); LIBSSH_API ssh_buffer ssh_buffer_new(void); LIBSSH_API void ssh_buffer_free(ssh_buffer buffer); LIBSSH_API int ssh_buffer_reinit(ssh_buffer buffer); +LIBSSH_API int ssh_buffer_add_data(ssh_buffer buffer, const void *data, uint32_t len); +LIBSSH_API uint32_t ssh_buffer_get_data(ssh_buffer buffer, void *data, uint32_t requestedlen); LIBSSH_API uint32_t ssh_buffer_get_len(ssh_buffer buffer); #ifndef LIBSSH_LEGACY_0_4 diff --git a/src/buffer.c b/src/buffer.c index d3eecb72..4e114760 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -206,8 +206,6 @@ int ssh_buffer_reinit(struct ssh_buffer_struct *buffer) } /** - * @internal - * * @brief Add data at the tail of a buffer. * * @param[in] buffer The buffer to add the data. @@ -515,8 +513,6 @@ uint32_t ssh_buffer_pass_bytes_end(struct ssh_buffer_struct *buffer, uint32_t le } /** - * @internal - * * @brief Get the remaining data out of the buffer and adjust the read pointer. * * @param[in] buffer The buffer to read.