*------------------------------------------------------------------
*/
-#include <stdio.h>
-#include <stdlib.h>
#include <setjmp.h>
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <netinet/in.h>
-#include <signal.h>
-#include <pthread.h>
-#include <unistd.h>
-#include <time.h>
-#include <fcntl.h>
-#include <string.h>
-#include <vppinfra/clib.h>
-#include <vppinfra/vec.h>
+
+#include <svm/svm.h>
+#include <svm/ssvm.h>
+#include <vppinfra/serialize.h>
#include <vppinfra/hash.h>
-#include <vppinfra/bitmap.h>
-#include <vppinfra/fifo.h>
-#include <vppinfra/time.h>
-#include <vppinfra/mheap.h>
-#include <vppinfra/heap.h>
-#include <vppinfra/pool.h>
-#include <vppinfra/format.h>
-
-#include <vlib/vlib.h>
-#include <vlib/unix/unix.h>
-#include <vlibmemory/api.h>
+#include <vlibmemory/memory_client.h>
+
+/* A hack. vl_client_get_first_plugin_msg_id depends on it */
+#include <vlibmemory/socket_client.h>
#include <vlibmemory/vl_memory_msg_enum.h>
static void *
rx_thread_fn (void *arg)
{
- unix_shared_memory_queue_t *q;
+ svm_queue_t *q;
memory_client_main_t *mm = &memory_client_main;
api_main_t *am = &api_main;
int i;
svm_region_t *svm;
vl_api_memclnt_create_t *mp;
vl_api_memclnt_create_reply_t *rp;
- unix_shared_memory_queue_t *vl_input_queue;
+ svm_queue_t *vl_input_queue;
vl_shmem_hdr_t *shmem_hdr;
int rv = 0;
void *oldheap;
pthread_mutex_lock (&svm->mutex);
oldheap = svm_push_data_heap (svm);
vl_input_queue =
- unix_shared_memory_queue_init (input_queue_size, sizeof (uword),
- getpid (), 0);
+ svm_queue_init (input_queue_size, sizeof (uword), getpid (), 0);
pthread_mutex_unlock (&svm->mutex);
svm_pop_heap (oldheap);
/* Wait up to 10 seconds */
for (i = 0; i < 1000; i++)
{
- qstatus = unix_shared_memory_queue_sub (vl_input_queue, (u8 *) & rp,
- 1 /* nowait */ );
+ qstatus = svm_queue_sub (vl_input_queue, (u8 *) & rp,
+ 1 /* nowait */ );
if (qstatus == 0)
goto read_one_msg;
ts.tv_sec = 0;
pthread_mutex_lock (&am->vlib_rp->mutex);
oldheap = svm_push_data_heap (am->vlib_rp);
- unix_shared_memory_queue_free (am->vl_input_queue);
+ svm_queue_free (am->vl_input_queue);
pthread_mutex_unlock (&am->vlib_rp->mutex);
svm_pop_heap (oldheap);
{
vl_api_memclnt_delete_t *mp;
vl_api_memclnt_delete_reply_t *rp;
- unix_shared_memory_queue_t *vl_input_queue;
+ svm_queue_t *vl_input_queue;
vl_shmem_hdr_t *shmem_hdr;
time_t begin;
api_main_t *am = &api_main;
am->shmem_hdr = 0;
break;
}
- if (unix_shared_memory_queue_sub (vl_input_queue, (u8 *) & rp, 1) < 0)
+ if (svm_queue_sub (vl_input_queue, (u8 *) & rp, 1) < 0)
continue;
/* drain the queue */
_(MEMCLNT_DELETE_REPLY, memclnt_delete_reply) \
_(MEMCLNT_KEEPALIVE, memclnt_keepalive)
-
void
vl_client_install_client_message_handlers (void)
{