ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
Loading...
Searching...
No Matches
protocol.h File Reference

Layer 4 (Transport) - the user/TCP interface and the event processing behind it. More...

Go to the source code of this file.

Classes

struct  ConnIoArgs
 RFC 9293 sec 3.9.1 SEND / RECEIVE: the bytes a call moves, and the room they move into. More...
 
struct  ConnLifeArgs
 What a pool lifecycle call reads: the idle deadline it sweeps against, and whose slots. More...
 
struct  ConnPoolVars
 
struct  ConnPoolNs
 The entries. More...
 

Functions

PROTOCORE_BEGIN_DECLS protocore_net_err lowlevel_recv_cb (void *arg, protocore_pcb *tpcb, protocore_pbuf *p, protocore_net_err err)
 
protocore_net_err lowlevel_sent_cb (void *arg, protocore_pcb *tpcb, proto_u16 len)
 
void lowlevel_err_cb (void *arg, protocore_net_err err)
 
void protocore_conn_pool_set_state (uint8_t *work)
 
void protocore_conn_pool_alloc_free (uint8_t *work)
 
void protocore_conn_pool_timeout_ms (uint8_t *work)
 
void protocore_conn_pool_send (uint8_t *work)
 
void protocore_conn_pool_send_flush (uint8_t *work)
 
void protocore_conn_pool_sndbuf (uint8_t *work)
 
void protocore_conn_pool_flush (uint8_t *work)
 
void protocore_conn_pool_ack_consumed (uint8_t *work)
 
void protocore_conn_pool_raw_send (uint8_t *work)
 
void protocore_conn_pool_close (uint8_t *work)
 
void protocore_conn_pool_abort_slot (uint8_t *work)
 
void protocore_conn_pool_closing_finalize (uint8_t *work)
 
void protocore_conn_pool_closing_check (uint8_t *work)
 
void protocore_conn_pool_begin_close (uint8_t *work)
 
void protocore_conn_pool_enqueue (uint8_t *work)
 
void protocore_conn_pool_init (uint8_t *work)
 
void protocore_conn_pool_stop (uint8_t *work)
 
void protocore_conn_pool_active_count (uint8_t *work)
 
void protocore_conn_pool_remote_ip (uint8_t *work)
 
void protocore_conn_pool_remote_addr (uint8_t *work)
 
void protocore_conn_pool_touch_active (uint8_t *work)
 
void protocore_conn_pool_check_timeouts (uint8_t *work)
 
void protocore_conn_pool_available (uint8_t *work)
 
void protocore_conn_pool_read_byte (uint8_t *work)
 
void protocore_conn_pool_peek (uint8_t *work)
 
void protocore_conn_pool_consume (uint8_t *work)
 
void protocore_conn_pool_read (uint8_t *work)
 
void protocore_conn_pool_active (uint8_t *work)
 
void protocore_conn_pool_iface (uint8_t *work)
 
void protocore_conn_pool_listener_id (uint8_t *work)
 
void protocore_conn_pool_tls (uint8_t *work)
 
void protocore_conn_pool_owner (uint8_t *work)
 
void protocore_conn_pool_proto_of (uint8_t *work)
 
void protocore_conn_pool_pcb_of (uint8_t *work)
 
uint8_t * protocore_conn_pool_span (void)
 The PROTOCORE_CONN_POOL_BORROW bytes this module's state lives in.
 

Variables

ConnPoolVars ConnPoolV
 The operands and the outcome.
 

Detailed Description

Layer 4 (Transport) - the user/TCP interface and the event processing behind it.

RFC 9293 sec 3.9.1 names the calls a TCP implementation owes its user: Open, Send, Receive, Close, Status, Abort, Flush, Asynchronous Reports, Set Differentiated Services Field. ConnPoolNs is that set for an accepted connection - the pool holds what the server accepted, and every layer above reaches a connection through this table rather than through the stack.

Behind the calls is sec 3.10 Event Processing: the three stack callbacks (sec 3.10.7 SEGMENT ARRIVES), the close sequence and its drain dwell (sec 3.6), the window management that reopens on consume (sec 3.8.6), and the timeouts (sec 3.10.8).

Calls INTO the stack are not here - those are lower.h (sec 3.9.2). This module decides what to do; that one performs it in the context where it is safe.

Author
Douglas Quigg (dstroy0)
Date
2026

Definition in file protocol.h.

Function Documentation

◆ lowlevel_recv_cb()

PROTOCORE_BEGIN_DECLS protocore_net_err lowlevel_recv_cb ( void *  arg,
protocore_pcb *  tpcb,
protocore_pbuf *  p,
protocore_net_err  err 
)

◆ lowlevel_sent_cb()

protocore_net_err lowlevel_sent_cb ( void *  arg,
protocore_pcb *  tpcb,
proto_u16  len 
)

◆ lowlevel_err_cb()

void lowlevel_err_cb ( void *  arg,
protocore_net_err  err 
)

◆ protocore_conn_pool_set_state()

void protocore_conn_pool_set_state ( uint8_t *  work)

◆ protocore_conn_pool_alloc_free()

void protocore_conn_pool_alloc_free ( uint8_t *  work)

◆ protocore_conn_pool_timeout_ms()

void protocore_conn_pool_timeout_ms ( uint8_t *  work)

◆ protocore_conn_pool_send()

void protocore_conn_pool_send ( uint8_t *  work)

◆ protocore_conn_pool_send_flush()

void protocore_conn_pool_send_flush ( uint8_t *  work)

◆ protocore_conn_pool_sndbuf()

void protocore_conn_pool_sndbuf ( uint8_t *  work)

◆ protocore_conn_pool_flush()

void protocore_conn_pool_flush ( uint8_t *  work)

◆ protocore_conn_pool_ack_consumed()

void protocore_conn_pool_ack_consumed ( uint8_t *  work)

◆ protocore_conn_pool_raw_send()

void protocore_conn_pool_raw_send ( uint8_t *  work)

◆ protocore_conn_pool_close()

void protocore_conn_pool_close ( uint8_t *  work)

◆ protocore_conn_pool_abort_slot()

void protocore_conn_pool_abort_slot ( uint8_t *  work)

◆ protocore_conn_pool_closing_finalize()

void protocore_conn_pool_closing_finalize ( uint8_t *  work)

◆ protocore_conn_pool_closing_check()

void protocore_conn_pool_closing_check ( uint8_t *  work)

◆ protocore_conn_pool_begin_close()

void protocore_conn_pool_begin_close ( uint8_t *  work)

◆ protocore_conn_pool_enqueue()

void protocore_conn_pool_enqueue ( uint8_t *  work)

◆ protocore_conn_pool_init()

void protocore_conn_pool_init ( uint8_t *  work)

◆ protocore_conn_pool_stop()

void protocore_conn_pool_stop ( uint8_t *  work)

◆ protocore_conn_pool_active_count()

void protocore_conn_pool_active_count ( uint8_t *  work)

◆ protocore_conn_pool_remote_ip()

void protocore_conn_pool_remote_ip ( uint8_t *  work)

◆ protocore_conn_pool_remote_addr()

void protocore_conn_pool_remote_addr ( uint8_t *  work)

◆ protocore_conn_pool_touch_active()

void protocore_conn_pool_touch_active ( uint8_t *  work)

◆ protocore_conn_pool_check_timeouts()

void protocore_conn_pool_check_timeouts ( uint8_t *  work)

◆ protocore_conn_pool_available()

void protocore_conn_pool_available ( uint8_t *  work)

◆ protocore_conn_pool_read_byte()

void protocore_conn_pool_read_byte ( uint8_t *  work)

◆ protocore_conn_pool_peek()

void protocore_conn_pool_peek ( uint8_t *  work)

◆ protocore_conn_pool_consume()

void protocore_conn_pool_consume ( uint8_t *  work)

◆ protocore_conn_pool_read()

void protocore_conn_pool_read ( uint8_t *  work)

◆ protocore_conn_pool_active()

void protocore_conn_pool_active ( uint8_t *  work)

◆ protocore_conn_pool_iface()

void protocore_conn_pool_iface ( uint8_t *  work)

◆ protocore_conn_pool_listener_id()

void protocore_conn_pool_listener_id ( uint8_t *  work)

◆ protocore_conn_pool_tls()

void protocore_conn_pool_tls ( uint8_t *  work)

◆ protocore_conn_pool_owner()

void protocore_conn_pool_owner ( uint8_t *  work)

◆ protocore_conn_pool_proto_of()

void protocore_conn_pool_proto_of ( uint8_t *  work)

◆ protocore_conn_pool_pcb_of()

void protocore_conn_pool_pcb_of ( uint8_t *  work)

◆ protocore_conn_pool_span()

uint8_t * protocore_conn_pool_span ( void  )

The PROTOCORE_CONN_POOL_BORROW bytes this module's state lives in.

Stated beside the namespace rather than on it: an entry takes a borrow, and this is where that borrow comes from. Taken once from the end of the pool, which no mark and no release walks, so the state lasts the life of the program.

Returns
the span.

Variable Documentation

◆ ConnPoolV

ConnPoolVars ConnPoolV
extern

The operands and the outcome.