for (i = 0; i < num_threads; i++)
{
/* *INDENT-OFF* */
- pool_foreach (crctx, qm->wrk_ctx[i].crypto_ctx_pool, ({
+ pool_foreach (crctx, qm->wrk_ctx[i].crypto_ctx_pool) {
if (crctx->ckpair_index == ckpair->cert_key_index)
{
quic_crypto_context_make_key_from_crctx (&kv, crctx);
clib_bihash_add_del_24_8 (&qm->wrk_ctx[i].crypto_context_hash, &kv, 0 /* is_add */ );
}
- }));
+ }
/* *INDENT-ON* */
}
return 0;
for (i = 0; i < num_threads; i++)
{
/* *INDENT-OFF* */
- pool_foreach (crctx, qm->wrk_ctx[i].crypto_ctx_pool, ({
+ pool_foreach (crctx, qm->wrk_ctx[i].crypto_ctx_pool) {
vlib_cli_output (vm, "[%d][Q]%U", i, format_crypto_context, crctx);
- }));
+ }
/* *INDENT-ON* */
}
return 0;
unformat_input_t * input,
vlib_cli_command_t * cmd)
{
+ unformat_input_t _line_input, *line_input = &_line_input;
quic_main_t *qm = &quic_main;
- if (unformat_check_input (input) == UNFORMAT_END_OF_INPUT)
- return clib_error_return (0, "unknown input '%U'",
- format_unformat_error, input);
- if (unformat (input, "vpp"))
- qm->default_crypto_engine = CRYPTO_ENGINE_VPP;
- else if (unformat (input, "picotls"))
- qm->default_crypto_engine = CRYPTO_ENGINE_PICOTLS;
- else
- return clib_error_return (0, "unknown input '%U'",
- format_unformat_error, input);
- return 0;
+ clib_error_t *e = 0;
+
+ if (!unformat_user (input, unformat_line_input, line_input))
+ return 0;
+
+ while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
+ {
+ if (unformat (line_input, "vpp"))
+ qm->default_crypto_engine = CRYPTO_ENGINE_VPP;
+ else if (unformat (line_input, "picotls"))
+ qm->default_crypto_engine = CRYPTO_ENGINE_PICOTLS;
+ else
+ {
+ e = clib_error_return (0, "unknown input '%U'",
+ format_unformat_error, line_input);
+ goto done;
+ }
+ }
+done:
+ unformat_free (line_input);
+ return e;
}
u64 quic_fifosize = 0;
for (i = 0; i < num_workers + 1; i++)
{
/* *INDENT-OFF* */
- pool_foreach (ctx, qm->ctx_pool[i],
- ({
+ pool_foreach (ctx, qm->ctx_pool[i])
+ {
if (quic_ctx_is_conn (ctx) && ctx->conn)
{
quicly_get_stats (ctx->conn, &st);
}
else if (quic_ctx_is_stream (ctx))
nstream++;
- }));
+ }
/* *INDENT-ON* */
}
vlib_cli_output (vm, "-------- Connections --------");
for (int i = 0; i < num_workers + 1; i++)
{
/* *INDENT-OFF* */
- pool_foreach (ctx, qm->ctx_pool[i],
- ({
+ pool_foreach (ctx, qm->ctx_pool[i])
+ {
if (quic_ctx_is_stream (ctx) && show_stream)
vlib_cli_output (vm, "%U", quic_format_stream_ctx, ctx);
else if (quic_ctx_is_listener (ctx) && show_listeners)
vlib_cli_output (vm, "%U", quic_format_listener_ctx, ctx);
else if (quic_ctx_is_conn (ctx) && show_conn)
vlib_cli_output (vm, "%U", quic_format_connection_ctx, ctx);
- }));
+ }
/* *INDENT-ON* */
}
static clib_error_t *
quic_config_fn (vlib_main_t * vm, unformat_input_t * input)
{
+ unformat_input_t _line_input, *line_input = &_line_input;
quic_main_t *qm = &quic_main;
+ clib_error_t *error = 0;
uword tmp;
u32 i;
qm->udp_fifo_size = QUIC_DEFAULT_FIFO_SIZE;
qm->udp_fifo_prealloc = 0;
qm->connection_timeout = QUIC_DEFAULT_CONN_TIMEOUT;
- while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
+
+ if (!unformat_user (input, unformat_line_input, line_input))
+ return 0;
+
+ while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
{
if (unformat (input, "fifo-size %U", unformat_memory_size, &tmp))
{
if (tmp >= 0x100000000ULL)
{
- return clib_error_return (0,
- "fifo-size %llu (0x%llx) too large",
- tmp, tmp);
+ error = clib_error_return (0,
+ "fifo-size %llu (0x%llx) too large",
+ tmp, tmp);
+ goto done;
}
qm->udp_fifo_size = tmp;
}
else if (unformat (input, "fifo-prealloc %u", &i))
qm->udp_fifo_prealloc = i;
else
- return clib_error_return (0, "unknown input '%U'",
- format_unformat_error, input);
+ {
+ error = clib_error_return (0, "unknown input '%U'",
+ format_unformat_error, line_input);
+ goto done;
+ }
}
-
- return 0;
+done:
+ unformat_free (line_input);
+ return error;
}
VLIB_EARLY_CONFIG_FUNCTION (quic_config_fn, "quic");