api: Implement log_dump/log_details
[vpp.git] / src / vpp / api / vpe.api
index 22b7f3e..bd6b9d5 100644 (file)
     called through a shared memory interface. 
 */
 
-option version = "1.0.0";
+option version = "1.3.0";
 
 /* 
  * Note: API placement cleanup in progress
  * If you're looking for interface APIs, please
  * see .../src/vnet/{interface.api,interface_api.c}
  * IP APIs: see .../src/vnet/ip/{ip.api, ip_api.c}
- * TAP APIs: see .../src/vnet/unix/{tap.api, tap_api.c}
  * VXLAN APIs: see .../src/vnet/vxlan/{vxlan.api, vxlan_api.c}
  * GENEVE APIs: see .../src/vnet/geneve/{geneve.api, geneve_api.c}
  * LLDP APIs: see .../src/vnet/lldp/{lldp.api, lldp_api.c}
@@ -39,7 +38,6 @@ option version = "1.0.0";
  * L2TP APIs: see .../src/vnet/l2tp/{l2tp.api, l2tp_api.c}
  * BFD APIs: see .../src/vnet/bfd/{bfd.api, bfd_api.c}
  * IPSEC APIs: see .../src/vnet/ipsec/{ipsec.api, ipsec_api.c}
- * IPSEC-GRE APIs: see .../src/vnet/ipsec-gre/{ipsec_gre.api, ipsec_gre_api.c}
  * LISP APIs: see .../src/vnet/lisp/{lisp.api, lisp_api.c}
  * LISP-GPE APIs: see .../src/vnet/lisp-gpe/{lisp_gpe.api, lisp_gpe_api.c}
  * SESSION APIs: .../vnet/session/{session.api session_api.c}
@@ -47,10 +45,9 @@ option version = "1.0.0";
  * SR APIs: see .../src/vnet/srv6/{sr.api, sr_api.c}
  * CLASSIFY APIs: see ... /src/vnet/classify/{classify.api, classify_api.c}
  * FLOW APIs: see ... /src/vnet/flow/{flow.api, flow_api.c}
- * DHCP APIs: see ... /src/vnet/dhcp/{dhcpk.api, dhcp_api.c}
+ * 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}
- * STATS APIs: see .../src/vpp/stats/{stats.api, stats.c}
  * BIER APIs: see ... /src/vnet/policer/{bier.api, bier_api.c}
  */
 
@@ -93,8 +90,7 @@ define cli_inband
 {
   u32 client_index;
   u32 context;
-  u32 length;
-  u8 cmd[length];
+  string cmd;
 };
 
 /** \brief vpe parser cli string response
@@ -112,8 +108,7 @@ define cli_inband_reply
 {
   u32 context;
   i32 retval;
-  u32 length;
-  u8 reply[length];
+  string reply;
 };
 
 /** \brief Get node index using name request
@@ -187,10 +182,58 @@ define show_version_reply
 {
   u32 context;
   i32 retval;
-  u8 program[32];
-  u8 version[32];
-  u8 build_date[32];
-  u8 build_directory[256];
+  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];
 };
 
 define get_node_graph
@@ -240,6 +283,55 @@ define get_next_index_reply
   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 */
+};
+
+define log_dump {
+  u32 client_index;
+  u32 context;
+  f64 start_timestamp;
+};
+
+define log_details {
+  u32 context;
+  f64 timestamp_ticks;
+  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;
+};
+
 /*
  * Local Variables:
  * eval: (c-set-style "gnu")