FD.io VPP  v20.01-48-g3e0dafb74
Vector Packet Processing
tls_openssl_api.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018 Cisco 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:
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
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.
14  */
15 
16 #include <vnet/vnet.h>
17 #include <vlibapi/api.h>
18 #include <vlibmemory/api.h>
19 #include <vpp/app/version.h>
20 #include <tlsopenssl/tls_openssl.h>
21 
22 /* define message IDs */
23 #include <tlsopenssl/tls_openssl.api_enum.h>
24 #include <tlsopenssl/tls_openssl.api_types.h>
25 
26 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__)
27 
28 #define REPLY_MSG_ID_BASE om->msg_id_base
30 
32 
33 /* API message handler */
34 static void
36 {
37  vl_api_tls_openssl_set_engine_reply_t *rmp;
39  char *engine, *alg;
40  char *ciphers;
41  int rv;
42 
43  if (mp->async_enable)
44  {
45  om->async = 1;
47  }
48 
49  ciphers = (char *) &mp->ciphers;
50  ciphers[63] = '\0';
51  if (ciphers[0])
52  tls_openssl_set_ciphers (ciphers);
53 
54  engine = (char *) mp->engine;
55  engine[63] = '\0';
56  alg = (char *) mp->algorithm;
57  alg[63] = '\0';
58  rv = openssl_engine_register (engine, alg);
59 
60  REPLY_MACRO (VL_API_TLS_OPENSSL_SET_ENGINE_REPLY);
61 }
62 
63 #include <tlsopenssl/tls_openssl.api.c>
66 {
68 
69  /* Ask for a correctly-sized block of API message decode slots */
71 
72  return 0;
73 }
74 
75 /*
76  * fd.io coding-style-patch-verification: ON
77  *
78  * Local Variables:
79  * eval: (c-set-style "gnu")
80  * End:
81  */
void openssl_async_node_enable_disable(u8 is_en)
Definition: tls_async.c:426
int tls_openssl_set_ciphers(char *ciphers)
Definition: tls_openssl.c:862
static void vl_api_tls_openssl_set_engine_t_handler(vl_api_tls_openssl_set_engine_t *mp)
clib_error_t * tls_openssl_api_init(vlib_main_t *vm)
int openssl_engine_register(char *engine_name, char *algorithm)
Definition: tls_async.c:124
#define REPLY_MACRO(t)
vlib_main_t * vm
Definition: in2out_ed.c:1810
openssl_main_t openssl_main
Definition: tls_openssl.c:32
static void setup_message_id_table(snat_main_t *sm, api_main_t *am)
Definition: nat_api.c:3410