Loading...
Searching...
No Matches
moq.h File Reference

imquic MoQ public interface (headers) More...

#include "imquic.h"
Include dependency graph for 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_namespace
 MoQ Track Namespace. More...
 
struct  imquic_moq_name
 MoQ Track Name. More...
 
struct  imquic_moq_location
 MoQ Group/Object couple (for ranges) More...
 
struct  imquic_moq_location_range
 MoQ location range (from where to where, e.g., for FETCH) More...
 
struct  imquic_moq_object_extension
 MoQ Object Extension. More...
 
struct  imquic_moq_object
 MoQ Object. More...
 
struct  imquic_moq_auth_token
 MoQ Authorization Token. More...
 
struct  imquic_moq_auth_token::imquic_moq_auth_token_value
 Token value, if any. More...
 

Typedefs

typedef enum imquic_moq_auth_token_alias_type imquic_moq_auth_token_alias_type
 MoQ Authorization Token Alias Type.
 
typedef struct imquic_moq_auth_token imquic_moq_auth_token
 MoQ Authorization Token.
 
typedef enum imquic_moq_role imquic_moq_role
 Roles that can be specified once connected.
 
typedef enum imquic_moq_version imquic_moq_version
 Versions that can be negotiated.
 

Enumerations

enum  imquic_moq_auth_token_alias_type { IMQUIC_MOQ_AUTH_TOKEN_DELETE = 0x0 , IMQUIC_MOQ_AUTH_TOKEN_REGISTER = 0x1 , IMQUIC_MOQ_AUTH_TOKEN_USE_ALIAS = 0x2 , IMQUIC_MOQ_AUTH_TOKEN_USE_VALUE = 0x3 }
 MoQ Authorization Token Alias Type. More...
 
enum  imquic_moq_role { IMQUIC_MOQ_ENDPOINT , IMQUIC_MOQ_PUBLISHER , IMQUIC_MOQ_SUBSCRIBER , IMQUIC_MOQ_PUBSUB }
 Roles that can be specified once connected. More...
 
enum  imquic_moq_version {
  IMQUIC_MOQ_VERSION_BASE = 0xff000000 , IMQUIC_MOQ_VERSION_MIN = 0xff000006 , IMQUIC_MOQ_VERSION_06 = 0xff000006 , IMQUIC_MOQ_VERSION_07 = 0xff000007 ,
  IMQUIC_MOQ_VERSION_08 = 0xff000008 , IMQUIC_MOQ_VERSION_09 = 0xff000009 , IMQUIC_MOQ_VERSION_10 = 0xff00000A , IMQUIC_MOQ_VERSION_11 = 0xff00000B ,
  IMQUIC_MOQ_VERSION_12 = 0xff00000C , IMQUIC_MOQ_VERSION_13 = 0xff00000D , IMQUIC_MOQ_VERSION_14 = 0xff00000E , IMQUIC_MOQ_VERSION_MAX = IMQUIC_MOQ_VERSION_14 ,
  IMQUIC_MOQ_VERSION_ANY = 0xffffffff , IMQUIC_MOQ_VERSION_ANY_LEGACY = 0xfffffffe
}
 Versions that can be negotiated. More...
 

Functions

const char * imquic_moq_auth_token_alias_type_str (imquic_moq_auth_token_alias_type type)
 Helper function to serialize to string the name of a imquic_moq_auth_token_alias_type property.
 
int imquic_moq_parse_auth_token (uint8_t *bytes, size_t blen, imquic_moq_auth_token *token)
 Helper mode to parse an auth token buffer to a imquic_moq_auth_token instance.
 
size_t imquic_moq_build_auth_token (imquic_moq_auth_token *token, uint8_t *bytes, size_t blen)
 Helper mode to craft an auth token buffer out of a imquic_moq_auth_token instance.
 
const char * imquic_moq_role_str (imquic_moq_role role)
 Helper function to serialize to string the name of a imquic_moq_role property.
 
int imquic_moq_set_role (imquic_connection *conn, imquic_moq_role role)
 Method to set the MoQ role on a connection. Must be done as soon as the connection is established, and before sending any MoQ message. A good place to do that is the callback fired when a new connection is available.
 
imquic_moq_role imquic_moq_get_role (imquic_connection *conn)
 Helper function to get the MoQ role associated with a connection.
 
const char * imquic_moq_version_str (imquic_moq_version version)
 Helper function to serialize to string the name of a imquic_moq_version property.
 
int imquic_moq_set_version (imquic_connection *conn, imquic_moq_version version)
 Method to set the MoQ version on a connection. Must be done as soon as the connection is established, and before sending any MoQ message. A good place to do that is the callback fired when a new connection is available.
 
imquic_moq_version imquic_moq_get_version (imquic_connection *conn)
 Helper function to get the MoQ version associated with a connection.
 
int imquic_moq_set_connection_auth (imquic_connection *conn, uint8_t *auth, size_t authlen)
 Method to provide credentials, as a client, on a new connection. If credentials need to provided, this must be done as soon as the connection is established, and before sending any MoQ message. A good place to do that is the callback fired when a new connection is available.
 
int imquic_moq_set_max_request_id (imquic_connection *conn, uint64_t max_request_id)
 Helper function to set the Maximum Request ID a subscriber can send.
 
uint64_t imquic_moq_get_next_request_id (imquic_connection *conn)
 Helper function to get the next Request ID we can use.
 
MoQ endpoints management
imquic_serverimquic_create_moq_server (const char *name,...)
 Method to create a new MoQ server, using variable arguments to dictate what the server should do (e.g., port to bind to, ALPN, etc.). Variable arguments are in the form of a sequence of name-value started with a IMQUIC_CONFIG_INIT and ended by a IMQUIC_CONFIG_DONE , e.g.:
 
imquic_clientimquic_create_moq_client (const char *name,...)
 Method to create a new MoQ client, using variable arguments to dictate what the client should do (e.g., address to connect to, ALPN, etc.). Variable arguments are in the form of a sequence of name-value started with a IMQUIC_CONFIG_INIT and ended by a IMQUIC_CONFIG_DONE , e.g.:
 
void imquic_set_new_moq_connection_cb (imquic_endpoint *endpoint, void(*new_moq_connection)(imquic_connection *conn, void *user_data))
 Configure the callback function to be notified about new QUIC connections on the configured endpoint. For a server, it will be triggered any time a client successfully connects to the server; for a client, it will be triggered when the client successfully connects to the server. Notice that this precedes the MoQ setup/handshakes, which means this is where you need to configure the MoQ role via imquic_moq_set_role. You'll need to wait until the callback set in imquic_set_moq_ready_cb is fired, before being able to use the MoQ API for publishing/subscribing.
 
void imquic_set_incoming_moq_connection_cb (imquic_endpoint *endpoint, uint64_t(*incoming_moq_connection)(imquic_connection *conn, uint8_t *auth, size_t authlen))
 Configure the callback function to be notified, as a server, when a CLIENT_SETUP is received. This is a chance, for instance, to evaluate the credentials that were provided. It's the application responsibility to accept or reject the connection at this point: returning 0 will accept the connection, while returning an error code will reject and close it. Connections are automatically accepted if this callback is not configured.
 
void imquic_set_moq_ready_cb (imquic_endpoint *endpoint, void(*moq_ready)(imquic_connection *conn))
 Configure the callback function to be notified when a MoQ connection has been successfully established. After this, the MoQ APIs can be used to start exchanging MoQ messages.
 
void imquic_set_incoming_publish_namespace_cb (imquic_endpoint *endpoint, void(*incoming_publish_namespace)(imquic_connection *conn, uint64_t request_id, imquic_moq_namespace *tns, uint8_t *auth, size_t authlen))
 Configure the callback function to be notified when there's an incoming PUBLISH_NAMESPACE request.
 
void imquic_set_incoming_publish_namespace_cancel_cb (imquic_endpoint *endpoint, void(*incoming_publish_namespace_cancel)(imquic_connection *conn, imquic_moq_namespace *tns, imquic_moq_publish_namespace_error_code error_code, const char *reason))
 Configure the callback function to be notified when there's an incoming PUBLISH_NAMESPACE_CANCEL request.
 
void imquic_set_publish_namespace_accepted_cb (imquic_endpoint *endpoint, void(*publish_namespace_accepted)(imquic_connection *conn, uint64_t request_id, imquic_moq_namespace *tns))
 Configure the callback function to be notified when an PUBLISH_NAMESPACE we previously sent was accepted.
 
void imquic_set_publish_namespace_error_cb (imquic_endpoint *endpoint, void(*publish_namespace_error)(imquic_connection *conn, uint64_t request_id, imquic_moq_namespace *tns, imquic_moq_publish_namespace_error_code error_code, const char *reason))
 Configure the callback function to be notified when an PUBLISH_NAMESPACE we previously sent was rejected with an error.
 
void imquic_set_publish_namespace_done_cb (imquic_endpoint *endpoint, void(*publish_namespace_done)(imquic_connection *conn, imquic_moq_namespace *tns))
 Configure the callback function to be notified when there's an incoming PUBLISH_NAMESPACE_DONE request.
 
void imquic_set_incoming_publish_cb (imquic_endpoint *endpoint, void(*incoming_publish)(imquic_connection *conn, uint64_t request_id, imquic_moq_namespace *tns, imquic_moq_name *tn, uint64_t track_alias, gboolean descending, imquic_moq_location *largest, gboolean forward, uint8_t *auth, size_t authlen))
 Configure the callback function to be notified when there's an incoming PUBLISH request.
 
void imquic_set_publish_accepted_cb (imquic_endpoint *endpoint, void(*publish_accepted)(imquic_connection *conn, uint64_t request_id, gboolean forward, uint8_t priority, gboolean descending, imquic_moq_filter_type filter_type, imquic_moq_location *start_location, imquic_moq_location *end_location, uint8_t *auth, size_t authlen))
 Configure the callback function to be notified when a PUBLISH we previously sent was accepted.
 
void imquic_set_publish_error_cb (imquic_endpoint *endpoint, void(*publish_error)(imquic_connection *conn, uint64_t request_id, imquic_moq_pub_error_code error_code, const char *reason))
 Configure the callback function to be notified when a PUBLISH we previously sent was rejected with an error.
 
void imquic_set_incoming_subscribe_cb (imquic_endpoint *endpoint, void(*incoming_subscribe)(imquic_connection *conn, uint64_t request_id, uint64_t track_alias, imquic_moq_namespace *tns, imquic_moq_name *tn, uint8_t priority, gboolean descending, gboolean forward, imquic_moq_filter_type filter_type, imquic_moq_location *start_location, imquic_moq_location *end_location, uint8_t *auth, size_t authlen))
 Configure the callback function to be notified when there's an incoming SUBSCRIBE request.
 
void imquic_set_subscribe_accepted_cb (imquic_endpoint *endpoint, void(*subscribe_accepted)(imquic_connection *conn, uint64_t request_id, uint64_t track_alias, uint64_t expires, gboolean descending, imquic_moq_location *largest))
 Configure the callback function to be notified when a SUBSCRIBE we previously sent was accepted.
 
void imquic_set_subscribe_error_cb (imquic_endpoint *endpoint, void(*subscribe_error)(imquic_connection *conn, uint64_t request_id, imquic_moq_sub_error_code error_code, const char *reason, uint64_t track_alias))
 Configure the callback function to be notified when a SUBSCRIBE we previously sent was rejected with an error.
 
void imquic_set_subscribe_updated_cb (imquic_endpoint *endpoint, void(*subscribe_updated)(imquic_connection *conn, uint64_t request_id, uint64_t sub_request_id, imquic_moq_location *start_location, uint64_t end_group, uint8_t priority, gboolean forward))
 Configure the callback function to be notified when an update is received for a SUBSCRIBE we previously sent.
 
void imquic_set_publish_done_cb (imquic_endpoint *endpoint, void(*publish_done)(imquic_connection *conn, uint64_t request_id, imquic_moq_sub_done_code status_code, uint64_t streams_count, const char *reason))
 Configure the callback function to be notified when a PUBLISH we received or a SUBSCRIBE we sent is now done.
 
void imquic_set_incoming_unsubscribe_cb (imquic_endpoint *endpoint, void(*incoming_unsubscribe)(imquic_connection *conn, uint64_t request_id))
 Configure the callback function to be notified when there's an incoming UNSUBSCRIBE request.
 
void imquic_set_requests_blocked_cb (imquic_endpoint *endpoint, void(*requests_blocked)(imquic_connection *conn, uint64_t max_request_id))
 Configure the callback function to be notified when there's an incoming REQUESTS_BLOCKED request.
 
void imquic_set_incoming_subscribe_namespace_cb (imquic_endpoint *endpoint, void(*incoming_subscribe_namespace)(imquic_connection *conn, uint64_t request_id, imquic_moq_namespace *tns, uint8_t *auth, size_t authlen))
 Configure the callback function to be notified when there's an incoming SUBSCRIBE_NAMESPACE request.
 
void imquic_set_subscribe_namespace_accepted_cb (imquic_endpoint *endpoint, void(*subscribe_namespace_accepted)(imquic_connection *conn, uint64_t request_id, imquic_moq_namespace *tns))
 Configure the callback function to be notified when an SUBSCRIBE_NAMESPACE we previously sent was accepted.
 
void imquic_set_subscribe_namespace_error_cb (imquic_endpoint *endpoint, void(*subscribe_namespace_error)(imquic_connection *conn, uint64_t request_id, imquic_moq_namespace *tns, imquic_moq_subns_error_code error_code, const char *reason))
 Configure the callback function to be notified when an SUBSCRIBE_NAMESPACE we previously sent was rejected with an error.
 
void imquic_set_incoming_unsubscribe_namespace_cb (imquic_endpoint *endpoint, void(*incoming_unsubscribe_namespace)(imquic_connection *conn, imquic_moq_namespace *tns))
 Configure the callback function to be notified when there's an incoming UNSUBSCRIBE_NAMESPACE request.
 
void imquic_set_incoming_standalone_fetch_cb (imquic_endpoint *endpoint, void(*incoming_standalone_fetch)(imquic_connection *conn, uint64_t request_id, imquic_moq_namespace *tns, imquic_moq_name *tn, gboolean descending, imquic_moq_location_range *range, uint8_t *auth, size_t authlen))
 Configure the callback function to be notified when there's an incoming standalone FETCH request.
 
void imquic_set_incoming_joining_fetch_cb (imquic_endpoint *endpoint, void(*incoming_joining_fetch)(imquic_connection *conn, uint64_t request_id, uint64_t joining_request_id, gboolean absolute, uint64_t joining_start, gboolean descending, uint8_t *auth, size_t authlen))
 Configure the callback function to be notified when there's an incoming joining FETCH request.
 
void imquic_set_incoming_fetch_cancel_cb (imquic_endpoint *endpoint, void(*incoming_fetch_cancel)(imquic_connection *conn, uint64_t request_id))
 Configure the callback function to be notified when there's an incoming FETCH_CANCEL request.
 
void imquic_set_fetch_accepted_cb (imquic_endpoint *endpoint, void(*fetch_accepted)(imquic_connection *conn, uint64_t request_id, gboolean descending, imquic_moq_location *largest))
 Configure the callback function to be notified when an FETCH we previously sent was accepted.
 
void imquic_set_fetch_error_cb (imquic_endpoint *endpoint, void(*fetch_error)(imquic_connection *conn, uint64_t request_id, imquic_moq_fetch_error_code error_code, const char *reason))
 Configure the callback function to be notified when an FETCH we previously sent was rejected with an error.
 
void imquic_set_incoming_track_status_cb (imquic_endpoint *endpoint, void(*incoming_track_status)(imquic_connection *conn, uint64_t request_id, imquic_moq_namespace *tns, imquic_moq_name *tn, uint8_t priority, gboolean descending, gboolean forward, imquic_moq_filter_type filter_type, imquic_moq_location *start_location, imquic_moq_location *end_location, uint8_t *auth, size_t authlen))
 Configure the callback function to be notified when there's an incoming TRACK_STATUS request.
 
void imquic_set_track_status_accepted_cb (imquic_endpoint *endpoint, void(*track_status_accepted)(imquic_connection *conn, uint64_t request_id, uint64_t track_alias, uint64_t expires, gboolean descending, imquic_moq_location *largest))
 Configure the callback function to be notified when a TRACK_STATUS we previously sent was accepted.
 
void imquic_set_track_status_error_cb (imquic_endpoint *endpoint, void(*track_status_error)(imquic_connection *conn, uint64_t request_id, imquic_moq_sub_error_code error_code, const char *reason))
 Configure the callback function to be notified when a TRACK_STATUS we previously sent was rejected with an error.
 
void imquic_set_incoming_object_cb (imquic_endpoint *endpoint, void(*incoming_object)(imquic_connection *conn, imquic_moq_object *object))
 Configure the callback function to be notified when there's an incoming MoQ object, independently of how it was multiplexed on the wire.
 
void imquic_set_incoming_goaway_cb (imquic_endpoint *endpoint, void(*incoming_goaway)(imquic_connection *conn, const char *uri))
 Configure the callback function to be notified when there's an incoming GOAWAY request.
 
void imquic_set_moq_connection_gone_cb (imquic_endpoint *endpoint, void(*moq_connection_gone)(imquic_connection *conn))
 Configure the callback function to be notified when an existing MoQ connection handled by this endpoint has been closed/shut down.
 
Using the MoQ API
int imquic_moq_publish_namespace (imquic_connection *conn, uint64_t request_id, imquic_moq_namespace *tns, uint8_t *auth, size_t authlen)
 Function to send a PUBLISH_NAMESPACE request.
 
int imquic_moq_accept_publish_namespace (imquic_connection *conn, uint64_t request_id, imquic_moq_namespace *tns)
 Function to accept an incoming PUBLISH_NAMESPACE request.
 
int imquic_moq_reject_publish_namespace (imquic_connection *conn, uint64_t request_id, imquic_moq_namespace *tns, imquic_moq_publish_namespace_error_code error_code, const char *reason)
 Function to reject an incoming PUBLISH_NAMESPACE request.
 
int imquic_moq_publish_namespace_done (imquic_connection *conn, imquic_moq_namespace *tns)
 Function to send a PUBLISH_NAMESPACE_DONE request.
 
int imquic_moq_publish (imquic_connection *conn, uint64_t request_id, imquic_moq_namespace *tns, imquic_moq_name *tn, uint64_t track_alias, gboolean descending, imquic_moq_location *largest, gboolean forward, uint8_t *auth, size_t authlen)
 Function to send a PUBLISH request.
 
int imquic_moq_accept_publish (imquic_connection *conn, uint64_t request_id, gboolean forward, uint8_t priority, gboolean descending, imquic_moq_filter_type filter_type, imquic_moq_location *start_location, imquic_moq_location *end_location)
 Function to accept an incoming PUBLISH request.
 
int imquic_moq_reject_publish (imquic_connection *conn, uint64_t request_id, imquic_moq_pub_error_code error_code, const char *reason)
 Function to reject an incoming PUBLISH request.
 
int imquic_moq_subscribe (imquic_connection *conn, uint64_t request_id, uint64_t track_alias, imquic_moq_namespace *tns, imquic_moq_name *tn, uint8_t priority, gboolean descending, gboolean forward, imquic_moq_filter_type filter_type, imquic_moq_location *start_location, imquic_moq_location *end_location, uint8_t *auth, size_t authlen)
 Function to send a SUBSCRIBE request.
 
int imquic_moq_accept_subscribe (imquic_connection *conn, uint64_t request_id, uint64_t track_alias, uint64_t expires, gboolean descending, imquic_moq_location *largest)
 Function to accept an incoming SUBSCRIBE request.
 
int imquic_moq_reject_subscribe (imquic_connection *conn, uint64_t request_id, imquic_moq_sub_error_code error_code, const char *reason, uint64_t track_alias)
 Function to reject an incoming SUBSCRIBE request.
 
int imquic_moq_update_subscribe (imquic_connection *conn, uint64_t request_id, uint64_t sub_request_id, imquic_moq_location *start_location, uint64_t end_group, uint8_t priority, gboolean forward)
 Function to send a SUBSCRIBE_UPDATE request.
 
int imquic_moq_publish_done (imquic_connection *conn, uint64_t request_id, imquic_moq_sub_done_code status_code, const char *reason)
 Function to send a PUBLISH_DONE request.
 
int imquic_moq_unsubscribe (imquic_connection *conn, uint64_t request_id)
 Function to send a UNSUBSCRIBE request.
 
int imquic_moq_subscribe_namespace (imquic_connection *conn, uint64_t request_id, imquic_moq_namespace *tns, uint8_t *auth, size_t authlen)
 Function to send a SUBSCRIBE_NAMESPACE request.
 
int imquic_moq_accept_subscribe_namespace (imquic_connection *conn, uint64_t request_id, imquic_moq_namespace *tns)
 Function to accept an incoming SUBSCRIBE_NAMESPACE request.
 
int imquic_moq_reject_subscribe_namespace (imquic_connection *conn, uint64_t request_id, imquic_moq_namespace *tns, imquic_moq_subns_error_code error_code, const char *reason)
 Function to reject an incoming SUBSCRIBE_NAMESPACE request.
 
int imquic_moq_unsubscribe_namespace (imquic_connection *conn, imquic_moq_namespace *tns)
 Function to send a UNSUBSCRIBE_NAMESPACE request.
 
int imquic_moq_standalone_fetch (imquic_connection *conn, uint64_t request_id, imquic_moq_namespace *tns, imquic_moq_name *tn, gboolean descending, imquic_moq_location_range *range, uint8_t *auth, size_t authlen)
 Function to send a standalone FETCH request.
 
int imquic_moq_joining_fetch (imquic_connection *conn, uint64_t request_id, uint64_t joining_request_id, gboolean absolute, uint64_t joining_start, gboolean descending, uint8_t *auth, size_t authlen)
 Function to send a joining FETCH request.
 
int imquic_moq_accept_fetch (imquic_connection *conn, uint64_t request_id, gboolean descending, imquic_moq_location *largest)
 Function to accept an incoming FETCH request.
 
int imquic_moq_reject_fetch (imquic_connection *conn, uint64_t request_id, imquic_moq_fetch_error_code error_code, const char *reason)
 Function to reject an incoming FETCH request.
 
int imquic_moq_cancel_fetch (imquic_connection *conn, uint64_t request_id)
 Function to send a FETCH_CANCEL request.
 
int imquic_moq_track_status (imquic_connection *conn, uint64_t request_id, imquic_moq_namespace *tns, imquic_moq_name *tn, uint8_t priority, gboolean descending, gboolean forward, imquic_moq_filter_type filter_type, imquic_moq_location *start_location, imquic_moq_location *end_location, uint8_t *auth, size_t authlen)
 Function to send a TRACK_STATUS request.
 
int imquic_moq_accept_track_status (imquic_connection *conn, uint64_t request_id, uint64_t track_alias, uint64_t expires, gboolean descending, imquic_moq_location *largest)
 Function to accept an incoming TRACK_STATUS request.
 
int imquic_moq_reject_track_status (imquic_connection *conn, uint64_t request_id, imquic_moq_sub_error_code error_code, const char *reason)
 Function to reject an incoming TRACK_STATUS request.
 
int imquic_moq_send_object (imquic_connection *conn, imquic_moq_object *object)
 Function to send a MoQ object.
 
int imquic_moq_requests_blocked (imquic_connection *conn)
 Function to send a REQUESTS_BLOCKED request.
 
int imquic_moq_goaway (imquic_connection *conn, const char *uri)
 Function to send a GOAWAY request.
 

MoQ resources

enum  imquic_moq_filter_type { IMQUIC_MOQ_FILTER_NEXT_GROUP_START = 0x1 , IMQUIC_MOQ_FILTER_LARGEST_OBJECT = 0x2 , IMQUIC_MOQ_FILTER_ABSOLUTE_START = 0x3 , IMQUIC_MOQ_FILTER_ABSOLUTE_RANGE = 0x4 }
 MoQ filter type, for subscriptions. More...
 
enum  imquic_moq_delivery { IMQUIC_MOQ_USE_DATAGRAM , IMQUIC_MOQ_USE_SUBGROUP , IMQUIC_MOQ_USE_TRACK , IMQUIC_MOQ_USE_FETCH }
 Ways of sending objects. More...
 
enum  imquic_moq_object_status {
  IMQUIC_MOQ_NORMAL_OBJECT = 0x0 , IMQUIC_MOQ_OBJECT_DOESNT_EXIST = 0x1 , IMQUIC_MOQ_END_OF_GROUP = 0x3 , IMQUIC_MOQ_END_OF_TRACK_AND_GROUP = 0x4 ,
  IMQUIC_MOQ_END_OF_TRACK = 0x5
}
 MoQ Object status. More...
 
enum  imquic_moq_extension_type { IMQUIC_MOQ_EXT_PRIOR_GROUP_ID_GAP = 0x3C , IMQUIC_MOQ_EXT_PRIOR_OBJECT_ID_GAP = 0x3E , IMQUIC_MOQ_EXT_IMMUTABLE_EXTENSIONS = 0xB }
 Known MoQ Object Extension header types. More...
 
typedef struct imquic_moq_namespace imquic_moq_namespace
 MoQ Track Namespace.
 
typedef struct imquic_moq_name imquic_moq_name
 MoQ Track Name.
 
typedef enum imquic_moq_filter_type imquic_moq_filter_type
 MoQ filter type, for subscriptions.
 
typedef struct imquic_moq_location imquic_moq_location
 MoQ Group/Object couple (for ranges)
 
typedef struct imquic_moq_location_range imquic_moq_location_range
 MoQ location range (from where to where, e.g., for FETCH)
 
typedef enum imquic_moq_delivery imquic_moq_delivery
 Ways of sending objects.
 
typedef enum imquic_moq_object_status imquic_moq_object_status
 MoQ Object status.
 
typedef struct imquic_moq_object_extension imquic_moq_object_extension
 MoQ Object Extension.
 
typedef enum imquic_moq_extension_type imquic_moq_extension_type
 Known MoQ Object Extension header types.
 
typedef struct imquic_moq_object imquic_moq_object
 MoQ Object.
 
const char * imquic_moq_namespace_str (imquic_moq_namespace *tns, char *buffer, size_t blen, gboolean tuple)
 Helper to stringify a namespace (optionally the whole tuple)
 
const char * imquic_moq_track_str (imquic_moq_name *tn, char *buffer, size_t blen)
 
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_delivery_str (imquic_moq_delivery type)
 Helper function to serialize to string the name of a imquic_moq_delivery property.
 
const char * imquic_moq_object_status_str (imquic_moq_object_status status)
 Helper function to serialize to string the name of a imquic_moq_object_status property.
 
GList * imquic_moq_parse_object_extensions (uint8_t *extensions, size_t elen)
 Helper mode to parse an extensions buffer to a GList of imquic_moq_object_extension.
 
size_t imquic_moq_build_object_extensions (GList *extensions, uint8_t *bytes, size_t blen)
 Helper mode to craft an extensions buffer out of a GList of imquic_moq_object_extension.
 
const char * imquic_moq_extension_type_str (imquic_moq_extension_type type)
 Helper function to serialize to string the name of a imquic_moq_extension_type value.
 

MoQ error and status codes

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_INVALID_REQUEST_ID = 0x4 , IMQUIC_MOQ_DUPLICATE_TRACK_ALIAS = 0x5 , IMQUIC_MOQ_KEYVALUE_FORMATTING_ERROR = 0x6 , IMQUIC_MOQ_TOO_MANY_REQUESTS = 0x7 ,
  IMQUIC_MOQ_INVALID_PATH = 0x8 , IMQUIC_MOQ_MALFORMED_PATH = 0x9 , IMQUIC_MOQ_GOAWAY_TIMEOUT = 0x10 , IMQUIC_MOQ_CONTROL_MESSAGE_TIMEOUT = 0x11 ,
  IMQUIC_MOQ_DATA_STREAM_TIMEOUT = 0x12 , IMQUIC_MOQ_AUTH_TOKEN_CACHE_OVERFLOW = 0x13 , IMQUIC_MOQ_DUPLICATE_AUTH_TOKEN_ALIAS = 0x14 , IMQUIC_MOQ_VERSION_NEGOTIATION_FAILED = 0x15 ,
  IMQUIC_MOQ_MALFORMED_AUTH_TOKEN = 0x16 , IMQUIC_MOQ_UNKNOWN_AUTH_TOKEN_ALIAS = 0x17 , IMQUIC_MOQ_EXPIRED_AUTH_TOKEN = 0x18 , IMQUIC_MOQ_INVALID_AUTHORITY = 0x19 ,
  IMQUIC_MOQ_MALFORMED_AUTHORITY = 0x1A , IMQUIC_MOQ_UNKNOWN_ERROR = 0xFF
}
 Generic error codes. More...
 
enum  imquic_moq_publish_namespace_error_code {
  IMQUIC_MOQ_PUBNSERR_INTERNAL_ERROR = 0x0 , IMQUIC_MOQ_PUBNSERR_UNAUTHORIZED = 0x1 , IMQUIC_MOQ_PUBNSERR_TIMEOUT = 0x2 , IMQUIC_MOQ_PUBNSERR_NOT_SUPPORTED = 0x3 ,
  IMQUIC_MOQ_PUBNSERR_UNINTERESTED = 0x4 , IMQUIC_MOQ_PUBNSERR_MALFORMED_AUTH_TOKEN = 0x10 , IMQUIC_MOQ_PUBNSERR_UNKNOWN_AUTH_TOKEN_ALIAS = 0x11 , IMQUIC_MOQ_PUBNSERR_EXPIRED_AUTH_TOKEN = 0x12
}
 Publish Namespace error codes. More...
 
enum  imquic_moq_pub_error_code {
  IMQUIC_MOQ_PUBERR_INTERNAL_ERROR = 0x0 , IMQUIC_MOQ_PUBERR_UNAUTHORIZED = 0x1 , IMQUIC_MOQ_PUBERR_TIMEOUT = 0x2 , IMQUIC_MOQ_PUBERR_NOT_SUPPORTED = 0x3 ,
  IMQUIC_MOQ_PUBERR_UNINTERESTED = 0x4
}
 Publish error codes. More...
 
enum  imquic_moq_sub_error_code {
  IMQUIC_MOQ_SUBERR_INTERNAL_ERROR = 0x0 , IMQUIC_MOQ_SUBERR_UNAUTHORIZED = 0x1 , IMQUIC_MOQ_SUBERR_TIMEOUT = 0x2 , IMQUIC_MOQ_SUBERR_NOT_SUPPORTED = 0x3 ,
  IMQUIC_MOQ_SUBERR_TRACK_DOES_NOT_EXIST = 0x4 , IMQUIC_MOQ_SUBERR_INVALID_RANGE = 0x5 , IMQUIC_MOQ_SUBERR_RETRY_TRACK_ALIAS = 0x6 , IMQUIC_MOQ_SUBERR_MALFORMED_AUTH_TOKEN = 0x10 ,
  IMQUIC_MOQ_SUBERR_UNKNOWN_AUTH_TOKEN_ALIAS = 0x11 , IMQUIC_MOQ_SUBERR_EXPIRED_AUTH_TOKEN = 0x12
}
 Subscribe error codes. More...
 
enum  imquic_moq_subns_error_code {
  IMQUIC_MOQ_SUBNSERR_INTERNAL_ERROR = 0x0 , IMQUIC_MOQ_SUBNSERR_UNAUTHORIZED = 0x1 , IMQUIC_MOQ_SUBNSERR_TIMEOUT = 0x2 , IMQUIC_MOQ_SUBNSERR_NOT_SUPPORTED = 0x3 ,
  IMQUIC_MOQ_SUBNSERR_NAMESPACE_PREFIX_UNKNOWN = 0x4 , IMQUIC_MOQ_SUBNSERR_MALFORMED_AUTH_TOKEN = 0x10 , IMQUIC_MOQ_SUBNSERR_UNKNOWN_AUTH_TOKEN_ALIAS = 0x11 , IMQUIC_MOQ_SUBNSERR_EXPIRED_AUTH_TOKEN = 0x12
}
 Subscribe namespaces error codes. More...
 
enum  imquic_moq_fetch_error_code {
  IMQUIC_MOQ_FETCHERR_INTERNAL_ERROR = 0x0 , IMQUIC_MOQ_FETCHERR_UNAUTHORIZED = 0x1 , IMQUIC_MOQ_FETCHERR_TIMEOUT = 0x2 , IMQUIC_MOQ_FETCHERR_NOT_SUPPORTED = 0x3 ,
  IMQUIC_MOQ_FETCHERR_TRACK_DOES_NOT_EXIST = 0x4 , IMQUIC_MOQ_FETCHERR_INVALID_RANGE = 0x5 , IMQUIC_MOQ_FETCHERR_NO_OBJECTS = 0x6 , IMQUIC_MOQ_FETCHERR_INVALID_JOINING_REQUEST_ID = 0x7 ,
  IMQUIC_MOQ_FETCHERR_UNKNOWN_STATUS_IN_RANGE = 0x8 , IMQUIC_MOQ_FETCHERR_MALFORMED_TRACK = 0x9 , IMQUIC_MOQ_FETCHERR_MALFORMED_AUTH_TOKEN = 0x10 , IMQUIC_MOQ_FETCHERR_UNKNOWN_AUTH_TOKEN_ALIAS = 0x11 ,
  IMQUIC_MOQ_FETCHERR_EXPIRED_AUTH_TOKEN = 0x12
}
 Fetch error codes. More...
 
enum  imquic_moq_sub_done_code {
  IMQUIC_MOQ_SUBDONE_INTERNAL_ERROR = 0x0 , IMQUIC_MOQ_SUBDONE_UNAUTHORIZED = 0x1 , IMQUIC_MOQ_SUBDONE_TRACK_ENDED = 0x2 , IMQUIC_MOQ_SUBDONE_SUBSCRIPTION_ENDED = 0x3 ,
  IMQUIC_MOQ_SUBDONE_GOING_AWAY = 0x4 , IMQUIC_MOQ_SUBDONE_EXPIRED = 0x5 , IMQUIC_MOQ_SUBDONE_TOO_FAR_BEHIND = 0x6 , IMQUIC_MOQ_SUBDONE_MALFORMED_TRACK = 0x7
}
 Subscribe done codes. More...
 
typedef enum imquic_moq_error_code imquic_moq_error_code
 Generic error codes.
 
typedef enum imquic_moq_publish_namespace_error_code imquic_moq_publish_namespace_error_code
 Publish Namespace error codes.
 
typedef enum imquic_moq_pub_error_code imquic_moq_pub_error_code
 Publish error codes.
 
typedef enum imquic_moq_sub_error_code imquic_moq_sub_error_code
 Subscribe error codes.
 
typedef enum imquic_moq_subns_error_code imquic_moq_subns_error_code
 Subscribe namespaces error codes.
 
typedef enum imquic_moq_fetch_error_code imquic_moq_fetch_error_code
 Fetch error codes.
 
typedef enum imquic_moq_sub_done_code imquic_moq_sub_done_code
 Subscribe done codes.
 
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_publish_namespace_error_code_str (imquic_moq_publish_namespace_error_code code)
 Helper function to serialize to string the name of a imquic_moq_publish_namespace_error_code value.
 
const char * imquic_moq_pub_error_code_str (imquic_moq_pub_error_code code)
 Helper function to serialize to string the name of a imquic_moq_pub_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_sub_error_code value.
 
const char * imquic_moq_subns_error_code_str (imquic_moq_subns_error_code code)
 Helper function to serialize to string the name of a imquic_moq_subns_error_code value.
 
const char * imquic_moq_fetch_error_code_str (imquic_moq_fetch_error_code code)
 Helper function to serialize to string the name of a imquic_moq_fetch_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.
 

Detailed Description

imquic MoQ public interface (headers)

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

Public interface to the Media Over QUIC (MoQ) native support in the imquic library. This is where public functions are callbacks to interact with the MoQ features of the library are defined.

Typedef Documentation

◆ imquic_moq_auth_token

typedef struct imquic_moq_auth_token imquic_moq_auth_token

MoQ Authorization Token.

◆ imquic_moq_auth_token_alias_type

MoQ Authorization Token Alias Type.

◆ imquic_moq_delivery

Ways of sending objects.

◆ imquic_moq_error_code

Generic error codes.

◆ imquic_moq_extension_type

Known MoQ Object Extension header types.

Note
The library will not try to interpret extensions and their payload: this is always left up to applications

◆ imquic_moq_fetch_error_code

◆ imquic_moq_filter_type

MoQ filter type, for subscriptions.

◆ imquic_moq_location

typedef struct imquic_moq_location imquic_moq_location

MoQ Group/Object couple (for ranges)

◆ imquic_moq_location_range

typedef struct imquic_moq_location_range imquic_moq_location_range

MoQ location range (from where to where, e.g., for FETCH)

◆ imquic_moq_name

typedef struct imquic_moq_name imquic_moq_name

MoQ Track Name.

◆ imquic_moq_namespace

typedef struct imquic_moq_namespace imquic_moq_namespace

MoQ Track Namespace.

◆ imquic_moq_object

typedef struct imquic_moq_object imquic_moq_object

MoQ Object.

Note
This may contain info related to different MoQ versions, and so should be considered a higher level abstraction that the internal MoQ stack may (and often will) use and notify differently

◆ imquic_moq_object_extension

typedef struct imquic_moq_object_extension imquic_moq_object_extension

MoQ Object Extension.

Note
This may contain info related to different MoQ versions, and so should be considered a higher level abstraction that the internal MoQ stack may (and often will) use and notify differently

◆ imquic_moq_object_status

MoQ Object status.

◆ imquic_moq_pub_error_code

Publish error codes.

◆ imquic_moq_publish_namespace_error_code

◆ imquic_moq_role

Roles that can be specified once connected.

◆ imquic_moq_sub_done_code

Subscribe done codes.

◆ imquic_moq_sub_error_code

Subscribe error codes.

◆ imquic_moq_subns_error_code

Subscribe namespaces error codes.

◆ imquic_moq_version

Versions that can be negotiated.

Enumeration Type Documentation

◆ imquic_moq_auth_token_alias_type

MoQ Authorization Token Alias Type.

Enumerator
IMQUIC_MOQ_AUTH_TOKEN_DELETE 

DELETE.

IMQUIC_MOQ_AUTH_TOKEN_REGISTER 

REGISTER.

IMQUIC_MOQ_AUTH_TOKEN_USE_ALIAS 

USE_ALIAS.

IMQUIC_MOQ_AUTH_TOKEN_USE_VALUE 

USE_VALUE.

◆ imquic_moq_delivery

Ways of sending objects.

Enumerator
IMQUIC_MOQ_USE_DATAGRAM 

A single object on a DATAGRAM.

IMQUIC_MOQ_USE_SUBGROUP 

All objects of the same subgroup on the same STREAM.

IMQUIC_MOQ_USE_TRACK 

All objects of the same track on the same STREAM (only v06)

IMQUIC_MOQ_USE_FETCH 

All fetched objects on the same STREAM (starting from v07)

◆ 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_INVALID_REQUEST_ID 
IMQUIC_MOQ_DUPLICATE_TRACK_ALIAS 
IMQUIC_MOQ_KEYVALUE_FORMATTING_ERROR 
IMQUIC_MOQ_TOO_MANY_REQUESTS 
IMQUIC_MOQ_INVALID_PATH 
IMQUIC_MOQ_MALFORMED_PATH 
IMQUIC_MOQ_GOAWAY_TIMEOUT 
IMQUIC_MOQ_CONTROL_MESSAGE_TIMEOUT 
IMQUIC_MOQ_DATA_STREAM_TIMEOUT 
IMQUIC_MOQ_AUTH_TOKEN_CACHE_OVERFLOW 
IMQUIC_MOQ_DUPLICATE_AUTH_TOKEN_ALIAS 
IMQUIC_MOQ_VERSION_NEGOTIATION_FAILED 
IMQUIC_MOQ_MALFORMED_AUTH_TOKEN 
IMQUIC_MOQ_UNKNOWN_AUTH_TOKEN_ALIAS 
IMQUIC_MOQ_EXPIRED_AUTH_TOKEN 
IMQUIC_MOQ_INVALID_AUTHORITY 
IMQUIC_MOQ_MALFORMED_AUTHORITY 
IMQUIC_MOQ_UNKNOWN_ERROR 

◆ imquic_moq_extension_type

Known MoQ Object Extension header types.

Note
The library will not try to interpret extensions and their payload: this is always left up to applications
Enumerator
IMQUIC_MOQ_EXT_PRIOR_GROUP_ID_GAP 
IMQUIC_MOQ_EXT_PRIOR_OBJECT_ID_GAP 
IMQUIC_MOQ_EXT_IMMUTABLE_EXTENSIONS 

◆ imquic_moq_fetch_error_code

Fetch error codes.

Enumerator
IMQUIC_MOQ_FETCHERR_INTERNAL_ERROR 
IMQUIC_MOQ_FETCHERR_UNAUTHORIZED 
IMQUIC_MOQ_FETCHERR_TIMEOUT 
IMQUIC_MOQ_FETCHERR_NOT_SUPPORTED 
IMQUIC_MOQ_FETCHERR_TRACK_DOES_NOT_EXIST 
IMQUIC_MOQ_FETCHERR_INVALID_RANGE 
IMQUIC_MOQ_FETCHERR_NO_OBJECTS 
IMQUIC_MOQ_FETCHERR_INVALID_JOINING_REQUEST_ID 
IMQUIC_MOQ_FETCHERR_UNKNOWN_STATUS_IN_RANGE 
IMQUIC_MOQ_FETCHERR_MALFORMED_TRACK 
IMQUIC_MOQ_FETCHERR_MALFORMED_AUTH_TOKEN 
IMQUIC_MOQ_FETCHERR_UNKNOWN_AUTH_TOKEN_ALIAS 
IMQUIC_MOQ_FETCHERR_EXPIRED_AUTH_TOKEN 

◆ imquic_moq_filter_type

MoQ filter type, for subscriptions.

Enumerator
IMQUIC_MOQ_FILTER_NEXT_GROUP_START 
IMQUIC_MOQ_FILTER_LARGEST_OBJECT 
IMQUIC_MOQ_FILTER_ABSOLUTE_START 
IMQUIC_MOQ_FILTER_ABSOLUTE_RANGE 

◆ imquic_moq_object_status

MoQ Object status.

Enumerator
IMQUIC_MOQ_NORMAL_OBJECT 

Normal object.

IMQUIC_MOQ_OBJECT_DOESNT_EXIST 

Object doesn't exist.

IMQUIC_MOQ_END_OF_GROUP 

End of group.

IMQUIC_MOQ_END_OF_TRACK_AND_GROUP 

End of track and group.

IMQUIC_MOQ_END_OF_TRACK 

End of track.

◆ imquic_moq_pub_error_code

Publish error codes.

Enumerator
IMQUIC_MOQ_PUBERR_INTERNAL_ERROR 
IMQUIC_MOQ_PUBERR_UNAUTHORIZED 
IMQUIC_MOQ_PUBERR_TIMEOUT 
IMQUIC_MOQ_PUBERR_NOT_SUPPORTED 
IMQUIC_MOQ_PUBERR_UNINTERESTED 

◆ imquic_moq_publish_namespace_error_code

Publish Namespace error codes.

Enumerator
IMQUIC_MOQ_PUBNSERR_INTERNAL_ERROR 
IMQUIC_MOQ_PUBNSERR_UNAUTHORIZED 
IMQUIC_MOQ_PUBNSERR_TIMEOUT 
IMQUIC_MOQ_PUBNSERR_NOT_SUPPORTED 
IMQUIC_MOQ_PUBNSERR_UNINTERESTED 
IMQUIC_MOQ_PUBNSERR_MALFORMED_AUTH_TOKEN 
IMQUIC_MOQ_PUBNSERR_UNKNOWN_AUTH_TOKEN_ALIAS 
IMQUIC_MOQ_PUBNSERR_EXPIRED_AUTH_TOKEN 

◆ imquic_moq_role

Roles that can be specified once connected.

Enumerator
IMQUIC_MOQ_ENDPOINT 
IMQUIC_MOQ_PUBLISHER 
IMQUIC_MOQ_SUBSCRIBER 
IMQUIC_MOQ_PUBSUB 

◆ imquic_moq_sub_done_code

Subscribe done codes.

Enumerator
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_SUBDONE_TOO_FAR_BEHIND 
IMQUIC_MOQ_SUBDONE_MALFORMED_TRACK 

◆ imquic_moq_sub_error_code

Subscribe error codes.

Enumerator
IMQUIC_MOQ_SUBERR_INTERNAL_ERROR 
IMQUIC_MOQ_SUBERR_UNAUTHORIZED 
IMQUIC_MOQ_SUBERR_TIMEOUT 
IMQUIC_MOQ_SUBERR_NOT_SUPPORTED 
IMQUIC_MOQ_SUBERR_TRACK_DOES_NOT_EXIST 
IMQUIC_MOQ_SUBERR_INVALID_RANGE 
IMQUIC_MOQ_SUBERR_RETRY_TRACK_ALIAS 
IMQUIC_MOQ_SUBERR_MALFORMED_AUTH_TOKEN 
IMQUIC_MOQ_SUBERR_UNKNOWN_AUTH_TOKEN_ALIAS 
IMQUIC_MOQ_SUBERR_EXPIRED_AUTH_TOKEN 

◆ imquic_moq_subns_error_code

Subscribe namespaces error codes.

Enumerator
IMQUIC_MOQ_SUBNSERR_INTERNAL_ERROR 
IMQUIC_MOQ_SUBNSERR_UNAUTHORIZED 
IMQUIC_MOQ_SUBNSERR_TIMEOUT 
IMQUIC_MOQ_SUBNSERR_NOT_SUPPORTED 
IMQUIC_MOQ_SUBNSERR_NAMESPACE_PREFIX_UNKNOWN 
IMQUIC_MOQ_SUBNSERR_MALFORMED_AUTH_TOKEN 
IMQUIC_MOQ_SUBNSERR_UNKNOWN_AUTH_TOKEN_ALIAS 
IMQUIC_MOQ_SUBNSERR_EXPIRED_AUTH_TOKEN 

◆ imquic_moq_version

Versions that can be negotiated.

Enumerator
IMQUIC_MOQ_VERSION_BASE 
IMQUIC_MOQ_VERSION_MIN 
IMQUIC_MOQ_VERSION_06 
IMQUIC_MOQ_VERSION_07 
IMQUIC_MOQ_VERSION_08 
IMQUIC_MOQ_VERSION_09 
IMQUIC_MOQ_VERSION_10 
IMQUIC_MOQ_VERSION_11 
IMQUIC_MOQ_VERSION_12 
IMQUIC_MOQ_VERSION_13 
IMQUIC_MOQ_VERSION_14 
IMQUIC_MOQ_VERSION_MAX 
IMQUIC_MOQ_VERSION_ANY 
IMQUIC_MOQ_VERSION_ANY_LEGACY 

Function Documentation

◆ imquic_create_moq_client()

imquic_client * imquic_create_moq_client ( const char * name,
... )

Method to create a new MoQ client, using variable arguments to dictate what the client should do (e.g., address to connect to, ALPN, etc.). Variable arguments are in the form of a sequence of name-value started with a IMQUIC_CONFIG_INIT and ended by a IMQUIC_CONFIG_DONE , e.g.:

       imquic_server *client = imquic_create_moq_client("moq-sub",
        IMQUIC_CONFIG_INIT,
        IMQUIC_CONFIG_TLS_CERT, cert_pem,
        IMQUIC_CONFIG_TLS_KEY, cert_key,
        IMQUIC_CONFIG_TLS_PASSWORD, cert_pwd,
        IMQUIC_CONFIG_REMOTE_HOST, "127.0.0.1",
        IMQUIC_CONFIG_REMOTE_PORT, 9000,
        IMQUIC_CONFIG_WEBTRANSPORT, TRUE,
        IMQUIC_CONFIG_HTTP3_PATH, "/moq",
        IMQUIC_CONFIG_DONE, NULL);

to create a QUIC client that will automatically negotiate MoQ over WebTransport. Notice that the MoQ role (publisher, subscriber or relay) is not set here: this is only specifying the QUIC role (client). For the MoQ role, see the imquic_set_new_moq_connection_cb callback and imquic_moq_set_role. Again, as with imquic_create_client this will only create the resource, but not actually start the connection: before doing that, you'll need to configure the callbacks for the events you're interested in (in this case, MoQ specific), and then use imquic_start_endpoint to start the QUIC client (which will attempt a connection).

Note
This will create a full, internal, MoQ stack on top of imquic, meaning that the MoQ Transport protocol will be handled natively by imquic for you, providing a high level interface to the features of the protocol itself. If you want to only use imquic as a QUIC/WebTrasport protocol, and implement MoQ yourself, then you'll need to use imquic_create_server or imquic_create_client instead.
Parameters
[in]nameThe endpoint name (if NULL, a default value will be set)
Returns
A pointer to a imquic_client object, if successful, NULL otherwise

◆ imquic_create_moq_server()

imquic_server * imquic_create_moq_server ( const char * name,
... )

Method to create a new MoQ server, using variable arguments to dictate what the server should do (e.g., port to bind to, ALPN, etc.). Variable arguments are in the form of a sequence of name-value started with a IMQUIC_CONFIG_INIT and ended by a IMQUIC_CONFIG_DONE , e.g.:

       imquic_server *server = imquic_create_moq_server("moq-relay",
        IMQUIC_CONFIG_INIT,
        IMQUIC_CONFIG_TLS_CERT, cert_pem,
        IMQUIC_CONFIG_TLS_KEY, cert_key,
        IMQUIC_CONFIG_TLS_PASSWORD, cert_pwd,
        IMQUIC_CONFIG_LOCAL_PORT, 9000,
        IMQUIC_CONFIG_WEBTRANSPORT, TRUE,
        IMQUIC_CONFIG_DONE, NULL);

to create a QUIC server that will automatically negotiate MoQ over WebTransport. Notice that the MoQ role (publisher, subscriber or relay) is not set here: this is only specifying the QUIC role (server). For the MoQ role, see the imquic_set_new_moq_connection_cb callback and imquic_moq_set_role. Again, as with imquic_create_server this will only create the resource, but not actually start the server: before doing that, you'll need to configure the callbacks for the events you're interested in (in this case, MoQ specific), and then use imquic_start_endpoint to start the QUIC server (which will wait for incoming connections).

Note
This will create a full, internal, MoQ stack on top of imquic, meaning that the MoQ Transport protocol will be handled natively by imquic for you, providing a high level interface to the features of the protocol itself. If you want to only use imquic as a QUIC/WebTrasport protocol, and implement MoQ yourself, then you'll need to use imquic_create_server or imquic_create_client instead.
Parameters
[in]nameThe endpoint name (if NULL, a default value will be set)
Returns
A pointer to a imquic_server object, if successful, NULL otherwise

◆ imquic_moq_accept_fetch()

int imquic_moq_accept_fetch ( imquic_connection * conn,
uint64_t request_id,
gboolean descending,
imquic_moq_location * largest )

Function to accept an incoming FETCH request.

Parameters
connThe imquic_connection to send the request on
request_idThe unique request_id value associated to the subscription to accept
descendingWhether objects will be delivered in descending group order
largestThe largest group/object IDs
Returns
0 in case of success, a negative integer otherwise

◆ imquic_moq_accept_publish()

int imquic_moq_accept_publish ( imquic_connection * conn,
uint64_t request_id,
gboolean forward,
uint8_t priority,
gboolean descending,
imquic_moq_filter_type filter_type,
imquic_moq_location * start_location,
imquic_moq_location * end_location )

Function to accept an incoming PUBLISH request.

Parameters
connThe imquic_connection to send the request on
request_idThe unique request_id value associated to the subscription to accept
forwardWhether objects should be forwarded, when this subscription is accepted (ignored before v11)
priorityThe publishr priority
descendingWhether objects should be fetched in descending order, per each group
filter_typeThe subscription filter type
start_locationThe group and object to start from (ignored if the filter is not AbsoluteStart or AbsoluteRange)
end_locationThe group (and for v06/v07 the object) to end at (ignored if the filter is not AbsoluteRange)
Returns
0 in case of success, a negative integer otherwise

◆ imquic_moq_accept_publish_namespace()

int imquic_moq_accept_publish_namespace ( imquic_connection * conn,
uint64_t request_id,
imquic_moq_namespace * tns )

Function to accept an incoming PUBLISH_NAMESPACE request.

Parameters
connThe imquic_connection to send the request on
request_idThe request ID of the original PUBLISH_NAMESPACE request (only v11 and later)
tnsThe imquic_moq_namespace namespace to accept (only before v11)
Returns
0 in case of success, a negative integer otherwise

◆ imquic_moq_accept_subscribe()

int imquic_moq_accept_subscribe ( imquic_connection * conn,
uint64_t request_id,
uint64_t track_alias,
uint64_t expires,
gboolean descending,
imquic_moq_location * largest )

Function to accept an incoming SUBSCRIBE request.

Parameters
connThe imquic_connection to send the request on
request_idThe unique request_id value associated to the subscription to accept
track_aliasThe unique track_alias value associated to the subscription to accept (ignored before v12)
expiresValue of expires to send back
descendingWhether objects will be delivered in descending group order
largestThe largest group/object IDs, in case content exists
Returns
0 in case of success, a negative integer otherwise

◆ imquic_moq_accept_subscribe_namespace()

int imquic_moq_accept_subscribe_namespace ( imquic_connection * conn,
uint64_t request_id,
imquic_moq_namespace * tns )

Function to accept an incoming SUBSCRIBE_NAMESPACE request.

Parameters
connThe imquic_connection to send the request on
request_idThe request ID of the original SUBSCRIBE_NAMESPACE request (only v11 and later)
tnsThe imquic_moq_namespace namespace to accept notifications for (only before v11)
Returns
0 in case of success, a negative integer otherwise

◆ imquic_moq_accept_track_status()

int imquic_moq_accept_track_status ( imquic_connection * conn,
uint64_t request_id,
uint64_t track_alias,
uint64_t expires,
gboolean descending,
imquic_moq_location * largest )

Function to accept an incoming TRACK_STATUS request.

Note
Due to considerable changes between v12 and v13 on TRACK_STATUS , support for this request is disabled in versions earlier than v13
Parameters
connThe imquic_connection to send the request on
request_idThe unique request_id value associated to the subscription to accept
track_aliasThe unique track_alias value associated to the subscription to accept
expiresValue of expires to send back
descendingWhether objects will be delivered in descending group order
largestThe largest group/object IDs, in case content exists
Returns
0 in case of success, a negative integer otherwise

◆ imquic_moq_auth_token_alias_type_str()

const char * imquic_moq_auth_token_alias_type_str ( imquic_moq_auth_token_alias_type type)

Helper function to serialize to string the name of a imquic_moq_auth_token_alias_type property.

Parameters
typeThe imquic_moq_auth_token_alias_type property
Returns
The type name as a string, if valid, or NULL otherwise

◆ imquic_moq_build_auth_token()

size_t imquic_moq_build_auth_token ( imquic_moq_auth_token * token,
uint8_t * bytes,
size_t blen )

Helper mode to craft an auth token buffer out of a imquic_moq_auth_token instance.

Parameters
[in]tokenThe imquic_moq_auth_token instance to serialize
[out]bytesThe buffer to write the auth token to
[in]blenThe size of the buffer to write to
Returns
How many bytes were written, if successful

◆ imquic_moq_build_object_extensions()

size_t imquic_moq_build_object_extensions ( GList * extensions,
uint8_t * bytes,
size_t blen )

Helper mode to craft an extensions buffer out of a GList of imquic_moq_object_extension.

Parameters
[in]extensionsThe list of extensions to serialize
[out]bytesThe buffer to write the extensions data to
[in]blenThe size of the buffer to write to
Returns
How many bytes were written, if successful

◆ imquic_moq_cancel_fetch()

int imquic_moq_cancel_fetch ( imquic_connection * conn,
uint64_t request_id )

Function to send a FETCH_CANCEL request.

Parameters
connThe imquic_connection to send the request on
request_idThe unique request_id value associated to the subscription to cancel_fetch from
Returns
0 in case of success, a negative integer otherwise

◆ imquic_moq_delivery_str()

const char * imquic_moq_delivery_str ( imquic_moq_delivery type)

Helper function to serialize to string the name of a imquic_moq_delivery property.

Parameters
typeThe imquic_moq_delivery property
Returns
The type name as a string, if valid, or NULL otherwise

◆ 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_extension_type_str()

const char * imquic_moq_extension_type_str ( imquic_moq_extension_type type)

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

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

◆ imquic_moq_fetch_error_code_str()

const char * imquic_moq_fetch_error_code_str ( imquic_moq_fetch_error_code code)

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

Parameters
codeThe imquic_moq_fetch_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_get_next_request_id()

uint64_t imquic_moq_get_next_request_id ( imquic_connection * conn)

Helper function to get the next Request ID we can use.

Parameters
connThe imquic_connection to query
Returns
The next Request ID

◆ imquic_moq_get_role()

imquic_moq_role imquic_moq_get_role ( imquic_connection * conn)

Helper function to get the MoQ role associated with a connection.

Parameters
connThe imquic_connection to query
Returns
The imquic_moq_role value

◆ imquic_moq_get_version()

imquic_moq_version imquic_moq_get_version ( imquic_connection * conn)

Helper function to get the MoQ version associated with a connection.

Parameters
connThe imquic_connection to query
Returns
The imquic_moq_version value

◆ imquic_moq_goaway()

int imquic_moq_goaway ( imquic_connection * conn,
const char * uri )

Function to send a GOAWAY request.

Parameters
connThe imquic_connection to send the request on
uriWhere the client can connect to continue the session
Returns
0 in case of success, a negative integer otherwise

◆ imquic_moq_joining_fetch()

int imquic_moq_joining_fetch ( imquic_connection * conn,
uint64_t request_id,
uint64_t joining_request_id,
gboolean absolute,
uint64_t joining_start,
gboolean descending,
uint8_t * auth,
size_t authlen )

Function to send a joining FETCH request.

Parameters
connThe imquic_connection to send the request on
request_idA unique numeric identifier to associate to this subscription
joining_request_idExisting subscription to join
absoluteWhether this is an absolute or relative joining FETCH
joining_startHow many groups to retrieve before the current one, for relative joins, or starting group ID for absolute joins
descendingWhether objects should be fetched in descending group order
authThe authentication info, if any
authlenThe size of the authentication info, if any
Returns
0 in case of success, a negative integer otherwise

◆ imquic_moq_namespace_str()

const char * imquic_moq_namespace_str ( imquic_moq_namespace * tns,
char * buffer,
size_t blen,
gboolean tuple )

Helper to stringify a namespace (optionally the whole tuple)

Note
If tuple is FALSE, the next property of the namespace is ignored, otherwise a single string is built for the whole tuple, using a slash character as a separator.
Parameters
[in]tnsThe namespace (or the start of a namespace tuple) to stringify
[out]bufferThe buffer to write the string to
[in]blenThe size of the output buffer
[in]tupleWhether the whole tuple should be stringified, or only the specific namespace
Returns
A pointer to the output buffer, if successful, or NULL otherwise

◆ imquic_moq_object_status_str()

const char * imquic_moq_object_status_str ( imquic_moq_object_status status)

Helper function to serialize to string the name of a imquic_moq_object_status property.

Parameters
statusThe imquic_moq_object_status property
Returns
The type name as a string, if valid, or NULL otherwise

◆ imquic_moq_parse_auth_token()

int imquic_moq_parse_auth_token ( uint8_t * bytes,
size_t blen,
imquic_moq_auth_token * token )

Helper mode to parse an auth token buffer to a imquic_moq_auth_token instance.

Note
The buffer in the value property will point to data in the original bytes buffer, which means that no allocation will be performed by this method. If you need to store the token value somewhere, it's up to you to copy it before bytes is invalidated by the application
Parameters
[in]bytesThe buffer containing the auth token data
[in]blenThe size of the buffer containing the auth token data data
[out]tokenThe imquic_moq_auth_token to put the parsed token info to
Returns
0 in case of success, or a negative integer otherwise

◆ imquic_moq_parse_object_extensions()

GList * imquic_moq_parse_object_extensions ( uint8_t * extensions,
size_t elen )

Helper mode to parse an extensions buffer to a GList of imquic_moq_object_extension.

Note
The caller owns the list, and is responsible of freeing it and its content
Parameters
extensionsThe buffer containing the extensions data
elenThe size of the buffer containing the extensions data
Returns
A GList instance containing a set of imquic_moq_object_extension, if successful, or NULL if no extensions were found

◆ imquic_moq_pub_error_code_str()

const char * imquic_moq_pub_error_code_str ( imquic_moq_pub_error_code code)

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

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

◆ imquic_moq_publish()

int imquic_moq_publish ( imquic_connection * conn,
uint64_t request_id,
imquic_moq_namespace * tns,
imquic_moq_name * tn,
uint64_t track_alias,
gboolean descending,
imquic_moq_location * largest,
gboolean forward,
uint8_t * auth,
size_t authlen )

Function to send a PUBLISH request.

Parameters
connThe imquic_connection to send the request on
request_idA unique request ID to associate to this subscription
tnsThe imquic_moq_namespace namespace the track to publish to belongs to
tnThe imquic_moq_name track name to publish to
track_aliasA unique numeric identifier to associate to the track in this subscription
descendingWhether objects should be fetched in descending order, per each group
largestThe largest group/object IDs, in case content exists
forwardWhether objects should be forwarded, when this subscription is accepted (ignored before v11)
authThe authentication info, if any
authlenThe size of the authentication info, if any
Returns
0 in case of success, a negative integer otherwise

◆ imquic_moq_publish_done()

int imquic_moq_publish_done ( imquic_connection * conn,
uint64_t request_id,
imquic_moq_sub_done_code status_code,
const char * reason )

Function to send a PUBLISH_DONE request.

Note
The streams count is handled by the library internally
Parameters
connThe imquic_connection to send the request on
request_idThe unique request_id value associated to the subscription that's now done
status_codeThe status code
reasonA reason phrase, if needed
Returns
0 in case of success, a negative integer otherwise

◆ imquic_moq_publish_namespace()

int imquic_moq_publish_namespace ( imquic_connection * conn,
uint64_t request_id,
imquic_moq_namespace * tns,
uint8_t * auth,
size_t authlen )

Function to send a PUBLISH_NAMESPACE request.

Parameters
connThe imquic_connection to send the request on
request_idA unique request ID (only v11 and later)
tnsThe imquic_moq_namespace namespace to publish_namespace
authThe authentication info, if any
authlenThe size of the authentication info, if any
Returns
0 in case of success, a negative integer otherwise

◆ imquic_moq_publish_namespace_done()

int imquic_moq_publish_namespace_done ( imquic_connection * conn,
imquic_moq_namespace * tns )

Function to send a PUBLISH_NAMESPACE_DONE request.

Parameters
connThe imquic_connection to send the request on
tnsThe imquic_moq_namespace namespace to publish_namespace_done
Returns
0 in case of success, a negative integer otherwise

◆ imquic_moq_publish_namespace_error_code_str()

const char * imquic_moq_publish_namespace_error_code_str ( imquic_moq_publish_namespace_error_code code)

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

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

◆ imquic_moq_reject_fetch()

int imquic_moq_reject_fetch ( imquic_connection * conn,
uint64_t request_id,
imquic_moq_fetch_error_code error_code,
const char * reason )

Function to reject an incoming FETCH request.

Parameters
connThe imquic_connection to send the request on
request_idThe unique request_id value associated to the subscription to reject
error_codeThe error code to send back
reasonA string representation of the error, if needed
Returns
0 in case of success, a negative integer otherwise

◆ imquic_moq_reject_publish()

int imquic_moq_reject_publish ( imquic_connection * conn,
uint64_t request_id,
imquic_moq_pub_error_code error_code,
const char * reason )

Function to reject an incoming PUBLISH request.

Parameters
connThe imquic_connection to send the request on
request_idThe unique request_id value associated to the subscription to reject
error_codeThe error code to send back
reasonA string representation of the error, if needed
Returns
0 in case of success, a negative integer otherwise

◆ imquic_moq_reject_publish_namespace()

int imquic_moq_reject_publish_namespace ( imquic_connection * conn,
uint64_t request_id,
imquic_moq_namespace * tns,
imquic_moq_publish_namespace_error_code error_code,
const char * reason )

Function to reject an incoming PUBLISH_NAMESPACE request.

Parameters
connThe imquic_connection to send the request on
request_idThe request ID of the original PUBLISH_NAMESPACE request (only v11 and later)
tnsThe imquic_moq_namespace namespace to reject (only before v11)
error_codeThe error code to send back
reasonA string representation of the error, if needed
Returns
0 in case of success, a negative integer otherwise

◆ imquic_moq_reject_subscribe()

int imquic_moq_reject_subscribe ( imquic_connection * conn,
uint64_t request_id,
imquic_moq_sub_error_code error_code,
const char * reason,
uint64_t track_alias )

Function to reject an incoming SUBSCRIBE request.

Parameters
connThe imquic_connection to send the request on
request_idThe unique request_id value associated to the subscription to reject
error_codeThe error code to send back
reasonA string representation of the error, if needed
track_aliasThe unique track_alias value associated to the subscription to reject
Returns
0 in case of success, a negative integer otherwise

◆ imquic_moq_reject_subscribe_namespace()

int imquic_moq_reject_subscribe_namespace ( imquic_connection * conn,
uint64_t request_id,
imquic_moq_namespace * tns,
imquic_moq_subns_error_code error_code,
const char * reason )

Function to reject an incoming SUBSCRIBE_NAMESPACE request.

Parameters
connThe imquic_connection to send the request on
request_idThe request ID of the original SUBSCRIBE_NAMESPACE request (only v11 and later)
tnsThe imquic_moq_namespace namespace to reject notifications for (only before v11)
error_codeThe error code to send back
reasonA string representation of the error, if needed
Returns
0 in case of success, a negative integer otherwise

◆ imquic_moq_reject_track_status()

int imquic_moq_reject_track_status ( imquic_connection * conn,
uint64_t request_id,
imquic_moq_sub_error_code error_code,
const char * reason )

Function to reject an incoming TRACK_STATUS request.

Note
Due to considerable changes between v12 and v13 on TRACK_STATUS , support for this request is disabled in versions earlier than v13
Parameters
connThe imquic_connection to send the request on
request_idThe unique request_id value associated to the subscription to reject
error_codeThe error code to send back
reasonA string representation of the error, if needed
Returns
0 in case of success, a negative integer otherwise

◆ imquic_moq_requests_blocked()

int imquic_moq_requests_blocked ( imquic_connection * conn)

Function to send a REQUESTS_BLOCKED request.

Parameters
connThe imquic_connection to send the request on
Returns
0 in case of success, a negative integer otherwise

◆ imquic_moq_role_str()

const char * imquic_moq_role_str ( imquic_moq_role role)

Helper function to serialize to string the name of a imquic_moq_role property.

Parameters
roleThe imquic_moq_role property
Returns
The role name as a string, if valid, or NULL otherwise

◆ imquic_moq_send_object()

int imquic_moq_send_object ( imquic_connection * conn,
imquic_moq_object * object )

Function to send a MoQ object.

Note
Depending on the delivery mode, to close the stream set the end_of_stream property to TRUE in the object. There's no need to do that when using OBJECT_STREAM or OBJECT_DATAGRAM . You can also close the stream when you don't have any object to send: just set the relevant properties (e.g., request_id, group_id and subgroup_id) without any payload, and the stack will find the right stream to close it.
Parameters
connThe imquic_connection to send the object on
objectThe imquic_moq_object object to send, including all relevant identifiers and the payload
Returns
0 in case of success, a negative integer otherwise

◆ imquic_moq_set_connection_auth()

int imquic_moq_set_connection_auth ( imquic_connection * conn,
uint8_t * auth,
size_t authlen )

Method to provide credentials, as a client, on a new connection. If credentials need to provided, this must be done as soon as the connection is established, and before sending any MoQ message. A good place to do that is the callback fired when a new connection is available.

Note
The method only copies the pointer and not the data, so it's the 'sapplication responsibility to ensure the data addressed by the pointer will be valid when accessed.
Parameters
connThe imquic_connection to set the version on
authThe authentication info, if any
authlenThe size of the authentication info, if any
Returns
0 in case of success, a negative integer otherwise

◆ imquic_moq_set_max_request_id()

int imquic_moq_set_max_request_id ( imquic_connection * conn,
uint64_t max_request_id )

Helper function to set the Maximum Request ID a subscriber can send.

Note
If invoked before the MoQ connection setup, it will be put in the setup parameter, otherwise it's sent in a MAX_REQUEST_ID request. Notice that whatever is passed to the request will be decremented by 1, as per the specification, meaning you cannot pass 0 as a value here
Parameters
connThe imquic_connection to update
max_request_idThe Maximum Request ID to enforce
Returns
0 in case of success, a negative integer otherwise

◆ imquic_moq_set_role()

int imquic_moq_set_role ( imquic_connection * conn,
imquic_moq_role role )

Method to set the MoQ role on a connection. Must be done as soon as the connection is established, and before sending any MoQ message. A good place to do that is the callback fired when a new connection is available.

Note
The role can only be set once: it's an error to try and change it later, since the MoQ handshake will already have taken place.
Parameters
connThe imquic_connection to set the role on
roleThe imquic_moq_role to take
Returns
0 in case of success, a negative integer otherwise

◆ imquic_moq_set_version()

int imquic_moq_set_version ( imquic_connection * conn,
imquic_moq_version version )

Method to set the MoQ version on a connection. Must be done as soon as the connection is established, and before sending any MoQ message. A good place to do that is the callback fired when a new connection is available.

Note
The version can only be set once: it's an error to try and change it later, since the MoQ handshake will already have taken place.
Parameters
connThe imquic_connection to set the version on
versionThe imquic_moq_version to use/offer
Returns
0 in case of success, a negative integer otherwise

◆ imquic_moq_standalone_fetch()

int imquic_moq_standalone_fetch ( imquic_connection * conn,
uint64_t request_id,
imquic_moq_namespace * tns,
imquic_moq_name * tn,
gboolean descending,
imquic_moq_location_range * range,
uint8_t * auth,
size_t authlen )

Function to send a standalone FETCH request.

Parameters
connThe imquic_connection to send the request on
request_idA unique numeric identifier to associate to this subscription
tnsThe imquic_moq_namespace namespace the track to fetch to belongs to
tnThe imquic_moq_name track name to fetch to
descendingWhether objects should be fetched in descending group order
rangeThe range of groups/objects to fetch
authThe authentication info, if any
authlenThe size of the authentication info, if any
Returns
0 in case of success, a negative integer otherwise

◆ 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_sub_error_code value.

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

◆ imquic_moq_subns_error_code_str()

const char * imquic_moq_subns_error_code_str ( imquic_moq_subns_error_code code)

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

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

◆ imquic_moq_subscribe()

int imquic_moq_subscribe ( imquic_connection * conn,
uint64_t request_id,
uint64_t track_alias,
imquic_moq_namespace * tns,
imquic_moq_name * tn,
uint8_t priority,
gboolean descending,
gboolean forward,
imquic_moq_filter_type filter_type,
imquic_moq_location * start_location,
imquic_moq_location * end_location,
uint8_t * auth,
size_t authlen )

Function to send a SUBSCRIBE request.

Parameters
connThe imquic_connection to send the request on
request_idA unique request ID to associate to this subscription
track_aliasA unique numeric identifier to associate to the track in this subscription (ignored starting from v12)
tnsThe imquic_moq_namespace namespace the track to subscribe to belongs to
tnThe imquic_moq_name track name to subscribe to
priorityThe subscriber priority
descendingWhether objects should be fetched in descending order, per each group
forwardWhether objects should be forwarded, when this subscription is accepted (ignored before v11)
filter_typeThe subscription filter type
start_locationThe group and object to start from (ignored if the filter is not AbsoluteStart or AbsoluteRange)
end_locationThe group (and for v06/v07 the object) to end at (ignored if the filter is not AbsoluteRange)
authThe authentication info, if any
authlenThe size of the authentication info, if any
Returns
0 in case of success, a negative integer otherwise

◆ imquic_moq_subscribe_namespace()

int imquic_moq_subscribe_namespace ( imquic_connection * conn,
uint64_t request_id,
imquic_moq_namespace * tns,
uint8_t * auth,
size_t authlen )

Function to send a SUBSCRIBE_NAMESPACE request.

Parameters
connThe imquic_connection to send the request on
request_idA unique request ID (only v11 and later)
tnsThe imquic_moq_namespace namespace the track to subscribe to belongs to
authThe authentication info, if any
authlenThe size of the authentication info, if any
Returns
0 in case of success, a negative integer otherwise

◆ imquic_moq_track_status()

int imquic_moq_track_status ( imquic_connection * conn,
uint64_t request_id,
imquic_moq_namespace * tns,
imquic_moq_name * tn,
uint8_t priority,
gboolean descending,
gboolean forward,
imquic_moq_filter_type filter_type,
imquic_moq_location * start_location,
imquic_moq_location * end_location,
uint8_t * auth,
size_t authlen )

Function to send a TRACK_STATUS request.

Note
Due to considerable changes between v12 and v13 on TRACK_STATUS , support for this request is disabled in versions earlier than v13
Parameters
connThe imquic_connection to send the request on
request_idA unique request ID to associate to this request
tnsThe imquic_moq_namespace namespace the track to track_status to belongs to
tnThe imquic_moq_name track name to track_status to
priorityThe track_statusr priority
descendingWhether objects should be fetched in descending order, per each group
forwardWhether objects should be forwarded (ignored)
filter_typeThe subscription filter type
start_locationThe group and object to start from
end_locationThe group to end at
authThe authentication info, if any
authlenThe size of the authentication info, if any
Returns
0 in case of success, a negative integer otherwise

◆ imquic_moq_track_str()

const char * imquic_moq_track_str ( imquic_moq_name * tn,
char * buffer,
size_t blen )

◆ imquic_moq_unsubscribe()

int imquic_moq_unsubscribe ( imquic_connection * conn,
uint64_t request_id )

Function to send a UNSUBSCRIBE request.

Parameters
connThe imquic_connection to send the request on
request_idThe unique request_id value associated to the subscription to unsubscribe from
Returns
0 in case of success, a negative integer otherwise

◆ imquic_moq_unsubscribe_namespace()

int imquic_moq_unsubscribe_namespace ( imquic_connection * conn,
imquic_moq_namespace * tns )

Function to send a UNSUBSCRIBE_NAMESPACE request.

Parameters
connThe imquic_connection to send the request on
tnsThe imquic_moq_namespace namespace to unsubscribe notifications from
Returns
0 in case of success, a negative integer otherwise

◆ imquic_moq_update_subscribe()

int imquic_moq_update_subscribe ( imquic_connection * conn,
uint64_t request_id,
uint64_t sub_request_id,
imquic_moq_location * start_location,
uint64_t end_group,
uint8_t priority,
gboolean forward )

Function to send a SUBSCRIBE_UPDATE request.

Note
Version 14 of the draft introduced a new "Subscription Request ID", which means the meaning of request_id will change depending on which version the connection is using
Parameters
connThe imquic_connection to send the request on
request_idUnique request_id value (before v14, this is associated to the subscription to update)
sub_request_idUnique request_id value associated to the subscription to update (ignored before v14)
start_locationThe group and object to start from
end_groupThe group to end at
priorityThe subscriber priority
forwardWhether objects should be forwarded, when this subscription is updated (ignored before v11)
Returns
0 in case of success, a negative integer otherwise

◆ imquic_moq_version_str()

const char * imquic_moq_version_str ( imquic_moq_version version)

Helper function to serialize to string the name of a imquic_moq_version property.

Parameters
versionThe imquic_moq_version property
Returns
The version name as a string, if valid, or NULL otherwise

◆ imquic_set_fetch_accepted_cb()

void imquic_set_fetch_accepted_cb ( imquic_endpoint * endpoint,
void(* fetch_accepted )(imquic_connection *conn, uint64_t request_id, gboolean descending, imquic_moq_location *largest) )

Configure the callback function to be notified when an FETCH we previously sent was accepted.

Parameters
endpointThe imquic_endpoint (imquic_server or imquic_client) to configure
fetch_acceptedPointer to the function that will fire when an FETCH is accepted

◆ imquic_set_fetch_error_cb()

void imquic_set_fetch_error_cb ( imquic_endpoint * endpoint,
void(* fetch_error )(imquic_connection *conn, uint64_t request_id, imquic_moq_fetch_error_code error_code, const char *reason) )

Configure the callback function to be notified when an FETCH we previously sent was rejected with an error.

Parameters
endpointThe imquic_endpoint (imquic_server or imquic_client) to configure
fetch_errorPointer to the function that will fire when an FETCH is rejected

◆ imquic_set_incoming_fetch_cancel_cb()

void imquic_set_incoming_fetch_cancel_cb ( imquic_endpoint * endpoint,
void(* incoming_fetch_cancel )(imquic_connection *conn, uint64_t request_id) )

Configure the callback function to be notified when there's an incoming FETCH_CANCEL request.

Parameters
endpointThe imquic_endpoint (imquic_server or imquic_client) to configure
incoming_fetch_cancelPointer to the function that will handle the incoming FETCH_CANCEL

◆ imquic_set_incoming_goaway_cb()

void imquic_set_incoming_goaway_cb ( imquic_endpoint * endpoint,
void(* incoming_goaway )(imquic_connection *conn, const char *uri) )

Configure the callback function to be notified when there's an incoming GOAWAY request.

Parameters
endpointThe imquic_endpoint (imquic_server or imquic_client) to configure
incoming_goawayPointer to the function that will handle the incoming GOAWAY

◆ imquic_set_incoming_joining_fetch_cb()

void imquic_set_incoming_joining_fetch_cb ( imquic_endpoint * endpoint,
void(* incoming_joining_fetch )(imquic_connection *conn, uint64_t request_id, uint64_t joining_request_id, gboolean absolute, uint64_t joining_start, gboolean descending, uint8_t *auth, size_t authlen) )

Configure the callback function to be notified when there's an incoming joining FETCH request.

Parameters
endpointThe imquic_endpoint (imquic_server or imquic_client) to configure
incoming_joining_fetchPointer to the function that will handle the incoming FETCH

◆ imquic_set_incoming_moq_connection_cb()

void imquic_set_incoming_moq_connection_cb ( imquic_endpoint * endpoint,
uint64_t(* incoming_moq_connection )(imquic_connection *conn, uint8_t *auth, size_t authlen) )

Configure the callback function to be notified, as a server, when a CLIENT_SETUP is received. This is a chance, for instance, to evaluate the credentials that were provided. It's the application responsibility to accept or reject the connection at this point: returning 0 will accept the connection, while returning an error code will reject and close it. Connections are automatically accepted if this callback is not configured.

Parameters
endpointThe imquic_endpoint (imquic_server or imquic_client) to configure
incoming_moq_connectionPointer to the function that will be invoked when MoQ is ready to be used

◆ imquic_set_incoming_object_cb()

void imquic_set_incoming_object_cb ( imquic_endpoint * endpoint,
void(* incoming_object )(imquic_connection *conn, imquic_moq_object *object) )

Configure the callback function to be notified when there's an incoming MoQ object, independently of how it was multiplexed on the wire.

Parameters
endpointThe imquic_endpoint (imquic_server or imquic_client) to configure
incoming_objectPointer to the function that will handle the incoming MoQ object

◆ imquic_set_incoming_publish_cb()

void imquic_set_incoming_publish_cb ( imquic_endpoint * endpoint,
void(* incoming_publish )(imquic_connection *conn, uint64_t request_id, imquic_moq_namespace *tns, imquic_moq_name *tn, uint64_t track_alias, gboolean descending, imquic_moq_location *largest, gboolean forward, uint8_t *auth, size_t authlen) )

Configure the callback function to be notified when there's an incoming PUBLISH request.

Parameters
endpointThe imquic_endpoint (imquic_server or imquic_client) to configure
incoming_publishPointer to the function that will handle the incoming PUBLISH

◆ imquic_set_incoming_publish_namespace_cancel_cb()

void imquic_set_incoming_publish_namespace_cancel_cb ( imquic_endpoint * endpoint,
void(* incoming_publish_namespace_cancel )(imquic_connection *conn, imquic_moq_namespace *tns, imquic_moq_publish_namespace_error_code error_code, const char *reason) )

Configure the callback function to be notified when there's an incoming PUBLISH_NAMESPACE_CANCEL request.

Parameters
endpointThe imquic_endpoint (imquic_server or imquic_client) to configure
incoming_publish_namespace_cancelPointer to the function that will handle the incoming PUBLISH_NAMESPACE_CANCEL

◆ imquic_set_incoming_publish_namespace_cb()

void imquic_set_incoming_publish_namespace_cb ( imquic_endpoint * endpoint,
void(* incoming_publish_namespace )(imquic_connection *conn, uint64_t request_id, imquic_moq_namespace *tns, uint8_t *auth, size_t authlen) )

Configure the callback function to be notified when there's an incoming PUBLISH_NAMESPACE request.

Parameters
endpointThe imquic_endpoint (imquic_server or imquic_client) to configure
incoming_publish_namespacePointer to the function that will handle the incoming PUBLISH_NAMESPACE

◆ imquic_set_incoming_standalone_fetch_cb()

void imquic_set_incoming_standalone_fetch_cb ( imquic_endpoint * endpoint,
void(* incoming_standalone_fetch )(imquic_connection *conn, uint64_t request_id, imquic_moq_namespace *tns, imquic_moq_name *tn, gboolean descending, imquic_moq_location_range *range, uint8_t *auth, size_t authlen) )

Configure the callback function to be notified when there's an incoming standalone FETCH request.

Parameters
endpointThe imquic_endpoint (imquic_server or imquic_client) to configure
incoming_standalone_fetchPointer to the function that will handle the incoming FETCH

◆ imquic_set_incoming_subscribe_cb()

void imquic_set_incoming_subscribe_cb ( imquic_endpoint * endpoint,
void(* incoming_subscribe )(imquic_connection *conn, uint64_t request_id, uint64_t track_alias, imquic_moq_namespace *tns, imquic_moq_name *tn, uint8_t priority, gboolean descending, gboolean forward, imquic_moq_filter_type filter_type, imquic_moq_location *start_location, imquic_moq_location *end_location, uint8_t *auth, size_t authlen) )

Configure the callback function to be notified when there's an incoming SUBSCRIBE request.

Parameters
endpointThe imquic_endpoint (imquic_server or imquic_client) to configure
incoming_subscribePointer to the function that will handle the incoming SUBSCRIBE

◆ imquic_set_incoming_subscribe_namespace_cb()

void imquic_set_incoming_subscribe_namespace_cb ( imquic_endpoint * endpoint,
void(* incoming_subscribe_namespace )(imquic_connection *conn, uint64_t request_id, imquic_moq_namespace *tns, uint8_t *auth, size_t authlen) )

Configure the callback function to be notified when there's an incoming SUBSCRIBE_NAMESPACE request.

Parameters
endpointThe imquic_endpoint (imquic_server or imquic_client) to configure
incoming_subscribe_namespacePointer to the function that will handle the incoming SUBSCRIBE_NAMESPACE

◆ imquic_set_incoming_track_status_cb()

void imquic_set_incoming_track_status_cb ( imquic_endpoint * endpoint,
void(* incoming_track_status )(imquic_connection *conn, uint64_t request_id, imquic_moq_namespace *tns, imquic_moq_name *tn, uint8_t priority, gboolean descending, gboolean forward, imquic_moq_filter_type filter_type, imquic_moq_location *start_location, imquic_moq_location *end_location, uint8_t *auth, size_t authlen) )

Configure the callback function to be notified when there's an incoming TRACK_STATUS request.

Parameters
endpointThe imquic_endpoint (imquic_server or imquic_client) to configure
incoming_track_statusPointer to the function that will handle the incoming TRACK_STATUS

◆ imquic_set_incoming_unsubscribe_cb()

void imquic_set_incoming_unsubscribe_cb ( imquic_endpoint * endpoint,
void(* incoming_unsubscribe )(imquic_connection *conn, uint64_t request_id) )

Configure the callback function to be notified when there's an incoming UNSUBSCRIBE request.

Parameters
endpointThe imquic_endpoint (imquic_server or imquic_client) to configure
incoming_unsubscribePointer to the function that will handle the incoming UNSUBSCRIBE

◆ imquic_set_incoming_unsubscribe_namespace_cb()

void imquic_set_incoming_unsubscribe_namespace_cb ( imquic_endpoint * endpoint,
void(* incoming_unsubscribe_namespace )(imquic_connection *conn, imquic_moq_namespace *tns) )

Configure the callback function to be notified when there's an incoming UNSUBSCRIBE_NAMESPACE request.

Parameters
endpointThe imquic_endpoint (imquic_server or imquic_client) to configure
incoming_unsubscribe_namespacePointer to the function that will handle the incoming UNSUBSCRIBE_NAMESPACE

◆ imquic_set_moq_connection_gone_cb()

void imquic_set_moq_connection_gone_cb ( imquic_endpoint * endpoint,
void(* moq_connection_gone )(imquic_connection *conn) )

Configure the callback function to be notified when an existing MoQ connection handled by this endpoint has been closed/shut down.

Note
This is a good place to release the last reference to the connection
Parameters
endpointThe imquic_endpoint (imquic_server or imquic_client) to configure
moq_connection_gonePointer to the function that will be invoked when a MoQ connection is gone

◆ imquic_set_moq_ready_cb()

void imquic_set_moq_ready_cb ( imquic_endpoint * endpoint,
void(* moq_ready )(imquic_connection *conn) )

Configure the callback function to be notified when a MoQ connection has been successfully established. After this, the MoQ APIs can be used to start exchanging MoQ messages.

Parameters
endpointThe imquic_endpoint (imquic_server or imquic_client) to configure
moq_readyPointer to the function that will be invoked when MoQ is ready to be used

◆ imquic_set_new_moq_connection_cb()

void imquic_set_new_moq_connection_cb ( imquic_endpoint * endpoint,
void(* new_moq_connection )(imquic_connection *conn, void *user_data) )

Configure the callback function to be notified about new QUIC connections on the configured endpoint. For a server, it will be triggered any time a client successfully connects to the server; for a client, it will be triggered when the client successfully connects to the server. Notice that this precedes the MoQ setup/handshakes, which means this is where you need to configure the MoQ role via imquic_moq_set_role. You'll need to wait until the callback set in imquic_set_moq_ready_cb is fired, before being able to use the MoQ API for publishing/subscribing.

Note
This is a good place to obtain the first reference to a connection.
Parameters
endpointThe imquic_endpoint (imquic_server or imquic_client) to configure
new_moq_connectionPointer to the function that will be invoked on the new MoQ connection

◆ imquic_set_publish_accepted_cb()

void imquic_set_publish_accepted_cb ( imquic_endpoint * endpoint,
void(* publish_accepted )(imquic_connection *conn, uint64_t request_id, gboolean forward, uint8_t priority, gboolean descending, imquic_moq_filter_type filter_type, imquic_moq_location *start_location, imquic_moq_location *end_location, uint8_t *auth, size_t authlen) )

Configure the callback function to be notified when a PUBLISH we previously sent was accepted.

Parameters
endpointThe imquic_endpoint (imquic_server or imquic_client) to configure
publish_acceptedPointer to the function that will fire when a PUBLISH is accepted

◆ imquic_set_publish_done_cb()

void imquic_set_publish_done_cb ( imquic_endpoint * endpoint,
void(* publish_done )(imquic_connection *conn, uint64_t request_id, imquic_moq_sub_done_code status_code, uint64_t streams_count, const char *reason) )

Configure the callback function to be notified when a PUBLISH we received or a SUBSCRIBE we sent is now done.

Parameters
endpointThe imquic_endpoint (imquic_server or imquic_client) to configure
publish_donePointer to the function that will fire when a PUBLSH or SUBSCRIBE is done

◆ imquic_set_publish_error_cb()

void imquic_set_publish_error_cb ( imquic_endpoint * endpoint,
void(* publish_error )(imquic_connection *conn, uint64_t request_id, imquic_moq_pub_error_code error_code, const char *reason) )

Configure the callback function to be notified when a PUBLISH we previously sent was rejected with an error.

Parameters
endpointThe imquic_endpoint (imquic_server or imquic_client) to configure
publish_errorPointer to the function that will fire when a PUBLISH is rejected

◆ imquic_set_publish_namespace_accepted_cb()

void imquic_set_publish_namespace_accepted_cb ( imquic_endpoint * endpoint,
void(* publish_namespace_accepted )(imquic_connection *conn, uint64_t request_id, imquic_moq_namespace *tns) )

Configure the callback function to be notified when an PUBLISH_NAMESPACE we previously sent was accepted.

Parameters
endpointThe imquic_endpoint (imquic_server or imquic_client) to configure
publish_namespace_acceptedPointer to the function that will fire when a PUBLISH_NAMESPACE is accepted

◆ imquic_set_publish_namespace_done_cb()

void imquic_set_publish_namespace_done_cb ( imquic_endpoint * endpoint,
void(* publish_namespace_done )(imquic_connection *conn, imquic_moq_namespace *tns) )

Configure the callback function to be notified when there's an incoming PUBLISH_NAMESPACE_DONE request.

Parameters
endpointThe imquic_endpoint (imquic_server or imquic_client) to configure
publish_namespace_donePointer to the function that will handle the incoming PUBLISH_NAMESPACE_DONE

◆ imquic_set_publish_namespace_error_cb()

void imquic_set_publish_namespace_error_cb ( imquic_endpoint * endpoint,
void(* publish_namespace_error )(imquic_connection *conn, uint64_t request_id, imquic_moq_namespace *tns, imquic_moq_publish_namespace_error_code error_code, const char *reason) )

Configure the callback function to be notified when an PUBLISH_NAMESPACE we previously sent was rejected with an error.

Parameters
endpointThe imquic_endpoint (imquic_server or imquic_client) to configure
publish_namespace_errorPointer to the function that will fire when a PUBLISH_NAMESPACE is rejected

◆ imquic_set_requests_blocked_cb()

void imquic_set_requests_blocked_cb ( imquic_endpoint * endpoint,
void(* requests_blocked )(imquic_connection *conn, uint64_t max_request_id) )

Configure the callback function to be notified when there's an incoming REQUESTS_BLOCKED request.

Parameters
endpointThe imquic_endpoint (imquic_server or imquic_client) to configure
requests_blockedPointer to the function that will handle the incoming REQUESTS_BLOCKED

◆ imquic_set_subscribe_accepted_cb()

void imquic_set_subscribe_accepted_cb ( imquic_endpoint * endpoint,
void(* subscribe_accepted )(imquic_connection *conn, uint64_t request_id, uint64_t track_alias, uint64_t expires, gboolean descending, imquic_moq_location *largest) )

Configure the callback function to be notified when a SUBSCRIBE we previously sent was accepted.

Parameters
endpointThe imquic_endpoint (imquic_server or imquic_client) to configure
subscribe_acceptedPointer to the function that will fire when a SUBSCRIBE is accepted

◆ imquic_set_subscribe_error_cb()

void imquic_set_subscribe_error_cb ( imquic_endpoint * endpoint,
void(* subscribe_error )(imquic_connection *conn, uint64_t request_id, imquic_moq_sub_error_code error_code, const char *reason, uint64_t track_alias) )

Configure the callback function to be notified when a SUBSCRIBE we previously sent was rejected with an error.

Parameters
endpointThe imquic_endpoint (imquic_server or imquic_client) to configure
subscribe_errorPointer to the function that will fire when a SUBSCRIBE is rejected

◆ imquic_set_subscribe_namespace_accepted_cb()

void imquic_set_subscribe_namespace_accepted_cb ( imquic_endpoint * endpoint,
void(* subscribe_namespace_accepted )(imquic_connection *conn, uint64_t request_id, imquic_moq_namespace *tns) )

Configure the callback function to be notified when an SUBSCRIBE_NAMESPACE we previously sent was accepted.

Parameters
endpointThe imquic_endpoint (imquic_server or imquic_client) to configure
subscribe_namespace_acceptedPointer to the function that will fire when an SUBSCRIBE_NAMESPACE is accepted

◆ imquic_set_subscribe_namespace_error_cb()

void imquic_set_subscribe_namespace_error_cb ( imquic_endpoint * endpoint,
void(* subscribe_namespace_error )(imquic_connection *conn, uint64_t request_id, imquic_moq_namespace *tns, imquic_moq_subns_error_code error_code, const char *reason) )

Configure the callback function to be notified when an SUBSCRIBE_NAMESPACE we previously sent was rejected with an error.

Parameters
endpointThe imquic_endpoint (imquic_server or imquic_client) to configure
subscribe_namespace_errorPointer to the function that will fire when an SUBSCRIBE_NAMESPACE is rejected

◆ imquic_set_subscribe_updated_cb()

void imquic_set_subscribe_updated_cb ( imquic_endpoint * endpoint,
void(* subscribe_updated )(imquic_connection *conn, uint64_t request_id, uint64_t sub_request_id, imquic_moq_location *start_location, uint64_t end_group, uint8_t priority, gboolean forward) )

Configure the callback function to be notified when an update is received for a SUBSCRIBE we previously sent.

Note
Currently unused, considering there are discussions in the MoQ standardization efforts on whether this is actually useful or not, or if it even works at all.
Parameters
endpointThe imquic_endpoint (imquic_server or imquic_client) to configure
subscribe_updatedPointer to the function that will fire when a SUBSCRIBE is done

◆ imquic_set_track_status_accepted_cb()

void imquic_set_track_status_accepted_cb ( imquic_endpoint * endpoint,
void(* track_status_accepted )(imquic_connection *conn, uint64_t request_id, uint64_t track_alias, uint64_t expires, gboolean descending, imquic_moq_location *largest) )

Configure the callback function to be notified when a TRACK_STATUS we previously sent was accepted.

Parameters
endpointThe imquic_endpoint (imquic_server or imquic_client) to configure
track_status_acceptedPointer to the function that will fire when a TRACK_STATUS is accepted

◆ imquic_set_track_status_error_cb()

void imquic_set_track_status_error_cb ( imquic_endpoint * endpoint,
void(* track_status_error )(imquic_connection *conn, uint64_t request_id, imquic_moq_sub_error_code error_code, const char *reason) )

Configure the callback function to be notified when a TRACK_STATUS we previously sent was rejected with an error.

Parameters
endpointThe imquic_endpoint (imquic_server or imquic_client) to configure
track_status_errorPointer to the function that will fire when a TRACK_STATUS is rejected