Networking utilities (headers) More...
#include <stdint.h>
#include <sys/socket.h>
#include "../imquic/imquic.h"
#include "configuration.h"
#include "loop.h"
#include "crypto.h"
#include "moq.h"
#include "roq.h"
#include "refcount.h"
Go to the source code of this file.
Data Structures | |
struct | imquic_network_address |
Abstraction of a network address. More... | |
struct | imquic_network_endpoint |
Abstraction of a network endpoint (client or server) More... | |
Typedefs | |
typedef struct imquic_network_address | imquic_network_address |
Abstraction of a network address. | |
typedef struct imquic_network_endpoint | imquic_network_endpoint |
Abstraction of a network endpoint (client or server) | |
Functions | |
char * | imquic_network_address_str (imquic_network_address *address, char *output, size_t outlen) |
Helper to serialize a network address to a string. | |
imquic_network_endpoint * | imquic_network_endpoint_create (imquic_configuration *config) |
Helper to create a new imquic_network_endpoint instance from a imquic_configuration object. | |
void | imquic_network_endpoint_add_connection (imquic_network_endpoint *ne, imquic_connection *conn, gboolean lock_mutex) |
Helper to add a new connection to the list of connections originated by this endpoint. | |
void | imquic_network_endpoint_remove_connection (imquic_network_endpoint *ne, imquic_connection *conn, gboolean lock_mutex) |
Helper to remove an existing connection from the list of connections originated by this endpoint. | |
void | imquic_network_endpoint_shutdown (imquic_network_endpoint *ne) |
Helper to shutdown an existing endpoint. | |
void | imquic_network_endpoint_destroy (imquic_network_endpoint *ne) |
Helper to destroy an existing endpoint instance. | |
int | imquic_network_send (imquic_connection *conn, uint8_t *bytes, size_t blen) |
Helper to send data on a connection. | |
Networking utilities (headers)
Implementation of the networking functionality of the QUIC stack. This is where client and server instances are allocated and managed, taking care of actually sending data out, and to notify upper layers about new connections or data coming in. The networking stack relies on a separate event loop for polling the sockets.
typedef struct imquic_network_address imquic_network_address |
Abstraction of a network address.
typedef struct imquic_network_endpoint imquic_network_endpoint |
Abstraction of a network endpoint (client or server)
char * imquic_network_address_str | ( | imquic_network_address * | address, |
char * | output, | ||
size_t | outlen ) |
Helper to serialize a network address to a string.
[in] | address | The imquic_network_address instance to serialize |
[out] | output | The buffer to put the serialized string into |
[in] | outlen | The size of the output buffer |
void imquic_network_endpoint_add_connection | ( | imquic_network_endpoint * | ne, |
imquic_connection * | conn, | ||
gboolean | lock_mutex ) |
Helper to add a new connection to the list of connections originated by this endpoint.
ne | The imquic_network_endpoint instance to add the connection to |
conn | The imquic_connection instance to add to the endpoint |
lock_mutex | Whether the endpoint mutex should be used to protect the action (to avoid double locks) |
imquic_network_endpoint * imquic_network_endpoint_create | ( | imquic_configuration * | config | ) |
Helper to create a new imquic_network_endpoint instance from a imquic_configuration object.
config | The imquic_configuration object to use to configure and create the new endpoint |
void imquic_network_endpoint_destroy | ( | imquic_network_endpoint * | ne | ) |
Helper to destroy an existing endpoint instance.
ne | The imquic_network_endpoint instance to destroy |
void imquic_network_endpoint_remove_connection | ( | imquic_network_endpoint * | ne, |
imquic_connection * | conn, | ||
gboolean | lock_mutex ) |
Helper to remove an existing connection from the list of connections originated by this endpoint.
ne | The imquic_network_endpoint instance to remove the connection from |
conn | The imquic_connection instance to remove from the endpoint |
lock_mutex | Whether the endpoint mutex should be used to protect the action (to avoid double locks) |
void imquic_network_endpoint_shutdown | ( | imquic_network_endpoint * | ne | ) |
Helper to shutdown an existing endpoint.
ne | The imquic_network_endpoint instance to shut down |
int imquic_network_send | ( | imquic_connection * | conn, |
uint8_t * | bytes, | ||
size_t | blen ) |
Helper to send data on a connection.
conn | The imquic_connection instance to send the data on |
bytes | The data to send |
blen | the size of the data to send |