api: multiple connections per process

Type: feature

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I2272521d6e69edcd385ef684af6dd4eea5eaa953
diff --git a/src/vlibapi/api_common.h b/src/vlibapi/api_common.h
index fac4c96..c3ef573 100644
--- a/src/vlibapi/api_common.h
+++ b/src/vlibapi/api_common.h
@@ -369,7 +369,14 @@
 
 } api_main_t;
 
-extern api_main_t api_main;
+extern __thread api_main_t *my_api_main;
+extern api_main_t api_global_main;
+
+always_inline api_main_t *
+vlibapi_get_main (void)
+{
+  return my_api_main;
+}
 
 #endif /* included_api_common_h */