misc: move part of vpe apis to vlibmemory
[vpp.git] / src / vpp / api / vpe.api
index 7c466b9..3c4c021 100644 (file)
 /** \file
 
     This file defines vpe control-plane API messages which are generally
-    called through a shared memory interface. 
+    called through a shared memory interface.
 */
 
-option version = "1.4.0";
+option version = "1.7.0";
 
-/* 
+import "vpp/api/vpe_types.api";
+
+/*
  * Note: API placement cleanup in progress
  * If you're looking for interface APIs, please
  * see .../src/vnet/{interface.api,interface_api.c}
@@ -30,7 +32,6 @@ option version = "1.4.0";
  * GENEVE APIs: see .../src/vnet/geneve/{geneve.api, geneve_api.c}
  * LLDP APIs: see .../src/vnet/lldp/{lldp.api, lldp_api.c}
  * AF-PACKET APIs: see ... /vnet/devices/af_packet/{af_packet.api, af_packet_api.c}
- * NETMAP APIs: see ... /src/vnet/devices/netmap/{netmap.api, netmap_api.c}
  * VHOST-USER APIs: see .../vnet/devices/virtio/{vhost_user.api, vhost_user_api.c}
  * VXLAN GPE APIs: see .../src/vnet/vxlan-gpe/{vxlan_gpe.api, vxlan_gpe_api.c}
  * GRE APIs: see .../src/vnet/gre/{gre.api, gre_api.c}
@@ -48,7 +49,8 @@ option version = "1.4.0";
  * DHCP APIs: see ... /src/vnet/dhcp/{dhcp.api, dhcp_api.c}
  * COP APIs: see ... /src/vnet/cop/{cop.api, cop_api.c}
  * POLICER APIs: see ... /src/vnet/policer/{policer.api, policer_api.c}
- * BIER APIs: see ... /src/vnet/policer/{bier.api, bier_api.c}
+ * BIER APIs: see ... /src/vnet/policer/{bier.api, bier_api.c}.
+ * flow APIs: see .../vnet/vnet/flow/{flow.api, flow_api.c}
  */
 
 /** \brief Control ping from client to api server request
@@ -75,92 +77,6 @@ define control_ping_reply
   u32 vpe_pid;
 };
 
-/** \brief Process a vpe parser cli string request
-    @param client_index - opaque cookie to identify the sender
-    @param context - sender context, to match reply w/ request
-    @param cmd_in_shmem - pointer to cli command string
-*/
-define cli
-{
-  u32 client_index;
-  u32 context;
-  u64 cmd_in_shmem;
-};
-define cli_inband
-{
-  u32 client_index;
-  u32 context;
-  string cmd;
-};
-
-/** \brief vpe parser cli string response
-    @param context - sender context, to match reply w/ request
-    @param retval - return code for request
-    @param reply_in_shmem - Reply string from cli processing if any
-*/
-define cli_reply
-{
-  u32 context;
-  i32 retval;
-  u64 reply_in_shmem;
-};
-define cli_inband_reply
-{
-  u32 context;
-  i32 retval;
-  string reply;
-};
-
-/** \brief Get node index using name request
-    @param client_index - opaque cookie to identify the sender
-    @param context - sender context, to match reply w/ request
-    @param node_name[] - name of the node
-*/
-define get_node_index
-{
-  u32 client_index;
-  u32 context;
-  u8 node_name[64];
-};
-
-/** \brief Get node index using name request
-    @param context - sender context, to match reply w/ request
-    @param retval - return code for the request
-    @param node_index - index of the desired node if found, else ~0
-*/
-define get_node_index_reply
-{
-  u32 context;
-  i32 retval;
-  u32 node_index;
-};
-
-/** \brief Set the next node for a given node request
-    @param client_index - opaque cookie to identify the sender
-    @param context - sender context, to match reply w/ request
-    @param node_name[] - node to add the next node to
-    @param next_name[] - node to add as the next node
-*/
-define add_node_next
-{
-  u32 client_index;
-  u32 context;
-  u8 node_name[64];
-  u8 next_name[64];
-};
-
-/** \brief IP Set the next node for a given node response
-    @param context - sender context, to match reply w/ request
-    @param retval - return code for the add next node request
-    @param next_index - the index of the next node if success, else ~0
-*/
-define add_node_next_reply
-{
-  u32 context;
-  i32 retval;
-  u32 next_index;
-};
-
 /** \brief show version
     @param client_index - opaque cookie to identify the sender
     @param context - sender context, to match reply w/ request
@@ -182,202 +98,46 @@ define show_version_reply
 {
   u32 context;
   i32 retval;
-  string program [limit = 32];
-  string version [limit = 32];
-  string build_date [limit = 32];
-  string build_directory [limit = 256];
-};
-
-
-/** \brief show_threads display the information about vpp
-    threads running on system along with their process id,
-    cpu id, physical core and cpu socket.
-*/
-define show_threads
-{
-  u32 client_index;
-  u32 context;
-};
-
-/** \brief thread data
-    @param id - thread index
-    @param name - thread name i.e. vpp_main or vpp_wk_0
-    @param type - thread type i.e. workers or stats
-    @param pid - thread Process Id
-    @param cpu_id - thread pinned to cpu.
-    "CPUs or Logical cores are the number of physical cores times
-    the number of threads that can run on each core through
-    the use of hyperthreading." (from unix.stackexchange.com)
-    @param core - thread pinned to actual physical core.
-    @param cpu_socket - thread is running on which cpu socket.
-*/
-typeonly define thread_data
-{
-  u32 id;
-  u8 name[64];
-  u8 type[64];
-  u32 pid;
-  u32 cpu_id;
-  u32 core;
-  u32 cpu_socket;
-};
-
-/** \brief show_threads_reply
-    @param context - returned sender context, to match reply w/ request
-    @param retval - return code
-    @param count - number of threads in thread_data array
-    @param thread_data - array of thread data
-*/
-define show_threads_reply
-{
-  u32 context;
-  i32 retval;
-  u32 count;
-  vl_api_thread_data_t thread_data[count];
+  string program[32];
+  string version[32];
+  string build_date[32];
+  string build_directory[256];
 };
 
-define get_node_graph
-{
-  u32 client_index;
-  u32 context;
-};
-
-/** \brief get_node_graph_reply
-    @param context - returned sender context, to match reply w/ request
-    @param retval - return code
-    @param reply_in_shmem - result from vlib_node_serialize, in shared
-    memory. Process with vlib_node_unserialize, remember to switch
-    heaps and free the result.
-*/
-
-define get_node_graph_reply
-{
-  u32 context;
-  i32 retval;
-  u64 reply_in_shmem;
-};
-
-/** \brief Query relative index via node names
+/** \brief Show the current system timestamp.
     @param client_index - opaque cookie to identify the sender
     @param context - sender context, to match reply w/ request
-    @param node_name - name of node to find relative index from
-    @param next_name - next node from node_name to find relative index of
 */
-define get_next_index
+define show_vpe_system_time
 {
   u32 client_index;
   u32 context;
-  u8 node_name[64];
-  u8 next_name[64];
 };
 
-/** \brief Reply for get next node index
+/** \brief Reply for show vpe system time.
     @param context - sender context which was passed in the request
     @param retval - return value
-    @param next_index - index of the next_node
+    @param vpe_system_time - the time in seconds since epoch of the host system.
 */
-define get_next_index_reply
+define show_vpe_system_time_reply
 {
   u32 context;
   i32 retval;
-  u32 next_index;
-};
-
-enum log_level {
-  VPE_API_LOG_LEVEL_EMERG = 0,    /* emerg */
-  VPE_API_LOG_LEVEL_ALERT = 1,    /* alert */
-  VPE_API_LOG_LEVEL_CRIT = 2,     /* crit */
-  VPE_API_LOG_LEVEL_ERR = 3,      /* err  */
-  VPE_API_LOG_LEVEL_WARNING = 4,  /* warn */
-  VPE_API_LOG_LEVEL_NOTICE = 5,   /* notice */
-  VPE_API_LOG_LEVEL_INFO = 6,     /* info */
-  VPE_API_LOG_LEVEL_DEBUG = 7,    /* debug */
-  VPE_API_LOG_LEVEL_DISABLED = 8, /* disabled */
+  vl_api_timestamp_t vpe_system_time;
 };
 
 define log_dump {
   u32 client_index;
   u32 context;
-  f64 start_timestamp;
+  vl_api_timestamp_t start_timestamp;
 };
 
 define log_details {
   u32 context;
-  f64 timestamp_ticks;
+  vl_api_timestamp_t timestamp;
   vl_api_log_level_t level;
-  string timestamp [limit=24];
-  string msg_class [limit=32];
-  string message [limit=256];
-};
-
-/** \brief Show the current system timestamp.
-    @param client_index - opaque cookie to identify the sender
-    @param context - sender context, to match reply w/ request
-*/
-define show_vpe_system_time_ticks
-{
-  u32 client_index;
-  u32 context;
-};
-
-/** \brief Reply for show vpe system time ticks.
-    @param context - sender context which was passed in the request
-    @param retval - return value
-    @param vpe_system_time_ticks - the time in ticks of the host system.
-*/
-define show_vpe_system_time_ticks_reply
-{
-  u32 context;
-  i32 retval;
-  f64 vpe_system_time_ticks;
-};
-
-/** \brief f64 types are not standardized across the wire. Sense wire format in each direction by sending the f64 value 1.0.
-    @param client_index - opaque cookie to identify the sender
-    @param context - sender context, to match reply w/ request
-    @param f64_one - The constant of 1.0.  If you send a different value, expect an rv=VNET_API_ERROR_API_ENDIAN_FAILED.
-*/
-define get_f64_endian_value
-{
-  u32 client_index;
-  u32 context;
-  f64 f64_one [default=1.0];
-};
-
-/** \brief get_f64_endian_value reply message
-    @param context - sender context which was passed in the request
-    @param retval - return value - VNET_API_ERROR_API_ENDIAN_FAILED if f64_one != 1.0
-    @param f64_one_result - The value of 'f64 1.0'
-*/
-define get_f64_endian_value_reply
-{
-  u32 context;
-  u32 retval;
-  f64 f64_one_result;
-};
-
-/** \brief Verify f64 wire format by sending a value and receiving the value + 1.0
-    @param client_index - opaque cookie to identify the sender.
-    @param context - sender context, to match reply w/ request.
-    @param f64_value - The value you want to test.  Default: 1.0.
-*/
-define get_f64_increment_by_one
-{
-  u32 client_index;
-  u32 context;
-  f64 f64_value [default=1.0];
-};
-
-/** \brief get_f64_increment_by_one reply
-    @param client_index - opaque cookie to identify the sender.
-    @param context - sender context, to match reply w/ request.
-    @param f64_value - The input f64_value incremented by 1.0.
-*/
-define get_f64_increment_by_one_reply
-{
-  u32 context;
-  u32 retval;
-  f64 f64_value;
+  string msg_class[32];
+  string message[256];
 };
 
 /*