wired
libc-free QUIC/HTTP3 SDK in C for x86_64-linux
Loading...
Searching...
No Matches
moqfetch.h
Go to the documentation of this file.
1#ifndef MOQFETCH_H
2#define MOQFETCH_H
3
5
21
23#define MOQFETCH_T_FETCH 0x16ULL
25#define MOQFETCH_T_FETCH_OK 0x18ULL
26
29#define MOQFETCH_ERR_INVALID_JOINING_REQUEST_ID \
30 MOQCTL_ERR_INVALID_JOINING_REQUEST_ID
31
33#define MOQFETCH_STANDALONE 0x1ULL
36#define MOQFETCH_RELATIVE_JOINING 0x2ULL
38#define MOQFETCH_ABSOLUTE_JOINING 0x3ULL
39
67
81
111
118
123
138
161
166
171
186
192int moqfetch_ok_take(int ver, wired_span body, moqfetch_ok* out);
200
203#define MOQFETCH_OBJ_GROUP_END (~0ULL)
204
211
216
222
225int moqfetch_hdr_take(wired_span buf, usz* off, u64* request_id);
231int moqfetch_hdr_put(wired_mspan buf, usz* off, u64 request_id);
232
234#define MOQFETCH_F_SUBGROUP_MASK 0x03ULL
236#define MOQFETCH_F_OBJECT 0x04ULL
238#define MOQFETCH_F_GROUP 0x08ULL
240#define MOQFETCH_F_PRIORITY 0x10ULL
242#define MOQFETCH_F_PROPS 0x20ULL
244#define MOQFETCH_F_DATAGRAM 0x40ULL
246#define MOQFETCH_EOR_NONEXISTENT 0x8CULL
248#define MOQFETCH_EOR_UNKNOWN 0x10CULL
251#define MOQFETCH_EOR_TIMED_OUT 0x20CULL
252
278
305
313 wired_span buf, usz* off, moqfetch_seq* seq, moqfetch_obj* out);
314
320 wired_mspan buf, usz* off, moqfetch_seq* seq, const moqfetch_obj* o);
321
328 wired_span buf, usz* off, moqfetch_seq* seq, moqfetch_obj* out);
329
334 wired_mspan buf, usz* off, moqfetch_seq* seq, const moqfetch_obj* o);
335
336#endif
draft-ietf-moq-transport-19 SS10 Control Messages: common envelope (Type + 16-bit Length + Body),...
moqctl_loc moqfetch_end19_incl(moqctl_loc wire)
draft-19 End Location (last Object + 1, Object 0 = whole group) to the inclusive model and back (draf...
int moqfetch_obj_put_head(wired_mspan buf, usz *off, moqfetch_seq *seq, const moqfetch_obj *o)
moqfetch_obj_put without the payload bytes: the fields and a Payload Length of o->payload....
int moqfetch_req22_take(wired_span body, moqfetch_req *out)
Decodes a draft-22 FETCH body (SS "FETCH"): Request ID, Track Namespace, Track Name,...
int moqfetch_obj_take_head(wired_span buf, usz *off, moqfetch_seq *seq, moqfetch_obj *out)
moqfetch_obj_take for an Object whose payload may not all be in buf yet: MOQCTL_OK once every field t...
int moqfetch_fill_put(wired_mspan buf, usz *off, const moqfetch_fill *f)
Encodes f as a FILL_PARAMETERS value; a fill without a filter sends LOCATION_FILTER type 0x00 (SS9....
int moqfetch_ok_take(int ver, wired_span body, moqfetch_ok *out)
Decodes a FETCH_OK body in draft ver's layout.
int moqfetch_ok_encode(wired_mspan buf, usz *off, const moqfetch_ok *m)
Encodes m as a FETCH_OK body with m->end written as is (draft-22 inclusive form; moqfetch_ok19_encode...
int moqfetch_fetch_take(int ver, wired_span body, moqfetch_fetch *out)
Decodes a FETCH body in draft ver's layout (standalone vs joining fields chosen by Fetch Type).
int moqfetch_obj_put(wired_mspan buf, usz *off, moqfetch_seq *seq, const moqfetch_obj *o)
Encodes o with the wire fields o->flags selects (deltas computed from *seq), then advances *seq exact...
int moqfetch_obj_take(wired_span buf, usz *off, moqfetch_seq *seq, moqfetch_obj *out)
Decodes one fetch Object / End of Range and advances *seq.
int moqfetch_hdr_take(wired_span buf, usz *off, u64 *request_id)
FETCH_HEADER (11.4.4 Figure 26): Type 0x5 then Request ID.
int moqfetch_hdr_put(wired_mspan buf, usz *off, u64 request_id)
Writes FETCH_HEADER (Type 0x5, Request ID) at *off.
moqctl_loc moqfetch_end19_wire(moqctl_loc incl)
Inverse of moqfetch_end19_incl: inclusive end to the draft-19 wire End Location (MOQFETCH_OBJ_GROUP_E...
int moqfetch_req19_encode(wired_mspan buf, usz *off, const moqfetch_req *m)
Encodes m as a draft-19 FETCH body.
int moqfetch_fill_take(wired_span value, moqfetch_fill *out)
Decodes a FILL_PARAMETERS value (a zero-length one is "noparameters").
int moqfetch_req22_encode(wired_mspan buf, usz *off, const moqfetch_req *m)
Encodes m as a draft-22 FETCH body; range goes out as a LOCATION_FILTER parameter (SS9....
int moqfetch_ok19_encode(wired_mspan buf, usz *off, const moqfetch_ok *m)
FETCH_OK encode with m->end held inclusive, converted to the draft-19 wire form (moqfetch_end19_wire)...
moqctl_loc moqfetch_req_end(const moqctl_rangeloc *r, moqctl_loc largest)
The inclusive end of a FETCH range r, in the same model: a whole end group (MOQCTL_REK_GROUP) is Obje...
int moqfetch_req19_take(int ver, wired_span body, moqfetch_req *out)
Decodes a draft-19 FETCH body (10.12) into the version-neutral model.
int moqfetch_fetch_encode(wired_mspan buf, usz *off, const moqfetch_fetch *m)
Encodes m as a FETCH body (no type/length framing) at *off.
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
A decoded/to-encode Message Parameter list.
Definition moqctl.h:716
Version-neutral LOCATION_FILTER range.
Definition moqctl.h:472
FETCH (10.12.3 Figure 15).
Definition moqfetch.h:45
moqctl_loc start
Start Location (Standalone only).
Definition moqfetch.h:55
u64 fetch_type
Fetch Type: MOQFETCH_STANDALONE / _RELATIVE_JOINING / _ABSOLUTE_JOINING.
Definition moqfetch.h:50
u64 request_id
Request ID of this FETCH.
Definition moqfetch.h:47
u64 joining_request_id
Request ID of the subscription joined (Joining Fetches only).
Definition moqfetch.h:60
moqctl_loc end
End Location as on the wire: last Object + 1, Object 0 = whole End Group (Standalone only).
Definition moqfetch.h:58
moqctl_params params
Message Parameters (FETCH scope).
Definition moqfetch.h:65
u64 joining_start
Joining Start: groups back from the joined Largest Group (Relative) or an absolute Group ID (Absolute...
Definition moqfetch.h:63
moqctl_ftn track
Track Namespace + Track Name (Standalone only); views into the decoded body.
Definition moqfetch.h:53
draft-22 SS9.20.15 FILL_PARAMETERS value (Number of Parameters + Parameters, the FETCH parameter scop...
Definition moqfetch.h:146
int descending
1 iff GROUP_ORDER is Descending (0x2).
Definition moqfetch.h:155
int has_filter
1 iff a LOCATION_FILTER with a range (type != 0x00) was carried.
Definition moqfetch.h:151
int inherit
1 iff the value carries parameters but no LOCATION_FILTER: the fill range is the subscription's own L...
Definition moqfetch.h:149
moqctl_rangeloc range
The fill range; valid iff has_filter.
Definition moqfetch.h:153
u64 timeout_ms
FILL_TIMEOUT in milliseconds; valid iff has_timeout.
Definition moqfetch.h:159
int has_timeout
1 iff FILL_TIMEOUT was carried.
Definition moqfetch.h:157
One fetch Object or End of Range marker, with every field resolved to its absolute value.
Definition moqfetch.h:284
u64 group
Absolute Group ID.
Definition moqfetch.h:288
int has_props
1 iff Object Properties were carried (MOQFETCH_F_PROPS).
Definition moqfetch.h:298
u64 flags
Serialization Flags (MOQFETCH_F_* bits, or MOQFETCH_EOR_*).
Definition moqfetch.h:286
wired_span payload
Object payload; view into the stream buffer.
Definition moqfetch.h:303
wired_span props
Object Properties' KVP bytes without the Length; view into the stream buffer.
Definition moqfetch.h:301
u64 object
Absolute Object ID.
Definition moqfetch.h:290
u64 priority
Publisher Priority (explicit or inherited from the prior Object).
Definition moqfetch.h:296
int has_subgroup
1 iff the Object has a Subgroup ID (not Datagram-preference).
Definition moqfetch.h:292
u64 subgroup
Subgroup ID; valid iff has_subgroup.
Definition moqfetch.h:294
FETCH_OK (10.13 Figure 16).
Definition moqfetch.h:173
u64 end_of_track
End Of Track byte: 1 when the track has ended and End Location is its final Object,...
Definition moqfetch.h:176
moqctl_loc end
End Location: draft-19 wire form (last Object + 1) from moqfetch_ok_take, inclusive in draft-22.
Definition moqfetch.h:179
wired_span track_properties
Track Properties: the body bytes after Parameters (view into the decoded body).
Definition moqfetch.h:184
moqctl_params params
Message Parameters (FETCH_OK scope).
Definition moqfetch.h:181
Version-neutral FETCH request, an upper set of draft-19's Standalone + Joining split and draft-22's s...
Definition moqfetch.h:91
moqctl_ftn track
Track Namespace + Track Name (views into the decoded body); valid iff !is_joining.
Definition moqfetch.h:105
u64 joining_start
Joining Start (relative or absolute per fetch_type); valid iff is_joining.
Definition moqfetch.h:102
int is_joining
1 for a draft-19 Relative/Absolute Joining Fetch.
Definition moqfetch.h:97
moqctl_params params
Message Parameters (FETCH scope).
Definition moqfetch.h:109
u64 fetch_type
MOQFETCH_STANDALONE / _RELATIVE_JOINING / _ABSOLUTE_JOINING.
Definition moqfetch.h:95
u64 request_id
Request ID of this FETCH.
Definition moqfetch.h:93
u64 joining_request_id
Request ID of the joined subscription; valid iff is_joining.
Definition moqfetch.h:99
moqctl_rangeloc range
Requested Location range; valid iff !is_joining.
Definition moqfetch.h:107
The "prior Object" state threaded through one fetch stream.
Definition moqfetch.h:258
int have_loc
1 once a prior Object or End of Range set group/object.
Definition moqfetch.h:264
int eor_timed_out
1 iff the 0x20C End of Timed-Out Range marker is accepted.
Definition moqfetch.h:262
int have_priority
1 once a prior Object set priority.
Definition moqfetch.h:268
u64 object
Prior item's Object ID; valid iff have_loc.
Definition moqfetch.h:272
u64 priority
Last Object's Publisher Priority; valid iff have_priority.
Definition moqfetch.h:276
int descending
1 iff Group ID Deltas count downward (GROUP_ORDER Descending).
Definition moqfetch.h:260
u64 subgroup
Last Object's Subgroup ID; valid iff have_subgroup.
Definition moqfetch.h:274
u64 group
Prior item's Group ID; valid iff have_loc.
Definition moqfetch.h:270
int have_subgroup
1 iff the last Object (not End of Range) carried a Subgroup ID.
Definition moqfetch.h:266
Mutable view of a byte range.
Definition span.h:42
Read-only view of a byte range.
Definition span.h:30
u64 usz
unsigned size (size_t equivalent)
Definition types.h:20
unsigned long u64
unsigned 64-bit integer
Definition types.h:13