aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/memif/device.c
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/device.c
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/device.c')
-rw-r--r--src/plugins/memif/device.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/memif/device.c b/src/plugins/memif/device.c
index 3809061e434..22f9753dc42 100644
--- a/src/plugins/memif/device.c
+++ b/src/plugins/memif/device.c
@@ -54,8 +54,10 @@ format_memif_device_name (u8 * s, va_list * args)
u32 dev_instance = va_arg (*args, u32);
memif_main_t *mm = &memif_main;
memif_if_t *mif = pool_elt_at_index (mm->interfaces, dev_instance);
+ memif_socket_file_t *msf;
- s = format (s, "memif%lu/%lu", mif->socket_file_index, mif->id);
+ msf = pool_elt_at_index (mm->socket_files, mif->socket_file_index);
+ s = format (s, "memif%lu/%lu", msf->socket_id, mif->id);
return s;
}
#endif