summaryrefslogtreecommitdiffstats
path: root/vpp-api/python/pneum
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2016-10-05 11:10:50 +0200
committerDamjan Marion <dmarion.lists@gmail.com>2016-10-05 11:39:14 +0000
commitb8602b595fc89fe8b8fb00cef4820eedf225a93e (patch)
tree275111a5e3a1011b91939f5347a5aef0dae016b3 /vpp-api/python/pneum
parentd4bc9af55fc9a7bb5133da8c863569497cb92cd0 (diff)
Python API: Add support for shared memory prefix
Recheck. This is to support multiple VPP instances on same host. Change-Id: Ibe511b1f790fc8771900085577423f7e71dc45df Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'vpp-api/python/pneum')
-rw-r--r--vpp-api/python/pneum/pneum.c5
-rw-r--r--vpp-api/python/pneum/pneum.h2
-rw-r--r--vpp-api/python/pneum/test_pneum.c2
3 files changed, 6 insertions, 3 deletions
diff --git a/vpp-api/python/pneum/pneum.c b/vpp-api/python/pneum/pneum.c
index 7250cf6a90e..ebe47b2f419 100644
--- a/vpp-api/python/pneum/pneum.c
+++ b/vpp-api/python/pneum/pneum.c
@@ -116,11 +116,14 @@ pneum_rx_thread_fn (void *arg)
}
int
-pneum_connect (char *name)
+pneum_connect (char * name, char * chroot_prefix)
{
int rv = 0;
pneum_main_t *pm = &pneum_main;
+ if (chroot_prefix != NULL)
+ vl_set_memory_root_path (chroot_prefix);
+
if ((rv = vl_client_api_map("/vpe-api"))) {
clib_warning ("vl_client_api map rv %d", rv);
return rv;
diff --git a/vpp-api/python/pneum/pneum.h b/vpp-api/python/pneum/pneum.h
index 75fccf84bcf..75b10f8df45 100644
--- a/vpp-api/python/pneum/pneum.h
+++ b/vpp-api/python/pneum/pneum.h
@@ -15,7 +15,7 @@
#ifndef included_pneum_h
#define included_pneum_h
-int pneum_connect(char *name);
+int pneum_connect(char * name, char * chroot_prefix);
int pneum_disconnect(void);
int pneum_read(char **data, int *l);
int pneum_write(char *data, int len);
diff --git a/vpp-api/python/pneum/test_pneum.c b/vpp-api/python/pneum/test_pneum.c
index b3131953e8f..20c29a7e754 100644
--- a/vpp-api/python/pneum/test_pneum.c
+++ b/vpp-api/python/pneum/test_pneum.c
@@ -76,7 +76,7 @@ int main (int argc, char ** argv)
vl_api_show_version_t message;
vl_api_show_version_t *mp;
int async = 1;
- int rv = pneum_connect("pneum_client");
+ int rv = pneum_connect("pneum_client", NULL);
if (rv != 0) {
printf("Connect failed: %d\n", rv);