interface: add api test file
[vpp.git] / src / vpp-api / vapi / vapi.c
index 8a9c8e3..513ff98 100644 (file)
@@ -32,6 +32,7 @@
 #include <vlibmemory/memory_client.h>
 
 #include <vapi/memclnt.api.vapi.h>
+#include <vapi/vlib.api.vapi.h>
 
 /* we need to use control pings for some stuff and because we're forced to put
  * the code in headers, we need a way to be able to grab the ids of these
@@ -40,7 +41,7 @@ vapi_msg_id_t vapi_msg_id_control_ping = 0;
 vapi_msg_id_t vapi_msg_id_control_ping_reply = 0;
 
 DEFINE_VAPI_MSG_IDS_MEMCLNT_API_JSON;
-DEFINE_VAPI_MSG_IDS_VPE_API_JSON;
+DEFINE_VAPI_MSG_IDS_VLIB_API_JSON;
 
 struct
 {
@@ -221,6 +222,10 @@ vapi_msg_alloc (vapi_ctx_t ctx, size_t size)
       return NULL;
     }
   void *rv = vl_msg_api_alloc_or_null (size);
+  if (rv)
+    {
+      clib_memset (rv, 0, size);
+    }
   return rv;
 }