]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Add macros for access to the underlying buffer and offset.
authorJason Ish <jason.ish@emulex.com>
Tue, 4 Mar 2014 16:42:19 +0000 (10:42 -0600)
committerVictor Julien <victor@inliniac.net>
Wed, 4 Jun 2014 07:50:07 +0000 (09:50 +0200)
Useful for using passing the buffer through to another writer
such as LogFileCtx.

src/util-buffer.h

index 0ab4583a3233351822fcf83e00b1379ed0659e3d..5c592ae43a32644ec94a73c291a1ef1abf6eb391 100644 (file)
@@ -43,6 +43,16 @@ void MemBufferFree(MemBuffer *buffer);
         (mem_buffer)->offset = 0;                           \
     } while (0)
 
+/**
+ * \brief Get the MemBuffers underlying buffer.
+ */
+#define MEMBUFFER_BUFFER(mem_buffer) (mem_buffer)->buffer
+
+/**
+ * \brief Get the MemBuffers current offset.
+ */
+#define MEMBUFFER_OFFSET(mem_buffer) (mem_buffer)->offset
+
 /**
  * \brief Write a buffer to the file pointer.
  *