aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/memif/private.h
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2017-09-13 21:30:31 +0200
committerDamjan Marion <dmarion.lists@gmail.com>2017-11-09 18:31:08 +0000
commitb966b8e63ff71159d55bc4510b4d9d96a01c19db (patch)
tree4a501f465f6a071b6c22ed5f11500ad2d8aa2f58 /src/plugins/memif/private.h
parent4e50d2f1f8adb1bef9187dab1b7cffdc7bc4fb8c (diff)
memif: use clib_socket_t for socket connections
This reverts commit 590acf8fa7af6a8604edd72a32f9f087be52c767. new version includes minor fix for the crash when the interface is deleted. Change-Id: I8fc56eb9145e4d8e1d410206f84e705045898608 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/memif/private.h')
-rw-r--r--src/plugins/memif/private.h14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/plugins/memif/private.h b/src/plugins/memif/private.h
index 912ec59abd2..49357ddc617 100644
--- a/src/plugins/memif/private.h
+++ b/src/plugins/memif/private.h
@@ -40,7 +40,6 @@
#if MEMIF_DEBUG == 1
#define memif_file_add(a, b) do { \
- ASSERT (*a == ~0); \
*a = clib_file_add (&file_main, b); \
clib_warning ("clib_file_add fd %d private_data %u idx %u", \
(b)->file_descriptor, (b)->private_data, *a); \
@@ -57,7 +56,6 @@
} while (0)
#else
#define memif_file_add(a, b) do { \
- ASSERT (*a == ~0); \
*a = clib_file_add (&file_main, b); \
} while (0)
#define memif_file_del(a) clib_file_del(&file_main, a)
@@ -67,9 +65,8 @@
typedef struct
{
u8 *filename;
- int fd;
- uword clib_file_index;
- uword *pending_file_indices;
+ clib_socket_t *sock;
+ clib_socket_t **pending_clients;
int ref_cnt;
int is_listener;
@@ -138,9 +135,8 @@ typedef struct
u32 per_interface_next_index;
/* socket connection */
+ clib_socket_t *sock;
uword socket_file_index;
- int conn_fd;
- uword conn_clib_file_index;
memif_msg_fifo_elt_t *msg_queue;
u8 *secret;
@@ -150,9 +146,6 @@ typedef struct
memif_queue_t *tx_queues;
/* remote info */
- pid_t remote_pid;
- uid_t remote_uid;
- gid_t remote_gid;
u8 *remote_name;
u8 *remote_if_name;
@@ -241,6 +234,7 @@ clib_error_t *memif_connect (memif_if_t * mif);
void memif_disconnect (memif_if_t * mif, clib_error_t * err);
/* socket.c */
+void memif_socket_close (clib_socket_t ** sock);
clib_error_t *memif_conn_fd_accept_ready (clib_file_t * uf);
clib_error_t *memif_master_conn_fd_read_ready (clib_file_t * uf);
clib_error_t *memif_slave_conn_fd_read_ready (clib_file_t * uf);