summaryrefslogtreecommitdiffstats
path: root/src/openvpn/options.c
diff options
context:
space:
mode:
authorGert Doering <gert@greenie.muc.de>2014-01-01 22:57:58 +0100
committerGert Doering <gert@greenie.muc.de>2014-01-06 12:18:53 +0100
commit40efb6359aff0e4805c0439acd6e899c687ef058 (patch)
treeff119c7a017fa18f939f76e0f2577ef9a94f8d1d /src/openvpn/options.c
parent56ab21091c0f1e07d0a6ef7815160f6ae072498d (diff)
downloadopenvpn-40efb6359aff0e4805c0439acd6e899c687ef058.tar.gz
openvpn-40efb6359aff0e4805c0439acd6e899c687ef058.tar.xz
openvpn-40efb6359aff0e4805c0439acd6e899c687ef058.zip
Implement LZ4 compression.
Implement LZ4 compression, similar to the existing snappy / push-peer-info model: a LZ4 capable client will send IV_LZ4=1 to the server, and the algorithm is selected by pushing "compress lz4" back. LZ4 does not compress as well as LZO or Snappy, but needs far less CPU and is much faster, thus better suited for mobile devices. See https://code.google.com/p/lz4/ for more details. LZ4 include and library path can be specified by specifying LZ4_LIBS=... and LZ4_CFLAGS=... on the configure command line. Signed-off-by: Gert Doering <gert@greenie.muc.de> Acked-by: Arne Schwabe <arne@rfc2549.org> Message-Id: <1388613479-22377-1-git-send-email-gert@greenie.muc.de> URL: http://article.gmane.org/gmane.network.openvpn.devel/8153
Diffstat (limited to 'src/openvpn/options.c')
-rw-r--r--src/openvpn/options.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/openvpn/options.c b/src/openvpn/options.c
index 6d9c3b8..6165faa 100644
--- a/src/openvpn/options.c
+++ b/src/openvpn/options.c
@@ -92,6 +92,9 @@ const char title_string[] =
#ifdef ENABLE_SNAPPY
" [SNAPPY]"
#endif
+#ifdef ENABLE_LZ4
+ " [LZ4]"
+#endif
#ifdef ENABLE_COMP_STUB
" [COMP_STUB]"
#endif
@@ -6259,6 +6262,13 @@ add_option (struct options *options,
options->comp.flags = COMP_F_SWAP;
}
#endif
+#if defined(ENABLE_LZ4)
+ else if (streq (p[1], "lz4"))
+ {
+ options->comp.alg = COMP_ALG_LZ4;
+ options->comp.flags = COMP_F_SWAP;
+ }
+#endif
else
{
msg (msglevel, "bad comp option: %s", p[1]);