39stub_compress_init(
struct compress_context *compctx)
44stub_compress_uninit(
struct compress_context *compctx)
50 struct compress_context *compctx,
59 uint8_t *head =
BPTR(buf);
60 uint8_t *tail =
BEND(buf);
66 *head = NO_COMPRESS_BYTE_SWAP;
71 *header = NO_COMPRESS_BYTE;
77 struct compress_context *compctx,
87 uint8_t *head =
BPTR(buf);
91 if (c != NO_COMPRESS_BYTE_SWAP)
93 dmsg(
D_COMP_ERRORS,
"Bad compression stub (swap) decompression header byte: %d", c);
101 if (c != NO_COMPRESS_BYTE)
112 struct compress_context *compctx,
120 compv2_escape_data_ifneeded(buf);
124stubv2_decompress(
struct buffer *buf,
struct buffer work,
125 struct compress_context *compctx,
133 uint8_t *head =
BPTR(buf);
136 if (head[0] != COMP_ALGV2_INDICATOR_BYTE)
153 if (head[0] != COMP_ALGV2_UNCOMPRESSED_BYTE)
155 dmsg(
D_COMP_ERRORS,
"Bad compression stubv2 decompression header byte: %d", *head);
161const struct compress_alg compv2_stub_alg = {
164 stub_compress_uninit,
169const struct compress_alg comp_stub_alg = {
172 stub_compress_uninit,
static bool buf_safe(const struct buffer *buf, size_t len)
static bool buf_advance(struct buffer *buf, int size)
static uint8_t * buf_prepend(struct buffer *buf, int size)
#define COMP_F_SWAP
initial command byte is swapped with last byte in buffer to preserve payload alignment
Wrapper structure for dynamically allocated memory.
int len
Length in bytes of the actual content within the allocated memory.
Packet geometry parameters.