fi
fi
-dnl enable multi-client mode
-if test "${enable_lzo_stub}" = "yes"; then
- AC_DEFINE([LZO_STUB], [1], [Enable LZO stub capability])
-fi
-
PKG_CHECK_MODULES(
[PKCS11_HELPER],
[libpkcs11-helper-1 >= 1.02],
AC_DEFINE([ENABLE_SELINUX], [1], [SELinux support])
fi
+if test "${enable_lzo_stub}" = "yes"; then
+ test "${enable_lzo}" = "yes" && AC_MSG_ERROR([Cannot have both lzo stub and lzo enabled])
+ AC_DEFINE([ENABLE_LZO_STUB], [1], [Enable LZO stub capability])
+ AC_DEFINE([USE_LZO], [1], [Enable LZO compression library])
+ AC_DEFINE([LZO_VERSION_NUM], ["STUB"], [LZO version number])
+fi
+
if test "${enable_pkcs11}" = "yes"; then
test "${have_pkcs11_helper}" != "yes" && AC_MSG_ERROR([PKCS11 enabled but libpkcs11-helper is missing])
test "${enable_ssl}" != "yes" && AC_MSG_ERROR([PKCS11 can be enabled only if SSL is enabled])
#include "memdbg.h"
-#ifndef LZO_STUB
+#ifndef ENABLE_LZO_STUB
/**
* Perform adaptive compression housekeeping.
*
ac->n_comp += n_comp;
}
-#endif /* LZO_STUB */
+#endif /* ENABLE_LZO_STUB */
void lzo_adjust_frame_parameters (struct frame *frame)
{
CLEAR (*lzowork);
lzowork->flags = flags;
-#ifndef LZO_STUB
+#ifndef ENABLE_LZO_STUB
lzowork->wmem_size = LZO_WORKSPACE;
if (lzo_init () != LZO_E_OK)
if (lzowork)
{
ASSERT (lzowork->defined);
-#ifndef LZO_STUB
+#ifndef ENABLE_LZO_STUB
lzo_free (lzowork->wmem);
lzowork->wmem = NULL;
#endif
static inline bool
lzo_compression_enabled (struct lzo_compress_workspace *lzowork)
{
-#ifndef LZO_STUB
+#ifndef ENABLE_LZO_STUB
if ((lzowork->flags & (LZO_SELECTED|LZO_ON)) == (LZO_SELECTED|LZO_ON))
{
if (lzowork->flags & LZO_ADAPTIVE)
struct lzo_compress_workspace *lzowork,
const struct frame* frame)
{
-#ifndef LZO_STUB
+#ifndef ENABLE_LZO_STUB
lzo_uint zlen = 0;
int err;
bool compressed = false;
if (buf->len <= 0)
return;
-#ifndef LZO_STUB
+#ifndef ENABLE_LZO_STUB
/*
* In order to attempt compression, length must be at least COMPRESS_THRESHOLD,
* and our adaptive level must give the OK.
struct lzo_compress_workspace *lzowork,
const struct frame* frame)
{
-#ifndef LZO_STUB
+#ifndef ENABLE_LZO_STUB
lzo_uint zlen = EXPANDED_SIZE (frame);
int err;
#endif
if (c == YES_COMPRESS) /* packet was compressed */
{
-#ifndef LZO_STUB
+#ifndef ENABLE_LZO_STUB
ASSERT (buf_safe (&work, zlen));
err = LZO_DECOMPRESS (BPTR (buf), BLEN (buf), BPTR (&work), &zlen,
lzowork->wmem);
{
ASSERT (lzo_compwork->defined);
-#ifndef LZO_STUB
+#ifndef ENABLE_LZO_STUB
status_printf (so, "pre-compress bytes," counter_format, lzo_compwork->pre_compress);
status_printf (so, "post-compress bytes," counter_format, lzo_compwork->post_compress);
status_printf (so, "pre-decompress bytes," counter_format, lzo_compwork->pre_decompress);
* @{
*/
-#ifndef LZO_STUB
+#ifndef ENABLE_LZO_STUB
#ifdef LZO_HEADER_DIR
#include "lzo/lzoutil.h"
#include "lzo/lzo1x.h"
/**************************************************************************/
/** @name LZO library interface defines *//** @{ *//***********************/
-#ifndef LZO_STUB
+#ifndef ENABLE_LZO_STUB
#define LZO_COMPRESS lzo1x_1_15_compress
/**< LZO library compression function.
*
* verify the integrity of incoming
* packets, you might want to consider
* using the non-safe version. */
-#endif /* LZO_STUB */
+#endif /* ENABLE_LZO_STUB */
/** @} name LZO library interface *//**************************************/
/** @name Miscellaneous compression defines *//** @{ *//*******************/
#define LZO_EXTRA_BUFFER(len) ((len)/8 + 128 + 3)
/**< LZO 2.0 worst-case size expansion. */
-#ifndef LZO_STUB
+#ifndef ENABLE_LZO_STUB
#define COMPRESS_THRESHOLD 100 /**< Minimum packet size to attempt
* compression. */
-#endif /* LZO_STUB */
+#endif /* ENABLE_LZO_STUB */
/** @} name Miscellaneous compression defines *//**************************/
/**************************************************************************/
/** @name Adaptive compression defines *//** @{ *//************************/
-#ifndef LZO_STUB
+#ifndef ENABLE_LZO_STUB
#define AC_SAMP_SEC 2 /**< Number of seconds in a sample period. */
#define AC_MIN_BYTES 1000 /**< Minimum number of bytes a sample
* period must contain for it to be
* turned off. */
#define AC_OFF_SEC 60 /**< Seconds to wait after compression has
* been turned off before retesting. */
-#endif /* LZO_STUB */
+#endif /* ENABLE_LZO_STUB */
/** @} name Adaptive compression defines *//*******************************/
-#ifndef LZO_STUB
+#ifndef ENABLE_LZO_STUB
/**
* Adaptive compression state.
int n_comp;
};
-#endif /* LZO_STUB */
+#endif /* ENABLE_LZO_STUB */
/**
{
bool defined;
unsigned int flags;
-#ifndef LZO_STUB
+#ifndef ENABLE_LZO_STUB
lzo_voidp wmem;
int wmem_size;
struct lzo_adaptive_compress ac;
}
/* push LZO status */
-#ifdef LZO_STUB
+#ifdef ENABLE_LZO_STUB
buf_printf (&out, "IV_LZO_STUB=1\n");
#endif
*/
#define ENABLE_CLIENT_NAT
-/*
- * Support LZO as a stub in client? (LZO lib not included, but we
- * we still support LZO protocol changes that allow us to
- * communicate with an LZO-enabled server)
- */
-#ifdef LZO_STUB
-#undef USE_LZO
-#undef LZO_VERSION_NUM
-#define USE_LZO 1
-#define LZO_VERSION_NUM "STUB"
-#endif
-
/*
* Enable --memstats option
*/