/* 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;
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
* 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
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
* 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
* 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 {
* 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 {
* limitations under the License.
*/
+vl_api_version 1.0.0
+
/* API to control ioam caching */
autoreply define ioam_cache_ip6_enable_disable {
* limitations under the License.
*/
+vl_api_version 1.0.0
/** \brief Proof of Transit(POT): Set POT profile
@param id - id of the profile
* 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
* 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
* 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
+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
* 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
* 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.
* 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
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
%%
stmt: flist defn {$$ = set_flags($1, $2);}
| defn {$$ = $1;}
+ | api_version {$$ = $1;}
;
flist: flist flag {$$ = (YYSTYPE)(unsigned long)
| 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);}
case ',':
return (COMMA);
+ case '.':
+ return (DOT);
+
case '"':
nameidx = 0;
the_lexer_state = STRING_STATE;
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 */
{"u8", NODE_U8},
{"union", NODE_UNION},
{"uword", NODE_UWORD},
+ {"vl_api_version", NODE_VERSION},
};
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);
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 ");
&node_vector_vft,
&node_complex_vft,
&node_noversion_vft,
+ &node_version_vft,
&node_uword_vft,
};
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);
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");
fprintf (fp, "vl_api_version(%s, 0x%08x)\n\n",
fixed_name, (unsigned int)input_crc);
+
fprintf (fp, "#endif\n\n");
}
}
}
+/*
+ * 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;
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) {
generate_uniondefs(a1, ofp);
generate_printfun(a1, ofp);
generate_endianfun(a1, ofp);
+ generate_version_tuple(a1, ofp);
generate_bottom_boilerplate(ofp);
}
NODE_VECTOR,
NODE_COMPLEX,
NODE_NOVERSION,
+ NODE_VERSION,
NODE_UWORD,
NODE_N_TYPES, /* number of node types with VFT's */
/* 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)
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,
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
{
/** 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;
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
* limitations under the License.
*/
+vl_api_version 1.0.0
+
/*
* Create a client registration
*/
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
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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* limitations under the License.
*/
+vl_api_version 1.0.0
+
define p2p_ethernet_add
{
u32 client_index;
* 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
* limitations under the License.
*/
+vl_api_version 1.0.0
+
define gre_add_del_tunnel
{
u32 client_index;
+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
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
* 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
* 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
* 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
* 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
* limitations under the License.
*/
+vl_api_version 1.0.0
+
typeonly manual_print manual_endian define local_locator
{
u32 sw_if_index;
* limitations under the License.
*/
+vl_api_version 1.0.0
+
typeonly manual_print manual_endian define one_local_locator
{
u32 sw_if_index;
* 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
* 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
* limitations under the License.
*/
+vl_api_version 1.0.0
/** \brief Add MAP domains
@param client_index - opaque cookie to identify the sender
* 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
* 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
* 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
* 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
+/* Hey Emacs use -*- mode: C -*- */
/*
* Copyright (c) 2015-2016 Cisco and/or its affiliates.
* Licensed under the Apache License, Version 2.0 (the "License");
* 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
@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.
};*/
/*
- * fd.io coding-style-patch-verification: ON
+ * fd.io coding-style-patch-verification: OFF
* Local Variables:
* eval: (c-set-style "gnu")
* End:
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
* limitations under the License.
*/
+vl_api_version 1.0.0
+
define vxlan_gpe_add_del_tunnel
{
u32 client_index;
* 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;
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
}
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
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