aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/tcp/tcp.c')
-rw-r--r--src/vnet/tcp/tcp.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c
index 2511a176e00..25c2615b101 100644
--- a/src/vnet/tcp/tcp.c
+++ b/src/vnet/tcp/tcp.c
@@ -1448,6 +1448,29 @@ unformat_tcp_cc_algo (unformat_input_t * input, va_list * va)
return 1;
}
+uword
+unformat_tcp_cc_algo_cfg (unformat_input_t * input, va_list * va)
+{
+ tcp_main_t *tm = vnet_get_tcp_main ();
+ tcp_cc_algorithm_t *cc_alg;
+ unformat_input_t sub_input;
+ int found = 0;
+
+ vec_foreach (cc_alg, tm->cc_algos)
+ {
+ if (!unformat (input, cc_alg->name))
+ continue;
+
+ if (cc_alg->unformat_cfg
+ && unformat (input, "%U", unformat_vlib_cli_sub_input, &sub_input))
+ {
+ if (cc_alg->unformat_cfg (&sub_input))
+ found = 1;
+ }
+ }
+ return found;
+}
+
static clib_error_t *
tcp_config_fn (vlib_main_t * vm, unformat_input_t * input)
{
@@ -1472,6 +1495,8 @@ tcp_config_fn (vlib_main_t * vm, unformat_input_t * input)
else if (unformat (input, "cc-algo %U", unformat_tcp_cc_algo,
&tm->cc_algo))
;
+ else if (unformat (input, "%U", unformat_tcp_cc_algo_cfg))
+ ;
else
return clib_error_return (0, "unknown input `%U'",
format_unformat_error, input);