27#ifndef PROTOCORE_RELAY_H
28#define PROTOCORE_RELAY_H
32#if PROTOCORE_ENABLE_RELAY
42 PROTOCORE_RELAY_ERROR = -1,
43 PROTOCORE_RELAY_RUNNING = 0,
44 PROTOCORE_RELAY_DONE = 1,
52typedef int (*protocore_relay_recv_fn)(
void *ctx, uint8_t *buf,
size_t cap);
59typedef int (*protocore_relay_send_fn)(
void *ctx,
const uint8_t *buf,
size_t len);
62typedef void (*protocore_relay_shutdown_fn)(
void *ctx);
67 protocore_relay_recv_fn recv;
68 protocore_relay_send_fn send;
69 protocore_relay_shutdown_fn shutdown;
76 protocore_relay_end a;
77 protocore_relay_end b;
88 embed_bool a_shut_sent;
89 embed_bool b_shut_sent;
98 const protocore_relay_end *client;
99 const protocore_relay_end *origin;
142 RelayInitArgs init_args;
143 RelayStepArgs step_args;
144 RelayNoteEofArgs note_eof_args;
146 protocore_relay_status status;
150extern RelayVars RelayV;
155 void (*
const init)(
const uint8_t *work);
156 void (*
const step)(
const uint8_t *work);
157 void (*
const note_eof)(
const uint8_t *work);
162void protocore_relay_init(
const uint8_t *work);
163void protocore_relay_step(
const uint8_t *work);
164void protocore_relay_note_eof(
const uint8_t *work);
170static const RelayNs Relay __attribute__((unused)) = {
171 .init = protocore_relay_init,
172 .step = protocore_relay_step,
173 .note_eof = protocore_relay_note_eof,
EMBED_ENUM_BYTE(ProtoConn, PROTO_NONE=0, PROTO_HTTP=1, PROTO_TELNET=2, PROTO_SSH=3, PROTO_MODBUS=4, PROTO_OPCUA=5, PROTO_SSH_RFWD=6, PROTO_RELAY=7, PROTO_BRIDGE=8, PROTO_NTRIP_CASTER=9, PROTO_MESH=10, PROTO_UDP=11,)
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).