vcl_test_t post_test;
uint8_t proto;
uint32_t n_workers;
+ uint32_t ckpair_index;
volatile int active_workers;
struct sockaddr_storage server_addr;
} vcl_test_client_main_t;
return ts->fd;
}
+ if (vcm->proto == VPPCOM_PROTO_TLS)
+ {
+ uint32_t ckp_len = sizeof (vcm->ckpair_index);
+ vppcom_session_attr (ts->fd, VPPCOM_ATTR_SET_CKPAIR,
+ &vcm->ckpair_index, &ckp_len);
+ }
+
/* Connect is blocking */
rv = vppcom_session_connect (ts->fd, &vcm->server_endpt);
if (rv < 0)
vtwrn ("post-test cfg sync failed!");
}
-static void
-dump_help (void)
-{
-#define INDENT "\n "
-
- printf ("CLIENT: Test configuration commands:"
- INDENT VCL_TEST_TOKEN_HELP
- "\t\t\tDisplay help."
- INDENT VCL_TEST_TOKEN_EXIT
- "\t\t\tExit test client & server."
- INDENT VCL_TEST_TOKEN_SHOW_CFG
- "\t\t\tShow the current test cfg."
- INDENT VCL_TEST_TOKEN_RUN_UNI
- "\t\t\tRun the Uni-directional test."
- INDENT VCL_TEST_TOKEN_RUN_BI
- "\t\t\tRun the Bi-directional test."
- INDENT VCL_TEST_TOKEN_VERBOSE
- "\t\t\tToggle verbose setting."
- INDENT VCL_TEST_TOKEN_RXBUF_SIZE
- "<rxbuf size>\tRx buffer size (bytes)."
- INDENT VCL_TEST_TOKEN_TXBUF_SIZE
- "<txbuf size>\tTx buffer size (bytes)."
- INDENT VCL_TEST_TOKEN_NUM_WRITES
- "<# of writes>\tNumber of txbuf writes to server." "\n");
-}
-
static void
cfg_txbuf_size_set (void)
{
if (ctrl->fd < 0)
vtfail ("vppcom_session_create()", ctrl->fd);
- if (vcm->proto == VPPCOM_PROTO_TLS || vcm->proto == VPPCOM_PROTO_QUIC)
+ if (vcm->proto == VPPCOM_PROTO_TLS || vcm->proto == VPPCOM_PROTO_QUIC ||
+ vcm->proto == VPPCOM_PROTO_DTLS)
{
+ vppcom_cert_key_pair_t ckpair;
+ uint32_t ckp_len;
+ int ckp_index;
+
vtinf ("Adding tls certs ...");
- vppcom_session_tls_add_cert (ctrl->fd, vcl_test_crt_rsa,
- vcl_test_crt_rsa_len);
- vppcom_session_tls_add_key (ctrl->fd, vcl_test_key_rsa,
- vcl_test_key_rsa_len);
+ ckpair.cert = vcl_test_crt_rsa;
+ ckpair.key = vcl_test_key_rsa;
+ ckpair.cert_len = vcl_test_crt_rsa_len;
+ ckpair.key_len = vcl_test_key_rsa_len;
+ ckp_index = vppcom_add_cert_key_pair (&ckpair);
+ if (ckp_index < 0)
+ vtfail ("vppcom_add_cert_key_pair()", ckp_index);
+
+ vcm->ckpair_index = ckp_index;
+ ckp_len = sizeof (ckp_index);
+ vppcom_session_attr (ctrl->fd, VPPCOM_ATTR_SET_CKPAIR, &ckp_index,
+ &ckp_len);
}
vtinf ("Connecting to server...");