4#ifndef PROTOCORE_TRANSPORT_COMP_H
5#define PROTOCORE_TRANSPORT_COMP_H
28 SSH_COMP_ZLIB_DELAYED = 2
34 void (*
reset)(uint8_t *, uint8_t);
35 void (*
set_s2c)(uint8_t *, uint8_t, SshCompAlg);
39 int (*
s2c)(uint8_t *, uint8_t,
const uint8_t *, size_t, uint8_t *, size_t,
size_t *);
40 void (*
set_c2s)(uint8_t *, uint8_t, SshCompAlg);
42 int (*
c2s)(uint8_t *, uint8_t,
const uint8_t *, size_t, uint8_t *, size_t,
size_t *);
89int protocore_comp_s2c(uint8_t *work, uint8_t i,
const uint8_t *src,
size_t src_len, uint8_t *dst,
size_t dst_cap,
116int protocore_comp_c2s(uint8_t *work, uint8_t i,
const uint8_t *src,
size_t src_len, uint8_t *dst,
size_t dst_cap,
embed_bool protocore_comp_c2s_active(uint8_t *work, uint8_t i)
True once the c2s stream is active and inbound payloads must be .
int protocore_comp_s2c(uint8_t *work, uint8_t i, const uint8_t *src, size_t src_len, uint8_t *dst, size_t dst_cap, size_t *out_len)
Compress one outbound payload, continuing the session's zlib stream.
embed_bool protocore_comp_s2c_active(uint8_t *work, uint8_t i)
True once the s2c stream is active and outbound payloads must be .
EMBED_ENUM_BYTE(SshCompAlg, SSH_COMP_NONE=0, SSH_COMP_ZLIB=1, SSH_COMP_ZLIB_DELAYED=2)
Negotiated compression algorithm, held per direction.
void protocore_comp_set_c2s(uint8_t *work, uint8_t i, SshCompAlg alg)
Record the client-to-server algorithm negotiated in KEXINIT .
void protocore_comp_on_auth_success(uint8_t *work, uint8_t i)
SSH_MSG_USERAUTH_SUCCESS sent: start the stream if .
void protocore_comp_set_s2c(uint8_t *work, uint8_t i, SshCompAlg alg)
Record the s2c algorithm negotiated in KEXINIT (SshCompAlg).
uint8_t * protocore_ssh_comp_span(void)
The bytes every entry here runs out of: one compressor per SSH connection.
void protocore_comp_reset(uint8_t *work, uint8_t i)
Reset compression state for slot i (fresh connection). Does NOT run .
int protocore_comp_c2s(uint8_t *work, uint8_t i, const uint8_t *src, size_t src_len, uint8_t *dst, size_t dst_cap, size_t *out_len)
Decompress one inbound payload, continuing the session's .
void protocore_comp_on_newkeys(uint8_t *work, uint8_t i)
NEWKEYS completed: start the stream now if zlib was negotiated .
#define PROTOCORE_UNUSED
Suppress the unused warning. Every module ends in a namespace most callers only partly use.
#define PROTOCORE_NS_LAYOUT(T,...)
Pin every dispatch slot of a table that is nothing but function pointers.
#define PROTOCORE_NS
Storage for a dispatch table. The const is load bearing.
Dispatch table. Addressed by offset, so the layout is asserted below.
void(* on_auth_success)(uint8_t *, uint8_t)
void(* set_c2s)(uint8_t *, uint8_t, SshCompAlg)
int(* s2c)(uint8_t *, uint8_t, const uint8_t *, size_t, uint8_t *, size_t, size_t *)
void(* on_newkeys)(uint8_t *, uint8_t)
int(* c2s)(uint8_t *, uint8_t, const uint8_t *, size_t, uint8_t *, size_t, size_t *)
void(* set_s2c)(uint8_t *, uint8_t, SshCompAlg)
void(* reset)(uint8_t *, uint8_t)
embed_bool(* c2s_active)(uint8_t *, uint8_t)
embed_bool(* s2c_active)(uint8_t *, uint8_t)