rename sync_mode to real_time_mode, as we using sync_mode all the time now, so the name is misleading
svn path=/trunk/; revision=13956
}
capture_opts->save_file = g_strdup(new_file);
- /* if we are in sync mode, open the new file */
- if(capture_opts->sync_mode) {
+ /* if we are in real-time mode, open the new file */
+ if(capture_opts->real_time_mode) {
/* The child process started a capture.
Attempt to open the capture file and set up to read it. */
switch(cf_start_tail(capture_opts->cf, capture_opts->save_file, is_tempfile, &err)) {
int err;
- if(capture_opts->sync_mode) {
+ if(capture_opts->real_time_mode) {
/* Read from the capture file the number of records the child told us
it added.
XXX - do something if this fails? */
int err;
- if(capture_opts->sync_mode) {
+ if(capture_opts->real_time_mode) {
/* 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)) {
gchar *save_file; /**< the capture file name */
/* GUI related */
- gboolean sync_mode; /**< Fork a child to do the capture,
- and sync between them */
+ gboolean real_time_mode;/**< Update list of packets in real time */
gboolean show_info; /**< show the info dialog */
gboolean quit_after_cap; /** Makes a "capture only mode". Implies -k */
#include <epan/dissectors/packet-ipfc.h>
#include <epan/dissectors/packet-arcnet.h>
+/* Win32 needs the O_BINARY flag for open() */
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
} else {
/* We couldn't open "iface" as a network device. */
#ifdef _WIN32
- /* On Windows, we don't support capturing on pipes, so we give up.
- If this is a child process that does the capturing in sync
- mode or fork mode, it shouldn't do any UI stuff until we pop up the
- capture-progress window, and, since we couldn't start the
- capture, we haven't popped it up. */
-
+ /* On Windows, we don't support capturing on pipes, so we give up. */
/* On Win32 OSes, the capture devices are probably available to all
users; don't warn about permissions problems.
if (capture_opts->save_file != NULL) {
- /* If the Sync option is set, we return to the caller while the capture
- * is in progress. Therefore we need to take a copy of save_file in
+ /* We return to the caller while the capture is in progress.
+ * Therefore we need to take a copy of save_file in
* case the caller destroys it after we return.
*/
capfile_name = g_strdup(capture_opts->save_file);
char errmsg[4096+1];
int save_file_fd;
- gboolean show_info = capture_opts->show_info || !capture_opts->sync_mode;
-
/* init the loop data */
ld.go = TRUE;
}
/* start capture info dialog */
- if(show_info) {
+ if(capture_opts->show_info) {
capture_ui.callback_data = &ld;
capture_ui.counts = &ld.counts;
capture_info_create(&capture_ui, capture_opts->iface);
}*/
/* calculate and display running time */
- if(show_info) {
+ if(capture_opts->show_info) {
cur_time -= start_time;
capture_ui.running_time = cur_time;
capture_ui.new_packets = ld.packets_sync_pipe;
} /* while (ld.go) */
/* close capture info dialog */
- if(show_info) {
+ if(capture_opts->show_info) {
capture_info_destroy(&capture_ui);
}
capture_opts->promisc_mode = TRUE; /* promiscuous mode is the default */
capture_opts->linktype = -1; /* the default linktype */
capture_opts->save_file = NULL;
- capture_opts->sync_mode = TRUE;
+ capture_opts->real_time_mode = TRUE;
capture_opts->show_info = TRUE;
capture_opts->quit_after_cap = FALSE;
g_warning("Promisc : %u", capture_opts->promisc_mode);
g_warning("LinkType : %d", capture_opts->linktype);
g_warning("SaveFile : %s", capture_opts->save_file);
- g_warning("SyncMode : %u", capture_opts->sync_mode);
+ g_warning("RealTimeMode : %u", capture_opts->real_time_mode);
g_warning("ShowInfo : %u", capture_opts->show_info);
g_warning("QuitAfterCap : %u", capture_opts->quit_after_cap);
capture_opts->has_snaplen = TRUE;
capture_opts->snaplen = get_positive_int(appname, optarg, "snapshot length");
break;
- case 'S': /* "Sync" mode: used for following file ala tail -f */
- capture_opts->sync_mode = TRUE;
+ case 'S': /* "Real-Time" mode: used for following file ala tail -f */
+ capture_opts->real_time_mode = TRUE;
break;
case 'w': /* Write to capture file xxx */
capture_opts->save_file = g_strdup(optarg);
sync_cb = CHECK_BUTTON_NEW_WITH_MNEMONIC(
"_Update list of packets in real time", accel_group);
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(sync_cb),
- capture_opts->sync_mode);
+ capture_opts->real_time_mode);
SIGNAL_CONNECT(sync_cb, "toggled", capture_prep_adjust_sensitivity, cap_open_w);
gtk_tooltips_set_tip(tooltips, sync_cb,
"Using this option will show the captured packets immediately on the main screen. "
time_unit_option_menu_get_value(stop_duration_om, capture_opts->autostop_duration);
}
- capture_opts->sync_mode =
+ capture_opts->real_time_mode =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(sync_cb));
auto_scroll_live =
capture_opts->autostop_files =
gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(stop_files_sb));
- if(capture_opts->sync_mode)
+ if(capture_opts->real_time_mode)
capture_opts->multi_files_on = FALSE;
if (capture_opts->multi_files_on) {
} else {
capture_opts->promisc_mode = prefs->capture_prom_mode;
capture_opts->show_info = prefs->capture_show_info;
- capture_opts->sync_mode = prefs->capture_real_time;
+ capture_opts->real_time_mode = prefs->capture_real_time;
auto_scroll_live = prefs->capture_auto_scroll;
}
if (capture_opts->multi_files_on) {
/* Ring buffer works only under certain conditions:
a) ring buffer does not work with temporary files;
- b) sync_mode and capture_opts->ringbuffer_on are mutually exclusive -
- sync_mode takes precedence;
+ b) real_time_mode and multi_files_on are mutually exclusive -
+ real_time_mode takes precedence;
c) it makes no sense to enable the ring buffer if the maximum
file size is set to "infinite". */
if (capture_opts->save_file == NULL) {
fprintf(stderr, "ethereal: Ring buffer requested, but capture isn't being saved to a permanent file.\n");
capture_opts->multi_files_on = FALSE;
}
-/* if (capture_opts->sync_mode) {
+/* if (capture_opts->real_time_mode) {
fprintf(stderr, "ethereal: Ring buffer requested, but an \"Update list of packets in real time\" capture is being done.\n");
capture_opts->multi_files_on = FALSE;
}*/