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

Application layer signaling: the bucket the server's state is read from, and the one way a connection the application layer owns is killed. More...

#include "protocore_config.h"

Go to the source code of this file.

Classes

struct  protocore_signal_snapshot
 The server's state, as the loop deposited it. More...
 
struct  SignalPutArgs
 What one deposit carries: a response's status, or the loop's own figures. More...
 
struct  SignalVars
 
struct  SignalingNs
 The entries. More...
 

Functions

void protocore_signal_know (uint8_t *work)
 
void protocore_signal_reset (uint8_t *work)
 
void protocore_signal_put_response (uint8_t *work)
 
void protocore_signal_put_tick (uint8_t *work)
 
void protocore_signal_kill (uint8_t *work)
 
uint8_t * protocore_signaling_span (void)
 The PROTOCORE_SIGNALING_BORROW bytes this module's state lives in.
 

Variables

SignalVars SignalV
 The operands and the outcome.
 

Detailed Description

Application layer signaling: the bucket the server's state is read from, and the one way a connection the application layer owns is killed.

Signaling in the control-plane sense - what the server knows about itself, kept apart from the data it is moving.

Signaling owns no state, and it never gathers any. It originates nothing. The active function in the server loop already knows each fact at the instant it becomes true, so it deposits it here then, and only when there is something to deposit. SignalingNs::know hands the bucket back; it does not compose, poll, or ask an owner for anything.

Both halves of that matter. A bucket that gathered on read would recompute what the loop had already established, and would interleave reads of owners that are moving underneath it. A bucket that owned its fields would be a second tally beside the real one, drifting the first time an owner changed without telling it. Depositing at the point of truth is neither: the fact is written once, by the code that had it.

The problem it solves is that the state had no single place to be read from. protocore_stats(), protocore_metrics(), and protocore_diag() each walk a different set of owners and assemble their own picture, so the same question already has three answers, and a fourth reader would write a fourth.

Kill, for applications that do not talk transport. An application at this layer has no transport dependency and should not acquire one just to hang up: reaching for Tcp.conn->close() would put an L4 include in L7 code and make every such application know about slots and PCBs. This is the seam instead. The decision is the application's and the teardown is the transport's.

It also lets a remote kill its own connection - and only its own, because a remote request arrives on its slot and never supplies a slot number, so it has no way to name another. That is structural rather than a check, which is why there is no permission test here and no way to forge past one.

A module that already speaks transport keeps calling transport directly. This does not replace Tcp.conn->close(); it means an application never has to reach for it.

This is not SSH signaling. RFC 4254 signaling delivers a POSIX signal to a remote process over a channel and is implemented in ssh_flow_control; the two share a word and nothing else.

Single-accessor like the rest of the server: use it from the worker that owns the slot.

Author
Douglas Quigg (dstroy0)
Date
2026

Definition in file signaling.h.

Function Documentation

◆ protocore_signal_know()

void protocore_signal_know ( uint8_t *  work)

◆ protocore_signal_reset()

void protocore_signal_reset ( uint8_t *  work)

◆ protocore_signal_put_response()

void protocore_signal_put_response ( uint8_t *  work)

◆ protocore_signal_put_tick()

void protocore_signal_put_tick ( uint8_t *  work)

◆ protocore_signal_kill()

void protocore_signal_kill ( uint8_t *  work)

◆ protocore_signaling_span()

uint8_t * protocore_signaling_span ( void  )

The PROTOCORE_SIGNALING_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

◆ SignalV

SignalVars SignalV
extern

The operands and the outcome.