OpenVPN
Data Structures | Macros | Functions
comp.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  compress_options
 

Macros

#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
 
#define COMP_F_MIGRATE   (1<<5) /* push stub-v2 or comp-lzo no when we see a client with comp-lzo in occ */
 
#define COMP_F_ALLOW_ASYM   (1<<6) /* Compression was explicitly set to allow asymetric compression */
 
#define COMP_F_ALLOW_NOCOMP_ONLY   (1<<7) /* Do not allow compression framing (breaks DCO) */
 
#define COMP_ALG_UNDEF   0
 
#define COMP_ALG_STUB   1 /* support compression command byte and framing without actual compression */
 
#define COMP_ALG_LZO   2 /* LZO algorithm */
 
#define COMP_ALG_SNAPPY   3 /* Snappy algorithm (no longer supported) */
 
#define COMP_ALG_LZ4   4 /* LZ4 algorithm */
 
#define COMP_ALGV2_UNCOMPRESSED   10
 
#define COMP_ALGV2_LZ4   11
 

Functions

static bool comp_non_stub_enabled (const struct compress_options *info)
 
bool check_compression_settings_valid (struct compress_options *info, int msglevel)
 Checks if the compression settings are valid. More...
 

Macro Definition Documentation

◆ COMP_ALG_LZ4

#define COMP_ALG_LZ4   4 /* LZ4 algorithm */

Definition at line 49 of file comp.h.

◆ COMP_ALG_LZO

#define COMP_ALG_LZO   2 /* LZO algorithm */

Definition at line 47 of file comp.h.

◆ COMP_ALG_SNAPPY

#define COMP_ALG_SNAPPY   3 /* Snappy algorithm (no longer supported) */

Definition at line 48 of file comp.h.

◆ COMP_ALG_STUB

#define COMP_ALG_STUB   1 /* support compression command byte and framing without actual compression */

Definition at line 46 of file comp.h.

◆ COMP_ALG_UNDEF

#define COMP_ALG_UNDEF   0

Definition at line 45 of file comp.h.

◆ COMP_ALGV2_LZ4

#define COMP_ALGV2_LZ4   11

Definition at line 54 of file comp.h.

◆ COMP_ALGV2_UNCOMPRESSED

#define COMP_ALGV2_UNCOMPRESSED   10

Definition at line 53 of file comp.h.

◆ COMP_F_ADAPTIVE

#define COMP_F_ADAPTIVE   (1<<0) /* COMP_ALG_LZO only */

Definition at line 35 of file comp.h.

◆ COMP_F_ADVERTISE_STUBS_ONLY

#define COMP_F_ADVERTISE_STUBS_ONLY   (1<<3) /* tell server that we only support compression stubs */

Definition at line 38 of file comp.h.

◆ COMP_F_ALLOW_ASYM

#define COMP_F_ALLOW_ASYM   (1<<6) /* Compression was explicitly set to allow asymetric compression */

Definition at line 41 of file comp.h.

◆ COMP_F_ALLOW_COMPRESS

#define COMP_F_ALLOW_COMPRESS   (1<<1) /* not only downlink is compressed but also uplink */

Definition at line 36 of file comp.h.

◆ COMP_F_ALLOW_NOCOMP_ONLY

#define COMP_F_ALLOW_NOCOMP_ONLY   (1<<7) /* Do not allow compression framing (breaks DCO) */

Definition at line 42 of file comp.h.

◆ COMP_F_ALLOW_STUB_ONLY

#define COMP_F_ALLOW_STUB_ONLY
Value:
(1<<4) /* Only accept stub compression, even with COMP_F_ADVERTISE_STUBS_ONLY
* we still accept other compressions to be pushed */

Definition at line 39 of file comp.h.

◆ COMP_F_MIGRATE

#define COMP_F_MIGRATE   (1<<5) /* push stub-v2 or comp-lzo no when we see a client with comp-lzo in occ */

Definition at line 40 of file comp.h.

◆ COMP_F_SWAP

#define COMP_F_SWAP   (1<<2) /* initial command byte is swapped with last byte in buffer to preserve payload alignment */

Definition at line 37 of file comp.h.

Function Documentation

◆ check_compression_settings_valid()

bool check_compression_settings_valid ( struct compress_options info,
int  msglevel 
)

Checks if the compression settings are valid.

Takes into account the flags of allow-compression and also the whether algorithms are compiled in

Definition at line 163 of file comp.c.

References compress_options::alg, COMP_ALG_LZ4, COMP_ALG_LZO, COMP_ALG_UNDEF, COMP_ALGV2_LZ4, COMP_ALGV2_UNCOMPRESSED, COMP_F_ALLOW_NOCOMP_ONLY, COMP_F_ALLOW_STUB_ONLY, comp_non_stub_enabled(), compress_options::flags, and msg.

Referenced by do_deferred_options(), multi_connection_established(), and options_postprocess_mutate().

◆ comp_non_stub_enabled()

static bool comp_non_stub_enabled ( const struct compress_options info)
inlinestatic