Loading...
Searching...
No Matches
http3.h
Go to the documentation of this file.
1
13#ifndef IMQUIC_HTTP3_H
14#define IMQUIC_HTTP3_H
15
16#include <glib.h>
17
18#include "../imquic/imquic.h"
19#include "qpack.h"
20#include "buffer.h"
21#include "stream.h"
22#include "refcount.h"
23
39
65
87
137
172
178void imquic_http3_process_stream_data(imquic_connection *conn, imquic_stream *stream, imquic_buffer_chunk *chunk, gboolean new_stream);
179
183
189int imquic_http3_parse_request(imquic_http3_connection *h3c, imquic_stream *stream, uint8_t *bytes, size_t blen);
196size_t imquic_http3_parse_request_headers(imquic_http3_connection *h3c, imquic_stream *stream, uint8_t *bytes, size_t blen);
203size_t imquic_http3_parse_request_data(imquic_http3_connection *h3c, imquic_stream *stream, uint8_t *bytes, size_t blen);
209int imquic_http3_parse_settings(imquic_http3_connection *h3c, uint8_t *bytes, size_t blen);
211
215
222int imquic_http3_prepare_headers_request(imquic_http3_connection *h3c, uint8_t *es, size_t *es_len, uint8_t *rs, size_t *rs_len);
230int imquic_http3_prepare_headers_response(imquic_http3_connection *h3c, uint8_t *es, size_t *es_len, uint8_t *rs, size_t *rs_len);
241size_t imquic_http3_settings_add_int(uint8_t *bytes, size_t blen, imquic_http3_settings_type type, uint64_t number);
246
247#endif
Buffer abstraction (headers)
struct imquic_http3_connection imquic_http3_connection
HTTP/3 connection abstraction.
size_t imquic_http3_parse_request_data(imquic_http3_connection *h3c, imquic_stream *stream, uint8_t *bytes, size_t blen)
Definition http3.c:368
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.
Definition http3.c:164
void imquic_http3_connection_destroy(imquic_http3_connection *h3c)
Helper method to destroy an existing HTTP/3 connection associated with a QUIC core connection.
Definition http3.c:101
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.
Definition http3.c:214
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.
Definition http3.c:155
imquic_http3_frame_type
HTTP/3 frame type.
Definition http3.h:41
@ IMQUIC_HTTP3_HEADERS
HEADERS.
Definition http3.h:45
@ IMQUIC_HTTP3_GOAWAY
GOAWAY.
Definition http3.h:53
@ IMQUIC_HTTP3_MAX_PUSH_ID
MAX_PUSH_ID.
Definition http3.h:55
@ IMQUIC_HTTP3_DATA
DATA.
Definition http3.h:43
@ IMQUIC_HTTP3_SETTINGS
SETTINGS.
Definition http3.h:49
@ IMQUIC_HTTP3_CANCEL_PUSH
CANCEL_PUSH.
Definition http3.h:47
@ IMQUIC_HTTP3_WEBTRANSPORT_UNI_STREAM
WebTransport unidirectional stream.
Definition http3.h:57
@ IMQUIC_HTTP3_PUSH_PROMISE
PUSH_PROMISE.
Definition http3.h:51
@ IMQUIC_HTTP3_WEBTRANSPORT_STREAM
WebTransport bidirectional stream.
Definition http3.h:59
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.
Definition http3.c:425
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.
Definition http3.c:63
int imquic_http3_parse_settings(imquic_http3_connection *h3c, uint8_t *bytes, size_t blen)
Definition http3.c:107
imquic_http3_error_code
HTTP/3 error codes.
Definition http3.h:89
@ IMQUIC_HTTP3_H3_CLOSED_CRITICAL_STREAM
H3_CLOSED_CRITICAL_STREAM.
Definition http3.h:101
@ IMQUIC_HTTP3_H3_CONNECT_ERROR
H3_CONNECT_ERROR.
Definition http3.h:123
@ IMQUIC_HTTP3_H3_FRAME_UNEXPECTED
H3_FRAME_UNEXPECTED.
Definition http3.h:103
@ IMQUIC_HTTP3_H3_VERSION_FALLBACK
H3_VERSION_FALLBACK.
Definition http3.h:125
@ IMQUIC_HTTP3_H3_DATAGRAM_ERROR
DATAGRAM_ERROR.
Definition http3.h:91
@ IMQUIC_HTTP3_H3_FRAME_ERROR
H3_FRAME_ERROR.
Definition http3.h:105
@ IMQUIC_HTTP3_QPACK_DECOMPRESSION_FAILED
QPACK_DECOMPRESSION_FAILED.
Definition http3.h:127
@ IMQUIC_HTTP3_H3_REQUEST_INCOMPLETE
H3_REQUEST_INCOMPLETE.
Definition http3.h:119
@ IMQUIC_HTTP3_H3_REQUEST_REJECTED
H3_REQUEST_REJECTED.
Definition http3.h:115
@ IMQUIC_HTTP3_H3_NO_ERROR
NO_ERROR.
Definition http3.h:93
@ IMQUIC_HTTP3_H3_MISSING_SETTINGS
H3_MISSING_SETTINGS.
Definition http3.h:113
@ IMQUIC_HTTP3_QPACK_ENCODER_STREAM_ERROR
QPACK_ENCODER_STREAM_ERROR.
Definition http3.h:129
@ IMQUIC_HTTP3_H3_REQUEST_CANCELLED
H3_REQUEST_CANCELLED.
Definition http3.h:117
@ IMQUIC_HTTP3_H3_ID_ERROR
H3_ID_ERROR.
Definition http3.h:109
@ IMQUIC_HTTP3_H3_GENERAL_PROTOCOL_ERROR
GENERAL_PROTOCOL_ERROR.
Definition http3.h:95
@ IMQUIC_HTTP3_H3_EXCESSIVE_LOAD
H3_EXCESSIVE_LOAD.
Definition http3.h:107
@ IMQUIC_HTTP3_H3_STREAM_CREATION_ERROR
H3_STREAM_CREATION_ERROR.
Definition http3.h:99
@ IMQUIC_HTTP3_QPACK_DECODER_STREAM_ERROR
QPACK_DECODER_STREAM_ERROR.
Definition http3.h:131
@ IMQUIC_HTTP3_H3_MESSAGE_ERROR
H3_MESSAGE_ERROR.
Definition http3.h:121
@ IMQUIC_HTTP3_H3_INTERNAL_ERROR
IMQUIC_HTTP3_H3_INTERNAL_ERROR.
Definition http3.h:97
@ IMQUIC_HTTP3_H3_SETTINGS_ERROR
H3_SETTINGS_ERROR.
Definition http3.h:111
imquic_http3_stream_type
HTTP/3 stream type.
Definition http3.h:25
@ IMQUIC_HTTP3_CONTROL_STREAM
Control stream.
Definition http3.h:27
@ IMQUIC_HTTP3_QPACK_DECODER_STREAM
QPACK decoder stream.
Definition http3.h:33
@ IMQUIC_HTTP3_QPACK_ENCODER_STREAM
QPACK encoder stream.
Definition http3.h:31
@ IMQUIC_HTTP3_PUSH_STREAM
Push stream.
Definition http3.h:29
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.
Definition http3.c:92
size_t imquic_http3_parse_request_headers(imquic_http3_connection *h3c, imquic_stream *stream, uint8_t *bytes, size_t blen)
Definition http3.c:324
imquic_http3_settings_type
HTTP/3 SETTINGS type.
Definition http3.h:67
@ IMQUIC_HTTP3_SETTINGS_MAX_FIELD_SECTION_SIZE
MAX_FIELD_SECTION_SIZE.
Definition http3.h:71
@ IMQUIC_HTTP3_SETTINGS_WEBTRANSPORT_MAX_SESSIONS
WEBTRANSPORT_MAX_SESSIONS.
Definition http3.h:81
@ IMQUIC_HTTP3_SETTINGS_QPACK_BLOCKED_STREAMS
QPACK_BLOCKED_STREAMS.
Definition http3.h:73
@ IMQUIC_HTTP3_SETTINGS_QPACK_MAX_TABLE_CAPACITY
QPACK_MAX_TABLE_CAPACITY.
Definition http3.h:69
@ IMQUIC_HTTP3_SETTINGS_H3_DATAGRAM
H3_DATAGRAM.
Definition http3.h:77
@ IMQUIC_HTTP3_SETTINGS_ENABLE_CONNECT_PROTOCOL
ENABLE_CONNECT_PROTOCOL.
Definition http3.h:75
@ IMQUIC_HTTP3_SETTINGS_ENABLE_WEBTRANSPORT
ENABLE_WEBTRANSPORT.
Definition http3.h:79
int imquic_http3_parse_request(imquic_http3_connection *h3c, imquic_stream *stream, uint8_t *bytes, size_t blen)
Definition http3.c:288
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.
Definition http3.c:38
int imquic_http3_prepare_settings(imquic_http3_connection *h3c)
Helper to prepare a new SETTINGS frame.
Definition http3.c:500
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.
Definition http3.c:23
void imquic_http3_check_send_connect(imquic_http3_connection *h3c)
Helper to send a new HTTP/3 CONNECT request to establish a WebTransport session.
Definition http3.c:469
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.
Definition http3.c:377
imquic public interface (headers)
QPACK stack (WebTransport only) (headers)
Reference counter mechanism.
QUIC STREAM abstraction (headers)
Buffer chunk.
Definition buffer.h:22
QUIC Connection.
Definition connection.h:101
HTTP/3 connection abstraction.
Definition http3.h:139
uint64_t local_qpack_decoder_stream
Definition http3.h:149
char * subprotocol
Subprotocol to negotiate on WebTransport, if any (currently unused)
Definition http3.h:158
gboolean settings_received
Definition http3.h:145
volatile gint destroyed
Whether this instance has been destroyed (reference counting)
Definition http3.h:160
uint64_t remote_control_stream
Definition http3.h:147
imquic_refcount ref
Reference counter.
Definition http3.h:162
uint64_t local_qpack_encoder_stream
Definition http3.h:148
uint64_t local_control_stream
Streams.
Definition http3.h:147
gboolean settings_sent
Current SETTINGS state.
Definition http3.h:145
imquic_qpack_context * qpack
QPACK context.
Definition http3.h:154
gboolean has_bidi_streams
Whether there (already) are bidirectional streams in this connection.
Definition http3.h:152
uint64_t remote_qpack_encoder_stream
Definition http3.h:148
gboolean is_server
Whether this is a server or a client.
Definition http3.h:143
uint64_t request_stream
Definition http3.h:150
gboolean webtransport
Whether a WebTransport connection has been established.
Definition http3.h:156
uint64_t remote_qpack_decoder_stream
Definition http3.h:149
imquic_connection * conn
Associated QUIC core connection.
Definition http3.h:141
QPACK context.
Definition qpack.h:64
Definition refcount.h:77
QUIC stream.
Definition stream.h:41