40#define COMP_F_SWAP (1u << 2)
42#define COMP_F_ADVERTISE_STUBS_ONLY (1u << 3)
45#define COMP_F_ALLOW_STUB_ONLY (1u << 4)
47#define COMP_F_MIGRATE (1u << 5)
49#define COMP_F_ALLOW_ASYM (1u << 6)
51#define COMP_F_ALLOW_NOCOMP_ONLY (1u << 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
103#define COMP_PREFIX_LEN 1
111#define LZO_COMPRESS_BYTE 0x66
112#define LZ4_COMPRESS_BYTE 0x69
113#define NO_COMPRESS_BYTE 0xFA
115#define NO_COMPRESS_BYTE_SWAP 0xFB
118#define COMP_ALGV2_INDICATOR_BYTE 0x50
119#define COMP_ALGV2_UNCOMPRESSED_BYTE 0
120#define COMP_ALGV2_LZ4_BYTE 1
121#define COMP_ALGV2_LZO_BYTE 2
122#define COMP_ALGV2_SNAPPY_BYTE 3
131#define COMP_EXTRA_BUFFER(len) ((len) / 6 + 128 + 3 + COMP_PREFIX_LEN)
136#define COMPRESS_THRESHOLD 100
139struct compress_context;
147 void (*compress_init)(
struct compress_context *compctx);
148 void (*compress_uninit)(
struct compress_context *compctx);
170union compress_workspace_union
173 struct lzo_compress_workspace lzo;
176 struct lz4_workspace lz4;
183struct compress_context
186 struct compress_alg alg;
187 union compress_workspace_union wu;
196extern const struct compress_alg comp_stub_alg;
197extern const struct compress_alg compv2_stub_alg;
201void comp_uninit(
struct compress_context *compctx);
203void comp_print_stats(
const struct compress_context *compctx,
struct status_output *so);
207void 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.