Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Enumerations | Functions
moq.h File Reference

Media Over QUIC (MoQ) stack (headers) More...

#include <stddef.h>
#include <stdint.h>
#include <glib.h>
#include "../imquic/imquic.h"
#include "../imquic/moq.h"
#include "utils.h"
#include "refcount.h"
Include dependency graph for internal/moq.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  imquic_moq_parsed_setup_parameter
 Parsed MoQ setup parameter. More...
 
struct  imquic_moq_parsed_subscribe_parameter
 Parsed MoQ subscribe parameter. More...
 
struct  imquic_moq_location
 MoQ location. More...
 
struct  imquic_moq_context
 MoQ context. More...
 
struct  imquic_moq_buffer
 MoQ buffer. More...
 
struct  imquic_moq_stream
 MoQ stream. More...
 
struct  imquic_moq_subscription
 MoQ subscription, whether this is a publisher or a subscriber. More...
 
struct  imquic_moq_callbacks
 RoQ public callbacks. More...
 

Macros

#define IMQUIC_MOQ   7171953
 

Typedefs

typedef enum imquic_moq_error_code imquic_moq_error_code
 Generic error codes.
 
typedef enum imquic_moq_sub_error_code imquic_moq_sub_error_code
 Subscribe error codes.
 
typedef enum imquic_moq_sub_done_code imquic_moq_sub_done_code
 Subscribe done error codes.
 
typedef enum imquic_moq_message_type imquic_moq_message_type
 MoQ messages.
 
typedef enum imquic_moq_data_message_type imquic_moq_data_message_type
 MoQ data messages.
 
typedef enum imquic_moq_setup_parameter_type imquic_moq_setup_parameter_type
 MoQ setup parameters.
 
typedef enum imquic_moq_subscribe_parameter_type imquic_moq_subscribe_parameter_type
 MoQ subscribe parameters.
 
typedef enum imquic_moq_role_type imquic_moq_role_type
 MoQ roles.
 
typedef struct imquic_moq_parsed_setup_parameter imquic_moq_parsed_setup_parameter
 Parsed MoQ setup parameter.
 
typedef struct imquic_moq_parsed_subscribe_parameter imquic_moq_parsed_subscribe_parameter
 Parsed MoQ subscribe parameter.
 
typedef enum imquic_moq_location_mode imquic_moq_location_mode
 MoQ location modes.
 
typedef struct imquic_moq_location imquic_moq_location
 MoQ location.
 
typedef enum imquic_moq_filter_type imquic_moq_filter_type
 MoQ filter type.
 
typedef enum imquic_moq_group_order imquic_moq_group_order
 Group ordering for FETCH.
 
typedef struct imquic_moq_context imquic_moq_context
 MoQ context.
 
typedef struct imquic_moq_buffer imquic_moq_buffer
 MoQ buffer.
 
typedef struct imquic_moq_stream imquic_moq_stream
 MoQ stream.
 
typedef struct imquic_moq_subscription imquic_moq_subscription
 MoQ subscription, whether this is a publisher or a subscriber.
 
typedef struct imquic_moq_callbacks imquic_moq_callbacks
 RoQ public callbacks.
 

Enumerations

enum  imquic_moq_error_code {
  IMQUIC_MOQ_NO_ERROR = 0x0 , IMQUIC_MOQ_INTERNAL_ERROR = 0x1 , IMQUIC_MOQ_UNAUTHORIZED = 0x2 , IMQUIC_MOQ_PROTOCOL_VIOLATION = 0x3 ,
  IMQUIC_MOQ_DUPLICATE_TRACK_ALIAS = 0x4 , IMQUIC_MOQ_PARAMETER_LENGTH_MISMATCH = 0x5 , IMQUIC_MOQ_TOO_MANY_SUBSCRIBES = 0x6 , IMQUIC_MOQ_GOAWAY_TIMEOUT = 0x10
}
 Generic error codes. More...
 
enum  imquic_moq_sub_error_code {
  IMQUIC_MOQ_SUBERR_INTERNAL_ERROR = 0x0 , IMQUIC_MOQ_SUBERR_INVALID_RANGE = 0x1 , IMQUIC_MOQ_SUBERR_RETRY_TRACK_ALIAS = 0x2 , IMQUIC_MOQ_SUBERR_TRACK_DOES_NOT_EXIST = 0x3 ,
  IMQUIC_MOQ_SUBERR_UNAUTHORIZED = 0x4 , IMQUIC_MOQ_SUBERR_TIMEOUT = 0x5
}
 Subscribe error codes. More...
 
enum  imquic_moq_sub_done_code {
  IMQUIC_MOQ_SUBDONE_UNSUBSCRIBED = 0x0 , IMQUIC_MOQ_SUBDONE_INTERNAL_ERROR = 0x1 , IMQUIC_MOQ_SUBDONE_UNAUTHORIZED = 0x2 , IMQUIC_MOQ_SUBDONE_TRACK_ENDED = 0x3 ,
  IMQUIC_MOQ_SUBDONE_SUBSCRIPTION_ENDED = 0x4 , IMQUIC_MOQ_SUBDONE_GOING_AWAY = 0x5 , IMQUIC_MOQ_SUBDONE_EXPIRED = 0x6
}
 Subscribe done error codes. More...
 
enum  imquic_moq_message_type {
  IMQUIC_MOQ_SUBSCRIBE_UPDATE = 0x2 , IMQUIC_MOQ_SUBSCRIBE = 0x3 , IMQUIC_MOQ_SUBSCRIBE_OK = 0x4 , IMQUIC_MOQ_SUBSCRIBE_ERROR = 0x5 ,
  IMQUIC_MOQ_ANNOUNCE = 0x6 , IMQUIC_MOQ_ANNOUNCE_OK = 0x7 , IMQUIC_MOQ_ANNOUNCE_ERROR = 0x8 , IMQUIC_MOQ_UNANNOUNCE = 0x9 ,
  IMQUIC_MOQ_UNSUBSCRIBE = 0xa , IMQUIC_MOQ_SUBSCRIBE_DONE = 0xb , IMQUIC_MOQ_ANNOUNCE_CANCEL = 0xc , IMQUIC_MOQ_TRACK_STATUS_REQUEST = 0xd ,
  IMQUIC_MOQ_TRACK_STATUS = 0xe , IMQUIC_MOQ_GOAWAY = 0x10 , IMQUIC_MOQ_SUBSCRIBE_ANNOUNCES = 0x11 , IMQUIC_MOQ_SUBSCRIBE_ANNOUNCES_OK = 0x12 ,
  IMQUIC_MOQ_SUBSCRIBE_ANNOUNCES_ERROR = 0x13 , IMQUIC_MOQ_UNSUBSCRIBE_ANNOUNCES = 0x14 , IMQUIC_MOQ_MAX_SUBSCRIBE_ID = 0x15 , IMQUIC_MOQ_FETCH = 0x16 ,
  IMQUIC_MOQ_FETCH_CANCEL = 0x17 , IMQUIC_MOQ_FETCH_OK = 0x18 , IMQUIC_MOQ_FETCH_ERROR = 0x19 , IMQUIC_MOQ_CLIENT_SETUP = 0x40 ,
  IMQUIC_MOQ_SERVER_SETUP = 0x41
}
 MoQ messages. More...
 
enum  imquic_moq_data_message_type {
  IMQUIC_MOQ_OBJECT_STREAM = 0x0 , IMQUIC_MOQ_OBJECT_DATAGRAM = 0x1 , IMQUIC_MOQ_STREAM_HEADER_TRACK = 0x50 , IMQUIC_MOQ_STREAM_HEADER_TRACK_V06 = 0x2 ,
  IMQUIC_MOQ_STREAM_HEADER_GROUP = 0x51 , IMQUIC_MOQ_STREAM_HEADER_SUBGROUP = 0x4 , IMQUIC_MOQ_FETCH_HEADER = 0x5
}
 MoQ data messages. More...
 
enum  imquic_moq_setup_parameter_type { IMQUIC_MOQ_PARAM_ROLE = 0x00 , IMQUIC_MOQ_PARAM_PATH = 0x01 , IMQUIC_MOQ_PARAM_MAX_SUBSCRIBE_ID = 0x02 }
 MoQ setup parameters. More...
 
enum  imquic_moq_subscribe_parameter_type { IMQUIC_MOQ_PARAM_AUTHORIZATION_INFO = 0x02 , IMQUIC_MOQ_PARAM_DELIVERY_TIMEOUT = 0x03 , IMQUIC_MOQ_PARAM_MAX_CACHE_DURATION = 0x04 }
 MoQ subscribe parameters. More...
 
enum  imquic_moq_role_type { IMQUIC_MOQ_ROLE_PUBLISHER = 0x01 , IMQUIC_MOQ_ROLE_SUBSCRIBER = 0x02 , IMQUIC_MOQ_ROLE_PUBSUB = 0x03 }
 MoQ roles. More...
 
enum  imquic_moq_location_mode { IMQUIC_MOQ_LOCATION_NONE = 0x0 , IMQUIC_MOQ_LOCATION_ABSOLUTE = 0x1 , IMQUIC_MOQ_LOCATION_RELATIVEPREVIOUS = 0x2 , IMQUIC_MOQ_LOCATION_RELATIVENEXT = 0x3 }
 MoQ location modes. More...
 
enum  imquic_moq_filter_type { IMQUIC_MOQ_FILTER_LATEST_GROUP = 0x1 , IMQUIC_MOQ_FILTER_LATEST_OBJECT = 0x2 , IMQUIC_MOQ_FILTER_ABSOLUTE_START = 0x3 , IMQUIC_MOQ_FILTER_ABSOLUTE_RANGE = 0x4 }
 MoQ filter type. More...
 
enum  imquic_moq_group_order { IMQUIC_MOQ_ORDERING_ORIGINAL = 0x0 , IMQUIC_MOQ_ORDERING_ASCENDING = 0x1 , IMQUIC_MOQ_ORDERING_DESCENDING = 0x2 }
 Group ordering for FETCH. More...
 

Functions

void imquic_moq_init (void)
 Initialize the native MoQ stack at startup.
 
void imquic_moq_deinit (void)
 Uninitialize the native MoQ stack.
 
const char * imquic_moq_error_code_str (imquic_moq_error_code code)
 Helper function to serialize to string the name of a imquic_moq_error_code value.
 
const char * imquic_moq_sub_error_code_str (imquic_moq_sub_error_code code)
 Helper function to serialize to string the name of a imquic_moq_error_code value.
 
const char * imquic_moq_sub_done_code_str (imquic_moq_sub_done_code code)
 Helper function to serialize to string the name of a imquic_moq_sub_done_code value.
 
const char * imquic_moq_message_type_str (imquic_moq_message_type type)
 Helper function to serialize to string the name of a imquic_moq_message_type value.
 
const char * imquic_moq_data_message_type_str (imquic_moq_data_message_type type)
 Helper function to serialize to string the name of a imquic_moq_data_message_type value.
 
imquic_moq_delivery imquic_moq_data_message_type_to_delivery (imquic_moq_data_message_type type)
 Helper function to return the imquic_moq_delivery mode associated to a imquic_moq_data_message_type type.
 
const char * imquic_moq_setup_parameter_type_str (imquic_moq_setup_parameter_type type)
 Helper function to serialize to string the name of a imquic_moq_setup_parameter_type value.
 
const char * imquic_moq_subscribe_parameter_type_str (imquic_moq_subscribe_parameter_type type)
 Helper function to serialize to string the name of a imquic_moq_subscribe_parameter_type value.
 
const char * imquic_moq_role_type_str (imquic_moq_role_type type)
 Helper function to serialize to string the name of a imquic_moq_role_type value.
 
const char * imquic_moq_location_mode_str (imquic_moq_location_mode mode)
 Helper function to serialize to string the name of a imquic_moq_location_mode value.
 
const char * imquic_moq_filter_type_str (imquic_moq_filter_type type)
 Helper function to serialize to string the name of a imquic_moq_filter_type value.
 
const char * imquic_moq_group_order_str (imquic_moq_group_order type)
 Helper function to serialize to string the name of a imquic_moq_group_order value.
 
gboolean imquic_moq_buffer_resize (imquic_moq_buffer *buffer, uint64_t new_size)
 Resize an existing buffer.
 
void imquic_moq_buffer_append (imquic_moq_buffer *buffer, uint8_t *bytes, uint64_t length)
 Append data at the end of the buffer.
 
void imquic_moq_buffer_shift (imquic_moq_buffer *buffer, uint64_t length)
 Move the data in the buffer back of a specific number of bytes.
 
void imquic_moq_buffer_destroy (imquic_moq_buffer *buffer)
 Destroy an existing buffer.
 
void imquic_moq_stream_destroy (imquic_moq_stream *moq_stream)
 Destroy an existing MoQ stream.
 
imquic_moq_subscriptionimquic_moq_subscription_create (uint64_t subscribe_id, uint64_t track_alias)
 Helper to create a new subscription instance.
 
void imquic_moq_subscription_destroy (imquic_moq_subscription *moq_sub)
 Destroy an existing MoQ subscription.
 
Parsing MoQ messages
int imquic_moq_parse_message (imquic_moq_context *moq, uint64_t stream_id, uint8_t *bytes, size_t blen, gboolean complete, gboolean datagram)
 Parse an incoming MoQ message.
 
size_t imquic_moq_parse_client_setup (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
 Helper to parse a CLIENT_SETUP message.
 
size_t imquic_moq_parse_server_setup (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
 Helper to pars an SERVER_SETUP message.
 
size_t imquic_moq_parse_max_subscribe_id (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
 Helper to pars an MAX_SUBSCRIBE_ID message.
 
size_t imquic_moq_parse_announce (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
 Helper to parse an ANNOUNCE message.
 
size_t imquic_moq_parse_announce_ok (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
 Helper to parse an ANNOUNCE_OK message.
 
size_t imquic_moq_parse_announce_error (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
 Helper to parse an ANNOUNCE_ERROR message.
 
size_t imquic_moq_parse_unannounce (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
 Helper to parse an UNANNOUNCE message.
 
size_t imquic_moq_parse_announce_cancel (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
 Helper to parse an ANNOUNCE_CANCEL message.
 
size_t imquic_moq_parse_subscribe (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
 Helper to parse a SUBSCRIBE message.
 
size_t imquic_moq_parse_subscribe_update (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
 Helper to parse a SUBSCRIBE_UPDATE message.
 
size_t imquic_moq_parse_subscribe_ok (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
 Helper to parse a SUBSCRIBE_OK message.
 
size_t imquic_moq_parse_subscribe_error (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
 Helper to parse a SUBSCRIBE_ERROR message.
 
size_t imquic_moq_parse_unsubscribe (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
 Helper to parse an UNSUBSCRIBE message.
 
size_t imquic_moq_parse_subscribe_done (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
 Helper to parse a SUBSCRIBE_DONE message.
 
size_t imquic_moq_parse_subscribe_announces (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
 Helper to parse a SUBSCRIBE_ANNOUNCES message.
 
size_t imquic_moq_parse_subscribe_announces_ok (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
 Helper to parse a SUBSCRIBE_ANNOUNCES_OK message.
 
size_t imquic_moq_parse_subscribe_announces_error (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
 Helper to parse a SUBSCRIBE_ANNOUNCES_ERROR message.
 
size_t imquic_moq_parse_unsubscribe_announces (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
 Helper to parse an UNSUBSCRIBE_ANNOUNCES message.
 
size_t imquic_moq_parse_fetch (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
 Helper to parse a FETCH message.
 
size_t imquic_moq_parse_fetch_cancel (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
 Helper to parse a FETCH_CANCEL message.
 
size_t imquic_moq_parse_fetch_ok (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
 Helper to parse a FETCH_OK message.
 
size_t imquic_moq_parse_fetch_error (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
 Helper to parse a FETCH_ERROR message.
 
size_t imquic_moq_parse_track_status_request (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
 Helper to parse a TRACK_STATUS_REQUEST message.
 
size_t imquic_moq_parse_track_status (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
 Helper to parse a TRACK_STATUS message.
 
size_t imquic_moq_parse_object_stream (imquic_moq_context *moq, imquic_moq_stream *moq_stream, uint8_t *bytes, size_t blen, uint8_t *error)
 Helper to parse an OBJECT_STREAM message.
 
size_t imquic_moq_parse_object_datagram (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
 Helper to parse an OBJECT_DATAGRAM message.
 
size_t imquic_moq_parse_stream_header_track (imquic_moq_context *moq, imquic_moq_stream *moq_stream, uint8_t *bytes, size_t blen, uint8_t *error)
 Helper to parse a STREAM_HEADER_TRACK message.
 
int imquic_moq_parse_stream_header_track_object (imquic_moq_context *moq, imquic_moq_stream *moq_stream, gboolean complete)
 Helper to parse a STREAM_HEADER_TRACK object.
 
size_t imquic_moq_parse_stream_header_group (imquic_moq_context *moq, imquic_moq_stream *moq_stream, uint8_t *bytes, size_t blen, uint8_t *error)
 Helper to parse a STREAM_HEADER_GROUP message.
 
int imquic_moq_parse_stream_header_group_object (imquic_moq_context *moq, imquic_moq_stream *moq_stream, gboolean complete)
 Helper to parse a STREAM_HEADER_GROUP object.
 
size_t imquic_moq_parse_stream_header_subgroup (imquic_moq_context *moq, imquic_moq_stream *moq_stream, uint8_t *bytes, size_t blen, uint8_t *error)
 Helper to parse a STREAM_HEADER_SUBGROUP message.
 
int imquic_moq_parse_stream_header_subgroup_object (imquic_moq_context *moq, imquic_moq_stream *moq_stream, gboolean complete)
 Helper to parse a STREAM_HEADER_SUBGROUP object.
 
size_t imquic_moq_parse_fetch_header (imquic_moq_context *moq, imquic_moq_stream *moq_stream, uint8_t *bytes, size_t blen, uint8_t *error)
 Helper to parse a FETCH_HEADER message.
 
int imquic_moq_parse_fetch_header_object (imquic_moq_context *moq, imquic_moq_stream *moq_stream, gboolean complete)
 Helper to parse a FETCH_HEADER object.
 
size_t imquic_moq_parse_goaway (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
 Helper to parse a GOAWAY message.
 
Building MoQ messages
size_t imquic_moq_add_control_message (imquic_moq_context *moq, imquic_moq_message_type type, uint8_t *bytes, size_t blen, size_t poffset, size_t plen, size_t *start)
 Helper method to put a message header and a payload together.
 
size_t imquic_moq_add_client_setup (imquic_moq_context *moq, uint8_t *bytes, size_t blen, GList *supported_versions, size_t params_num, imquic_data *parameters)
 Helper method to add a CLIENT_SETUP message to a buffer.
 
size_t imquic_moq_add_server_setup (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint32_t version, size_t params_num, imquic_data *parameters)
 Helper method to add a SERVER_SETUP message to a buffer.
 
size_t imquic_moq_add_max_subscribe_id (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t max_subscribe_id)
 Helper method to add a MAX_SUBSCRIBE_ID message to a buffer.
 
size_t imquic_moq_add_announce (imquic_moq_context *moq, uint8_t *bytes, size_t blen, imquic_moq_namespace *track_namespace, size_t params_num, imquic_data *parameters)
 Helper method to add an ANNOUNCE message to a buffer.
 
size_t imquic_moq_add_announce_ok (imquic_moq_context *moq, uint8_t *bytes, size_t blen, imquic_moq_namespace *track_namespace)
 Helper method to add an ANNOUNCE_OK message to a buffer.
 
size_t imquic_moq_add_announce_error (imquic_moq_context *moq, uint8_t *bytes, size_t blen, imquic_moq_namespace *track_namespace, imquic_moq_error_code error, const char *reason)
 Helper method to add an ANNOUNCE_ERROR message to a buffer.
 
size_t imquic_moq_add_unannounce (imquic_moq_context *moq, uint8_t *bytes, size_t blen, imquic_moq_namespace *track_namespace)
 Helper method to add an UNANNOUNCE message to a buffer.
 
size_t imquic_moq_add_announce_cancel (imquic_moq_context *moq, uint8_t *bytes, size_t blen, imquic_moq_namespace *track_namespace)
 Helper method to add aN ANNOUNCE_CANCEL message to a buffer.
 
size_t imquic_moq_add_subscribe_v03 (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t subscribe_id, uint64_t track_alias, imquic_moq_namespace *track_namespace, imquic_moq_name *track_name, imquic_moq_location *start_group, imquic_moq_location *start_object, imquic_moq_location *end_group, imquic_moq_location *end_object, size_t params_num, imquic_data *parameters)
 Helper to add a SUBSCRIBE message (version -03 of the draft) to a buffer.
 
size_t imquic_moq_add_subscribe (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t subscribe_id, uint64_t track_alias, imquic_moq_namespace *track_namespace, imquic_moq_name *track_name, uint8_t priority, uint8_t group_order, imquic_moq_filter_type filter, uint64_t start_group, uint64_t start_object, uint64_t end_group, uint64_t end_object, size_t params_num, imquic_data *parameters)
 Helper to add a SUBSCRIBE message (any version of the draft except v03) to a buffer.
 
size_t imquic_moq_add_subscribe_update (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t subscribe_id, uint64_t start_group, uint64_t start_object, uint64_t end_group, uint64_t end_object, uint8_t priority, size_t params_num, imquic_data *parameters)
 Helper method to add a SUBSCRIBE_UPDATE message to a buffer.
 
size_t imquic_moq_add_subscribe_ok (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t subscribe_id, uint64_t expires, imquic_moq_group_order group_order, gboolean content_exists, uint64_t largest_group_id, uint64_t largest_object_id, size_t params_num, imquic_data *parameters)
 Helper method to add a SUBSCRIBE_OK message to a buffer.
 
size_t imquic_moq_add_subscribe_error (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t subscribe_id, imquic_moq_sub_error_code error, const char *reason, uint64_t track_alias)
 Helper method to add a SUBSCRIBE_ERRROR message to a buffer.
 
size_t imquic_moq_add_unsubscribe (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t subscribe_id)
 Helper method to add an UNSUBSCRIBE message to a buffer.
 
size_t imquic_moq_add_subscribe_done (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t subscribe_id, imquic_moq_sub_done_code status, const char *reason, gboolean content_exists, uint64_t final_group, uint64_t final_object)
 Helper method to add a SUBSCRIBE_DONE message to a buffer.
 
size_t imquic_moq_add_subscribe_announces (imquic_moq_context *moq, uint8_t *bytes, size_t blen, imquic_moq_namespace *track_namespace, size_t params_num, imquic_data *parameters)
 Helper to add a SUBSCRIBE_ANNOUNCES message (version -04 of the draft) to a buffer.
 
size_t imquic_moq_add_subscribe_announces_ok (imquic_moq_context *moq, uint8_t *bytes, size_t blen, imquic_moq_namespace *track_namespace)
 Helper method to add a SUBSCRIBE_ANNOUNCES_OK message to a buffer.
 
size_t imquic_moq_add_subscribe_announces_error (imquic_moq_context *moq, uint8_t *bytes, size_t blen, imquic_moq_namespace *track_namespace, imquic_moq_error_code error, const char *reason)
 Helper method to add a SUBSCRIBE_ANNOUNCES_ERRROR message to a buffer.
 
size_t imquic_moq_add_unsubscribe_announces (imquic_moq_context *moq, uint8_t *bytes, size_t blen, imquic_moq_namespace *track_namespace)
 Helper method to add an UNSUBSCRIBE_ANNOUNCES message to a buffer.
 
size_t imquic_moq_add_fetch (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t subscribe_id, imquic_moq_namespace *track_namespace, imquic_moq_name *track_name, uint8_t priority, imquic_moq_group_order group_order, uint64_t start_group, uint64_t start_object, uint64_t end_group, uint64_t end_object, size_t params_num, imquic_data *parameters)
 Helper to add a FETCH message (any version of the draft except v03) to a buffer.
 
size_t imquic_moq_add_fetch_cancel (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t subscribe_id)
 Helper method to add an FETCH_CANCEL message to a buffer.
 
size_t imquic_moq_add_fetch_ok (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t subscribe_id, uint8_t group_order, uint8_t end_of_track, uint64_t largest_group_id, uint64_t largest_object_id, size_t params_num, imquic_data *parameters)
 Helper method to add a FETCH_OK message to a buffer.
 
size_t imquic_moq_add_fetch_error (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t subscribe_id, imquic_moq_sub_error_code error, const char *reason)
 Helper method to add a FETCH_ERRROR message to a buffer.
 
size_t imquic_moq_add_track_status_request (imquic_moq_context *moq, uint8_t *bytes, size_t blen, imquic_moq_namespace *track_namespace, imquic_moq_name *track_name)
 Helper to add a TRACK_STATUS_REQUEST message to a buffer.
 
size_t imquic_moq_add_track_status (imquic_moq_context *moq, uint8_t *bytes, size_t blen, imquic_moq_namespace *track_namespace, imquic_moq_name *track_name, uint64_t status_code, uint64_t last_group_id, uint64_t last_object_id)
 Helper to add a TRACK_STATUS message to a buffer.
 
size_t imquic_moq_add_object_stream (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t subscribe_id, uint64_t track_alias, uint64_t group_id, uint64_t object_id, uint64_t object_status, uint64_t object_send_order, uint8_t priority, uint8_t *payload, size_t plen)
 Helper to add an OBJECT_STREAM message to a buffer (only before v06)
 
size_t imquic_moq_add_object_datagram (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t subscribe_id, uint64_t track_alias, uint64_t group_id, uint64_t object_id, uint64_t object_status, uint64_t object_send_order, uint8_t priority, uint8_t *payload, size_t plen)
 Helper to add an OBJECT_DATAGRAM message to a buffer.
 
size_t imquic_moq_add_stream_header_track (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t subscribe_id, uint64_t track_alias, uint64_t object_send_order, uint8_t priority)
 Helper to add a STREAM_HEADER_TRACK message to a buffer (only before v06)
 
size_t imquic_moq_add_stream_header_track_object (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t group_id, uint64_t object_id, uint64_t object_status, uint8_t *payload, size_t plen)
 Helper to add an object to a buffer, formatted as expected for STREAM_HEADER_TRACK objects (so not all IDs) (only before v06)
 
size_t imquic_moq_add_stream_header_group (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t subscribe_id, uint64_t track_alias, uint64_t group_id, uint64_t object_send_order, uint8_t priority)
 Helper to add a STREAM_HEADER_GROUP message to a buffer (only before v06)
 
size_t imquic_moq_add_stream_header_group_object (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t object_id, uint64_t object_status, uint8_t *payload, size_t plen)
 Helper to add an object to a buffer, formatted as expected for STREAM_HEADER_GROUP objects (so not all IDs) (only before v06)
 
size_t imquic_moq_add_stream_header_subgroup (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t subscribe_id, uint64_t track_alias, uint64_t group_id, uint64_t subgroup_id, uint8_t priority)
 Helper to add a STREAM_HEADER_SUBGROUP message to a buffer (only after v06)
 
size_t imquic_moq_add_stream_header_subgroup_object (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t object_id, uint64_t object_status, uint8_t *payload, size_t plen)
 Helper to add an object to a buffer, formatted as expected for STREAM_HEADER_SUBGROUP objects (so not all IDs) (only after v06)
 
size_t imquic_moq_add_fetch_header (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t subscribe_id)
 Helper to add a FETCH_HEADER message to a buffer (only after v07)
 
size_t imquic_moq_add_fetch_header_object (imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t group_id, uint64_t subgroup_id, uint64_t object_id, uint8_t priority, uint64_t object_status, uint8_t *payload, size_t plen)
 Helper to add an object to a buffer, formatted as expected for FETCH_HEADER objects (so not all IDs) (only before v06)
 
size_t imquic_moq_add_goaway (imquic_moq_context *moq, uint8_t *bytes, size_t blen, imquic_data *new_session_uri)
 Helper method to add a GOAWAY message to a buffer.
 
Parsing and building MoQ parameters
size_t imquic_moq_parse_setup_parameter (imquic_moq_context *moq, uint8_t *bytes, size_t blen, imquic_moq_parsed_setup_parameter *param, uint8_t *error)
 Helper method to parse a MoQ setup parameter.
 
size_t imquic_moq_parse_subscribe_parameter (imquic_moq_context *moq, uint8_t *bytes, size_t blen, imquic_moq_parsed_subscribe_parameter *param, uint8_t *error)
 Helper method to parse a MoQ subscribe parameter.
 
size_t imquic_moq_parameter_add_int (imquic_moq_context *moq, uint8_t *bytes, size_t blen, int param, uint64_t number)
 Helper to add a MoQ (setup or subscribe) parameter with a numeric value to a buffer.
 
size_t imquic_moq_parameter_add_data (imquic_moq_context *moq, uint8_t *bytes, size_t blen, int param, uint8_t *buf, size_t buflen)
 Helper to add a MoQ (setup or subscribe) parameter with generic data to a buffer.
 
Internal callbacks for MoQ endpoints
void imquic_moq_new_connection (imquic_connection *conn, void *user_data)
 Callback the core invokes when a new QUIC connection using MoQ is available.
 
void imquic_moq_stream_incoming (imquic_connection *conn, uint64_t stream_id, uint8_t *bytes, uint64_t offset, uint64_t length, gboolean complete)
 Callback the core invokes when there's new incoming data on a STREAM.
 
void imquic_moq_datagram_incoming (imquic_connection *conn, uint8_t *bytes, uint64_t length)
 Callback the core invokes when there's new incoming data on a DATAGRAM.
 
void imquic_moq_connection_gone (imquic_connection *conn)
 Callback the core invokes when an existing MoQ connection is not available anymore.
 

Detailed Description

Media Over QUIC (MoQ) stack (headers)

Author
Lorenzo Miniero loren.nosp@m.zo@m.nosp@m.eetec.nosp@m.ho.c.nosp@m.om

Implementation of the Media Over QUIC (MoQ) stack as part of the library itself. At the time of writing, this implements (most of) versions -03 and -04 of the protocol.

Note
This is the internal implementation of MoQ in the library. You're still free to only use imquic as the underlying QUIC/WebTransport library, and take care of the MoQ implementation on your own instead: in order to do that, use the generic imquic client/server creation utilities, rather than the MoQ specific ones.

Macro Definition Documentation

◆ IMQUIC_MOQ

#define IMQUIC_MOQ   7171953

Typedef Documentation

◆ imquic_moq_buffer

typedef struct imquic_moq_buffer imquic_moq_buffer

MoQ buffer.

◆ imquic_moq_callbacks

typedef struct imquic_moq_callbacks imquic_moq_callbacks

RoQ public callbacks.

◆ imquic_moq_context

typedef struct imquic_moq_context imquic_moq_context

MoQ context.

◆ imquic_moq_data_message_type

MoQ data messages.

◆ imquic_moq_error_code

Generic error codes.

◆ imquic_moq_filter_type

MoQ filter type.

Note
Only supported in version -04 of the protocol

◆ imquic_moq_group_order

Group ordering for FETCH.

Note
Only supported since version -07 of the protocol

◆ imquic_moq_location

typedef struct imquic_moq_location imquic_moq_location

MoQ location.

◆ imquic_moq_location_mode

MoQ location modes.

◆ imquic_moq_message_type

MoQ messages.

◆ imquic_moq_parsed_setup_parameter

typedef struct imquic_moq_parsed_setup_parameter imquic_moq_parsed_setup_parameter

Parsed MoQ setup parameter.

◆ imquic_moq_parsed_subscribe_parameter

typedef struct imquic_moq_parsed_subscribe_parameter imquic_moq_parsed_subscribe_parameter

Parsed MoQ subscribe parameter.

◆ imquic_moq_role_type

MoQ roles.

◆ imquic_moq_setup_parameter_type

MoQ setup parameters.

◆ imquic_moq_stream

typedef struct imquic_moq_stream imquic_moq_stream

MoQ stream.

◆ imquic_moq_sub_done_code

Subscribe done error codes.

◆ imquic_moq_sub_error_code

Subscribe error codes.

◆ imquic_moq_subscribe_parameter_type

MoQ subscribe parameters.

◆ imquic_moq_subscription

typedef struct imquic_moq_subscription imquic_moq_subscription

MoQ subscription, whether this is a publisher or a subscriber.

Enumeration Type Documentation

◆ imquic_moq_data_message_type

MoQ data messages.

Enumerator
IMQUIC_MOQ_OBJECT_STREAM 
IMQUIC_MOQ_OBJECT_DATAGRAM 
IMQUIC_MOQ_STREAM_HEADER_TRACK 
IMQUIC_MOQ_STREAM_HEADER_TRACK_V06 
IMQUIC_MOQ_STREAM_HEADER_GROUP 
IMQUIC_MOQ_STREAM_HEADER_SUBGROUP 
IMQUIC_MOQ_FETCH_HEADER 

◆ imquic_moq_error_code

Generic error codes.

Enumerator
IMQUIC_MOQ_NO_ERROR 
IMQUIC_MOQ_INTERNAL_ERROR 
IMQUIC_MOQ_UNAUTHORIZED 
IMQUIC_MOQ_PROTOCOL_VIOLATION 
IMQUIC_MOQ_DUPLICATE_TRACK_ALIAS 
IMQUIC_MOQ_PARAMETER_LENGTH_MISMATCH 
IMQUIC_MOQ_TOO_MANY_SUBSCRIBES 
IMQUIC_MOQ_GOAWAY_TIMEOUT 

◆ imquic_moq_filter_type

MoQ filter type.

Note
Only supported in version -04 of the protocol
Enumerator
IMQUIC_MOQ_FILTER_LATEST_GROUP 
IMQUIC_MOQ_FILTER_LATEST_OBJECT 
IMQUIC_MOQ_FILTER_ABSOLUTE_START 
IMQUIC_MOQ_FILTER_ABSOLUTE_RANGE 

◆ imquic_moq_group_order

Group ordering for FETCH.

Note
Only supported since version -07 of the protocol
Enumerator
IMQUIC_MOQ_ORDERING_ORIGINAL 
IMQUIC_MOQ_ORDERING_ASCENDING 
IMQUIC_MOQ_ORDERING_DESCENDING 

◆ imquic_moq_location_mode

MoQ location modes.

Enumerator
IMQUIC_MOQ_LOCATION_NONE 
IMQUIC_MOQ_LOCATION_ABSOLUTE 
IMQUIC_MOQ_LOCATION_RELATIVEPREVIOUS 
IMQUIC_MOQ_LOCATION_RELATIVENEXT 

◆ imquic_moq_message_type

MoQ messages.

Enumerator
IMQUIC_MOQ_SUBSCRIBE_UPDATE 
IMQUIC_MOQ_SUBSCRIBE 
IMQUIC_MOQ_SUBSCRIBE_OK 
IMQUIC_MOQ_SUBSCRIBE_ERROR 
IMQUIC_MOQ_ANNOUNCE 
IMQUIC_MOQ_ANNOUNCE_OK 
IMQUIC_MOQ_ANNOUNCE_ERROR 
IMQUIC_MOQ_UNANNOUNCE 
IMQUIC_MOQ_UNSUBSCRIBE 
IMQUIC_MOQ_SUBSCRIBE_DONE 
IMQUIC_MOQ_ANNOUNCE_CANCEL 
IMQUIC_MOQ_TRACK_STATUS_REQUEST 
IMQUIC_MOQ_TRACK_STATUS 
IMQUIC_MOQ_GOAWAY 
IMQUIC_MOQ_SUBSCRIBE_ANNOUNCES 
IMQUIC_MOQ_SUBSCRIBE_ANNOUNCES_OK 
IMQUIC_MOQ_SUBSCRIBE_ANNOUNCES_ERROR 
IMQUIC_MOQ_UNSUBSCRIBE_ANNOUNCES 
IMQUIC_MOQ_MAX_SUBSCRIBE_ID 
IMQUIC_MOQ_FETCH 
IMQUIC_MOQ_FETCH_CANCEL 
IMQUIC_MOQ_FETCH_OK 
IMQUIC_MOQ_FETCH_ERROR 
IMQUIC_MOQ_CLIENT_SETUP 
IMQUIC_MOQ_SERVER_SETUP 

◆ imquic_moq_role_type

MoQ roles.

Enumerator
IMQUIC_MOQ_ROLE_PUBLISHER 
IMQUIC_MOQ_ROLE_SUBSCRIBER 
IMQUIC_MOQ_ROLE_PUBSUB 

◆ imquic_moq_setup_parameter_type

MoQ setup parameters.

Enumerator
IMQUIC_MOQ_PARAM_ROLE 
IMQUIC_MOQ_PARAM_PATH 
IMQUIC_MOQ_PARAM_MAX_SUBSCRIBE_ID 

◆ imquic_moq_sub_done_code

Subscribe done error codes.

Enumerator
IMQUIC_MOQ_SUBDONE_UNSUBSCRIBED 
IMQUIC_MOQ_SUBDONE_INTERNAL_ERROR 
IMQUIC_MOQ_SUBDONE_UNAUTHORIZED 
IMQUIC_MOQ_SUBDONE_TRACK_ENDED 
IMQUIC_MOQ_SUBDONE_SUBSCRIPTION_ENDED 
IMQUIC_MOQ_SUBDONE_GOING_AWAY 
IMQUIC_MOQ_SUBDONE_EXPIRED 

◆ imquic_moq_sub_error_code

Subscribe error codes.

Enumerator
IMQUIC_MOQ_SUBERR_INTERNAL_ERROR 
IMQUIC_MOQ_SUBERR_INVALID_RANGE 
IMQUIC_MOQ_SUBERR_RETRY_TRACK_ALIAS 
IMQUIC_MOQ_SUBERR_TRACK_DOES_NOT_EXIST 
IMQUIC_MOQ_SUBERR_UNAUTHORIZED 
IMQUIC_MOQ_SUBERR_TIMEOUT 

◆ imquic_moq_subscribe_parameter_type

MoQ subscribe parameters.

Enumerator
IMQUIC_MOQ_PARAM_AUTHORIZATION_INFO 
IMQUIC_MOQ_PARAM_DELIVERY_TIMEOUT 
IMQUIC_MOQ_PARAM_MAX_CACHE_DURATION 

Function Documentation

◆ imquic_moq_add_announce()

size_t imquic_moq_add_announce ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
imquic_moq_namespace * track_namespace,
size_t params_num,
imquic_data * parameters )

Helper method to add an ANNOUNCE message to a buffer.

Parameters
moqThe imquic_moq_context generating the message
bytesThe buffer to add the message to
blenThe size of the buffer
track_namespaceNamespace to announce
params_numNumber of parameters to add to the message, if any
parametersA buffer containing an already serialized list of parameters
Returns
The size of the generated message, if successful, or 0 otherwise

◆ imquic_moq_add_announce_cancel()

size_t imquic_moq_add_announce_cancel ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
imquic_moq_namespace * track_namespace )

Helper method to add aN ANNOUNCE_CANCEL message to a buffer.

Parameters
moqThe imquic_moq_context generating the message
bytesThe buffer to add the message to
blenThe size of the buffer
track_namespaceNamespace for which to cancel the announcement
Returns
The size of the generated message, if successful, or 0 otherwise

◆ imquic_moq_add_announce_error()

size_t imquic_moq_add_announce_error ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
imquic_moq_namespace * track_namespace,
imquic_moq_error_code error,
const char * reason )

Helper method to add an ANNOUNCE_ERROR message to a buffer.

Parameters
moqThe imquic_moq_context generating the message
bytesThe buffer to add the message to
blenThe size of the buffer
track_namespaceNamespace for which the announcement caused an error
errorError code associated to the message
reasonVerbose description of the error, if any
Returns
The size of the generated message, if successful, or 0 otherwise

◆ imquic_moq_add_announce_ok()

size_t imquic_moq_add_announce_ok ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
imquic_moq_namespace * track_namespace )

Helper method to add an ANNOUNCE_OK message to a buffer.

Parameters
moqThe imquic_moq_context generating the message
bytesThe buffer to add the message to
blenThe size of the buffer
track_namespaceNamespace for which the announcement succeeded
Returns
The size of the generated message, if successful, or 0 otherwise

◆ imquic_moq_add_client_setup()

size_t imquic_moq_add_client_setup ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
GList * supported_versions,
size_t params_num,
imquic_data * parameters )

Helper method to add a CLIENT_SETUP message to a buffer.

Parameters
moqThe imquic_moq_context generating the message
bytesThe buffer to add the message to
blenThe size of the buffer
supported_versionsList of supported versions
params_numNumber of parameters to add to the message, if any
parametersA buffer containing an already serialized list of parameters
Returns
The size of the generated message, if successful, or 0 otherwise

◆ imquic_moq_add_control_message()

size_t imquic_moq_add_control_message ( imquic_moq_context * moq,
imquic_moq_message_type type,
uint8_t * bytes,
size_t blen,
size_t poffset,
size_t plen,
size_t * start )

Helper method to put a message header and a payload together.

Note
All the "add" functions for control messages don't set the type in the buffer, since versions of MoQ later than v06 also envision a payload length varint: as such, we prepare the payload first, and prefix the message type (and optionally the payload length) later.
Parameters
[in]moqThe imquic_moq_context generating the message
[in]typeThe ID of the control message to send
[in]bytesThe buffer to add the control message to
[in]blenThe size of the buffer
[in]poffsetWhere in the provided buffer we already have the payload
[in]plenSize of the payload in the buffer
[out]startWhere the final control message starts, in the buffer
Returns
The size of the generated message, if successful, or 0 otherwise

◆ imquic_moq_add_fetch()

size_t imquic_moq_add_fetch ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint64_t subscribe_id,
imquic_moq_namespace * track_namespace,
imquic_moq_name * track_name,
uint8_t priority,
imquic_moq_group_order group_order,
uint64_t start_group,
uint64_t start_object,
uint64_t end_group,
uint64_t end_object,
size_t params_num,
imquic_data * parameters )

Helper to add a FETCH message (any version of the draft except v03) to a buffer.

Note
This sends the -04 or -05 variant of the message
Parameters
moqThe imquic_moq_context generating the message
bytesThe buffer to add the message to
blenThe size of the buffer
subscribe_idThe subscription ID to put in the message
track_namespaceThe namespace to put in the message
track_nameThe track name to put in the message
priorityThe fetchr priority to put in the message
group_orderThe group order to put in the message
start_groupThe start group ID to put in the message
start_objectThe start object ID to put in the message
end_groupThe end group ID to put in the message
end_objectThe end object ID to put in the message
params_numNumber of parameters to add to the message, if any
parametersA buffer containing an already serialized list of parameters
Returns
The size of the generated message, if successful, or 0 otherwise

◆ imquic_moq_add_fetch_cancel()

size_t imquic_moq_add_fetch_cancel ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint64_t subscribe_id )

Helper method to add an FETCH_CANCEL message to a buffer.

Parameters
moqThe imquic_moq_context generating the message
bytesThe buffer to add the message to
blenThe size of the buffer
subscribe_idThe subscription ID to put in the message
Returns
The size of the generated message, if successful, or 0 otherwise

◆ imquic_moq_add_fetch_error()

size_t imquic_moq_add_fetch_error ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint64_t subscribe_id,
imquic_moq_sub_error_code error,
const char * reason )

Helper method to add a FETCH_ERRROR message to a buffer.

Parameters
moqThe imquic_moq_context generating the message
bytesThe buffer to add the message to
blenThe size of the buffer
subscribe_idThe subscription ID to put in the message
errorError code associated to the message
reasonVerbose description of the error, if any
Returns
The size of the generated message, if successful, or 0 otherwise

◆ imquic_moq_add_fetch_header()

size_t imquic_moq_add_fetch_header ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint64_t subscribe_id )

Helper to add a FETCH_HEADER message to a buffer (only after v07)

Note
This will create a new STREAM and send the header: after that, imquic_moq_add_fetch_header_object is used to send all objects that belong to this track.
Parameters
moqThe imquic_moq_context generating the message
bytesThe buffer to add the message to
blenThe size of the buffer
subscribe_idThe subscription ID to put in the message
Returns
The size of the generated message, if successful, or 0 otherwise

◆ imquic_moq_add_fetch_header_object()

size_t imquic_moq_add_fetch_header_object ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint64_t group_id,
uint64_t subgroup_id,
uint64_t object_id,
uint8_t priority,
uint64_t object_status,
uint8_t * payload,
size_t plen )

Helper to add an object to a buffer, formatted as expected for FETCH_HEADER objects (so not all IDs) (only before v06)

Parameters
moqThe imquic_moq_context generating the object
bytesThe buffer to add the object to
blenThe size of the buffer
group_idThe group ID
subgroup_idThe subgroup ID
object_idThe object ID
priorityThe publisher priority to put in the message
object_statusThe object status (only added if the payload length is 0)
payloadThe buffer containing the payload of the object
plenThe size of the payload buffer
Returns
The size of the generated object, if successful, or 0 otherwise

◆ imquic_moq_add_fetch_ok()

size_t imquic_moq_add_fetch_ok ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint64_t subscribe_id,
uint8_t group_order,
uint8_t end_of_track,
uint64_t largest_group_id,
uint64_t largest_object_id,
size_t params_num,
imquic_data * parameters )

Helper method to add a FETCH_OK message to a buffer.

Parameters
moqThe imquic_moq_context generating the message
bytesThe buffer to add the message to
blenThe size of the buffer
subscribe_idThe subscription ID to put in the message
group_orderThe group order to put in the message
end_of_trackWhether all objects have been published
largest_group_idLargest group ID to add to the message, if needed
largest_object_idLargest object ID to add to the message, if needed
params_numNumber of parameters to add to the message, if any
parametersA buffer containing an already serialized list of parameters
Returns
The size of the generated message, if successful, or 0 otherwise

◆ imquic_moq_add_goaway()

size_t imquic_moq_add_goaway ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
imquic_data * new_session_uri )

Helper method to add a GOAWAY message to a buffer.

Parameters
moqThe imquic_moq_context generating the message
bytesThe buffer to add the message to
blenThe size of the buffer
new_session_uriBuffer containint the new uri value to put in the message, if any
Returns
The size of the generated message, if successful, or 0 otherwise

◆ imquic_moq_add_max_subscribe_id()

size_t imquic_moq_add_max_subscribe_id ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint64_t max_subscribe_id )

Helper method to add a MAX_SUBSCRIBE_ID message to a buffer.

Parameters
moqThe imquic_moq_context generating the message
bytesThe buffer to add the message to
blenThe size of the buffer
max_subscribe_idMaximum subscribe ID to put in the message
Returns
The size of the generated message, if successful, or 0 otherwise

◆ imquic_moq_add_object_datagram()

size_t imquic_moq_add_object_datagram ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint64_t subscribe_id,
uint64_t track_alias,
uint64_t group_id,
uint64_t object_id,
uint64_t object_status,
uint64_t object_send_order,
uint8_t priority,
uint8_t * payload,
size_t plen )

Helper to add an OBJECT_DATAGRAM message to a buffer.

Note
This assumes the connection negotiated DATAGRAM support
Parameters
moqThe imquic_moq_context generating the message
bytesThe buffer to add the message to
blenThe size of the buffer
subscribe_idThe subscription ID to put in the message
track_aliasThe track alias to put in the message
group_idThe group ID to put in the message
object_idThe object ID to put in the message
object_statusThe object status (only added if the payload length is 0)
object_send_orderThe object send order to put in the message (v03 and v04 only)
priorityThe publisher priority to put in the message (only after v05)
payloadThe buffer containing the payload of the object
plenThe size of the payload buffer
Returns
The size of the generated message, if successful, or 0 otherwise

◆ imquic_moq_add_object_stream()

size_t imquic_moq_add_object_stream ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint64_t subscribe_id,
uint64_t track_alias,
uint64_t group_id,
uint64_t object_id,
uint64_t object_status,
uint64_t object_send_order,
uint8_t priority,
uint8_t * payload,
size_t plen )

Helper to add an OBJECT_STREAM message to a buffer (only before v06)

Note
This will create a throaway STREAM just to send this object
Parameters
moqThe imquic_moq_context generating the message
bytesThe buffer to add the message to
blenThe size of the buffer
subscribe_idThe subscription ID to put in the message
track_aliasThe track alias to put in the message
group_idThe group ID to put in the message
object_idThe object ID to put in the message
object_statusThe object status (only added if the payload length is 0)
object_send_orderThe object send order to put in the message (v03 and v04 only)
priorityThe publisher priority to put in the message (only after v05)
payloadThe buffer containing the payload of the object
plenThe size of the payload buffer
Returns
The size of the generated message, if successful, or 0 otherwise

◆ imquic_moq_add_server_setup()

size_t imquic_moq_add_server_setup ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint32_t version,
size_t params_num,
imquic_data * parameters )

Helper method to add a SERVER_SETUP message to a buffer.

Parameters
moqThe imquic_moq_context generating the message
bytesThe buffer to add the message to
blenThe size of the buffer
versionNegotiated version
params_numNumber of parameters to add to the message, if any
parametersA buffer containing an already serialized list of parameters
Returns
The size of the generated message, if successful, or 0 otherwise

◆ imquic_moq_add_stream_header_group()

size_t imquic_moq_add_stream_header_group ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint64_t subscribe_id,
uint64_t track_alias,
uint64_t group_id,
uint64_t object_send_order,
uint8_t priority )

Helper to add a STREAM_HEADER_GROUP message to a buffer (only before v06)

Note
This will create a new STREAM and send the header: after that, imquic_moq_add_stream_header_group_object is used to send all objects that belong to this group.
Parameters
moqThe imquic_moq_context generating the message
bytesThe buffer to add the message to
blenThe size of the buffer
subscribe_idThe subscription ID to put in the message
track_aliasThe track alias to put in the message
group_idThe group ID to put in the message
object_send_orderThe object send order to put in the message (v03 and v04 only)
priorityThe publisher priority to put in the message (only after v05)
Returns
The size of the generated message, if successful, or 0 otherwise

◆ imquic_moq_add_stream_header_group_object()

size_t imquic_moq_add_stream_header_group_object ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint64_t object_id,
uint64_t object_status,
uint8_t * payload,
size_t plen )

Helper to add an object to a buffer, formatted as expected for STREAM_HEADER_GROUP objects (so not all IDs) (only before v06)

Parameters
moqThe imquic_moq_context generating the object
bytesThe buffer to add the object to
blenThe size of the buffer
object_idThe object ID
object_statusThe object status (only added if the payload length is 0)
payloadThe buffer containing the payload of the object
plenThe size of the payload buffer
Returns
The size of the generated object, if successful, or 0 otherwise

◆ imquic_moq_add_stream_header_subgroup()

size_t imquic_moq_add_stream_header_subgroup ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint64_t subscribe_id,
uint64_t track_alias,
uint64_t group_id,
uint64_t subgroup_id,
uint8_t priority )

Helper to add a STREAM_HEADER_SUBGROUP message to a buffer (only after v06)

Note
This will create a new STREAM and send the header: after that, imquic_moq_add_stream_header_subgroup_object is used to send all objects that belong to this subgroup.
Parameters
moqThe imquic_moq_context generating the message
bytesThe buffer to add the message to
blenThe size of the buffer
subscribe_idThe subscription ID to put in the message
track_aliasThe track alias to put in the message
group_idThe group ID to put in the message
subgroup_idThe subgroup ID to put in the message
priorityThe publisher priority to put in the message
Returns
The size of the generated message, if successful, or 0 otherwise

◆ imquic_moq_add_stream_header_subgroup_object()

size_t imquic_moq_add_stream_header_subgroup_object ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint64_t object_id,
uint64_t object_status,
uint8_t * payload,
size_t plen )

Helper to add an object to a buffer, formatted as expected for STREAM_HEADER_SUBGROUP objects (so not all IDs) (only after v06)

Parameters
moqThe imquic_moq_context generating the object
bytesThe buffer to add the object to
blenThe size of the buffer
object_idThe object ID
object_statusThe object status (only added if the payload length is 0)
payloadThe buffer containing the payload of the object
plenThe size of the payload buffer
Returns
The size of the generated object, if successful, or 0 otherwise

◆ imquic_moq_add_stream_header_track()

size_t imquic_moq_add_stream_header_track ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint64_t subscribe_id,
uint64_t track_alias,
uint64_t object_send_order,
uint8_t priority )

Helper to add a STREAM_HEADER_TRACK message to a buffer (only before v06)

Note
This will create a new STREAM and send the header: after that, imquic_moq_add_stream_header_track_object is used to send all objects that belong to this track.
Parameters
moqThe imquic_moq_context generating the message
bytesThe buffer to add the message to
blenThe size of the buffer
subscribe_idThe subscription ID to put in the message
track_aliasThe track alias to put in the message
object_send_orderThe object send order to put in the message (v03 and v04 only)
priorityThe publisher priority to put in the message (only after v05)
Returns
The size of the generated message, if successful, or 0 otherwise

◆ imquic_moq_add_stream_header_track_object()

size_t imquic_moq_add_stream_header_track_object ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint64_t group_id,
uint64_t object_id,
uint64_t object_status,
uint8_t * payload,
size_t plen )

Helper to add an object to a buffer, formatted as expected for STREAM_HEADER_TRACK objects (so not all IDs) (only before v06)

Parameters
moqThe imquic_moq_context generating the object
bytesThe buffer to add the object to
blenThe size of the buffer
group_idThe group ID
object_idThe object ID
object_statusThe object status (only added if the payload length is 0)
payloadThe buffer containing the payload of the object
plenThe size of the payload buffer
Returns
The size of the generated object, if successful, or 0 otherwise

◆ imquic_moq_add_subscribe()

size_t imquic_moq_add_subscribe ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint64_t subscribe_id,
uint64_t track_alias,
imquic_moq_namespace * track_namespace,
imquic_moq_name * track_name,
uint8_t priority,
uint8_t group_order,
imquic_moq_filter_type filter,
uint64_t start_group,
uint64_t start_object,
uint64_t end_group,
uint64_t end_object,
size_t params_num,
imquic_data * parameters )

Helper to add a SUBSCRIBE message (any version of the draft except v03) to a buffer.

Note
This sends the -04 or -05 variant of the message
Parameters
moqThe imquic_moq_context generating the message
bytesThe buffer to add the message to
blenThe size of the buffer
subscribe_idThe subscription ID to put in the message
track_aliasThe track alias to put in the message
track_namespaceThe namespace to put in the message
track_nameThe track name to put in the message
priorityThe subscriber priority to put in the message (only after v05)
group_orderThe group order to put in the message (only after v05)
filterThe filter as a imquic_moq_filter_type value
start_groupThe start group ID to put in the message
start_objectThe start object ID to put in the message
end_groupThe end group ID to put in the message
end_objectThe end object ID to put in the message
params_numNumber of parameters to add to the message, if any
parametersA buffer containing an already serialized list of parameters
Returns
The size of the generated message, if successful, or 0 otherwise

◆ imquic_moq_add_subscribe_announces()

size_t imquic_moq_add_subscribe_announces ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
imquic_moq_namespace * track_namespace,
size_t params_num,
imquic_data * parameters )

Helper to add a SUBSCRIBE_ANNOUNCES message (version -04 of the draft) to a buffer.

Note
This sends the -04 or -05 variant of the message
Parameters
moqThe imquic_moq_context generating the message
bytesThe buffer to add the message to
blenThe size of the buffer
track_namespaceThe namespace to put in the message
params_numNumber of parameters to add to the message, if any
parametersA buffer containing an already serialized list of parameters
Returns
The size of the generated message, if successful, or 0 otherwise

◆ imquic_moq_add_subscribe_announces_error()

size_t imquic_moq_add_subscribe_announces_error ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
imquic_moq_namespace * track_namespace,
imquic_moq_error_code error,
const char * reason )

Helper method to add a SUBSCRIBE_ANNOUNCES_ERRROR message to a buffer.

Parameters
moqThe imquic_moq_context generating the message
bytesThe buffer to add the message to
blenThe size of the buffer
track_namespaceThe namespace to put in the message
errorError code associated to the message
reasonVerbose description of the error, if any
Returns
The size of the generated message, if successful, or 0 otherwise

◆ imquic_moq_add_subscribe_announces_ok()

size_t imquic_moq_add_subscribe_announces_ok ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
imquic_moq_namespace * track_namespace )

Helper method to add a SUBSCRIBE_ANNOUNCES_OK message to a buffer.

Parameters
moqThe imquic_moq_context generating the message
bytesThe buffer to add the message to
blenThe size of the buffer
track_namespaceThe namespace to put in the message
Returns
The size of the generated message, if successful, or 0 otherwise

◆ imquic_moq_add_subscribe_done()

size_t imquic_moq_add_subscribe_done ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint64_t subscribe_id,
imquic_moq_sub_done_code status,
const char * reason,
gboolean content_exists,
uint64_t final_group,
uint64_t final_object )

Helper method to add a SUBSCRIBE_DONE message to a buffer.

Parameters
moqThe imquic_moq_context generating the message
bytesThe buffer to add the message to
blenThe size of the buffer
subscribe_idThe subscription ID to put in the message
statusThe status of the subscrption
reasonVerbose description of the status
content_existsWhether the following two properties should be added to the message
final_groupFinal group ID to add to the message, if needed
final_objectFinal object ID to add to the message, if needed
Returns
The size of the generated message, if successful, or 0 otherwise

◆ imquic_moq_add_subscribe_error()

size_t imquic_moq_add_subscribe_error ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint64_t subscribe_id,
imquic_moq_sub_error_code error,
const char * reason,
uint64_t track_alias )

Helper method to add a SUBSCRIBE_ERRROR message to a buffer.

Parameters
moqThe imquic_moq_context generating the message
bytesThe buffer to add the message to
blenThe size of the buffer
subscribe_idThe subscription ID to put in the message
errorError code associated to the message
reasonVerbose description of the error, if any
track_aliasThe track alias to put in the message
Returns
The size of the generated message, if successful, or 0 otherwise

◆ imquic_moq_add_subscribe_ok()

size_t imquic_moq_add_subscribe_ok ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint64_t subscribe_id,
uint64_t expires,
imquic_moq_group_order group_order,
gboolean content_exists,
uint64_t largest_group_id,
uint64_t largest_object_id,
size_t params_num,
imquic_data * parameters )

Helper method to add a SUBSCRIBE_OK message to a buffer.

Parameters
moqThe imquic_moq_context generating the message
bytesThe buffer to add the message to
blenThe size of the buffer
subscribe_idThe subscription ID to put in the message
expiresThe expires value to put in the message
group_orderThe group order to put in the message (only after v05)
content_existsWhether the following two properties should be added to the message
largest_group_idLargest group ID to add to the message, if needed
largest_object_idLargest object ID to add to the message, if needed
params_numNumber of parameters to add to the message, if any (only after v06)
parametersA buffer containing an already serialized list of parameters (only after v06)
Returns
The size of the generated message, if successful, or 0 otherwise

◆ imquic_moq_add_subscribe_update()

size_t imquic_moq_add_subscribe_update ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint64_t subscribe_id,
uint64_t start_group,
uint64_t start_object,
uint64_t end_group,
uint64_t end_object,
uint8_t priority,
size_t params_num,
imquic_data * parameters )

Helper method to add a SUBSCRIBE_UPDATE message to a buffer.

Parameters
moqThe imquic_moq_context generating the message
bytesThe buffer to add the message to
blenThe size of the buffer
subscribe_idThe subscription ID to put in the message
start_groupThe start group ID to put in the message
start_objectThe start object ID to put in the message
end_groupThe end group ID to put in the message
end_objectThe end object ID to put in the message
priorityThe subscriber priority to put in the message (only after v05)
params_numNumber of parameters to add to the message, if any
parametersA buffer containing an already serialized list of parameters
Returns
The size of the generated message, if successful, or 0 otherwise

◆ imquic_moq_add_subscribe_v03()

size_t imquic_moq_add_subscribe_v03 ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint64_t subscribe_id,
uint64_t track_alias,
imquic_moq_namespace * track_namespace,
imquic_moq_name * track_name,
imquic_moq_location * start_group,
imquic_moq_location * start_object,
imquic_moq_location * end_group,
imquic_moq_location * end_object,
size_t params_num,
imquic_data * parameters )

Helper to add a SUBSCRIBE message (version -03 of the draft) to a buffer.

Note
This sends the -03 variant of the message
Parameters
moqThe imquic_moq_context generating the message
bytesThe buffer to add the message to
blenThe size of the buffer
subscribe_idThe subscription ID to put in the message
track_aliasThe track alias to put in the message
track_namespaceThe namespace to put in the message
track_nameThe track name to put in the message
start_groupThe start group as a imquic_moq_location instance, if any
start_objectThe start object as a imquic_moq_location instance, if any
end_groupThe end group as a imquic_moq_location instance, if any
end_objectThe end object as a imquic_moq_location instance, if any
params_numNumber of parameters to add to the message, if any
parametersA buffer containing an already serialized list of parameters
Returns
The size of the generated message, if successful, or 0 otherwise

◆ imquic_moq_add_track_status()

size_t imquic_moq_add_track_status ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
imquic_moq_namespace * track_namespace,
imquic_moq_name * track_name,
uint64_t status_code,
uint64_t last_group_id,
uint64_t last_object_id )

Helper to add a TRACK_STATUS message to a buffer.

Parameters
moqThe imquic_moq_context generating the message
bytesThe buffer to add the message to
blenThe size of the buffer
track_namespaceThe namespace to put in the message
track_nameThe track name to put in the message
status_codeThe status code to put in the message
last_group_idThe last group ID to put in the message
last_object_idThe last object ID to put in the message
Returns
The size of the generated message, if successful, or 0 otherwise

◆ imquic_moq_add_track_status_request()

size_t imquic_moq_add_track_status_request ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
imquic_moq_namespace * track_namespace,
imquic_moq_name * track_name )

Helper to add a TRACK_STATUS_REQUEST message to a buffer.

Parameters
moqThe imquic_moq_context generating the message
bytesThe buffer to add the message to
blenThe size of the buffer
track_namespaceThe namespace to put in the message
track_nameThe track name to put in the message
Returns
The size of the generated message, if successful, or 0 otherwise

◆ imquic_moq_add_unannounce()

size_t imquic_moq_add_unannounce ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
imquic_moq_namespace * track_namespace )

Helper method to add an UNANNOUNCE message to a buffer.

Parameters
moqThe imquic_moq_context generating the message
bytesThe buffer to add the message to
blenThe size of the buffer
track_namespaceNamespace to unannounce
Returns
The size of the generated message, if successful, or 0 otherwise

◆ imquic_moq_add_unsubscribe()

size_t imquic_moq_add_unsubscribe ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint64_t subscribe_id )

Helper method to add an UNSUBSCRIBE message to a buffer.

Parameters
moqThe imquic_moq_context generating the message
bytesThe buffer to add the message to
blenThe size of the buffer
subscribe_idThe subscription ID to put in the message
Returns
The size of the generated message, if successful, or 0 otherwise

◆ imquic_moq_add_unsubscribe_announces()

size_t imquic_moq_add_unsubscribe_announces ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
imquic_moq_namespace * track_namespace )

Helper method to add an UNSUBSCRIBE_ANNOUNCES message to a buffer.

Parameters
moqThe imquic_moq_context generating the message
bytesThe buffer to add the message to
blenThe size of the buffer
track_namespaceThe namespace to put in the message
Returns
The size of the generated message, if successful, or 0 otherwise

◆ imquic_moq_buffer_append()

void imquic_moq_buffer_append ( imquic_moq_buffer * buffer,
uint8_t * bytes,
uint64_t length )

Append data at the end of the buffer.

Note
This automatically resizes the buffer with imquic_moq_buffer_resize, if appending the new data would exceeds the buffer size.
Parameters
bufferBuffer to append the new data to
bytesData to append
lengthSize of the data to append

◆ imquic_moq_buffer_destroy()

void imquic_moq_buffer_destroy ( imquic_moq_buffer * buffer)

Destroy an existing buffer.

Parameters
bufferBuffer to destroy

◆ imquic_moq_buffer_resize()

gboolean imquic_moq_buffer_resize ( imquic_moq_buffer * buffer,
uint64_t new_size )

Resize an existing buffer.

Note
We can only increase the size of the buffer, not reduce it.
Parameters
bufferBuffer to resize
new_sizeNew size of the buffer
Returns
TRUE if successful, a negative integer otherwise

◆ imquic_moq_buffer_shift()

void imquic_moq_buffer_shift ( imquic_moq_buffer * buffer,
uint64_t length )

Move the data in the buffer back of a specific number of bytes.

Note
This automatically updates the buffer length accordingly.
Parameters
bufferBuffer to update
lengthHow many bytes back the buffer should be moved

◆ imquic_moq_connection_gone()

void imquic_moq_connection_gone ( imquic_connection * conn)

Callback the core invokes when an existing MoQ connection is not available anymore.

Parameters
connThe imquic_connection instance that is now gone

◆ imquic_moq_data_message_type_str()

const char * imquic_moq_data_message_type_str ( imquic_moq_data_message_type type)

Helper function to serialize to string the name of a imquic_moq_data_message_type value.

Parameters
typeThe imquic_data_moq_message_type value
Returns
The type name as a string, if valid, or NULL otherwise

◆ imquic_moq_data_message_type_to_delivery()

imquic_moq_delivery imquic_moq_data_message_type_to_delivery ( imquic_moq_data_message_type type)

Helper function to return the imquic_moq_delivery mode associated to a imquic_moq_data_message_type type.

Parameters
typeThe imquic_data_moq_message_type value
Returns
The associated imquic_moq_delivery mode, if successful, or -1 otherwise

◆ imquic_moq_datagram_incoming()

void imquic_moq_datagram_incoming ( imquic_connection * conn,
uint8_t * bytes,
uint64_t length )

Callback the core invokes when there's new incoming data on a DATAGRAM.

Parameters
connThe imquic_connection instance for which new DATAGRAM data is available
bytesThe new data that is available
lengthSize of the new data

◆ imquic_moq_deinit()

void imquic_moq_deinit ( void )

Uninitialize the native MoQ stack.

◆ imquic_moq_error_code_str()

const char * imquic_moq_error_code_str ( imquic_moq_error_code code)

Helper function to serialize to string the name of a imquic_moq_error_code value.

Parameters
codeThe imquic_moq_error_code value
Returns
The type name as a string, if valid, or NULL otherwise

◆ imquic_moq_filter_type_str()

const char * imquic_moq_filter_type_str ( imquic_moq_filter_type type)

Helper function to serialize to string the name of a imquic_moq_filter_type value.

Parameters
typeThe imquic_moq_filter_type value
Returns
The type name as a string, if valid, or NULL otherwise

◆ imquic_moq_group_order_str()

const char * imquic_moq_group_order_str ( imquic_moq_group_order type)

Helper function to serialize to string the name of a imquic_moq_group_order value.

Parameters
typeThe imquic_moq_group_order value
Returns
The type name as a string, if valid, or NULL otherwise

◆ imquic_moq_init()

void imquic_moq_init ( void )

Initialize the native MoQ stack at startup.

◆ imquic_moq_location_mode_str()

const char * imquic_moq_location_mode_str ( imquic_moq_location_mode mode)

Helper function to serialize to string the name of a imquic_moq_location_mode value.

Parameters
modeThe imquic_moq_location_mode value
Returns
The type name as a string, if valid, or NULL otherwise

◆ imquic_moq_message_type_str()

const char * imquic_moq_message_type_str ( imquic_moq_message_type type)

Helper function to serialize to string the name of a imquic_moq_message_type value.

Parameters
typeThe imquic_moq_message_type value
Returns
The type name as a string, if valid, or NULL otherwise

◆ imquic_moq_new_connection()

void imquic_moq_new_connection ( imquic_connection * conn,
void * user_data )

Callback the core invokes when a new QUIC connection using MoQ is available.

Parameters
connThe imquic_connection instance that is now available
user_dataOptional user data the user/application may have associated to the endpoint this connection belongs to

◆ imquic_moq_parameter_add_data()

size_t imquic_moq_parameter_add_data ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
int param,
uint8_t * buf,
size_t buflen )

Helper to add a MoQ (setup or subscribe) parameter with generic data to a buffer.

Parameters
moqThe imquic_moq_context instance the parameter is for
bytesBuffer to add the parameter to
blenSize of the buffer
paramID of the parameter to add
bufThe data acting as a value for the parameter to add
buflenThe size of the data value
Returns
The size of the parameter, if successful, or 0 otherwise

◆ imquic_moq_parameter_add_int()

size_t imquic_moq_parameter_add_int ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
int param,
uint64_t number )

Helper to add a MoQ (setup or subscribe) parameter with a numeric value to a buffer.

Parameters
moqThe imquic_moq_context instance the parameter is for
bytesBuffer to add the parameter to
blenSize of the buffer
paramID of the parameter to add
numberThe numeric value of the parameter to add
Returns
The size of the parameter, if successful, or 0 otherwise

◆ imquic_moq_parse_announce()

size_t imquic_moq_parse_announce ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint8_t * error )

Helper to parse an ANNOUNCE message.

Parameters
[in]moqThe imquic_moq_context instance the message is for
[in]bytesThe buffer containing the message to parse
[in]blenSize of the buffer to parse
[out]errorIn/out property, initialized to 0 and set to 1 in case of parsing errors
Returns
The size of the parsed message, if successful, or 0 otherwise

◆ imquic_moq_parse_announce_cancel()

size_t imquic_moq_parse_announce_cancel ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint8_t * error )

Helper to parse an ANNOUNCE_CANCEL message.

Parameters
[in]moqThe imquic_moq_context instance the message is for
[in]bytesThe buffer containing the message to parse
[in]blenSize of the buffer to parse
[out]errorIn/out property, initialized to 0 and set to 1 in case of parsing errors
Returns
The size of the parsed message, if successful, or 0 otherwise

◆ imquic_moq_parse_announce_error()

size_t imquic_moq_parse_announce_error ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint8_t * error )

Helper to parse an ANNOUNCE_ERROR message.

Parameters
[in]moqThe imquic_moq_context instance the message is for
[in]bytesThe buffer containing the message to parse
[in]blenSize of the buffer to parse
[out]errorIn/out property, initialized to 0 and set to 1 in case of parsing errors
Returns
The size of the parsed message, if successful, or 0 otherwise

◆ imquic_moq_parse_announce_ok()

size_t imquic_moq_parse_announce_ok ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint8_t * error )

Helper to parse an ANNOUNCE_OK message.

Parameters
[in]moqThe imquic_moq_context instance the message is for
[in]bytesThe buffer containing the message to parse
[in]blenSize of the buffer to parse
[out]errorIn/out property, initialized to 0 and set to 1 in case of parsing errors
Returns
The size of the parsed message, if successful, or 0 otherwise

◆ imquic_moq_parse_client_setup()

size_t imquic_moq_parse_client_setup ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint8_t * error )

Helper to parse a CLIENT_SETUP message.

Parameters
[in]moqThe imquic_moq_context instance the message is for
[in]bytesThe buffer containing the message to parse
[in]blenSize of the buffer to parse
[out]errorIn/out property, initialized to 0 and set to 1 in case of parsing errors
Returns
The size of the parsed message, if successful, or 0 otherwise

◆ imquic_moq_parse_fetch()

size_t imquic_moq_parse_fetch ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint8_t * error )

Helper to parse a FETCH message.

Parameters
[in]moqThe imquic_moq_context instance the message is for
[in]bytesThe buffer containing the message to parse
[in]blenSize of the buffer to parse
[out]errorIn/out property, initialized to 0 and set to 1 in case of parsing errors
Returns
The size of the parsed message, if successful, or 0 otherwise

◆ imquic_moq_parse_fetch_cancel()

size_t imquic_moq_parse_fetch_cancel ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint8_t * error )

Helper to parse a FETCH_CANCEL message.

Parameters
[in]moqThe imquic_moq_context instance the message is for
[in]bytesThe buffer containing the message to parse
[in]blenSize of the buffer to parse
[out]errorIn/out property, initialized to 0 and set to 1 in case of parsing errors
Returns
The size of the parsed message, if successful, or 0 otherwise

◆ imquic_moq_parse_fetch_error()

size_t imquic_moq_parse_fetch_error ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint8_t * error )

Helper to parse a FETCH_ERROR message.

Parameters
[in]moqThe imquic_moq_context instance the message is for
[in]bytesThe buffer containing the message to parse
[in]blenSize of the buffer to parse
[out]errorIn/out property, initialized to 0 and set to 1 in case of parsing errors
Returns
The size of the parsed message, if successful, or 0 otherwise

◆ imquic_moq_parse_fetch_header()

size_t imquic_moq_parse_fetch_header ( imquic_moq_context * moq,
imquic_moq_stream * moq_stream,
uint8_t * bytes,
size_t blen,
uint8_t * error )

Helper to parse a FETCH_HEADER message.

Parameters
[in]moqThe imquic_moq_context instance the message is for
[in]moq_streamThe imquic_moq_context instance the object is from
[in]bytesThe buffer containing the message to parse
[in]blenSize of the buffer to parse
[out]errorIn/out property, initialized to 0 and set to 1 in case of parsing errors
Returns
The size of the parsed message, if successful, or 0 otherwise

◆ imquic_moq_parse_fetch_header_object()

int imquic_moq_parse_fetch_header_object ( imquic_moq_context * moq,
imquic_moq_stream * moq_stream,
gboolean complete )

Helper to parse a FETCH_HEADER object.

Note
A negative response doesn't mean there's an error, but just that the object isn't complete yet and we need to wait for more data.
Parameters
[in]moqThe imquic_moq_context instance the object is for
[in]moq_streamThe imquic_moq_context instance the object is from
[in]completeWhether this data marks the completion of the QUIC stream it came from
Returns
0 in case of success, or a negative integer otherwise

◆ imquic_moq_parse_fetch_ok()

size_t imquic_moq_parse_fetch_ok ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint8_t * error )

Helper to parse a FETCH_OK message.

Parameters
[in]moqThe imquic_moq_context instance the message is for
[in]bytesThe buffer containing the message to parse
[in]blenSize of the buffer to parse
[out]errorIn/out property, initialized to 0 and set to 1 in case of parsing errors
Returns
The size of the parsed message, if successful, or 0 otherwise

◆ imquic_moq_parse_goaway()

size_t imquic_moq_parse_goaway ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint8_t * error )

Helper to parse a GOAWAY message.

Parameters
[in]moqThe imquic_moq_context instance the message is for
[in]bytesThe buffer containing the message to parse
[in]blenSize of the buffer to parse
[out]errorIn/out property, initialized to 0 and set to 1 in case of parsing errors
Returns
The size of the parsed message, if successful, or 0 otherwise

◆ imquic_moq_parse_max_subscribe_id()

size_t imquic_moq_parse_max_subscribe_id ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint8_t * error )

Helper to pars an MAX_SUBSCRIBE_ID message.

Parameters
[in]moqThe imquic_moq_context instance the message is for
[in]bytesThe buffer containing the message to parse
[in]blenSize of the buffer to parse
[out]errorIn/out property, initialized to 0 and set to 1 in case of parsing errors
Returns
The size of the parsed message, if successful, or 0 otherwise

◆ imquic_moq_parse_message()

int imquic_moq_parse_message ( imquic_moq_context * moq,
uint64_t stream_id,
uint8_t * bytes,
size_t blen,
gboolean complete,
gboolean datagram )

Parse an incoming MoQ message.

Note
This will iterate on a buffer, trying to parse as many messages as possible in a sequential way. In case a message is incomplete (e.g., because we're still waiting on STREAM data), we move back to the beginning of the buffer and return, waiting for more data to arrive.
Parameters
moqThe imquic_moq_context instance the message is for
stream_idThe QUIC stream ID the message came from
bytesThe buffer containing the message to parse
blenSize of the buffer to parse
completeWhether this data marks the completion of the QUIC stream it came from
datagramWhether this is not coming from a STREAM but a DATAGRAM
Returns
0 in case of success, or a negative integer otherwise

◆ imquic_moq_parse_object_datagram()

size_t imquic_moq_parse_object_datagram ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint8_t * error )

Helper to parse an OBJECT_DATAGRAM message.

Parameters
[in]moqThe imquic_moq_context instance the message is for
[in]bytesThe buffer containing the message to parse
[in]blenSize of the buffer to parse
[out]errorIn/out property, initialized to 0 and set to 1 in case of parsing errors
Returns
The size of the parsed message, if successful, or 0 otherwise

◆ imquic_moq_parse_object_stream()

size_t imquic_moq_parse_object_stream ( imquic_moq_context * moq,
imquic_moq_stream * moq_stream,
uint8_t * bytes,
size_t blen,
uint8_t * error )

Helper to parse an OBJECT_STREAM message.

Parameters
[in]moqThe imquic_moq_context instance the message is for
[in]moq_streamThe imquic_moq_context instance the message came from
[in]bytesThe buffer containing the message to parse
[in]blenSize of the buffer to parse
[out]errorIn/out property, initialized to 0 and set to 1 in case of parsing errors
Returns
The size of the parsed message, if successful, or 0 otherwise

◆ imquic_moq_parse_server_setup()

size_t imquic_moq_parse_server_setup ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint8_t * error )

Helper to pars an SERVER_SETUP message.

Parameters
[in]moqThe imquic_moq_context instance the message is for
[in]bytesThe buffer containing the message to parse
[in]blenSize of the buffer to parse
[out]errorIn/out property, initialized to 0 and set to 1 in case of parsing errors
Returns
The size of the parsed message, if successful, or 0 otherwise

◆ imquic_moq_parse_setup_parameter()

size_t imquic_moq_parse_setup_parameter ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
imquic_moq_parsed_setup_parameter * param,
uint8_t * error )

Helper method to parse a MoQ setup parameter.

Note
This method does nothing at the moment
Parameters
[in]moqThe imquic_moq_context instance to update with the new parameter
[in]bytesBuffer containing the parameter to parse
[in]blenSize of the buffer to parse
[out]paramimquic_moq_parsed_setup_parameter instance to put the parsed parameter in
[out]errorIn/out property, initialized to 0 and set to 1 in case of parsing errors
Returns
The size of the parameter, if successful, or 0 otherwise

◆ imquic_moq_parse_stream_header_group()

size_t imquic_moq_parse_stream_header_group ( imquic_moq_context * moq,
imquic_moq_stream * moq_stream,
uint8_t * bytes,
size_t blen,
uint8_t * error )

Helper to parse a STREAM_HEADER_GROUP message.

Parameters
[in]moqThe imquic_moq_context instance the message is for
[in]moq_streamThe imquic_moq_context instance the message came from
[in]bytesThe buffer containing the message to parse
[in]blenSize of the buffer to parse
[out]errorIn/out property, initialized to 0 and set to 1 in case of parsing errors
Returns
The size of the parsed message, if successful, or 0 otherwise

◆ imquic_moq_parse_stream_header_group_object()

int imquic_moq_parse_stream_header_group_object ( imquic_moq_context * moq,
imquic_moq_stream * moq_stream,
gboolean complete )

Helper to parse a STREAM_HEADER_GROUP object.

Note
A negative response doesn't mean there's an error, but just that the object isn't complete yet and we need to wait for more data.
Parameters
[in]moqThe imquic_moq_context instance the object is for
[in]moq_streamThe imquic_moq_context instance the object is from
[in]completeWhether this data marks the completion of the QUIC stream it came from
Returns
0 in case of success, or a negative integer otherwise

◆ imquic_moq_parse_stream_header_subgroup()

size_t imquic_moq_parse_stream_header_subgroup ( imquic_moq_context * moq,
imquic_moq_stream * moq_stream,
uint8_t * bytes,
size_t blen,
uint8_t * error )

Helper to parse a STREAM_HEADER_SUBGROUP message.

Parameters
[in]moqThe imquic_moq_context instance the message is for
[in]moq_streamThe imquic_moq_context instance the message came from
[in]bytesThe buffer containing the message to parse
[in]blenSize of the buffer to parse
[out]errorIn/out property, initialized to 0 and set to 1 in case of parsing errors
Returns
The size of the parsed message, if successful, or 0 otherwise

◆ imquic_moq_parse_stream_header_subgroup_object()

int imquic_moq_parse_stream_header_subgroup_object ( imquic_moq_context * moq,
imquic_moq_stream * moq_stream,
gboolean complete )

Helper to parse a STREAM_HEADER_SUBGROUP object.

Note
A negative response doesn't mean there's an error, but just that the object isn't complete yet and we need to wait for more data.
Parameters
[in]moqThe imquic_moq_context instance the object is for
[in]moq_streamThe imquic_moq_context instance the object is from
[in]completeWhether this data marks the completion of the QUIC stream it came from
Returns
0 in case of success, or a negative integer otherwise

◆ imquic_moq_parse_stream_header_track()

size_t imquic_moq_parse_stream_header_track ( imquic_moq_context * moq,
imquic_moq_stream * moq_stream,
uint8_t * bytes,
size_t blen,
uint8_t * error )

Helper to parse a STREAM_HEADER_TRACK message.

Parameters
[in]moqThe imquic_moq_context instance the message is for
[in]moq_streamThe imquic_moq_context instance the object is from
[in]bytesThe buffer containing the message to parse
[in]blenSize of the buffer to parse
[out]errorIn/out property, initialized to 0 and set to 1 in case of parsing errors
Returns
The size of the parsed message, if successful, or 0 otherwise

◆ imquic_moq_parse_stream_header_track_object()

int imquic_moq_parse_stream_header_track_object ( imquic_moq_context * moq,
imquic_moq_stream * moq_stream,
gboolean complete )

Helper to parse a STREAM_HEADER_TRACK object.

Note
A negative response doesn't mean there's an error, but just that the object isn't complete yet and we need to wait for more data.
Parameters
[in]moqThe imquic_moq_context instance the object is for
[in]moq_streamThe imquic_moq_context instance the object is from
[in]completeWhether this data marks the completion of the QUIC stream it came from
Returns
0 in case of success, or a negative integer otherwise

◆ imquic_moq_parse_subscribe()

size_t imquic_moq_parse_subscribe ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint8_t * error )

Helper to parse a SUBSCRIBE message.

Parameters
[in]moqThe imquic_moq_context instance the message is for
[in]bytesThe buffer containing the message to parse
[in]blenSize of the buffer to parse
[out]errorIn/out property, initialized to 0 and set to 1 in case of parsing errors
Returns
The size of the parsed message, if successful, or 0 otherwise

◆ imquic_moq_parse_subscribe_announces()

size_t imquic_moq_parse_subscribe_announces ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint8_t * error )

Helper to parse a SUBSCRIBE_ANNOUNCES message.

Parameters
[in]moqThe imquic_moq_context instance the message is for
[in]bytesThe buffer containing the message to parse
[in]blenSize of the buffer to parse
[out]errorIn/out property, initialized to 0 and set to 1 in case of parsing errors
Returns
The size of the parsed message, if successful, or 0 otherwise

◆ imquic_moq_parse_subscribe_announces_error()

size_t imquic_moq_parse_subscribe_announces_error ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint8_t * error )

Helper to parse a SUBSCRIBE_ANNOUNCES_ERROR message.

Parameters
[in]moqThe imquic_moq_context instance the message is for
[in]bytesThe buffer containing the message to parse
[in]blenSize of the buffer to parse
[out]errorIn/out property, initialized to 0 and set to 1 in case of parsing errors
Returns
The size of the parsed message, if successful, or 0 otherwise

◆ imquic_moq_parse_subscribe_announces_ok()

size_t imquic_moq_parse_subscribe_announces_ok ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint8_t * error )

Helper to parse a SUBSCRIBE_ANNOUNCES_OK message.

Parameters
[in]moqThe imquic_moq_context instance the message is for
[in]bytesThe buffer containing the message to parse
[in]blenSize of the buffer to parse
[out]errorIn/out property, initialized to 0 and set to 1 in case of parsing errors
Returns
The size of the parsed message, if successful, or 0 otherwise

◆ imquic_moq_parse_subscribe_done()

size_t imquic_moq_parse_subscribe_done ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint8_t * error )

Helper to parse a SUBSCRIBE_DONE message.

Parameters
[in]moqThe imquic_moq_context instance the message is for
[in]bytesThe buffer containing the message to parse
[in]blenSize of the buffer to parse
[out]errorIn/out property, initialized to 0 and set to 1 in case of parsing errors
Returns
The size of the parsed message, if successful, or 0 otherwise

◆ imquic_moq_parse_subscribe_error()

size_t imquic_moq_parse_subscribe_error ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint8_t * error )

Helper to parse a SUBSCRIBE_ERROR message.

Parameters
[in]moqThe imquic_moq_context instance the message is for
[in]bytesThe buffer containing the message to parse
[in]blenSize of the buffer to parse
[out]errorIn/out property, initialized to 0 and set to 1 in case of parsing errors
Returns
The size of the parsed message, if successful, or 0 otherwise

◆ imquic_moq_parse_subscribe_ok()

size_t imquic_moq_parse_subscribe_ok ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint8_t * error )

Helper to parse a SUBSCRIBE_OK message.

Parameters
[in]moqThe imquic_moq_context instance the message is for
[in]bytesThe buffer containing the message to parse
[in]blenSize of the buffer to parse
[out]errorIn/out property, initialized to 0 and set to 1 in case of parsing errors
Returns
The size of the parsed message, if successful, or 0 otherwise

◆ imquic_moq_parse_subscribe_parameter()

size_t imquic_moq_parse_subscribe_parameter ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
imquic_moq_parsed_subscribe_parameter * param,
uint8_t * error )

Helper method to parse a MoQ subscribe parameter.

Note
This method does nothing at the moment
Parameters
[in]moqThe imquic_moq_context instance to update with the new parameter
[in]bytesBuffer containing the parameter to parse
[in]blenSize of the buffer to parse
[out]paramimquic_moq_parsed_subscribe_parameter instance to put the parsed parameter in
[out]errorIn/out property, initialized to 0 and set to 1 in case of parsing errors
Returns
The size of the parameter, if successful, or 0 otherwise

◆ imquic_moq_parse_subscribe_update()

size_t imquic_moq_parse_subscribe_update ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint8_t * error )

Helper to parse a SUBSCRIBE_UPDATE message.

Parameters
[in]moqThe imquic_moq_context instance the message is for
[in]bytesThe buffer containing the message to parse
[in]blenSize of the buffer to parse
[out]errorIn/out property, initialized to 0 and set to 1 in case of parsing errors
Returns
The size of the parsed message, if successful, or 0 otherwise

◆ imquic_moq_parse_track_status()

size_t imquic_moq_parse_track_status ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint8_t * error )

Helper to parse a TRACK_STATUS message.

Parameters
[in]moqThe imquic_moq_context instance the message is for
[in]bytesThe buffer containing the message to parse
[in]blenSize of the buffer to parse
[out]errorIn/out property, initialized to 0 and set to 1 in case of parsing errors
Returns
The size of the parsed message, if successful, or 0 otherwise

◆ imquic_moq_parse_track_status_request()

size_t imquic_moq_parse_track_status_request ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint8_t * error )

Helper to parse a TRACK_STATUS_REQUEST message.

Parameters
[in]moqThe imquic_moq_context instance the message is for
[in]bytesThe buffer containing the message to parse
[in]blenSize of the buffer to parse
[out]errorIn/out property, initialized to 0 and set to 1 in case of parsing errors
Returns
The size of the parsed message, if successful, or 0 otherwise

◆ imquic_moq_parse_unannounce()

size_t imquic_moq_parse_unannounce ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint8_t * error )

Helper to parse an UNANNOUNCE message.

Parameters
[in]moqThe imquic_moq_context instance the message is for
[in]bytesThe buffer containing the message to parse
[in]blenSize of the buffer to parse
[out]errorIn/out property, initialized to 0 and set to 1 in case of parsing errors
Returns
The size of the parsed message, if successful, or 0 otherwise

◆ imquic_moq_parse_unsubscribe()

size_t imquic_moq_parse_unsubscribe ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint8_t * error )

Helper to parse an UNSUBSCRIBE message.

Parameters
[in]moqThe imquic_moq_context instance the message is for
[in]bytesThe buffer containing the message to parse
[in]blenSize of the buffer to parse
[out]errorIn/out property, initialized to 0 and set to 1 in case of parsing errors
Returns
The size of the parsed message, if successful, or 0 otherwise

◆ imquic_moq_parse_unsubscribe_announces()

size_t imquic_moq_parse_unsubscribe_announces ( imquic_moq_context * moq,
uint8_t * bytes,
size_t blen,
uint8_t * error )

Helper to parse an UNSUBSCRIBE_ANNOUNCES message.

Parameters
[in]moqThe imquic_moq_context instance the message is for
[in]bytesThe buffer containing the message to parse
[in]blenSize of the buffer to parse
[out]errorIn/out property, initialized to 0 and set to 1 in case of parsing errors
Returns
The size of the parsed message, if successful, or 0 otherwise

◆ imquic_moq_role_type_str()

const char * imquic_moq_role_type_str ( imquic_moq_role_type type)

Helper function to serialize to string the name of a imquic_moq_role_type value.

Parameters
typeThe imquic_moq_role_type value
Returns
The type name as a string, if valid, or NULL otherwise

◆ imquic_moq_setup_parameter_type_str()

const char * imquic_moq_setup_parameter_type_str ( imquic_moq_setup_parameter_type type)

Helper function to serialize to string the name of a imquic_moq_setup_parameter_type value.

Parameters
typeThe imquic_moq_setup_parameter_type value
Returns
The type name as a string, if valid, or NULL otherwise

◆ imquic_moq_stream_destroy()

void imquic_moq_stream_destroy ( imquic_moq_stream * moq_stream)

Destroy an existing MoQ stream.

Parameters
moq_streamMoQ stream to destroy

◆ imquic_moq_stream_incoming()

void imquic_moq_stream_incoming ( imquic_connection * conn,
uint64_t stream_id,
uint8_t * bytes,
uint64_t offset,
uint64_t length,
gboolean complete )

Callback the core invokes when there's new incoming data on a STREAM.

Parameters
connThe imquic_connection instance for which new STREAM data is available
stream_idThe QUIC Stream ID for which new data is available
bytesThe new data that is available
offsetThe offset in the stream this new data should be put in
lengthSize of the new data
completeWhether this data marks the end of this STREAM

◆ imquic_moq_sub_done_code_str()

const char * imquic_moq_sub_done_code_str ( imquic_moq_sub_done_code code)

Helper function to serialize to string the name of a imquic_moq_sub_done_code value.

Parameters
codeThe imquic_moq_sub_done_code value
Returns
The type name as a string, if valid, or NULL otherwise

◆ imquic_moq_sub_error_code_str()

const char * imquic_moq_sub_error_code_str ( imquic_moq_sub_error_code code)

Helper function to serialize to string the name of a imquic_moq_error_code value.

Parameters
codeThe imquic_moq_error_code value
Returns
The type name as a string, if valid, or NULL otherwise

◆ imquic_moq_subscribe_parameter_type_str()

const char * imquic_moq_subscribe_parameter_type_str ( imquic_moq_subscribe_parameter_type type)

Helper function to serialize to string the name of a imquic_moq_subscribe_parameter_type value.

Parameters
typeThe imquic_moq_subscribe_parameter_type value
Returns
The type name as a string, if valid, or NULL otherwise

◆ imquic_moq_subscription_create()

imquic_moq_subscription * imquic_moq_subscription_create ( uint64_t subscribe_id,
uint64_t track_alias )

Helper to create a new subscription instance.

Parameters
subscribe_idThe subscription ID
track_aliasThe track alias
Returns
A pointer to a imquic_moq_subscription, if successful, or NULL otherwise

◆ imquic_moq_subscription_destroy()

void imquic_moq_subscription_destroy ( imquic_moq_subscription * moq_sub)

Destroy an existing MoQ subscription.

Parameters
moq_subMoQ subscription to destroy