From 10b625e18030144f30a68556321a4c3d11fa7e25 Mon Sep 17 00:00:00 2001 From: Aris Adamantiadis Date: Sun, 8 Nov 2009 23:42:41 +0100 Subject: First lines of experimental pcap output support This will serve to debug packets right under wireshark ! --- libssh/buffer.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'libssh/buffer.c') 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 @@ -188,6 +189,20 @@ int buffer_add_u32(struct ssh_buffer_struct *buffer,uint32_t data){ return 0; } +/** \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 -- cgit