wired
libc-free QUIC/HTTP3 SDK in C for x86_64-linux
Loading...
Searching...
No Matches
moqctl.h
Go to the documentation of this file.
1#ifndef MOQCTL_H
2#define MOQCTL_H
3
6#include "common/bytes/varint/varint.h"
8
30
32#define MOQCTL_OK 1
35#define MOQCTL_INSUFFICIENT 0
38#define MOQCTL_VIOLATION (-1)
39
40/* Message Type IDs this codec knows how to decode/encode (SS10 table). */
43#define MOQCTL_T_SETUP 0x2F00ULL
46#define MOQCTL_T_GOAWAY 0x10ULL
48#define MOQCTL_T_SUBSCRIBE 0x3ULL
51#define MOQCTL_T_SUBSCRIBE_OK 0x4ULL
53#define MOQCTL_T_REQUEST_ERROR 0x5ULL
56#define MOQCTL_T_REQUEST_OK 0x7ULL
58#define MOQCTL_T_PUBLISH_DONE 0xBULL
60#define MOQCTL_T_PUBLISH 0x1DULL
63#define MOQCTL_T_PUBLISH_SKIPPED 0xFULL
66#define MOQCTL_T_SUBSCRIBE_TRACKS 0x51ULL
69#define MOQCTL_T_PUBLISH_OK18 0x1EULL
71#define MOQCTL_T_PUBLISH_STATE_NOTIFY 0x22ULL
72
74#define MOQCTL_UNKNOWN_TYPE (-2)
77#define MOQCTL_KNOWN_UNIMPLEMENTED (-3)
78
79/* Wire limits (draft-ietf-moq-transport-18/19/22: the same in all three;
80 * draft-19 sections). */
83#define MOQCTL_MAX_MSG_LEN 0xFFFF
86#define MOQCTL_MAX_REASON_LEN 1024
89#define MOQCTL_MAX_URI_LEN 8192
91#define MOQCTL_MAX_NS_FIELDS 32
94#define MOQCTL_MAX_FTN_LEN 4096
97#define MOQCTL_MAX_PARAMS 64
98
100#define MOQCTL_ERR_INTERNAL_ERROR 0x0ULL
103#define MOQCTL_ERR_NOT_SUPPORTED 0x3ULL
105#define MOQCTL_ERR_GOING_AWAY 0x6ULL
107#define MOQCTL_ERR_DOES_NOT_EXIST 0x10ULL
110#define MOQCTL_ERR_INVALID_RANGE 0x11ULL
112#define MOQCTL_ERR_UNINTERESTED 0x20ULL
114#define MOQCTL_ERR_UNAUTHORIZED 0x1ULL
116#define MOQCTL_ERR_MALFORMED_AUTH_TOKEN 0x4ULL
119#define MOQCTL_ERR_INVALID_FILTER 0x36ULL
122#define MOQCTL_ERR_REDIRECT 0x34ULL
124#define MOQCTL_ERR_PREFIX_OVERLAP 0x30ULL
126#define MOQCTL_ERR_EXCESSIVE_LOAD 0x9ULL
129#define MOQCTL_ERR_DUPLICATE_SUBSCRIPTION 0x19ULL
132#define MOQCTL_ERR_INVALID_JOINING_REQUEST_ID 0x32ULL
135#define MOQCTL_ERR_CONFLICTING_FILTERS 0x35ULL
140#define MOQCTL_ERR_INVALID_SWITCH 0x32ULL
144#define MOQCTL_ERR_UNSUPPORTED_EXTENSION 0x33ULL
145
147#define MOQCTL_DONE_INTERNAL_ERROR 0x0ULL
149#define MOQCTL_DONE_TRACK_ENDED 0x2ULL
151#define MOQCTL_DONE_GOING_AWAY 0x4ULL
154#define MOQCTL_DONE_UPDATE_FAILED 0x8ULL
156#define MOQCTL_DONE_SUBSCRIPTION_ENDED 0x3ULL
159#define MOQCTL_DONE_MALFORMED_TRACK 0x12ULL
165#define MOQCTL_DONE_SWITCHED 0x3ULL
166
168#define MOQCTL_CLOSE_INVALID_AUTHORITY 0x19ULL
171#define MOQCTL_CLOSE_INVALID_PATH 0x8ULL
175#define MOQCTL_CLOSE_KVFMT_ERROR 0x6ULL
176
178#define MOQCTL_OPT_PATH 0x1ULL
181#define MOQCTL_OPT_AUTHORITY 0x5ULL
184#define MOQCTL_OPT_MAX_FILTER_RANGES 0x6ULL
187#define MOQCTL_OPT_MOQT_IMPLEMENTATION 0x7ULL
190#define MOQCTL_OPT_MAX_REQUEST_UPDATES 0x8ULL
193#define MOQCTL_OPT_SSTS_ALGORITHMS 0x9ULL
194
197#define MOQCTL_SSTS_ALG_DEFAULT 0x0ULL
200#define MOQCTL_SSTS_ALG_BACKPRESSURE 0xff01ULL
204#define MOQCTL_SSTS_MAX_ALGS 4
205
207#define MOQCTL_PARAM_AUTHORIZATION_TOKEN 0x03ULL
210#define MOQCTL_PARAM_OBJECT_DELIVERY_TIMEOUT 0x02ULL
213#define MOQCTL_PARAM_SUBGROUP_DELIVERY_TIMEOUT 0x06ULL
216#define MOQCTL_PARAM_FORWARD 0x10ULL
219#define MOQCTL_PARAM_RENDEZVOUS_TIMEOUT 0x04ULL
222#define MOQCTL_PARAM_EXPIRES 0x08ULL
224#define MOQCTL_PARAM_LARGEST_OBJECT 0x09ULL
227#define MOQCTL_PARAM_FILL_TIMEOUT 0x0AULL
230#define MOQCTL_PARAM_SUBSCRIBER_PRIORITY 0x20ULL
233#define MOQCTL_PARAM_LOCATION_FILTER 0x21ULL
236#define MOQCTL_PARAM_GROUP_ORDER 0x22ULL
238#define MOQCTL_PARAM_SUBGROUP_FILTER 0x25ULL
240#define MOQCTL_PARAM_OBJECTID_FILTER 0x26ULL
243#define MOQCTL_PARAM_PRIORITY_FILTER 0x27ULL
246#define MOQCTL_PARAM_OBJECT_PROPERTY_FILTER 0x28ULL
249#define MOQCTL_PARAM_TRACK_PROPERTY_FILTER 0x29ULL
251#define MOQCTL_PARAM_NEW_GROUP_REQUEST 0x32ULL
253#define MOQCTL_PARAM_TRACK_NAMESPACE_PREFIX 0x34ULL
255#define MOQCTL_PARAM_FILL_PARAMETERS 0x23ULL
257#define MOQCTL_PARAM_INCLUDE_PROPERTIES 0x35ULL
260#define MOQCTL_PARAM_SWITCH_FROM 0x24ULL
263#define MOQCTL_PARAM_SWITCHING_SET_ASSIGNMENT 0x41ULL
264
266#define MOQCTL_SWITCH_HARD 0
269#define MOQCTL_SWITCH_SOFT 1
270
276#define MOQCTL_PCTX_SUBSCRIBE 0x1u
278#define MOQCTL_PCTX_SUBSCRIBE_OK 0x2u
280#define MOQCTL_PCTX_PUBLISH 0x4u
282#define MOQCTL_PCTX_PUBLISH_OK 0x8u
284#define MOQCTL_PCTX_FETCH 0x10u
286#define MOQCTL_PCTX_FETCH_OK 0x20u
288#define MOQCTL_PCTX_TRACK_STATUS 0x40u
290#define MOQCTL_PCTX_TRACK_STATUS_OK 0x80u
292#define MOQCTL_PCTX_PUBLISH_NAMESPACE 0x100u
294#define MOQCTL_PCTX_PUBLISH_NAMESPACE_OK 0x200u
296#define MOQCTL_PCTX_SUBSCRIBE_NAMESPACE 0x400u
298#define MOQCTL_PCTX_SUBSCRIBE_NAMESPACE_OK 0x800u
300#define MOQCTL_PCTX_SUBSCRIBE_TRACKS 0x1000u
302#define MOQCTL_PCTX_SUBSCRIBE_TRACKS_OK 0x2000u
304#define MOQCTL_PCTX_UPDATE_SUBSCRIPTION 0x4000u
306#define MOQCTL_PCTX_UPDATE_FETCH 0x8000u
308#define MOQCTL_PCTX_UPDATE_SUBSCRIBE_NAMESPACE 0x10000u
310#define MOQCTL_PCTX_UPDATE_SUBSCRIBE_TRACKS 0x20000u
312#define MOQCTL_PCTX_UPDATE_PUBLISH_NAMESPACE 0x40000u
314#define MOQCTL_PCTX_REQUEST_UPDATE_OK 0x80000u
316#define MOQCTL_PCTX_REQUEST_OK_ANY \
317 (MOQCTL_PCTX_PUBLISH_OK | MOQCTL_PCTX_TRACK_STATUS_OK | \
318 MOQCTL_PCTX_PUBLISH_NAMESPACE_OK | MOQCTL_PCTX_SUBSCRIBE_NAMESPACE_OK | \
319 MOQCTL_PCTX_SUBSCRIBE_TRACKS_OK | MOQCTL_PCTX_REQUEST_UPDATE_OK)
320
322#define MOQCTL_PENC_UINT8 0
324#define MOQCTL_PENC_VARINT 1
326#define MOQCTL_PENC_LOCATION 2
328#define MOQCTL_PENC_BYTES 3
331#define MOQCTL_PENC_TOKEN 4
335#define MOQCTL_PENC_LOCFILTER 5
338#define MOQCTL_PENC_NS 6
342#define MOQCTL_PENC_RANGELOC22 7
346#define MOQCTL_PENC_SWITCHFROM 8
350#define MOQCTL_PENC_SSA 9
351
355#define MOQCTL_TOKEN_DELETE 0x0ULL
357#define MOQCTL_TOKEN_REGISTER 0x1ULL
359#define MOQCTL_TOKEN_USE_ALIAS 0x2ULL
361#define MOQCTL_TOKEN_USE_VALUE 0x3ULL
362
364#define MOQCTL_FILTER_NEXT_GROUP 0x1ULL
366#define MOQCTL_FILTER_LARGEST 0x2ULL
368#define MOQCTL_FILTER_ABS_START 0x3ULL
371#define MOQCTL_FILTER_ABS_RANGE 0x4ULL
372
375
382
390
392typedef struct {
397} moqctl_loc;
398
400static inline moqctl_loc moqctl_loc_of(u64 group, u64 object) {
401 moqctl_loc l = {group, object};
402 return l;
403}
404
407
410 return moqctl_loc_less(a, b) ? a : b;
411}
412
415 return moqctl_loc_less(a, b) ? b : a;
416}
417
421 return excl.object ? moqctl_loc_of(excl.group, excl.object - 1)
422 : moqctl_loc_of(excl.group - 1, VARINT_MAX);
423}
424
429
439
446
451typedef enum {
452 MOQCTL_RSK_REL_GROUP,
453 MOQCTL_RSK_NEXT_OBJ,
454 MOQCTL_RSK_ABS
455} moqctl_rsk;
456
460typedef enum {
461 MOQCTL_REK_UNBOUNDED,
462 MOQCTL_REK_GROUP,
463 MOQCTL_REK_OBJ
464} moqctl_rek;
465
486
496
503 wired_span buf, usz* off, int* has_filter, moqctl_rangeloc* out);
507 wired_mspan buf, usz* off, int has_filter, const moqctl_rangeloc* r);
508
512#define MOQCTL_MAX_RANGES 4
513
516typedef struct {
524
548
553 u64 ptype, wired_span value, moqctl_rangefilter* out);
554
558 wired_mspan buf, usz* off, u64 ptype, const moqctl_rangefilter* f);
559
569
577
583int moqctl_ftn_put(wired_mspan buf, usz* off, const moqctl_ftn* f);
584
591int moqctl_ns_put(wired_mspan buf, usz* off, const moqctl_ns* ns);
592
595int moqctl_ns_put(wired_mspan buf, usz* off, const moqctl_ns* ns);
596
599
604
608
614
616int moqctl_ftn_eq(const moqctl_ftn* a, const moqctl_ftn* b);
617
630
637
652
663
684
714
722
730#define MOQCTL_PARAMS_KVFMT (-4)
737 int ver, wired_span buf, usz* off, u32 ctx, moqctl_params* out);
741int moqctl_params_put(wired_mspan buf, usz* off, const moqctl_params* params);
742
746
785
794
804
807 int ver, wired_span buf, usz* off, moqctl_subscribe* out);
810 wired_mspan buf, usz* off, const moqctl_subscribe* m);
811
824
827 int ver, wired_span buf, usz* off, moqctl_subscribe_ok* out);
831 wired_mspan buf, usz* off, const moqctl_subscribe_ok* m);
832
846
848int moqctl_publish_take(int ver, wired_span buf, usz* off, moqctl_publish* out);
851
864
867 int ver, wired_span buf, usz* off, moqctl_request_ok* out);
870 wired_mspan buf, usz* off, const moqctl_request_ok* m);
871
881
900
904 wired_span buf, usz* off, moqctl_request_error* out);
908 wired_mspan buf, usz* off, const moqctl_request_error* m);
909
921
924 wired_span buf, usz* off, moqctl_publish_done* out);
928 wired_mspan buf, usz* off, const moqctl_publish_done* m);
929
941
948
955
969int moqctl_peek_type(wired_span buf, usz* off, u64* type_out, wired_span* body);
970
975int moqctl_type_ver(int ver, int peek, u64* type);
976
979int moqctl_peek_header(wired_span buf, usz* at, u64* type, u16* len);
980
985int moqctl_body_end(int r, usz off, wired_span body);
986
987#endif
int moqctl_ftn_put(wired_mspan buf, usz *off, const moqctl_ftn *f)
Encodes f as Track Namespace then Track Name; 1 ok, 0 when buf runs out.
#define MOQCTL_MAX_NS_FIELDS
Most Track Namespace fields (SS1.5); more is a VIOLATION.
Definition moqctl.h:91
int moqctl_publish_done_take(wired_span buf, usz *off, moqctl_publish_done *out)
Decodes a PUBLISH_DONE Message Body.
int moqctl_ftn_eq(const moqctl_ftn *a, const moqctl_ftn *b)
Exact byte comparison (SS1.5): 1 if equal, 0 otherwise.
int moqctl_param_put_uint8(wired_mspan buf, usz *at, u64 v)
Writes the low 8 bits of v as one byte at *at; 1 ok, 0 no room.
int moqctl_rangefilter_put(wired_mspan buf, usz *off, u64 ptype, const moqctl_rangefilter *f)
Encodes f as a Range Filter value (no parameter Type/Length around it).
int moqctl_request_error_encode(wired_mspan buf, usz *off, const moqctl_request_error *m)
Encodes m as a REQUEST_ERROR Message Body; 1 ok, 0 when buf runs out.
const moqctl_param * moqctl_params_find(const moqctl_params *params, u64 type)
First item of Type type in params, or 0 when absent (the draft default then applies,...
int moqctl_goaway_take(wired_span buf, usz *off, moqctl_goaway *out)
Decodes a GOAWAY Message Body (draft-19/22 form, no Request ID).
int moqctl_name_put(wired_mspan buf, usz *off, wired_span name)
Length (vi64) + bytes.
int moqctl_setup_encode(wired_mspan buf, usz *off, const moqctl_setup *s)
Encodes s's present options as a SETUP Message Body, in ascending option order; 1 ok,...
moqctl_rek
End kind: UNBOUNDED (open-ended), GROUP (ends at the last Object of end_group, no explicit end object...
Definition moqctl.h:460
int moqctl_setup_take(wired_span buf, usz *off, moqctl_setup *out)
Decodes a SETUP Message Body: every byte from *off to the end of buf is the Setup Options list.
int moqctl_request_ok_encode(wired_mspan buf, usz *off, const moqctl_request_ok *m)
Encodes m as a REQUEST_OK Message Body; 1 ok, 0 when buf runs out.
moqctl_rsk
Version-neutral LOCATION_FILTER range model.
Definition moqctl.h:451
int moqctl_loc_put(wired_mspan buf, usz *off, moqctl_loc loc)
Encodes loc as two varints at *off; 1 ok, 0 when buf runs out.
int moqctl_is_grease(u64 v)
grease pattern (SS17.6): 0x7f*N + 0x9D.
int moqctl_rangeloc19_put(wired_mspan buf, usz *off, const moqctl_rangeloc *r)
Encodes r in draft-19's Location Filter form; 1 ok, 0 when buf runs out.
static moqctl_loc moqctl_loc_max(moqctl_loc a, moqctl_loc b)
The later of a and b.
Definition moqctl.h:414
int moqctl_publish_done_encode(wired_mspan buf, usz *off, const moqctl_publish_done *m)
Encodes m as a PUBLISH_DONE Message Body; 1 ok, 0 when buf runs out.
int moqctl_rangeloc19_take(wired_span buf, usz *off, moqctl_rangeloc *out)
draft-19 LOCATION_FILTER value codec (SS5.1.2/SS10.2.9).
#define MOQCTL_MAX_RANGES
Ranges one decoded Range Filter value holds (SS10.2.10-10.2.14); a value with more marks the filter i...
Definition moqctl.h:512
int moqctl_reason_take(wired_span buf, usz *off, moqctl_reason *out)
Decodes a Reason Phrase as a view into buf.
int moqctl_params_take(int ver, wired_span buf, usz *off, u32 ctx, moqctl_params *out)
ver (MOQVER_*, a valid id) picks the draft's parameter table: each Type's allowed contexts,...
u64 moqctl_known_publish_done(u64 code)
PUBLISH_DONE counterpart of moqctl_known_request_error: a status code this subset does not act on bec...
static moqctl_loc moqctl_loc_of(u64 group, u64 object)
Location {group, object}.
Definition moqctl.h:400
int moqctl_request_error_take(wired_span buf, usz *off, moqctl_request_error *out)
Decodes a REQUEST_ERROR Message Body (Redirect read iff the code is REDIRECT).
int moqctl_goaway18_encode(wired_mspan buf, usz *off, const moqctl_goaway *m)
Encoding counterpart of moqctl_goaway18_take (appends request_id).
int moqctl_ftn_take(wired_span buf, usz *off, moqctl_ftn *out)
VIOLATION on: a field of length 0, >32 fields, or total (namespace + name) bytes > MOQCTL_MAX_FTN_LEN...
int moqctl_param_take_uint8(wired_span buf, usz *at, u64 *out)
One fixed 8-bit field (uint8 parameter values, Publisher Priority, End Of Track).
int moqctl_subscribe_ok_encode(wired_mspan buf, usz *off, const moqctl_subscribe_ok *m)
Encodes m as a SUBSCRIBE_OK Message Body; 1 ok, 0 when buf runs out.
int moqctl_goaway_encode(wired_mspan buf, usz *off, const moqctl_goaway *m)
Encodes m's URI and timeout as a GOAWAY Message Body; 1 ok, 0 when buf runs out.
int moqctl_goaway18_take(wired_span buf, usz *off, moqctl_goaway *out)
draft-18 SS10.4 GOAWAY on the control stream: the fields above plus a trailing Request ID.
u64 moqctl_publish_done_for(int ver, u64 code)
PUBLISH_DONE counterpart of moqctl_request_error_for (draft-22 has no SUBSCRIPTION_ENDED,...
int moqctl_ns_put(wired_mspan buf, usz *off, const moqctl_ns *ns)
Encodes a bare Track Namespace (count + Length-prefixed fields); 0 when buf runs out.
int moqctl_rangeloc22_take(wired_span buf, usz *off, int *has_filter, moqctl_rangeloc *out)
draft-22 LOCATION_FILTER value codec (SS9.20.9).
int moqctl_body_end(int r, usz off, wired_span body)
Whole-body decode verdict: r is a take's result after reading from the start of a Message Body,...
int moqctl_loc_take(wired_span buf, usz *off, moqctl_loc *out)
Decodes a Location at *off.
int moqctl_name_take(wired_span buf, usz *off, wired_span *name)
Length (vi64) + that many bytes, as a view into buf (Track Name and every other length-prefixed byte ...
int moqctl_locfilter_put(wired_mspan buf, usz *off, const moqctl_locfilter *f)
Encodes f (Type, then the fields its Type carries); 1 ok, 0 when buf runs out.
int moqctl_subscribe_ok_take(int ver, wired_span buf, usz *off, moqctl_subscribe_ok *out)
Decodes a SUBSCRIBE_OK Message Body to its end (*off = buf.n).
int moqctl_locfilter_take(wired_span buf, usz *off, moqctl_locfilter *out)
Returns MOQCTL_OK / INSUFFICIENT / VIOLATION (unknown type, or AbsoluteRange End Group overflowing 2^...
int moqctl_type_ver(int ver, int peek, u64 *type)
Re-classifies a moqctl_peek_type result for draft ver (MOQVER_*): a Type unknown to the draft-19 tabl...
int moqctl_rangefilter_take(u64 ptype, wired_span value, moqctl_rangefilter *out)
Decodes a Range Filter parameter's value bytes (exactly its Length).
int moqctl_peek_type(wired_span buf, usz *off, u64 *type_out, wired_span *body)
Common envelope: reads Type (vi64) + Length (16-bit BE) at *off, without consuming past MOQCTL_OK's T...
#define MOQCTL_MAX_PARAMS
Most Message Parameters one list holds: an implementation bound (no draft limit); a longer list is a ...
Definition moqctl.h:97
#define MOQCTL_SSTS_MAX_ALGS
Algorithm ids one decoded SSTS_ALGORITHMS option keeps.
Definition moqctl.h:204
usz moqctl_ns_bytelen(const moqctl_ns *ns)
Sum of the Track Namespace Field Lengths (SS2.4.1 namespace length).
int moqctl_loc_less(moqctl_loc a, moqctl_loc b)
Location A < Location B: (A.Group, A.Object) lexicographic.
int moqctl_subscribe_encode(wired_mspan buf, usz *off, const moqctl_subscribe *m)
Encodes m as a SUBSCRIBE Message Body; 1 ok, 0 when buf runs out.
static moqctl_loc moqctl_loc_prev(moqctl_loc excl)
The Location just before excl (excl > {0, 0}): the previous Group's last possible Object when excl st...
Definition moqctl.h:420
u64 moqctl_known_request_error(u64 code)
Unknown-error-code-is-INTERNAL_ERROR normalization (SS17.6).
u64 moqctl_request_error_for(int ver, u64 code)
Send-side code for draft ver (MOQVER_*): a REQUEST_ERROR / PUBLISH_DONE code that ver does not define...
int moqctl_publish_take(int ver, wired_span buf, usz *off, moqctl_publish *out)
Decodes a PUBLISH Message Body to its end (*off = buf.n).
wired_span moqctl_reason
draft-ietf-moq-transport-19 SS1.4.4 Reason Phrase: Length + UTF-8 bytes, length capped at MOQCTL_MAX_...
Definition moqctl.h:629
static moqctl_loc moqctl_loc_min(moqctl_loc a, moqctl_loc b)
The earlier of a and b.
Definition moqctl.h:409
int moqctl_reason_put(wired_mspan buf, usz *off, moqctl_reason reason)
Encodes reason as Length + bytes; 1 ok, 0 when buf runs out.
int moqctl_request_ok_take(int ver, wired_span buf, usz *off, moqctl_request_ok *out)
Decodes a REQUEST_OK Message Body to its end (*off = buf.n).
int moqctl_peek_header(wired_span buf, usz *at, u64 *type, u16 *len)
Reads only Type + Length at *at (no body check): MOQCTL_OK advances *at past them; on MOQCTL_INSUFFIC...
int moqctl_params_put(wired_mspan buf, usz *off, const moqctl_params *params)
Encodes params as count + Type Delta/Value pairs, each value per its enc.
int moqctl_rangeloc22_put(wired_mspan buf, usz *off, int has_filter, const moqctl_rangeloc *r)
Encodes r in draft-22's form, or Type 0x00 (None) when has_filter is 0; 1 ok, 0 when buf runs out.
int moqctl_ns_take(wired_span buf, usz *off, moqctl_ns *out)
Track Namespace alone (no Track Name): VIOLATION on a field of length 0, >32 fields,...
int moqctl_subscribe_take(int ver, wired_span buf, usz *off, moqctl_subscribe *out)
Decodes a SUBSCRIBE Message Body; ver as in moqctl_params_take.
int moqctl_publish_encode(wired_mspan buf, usz *off, const moqctl_publish *m)
Encodes m as a PUBLISH Message Body; 1 ok, 0 when buf runs out.
The MOQT drafts this SDK speaks, as one table: each row is a dense version id, its WebTransport subpr...
Value-type views that fold the SDK's recurring argument shapes into single parameters,...
Full Track Name: Track Namespace + Track Name (may be empty).
Definition moqctl.h:571
wired_span name
Track Name bytes (view); may be empty.
Definition moqctl.h:575
moqctl_ns ns
Track Namespace.
Definition moqctl.h:573
draft-ietf-moq-transport-19 SS10.3 GOAWAY.
Definition moqctl.h:931
u64 request_id
draft-18 control-stream GOAWAY only (moqctl_goaway18_*): the smallest peer Request ID not (or maybe n...
Definition moqctl.h:939
u64 timeout
Milliseconds after which the sender may close the session.
Definition moqctl.h:936
wired_span new_session_uri
URI to reconnect to (view), at most MOQCTL_MAX_URI_LEN bytes; empty means reuse the current URI.
Definition moqctl.h:934
draft-ietf-moq-transport-19 SS1.4.2 Location: two consecutive varints.
Definition moqctl.h:392
u64 object
Object ID within the Group.
Definition moqctl.h:396
u64 group
Group ID.
Definition moqctl.h:394
draft-ietf-moq-transport-19 SS9.3.1 Location Filter.
Definition moqctl.h:431
u64 end_group_delta
End Group minus start.group; on the wire only for ABS_RANGE.
Definition moqctl.h:437
u64 type
Filter Type, one of MOQCTL_FILTER_*.
Definition moqctl.h:433
moqctl_loc start
Start Location; on the wire only for ABS_START / ABS_RANGE.
Definition moqctl.h:435
draft-ietf-moq-transport-19 SS1.5 Track Namespace: up to MOQCTL_MAX_NS_FIELDS fields,...
Definition moqctl.h:563
usz n
Number of fields used, 0..MOQCTL_MAX_NS_FIELDS.
Definition moqctl.h:567
wired_span fields[MOQCTL_MAX_NS_FIELDS]
Namespace fields in order; each non-empty (views, not copies).
Definition moqctl.h:565
draft-ietf-moq-transport-19 SS10.2 Message Parameter: Type Delta + Value.
Definition moqctl.h:687
moqctl_rangeloc rl
Version-neutral filter for PENC_LOCFILTER / PENC_RANGELOC22.
Definition moqctl.h:708
u64 type
Absolute Parameter Type (MOQCTL_PARAM_*), Type Delta resolved.
Definition moqctl.h:689
wired_span bytes
View for MOQCTL_PENC_BYTES / NS, and MOQCTL_PENC_TOKEN's raw Token bytes (what encode re-emits).
Definition moqctl.h:700
moqctl_loc loc
Value for MOQCTL_PENC_LOCATION.
Definition moqctl.h:697
moqctl_ssa ssa
Decoded value for MOQCTL_PENC_SSA.
Definition moqctl.h:712
moqctl_token token
Decoded Token for MOQCTL_PENC_TOKEN.
Definition moqctl.h:702
int enc
Value encoding, one of MOQCTL_PENC_*; selects the field below.
Definition moqctl.h:691
u64 vi
Value for MOQCTL_PENC_VARINT.
Definition moqctl.h:695
u64 u8v
Value for MOQCTL_PENC_UINT8 (0..255).
Definition moqctl.h:693
moqctl_locfilter lf
draft-19 Location Filter for MOQCTL_PENC_LOCFILTER.
Definition moqctl.h:704
moqctl_switchfrom sw
Decoded value for MOQCTL_PENC_SWITCHFROM.
Definition moqctl.h:710
int has_filter
PENC_LOCFILTER/RANGELOC22: 0 for draft-22 Type 0x00 (None).
Definition moqctl.h:706
A decoded/to-encode Message Parameter list.
Definition moqctl.h:716
usz n
Number of items used, 0..MOQCTL_MAX_PARAMS.
Definition moqctl.h:720
moqctl_param items[MOQCTL_MAX_PARAMS]
Parameters in wire order, i.e.
Definition moqctl.h:718
draft-ietf-moq-transport-19 SS10.10 PUBLISH_DONE.
Definition moqctl.h:911
u64 stream_count
Number of data streams the publisher opened for the subscription, so the subscriber knows when all of...
Definition moqctl.h:917
u64 status_code
Status Code (MOQCTL_DONE_*); normalize received codes with moqctl_known_publish_done.
Definition moqctl.h:914
moqctl_reason reason
Reason Phrase (view, untrusted).
Definition moqctl.h:919
draft-ietf-moq-transport-19 SS10.9 PUBLISH.
Definition moqctl.h:834
u64 track_alias
Track Alias the publisher assigned for the data streams.
Definition moqctl.h:840
moqctl_ftn name
Full Track Name offered.
Definition moqctl.h:838
u64 request_id
Request ID the publisher allocated for this PUBLISH.
Definition moqctl.h:836
wired_span track_properties
Unparsed Track Properties: the rest of the body (view).
Definition moqctl.h:844
moqctl_params params
Parameters (PUBLISH context).
Definition moqctl.h:842
One inclusive Range of a Range Filter (SS10.2.10): [start, end], or [start, inf) when the final End w...
Definition moqctl.h:516
int has_end
0 when the final Range is open-ended.
Definition moqctl.h:522
u64 start
First matching value, absolute (deltas already resolved).
Definition moqctl.h:518
u64 end
Last matching value, inclusive; valid iff has_end.
Definition moqctl.h:520
A decoded Range Filter parameter value (SS10.2.10-10.2.14): SetID, the 0x28/0x29 Property Type,...
Definition moqctl.h:531
int remove
1 for a zero-length value: delete this filter (REQUEST_UPDATE).
Definition moqctl.h:539
usz n
Ranges decoded into r, at most MOQCTL_MAX_RANGES.
Definition moqctl.h:543
u64 prop_type
Property Type the Ranges apply to; valid iff has_prop.
Definition moqctl.h:537
int invalid
1 when the value is unusable (see above): answer INVALID_FILTER.
Definition moqctl.h:541
int has_prop
1 for the Property filters (0x28/0x29), which carry prop_type.
Definition moqctl.h:535
moqctl_range r[MOQCTL_MAX_RANGES]
The Ranges in wire order (each start is a delta past the previous end, so they ascend).
Definition moqctl.h:546
u64 set_id
SetID: the filter set this Range Filter belongs to.
Definition moqctl.h:533
Version-neutral LOCATION_FILTER range.
Definition moqctl.h:472
moqctl_rsk sk
How the start is expressed (moqctl_rsk).
Definition moqctl.h:474
u64 end_object
Last Object ID, inclusive; meaningful only when ek == OBJ.
Definition moqctl.h:484
u64 start_group
Absolute start Group (ABS) or groups-back count (REL_GROUP).
Definition moqctl.h:476
u64 end_group
Absolute last Group; meaningful unless ek == UNBOUNDED.
Definition moqctl.h:482
u64 start_object
Start Object ID; meaningful only when sk == ABS.
Definition moqctl.h:478
moqctl_rek ek
How the end is expressed (moqctl_rek).
Definition moqctl.h:480
draft-ietf-moq-transport-19 SS10.8 REQUEST_ERROR redirect (SS10.8.1).
Definition moqctl.h:873
moqctl_ns track_namespace
Track Namespace to request instead.
Definition moqctl.h:877
wired_span connect_uri
URI of the session to retry the request on (view).
Definition moqctl.h:875
wired_span track_name
Track Name to request instead (view).
Definition moqctl.h:879
draft-ietf-moq-transport-19 SS10.8 REQUEST_ERROR.
Definition moqctl.h:886
u64 error_code
Error Code (MOQCTL_ERR_*); normalize received codes with moqctl_known_request_error.
Definition moqctl.h:889
moqctl_reason reason
Reason Phrase (view, untrusted).
Definition moqctl.h:894
u64 retry_interval
Retry Interval: 0 means do not retry, otherwise the minimum wait before retrying in milliseconds plus...
Definition moqctl.h:892
int has_redirect
1 when redirect is present (error_code == MOQCTL_ERR_REDIRECT).
Definition moqctl.h:896
moqctl_redirect redirect
Redirect target; valid iff has_redirect.
Definition moqctl.h:898
draft-ietf-moq-transport-19 SS10.5 REQUEST_OK.
Definition moqctl.h:858
wired_span track_properties
Unparsed Track Properties: the rest of the body (view).
Definition moqctl.h:862
moqctl_params params
Parameters (MOQCTL_PCTX_REQUEST_OK_ANY context).
Definition moqctl.h:860
draft-ietf-moq-transport-19 SS10.4 SETUP: Setup Options are a KVP list (unknown options ignored on de...
Definition moqctl.h:751
wired_span implementation
MOQT_IMPLEMENTATION value (view); untrusted text, see moqctl_reason.
Definition moqctl.h:764
int has_path
1 when the PATH option was present.
Definition moqctl.h:753
u64 max_filter_ranges
MAX_FILTER_RANGES (SS10.4): Ranges the sender accepts concurrently across one request's Range filter ...
Definition moqctl.h:768
int has_authority
1 when the AUTHORITY option was present.
Definition moqctl.h:757
wired_span authority
AUTHORITY option value (view).
Definition moqctl.h:759
u8 has_ssts
1 when a well-formed SSTS_ALGORITHMS option is present.
Definition moqctl.h:783
u64 ssts_algs[MOQCTL_SSTS_MAX_ALGS]
SSTS_ALGORITHMS (experimental, moqtail): has_ssts when the option was present and well-formed (a malf...
Definition moqctl.h:779
int has_implementation
1 when the MOQT_IMPLEMENTATION option was present.
Definition moqctl.h:761
u8 ssts_alg_n
Number of ids used in ssts_algs.
Definition moqctl.h:781
wired_span path
PATH option value (view): the MOQT URI path on raw QUIC.
Definition moqctl.h:755
u64 max_request_updates
MAX_REQUEST_UPDATES (SS10.4): outstanding REQUEST_UPDATEs the sender accepts per request stream; the ...
Definition moqctl.h:772
SWITCHING_SET_ASSIGNMENT value (moqtail SSTS): puts the subscription into switching set set_id.
Definition moqctl.h:666
u64 activate
Member count at which the set becomes active; 0 never activates.
Definition moqctl.h:677
u64 algorithm_id
Selection algorithm, one of MOQCTL_SSTS_ALG_*.
Definition moqctl.h:670
u64 weight
Member weight, 1..10.
Definition moqctl.h:675
u64 set_id
Switching set the subscription joins (subscriber-chosen ID).
Definition moqctl.h:668
u8 has_rank
1 when the optional trailing Rank byte was present on the wire.
Definition moqctl.h:682
u8 rank
Set rank: active sets of equal rank are switched together; valid iff has_rank, 0 otherwise.
Definition moqctl.h:680
u64 threshold_kbps
Estimated bandwidth in kbit/s at or above which this member is eligible for selection.
Definition moqctl.h:673
draft-ietf-moq-transport-19 SS10.7 SUBSCRIBE_OK.
Definition moqctl.h:815
u64 track_alias
Track Alias the publisher assigned; data streams carry it in place of the Full Track Name.
Definition moqctl.h:818
moqctl_params params
Parameters (SUBSCRIBE_OK context).
Definition moqctl.h:820
wired_span track_properties
Unparsed Track Properties: the rest of the body (view).
Definition moqctl.h:822
draft-ietf-moq-transport-19 SS10.6 SUBSCRIBE.
Definition moqctl.h:796
moqctl_params params
Parameters (SUBSCRIBE context).
Definition moqctl.h:802
u64 request_id
Request ID the sender allocated for this subscription.
Definition moqctl.h:798
moqctl_ftn name
Full Track Name subscribed to.
Definition moqctl.h:800
SWITCH_FROM value (moqtail): activate this subscription and stop the one with request_id.
Definition moqctl.h:655
u8 publish_done
Flags bit 0x80: end the old subscription with PUBLISH_DONE.
Definition moqctl.h:661
u8 mode
MOQCTL_SWITCH_HARD / MOQCTL_SWITCH_SOFT.
Definition moqctl.h:659
u64 request_id
Request ID of the subscription being switched away from.
Definition moqctl.h:657
draft-ietf-moq-transport-19 SS10.2.2 Token structure: Alias Type selects which of the optional fields...
Definition moqctl.h:642
u64 alias_type
Alias Type, one of MOQCTL_TOKEN_*.
Definition moqctl.h:644
u64 token_type
Token Type (registry value); present for REGISTER / USE_VALUE.
Definition moqctl.h:648
u64 alias
Token Alias; present for DELETE / REGISTER / USE_ALIAS.
Definition moqctl.h:646
wired_span value
Opaque Token Value (view); present for REGISTER / USE_VALUE.
Definition moqctl.h:650
Mutable view of a byte range.
Definition span.h:42
Read-only view of a byte range.
Definition span.h:30
Linux direct syscalls.
unsigned int u32
unsigned 32-bit integer
Definition types.h:15
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