Ping; report failures to the terminal
[vpp.git] / src / vnet / ip / ping.h
index 0af9d58..442ba73 100644 (file)
@@ -26,13 +26,18 @@ typedef enum
   PING_RESPONSE_IP4,
 } ping_response_type_t;
 
+#define foreach_ip46_ping_result                                      \
+  _ (OK, "OK")                                                        \
+  _ (ALLOC_FAIL, "packet allocation failed")                          \
+  _ (NO_INTERFACE, "no egress interface")                             \
+  _ (NO_TABLE, "no IPv6 Table for lookup")                            \
+  _ (NO_SRC_ADDRESS, "no source address for egress interface")        \
+
 typedef enum
 {
-  SEND_PING_OK = 0,
-  SEND_PING_ALLOC_FAIL,
-  SEND_PING_NO_INTERFACE,
-  SEND_PING_NO_TABLE,
-  SEND_PING_NO_SRC_ADDRESS,
+#define _(v, s) SEND_PING_##v,
+    foreach_ip46_ping_result
+#undef _
 } send_ip46_ping_result_t;
 
 /*
@@ -43,6 +48,7 @@ typedef struct ping_run_t
   u16 icmp_id;
   u16 curr_seq;
   uword cli_process_id;
+  uword cli_thread_index;
 } ping_run_t;
 
 typedef struct ping_main_t
@@ -55,7 +61,7 @@ typedef struct ping_main_t
   ping_run_t *ping_run_by_icmp_id;
 } ping_main_t;
 
-ping_main_t ping_main;
+extern ping_main_t ping_main;
 
 #define PING_DEFAULT_DATA_LEN 60
 #define PING_DEFAULT_INTERVAL 1.0