build: fix make test with distributed src
[vpp.git] / src / plugins / ioam / export / ioam_export_test.c
index a4ec80d..b7d53c2 100644 (file)
 #include <vat/vat.h>
 #include <vlibapi/api.h>
 #include <vlibmemory/api.h>
-#include <vlibsocket/api.h>
 #include <vppinfra/error.h>
+
+#define __plugin_msg_base export_test_main.msg_id_base
 #include <vlibapi/vat_helper_macros.h>
 
 
 /* Declare message IDs */
-#include <ioam/export/ioam_export_msg_enum.h>
-
-/* define message structures */
-#define vl_typedefs
-#include <ioam/export/ioam_export_all_api_h.h>
-#undef vl_typedefs
-
-/* declare message handlers for each api */
-
-#define vl_endianfun           /* define message structures */
-#include <ioam/export/ioam_export_all_api_h.h>
-#undef vl_endianfun
+#include <ioam/export/ioam_export.api_enum.h>
+#include <ioam/export/ioam_export.api_types.h>
 
-/* instantiate all the print functions we know about */
-#define vl_print(handle, ...)
+#define vl_endianfun            /* define message structures */
 #define vl_printfun
-#include <ioam/export/ioam_export_all_api_h.h>
-#undef vl_printfun
-
-/* Get the API version number. */
 #define vl_api_version(n,v) static u32 api_version=(v);
-#include <ioam/export/ioam_export_all_api_h.h>
+#define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__)
+#include <ioam/export/ioam_export.api.h>
+#undef vl_endianfun
+#undef vl_printfun
 #undef vl_api_version
 
-
 typedef struct
 {
   /* API message ID base */
@@ -59,7 +47,7 @@ typedef struct
   vat_main_t *vat_main;
 } export_test_main_t;
 
-export_test_main_t export_test_main;
+static export_test_main_t export_test_main;
 
 #define foreach_standard_reply_retval_handler   \
 _(ioam_export_ip6_enable_disable_reply)
@@ -92,9 +80,9 @@ static int
 api_ioam_export_ip6_enable_disable (vat_main_t * vam)
 {
   unformat_input_t *i = vam->input;
-  f64 timeout;
   int is_disable = 0;
   vl_api_ioam_export_ip6_enable_disable_t *mp;
+  int ret;
 
   /* Parse args required to build the message */
   while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
@@ -106,14 +94,15 @@ api_ioam_export_ip6_enable_disable (vat_main_t * vam)
     }
 
   /* Construct the API message */
-  M (IOAM_EXPORT_IP6_ENABLE_DISABLE, ioam_export_ip6_enable_disable);
+  M(IOAM_EXPORT_IP6_ENABLE_DISABLE, mp);
   mp->is_disable = is_disable;
 
   /* send it... */
-  S;
+  S(mp);
 
   /* Wait for a reply... */
-  W;
+  W (ret);
+  return ret;
 }
 
 /*
@@ -151,7 +140,7 @@ ioam_export_vat_api_hookup (vat_main_t * vam)
 }
 
 clib_error_t *
-vat_plugin_register (vat_main_t * vam)
+ioam_export_vat_plugin_register (vat_main_t * vam)
 {
   export_test_main_t *sm = &export_test_main;
   u8 *name;