2 * Copyright (c) 2018 Intel and/or its affiliates.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 #ifndef SRC_PLUGINS_TLSOPENSSL_TLS_OPENSSL_H_
17 #define SRC_PLUGINS_TLSOPENSSL_TLS_OPENSSL_H_
19 #include <openssl/ssl.h>
20 #include <openssl/conf.h>
21 #include <openssl/err.h>
22 #include <openssl/engine.h>
23 #include <vnet/plugin/plugin.h>
24 #include <vpp/app/version.h>
25 #include <vnet/tls/tls.h>
27 #define TLSO_CTRL_BYTES 1000
28 #define TLSO_MIN_ENQ_SPACE (1 << 16)
30 #define DTLSO_MAX_DGRAM 2000
32 typedef struct tls_ctx_openssl_
34 tls_ctx_t ctx; /**< First */
35 u32 openssl_ctx_index;
42 typedef struct tls_listen_ctx_opensl_
44 u32 openssl_lctx_index;
49 } openssl_listen_ctx_t;
51 typedef struct openssl_main_
53 openssl_ctx_t ***ctx_pool;
54 openssl_listen_ctx_t *lctx_pool;
59 /* API message ID base */
62 X509_STORE *cert_store;
68 typedef int openssl_resume_handler (tls_ctx_t * ctx, session_t * tls_session);
70 tls_ctx_t *openssl_ctx_get_w_thread (u32 ctx_index, u8 thread_index);
71 int vpp_tls_async_init_event (tls_ctx_t * ctx,
72 openssl_resume_handler * handler,
74 int vpp_tls_async_update_event (tls_ctx_t * ctx, int eagain);
75 int tls_async_openssl_callback (SSL * s, void *evt);
76 int openssl_evt_free (int event_idx, u8 thread_index);
77 void openssl_polling_start (ENGINE * engine);
78 int openssl_engine_register (char *engine, char *alg, int async);
79 void openssl_async_node_enable_disable (u8 is_en);
80 clib_error_t *tls_openssl_api_init (vlib_main_t * vm);
81 int tls_openssl_set_ciphers (char *ciphers);
82 int vpp_openssl_is_inflight (tls_ctx_t * ctx);
84 #endif /* SRC_PLUGINS_TLSOPENSSL_TLS_OPENSSL_H_ */
87 * fd.io coding-style-patch-verification: ON
90 * eval: (c-set-style "gnu")