diff options
author | /C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org> | 2008-01-05 16:41:15 +0000 |
---|---|---|
committer | /C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org> | 2008-01-05 16:41:15 +0000 |
commit | 1102a95296e39f671efe51bb6bd9b30e5c14c91e (patch) | |
tree | d1d42347ea82ce0075884acc23ffa7ba932fb3a1 /include/buffer.h | |
parent | 1c0b4d3721e40586219fb7676e61e6ba19affdd2 (diff) | |
download | conntrack-tools-1102a95296e39f671efe51bb6bd9b30e5c14c91e.tar.gz conntrack-tools-1102a95296e39f671efe51bb6bd9b30e5c14c91e.zip |
implement buffered connection logging to improve performance
Diffstat (limited to 'include/buffer.h')
-rw-r--r-- | include/buffer.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/buffer.h b/include/buffer.h new file mode 100644 index 0000000..5b854f3 --- /dev/null +++ b/include/buffer.h @@ -0,0 +1,18 @@ +#ifndef _BUFFER_H_ +#define _BUFFER_H_ + +struct buffer { + unsigned char *data; + unsigned int size; + unsigned int cur_size; +}; + +struct buffer *buffer_create(unsigned int size); +int buffer_add(struct buffer *b, void *data, unsigned int size); +void buffer_flush(struct buffer *b, + void (*cb)(void *buffer_data, + void *data), + void *data); +unsigned int buffer_size(struct buffer *b); + +#endif |