ascii-chat
Binary v0.16.114-28-gf5913657f
Library lib/v0.3.2-3302-gf5913657f
Video chat in your terminal
Loading...
Searching...
No Matches
lib/network/quic/transport.h
Go to the documentation of this file.
1#pragma once
2
3#include "connection.h"
5
6/* Private single-lane bridge. The connection and its crypto context outlive
7 * the returned transport. All operations, endpoint pumping, and destruction
8 * must run on the same lane. recv is nonblocking and returns
9 * ERROR_NETWORK_TIMEOUT when no complete packet is queued. The caller must
10 * destroy the transport before destroying the connection. */
12/* As above, but adapter operations lock the borrowed lane mutex. The endpoint
13 * owner must hold that same mutex for every operation on the connection,
14 * including UDP pump, security transitions, and removal. The mutex outlives
15 * the transport; do not call attach while already holding it. recv waits up to
16 * receive_timeout_ns (one second if zero), and interrupt wakes receivers.
17 * Stop and join all transport users before destroying the transport. */
19/* For an endpoint accept callback already holding lane. The returned adapter
20 * uses lane for later calls; no adapter method may be called until it is
21 * released. */
23asciichat_error_t quic_transport_attach_on_lane_with_waker(quic_connection_t *connection, mutex_t *lane, void (*wake)(void *), void *context, void (*on_destroy)(acip_transport_t *, void *),
24 void *destroy_context, acip_transport_t **out);
25/* Report an endpoint-reported connection failure after releasing the lane
26 * mutex. Pending receives wake and return the supplied error. Once this
27 * returns, the endpoint owner may remove the detached connection on the lane. */
29/* The endpoint owner already holds the adapter's lane. */
31/* Only for an unclaimed adapter that has never been exposed to a caller. */
33asciichat_error_t quic_transport_set_waker_on_lane(acip_transport_t *transport, void (*wake)(void *), void *context);
34/* Called on the lane before a locally initiated close detaches its receiver. */
35void quic_transport_set_close_on_lane(acip_transport_t *transport, void (*close)(quic_connection_t *, void *), void *context);
36/* Configure while the transport is live. Called under the lane lock after a
37 * packet is admitted; the callback must not block or reenter transport APIs.
38 * Clear it and stop producers before destroying its context. */
39asciichat_error_t quic_transport_set_waker(acip_transport_t *transport, void (*wake)(void *), void *context);
40/* After the local ACIP handshake, begin the authenticated readiness exchange.
41 * The borrowed crypto context must outlive the connection. */
asciichat_error_t
Error and exit codes - unified status values (0-255).
Definition error_codes.h:48
struct acip_transport acip_transport_t
Forward declaration of ACIP transport.
Definition host.h:508
Transport abstraction layer for ACIP protocol.
struct quic_connection quic_connection_t
void quic_transport_set_close_on_lane(acip_transport_t *transport, void(*close)(quic_connection_t *, void *), void *context)
asciichat_error_t quic_transport_attach_serialized(quic_connection_t *connection, crypto_context_t *crypto, mutex_t *lane, acip_transport_t **out)
asciichat_error_t quic_transport_attach_on_lane_with_waker(quic_connection_t *connection, mutex_t *lane, void(*wake)(void *), void *context, void(*on_destroy)(acip_transport_t *, void *), void *destroy_context, acip_transport_t **out)
asciichat_error_t quic_transport_begin_security(acip_transport_t *transport, crypto_context_t *crypto)
asciichat_error_t quic_transport_set_waker_on_lane(acip_transport_t *transport, void(*wake)(void *), void *context)
bool quic_transport_security_ready(acip_transport_t *transport)
asciichat_error_t quic_transport_destroy_unclaimed_on_lane(acip_transport_t **transport, asciichat_error_t reason)
asciichat_error_t quic_transport_fail(acip_transport_t *transport, asciichat_error_t reason)
asciichat_error_t quic_transport_allow_media(acip_transport_t *transport)
asciichat_error_t quic_transport_attach(quic_connection_t *connection, crypto_context_t *crypto, acip_transport_t **out)
asciichat_error_t quic_transport_fail_on_lane(acip_transport_t *transport, asciichat_error_t reason)
asciichat_error_t quic_transport_attach_on_lane(quic_connection_t *connection, crypto_context_t *crypto, mutex_t *lane, acip_transport_t **out)
asciichat_error_t quic_transport_set_waker(acip_transport_t *transport, void(*wake)(void *), void *context)
static bool size_t gotel_query_t * out
Definition queries.h:10
Endpoint cryptographic state for handshake, packet protection, authentication, and rekeying.