Loading...
Searching...
No Matches
imquic/moq.h
Go to the documentation of this file.
1
336#ifndef IMQUIC_MOQ_H
337#define IMQUIC_MOQ_H
338
339#include "imquic.h"
340
350
352typedef struct imquic_moq_name {
354 uint8_t *buffer;
356 size_t length;
358
366
372
380
400
418
449
453
484imquic_server *imquic_create_moq_server(const char *name, ...);
519imquic_client *imquic_create_moq_client(const char *name, ...);
520
533 void (* new_moq_connection)(imquic_connection *conn, void *user_data));
540 void (* moq_ready)(imquic_connection *conn));
546 void (* incoming_announce)(imquic_connection *conn, imquic_moq_namespace *tns));
552 void (* incoming_announce_cancel)(imquic_connection *conn, imquic_moq_namespace *tns));
558 void (* announce_accepted)(imquic_connection *conn, imquic_moq_namespace *tns));
564 void (* announce_error)(imquic_connection *conn, imquic_moq_namespace *tns, int error_code, const char *reason));
570 void (* incoming_unannounce)(imquic_connection *conn, imquic_moq_namespace *tns));
576 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));
582 void (* subscribe_accepted)(imquic_connection *conn, uint64_t subscribe_id, uint64_t expires, gboolean descending));
588 void (* subscribe_error)(imquic_connection *conn, uint64_t subscribe_id, int error_code, const char *reason, uint64_t track_alias));
597 void (* subscribe_done)(imquic_connection *conn, uint64_t subscribe_id, int status_code, const char *reason));
603 void (* incoming_unsubscribe)(imquic_connection *conn, uint64_t subscribe_id));
609 void (* incoming_subscribe_announces)(imquic_connection *conn, imquic_moq_namespace *tns, imquic_moq_auth_info *auth));
615 void (* subscribe_announces_accepted)(imquic_connection *conn, imquic_moq_namespace *tns));
621 void (* subscribe_announces_error)(imquic_connection *conn, imquic_moq_namespace *tns, int error_code, const char *reason));
627 void (* incoming_unsubscribe_announces)(imquic_connection *conn, imquic_moq_namespace *tns));
633 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));
639 void (* incoming_fetch_cancel)(imquic_connection *conn, uint64_t subscribe_id));
645 void (* fetch_accepted)(imquic_connection *conn, uint64_t subscribe_id, gboolean descending, imquic_moq_position *largest));
651 void (* fetch_error)(imquic_connection *conn, uint64_t subscribe_id, int error_code, const char *reason));
657 void (* incoming_object)(imquic_connection *conn, imquic_moq_object *object));
663 void (* incoming_goaway)(imquic_connection *conn, const char *uri));
670 void (* moq_connection_gone)(imquic_connection *conn));
672
682const char *imquic_moq_role_str(imquic_moq_role role);
696
698typedef enum imquic_moq_version {
699 /* Base */
701 /* Draft version -03 */
704 /* Draft version -04 */
706 /* Draft version -05 */
708 /* Draft version -06 */
710 /* Draft version -07 */
712 /* Draft version -07 with a twist? */
715 /* Any post-v06 version: for client, it means offer all supported versions;
716 * for servers, it means accept the first supported offered version */
718 /* Any pre-v06 version: for client, it means offer all supported versions;
719 * for servers, it means accept the first supported offered version */
725const char *imquic_moq_version_str(imquic_moq_version version);
739
746int imquic_moq_set_max_subscribe_id(imquic_connection *conn, uint64_t max_subscribe_id);
747
751/* Namespaces and subscriptions */
768int imquic_moq_reject_announce(imquic_connection *conn, imquic_moq_namespace *tns, int error_code, const char *reason);
782int 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);
789int imquic_moq_accept_subscribe(imquic_connection *conn, uint64_t subscribe_id, uint64_t expires, gboolean descending);
797int imquic_moq_reject_subscribe(imquic_connection *conn, uint64_t subscribe_id, int error_code, const char *reason, uint64_t track_alias);
802int imquic_moq_unsubscribe(imquic_connection *conn, uint64_t subscribe_id);
820int imquic_moq_reject_subscribe_announces(imquic_connection *conn, imquic_moq_namespace *tns, int error_code, const char *reason);
835int imquic_moq_fetch(imquic_connection *conn, uint64_t subscribe_id, imquic_moq_namespace *tns, imquic_moq_name *tn,
836 gboolean descending, imquic_moq_fetch_range *range, imquic_moq_auth_info *auth);
843int imquic_moq_accept_fetch(imquic_connection *conn, uint64_t subscribe_id, gboolean descending, imquic_moq_position *largest);
850int imquic_moq_reject_fetch(imquic_connection *conn, uint64_t subscribe_id, int error_code, const char *reason);
855int imquic_moq_cancel_fetch(imquic_connection *conn, uint64_t subscribe_id);
868
869#endif
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.
Definition imquic-moq.c:251
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.
Definition imquic-moq.c:207
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.
Definition imquic-moq.c:497
int imquic_moq_cancel_fetch(imquic_connection *conn, uint64_t subscribe_id)
Function to send a FETCH_CANCEL request.
Definition moq.c:4909
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.
Definition imquic-moq.c:262
struct imquic_moq_fetch_range imquic_moq_fetch_range
MoQ FETCH range (from where to where)
imquic_moq_object_status
MoQ Object status.
Definition imquic/moq.h:402
@ IMQUIC_MOQ_END_OF_SUBGROUP
End of subgroup.
Definition imquic/moq.h:412
@ IMQUIC_MOQ_END_OF_GROUP
End of group.
Definition imquic/moq.h:408
@ IMQUIC_MOQ_OBJECT_DOESNT_EXIST
Object doesn't exist.
Definition imquic/moq.h:406
@ IMQUIC_MOQ_END_OF_TRACK_AND_GROUP
End of track.
Definition imquic/moq.h:410
@ IMQUIC_MOQ_NORMAL_OBJECT
Normal object.
Definition imquic/moq.h:404
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,...
Definition imquic-moq.c:405
int imquic_moq_accept_subscribe_announces(imquic_connection *conn, imquic_moq_namespace *tns)
Function to accept an incoming SUBSCRIBE_ANNOUNCES request.
Definition moq.c:4739
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.
Definition moq.c:4886
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 ...
Definition imquic-moq.c:240
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,...
Definition moq.c:4381
const char * imquic_moq_role_str(imquic_moq_role role)
Helper function to serialize to string the name of a imquic_moq_role property.
Definition imquic-moq.c:439
int imquic_moq_subscribe_announces(imquic_connection *conn, imquic_moq_namespace *tns, imquic_moq_auth_info *auth)
Function to send a SUBSCRIBE_ANNOUNCES request.
Definition moq.c:4704
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 establishe...
Definition imquic-moq.c:196
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.
Definition imquic-moq.c:306
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.
Definition imquic-moq.c:416
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...
Definition imquic-moq.c:350
struct imquic_moq_object imquic_moq_object
MoQ Object.
const char * imquic_moq_delivery_str(imquic_moq_delivery type)
Helper function to serialize to string the name of a imquic_moq_delivery property.
Definition imquic-moq.c:477
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.
Definition imquic-moq.c:273
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....
Definition imquic-moq.c:103
struct imquic_moq_auth_info imquic_moq_auth_info
MoQ Auth Info.
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.
Definition imquic-moq.c:295
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...
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....
Definition imquic-moq.c:20
imquic_moq_role imquic_moq_get_role(imquic_connection *conn)
Helper function to get the MoQ role associated with a connection.
Definition moq.c:4352
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.
Definition imquic-moq.c:218
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.
Definition moq.c:4427
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.
Definition imquic-moq.c:229
struct imquic_moq_position imquic_moq_position
MoQ Group/Object couple (for ranges)
struct imquic_moq_namespace imquic_moq_namespace
MoQ Track Namespace.
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,...
Definition moq.c:4322
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.
Definition moq.c:4508
imquic_moq_version imquic_moq_get_version(imquic_connection *conn)
Helper function to get the MoQ version associated with a connection.
Definition moq.c:4411
int imquic_moq_send_object(imquic_connection *conn, imquic_moq_object *object)
Function to send a MoQ object.
Definition moq.c:4932
int imquic_moq_announce(imquic_connection *conn, imquic_moq_namespace *tns)
Function to send an ANNOUNCE request.
Definition moq.c:4462
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.
Definition moq.c:4554
imquic_moq_version
Versions that can be negotiated.
Definition imquic/moq.h:698
@ IMQUIC_MOQ_VERSION_ANY_LEGACY
Definition imquic/moq.h:720
@ IMQUIC_MOQ_VERSION_06
Definition imquic/moq.h:709
@ IMQUIC_MOQ_VERSION_MIN
Definition imquic/moq.h:702
@ IMQUIC_MOQ_VERSION_MAX
Definition imquic/moq.h:714
@ IMQUIC_MOQ_VERSION_04
Definition imquic/moq.h:705
@ IMQUIC_MOQ_VERSION_07_PATCH
Definition imquic/moq.h:713
@ IMQUIC_MOQ_VERSION_03
Definition imquic/moq.h:703
@ IMQUIC_MOQ_VERSION_07
Definition imquic/moq.h:711
@ IMQUIC_MOQ_VERSION_05
Definition imquic/moq.h:707
@ IMQUIC_MOQ_VERSION_BASE
Definition imquic/moq.h:700
@ IMQUIC_MOQ_VERSION_ANY
Definition imquic/moq.h:717
const char * imquic_moq_version_str(imquic_moq_version version)
Helper function to serialize to string the name of a imquic_moq_version property.
Definition imquic-moq.c:453
struct imquic_moq_name imquic_moq_name
MoQ Track Name.
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 ...
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.
Definition imquic-moq.c:383
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 endpoi...
Definition imquic-moq.c:427
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.
Definition imquic-moq.c:317
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.
Definition moq.c:4856
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 rej...
Definition imquic-moq.c:339
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.
Definition moq.c:4658
int imquic_moq_unsubscribe_announces(imquic_connection *conn, imquic_moq_namespace *tns)
Function to send a UNSUBSCRIBE_ANNOUNCES request.
Definition moq.c:4785
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.
Definition imquic-moq.c:372
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.
Definition moq.c:4808
imquic_moq_role
Roles that can be specified once connected.
Definition imquic/moq.h:674
@ IMQUIC_MOQ_PUBSUB
Definition imquic/moq.h:677
@ IMQUIC_MOQ_PUBLISHER
Definition imquic/moq.h:675
@ IMQUIC_MOQ_SUBSCRIBER
Definition imquic/moq.h:676
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 acc...
Definition imquic-moq.c:328
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....
Definition imquic-moq.c:185
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.
Definition moq.c:4762
int imquic_moq_accept_subscribe(imquic_connection *conn, uint64_t subscribe_id, uint64_t expires, gboolean descending)
Function to accept an incoming SUBSCRIBE request.
Definition moq.c:4627
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.
Definition imquic-moq.c:361
int imquic_moq_accept_announce(imquic_connection *conn, imquic_moq_namespace *tns)
Function to accept an incoming ANNOUNCE request.
Definition moq.c:4485
int imquic_moq_unsubscribe(imquic_connection *conn, uint64_t subscribe_id)
Function to send a UNSUBSCRIBE request.
Definition moq.c:4681
int imquic_moq_unannounce(imquic_connection *conn, imquic_moq_namespace *tns)
Function to send an UNANNOUNCE request.
Definition moq.c:4531
imquic_moq_delivery
Ways of sending objects.
Definition imquic/moq.h:382
@ IMQUIC_MOQ_USE_GROUP
All objects of the same group on the same STREAM (only before v06)
Definition imquic/moq.h:388
@ IMQUIC_MOQ_USE_STREAM
A single object on a STREAM (only before v06)
Definition imquic/moq.h:386
@ IMQUIC_MOQ_USE_TRACK
All objects of the same track on the same STREAM (only before v07)
Definition imquic/moq.h:392
@ IMQUIC_MOQ_USE_FETCH
All fetched objects on the same STREAM (only v07)
Definition imquic/moq.h:394
@ IMQUIC_MOQ_USE_DATAGRAM
A single object on a DATAGRAM.
Definition imquic/moq.h:384
@ IMQUIC_MOQ_USE_SUBGROUP
All objects of the same subgroup on the same STREAM (v06 and v07 only)
Definition imquic/moq.h:390
imquic public interface (headers)
QUIC Connection.
Definition connection.h:101
MoQ Auth Info.
Definition imquic/moq.h:360
size_t length
Size of the auth info data.
Definition imquic/moq.h:364
uint8_t * buffer
Auth info data (typically a non-null terminated string)
Definition imquic/moq.h:362
MoQ FETCH range (from where to where)
Definition imquic/moq.h:374
imquic_moq_position start
Start group/object.
Definition imquic/moq.h:376
imquic_moq_position end
End group/object.
Definition imquic/moq.h:378
MoQ Track Name.
Definition imquic/moq.h:352
size_t length
Size of the name data.
Definition imquic/moq.h:356
uint8_t * buffer
Name data (typically a non-null terminated string)
Definition imquic/moq.h:354
MoQ Track Namespace.
Definition imquic/moq.h:342
size_t length
Size of the namespace data.
Definition imquic/moq.h:346
uint8_t * buffer
Namespace data (typically a non-null terminated string)
Definition imquic/moq.h:344
struct imquic_moq_namespace * next
Next namespace in this list, if this is a tuple.
Definition imquic/moq.h:348
MoQ Object.
Definition imquic/moq.h:423
imquic_moq_delivery delivery
How to send this object (or how it was received)
Definition imquic/moq.h:445
size_t payload_len
Size of the MoQ object payload.
Definition imquic/moq.h:443
uint64_t subgroup_id
MoQ subgroup_id (v06 and v07 only)
Definition imquic/moq.h:431
gboolean end_of_stream
Whether this signals the end of the stream.
Definition imquic/moq.h:447
uint64_t subscribe_id
MoQ subscribe_id.
Definition imquic/moq.h:425
uint64_t group_id
MoQ group_id.
Definition imquic/moq.h:429
uint64_t object_id
MoQ object_id.
Definition imquic/moq.h:433
uint8_t * payload
MoQ object payload.
Definition imquic/moq.h:441
uint8_t priority
MoQ publisher priority (only after v05)
Definition imquic/moq.h:439
uint64_t track_alias
MoQ track_alias.
Definition imquic/moq.h:427
uint64_t object_send_order
MoQ object_sent_order (v03 and v04 only)
Definition imquic/moq.h:437
imquic_moq_object_status object_status
MoQ object status.
Definition imquic/moq.h:435
MoQ Group/Object couple (for ranges)
Definition imquic/moq.h:368
uint64_t group
Definition imquic/moq.h:369
uint64_t object
Definition imquic/moq.h:370
Abstraction of a network endpoint (client or server)
Definition network.h:43