HTTP/3 stack (WebTransport only) (headers) More...
#include <glib.h>
#include "../imquic/imquic.h"
#include "qpack.h"
#include "buffer.h"
#include "stream.h"
#include "refcount.h"
Go to the source code of this file.
Data Structures | |
struct | imquic_http3_connection |
HTTP/3 connection abstraction. More... | |
Typedefs | |
typedef enum imquic_http3_stream_type | imquic_http3_stream_type |
HTTP/3 stream type. | |
typedef enum imquic_http3_frame_type | imquic_http3_frame_type |
HTTP/3 frame type. | |
typedef enum imquic_http3_settings_type | imquic_http3_settings_type |
HTTP/3 SETTINGS type. | |
typedef enum imquic_http3_error_code | imquic_http3_error_code |
HTTP/3 error codes. | |
typedef struct imquic_http3_connection | imquic_http3_connection |
HTTP/3 connection abstraction. | |
Functions | |
const char * | imquic_http3_stream_type_str (imquic_http3_stream_type type) |
Helper function to serialize to string the name of a imquic_http3_stream_type value. | |
const char * | imquic_http3_frame_type_str (imquic_http3_frame_type type) |
Helper function to serialize to string the name of a imquic_http3_frame_type value. | |
const char * | imquic_http3_settings_type_str (imquic_http3_settings_type type) |
Helper function to serialize to string the name of a imquic_http3_settings_type value. | |
const char * | imquic_http3_error_code_str (imquic_http3_error_code type) |
Helper function to serialize to string the name of a imquic_http3_error_code value. | |
imquic_http3_connection * | imquic_http3_connection_create (imquic_connection *conn, char *subprotocol) |
Helper method to create a new HTTP/3 connection associated with a new QUIC core connection. | |
void | imquic_http3_connection_destroy (imquic_http3_connection *h3c) |
Helper method to destroy an existing HTTP/3 connection associated with a QUIC core connection. | |
void | imquic_http3_process_stream_data (imquic_connection *conn, imquic_stream *stream, imquic_buffer_chunk *chunk, gboolean new_stream) |
Callback invoked by the core when there's incoming STREAM data to process on an existing connection. | |
Parsing HTTP/3 messages | |
int | imquic_http3_parse_request (imquic_http3_connection *h3c, imquic_stream *stream, uint8_t *bytes, size_t blen) |
size_t | imquic_http3_parse_request_headers (imquic_http3_connection *h3c, imquic_stream *stream, uint8_t *bytes, size_t blen) |
size_t | imquic_http3_parse_request_data (imquic_http3_connection *h3c, imquic_stream *stream, uint8_t *bytes, size_t blen) |
int | imquic_http3_parse_settings (imquic_http3_connection *h3c, uint8_t *bytes, size_t blen) |
Creating and sending HTTP/3 messages | |
int | imquic_http3_prepare_headers_request (imquic_http3_connection *h3c, uint8_t *es, size_t *es_len, uint8_t *rs, size_t *rs_len) |
Helper to prepare a new HTTP/3 request. | |
int | imquic_http3_prepare_headers_response (imquic_http3_connection *h3c, uint8_t *es, size_t *es_len, uint8_t *rs, size_t *rs_len) |
Helper to prepare a new HTTP/3 response. | |
int | imquic_http3_prepare_settings (imquic_http3_connection *h3c) |
Helper to prepare a new SETTINGS frame. | |
size_t | imquic_http3_settings_add_int (uint8_t *bytes, size_t blen, imquic_http3_settings_type type, uint64_t number) |
Helper to add a new SETTINGS property to a buffer. | |
void | imquic_http3_check_send_connect (imquic_http3_connection *h3c) |
Helper to send a new HTTP/3 CONNECT request to establish a WebTransport session. | |
HTTP/3 stack (WebTransport only) (headers)
Implementation of the required set of features need to establish a WebTransport connection, when needed. It explicitly only deals with WebTransport, meaning it will fail with anything else that is not a CONNECT
request.
typedef struct imquic_http3_connection imquic_http3_connection |
HTTP/3 connection abstraction.
typedef enum imquic_http3_error_code imquic_http3_error_code |
HTTP/3 error codes.
typedef enum imquic_http3_frame_type imquic_http3_frame_type |
HTTP/3 frame type.
typedef enum imquic_http3_settings_type imquic_http3_settings_type |
HTTP/3 SETTINGS type.
typedef enum imquic_http3_stream_type imquic_http3_stream_type |
HTTP/3 stream type.
HTTP/3 error codes.
HTTP/3 frame type.
HTTP/3 SETTINGS type.
void imquic_http3_check_send_connect | ( | imquic_http3_connection * | h3c | ) |
Helper to send a new HTTP/3 CONNECT
request to establish a WebTransport session.
h3c | The imquic_http3_connection instance to send the CONNECT on |
imquic_http3_connection * imquic_http3_connection_create | ( | imquic_connection * | conn, |
char * | subprotocol ) |
Helper method to create a new HTTP/3 connection associated with a new QUIC core connection.
conn | The QUIC core connection to associate this HTTP/3 instance to |
subprotocol | The subprotocol to negotiate on WebTransport, if any (currently unused) |
void imquic_http3_connection_destroy | ( | imquic_http3_connection * | h3c | ) |
Helper method to destroy an existing HTTP/3 connection associated with a QUIC core connection.
h3c | The imquic_http3_connection to destroy |
const char * imquic_http3_error_code_str | ( | imquic_http3_error_code | type | ) |
Helper function to serialize to string the name of a imquic_http3_error_code value.
type | The imquic_http3_error_code value |
const char * imquic_http3_frame_type_str | ( | imquic_http3_frame_type | type | ) |
Helper function to serialize to string the name of a imquic_http3_frame_type value.
type | The imquic_http3_frame_type value |
int imquic_http3_parse_request | ( | imquic_http3_connection * | h3c, |
imquic_stream * | stream, | ||
uint8_t * | bytes, | ||
size_t | blen ) |
brief Helper method to parse an incoming HTTP/3 request
h3c | The imquic_http3_connection instance to parse the request for |
stream | The imquic_stream instance in the connection the data has been received on |
bytes | Data to process |
blen | Size of the data to process |
size_t imquic_http3_parse_request_data | ( | imquic_http3_connection * | h3c, |
imquic_stream * | stream, | ||
uint8_t * | bytes, | ||
size_t | blen ) |
brief Helper method to parse a DATA
frame in an HTTP/3 message
h3c | The imquic_http3_connection instance to parse the DATA for |
stream | The imquic_stream instance in the connection the data has been received on |
bytes | Data to process |
blen | Size of the data to process |
size_t imquic_http3_parse_request_headers | ( | imquic_http3_connection * | h3c, |
imquic_stream * | stream, | ||
uint8_t * | bytes, | ||
size_t | blen ) |
brief Helper method to parse a HEADERS
frame in an HTTP/3 message
h3c | The imquic_http3_connection instance to parse the HEADERS for |
stream | The imquic_stream instance in the connection the data has been received on |
bytes | Data to process |
blen | Size of the data to process |
int imquic_http3_parse_settings | ( | imquic_http3_connection * | h3c, |
uint8_t * | bytes, | ||
size_t | blen ) |
brief Helper method to parse an incoming SETTINGS
frame
h3c | The imquic_http3_connection instance to parse the SETTINGS for |
bytes | Data to process |
blen | Size of the data to process |
int imquic_http3_prepare_headers_request | ( | imquic_http3_connection * | h3c, |
uint8_t * | es, | ||
size_t * | es_len, | ||
uint8_t * | rs, | ||
size_t * | rs_len ) |
Helper to prepare a new HTTP/3 request.
h3c | The imquic_http3_connection instance to prepare the request for |
es | Buffer to use for the QPACK encoder stream, if needed |
es_len | Size of the encoder stream buffer |
rs | Buffer to use for the HTTP/3 request |
rs_len | Size of the request buffer |
int imquic_http3_prepare_headers_response | ( | imquic_http3_connection * | h3c, |
uint8_t * | es, | ||
size_t * | es_len, | ||
uint8_t * | rs, | ||
size_t * | rs_len ) |
Helper to prepare a new HTTP/3 response.
h3c | The imquic_http3_connection instance to prepare the response for |
es | Buffer to use for the QPACK encoder stream, if needed |
es_len | Size of the encoder stream buffer |
rs | Buffer to use for the HTTP/3 request |
rs_len | Size of the request buffer |
int imquic_http3_prepare_settings | ( | imquic_http3_connection * | h3c | ) |
Helper to prepare a new SETTINGS
frame.
h3c | The imquic_http3_connection instance to prepare the SETTINGS frame for |
void imquic_http3_process_stream_data | ( | imquic_connection * | conn, |
imquic_stream * | stream, | ||
imquic_buffer_chunk * | chunk, | ||
gboolean | new_stream ) |
Callback invoked by the core when there's incoming STREAM
data to process on an existing connection.
conn | The imquic_connection instance the data has been received on |
stream | The imquic_stream instance in the connection the data has been received on |
chunk | The imquic_buffer_chunk instance containing the new data |
new_stream | Whether this data opened a new stream |
size_t imquic_http3_settings_add_int | ( | uint8_t * | bytes, |
size_t | blen, | ||
imquic_http3_settings_type | type, | ||
uint64_t | number ) |
Helper to add a new SETTINGS
property to a buffer.
bytes | Buffer to add the property to |
blen | Size of the buffer |
type | The imquic_http3_settings_type type to add to the frame |
number | The numeric value of the property to add |
const char * imquic_http3_settings_type_str | ( | imquic_http3_settings_type | type | ) |
Helper function to serialize to string the name of a imquic_http3_settings_type value.
type | The imquic_http3_settings_type value |
const char * imquic_http3_stream_type_str | ( | imquic_http3_stream_type | type | ) |
Helper function to serialize to string the name of a imquic_http3_stream_type value.
type | The imquic_http3_stream_type value |