summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2019-09-19 01:08:30 +0200
committerDave Barach <openvpp@barachs.net>2019-09-25 12:02:32 +0000
commit2a1ca787b9ca0021bd5da73450caedc2ff41c76d (patch)
treef9d879e07099f727ca565cfd8bc1624d3e7dc405 /src/vnet/ip
parent33af8c1ed89f15cf0601ee891e9603bef16f2c93 (diff)
api: split api generated files
Split generation of API message enum and the typedefs into separate files, so that the type file can be included from elsewhere. Generate a C file for VPP that contains the API registration, this was previously done via X macros by the C pre- processor. This allows deleting lots of skeleton/copy paste code for each feature. plugins/flowprobe plugins/map examples/sample-plugin vnet/ipip used as Guinea pigs. Generate a C Test file for VAT, that does the same for VAT plugins. Also add support for a per-message CLI option, that is currently limited to VAT help text. option vat_help = "<help text>"; Type: refactor Change-Id: I245e3104bb76f7e1fb69a59ab20cc7c8dfcdd460 Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/vnet/ip')
-rw-r--r--src/vnet/ip/ip_format_fns.h3
-rw-r--r--src/vnet/ip/ip_types_api.h10
2 files changed, 2 insertions, 11 deletions
diff --git a/src/vnet/ip/ip_format_fns.h b/src/vnet/ip/ip_format_fns.h
index b0e0c10d715..0c2e0661ba0 100644
--- a/src/vnet/ip/ip_format_fns.h
+++ b/src/vnet/ip/ip_format_fns.h
@@ -20,8 +20,7 @@ static inline u8 *format_vl_api_ip6_address_t (u8 * s, va_list * args);
static inline u8 *format_vl_api_ip4_address_t (u8 * s, va_list * args);
#include <vnet/ip/format.h>
-#define vl_typedefs
-#include <vnet/ip/ip_types.api.h>
+#include <vnet/ip/ip_types.api_types.h>
static inline u8 *
format_vl_api_ip6_address_t (u8 * s, va_list * args)
diff --git a/src/vnet/ip/ip_types_api.h b/src/vnet/ip/ip_types_api.h
index 09ca0e6e1a0..11891dec7c1 100644
--- a/src/vnet/ip/ip_types_api.h
+++ b/src/vnet/ip/ip_types_api.h
@@ -24,15 +24,7 @@
#include <vnet/fib/fib_types.h>
#include <vnet/mfib/mfib_types.h>
#include <vlibapi/api_types.h>
-
-/**
- * Forward declarations so we need not #include the API definitions here
- */
-typedef u8 vl_api_ip6_address_t[16];
-typedef u8 vl_api_ip4_address_t[4];
-struct _vl_api_address;
-struct _vl_api_prefix;
-struct _vl_api_mprefix;
+#include <vnet/ip/ip.api_types.h>
/**
* These enum decode/encodes use 'int' as the type for the enum becuase