+static void
+vts_ctrl_session_init (vcl_test_server_worker_t *wrk)
+{
+ vcl_test_server_main_t *vsm = &vcl_server_main;
+ struct epoll_event listen_ev;
+ int rv;
+
+ vtinf ("Initializing main ctrl session ...");
+
+ vsm->ctrl_listen_fd =
+ vppcom_session_create (VPPCOM_PROTO_TCP, 0 /* is_nonblocking */);
+ if (vsm->ctrl_listen_fd < 0)
+ vtfail ("vppcom_session_create()", vsm->ctrl_listen_fd);
+
+ rv = vppcom_session_bind (vsm->ctrl_listen_fd, &vsm->server_cfg.endpt);
+ if (rv < 0)
+ vtfail ("vppcom_session_bind()", rv);
+
+ rv = vppcom_session_listen (vsm->ctrl_listen_fd, 10);
+ if (rv < 0)
+ vtfail ("vppcom_session_listen()", rv);
+
+ wrk->epfd = vppcom_epoll_create ();
+ if (wrk->epfd < 0)
+ vtfail ("vppcom_epoll_create()", wrk->epfd);
+
+ listen_ev.events = EPOLLET | EPOLLIN;
+ listen_ev.data.u32 = VCL_TEST_CTRL_LISTENER;
+ rv = vppcom_epoll_ctl (wrk->epfd, EPOLL_CTL_ADD, vsm->ctrl_listen_fd,
+ &listen_ev);
+ if (rv < 0)
+ vtfail ("vppcom_epoll_ctl", rv);
+
+ vtinf ("Waiting for client ctrl connection on port %d ...",
+ vsm->server_cfg.port);
+}
+