aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/ioam/export-vxlan-gpe
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2017-01-20 19:50:09 -0500
committerDamjan Marion <dmarion.lists@gmail.com>2017-01-23 15:17:25 +0000
commitfe6bdfd84573cd8813a211f9094ee734f088ce16 (patch)
tree68c109d579ebbcb64c2a0e9af379aaf0522c0c0b /src/plugins/ioam/export-vxlan-gpe
parent675a69cdf6eb1a8e60613bef4a918fe1b354c276 (diff)
binary-api debug CLI works with plugins
Change-Id: I81f33f5153d5afac94b66b5a8cb91da77463af79 Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/plugins/ioam/export-vxlan-gpe')
-rw-r--r--src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_test.c46
1 files changed, 4 insertions, 42 deletions
diff --git a/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_test.c b/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_test.c
index 494263d9a1a..5b641cc7ce7 100644
--- a/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_test.c
+++ b/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_test.c
@@ -23,7 +23,7 @@
#include <vlibmemory/api.h>
#include <vlibsocket/api.h>
#include <vppinfra/error.h>
-
+#include <vlibapi/vat_helper_macros.h>
/* Declare message IDs */
#include <ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_msg_enum.h>
@@ -86,47 +86,9 @@ foreach_standard_reply_retval_handler;
#define foreach_vpe_api_reply_msg \
_(VXLAN_GPE_IOAM_EXPORT_ENABLE_DISABLE_REPLY, vxlan_gpe_ioam_export_enable_disable_reply)
-
-/* M: construct, but don't yet send a message */
-
-#define M(T,t) \
-do { \
- vam->result_ready = 0; \
- mp = vl_msg_api_alloc(sizeof(*mp)); \
- memset (mp, 0, sizeof (*mp)); \
- mp->_vl_msg_id = ntohs (VL_API_##T + sm->msg_id_base); \
- mp->client_index = vam->my_client_index; \
-} while(0);
-
-#define M2(T,t,n) \
-do { \
- vam->result_ready = 0; \
- mp = vl_msg_api_alloc(sizeof(*mp)+(n)); \
- memset (mp, 0, sizeof (*mp)); \
- mp->_vl_msg_id = ntohs (VL_API_##T + sm->msg_id_base); \
- mp->client_index = vam->my_client_index; \
-} while(0);
-
-/* S: send a message */
-#define S (vl_msg_api_send_shmem (vam->vl_input_queue, (u8 *)&mp))
-
-/* W: wait for results, with timeout */
-#define W \
-do { \
- timeout = vat_time_now (vam) + 1.0; \
- \
- while (vat_time_now (vam) < timeout) { \
- if (vam->result_ready == 1) { \
- return (vam->retval); \
- } \
- } \
- return -99; \
-} while(0);
-
static int
api_vxlan_gpe_ioam_export_enable_disable (vat_main_t * vam)
{
- export_test_main_t *sm = &export_test_main;
unformat_input_t *i = vam->input;
f64 timeout;
int is_disable = 0;
@@ -160,8 +122,8 @@ api_vxlan_gpe_ioam_export_enable_disable (vat_main_t * vam)
#define foreach_vpe_api_msg \
_(vxlan_gpe_ioam_export_enable_disable, "<intfc> [disable]")
-void
-vat_api_hookup (vat_main_t * vam)
+static void
+vxlan_gpe_ioam_vat_api_hookup (vat_main_t * vam)
{
export_test_main_t *sm = &export_test_main;
/* Hook up handlers for replies from the data plane plug-in */
@@ -199,7 +161,7 @@ vat_plugin_register (vat_main_t * vam)
sm->msg_id_base = vl_client_get_first_plugin_msg_id ((char *) name);
if (sm->msg_id_base != (u16) ~ 0)
- vat_api_hookup (vam);
+ vxlan_gpe_ioam_vat_api_hookup (vam);
vec_free (name);