From 9d9cde973430cfc91976a8c293dcfa3f302b7af4 Mon Sep 17 00:00:00 2001 From: Sijie Yang Date: Fri, 5 Jan 2024 07:51:24 +0800 Subject: [PATCH] Add `-A` option to specify congestion control algorithm for tools (#487) --- bin/prog.c | 8 ++++++++ bin/prog.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/bin/prog.c b/bin/prog.c index b779f92..915e848 100644 --- a/bin/prog.c +++ b/bin/prog.c @@ -171,6 +171,11 @@ prog_print_common_options (const struct prog *prog, FILE *out) " sndbuf=12345 # Sets SO_SNDBUF\n" " rcvbuf=12345 # Sets SO_RCVBUF\n" " -W Use stock PMI (malloc & free)\n" +" -A CC_ALGO Congestion control algorithm. The following algorithms are\n" +" supported.\n" +" 1: Cubic\n" +" 2: BBRv1\n" +" 3: Adaptive congestion control (this is the default).\n" ); #if HAVE_SENDMMSG @@ -266,6 +271,9 @@ prog_set_opt (struct prog *prog, int opt, const char *arg) case 'W': prog->prog_use_stock_pmi = 1; return 0; + case 'A': + prog->prog_settings.es_cc_algo = atoi(optarg); + return 0; case 'c': if (prog->prog_engine_flags & LSENG_SERVER) { diff --git a/bin/prog.h b/bin/prog.h index 1638d23..4f080b4 100644 --- a/bin/prog.h +++ b/bin/prog.h @@ -74,7 +74,7 @@ prog_init (struct prog *, unsigned lsquic_engine_flags, struct sport_head *, # define IP_DONTFRAG_FLAG "" #endif -#define PROG_OPTS "i:km:c:y:L:l:o:H:s:S:Y:z:G:W" RECVMMSG_FLAG SENDMMSG_FLAG \ +#define PROG_OPTS "i:km:c:y:L:l:o:H:s:S:Y:z:G:WA:" RECVMMSG_FLAG SENDMMSG_FLAG \ IP_DONTFRAG_FLAG /* Returns: