3 * echo_client.h - built-in application layer echo client
5 * Copyright (c) 2017-2019 Cisco and/or its affiliates.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at:
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
18 #ifndef __included_echo_client_h__
19 #define __included_echo_client_h__
21 #include <vnet/session/session.h>
22 #include <vnet/session/application_interface.h>
24 typedef struct ec_session_
26 CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
28 u32 vpp_session_index;
34 u64 vpp_session_handle;
37 typedef struct ec_worker_
39 CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
40 ec_session_t *sessions; /**< session pool */
41 u8 *rx_buf; /**< prealloced rx buffer */
42 u32 *conn_indices; /**< sessions handled by worker */
43 u32 *conns_this_batch; /**< sessions handled in batch */
44 svm_msg_q_t *vpp_event_queue; /**< session layer worker mq */
45 u32 thread_index; /**< thread index for worker */
50 ec_worker_t *wrk; /**< Per-thread state */
51 u8 *connect_test_data; /**< Pre-computed test data */
53 volatile u32 ready_connections;
54 volatile u64 rx_total;
55 volatile u64 tx_total;
56 volatile int run_test; /**< Signal start of test */
64 u32 connect_conn_index; /**< Connects attempted progress */
67 * Application setup parameters
70 u32 cli_node_index; /**< cli process node index */
71 u32 app_index; /**< app index after attach */
74 * Configuration params
76 u32 n_clients; /**< Number of clients */
77 u8 *connect_uri; /**< URI for slave's connect */
78 session_endpoint_cfg_t connect_sep; /**< Sever session endpoint */
79 u64 bytes_to_send; /**< Bytes to send */
80 u32 configured_segment_size;
82 u32 expected_connections; /**< Number of clients/connections */
83 u32 connections_per_batch; /**< Connections to rx/tx at once */
84 u32 private_segment_count; /**< Number of private fifo segs */
85 u64 private_segment_size; /**< size of private fifo segs */
86 u32 tls_engine; /**< TLS engine mbedtls/openssl */
88 u32 no_copy; /**< Don't memcpy data to tx fifo */
89 u32 quic_streams; /**< QUIC streams per connection */
90 u32 ckpair_index; /**< Cert key pair for tls/quic */
91 u64 attach_flags; /**< App attach flags */
92 u8 *appns_id; /**< App namespaces id */
93 u64 appns_secret; /**< App namespace secret */
94 f64 syn_timeout; /**< Test syn timeout (s) */
95 f64 test_timeout; /**< Test timeout (s) */
101 u8 test_client_attached;
103 u8 test_return_packets;
104 int drop_packets; /**< drop all packets */
105 u8 prealloc_fifos; /**< Request fifo preallocation */
106 u8 prealloc_sessions;
111 u8 barrier_acq_needed;
113 vlib_main_t *vlib_main;
116 typedef enum ec_state_
123 typedef enum ec_cli_signal_
125 EC_CLI_CONNECTS_DONE = 1,
126 EC_CLI_CONNECTS_FAILED,
130 void ec_program_connects (void);
132 #endif /* __included_echo_client_h__ */
135 * fd.io coding-style-patch-verification: ON
138 * eval: (c-set-style "gnu")