summaryrefslogtreecommitdiffstats
path: root/src/plugins/memif/private.h
diff options
context:
space:
mode:
authorJon Loeliger <jdl@netgate.com>2018-01-16 16:37:16 -0600
committerDamjan Marion <damarion@cisco.com>2018-01-29 13:09:57 +0100
commit30349b075cf939549980f2a32e030b32f6d07e9a (patch)
treeebf4a6e10c49cd9657cefeadafbaa44f07c5c021 /src/plugins/memif/private.h
parentb4d43d7901b49bdda4345adb86b4d15a5d72f7ff (diff)
memif: Add new API calls to manage memif socket names.
New API calls and corresponding CLI commands allow the user to manage the socket filenames for memif connections using: vppctl# create memif id <u32> filename <socket-filename> vppctl# delete memif id <u32> and then referencing it later in a memif interface: vppctl# create memif <u32> socket-id <id> mode <mode> <master|slave> ... Corresponding VAT cli entries have also been added. The default memif socket file at id 0 are still always present. The existing memif create/delete CLI commands have been slightly altered into the new syntax: vppctl# create interface memif ... vppctl# delete interface memif ... Change-Id: If2bdc7eac3d81e1d9011a5869747e52fc5e11639 Signed-off-by: Jon Loeliger <jdl@netgate.com> Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/memif/private.h')
-rw-r--r--src/plugins/memif/private.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/memif/private.h b/src/plugins/memif/private.h
index 49357ddc617..5904fc09cd6 100644
--- a/src/plugins/memif/private.h
+++ b/src/plugins/memif/private.h
@@ -65,6 +65,7 @@
typedef struct
{
u8 *filename;
+ u32 socket_id;
clib_socket_t *sock;
clib_socket_t **pending_clients;
int ref_cnt;
@@ -182,7 +183,7 @@ typedef struct
/* pool of all unix socket files */
memif_socket_file_t *socket_files;
- mhash_t socket_file_index_by_filename;
+ uword *socket_file_index_by_sock_id; /* map user socket id to pool idx */
/* rx buffer cache */
u32 **rx_buffers;
@@ -202,7 +203,7 @@ enum
typedef struct
{
memif_interface_id_t id;
- u8 *socket_filename;
+ u32 socket_id;
u8 *secret;
u8 is_master;
memif_interface_mode_t mode:8;
@@ -217,6 +218,8 @@ typedef struct
u32 sw_if_index;
} memif_create_if_args_t;
+int memif_socket_filename_add_del (u8 is_add, u32 sock_id,
+ u8 * sock_filename);
int memif_create_if (vlib_main_t * vm, memif_create_if_args_t * args);
int memif_delete_if (vlib_main_t * vm, memif_if_t * mif);
clib_error_t *memif_plugin_api_hookup (vlib_main_t * vm);