14#ifndef IMQUIC_NETWORK_H
15#define IMQUIC_NETWORK_H
18#include <sys/socket.h>
37 struct sockaddr_storage
addr;
95 uint8_t *bytes, uint64_t length, gboolean complete);
imquic public interface (headers)
Media Over QUIC (MoQ) stack (headers)
RTP Over QUIC (RoQ) stack (headers)
GMutex imquic_mutex
imquic mutex implementation
Definition mutex.h:18
char * imquic_network_address_str(imquic_network_address *address, char *output, size_t outlen, gboolean add_port)
Helper to serialize a network address to a string.
Definition network.c:57
int imquic_network_send_packet(imquic_network_endpoint *ne)
Definition network.c:498
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.
Definition network.c:171
imquic_network_endpoint * imquic_network_endpoint_create(imquic_configuration *config)
Helper to create a new imquic_network_endpoint instance from a imquic_configuration object.
Definition network.c:212
void imquic_network_init(void)
Initialize the network stack at startup.
Definition network.c:35
uint16_t imquic_network_address_port(imquic_network_address *address)
Helper to return the port used by a network address.
Definition network.c:92
int imquic_network_endpoint_start(imquic_network_endpoint *ne)
Helper method to start an endpoint (whether it's a client or a server)
Definition network.c:136
void imquic_network_endpoint_shutdown(imquic_network_endpoint *ne)
Helper to shutdown an existing endpoint.
Definition network.c:186
void imquic_network_deinit(void)
Uninitialize the network stack.
Definition network.c:52
void imquic_network_endpoint_destroy(imquic_network_endpoint *ne)
Helper to destroy an existing endpoint instance.
Definition network.c:193
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.
Definition network.c:159
Reference counter mechanism.
A client/server configuration.
Definition configuration.h:27
QUIC Connection.
Definition connection.h:38
MoQ public callbacks.
Definition internal/moq.h:1306
Abstraction of a network address.
Definition network.h:35
struct sockaddr_storage addr
Network address.
Definition network.h:37
socklen_t addrlen
Size of the network address.
Definition network.h:39
Abstraction of a network endpoint (client or server)
Definition network.h:54
void(* connection_failed)(void *user_data)
Callback to invoke when a client connection attempt fails.
Definition network.h:103
uint64_t protocol
(Sub-)Protocol this endpoint uses, in case imquic is handling a protocol natively
Definition network.h:107
union imquic_network_endpoint::@174160051024204156321124113115044216377074317140 callbacks
(Sub-)Protocol specific callbacks (at the time of writing, RoQ and MoQ only)
void(* reset_stream_incoming)(imquic_connection *conn, uint64_t stream_id, uint64_t error_code)
Callback to invoke when a RESET_STREAM arrives on one of the connections handled by this endpoint.
Definition network.h:99
gboolean qlog_sequential
Whether sequential JSON should be used for the QLOG file, instead of regular JSON.
Definition network.h:116
volatile gint started
Whether this connection has been started.
Definition network.h:126
uint16_t port
Local and remote ports.
Definition network.h:64
gboolean qlog_http3
Definition network.h:118
void(* stream_incoming)(imquic_connection *conn, uint64_t stream_id, uint8_t *bytes, uint64_t length, gboolean complete)
Callback to invoke when new STREAM data is available on one of the connections handled by this endpoi...
Definition network.h:94
imquic_moq_callbacks moq
Definition network.h:110
picoquic_quic_t * qc
Definition network.h:70
imquic_roq_callbacks roq
Definition network.h:111
uint64_t conns_num
Number of connections handled by this socket (may be more than one for servers)
Definition network.h:88
void * source
Definition network.h:56
imquic_mutex mutex
Mutex.
Definition network.h:124
gboolean raw_quic
Whether raw QUIC should be supported.
Definition network.h:76
GHashTable * connections
List of connections handled by this socket (may be more than one for servers)
Definition network.h:86
uint32_t moq_version
Definition network.h:122
char * qlog_path
Path to save QLOG files to, if needed/supported: a filename for clients, a folder for servers.
Definition network.h:114
char * h3_path
For WebTransport clients, the path to CONNECT to (/ by default)
Definition network.h:82
imquic_network_address remote_address
Remote address of the peer (clients only)
Definition network.h:68
gboolean internal_callbacks
Whether this endpoint has internal generic callbacks (true for the native RoQ and MoQ stacks)
Definition network.h:90
char * name
Name of this endpoint.
Definition network.h:58
void(* datagram_incoming)(imquic_connection *conn, uint8_t *bytes, uint64_t length)
Callback to invoke when new DATAGRAM data is available on one of the connections handled by this endp...
Definition network.h:97
char * sni
SNI the client will use.
Definition network.h:74
void(* new_connection)(imquic_connection *conn, void *user_data)
Callback to invoke when a new connection is available on this endpoint.
Definition network.h:92
void(* connection_gone)(imquic_connection *conn)
Callback to invoke when new one of the connections handled by this endpoint is closed.
Definition network.h:101
void * user_data
User data to pass in the new_connection callback, to correlate a connection to the endpoint it's comi...
Definition network.h:105
gboolean qlog_quic
Whether HTTP/3 and/or RoQ and/or MoQT events should be saved to QLOG, if supported.
Definition network.h:118
int fd
Socket.
Definition network.h:62
gboolean qlog_roq
Definition network.h:119
uint16_t remote_port
Definition network.h:64
gboolean webtransport
Whether WebTransport should be supported.
Definition network.h:80
volatile gint shutting
Whether this connection is being shut down.
Definition network.h:128
gboolean qlog_roq_packets
Definition network.h:119
struct imquic_source * timer
Definition network.h:72
imquic_network_address local_address
Local address.
Definition network.h:66
GHashTable * connections_by_cnx
Definition network.h:86
volatile gint destroyed
Whether this instance has been destroyed (reference counting)
Definition network.h:130
imquic_refcount ref
Reference counter.
Definition network.h:132
gboolean qlog_moq_messages
Definition network.h:120
char ** alpn
Array of ALPN this endpoint will negotiate, when using raw QUIC.
Definition network.h:78
char ** wt_protocols
In case WebTransport is used, array of protocols to negotiate.
Definition network.h:84
gboolean qlog_moq_objects
Definition network.h:120
gboolean qlog_moq
Definition network.h:120
gboolean is_server
Whether this is a client or a server.
Definition network.h:60
RoQ public callbacks.
Definition internal/roq.h:61
Event source base.
Definition loop.h:34