summaryrefslogtreecommitdiffstats
path: root/lzo.h
diff options
context:
space:
mode:
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2005-10-02 03:41:35 +0000
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2005-10-02 03:41:35 +0000
commit537073fd55b3e35720e759c5c13e9da128a2b0bb (patch)
treef4d544e3e85bc2a32b33f6400ff74ec8d3826302 /lzo.h
parentc70caa7fd4a631f42b136bdcf3c5199774ed09e5 (diff)
downloadopenvpn-537073fd55b3e35720e759c5c13e9da128a2b0bb.tar.gz
openvpn-537073fd55b3e35720e759c5c13e9da128a2b0bb.tar.xz
openvpn-537073fd55b3e35720e759c5c13e9da128a2b0bb.zip
version 2.1_beta1
git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@588 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to 'lzo.h')
-rw-r--r--lzo.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/lzo.h b/lzo.h
index eed4373..47b2c3b 100644
--- a/lzo.h
+++ b/lzo.h
@@ -22,6 +22,9 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#ifndef OPENVPN_LZO_H
+#define OPENVPN_LZO_H
+
#ifdef USE_LZO
#ifdef LZO_HEADER_DIR
@@ -37,6 +40,11 @@
#include "common.h"
#include "status.h"
+/* LZO flags */
+#define LZO_SELECTED (1<<0)
+#define LZO_ON (1<<1)
+#define LZO_ADAPTIVE (1<<2)
+
/*
* Use LZO compress routine lzo1x_1_15_compress which is described
* as faster but needs a bit more memory than the standard routine.
@@ -74,7 +82,6 @@
retest for n seconds */
struct lzo_adaptive_compress {
- bool enabled;
bool compress_state;
time_t next;
int n_total;
@@ -90,6 +97,8 @@ struct lzo_compress_workspace
lzo_voidp wmem;
int wmem_size;
struct lzo_adaptive_compress ac;
+ unsigned int flags;
+ bool defined;
/* statistics */
counter_type pre_decompress;
@@ -100,10 +109,12 @@ struct lzo_compress_workspace
void lzo_adjust_frame_parameters(struct frame *frame);
-void lzo_compress_init (struct lzo_compress_workspace *lzowork, bool adaptive);
+void lzo_compress_init (struct lzo_compress_workspace *lzowork, unsigned int flags);
void lzo_compress_uninit (struct lzo_compress_workspace *lzowork);
+void lzo_modify_flags (struct lzo_compress_workspace *lzowork, unsigned int flags);
+
void lzo_compress (struct buffer *buf, struct buffer work,
struct lzo_compress_workspace *lzowork,
const struct frame* frame);
@@ -114,4 +125,12 @@ void lzo_decompress (struct buffer *buf, struct buffer work,
void lzo_print_stats (const struct lzo_compress_workspace *lzo_compwork, struct status_output *so);
+static inline bool
+lzo_defined (const struct lzo_compress_workspace *lzowork)
+{
+ return lzowork->defined;
+}
+
+
#endif /* USE_LZO */
+#endif