4#ifndef PROTOCORE_TRANSPORT_COMP_H
5#define PROTOCORE_TRANSPORT_COMP_H
35 void (*reset)(uint8_t *, uint8_t);
37 void (*on_newkeys)(uint8_t *, uint8_t);
38 void (*on_auth_success)(uint8_t *, uint8_t);
40 int (*s2c)(uint8_t *, uint8_t,
const uint8_t *, size_t, uint8_t *, size_t,
size_t *);
43 int (*c2s)(uint8_t *, uint8_t,
const uint8_t *, size_t, uint8_t *, size_t,
size_t *);
90int protocore_comp_s2c(uint8_t *work, uint8_t i,
const uint8_t *src,
size_t src_len, uint8_t *dst,
size_t dst_cap,
117int protocore_comp_c2s(uint8_t *work, uint8_t i,
const uint8_t *src,
size_t src_len, uint8_t *dst,
size_t dst_cap,
PROTO_ENUM_PACKED
Application protocol spoken on a listener port or connection slot.
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.
PROTOCORE_NS CompNs Comp PROTOCORE_UNUSED
Module namespace.
proto_bool protocore_comp_c2s_active(uint8_t *work, uint8_t i)
True once the c2s stream is active and inbound payloads must be .
enum PROTO_ENUM_PACKED SshCompAlg
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.
proto_bool protocore_comp_s2c_active(uint8_t *work, uint8_t i)
True once the s2c stream is active and outbound payloads must be .
@ SSH_COMP_ZLIB_DELAYED
"zlib@openssh.com" - starts after SSH_MSG_USERAUTH_SUCCESS
@ SSH_COMP_ZLIB
"zlib" (RFC 4253) - starts right after NEWKEYS
@ SSH_COMP_NONE
no compression
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_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(* reset)(uint8_t *, uint8_t)
#define PROTOCORE_BEGIN_DECLS
Give a header's declarations C linkage, so their symbol names carry no parameter types.
_Bool proto_bool
The truth value.
#define PROTOCORE_END_DECLS