lsquic_engine_public.h revision 3b55e6ae
1/* Copyright (c) 2017 - 2018 LiteSpeed Technologies Inc.  See LICENSE. */
2/*
3 * lsquic_engine_public.h -- Engine's "public interface"
4 *
5 */
6
7#ifndef LSQUIC_ENGINE_PUBLIC_H
8#define LSQUIC_ENGINE_PUBLIC_H 1
9
10struct lsquic_conn;
11struct lsquic_engine;
12struct stack_st_X509;
13
14struct lsquic_engine_public {
15    struct lsquic_mm                enp_mm;
16    struct lsquic_engine_settings   enp_settings;
17    const struct lsquic_hset_if    *enp_hsi_if;
18    void                           *enp_hsi_ctx;
19    int                           (*enp_verify_cert)(void *verify_ctx,
20                                            struct stack_st_X509 *chain);
21    void                           *enp_verify_ctx;
22    const struct lsquic_packout_mem_if
23                                   *enp_pmi;
24    void                           *enp_pmi_ctx;
25    struct lsquic_engine           *enp_engine;
26    enum {
27        ENPUB_PROC  = (1 << 0), /* Being processed by one of the user-facing
28                                 * functions.
29                                 */
30        ENPUB_CAN_SEND = (1 << 1),
31    }                               enp_flags;
32    unsigned char                   enp_ver_tags_buf[ sizeof(lsquic_ver_tag_t) * N_LSQVER ];
33    unsigned                        enp_ver_tags_len;
34};
35
36/* Put connection onto the Tickable Queue if it is not already on it.  If
37 * connection is being destroyed, this is a no-op.
38 */
39void
40lsquic_engine_add_conn_to_tickable (struct lsquic_engine_public *,
41                                                        lsquic_conn_t *);
42
43/* Put connection onto Advisory Tick Time  Queue if it is not already on it.
44 */
45void
46lsquic_engine_add_conn_to_attq (struct lsquic_engine_public *enpub,
47                                            lsquic_conn_t *, lsquic_time_t);
48
49#endif
50