wired
libc-free QUIC/HTTP3 SDK in C for x86_64-linux
Loading...
Searching...
No Matches
moqdg.h File Reference

draft-ietf-moq-transport-18/19/22 datagram plane: OBJECT_DATAGRAM codec (18/19 11.3.1, 22 11.2.1; byte-identical in all three, no version). More...

Go to the source code of this file.

Data Structures

struct  moqdg_obj
 Decoded OBJECT_DATAGRAM (11.3.1). More...

Macros

#define MOQDG_HDR_MAX   29
 Worst-case encoded size of the fields before Properties / Status / Payload: Type(1) + Track Alias(9) + Group ID(9) + Object ID(9) + Priority(1) = 29.

Functions

int moqdg_type_valid (u64 type)
 OBJECT_DATAGRAM Type (11.3.1): 0b00X0XXXX, i.e.
int moqdg_take (wired_span buf, usz *off, moqdg_obj *out)
 Decodes one OBJECT_DATAGRAM spanning all of buf from *off.
int moqdg_put (wired_mspan buf, usz *off, const moqdg_obj *o)
 Encodes o at *off, minimal varints.

Detailed Description

draft-ietf-moq-transport-18/19/22 datagram plane: OBJECT_DATAGRAM codec (18/19 11.3.1, 22 11.2.1; byte-identical in all three, no version).

One datagram carries exactly one Object; the stream plane (SUBGROUP_HEADER, 11.4) lives in moqdata. Return codes are the shared MOQDATA_OK / MOQDATA_INSUFFICIENT / MOQDATA_VIOLATION.

Function Documentation

◆ moqdg_put()

int moqdg_put ( wired_mspan buf,
usz * off,
const moqdg_obj * o )

Encodes o at *off, minimal varints.

Same violation rules as moqdg_take applied to o before writing. Returns MOQDATA_OK/INSUFFICIENT/VIOLATION; on any outcome but OK, *off is left unchanged.

◆ moqdg_take()

int moqdg_take ( wired_span buf,
usz * off,
moqdg_obj * out )

Decodes one OBJECT_DATAGRAM spanning all of buf from *off.

Returns MOQDATA_OK/INSUFFICIENT/VIOLATION; on any outcome but OK, *off is left unchanged. VIOLATION covers (11.3.1): an invalid Type, the PROPERTIES bit with a Properties Length of 0, and STATUS + PROPERTIES with a non-Normal Status. out's spans borrow from buf.

◆ moqdg_type_valid()

int moqdg_type_valid ( u64 type)

OBJECT_DATAGRAM Type (11.3.1): 0b00X0XXXX, i.e.

0x00..0x0F and 0x20..0x2F, minus the values with both STATUS (0x20) and END_OF_GROUP (0x02) set (0x22/0x23/0x26/0x27/0x2A/0x2B/0x2E/0x2F). Type is a vi64: any value outside those ranges – including >= 0x100, whatever its low byte – is invalid.