Loading...
Searching...
No Matches
Data Structures | Typedefs | Enumerations | Functions
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_auth_info
 MoQ Auth Info. More...
 
struct  imquic_moq_position
 MoQ Group/Object couple (for ranges) More...
 
struct  imquic_moq_fetch_range
 MoQ FETCH range (from where to where) More...
 
struct  imquic_moq_object
 MoQ Object. More...
 

Typedefs

typedef struct imquic_moq_namespace imquic_moq_namespace
 MoQ Track Namespace.
 
typedef struct imquic_moq_name imquic_moq_name
 MoQ Track Name.
 
typedef struct imquic_moq_auth_info imquic_moq_auth_info
 MoQ Auth Info.
 
typedef struct imquic_moq_position imquic_moq_position
 MoQ Group/Object couple (for ranges)
 
typedef struct imquic_moq_fetch_range imquic_moq_fetch_range
 MoQ FETCH range (from where to where)
 
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 imquic_moq_object
 MoQ Object.
 
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_delivery {
  IMQUIC_MOQ_USE_DATAGRAM , IMQUIC_MOQ_USE_STREAM , IMQUIC_MOQ_USE_GROUP , 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_SUBGROUP = 0x5
}
 MoQ Object status. More...
 
enum  imquic_moq_role { 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 = 0xff000003 , IMQUIC_MOQ_VERSION_03 = 0xff000003 , IMQUIC_MOQ_VERSION_04 = 0xff000004 ,
  IMQUIC_MOQ_VERSION_05 = 0xff000005 , IMQUIC_MOQ_VERSION_06 = 0xff000006 , IMQUIC_MOQ_VERSION_07 = 0xff000007 , IMQUIC_MOQ_VERSION_07_PATCH = 0xff070001 ,
  IMQUIC_MOQ_VERSION_MAX = IMQUIC_MOQ_VERSION_07_PATCH , IMQUIC_MOQ_VERSION_ANY = 0xffffffff , IMQUIC_MOQ_VERSION_ANY_LEGACY = 0xfffffffe
}
 Versions that can be negotiated. More...
 

Functions

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.
 
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_max_subscribe_id (imquic_connection *conn, uint64_t max_subscribe_id)
 Helper function to set the Maximum Subscribe ID a subscriber can send.
 
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 MoQ 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_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_announce_cb (imquic_endpoint *endpoint, void(*incoming_announce)(imquic_connection *conn, imquic_moq_namespace *tns))
 Configure the callback function to be notified when there's an incoming ANNOUNCE request.
 
void imquic_set_incoming_announce_cancel_cb (imquic_endpoint *endpoint, void(*incoming_announce_cancel)(imquic_connection *conn, imquic_moq_namespace *tns))
 Configure the callback function to be notified when there's an incoming ANNOUNCE_CANCEL request.
 
void imquic_set_announce_accepted_cb (imquic_endpoint *endpoint, void(*announce_accepted)(imquic_connection *conn, imquic_moq_namespace *tns))
 Configure the callback function to be notified when an ANNOUNCE we previously sent was accepted.
 
void imquic_set_announce_error_cb (imquic_endpoint *endpoint, void(*announce_error)(imquic_connection *conn, imquic_moq_namespace *tns, int error_code, const char *reason))
 Configure the callback function to be notified when an ANNOUNCE we previously sent was rejected with an error.
 
void imquic_set_incoming_unannounce_cb (imquic_endpoint *endpoint, void(*incoming_unannounce)(imquic_connection *conn, imquic_moq_namespace *tns))
 Configure the callback function to be notified when there's an incoming UNANNOUNCE request.
 
void imquic_set_incoming_subscribe_cb (imquic_endpoint *endpoint, void(*incoming_subscribe)(imquic_connection *conn, uint64_t subscribe_id, uint64_t track_alias, imquic_moq_namespace *tns, imquic_moq_name *tn, imquic_moq_auth_info *auth))
 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 subscribe_id, uint64_t expires, gboolean descending))
 Configure the callback function to be notified when an SUBSCRIBE we previously sent was accepted.
 
void imquic_set_subscribe_error_cb (imquic_endpoint *endpoint, void(*subscribe_error)(imquic_connection *conn, uint64_t subscribe_id, int error_code, const char *reason, uint64_t track_alias))
 Configure the callback function to be notified when an SUBSCRIBE we previously sent was rejected with an error.
 
void imquic_set_subscribe_done_cb (imquic_endpoint *endpoint, void(*subscribe_done)(imquic_connection *conn, uint64_t subscribe_id, int status_code, const char *reason))
 Configure the callback function to be notified when an SUBSCRIBE we previously sent is now done.
 
void imquic_set_incoming_unsubscribe_cb (imquic_endpoint *endpoint, void(*incoming_unsubscribe)(imquic_connection *conn, uint64_t subscribe_id))
 Configure the callback function to be notified when there's an incoming UNSUBSCRIBE request.
 
void imquic_set_incoming_subscribe_announces_cb (imquic_endpoint *endpoint, void(*incoming_subscribe_announces)(imquic_connection *conn, imquic_moq_namespace *tns, imquic_moq_auth_info *auth))
 Configure the callback function to be notified when there's an incoming SUBSCRIBE_ANNOUNCES request.
 
void imquic_set_subscribe_announces_accepted_cb (imquic_endpoint *endpoint, void(*subscribe_announces_accepted)(imquic_connection *conn, imquic_moq_namespace *tns))
 Configure the callback function to be notified when an SUBSCRIBE_ANNOUNCES we previously sent was accepted.
 
void imquic_set_subscribe_announces_error_cb (imquic_endpoint *endpoint, void(*subscribe_announces_error)(imquic_connection *conn, imquic_moq_namespace *tns, int error_code, const char *reason))
 Configure the callback function to be notified when an SUBSCRIBE_ANNOUNCES we previously sent was rejected with an error.
 
void imquic_set_incoming_unsubscribe_announces_cb (imquic_endpoint *endpoint, void(*incoming_unsubscribe_announces)(imquic_connection *conn, imquic_moq_namespace *tns))
 Configure the callback function to be notified when there's an incoming UNSUBSCRIBE_ANNOUNCES request.
 
void imquic_set_incoming_fetch_cb (imquic_endpoint *endpoint, void(*incoming_fetch)(imquic_connection *conn, uint64_t subscribe_id, imquic_moq_namespace *tns, imquic_moq_name *tn, gboolean descending, imquic_moq_fetch_range *range, imquic_moq_auth_info *auth))
 Configure the callback function to be notified when there's an incoming FETCH request.
 
void imquic_set_incoming_fetch_cancel_cb (imquic_endpoint *endpoint, void(*incoming_fetch_cancel)(imquic_connection *conn, uint64_t subscribe_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 subscribe_id, gboolean descending, imquic_moq_position *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 subscribe_id, int 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_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_announce (imquic_connection *conn, imquic_moq_namespace *tns)
 Function to send an ANNOUNCE request.
 
int imquic_moq_accept_announce (imquic_connection *conn, imquic_moq_namespace *tns)
 Function to accept an incoming ANNOUNCE request.
 
int imquic_moq_reject_announce (imquic_connection *conn, imquic_moq_namespace *tns, int error_code, const char *reason)
 Function to reject an incoming ANNOUNCE request.
 
int imquic_moq_unannounce (imquic_connection *conn, imquic_moq_namespace *tns)
 Function to send an UNANNOUNCE request.
 
int imquic_moq_subscribe (imquic_connection *conn, uint64_t subscribe_id, uint64_t track_alias, imquic_moq_namespace *tns, imquic_moq_name *tn, imquic_moq_auth_info *auth)
 Function to send a SUBSCRIBE request.
 
int imquic_moq_accept_subscribe (imquic_connection *conn, uint64_t subscribe_id, uint64_t expires, gboolean descending)
 Function to accept an incoming SUBSCRIBE request.
 
int imquic_moq_reject_subscribe (imquic_connection *conn, uint64_t subscribe_id, int error_code, const char *reason, uint64_t track_alias)
 Function to reject an incoming SUBSCRIBE request.
 
int imquic_moq_unsubscribe (imquic_connection *conn, uint64_t subscribe_id)
 Function to send a UNSUBSCRIBE request.
 
int imquic_moq_subscribe_announces (imquic_connection *conn, imquic_moq_namespace *tns, imquic_moq_auth_info *auth)
 Function to send a SUBSCRIBE_ANNOUNCES request.
 
int imquic_moq_accept_subscribe_announces (imquic_connection *conn, imquic_moq_namespace *tns)
 Function to accept an incoming SUBSCRIBE_ANNOUNCES request.
 
int imquic_moq_reject_subscribe_announces (imquic_connection *conn, imquic_moq_namespace *tns, int error_code, const char *reason)
 Function to reject an incoming SUBSCRIBE_ANNOUNCES request.
 
int imquic_moq_unsubscribe_announces (imquic_connection *conn, imquic_moq_namespace *tns)
 Function to send a UNSUBSCRIBE_ANNOUNCES request.
 
int imquic_moq_fetch (imquic_connection *conn, uint64_t subscribe_id, imquic_moq_namespace *tns, imquic_moq_name *tn, gboolean descending, imquic_moq_fetch_range *range, imquic_moq_auth_info *auth)
 Function to send a FETCH request.
 
int imquic_moq_accept_fetch (imquic_connection *conn, uint64_t subscribe_id, gboolean descending, imquic_moq_position *largest)
 Function to accept an incoming FETCH request.
 
int imquic_moq_reject_fetch (imquic_connection *conn, uint64_t subscribe_id, int error_code, const char *reason)
 Function to reject an incoming FETCH request.
 
int imquic_moq_cancel_fetch (imquic_connection *conn, uint64_t subscribe_id)
 Function to send a FETCH_CANCEL request.
 
int imquic_moq_send_object (imquic_connection *conn, imquic_moq_object *object)
 Function to send a MoQ object.
 

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_info

typedef struct imquic_moq_auth_info imquic_moq_auth_info

MoQ Auth Info.

◆ imquic_moq_delivery

Ways of sending objects.

◆ imquic_moq_fetch_range

typedef struct imquic_moq_fetch_range imquic_moq_fetch_range

MoQ FETCH range (from where to where)

◆ 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_status

MoQ Object status.

◆ imquic_moq_position

typedef struct imquic_moq_position imquic_moq_position

MoQ Group/Object couple (for ranges)

◆ imquic_moq_role

Roles that can be specified once connected.

◆ imquic_moq_version

Versions that can be negotiated.

Enumeration Type Documentation

◆ imquic_moq_delivery

Ways of sending objects.

Enumerator
IMQUIC_MOQ_USE_DATAGRAM 

A single object on a DATAGRAM.

IMQUIC_MOQ_USE_STREAM 

A single object on a STREAM (only before v06)

IMQUIC_MOQ_USE_GROUP 

All objects of the same group on the same STREAM (only before v06)

IMQUIC_MOQ_USE_SUBGROUP 

All objects of the same subgroup on the same STREAM (v06 and v07 only)

IMQUIC_MOQ_USE_TRACK 

All objects of the same track on the same STREAM (only before v07)

IMQUIC_MOQ_USE_FETCH 

All fetched objects on the same STREAM (only v07)

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

IMQUIC_MOQ_END_OF_SUBGROUP 

End of subgroup.

◆ imquic_moq_role

Roles that can be specified once connected.

Enumerator
IMQUIC_MOQ_PUBLISHER 
IMQUIC_MOQ_SUBSCRIBER 
IMQUIC_MOQ_PUBSUB 

◆ imquic_moq_version

Versions that can be negotiated.

Enumerator
IMQUIC_MOQ_VERSION_BASE 
IMQUIC_MOQ_VERSION_MIN 
IMQUIC_MOQ_VERSION_03 
IMQUIC_MOQ_VERSION_04 
IMQUIC_MOQ_VERSION_05 
IMQUIC_MOQ_VERSION_06 
IMQUIC_MOQ_VERSION_07 
IMQUIC_MOQ_VERSION_07_PATCH 
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_announce()

int imquic_moq_accept_announce ( imquic_connection * conn,
imquic_moq_namespace * tns )

Function to accept an incoming ANNOUNCE request.

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

◆ imquic_moq_accept_fetch()

int imquic_moq_accept_fetch ( imquic_connection * conn,
uint64_t subscribe_id,
gboolean descending,
imquic_moq_position * largest )

Function to accept an incoming FETCH request.

Parameters
connThe imquic_connection to send the request on
subscribe_idThe unique subscribe_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_subscribe()

int imquic_moq_accept_subscribe ( imquic_connection * conn,
uint64_t subscribe_id,
uint64_t expires,
gboolean descending )

Function to accept an incoming SUBSCRIBE request.

Parameters
connThe imquic_connection to send the request on
subscribe_idThe unique subscribe_id value associated to the subscription to accept
expiresValue of expires to send back
descendingWhether objects will be delivered in descending group order
Returns
0 in case of success, a negative integer otherwise

◆ imquic_moq_accept_subscribe_announces()

int imquic_moq_accept_subscribe_announces ( imquic_connection * conn,
imquic_moq_namespace * tns )

Function to accept an incoming SUBSCRIBE_ANNOUNCES request.

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

◆ imquic_moq_announce()

int imquic_moq_announce ( imquic_connection * conn,
imquic_moq_namespace * tns )

Function to send an ANNOUNCE request.

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

◆ imquic_moq_cancel_fetch()

int imquic_moq_cancel_fetch ( imquic_connection * conn,
uint64_t subscribe_id )

Function to send a FETCH_CANCEL request.

Parameters
connThe imquic_connection to send the request on
subscribe_idThe unique subscribe_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_fetch()

int imquic_moq_fetch ( imquic_connection * conn,
uint64_t subscribe_id,
imquic_moq_namespace * tns,
imquic_moq_name * tn,
gboolean descending,
imquic_moq_fetch_range * range,
imquic_moq_auth_info * auth )

Function to send a FETCH request.

Parameters
connThe imquic_connection to send the request on
subscribe_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 imquic_moq_auth_info authentication info, if needed
Returns
0 in case of success, a negative integer otherwise

◆ 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_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_reject_announce()

int imquic_moq_reject_announce ( imquic_connection * conn,
imquic_moq_namespace * tns,
int error_code,
const char * reason )

Function to reject an incoming ANNOUNCE request.

Parameters
connThe imquic_connection to send the request on
tnsThe imquic_moq_namespace namespace 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_fetch()

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

Function to reject an incoming FETCH request.

Parameters
connThe imquic_connection to send the request on
subscribe_idThe unique subscribe_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_subscribe()

int imquic_moq_reject_subscribe ( imquic_connection * conn,
uint64_t subscribe_id,
int 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
subscribe_idThe unique subscribe_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_announces()

int imquic_moq_reject_subscribe_announces ( imquic_connection * conn,
imquic_moq_namespace * tns,
int error_code,
const char * reason )

Function to reject an incoming SUBSCRIBE_ANNOUNCES request.

Parameters
connThe imquic_connection to send the request on
tnsThe imquic_moq_namespace namespace to reject notifications for
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_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., subscribe_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_max_subscribe_id()

int imquic_moq_set_max_subscribe_id ( imquic_connection * conn,
uint64_t max_subscribe_id )

Helper function to set the Maximum Subscribe 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_SUBSCRIBE_ID request
Parameters
connThe imquic_connection to update
max_subscribe_idThe Maximum Subscribe 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_subscribe()

int imquic_moq_subscribe ( imquic_connection * conn,
uint64_t subscribe_id,
uint64_t track_alias,
imquic_moq_namespace * tns,
imquic_moq_name * tn,
imquic_moq_auth_info * auth )

Function to send a SUBSCRIBE request.

Parameters
connThe imquic_connection to send the request on
subscribe_idA unique numeric identifier to associate to this subscription
track_aliasA unique numeric identifier to associate to the track in this subscription
tnsThe imquic_moq_namespace namespace the track to subscribe to belongs to
tnThe imquic_moq_name track name to subscribe to
authThe imquic_moq_auth_info authentication info, if needed
Returns
0 in case of success, a negative integer otherwise

◆ imquic_moq_subscribe_announces()

int imquic_moq_subscribe_announces ( imquic_connection * conn,
imquic_moq_namespace * tns,
imquic_moq_auth_info * auth )

Function to send a SUBSCRIBE_ANNOUNCES request.

Parameters
connThe imquic_connection to send the request on
tnsThe imquic_moq_namespace namespace the track to subscribe to belongs to
authThe imquic_moq_auth_info authentication info, if needed
Returns
0 in case of success, a negative integer otherwise

◆ imquic_moq_unannounce()

int imquic_moq_unannounce ( imquic_connection * conn,
imquic_moq_namespace * tns )

Function to send an UNANNOUNCE request.

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

◆ imquic_moq_unsubscribe()

int imquic_moq_unsubscribe ( imquic_connection * conn,
uint64_t subscribe_id )

Function to send a UNSUBSCRIBE request.

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

◆ imquic_moq_unsubscribe_announces()

int imquic_moq_unsubscribe_announces ( imquic_connection * conn,
imquic_moq_namespace * tns )

Function to send a UNSUBSCRIBE_ANNOUNCES 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_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_announce_accepted_cb()

void imquic_set_announce_accepted_cb ( imquic_endpoint * endpoint,
void(*)(imquic_connection *conn, imquic_moq_namespace *tns) announce_accepted )

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

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

◆ imquic_set_announce_error_cb()

void imquic_set_announce_error_cb ( imquic_endpoint * endpoint,
void(*)(imquic_connection *conn, imquic_moq_namespace *tns, int error_code, const char *reason) announce_error )

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

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

◆ imquic_set_fetch_accepted_cb()

void imquic_set_fetch_accepted_cb ( imquic_endpoint * endpoint,
void(*)(imquic_connection *conn, uint64_t subscribe_id, gboolean descending, imquic_moq_position *largest) fetch_accepted )

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(*)(imquic_connection *conn, uint64_t subscribe_id, int error_code, const char *reason) fetch_error )

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_announce_cancel_cb()

void imquic_set_incoming_announce_cancel_cb ( imquic_endpoint * endpoint,
void(*)(imquic_connection *conn, imquic_moq_namespace *tns) incoming_announce_cancel )

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

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

◆ imquic_set_incoming_announce_cb()

void imquic_set_incoming_announce_cb ( imquic_endpoint * endpoint,
void(*)(imquic_connection *conn, imquic_moq_namespace *tns) incoming_announce )

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

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

◆ imquic_set_incoming_fetch_cancel_cb()

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

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_fetch_cb()

void imquic_set_incoming_fetch_cb ( imquic_endpoint * endpoint,
void(*)(imquic_connection *conn, uint64_t subscribe_id, imquic_moq_namespace *tns, imquic_moq_name *tn, gboolean descending, imquic_moq_fetch_range *range, imquic_moq_auth_info *auth) incoming_fetch )

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

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

◆ imquic_set_incoming_goaway_cb()

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

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_object_cb()

void imquic_set_incoming_object_cb ( imquic_endpoint * endpoint,
void(*)(imquic_connection *conn, imquic_moq_object *object) incoming_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_subscribe_announces_cb()

void imquic_set_incoming_subscribe_announces_cb ( imquic_endpoint * endpoint,
void(*)(imquic_connection *conn, imquic_moq_namespace *tns, imquic_moq_auth_info *auth) incoming_subscribe_announces )

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

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

◆ imquic_set_incoming_subscribe_cb()

void imquic_set_incoming_subscribe_cb ( imquic_endpoint * endpoint,
void(*)(imquic_connection *conn, uint64_t subscribe_id, uint64_t track_alias, imquic_moq_namespace *tns, imquic_moq_name *tn, imquic_moq_auth_info *auth) incoming_subscribe )

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_unannounce_cb()

void imquic_set_incoming_unannounce_cb ( imquic_endpoint * endpoint,
void(*)(imquic_connection *conn, imquic_moq_namespace *tns) incoming_unannounce )

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

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

◆ imquic_set_incoming_unsubscribe_announces_cb()

void imquic_set_incoming_unsubscribe_announces_cb ( imquic_endpoint * endpoint,
void(*)(imquic_connection *conn, imquic_moq_namespace *tns) incoming_unsubscribe_announces )

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

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

◆ imquic_set_incoming_unsubscribe_cb()

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

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_moq_connection_gone_cb()

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

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(*)(imquic_connection *conn) moq_ready )

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(*)(imquic_connection *conn, void *user_data) new_moq_connection )

Configure the callback function to be notified about new MoQ 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_subscribe_accepted_cb()

void imquic_set_subscribe_accepted_cb ( imquic_endpoint * endpoint,
void(*)(imquic_connection *conn, uint64_t subscribe_id, uint64_t expires, gboolean descending) subscribe_accepted )

Configure the callback function to be notified when an 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 an SUBSCRIBE is accepted

◆ imquic_set_subscribe_announces_accepted_cb()

void imquic_set_subscribe_announces_accepted_cb ( imquic_endpoint * endpoint,
void(*)(imquic_connection *conn, imquic_moq_namespace *tns) subscribe_announces_accepted )

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

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

◆ imquic_set_subscribe_announces_error_cb()

void imquic_set_subscribe_announces_error_cb ( imquic_endpoint * endpoint,
void(*)(imquic_connection *conn, imquic_moq_namespace *tns, int error_code, const char *reason) subscribe_announces_error )

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

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

◆ imquic_set_subscribe_done_cb()

void imquic_set_subscribe_done_cb ( imquic_endpoint * endpoint,
void(*)(imquic_connection *conn, uint64_t subscribe_id, int status_code, const char *reason) subscribe_done )

Configure the callback function to be notified when an SUBSCRIBE we previously sent is now done.

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_donePointer to the function that will fire when an SUBSCRIBE is done

◆ imquic_set_subscribe_error_cb()

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

Configure the callback function to be notified when an 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 an SUBSCRIBE is rejected