39#define COMP_F_SWAP (1<<2)
40#define COMP_F_ADVERTISE_STUBS_ONLY (1<<3)
41#define COMP_F_ALLOW_STUB_ONLY (1<<4)
43#define COMP_F_MIGRATE (1<<5)
44#define COMP_F_ALLOW_ASYM (1<<6)
45#define COMP_F_ALLOW_NOCOMP_ONLY (1<<7)
48#define COMP_ALG_UNDEF 0
49#define COMP_ALG_STUB 1
51#define COMP_ALG_SNAPPY 3
56#define COMP_ALGV2_UNCOMPRESSED 10
57#define COMP_ALGV2_LZ4 11
98#define COMP_PREFIX_LEN 1
106#define LZO_COMPRESS_BYTE 0x66
107#define LZ4_COMPRESS_BYTE 0x69
108#define NO_COMPRESS_BYTE 0xFA
109#define NO_COMPRESS_BYTE_SWAP 0xFB
112#define COMP_ALGV2_INDICATOR_BYTE 0x50
113#define COMP_ALGV2_UNCOMPRESSED_BYTE 0
114#define COMP_ALGV2_LZ4_BYTE 1
115#define COMP_ALGV2_LZO_BYTE 2
116#define COMP_ALGV2_SNAPPY_BYTE 3
125#define COMP_EXTRA_BUFFER(len) ((len)/6 + 128 + 3 + COMP_PREFIX_LEN)
130#define COMPRESS_THRESHOLD 100
133struct compress_context;
141 void (*compress_init)(
struct compress_context *compctx);
142 void (*compress_uninit)(
struct compress_context *compctx);
143 void (*compress)(
struct buffer *buf,
struct buffer work,
147 void (*decompress)(
struct buffer *buf,
struct buffer work,
166union compress_workspace_union
169 struct lzo_compress_workspace lzo;
172 struct lz4_workspace lz4;
179struct compress_context
182 struct compress_alg alg;
183 union compress_workspace_union wu;
192extern const struct compress_alg comp_stub_alg;
193extern const struct compress_alg compv2_stub_alg;
197void comp_uninit(
struct compress_context *compctx);
199void comp_print_stats(
const struct compress_context *compctx,
struct status_output *so);
203void compv2_escape_data_ifneeded(
struct buffer *buf);
#define COMP_ALGV2_UNCOMPRESSED
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.
Data Channel Compression module header file.
Wrapper structure for dynamically allocated memory.
int len
Length in bytes of the actual content within the allocated memory.
Packet geometry parameters.