9#include <netinet/tcp.h>
13#include <sys/socket.h>
17#define CT_EXTERN __attribute__((visibility("default")))
22#define CT_CONNECTION_DEFAULT_PRIORITY 100
218#define EMPTY_PREFERENCE_SET_DEFAULT {0}
219#define RUNTIME_DEPENDENT_DEFAULT 0
222#define get_selection_property_list(f) \
223f(RELIABILITY, "reliability", ct_selection_preference_enum_t, reliability, REQUIRE, TYPE_PREFERENCE) \
224f(PRESERVE_MSG_BOUNDARIES, "preserveMsgBoundaries", ct_selection_preference_enum_t, preserve_msg_boundaries, NO_PREFERENCE, TYPE_PREFERENCE ) \
225f(PER_MSG_RELIABILITY, "perMsgReliability", ct_selection_preference_enum_t, per_msg_reliability, NO_PREFERENCE, TYPE_PREFERENCE) \
226f(PRESERVE_ORDER, "preserveOrder", ct_selection_preference_enum_t, preserve_order, REQUIRE, TYPE_PREFERENCE) \
227f(ZERO_RTT_MSG, "zeroRttMsg", ct_selection_preference_enum_t, zero_rtt_msg, NO_PREFERENCE, TYPE_PREFERENCE) \
228f(MULTISTREAMING, "multistreaming", ct_selection_preference_enum_t, multistreaming, PREFER, TYPE_PREFERENCE) \
229f(FULL_CHECKSUM_SEND, "fullChecksumSend", ct_selection_preference_enum_t, full_checksum_send, REQUIRE, TYPE_PREFERENCE) \
230f(FULL_CHECKSUM_RECV, "fullChecksumRecv", ct_selection_preference_enum_t, full_checksum_recv, REQUIRE, TYPE_PREFERENCE) \
231f(CONGESTION_CONTROL, "congestionControl", ct_selection_preference_enum_t, congestion_control, REQUIRE, TYPE_PREFERENCE) \
232f(KEEP_ALIVE, "keepAlive", ct_selection_preference_enum_t, keep_alive, NO_PREFERENCE, TYPE_PREFERENCE) \
233f(USE_TEMPORARY_LOCAL_ADDRESS, "useTemporaryLocalAddress", ct_selection_preference_enum_t, use_temporary_local_address, RUNTIME_DEPENDENT_DEFAULT, TYPE_PREFERENCE) \
234f(MULTIPATH, "multipath", ct_multipath_enum_t, multipath, RUNTIME_DEPENDENT_DEFAULT, TYPE_ENUM) \
235f(ADVERTISES_ALT_ADDRESS, "advertisesAltAddr", ct_selection_preference_enum_t, advertises_alt_address, PROHIBIT, TYPE_PREFERENCE) \
236f(DIRECTION, "direction", ct_direction_of_communication_enum_t, direction, CT_DIRECTION_BIDIRECTIONAL, TYPE_ENUM) \
237f(SOFT_ERROR_NOTIFY, "softErrorNotify", ct_selection_preference_enum_t, soft_error_notify, NO_PREFERENCE, TYPE_PREFERENCE) \
238f(ACTIVE_READ_BEFORE_SEND, "activeReadBeforeSend", ct_selection_preference_enum_t, active_read_before_send, NO_PREFERENCE, TYPE_PREFERENCE)
240#define get_preference_set_selection_property_list(f) \
241 f(INTERFACE, "interface", ct_preference_set_t, interface, EMPTY_PREFERENCE_SET_DEFAULT, \
242 TYPE_PREFERENCE_SET) \
243 f(PVD, "pvd", ct_preference_set_t, pvd, EMPTY_PREFERENCE_SET_DEFAULT, TYPE_PREFERENCE_SET)
245#define output_enum(enum_name, string_name, property_type, token_name, default_value, type) \
258#define CT_CONN_TIMEOUT_DISABLED 0
263#define CT_CONN_RATE_UNLIMITED UINT64_MAX
268#define CT_CONN_CHECKSUM_FULL_COVERAGE UINT32_MAX
273#define CT_CONN_MSG_MAX_LEN_NOT_APPLICABLE 0
319#define get_writable_connection_property_list(f) \
320f(RECV_CHECKSUM_LEN, "recvChecksumLen", uint32_t, recv_checksum_len, CT_CONN_CHECKSUM_FULL_COVERAGE, TYPE_UINT32) \
321f(CONN_PRIORITY, "connPriority", uint8_t, conn_priority, CT_CONNECTION_DEFAULT_PRIORITY, TYPE_UINT8) \
322f(CONN_TIMEOUT, "connTimeout", uint32_t, conn_timeout_ms, CT_CONN_TIMEOUT_DISABLED, TYPE_UINT32) \
323f(KEEP_ALIVE_TIMEOUT, "keepAliveTimeout", uint32_t, keep_alive_timeout, CT_CONN_TIMEOUT_DISABLED, TYPE_UINT32) \
324f(CONN_SCHEDULER, "connScheduler", ct_connection_scheduler_enum_t, conn_scheduler, CT_CONN_SCHEDULER_WEIGHTED_FAIR_QUEUEING, TYPE_ENUM) \
325f(CONN_CAPACITY_PROFILE, "connCapacityProfile", ct_capacity_profile_enum_t, conn_capacity_profile, CT_CAPACITY_PROFILE_BEST_EFFORT, TYPE_ENUM) \
326f(MULTIPATH_POLICY, "multipathPolicy", ct_multipath_policy_enum_t, multipath_policy, CT_MULTIPATH_POLICY_HANDOVER, TYPE_ENUM) \
327f(MIN_SEND_RATE, "minSendRate", uint64_t, min_send_rate, CT_CONN_RATE_UNLIMITED, TYPE_UINT64) \
328f(MIN_RECV_RATE, "minRecvRate", uint64_t, min_recv_rate, CT_CONN_RATE_UNLIMITED, TYPE_UINT64) \
329f(MAX_SEND_RATE, "maxSendRate", uint64_t, max_send_rate, CT_CONN_RATE_UNLIMITED, TYPE_UINT64) \
330f(MAX_RECV_RATE, "maxRecvRate", uint64_t, max_recv_rate, CT_CONN_RATE_UNLIMITED, TYPE_UINT64) \
331f(GROUP_CONN_LIMIT, "groupConnLimit", uint64_t, group_conn_limit, CT_CONN_RATE_UNLIMITED, TYPE_UINT64) \
332f(ISOLATE_SESSION, "isolateSession", bool, isolate_session, false, TYPE_BOOL)
334#define get_read_only_connection_properties(f) \
335f(SINGULAR_TRANSMISSION_MSG_MAX_LEN, "singularTransmissionMsgMaxLen", uint64_t, singular_transmission_msg_max_len, 0, TYPE_UINT64) \
336f(SEND_MESSAGE_MAX_LEN, "sendMsgMaxLen", uint64_t, send_message_max_len, 0, TYPE_UINT64) \
337f(RECV_MESSAGE_MAX_LEN, "recvMessageMaxLen", uint64_t, recv_message_max_len, 0, TYPE_UINT64)
339#define get_tcp_connection_properties(f) \
340f(USER_TIMEOUT_VALUE_MS, "userTimeoutValueMs", uint32_t, user_timeout_value_ms, TCP_USER_TIMEOUT, TYPE_UINT32) \
341f(USER_TIMEOUT_ENABLED, "userTimeoutEnabled", bool, user_timeout_enabled, false, TYPE_BOOL) \
342f(USER_TIMEOUT_CHANGEABLE, "userTimeoutChangeable", bool, user_timeout_changeable, true, TYPE_BOOL)
360#define output_transport_property_getter_declaration(enum_name, string_name, property_type, \
361 token_name, default_value, type_enum) \
362 CT_EXTERN property_type ct_transport_properties_get_##token_name( \
363 const ct_transport_properties_t* transport_props);
365#define output_transport_property_preference_getter_declaration( \
366 enum_name, string_name, property_type, token_name, default_value, type) \
367 CT_EXTERN ct_selection_preference_enum_t ct_transport_properties_get_##token_name##_preference( \
368 const ct_transport_properties_t* transport_props, const char* value);
370#define output_transport_property_setter_declaration(enum_name, string_name, property_type, \
371 token_name, default_value, type_enum) \
372 CT_EXTERN void ct_transport_properties_set_##token_name( \
373 ct_transport_properties_t* transport_props, property_type val);
375#define output_transport_property_preference_set_adder(enum_name, string_name, property_type, \
376 token_name, default_value, type) \
377 CT_EXTERN int ct_transport_properties_add_##token_name##_preference( \
378 ct_transport_properties_t* transport_props, const char* value, \
379 ct_selection_preference_enum_t preference);
436#define CT_MESSAGE_CHECKSUM_FULL_COVERAGE UINT32_MAX
439#define get_message_property_list(f) \
440f(MSG_LIFETIME, "msgLifetime", uint64_t, lifetime, 0, TYPE_UINT64) \
441f(MSG_PRIORITY, "msgPriority", uint32_t, priority, 100, TYPE_UINT32) \
442f(MSG_ORDERED, "msgOrdered", bool, ordered, true, TYPE_BOOL) \
443f(MSG_SAFELY_REPLAYABLE, "msgSafelyReplayable", bool, safely_replayable, false, TYPE_BOOL) \
444f(FINAL, "final", bool, final, false, TYPE_BOOL) \
445f(MSG_CHECKSUM_LEN, "msgChecksumLen", uint32_t, checksum_len, CT_MESSAGE_CHECKSUM_FULL_COVERAGE, TYPE_UINT32) \
446f(MSG_RELIABLE, "msgReliable", bool, reliable, true, TYPE_BOOL) \
447f(MSG_CAPACITY_PROFILE, "msgCapacityProfile", ct_capacity_profile_enum_t, capacity_profile, CT_CAPACITY_PROFILE_BEST_EFFORT, TYPE_ENUM) \
448f(NO_FRAGMENTATION, "noFragmentation", bool, no_fragmentation, false, TYPE_BOOL) \
449f(NO_SEGMENTATION, "noSegmentation", bool, no_segmentation, false, TYPE_BOOL)
451#define output_message_property_getter_declaration(enum_name, string_name, property_type, \
452 token_name, default_value, type_enum) \
453 CT_EXTERN property_type ct_message_properties_get_##token_name( \
454 const ct_message_properties_t* msg_props);
456#define output_message_property_setter_declaration(enum_name, string_name, property_type, \
457 token_name, default_value, type_enum) \
458 CT_EXTERN void ct_message_properties_set_##token_name(ct_message_properties_t* msg_props, \
526 const
char* ticket_store_path);
550 const
char* cert_file,
551 const
char* key_file);
562 const
char* cert_file,
563 const
char* key_file);
720 const
char* interface_name);
759 struct in6_addr ipv6_addr);
773 const struct sockaddr_storage* addr);
826 const
char* hostname);
844 const
char* service);
861 const struct sockaddr_storage* addr);
879 in_addr_t ipv4_addr);
889 struct in6_addr ipv6_addr);
1088#define output_message_context_getter_declaration(enum_name, string_name, property_type, \
1089 token_name, default_value, type_enum) \
1090 CT_EXTERN property_type ct_message_context_get_##token_name( \
1091 const ct_message_context_t* msg_ctx);
1093#define output_message_context_setter_declaration(enum_name, string_name, property_type, \
1094 token_name, default_value, type_enum) \
1095 CT_EXTERN void ct_message_context_set_##token_name(ct_message_context_t* msg_ctx, \
1111typedef struct ct_receive_callbacks_s {
1126 const char* reason);
1152typedef struct ct_connection_callbacks_s {
1205typedef struct ct_listener_callbacks_s {
1284typedef struct ct_framer_impl_s {
#define output_transport_property_setter_declaration(enum_name, string_name, property_type, token_name, default_value, type_enum)
const ct_local_endpoint_t * ct_message_context_get_local_endpoint(const ct_message_context_t *message_context)
Get the local endpoint from a message context.
#define output_message_context_setter_declaration(enum_name, string_name, property_type, token_name, default_value, type_enum)
#define output_transport_property_getter_declaration(enum_name, string_name, property_type, token_name, default_value, type_enum)
#define output_transport_property_preference_getter_declaration( enum_name, string_name, property_type, token_name, default_value, type)
const ct_remote_endpoint_t * ct_message_context_get_remote_endpoint(const ct_message_context_t *message_context)
Get the remote endpoint from a message context.
ct_message_context_t * ct_message_context_new(void)
Initialize a message context with default values.
#define get_tcp_connection_properties(f)
#define output_transport_property_preference_set_adder(enum_name, string_name, property_type, token_name, default_value, type)
#define get_selection_property_list(f)
#define output_message_property_getter_declaration(enum_name, string_name, property_type, token_name, default_value, type_enum)
#define get_read_only_connection_properties(f)
void ct_message_context_free(ct_message_context_t *message_context)
Free resources in a message context.
const ct_message_properties_t * ct_message_context_get_message_properties(const ct_message_context_t *message_context)
Get message properties from a message context.
#define output_message_property_setter_declaration(enum_name, string_name, property_type, token_name, default_value, type_enum)
#define get_message_property_list(f)
#define output_message_context_getter_declaration(enum_name, string_name, property_type, token_name, default_value, type_enum)
#define get_writable_connection_property_list(f)
#define get_preference_set_selection_property_list(f)
void * ct_message_context_get_receive_context(const ct_message_context_t *message_context)
Get the receive context from a message context.
ct_connection_state_enum_t
Connection lifecycle states.
ct_capacity_profile_enum_t
QoS capacity profiles for traffic classification.
ct_connection_scheduler_enum_t
Connection scheduling algorithms for multipath.
ct_multipath_policy_enum_t
Policies for multipath traffic distribution.
@ CT_CONN_STATE_ESTABLISHED
Connection is ready for data transfer.
@ CT_CONN_STATE_CLOSED
Connection is fully closed.
@ CT_CONN_STATE_ESTABLISHING
Connection is being established.
@ CT_CONN_STATE_INVALID
Invalid state (used for error handling)
@ CT_CONN_STATE_CLOSING
Connection is closing gracefully.
@ CT_CAPACITY_PROFILE_CONSTANT_RATE_STREAMING
Constant bitrate streaming.
@ CT_CAPACITY_PROFILE_SCAVENGER
Background/bulk traffic.
@ CT_CAPACITY_PROFILE_BEST_EFFORT
Default best-effort traffic.
@ CT_CAPACITY_PROFILE_CAPACITY_SEEKING
Throughput-seeking traffic.
@ CT_CAPACITY_PROFILE_LOW_LATENCY_NON_INTERACTIVE
Non-interactive low-latency (e.g., streaming)
@ CT_CAPACITY_PROFILE_LOW_LATENCY_INTERACTIVE
Interactive low-latency (e.g., gaming, VoIP)
@ CT_CONN_SCHEDULER_WEIGHTED_FAIR_QUEUEING
Weighted fair queueing across paths.
@ CT_MULTIPATH_POLICY_HANDOVER
Use paths sequentially (failover only)
@ CT_MULTIPATH_POLICY_INTERACTIVE
Optimize for low latency.
@ CT_MULTIPATH_POLICY_AGGREGATE
Use all paths for maximum throughput.
void * ct_connection_get_callback_context(const ct_connection_t *connection)
Get the connection's callback context.
bool ct_connection_is_established(const ct_connection_t *connection)
Check if a connection's state is CT_CONN_STATE_ESTABLISHED.
const char * ct_connection_get_protocol_name(const ct_connection_t *connection)
Get the name of the underlying protocol.
int ct_connection_clone_full(const ct_connection_t *source_connection, const ct_framer_impl_t *framer, const ct_transport_properties_t *connection_properties)
Clone a connection to create a new connection in the same connection group.
int ct_connection_clone(ct_connection_t *source_connection)
Clone a connection with only mandatory parameters.
void ct_connection_close(ct_connection_t *connection)
Close a connection gracefully.
bool ct_connection_is_establishing(const ct_connection_t *connection)
Check if a connection's state is CT_CONN_STATE_ESTABLISHING.
const ct_local_endpoint_t * ct_connection_get_active_local_endpoint(const ct_connection_t *connection)
Get the currently active local endpoint.
bool ct_connection_can_receive(const ct_connection_t *connection)
Check the value of the canReceive connection property.
bool ct_connection_is_server(const ct_connection_t *connection)
Check if a connection is a server connection.
const char * ct_connection_get_uuid(const ct_connection_t *connection)
Get the UUID of a connection.
int ct_receive_message(ct_connection_t *connection, const ct_receive_callbacks_t *receive_callbacks)
Register callbacks to receive messages on a connection.
int ct_send_message(ct_connection_t *connection, const ct_message_t *message)
Send a message over a connection with default properties.
int ct_send_message_full(ct_connection_t *connection, const ct_message_t *message, const ct_message_context_t *message_context)
Send a message with custom message context and properties.
int ct_connection_set_priority(ct_connection_t *connection, uint8_t priority)
Set relative priority for a connection compared to other connections in the same group.
bool ct_connection_is_closing(const ct_connection_t *connection)
Check if a connection's state is CT_CONN_STATE_CLOSING.
bool ct_connection_is_closed_or_closing(const ct_connection_t *connection)
Check if a connection's state is CT_CONN_STATE_CLOSED or CT_CONN_STATE_CLOSING.
ct_protocol_enum_t
Enumeration of currently supported transport protocols.
bool ct_connection_sent_early_data(const ct_connection_t *connection)
Check if a connection has sent early data (e.g., 0-RTT).
const ct_remote_endpoint_t * ct_connection_get_active_remote_endpoint(const ct_connection_t *connection)
Get the currently active remote endpoint for the connection.
size_t ct_connection_get_total_num_grouped_connections(const ct_connection_t *connection)
Get the total number of connections in a connection group (including closed ones).
void ct_connection_abort(ct_connection_t *connection)
Forcefully abort a connection without graceful shutdown.
void ct_connection_close_group(ct_connection_t *connection)
Close all connections in the same connection group gracefully.
void ct_connection_free(ct_connection_t *connection)
Free resources in a connection.
const ct_transport_properties_t * ct_connection_get_transport_properties(const ct_connection_t *connection)
Get shared connection properties for a connection.
size_t ct_connection_get_num_open_grouped_connections(const ct_connection_t *connection)
Get the number of open connections in a connection group.
void ct_connection_abort_group(ct_connection_t *connection)
Forcefully abort all connections in the same connection group.
bool ct_connection_is_client(const ct_connection_t *connection)
Check if a connection is a client connection.
uint8_t ct_connection_get_priority(const ct_connection_t *connection)
Get relative priority when compared to other connections in the same group.
bool ct_connection_is_closed(const ct_connection_t *connection)
Check if a connection's state is CT_CONN_STATE_CLOSED.
ct_connection_state_enum_t ct_connection_get_state(const ct_connection_t *connection)
Get the current state of a connection.
ct_protocol_enum_t ct_connection_get_transport_protocol(const ct_connection_t *connection)
Get the transport protocol used by a connection.
bool ct_connection_can_send(const ct_connection_t *connection)
Check the value of the canSend connection property.
@ CT_PROTOCOL_ERROR
returned from getters in errors, e.g. null connection
int(* ct_framer_done_encoding_callback)(ct_connection_t *connection, ct_message_t *encoded_message, ct_message_context_t *context)
Callback invoked by framer when message encoding is complete.
void(* ct_framer_done_decoding_callback)(ct_connection_t *connection, ct_message_t *decoded_message, ct_message_context_t *context)
Callback invoked by framer when message decoding is complete.
int ct_start_event_loop(void)
Start the CTaps event loop (blocking operation).
int ct_close(void)
Close and cleanup the CTaps library.
int ct_initialize(void)
Initialize the CTaps library.
void ct_listener_close(ct_listener_t *listener)
Close a listener and stop accepting new connections.
void ct_listener_free(ct_listener_t *listener)
Free resources in a listener.
bool ct_listener_is_closed(const ct_listener_t *listener)
Check if a listener is closed.
void * ct_listener_get_callback_context(const ct_listener_t *listener)
Get the callback context associated with a listener.
int ct_local_endpoint_with_service(ct_local_endpoint_t *local_endpoint, const char *service)
Set the service name for a local endpoint.
int ct_local_endpoint_with_interface(ct_local_endpoint_t *local_endpoint, const char *interface_name)
Set the network interface for a local endpoint.
uint16_t ct_local_endpoint_get_resolved_port(const ct_local_endpoint_t *local_endpoint)
Get the resolved port for a local endpoint after binding.
void ct_local_endpoint_with_port(ct_local_endpoint_t *local_endpoint, uint16_t port)
Set the port number for a local endpoint.
int ct_local_endpoint_from_sockaddr(ct_local_endpoint_t *local_endpoint, const struct sockaddr_storage *addr)
Initialize a local endpoint from a sockaddr structure.
void ct_local_endpoint_free(ct_local_endpoint_t *local_endpoint)
Free all resources in a local endpoint including the structure itself.
int ct_local_endpoint_with_ipv6(ct_local_endpoint_t *local_endpoint, struct in6_addr ipv6_addr)
Set the IPv6 address for a local endpoint.
const char * ct_local_endpoint_get_service(const ct_local_endpoint_t *local_endpoint)
Get the service for a local endpoint.
ct_local_endpoint_t * ct_local_endpoint_deep_copy(const ct_local_endpoint_t *local_endpoint)
Create a heap-allocated copy of a local endpoint.
ct_local_endpoint_t * ct_local_endpoint_new(void)
Create a new heap-allocated local endpoint.
int ct_local_endpoint_with_ipv4(ct_local_endpoint_t *local_endpoint, in_addr_t ipv4_addr)
Set the IPv4 address for a local endpoint.
int ct_add_log_file(const char *file_path, ct_log_level_enum_t min_level)
Add a file output destination for CTaps logs.
void ct_set_log_level(ct_log_level_enum_t level)
Set the minimum logging level for CTaps.
ct_log_level_enum_t
Log level enumeration for filtering log output.
@ CT_LOG_ERROR
Error messages.
@ CT_LOG_INFO
Informational messages (default)
@ CT_LOG_TRACE
Trace-level debugging (most verbose)
@ CT_LOG_DEBUG
Debug-level information.
@ CT_LOG_WARN
Warning messages.
ct_message_properties_t * ct_message_properties_new(void)
Create a new message properties object with default values.
void ct_message_properties_free(ct_message_properties_t *message_properties)
Free resources in message properties.
const char * ct_message_get_content(const ct_message_t *message)
Get the content buffer of a message.
ct_message_t * ct_message_deep_copy(const ct_message_t *message)
Create a deep copy of a message, including its content.
ct_message_t * ct_message_new(void)
Allocate a new message on the heap.
ct_message_t * ct_message_new_with_content(const char *content, size_t length)
Allocate a new message with content.
void ct_message_free(ct_message_t *message)
Free all resources in a message including the structure.
void ct_message_set_content(ct_message_t *message, const void *content, size_t length)
Set the content of a message, replacing any existing content.
size_t ct_message_get_length(const ct_message_t *message)
Get the length of a message.
int ct_preconnection_initiate_with_send(const ct_preconnection_t *preconnection, const ct_connection_callbacks_t *connection_callbacks, const ct_message_t *message, const ct_message_context_t *message_context)
Initiate a connection and send a message immediately upon establishment.
ct_preconnection_t * ct_preconnection_new(const ct_local_endpoint_t *const *local_endpoints, size_t num_local_endpoints, const ct_remote_endpoint_t *const *remote_endpoints, size_t num_remote_endpoints, const ct_transport_properties_t *transport_properties, const ct_security_parameters_t *security_parameters)
Create a new preconnection with transport properties and endpoints.
void ct_preconnection_free(ct_preconnection_t *preconnection)
Free a preconnection object.
int ct_preconnection_listen(const ct_preconnection_t *preconnection, const ct_listener_callbacks_t *listener_callbacks, const ct_connection_callbacks_t *connection_callbacks)
Start listening for incoming connections using the configured Preconnection.
int ct_preconnection_initiate(const ct_preconnection_t *preconnection, const ct_connection_callbacks_t *connection_callbacks)
Initiate a connection.
int ct_preconnection_set_framer(ct_preconnection_t *preconnection, const ct_framer_impl_t *framer_impl)
Set a message framer for the preconnection.
int ct_remote_endpoint_with_ipv4(ct_remote_endpoint_t *remote_endpoint, in_addr_t ipv4_addr)
Set the IPv4 address for a remote endpoint.
ct_remote_endpoint_t * ct_remote_endpoint_new(void)
Create a new heap-allocated remote endpoint.
int ct_remote_endpoint_with_service(ct_remote_endpoint_t *remote_endpoint, const char *service)
Set the service name for a remote endpoint.
void ct_remote_endpoint_free(ct_remote_endpoint_t *remote_endpoint)
Free all resources in a remote endpoint including the structure itself.
const char * ct_remote_endpoint_get_service(const ct_remote_endpoint_t *remote_endpoint)
Get the service for a remote endpoint.
void ct_remote_endpoint_with_port(ct_remote_endpoint_t *remote_endpoint, uint16_t port)
Set the port number for a remote endpoint.
int ct_remote_endpoint_with_hostname(ct_remote_endpoint_t *remote_endpoint, const char *hostname)
Set the hostname for a remote endpoint.
int ct_remote_endpoint_from_sockaddr(ct_remote_endpoint_t *remote_endpoint, const struct sockaddr_storage *addr)
Initialize a remote endpoint from a sockaddr structure.
int ct_remote_endpoint_with_ipv6(ct_remote_endpoint_t *remote_endpoint, struct in6_addr ipv6_addr)
Set the IPv6 address for a remote endpoint.
ct_remote_endpoint_t * ct_remote_endpoint_deep_copy(const ct_remote_endpoint_t *remote_endpoint)
Create a heap-allocated copy of a remote endpoint.
const char * ct_security_parameters_get_ticket_store_path(const ct_security_parameters_t *sec)
int ct_security_parameters_clear_alpn(ct_security_parameters_t *sec)
Free and clear all configured ALPN protocol identifiers from the security parameters.
int ct_security_parameters_set_session_ticket_encryption_key(ct_security_parameters_t *sec, const uint8_t *key, size_t key_len)
Set the session ticket encryption key for QUIC session resumption.
ct_security_parameters_t * ct_security_parameters_new(void)
Allocate a new security parameters object on the heap.
size_t ct_security_parameters_get_client_certificate_count(const ct_security_parameters_t *sec)
size_t ct_security_parameters_get_server_certificate_count(const ct_security_parameters_t *sec)
const uint8_t * ct_security_parameters_get_session_ticket_encryption_key(const ct_security_parameters_t *sec, size_t *key_len)
Get the session ticket encryption key.
const char * ct_security_parameters_get_server_name_identification(const ct_security_parameters_t *sec)
const char * ct_security_parameters_get_server_certificate_file(const ct_security_parameters_t *sec, size_t index)
int ct_security_parameters_add_client_certificate(ct_security_parameters_t *sec, const char *cert_file, const char *key_file)
Add a client certificate and private key for TLS connections.
int ct_security_parameters_set_ticket_store_path(ct_security_parameters_t *sec, const char *ticket_store_path)
Set the path to the ticket store for QUIC session resumption.
const char *const * ct_security_parameters_get_alpns(const ct_security_parameters_t *sec, size_t *num_alpns)
Get the configured ALPN protocol identifiers.
const char * ct_security_parameters_get_client_certificate_file(const ct_security_parameters_t *sec, size_t index)
void ct_security_parameters_free(ct_security_parameters_t *security_parameters)
Free resources in security parameters including the structure itself.
int ct_security_parameters_add_server_certificate(ct_security_parameters_t *sec, const char *cert_file, const char *key_file)
Add a server certificate and private key for TLS connections.
const char * ct_security_parameters_get_server_certificate_key_file(const ct_security_parameters_t *sec, size_t index)
int ct_security_parameters_add_alpn(ct_security_parameters_t *sec, const char *alpn)
Add an ALPN protocol identifier to the list of supported ALPNs for TLS connections.
int ct_security_parameters_set_server_name_identification(ct_security_parameters_t *sec, const char *sni)
Set the server name identification (SNI) for TLS connections.
const char * ct_security_parameters_get_client_certificate_key_file(const ct_security_parameters_t *sec, size_t index)
ct_selection_preference_enum_t
Preference levels for transport selection properties.
ct_multipath_enum_t
Multipath transport modes.
ct_direction_of_communication_enum_t
Direction of communication for a connection.
@ REQUIRE
Protocol MUST have this property (eliminates candidates)
@ NO_PREFERENCE
No preference - property does not affect selection.
@ PREFER
Prefer protocols with this property if available.
@ PROHIBIT
Protocol MUST NOT have this property (eliminates candidates)
@ AVOID
Prefer protocols without this property if possible.
@ CT_MULTIPATH_ACTIVE
Actively use multiple paths simultaneously.
@ CT_MULTIPATH_PASSIVE
Will accept multipath used by peer.
@ CT_MULTIPATH_DISABLED
Do not use multipath.
@ CT_DIRECTION_BIDIRECTIONAL
Two-way communication (send and receive)
@ CT_DIRECTION_UNIDIRECTIONAL_RECV
One-way, receive only.
@ CT_DIRECTION_UNIDIRECTIONAL_SEND
One-way, send only.
void ct_transport_properties_free(ct_transport_properties_t *props)
Free a transport properties object.
ct_transport_properties_t * ct_transport_properties_new(void)
Create a new transport properties object with default values.
Callback functions for connection lifecycle events.
void * per_connection_context
User-provided context for the connection lifetime.
Opaque handle representing a connection.
Opaque handle representing a framer layer, wrapping or unwrapping sent/received messages.
Callback functions for listener events.
void * per_listener_context
Opaque handle representing a listener.
Opaque handle representing a local endpoint (generic or resolved to specific ip address and port).
Opaque handle representing message metadata to pass to sending protocol.
Collection of message properties for per-message transmission control.
Opaque handle representing a single message to be sent or received.
Opaque handle representing a preconnection.
Callback functions for receiving messages on a connection.
void * per_receive_context
Per-receive user context accessible when this specific callback is invoked. Can be fetched within ct_...
Opaque handle representing a remote endpoint (generic or resolved to specific ip address and port).
Opaque handle representing a security parameters used to configure security settings for connections ...
Opaque handle representing transport properties used for selecting and configuring protocols.