summaryrefslogtreecommitdiffstats
path: root/libssh/buffer.c
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2009-11-08 23:42:41 +0100
committerAris Adamantiadis <aris@0xbadc0de.be>2009-11-08 23:42:41 +0100
commit10b625e18030144f30a68556321a4c3d11fa7e25 (patch)
treebc06f5a5386ace21a90d3ea4dad74be460042afd /libssh/buffer.c
parent10f27457d36fd39eee5c317d59e6ecfbc898db58 (diff)
downloadlibssh-10b625e18030144f30a68556321a4c3d11fa7e25.tar.gz
libssh-10b625e18030144f30a68556321a4c3d11fa7e25.tar.xz
libssh-10b625e18030144f30a68556321a4c3d11fa7e25.zip
First lines of experimental pcap output support
This will serve to debug packets right under wireshark !
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 a24dc68..761c51b 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