Packages
hackney
3.0.3
4.7.2
4.7.1
4.7.0
4.6.1
4.6.0
4.5.2
4.5.1
4.5.0
4.4.5
4.4.3
4.4.2
4.4.1
4.4.0
4.3.0
4.2.3
4.2.2
4.2.1
4.2.0
4.1.0
4.0.3
4.0.2
4.0.1
4.0.0
3.2.1
3.2.0
3.1.2
3.1.1
3.1.0
3.0.3
3.0.2
3.0.1
3.0.0
retired
2.0.1
2.0.0
2.0.0-beta.1
1.25.0
1.24.1
1.24.0
1.23.0
1.22.0
1.21.0
1.20.1
1.20.0
1.19.1
1.19.0
1.18.2
1.18.1
1.18.0
1.17.4
1.17.3
1.17.2
1.17.1
1.17.0
1.16.0
1.15.2
1.15.1
1.15.0
1.14.3
1.14.2
1.14.0
1.13.0
1.12.1
1.12.0
1.11.0
1.10.1
1.10.0
1.9.0
1.8.6
1.8.5
1.8.4
1.8.3
1.8.2
1.8.0
1.7.1
1.7.0
1.6.6
retired
1.6.5
1.6.4
retired
1.6.3
1.6.2
1.6.1
1.6.0
1.5.7
1.5.6
1.5.5
1.5.4
1.5.3
1.5.2
1.5.1
1.5.0
1.4.10
1.4.8
1.4.7
1.4.6
1.4.5
1.4.4
1.4.3
1.4.2
1.4.1
1.4.0
1.3.2
1.3.1
1.3.0
1.2.0
1.1.0
1.0.6
1.0.5
1.0.2
1.0.1
0.15.2
0.15.0
0.14.3
0.14.2
0.14.1
0.14.0
0.13.1
Simple HTTP client with HTTP/1.1, HTTP/2, and HTTP/3 support
Security advisory:
This version has known vulnerabilities.
View advisories
Current section
Files
Jump to
Current section
Files
c_src/lsquic/src/liblsquic/lsquic_engine_public.h
/* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */
/*
* lsquic_engine_public.h -- Engine's "public interface"
*
* This structure is used to bundle things in engine that connections
* need. This way, the space per mini connection is one pointer instead
* of several.
*/
#ifndef LSQUIC_ENGINE_PUBLIC_H
#define LSQUIC_ENGINE_PUBLIC_H 1
struct lsquic_cid;
struct lsquic_conn;
struct lsquic_engine;
struct stack_st_X509;
struct lsquic_hash;
struct lsquic_stream_if;
struct ssl_ctx_st;
struct crand;
struct evp_aead_ctx_st;
struct lsquic_server_config;
struct sockaddr;
enum warning_type
{
WT_ACKPARSE_MINI,
WT_ACKPARSE_FULL,
WT_NO_POISON,
N_WARNING_TYPES,
};
#define WARNING_INTERVAL (24ULL * 3600ULL * 1000000ULL)
struct lsquic_engine_public {
struct lsquic_mm enp_mm;
struct lsquic_engine_settings enp_settings;
struct token_generator *enp_tokgen;
lsquic_lookup_cert_f enp_lookup_cert;
void *enp_cert_lu_ctx;
struct ssl_ctx_st * (*enp_get_ssl_ctx)(void *peer_ctx,
const struct sockaddr *);
const struct lsquic_shared_hash_if
*enp_shi;
void *enp_shi_ctx;
lsquic_time_t enp_last_warning[N_WARNING_TYPES];
const struct lsquic_stream_if *enp_stream_if;
void *enp_stream_if_ctx;
const struct lsquic_hset_if *enp_hsi_if;
void *enp_hsi_ctx;
void (*enp_generate_scid)(void *,
struct lsquic_conn *, struct lsquic_cid *, unsigned);
void *enp_gen_scid_ctx;
int (*enp_verify_cert)(void *verify_ctx,
struct stack_st_X509 *chain);
void *enp_verify_ctx;
const struct lsquic_packout_mem_if
*enp_pmi;
void *enp_pmi_ctx;
struct lsquic_engine *enp_engine;
struct lsquic_hash *enp_srst_hash;
enum {
ENPUB_PROC = (1 << 0), /* Being processed by one of the user-facing
* functions.
*/
ENPUB_CAN_SEND = (1 << 1),
ENPUB_HTTP = (1 << 2), /* Engine in HTTP mode */
} enp_flags;
unsigned char enp_ver_tags_buf[ sizeof(lsquic_ver_tag_t) * N_LSQVER ];
unsigned enp_ver_tags_len;
struct crand *enp_crand;
struct evp_aead_ctx_st *enp_retry_aead_ctx;
unsigned char *enp_alpn; /* May be set if not HTTP */
/* es_noprogress_timeout converted to microseconds for speed */
lsquic_time_t enp_noprog_timeout;
lsquic_time_t enp_mtu_probe_timer;
/* Certs used by gQUIC server: */
struct lsquic_hash *enp_compressed_server_certs;
struct lsquic_hash *enp_server_certs;
/* gQUIC server configuration: */
struct lsquic_server_config *enp_server_config;
/* Serialized subset of server engine transport parameters that is used
* as SSL QUIC context. 0 is for version <= LSQVER_ID27, 1 is for others.
*/
unsigned char enp_quic_ctx_buf[2][200];
unsigned enp_quic_ctx_sz[2];
#if LSQUIC_CONN_STATS
struct batch_size_stats {
unsigned min, max, /* Minimum and maximum batch sizes */
count; /* Number of batches sent */
float avg; /* Average batch size */
} enp_batch_size_stats;
#endif
};
/* Put connection onto the Tickable Queue if it is not already on it. If
* connection is being destroyed, this is a no-op.
*/
void
lsquic_engine_add_conn_to_tickable (struct lsquic_engine_public *,
lsquic_conn_t *);
/* Put connection onto Advisory Tick Time Queue if it is not already on it.
*/
void
lsquic_engine_add_conn_to_attq (struct lsquic_engine_public *enpub,
lsquic_conn_t *, lsquic_time_t, unsigned why);
void
lsquic_engine_retire_cid (struct lsquic_engine_public *,
struct lsquic_conn *, unsigned cce_idx, lsquic_time_t now,
lsquic_time_t drain_time);
int
lsquic_engine_add_cid (struct lsquic_engine_public *,
struct lsquic_conn *, unsigned cce_idx);
struct lsquic_conn *
lsquic_engine_find_conn (const struct lsquic_engine_public *pub,
const lsquic_cid_t *cid);
#endif