+static int
+vts_conn_expect_config (vcl_test_server_conn_t * conn)
+{
+ if (conn->cfg.test == SOCK_TEST_TYPE_ECHO)
+ return 1;
+
+ return (conn->stats.rx_bytes < 128
+ || conn->stats.rx_bytes > conn->cfg.total_bytes);
+}
+
+static sock_test_cfg_t *
+vts_conn_read_config (vcl_test_server_conn_t * conn)
+{
+ vcl_test_server_main_t *vts = &sock_server_main;
+
+ if (vts->use_ds)
+ {
+ /* We could avoid the copy if the first segment is big enough but this
+ * just simplifies things */
+ vppcom_data_segment_copy (conn->buf, conn->ds,
+ sizeof (sock_test_cfg_t));
+ vppcom_session_free_segments (conn->fd, conn->ds);
+ }
+ return (sock_test_cfg_t *) conn->buf;
+}
+
+static inline int
+vts_conn_read (vcl_test_server_conn_t * conn)
+{
+ vcl_test_server_main_t *vts = &sock_server_main;
+ if (vts->use_ds)
+ return vcl_test_read_ds (conn->fd, conn->ds, &conn->stats);
+ else
+ return vcl_test_read (conn->fd, conn->buf, conn->buf_size, &conn->stats);
+}
+
+static inline int
+vts_conn_has_ascii (vcl_test_server_conn_t * conn)
+{
+ vcl_test_server_main_t *vts = &sock_server_main;
+
+ if (vts->use_ds)
+ return isascii (conn->ds[0].data[0]);
+ else
+ return isascii (conn->buf[0]);
+}
+