QUIC connection abstraction. More...
#include "internal/quic.h"
#include "internal/connection.h"
#include "internal/stream.h"
#include "internal/utils.h"
#include "imquic/debug.h"
Functions | |
const char * | imquic_connection_id_str (imquic_connection_id *cid, char *buffer, size_t blen) |
Helper method to stringify a imquic_connection_id instance. | |
imquic_connection_id * | imquic_connection_id_dup (imquic_connection_id *cid) |
Helper method to duplicate (copy) a imquic_connection_id instance. | |
gboolean | imquic_connection_id_equal (const void *a, const void *b) |
Helper method to check if two imquic_connection_id instances are actually the same Connection ID. | |
guint | imquic_connection_id_hash (gconstpointer v) |
Helper method to return a hash associated to a imquic_connection_id instance. | |
void | imquic_connection_parameters_init (imquic_connection_parameters *params) |
Helper method to reset/initialize a imquic_connection_parameters instance. | |
imquic_connection * | imquic_connection_create (imquic_network_endpoint *socket) |
Helper method to create a new imquic_connection instance owned by a specific imquic_network_endpoint in the QUIC stack. | |
void | imquic_connection_destroy (imquic_connection *conn) |
Helper method to destroy an existing imquic_connection instance. | |
void | imquic_connection_change_level (imquic_connection *conn, enum ssl_encryption_level_t level) |
Helper to change the current encryption level of a connection. | |
void | imquic_connection_update_rtt (imquic_connection *conn, int64_t sent_time, uint16_t ack_delay) |
Helper method to update the RTT of a connection, when parsing ACKs. | |
void | imquic_connection_update_loss_timer (imquic_connection *conn) |
Helper method to update the loss detection timer. | |
gboolean | imquic_connection_loss_detection_timeout (gpointer user_data) |
Callback invoked when the loss detection timer fires. | |
GList * | imquic_connection_detect_lost (imquic_connection *conn) |
Helper method to detect lost packets. | |
int | imquic_connection_new_stream_id (imquic_connection *conn, gboolean bidirectional, uint64_t *stream_id) |
Helper to generate a new stream ID for this connection. | |
int | imquic_connection_send_on_datagram (imquic_connection *conn, uint8_t *bytes, uint64_t length) |
Helper method to send data on a QUIC DATAGRAM. | |
int | imquic_connection_send_on_stream (imquic_connection *conn, uint64_t stream_id, uint8_t *bytes, uint64_t offset, uint64_t length, gboolean complete) |
Helper method to send data on a QUIC STREAM. | |
void | imquic_connection_notify_datagram_incoming (imquic_connection *conn, uint8_t *data, uint64_t length) |
Helper to notify incoming DATAGRAM data to the application. | |
void | imquic_connection_notify_stream_incoming (imquic_connection *conn, imquic_stream *stream, uint8_t *data, uint64_t offset, uint64_t length) |
Helper to notify incoming STREAM data to the application. | |
void | imquic_connection_flush_stream (imquic_connection *conn, uint64_t stream_id) |
Helper to flush a stream, in order to send data right away. | |
void | imquic_connection_close (imquic_connection *conn, uint64_t error_code, uint64_t frame_type, const char *reason) |
Helpers to close connections. | |
QUIC connection abstraction.
Abstraction of QUIC connections, during or after establishment. This is where helper functions are exposed to the QUIC stack internals for the purpose of creating STREAM ids, send data, and notify upper layers about incoming data or shutdowns.
void imquic_connection_change_level | ( | imquic_connection * | conn, |
enum ssl_encryption_level_t | level ) |
Helper to change the current encryption level of a connection.
conn | The imquic_connection instance to update |
level | The new SSL encryption level |
void imquic_connection_close | ( | imquic_connection * | conn, |
uint64_t | error_code, | ||
uint64_t | frame_type, | ||
const char * | reason ) |
Helpers to close connections.
conn | The imquic_connection instance to close |
error_code | The error code to send back in the CONNECTION_CLOSE frame |
frame_type | The frame type that caused this connection to be closed |
reason | A verbose description of the error, if any |
imquic_connection * imquic_connection_create | ( | imquic_network_endpoint * | socket | ) |
Helper method to create a new imquic_connection instance owned by a specific imquic_network_endpoint in the QUIC stack.
socket | The network endpoint this connection will be associated to |
void imquic_connection_destroy | ( | imquic_connection * | conn | ) |
Helper method to destroy an existing imquic_connection instance.
conn | The imquic_connection instance to destroy |
GList * imquic_connection_detect_lost | ( | imquic_connection * | conn | ) |
Helper method to detect lost packets.
conn | The imquic_connection instance to refer to |
void imquic_connection_flush_stream | ( | imquic_connection * | conn, |
uint64_t | stream_id ) |
Helper to flush a stream, in order to send data right away.
conn | The imquic_connection instance that owns the stream to flush |
stream_id | ID of the stream to flush |
imquic_connection_id * imquic_connection_id_dup | ( | imquic_connection_id * | cid | ) |
Helper method to duplicate (copy) a imquic_connection_id instance.
cid | The imquic_connection_id instance to duplicate |
gboolean imquic_connection_id_equal | ( | const void * | a, |
const void * | b ) |
Helper method to check if two imquic_connection_id instances are actually the same Connection ID.
a | The Opaque pointer to the first imquic_connection_id instance to compare |
b | The Opaque pointer to the first imquic_connection_id instance to compare |
guint imquic_connection_id_hash | ( | gconstpointer | v | ) |
Helper method to return a hash associated to a imquic_connection_id instance.
v | The Opaque pointer to the imquic_connection_id instance to hash |
const char * imquic_connection_id_str | ( | imquic_connection_id * | cid, |
char * | buffer, | ||
size_t | blen ) |
Helper method to stringify a imquic_connection_id instance.
[in] | cid | The imquic_connection_id instance to stringify |
[out] | buffer | The buffer where the string will be written |
[in] | blen | Size of the string output buffer |
gboolean imquic_connection_loss_detection_timeout | ( | gpointer | user_data | ) |
Callback invoked when the loss detection timer fires.
ld_timer
timer user_data | Opaque pointer to the connection the timer refers to |
int imquic_connection_new_stream_id | ( | imquic_connection * | conn, |
gboolean | bidirectional, | ||
uint64_t * | stream_id ) |
Helper to generate a new stream ID for this connection.
[in] | conn | The imquic_connection instance to get a new stream ID from |
[in] | bidirectional | Whether the new stream will be bidirectional |
[out] | stream_id | Pointer to where the new stream ID will be placed |
void imquic_connection_notify_datagram_incoming | ( | imquic_connection * | conn, |
uint8_t * | data, | ||
uint64_t | length ) |
Helper to notify incoming DATAGRAM
data to the application.
conn | The imquic_connection instance to notify the event for |
data | Buffer containing the new data |
length | Size of the new data buffer |
void imquic_connection_notify_stream_incoming | ( | imquic_connection * | conn, |
imquic_stream * | stream, | ||
uint8_t * | data, | ||
uint64_t | offset, | ||
uint64_t | length ) |
Helper to notify incoming STREAM
data to the application.
conn | The imquic_connection instance to notify the event for |
stream | The imquic_stream that originated the new data to notify about |
data | Buffer containing the new data |
offset | Offset in the overall STREAM this data is positioned at |
length | Size of the new data buffer |
void imquic_connection_parameters_init | ( | imquic_connection_parameters * | params | ) |
Helper method to reset/initialize a imquic_connection_parameters instance.
params | The imquic_connection_parameters instance to initialize |
int imquic_connection_send_on_datagram | ( | imquic_connection * | conn, |
uint8_t * | bytes, | ||
uint64_t | length ) |
Helper method to send data on a QUIC DATAGRAM.
[in] | conn | The imquic_connection to send data on |
[in] | bytes | Buffer containing the data to send |
[in] | length | Size of the buffer of data |
int imquic_connection_send_on_stream | ( | imquic_connection * | conn, |
uint64_t | stream_id, | ||
uint8_t * | bytes, | ||
uint64_t | offset, | ||
uint64_t | length, | ||
gboolean | complete ) |
Helper method to send data on a QUIC STREAM.
[in] | conn | The imquic_connection to send data on |
[in] | stream_id | The QUIC stream to use for sending data |
[in] | bytes | Buffer containing the data to send |
[in] | offset | Offset value to put in the outgoing STREAM fragment |
[in] | length | Size of the buffer of data |
[in] | complete | Whether this (offset+length) is the end of the STREAM data |
void imquic_connection_update_loss_timer | ( | imquic_connection * | conn | ) |
Helper method to update the loss detection timer.
conn | The imquic_connection instance to update |
void imquic_connection_update_rtt | ( | imquic_connection * | conn, |
int64_t | sent_time, | ||
uint16_t | ack_delay ) |
Helper method to update the RTT of a connection, when parsing ACKs.
conn | The imquic_connection instance to update |
sent_time | Monotonic time of when the largest acked packet was sent |
ack_delay | ACK delay value in the ACK frame |