FD.io VPP  v19.04.4-rc0-5-ge88582fac
Vector Packet Processing
main.c
Go to the documentation of this file.
1 /*
2  *------------------------------------------------------------------
3  * Copyright (c) 2019 Cisco and/or its affiliates.
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at:
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *------------------------------------------------------------------
16  */
17 
18 #include <vlib/vlib.h>
19 #include <vnet/plugin/plugin.h>
20 #include <vnet/crypto/crypto.h>
22 
24 
27 {
30  clib_error_t *error;
31 
32  if ((error = vlib_call_init_function (vm, vnet_crypto_init)))
33  return error;
34 
37 
39  vnet_crypto_register_engine (vm, "ia32", 100,
40  "Intel IA32 ISA Optimized Crypto");
41 
42  if (clib_cpu_supports_x86_aes () &&
43  (error = crypto_ia32_aesni_cbc_init (vm)))
44  goto error;
45 
46 error:
47  if (error)
49 
50  return error;
51 }
52 
54 
55 #include <vpp/app/version.h>
56 
57 /* *INDENT-OFF* */
59  .version = VPP_BUILD_VER,
60  .description = "Intel IA32 Software Crypto Engine",
61 };
62 /* *INDENT-ON* */
63 
64 /*
65  * fd.io coding-style-patch-verification: ON
66  *
67  * Local Variables:
68  * eval: (c-set-style "gnu")
69  * End:
70  */
VLIB_PLUGIN_REGISTER()
#define vec_validate_aligned(V, I, A)
Make sure vector is long enough for given index (no header, specified alignment)
Definition: vec.h:450
crypto_ia32_main_t crypto_ia32_main
Definition: main.c:23
#define VLIB_INIT_FUNCTION(x)
Definition: init.h:163
#define vlib_call_init_function(vm, x)
Definition: init.h:260
vlib_main_t * vm
Definition: buffer.c:312
#define vec_free(V)
Free vector&#39;s memory (no header).
Definition: vec.h:341
crypto_ia32_per_thread_data_t * per_thread_data
Definition: crypto_ia32.h:29
clib_error_t * crypto_ia32_init(vlib_main_t *vm)
Definition: main.c:26
clib_error_t * crypto_ia32_aesni_cbc_init(vlib_main_t *vm)
Definition: aes_cbc.c:235
static vlib_thread_main_t * vlib_get_thread_main()
Definition: global_funcs.h:32
#define CLIB_CACHE_LINE_BYTES
Definition: cache.h:59
u32 vnet_crypto_register_engine(vlib_main_t *vm, char *name, int prio, char *desc)
Definition: crypto.c:78
clib_error_t * vnet_crypto_init(vlib_main_t *vm)
Definition: crypto.c:201