1*e7be843bSPierre Pronchery /* 2*e7be843bSPierre Pronchery * Copyright 2023 The OpenSSL Project Authors. All Rights Reserved. 3*e7be843bSPierre Pronchery * 4*e7be843bSPierre Pronchery * Licensed under the Apache License 2.0 (the "License"). You may not use 5*e7be843bSPierre Pronchery * this file except in compliance with the License. You can obtain a copy 6*e7be843bSPierre Pronchery * in the file LICENSE in the source distribution or at 7*e7be843bSPierre Pronchery * https://www.openssl.org/source/license.html 8*e7be843bSPierre Pronchery */ 9*e7be843bSPierre Pronchery 10*e7be843bSPierre Pronchery #ifndef OSSL_QUIC_ENGINE_LOCAL_H 11*e7be843bSPierre Pronchery # define OSSL_QUIC_ENGINE_LOCAL_H 12*e7be843bSPierre Pronchery 13*e7be843bSPierre Pronchery # include "internal/quic_engine.h" 14*e7be843bSPierre Pronchery # include "internal/quic_reactor.h" 15*e7be843bSPierre Pronchery 16*e7be843bSPierre Pronchery # ifndef OPENSSL_NO_QUIC 17*e7be843bSPierre Pronchery 18*e7be843bSPierre Pronchery /* 19*e7be843bSPierre Pronchery * QUIC Engine Structure 20*e7be843bSPierre Pronchery * ===================== 21*e7be843bSPierre Pronchery * 22*e7be843bSPierre Pronchery * QUIC engine internals. It is intended that only the QUIC_ENGINE, QUIC_PORT 23*e7be843bSPierre Pronchery * and QUIC_CHANNEL implementations be allowed to access this structure 24*e7be843bSPierre Pronchery * directly. 25*e7be843bSPierre Pronchery * 26*e7be843bSPierre Pronchery * Other components should not include this header. 27*e7be843bSPierre Pronchery */ 28*e7be843bSPierre Pronchery DECLARE_LIST_OF(port, QUIC_PORT); 29*e7be843bSPierre Pronchery 30*e7be843bSPierre Pronchery struct quic_engine_st { 31*e7be843bSPierre Pronchery /* All objects in a QUIC event domain share the same (libctx, propq). */ 32*e7be843bSPierre Pronchery OSSL_LIB_CTX *libctx; 33*e7be843bSPierre Pronchery const char *propq; 34*e7be843bSPierre Pronchery 35*e7be843bSPierre Pronchery /* 36*e7be843bSPierre Pronchery * Master synchronisation mutex for the entire QUIC event domain. Used for 37*e7be843bSPierre Pronchery * thread assisted mode synchronisation. We don't own this; the instantiator 38*e7be843bSPierre Pronchery * of the engine passes it to us and is responsible for freeing it after 39*e7be843bSPierre Pronchery * engine destruction. 40*e7be843bSPierre Pronchery */ 41*e7be843bSPierre Pronchery CRYPTO_MUTEX *mutex; 42*e7be843bSPierre Pronchery 43*e7be843bSPierre Pronchery /* Callback used to get the current time. */ 44*e7be843bSPierre Pronchery OSSL_TIME (*now_cb)(void *arg); 45*e7be843bSPierre Pronchery void *now_cb_arg; 46*e7be843bSPierre Pronchery 47*e7be843bSPierre Pronchery /* Asynchronous I/O reactor. */ 48*e7be843bSPierre Pronchery QUIC_REACTOR rtor; 49*e7be843bSPierre Pronchery 50*e7be843bSPierre Pronchery /* List of all child ports. */ 51*e7be843bSPierre Pronchery OSSL_LIST(port) port_list; 52*e7be843bSPierre Pronchery 53*e7be843bSPierre Pronchery /* Inhibit tick for testing purposes? */ 54*e7be843bSPierre Pronchery unsigned int inhibit_tick : 1; 55*e7be843bSPierre Pronchery }; 56*e7be843bSPierre Pronchery 57*e7be843bSPierre Pronchery # endif 58*e7be843bSPierre Pronchery 59*e7be843bSPierre Pronchery #endif 60