summaryrefslogtreecommitdiffstats
path: root/src/vnet/crypto/cli.c
diff options
context:
space:
mode:
authorFilip Tehlar <ftehlar@cisco.com>2020-02-04 09:36:04 +0000
committerDamjan Marion <dmarion@me.com>2020-02-11 23:07:38 +0000
commitefcad1a9d22c4a664f3004cafe09d9c3a68e1620 (patch)
tree5d0668c307083f096f6034d5ae8a608078640d18 /src/vnet/crypto/cli.c
parent16d974ec59776f0103ad62d0d04dc57989eef7ed (diff)
ipsec: add support for chained buffers
Type: feature Change-Id: Ie072a7c2bbb1e4a77f7001754f01897efd30fc53 Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Diffstat (limited to 'src/vnet/crypto/cli.c')
-rw-r--r--src/vnet/crypto/cli.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/src/vnet/crypto/cli.c b/src/vnet/crypto/cli.c
index 8d523aec484..ef6371ad3dc 100644
--- a/src/vnet/crypto/cli.c
+++ b/src/vnet/crypto/cli.c
@@ -74,14 +74,24 @@ format_vnet_crypto_handlers (u8 * s, va_list * args)
od = cm->opt_data + id;
if (first == 0)
s = format (s, "\n%U", format_white_space, indent);
- s = format (s, "%-20U%-20U", format_vnet_crypto_op_type, od->type,
- format_vnet_crypto_engine, od->active_engine_index,s);
+ s = format (s, "%-22U%-20U", format_vnet_crypto_op_type, od->type, 0,
+ format_vnet_crypto_engine, od->active_engine_index_simple,s);
vec_foreach (e, cm->engines)
{
if (e->ops_handlers[id] != 0)
s = format (s, "%U ", format_vnet_crypto_engine, e - cm->engines);
}
+
+ s = format (s, "\n%U", format_white_space, indent);
+ s = format (s, "%-22U%-20U", format_vnet_crypto_op_type, od->type, 1,
+ format_vnet_crypto_engine,
+ od->active_engine_index_chained);
+ vec_foreach (e, cm->engines)
+ {
+ if (e->chained_ops_handlers[id] != 0)
+ s = format (s, "%U ", format_vnet_crypto_engine, e - cm->engines);
+ }
first = 0;
}
return s;
@@ -98,7 +108,7 @@ show_crypto_handlers_command_fn (vlib_main_t * vm,
if (unformat_user (input, unformat_line_input, line_input))
unformat_free (line_input);
- vlib_cli_output (vm, "%-20s%-20s%-20s%s", "Algo", "Type", "Active",
+ vlib_cli_output (vm, "%-20s%-22s%-20s%s", "Algo", "Type", "Active",
"Candidates");
for (i = 0; i < VNET_CRYPTO_N_ALGS; i++)
@@ -128,6 +138,7 @@ set_crypto_handler_command_fn (vlib_main_t * vm,
char **args = 0, *s, **arg, *engine = 0;
int all = 0;
clib_error_t *error = 0;
+ crypto_op_class_type_t oct = CRYPTO_OP_BOTH;
if (!unformat_user (input, unformat_line_input, line_input))
return 0;
@@ -136,6 +147,12 @@ set_crypto_handler_command_fn (vlib_main_t * vm,
{
if (unformat (line_input, "all"))
all = 1;
+ else if (unformat (line_input, "simple"))
+ oct = CRYPTO_OP_SIMPLE;
+ else if (unformat (line_input, "chained"))
+ oct = CRYPTO_OP_CHAINED;
+ else if (unformat (line_input, "both"))
+ oct = CRYPTO_OP_BOTH;
else if (unformat (line_input, "%s", &s))
vec_add1 (args, s);
else
@@ -163,7 +180,7 @@ set_crypto_handler_command_fn (vlib_main_t * vm,
hash_foreach_mem (key, value, cm->alg_index_by_name,
({
(void) value;
- rc += vnet_crypto_set_handler (key, engine);
+ rc += vnet_crypto_set_handler2 (key, engine, oct);
}));
/* *INDENT-ON* */
@@ -174,7 +191,7 @@ set_crypto_handler_command_fn (vlib_main_t * vm,
{
vec_foreach (arg, args)
{
- rc = vnet_crypto_set_handler (arg[0], engine);
+ rc = vnet_crypto_set_handler2 (arg[0], engine, oct);
if (rc)
{
vlib_cli_output (vm, "failed to set engine %s for %s!",
@@ -195,7 +212,8 @@ done:
VLIB_CLI_COMMAND (set_crypto_handler_command, static) =
{
.path = "set crypto handler",
- .short_help = "set crypto handler cipher [cipher2 cipher3 ...] engine",
+ .short_help = "set crypto handler cipher [cipher2 cipher3 ...] engine"
+ " [simple|chained]",
.function = set_crypto_handler_command_fn,
};
/* *INDENT-ON* */