aboutsummaryrefslogtreecommitdiff
path: root/lzo.h
diff options
context:
space:
mode:
authorJames Yonan <james@openvpn.net>2011-03-10 00:04:39 +0000
committerDavid Sommerseth <dazo@users.sourceforge.net>2011-04-25 22:12:03 +0200
commit6c34e74f1340a72ab7dce077e4d326f03989322c (patch)
tree58d9c9866866156ddd191a4b4bbfefb1d3ab0d34 /lzo.h
parentAdded "client-nat" option for stateless, one-to-one (diff)
downloadopenvpn-6c34e74f1340a72ab7dce077e4d326f03989322c.tar.xz
Added --enable-lzo-stub configure option to build an OpenVPN client without LZO, but that has limited interoperability with LZO-enabled servers.
Modified "push-peer-info" option to push IV_LZO_STUB=1 to server when client was built with --enable-lzo-stub configure option. This tells the server that the client lacks LZO capabilities, so the server should turn off LZO compression for this client via "lzo no". Added "setenv PUSH_PEER_INFO" option having the same effect as "push-peer-info". Version 2.1.3j git-svn-id: http://svn.openvpn.net/projects/branches/BETA21@7023 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to '')
-rw-r--r--lzo.h29
1 files changed, 20 insertions, 9 deletions
diff --git a/lzo.h b/lzo.h
index bb15753..831f204 100644
--- a/lzo.h
+++ b/lzo.h
@@ -27,6 +27,7 @@
#ifdef USE_LZO
+#ifndef LZO_STUB
#ifdef LZO_HEADER_DIR
#include "lzo/lzoutil.h"
#include "lzo/lzo1x.h"
@@ -34,6 +35,7 @@
#include "lzoutil.h"
#include "lzo1x.h"
#endif
+#endif
#include "buffer.h"
#include "mtu.h"
@@ -46,6 +48,18 @@
#define LZO_ADAPTIVE (1<<2)
/*
+ * Length of prepended prefix on LZO packets
+ */
+#define LZO_PREFIX_LEN 1
+
+/*
+ * LZO 2.0 worst case size expansion
+ */
+#define LZO_EXTRA_BUFFER(len) ((len)/8 + 128 + 3)
+
+#ifndef LZO_STUB
+
+/*
* Use LZO compress routine lzo1x_1_15_compress which is described
* as faster but needs a bit more memory than the standard routine.
* Use safe decompress (i.e. check for buffer overflows).
@@ -58,19 +72,12 @@
#define LZO_WORKSPACE LZO1X_1_15_MEM_COMPRESS
#define LZO_DECOMPRESS lzo1x_decompress_safe
-#define LZO_EXTRA_BUFFER(len) ((len)/8 + 128 + 3) /* LZO 2.0 worst case size expansion. */
-
/*
* Don't try to compress any packet smaller than this.
*/
#define COMPRESS_THRESHOLD 100
/*
- * Length of prepended prefix on LZO packets
- */
-#define LZO_PREFIX_LEN 1
-
-/*
* Adaptive compress parameters
*/
#define AC_SAMP_SEC 2 /* number of seconds in sample period */
@@ -88,23 +95,27 @@ struct lzo_adaptive_compress {
int n_comp;
};
+#endif /* LZO_STUB */
+
/*
* Compress and Uncompress routines.
*/
struct lzo_compress_workspace
{
+ bool defined;
+ unsigned int flags;
+#ifndef LZO_STUB
lzo_voidp wmem;
int wmem_size;
struct lzo_adaptive_compress ac;
- unsigned int flags;
- bool defined;
/* statistics */
counter_type pre_decompress;
counter_type post_decompress;
counter_type pre_compress;
counter_type post_compress;
+#endif
};
void lzo_adjust_frame_parameters(struct frame *frame);