35 ops[0]->
status = VNET_CRYPTO_OP_STATUS_FAIL_NO_HANDLER;
57 for (
i = 0;
i < n_ops;
i++)
61 if (current_op_type != opt || n_op_queue >= op_q_size)
64 op_queue, n_op_queue);
66 current_op_type = opt;
69 op_queue[n_op_queue++] = &ops[
i];
73 op_queue, n_op_queue);
172 eopt = VNET_CRYPTO_OP_TYPE_AEAD_ENCRYPT;
173 dopt = VNET_CRYPTO_OP_TYPE_AEAD_DECRYPT;
177 eopt = VNET_CRYPTO_OP_TYPE_ENCRYPT;
178 dopt = VNET_CRYPTO_OP_TYPE_DECRYPT;
211 vnet_crypto_init_cipher_data (VNET_CRYPTO_ALG_##n, \ 212 VNET_CRYPTO_OP_##n##_ENC, \ 213 VNET_CRYPTO_OP_##n##_DEC, s, 0); 217 vnet_crypto_init_cipher_data (VNET_CRYPTO_ALG_##n, \ 218 VNET_CRYPTO_OP_##n##_ENC, \ 219 VNET_CRYPTO_OP_##n##_DEC, s, 1); 223 vnet_crypto_init_hmac_data (VNET_CRYPTO_ALG_HMAC_##n, \ 224 VNET_CRYPTO_OP_##n##_HMAC, "hmac-" s); u32 vnet_crypto_process_ops(vlib_main_t *vm, vnet_crypto_op_t ops[], u32 n_ops)
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
vnet_crypto_engine_t * engines
vnet_crypto_thread_t * threads
uword * alg_index_by_name
vnet_crypto_op_data_t opt_data[VNET_CRYPTO_N_OP_IDS]
vnet_crypto_alg_data_t * algs
vnet_crypto_op_id_t op_by_type[VNET_CRYPTO_OP_N_TYPES]
#define vec_add2(V, P, N)
Add N elements to end of vector V, return pointer to new elements in P.
#define hash_set_mem(h, key, value)
#define vec_validate_aligned(V, I, A)
Make sure vector is long enough for given index (no header, specified alignment)
static void vnet_crypto_init_hmac_data(vnet_crypto_alg_t alg, vnet_crypto_op_id_t id, char *name)
#define static_always_inline
#define VLIB_INIT_FUNCTION(x)
#define foreach_crypto_aead_alg
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
#define foreach_crypto_hmac_alg
#define hash_create_string(elts, value_bytes)
int vnet_crypto_set_handler(char *alg_name, char *engine)
vlib_error_t * vnet_crypto_register_ops_handler(vlib_main_t *vm, u32 engine_index, vnet_crypto_op_id_t opt, vnet_crypto_ops_handler_t *fn)
u32() vnet_crypto_ops_handler_t(vlib_main_t *vm, vnet_crypto_op_t *ops[], u32 n_ops)
uword * engine_index_by_name
static void vnet_crypto_init_cipher_data(vnet_crypto_alg_t alg, vnet_crypto_op_id_t eid, vnet_crypto_op_id_t did, char *name, u8 is_aead)
vnet_crypto_op_type_t type
static_always_inline u32 vnet_crypto_process_ops_call_handler(vlib_main_t *vm, vnet_crypto_main_t *cm, vnet_crypto_op_id_t opt, vnet_crypto_op_t *ops[], u32 n_ops)
#define hash_get_mem(h, key)
vnet_crypto_ops_handler_t * ops_handlers[VNET_CRYPTO_N_OP_IDS]
vnet_crypto_op_status_t status
static vlib_thread_main_t * vlib_get_thread_main()
vnet_crypto_ops_handler_t ** ops_handlers
#define CLIB_CACHE_LINE_BYTES
u32 vnet_crypto_register_engine(vlib_main_t *vm, char *name, int prio, char *desc)
vnet_crypto_main_t crypto_main
clib_error_t * vnet_crypto_init(vlib_main_t *vm)
#define foreach_crypto_cipher_alg