Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement PR 292 on top of draft-06 #1641

Merged
merged 12 commits into from
Feb 28, 2024
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ else()
endif()

project(picoquic
VERSION 1.1.19.1
VERSION 1.1.19.2
DESCRIPTION "picoquic library"
LANGUAGES C CXX)

Expand Down
14 changes: 13 additions & 1 deletion UnitTest1/unittest1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ namespace UnitTest1
Assert::AreEqual(ret, 0);
}

TEST_METHOD(test_transport_param)
TEST_METHOD(transport_param)
{
int ret = transport_param_test();

Expand Down Expand Up @@ -2398,6 +2398,12 @@ namespace UnitTest1
Assert::AreEqual(ret, 0);
}

TEST_METHOD(monopath_unique) {
int ret = monopath_unique_test();

Assert::AreEqual(ret, 0);
}

TEST_METHOD(monopath_0rtt) {
int ret = monopath_0rtt_test();

Expand Down Expand Up @@ -2536,6 +2542,12 @@ namespace UnitTest1
Assert::AreEqual(ret, 0);
}

TEST_METHOD(m_unip_basic) {
int ret = m_unip_basic_test();

Assert::AreEqual(ret, 0);
}

TEST_METHOD(simple_multipath_basic) {
int ret = simple_multipath_basic_test();

Expand Down
6 changes: 6 additions & 0 deletions loglib/logconvert.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ const char * ftype2str(picoquic_frame_type_enum_t ftype)
return "streams_blocked";
case picoquic_frame_type_new_connection_id:
return "new_connection_id";
case picoquic_frame_type_mp_new_connection_id:
return "mp_new_connection_id";
case picoquic_frame_type_stop_sending:
return "stop_sending";
case picoquic_frame_type_ack:
Expand All @@ -96,6 +98,8 @@ const char * ftype2str(picoquic_frame_type_enum_t ftype)
return "ack_mp";
case picoquic_frame_type_retire_connection_id:
return "retire_connection_id";
case picoquic_frame_type_mp_retire_connection_id:
return "mp_retire_connection_id";
case picoquic_frame_type_handshake_done:
return "handshake_done";
case picoquic_frame_type_datagram:
Expand All @@ -115,6 +119,8 @@ const char * ftype2str(picoquic_frame_type_enum_t ftype)
return "path_available";
case picoquic_frame_type_bdp:
return "bdp";
case picoquic_frame_type_max_paths:
return "max_paths";
default:
return "unknown";
}
Expand Down
33 changes: 29 additions & 4 deletions loglib/qlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,13 @@ void qlog_path_available_frame(FILE* f, bytestream* s)
fprintf(f, ", \"sequence\": %"PRIu64, sequence);
}

void qlog_max_paths_frame(FILE* f, bytestream* s)
{
uint64_t max_paths = 0;
byteread_vint(s, &max_paths);
fprintf(f, ", \"max_paths\": %"PRIu64, max_paths);
}

void qlog_reset_stream_frame(FILE* f, bytestream* s)
{
uint64_t stream_id = 0;
Expand Down Expand Up @@ -940,12 +947,18 @@ void qlog_streams_blocked_frame(uint64_t ftype, FILE* f, bytestream* s)
fprintf(f, ", \"limit\": %"PRIu64"", limit);
}

void qlog_new_connection_id_frame(FILE* f, bytestream* s)
void qlog_new_connection_id_frame(uint64_t ftype, FILE* f, bytestream* s)
{
uint64_t sequence_number = 0;
uint64_t retire_before = 0;
uint64_t cid_length = 0;

if (ftype == picoquic_frame_type_mp_new_connection_id) {
uint64_t path_id;
byteread_vint(s, &path_id);
fprintf(f, ", \"path_id\": %"PRIu64"", path_id);
}

byteread_vint(s, &sequence_number);
fprintf(f, ", \"sequence_number\": %"PRIu64"", sequence_number);
byteread_vint(s, &retire_before);
Expand All @@ -957,9 +970,16 @@ void qlog_new_connection_id_frame(FILE* f, bytestream* s)
qlog_string(f, s, 16);
}

void qlog_retire_connection_id_frame(FILE* f, bytestream* s)
void qlog_retire_connection_id_frame(uint64_t ftype, FILE* f, bytestream* s)
{
uint64_t sequence_number = 0;

if (ftype == picoquic_frame_type_mp_retire_connection_id) {
uint64_t path_id = 0;
byteread_vint(s, &path_id);
fprintf(f, ", \"path_id\": %"PRIu64"", path_id);
}

byteread_vint(s, &sequence_number);
fprintf(f, ", \"sequence_number\": %"PRIu64"", sequence_number);
}
Expand Down Expand Up @@ -1212,10 +1232,12 @@ int qlog_packet_frame(bytestream * s, void * ptr)
qlog_streams_blocked_frame(ftype, f, s);
break;
case picoquic_frame_type_new_connection_id:
qlog_new_connection_id_frame(f, s);
case picoquic_frame_type_mp_new_connection_id:
qlog_new_connection_id_frame(ftype, f, s);
break;
case picoquic_frame_type_retire_connection_id:
qlog_retire_connection_id_frame(f, s);
case picoquic_frame_type_mp_retire_connection_id:
qlog_retire_connection_id_frame(ftype, f, s);
break;
case picoquic_frame_type_path_challenge:
case picoquic_frame_type_path_response:
Expand Down Expand Up @@ -1251,6 +1273,9 @@ int qlog_packet_frame(bytestream * s, void * ptr)
case picoquic_frame_type_bdp:
qlog_bdp_frame(f, s);
break;
case picoquic_frame_type_max_paths:
qlog_max_paths_frame(f, s);
break;
default:
s->ptr = ptr_before_type;
qlog_erroring_frame(f, s, ftype);
Expand Down
4 changes: 2 additions & 2 deletions picoquic/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static option_table_line_t option_table[] = {
"Use the specified congestion control algorithm: reno, cubic, bbr or fast. Defaults to bbr." },
{ picoquic_option_SPINBIT, 'P', "spinbit", 1, "number", "Set the default spinbit policy" },
{ picoquic_option_LOSSBIT, 'O', "lossbit", 1, "number", "Set the default lossbit policy" },
{ picoquic_option_MULTIPATH, 'M', "multipath", 1, "number", "Multipath option: none(0), full(1), simple(2), both(3)" },
{ picoquic_option_MULTIPATH, 'M', "multipath", 1, "number", "Multipath option: none(0), full(1), simple(2), both(3), unique(4), all (7)" },
{ picoquic_option_DEST_IF, 'e', "dest_if", 1, "if", "Send on interface (default: -1)" },
{ picoquic_option_CIPHER_SUITE, 'C', "cipher_suite", 1, "cipher_suite_id", "specify cipher suite (e.g. -C 20 = chacha20)" },
{ picoquic_option_INIT_CNXID, 'i', "cnxid_params", 1, "per-text-lb-spec", "See documentation for LB compatible CID configuration" },
Expand Down Expand Up @@ -375,7 +375,7 @@ static int config_set_option(option_table_line_t* option_desc, option_param_t* p
}
case picoquic_option_MULTIPATH: {
int v = config_atoi(params, nb_params, 0, &ret);
if (ret != 0 || v < 0 || v > 3) {
if (ret != 0 || v < 0 || v > 7) {
fprintf(stderr, "Invalid multipath option: %s\n", config_optval_param_string(opval_buffer, 256, params, nb_params, 0));
ret = (ret == 0) ? -1 : ret;
}
Expand Down
Loading
Loading