+ vl_msg_api_send_shmem (em->vl_input_queue, (u8 *) & bmp);
+
+ clib_warning ("Sent detach");
+}
+
+static int
+memfd_segment_attach (void)
+{
+ ssvm_private_t _ssvm = { 0 }, *ssvm = &_ssvm;
+ clib_error_t *error;
+ int rv;
+
+ if ((error = vl_socket_client_recv_fd_msg (&ssvm->fd, 5)))
+ {
+ clib_error_report (error);
+ return -1;
+ }
+
+ if ((rv = ssvm_slave_init_memfd (ssvm)))
+ return rv;
+
+ return 0;
+}
+
+static int
+fifo_segment_attach (char *name, u32 size, ssvm_segment_type_t type)
+{
+ svm_fifo_segment_create_args_t _a, *a = &_a;
+ clib_error_t *error;
+ int rv;
+
+ memset (a, 0, sizeof (*a));
+ a->segment_name = (char *) name;
+ a->segment_size = size;
+ a->segment_type = type;
+
+ if (type == SSVM_SEGMENT_MEMFD)
+ {
+ if ((error = vl_socket_client_recv_fd_msg (&a->memfd_fd, 5)))
+ {
+ clib_error_report (error);
+ return -1;
+ }
+ }
+
+ if ((rv = svm_fifo_segment_attach (a)))
+ {
+ clib_warning ("svm_fifo_segment_attach ('%s') failed", name);
+ return rv;
+ }
+
+ return 0;