+ vl_client_send_disconnect (1 /* vpp should cleanup */ );
+}
+
+int
+vcl_bapi_recv_fds (vcl_worker_t * wrk, int *fds, int n_fds)
+{
+ clib_error_t *err;
+
+ if ((err = vl_socket_client_recv_fd_msg2 (&wrk->bapi_sock_ctx, fds, n_fds,
+ 5)))
+ {
+ clib_error_report (err);
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+vcl_bapi_add_cert_key_pair (vppcom_cert_key_pair_t *ckpair)
+{
+ vcl_worker_t *wrk = vcl_worker_get_current ();
+
+ if (ckpair->key_len == 0 || ckpair->key_len == ~0)
+ return VPPCOM_EINVAL;
+
+ vcl_bapi_send_app_add_cert_key_pair (ckpair);
+ wrk->bapi_app_state = STATE_APP_ADDING_TLS_DATA;
+ vcl_bapi_wait_for_wrk_state_change (STATE_APP_READY);
+ if (wrk->bapi_app_state == STATE_APP_READY)
+ return wrk->bapi_return;
+ return VPPCOM_EFAULT;
+}
+
+int
+vcl_bapi_del_cert_key_pair (u32 ckpair_index)
+{
+ /* Don't wait for reply */
+ vcl_bapi_send_app_del_cert_key_pair (ckpair_index);
+ return 0;
+}
+
+int
+vcl_bapi_worker_set (void)
+{
+ vcl_worker_t *wrk = vcl_worker_get_current ();
+ int i;
+
+ /* Find the first worker with the same pid */
+ for (i = 0; i < vec_len (vcm->workers); i++)
+ {
+ if (i == wrk->wrk_index)
+ continue;
+ if (vcm->workers[i].current_pid == wrk->current_pid)
+ {
+ wrk->vl_input_queue = vcm->workers[i].vl_input_queue;
+ wrk->api_client_handle = vcm->workers[i].api_client_handle;
+ return 0;
+ }
+ }
+ return -1;