aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2017-01-25 16:32:08 -0500
committerDave Barach <dave@barachs.net>2017-01-25 16:32:32 -0500
commit2d6b2d6d1bbb130921ec525a1cc6e88f42717c79 (patch)
tree72653c6777511e74738a303dee93ae39db3d2fbf
parent044183faacc5eb8a055658f9deebefb56b254adc (diff)
Repair plugin binary API message numbering
Change-Id: I422a3f168bd483e011cfaf54af022cb79b78db02 Signed-off-by: Dave Barach <dave@barachs.net>
-rw-r--r--src/examples/sample-plugin/sample/sample_test.c2
-rw-r--r--src/plugins/acl/acl_test.c2
-rw-r--r--src/plugins/flowperpkt/flowperpkt_test.c2
-rw-r--r--src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_test.c2
-rw-r--r--src/plugins/ioam/export/ioam_export_test.c2
-rw-r--r--src/plugins/ioam/lib-pot/pot_test.c2
-rw-r--r--src/plugins/ioam/lib-trace/trace_test.c2
-rw-r--r--src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c2
-rw-r--r--src/plugins/lb/lb_test.c2
-rw-r--r--src/plugins/snat/snat_test.c2
-rw-r--r--src/vat/api_format.c1
-rw-r--r--src/vlibapi/vat_helper_macros.h18
12 files changed, 29 insertions, 10 deletions
diff --git a/src/examples/sample-plugin/sample/sample_test.c b/src/examples/sample-plugin/sample/sample_test.c
index a47710ee..2308e8f4 100644
--- a/src/examples/sample-plugin/sample/sample_test.c
+++ b/src/examples/sample-plugin/sample/sample_test.c
@@ -23,6 +23,8 @@
#include <vlibmemory/api.h>
#include <vlibsocket/api.h>
#include <vppinfra/error.h>
+
+#define __plugin_msg_base sample_test_main.msg_id_base
#include <vlibapi/vat_helper_macros.h>
uword unformat_sw_if_index (unformat_input_t * input, va_list * args);
diff --git a/src/plugins/acl/acl_test.c b/src/plugins/acl/acl_test.c
index 5cacf716..4ea6bcc8 100644
--- a/src/plugins/acl/acl_test.c
+++ b/src/plugins/acl/acl_test.c
@@ -25,6 +25,8 @@
#include <vppinfra/error.h>
#include <vnet/ip/ip.h>
#include <arpa/inet.h>
+
+#define __plugin_msg_base acl_test_main.msg_id_base
#include <vlibapi/vat_helper_macros.h>
uword unformat_sw_if_index (unformat_input_t * input, va_list * args);
diff --git a/src/plugins/flowperpkt/flowperpkt_test.c b/src/plugins/flowperpkt/flowperpkt_test.c
index 9211ebe3..4dcfdf05 100644
--- a/src/plugins/flowperpkt/flowperpkt_test.c
+++ b/src/plugins/flowperpkt/flowperpkt_test.c
@@ -19,6 +19,8 @@
#include <vlibmemory/api.h>
#include <vlibsocket/api.h>
#include <vppinfra/error.h>
+
+#define __plugin_msg_base flowperpkt_test_main.msg_id_base
#include <vlibapi/vat_helper_macros.h>
/**
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 5b641cc7..d35bf399 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,6 +23,8 @@
#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 */
diff --git a/src/plugins/ioam/export/ioam_export_test.c b/src/plugins/ioam/export/ioam_export_test.c
index a4ec80d0..8bfee583 100644
--- a/src/plugins/ioam/export/ioam_export_test.c
+++ b/src/plugins/ioam/export/ioam_export_test.c
@@ -23,6 +23,8 @@
#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>
diff --git a/src/plugins/ioam/lib-pot/pot_test.c b/src/plugins/ioam/lib-pot/pot_test.c
index 9f9d0c99..deeb563c 100644
--- a/src/plugins/ioam/lib-pot/pot_test.c
+++ b/src/plugins/ioam/lib-pot/pot_test.c
@@ -23,6 +23,8 @@
#include <vlibmemory/api.h>
#include <vlibsocket/api.h>
#include <vppinfra/error.h>
+
+#define __plugin_msg_base pot_test_main.msg_id_base
#include <vlibapi/vat_helper_macros.h>
/* Declare message IDs */
diff --git a/src/plugins/ioam/lib-trace/trace_test.c b/src/plugins/ioam/lib-trace/trace_test.c
index f4f1d4d5..0ccb675e 100644
--- a/src/plugins/ioam/lib-trace/trace_test.c
+++ b/src/plugins/ioam/lib-trace/trace_test.c
@@ -23,6 +23,8 @@
#include <vlibmemory/api.h>
#include <vlibsocket/api.h>
#include <vppinfra/error.h>
+
+#define __plugin_msg_base trace_test_main.msg_id_base
#include <vlibapi/vat_helper_macros.h>
/* Declare message IDs */
diff --git a/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c b/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c
index 7c4088ee..0748c5b7 100644
--- a/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c
+++ b/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c
@@ -23,6 +23,8 @@
#include <vlibmemory/api.h>
#include <vlibsocket/api.h>
#include <vppinfra/error.h>
+
+#define __plugin_msg_base vxlan_gpe_test_main.msg_id_base
#include <vlibapi/vat_helper_macros.h>
/* Declare message IDs */
diff --git a/src/plugins/lb/lb_test.c b/src/plugins/lb/lb_test.c
index 7e3519a8..9d55e4a7 100644
--- a/src/plugins/lb/lb_test.c
+++ b/src/plugins/lb/lb_test.c
@@ -19,6 +19,8 @@
#include <vlibsocket/api.h>
#include <vppinfra/error.h>
#include <lb/lb.h>
+
+#define __plugin_msg_base lb_test_main.msg_id_base
#include <vlibapi/vat_helper_macros.h>
//TODO: Move that to vat/plugin_api.c
diff --git a/src/plugins/snat/snat_test.c b/src/plugins/snat/snat_test.c
index 67dc4380..db53470c 100644
--- a/src/plugins/snat/snat_test.c
+++ b/src/plugins/snat/snat_test.c
@@ -21,6 +21,8 @@
#include <vlibsocket/api.h>
#include <vppinfra/error.h>
#include <vnet/ip/ip.h>
+
+#define __plugin_msg_base snat_test_main.msg_id_base
#include <vlibapi/vat_helper_macros.h>
uword unformat_sw_if_index (unformat_input_t * input, va_list * args);
diff --git a/src/vat/api_format.c b/src/vat/api_format.c
index 839bcdaa..b83313de 100644
--- a/src/vat/api_format.c
+++ b/src/vat/api_format.c
@@ -70,6 +70,7 @@
#include <vpp/api/vpe_all_api_h.h>
#undef vl_printfun
+#define __plugin_msg_base 0
#include <vlibapi/vat_helper_macros.h>
f64
diff --git a/src/vlibapi/vat_helper_macros.h b/src/vlibapi/vat_helper_macros.h
index 7199364a..dc91c9f5 100644
--- a/src/vlibapi/vat_helper_macros.h
+++ b/src/vlibapi/vat_helper_macros.h
@@ -20,14 +20,13 @@
#define __vat_helper_macros_h__
/* M: construct, but don't yet send a message */
-
-#define M(T,t) \
-do { \
- vam->result_ready = 0; \
- mp = vl_msg_api_alloc_as_if_client(sizeof(*mp)); \
- memset (mp, 0, sizeof (*mp)); \
- mp->_vl_msg_id = ntohs (VL_API_##T); \
- mp->client_index = vam->my_client_index; \
+#define M(T,t) \
+do { \
+ vam->result_ready = 0; \
+ mp = vl_msg_api_alloc_as_if_client(sizeof(*mp)); \
+ memset (mp, 0, sizeof (*mp)); \
+ mp->_vl_msg_id = ntohs (VL_API_##T+__plugin_msg_base); \
+ mp->client_index = vam->my_client_index; \
} while(0);
#define M2(T,t,n) \
@@ -35,11 +34,10 @@ do { \
vam->result_ready = 0; \
mp = vl_msg_api_alloc_as_if_client(sizeof(*mp)+(n)); \
memset (mp, 0, sizeof (*mp)); \
- mp->_vl_msg_id = ntohs (VL_API_##T); \
+ mp->_vl_msg_id = ntohs (VL_API_##T+__plugin_msg_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))