40#define COMP_F_SWAP (1<<2)
42#define COMP_F_ADVERTISE_STUBS_ONLY (1<<3)
45#define COMP_F_ALLOW_STUB_ONLY (1<<4)
47#define COMP_F_MIGRATE (1<<5)
49#define COMP_F_ALLOW_ASYM (1<<6)
51#define COMP_F_ALLOW_NOCOMP_ONLY (1<<7)
54#define COMP_ALG_UNDEF 0
56#define COMP_ALG_STUB 1
58#define COMP_ALG_SNAPPY 3
63#define COMP_ALGV2_UNCOMPRESSED 10
64#define COMP_ALGV2_LZ4 11
105#define COMP_PREFIX_LEN 1
113#define LZO_COMPRESS_BYTE 0x66
114#define LZ4_COMPRESS_BYTE 0x69
115#define NO_COMPRESS_BYTE 0xFA
117#define NO_COMPRESS_BYTE_SWAP 0xFB
120#define COMP_ALGV2_INDICATOR_BYTE 0x50
121#define COMP_ALGV2_UNCOMPRESSED_BYTE 0
122#define COMP_ALGV2_LZ4_BYTE 1
123#define COMP_ALGV2_LZO_BYTE 2
124#define COMP_ALGV2_SNAPPY_BYTE 3
133#define COMP_EXTRA_BUFFER(len) ((len)/6 + 128 + 3 + COMP_PREFIX_LEN)
138#define COMPRESS_THRESHOLD 100
141struct compress_context;
149 void (*compress_init)(
struct compress_context *compctx);
150 void (*compress_uninit)(
struct compress_context *compctx);
151 void (*compress)(
struct buffer *buf,
struct buffer work,
155 void (*decompress)(
struct buffer *buf,
struct buffer work,
174union compress_workspace_union
177 struct lzo_compress_workspace lzo;
180 struct lz4_workspace lz4;
187struct compress_context
190 struct compress_alg alg;
191 union compress_workspace_union wu;
200extern const struct compress_alg comp_stub_alg;
201extern const struct compress_alg compv2_stub_alg;
205void comp_uninit(
struct compress_context *compctx);
207void comp_print_stats(
const struct compress_context *compctx,
struct status_output *so);
211void compv2_escape_data_ifneeded(
struct buffer *buf);
#define COMP_ALGV2_UNCOMPRESSED
#define COMP_ALG_STUB
support compression command byte and framing without actual compression
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.