vppapigen: support per-file (major,minor,patch) version stamps 89/8589/6
authorDave Barach <dave@barachs.net>
Thu, 28 Sep 2017 19:11:16 +0000 (15:11 -0400)
committerOle Troan <ot@cisco.com>
Mon, 9 Oct 2017 11:32:40 +0000 (13:32 +0200)
Add one of these statements to foo.api:

  vl_api_version 1.2.3

to generate a version tuple stanza in foo.api.h:

/****** Version tuple *****/

vl_api_version_tuple(foo, 1, 2, 3)

Change-Id: Ic514439e4677999daa8463a94f948f76b132ff15
Signed-off-by: Dave Barach <dave@barachs.net>
Signed-off-by: Ole Troan <ot@cisco.com>
57 files changed:
src/examples/sample-plugin/sample/sample.api
src/plugins/acl/acl.api
src/plugins/dpdk/api/dpdk.api
src/plugins/flowprobe/flowprobe.api
src/plugins/gtpu/gtpu.api
src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export.api
src/plugins/ioam/export/ioam_export.api
src/plugins/ioam/ip6/ioam_cache.api
src/plugins/ioam/lib-pot/pot.api
src/plugins/ioam/lib-trace/trace.api
src/plugins/ioam/lib-vxlan-gpe/ioam_vxlan_gpe.api
src/plugins/ioam/udp-ping/udp_ping.api
src/plugins/lb/lb.api
src/plugins/memif/memif.api
src/plugins/nat/nat.api
src/plugins/pppoe/pppoe.api
src/tools/vppapigen/gram.y
src/tools/vppapigen/lex.c
src/tools/vppapigen/node.c
src/tools/vppapigen/node.h
src/vlibapi/api.h
src/vlibapi/api_common.h
src/vlibapi/api_shared.c
src/vlibmemory/memclnt.api
src/vlibmemory/memory_vlib.c
src/vnet/bfd/bfd.api
src/vnet/classify/classify.api
src/vnet/cop/cop.api
src/vnet/devices/af_packet/af_packet.api
src/vnet/devices/netmap/netmap.api
src/vnet/devices/virtio/vhost_user.api
src/vnet/dhcp/dhcp.api
src/vnet/ethernet/p2p_ethernet.api
src/vnet/flow/flow.api
src/vnet/gre/gre.api
src/vnet/interface.api
src/vnet/ip/ip.api
src/vnet/ipsec-gre/ipsec_gre.api
src/vnet/ipsec/ipsec.api
src/vnet/l2/l2.api
src/vnet/l2tp/l2tp.api
src/vnet/lisp-cp/lisp.api
src/vnet/lisp-cp/one.api
src/vnet/lisp-gpe/lisp_gpe.api
src/vnet/lldp/lldp.api
src/vnet/map/map.api
src/vnet/mpls/mpls.api
src/vnet/policer/policer.api
src/vnet/session/session.api
src/vnet/span/span.api
src/vnet/srv6/sr.api
src/vnet/unix/tap.api
src/vnet/vxlan-gpe/vxlan_gpe.api
src/vnet/vxlan/vxlan.api
src/vpp/api/api.c
src/vpp/api/vpe.api
src/vpp/stats/stats.api

index d565c0b..f3604b6 100644 (file)
@@ -16,6 +16,8 @@
 
 /* Define a simple binary API to control the feature */
 
+vl_api_version 0.1.0
+
 autoreply define sample_macswap_enable_disable {
     /* Client identifier, set from api_main.my_client_index */
     u32 client_index;
index a0de24a..19f007a 100644 (file)
@@ -19,6 +19,7 @@
     used to control the ACL plugin
 */
 
+vl_api_version 1.0.0
 
 /** \brief Get the plugin version
     @param client_index - opaque cookie to identify the sender
index d43f8a3..5ded450 100644 (file)
@@ -13,6 +13,8 @@
  * limitations under the License.
  */
 
+vl_api_version 1.0.0
+
 /** \brief DPDK interface HQoS pipe profile set request
     @param client_index - opaque cookie to identify the sender
     @param context - sender context, to match reply w/ request
index 3f8c583..5bfe451 100644 (file)
@@ -5,6 +5,8 @@
     used to control the flowprobe plugin
 */
 
+vl_api_version 1.0.0
+
 /** \brief Enable / disable per-packet IPFIX recording on an interface
     @param client_index - opaque cookie to identify the sender
     @param context - sender context, to match reply w/ request
index 55ba039..fea4791 100644 (file)
@@ -13,6 +13,8 @@
  * limitations under the License.
  */
 
+vl_api_version 1.0.0
+
 /** \brief Set or delete an GTPU tunnel
     @param client_index - opaque cookie to identify the sender
     @param context - sender context, to match reply w/ request
index caa97e6..3637ae8 100644 (file)
@@ -14,6 +14,8 @@
  * limitations under the License.
  */
 
+vl_api_version 1.0.0
+
 /* Define a simple binary API to control the feature */
 
 autoreply define vxlan_gpe_ioam_export_enable_disable {
index bb83056..47a8cc0 100644 (file)
@@ -14,6 +14,8 @@
  * limitations under the License.
  */
 
+vl_api_version 1.0.0
+
 /* Define a simple binary API to control the feature */
 
 autoreply define ioam_export_ip6_enable_disable {
index dd9c018..c953b67 100644 (file)
@@ -14,6 +14,8 @@
  * limitations under the License.
  */
 
+vl_api_version 1.0.0
+
 /*  API to control ioam caching */
 
 autoreply define ioam_cache_ip6_enable_disable {
index c377cde..d1bfe44 100644 (file)
@@ -14,6 +14,7 @@
  * limitations under the License.
  */
 
+vl_api_version 1.0.0
 
 /** \brief Proof of Transit(POT): Set POT profile
     @param id - id of the profile 
index 2f45c6e..59d664a 100644 (file)
@@ -14,6 +14,7 @@
  * limitations under the License.
  */
 
+vl_api_version 1.0.0
 
 /** \brief iOAM6 Trace - Set the iOAM6 trace profile
     @param trace_type - Type of trace requested
index a6761f0..dfaecff 100644 (file)
@@ -14,6 +14,7 @@
  * limitations under the License.
  */
 
+vl_api_version 1.0.0
 
 /** \brief iOAM Over VxLAN-GPE - Set iOAM transport for VxLAN-GPE
     @param client_index - opaque cookie to identify the sender
index 8794581..6a5a6e6 100644 (file)
@@ -14,6 +14,7 @@
  * limitations under the License.
  */
 
+vl_api_version 1.0.0
 
 /** \brief UDP-Probe Add/Delete request 
     @param src_ip_address - Source ipv4/v6 address for the udp-ping flow
index 32cc669..7f48666 100644 (file)
@@ -1,3 +1,5 @@
+vl_api_version 1.0.0
+
 /** \brief Configure Load-Balancer global parameters
     @param client_index - opaque cookie to identify the sender
     @param context - sender context, to match reply w/ request
index c9632d1..08d056f 100644 (file)
@@ -13,6 +13,8 @@
  * limitations under the License.
  */
 
+vl_api_version 1.0.0
+
 /** \brief Create memory interface
     @param client_index - opaque cookie to identify the sender
     @param context - sender context, to match reply w/ request
index d7a4a9e..8418757 100644 (file)
@@ -12,6 +12,9 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
+vl_api_version 1.0.0
+
 /**
  * @file nat.api
  * @brief VPP control-plane API messages.
index e8cd989..78982f3 100644 (file)
@@ -13,6 +13,8 @@
  * limitations under the License.
  */
 
+vl_api_version 1.0.0
+
 /** \brief Set or delete an PPPOE session
     @param client_index - opaque cookie to identify the sender
     @param context - sender context, to match reply w/ request
index 52bb65c..5c5d46f 100644 (file)
@@ -33,11 +33,12 @@ void generate (YYSTYPE);
  YYSTYPE add_vector_vbl(YYSTYPE, YYSTYPE);
  YYSTYPE add_variable_length_vector_vbl(YYSTYPE, YYSTYPE);
  YYSTYPE set_flags(YYSTYPE, YYSTYPE);
+ YYSTYPE add_version(YYSTYPE, YYSTYPE, YYSTYPE);
 %}
 
 %token NAME RPAR LPAR SEMI LBRACK RBRACK NUMBER PRIMTYPE BARF
 %token TPACKED DEFINE LCURLY RCURLY STRING UNION
-%token HELPER_STRING COMMA 
+%token HELPER_STRING COMMA DOT VL_API_VERSION
 %token NOVERSION MANUAL_PRINT MANUAL_ENDIAN TYPEONLY DONT_TRACE AUTOREPLY
 
 %%
@@ -51,6 +52,7 @@ slist:          slist stmt            {$$ = add_slist ($1, $2);}
 
 stmt:     flist defn            {$$ = set_flags($1, $2);}
         | defn                  {$$ = $1;}
+        | api_version           {$$ = $1;}
           ;
 
 flist:    flist flag            {$$ = (YYSTYPE)(unsigned long)
@@ -89,3 +91,6 @@ vbl:      NAME                      {$$ = add_scalar_vbl($1);}
         | NAME LBRACK NUMBER RBRACK {$$ = add_vector_vbl($1, $3);}
         | NAME LBRACK NAME RBRACK {$$ = add_variable_length_vector_vbl($1, $3);}
           ;
+
+api_version:  VL_API_VERSION NUMBER DOT NUMBER DOT NUMBER 
+                                    {$$ = add_version ($2, $4, $6);}
index e635814..d9f82c2 100644 (file)
@@ -581,6 +581,9 @@ static int yylex_1 (void)
         case ',':
             return (COMMA);
 
+        case '.':
+            return (DOT);
+
         case '"':
             nameidx = 0;
             the_lexer_state = STRING_STATE;
@@ -937,6 +940,8 @@ int yylex (void)
     case TYPEONLY:           code = 278; break;
     case DONT_TRACE:         code = 279; break;
     case AUTOREPLY:          code = 280; break;
+    case DOT:                code = 281; break;
+    case VL_API_VERSION:     code = 282; break;
         
     case EOF: code = ~0; break; /* hysterical compatibility */
 
@@ -996,6 +1001,7 @@ static struct keytab {
     {"u8",             NODE_U8},
     {"union",           NODE_UNION},
     {"uword",           NODE_UWORD},
+    {"vl_api_version",         NODE_VERSION},
 };
  
 static int name_check (const char *s, YYSTYPE *token_value)
@@ -1061,6 +1067,9 @@ static int name_check (const char *s, YYSTYPE *token_value)
             case NODE_NOVERSION:
                 return(NOVERSION);
 
+            case NODE_VERSION:
+                return(VL_API_VERSION);
+
             case NODE_UNION:
                 return(UNION);
 
index 4c85a11..37ba493 100644 (file)
@@ -832,6 +832,22 @@ node_vft_t node_noversion_vft = {
     0,
 };
 
+void node_version_print (node_t *this)
+{
+    primtype_recursive_print (this, "version ");
+}
+
+void node_version_generate (node_t *this, enum passid which, FILE *ofp)
+{
+    fprintf(stderr, "node_version_generate called...\n");
+}
+
+node_vft_t node_version_vft = {
+    node_version_print,
+    node_version_generate,
+    0,
+};
+
 void node_uword_print (node_t *this)
 {
     primtype_recursive_print(this, "uword ");
@@ -866,6 +882,7 @@ node_vft_t *the_vft[NODE_N_TYPES] = {
     &node_vector_vft,
     &node_complex_vft,
     &node_noversion_vft,
+    &node_version_vft,
     &node_uword_vft,
 };
 
@@ -1133,7 +1150,8 @@ void generate_top_boilerplate(FILE *fp)
     fprintf (fp, "#if defined(vl_msg_id)||defined(vl_union_id)||");
     fprintf (fp, "defined(vl_printfun) \\\n ||defined(vl_endianfun)||");
     fprintf (fp, " defined(vl_api_version)||defined(vl_typedefs) \\\n");
-    fprintf (fp, " ||defined(vl_msg_name)||defined(vl_msg_name_crc_list)\n");
+    fprintf (fp, " ||defined(vl_msg_name)||defined(vl_msg_name_crc_list) \\\n");
+    fprintf (fp, " ||defined(vl_api_version_tuple)\n");
     fprintf (fp, "/* ok, something was selected */\n");
     fprintf (fp, "#else\n");
     fprintf (fp, "#warning no content included from %s\n", input_filename);
@@ -1144,7 +1162,8 @@ void generate_top_boilerplate(FILE *fp)
 void generate_bottom_boilerplate(FILE *fp)
 
 {
-    fprintf (fp, "\n#ifdef vl_api_version\n");
+    fprintf(fp, "/****** API CRC (whole file) *****/\n\n");
+    fprintf (fp, "#ifdef vl_api_version\n");
 
     if (dont_output_version) {
         fprintf (fp, "/* WARNING: API FILE VERSION CHECK DISABLED */\n");
@@ -1153,6 +1172,7 @@ void generate_bottom_boilerplate(FILE *fp)
 
     fprintf (fp, "vl_api_version(%s, 0x%08x)\n\n", 
              fixed_name, (unsigned int)input_crc);
+
     fprintf (fp, "#endif\n\n");
 }
 
@@ -1416,6 +1436,20 @@ void add_msg_ids(YYSTYPE a1)
     }
 }
 
+/*
+ * add_scalar_vbl (char *name)
+ */
+YYSTYPE add_version (YYSTYPE a1, YYSTYPE a2, YYSTYPE a3)
+{
+    node_t *np;
+
+    np = make_node(NODE_VERSION);
+    np->data[0] = (void *) a1;
+    np->data[1] = (void *) a2;
+    np->data[2] = (void *) a3;
+    return ((YYSTYPE) np);
+}
+
 void generate_python_msg_definitions(YYSTYPE a1, FILE *fp)
 {
     node_t *np = (node_t *)a1;
@@ -1517,6 +1551,26 @@ void generate_json(YYSTYPE a1, FILE *fp)
     fprintf (fp, "}\n");
 }
 
+void generate_version_tuple(YYSTYPE a1, FILE *fp)
+{
+    node_t *this = (node_t *)a1;
+
+    fprintf(fp, "/****** Version tuple *****/\n\n");
+
+    fprintf(fp, "#ifdef vl_api_version_tuple\n\n");
+
+    /* Walk the top-level node-list */
+    while (this) {
+        if (this->type == NODE_VERSION) {
+            fprintf (fp, "vl_api_version_tuple(%s, %d, %d, %d)\n",
+                     fixed_name, IDATA0, IDATA1, IDATA2);
+        }
+        this = this->peer;
+    }
+
+    fprintf(fp, "\n#endif /* vl_api_version_tuple */\n\n");
+}
+
 void generate(YYSTYPE a1)
 {
     if (dump_tree) {
@@ -1535,6 +1589,7 @@ void generate(YYSTYPE a1)
         generate_uniondefs(a1, ofp);
         generate_printfun(a1, ofp);
         generate_endianfun(a1, ofp);
+        generate_version_tuple(a1, ofp);
         
         generate_bottom_boilerplate(ofp);
     }
index 65bd5d1..58570d8 100644 (file)
@@ -44,6 +44,7 @@ enum node_subclass {  /* WARNING: indices must match the vft... */
     NODE_VECTOR,
     NODE_COMPLEX,
     NODE_NOVERSION,
+    NODE_VERSION,
     NODE_UWORD,
     NODE_N_TYPES,  /* number of node types with VFT's */
 
@@ -77,10 +78,15 @@ typedef struct node_ {
 
 /* To shut up gcc-4.2.x warnings */
 #define CDATA0 ((char *)(this->data[0]))
-#define IDATA1 ((int)(uword)(this->data[1]))
+#define CDATA1 ((char *)(this->data[0]))
 #define CDATA2 ((char *)(this->data[2]))
 #define CDATA3 ((char *)(this->data[3]))
 
+#define IDATA0 ((int)(uword)(this->data[0]))
+#define IDATA1 ((int)(uword)(this->data[1]))
+#define IDATA2 ((int)(uword)(this->data[2]))
+#define IDATA3 ((int)(uword)(this->data[3]))
+
 #define NODE_FLAG_MANUAL_PRINT (1<<0)
 #define NODE_FLAG_MANUAL_ENDIAN (1<<1)
 #define NODE_FLAG_TYPEONLY (1<<3)
index 49f5d5f..6820a54 100644 (file)
@@ -114,6 +114,8 @@ vl_api_trace_t *vl_msg_api_trace_get (api_main_t * am,
                                      vl_api_trace_which_t which);
 void vl_msg_api_add_msg_name_crc (api_main_t * am, const char *string,
                                  u32 id);
+void vl_msg_api_add_version (api_main_t * am, const char *string,
+                            u32 major, u32 minor, u32 patch);
 /* node_serialize.c prototypes */
 u8 *vlib_node_serialize (vlib_node_main_t * nm, u8 * vector,
                         u32 max_threads, int include_nexts,
index 845199e..56b036d 100644 (file)
@@ -186,6 +186,14 @@ typedef struct _vl_msg_api_init_function_list_elt
   vl_msg_api_init_function_t *f;
 } _vl_msg_api_function_list_elt_t;
 
+typedef struct
+{
+  u32 major;
+  u32 minor;
+  u32 patch;
+  char name[64];
+} api_version_t;
+
 /** API main structure, used by both vpp and binary API clients */
 typedef struct
 {
@@ -312,6 +320,9 @@ typedef struct
   /** client message index hash table */
   uword *msg_index_by_name_and_crc;
 
+  /** api version list */
+  api_version_t *api_version_list;
+
   /** Shared VM binary API region name */
   const char *region_name;
 
index 27898c3..831e863 100644 (file)
@@ -915,6 +915,15 @@ vl_msg_api_add_msg_name_crc (api_main_t * am, const char *string, u32 id)
   hash_set_mem (am->msg_index_by_name_and_crc, string, id);
 }
 
+void
+vl_msg_api_add_version (api_main_t * am, const char *string,
+                       u32 major, u32 minor, u32 patch)
+{
+  api_version_t version = {.major = major,.minor = minor,.patch = patch };
+  ASSERT (strlen (string) < 64);
+  strncpy (version.name, string, 64);
+  vec_add1 (am->api_version_list, version);
+}
 
 /*
  * fd.io coding-style-patch-verification: ON
index 94c99ad..6d6a1fe 100644 (file)
@@ -14,6 +14,8 @@
  * limitations under the License.
  */
 
+vl_api_version 1.0.0
+
 /*
  * Create a client registration 
  */
@@ -98,6 +100,27 @@ define get_first_msg_id_reply {
     u16 first_msg_id;
 };
 
+/*
+ * Get API version table (includes built-in and plugins)
+ */
+typeonly define module_version {
+  u32 major;
+  u32 minor;
+  u32 patch;
+  u8 name[64];
+};
+define api_versions {
+  u32 client_index;
+  u32 context;
+};
+define api_versions_reply {
+  u32 client_index;
+  u32 context;
+  i32 retval;
+  u32 count;
+  vl_api_module_version_t api_versions[count];
+};
+
 /*
  * Trace the plugin message-id allocator
  * so we stand a chance of dealing with different sets of plugins
index 2242abc..c3aef65 100644 (file)
@@ -470,12 +470,48 @@ vl_api_memclnt_keepalive_t_handler (vl_api_memclnt_keepalive_t * mp)
   vl_msg_api_send_shmem (shmem_hdr->vl_input_queue, (u8 *) & rmp);
 }
 
+void
+vl_api_api_versions_t_handler (vl_api_api_versions_t * mp)
+{
+  api_main_t *am = &api_main;
+  vl_api_api_versions_reply_t *rmp;
+  unix_shared_memory_queue_t *q;
+  u32 nmsg = vec_len (am->api_version_list);
+  int msg_size = sizeof (*rmp) + sizeof (rmp->api_versions[0]) * nmsg;
+  int i;
+
+  q = vl_api_client_index_to_input_queue (mp->client_index);
+  if (q == 0)
+    return;
+
+  rmp = vl_msg_api_alloc (msg_size);
+  memset (rmp, 0, msg_size);
+  rmp->_vl_msg_id = ntohs (VL_API_API_VERSIONS_REPLY);
+
+  /* fill in the message */
+  rmp->context = mp->context;
+  rmp->count = htonl (nmsg);
+
+  for (i = 0; i < nmsg; ++i)
+    {
+      api_version_t *vl = &am->api_version_list[i];
+      rmp->api_versions[i].major = htonl (vl->major);
+      rmp->api_versions[i].minor = htonl (vl->minor);
+      rmp->api_versions[i].patch = htonl (vl->patch);
+      strncpy ((char *) rmp->api_versions[i].name, vl->name, 64);
+    }
+
+  vl_msg_api_send_shmem (q, (u8 *) & rmp);
+
+}
+
 #define foreach_vlib_api_msg                            \
 _(MEMCLNT_CREATE, memclnt_create)                       \
 _(MEMCLNT_DELETE, memclnt_delete)                       \
 _(GET_FIRST_MSG_ID, get_first_msg_id)                   \
 _(MEMCLNT_KEEPALIVE, memclnt_keepalive)                 \
-_(MEMCLNT_KEEPALIVE_REPLY, memclnt_keepalive_reply)
+_(MEMCLNT_KEEPALIVE_REPLY, memclnt_keepalive_reply)    \
+_(API_VERSIONS, api_versions)
 
 /*
  * vl_api_init
index 7bcaa4c..1c5c578 100644 (file)
@@ -13,6 +13,8 @@
  * limitations under the License.
  */
 
+vl_api_version 1.0.0
+
 /** \brief Set BFD echo source
     @param client_index - opaque cookie to identify the sender
     @param context - sender context, to match reply w/ request
index cacb9be..de9de77 100644 (file)
@@ -13,6 +13,8 @@
  * limitations under the License.
  */
 
+vl_api_version 1.0.0
+
 /** \brief Add/Delete classification table request
     @param client_index - opaque cookie to identify the sender
     @param context - sender context, to match reply w/ request
index 6931600..a11b451 100644 (file)
@@ -13,6 +13,8 @@
  * limitations under the License.
  */
 
+vl_api_version 1.0.0
+
  /** \brief cop: enable/disable junk filtration features on an interface
     @param client_index - opaque cookie to identify the sender
     @param context - sender context, to match reply w/ request
index 8d40ad6..f815042 100644 (file)
@@ -13,6 +13,8 @@
  * limitations under the License.
  */
 
+vl_api_version 1.0.0
+
 /** \brief Create host-interface
     @param client_index - opaque cookie to identify the sender
     @param context - sender context, to match reply w/ request
index 8dc698b..d2de033 100644 (file)
@@ -13,6 +13,8 @@
  * limitations under the License.
  */
 
+vl_api_version 1.0.0
+
 /** \brief Create netmap
     @param client_index - opaque cookie to identify the sender
     @param context - sender context, to match reply w/ request
index 28d5e89..6f21cb6 100644 (file)
@@ -13,6 +13,8 @@
  * limitations under the License.
  */
 
+vl_api_version 1.0.0
+
 /** \brief vhost-user interface create request
     @param client_index - opaque cookie to identify the sender
     @param is_server - our side is socket server
index c632c08..628b674 100644 (file)
@@ -13,6 +13,8 @@
  * limitations under the License.
  */
 
+vl_api_version 1.0.0
+
 /** \brief DHCP Proxy config add / del request
     @param client_index - opaque cookie to identify the sender
     @param context - sender context, to match reply w/ request
index 8fb6637..ead7cab 100644 (file)
@@ -13,6 +13,8 @@
  * limitations under the License.
  */
 
+vl_api_version 1.0.0
+
 define p2p_ethernet_add
 {
   u32 client_index;
index 1c5e8c5..6c49428 100644 (file)
@@ -13,6 +13,8 @@
  * limitations under the License.
  */
 
+vl_api_version 1.0.0
+
 /** \brief Configure IPFIX exporter process request
     @param client_index - opaque cookie to identify the sender
     @param context - sender context, to match reply w/ request
index 28f6dbc..1091835 100644 (file)
@@ -13,6 +13,8 @@
  * limitations under the License.
  */
 
+vl_api_version 1.0.0
+
 define gre_add_del_tunnel
 {
   u32 client_index;
index 94ecdd9..2f2e837 100644 (file)
@@ -1,3 +1,5 @@
+vl_api_version 1.0.0
+
 /** \brief Set flags on the interface
     @param client_index - opaque cookie to identify the sender
     @param context - sender context, to match reply w/ request
index 4b7019f..69ab701 100644 (file)
@@ -19,6 +19,8 @@
     called through a shared memory interface. 
 */
 
+vl_api_version 1.0.0
+
 /** \brief Add / del table request
            A table can be added multiple times, but need be deleted only once.
     @param client_index - opaque cookie to identify the sender
index 793bca0..ad6ec4e 100644 (file)
@@ -13,6 +13,8 @@
  * limitations under the License.
  */
 
+vl_api_version 1.0.0
+
 /** \brief Add / del ipsec gre tunnel request
     @param client_index - opaque cookie to identify the sender
     @param context - sender context, to match reply w/ request
index 4e283b6..14d6c18 100644 (file)
@@ -13,6 +13,8 @@
  * limitations under the License.
  */
 
+vl_api_version 1.0.0
+
 /** \brief IPsec: Add/delete Security Policy Database
     @param client_index - opaque cookie to identify the sender
     @param context - sender context, to match reply w/ request
index ac923de..1838365 100644 (file)
@@ -14,6 +14,8 @@
  * limitations under the License.
  */
 
+vl_api_version 1.0.0
+
 /** \brief Reply to l2_xconnect_dump 
     @param context - sender context which was passed in the request
     @param rx_sw_if_index - Receive interface index
index 4587a80..1ccf71b 100644 (file)
@@ -13,6 +13,8 @@
  * limitations under the License.
  */
 
+vl_api_version 1.0.0
+
 /** \brief l2tpv3 tunnel interface create request
     @param client_index - opaque cookie to identify the sender
     @param context - sender context, to match reply w/ request
index 8bed71b..7ec17d9 100644 (file)
@@ -13,6 +13,8 @@
  * limitations under the License.
  */
 
+vl_api_version 1.0.0
+
 typeonly manual_print manual_endian define local_locator
 {
   u32 sw_if_index;
index 39f2802..6cb2ef3 100644 (file)
@@ -13,6 +13,8 @@
  * limitations under the License.
  */
 
+vl_api_version 1.0.0
+
 typeonly manual_print manual_endian define one_local_locator
 {
   u32 sw_if_index;
index 07ee3d7..626038f 100644 (file)
@@ -13,6 +13,8 @@
  * limitations under the License.
  */
 
+vl_api_version 1.0.0
+
 /** \brief GPE locator structure
     @param is_ip4 - whether addr is IPv4 or v6
     @param weight - locator weight
index 02fe32c..8117ed4 100644 (file)
@@ -13,6 +13,8 @@
  * limitations under the License.
  */
 
+vl_api_version 1.0.0
+
 /** \brief configure global parameter for LLDP
     @param client_index - opaque cookie to identify the sender
     @param context - sender context, to match reply w/ request
index 4b142c8..14f10e7 100644 (file)
@@ -13,6 +13,7 @@
  * limitations under the License.
  */
 
+vl_api_version 1.0.0
 
 /** \brief Add MAP domains
     @param client_index - opaque cookie to identify the sender
index 36488d0..3c817db 100644 (file)
@@ -13,6 +13,8 @@
  * limitations under the License.
  */
 
+vl_api_version 1.0.0
+
 /** \brief Bind/Unbind an MPLS local label to an IP prefix. i.e. create
            a per-prefix label entry.
     @param client_index - opaque cookie to identify the sender
index 26c6903..13024dd 100644 (file)
@@ -13,6 +13,8 @@
  * limitations under the License.
  */
 
+vl_api_version 1.0.0
+
 /** \brief Add/del policer
     @param client_index - opaque cookie to identify the sender
     @param context - sender context, to match reply w/ request
index 30d2ae9..992a063 100644 (file)
@@ -12,7 +12,9 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
+vl_api_version 1.0.0
+
 /** \brief client->vpp, attach application to session layer
     @param client_index - opaque cookie to identify the sender
     @param context - sender context, to match reply w/ request
index 03cd60e..a0f2915 100644 (file)
@@ -14,6 +14,8 @@
  * limitations under the License.
  */
 
+vl_api_version 1.0.0
+
  /** \brief Enable/Disable span to mirror traffic from one interface to another
     @param client_index - opaque cookie to identify the sender
     @param context - sender context which was passed in the request
index 9e90074..2c72cc5 100644 (file)
@@ -1,3 +1,4 @@
+/* Hey Emacs use -*- mode: C -*- */
 /*
  * Copyright (c) 2015-2016 Cisco and/or its affiliates.
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,6 +14,8 @@
  * limitations under the License.
  */
 
+vl_api_version 1.0.0
+
 /** \brief IPv6 SR LocalSID add/del request
     @param client_index - opaque cookie to identify the sender
     @param context - sender context, to match reply w/ request
@@ -20,7 +23,8 @@
     @param localsid_addr IPv6 address of the localsid
     @param end_psp Boolean of whether decapsulation is allowed in this function
     @param behavior Type of behavior (function) for this localsid
-    @param sw_if_index Only for L2/L3 xconnect. OIF. In VRF variant the fib_table.
+    @param sw_if_index Only for L2/L3 xconnect. OIF. In VRF variant the
+     fib_table.
     @param vlan_index Only for L2 xconnect. Outgoing VLAN tag.
     @param fib_table  FIB table in which we should install the localsid entry
     @param nh_addr Next Hop IPv4/IPv6 address. Only for L2/L3 xconnect.
@@ -161,7 +165,7 @@ autoreply define sr_steering_add_del
 };*/
 
 /*
- * fd.io coding-style-patch-verification: ON
+ * fd.io coding-style-patch-verification: OFF
  * Local Variables:
  * eval: (c-set-style "gnu")
  * End:
index d9fba37..6b1b2b4 100644 (file)
@@ -19,6 +19,8 @@
     the Linux kernel TAP device driver
 */
 
+vl_api_version 1.0.0
+
 /** \brief Initialize a new tap interface with the given paramters 
     @param client_index - opaque cookie to identify the sender
     @param context - sender context, to match reply w/ request
index 04082d6..6391148 100644 (file)
@@ -13,6 +13,8 @@
  * limitations under the License.
  */
 
+vl_api_version 1.0.0
+
 define vxlan_gpe_add_del_tunnel
 {
   u32 client_index;
index 6c331a5..64850f0 100644 (file)
@@ -13,7 +13,9 @@
  * limitations under the License.
  */
 
- define vxlan_add_del_tunnel
+vl_api_version 1.0.0
+
+define vxlan_add_del_tunnel
 {
   u32 client_index;
   u32 context;
index 5d4a63b..7350936 100644 (file)
@@ -2445,6 +2445,11 @@ setup_message_id_table (api_main_t * am)
   foreach_vl_msg_name_crc_memclnt;
   foreach_vl_msg_name_crc_vpe;
 #undef _
+
+#define vl_api_version_tuple(n,mj, mi, p) \
+  vl_msg_api_add_version (am, #n, mj, mi, p);
+#include <vpp/api/vpe_all_api_h.h>
+#undef vl_api_version_tuple
 }
 
 
index b8e5818..f0f6f41 100644 (file)
@@ -19,6 +19,8 @@
     called through a shared memory interface. 
 */
 
+vl_api_version 1.0.0
+
 /* 
  * Note: API placement cleanup in progress
  * If you're looking for interface APIs, please
index caf8f51..ec1ca66 100644 (file)
@@ -18,6 +18,7 @@
     This file defines the stats API 
 */
 
+vl_api_version 1.0.0
 
 /** \brief Want Stats, enable/disable ALL stats updates
     @param client_index - opaque cookie to identify the sender