aboutsummaryrefslogtreecommitdiff
path: root/libssh/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'libssh/buffer.c')
-rw-r--r--libssh/buffer.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libssh/buffer.c b/libssh/buffer.c
index a24dc688..761c51b0 100644
--- a/libssh/buffer.c
+++ b/libssh/buffer.c
@@ -174,6 +174,7 @@ int buffer_add_ssh_string(struct ssh_buffer_struct *buffer,
return 0;
}
+
/** \internal
* \brief add a 32 bits unsigned integer to the tail of buffer
* \param buffer buffer
@@ -189,6 +190,20 @@ int buffer_add_u32(struct ssh_buffer_struct *buffer,uint32_t data){
}
/** \internal
+ * \brief add a 16 bits unsigned integer to the tail of buffer
+ * \param buffer buffer
+ * \param data 16 bits integer
+ * \return 0 on success, -1 on error.
+ */
+int buffer_add_u16(struct ssh_buffer_struct *buffer,uint16_t data){
+ if (buffer_add_data(buffer, &data, sizeof(data)) < 0) {
+ return -1;
+ }
+
+ return 0;
+}
+
+/** \internal
* \brief add a 64 bits unsigned integer to the tail of buffer
* \param buffer buffer
* \param data 64 bits integer