}
capture_opts->state = CAPTURE_STOPPED;
+ } else {
+ /* the capture child might not respond shortly after bringing it up */
+ /* (especially it will block, if no input coming from an input capture pipe (e.g. mkfifo) is coming in) */
+
+ /* to prevent problems, bring the main GUI into "capture mode" right after successfully */
+ /* spawn/exec the capture child, without waiting for any response from it */
+ cf_callback_invoke(cf_cb_live_capture_prepared, capture_opts);
}
return ret;
cf_cb_file_read_start,
cf_cb_file_read_finished,
#ifdef HAVE_LIBPCAP
+ cf_cb_live_capture_prepared,
cf_cb_live_capture_update_started,
cf_cb_live_capture_update_continue,
cf_cb_live_capture_update_finished,
#ifdef HAVE_LIBPCAP
static void
-main_cf_cb_live_capture_update_started(capture_options *capture_opts)
+main_cf_cb_live_capture_prepared(capture_options *capture_opts)
{
- gchar *capture_msg;
gchar *title;
a capture. */
set_menus_for_capture_in_progress(TRUE);
+ /* update statusbar */
+ statusbar_push_file_msg("Waiting for capture input data ...");
+
+ /* Don't set up main window for a capture file. */
+ main_set_for_capture_file(FALSE);
+}
+
+static void
+main_cf_cb_live_capture_update_started(capture_options *capture_opts)
+{
+ gchar *capture_msg;
+
+
/* Enable menu items that make sense if you have some captured
packets (yes, I know, we don't have any *yet*). */
set_menus_for_captured_packets(TRUE);
+ statusbar_pop_file_msg();
+
capture_msg = g_strdup_printf(" %s: <live capture in progress> to file: %s",
get_interface_descriptive_name(capture_opts->iface),
(capture_opts->save_file) ? capture_opts->save_file : "");
main_cf_cb_live_capture_fixed_started(capture_options *capture_opts)
{
gchar *capture_msg;
- gchar *title;
- title = g_strdup_printf("%s: Capturing - Ethereal",
- get_interface_descriptive_name(capture_opts->iface));
- set_main_window_name(title);
- g_free(title);
-
- /* Disable menu items that make no sense if you're currently running
- a capture. */
- set_menus_for_capture_in_progress(TRUE);
-
/* Enable menu items that make sense if you have some captured
packets (yes, I know, we don't have any *yet*). */
/*set_menus_for_captured_packets(TRUE);*/
+ statusbar_pop_file_msg();
+
capture_msg = g_strdup_printf(" %s: <live capture in progress> to file: %s",
get_interface_descriptive_name(capture_opts->iface),
(capture_opts->save_file) ? capture_opts->save_file : "");
main_cf_cb_file_read_finished(data);
break;
#ifdef HAVE_LIBPCAP
+ case(cf_cb_live_capture_prepared):
+ main_cf_cb_live_capture_prepared(data);
+ break;
case(cf_cb_live_capture_update_started):
main_cf_cb_live_capture_update_started(data);
break;