18#ifndef IMQUIC_MOQ_INTERNAL_H
19#define IMQUIC_MOQ_INTERNAL_H
31#define IMQUIC_MOQ 7171953
660 uint8_t *bytes,
size_t blen,
size_t poffset,
size_t plen,
size_t *start);
670 GList *supported_versions,
size_t params_num,
imquic_data *parameters);
680 uint32_t version,
size_t params_num,
imquic_data *parameters);
769 uint64_t start_group, uint64_t start_object, uint64_t end_group, uint64_t end_object,
size_t params_num,
imquic_data *parameters);
784 uint64_t start_group, uint64_t start_object, uint64_t end_group, uint64_t end_object, uint8_t priority,
800 uint64_t expires,
imquic_moq_group_order group_order, gboolean content_exists, uint64_t largest_group_id, uint64_t largest_object_id,
832 imquic_moq_sub_done_code status,
const char *reason, gboolean content_exists, uint64_t final_group, uint64_t final_object);
887 uint64_t start_group, uint64_t start_object, uint64_t end_group, uint64_t end_object,
size_t params_num,
imquic_data *parameters);
908 uint8_t group_order, uint8_t end_of_track, uint64_t largest_group_id, uint64_t largest_object_id,
957 uint64_t group_id, uint64_t object_id, uint64_t object_status, uint64_t object_send_order, uint8_t priority, uint8_t *payload,
size_t plen);
974 uint64_t group_id, uint64_t object_id, uint64_t object_status, uint64_t object_send_order, uint8_t priority, uint8_t *payload,
size_t plen);
988 uint64_t subscribe_id, uint64_t track_alias, uint64_t object_send_order, uint8_t priority);
1001 uint64_t group_id, uint64_t object_id, uint64_t object_status, uint8_t *payload,
size_t plen);
1016 uint64_t track_alias, uint64_t group_id, uint64_t object_send_order, uint8_t priority);
1028 uint64_t object_id, uint64_t object_status, uint8_t *payload,
size_t plen);
1043 uint64_t track_alias, uint64_t group_id, uint64_t subgroup_id, uint8_t priority);
1055 uint64_t object_id, uint64_t object_status, uint8_t *payload,
size_t plen);
1080 uint64_t group_id, uint64_t subgroup_id, uint64_t object_id, uint8_t priority,
1081 uint64_t object_status, uint8_t *payload,
size_t plen);
1199 uint8_t *bytes, uint64_t offset, uint64_t length, gboolean complete);
imquic MoQ public interface (headers)
imquic_moq_object_status
MoQ Object status.
Definition imquic/moq.h:402
imquic_moq_version
Versions that can be negotiated.
Definition imquic/moq.h:698
imquic_moq_delivery
Ways of sending objects.
Definition imquic/moq.h:382
imquic public interface (headers)
size_t imquic_moq_add_subscribe_announces(imquic_moq_context *moq, uint8_t *bytes, size_t blen, imquic_moq_namespace *track_namespace, size_t params_num, imquic_data *parameters)
Helper to add a SUBSCRIBE_ANNOUNCES message (version -04 of the draft) to a buffer.
Definition moq.c:3556
int imquic_moq_parse_message(imquic_moq_context *moq, uint64_t stream_id, uint8_t *bytes, size_t blen, gboolean complete, gboolean datagram)
Parse an incoming MoQ message.
Definition moq.c:519
size_t imquic_moq_add_stream_header_track(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t subscribe_id, uint64_t track_alias, uint64_t object_send_order, uint8_t priority)
Helper to add a STREAM_HEADER_TRACK message to a buffer (only before v06)
Definition moq.c:3962
size_t imquic_moq_add_stream_header_subgroup(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t subscribe_id, uint64_t track_alias, uint64_t group_id, uint64_t subgroup_id, uint8_t priority)
Helper to add a STREAM_HEADER_SUBGROUP message to a buffer (only after v06)
Definition moq.c:4069
size_t imquic_moq_parse_subscribe_announces_ok(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
Helper to parse a SUBSCRIBE_ANNOUNCES_OK message.
Definition moq.c:1905
gboolean imquic_moq_buffer_resize(imquic_moq_buffer *buffer, uint64_t new_size)
Resize an existing buffer.
Definition moq.c:441
size_t imquic_moq_add_track_status(imquic_moq_context *moq, uint8_t *bytes, size_t blen, imquic_moq_namespace *track_namespace, imquic_moq_name *track_name, uint64_t status_code, uint64_t last_group_id, uint64_t last_object_id)
Helper to add a TRACK_STATUS message to a buffer.
Definition moq.c:3859
size_t imquic_moq_parse_max_subscribe_id(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
Helper to pars an MAX_SUBSCRIBE_ID message.
Definition moq.c:1008
int imquic_moq_parse_stream_header_subgroup_object(imquic_moq_context *moq, imquic_moq_stream *moq_stream, gboolean complete)
Helper to parse a STREAM_HEADER_SUBGROUP object.
Definition moq.c:2859
size_t imquic_moq_add_client_setup(imquic_moq_context *moq, uint8_t *bytes, size_t blen, GList *supported_versions, size_t params_num, imquic_data *parameters)
Helper method to add a CLIENT_SETUP message to a buffer.
Definition moq.c:3075
size_t imquic_moq_parse_announce_error(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
Helper to parse an ANNOUNCE_ERROR message.
Definition moq.c:1159
size_t imquic_moq_add_fetch_header(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t subscribe_id)
Helper to add a FETCH_HEADER message to a buffer (only after v07)
Definition moq.c:4120
struct imquic_moq_location imquic_moq_location
MoQ location.
size_t imquic_moq_add_subscribe_announces_error(imquic_moq_context *moq, uint8_t *bytes, size_t blen, imquic_moq_namespace *track_namespace, imquic_moq_error_code error, const char *reason)
Helper method to add a SUBSCRIBE_ANNOUNCES_ERRROR message to a buffer.
Definition moq.c:3627
size_t imquic_moq_parse_track_status(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
Helper to parse a TRACK_STATUS message.
Definition moq.c:2362
size_t imquic_moq_parse_subscribe_ok(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
Helper to parse a SUBSCRIBE_OK message.
Definition moq.c:1644
void imquic_moq_subscription_destroy(imquic_moq_subscription *moq_sub)
Destroy an existing MoQ subscription.
Definition moq.c:495
const char * imquic_moq_sub_done_code_str(imquic_moq_sub_done_code code)
Helper function to serialize to string the name of a imquic_moq_sub_done_code value.
Definition moq.c:242
void imquic_moq_stream_incoming(imquic_connection *conn, uint64_t stream_id, uint8_t *bytes, uint64_t offset, uint64_t length, gboolean complete)
Callback the core invokes when there's new incoming data on a STREAM.
Definition moq.c:129
size_t imquic_moq_parameter_add_data(imquic_moq_context *moq, uint8_t *bytes, size_t blen, int param, uint8_t *buf, size_t buflen)
Helper to add a MoQ (setup or subscribe) parameter with generic data to a buffer.
Definition moq.c:4306
imquic_moq_setup_parameter_type
MoQ setup parameters.
Definition internal/moq.h:137
@ IMQUIC_MOQ_PARAM_PATH
Definition internal/moq.h:139
@ IMQUIC_MOQ_PARAM_MAX_SUBSCRIBE_ID
Definition internal/moq.h:140
@ IMQUIC_MOQ_PARAM_ROLE
Definition internal/moq.h:138
struct imquic_moq_subscription imquic_moq_subscription
MoQ subscription, whether this is a publisher or a subscriber.
size_t imquic_moq_parse_announce_cancel(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
Helper to parse an ANNOUNCE_CANCEL message.
Definition moq.c:1291
void imquic_moq_stream_destroy(imquic_moq_stream *moq_stream)
Destroy an existing MoQ stream.
Definition moq.c:505
size_t imquic_moq_add_object_stream(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t subscribe_id, uint64_t track_alias, uint64_t group_id, uint64_t object_id, uint64_t object_status, uint64_t object_send_order, uint8_t priority, uint8_t *payload, size_t plen)
Helper to add an OBJECT_STREAM message to a buffer (only before v06)
Definition moq.c:3901
size_t imquic_moq_parse_fetch_header(imquic_moq_context *moq, imquic_moq_stream *moq_stream, uint8_t *bytes, size_t blen, uint8_t *error)
Helper to parse a FETCH_HEADER message.
Definition moq.c:2919
void imquic_moq_buffer_destroy(imquic_moq_buffer *buffer)
Destroy an existing buffer.
Definition moq.c:476
imquic_moq_filter_type
MoQ filter type.
Definition internal/moq.h:220
@ IMQUIC_MOQ_FILTER_ABSOLUTE_RANGE
Definition internal/moq.h:224
@ IMQUIC_MOQ_FILTER_ABSOLUTE_START
Definition internal/moq.h:223
@ IMQUIC_MOQ_FILTER_LATEST_GROUP
Definition internal/moq.h:221
@ IMQUIC_MOQ_FILTER_LATEST_OBJECT
Definition internal/moq.h:222
size_t imquic_moq_add_unsubscribe_announces(imquic_moq_context *moq, uint8_t *bytes, size_t blen, imquic_moq_namespace *track_namespace)
Helper method to add an UNSUBSCRIBE_ANNOUNCES message to a buffer.
Definition moq.c:3667
size_t imquic_moq_add_subscribe_done(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t subscribe_id, imquic_moq_sub_done_code status, const char *reason, gboolean content_exists, uint64_t final_group, uint64_t final_object)
Helper method to add a SUBSCRIBE_DONE message to a buffer.
Definition moq.c:3532
size_t imquic_moq_add_stream_header_subgroup_object(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t object_id, uint64_t object_status, uint8_t *payload, size_t plen)
Helper to add an object to a buffer, formatted as expected for STREAM_HEADER_SUBGROUP objects (so not...
Definition moq.c:4093
imquic_moq_location_mode
MoQ location modes.
Definition internal/moq.h:199
@ IMQUIC_MOQ_LOCATION_ABSOLUTE
Definition internal/moq.h:201
@ IMQUIC_MOQ_LOCATION_NONE
Definition internal/moq.h:200
@ IMQUIC_MOQ_LOCATION_RELATIVENEXT
Definition internal/moq.h:203
@ IMQUIC_MOQ_LOCATION_RELATIVEPREVIOUS
Definition internal/moq.h:202
size_t imquic_moq_add_fetch_error(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t subscribe_id, imquic_moq_sub_error_code error, const char *reason)
Helper method to add a FETCH_ERRROR message to a buffer.
Definition moq.c:3796
size_t imquic_moq_parse_object_stream(imquic_moq_context *moq, imquic_moq_stream *moq_stream, uint8_t *bytes, size_t blen, uint8_t *error)
Helper to parse an OBJECT_STREAM message.
Definition moq.c:2444
size_t imquic_moq_add_announce_error(imquic_moq_context *moq, uint8_t *bytes, size_t blen, imquic_moq_namespace *track_namespace, imquic_moq_error_code error, const char *reason)
Helper method to add an ANNOUNCE_ERROR message to a buffer.
Definition moq.c:3206
int imquic_moq_parse_stream_header_track_object(imquic_moq_context *moq, imquic_moq_stream *moq_stream, gboolean complete)
Helper to parse a STREAM_HEADER_TRACK object.
Definition moq.c:2633
const char * imquic_moq_group_order_str(imquic_moq_group_order type)
Helper function to serialize to string the name of a imquic_moq_group_order value.
Definition moq.c:427
size_t imquic_moq_add_stream_header_group_object(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t object_id, uint64_t object_status, uint8_t *payload, size_t plen)
Helper to add an object to a buffer, formatted as expected for STREAM_HEADER_GROUP objects (so not al...
Definition moq.c:4042
size_t imquic_moq_add_track_status_request(imquic_moq_context *moq, uint8_t *bytes, size_t blen, imquic_moq_namespace *track_namespace, imquic_moq_name *track_name)
Helper to add a TRACK_STATUS_REQUEST message to a buffer.
Definition moq.c:3820
struct imquic_moq_callbacks imquic_moq_callbacks
RoQ public callbacks.
size_t imquic_moq_parse_stream_header_subgroup(imquic_moq_context *moq, imquic_moq_stream *moq_stream, uint8_t *bytes, size_t blen, uint8_t *error)
Helper to parse a STREAM_HEADER_SUBGROUP message.
Definition moq.c:2809
imquic_moq_message_type
MoQ messages.
Definition internal/moq.h:84
@ IMQUIC_MOQ_SUBSCRIBE_ERROR
Definition internal/moq.h:88
@ IMQUIC_MOQ_UNSUBSCRIBE_ANNOUNCES
Definition internal/moq.h:102
@ IMQUIC_MOQ_CLIENT_SETUP
Definition internal/moq.h:108
@ IMQUIC_MOQ_FETCH
Definition internal/moq.h:104
@ IMQUIC_MOQ_SUBSCRIBE_ANNOUNCES
Definition internal/moq.h:99
@ IMQUIC_MOQ_FETCH_CANCEL
Definition internal/moq.h:105
@ IMQUIC_MOQ_SUBSCRIBE
Definition internal/moq.h:86
@ IMQUIC_MOQ_SUBSCRIBE_ANNOUNCES_ERROR
Definition internal/moq.h:101
@ IMQUIC_MOQ_FETCH_OK
Definition internal/moq.h:106
@ IMQUIC_MOQ_TRACK_STATUS_REQUEST
Definition internal/moq.h:96
@ IMQUIC_MOQ_MAX_SUBSCRIBE_ID
Definition internal/moq.h:103
@ IMQUIC_MOQ_UNSUBSCRIBE
Definition internal/moq.h:93
@ IMQUIC_MOQ_FETCH_ERROR
Definition internal/moq.h:107
@ IMQUIC_MOQ_ANNOUNCE_ERROR
Definition internal/moq.h:91
@ IMQUIC_MOQ_SUBSCRIBE_UPDATE
Definition internal/moq.h:85
@ IMQUIC_MOQ_UNANNOUNCE
Definition internal/moq.h:92
@ IMQUIC_MOQ_GOAWAY
Definition internal/moq.h:98
@ IMQUIC_MOQ_SERVER_SETUP
Definition internal/moq.h:109
@ IMQUIC_MOQ_SUBSCRIBE_ANNOUNCES_OK
Definition internal/moq.h:100
@ IMQUIC_MOQ_ANNOUNCE_OK
Definition internal/moq.h:90
@ IMQUIC_MOQ_ANNOUNCE
Definition internal/moq.h:89
@ IMQUIC_MOQ_SUBSCRIBE_DONE
Definition internal/moq.h:94
@ IMQUIC_MOQ_SUBSCRIBE_OK
Definition internal/moq.h:87
@ IMQUIC_MOQ_ANNOUNCE_CANCEL
Definition internal/moq.h:95
@ IMQUIC_MOQ_TRACK_STATUS
Definition internal/moq.h:97
size_t imquic_moq_parse_subscribe_announces_error(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
Helper to parse a SUBSCRIBE_ANNOUNCES_ERROR message.
Definition moq.c:1948
size_t imquic_moq_add_fetch_ok(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t subscribe_id, uint8_t group_order, uint8_t end_of_track, uint64_t largest_group_id, uint64_t largest_object_id, size_t params_num, imquic_data *parameters)
Helper method to add a FETCH_OK message to a buffer.
Definition moq.c:3767
size_t imquic_moq_add_subscribe_update(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t subscribe_id, uint64_t start_group, uint64_t start_object, uint64_t end_group, uint64_t end_object, uint8_t priority, size_t params_num, imquic_data *parameters)
Helper method to add a SUBSCRIBE_UPDATE message to a buffer.
Definition moq.c:3446
size_t imquic_moq_add_control_message(imquic_moq_context *moq, imquic_moq_message_type type, uint8_t *bytes, size_t blen, size_t poffset, size_t plen, size_t *start)
Helper method to put a message header and a payload together.
Definition moq.c:3049
size_t imquic_moq_parse_setup_parameter(imquic_moq_context *moq, uint8_t *bytes, size_t blen, imquic_moq_parsed_setup_parameter *param, uint8_t *error)
Helper method to parse a MoQ setup parameter.
Definition moq.c:4185
imquic_moq_delivery imquic_moq_data_message_type_to_delivery(imquic_moq_data_message_type type)
Helper function to return the imquic_moq_delivery mode associated to a imquic_moq_data_message_type t...
Definition moq.c:338
size_t imquic_moq_add_object_datagram(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t subscribe_id, uint64_t track_alias, uint64_t group_id, uint64_t object_id, uint64_t object_status, uint64_t object_send_order, uint8_t priority, uint8_t *payload, size_t plen)
Helper to add an OBJECT_DATAGRAM message to a buffer.
Definition moq.c:3934
imquic_moq_group_order
Group ordering for FETCH.
Definition internal/moq.h:233
@ IMQUIC_MOQ_ORDERING_DESCENDING
Definition internal/moq.h:236
@ IMQUIC_MOQ_ORDERING_ASCENDING
Definition internal/moq.h:235
@ IMQUIC_MOQ_ORDERING_ORIGINAL
Definition internal/moq.h:234
size_t imquic_moq_parse_object_datagram(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
Helper to parse an OBJECT_DATAGRAM message.
Definition moq.c:2511
size_t imquic_moq_add_announce(imquic_moq_context *moq, uint8_t *bytes, size_t blen, imquic_moq_namespace *track_namespace, size_t params_num, imquic_data *parameters)
Helper method to add an ANNOUNCE message to a buffer.
Definition moq.c:3131
size_t imquic_moq_parse_fetch(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
Helper to parse a FETCH message.
Definition moq.c:2050
struct imquic_moq_buffer imquic_moq_buffer
MoQ buffer.
void imquic_moq_buffer_shift(imquic_moq_buffer *buffer, uint64_t length)
Move the data in the buffer back of a specific number of bytes.
Definition moq.c:465
size_t imquic_moq_add_stream_header_track_object(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t group_id, uint64_t object_id, uint64_t object_status, uint8_t *payload, size_t plen)
Helper to add an object to a buffer, formatted as expected for STREAM_HEADER_TRACK objects (so not al...
Definition moq.c:3988
void imquic_moq_deinit(void)
Uninitialize the native MoQ stack.
Definition moq.c:41
size_t imquic_moq_add_server_setup(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint32_t version, size_t params_num, imquic_data *parameters)
Helper method to add a SERVER_SETUP message to a buffer.
Definition moq.c:3098
const char * imquic_moq_role_type_str(imquic_moq_role_type type)
Helper function to serialize to string the name of a imquic_moq_role_type value.
Definition moq.c:384
size_t imquic_moq_add_subscribe_error(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t subscribe_id, imquic_moq_sub_error_code error, const char *reason, uint64_t track_alias)
Helper method to add a SUBSCRIBE_ERRROR message to a buffer.
Definition moq.c:3503
size_t imquic_moq_add_announce_ok(imquic_moq_context *moq, uint8_t *bytes, size_t blen, imquic_moq_namespace *track_namespace)
Helper method to add an ANNOUNCE_OK message to a buffer.
Definition moq.c:3172
const char * imquic_moq_location_mode_str(imquic_moq_location_mode mode)
Helper function to serialize to string the name of a imquic_moq_location_mode value.
Definition moq.c:397
const char * imquic_moq_message_type_str(imquic_moq_message_type type)
Helper function to serialize to string the name of a imquic_moq_message_type value.
Definition moq.c:263
size_t imquic_moq_parse_announce_ok(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
Helper to parse an ANNOUNCE_OK message.
Definition moq.c:1101
size_t imquic_moq_add_goaway(imquic_moq_context *moq, uint8_t *bytes, size_t blen, imquic_data *new_session_uri)
Helper method to add a GOAWAY message to a buffer.
Definition moq.c:4169
size_t imquic_moq_parse_subscribe_parameter(imquic_moq_context *moq, uint8_t *bytes, size_t blen, imquic_moq_parsed_subscribe_parameter *param, uint8_t *error)
Helper method to parse a MoQ subscribe parameter.
Definition moq.c:4234
void imquic_moq_init(void)
Initialize the native MoQ stack at startup.
Definition moq.c:37
struct imquic_moq_parsed_setup_parameter imquic_moq_parsed_setup_parameter
Parsed MoQ setup parameter.
size_t imquic_moq_add_unsubscribe(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t subscribe_id)
Helper method to add an UNSUBSCRIBE message to a buffer.
Definition moq.c:3522
imquic_moq_error_code
Generic error codes.
Definition internal/moq.h:39
@ IMQUIC_MOQ_INTERNAL_ERROR
Definition internal/moq.h:41
@ IMQUIC_MOQ_PROTOCOL_VIOLATION
Definition internal/moq.h:43
@ IMQUIC_MOQ_PARAMETER_LENGTH_MISMATCH
Definition internal/moq.h:45
@ IMQUIC_MOQ_DUPLICATE_TRACK_ALIAS
Definition internal/moq.h:44
@ IMQUIC_MOQ_UNAUTHORIZED
Definition internal/moq.h:42
@ IMQUIC_MOQ_NO_ERROR
Definition internal/moq.h:40
@ IMQUIC_MOQ_GOAWAY_TIMEOUT
Definition internal/moq.h:47
@ IMQUIC_MOQ_TOO_MANY_SUBSCRIBES
Definition internal/moq.h:46
size_t imquic_moq_parse_goaway(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
Helper to parse a GOAWAY message.
Definition moq.c:3017
const char * imquic_moq_sub_error_code_str(imquic_moq_sub_error_code code)
Helper function to serialize to string the name of a imquic_moq_error_code value.
Definition moq.c:223
imquic_moq_data_message_type
MoQ data messages.
Definition internal/moq.h:117
@ IMQUIC_MOQ_FETCH_HEADER
Definition internal/moq.h:124
@ IMQUIC_MOQ_OBJECT_DATAGRAM
Definition internal/moq.h:119
@ IMQUIC_MOQ_STREAM_HEADER_TRACK_V06
Definition internal/moq.h:121
@ IMQUIC_MOQ_OBJECT_STREAM
Definition internal/moq.h:118
@ IMQUIC_MOQ_STREAM_HEADER_GROUP
Definition internal/moq.h:122
@ IMQUIC_MOQ_STREAM_HEADER_TRACK
Definition internal/moq.h:120
@ IMQUIC_MOQ_STREAM_HEADER_SUBGROUP
Definition internal/moq.h:123
size_t imquic_moq_parse_unsubscribe(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
Helper to parse an UNSUBSCRIBE message.
Definition moq.c:1762
size_t imquic_moq_add_subscribe(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t subscribe_id, uint64_t track_alias, imquic_moq_namespace *track_namespace, imquic_moq_name *track_name, uint8_t priority, uint8_t group_order, imquic_moq_filter_type filter, uint64_t start_group, uint64_t start_object, uint64_t end_group, uint64_t end_object, size_t params_num, imquic_data *parameters)
Helper to add a SUBSCRIBE message (any version of the draft except v03) to a buffer.
Definition moq.c:3382
int imquic_moq_parse_stream_header_group_object(imquic_moq_context *moq, imquic_moq_stream *moq_stream, gboolean complete)
Helper to parse a STREAM_HEADER_GROUP object.
Definition moq.c:2750
size_t imquic_moq_parse_subscribe_error(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
Helper to parse a SUBSCRIBE_ERROR message.
Definition moq.c:1716
void imquic_moq_new_connection(imquic_connection *conn, void *user_data)
Callback the core invokes when a new QUIC connection using MoQ is available.
Definition moq.c:50
imquic_moq_sub_error_code
Subscribe error codes.
Definition internal/moq.h:55
@ IMQUIC_MOQ_SUBERR_TRACK_DOES_NOT_EXIST
Definition internal/moq.h:59
@ IMQUIC_MOQ_SUBERR_UNAUTHORIZED
Definition internal/moq.h:60
@ IMQUIC_MOQ_SUBERR_INVALID_RANGE
Definition internal/moq.h:57
@ IMQUIC_MOQ_SUBERR_TIMEOUT
Definition internal/moq.h:61
@ IMQUIC_MOQ_SUBERR_INTERNAL_ERROR
Definition internal/moq.h:56
@ IMQUIC_MOQ_SUBERR_RETRY_TRACK_ALIAS
Definition internal/moq.h:58
size_t imquic_moq_parse_announce(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
Helper to parse an ANNOUNCE message.
Definition moq.c:1034
const char * imquic_moq_filter_type_str(imquic_moq_filter_type type)
Helper function to serialize to string the name of a imquic_moq_filter_type value.
Definition moq.c:412
imquic_moq_role_type
MoQ roles.
Definition internal/moq.h:159
@ IMQUIC_MOQ_ROLE_PUBSUB
Definition internal/moq.h:162
@ IMQUIC_MOQ_ROLE_PUBLISHER
Definition internal/moq.h:160
@ IMQUIC_MOQ_ROLE_SUBSCRIBER
Definition internal/moq.h:161
size_t imquic_moq_parse_subscribe_done(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
Helper to parse a SUBSCRIBE_DONE message.
Definition moq.c:1790
size_t imquic_moq_parse_stream_header_group(imquic_moq_context *moq, imquic_moq_stream *moq_stream, uint8_t *bytes, size_t blen, uint8_t *error)
Helper to parse a STREAM_HEADER_GROUP message.
Definition moq.c:2698
size_t imquic_moq_parse_server_setup(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
Helper to pars an SERVER_SETUP message.
Definition moq.c:946
size_t imquic_moq_parse_unsubscribe_announces(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
Helper to parse an UNSUBSCRIBE_ANNOUNCES message.
Definition moq.c:2007
imquic_moq_sub_done_code
Subscribe done error codes.
Definition internal/moq.h:69
@ IMQUIC_MOQ_SUBDONE_INTERNAL_ERROR
Definition internal/moq.h:71
@ IMQUIC_MOQ_SUBDONE_UNSUBSCRIBED
Definition internal/moq.h:70
@ IMQUIC_MOQ_SUBDONE_GOING_AWAY
Definition internal/moq.h:75
@ IMQUIC_MOQ_SUBDONE_SUBSCRIPTION_ENDED
Definition internal/moq.h:74
@ IMQUIC_MOQ_SUBDONE_TRACK_ENDED
Definition internal/moq.h:73
@ IMQUIC_MOQ_SUBDONE_EXPIRED
Definition internal/moq.h:76
@ IMQUIC_MOQ_SUBDONE_UNAUTHORIZED
Definition internal/moq.h:72
size_t imquic_moq_add_subscribe_v03(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t subscribe_id, uint64_t track_alias, imquic_moq_namespace *track_namespace, imquic_moq_name *track_name, imquic_moq_location *start_group, imquic_moq_location *start_object, imquic_moq_location *end_group, imquic_moq_location *end_object, size_t params_num, imquic_data *parameters)
Helper to add a SUBSCRIBE message (version -03 of the draft) to a buffer.
Definition moq.c:3316
size_t imquic_moq_add_fetch_cancel(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t subscribe_id)
Helper method to add an FETCH_CANCEL message to a buffer.
Definition moq.c:3751
size_t imquic_moq_parse_fetch_error(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
Helper to parse a FETCH_ERROR message.
Definition moq.c:2253
size_t imquic_moq_parse_client_setup(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
Helper to parse a CLIENT_SETUP message.
Definition moq.c:851
size_t imquic_moq_add_announce_cancel(imquic_moq_context *moq, uint8_t *bytes, size_t blen, imquic_moq_namespace *track_namespace)
Helper method to add aN ANNOUNCE_CANCEL message to a buffer.
Definition moq.c:3282
size_t imquic_moq_parse_stream_header_track(imquic_moq_context *moq, imquic_moq_stream *moq_stream, uint8_t *bytes, size_t blen, uint8_t *error)
Helper to parse a STREAM_HEADER_TRACK message.
Definition moq.c:2587
size_t imquic_moq_add_subscribe_ok(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t subscribe_id, uint64_t expires, imquic_moq_group_order group_order, gboolean content_exists, uint64_t largest_group_id, uint64_t largest_object_id, size_t params_num, imquic_data *parameters)
Helper method to add a SUBSCRIBE_OK message to a buffer.
Definition moq.c:3472
size_t imquic_moq_parse_track_status_request(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
Helper to parse a TRACK_STATUS_REQUEST message.
Definition moq.c:2295
size_t imquic_moq_parse_fetch_cancel(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
Helper to parse a FETCH_CANCEL message.
Definition moq.c:2163
size_t imquic_moq_add_fetch(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t subscribe_id, imquic_moq_namespace *track_namespace, imquic_moq_name *track_name, uint8_t priority, imquic_moq_group_order group_order, uint64_t start_group, uint64_t start_object, uint64_t end_group, uint64_t end_object, size_t params_num, imquic_data *parameters)
Helper to add a FETCH message (any version of the draft except v03) to a buffer.
Definition moq.c:3699
void imquic_moq_connection_gone(imquic_connection *conn)
Callback the core invokes when an existing MoQ connection is not available anymore.
Definition moq.c:168
size_t imquic_moq_parse_subscribe_announces(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
Helper to parse a SUBSCRIBE_ANNOUNCES message.
Definition moq.c:1848
imquic_moq_subscription * imquic_moq_subscription_create(uint64_t subscribe_id, uint64_t track_alias)
Helper to create a new subscription instance.
Definition moq.c:483
struct imquic_moq_context imquic_moq_context
MoQ context.
size_t imquic_moq_add_stream_header_group(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t subscribe_id, uint64_t track_alias, uint64_t group_id, uint64_t object_send_order, uint8_t priority)
Helper to add a STREAM_HEADER_GROUP message to a buffer (only before v06)
Definition moq.c:4016
size_t imquic_moq_parse_unannounce(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
Helper to parse an UNANNOUNCE message.
Definition moq.c:1233
size_t imquic_moq_add_unannounce(imquic_moq_context *moq, uint8_t *bytes, size_t blen, imquic_moq_namespace *track_namespace)
Helper method to add an UNANNOUNCE message to a buffer.
Definition moq.c:3248
size_t imquic_moq_parse_subscribe_update(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
Helper to parse a SUBSCRIBE_UPDATE message.
Definition moq.c:1577
const char * imquic_moq_error_code_str(imquic_moq_error_code code)
Helper function to serialize to string the name of a imquic_moq_error_code value.
Definition moq.c:200
size_t imquic_moq_add_fetch_header_object(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t group_id, uint64_t subgroup_id, uint64_t object_id, uint8_t priority, uint64_t object_status, uint8_t *payload, size_t plen)
Helper to add an object to a buffer, formatted as expected for FETCH_HEADER objects (so not all IDs) ...
Definition moq.c:4137
void imquic_moq_datagram_incoming(imquic_connection *conn, uint8_t *bytes, uint64_t length)
Callback the core invokes when there's new incoming data on a DATAGRAM.
Definition moq.c:156
imquic_moq_subscribe_parameter_type
MoQ subscribe parameters.
Definition internal/moq.h:148
@ IMQUIC_MOQ_PARAM_DELIVERY_TIMEOUT
Definition internal/moq.h:150
@ IMQUIC_MOQ_PARAM_AUTHORIZATION_INFO
Definition internal/moq.h:149
@ IMQUIC_MOQ_PARAM_MAX_CACHE_DURATION
Definition internal/moq.h:151
struct imquic_moq_parsed_subscribe_parameter imquic_moq_parsed_subscribe_parameter
Parsed MoQ subscribe parameter.
const char * imquic_moq_setup_parameter_type_str(imquic_moq_setup_parameter_type type)
Helper function to serialize to string the name of a imquic_moq_setup_parameter_type value.
Definition moq.c:358
int imquic_moq_parse_fetch_header_object(imquic_moq_context *moq, imquic_moq_stream *moq_stream, gboolean complete)
Helper to parse a FETCH_HEADER object.
Definition moq.c:2943
const char * imquic_moq_subscribe_parameter_type_str(imquic_moq_subscribe_parameter_type type)
Helper function to serialize to string the name of a imquic_moq_subscribe_parameter_type value.
Definition moq.c:371
size_t imquic_moq_add_subscribe_announces_ok(imquic_moq_context *moq, uint8_t *bytes, size_t blen, imquic_moq_namespace *track_namespace)
Helper method to add a SUBSCRIBE_ANNOUNCES_OK message to a buffer.
Definition moq.c:3595
size_t imquic_moq_parameter_add_int(imquic_moq_context *moq, uint8_t *bytes, size_t blen, int param, uint64_t number)
Helper to add a MoQ (setup or subscribe) parameter with a numeric value to a buffer.
Definition moq.c:4286
size_t imquic_moq_parse_fetch_ok(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
Helper to parse a FETCH_OK message.
Definition moq.c:2196
size_t imquic_moq_add_max_subscribe_id(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint64_t max_subscribe_id)
Helper method to add a MAX_SUBSCRIBE_ID message to a buffer.
Definition moq.c:3115
const char * imquic_moq_data_message_type_str(imquic_moq_data_message_type type)
Helper function to serialize to string the name of a imquic_moq_data_message_type value.
Definition moq.c:318
size_t imquic_moq_parse_subscribe(imquic_moq_context *moq, uint8_t *bytes, size_t blen, uint8_t *error)
Helper to parse a SUBSCRIBE message.
Definition moq.c:1349
void imquic_moq_buffer_append(imquic_moq_buffer *buffer, uint8_t *bytes, uint64_t length)
Append data at the end of the buffer.
Definition moq.c:452
struct imquic_moq_stream imquic_moq_stream
MoQ stream.
GMutex imquic_mutex
imquic mutex implementation
Definition mutex.h:18
Reference counter mechanism.
QUIC Connection.
Definition connection.h:101
Generic data buffer.
Definition utils.h:133
MoQ Auth Info.
Definition imquic/moq.h:360
MoQ buffer.
Definition internal/moq.h:284
uint64_t length
Size of the data currently in the buffer.
Definition internal/moq.h:288
uint8_t * bytes
Buffer containing the data.
Definition internal/moq.h:286
uint64_t size
Overall size of the buffer.
Definition internal/moq.h:290
RoQ public callbacks.
Definition internal/moq.h:1134
void(* incoming_object)(imquic_connection *conn, imquic_moq_object *object)
Callback function to be notified about incoming MoQ objects.
Definition internal/moq.h:1176
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)
Callback function to be notified about incoming FETCH messages.
Definition internal/moq.h:1168
void(* incoming_unannounce)(imquic_connection *conn, imquic_moq_namespace *tns)
Callback function to be notified about incoming UNANNOUNCE messages.
Definition internal/moq.h:1148
void(* new_connection)(imquic_connection *conn, void *user_data)
Callback function to be notified about new moQ connections.
Definition internal/moq.h:1136
void(* incoming_goaway)(imquic_connection *conn, const char *uri)
Callback function to be notified about incoming GOAWAY messages.
Definition internal/moq.h:1178
void(* announce_error)(imquic_connection *conn, imquic_moq_namespace *tns, int error_code, const char *reason)
Callback function to be notified about incoming ANNOUNCE_ERROR messages.
Definition internal/moq.h:1146
void(* subscribe_accepted)(imquic_connection *conn, uint64_t subscribe_id, uint64_t expires, gboolean descending)
Callback function to be notified about incoming SUBSCRIBE_ACCEPTED messages.
Definition internal/moq.h:1152
void(* incoming_unsubscribe_announces)(imquic_connection *conn, imquic_moq_namespace *tns)
Callback function to be notified about incoming UNSUBSCRIBE_ANNOUNCES messages.
Definition internal/moq.h:1166
void(* incoming_subscribe_announces)(imquic_connection *conn, imquic_moq_namespace *tns, imquic_moq_auth_info *auth)
Callback function to be notified about incoming SUBSCRIBE_ANNOUNCES messages.
Definition internal/moq.h:1160
void(* fetch_accepted)(imquic_connection *conn, uint64_t subscribe_id, gboolean descending, imquic_moq_position *largest)
Callback function to be notified about incoming FETCH_ACCEPTED messages.
Definition internal/moq.h:1172
void(* announce_accepted)(imquic_connection *conn, imquic_moq_namespace *tns)
Callback function to be notified about incoming ANNOUNCE_ACCEPTED messages.
Definition internal/moq.h:1144
void(* fetch_error)(imquic_connection *conn, uint64_t subscribe_id, int error_code, const char *reason)
Callback function to be notified about incoming FETCH_ERROR messages.
Definition internal/moq.h:1174
void(* incoming_announce_cancel)(imquic_connection *conn, imquic_moq_namespace *tns)
Callback function to be notified about incoming ANNOUNCE_CANCEL messages.
Definition internal/moq.h:1142
void(* subscribe_announces_error)(imquic_connection *conn, imquic_moq_namespace *tns, int error_code, const char *reason)
Callback function to be notified about incoming SUBSCRIBE_ANNOUNCES_ERROR messages.
Definition internal/moq.h:1164
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)
Callback function to be notified about incoming SUBSCRIBE messages.
Definition internal/moq.h:1150
void(* incoming_announce)(imquic_connection *conn, imquic_moq_namespace *tns)
Callback function to be notified about incoming ANNOUNCE messages.
Definition internal/moq.h:1140
void(* subscribe_error)(imquic_connection *conn, uint64_t subscribe_id, int error_code, const char *reason, uint64_t track_alias)
Callback function to be notified about incoming SUBSCRIBE_ERROR messages.
Definition internal/moq.h:1154
void(* subscribe_done)(imquic_connection *conn, uint64_t subscribe_id, int status_code, const char *reason)
Callback function to be notified about incoming SUBSCRIBE_DONE messages.
Definition internal/moq.h:1156
void(* subscribe_announces_accepted)(imquic_connection *conn, imquic_moq_namespace *tns)
Callback function to be notified about incoming SUBSCRIBE_ANNOUNCES_ACCEPTED messages.
Definition internal/moq.h:1162
void(* incoming_fetch_cancel)(imquic_connection *conn, uint64_t subscribe_id)
Callback function to be notified about incoming FETCH_CANCEL messages.
Definition internal/moq.h:1170
void(* incoming_unsubscribe)(imquic_connection *conn, uint64_t subscribe_id)
Callback function to be notified about incoming UNBSUBSCRIBE messages.
Definition internal/moq.h:1158
void(* connection_gone)(imquic_connection *conn)
Callback function to be notified about RoQ connections being closed.
Definition internal/moq.h:1180
void(* moq_ready)(imquic_connection *conn)
Callback function to be notified when a MoQ connection is ready (setup performed on both ends)
Definition internal/moq.h:1138
MoQ context.
Definition internal/moq.h:244
volatile gint destroyed
Whether this instance has been destroyed (reference counting)
Definition internal/moq.h:278
imquic_moq_version version
Negotiated version.
Definition internal/moq.h:248
uint64_t control_stream_offset
Current offset of the control stream on the way out.
Definition internal/moq.h:262
gboolean version_set
Whether a version has been set.
Definition internal/moq.h:250
uint64_t next_subscribe_id
Definition internal/moq.h:270
uint64_t control_stream_id
ID of the control stream.
Definition internal/moq.h:260
uint64_t expected_subscribe_id
Current Subscribe IDs we expect and we can send.
Definition internal/moq.h:270
uint64_t max_subscribe_id
Maximum Subscribe IDs we can send and the one we accept.
Definition internal/moq.h:272
imquic_refcount ref
Reference counter.
Definition internal/moq.h:280
gboolean has_control_stream
Whether a MoQ control stream has been established.
Definition internal/moq.h:258
imquic_moq_role_type type
Role of this endpoint.
Definition internal/moq.h:252
GHashTable * subscriptions
Subscriptions this connection will send objects to, indexed by track_alias.
Definition internal/moq.h:266
GHashTable * streams
QUIC streams handled by the stack.
Definition internal/moq.h:264
gboolean role_set
Whether a role has been set.
Definition internal/moq.h:254
gboolean is_server
Whether this is a QUIC server or client.
Definition internal/moq.h:256
imquic_mutex mutex
Mutex.
Definition internal/moq.h:274
imquic_connection * conn
Associated QUIC connection.
Definition internal/moq.h:246
GHashTable * subscriptions_by_id
Subscriptions this connection will send objects to, indexed by subscribe_id.
Definition internal/moq.h:268
volatile gint connected
Whether we have established a connection.
Definition internal/moq.h:276
uint64_t local_max_subscribe_id
Definition internal/moq.h:272
MoQ FETCH range (from where to where)
Definition imquic/moq.h:374
MoQ location.
Definition internal/moq.h:211
uint64_t value
Value.
Definition internal/moq.h:215
imquic_moq_location_mode mode
Location mode.
Definition internal/moq.h:213
MoQ Track Name.
Definition imquic/moq.h:352
MoQ Track Namespace.
Definition imquic/moq.h:342
MoQ Object.
Definition imquic/moq.h:423
Parsed MoQ setup parameter.
Definition internal/moq.h:170
uint64_t max_subscribe_id
MAX_SUBSCRIBE_ID.
Definition internal/moq.h:179
imquic_moq_role_type role
ROLE.
Definition internal/moq.h:175
union imquic_moq_parsed_setup_parameter::@0 value
char * path
PATH.
Definition internal/moq.h:177
imquic_moq_setup_parameter_type type
The setup parameter ID.
Definition internal/moq.h:172
Parsed MoQ subscribe parameter.
Definition internal/moq.h:184
uint64_t max_cache_duration
MAX_CACHE_DURATION.
Definition internal/moq.h:193
imquic_moq_auth_info auth_info
AUTHORIZATION_INFO.
Definition internal/moq.h:189
uint64_t delivery_timeout
DELIVERY_TIMEOUT.
Definition internal/moq.h:191
union imquic_moq_parsed_subscribe_parameter::@1 value
imquic_moq_subscribe_parameter_type type
The subscribe parameter ID.
Definition internal/moq.h:186
MoQ Group/Object couple (for ranges)
Definition imquic/moq.h:368
MoQ stream.
Definition internal/moq.h:315
uint64_t stream_offset
Current stream offset.
Definition internal/moq.h:337
uint64_t subgroup_id
Subgroup ID (only after v06)
Definition internal/moq.h:327
uint8_t priority
Publisher priority (only after v05)
Definition internal/moq.h:335
imquic_moq_object_status object_status
Object status.
Definition internal/moq.h:331
imquic_moq_data_message_type type
Delivery mode for this stream.
Definition internal/moq.h:317
imquic_moq_buffer * buffer
Buffer to process incoming messages/objects.
Definition internal/moq.h:339
uint64_t stream_id
QUIC stream ID.
Definition internal/moq.h:319
gboolean closed
Whether we closed this stream.
Definition internal/moq.h:341
uint64_t track_alias
Track alias.
Definition internal/moq.h:323
uint64_t subscribe_id
ID of the subscription.
Definition internal/moq.h:321
uint64_t object_send_order
Object send order (v03 and v04 only)
Definition internal/moq.h:333
uint64_t group_id
Group ID.
Definition internal/moq.h:325
uint64_t object_id
Object ID.
Definition internal/moq.h:329
MoQ subscription, whether this is a publisher or a subscriber.
Definition internal/moq.h:348
uint64_t subscribe_id
ID of the subscription.
Definition internal/moq.h:350
uint64_t track_alias
Track alias.
Definition internal/moq.h:352
imquic_moq_stream * stream
Stream for this subscription, in case it's a single one.
Definition internal/moq.h:356
gboolean fetch
Whether this is a FETCH.
Definition internal/moq.h:354
GHashTable * streams_by_subgroup
Streams for this subscription, indexed by subgroup.
Definition internal/moq.h:360
GHashTable * streams_by_group
Streams for this subscription, indexed by group.
Definition internal/moq.h:358
Generic utilities (headers)