32#ifndef PROTOCORE_TCP_SERVER_H
33#define PROTOCORE_TCP_SERVER_H
127#if PROTOCORE_WORKER_COUNT > 1
140 void (*
const stop)(uint8_t *work);
141 void (*
const stop_all)(uint8_t *work);
142 void (*
const stop_dynamic)(uint8_t *work);
143 void (*
const add)(uint8_t *work);
144 void (*
const add_dynamic)(uint8_t *work);
145 void (*
const enqueue)(uint8_t *work);
146 void (*
const set_dscp)(uint8_t *work);
147 void (*
const worker_queues_init)(uint8_t *work);
148 void (*
const worker_queue)(uint8_t *work);
149 void (*
const listener_queue)(uint8_t *work);
150 void (*
const accept_allowed)(uint8_t *work);
151 void (*
const accept_throttle_reset)(uint8_t *work);
152 void (*
const accept_allowed_ip)(uint8_t *work);
153 void (*
const per_ip_throttle_reset)(uint8_t *work);
154 void (*
const ip_allow_add)(uint8_t *work);
155 void (*
const ip_allow_add_cidr)(uint8_t *work);
156 void (*
const ip_allowed)(uint8_t *work);
157 void (*
const ip_allowlist_reset)(uint8_t *work);
169#if PROTOCORE_WORKER_COUNT > 1
170void protocore_tcp_listener_worker_queues_init(uint8_t *work);
171void protocore_tcp_listener_worker_queue(uint8_t *work);
188static const TcpListenerNs TcpListener __attribute__((unused)) = {
196#if PROTOCORE_WORKER_COUNT > 1
197 .worker_queues_init = protocore_tcp_listener_worker_queues_init,
198 .worker_queue = protocore_tcp_listener_worker_queue,
enum PROTO_ENUM_PACKED ProtoConn
Application protocol spoken on a listener port or connection slot.
What the stack callbacks post to a listener's queue: the event type and the record.
Layer 3 (Network) - a family-tagged IP address (IPv4 or IPv6) with RFC-faithful text parsing,...
RFC 9293 sec 3.9.1.1 passive OPEN: what a bound port is.
uint16_t port
the port it binds, or the one a lookup names
proto_bool tls
connections accepted here begin a handshake
uint8_t dscp
the code point a port marks with
ProtoConn proto
the application protocol its connections take
Event record posted from the stack callbacks to the session layer.
The accept-time gates: what a throttle or an allowlist judges. Nothing a bind reads.
const char * cidr
the same rule as text
uint8_t prefix_len
its CIDR prefix length (RFC 4632)
uint32_t now_ms
the clock a throttle window measures against
const protocore_ip * addr
the source address a gate judges
void(*const stop)(uint8_t *work)
TcpBindArgs bind
what a passive OPEN binds (RFC 9293 sec 3.9.1.1)
TcpGateArgs gate
what an accept-time gate judges
uint8_t idx
the listener row every call names
TcpQueueArgs q
where an event goes
protocore_platform_queue queue
Event routing: whose queue an event goes to, and what it names.
uint8_t conn_slot
the slot that event names
int worker_id
whose queue is being named
const TcpEvt * evt
the event an enqueue posts
A v4 or v6 address in network (big-endian) byte order.
void protocore_tcp_listener_listener_queue(uint8_t *work)
void protocore_tcp_listener_ip_allowlist_reset(uint8_t *work)
void protocore_tcp_listener_ip_allowed(uint8_t *work)
void protocore_tcp_listener_ip_allow_add(uint8_t *work)
void protocore_tcp_listener_set_dscp(uint8_t *work)
uint8_t * protocore_tcp_listener_span(void)
The PROTOCORE_TCP_LISTENER_BORROW bytes this module's state lives in.
void protocore_tcp_listener_add(uint8_t *work)
void protocore_tcp_listener_accept_allowed(uint8_t *work)
void protocore_tcp_listener_ip_allow_add_cidr(uint8_t *work)
TcpListenerVars TcpListenerV
The operands and the outcome.
void protocore_tcp_listener_accept_throttle_reset(uint8_t *work)
void protocore_tcp_listener_add_dynamic(uint8_t *work)
void protocore_tcp_listener_stop_all(uint8_t *work)
void protocore_tcp_listener_per_ip_throttle_reset(uint8_t *work)
void protocore_tcp_listener_stop_dynamic(uint8_t *work)
PROTOCORE_BEGIN_DECLS protocore_net_err listener_accept_cb(void *arg, protocore_pcb *newpcb, protocore_net_err err)
Accept callback from the lower-level module - single handler for all listener ports.
void protocore_tcp_listener_accept_allowed_ip(uint8_t *work)
void protocore_tcp_listener_enqueue(uint8_t *work)
void protocore_tcp_listener_stop(uint8_t *work)
#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