Loading...
Searching...
No Matches
imquic-moq.c File Reference

imquic MoQ public interface More...

#include "imquic/moq.h"
#include "internal/configuration.h"
#include "internal/connection.h"
#include "internal/moq.h"
Include dependency graph for imquic-moq.c:

Functions

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.:
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)
gboolean imquic_moq_namespace_equals (imquic_moq_namespace *first, imquic_moq_namespace *second)
 Helper to check whether two namespaces are the sames.
gboolean imquic_moq_namespace_contains (imquic_moq_namespace *parent, imquic_moq_namespace *child)
 Helper to check whether a namespace is contained in another.
imquic_moq_namespaceimquic_moq_namespace_duplicate (imquic_moq_namespace *tns)
 Helper to duplicate a namespace.
void imquic_moq_namespace_free (imquic_moq_namespace *tns)
 Helper to free a imquic_moq_namespace instance.
const char * imquic_moq_track_str (imquic_moq_name *tn, char *buffer, size_t blen)
gboolean imquic_moq_name_equals (imquic_moq_name *first, imquic_moq_name *second)
 Helper to check whether two track names are the sames.
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 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, imquic_moq_request_parameters *parameters))
 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_request_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_request_parameters *parameters))
 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_request_error_code error_code, const char *reason, uint64_t retry_interval))
 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, imquic_moq_request_parameters *parameters, GList *track_extensions))
 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, imquic_moq_request_parameters *parameters))
 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_request_error_code error_codes, const char *reason, uint64_t retry_interval))
 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, imquic_moq_request_parameters *parameters))
 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, imquic_moq_request_parameters *parameters, GList *track_extensions))
 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_request_error_code error_codes, const char *reason, uint64_t track_alias, uint64_t retry_interval))
 Configure the callback function to be notified when a SUBSCRIBE we previously sent was rejected with an error.
void imquic_set_request_updated_cb (imquic_endpoint *endpoint, void(*request_updated)(imquic_connection *conn, uint64_t request_id, uint64_t sub_request_id, imquic_moq_request_parameters *parameters))
 Configure the callback function to be notified when an update is received for a request (e.g., a SUBSCRIBE ) we previously sent.
void imquic_set_request_update_accepted_cb (imquic_endpoint *endpoint, void(*request_update_accepted)(imquic_connection *conn, uint64_t request_id, imquic_moq_request_parameters *parameters))
 Configure the callback function to be notified when an OK is received for a REQUEST_UPDATE we previously sent.
void imquic_set_request_update_error_cb (imquic_endpoint *endpoint, void(*request_update_error)(imquic_connection *conn, uint64_t request_id, imquic_moq_request_error_code error_codes, const char *reason, uint64_t retry_interval))
 Configure the callback function to be notified when a REQUEST_UPDATE we previously sent was rejected with an error.
void imquic_set_publish_done_cb (imquic_endpoint *endpoint, void(*publish_done)(imquic_connection *conn, uint64_t request_id, imquic_moq_pub_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, imquic_moq_subscribe_namespace_options subscribe_options, imquic_moq_request_parameters *parameters))
 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_request_parameters *parameters))
 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_request_error_code error_code, const char *reason, uint64_t retry_interval))
 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, uint64_t request_id, imquic_moq_namespace *tns))
 Configure the callback function to be notified when there's an incoming UNSUBSCRIBE_NAMESPACE request.
void imquic_set_incoming_namespace_cb (imquic_endpoint *endpoint, void(*incoming_namespace)(imquic_connection *conn, uint64_t request_id, imquic_moq_namespace *tns_suffix))
 Configure the callback function to be notified when there's an incoming NAMESPACE request.
void imquic_set_incoming_namespace_done_cb (imquic_endpoint *endpoint, void(*incoming_namespace_done)(imquic_connection *conn, uint64_t request_id, imquic_moq_namespace *tns_suffix))
 Configure the callback function to be notified when there's an incoming NAMESPACE_DONE 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, imquic_moq_location_range *range, imquic_moq_request_parameters *parameters))
 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, imquic_moq_request_parameters *parameters))
 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, imquic_moq_location *largest, imquic_moq_request_parameters *parameters, GList *track_extensions))
 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_request_error_code error_codes, const char *reason, uint64_t retry_interval))
 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, imquic_moq_request_parameters *parameters))
 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, imquic_moq_request_parameters *parameters))
 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_request_error_code error_codes, const char *reason, uint64_t retry_interval))
 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.
const char * imquic_moq_version_str (imquic_moq_version version)
 Helper function to serialize to string the name of a imquic_moq_version property.
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_extension_type_str (imquic_moq_extension_type type)
 Helper function to serialize to string the name of a imquic_moq_extension_type value.

Detailed Description

imquic MoQ public interface

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.

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_MOQ_VERSION, IMQUIC_MOQ_VERSION_16,
        IMQUIC_CONFIG_HTTP3_PATH, "/moq",
        IMQUIC_CONFIG_DONE, NULL);

to create a QUIC client that will automatically negotiate MoQ over WebTransport. Notice that this only specifies the QUIC role (client), not what role the application will have with respect to MoQ. Again, notice that, axacrlt 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_MOQ_VERSION, IMQUIC_MOQ_VERSION_16,
        IMQUIC_CONFIG_DONE, NULL);

to create a QUIC server that will automatically negotiate MoQ over WebTransport. Notice that this only specifies the QUIC role (server), not what role the application will have with respect to MoQ. Againn notice that, exactly 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_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_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_name_equals()

gboolean imquic_moq_name_equals ( imquic_moq_name * first,
imquic_moq_name * second )

Helper to check whether two track names are the sames.

Parameters
firstThe first track name to check
secondThe second track name to check
Returns
TRUE if the second track name is part of the secondm, FALSE otherwise

◆ imquic_moq_namespace_contains()

gboolean imquic_moq_namespace_contains ( imquic_moq_namespace * parent,
imquic_moq_namespace * child )

Helper to check whether a namespace is contained in another.

Parameters
parentThe namespace parent to check
childThe namespace child to check
Returns
TRUE if the child namespace is part of the parent, FALSE otherwise

◆ imquic_moq_namespace_duplicate()

imquic_moq_namespace * imquic_moq_namespace_duplicate ( imquic_moq_namespace * tns)

Helper to duplicate a namespace.

Note
This will allocate a new buffer, that must be freed with imquic_moq_namespace
Parameters
tnsThe namespace to duplicate
Returns
A pointer to a new imquic_moq_namespace, if successful, NULL otherwise

◆ imquic_moq_namespace_equals()

gboolean imquic_moq_namespace_equals ( imquic_moq_namespace * first,
imquic_moq_namespace * second )

Helper to check whether two namespaces are the sames.

Parameters
firstThe first namespace to check
secondThe second namespace to check
Returns
TRUE if the first namespace is equal to the second, FALSE otherwise

◆ imquic_moq_namespace_free()

void imquic_moq_namespace_free ( imquic_moq_namespace * tns)

Helper to free a imquic_moq_namespace instance.

Note
This should only be used if everything in the namespace, including buffers, were allocated, e.g., via a call to imquic_moq_namespace_duplicate
Parameters
tnsThe namespace to free

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

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

◆ 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, imquic_moq_location *largest, imquic_moq_request_parameters *parameters, GList *track_extensions) )

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_request_error_code error_code, const char *reason, uint64_t retry_interval) )

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, imquic_moq_request_parameters *parameters) )

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

void imquic_set_incoming_namespace_cb ( imquic_endpoint * endpoint,
void(* incoming_namespace )(imquic_connection *conn, uint64_t request_id, imquic_moq_namespace *tns) )

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

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

◆ imquic_set_incoming_namespace_done_cb()

void imquic_set_incoming_namespace_done_cb ( imquic_endpoint * endpoint,
void(* incoming_namespace_done )(imquic_connection *conn, uint64_t request_id, imquic_moq_namespace *tns) )

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

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

◆ 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, imquic_moq_request_parameters *parameters, GList *track_extensions) )

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_request_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, imquic_moq_request_parameters *parameters) )

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, imquic_moq_location_range *range, imquic_moq_request_parameters *parameters) )

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, imquic_moq_request_parameters *parameters) )

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, imquic_moq_subscribe_namespace_options subscribe_options, imquic_moq_request_parameters *parameters) )

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, imquic_moq_request_parameters *parameters) )

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, uint64_t request_id, 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 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, imquic_moq_request_parameters *parameters) )

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_pub_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_request_error_code error_code, const char *reason, uint64_t retry_interval) )

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_request_parameters *parameters) )

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_request_error_code error_code, const char *reason, uint64_t retry_interval) )

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

void imquic_set_request_update_accepted_cb ( imquic_endpoint * endpoint,
void(* request_update_accepted )(imquic_connection *conn, uint64_t request_id, imquic_moq_request_parameters *parameters) )

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

Note
This was only added in v15, and so will never be fired on older versions.
Parameters
endpointThe imquic_endpoint (imquic_server or imquic_client) to configure
request_update_acceptedPointer to the function that will fire when a REQUEST_UPDATE is acknowledged

◆ imquic_set_request_update_error_cb()

void imquic_set_request_update_error_cb ( imquic_endpoint * endpoint,
void(* request_update_error )(imquic_connection *conn, uint64_t request_id, imquic_moq_request_error_code error_code, const char *reason, uint64_t retry_interval) )

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

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

◆ imquic_set_request_updated_cb()

void imquic_set_request_updated_cb ( imquic_endpoint * endpoint,
void(* request_updated )(imquic_connection *conn, uint64_t request_id, uint64_t sub_request_id, imquic_moq_request_parameters *parameters) )

Configure the callback function to be notified when an update is received for a request (e.g., a SUBSCRIBE ) we previously sent.

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

◆ 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, imquic_moq_request_parameters *parameters, GList *track_extensions) )

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_request_error_code error_code, const char *reason, uint64_t track_alias, uint64_t retry_interval) )

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_request_parameters *parameters) )

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_request_error_code error_code, const char *reason, uint64_t retry_interval) )

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_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, imquic_moq_request_parameters *parameters) )

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_request_error_code error_code, const char *reason, uint64_t retry_interval) )

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