27#ifndef PROTOCORE_RELAY_H
28#define PROTOCORE_RELAY_H
32#if PROTOCORE_ENABLE_RELAY
43 PROTOCORE_RELAY_ERROR = -1,
44 PROTOCORE_RELAY_RUNNING = 0,
45 PROTOCORE_RELAY_DONE = 1,
46} protocore_relay_status;
53typedef int (*protocore_relay_recv_fn)(
void *ctx, uint8_t *buf,
size_t cap);
60typedef int (*protocore_relay_send_fn)(
void *ctx,
const uint8_t *buf,
size_t len);
63typedef void (*protocore_relay_shutdown_fn)(
void *ctx);
68 protocore_relay_recv_fn recv;
69 protocore_relay_send_fn send;
70 protocore_relay_shutdown_fn shutdown;
77 protocore_relay_end a;
78 protocore_relay_end b;
99 const protocore_relay_end *client;
100 const protocore_relay_end *origin;
143 RelayInitArgs init_args;
144 RelayStepArgs step_args;
145 RelayNoteEofArgs note_eof_args;
147 protocore_relay_status status;
151extern RelayVars RelayV;
156 void (*
const init)(uint8_t *work);
157 void (*
const step)(uint8_t *work);
158 void (*
const note_eof)(uint8_t *work);
163void protocore_relay_init(uint8_t *work);
164void protocore_relay_step(uint8_t *work);
165void protocore_relay_note_eof(uint8_t *work);
171static const RelayNs Relay __attribute__((unused)) = {
172 .init = protocore_relay_init,
173 .step = protocore_relay_step,
174 .note_eof = protocore_relay_note_eof,
PROTO_ENUM_PACKED
Application protocol spoken on a listener port or connection slot.
#define PROTOCORE_RELAY_BUF
Per-direction relay buffer size (bytes) for server/net/relay (PROTOCORE_ENABLE_RELAY).
#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