14 #include <sys/types.h> 29 #define LSENG_SERVER (1 << 0) 34 #define LSENG_HTTP (1 << 1) 36 #define LSENG_HTTP_SERVER (LSENG_SERVER|LSENG_HTTP) 81 #define LSQUIC_SUPPORTED_VERSIONS ((1 << LSQVER_035) | (1 << LSQVER_037) | \ 82 (1 << LSQVER_038) | (1 << LSQVER_039) | (1 << LSQVER_041)) 84 #define LSQUIC_EXPERIMENTAL_VERSIONS ((1 << LSQVER_041)) 127 #define LSQUIC_MIN_FCW (16 * 1024) 136 #define LSQUIC_DF_VERSIONS (LSQUIC_SUPPORTED_VERSIONS & \ 137 ~LSQUIC_EXPERIMENTAL_VERSIONS) 139 #define LSQUIC_DF_CFCW_SERVER (3 * 1024 * 1024 / 2) 140 #define LSQUIC_DF_CFCW_CLIENT (15 * 1024 * 1024) 141 #define LSQUIC_DF_SFCW_SERVER (1 * 1024 * 1024) 142 #define LSQUIC_DF_SFCW_CLIENT (6 * 1024 * 1024) 143 #define LSQUIC_DF_MAX_STREAMS_IN 100 148 #define LSQUIC_DF_HANDSHAKE_TO (10 * 1000 * 1000) 150 #define LSQUIC_DF_IDLE_CONN_TO (30 * 1000 * 1000) 151 #define LSQUIC_DF_SILENT_CLOSE 1 157 #define LSQUIC_DF_MAX_HEADER_LIST_SIZE 0 160 #define LSQUIC_DF_UA "LSQUIC" 162 #define LSQUIC_DF_STTL 86400 163 #define LSQUIC_DF_MAX_INCHOATE (1 * 1000 * 1000) 164 #define LSQUIC_DF_SUPPORT_SREJ_SERVER 1 165 #define LSQUIC_DF_SUPPORT_SREJ_CLIENT 0 167 #define LSQUIC_DF_SUPPORT_NSTP 0 168 #define LSQUIC_DF_SUPPORT_PUSH 1 169 #define LSQUIC_DF_SUPPORT_TCID0 1 171 #define LSQUIC_DF_HONOR_PRST 0 174 #define LSQUIC_DF_PROGRESS_CHECK 1000 177 #define LSQUIC_DF_PENDRW_CHECK 10 180 #define LSQUIC_DF_RW_ONCE 0 183 #define LSQUIC_DF_PROC_TIME_THRESH 0 186 #define LSQUIC_DF_PACE_PACKETS 1 233 unsigned es_max_sfcw;
392 unsigned lsquic_engine_flags);
412 unsigned lsquic_engine_flags,
413 char *err_buf,
size_t err_buf_sz);
417 const unsigned char *buf;
419 const struct sockaddr *local_sa;
420 const struct sockaddr *dest_sa;
429 void *packets_out_ctx,
431 unsigned n_packets_out
445 void * (*pmi_allocate) (
void *pmi_ctx,
size_t sz);
446 void (*pmi_release) (
void *pmi_ctx,
void *obj);
454 void *ea_stream_if_ctx;
456 void *ea_packets_out_ctx;
481 void *peer_ctx,
const char *hostname,
482 unsigned short max_packet_size);
496 const unsigned char *packet_in_data,
size_t packet_in_size,
497 const struct sockaddr *sa_local,
const struct sockaddr *sa_peer,
599 ssize_t lsquic_stream_writev(
lsquic_stream_t *s,
const struct iovec *vec,
int count);
612 size_t (*lsqr_read) (
void *lsqr_ctx,
void *buf,
size_t count);
616 size_t (*lsqr_size) (
void *lsqr_ctx);
659 lsquic_http_header_t *headers;
711 const char **headers,
size_t *headers_sz);
731 lsquic_conn_get_stream_by_id (
lsquic_conn_t *c, uint32_t stream_id);
738 const struct sockaddr **local,
const struct sockaddr **peer);
741 int (*vprintf)(
void *logger_ctx,
const char *fmt, va_list args);
816 #define LSQUIC_GLOBAL_CLIENT (1 << 0) 822 #define LSQUIC_GLOBAL_SERVER (1 << 1) 897 #endif //__LSQUIC_H__ int lsquic_engine_has_pend_rw(lsquic_engine_t *)
void lsquic_global_cleanup(void)
unsigned es_max_cfcw
Definition: lsquic.h:231
unsigned lsquic_engine_quic_versions(const lsquic_engine_t *)
const char * es_ua
Definition: lsquic.h:261
void lsquic_engine_send_unsent_packets(lsquic_engine_t *engine)
unsigned es_pendrw_check
Definition: lsquic.h:344
int lsquic_engine_earliest_adv_tick(lsquic_engine_t *engine, int *diff)
int es_support_tcid0
Definition: lsquic.h:293
int lsquic_stream_is_pushed(const lsquic_stream_t *s)
unsigned long es_handshake_to
Definition: lsquic.h:245
ssize_t lsquic_stream_write(lsquic_stream_t *s, const void *buf, size_t len)
unsigned es_max_streams_in
Definition: lsquic.h:236
int lsquic_set_log_level(const char *log_level)
The definition of callback functions call by lsquic_stream to process events.
Definition: lsquic.h:92
void lsquic_engine_process_conns_with_incoming(lsquic_engine_t *)
unsigned lsquic_engine_count_attq(lsquic_engine_t *engine, int from_now)
unsigned es_cfcw
Definition: lsquic.h:209
uint64_t lsquic_cid_t
Definition: lsquic_types.h:15
lsquic_stream_ctx_t * lsquic_stream_get_ctx(const lsquic_stream_t *s)
unsigned es_versions
Definition: lsquic.h:197
unsigned lsquic_conn_cancel_pending_streams(lsquic_conn_t *, unsigned n)
unsigned long es_idle_conn_to
Definition: lsquic.h:248
enum lsquic_version lsquic_str2ver(const char *str, size_t len)
struct lsquic_conn lsquic_conn_t
Definition: lsquic_types.h:21
int es_support_nstp
Definition: lsquic.h:305
int lsquic_stream_push_info(const lsquic_stream_t *, uint32_t *ref_stream_id, const char **headers, size_t *headers_sz)
lsquic_logger_timestamp_style
Definition: lsquic.h:747
int lsquic_engine_packet_in(lsquic_engine_t *, const unsigned char *packet_in_data, size_t packet_in_size, const struct sockaddr *sa_local, const struct sockaddr *sa_peer, void *peer_ctx)
unsigned es_proc_time_thresh
Definition: lsquic.h:378
void lsquic_engine_proc_all(lsquic_engine_t *engine)
int lsquic_stream_set_priority(lsquic_stream_t *s, unsigned priority)
int es_silent_close
Definition: lsquic.h:251
int es_honor_prst
Definition: lsquic.h:312
void lsquic_engine_process_conns_to_tick(lsquic_engine_t *)
unsigned es_max_header_list_size
Definition: lsquic.h:258
int lsquic_engine_check_settings(const struct lsquic_engine_settings *settings, unsigned lsquic_engine_flags, char *err_buf, size_t err_buf_sz)
int es_rw_once
Definition: lsquic.h:358
lsquic_version
Definition: lsquic.h:42
int lsquic_global_init(int flags)
int lsquic_engine_connect(lsquic_engine_t *, const struct sockaddr *peer_sa, void *peer_ctx, const char *hostname, unsigned short max_packet_size)
struct lsquic_engine lsquic_engine_t
Definition: lsquic_types.h:18
int lsquic_stream_refuse_push(lsquic_stream_t *s)
int es_support_srej
Definition: lsquic.h:272
lsquic_conn_ctx_t * lsquic_conn_get_ctx(const lsquic_conn_t *c)
void lsquic_logger_init(const struct lsquic_logger_if *, void *logger_ctx, enum lsquic_logger_timestamp_style)
int(* lsquic_packets_out_f)(void *packets_out_ctx, const struct lsquic_out_spec *out_spec, unsigned n_packets_out)
Definition: lsquic.h:428
ssize_t lsquic_stream_writef(lsquic_stream_t *, struct lsquic_reader *)
unsigned es_sfcw
Definition: lsquic.h:221
int es_pace_packets
Definition: lsquic.h:385
int lsquic_stream_shutdown(lsquic_stream_t *s, int how)
lsquic_engine_t * lsquic_engine_new(unsigned lsquic_engine_flags, const struct lsquic_engine_api *)
int lsquic_stream_flush(lsquic_stream_t *s)
lsquic_cid_t lsquic_conn_id(const lsquic_conn_t *c)
void * lsquic_conn_get_peer_ctx(const lsquic_conn_t *lconn)
unsigned lsquic_stream_priority(const lsquic_stream_t *s)
struct lsquic_http_header lsquic_http_header_t
HTTP header structure. Contains header name and value.
int lsquic_logger_lopt(const char *optarg)
const struct lsquic_packout_mem_if * ea_pmi
Definition: lsquic.h:460
struct lsquic_conn_ctx lsquic_conn_ctx_t
Definition: lsquic_types.h:24
struct lsquic_stream_ctx lsquic_stream_ctx_t
Definition: lsquic_types.h:30
void lsquic_engine_process_conns_with_pend_rw(lsquic_engine_t *)
struct lsquic_stream lsquic_stream_t
Definition: lsquic_types.h:27
lsquic_conn_t * lsquic_stream_conn(const lsquic_stream_t *s)
int lsquic_engine_has_unsent_packets(lsquic_engine_t *engine)
void lsquic_conn_going_away(lsquic_conn_t *conn)
enum lsquic_version lsquic_conn_quic_version(const lsquic_conn_t *c)
void lsquic_conn_close(lsquic_conn_t *conn)
uint32_t lsquic_stream_id(const lsquic_stream_t *s)
void(* on_goaway_received)(lsquic_conn_t *c)
Definition: lsquic.h:104
unsigned es_progress_check
Definition: lsquic.h:327
int es_support_push
Definition: lsquic.h:284
unsigned lsquic_conn_n_pending_streams(const lsquic_conn_t *)
void lsquic_conn_abort(lsquic_conn_t *c)