Type: fix
Currently ping stops on events like SOCKET_READ_EVENT,
which makes it hard to use over e.g. govpp as it aborts
immediately most of the time. With this patch, ping only
stops upon real CLI read / quit events.
Signed-off-by: Ivan Shvedunov <ivan4th@gmail.com>
Change-Id: Id7a8d0b0fdeb7bbc7b85240e398d27bd5199345b
#include <stddef.h>
#include <vlib/vlib.h>
+#include <vlib/unix/unix.h>
#include <vnet/fib/ip6_fib.h>
#include <vnet/fib/ip4_fib.h>
#include <vnet/fib/fib_sas.h>
}
}
break;
- default:
+ case UNIX_CLI_PROCESS_EVENT_READ_READY:
+ case UNIX_CLI_PROCESS_EVENT_QUIT:
/* someone pressed a key, abort */
vlib_cli_output (vm, "Aborted due to a keypress.");
goto double_break;
- break;
}
vec_free (event_data);
}
#undef _
-/** CLI session events. */
-typedef enum
-{
- UNIX_CLI_PROCESS_EVENT_READ_READY, /**< A file descriptor has data to be read. */
- UNIX_CLI_PROCESS_EVENT_QUIT, /**< A CLI session wants to close. */
-} unix_cli_process_event_type_t;
-
/** CLI session telnet negotiation timer events. */
typedef enum
{
} unix_main_t;
+/** CLI session events. */
+typedef enum
+{
+ UNIX_CLI_PROCESS_EVENT_READ_READY, /**< A file descriptor has data to be
+ read. */
+ UNIX_CLI_PROCESS_EVENT_QUIT, /**< A CLI session wants to close. */
+} unix_cli_process_event_type_t;
+
/* Global main structure. */
extern unix_main_t unix_main;
extern clib_file_main_t file_main;