wired
libc-free QUIC/HTTP3 SDK in C for x86_64-linux
Loading...
Searching...
No Matches
moqtrun.h
Go to the documentation of this file.
1#ifndef WIRED_MOQTRUN_H
2#define WIRED_MOQTRUN_H
3
11#include "app/moqt/run/moqtss.h"
15
33
37#define WIRED_MOQTRUN_MAX_SESSIONS 32
38
41#define WIRED_MOQTRUN_MAX_SUBS (WIRED_MOQTRUN_MAX_SESSIONS - 1)
42
43/* moqtrel.h's WIRED_MOQTREL_MAX_SUBS mirrors this value as its own
44 * literal (it cannot include this header -- this header includes
45 * moqtrel.h, moqtrel.h:50-53). This header includes moqtrel.h above, so
46 * this is the one place both are visible together; keep it in sync here
47 * if either changes. */
48_Static_assert(
50 "the relay ring's subscriber cursor table must match the hub's cap");
51
59typedef struct {
71 wired_wt_session* s, u64 stream_id, wired_span payload, int fin);
92 int (*stream_fin)(wired_wt_session* s, u64 stream_id);
98 int (*stream_reset)(wired_wt_session* s, u64 stream_id, u32 error_code);
119 int (*stream_hold)(wired_wt_session* s, u64 stream_id, int hold);
134 int (*close_session)(wired_wt_session* s, u32 error_code, wired_span reason);
142 wired_wt_session* s, u64 stream_id, wired_span payload);
148 int (*stream_priority)(wired_wt_session* s, u64 stream_id, u8 urgency);
155 int (*stream_stop)(wired_wt_session* s, u64 stream_id, u32 error_code);
171 wired_wt_session* s, u64 stream_id, const wired_wt_sched* k);
173
184#define WIRED_MOQTRUN_URGENCY(sub_prio, pub_prio) \
185 ((u8)(4 + ((sub_prio) >> 7) * 2 + ((pub_prio) >> 7)))
186
188#define WIRED_MOQTRUN_CLOSE_PROTOCOL_VIOLATION 0x3
189
191#define WIRED_MOQTRUN_CLOSE_INTERNAL_ERROR 0x1
192
194#define WIRED_MOQTRUN_CLOSE_NO_ERROR 0x0
195
197#define WIRED_MOQTRUN_CLOSE_INVALID_REQUEST_ID 0x4
198
200#define WIRED_MOQTRUN_CLOSE_GOAWAY_TIMEOUT 0x10
201
204#define WIRED_MOQTRUN_CLOSE_INVALID_PATH 0x8
205
208#define WIRED_MOQTRUN_CLOSE_INVALID_AUTHORITY 0x19
209
212#define WIRED_MOQTRUN_CLOSE_MALFORMED_PATH 0x9
213
217#define WIRED_MOQTRUN_CLOSE_MALFORMED_AUTHORITY 0x1A
218
222#define WIRED_MOQTRUN_CLOSE_TOO_MANY_REQUEST_UPDATES 0x1B
223
226#define WIRED_MOQTRUN_CLOSE_AUTH_TOKEN_CACHE_OVERFLOW 0x13
227
230#define WIRED_MOQTRUN_CLOSE_UNKNOWN_AUTH_TOKEN_ALIAS 0x17
231
238#define WIRED_MOQTRUN_MAX_FILTER_RANGES 4
239
244#define WIRED_MOQTRUN_MAX_REQ_UPDATES 4
245
249#define WIRED_MOQTRUN_IMPL_MAX 64
250
259#define WIRED_MOQTRUN_HOLD_BUF 2048
260
267#define WIRED_MOQTRUN_EARLY_BUF 2048
268
271#define WIRED_MOQTRUN_GOAWAY_URI_MAX 8192
272
275#define WIRED_MOQTRUN_GOAWAY_MSG_MAX ((usz)WIRED_MOQTRUN_GOAWAY_URI_MAX + 32)
276
280#define WIRED_MOQTRUN_DRAIN_TIMEOUT_MS 5000
281
298
411
417#define WIRED_MOQTRUN_TRACK_PROPS_MAX 32
418
422#define WIRED_MOQTRUN_RELAY_HDR_MAX 40
423
434#define WIRED_MOQTRUN_RELAY_FRAG_MAX 16384
435
443#define WIRED_MOQTRUN_FRAG_POOL 8
444
532
542#define WIRED_MOQTRUN_RESET_AFTER_BUSY 8
543
549#define WIRED_MOQTRUN_MAX_RELAYS 4
550
554#define WIRED_MOQTRUN_MAX_NAME 64
555
560#define WIRED_MOQTRUN_MAX_NS 128
561
566#define WIRED_MOQTRUN_MAX_TRACKS_PER_PEER 4
567
573#define WIRED_MOQTRUN_SUB_NAMES ((usz)WIRED_MOQTRUN_MAX_TRACKS_PER_PEER * 4)
574
579#define WIRED_MOQTRUN_CTL_REPLY_MAX 64
580
584#define WIRED_MOQTRUN_CTL_MSG_MAX 1024
585
587#define WIRED_MOQTRUN_CTL_HDR_MAX 11
588
600
610#define WIRED_MOQTRUN_MAX_REQS 96
611
615#define WIRED_MOQTRUN_MAX_REQS_PER_SESSION (WIRED_MOQTRUN_MAX_REQS / 4)
616
622#define WIRED_MOQTRUN_CTL_REPLIES_MAX \
623 ((usz)WIRED_MOQTRUN_CTL_REPLY_MAX * (usz)WIRED_MOQTRUN_MAX_SUBS * \
624 (usz)WIRED_MOQTRUN_MAX_TRACKS_PER_PEER)
625
630#define WIRED_MOQTRUN_CTL_SEND_BUF \
631 (WIRED_MOQTRUN_CTL_REPLIES_MAX > WIRED_MOQTRUN_GOAWAY_MSG_MAX \
632 ? WIRED_MOQTRUN_CTL_REPLIES_MAX \
633 : WIRED_MOQTRUN_GOAWAY_MSG_MAX)
634
637#define WIRED_MOQTRUN_REQ_SEND_BUF ((usz)WIRED_MOQTRUN_CTL_REPLY_MAX * 4)
638
750
759#define WIRED_MOQTRUN_MAX_RDV 16
760
763#define WIRED_MOQTRUN_RDV_PER_SESSION (WIRED_MOQTRUN_MAX_RDV / 4)
764
770#define WIRED_MOQTRUN_RDV_MAX_MS 1500
771
774#define WIRED_MOQTRUN_RDV_RETRY 1001
775
824
833#define WIRED_MOQTRUN_MAX_UP WIRED_MOQTRUN_MAX_RDV
834
864
869#define WIRED_MOQTRUN_MAX_FETCHES 8
870
877#define WIRED_MOQTRUN_UPFETCH_BUDGET_MS 2000
878
880#define WIRED_MOQTRUN_UPF_NONE 0
882#define WIRED_MOQTRUN_UPF_SENT 1
884#define WIRED_MOQTRUN_UPF_OK 2
885
893#define WIRED_MOQTRUN_GOAWAY_GRACE_MS 1000
894
901#define WIRED_MOQTRUN_PUBDONE_WAIT_MS 2000
902
1003
1019
1099
1105typedef struct {
1106 /* --- 8-byte aligned: session, control streams, reassembly --- */
1147 /* --- 8-byte aligned: Request IDs and session clocks --- */
1170 /* --- 8-byte aligned: tracks, remembered subscriptions, replies --- */
1184 /* SSTS (moqtssts_run.c) */
1188 /* --- 4-byte aligned --- */
1194 int ver;
1201 /* --- 1-byte flags and counters --- */
1230 /* --- byte arrays --- */
1275
1294
1304 void* ctx, const moqctl_ftn* name, const moqctl_token* token);
1305
1313 void* ctx, u64 msg_type, const moqctl_ns* ns, const moqctl_token* token);
1314
1317typedef struct {
1516 /* SSTS (moqtssts_run.c) */
1533 /* SWITCH_FROM (moqtswitch.c) */
1542
1545
1557
1563 void* app_ctx, wired_wt_session* s, wired_span path, wired_span protocol);
1564
1579 void* app_ctx, wired_wt_session* s, wired_span alpn);
1580
1616 void* app_ctx,
1618 u64 stream_id,
1619 wired_span data,
1620 int fin);
1621
1637 void* app_ctx, wired_wt_session* s, wired_span data);
1638
1647
1658 void* app_ctx,
1660 u64 stream_id,
1661 int mapped,
1662 u32 app_error_code);
1663
1687int wired_moqt_goaway(wired_moqt_hub* hub, wired_span new_uri, u64 timeout_ms);
1688
1694
1720 wired_moqt_hub* hub,
1721 wired_span name,
1722 u64 track_alias,
1723 wired_span blob,
1724 wired_mspan wire);
1725
1753 wired_moqt_hub* hub,
1754 wired_span name,
1755 u64 track_alias,
1756 const wired_span* frags,
1757 usz n_frags,
1758 u64 group_ms,
1759 u64 now_ms);
1760
1765
1766#endif
Object cache for FETCH (draft-ietf-moq-transport-19 10.12.3) in a caller-provided arena.
draft-ietf-moq-transport-19 SS10 Control Messages: common envelope (Type + 16-bit Length + Body),...
draft-ietf-moq-transport-18/19/22 data-plane (draft-19 sections; the wire is byte-identical in all th...
draft-ietf-moq-transport-18/19/22 FETCH: the FETCH (19 10.12, 22 9.11) and FETCH_OK (19 10....
MoQT-over-raw-QUIC Setup Option policy.
draft-ietf-moq-transport-19 3.3 / 5.1: session establishment/control- stream discipline,...
Reliable-relay byte ring for the MOQT hub: one publisher's relayed track bytes buffered once,...
#define WIRED_MOQTREL_POOL
Fixed capacity: reliable-relay rings the hub owns (one per concurrently relayed reliable track; furth...
Definition moqtrel.h:26
#define WIRED_MOQTREL_MAX_SUBS
Fixed capacity: subscriber cursors per ring.
Definition moqtrel.h:58
int wired_moqt_goaway(wired_moqt_hub *hub, wired_span new_uri, u64 timeout_ms)
draft-ietf-moq-transport-19 3.6 / 10.4 graceful drain: sends GOAWAY (new_uri, timeout_ms) once on the...
void wired_moqt_on_session_raw(void *app_ctx, wired_wt_session *s, wired_span alpn)
wired_rawq_on_session-shaped (srvrun's opt.raw_on_session): registers a raw-QUIC connection's implici...
#define WIRED_MOQTRUN_MAX_RDV
Fixed capacity: SUBSCRIBEs held for a publisher (RENDEZVOUS_TIMEOUT, draft-18/19 10....
Definition moqtrun.h:759
#define WIRED_MOQTRUN_HOLD_BUF
Per-peer buffer for request/Object stream deliveries arriving before SETUP completes both directions ...
Definition moqtrun.h:259
#define WIRED_MOQTRUN_REQ_SEND_BUF
Replies one request-stream delivery can queue: the request's own answer plus a few REQUEST_UPDATE ans...
Definition moqtrun.h:637
#define WIRED_MOQTRUN_MAX_SUBS
Fixed capacity: subscribers recorded against the hub's single published track per session slot (every...
Definition moqtrun.h:41
#define WIRED_MOQTRUN_MAX_NS
Fixed capacity for a track's encoded Track Namespace (count + each field's length + bytes,...
Definition moqtrun.h:560
void wired_moqt_on_stream_reset(void *app_ctx, wired_wt_session *s, u64 stream_id, int mapped, u32 app_error_code)
wired_wt_on_stream_reset-shaped: a RESET_STREAM / STOP_SENDING on one of s's request streams cancels ...
#define WIRED_MOQTRUN_MAX_SESSIONS
Fixed capacity: concurrent sessions the hub tracks at once.
Definition moqtrun.h:37
#define WIRED_MOQTRUN_MAX_REQS
Fixed capacity: peer-opened request streams (draft-ietf-moq-transport-19 3.3) tracked at once,...
Definition moqtrun.h:610
int wired_moqt_publish_live(wired_moqt_hub *hub, wired_span name, u64 track_alias, const wired_span *frags, usz n_frags, u64 group_ms, u64 now_ms)
Publish the hub's own clock-paced live track: Group g carries fragment g mod n_frags as its only Obje...
void wired_moqt_on_session_close(void *app_ctx, wired_wt_session *s)
wired_wt_on_session_close-shaped: frees the peer slot registered for s and deactivates every subscrip...
#define WIRED_MOQTRUN_CTL_SEND_BUF
Largest total this hub ever needs to buffer for one peer within one wired_moqt_on_stream_data dispatc...
Definition moqtrun.h:630
#define WIRED_MOQTRUN_CTL_MSG_MAX
Largest received control-message Length (body bytes) this hub handles.
Definition moqtrun.h:584
#define WIRED_MOQTRUN_MAX_RELAYS
Fixed capacity: publisher streams relayed concurrently per track.
Definition moqtrun.h:549
void wired_moqt_on_session_draining(void *app_ctx, wired_wt_session *s)
wired_wt_on_session_draining-shaped: the peer of s sent WT_DRAIN_SESSION, so s alone is drained as by...
int(* wired_moqt_authorize_ns_fn)(void *ctx, u64 msg_type, const moqctl_ns *ns, const moqctl_token *token)
draft-ietf-moq-transport-19 10.15 / 10.18 namespace authorization hook: the hub calls it once per PUB...
Definition moqtrun.h:1312
#define WIRED_MOQTRUN_TRACK_PROPS_MAX
Largest Track Properties block a track keeps to forward in SUBSCRIBE_OK: what still fits a WIRED_MOQT...
Definition moqtrun.h:417
#define WIRED_MOQTRUN_MAX_NAME
Fixed capacity for the copied participant id (Track Name) recorded on PUBLISH, used with the namespac...
Definition moqtrun.h:554
void wired_moqt_init(wired_moqt_hub *hub, wired_moqt_io io)
Zero-initialize hub and record the io table it will send through.
#define WIRED_MOQTRUN_MAX_UP
Fixed capacity: upstream SUBSCRIBEs the hub holds toward namespace publishers (draft-18/19 9....
Definition moqtrun.h:833
#define WIRED_MOQTRUN_RELAY_HDR_MAX
Fixed capacity for a saved SUBGROUP_HEADER (draft SS11.4.2: Type + Track Alias + Group ID + optional ...
Definition moqtrun.h:422
void wired_moqt_on_stream_data(void *app_ctx, wired_wt_session *s, u64 stream_id, wired_span data, int fin)
wired_wt_on_stream_data-shaped: dispatches one chunk of a control, request or data stream to the hub'...
usz wired_moqt_publish_blob(wired_moqt_hub *hub, wired_span name, u64 track_alias, wired_span blob, wired_mspan wire)
Publish a hub-owned static track: frames blob into wire (moqdata_blob_build: one SUBGROUP_HEADER carr...
#define WIRED_MOQTRUN_EARLY_BUF
Per-peer buffer for one SUBGROUP stream that reaches the hub before the publisher's SUBSCRIBE_OK to t...
Definition moqtrun.h:267
#define WIRED_MOQTRUN_MAX_FILTER_RANGES
MAX_FILTER_RANGES the hub advertises in its SETUP (draft-19 10.4): Ranges accepted concurrently acros...
Definition moqtrun.h:238
void wired_moqt_tick(wired_moqt_hub *hub, u64 now_ms)
Clock tick (wire to wired_srvrun_opt.on_step): the current Group is (now_ms - t0_ms) / group_ms; ever...
#define WIRED_MOQTRUN_MAX_FETCHES
Fixed capacity: FETCH responses (draft-ietf-moq-transport-19 10.12.3) being served at once,...
Definition moqtrun.h:869
#define WIRED_MOQTRUN_FRAG_POOL
Hub-wide buffers for held-back Object fragments, shared by every relay (a relay holds one only while ...
Definition moqtrun.h:443
#define WIRED_MOQTRUN_MAX_TRACKS_PER_PEER
Fixed capacity: tracks one peer can PUBLISH at once (chat + audio + screen + the screen's low-rate SS...
Definition moqtrun.h:566
void wired_moqt_on_session(void *app_ctx, wired_wt_session *s, wired_span path, wired_span protocol)
wired_wt_on_session-shaped: registers a new peer slot for s and opens its control stream carrying SET...
int(* wired_moqt_authorize_fn)(void *ctx, const moqctl_ftn *name, const moqctl_token *token)
draft-ietf-moq-transport-19 SS13.3 authorization hook: as authorize_subscribe the hub calls it once p...
Definition moqtrun.h:1303
#define WIRED_MOQTRUN_CTL_HDR_MAX
Type (vi64, up to 9 bytes) + 16-bit Length.
Definition moqtrun.h:587
#define WIRED_MOQTRUN_RELAY_FRAG_MAX
Cap on a held tail: the bytes of an Object split across deliveries (past the last complete Object bou...
Definition moqtrun.h:434
#define WIRED_MOQTRUN_IMPL_MAX
Longest MOQT_IMPLEMENTATION value (10.4) copied from the client's SETUP; longer values are kept trunc...
Definition moqtrun.h:249
#define WIRED_MOQTRUN_SUB_NAMES
Fixed capacity: Track Names one peer remembers having SUBSCRIBEd to (wired_moqtrun_peer....
Definition moqtrun.h:573
void wired_moqt_on_datagram(void *app_ctx, wired_wt_session *s, wired_span data)
wired_wt_on_datagram-shaped: relays one received OBJECT_DATAGRAM (draft-ietf-moq-transport-19 11....
int wired_moqt_cache_attach(wired_moqt_hub *hub, u8 *arena, usz size)
Gives the hub an Object cache for FETCH (draft-ietf-moq-transport-19 10.12.3): every whole Object a p...
Per-session SSTS (sender-side track switching, moqtail-compatible) state the hub keeps for one subscr...
Value-type views that fold the SDK's recurring argument shapes into single parameters,...
#define WIRED_SRVLOOP_WT_BUF_CAP
Byte capacity of one WT bidi/uni reassembly slot's receive window (buf below).
Definition srvloop.h:258
The complete server event loop: the sanctioned socket-owning layer over the socket-free srvboot/srvlo...
A FETCH object cache over one caller-owned arena.
Definition moqcache.h:44
Full Track Name: Track Namespace + Track Name (may be empty).
Definition moqctl.h:571
draft-ietf-moq-transport-19 SS1.4.2 Location: two consecutive varints.
Definition moqctl.h:392
draft-ietf-moq-transport-19 SS1.5 Track Namespace: up to MOQCTL_MAX_NS_FIELDS fields,...
Definition moqctl.h:563
Version-neutral LOCATION_FILTER range.
Definition moqctl.h:472
draft-ietf-moq-transport-19 SS10.2.2 Token structure: Alias Type selects which of the optional fields...
Definition moqctl.h:642
Per-subgroup Object decode state, threaded across successive moqdata_obj_take calls on the same SUBGR...
Definition moqdata.h:111
The "prior Object" state threaded through one fetch stream.
Definition moqfetch.h:258
The application's optional say over well-formed PATH/AUTHORITY values on raw QUIC.
Definition moqraw.h:34
Session state including the GOAWAY-lifecycle flags (5.1: GOAWAY may be sent/received at most once per...
Definition moqsess.h:58
One reliable-relay ring: the publisher's relayed bytes plus every subscriber's cursor and the publish...
Definition moqtrel.h:92
One subscriber session's SSTS state (wired_moqtrun_peer.ssts).
Definition moqtss.h:82
The hub's whole state: fixed peer table plus the io table it sends through.
Definition moqtrun.h:1317
wired_moqtrun_fetch fetches[WIRED_MOQTRUN_MAX_FETCHES]
FETCH responses in progress, all sessions.
Definition moqtrun.h:1471
wired_moqt_authorize_fn authorize_subscribe
Subscriber authorizer (SS13.3); 0 (the wired_moqt_init default) means an open hub that grants every S...
Definition moqtrun.h:1327
u64 stat_rel_early_return
Rings returned to the pool before the publisher's FIN because no subscriber cursor was left (none att...
Definition moqtrun.h:1457
u8 frag_pool[WIRED_MOQTRUN_FRAG_POOL][WIRED_MOQTRUN_RELAY_FRAG_MAX]
Held-fragment buffers shared by every relay (relay frag_idx).
Definition moqtrun.h:1461
wired_moqt_authorize_fn authorize_publish
Publisher authorizer (draft-22 16.3 "Preventing Impersonation": a relay MUST verify the publisher may...
Definition moqtrun.h:1335
const u64 * ssts_algs
SSTS algorithm ids this hub runs (moqtail –ssts-algorithms), in the order its draft-22 SETUP advertis...
Definition moqtrun.h:1526
wired_moqtrun_live live
The hub's live track (wired_moqt_publish_live); track.in_use once published.
Definition moqtrun.h:1347
moqraw_policy raw_policy
Raw-QUIC PATH/AUTHORITY policy (draft-ietf-moq-transport-22 9.1.1-2): zero (the wired_moqt_init defau...
Definition moqtrun.h:1515
u64 stat_relay_full
Fresh publisher streams NOT relayed because every relay entry of their track was busy (moqtrun_relay_...
Definition moqtrun.h:1397
wired_moqt_authorize_ns_fn authorize_namespace
Namespace authorizer (draft-ietf-moq-transport-19 10.15, 10.18); 0 (the wired_moqt_init default) gran...
Definition moqtrun.h:1503
wired_moqtrun_track blob_track
The hub's own static track (wired_moqt_publish_blob): in_use once a blob is published,...
Definition moqtrun.h:1341
wired_moqtrun_up ups[WIRED_MOQTRUN_MAX_UP]
SUBSCRIBEs the hub sent upstream to namespace publishers (draft-19 9.5), all sessions.
Definition moqtrun.h:1499
wired_moqtrun_req reqs[WIRED_MOQTRUN_MAX_REQS]
Peer-opened request streams in flight, all sessions.
Definition moqtrun.h:1459
u64 stat_rel_hold
Times the reliable relay froze a publisher's receive credit because its ring filled past the hold wat...
Definition moqtrun.h:1453
moqcache cache
Object cache over the app's arena (wired_moqt_cache_attach); empty, caching nothing,...
Definition moqtrun.h:1467
wired_span blob_wire
The published blob's framed bytes – a view into the caller's wire buffer, handed verbatim to io....
Definition moqtrun.h:1344
u64 stat_frag_drop
Cumulative undelivered tails dropped because they exceeded WIRED_MOQTRUN_RELAY_FRAG_MAX (each degrade...
Definition moqtrun.h:1373
u64 join_seq_next
Next wired_moqtrun_peer.join_seq to hand out.
Definition moqtrun.h:1323
u64 stat_open_drop
Failed relay-stream OPENS (io.open_uni_stream returned failure – send-slot exhaustion or the peer's s...
Definition moqtrun.h:1386
u8 relay_scratch[WIRED_MOQTRUN_RELAY_FRAG_MAX+WIRED_SRVLOOP_WT_BUF_CAP]
Scratch for moqtrun_relay_normalize: one relay's held fragment prepended to one delivery (a delivery ...
Definition moqtrun.h:1364
void * authorize_ctx
Opaque first argument handed to authorize_subscribe.
Definition moqtrun.h:1329
u64 stat_rel_stall
Reliable-relay subscribers given up on after WIRED_MOQTREL_STALL_MS without an accepted send (their s...
Definition moqtrun.h:1420
u8 switch_track
1 turns on SWITCH_FROM (0x24) on draft-22 sessions; 0 (the wired_moqt_init default) keeps the paramet...
Definition moqtrun.h:1537
wired_moqtrun_upf_leg upf_legs[WIRED_MOQTRUN_MAX_FETCHES]
The upstream FETCH state of fetches[i] beyond the slot's own fields (index i too).
Definition moqtrun.h:1480
u32 sw_live
Switches whose old subscription may still be waiting to end (a hint moqtsw_step recounts; 0 skips its...
Definition moqtrun.h:1540
u64 stat_rel_refused
Reliable-relay rounds the subscriber's transport refused (send slot busy or session credit exhausted)...
Definition moqtrun.h:1438
u64 stat_live_drop
Live Groups abandoned because the clock left the Group before a refused send could be retried (never ...
Definition moqtrun.h:1355
u64 ssts_cap_kbps
Default algorithm (0) budget cap in kbps; 0 = uncapped.
Definition moqtrun.h:1532
u64 stat_rel_in_bytes
Bytes the reliable relay appended from publishers (header and whole Objects; the ring's own overflow ...
Definition moqtrun.h:1444
void * authorize_ns_ctx
Opaque first argument handed to authorize_namespace.
Definition moqtrun.h:1505
usz upf_len
Bytes of upf_buf held.
Definition moqtrun.h:1491
u8 alias_scratch[WIRED_MOQTRUN_RELAY_FRAG_MAX+WIRED_SRVLOOP_WT_BUF_CAP+8]
Scratch for moqtrun_alias_splice: one relayed stream head or datagram (at most a relay_scratch round)...
Definition moqtrun.h:1369
u8 upf_buf[WIRED_MOQTRUN_RELAY_FRAG_MAX+WIRED_SRVLOOP_WT_BUF_CAP]
What one upstream fetch leg keeps between deliveries, followed by the next delivery while it decodes:...
Definition moqtrun.h:1489
wired_moqt_io io
Transport callbacks every send goes through (wired_moqt_init).
Definition moqtrun.h:1321
u64 cache_tag_next
Last wired_moqtrun_track.cache_tag handed out.
Definition moqtrun.h:1469
u64 stat_rel_sent
Reliable-relay rounds the subscriber's transport accepted (the attachment bytes that actually left th...
Definition moqtrun.h:1435
u64 stat_dg_bad
Received datagrams dropped whole: moqdg_take refused them (VIOLATION/INSUFFICIENT) or their Track Ali...
Definition moqtrun.h:1408
u64 stat_rel_fin_in
Publisher FINs the reliable relay recorded (the attachment stream's last byte reached the hub).
Definition moqtrun.h:1447
void * authorize_pub_ctx
Opaque first argument handed to authorize_publish.
Definition moqtrun.h:1337
u64 stat_rel_fin_out
Subscriber streams the reliable relay closed with a FIN (the attachment's last byte was accepted by t...
Definition moqtrun.h:1450
wired_moqtrun_rdv rdv[WIRED_MOQTRUN_MAX_RDV]
SUBSCRIBEs held for a publisher (RENDEZVOUS_TIMEOUT, draft-19 10.2.6), all sessions.
Definition moqtrun.h:1496
u64 stat_rel_overflow
Reliable-relay ring appends refused for lack of space.
Definition moqtrun.h:1424
usz ssts_alg_n
Entries at ssts_algs; 0 turns SSTS off.
Definition moqtrun.h:1528
u64 stat_rel_rings
Reliable-relay rings bound to a fresh publisher stream (one per attachment stream a reliable track's ...
Definition moqtrun.h:1441
wired_moqtrun_relay * frag_owner[WIRED_MOQTRUN_FRAG_POOL]
The relay that last took each buffer; the buffer is free unless that relay is still in use and still ...
Definition moqtrun.h:1464
u64 stat_relay_drop
Relay rounds dropped (stat_relay_sent's doc).
Definition moqtrun.h:1380
u64 stat_relay_reset
Relay streams abandoned (io.stream_reset accepted) after WIRED_MOQTRUN_RESET_AFTER_BUSY consecutive b...
Definition moqtrun.h:1391
wired_moqtrun_fetch fetch_waits[WIRED_MOQTRUN_MAX_FETCHES]
Fill fetch streams accepted while every serving slot above was busy (draft-22 SS9....
Definition moqtrun.h:1477
u64 stat_rel_wait
Reliable-relay rounds deferred because the subscriber session's remaining send credit (io....
Definition moqtrun.h:1431
u64 reliable_alias_limit
A track whose own_alias is below this relays reliably (refused sends retried from a moqtrel ring,...
Definition moqtrun.h:1412
u64 stat_relay_sent
Cumulative relay-round outcomes at the true loss site (moqtrun_relay_forward_one): rounds appended to...
Definition moqtrun.h:1378
moqtrel_buf rel_pool[WIRED_MOQTREL_POOL]
Ring pool for the reliable relays: one ring per concurrently relayed reliable publisher stream,...
Definition moqtrun.h:1416
u64 stat_dg_drop
OBJECT_DATAGRAM copies refused by io.send_datagram – that one subscriber's copy is lost for good (a d...
Definition moqtrun.h:1404
u64 stat_timeout_reset
Subscriber streams reset with DELIVERY_TIMEOUT because an Object outlived the subscription's OBJECT_D...
Definition moqtrun.h:1509
u64 stat_dg_sent
OBJECT_DATAGRAM copies accepted by io.send_datagram (one count per subscriber, wired_moqt_on_datagram...
Definition moqtrun.h:1400
wired_moqtrun_peer peers[WIRED_MOQTRUN_MAX_SESSIONS]
One slot per connected session (wired_moqtrun_peer.in_use).
Definition moqtrun.h:1319
u64 stat_live_sent
Live Groups accepted by io.send_uni2.
Definition moqtrun.h:1349
wired_moqtrun_fetch * upf_owner
The fetch slot whose tail upf_buf holds, 0 when none.
Definition moqtrun.h:1493
The send/reset operations this layer needs, as a function-pointer table so it never links wired_serve...
Definition moqtrun.h:59
int(* stream_stop)(wired_wt_session *s, u64 stream_id, u32 error_code)
wired_server_wt_stream_stop-shaped: asks the peer to stop sending on a PEER-initiated stream (one STO...
Definition moqtrun.h:155
usz(* send_budget)(wired_wt_session *s)
Remaining session-level send credit for s in bytes (the peer's WT_MAX_DATA minus bytes already staged...
Definition moqtrun.h:126
i64(* open_bidi_stream)(wired_wt_session *s, wired_span payload)
wired_server_wt_open_bidi_stream-shaped: opens a stream without FIN, returns the allocated id or nega...
Definition moqtrun.h:64
i64(* send_uni)(wired_wt_session *s, wired_span payload)
wired_server_wt_open_uni-shaped: opens a fresh uni stream, sends the whole payload,...
Definition moqtrun.h:77
u64(* est_kbps)(wired_wt_session *s)
wired_server_wt_est_kbps-shaped: the session's delivery-rate estimate in kbps, 0 when unknown – the S...
Definition moqtrun.h:161
int(* stream_fin)(wired_wt_session *s, u64 stream_id)
wired_server_wt_stream_fin-shaped: ends a stream opened via open_uni_stream/stream_send(fin=0) with n...
Definition moqtrun.h:92
i64(* open_uni_stream)(wired_wt_session *s, wired_span payload)
wired_server_wt_open_uni_stream-shaped: opens a fresh uni stream WITHOUT FIN, sends payload as its fi...
Definition moqtrun.h:83
int(* stream_reset)(wired_wt_session *s, u64 stream_id, u32 error_code)
wired_server_wt_stream_reset-shaped: abandons a stream opened via open_uni_stream (RESET_STREAM to th...
Definition moqtrun.h:98
int(* stream_hold)(wired_wt_session *s, u64 stream_id, int hold)
wired_server_wt_stream_hold-shaped: hold=1 stops raising the publisher's receive credit on stream_id,...
Definition moqtrun.h:119
i64(* send_uni2)(wired_wt_session *s, wired_span head, wired_span body)
wired_server_wt_open_uni-shaped for a two-part payload: head (a short framing prefix) immediately fol...
Definition moqtrun.h:105
int(* stream_priority)(wired_wt_session *s, u64 stream_id, u8 urgency)
wired_server_wt_stream_priority-shaped: sets the RFC 9218 urgency (0..7, lower first) of a subscriber...
Definition moqtrun.h:148
int(* send_datagram)(wired_wt_session *s, wired_span payload)
wired_server_wt_send_datagram_to-shaped: queues one QUIC DATAGRAM to s's peer (the adapter owns any s...
Definition moqtrun.h:113
int(* stream_sched)(wired_wt_session *s, u64 stream_id, const wired_wt_sched *k)
wired_server_wt_stream_schedule-shaped: sets the full send class of an Object stream the hub just ope...
Definition moqtrun.h:170
int(* stream_reply_open)(wired_wt_session *s, u64 stream_id, wired_span payload)
wired_server_wt_stream_reply_open-shaped: the first reply round on a peer-opened request stream (draf...
Definition moqtrun.h:141
int(* close_session)(wired_wt_session *s, u32 error_code, wired_span reason)
wired_server_wt_close_session-shaped: closes s (WT_CLOSE_SESSION on WebTransport, CONNECTION_CLOSE on...
Definition moqtrun.h:134
int(* stream_send)(wired_wt_session *s, u64 stream_id, wired_span payload, int fin)
wired_server_wt_stream_send-shaped: appends payload, fin=1 closes.
Definition moqtrun.h:70
Reassembly of control messages split across stream deliveries: holds the not-yet-complete tail of one...
Definition moqtrun.h:592
usz skip
bytes still to discard
Definition moqtrun.h:598
u8 buf[WIRED_MOQTRUN_CTL_MSG_MAX+WIRED_MOQTRUN_CTL_HDR_MAX]
The held tail: at most one whole message (header plus the largest accepted body).
Definition moqtrun.h:595
usz at
next unread byte
Definition moqtrun.h:597
usz n
bytes held
Definition moqtrun.h:596
One FETCH response being served from the hub cache: Objects of the track incarnation cache_tag in [cu...
Definition moqtrun.h:910
u64 request_id
The FETCH's Request ID (a fill: its subscription's).
Definition moqtrun.h:914
u64 up_pl_at
Payload bytes of that Object passed through so far.
Definition moqtrun.h:957
moqfetch_seq seq
Fetch-Object encoding state carried between items (11.4.4).
Definition moqtrun.h:924
int has_up_last
1 once an upstream item was relayed.
Definition moqtrun.h:991
int is_fill
1 when this fetch is a fill of a subscription (draft-22 SS9.20.15): it was opened by the hub,...
Definition moqtrun.h:973
int no_track
1 for a FETCH of a track the hub does not hold: its FETCH_OK waits for the upstream one.
Definition moqtrun.h:999
wired_wt_session * up_wt
The upstream session the FETCH went to.
Definition moqtrun.h:936
u64 cache_tag
The track incarnation served (wired_moqtrun_track.cache_tag).
Definition moqtrun.h:916
u64 up_budget_ms
The leg's budget: min(FILL_TIMEOUT, WIRED_MOQTRUN_UPFETCH_BUDGET_MS).
Definition moqtrun.h:964
int answered
no_track: 1 once the downstream FETCH was answered.
Definition moqtrun.h:1001
u64 up_req_sid
The hub-opened request stream carrying the upstream FETCH.
Definition moqtrun.h:938
int up_state
WIRED_MOQTRUN_UPF_*: the upstream FETCH filling the front of the range.
Definition moqtrun.h:984
moqctl_loc up_span_end
See up_lo.
Definition moqtrun.h:950
u64 owner_rid
Fill only: the owning subscription's Request ID – with wt it is the owner key.
Definition moqtrun.h:929
int up_tmo
1 when the cache side reports what it lacks as timed out: the budget ran out, or FILL_TIMEOUT was 0.
Definition moqtrun.h:996
moqctl_loc up_lo
Upstream Locations must lie in [up_lo, up_span_end): the range start and, ascending,...
Definition moqtrun.h:948
u64 req_sid
no_track: the downstream request stream the answer goes on.
Definition moqtrun.h:966
u64 up_pl_left
Payload bytes of the Object at up_last still to pass through as they arrive (its head and the bytes b...
Definition moqtrun.h:955
int in_use
1 while the slot serves (or, in fetch_waits, holds) a fetch.
Definition moqtrun.h:968
int opened
1 once the stream is open (stream_id valid).
Definition moqtrun.h:970
u64 up_rid
The upstream FETCH's Request ID (its FETCH_HEADER names it).
Definition moqtrun.h:940
int failed
Fill only: 1 once the upstream publisher left.
Definition moqtrun.h:977
u64 up_deadline_ms
Clock past which the upstream FETCH is cancelled.
Definition moqtrun.h:962
moqctl_loc end
First Location past the range.
Definition moqtrun.h:920
wired_wt_session * wt
The requesting session (owned by the transport).
Definition moqtrun.h:912
int up_eot
The upstream FETCH_OK End Of Track.
Definition moqtrun.h:993
u64 up_data_sid
The upstream fetch data stream.
Definition moqtrun.h:942
int descending
1 when Group Order is Descending (11.4.4.1): [cursor, end) is then one group's window,...
Definition moqtrun.h:980
int up_data_open
1 once the upstream data stream up_data_sid is bound to this slot; it stays bound (later bytes are di...
Definition moqtrun.h:987
u64 stream_id
The hub-opened uni stream the response goes out on.
Definition moqtrun.h:922
int up_data_end
1 once the upstream data stream ended (FIN or reset).
Definition moqtrun.h:989
moqfetch_seq up_seq
Fetch-Object decoding state of the upstream data stream.
Definition moqtrun.h:944
moqctl_loc up_last
The last relayed item's Location; valid iff has_up_last.
Definition moqtrun.h:952
moqctl_loc up_end
The upstream FETCH_OK End Location, inclusive; valid iff up_state is WIRED_MOQTRUN_UPF_OK.
Definition moqtrun.h:960
moqctl_loc lo
Descending only: the first Location of the whole range.
Definition moqtrun.h:931
moqctl_loc cursor
Next Location to serve.
Definition moqtrun.h:918
u64 last_ok_ms
Clock (wired_moqt_tick) of the last accepted round: a fetch refused for longer than WIRED_MOQTREL_STA...
Definition moqtrun.h:934
The hub's own clock-paced live track (wired_moqt_publish_live): Group g carries fragment g mod n_frag...
Definition moqtrun.h:1282
u64 group_ms
Group duration.
Definition moqtrun.h:1287
u64 sent_group[WIRED_MOQTRUN_MAX_SUBS]
last Group sent per sub
Definition moqtrun.h:1291
int sent_any[WIRED_MOQTRUN_MAX_SUBS]
0 until the first send
Definition moqtrun.h:1292
u64 t0_ms
clock at publish: Group 0's start
Definition moqtrun.h:1286
wired_moqtrun_track track
name, own_alias, subs[]
Definition moqtrun.h:1283
u64 last_now_ms
Clock of the most recent wired_moqt_tick; a SUBSCRIBE between ticks is served the Group current at th...
Definition moqtrun.h:1290
usz n_frags
entries at frags
Definition moqtrun.h:1285
const wired_span * frags
caller-owned fragment views
Definition moqtrun.h:1284
One connected participant's hub-side state: its WT session, its own control-stream MOQT session machi...
Definition moqtrun.h:1105
u64 goaway_deadline
Clock (wired_moqt_tick) past which a session sent GOAWAY (sess.goaway_sent) is closed with GOAWAY_TIM...
Definition moqtrun.h:1163
u8 peer_has_impl
1 when the client's SETUP carried MOQT_IMPLEMENTATION (peer_impl holds it).
Definition moqtrun.h:1219
u8 sub_names[WIRED_MOQTRUN_SUB_NAMES][WIRED_MOQTRUN_MAX_NAME]
Track Names this peer has successfully SUBSCRIBEd to (ring, newest overwrites oldest past WIRED_MOQTR...
Definition moqtrun.h:1246
u64 rx_sid
Stream id the current control dispatch is reading (transient, the control-stream twin of req).
Definition moqtrun.h:1120
u8 early[WIRED_MOQTRUN_EARLY_BUF]
The SUBGROUP stream kept before its upstream SUBSCRIBE_OK.
Definition moqtrun.h:1251
u64 pre_sid
A fresh stream whose first delivery ended inside its first varint (RFC 9000 2.2): its bytes so far wa...
Definition moqtrun.h:1146
u8 pre[9]
The kept head of stream pre_sid: at most one MOQT varint (9 bytes), pre_n of them valid.
Definition moqtrun.h:1233
int armed_idx
The send_bufs slot (0 or 1) last handed to stream_send – the ARMED one, never written while its round...
Definition moqtrun.h:1197
wired_moqtrun_sub sub_state[WIRED_MOQTRUN_SUB_NAMES]
Subscription state of each sub_names entry (same index), restored when a REPUBLISH re-attaches this p...
Definition moqtrun.h:1180
u8 legacy
1 while the control-stream binding is the pre-d17 single bidi: the WT token was empty (a browser cann...
Definition moqtrun.h:1205
u8 sub_names_at
ring write index
Definition moqtrun.h:1223
usz peer_impl_len
Bytes of peer_impl in use, at most WIRED_MOQTRUN_IMPL_MAX (a longer value is kept truncated).
Definition moqtrun.h:1132
int ver
Negotiated MOQT draft (MOQVER_*), decided from the WT subprotocol token in wired_moqt_on_session and ...
Definition moqtrun.h:1194
u8 sub_ns[WIRED_MOQTRUN_SUB_NAMES][WIRED_MOQTRUN_MAX_NS]
Encoded Track Namespace of each sub_names entry (same index).
Definition moqtrun.h:1253
wired_moqtrun_ctl_asm * rx
Reassembly of the stream being read as control bytes: ctl_asm for the hub's own (legacy bidi) stream,...
Definition moqtrun.h:1124
u8 ctl_opened
1 once the hub's control stream opened (SETUP went out with it).
Definition moqtrun.h:1212
u8 setup_recv
1 once the client's SETUP was accepted (a 2nd SETUP violates).
Definition moqtrun.h:1216
u64 request_id_next
Next Request ID this hub sends on the session: odd, 1-origin, +2 per request (the hub is the server,...
Definition moqtrun.h:1150
wired_moqtrun_ctl_asm ctl_asm
Control-stream bytes carried over to the next delivery.
Definition moqtrun.h:1129
wired_moqtrun_ctl_asm peer_ctl_asm
Client-control-stream bytes carried over to the next delivery (the peer_ctl_stream_id twin of ctl_asm...
Definition moqtrun.h:1127
u8 closing
1 once the hub asked the transport to close the session: nothing more is sent on it.
Definition moqtrun.h:1226
u64 join_seq
Registration order (wired_moqt_init-relative, never reused): a higher value is a newer session.
Definition moqtrun.h:1157
usz sub_name_lens[WIRED_MOQTRUN_SUB_NAMES]
Length of each sub_names entry (same index).
Definition moqtrun.h:1175
u8 send_bufs[2][WIRED_MOQTRUN_CTL_SEND_BUF]
Two send_buf slots, used as an ARMED/PENDING pair rather than a single shared buffer: wired_server_wt...
Definition moqtrun.h:1273
moqsess sess
The session's control-stream MOQT state machine (SETUP exchange, GOAWAY, control-stream end),...
Definition moqtrun.h:1200
usz early_n
Bytes of early in use; 0 when no stream is kept (WIRED_MOQTRUN_ EARLY_BUF's own doc).
Definition moqtrun.h:1137
wired_moqtrun_req * req
The request stream whose message is being handled, 0 for the control stream: replies go to it.
Definition moqtrun.h:1160
u64 control_stream_id
The HUB's own control stream (the one its SETUP went out on), valid only while ctl_opened.
Definition moqtrun.h:1112
usz send_lens[2]
Bytes queued in each send_bufs slot (same index): the armed slot's round in flight,...
Definition moqtrun.h:1183
int early_fin
1 once early_sid's FIN is kept too.
Definition moqtrun.h:1141
usz hold_len
Bytes of hold in use; 0 when no delivery waits for replay.
Definition moqtrun.h:1134
u8 raw
1 for a raw-QUIC session (wired_moqt_on_session_raw), 0 for WebTransport: decides how PATH/AUTHORITY ...
Definition moqtrun.h:1209
usz sub_ns_lens[WIRED_MOQTRUN_SUB_NAMES]
Length of each sub_ns entry (same index).
Definition moqtrun.h:1177
int in_use
1 while this slot holds a registered session; 0 marks it free for the next wired_moqt_on_session.
Definition moqtrun.h:1191
wired_moqtrun_track tracks[WIRED_MOQTRUN_MAX_TRACKS_PER_PEER]
The tracks this peer PUBLISHed; a slot is live while its in_use is set, and other peers' SUBSCRIBEs a...
Definition moqtrun.h:1173
u8 hold[WIRED_MOQTRUN_HOLD_BUF]
Pre-establishment deliveries held for replay (WIRED_MOQTRUN_ HOLD_BUF's own doc).
Definition moqtrun.h:1249
wired_wt_session * wt
The participant's WebTransport session, valid while in_use: the key every hub entry point finds this ...
Definition moqtrun.h:1109
u8 sub_names_n
entries recorded (<= WIRED_MOQTRUN_SUB_NAMES)
Definition moqtrun.h:1222
u8 wt_drained
1 once the peer drains its WebTransport session (WT_DRAIN_SESSION): like its GOAWAY,...
Definition moqtrun.h:1229
u8 peer_impl[WIRED_MOQTRUN_IMPL_MAX]
The client SETUP's MOQT_IMPLEMENTATION (10.4), copied – the decoded view dangles after the dispatch.
Definition moqtrun.h:1236
u64 early_sid
The SUBGROUP stream kept in early, valid while early_n is non-zero.
Definition moqtrun.h:1139
moqtss_sess ssts
This session's negotiated SSTS algorithms, switching sets and group decisions (reset with the slot).
Definition moqtrun.h:1187
u8 peer_ctl_set
1 once peer_ctl_stream_id names the client's control stream.
Definition moqtrun.h:1214
u64 peer_ctl_stream_id
The CLIENT's incoming control stream (draft-19 3.3), valid while peer_ctl_set: the first of a client ...
Definition moqtrun.h:1117
u8 pre_n
Bytes of stream pre_sid kept in pre; 0 = none pending.
Definition moqtrun.h:1221
u64 peer_rid_next
One past the largest Request ID the peer has sent (+2, 0 for none): a draft-18 GOAWAY's Request ID (S...
Definition moqtrun.h:1153
u64 goaway_flushed_at
wired_moqt_tick clock at which PUBLISH_DONE went to every subscription; 0 before that happens.
Definition moqtrun.h:1169
One SUBSCRIBE held for a publisher.
Definition moqtrun.h:780
usz name_len
Bytes of name in use.
Definition moqtrun.h:797
u8 ns[WIRED_MOQTRUN_MAX_NS]
The Full Track Name as the hub keys tracks (WIRED_MOQTRUN_MAX_NS / _MAX_NAME: a longer name is never ...
Definition moqtrun.h:791
u8 name[WIRED_MOQTRUN_MAX_NAME]
The Track Name, copied.
Definition moqtrun.h:795
u8 repath
1 when the slot holds an Established subscription whose upstream ended on the publisher's side and th...
Definition moqtrun.h:814
u64 stream_id
The SUBSCRIBE's request stream.
Definition moqtrun.h:786
u64 tried
repath only: bit i is set for peer slot i, asked for the track in this wait or the one that ended it;...
Definition moqtrun.h:822
usz body_len
Bytes of body in use.
Definition moqtrun.h:804
u64 deadline_ms
wired_moqt_tick clock at which the hold answers TIMEOUT.
Definition moqtrun.h:788
u8 up_only
1 when the SUBSCRIBE carried no RENDEZVOUS_TIMEOUT and is held only for its upstream SUBSCRIBE to a n...
Definition moqtrun.h:809
u64 done_count
repath only: that PUBLISH_DONE's Stream Count.
Definition moqtrun.h:818
int in_use
1 while the slot holds a SUBSCRIBE.
Definition moqtrun.h:782
u8 body[WIRED_MOQTRUN_CTL_MSG_MAX]
The SUBSCRIBE body as received, re-decoded in the session's own draft when the hold resolves (the dec...
Definition moqtrun.h:802
usz ns_len
Bytes of ns in use.
Definition moqtrun.h:793
wired_wt_session * wt
The subscriber's session (owned by the transport).
Definition moqtrun.h:784
u64 done_status
repath only: the PUBLISH_DONE Status Code owed at deadline_ms.
Definition moqtrun.h:816
One in-flight relayed publisher stream: which publisher-side stream (pub_stream_id) this relay follow...
Definition moqtrun.h:477
i32 rel_idx
Index into the hub's rel_pool while this relay runs reliably (its bytes ride a moqtrel ring instead o...
Definition moqtrun.h:507
int in_use
1 while this relay follows a publisher stream.
Definition moqtrun.h:479
u32 sub_expired
Bit i: sub slot i's stream was reset for OBJECT_DELIVERY_TIMEOUT and is not reopened for this Subgrou...
Definition moqtrun.h:519
usz frag_len
Bytes of the held fragment; 0 when none is held.
Definition moqtrun.h:493
u64 frag_ms
Clock (wired_moqt_tick) at which the held fragment's first byte arrived: the age of the torn Object i...
Definition moqtrun.h:516
u8 hdr[WIRED_MOQTRUN_RELAY_HDR_MAX]
The stream's opening SUBGROUP_HEADER, as received.
Definition moqtrun.h:483
u32 sub_reframe
Bit i: sub slot i's stream was late-opened header-only; the first Object it is sent gets its Object I...
Definition moqtrun.h:523
u8 sub_busy_streak[WIRED_MOQTRUN_MAX_SUBS]
Consecutive rounds sub slot i's stream_send was refused (saturates at 255): reaching WIRED_MOQTRUN_RE...
Definition moqtrun.h:503
u64 pub_stream_id
The publisher-side stream this relay follows (its key).
Definition moqtrun.h:481
u64 group_id
The stream's Group ID, from its SUBGROUP_HEADER.
Definition moqtrun.h:513
moqdata_objseq seq
Object-ID chaining state after the last whole Object relayed, and the stream's Group ID: lets header-...
Definition moqtrun.h:511
int sub_stream_set[WIRED_MOQTRUN_MAX_SUBS]
Per sub slot i: 1 once sub_stream_id[i] is open.
Definition moqtrun.h:498
u64 subgroup_id
The stream's Subgroup ID (a mode-0b01 header's first Object ID, spelled out in a late-opened stream's...
Definition moqtrun.h:527
u8 pub_prio
The stream's Publisher Priority (the header's, else the track's default): PRIORITY_FILTER's input.
Definition moqtrun.h:530
u64 sub_stream_id[WIRED_MOQTRUN_MAX_SUBS]
Per sub slot i of the track's subs[]: the subscriber-side uni stream this relay forwards on,...
Definition moqtrun.h:496
usz hdr_len
Bytes of hdr in use.
Definition moqtrun.h:485
u8 default_pub_prio
The track's DEFAULT_PUBLISHER_PRIORITY when this relay started: the Publisher Priority of a header th...
Definition moqtrun.h:488
i32 frag_idx
Index of the hub's frag_pool buffer holding the fragment, -1 when none is held (frag_len 0).
Definition moqtrun.h:491
One peer-opened request stream (draft-ietf-moq-transport-19 3.3): its own reassembly and reply queue ...
Definition moqtrun.h:642
u64 pub_origin_rid
A hub-opened PUBLISH request slot only (10.9, sent as a result of SUBSCRIBE_TRACKS): the request_id o...
Definition moqtrun.h:718
u8 has_forward
SUBSCRIBE_TRACKS (10.19.1, draft-22 3.6.2): FORWARD and GROUP_ORDER as received, copied into every PU...
Definition moqtrun.h:735
int fin_out
1 once the hub's side ended (FIN, or a reset).
Definition moqtrun.h:682
u64 stream_id
The request stream's id on wt.
Definition moqtrun.h:648
u64 done_status
The held PUBLISH_DONE's Status Code.
Definition moqtrun.h:688
int goaway
1 once a GOAWAY arrived on the stream (draft 10.4: at most one).
Definition moqtrun.h:670
u8 forward
FORWARD's value (0 or 1), valid when has_forward.
Definition moqtrun.h:737
u64 attempted_tag[WIRED_MOQTRUN_MAX_SESSIONS *WIRED_MOQTRUN_MAX_TRACKS_PER_PEER]
SUBSCRIBE_TRACKS only (10.19-10.20): per hub track slot (flat index session*WIRED_MOQTRUN_MAX_TRACKS_...
Definition moqtrun.h:710
u64 kind
Type of the stream's first message; 0 until it arrives.
Definition moqtrun.h:650
u8 send_bufs[2][WIRED_MOQTRUN_REQ_SEND_BUF]
ARMED/PENDING reply buffers (wired_moqtrun_peer.send_bufs).
Definition moqtrun.h:658
int armed_idx
The send_bufs slot (0 or 1) last handed to stream_send.
Definition moqtrun.h:662
u8 rdv_held
1 while this SUBSCRIBE is held for a publisher (hub->rdv): owed an answer, so moqtrun_req_answered mu...
Definition moqtrun.h:677
int done_pending
1 while this subscription's PUBLISH_DONE waits for a held fill (no stream may open after it); done_st...
Definition moqtrun.h:686
u64 pub_track_tag
A hub-opened PUBLISH request slot only: the wired_moqtrun_track.
Definition moqtrun.h:725
u8 ns[WIRED_MOQTRUN_MAX_NS]
PUBLISH_NAMESPACE: the Track Namespace; SUBSCRIBE_NAMESPACE: the Track Namespace Prefix (draft-ietf-m...
Definition moqtrun.h:694
int in_use
1 while the slot tracks a request stream.
Definition moqtrun.h:644
wired_moqtrun_rngrow rngf[WIRED_MOQTRUN_MAX_FILTER_RANGES]
SUBSCRIBE_TRACKS and the PUBLISH slots it opens: the object Range Filter rows it carried (draft-22 3....
Definition moqtrun.h:743
u8 rngf_n
Rows of rngf in use.
Definition moqtrun.h:745
u64 pending_updates
REQUEST_UPDATEs received but not yet answered by a flushed reply (draft-19 10.9/10....
Definition moqtrun.h:668
u64 request_id
That message's Request ID: what a reset cancels.
Definition moqtrun.h:652
wired_moqtrun_ctl_asm in
Reassembly of the peer's messages on the stream.
Definition moqtrun.h:656
int fin_in
1 once the peer's side ended (FIN).
Definition moqtrun.h:679
u64 done_count
The held PUBLISH_DONE's Stream Count.
Definition moqtrun.h:690
int live
1 once the request established a subscription or track: it stays open until cancelled or the session ...
Definition moqtrun.h:673
u8 pub_answered
A hub-opened PUBLISH slot only: 1 once its one REQUEST_OK arrived (18/19 5.1, 22 3....
Definition moqtrun.h:748
usz ns_len
Bytes of ns in use.
Definition moqtrun.h:696
usz send_lens[2]
Bytes queued in each send_bufs slot (same index).
Definition moqtrun.h:660
u8 group_order
GROUP_ORDER as received; 0 = absent.
Definition moqtrun.h:739
wired_wt_session * wt
Session the stream belongs to (owned by the transport).
Definition moqtrun.h:646
int opened
1 once stream_reply_open has accepted the first reply round.
Definition moqtrun.h:654
u64 pub_alias
A hub-opened PUBLISH request slot only: the Track Alias it named (moqtrun_session_alias),...
Definition moqtrun.h:728
u64 ns_seen[(WIRED_MOQTRUN_MAX_REQS+63)/64]
SUBSCRIBE_NAMESPACE: bit i is set while a NAMESPACE for reqs[i] has gone out with no NAMESPACE_DONE a...
Definition moqtrun.h:701
One flattened Range Filter Range (draft-19 10.2.10-10.2.14): the (ptype, set_id[, prop_type]) triple ...
Definition moqtrun.h:285
u64 end
inclusive, valid iff has_end
Definition moqtrun.h:289
u64 ptype
MOQCTL_PARAM_*_FILTER (0x25-0x29).
Definition moqtrun.h:286
u64 start
inclusive
Definition moqtrun.h:288
u64 prop_type
0x28/0x29 only, valid iff has_prop
Definition moqtrun.h:287
u8 has_end
1 when the Range has an End (end valid); 0 = open-ended.
Definition moqtrun.h:296
u8 has_prop
1 when prop_type is present (0x28/0x29 filters).
Definition moqtrun.h:294
u8 set_id
The filter's one-byte SetID (10.2.10): rows of one parameter share it.
Definition moqtrun.h:292
One subscriber recorded against the hub's track: which session, and the Track Alias its SUBSCRIBE_OK ...
Definition moqtrun.h:303
u16 ssts_fwd
Bit k: that decision picked this subscription's track.
Definition moqtrun.h:390
u64 newest_sid
That stream (0: none yet – a server-initiated uni stream id is never 0).
Definition moqtrun.h:382
u8 has_priority
1 when SUBSCRIBER_PRIORITY was present (priority valid).
Definition moqtrun.h:333
moqctl_loc jl
Joining Location (draft-ietf-moq-transport-19 5.1): the Largest Object SUBSCRIBE_OK carried,...
Definition moqtrun.h:348
u64 track_alias
Track Alias relayed Objects carry on the subscriber's session.
Definition moqtrun.h:307
u8 has_end_group
1 when the filter names a last Group (end_group valid).
Definition moqtrun.h:342
u8 has_jl
1 when jl holds a Joining Location.
Definition moqtrun.h:350
u64 end_object
Last Object of end_group to deliver (draft-22 Absolute Range, 0x04), valid when has_end_object; other...
Definition moqtrun.h:329
u8 ssts_on
1 while the subscription is a member of a switching set: only Groups decided for it are forwarded.
Definition moqtrun.h:393
u64 end_group
Last Group to deliver (AbsoluteRange), valid when has_end_group.
Definition moqtrun.h:326
moqctl_loc start
Location Filter Start (9.3.1), resolved at SUBSCRIBE time; {0, 0} when unfiltered.
Definition moqtrun.h:324
u64 subgroup_timeout
Effective SUBGROUP_DELIVERY_TIMEOUT (10.2.6) in ms: min of the publisher's Track Property and the sub...
Definition moqtrun.h:321
u8 priority
SUBSCRIBER_PRIORITY (10.2.7), valid when has_priority.
Definition moqtrun.h:331
u16 ssts_known
Bit k: a final SSTS decision for Group ssts_base + k was stamped.
Definition moqtrun.h:388
u8 has_end_object
1 when the filter names a last Object (end_object valid).
Definition moqtrun.h:344
u8 group_order
GROUP_ORDER (10.2.8); 0 = absent (the publisher's preference).
Definition moqtrun.h:335
u64 sw_peer_rid
OLD only: the activating subscription's Request ID.
Definition moqtrun.h:405
u8 sw_mode
OLD only: 0 Hard, 1 Soft.
Definition moqtrun.h:399
u8 has_delivery_timeout
1 when OBJECT_DELIVERY_TIMEOUT was present (delivery_timeout valid).
Definition moqtrun.h:340
u8 forward_off
1 when FORWARD was 0 (10.2.17): no Objects go to this subscription.
Definition moqtrun.h:337
u64 newest_group
The newest Group a lossy relay stream was opened in for this subscription, valid while newest_sid is ...
Definition moqtrun.h:378
u8 has_filter
1 when filter holds the subscription's LOCATION_FILTER.
Definition moqtrun.h:355
wired_moqtrun_rngrow rngf[WIRED_MOQTRUN_MAX_FILTER_RANGES]
Range Filter rows (10.2.10-10.2.14), one Range per row; capacity is the advertised MAX_FILTER_RANGES.
Definition moqtrun.h:364
moqctl_rangeloc filter
The LOCATION_FILTER as sent (version-neutral), valid when has_filter: what a re-attach re-resolves st...
Definition moqtrun.h:353
u8 sw_role
MOQTSW_ROLE_*: NONE, OLD (switched away from, its end pending) or NEW (activated by a switch,...
Definition moqtrun.h:397
u64 request_id
SUBSCRIBE's Request ID (draft-ietf-moq-transport-19 10.6).
Definition moqtrun.h:311
u8 blob_sent
Hub blob track only: 1 once the blob went out to this subscription, so a FORWARD 1 -> 0 -> 1 update n...
Definition moqtrun.h:369
u64 ssts_base
Group of verdict bit 0: bit k of ssts_known / ssts_fwd is the recorded verdict for Group ssts_base + ...
Definition moqtrun.h:386
int active
1 while the subscription is Established; 0 marks the slot free.
Definition moqtrun.h:309
u64 sw_deadline
OLD Soft only: clock (wired_moqt_tick) past which OLD gives up on its track reaching G-1 – WIRED_MOQT...
Definition moqtrun.h:409
u64 sw_g
The switch boundary G: OLD ends at G-1, NEW starts at {G, 0}.
Definition moqtrun.h:403
u64 stream_count
Streams the hub opened for this subscription (relay, blob, live and fetch streams alike): PUBLISH_DON...
Definition moqtrun.h:375
usz session_idx
Subscriber's index in wired_moqt_hub.peers.
Definition moqtrun.h:305
u8 rngf_n
Rows of rngf in use; 0 = no Range Filter.
Definition moqtrun.h:366
u8 sw_done
OLD only: 1 when the switch asked for Publish Done (flag 0x80).
Definition moqtrun.h:401
u64 delivery_timeout
OBJECT_DELIVERY_TIMEOUT (10.2.4) in ms, 0 when absent or none: an Object reaching the hub longer ago ...
Definition moqtrun.h:314
u8 no_props
1 when the SUBSCRIBE sent INCLUDE_PROPERTIES=0: its SUBSCRIBE_OK carries empty Track Properties (draf...
Definition moqtrun.h:372
One track a peer PUBLISHes (chat or audio), and the subscribers recorded against it.
Definition moqtrun.h:1031
usz ns_len
Bytes of ns in use; 0 for the hub's own tracks.
Definition moqtrun.h:1049
u64 own_alias
Track Alias this slot's PUBLISH declared.
Definition moqtrun.h:1039
int has_largest
1 once an Object was published (largest valid).
Definition moqtrun.h:1054
u8 props[WIRED_MOQTRUN_TRACK_PROPS_MAX]
The Track Properties forwarded in SUBSCRIBE_OK (INCLUDE_PROPERTIES, draft-22 9.20....
Definition moqtrun.h:1097
u8 malformed
1 once an Object past track_end or group_end arrived (draft-22 12.1 Malformed Track); the track then ...
Definition moqtrun.h:1090
int in_use
1 while the slot holds a PUBLISHed track.
Definition moqtrun.h:1033
u64 pubdone_status
The publisher's PUBLISH_DONE (draft-19 10.11) awaiting relay: its Status Code and Stream Count,...
Definition moqtrun.h:1074
u64 up_streams
SUBGROUP streams the PUBLISH's publisher opened on this incarnation: what its PUBLISH_DONE Stream Cou...
Definition moqtrun.h:1070
u8 pubdone_pending
1 while a PUBLISH_DONE is held.
Definition moqtrun.h:1080
u64 subgroup_timeout_ms
The PUBLISH's SUBGROUP_DELIVERY_TIMEOUT Track Property (12.6) in ms, 0 when absent: min()ed into each...
Definition moqtrun.h:1060
moqctl_loc track_end
The Object with Status END_OF_TRACK, valid while end_flags bit 0.
Definition moqtrun.h:1082
u64 cache_tag
This incarnation's records in the hub cache (wired_moqt_hub.cache), fresh on every PUBLISH,...
Definition moqtrun.h:1067
u8 name[WIRED_MOQTRUN_MAX_NAME]
Copied Track Name.
Definition moqtrun.h:1035
u8 end_flags
Bit 0: track_end set; bit 1: group_end set.
Definition moqtrun.h:1087
wired_moqtrun_relay relays[WIRED_MOQTRUN_MAX_RELAYS]
Publisher streams being relayed (wired_moqtrun_relay).
Definition moqtrun.h:1043
wired_moqtrun_sub subs[WIRED_MOQTRUN_MAX_SUBS]
Subscriptions recorded against the track (active marks live).
Definition moqtrun.h:1041
u64 pubdone_deadline
Clock past which the held PUBLISH_DONE goes out anyway.
Definition moqtrun.h:1078
u64 pubdone_streams
The held PUBLISH_DONE's Stream Count.
Definition moqtrun.h:1076
moqctl_loc largest
Largest Object published on this track (10.2.16), valid when has_largest; restarts with each PUBLISH.
Definition moqtrun.h:1052
u64 request_id
Request ID of the PUBLISH that claimed this slot.
Definition moqtrun.h:1056
u8 ns[WIRED_MOQTRUN_MAX_NS]
Encoded Track Namespace this slot's PUBLISH declared: a SUBSCRIBE matches on namespace AND name (draf...
Definition moqtrun.h:1047
u8 default_pub_prio
The PUBLISH's DEFAULT_PUBLISHER_PRIORITY Track Property (12.4), 128 when absent: the Publisher Priori...
Definition moqtrun.h:1063
moqctl_loc group_end
The latest Object with Status END_OF_GROUP, valid while end_flags bit 1.
Definition moqtrun.h:1085
u8 props_len
Bytes of props in use: the claiming PUBLISH's (or upstream SUBSCRIBE_OK's) Track Properties,...
Definition moqtrun.h:1094
usz name_len
Bytes of name in use.
Definition moqtrun.h:1037
One SUBSCRIBE the hub sent upstream on its own request stream.
Definition moqtrun.h:838
wired_wt_session * wt
The publisher's session.
Definition moqtrun.h:842
u64 stream_id
The hub-opened request stream the SUBSCRIBE went out on.
Definition moqtrun.h:844
u8 done
1 once the publisher's PUBLISH_DONE arrived: the hub's side ends with a FIN, not a cancel,...
Definition moqtrun.h:851
u8 ns[WIRED_MOQTRUN_MAX_NS]
The Full Track Name's encoded Namespace, keyed as the hub keys tracks.
Definition moqtrun.h:854
wired_moqtrun_ctl_asm in
Reassembly of the publisher's replies on stream_id.
Definition moqtrun.h:862
usz name_len
Bytes of name in use.
Definition moqtrun.h:860
usz ns_len
Bytes of ns in use.
Definition moqtrun.h:856
u64 track_tag
cache_tag of the track SUBSCRIBE_OK claimed; 0 while pending.
Definition moqtrun.h:848
u64 request_id
The hub's Request ID on wt (odd, draft-18 10.1).
Definition moqtrun.h:846
u8 name[WIRED_MOQTRUN_MAX_NAME]
The Full Track Name's Track Name, copied.
Definition moqtrun.h:858
int in_use
1 while the slot tracks an upstream SUBSCRIBE.
Definition moqtrun.h:840
The bulky part of a fetches[] slot's upstream FETCH, kept beside the slot (wired_moqt_hub....
Definition moqtrun.h:1007
usz ns_len
Bytes of ns in use.
Definition moqtrun.h:1013
u8 ns[WIRED_MOQTRUN_MAX_NS]
The Full Track Name's encoded Namespace (malformed-track scope).
Definition moqtrun.h:1011
usz name_len
Bytes of name in use.
Definition moqtrun.h:1017
wired_moqtrun_ctl_asm in
Reassembly of the upstream replies on the slot's up_req_sid.
Definition moqtrun.h:1009
u8 name[WIRED_MOQTRUN_MAX_NAME]
The Full Track Name's Track Name.
Definition moqtrun.h:1015
Mutable view of a byte range.
Definition span.h:42
Read-only view of a byte range.
Definition span.h:30
A server-sent stream's send class and its place inside a flow, set by wired_server_wt_stream_schedule...
Definition srvrun.h:672
A WebTransport session.
Definition session.h:77
Linux direct syscalls.
unsigned int u32
unsigned 32-bit integer
Definition types.h:15
long i64
signed 64-bit integer
Definition types.h:14
int i32
signed 32-bit integer
Definition types.h:16
u64 usz
unsigned size (size_t equivalent)
Definition types.h:20
unsigned short u16
unsigned 16-bit integer
Definition types.h:17
unsigned char u8
unsigned 8-bit integer / byte
Definition types.h:18
unsigned long u64
unsigned 64-bit integer
Definition types.h:13