#define __plugin_msg_base arping_test_main.msg_id_base
#include <vlibapi/vat_helper_macros.h>
+#include <vlibmemory/vlib.api_types.h>
/* declare message IDs */
#include <vnet/format_fns.h>
#include <arping/arping.api_enum.h>
#include <arping/arping.api_types.h>
-#include <vpp/api/vpe.api_types.h>
#include <vnet/ip/ip_types_api.h>
typedef struct
#include <vnet/format_fns.h>
#include <geneve/geneve.api_enum.h>
#include <geneve/geneve.api_types.h>
-#include <vpp/api/vpe.api_types.h>
+#include <vlibmemory/vlib.api_types.h>
typedef struct
{
#include <vnet/format_fns.h>
#include <ikev2/ikev2.api_enum.h>
#include <ikev2/ikev2.api_types.h>
-#include <vpp/api/vpe.api_types.h>
+#include <vlibmemory/vlib.api_types.h>
#define vl_endianfun /* define message structures */
#include <plugins/ikev2/ikev2.api.h>
/* define message IDs */
#include <l2tp/l2tp.api_enum.h>
#include <l2tp/l2tp.api_types.h>
-#include <vpp/api/vpe.api_types.h>
+#include <vlibmemory/vlib.api_types.h>
typedef struct
{
#include <vnet/format_fns.h>
#include <lacp/lacp.api_enum.h>
#include <lacp/lacp.api_types.h>
-#include <vpp/api/vpe.api_types.h>
+#include <vlibmemory/vlib.api_types.h>
typedef struct
{
/* define message IDs */
#include <lisp/lisp-cp/lisp.api_enum.h>
#include <lisp/lisp-cp/lisp.api_types.h>
-#include <vpp/api/vpe.api_types.h>
+#include <vlibmemory/vlib.api_types.h>
typedef struct
{
/* define message IDs */
#include <lisp/lisp-cp/one.api_enum.h>
#include <lisp/lisp-cp/one.api_types.h>
-#include <vpp/api/vpe.api_types.h>
+#include <vlibmemory/vlib.api_types.h>
typedef struct
{
/* define message IDs */
#include <lisp/lisp-gpe/lisp_gpe.api_enum.h>
#include <lisp/lisp-gpe/lisp_gpe.api_types.h>
-#include <vpp/api/vpe.api_types.h>
+#include <vlibmemory/vlib.api_types.h>
typedef struct
{
#include <vnet/format_fns.h>
#include <memif/memif.api_enum.h>
#include <memif/memif.api_types.h>
-#include <vpp/api/vpe.api_types.h>
-//#include <vnet/ethernet/ethernet_types.api_types.h>
+#include <vlibmemory/vlib.api_types.h>
typedef struct
{
#include <vlibapi/vat_helper_macros.h>
/* Declare message IDs */
-#include <vpp/api/vpe.api_types.h>
#include <stn/stn.api_enum.h>
#include <stn/stn.api_types.h>
+#include <vlibmemory/vlib.api_types.h>
typedef struct
{
#include <vnet/format_fns.h>
#include <tracedump/graph.api_enum.h>
#include <tracedump/graph.api_types.h>
-#include <vpp/api/vpe.api_types.h>
+#include <vlibmemory/vlib.api_types.h>
typedef struct
{
/* declare message IDs */
#include <vmxnet3/vmxnet3.api_enum.h>
#include <vmxnet3/vmxnet3.api_types.h>
-#include <vpp/api/vpe.api_types.h>
+#include <vlibmemory/vlib.api_types.h>
typedef struct
{
#include <vnet/format_fns.h>
#include <vrrp/vrrp.api_enum.h>
#include <vrrp/vrrp.api_types.h>
-#include <vpp/api/vpe.api_types.h>
-
+#include <vlibmemory/vlib.api_types.h>
typedef struct
{
#define vl_typedefs /* define message structures */
#include <vlibmemory/vl_memory_api_h.h>
-#include <vpp/api/vpe_types.api.h>
-#include <vpp/api/vpe.api.h>
+#include <vlibmemory/vlib.api_types.h>
+#include <vlibmemory/vlib.api.h>
#undef vl_typedefs
#include "{module}.api_enum.h"
#define vl_api_bridge_domain_details_t_endian vl_noop_handler
#define vl_api_bridge_domain_details_t_print vl_noop_handler
-static void vl_api_control_ping_reply_t_handler
- (vl_api_control_ping_reply_t * mp)
-{
- vat_main_t *vam = &vat_main;
- i32 retval = ntohl (mp->retval);
- if (vam->async_mode)
- {
- vam->async_errors += (retval < 0);
- }
- else
- {
- vam->retval = retval;
- vam->result_ready = 1;
- }
- if (vam->socket_client_main)
- vam->socket_client_main->control_pings_outstanding--;
-}
-
-static void vl_api_control_ping_reply_t_handler_json
- (vl_api_control_ping_reply_t * mp)
-{
- vat_main_t *vam = &vat_main;
- i32 retval = ntohl (mp->retval);
-
- if (VAT_JSON_NONE != vam->json_tree.type)
- {
- vat_json_print (vam->ofp, &vam->json_tree);
- vat_json_free (&vam->json_tree);
- vam->json_tree.type = VAT_JSON_NONE;
- }
- else
- {
- /* just print [] */
- vat_json_init_array (&vam->json_tree);
- vat_json_print (vam->ofp, &vam->json_tree);
- vam->json_tree.type = VAT_JSON_NONE;
- }
-
- vam->retval = retval;
- vam->result_ready = 1;
-}
-
-
static void vl_api_get_first_msg_id_reply_t_handler
(vl_api_get_first_msg_id_reply_t * mp)
{
#define foreach_vpe_api_reply_msg \
_ (GET_FIRST_MSG_ID_REPLY, get_first_msg_id_reply) \
- _ (CONTROL_PING_REPLY, control_ping_reply) \
_ (SHOW_VERSION_REPLY, show_version_reply) \
#define foreach_standalone_reply_msg \
#ifndef included_vat2_helpers_h
#define included_vat2_helpers_h
+#include <vlibmemory/vlib.api_types.h>
+
/* For control ping */
#define vl_endianfun
-#include <vpp/api/vpe.api.h>
+#include <vlibmemory/vlib.api.h>
#undef vl_endianfun
static inline void
f64 f64_value;
};
+/** \brief Control ping from client to api server request
+ @param client_index - opaque cookie to identify the sender
+ @param context - sender context, to match reply w/ request
+*/
+define control_ping
+{
+ u32 client_index;
+ u32 context;
+};
+
+/** \brief Control ping from the client to the server response
+ @param client_index - opaque cookie to identify the sender
+ @param context - sender context, to match reply w/ request
+ @param retval - return code for the request
+ @param vpe_pid - the pid of the vpe, returned by the server
+*/
+define control_ping_reply
+{
+ u32 context;
+ i32 retval;
+ u32 client_index;
+ u32 vpe_pid;
+};
+
/*
* Local Variables:
* eval: (c-set-style "gnu")
}));
}
+static void
+vl_api_control_ping_t_handler (vl_api_control_ping_t *mp)
+{
+ vl_api_control_ping_reply_t *rmp;
+ int rv = 0;
+
+ REPLY_MACRO2 (VL_API_CONTROL_PING_REPLY,
+ ({ rmp->vpe_pid = ntohl (getpid ()); }));
+}
+
#include <vlibmemory/vlib.api.c>
static clib_error_t *
vlib_apis_hookup (vlib_main_t *vm)
msg_id_base = setup_message_id_table ();
am->is_mp_safe[VL_API_GET_NODE_GRAPH] = 1;
+ am->is_mp_safe[VL_API_CONTROL_PING] = 1;
+ am->is_mp_safe[VL_API_CONTROL_PING_REPLY] = 1;
return 0;
}
return ret;
}
+static void
+vl_api_control_ping_reply_t_handler (vl_api_control_ping_reply_t *mp)
+{
+ vat_main_t *vam = &vat_main;
+ i32 retval = ntohl (mp->retval);
+ if (vam->async_mode)
+ {
+ vam->async_errors += (retval < 0);
+ }
+ else
+ {
+ vam->retval = retval;
+ vam->result_ready = 1;
+ }
+ if (vam->socket_client_main)
+ vam->socket_client_main->control_pings_outstanding--;
+}
+
+static int
+api_control_ping (vat_main_t *vam)
+{
+ // not yet implemented
+ return -1;
+}
+
#define VL_API_LOCAL_SETUP_MESSAGE_ID_TABLE local_setup_message_id_table
static void
local_setup_message_id_table (vat_main_t *vam)
/* Declare message IDs */
#include <vnet/arp/arp.api_enum.h>
#include <vnet/arp/arp.api_types.h>
-#include <vpp/api/vpe.api_types.h>
+#include <vlibmemory/vlib.api_types.h>
static int
api_proxy_arp_dump (vat_main_t * vam)
#include <vnet/format_fns.h>
#include <vnet/ip/ip.api_enum.h>
#include <vnet/ip/ip.api_types.h>
+#include <vlibmemory/vlib.api_types.h>
#define vl_endianfun /* define message structures */
#include <vnet/ip/ip.api.h>
/* define message IDs */
#include <ip6-nd/ip6_nd.api_enum.h>
#include <ip6-nd/ip6_nd.api_types.h>
-#include <vpp/api/vpe.api_types.h>
+#include <vlibmemory/vlib.api_types.h>
typedef struct
{
#include "vppapiclient.h"
#include "stat_client.h"
+#include <vlibmemory/vlib.api_enum.h>
+#include <vlibmemory/vlib.api_types.h>
+
#define vl_typedefs /* define message structures */
#include <vpp/api/vpe_all_api_h.h>
#undef vl_typedefs
#include <vlibapi/api_common.h>
#include <vlibmemory/memory_client.h>
+#include <vapi/vlib.api.vapi.h>
#include <vapi/memclnt.api.vapi.h>
/* we need to use control pings for some stuff and because we're forced to put
vapi_msg_id_t vapi_msg_id_control_ping_reply = 0;
DEFINE_VAPI_MSG_IDS_MEMCLNT_API_JSON;
-DEFINE_VAPI_MSG_IDS_VPE_API_JSON;
+DEFINE_VAPI_MSG_IDS_VLIB_API_JSON;
struct
{
print("#ifdef __cplusplus")
print("extern \"C\" {")
print("#endif")
- if name == "vpe.api.vapi.h":
+ if name == "vlib.api.vapi.h":
print("")
print("static inline vapi_error_e vapi_send_with_control_ping "
"(vapi_ctx_t ctx, void * msg, u32 context);")
else:
- print("#include <vapi/vpe.api.vapi.h>")
+ print("#include <vapi/vlib.api.vapi.h>")
print("")
for m in parser.messages_by_json[j].values():
print("extern vapi_msg_id_t %s;" % m.get_msg_id_name())
print("")
- if name == "vpe.api.vapi.h":
+ if name == "vlib.api.vapi.h":
print("%s" % vapi_send_with_control_ping)
print("")
#include <vlibapi/api_helper_macros.h>
#define foreach_vpe_api_msg \
- _ (CONTROL_PING, control_ping) \
_ (SHOW_VERSION, show_version) \
_ (SHOW_VPE_SYSTEM_TIME, show_vpe_system_time) \
_ (LOG_DUMP, log_dump)
VL_MSG_API_REAPER_FUNCTION (memclnt_delete_callback);
-static void
-vl_api_control_ping_t_handler (vl_api_control_ping_t * mp)
-{
- vl_api_control_ping_reply_t *rmp;
- int rv = 0;
-
- /* *INDENT-OFF* */
- REPLY_MACRO2(VL_API_CONTROL_PING_REPLY,
- ({
- rmp->vpe_pid = ntohl (getpid());
- }));
- /* *INDENT-ON* */
-}
-
static void
vl_api_show_version_t_handler (vl_api_show_version_t * mp)
{
/*
* Thread-safe API messages
*/
- am->is_mp_safe[VL_API_CONTROL_PING] = 1;
- am->is_mp_safe[VL_API_CONTROL_PING_REPLY] = 1;
am->is_mp_safe[VL_API_IP_ROUTE_ADD_DEL] = 1;
/*
* flow APIs: see .../vnet/vnet/flow/{flow.api, flow_api.c}
*/
-/** \brief Control ping from client to api server request
- @param client_index - opaque cookie to identify the sender
- @param context - sender context, to match reply w/ request
-*/
-define control_ping
-{
- u32 client_index;
- u32 context;
-};
-
-/** \brief Control ping from the client to the server response
- @param client_index - opaque cookie to identify the sender
- @param context - sender context, to match reply w/ request
- @param retval - return code for the request
- @param vpe_pid - the pid of the vpe, returned by the server
-*/
-define control_ping_reply
-{
- u32 context;
- i32 retval;
- u32 client_index;
- u32 vpe_pid;
-};
-
/** \brief show version
@param client_index - opaque cookie to identify the sender
@param context - sender context, to match reply w/ request