QUIC connection abstraction. More...
#include "internal/connection.h"#include "internal/stream.h"#include "internal/utils.h"#include "imquic/debug.h"
Functions | |
| const char * | imquic_connection_id_str (picoquic_connection_id_t *cid, char *buffer, size_t blen) |
| Helper method to stringify a connection ID. | |
| imquic_connection * | imquic_connection_create (imquic_network_endpoint *socket, picoquic_cnx_t *piconn) |
| 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. | |
| 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 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 length) |
Helper to notify incoming STREAM data to the application. | |
| void | imquic_connection_notify_gone (imquic_connection *conn) |
| Helper to notify about the connection being gone. | |
| void | imquic_connection_reset_stream (imquic_connection *conn, uint64_t stream_id, uint64_t error_code) |
Helper to reset a stream, sending a RESET_STREAM. | |
| void | imquic_connection_close (imquic_connection *conn, uint64_t error_code, const char *reason) |
| Helpers to close connections. | |
| imquic_connection_event * | imquic_connection_event_create (imquic_connection_event_type type) |
| Helper method to create a imquic_connection_event instance. | |
| void | imquic_connection_event_destroy (imquic_connection_event *event) |
| Helper method to destroy a imquic_connection_event instance. | |
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_close | ( | imquic_connection * | conn, |
| uint64_t | error_code, | ||
| 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 |
| reason | A verbose description of the error, if any |
| imquic_connection * imquic_connection_create | ( | imquic_network_endpoint * | socket, |
| picoquic_cnx_t * | piconn ) |
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 |
| piconn | The picoquic connection this connection will be associated to (only for servers) |
| void imquic_connection_destroy | ( | imquic_connection * | conn | ) |
Helper method to destroy an existing imquic_connection instance.
| conn | The imquic_connection instance to destroy |
| imquic_connection_event * imquic_connection_event_create | ( | imquic_connection_event_type | type | ) |
Helper method to create a imquic_connection_event instance.
| type | The imquic_connection_event_type of the event |
| void imquic_connection_event_destroy | ( | imquic_connection_event * | event | ) |
Helper method to destroy a imquic_connection_event instance.
| event | The imquic_connection_event instance to destroy |
| const char * imquic_connection_id_str | ( | picoquic_connection_id_t * | cid, |
| char * | buffer, | ||
| size_t | blen ) |
Helper method to stringify a connection ID.
| [in] | cid | The connection ID to stringify |
| [out] | buffer | The buffer where the string will be written |
| [in] | blen | Size of the string output buffer |
| 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_gone | ( | imquic_connection * | conn | ) |
Helper to notify about the connection being gone.
| conn | The imquic_connection instance to notify the event for |
| void imquic_connection_notify_stream_incoming | ( | imquic_connection * | conn, |
| imquic_stream * | stream, | ||
| uint8_t * | data, | ||
| 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 |
| length | Size of the new data buffer |
| void imquic_connection_reset_stream | ( | imquic_connection * | conn, |
| uint64_t | stream_id, | ||
| uint64_t | error_code ) |
Helper to reset a stream, sending a RESET_STREAM.
| conn | The imquic_connection instance that owns the stream to reset |
| stream_id | ID of the stream to reset |
| error_code | The error code to add to the frame |
| 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 | 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] | length | Size of the buffer of data |
| [in] | complete | Whether this (offset+length) is the end of the STREAM data |