aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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 a47710ee1c3..2308e8f4363 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 5cacf7162bc..4ea6bcc87f4 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 9211ebe32dd..4dcfdf05a24 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 5b641cc7ce7..d35bf399a98 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 a4ec80d0713..8bfee5834c7 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 9f9d0c99bcf..deeb563c1b7 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 f4f1d4d54e2..0ccb675ef95 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 7c4088ee71a..0748c5b793b 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 7e3519a8e4f..9d55e4a72ab 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 67dc4380cf7..db53470c58d 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 839bcdaab1d..b83313de850 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 7199364a389..dc91c9f5023 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))