ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
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. */
13/* As above, but adapter operations lock the borrowed lane mutex. The endpoint
14 * owner must hold that same mutex for every operation on the connection,
15 * including UDP pump, security transitions, and removal. The mutex outlives
16 * the transport; do not call attach while already holding it. recv waits up to
17 * receive_timeout_ns (one second if zero), and interrupt wakes receivers.
18 * Stop and join all transport users before destroying the transport. */
20 mutex_t *lane, acip_transport_t **out);
21/* For an endpoint accept callback already holding lane. The returned adapter
22 * uses lane for later calls; no adapter method may be called until it is
23 * released. */
27 void (*wake)(void *), void *context,
28 void (*on_destroy)(acip_transport_t *, void *),
29 void *destroy_context, acip_transport_t **out);
30/* Report an endpoint-reported connection failure after releasing the lane
31 * mutex. Pending receives wake and return the supplied error. Once this
32 * returns, the endpoint owner may remove the detached connection on the lane. */
34/* The endpoint owner already holds the adapter's lane. */
36/* Only for an unclaimed adapter that has never been exposed to a caller. */
38asciichat_error_t quic_transport_set_waker_on_lane(acip_transport_t *transport, void (*wake)(void *), void *context);
39/* Called on the lane before a locally initiated close detaches its receiver. */
40void quic_transport_set_close_on_lane(acip_transport_t *transport, void (*close)(quic_connection_t *, void *),
41 void *context);
42/* Configure while the transport is live. Called under the lane lock after a
43 * packet is admitted; the callback must not block or reenter transport APIs.
44 * Clear it and stop producers before destroying its context. */
45asciichat_error_t quic_transport_set_waker(acip_transport_t *transport, void (*wake)(void *), void *context);
46/* After the local ACIP handshake, begin the authenticated readiness exchange.
47 * The borrowed crypto context must outlive the connection. */
asciichat_error_t
Error and exit codes - unified status values (0-255).
Definition error_codes.h:44
struct acip_transport acip_transport_t
Forward declaration of ACIP transport.
Definition host.h:506
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:8
Endpoint cryptographic state for handshake, packet protection, authentication, and rekeying.