lsquic_engine_public.h revision 7f2bd84c
110c492f0SDmitri Tikhonov/* Copyright (c) 2017 - 2018 LiteSpeed Technologies Inc.  See LICENSE. */
250aadb33SDmitri Tikhonov/*
350aadb33SDmitri Tikhonov * lsquic_engine_public.h -- Engine's "public interface"
450aadb33SDmitri Tikhonov *
550aadb33SDmitri Tikhonov */
650aadb33SDmitri Tikhonov
750aadb33SDmitri Tikhonov#ifndef LSQUIC_ENGINE_PUBLIC_H
850aadb33SDmitri Tikhonov#define LSQUIC_ENGINE_PUBLIC_H 1
950aadb33SDmitri Tikhonov
1050aadb33SDmitri Tikhonovstruct lsquic_conn;
1150aadb33SDmitri Tikhonovstruct lsquic_engine;
127f2bd84cSDmitri Tikhonovstruct stack_st_X509;
1350aadb33SDmitri Tikhonov
1450aadb33SDmitri Tikhonovstruct lsquic_engine_public {
1550aadb33SDmitri Tikhonov    struct lsquic_mm                enp_mm;
1650aadb33SDmitri Tikhonov    struct lsquic_engine_settings   enp_settings;
177f2bd84cSDmitri Tikhonov    int                           (*enp_verify_cert)(void *verify_ctx,
187f2bd84cSDmitri Tikhonov                                            struct stack_st_X509 *chain);
197f2bd84cSDmitri Tikhonov    void                           *enp_verify_ctx;
2050aadb33SDmitri Tikhonov    const struct lsquic_packout_mem_if
2150aadb33SDmitri Tikhonov                                   *enp_pmi;
2250aadb33SDmitri Tikhonov    void                           *enp_pmi_ctx;
2350aadb33SDmitri Tikhonov    struct lsquic_engine           *enp_engine;
2450aadb33SDmitri Tikhonov    enum {
2550aadb33SDmitri Tikhonov        ENPUB_PROC  = (1 << 0), /* Being processed by one of the user-facing
2650aadb33SDmitri Tikhonov                                 * functions.
2750aadb33SDmitri Tikhonov                                 */
28c44946ecSDmitri Tikhonov        ENPUB_CAN_SEND = (1 << 1),
2950aadb33SDmitri Tikhonov    }                               enp_flags;
3050aadb33SDmitri Tikhonov    unsigned char                   enp_ver_tags_buf[ sizeof(lsquic_ver_tag_t) * N_LSQVER ];
3150aadb33SDmitri Tikhonov    unsigned                        enp_ver_tags_len;
3250aadb33SDmitri Tikhonov};
3350aadb33SDmitri Tikhonov
34e8bd737dSDmitri Tikhonov/* Put connection onto the Tickable Queue if it is not already on it.  If
3550aadb33SDmitri Tikhonov * connection is being destroyed, this is a no-op.
3650aadb33SDmitri Tikhonov */
3750aadb33SDmitri Tikhonovvoid
38e8bd737dSDmitri Tikhonovlsquic_engine_add_conn_to_tickable (struct lsquic_engine_public *,
39e8bd737dSDmitri Tikhonov                                                        lsquic_conn_t *);
4050aadb33SDmitri Tikhonov
4150aadb33SDmitri Tikhonov/* Put connection onto Advisory Tick Time  Queue if it is not already on it.
4250aadb33SDmitri Tikhonov */
4350aadb33SDmitri Tikhonovvoid
4450aadb33SDmitri Tikhonovlsquic_engine_add_conn_to_attq (struct lsquic_engine_public *enpub,
4550aadb33SDmitri Tikhonov                                            lsquic_conn_t *, lsquic_time_t);
4650aadb33SDmitri Tikhonov
4750aadb33SDmitri Tikhonov#endif
48