diff options
Diffstat (limited to 'src/plugins/hs_apps')
-rw-r--r-- | src/plugins/hs_apps/sapi/vpp_echo_bapi.c | 1 | ||||
-rw-r--r-- | src/plugins/hs_apps/sapi/vpp_echo_common.h | 2 | ||||
-rw-r--r-- | src/plugins/hs_apps/sapi/vpp_echo_proto_quic.c | 10 |
3 files changed, 13 insertions, 0 deletions
diff --git a/src/plugins/hs_apps/sapi/vpp_echo_bapi.c b/src/plugins/hs_apps/sapi/vpp_echo_bapi.c index 955d60697d9..04eba24156c 100644 --- a/src/plugins/hs_apps/sapi/vpp_echo_bapi.c +++ b/src/plugins/hs_apps/sapi/vpp_echo_bapi.c @@ -167,6 +167,7 @@ echo_send_connect (echo_main_t * em, void *args) mp->parent_handle = a->parent_session_handle; mp->ckpair_index = em->ckpair_index; mp->crypto_engine = em->crypto_engine; + mp->flags = em->connect_flag; app_send_ctrl_evt_to_vpp (mq, app_evt); } diff --git a/src/plugins/hs_apps/sapi/vpp_echo_common.h b/src/plugins/hs_apps/sapi/vpp_echo_common.h index 5588b279327..617acac9af9 100644 --- a/src/plugins/hs_apps/sapi/vpp_echo_common.h +++ b/src/plugins/hs_apps/sapi/vpp_echo_common.h @@ -94,6 +94,7 @@ _(ECHO_FAIL_MISSING_START_EVENT, "ECHO_FAIL_MISSING_START_EVENT") \ _(ECHO_FAIL_MISSING_END_EVENT, "ECHO_FAIL_MISSING_END_EVENT") \ _(ECHO_FAIL_TEST_ASSERT_RX_TOTAL, "ECHO_FAIL_TEST_ASSERT_RX_TOTAL") \ + _(ECHO_FAIL_UNIDIRECTIONAL, "ECHO_FAIL_UNIDIRECTIONAL") \ _(ECHO_FAIL_TEST_ASSERT_TX_TOTAL, "ECHO_FAIL_TEST_ASSERT_TX_TOTAL") \ _(ECHO_FAIL_TEST_ASSERT_ALL_SESSIONS_CLOSED, \ "ECHO_FAIL_TEST_ASSERT_ALL_SESSIONS_CLOSED") \ @@ -317,6 +318,7 @@ typedef struct u32 evt_q_size; /* Size of the vpp MQ (app<->vpp events) */ u32 ckpair_index; /* Cert key pair used */ u8 crypto_engine; /* crypto engine used */ + u8 connect_flag; /* flags to pass to mq connect */ u8 *appns_id; u64 appns_flags; diff --git a/src/plugins/hs_apps/sapi/vpp_echo_proto_quic.c b/src/plugins/hs_apps/sapi/vpp_echo_proto_quic.c index 55fd89097f2..5da81ccf4e9 100644 --- a/src/plugins/hs_apps/sapi/vpp_echo_proto_quic.c +++ b/src/plugins/hs_apps/sapi/vpp_echo_proto_quic.c @@ -370,6 +370,12 @@ quic_echo_accepted_cb (session_accepted_msg_t * mp, echo_session_t * session) if (em->stats.accepted_count.s % LOGGING_BATCH == 0) ECHO_LOG (0, "Accepted S %d / %d", em->stats.accepted_count.s, em->n_clients); + + if (em->connect_flag && !(mp->flags & em->connect_flag)) + { + ECHO_FAIL (ECHO_FAIL_UNIDIRECTIONAL, + "expected unidirectional streams"); + } } if (em->n_clients_connected == em->n_clients @@ -448,11 +454,14 @@ quic_echo_unformat_setup_vft (unformat_input_t * input, va_list * args) static int quic_echo_process_opts_cb (unformat_input_t * a) { + echo_main_t *em = &echo_main; quic_echo_proto_main_t *eqm = &quic_echo_proto_main; if (unformat (a, "quic-streams %d", &eqm->n_stream_clients)) ; else if (unformat (a, "quic-setup %U", quic_echo_unformat_setup_vft)) ; + else if (unformat (a, "uni")) + em->connect_flag = SESSION_F_UNIDIRECTIONAL; else if (unformat (a, "qclose=%U", echo_unformat_close, &eqm->send_quic_disconnects)) ; @@ -503,6 +512,7 @@ quic_echo_print_usage_cb () " OPT=default : Client open N connections.\n" " On each one client opens M streams\n" " qclose=[Y|N|W] When connection is done send[Y]|nop[N]|wait[W] for close\n" + " uni Use unidirectional streams\n" "\n" " quic-streams N Open N QUIC streams (defaults to 1)\n"); } |