X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvlibapi%2Fapi_common.h;h=2105f1bd430b475ff3fbcf0f7a4f005be45f33bd;hb=bdfe5955f59a735fd8d70e9026f8c1867a4c8cc6;hp=fac4c96ee3ce0d69743aa27a4732255662d7e277;hpb=9fb6d40eb3d4a2da8f45187de773498b784596e6;p=vpp.git diff --git a/src/vlibapi/api_common.h b/src/vlibapi/api_common.h index fac4c96ee3c..2105f1bd430 100644 --- a/src/vlibapi/api_common.h +++ b/src/vlibapi/api_common.h @@ -201,7 +201,9 @@ void vl_msg_api_set_first_available_msg_id (u16 first_avail); u16 vl_msg_api_get_msg_ids (const char *name, int n); u32 vl_msg_api_get_msg_index (u8 * name_and_crc); void *vl_msg_push_heap (void); +void *vl_msg_push_heap_w_region (svm_region_t * vlib_rp); void vl_msg_pop_heap (void *oldheap); +void vl_msg_pop_heap_w_region (svm_region_t * vlib_rp, void *oldheap); typedef clib_error_t *(vl_msg_api_init_function_t) (u32 client_index); @@ -369,7 +371,20 @@ typedef struct } 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; +} + +always_inline void +vlibapi_set_main (api_main_t * am) +{ + my_api_main = am; +} #endif /* included_api_common_h */