+static void
+ vl_api_app_cut_through_registration_add_t_handler
+ (vl_api_app_cut_through_registration_add_t * mp)
+{
+ vcl_cut_through_registration_t *ctr;
+ u32 mqc_index = ~0;
+ int *fds = 0;
+
+ if (mp->n_fds)
+ {
+ ASSERT (mp->n_fds == 2);
+ vec_validate (fds, mp->n_fds);
+ vl_socket_client_recv_fd_msg (fds, mp->n_fds, 5);
+ }
+
+ ctr = vcl_ct_registration_lock_and_alloc ();
+ ctr->mq = uword_to_pointer (mp->evt_q_address, svm_msg_q_t *);
+ ctr->peer_mq = uword_to_pointer (mp->peer_evt_q_address, svm_msg_q_t *);
+ VDBG (0, "Adding ct registration %u", vcl_ct_registration_index (ctr));
+
+ if (mp->fd_flags & SESSION_FD_F_MQ_EVENTFD)
+ {
+ svm_msg_q_set_consumer_eventfd (ctr->mq, fds[0]);
+ svm_msg_q_set_producer_eventfd (ctr->peer_mq, fds[1]);
+ mqc_index = vcl_mq_epoll_add_evfd (ctr->mq);
+ ctr->epoll_evt_conn_index = mqc_index;
+ vec_free (fds);
+ }
+ vcl_ct_registration_lookup_add (mp->evt_q_address,
+ vcl_ct_registration_index (ctr));
+ vcl_ct_registration_unlock ();
+}
+