21 typedef struct _quic_echo_cb_vft
64 ECHO_LOG (0,
"Qsession 0x%llx connected to %U:%d",
66 mp->
lcl.is_ip4, clib_net_to_host_u16 (mp->
lcl.port));
72 static u32 client_index = 0;
87 "Got a wrong connected on session %u [%lx]", session_index,
94 static u32 client_index = 0;
123 "Got a wrong accept on session %u [%lx]", session_index,
132 ECHO_LOG (0,
"Accepted session from: %s:%d", ip_str,
133 clib_net_to_host_u16 (mp->
rmt.port));
152 .quic_connected_cb = NULL,
208 ECHO_LOG (1,
"Cleanup sessions (still %uQ %uS)",
226 if (s->session_type == ECHO_SESSION_TYPE_QUIC)
228 if (eqm->send_quic_disconnects == ECHO_CLOSE_F_ACTIVE)
230 ECHO_LOG (1,
"ACTIVE close 0x%lx", s->vpp_session_handle);
231 echo_send_rpc (em, echo_send_disconnect_session, (void *) s->vpp_session_handle, 0);
232 clib_atomic_fetch_add (&em->stats.active_count.q, 1);
234 else if (eqm->send_quic_disconnects == ECHO_CLOSE_F_NONE)
236 ECHO_LOG (1,
"Discard close 0x%lx", s->vpp_session_handle);
237 quic_echo_cleanup_cb (s, 0 );
238 clib_atomic_fetch_add (&em->stats.clean_count.q, 1);
241 ECHO_LOG (1,
"Passive close 0x%lx", s->vpp_session_handle);
259 if (eqm->
cb_vft.quic_connected_cb)
260 eqm->
cb_vft.quic_connected_cb (mp, session->session_index);
272 eqm->
cb_vft.server_stream_connected_cb (mp, session->session_index);
274 eqm->
cb_vft.client_stream_connected_cb (mp, session->session_index);
309 ECHO_LOG (1,
"Retrying connect %s", uri);
316 u32 session_index,
u8 is_failed)
336 if (eqm->
cb_vft.quic_accepted_cb)
337 eqm->
cb_vft.quic_accepted_cb (mp, session->session_index);
346 eqm->
cb_vft.server_stream_accepted_cb (mp, session->session_index);
348 eqm->
cb_vft.client_stream_accepted_cb (mp, session->session_index);
416 if (
unformat (input,
"serverstream"))
418 else if (
unformat (input,
"default"))
476 "-- QUIC specific options -- \n" 477 " quic-setup OPT OPT=serverstream : Client open N connections. \n" 478 " On each one server opens M streams\n" 479 " OPT=default : Client open N connections.\n" 480 " On each one client opens M streams\n" 481 " qclose=[Y|N|W] When a connection is done pass[N] send[Y] or wait[W] for close\n" 483 " nclients N[/M] Open N QUIC connections, each one with M streams (M defaults to 1)\n");
volatile u64 accepted_session_count
static void quic_echo_disconnected_reply_cb(echo_session_t *s)
static void quic_echo_on_accept_connect(session_accepted_msg_t *mp, u32 session_index)
static void quic_echo_on_connected(session_connected_msg_t *mp, u32 session_index)
teardown_stat_t clean_count
echo_session_t * sessions
static void quic_echo_set_defaults_after_opts_cb()
static const quic_echo_cb_vft_t server_stream_cb_vft
static void quic_echo_disconnected_cb(session_disconnected_msg_t *mp, echo_session_t *s)
static void quic_echo_connected_cb(session_connected_bundled_msg_t *mp, u32 session_index, u8 is_failed)
volatile connection_state_t state
quic_echo_cb_vft_t cb_vft
ECHO_REGISTER_PROTO(TRANSPORT_PROTO_QUIC, quic_echo_proto_cb_vft)
void echo_send_disconnect_session(u64 handle, u32 opaque)
foreach_app_session_field u64 vpp_session_handle
volatile u32 n_clients_connected
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
quic_echo_proto_main_t quic_echo_proto_main
#define ECHO_FAIL(fail, _fmt, _args...)
static void quic_echo_reset_cb(session_reset_msg_t *mp, echo_session_t *s)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static const quic_echo_cb_vft_t default_cb_vft
static void quic_echo_accepted_cb(session_accepted_msg_t *mp, echo_session_t *session)
static uword quic_echo_unformat_setup_vft(unformat_input_t *input, va_list *args)
static void quic_echo_initiate_qsession_close_no_stream(echo_main_t *em)
volatile u32 n_quic_clients_connected
static void quic_echo_on_accept_error(session_accepted_msg_t *mp, u32 session_index)
#define SESSION_INVALID_INDEX
#define clib_atomic_sub_fetch(a, b)
void echo_send_connect(u8 *uri, u32 opaque)
static void quic_echo_on_connected_error(session_connected_msg_t *mp, u32 session_index)
static void quic_echo_cleanup_cb(echo_session_t *s, u8 parent_died)
static void quic_echo_print_usage_cb()
#define ECHO_LOG(lvl, _fmt, _args...)
void echo_notify_event(echo_main_t *em, echo_test_evt_t e)
u32 *volatile data_thread_args
struct _quic_echo_cb_vft quic_echo_cb_vft_t
teardown_stat_t reset_count
static void quic_echo_on_connected_connect(session_connected_msg_t *mp, u32 session_index)
static int quic_echo_process_opts_cb(unformat_input_t *a)
static void quic_echo_retry_connect(u32 session_index)
#define clib_atomic_fetch_add(a, b)
static void quic_echo_on_accept_log_ip(session_accepted_msg_t *mp, u32 session_index)
teardown_stat_t close_count
volatile u64 bytes_to_receive
teardown_stat_t active_count
static void quic_echo_set_defaults_before_opts_cb()
static void quic_echo_on_accept_recv(session_accepted_msg_t *mp, u32 session_index)
int echo_send_rpc(echo_main_t *em, void *fp, void *arg, u32 opaque)
void echo_session_print_stats(echo_main_t *em, echo_session_t *session)
struct echo_main_t::@481 stats
static void quic_echo_cleanup_listener(u32 listener_index, echo_main_t *em, quic_echo_proto_main_t *eqm)
uword echo_unformat_close(unformat_input_t *input, va_list *args)
static void quic_echo_on_connected_send(session_connected_msg_t *mp, u32 session_index)
void(* disconnected_cb)(session_disconnected_msg_t *mp, echo_session_t *s)