return FALSE;
break;
}
+
+ cf_callback_invoke(cf_cb_live_capture_update_started, capture_opts->cf);
+ } else {
+ cf_callback_invoke(cf_cb_live_capture_fixed_started, capture_opts->cf);
}
- cf_callback_invoke(cf_cb_live_capture_started, capture_opts->cf);
return TRUE;
}
if(capture_opts->real_time_mode) {
+ /* first of all, we are not doing a capture any more */
+ cf_callback_invoke(cf_cb_live_capture_update_finished, capture_opts->cf);
+
/* Read what remains of the capture file, and finish the capture.
XXX - do something if this fails? */
switch (cf_finish_tail(capture_opts->cf, &err)) {
}
} else {
+ /* first of all, we are not doing a capture any more */
+ cf_callback_invoke(cf_cb_live_capture_fixed_finished, capture_opts->cf);
+
/* this is a normal mode capture, read in the capture file data */
capture_input_read_all(capture_opts, cf_is_tempfile(capture_opts->cf),
cf_get_drops_known(capture_opts->cf), cf_get_drops(capture_opts->cf));
}
- /* if we have captured some packets, call cf_cb_live_capture_finished! */
- /* (otherwise we already have called cf_close) */
- if(cf_packet_count(capture_opts->cf) != 0) {
- cf_callback_invoke(cf_cb_live_capture_finished, capture_opts->cf);
- }
-
/* We're not doing a capture any more, so we don't have a save file. */
g_assert(capture_opts->save_file);
g_free(capture_opts->save_file);
cf_cb_file_read_finished,
#ifdef HAVE_LIBPCAP
cf_cb_live_capture_prepare,
- cf_cb_live_capture_started,
- cf_cb_live_capture_finished,
+ cf_cb_live_capture_update_started,
+ cf_cb_live_capture_fixed_started,
+ cf_cb_live_capture_update_finished,
+ cf_cb_live_capture_fixed_finished,
#endif
cf_cb_packet_selected,
cf_cb_packet_unselected,
void
statusbar_push_file_msg(gchar *msg)
{
+ /*g_warning("statusbar_push: %s", msg);*/
gtk_statusbar_push(GTK_STATUSBAR(info_bar), file_ctx, msg);
}
void
statusbar_pop_file_msg(void)
{
+ /*g_warning("statusbar_pop");*/
gtk_statusbar_pop(GTK_STATUSBAR(info_bar), file_ctx);
}
}
static void
-main_cf_cb_live_capture_started(capture_options *capture_opts)
+main_cf_cb_live_capture_update_started(capture_options *capture_opts)
{
gchar *capture_msg;
}
static void
-main_cf_cb_live_capture_finished(capture_file *cf)
+main_cf_cb_live_capture_fixed_started(capture_options *capture_opts)
+{
+ gchar *capture_msg;
+
+ /* 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);*/
+
+ if(capture_opts->iface) {
+ capture_msg = g_strdup_printf(" %s: <live capture in progress>", get_interface_descriptive_name(capture_opts->iface));
+ } else {
+ capture_msg = g_strdup_printf(" <live capture in progress>");
+ }
+
+ statusbar_push_file_msg(capture_msg);
+
+ g_free(capture_msg);
+
+ /* Set up main window for a capture file. */
+/* main_set_for_capture_file(TRUE);*/
+ /* XXX: shouldn't be already set */
+ main_set_for_capture_file(FALSE);
+}
+
+static void
+main_cf_cb_live_capture_update_finished(capture_file *cf)
{
/* Pop the "<live capture in progress>" message off the status bar. */
statusbar_pop_file_msg();
/* Set up main window for a capture file. */
main_set_for_capture_file(TRUE);
}
+
+static void
+main_cf_cb_live_capture_fixed_finished(capture_file *cf)
+{
+ /* Pop the "<live capture in progress>" message off the status bar. */
+ statusbar_pop_file_msg();
+
+ /*set_display_filename(cf);*/
+
+ /* Enable menu items that make sense if you're not currently running
+ a capture. */
+ set_menus_for_capture_in_progress(FALSE);
+
+ /* Enable menu items that make sense if you have a capture file
+ you've finished reading. */
+ set_menus_for_capture_file(TRUE);
+ set_menus_for_unsaved_capture_file(!cf->user_saved);
+
+ /* Set up main window for a capture file. */
+ main_set_for_capture_file(TRUE);
+}
#endif
static void
case(cf_cb_live_capture_prepare):
main_cf_cb_live_capture_prepare(data);
break;
- case(cf_cb_live_capture_started):
- main_cf_cb_live_capture_started(data);
+ case(cf_cb_live_capture_update_started):
+ main_cf_cb_live_capture_update_started(data);
+ break;
+ case(cf_cb_live_capture_fixed_started):
+ main_cf_cb_live_capture_fixed_started(data);
+ break;
+ case(cf_cb_live_capture_update_finished):
+ main_cf_cb_live_capture_update_finished(data);
break;
- case(cf_cb_live_capture_finished):
- main_cf_cb_live_capture_finished(data);
+ case(cf_cb_live_capture_fixed_finished):
+ main_cf_cb_live_capture_fixed_finished(data);
break;
#endif
case(cf_cb_packet_selected):