summaryrefslogtreecommitdiff
path: root/src/openvpn/comp.h
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2021-11-29 20:51:58 +0100
committerJörg Frings-Fürst <debian@jff.email>2021-11-29 20:51:58 +0100
commit6e3e95a9da9458ddf0874b4bd1c8ce6b47fcef27 (patch)
tree6e3667709d99f857d90b9831426f6a32ee70d113 /src/openvpn/comp.h
parentb29f419d68b26b75a44e3ac00748875f1003b900 (diff)
parentf2b3dda12a731c2e0971cb7889728edaf23f6cb0 (diff)
Merge branch 'upstream' into develop
Diffstat (limited to 'src/openvpn/comp.h')
-rw-r--r--src/openvpn/comp.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/openvpn/comp.h b/src/openvpn/comp.h
index 0dadd1e..dfd70bb 100644
--- a/src/openvpn/comp.h
+++ b/src/openvpn/comp.h
@@ -5,7 +5,7 @@
* packet encryption, packet authentication, and
* packet compression.
*
- * Copyright (C) 2002-2018 OpenVPN Inc <sales@openvpn.net>
+ * Copyright (C) 2002-2021 OpenVPN Inc <sales@openvpn.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
@@ -52,10 +52,12 @@
*/
/* Compression flags */
-#define COMP_F_ADAPTIVE (1<<0) /* COMP_ALG_LZO only */
-#define COMP_F_ASYM (1<<1) /* only downlink is compressed, not uplink */
-#define COMP_F_SWAP (1<<2) /* initial command byte is swapped with last byte in buffer to preserve payload alignment */
+#define COMP_F_ADAPTIVE (1<<0) /* COMP_ALG_LZO only */
+#define COMP_F_ALLOW_COMPRESS (1<<1) /* not only downlink is compressed but also uplink */
+#define COMP_F_SWAP (1<<2) /* initial command byte is swapped with last byte in buffer to preserve payload alignment */
#define COMP_F_ADVERTISE_STUBS_ONLY (1<<3) /* tell server that we only support compression stubs */
+#define COMP_F_ALLOW_STUB_ONLY (1<<4) /* Only accept stub compression, even with COMP_F_ADVERTISE_STUBS_ONLY
+ * we still accept other compressions to be pushed */
/*
@@ -189,6 +191,14 @@ comp_enabled(const struct compress_options *info)
}
static inline bool
+comp_non_stub_enabled(const struct compress_options *info)
+{
+ return info->alg != COMP_ALGV2_UNCOMPRESSED
+ && info->alg != COMP_ALG_STUB
+ && info->alg != COMP_ALG_UNDEF;
+}
+
+static inline bool
comp_unswapped_prefix(const struct compress_options *info)
{
return !(info->flags & COMP_F_SWAP);