- wrk->listen_fd = vppcom_session_create (vsm->cfg.proto,
- 0 /* is_nonblocking */ );
- if (wrk->listen_fd < 0)
- vtfail ("vppcom_session_create()", wrk->listen_fd);
-
- if (vsm->cfg.proto == VPPCOM_PROTO_UDP)
- {
- vppcom_session_attr (wrk->listen_fd, VPPCOM_ATTR_SET_CONNECTED, 0, 0);
- }
-
- if (vsm->cfg.proto == VPPCOM_PROTO_TLS ||
- vsm->cfg.proto == VPPCOM_PROTO_QUIC ||
- vsm->cfg.proto == VPPCOM_PROTO_DTLS)
- {
- vppcom_cert_key_pair_t ckpair;
- uint32_t ckp_len;
- int ckp_index;
-
- vtinf ("Adding tls certs ...");
- 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);
-
- ckp_len = sizeof (ckp_index);
- vppcom_session_attr (wrk->listen_fd, VPPCOM_ATTR_SET_CKPAIR, &ckp_index,
- &ckp_len);
- }
-
- rv = vppcom_session_bind (wrk->listen_fd, &vsm->cfg.endpt);
- if (rv < 0)
- vtfail ("vppcom_session_bind()", rv);
-
- if (!(vsm->cfg.proto == VPPCOM_PROTO_UDP))
- {
- rv = vppcom_session_listen (wrk->listen_fd, 10);
- if (rv < 0)
- vtfail ("vppcom_session_listen()", rv);
- }